Changeset 2191422
- Timestamp:
- 11/13/2019 09:28:37 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
copy-code-to-clipboard/trunk/js/copy_code_script.js
r2189475 r2191422 1 1 jQuery( document ).ready(function() { 2 var copyButton = '<div class="btn-clipboard" title="" data-original-title="Copy to clipboard">Copy</div>'; 2 3 var copy_text_label = copyScript.copy_text_label; 4 var copied_text_label = copyScript.copied_text_label; 5 var copy_text_label_safari = copyScript.copy_text_label_safari; 6 var copy_text_label_other_browser = copyScript.copy_text_label_other_browser; 7 var copy_button_background = copyScript.copy_button_background; 8 var copy_button_text_color = copyScript.copy_button_text_color; 9 10 var copyButton = '<div class="btn-clipboard" style="color:'+copy_button_text_color+'; background-color:'+copy_button_background+';" title="" data-original-title="Copy to clipboard">'+copy_text_label+'</div>'; 3 11 jQuery('pre').each(function(){ 4 12 … … 25 33 copyCode.on('success', function(event) { 26 34 event.clearSelection(); 27 event.trigger.textContent = 'Copied';35 event.trigger.textContent = copied_text_label; 28 36 window.setTimeout(function() { 29 event.trigger.textContent = 'Copy';37 event.trigger.textContent = copy_text_label; 30 38 }, 2000); 31 39 /* $.Velocity(pasteContent, 'scroll', { … … 40 48 41 49 if (is_safari) { 42 event.trigger.textContent = 'Press "⌘ + C" to copy';50 event.trigger.textContent = copy_text_label_safari; 43 51 } 44 52 else if(navigator.userAgent.match(/ipad|ipod|iphone/i)){ 45 event.trigger.textContent = 'Press "Ctrl + C" to copy';53 event.trigger.textContent = copy_text_label_other_browser; 46 54 } 47 55 else{ 48 event.trigger.textContent = 'Press "Ctrl + C" to copy';56 event.trigger.textContent = copy_text_label_other_browser; 49 57 } 50 58 51 59 window.setTimeout(function() { 52 event.trigger.textContent = 'Copy';60 event.trigger.textContent = copy_text_label; 53 61 }, 5000); 54 62 });
Note: See TracChangeset
for help on using the changeset viewer.