Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 JavaScript  



1.1  statusChanger  





1.2  watchlistSorter  





1.3  viewSource  







2 pywikipedia scripts  





3 MediaWiki template stuff  














User:Misza13/Scripts

















User page
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
User contributions
User logs
View user groups
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

< User:Misza13
(Redirected from User:Misza13/Scripts/Status switcher)

This user is a member of the
User scripts WikiProject.

JavaScript[edit]

statusChanger[edit]

This module will add 3 new links beside the "log out" link. These will be "in", "busy" and "out" for quickly changing your current Wikipedia status.

To enable this, first add the following line to your monobook file:

importScript('User:Misza13/statusChanger.js');

Additionally, you'll need two additional pages:

  1. Special:Mypage/Status
  2. Special:Mypage/StatusTemplate

The first one is the one modified by the script to hold {{User:Example/StatusTemplate|STATUS}}, where "STATUS" will be one of "in", "busy", "out". Then it is up to the "Template" to render it the way you wish. An example is:

'''<div style="border: 1px solid black; background: white; float: right; position: relative; top: -30px; padding: 5px">
Example's status: {{ #switch: {{{1}}}
 | in=<span style="color: green;">IN</span>
 | busy=<span style="color: #FFAA00;">BUSY</span>
 | out=<span style="color: red;">OUT</span>
}}
</div>'''

You can tweak it to look whatever you like.

Then all you need is to put {{User:Example/Status}} on whatever pages you want the status to be displayed.

You can also define your own range of statuses using this statement (put it right after theimportScript statement):

statusChangerConfig = {
  statusList : [ 'in', 'busy', 'school', 'work', 'out' ],
};

Make sure your template knows how to handle these new values.

watchlistSorter[edit]

This tool that sorts your watchlist by namespace making it easier to browse for important edits - not recommended for people with thousands of pages watched. Not compatible with Internet Explorer. Not compatible with "Enhanced recent changes" option in Preferences.

To install it, add the following to your monobook:

if (mw.config.get('wgPageName') == 'Special:Watchlist') {
  importScript('User:Misza13/watchlistSorter.js');
}

viewSource[edit]

This code will create a new button called [view source] to the left of the [edit this page] button (unless you're already editing a page or the page is protected). Technically, it takes you to editing the page, but removes the interface (edit summary box, minor edit and watch checkboxes, save/preview/show changes buttons) below the editing box. This will prevent you from accidentally saving the page if you were just playing with the content.

To install it, add the following to your monobook:

importScript('User:Misza13/viewSource.js');

pywikipedia scripts[edit]

MediaWiki template stuff[edit]

Other random stuff I've created:


Retrieved from "https://en.wikipedia.org/w/index.php?title=User:Misza13/Scripts&oldid=1086837757"

Category: 
Wikipedia scripts
 



This page was last edited on 8 May 2022, at 17:24 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki