Jump to content

User:Topaz/Wikiscripts

From Wikipedia, the free encyclopedia
The status changer box as a left-column panel.
The results of the section splitter with a CSS declaration in place to give each div a red border.

These are the Wikipedia-specific javascripts I have written. To use them, copy them to your own userspace and update your /monobook.js to have the proper includes (see mine) for them and their dependencies. Keep scripts that are depended upon above scripts that depend on them. Please discuss these scripts on my usertalk page.


If you like my wikiscripts, consider a userbox!

tzws This user uses Topaz's Wikiscripts.
tzws This user has enhanced userpage CSS available.


It seems that IE7 won't run some of my scripts, but it won't throw any errors either. It seems to ignore the three 'Script Debugger' settings in the options, too. Feel free to suggest a debugging strategy on my talk page. Might I suggest Firefox?


Updating

[edit]

I apologize for putting an obnoxious notice up for everyone, but I couldn't think of an easier way to notify people of the major changes I've made to the status changer script. To update, copy your configuration section someplace, overwrite your status changer with the copy I have here, and then put your configuration back. Your new version should have a slightly different code section and a version declaration on the top of the file. If you want to totally disable the changes notification (instead of disabling it until the version changes again), use your own copy of init instead and delete everything except the first line, var topaz = new Object();.

A complete set of installation instructions is on an external page.

Scripts

[edit]

The below tree is organized based on dependencies: scripts that are depended upon are the parents of scripts that depend on them. (That is, if you decide to use something, you will also need any scripts above it in the tree.) Function libraries (only useful if you're a wikiscripter yourself or you need them to run a module) are in blue, and Modules (scripts which most anyone might find useful and which require nearly zero javascript skill) are in orange.

  • monobook - A set of includes for any scripts you'd like to use.
  • init - Initialization for the rest of my scripts.
    • util - Basic utility functions: DOM manipulation, cross-browser object constructors, cookie management.
      • edit count util - Sends you to Interiot's javascript edit counter tool for a user if you right click on a link to their page, subpage, or talk page. Can be customized to instead use any tool that takes a Wikipedia username in its query string. Warning:Editcountitis can be fatal.
      • section splitter - Wraps each main section of every article you view with divs that the attribute class="tz-primarySection". While this isn't horribly useful on its own, it can be used with CSS to achieve interesting results.
      • user message changer - Lets you change the new message notice to any custom value.
      • enhanced userpage - Allows you to attach a full CSS document to your userpages and to see other users' userpages with their CSS document in effect, if any. See the manual for more information.
      • comm - A little XMLHttpRequest wrapper.
        • wputil - Wikipedia-specific utility functions: get the current user's username, alter the monobook ui, alter article contents in the background.
          • status changer - Adds a panel under 'toolbox' on the left side of your screen or a few buttons in your toolbar to update User:YourUserName/Status for Online, Busy, or Offline. Customizable to allow any number of statuses which each set your Status subpage to any value. Uses cookies to track the last status you set on your local machine and updates the toolbar and all transclusions of your Status subpage automatically, even on other tabs or windows.

Testcases

[edit]

enhanced userpage: either not installed, not active, or not working properly (wait until the page is fully loaded)

Todo

[edit]

If you have an idea for a script, please suggest it on my talk page. I don't know what people need or want unless they tell me!

See also: Wikipedia:WikiProject_User_scripts#Requests

  • Make sure multiple statuschangers play nicely together.
  • Look into writing a script that tells you if you have new messages without a page reload (use MediaWiki:Blank)
  • Add functionality to track the user's last set state with a cookie.
  • Una función similar a setpagecontent pero que lea la información de una página y la traiga a una variable. Algo así como getpagecontent. Saludos Axxgreazz (consultas?) 14:57, 10 October 2006 (UTC)
  • Make a tool to easily get http://toolserver.org/~interiot/cgi-bin/count_edits?dbname=enwiki_p&user= for a user; probably a template for RfA pages and a javascript module to put it in a user's toolbox that triggers from a user page link double click. (done, but uses right click and doesn't work in IE)
  • Change these scripts to work on any wiki (like Meta). (they already do; Essjay's mistake)
  • Add the ability to alter the personal bar (the links in the upper right on Monobook) to wputil. (already does; same xhtml!)
  • Add the option to put the statuschanger controls in the personal bar instead.
  • Add the option to keep your status page on your watchlist.