Help:Gadget-EnhancedPOTY.js

From Wikimedia Commons, the free media repository
(Redirected from Help:EnhancedPOTY.js)
Jump to navigation Jump to search
A screenshot showing the App as of 2012 on a Gallery Page

This is the documentation for MediaWiki:Gadget-EnhancedPOTY.js and MediaWiki:Gadget-EnhancedPOTY.css. It was written in 2 weeks and therefore will need a lot of additional work meaning that changes may follow.

Features[edit]

  • Eligibility check (cross-wiki, SUL) and saving the result
    • On a limited time-span
    • Including or excluding deleted contributions
  • Dynamic resizing of thumbnail images and saving the last used size
  • Automatic language detection for new users on Commons
  • Randomization of the images in the gallery using the username as a seed (so each user will get the same order when visiting the same gallery)
  • Button to invoke the Slideshow
  • My Poty (The POTY "control center")
  • Adding and removing votes

How it works[edit]

  • First run / one time:
    • Comparing selected user language on Commons (default is en) with the browser's language and adjusting if appropriate
    • Query SUL information (edit count, active wikis)
    • Query some metainformation about the Wikimedia Server Cluster to guess URLs of the APIs
    • Checking local contribution count in the selected timeframe
    • Checking contribution count in the selected timeframe on other wikis if not locally eligible: First those with most edits, then those with less edits
    • Saving the result found to the browser's local storage
    • Randomize Files in each gallery and save the position per file
  • Each time:
    • Looking for blocks, ratelimits, edit count on the local Wiki
    • Build the User Interface (Slider, Gallery, Buttons, Randomize)

System requirements[edit]

  • JavaScript enabled
  • Local storage or userData (support started at IE6, Firefox 2, Chrome 4, Opera 10.50, Safari 4), allowed to be used by App/Wikimedia Commons
  • JSONP requests allowed (and not blocked by AddOns/Extensions like NoScript)
  • It is aimed to work with recent versions of Firefox, Chrome, Safari, Opera, Internet Explorer 8

Administrative settings[edit]

where YYYY = the year in which the Featured Pictures were promoted

Requirements[edit]

  • A structure like that:
    • R1 galleries: Commons:Picture of the Year/YYYY/R1/Gallery/<gallery name>
    • R1 vote pages: Commons:Picture of the Year/YYYY/R1/v/<exact file name>Note: when a file is moved during POTY, a new page will be created and this event will be logged to MediaWiki talk:Gadget-EnhancedPOTY.js/auto-reports
    • Final gallery: Commons:Picture of the Year/YYYY/R2/Gallery
    • Final vote pages: Commons:Picture of the Year/YYYY/R2/v/<exact file name>Note: when a file is moved during POTY, a new page will be created and this event will be logged to MediaWiki talk:Gadget-EnhancedPOTY.js/auto-reports
  • {{ThumbSizeBar/2012}} (wrapped into class thumb-size-bar) allowing dynamic resizing. This can be hidden, the App uses the text in the child note that is classified as thumb-size-text.
  • Node with id=potyVotingState that contains the current state of POTY. 2011 {{POTY2011/state}} was used. It is smart to integrate this into the header template that is shown on each page.
  • On the gallery pages: A gallery that is wrapped in a <div id="potyEasyVoteEnhanced">
  • On the vote pages/ vote lists <div id="potyEasyVoteEnhancedButton"> in which the vote-button will be inserted

Configuration[edit]

at MediaWiki:Gadget-EnhancedPOTY.js search for Configuration. You can specify, for example, the eligibility requirements.

Installation[edit]

through MediaWiki:Common.js (Outdated; use gadgets and resource loader instead!); 2011 sample

/* POTY2011 voting script
 * Maintainer: [[user:<user name>]]
 */
if ( /^Commons:Picture_of_the_Year\/YYYY\/(?:Galleries\/|R1\/|Finalists)/.test(mw.config.get('wgPageName')) ) {
 mw.loader.load('//commons.wikimedia.org/w/index.php?title=MediaWiki:EnhancedPOTY.js'+
                '&action=raw&ctype=text/javascript&smaxage=2160&maxage=8640&x=10');
}

Why POTY-App[edit]

100% valid votes in POTY 2011

What should be also done[edit]

Translation[edit]

Debugging[edit]