Korisnik:Conquistador/sandbox
Sitenotice:
- centralNotice.collapsed #stewvote{
display: none;
}
- stewvote {
position: relative; overflow: hidden; background: url('//upload.wikimedia.org/wikipedia/commons/0/0d/Gray-gradient1.png') bottom repeat-x; margin-bottom: 0.5em !important; margin-top: 0.5em !important; background-color:#FFFFFF; border: solid 1px #aaaaaa; height:44px; display: none;
}
- stewvote a.cn-full-banner-click {
display:block; height:100%; width:100%; cursor: pointer;
}
- stewvote a:hover {
text-decoration: none;
}
- stewvote-logo {
position: absolute; top: 6px; left: 15px; background-image: url(//upload.wikimedia.org/wikipedia/commons/thumb/7/75/Wikimedia_Community_Logo.svg/34px-Wikimedia_Community_Logo.svg.png); height: 34px; width: 34px; background-repeat: no-repeat;
}
- stewvote #black-text {
font-size: 1.06em; color: black; font-weight:bold; padding: 0.75em 40px 0.4em 60px; line-height: 1.3em; text-align: center;
}
- stewvote #black-text:hover {
text-decoration: underline; }
- stewvote div#cn-toggle-box {
position: absolute; z-index: 98; top: 3px; right: 6px;
}
- stewvote div#cn-translation-link {
position:absolute; z-index:50; bottom: 3px; right: 6px; font-size: 0.7em;
}
- stewvote #cn-translation-link:hover {
text-decoration: underline; } </style>
<a class="cn-full-banner-click" href="//meta.wikimedia.org/wiki/Special:Mylanguage/Stewards/Elections_2016">
</a>
[<a href="//meta.wikimedia.org/w/index.php?title=Special:Translate&group=Centralnotice-tgroup-stewvote">Pomozite nam s pr(ij)evodima!</a>]
<script> /**
* This script does not check the actual requirements on Guidelines page. It only * checks whether the user's global edit count is more than MIN_EDIT_COUNT and whether * the global account was registered before MIN_REGISTRATION. If the user's global account * registration time is newer, then we also try to find whether there is a local account * which was registered before the minimum registration time. Users who do not match these * criteria are considered as ineligible. */
var stewardVoteBanner = ( function( $, mw ) {
var MIN_REGISTRATION = '2015-11-01T00:00:00Z', MIN_EDIT_COUNT = 600, COOKIE_KEY = 'StewardVoteEligible', username = mw.config.get( 'wgUserName' ), $notice = $( '#stewvote' );
function checkEligibility() { getGlobalAccountInfo().done( function( globalInfo ) { var eligibility = isEligible( globalInfo ); setDisplayAndCookie( eligibility ); } ).fail( function() { // We don't have the required info so this defaults to the hidden banner mw.log( 'API request failed for steward vote CNbanner' ); } ); }
function getGlobalAccountInfo() { return new mw.Api().get( { action: 'query', meta: 'globaluserinfo', guiprop: [ 'editcount', 'merged' ], guiuser: username } ).then( function( result ) { return result.query.globaluserinfo; }, function() { return null; } ); }
function isEligible( globalInfo ) { if ( globalInfo.editcount < MIN_EDIT_COUNT ) { // User doesn't have the required number of edits globally return false; } if ( globalInfo.registration <= MIN_REGISTRATION ) { // Global account was created before minimum registration // (and above global editcount threshold) so this user is eligible return true; }
// Global account registration time may be newer than registration time for // a local account so we'll iterate through all local accounts and find // the oldest account to compare with minimum registration time var wikis = globalInfo.merged, wikiCount = wikis.length, oldestRegistration = wikis[0].registration; // default to first account on wikis array for ( var i = 0; i < wikiCount; i++ ) { if ( wikis[i].registration < oldestRegistration ) { oldestRegistration = wikis[i].registration; } if ( oldestRegistration <= MIN_REGISTRATION ) { // A local account registered before the minimum registration // time so this user is eligible return true; } }
// We couldn't find a local account registered before the minimum // registration time - ultimately the user is not eligible to vote return false; }
function setDisplayAndCookie( eligible ) { $notice.css( 'display', eligible ? 'block' : 'none' ); $.cookie( COOKIE_KEY, eligible ? 1 : 0, { expires: 29 } ); }
return { initialize: function() { // Not logged in but just to be safe - this shouldn't actually // happen because the banner should only be loaded for logged-in users if ( username === null ) { mw.log( 'steward vote CNbanner loaded on an anon user - not showing' ); return; } if ( $notice.length === 0 ) { mw.log( 'Could not locate #stewvote' ); return; }
mw.loader.using( 'jquery.cookie', function() { var isEligible = $.cookie( COOKIE_KEY ); if ( isEligible !== null ) { // Eligibility already checked so use the value from the cookie and be done $notice.css( 'display', ( isEligible === '1' ) ? 'block' : 'none' ); return; } // Not checked yet so do the checks and store in the cookie and show/hide accordingly mw.loader.using( 'mediawiki.api', checkEligibility ); } ); } };
}( jQuery, mediaWiki ) ); stewardVoteBanner.initialize();
</script>
GNU Free Documentation LicenseUrediVersion 1.2, November 2002 The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. |
Licenca GNU-a za slobodnu dokumentacijuUrediVerzija 1.2, novembar 2002. The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. |