Zocky's javascript tools

Search Box is a Javascript tool which adds a search and replace box above the editbox. users

Click the search icon in the toolbar or press Alt-Shift-F (or Meta-Shift-F) to get the SearchBox. See Installation below.

Features

Issues

Installation

Your four choices of Wikipedia skin at Special:Preferences, in the second tab (Appearance), each have there own "Custom JavaScript" file and "Custom CSS" file. (Those will be red links if that skin has not been modified from the original.) We will be using custom JavaScript. The custom JavaScript file ends in ".js". The Monobook skin, for example, links to Special:Mypage/monobook.js, and for the Classic skin you would be editing Special:Mypage/standard.js, etc.

Copy and paste the following line into the ".js" (JavaScript) file for your skin:

((subst:User:Zocky/searchBox))

Save the file. You will notice that this line is automatically substituted (replaced) when the file is saved, and new version is displayed, showing:

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>');

Those lines are the expected results of the earlier substitution, which is permanent. (There may be other parts not shown that are comments, starting with "//" characters, which may also install alongside their associated code.)

Now, the edit page will have over the top left of it "Search/Replace Toggle Case", two links which activate the JavaScript dialog box you just installed. If not, reload the page in your browser in the usual way, or clear your cache, and the new icon should appear.

To uninstall the script delete only the lines you saw above, or just "undo" from the page history. A new edit sessions will then not show the icon.

Code

The code is available under GPL at User:Zocky/SearchBox.js.