User:Zocky/Search Box

From Wikipedia, the free encyclopedia

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-F (or Meta-F) to get the SearchBox. See Installation below.

Contents


Image:Search Box.png

[edit] Features

  • Search and replace text back and forward.
  • Regular expressions
  • Replace all occurences of the search text in the editbox, or inside the selection.
  • Case sensitive and case insentive searches.

[edit] Issues

  • The tool overrides the "edit box has full width" setting in preferences, under editing. This will probably shrink your edit box in width. Unfortunately, it seems that it's necessary for the tool to be able to show the found text in the textbox. A partial workaround is to increase the number of columns under editing in Special:Preferences.
  • The found text may sometimes still be outside the edit box. Scroll up and down a bit to find it.

[edit] Installation

To install, you have to create (or edit) a file in your userspace. For most people, this is Special:Mypage/monobook.js.

(People using the classic skin should edit Special:Mypage/standard.js instead, and people using other skins probably know which file to edit.)

Edit that page and paste in this line:

{{subst:User:Zocky/SearchBox}}

which expands to

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

Clear your browser's cache and when you edit a page, the search box should appear above the edit box.

To uninstall the script, just delete those lines from your javascript file and clear your browser's cache.

[edit] Code

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