MediaWiki:Common.js: Difference between revisions
Wiki admin (talk | contribs) (Created page with "→Any JavaScript here will be loaded for all users on every page load.: function copy_to_clipboard_2(text) { navigator.clipboard.writeText(text); alert("Copied: " + text); } function copy_to_clipboard(text) { btn = document.activeElement; navigator.clipboard.writeText(text); btn.value="📋Copied!"; //btn.style.backgroundColor = 'green'; //btn.style.color = 'white'; btn.style.color = 'blue'; } function code_box(text) { document.write("<pre>"); d...") |
Wiki admin (talk | contribs) No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
function copy_to_clipboard_2(text) { | (function copy_to_clipboard_2(text) { | ||
navigator.clipboard.writeText(text); | navigator.clipboard.writeText(text); | ||
alert("Copied: " + text); | alert("Copied: " + text); | ||
} | }()); | ||
function copy_to_clipboard(text) { | (function copy_to_clipboard(text) { | ||
btn = document.activeElement; | btn = document.activeElement; | ||
navigator.clipboard.writeText(text); | navigator.clipboard.writeText(text); | ||
Line 13: | Line 13: | ||
//btn.style.color = 'white'; | //btn.style.color = 'white'; | ||
btn.style.color = 'blue'; | btn.style.color = 'blue'; | ||
} | }()); | ||
function code_box(text) { | (function code_box(text) { | ||
document.write("<pre>"); | document.write("<pre>"); | ||
document.write(text); | document.write(text); | ||
document.write("</pre>"); | document.write("</pre>"); | ||
document.write("<br/>"); | document.write("<br/>"); | ||
} | }()); |
Revision as of 19:06, 15 September 2022
/* Any JavaScript here will be loaded for all users on every page load. */ (function copy_to_clipboard_2(text) { navigator.clipboard.writeText(text); alert("Copied: " + text); }()); (function copy_to_clipboard(text) { btn = document.activeElement; navigator.clipboard.writeText(text); btn.value="📋Copied!"; //btn.style.backgroundColor = 'green'; //btn.style.color = 'white'; btn.style.color = 'blue'; }()); (function code_box(text) { document.write("<pre>"); document.write(text); document.write("</pre>"); document.write("<br/>"); }());