"मीडियाविकि:Common.js/watchlist.js" इत्यस्य संस्करणे भेदः

imported>Remember the dot
(moved from MediaWiki:Common.js)
 
//<source lang="JavaScript">
 
/** Add dismiss buttonbuttons to watchlist-message *************************************
*
* Description: HideAllows themultiple watchlistdismiss messagebuttons foron one[[MediaWiki:Watchlist-details]] weekwith bump-able cookie IDs.
* Note: HTML is backwards compatible with old version, new version ignores old syntax, except for dismissed IDs.
* Maintainers: [[User:Ruud Koot|Ruud Koot]], [[User:MZMcBride|MZMcBride]]
*/
 
function addDismissButton() {
var watchlistMessagedocobj = document.getElementById("watchlist-message"'bodyContent'); || document.getElementById('content') || document
var watchItems = getElementsByClassName(docobj, 'div', 'watchlist-message');
if ( watchlistMessage == null ) return;
if(watchItems.length == 0) return
var watchlistCookieID = watchlistMessage.className.replace(/cookie\-ID\_/ig,'');
for(var i=0;i<watchItems.length;i++) {
 
var watchlistCookieID = watchlistMessageparseInt(watchItems[i].className.replace(/.*cookie\-ID\_(\d*).*/ig,'$1'));
if ( document.cookie.indexOf( "hidewatchlistmessage-" + watchlistCookieID + "=yes" ) != -1 ) {
if(isNaN(watchlistCookieID)) continue
watchlistMessage.style.display = "none";
if ( document.cookie.indexOf( "'hidewatchlistmessage-"' + watchlistCookieID + "'=yes" ') != -1 ) {
watchlistMessagewatchItems[i].style.display = "'none"';
continue;
}
var Button = document.createElement( "'span" ');
var ButtonLink = document.createElement( "'a" ');
var ButtonText = document.createTextNode( "'dismiss" ');
 
ButtonLink.setAttribute( "'id"', "'dismissButton" ');
var Button = document.createElement( "span" );
ButtonLink.setAttribute( "'href"', "'javascript:dismissWatchlistMessage();"' + i + ',' + watchlistCookieID + ')');
var ButtonLink = document.createElement( "a" );
ButtonLink.setAttribute( "'title"', "'Hide this message for one week" ');
var ButtonText = document.createTextNode( "dismiss" );
ButtonButtonLink.appendChild( ButtonLink ButtonText);
 
Button.appendChild( document.createTextNode( "'[" ') );
ButtonLink.setAttribute( "id", "dismissButton" );
Button.appendChild( document.createTextNode( "]" ) ButtonLink);
ButtonLink.setAttribute( "href", "javascript:dismissWatchlistMessage();" );
Button.appendChild(document.createTextNode(']'));
ButtonLink.setAttribute( "title", "Hide this message for one week" );
ButtonLinkwatchItems[i].appendChild( ButtonText Button);
}
 
function dismissWatchlistMessage(num,cid) {
Button.appendChild( document.createTextNode( "[" ) );
var docobj = document.getElementById('bodyContent') || document.getElementById('content') || document
Button.appendChild( ButtonLink );
var watchItems = getElementsByClassName(docobj, 'div', 'watchlist-message');
Button.appendChild( document.createTextNode( "]" ) );
watchlistMessagewatchItems[num].style.display = "'none"';
 
var e = new Date();
watchlistMessage.appendChild( Button );
e.setTime( e.getTime() + (7*24*60*60*1000) );
document.cookie = "'hidewatchlistmessage-"' + watchlistCookieIDcid + "'=yes; expires="' + e.toGMTString() + "'; path=/"';
}
addOnloadHook( addDismissButton );
 
function dismissWatchlistMessage() {
var e = new Date();
e.setTime( e.getTime() + (7*24*60*60*1000) );
var watchlistMessage = document.getElementById("watchlist-message");
var watchlistCookieID = watchlistMessage.className.replace(/cookie\-ID\_/ig,'');
document.cookie = "hidewatchlistmessage-" + watchlistCookieID + "=yes; expires=" + e.toGMTString() + "; path=/";
watchlistMessage.style.display = "none";
 
addOnloadHook( addDismissButton );
 
 
/** Geo-targeted watchlist notice *******************************************************
*/
 
if (wgPageName == "Special:Watchlist") {
addOnloadHook((function () {document.write importScriptURI('<script type="text/javascript" src="http://tools.wikimedia.de/~gmaxwell/cgi-bin/geonotice.py"><\/script>') }));
}
 
//</source>

सम्पादन

"https://sa.wikipedia.org/wiki/विशेषः:MobileDiff/184868" इत्यस्माद् प्रतिप्राप्तम्