diff options
Diffstat (limited to 'extensions/BugModal/web')
-rw-r--r-- | extensions/BugModal/web/bug_modal.js | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/extensions/BugModal/web/bug_modal.js b/extensions/BugModal/web/bug_modal.js index 27d8eb01b..5a04709ec 100644 --- a/extensions/BugModal/web/bug_modal.js +++ b/extensions/BugModal/web/bug_modal.js @@ -324,25 +324,30 @@ $(function() { hasFlash = localStorage.getItem('hasFlash'); } if (hasFlash) { - ZeroClipboard.config({ flashLoadTimeout: 5000 }); - var zero = new ZeroClipboard($('#copy-summary')); - zero.on({ - 'ready': function(event) { - $('#copy-summary').show(); - localStorage.setItem('hasFlash', true); - }, - 'error': function(event) { - console.log(event.message); - zero.destroy(); - $('#global-zeroclipboard-html-bridge').remove(); - $('#copy-summary').hide(); - localStorage.removeItem('hasFlash'); - }, - 'copy': function(event) { - var clipboard = event.clipboardData; - clipboard.setData('text/plain', clipboardSummary()); - } - }); + var s = document.createElement("script"); + s.onload = function () { + ZeroClipboard.config({ flashLoadTimeout: 5000 }); + var zero = new ZeroClipboard($('#copy-summary')); + zero.on({ + 'ready': function(event) { + $('#copy-summary').show(); + localStorage.setItem('hasFlash', true); + }, + 'error': function(event) { + console.log(event.message); + zero.destroy(); + $('#global-zeroclipboard-html-bridge').remove(); + $('#copy-summary').hide(); + localStorage.removeItem('hasFlash'); + }, + 'copy': function(event) { + var clipboard = event.clipboardData; + clipboard.setData('text/plain', clipboardSummary()); + } + }); + }; + s.src = "extensions/BugModal/web/ZeroClipboard/ZeroClipboard.min.js"; + document.getElementsByTagName('head')[0].appendChild(s); } } } |