User:MacHershell/Javascripts

From Wikibooks, open books for an open world
Jump to: navigation, search
User:MacHershellAZH.gif
User talk:MacHershellSpeech balloon.svg
R
L
P
MacHershell Discussion

(Create) monobook.js 

My master stylesheet, handles the includes for all the other scripts listed below.

(Create) convert.js 

Enables conversion of units between metric and standard. Adds a link to the toolbox to "Convert Units", and then performs the conversions on all associated templates.

(Create) links.js 

Creates a link to "edit top" (to edit section 0 of a page), and also adds a link to my book foundry in my personal links.

(Create) switcher.js 

Adds my skin to the stylesheet, and produces a link in the toolbox to switch back to the regular monobook skin. Switching does not work correctly in IE, and has only been tested to work in firefox. In IE, it would be better to import the skin directly in the CSS then to use javascript to do it because of the additional load time.

(Create) query.js 

Enables text values to be passed in the query string.

(Create) books.js 

This javascript is used to operate a number of special editing tools, especially those on My Book Creator (Create) . To install this script, open your common.js file and type:
import_script('User:MacHershell/books.js');
After you have loaded the script in your personal javascript file, you need to refresh the page, usually by pressing CTRL + F5.

(Create) remotetalk.js 

Allows me to check the contents of my talk pages on other projects from Wikibooks. To install, you need to import the code into your local user javascript:

import_script('User:MacHershell/remotetalk.js');

Then you need to create a 2-D array named "Alias" to contain the parameters:

var Alias = new Array(
  [LANG, PROJECT, USERNAME, LINKNAME],
  [LANG, PROJECT, USERNAME, LINKNAME],
  ...);

The LANG is the 2 or 3 letter language code (such as "en"). PROJECT is the name of the project using all lower-case letters. The URL is created by:

LANG.PROJECT.org

so if you want to make a link to a page at meta, you would say:

['meta', 'wikimedia', ...],

the USERNAME is your username on that project. LINKNAME is the words that you want to appear as the hyperlink. For instance, the following code:


var Alias = new Array(['en', 'wikipedia', 'TimmyWikibookian', 'Me at Wikipedia']);
import_script('User:MacHershell/remotetalk.js');

Will produce a link that says "Me At Wikipedia", and loads the page at en.wikipedia.org/wiki/User:TimmyWikibookian".


(Create) codeviewer.js 

Operates my code viewer gadget.

(Create) printversion.js 

Operates my print version gadget. To install and use this javascript, open your user monobook.js file and add this line:
import_script('User:MacHershell/printversion.js');

Then to place the gadget into a page, use the following template:

{{User:MacHershell/Print Version Gadget}}

(Create) pagetester.js 

Operates my page tester gadget.