میڈیاویکی:Common.js/watchlist.js
یاددہانی: محفوظ کرنے کے بعد تازہ ترین تبدیلیوں کو دیکھنے کے لیے آپ کو اپنے براؤزر کا کیش صاف کرنا ہوگا۔
- فائرفاکس/ سفاری: جب Reload پر کلک کریں تو Shift دبا کر رکھیں، یا Ctrl-F5 یا Ctrl-R دبائیں (Mac پر R- )
- گوگل کروم: Ctrl-Shift-R دبائیں (Mac پر Shift-R-⌘)
- انٹرنیٹ ایکسپلورر: جب Refresh پر کلک کریں تو Ctrl یا Ctrl-F5 دبائیں
- اوپیرا: Tools → Preferences میں جائیں اور کیش صاف کریں
اس اسکرپٹ کی دستاویزی تفصیلات میڈیاویکی:Common.js/watchlist پر درج کی جا سکتی ہیں۔ |
/** Add dismiss buttons to watchlist-message *************************************
*
* Description: Allows multiple dismiss buttons on [[MediaWiki:Watchlist-details]] with bump-able cookie IDs.
* Note: HTML is backwards compatible with old version, new version ignores old syntax, except for dismissed IDs.
* Maintainers: [[User:محمد شعیب]]
*/
function addDismissButton() {
var watchItems = $("div.watchlist-message");
if (watchItems.length == 0) watchItems = $("li.watchlist-message")
if (watchItems.length == 0) return
for (var i = 0; i < watchItems.length; i++) {
var watchlistCookieID = parseInt(watchItems[i].className.replace(/.*cookie\-ID\_(\d*).*/ig,'$1'));
if (isNaN(watchlistCookieID)) continue
if (document.cookie.indexOf('hidewatchlistmessage-' + watchlistCookieID + '=yes') != -1) {
watchItems[i].style.display = 'none';
continue;
}
var Button = document.createElement('span');
var ButtonLink = document.createElement('a');
var ButtonText = document.createTextNode('ختم کریں');
ButtonLink.className = 'dismissButton';
ButtonLink.setAttribute('href','javascript:dismissWatchlistMessage(' + i + ',' + watchlistCookieID + ')');
ButtonLink.setAttribute('title','اس پیغام کو چھپائیں');
ButtonLink.appendChild(ButtonText);
Button.appendChild(document.createTextNode(' ['));
Button.appendChild(ButtonLink);
Button.appendChild(document.createTextNode(']'));
watchItems[i].appendChild(Button);
}
}
function dismissWatchlistMessage(num,cid) {
var watchItems = $("div.watchlist-message");
if(watchItems.length == 0) watchItems = $("li.watchlist-message")
watchItems[num].style.display = 'none';
var e = new Date();
e.setTime( e.getTime() + (4*7*24*60*60*1000) );
document.cookie = 'hidewatchlistmessage-' + cid + '=yes; expires=' + e.toGMTString() + '; path=/';
}
$( document ).ready( function() {
addDismissButton();
});