Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
This is a repository of various javascript tools that may be useful to you when editing and such. To get these tools, put the javascript in your user js (usually [[Special:Mypage/ | {{User:Ryan Schmidt/UserNav}}This is a repository of various javascript tools that may be useful to you when editing and such. To get these tools, put the javascript in your user js (usually [[Special:Mypage/BlueCloud.js]]), then clear your browser cache. | ||
== Edit section link for the top section == | |||
Adds an edit link that lets you section edit the very top section. | Adds an edit link that lets you section edit the very top section. | ||
<pre> | <pre> | ||
/ | /****************************************** | ||
** Add Section Edit link for top section ** | |||
******************************************/ | |||
if (wgAction == 'view' && wgNamespaceNumber >=0) | |||
addOnloadHook(function(){ | |||
var h2s = document.getElementsByTagName('H2'); | |||
var h2 = h2s[0]; | |||
if (!h2) return; | |||
if (h2.parentNode.id == 'toctitle') h2 = h2s[1]; | |||
if (!h2) return; | |||
var span = h2.firstChild; | |||
if (!span || span.className != 'editsection') return; | |||
var zero = span.cloneNode(true); | |||
if (document.getElementById('featured_icon')) zero.style.marginRight = '30px' | |||
var parent = document.getElementsByTagName('H1')[0]; | |||
parent.insertBefore(zero, parent.firstChild); | |||
var a = zero.getElementsByTagName('A')[0]; | |||
a.title = a.title.replace(/:.*$/,': 0'); | |||
a.setAttribute('href', a.href.replace(/§ion=1/,'§ion=0')); | |||
}) | |||
</pre> | </pre> | ||
== Auto-edit script == | |||
Enables an auto-clicking script | Enables an auto-clicking script | ||
<pre> | <pre> | ||
// | /******************** | ||
// | ** AutoEdit Script ** | ||
********************/ | |||
document.write('<script type="text/javascript" src=" \ | |||
http://en.wikipedia.org/w/index.php?title=User:Lupin/autoedit.js \ | |||
&action=raw&ctype=text/javascript&dontcountme=s"></script>'); | |||
</pre> | </pre> | ||
== Find-and-replace script == | |||
Enables a search-and-replace function for the edit box, including | Enables a search-and-replace function for the edit box, including regex search | ||
<pre> | <pre> | ||
/ | /**************************** | ||
/ | ** Find and Replace Script ** | ||
****************************/ | |||
document.write('<script type="text/javascript" src=" \ | |||
http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js \ | |||
&action=raw&ctype=text/javascript&dontcountme=s"></script>'); | |||
</pre> | </pre> | ||
== | == Edit Summary Extender == | ||
Adds a string of text when an edit summary is too short. I actually wrote this one by mahself <!-- for the most part, anyway... Splarka gave me the info that made it possible -->^_^ | |||
<pre> | <pre> | ||
/ | /******************************* | ||
** Edit Summary Extender v1.0 ** | |||
*******************************/ | |||
function check_edit_summary(event) { | |||
var summary=document.getElementById('wpSummary').value; | |||
if(summary.length<3) document.getElementById('wpSummary').value += '/* Edit Summary Extender v1.0 */'; | |||
} | |||
= | |||
< | |||
</pre> | </pre> | ||
== More? == | == More? == | ||
Want something that's not listed here? Try searching for it on Google or some other search engine and if you still can't find it, feel free to drop a message on my [[User talk: | Want something that's not listed here? Try searching for it on Google or some other search engine and if you still can't find it, feel free to drop a message on my [[User talk:Ryan Schmidt|talk page]] and I'll attempt to write it :) |