From 1ce369cd543d0e07bd6d8b2d2a719248cad0639a Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Mon, 31 Oct 2016 16:16:56 +0300 Subject: [PATCH] [DE] removed ZeroClipboard library --- apps/documenteditor/embed/index.html | 1 - .../embed/js/ApplicationController.js | 52 +++---------------- build/documenteditor.json | 16 ------ 3 files changed, 7 insertions(+), 62 deletions(-) diff --git a/apps/documenteditor/embed/index.html b/apps/documenteditor/embed/index.html index 5310c1d76..6c91ed543 100644 --- a/apps/documenteditor/embed/index.html +++ b/apps/documenteditor/embed/index.html @@ -319,7 +319,6 @@ - diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 9722a92dd..b7b9d15c1 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -61,16 +61,6 @@ var ApplicationController = new(function(){ } - // Initialize ZeroClipboard - // ------------------------- - - ZeroClipboard.setMoviePath('../../../vendor/ZeroClipboard/ZeroClipboard10.swf'); - var clipShortUrl = new ZeroClipboard.Client(); - var clipEmbedObj = new ZeroClipboard.Client(); - clipShortUrl.zIndex = maxZIndex; - clipEmbedObj.zIndex = maxZIndex; - - // Utils // ------------------------- @@ -315,6 +305,13 @@ var ApplicationController = new(function(){ handlerToolbarSize(); hidePreloader(); + function _copytext(el, event) { + el.select(); + if ( !document.execCommand('copy') ) { + window.alert('Browser\'s error! Use keyboard shortcut [Ctrl] + [C]'); + } + } + Common.Analytics.trackEvent('Load', 'Complete'); } @@ -556,41 +553,6 @@ var ApplicationController = new(function(){ var documentMoveTimer; - // Initialize clipboard objects - - clipShortUrl.addEventListener('mousedown', function() { - if ($('#id-btn-copy-short').hasClass('copied')) - return; - - $('#id-btn-copy-short').button('copied'); - $('#id-btn-copy-short').addClass('copied'); - - clipShortUrl.setText($('#id-short-url').val()); - - setTimeout(function(){ - $('#id-btn-copy-short').button('reset'); - $('#id-btn-copy-short').removeClass('copied'); - }, 2000); - }); - - clipEmbedObj.addEventListener('mousedown', function(){ - if ($('#id-btn-copy-embed').hasClass('copied')) - return; - - $('#id-btn-copy-embed').button('copied'); - $('#id-btn-copy-embed').addClass('copied'); - - clipEmbedObj.setText($('#id-textarea-embed').text()); - - setTimeout(function(){ - $('#id-btn-copy-embed').button('reset'); - $('#id-btn-copy-embed').removeClass('copied'); - }, 2000); - }); - - clipShortUrl.glue('id-btn-copy-short'); - clipEmbedObj.glue('id-btn-copy-embed'); - // popover ui handlers diff --git a/build/documenteditor.json b/build/documenteditor.json index dda5f5306..ad1e7faa7 100644 --- a/build/documenteditor.json +++ b/build/documenteditor.json @@ -483,21 +483,6 @@ "dest": "../deploy/web-apps/vendor/requirejs/require.js" } }, - "zeroclipboard": { - "clean": [ - "../deploy/web-apps/vendor/ZeroClipboard" - ], - "copy": { - "script": { - "expand": true, - "cwd": "../vendor/ZeroClipboard/", - "src": [ - "**" - ], - "dest": "../deploy/web-apps/vendor/ZeroClipboard/" - } - } - }, "obf_api": { "ccvars": "../../sdkjs/word/variable.map", "ccprops": "../../sdkjs/word/property.map", @@ -535,7 +520,6 @@ "deploy-touch", "deploy-jquery", "deploy-underscore", - "deploy-zeroclipboard", "deploy-bootstrap", "deploy-jszip", "deploy-jsziputils",