משתמש אלמוני
מדיה ויקי:Gadget-WLM-draft.js: הבדלים בין גרסאות בדף
אין תקציר עריכה
אין תקציר עריכה |
אין תקציר עריכה |
||
שורה 11: | שורה 11: | ||
$(function() { | $(function() { | ||
function i18n(name) { | |||
var msg = { | |||
mark: ['סימון כעריכה שנקראה', 'Mark as read'], | |||
unmark: ['סימון כעריכה שלא נקראה', 'Mark as unread'], | |||
close: ['הסתרת העריכה', 'Hide revision'], | |||
markFlow: ['סימון זרימה כנקראה', 'Mark flow as read'], | |||
markCat: ['סימון קטגוריה כנקראה', 'Mark categorization as read'], | |||
manymarked: ['שורות סומנו', 'lines marked'], | |||
goldbutton: ['פתיחה וסימון של כל העריכות בדף הזה', 'Open and mark all this page revisions'], | |||
jsonlost: ['קובץ קונפיגורציה לא אותר', 'Configuration file not found'], | |||
hideAll: ['הסתרת עריכות שנקראו', 'Hide all read'], | |||
showAll: ['הצגת עריכות שהוסתרו', 'Show all hidden'], | |||
whatsnew: ['מה חדש?', "What's new?"], | |||
loga: ['שימו לב: רשימת המעקב כוללת רשומת יומן שלא נקראה. הדף הוא ', | |||
'Pay attention: the watchlist includes unread log entry. Page name: ' | |||
], | |||
logb: [', הפעולה שנעשתה היא: ', ', log action: '], | |||
logc: ['(לפרטים)', '(details)'], | |||
logd: ['אם ברצונכם לסמן אותה כנקראה, בדקו כי אין עריכות אחרות של הדף הזה שלא נקראו,' + | |||
' כי גם הן יסומנו. לאחר מכן לחצו ', 'If you want to mark it as read, check that there are' + | |||
' no other unwatched revisions of this page, because they will be marked too. Then click ' | |||
], | |||
loge: ['כאן', 'here'], | |||
clear: ['ניקוי', 'clear'], | |||
help: ['לפרטים ראו עזרה:מנהל רשימת המעקב', ''] | |||
}; | |||
return msg[name][lang || 0]; | |||
} | |||
function button(msg, icon) { | |||
return $('<a>', { | |||
text: '\u200f', | |||
title: i18n(msg), | |||
href: '#nw' | |||
}) | |||
.addClass(icon + ' WLM-icon'); | |||
} | |||
function seen(obj) { | |||
obj.filter(function() { | |||
return $(this) | |||
.closest('.mw-changeslist-line-watched') | |||
.filter(notcat) | |||
.find('a[href*="diff"]') | |||
.filter(notme) | |||
.filter(function() { | |||
return $(this) | |||
.closest('.mw-enhanced-rc-nested') | |||
.length <= 0; | |||
}) | |||
.length > 0; | |||
}) | |||
.before(button('mark', 'mark-edits') | |||
.click(function() { | |||
if (config.hidemarked.edit) | |||
$('.yellowedit') | |||
.hide(); | |||
var curid = /curid=([0-9]+)/.exec($(this) | |||
.closest('table, li') | |||
.find('a[href*="curid"]') | |||
.filter(notme) | |||
.prop('href'))[1]; | |||
var $this = $(this), | |||
diff = /diff=([0-9]+)/.exec($this.parent() | |||
.find('a[href*="diff"]') | |||
.filter(notme) | |||
.prop('href'))[1], | |||
name = $this.parent() | |||
.find('.mw-changeslist-title') | |||
.text(), | |||
all = $('.mw-changeslist-line-watched .mw-changeslist-title') | |||
.filter(function() { | |||
var thediff = /.*diff=([0-9]+).*oldid.*/.exec($(this) | |||
.closest('.mw-changeslist-line-watched') | |||
.find('a[href*="diff"]') | |||
.filter(notme) | |||
.prop('href')); | |||
return thediff && $(this) | |||
.text() == name && thediff[1] <= diff; | |||
}) | |||
.closest('.mw-changeslist-line-watched'), | |||
allboth = $('.mw-changeslist-line-watched .mw-changeslist-title') | |||
.filter(function() { | |||
return $(this) | |||
.text() == name; | |||
}) | |||
.closest('.mw-changeslist-line-watched'); | |||
new mw.Api() | |||
.postWithToken('csrf', { | |||
action: 'setnotificationtimestamp', | |||
titles: name, | |||
newerthanrevid: diff | |||
}) | |||
.done(function() { | |||
if (all.length > 1) | |||
$this.closest('table, li') | |||
.append($('<span>') | |||
.text(' ' + all.length + ' ' + i18n('manymarked') + ' ') | |||
.css({ | |||
backgroundColor: 'red' | |||
})); | |||
all.removeClass('mw-changeslist-line-watched blueedit') | |||
.addClass('mw-changeslist-line-not-watched yellowedit') | |||
.show() | |||
.find('.mark-edits') | |||
.remove(); | |||
allboth.find('.gold-button') | |||
.remove(); | |||
$('#gold-little-' + curid) | |||
.find('a') | |||
.remove(); | |||
defected[curid] = true; | |||
unseen(all.find('span.mw-title')); | |||
if (!config.hidemarked.wait) | |||
all.hide(); | |||
}); | |||
})); | |||
} | |||
function unseen(obj) { | |||
obj.filter(function() { | |||
return $(this) | |||
.closest('table, li') | |||
.filter(notcat) | |||
.find('a[href*="oldid"]') | |||
.length > 0; | |||
}) | |||
.before(button('unmark', 'unmark-edits') | |||
.click(function() { | |||
var curid = /curid=([0-9]+)/.exec($(this) | |||
.closest('table, li') | |||
.find('a[href*="curid"]') | |||
.filter(notme) | |||
.prop('href'))[1]; | |||
var $this = $(this), | |||
diffcond = $this | |||
.closest('.mw-changeslist-line-not-watched') | |||
.find('abbr.newpage') | |||
.length > 0, | |||
oldrev = diffcond ? 0 : /oldid=([0-9]+)/.exec($this | |||
.parent() | |||
.find('a[href*="oldid"]') | |||
.filter(notme) | |||
.prop('href'))[1], | |||
diff = diffcond ? 0 : /diff=([0-9]+)/.exec($this | |||
.parent() | |||
.find('a[href*="diff"]') | |||
.filter(notme) | |||
.prop('href'))[1], | |||
name = $this | |||
.next() | |||
.text(), | |||
all = $('.mw-changeslist-line-not-watched .mw-changeslist-title') | |||
.filter(function() { | |||
var thediff = /.*diff=([0-9]+).*oldid.*/.exec($(this) | |||
.closest('.mw-changeslist-line-not-watched') | |||
.find('a[href*="diff"]') | |||
.filter(notme) | |||
.prop('href')); | |||
return thediff && $(this) | |||
.text() == name && thediff[1] >= diff; | |||
}) | |||
.closest('.mw-changeslist-line-not-watched'), | |||
allboth = $('.mw-changeslist-line-watched .mw-changeslist-title') | |||
.filter(function() { | |||
return $(this) | |||
.text() == name; | |||
}) | |||
.closest('.mw-changeslist-line-watched'); | |||
new mw.Api() | |||
.postWithToken('csrf', { | |||
action: 'setnotificationtimestamp', | |||
titles: name, | |||
newerthanrevid: oldrev | |||
}) | |||
.done(function() { | |||
if (all.length > 1) | |||
$this.closest('table, li') | |||
.append($('<span>') | |||
.text(' ' + all.length + ' ' + i18n('manymarked') + ' ') | |||
); | |||
all.removeClass('mw-changeslist-line-not-watched yellowedit') | |||
.addClass('mw-changeslist-line-watched blueedit') | |||
.show() | |||
.find('.unmark-edits') | |||
.remove(); | |||
allboth.find('.gold-button') | |||
.remove(); | |||
$('#gold-little-' + curid) | |||
.find('a') | |||
.remove(); | |||
defected[curid] = true; | |||
seen(all.find('span.mw-title')); | |||
}); | |||
})); | |||
} | |||
function flowseen() { | |||
$('.mw-changeslist-line-watched a.mw-title') | |||
.parent() | |||
.prepend(button('markFlow', 'mark-all-flow-edits') | |||
.click(function() { | |||
var $this = $(this), | |||
topic = /title=[^:]*:(.+)&/.exec($this.parent() | |||
.find('a[href*="fromnotif"]') | |||
.prop('href')), | |||
page = $this | |||
.closest('.mw-changeslist-line-watched') | |||
.find('a.mw-title') | |||
.prop('title'), | |||
titles = topic ? page + '|נושא:' + topic[1] : page; | |||
new mw.Api() | |||
.postWithToken('csrf', { | |||
action: 'setnotificationtimestamp', | |||
titles: titles, | |||
}) | |||
.done(function() { | |||
if (config.hidemarked.flow) | |||
$this.closest('.mw-changeslist-line-watched') | |||
.hide(); | |||
$this.closest('.mw-changeslist-line-watched') | |||
.removeClass('mw-changeslist-line-watched blueedit') | |||
.addClass('mw-changeslist-line-not-watched yellowedit'); | |||
$this.remove(); | |||
}); | |||
})); | |||
} | |||
function categoryseen() { | |||
$('.mw-changeslist-line-watched span.mw-title') | |||
.filter(function() { | |||
return ($(this) | |||
.closest('.mw-changeslist-line-watched') | |||
.find('a[href*="diff"]') | |||
.length <= 0 && $(this) | |||
.closest('.mw-changeslist-line-watched') | |||
.find('abbr.newpage') | |||
.length <= 0) || | |||
$(this) | |||
.find('a.mw-changeslist-title') | |||
.parent() | |||
.next() | |||
.text() == '. .'; | |||
}) | |||
.before(button('markCat', 'mark-cat-edits') | |||
.click(function() { | |||
var $this = $(this), | |||
page = $this.parent() | |||
.find('a.mw-changeslist-title') | |||
.prop('title'); | |||
new mw.Api() | |||
.postWithToken('csrf', { | |||
action: 'setnotificationtimestamp', | |||
titles: page, | |||
}) | |||
.done(function() { | |||
if (config.hidemarked.categorization) | |||
$this.closest('.mw-changeslist-line-watched') | |||
.hide(); | |||
$this.closest('.mw-changeslist-line-watched') | |||
.removeClass('mw-changeslist-line-watched blueedit') | |||
.addClass('mw-changeslist-line-not-watched yellowedit'); | |||
$this.remove(); | |||
}); | |||
})); | |||
} | |||
function checklog() { | |||
new mw.Api() | |||
.get({ | |||
action: 'query', | |||
format: 'json', | |||
list: 'watchlist', | |||
indexpageids: 1, | |||
wllimit: 500, | |||
wlprop: 'title|loginfo', | |||
wlshow: 'unread', | |||
wltype: 'log' | |||
}) | |||
.done(function(data) { | |||
var firstname = data.query.watchlist; | |||
if (firstname.length > 0) { | |||
firstname = firstname[0]; | |||
$('#hideAll') | |||
.after($('<div>', { | |||
id: 'logmessage' | |||
}) | |||
.addClass('blueedit') | |||
.append($('<span>') | |||
.text(i18n('loga'))) | |||
.append($('<span>') | |||
.text(firstname.title) | |||
.css({ | |||
fontWeight: 'bold', | |||
})) | |||
.append($('<span>') | |||
.text(i18n('logb') + firstname.logaction + ' ')) | |||
.append($('<a>', { | |||
href: 'https://he.wikipedia.org//w/api.php?action=query&format=rawfm&list=watchlist&' + | |||
'indexpageids=1&wllimit=500&wlprop=title%7Cloginfo&wlshow=unread&wltype=log', | |||
text: i18n('logc') | |||
})) | |||
.append($('<span>') | |||
.text('. ' + i18n('logd') + ' ')) | |||
.append($('<a>', {target: '_blank'}) | |||
.text(i18n('loge')) | |||
.click(function() { | |||
new mw.Api() | |||
.postWithToken('csrf', { | |||
action: 'setnotificationtimestamp', | |||
titles: firstname.title | |||
}) | |||
.done(function() { | |||
$('#logmessage') | |||
.remove(); | |||
var all = $('.mw-changeslist-line-watched a.mw-changeslist-title') | |||
.filter(function() { | |||
return $(this) | |||
.prop('title') == firstname.title; | |||
}) | |||
.closest('.mw-changeslist-line-watched'); | |||
all.removeClass('mw-changeslist-line-watched blueedit') | |||
.addClass('mw-changeslist-line-not-watched yellowedit') | |||
.show() | |||
.find('.unmark-edits') | |||
.remove(); | |||
if (config.hidemarked.edit) | |||
$('.yellowedit') | |||
.hide(); | |||
seen(all.find('span.mw-title')); | |||
if (all.length > 0) | |||
$('#hideAll') | |||
.after($('<div>') | |||
.text(' ' + all.length + ' ' + i18n('manymarked') + ' ') | |||
) | |||
.addClass('yellowedit'); | |||
checklog(); | |||
}); | |||
})) | |||
.append($('<span>') | |||
.text('.') | |||
)); | |||
} | |||
}); | |||
} | |||
function goldbutton() { | |||
$('.close-edit') | |||
.filter(function() { | |||
return $(this) | |||
.closest('.mw-changeslist-line-watched') | |||
.filter(notcat) | |||
.find('a[href*="diff"]') | |||
.filter(notme) | |||
.filter(function() { | |||
return $(this) | |||
.closest('.mw-enhanced-rc-nested') | |||
.length <= 0; | |||
}) | |||
.length > 0 && | |||
$(this) | |||
.closest('.mw-changeslist-line-watched') | |||
.find('a.mw-title') | |||
.length <= 0; | |||
}) | |||
.each(function() { | |||
var curid = /curid=([0-9]+)/.exec($(this) | |||
.closest('table, li') | |||
.find('a[href*="curid"]') | |||
.filter(notme) | |||
.prop('href'))[1]; | |||
var name = $(this) | |||
.closest('.mw-changeslist-line-watched') | |||
.find('.mw-changeslist-title') | |||
.text(), | |||
checked = $('.mw-changeslist-title') | |||
.filter(function() { | |||
return $(this) | |||
.text() == name; | |||
}) | |||
.closest('.mw-changeslist-line-watched'), | |||
nonew = checked | |||
.find('abbr.newpage') | |||
.length <= 0, | |||
min = Infinity; | |||
checked | |||
.find('a[href*="oldid"]') | |||
.filter(notme) | |||
.filter(function() { | |||
return ($(this) | |||
.text() == messages.diff || $(this) | |||
.text() == messages.last) && | |||
($(this) | |||
.closest('.mw-enhanced-rc-nested') | |||
.closest('.mw-enhanced-watched') | |||
.length > 0 || | |||
$(this) | |||
.closest('.mw-enhanced-rc-nested') | |||
.length <= 0); | |||
}) | |||
.each(function() { | |||
var old = /oldid=([0-9]+)/.exec($(this) | |||
.prop('href')); | |||
min = old ? Math.min(min, old[1]) : min; | |||
}); | |||
if (min > 0 && min != Infinity && nonew) { | |||
$(this) | |||
.after($('<a>', { | |||
text: '\u200f', | |||
title: i18n('goldbutton'), | |||
target: '_blank', | |||
href: 'https://he.wikipedia.org/w/index.php?title=' + name + | |||
'&redirect=no&diff=cur&oldid=' + min | |||
}) | |||
.addClass('gold-button WLM-icon gold-' + curid) | |||
.click(function() { | |||
if (config.hidemarked.edit) | |||
$('.yellowedit') | |||
.hide(); | |||
var all = $('.mw-changeslist-line-watched .mw-changeslist-title') | |||
.filter(function() { | |||
return $(this) | |||
.text() == name; | |||
}) | |||
.closest('.mw-changeslist-line-watched'); | |||
if (all.length > 1) | |||
$(this) | |||
.closest('table, li') | |||
.append($('<span>') | |||
.text(' ' + all.length + ' ' + i18n('manymarked') + ' ') | |||
.css({ | |||
backgroundColor: 'red' | |||
})); | |||
all.removeClass('mw-changeslist-line-watched blueedit') | |||
.addClass('mw-changeslist-line-not-watched yellowedit') | |||
.show() | |||
.find('.mark-edits, .gold-button') | |||
.remove(); | |||
$('.gold-' + curid) | |||
.remove(); | |||
$('#gold-little-' + curid) | |||
.remove(); | |||
unseen(all.find('span.mw-title')); | |||
})); | |||
} | |||
}); | |||
} | |||
function closeedit() { | |||
var btn = button('close', 'close-edit') | |||
.click(function() { | |||
$(this) | |||
.closest('.mw-changeslist-line-not-watched, .mw-changeslist-line-watched') | |||
.hide(); | |||
}); | |||
$('li span.mw-changeslist-date') | |||
.parent() | |||
.prepend(btn); | |||
$('td.mw-enhanced-rc') | |||
.parent() | |||
.filter(function() { | |||
return $(this) | |||
.find('td.mw-enhanced-rc-nested') | |||
.length <= 0; | |||
}) | |||
.prepend($('<td>') | |||
.html(btn) | |||
.css({ | |||
whiteSpace: 'nowrap' | |||
})); | |||
$('td.mw-enhanced-rc') | |||
.parent() | |||
.find('td.mw-enhanced-rc-nested') | |||
.prev() | |||
.before($('<td>')); | |||
} | |||
function notme() { | |||
return !$(this) | |||
.hasClass('WLM-icon'); | |||
} | |||
function notcat() { | |||
return $(this) | |||
.find('a.mw-changeslist-title') | |||
.parent() | |||
.next() | |||
.text() != '. .'; | |||
} | |||
function whatsnew() { | function whatsnew() { | ||
$('#newrevs').remove(); | $('#newrevs').remove(); | ||
new mw.Api() | new mw.Api() | ||
.get({ | |||
action: 'query', | action: 'query', | ||
format: 'json', | format: 'json', | ||
שורה 517: | שורה 517: | ||
wlallrev: 1, | wlallrev: 1, | ||
errorformat: 'wikitext' | errorformat: 'wikitext' | ||
}) | |||
.done(function(data) { | |||
var ans = data.query.watchlist; | |||
$('#hideAll') | $('#hideAll') | ||
.after($('<div>', {id: 'newrevs', text: '['}) | |||
.addClass('blueedit')); | |||
var newmap = {}; | |||
Object.keys(ans).map(function(key) { | |||
var id = ans[key].pageid; | |||
if (id in newmap) { | |||
if (ans[key].old_revid < newmap[id].oldid) | |||
newmap[id].oldid = ans[key].old_revid; | |||
} else | |||
newmap[id] = {title: ans[key].title, | newmap[id] = {title: ans[key].title, | ||
oldid: ans[key].old_revid}; | oldid: ans[key].old_revid}; | ||
}); | |||
Object.keys(newmap).map(function(uuu) { | |||
var vvv = $('.gold-' + uuu).length; | |||
if (defected[uuu]) | |||
$('#newrevs') | |||
.append($('<span>', {text: newmap[uuu].title + ',\u200f '})); | |||
else if (vvv > 0) | |||
$('#newrevs') | |||
.append($('<span>', {text: newmap[uuu].title + ',\u200f ', id: 'gold-little-' + uuu}) | |||
.prepend($('.gold-' + uuu).clone(true, true)[0])); | |||
else | |||
$('#newrevs') | |||
.append($('<span>', {text: ',\u200f '}) | |||
.prepend($('<a>', {text: newmap[uuu].title, | |||
href: 'https://he.wikipedia.org/w/index.php?title=' + | |||
newmap[uuu].title + | |||
'&redirect=no&diff=cur&oldid=' + newmap[uuu].oldid, | |||
target: '_blank' | |||
}) | |||
.click(function() { | |||
$(this).parent(). | |||
remove(); | |||
}))); | |||
}); | |||
$('#newrevs') | |||
.append($('<span>', { | |||
text: '\u200f☺', | |||
title: 'closenew',//TODO | |||
id: 'closenew' | |||
}) | |||
.click(function() { | |||
$('#newrevs').remove(); | |||
}) | |||
).append(']'); | |||
}) | |||
.done(function() { | |||
$( 'body' ).trigger( 'script-88-pretend-clicked' ); | |||
}); | |||
} | } | ||
function hider(state) { | |||
$('#newrevs').remove(); | $('#newrevs').remove(); | ||
if (config.edit[state]) | |||
$('.mw-changeslist-line-not-watched') | |||
.filter(function() { | |||
return $(this) | |||
.find('abbr.wikibase-edit') | |||
.length <= 0; | |||
}) | |||
.hide(); | |||
if (config.log[state]) | |||
$('[class*="mw-changeslist-log"]') | |||
.hide(); | |||
if (config.wikidata[state]) | |||
$('abbr.wikibase-edit') | |||
.closest('.mw-changeslist-line-watched, .mw-changeslist-line-not-watched') | |||
.hide(); | |||
$('#logmessage') | |||
.hide(); | |||
$('#watchlist-preamble') | |||
.hide(); | |||
$('input[name="mw-watchlist-reset-submit"]') | |||
.hide(); | |||
} | |||
function unhider() { | |||
whatsnew(); | whatsnew(); | ||
$('.mw-changeslist-line-watched') | |||
.show(); | |||
if (config.edit.show) | |||
$('.mw-changeslist-line-not-watched') | |||
.filter(function() { | |||
return $(this) | |||
.find('abbr.wikibase-edit') | |||
.length <= 0; | |||
}) | |||
.show(); | |||
if (config.log.show) | |||
$('[class*="mw-changeslist-log"]') | |||
.show(); | |||
if (config.wikidata.show) | |||
$('abbr.wikibase-edit') | |||
.closest('.mw-changeslist-line-not-watched') | |||
.show(); | |||
$('#logmessage') | |||
.show(); | |||
$('#watchlist-preamble') | |||
.show(); | |||
$('input[name="mw-watchlist-reset-submit"]') | |||
.show(); | |||
} | |||
function main() { | |||
seen($('.mw-changeslist-line-watched span.mw-title')); | |||
unseen($('.mw-changeslist-line-not-watched span.mw-title')); | |||
flowseen(); | |||
categoryseen(); | |||
closeedit(); | |||
goldbutton(); | |||
hider('starthidden'); | |||
} | |||
function demo() { | |||
$('.mark-edits') | |||
.click(function() { | |||
var id = $(this) | |||
.parent() | |||
.prop('id'); | |||
$(this) | |||
.closest('table') | |||
.find('.mark-edits') | |||
.filter(function() { | |||
return $(this) | |||
.parent() | |||
.prop('id') <= id; | |||
}) | |||
.removeClass('mark-edits') | |||
.addClass('unmark-edits') | |||
.parent() | |||
.removeClass('blueedit') | |||
.addClass('yellowedit'); | |||
demo(); | |||
}); | |||
$('.unmark-edits') | |||
.click(function() { | |||
var id = $(this) | |||
.parent() | |||
.prop('id'); | |||
$(this) | |||
.closest('table') | |||
.find('.unmark-edits') | |||
.filter(function() { | |||
return $(this) | |||
.parent() | |||
.prop('id') >= id; | |||
}) | |||
.removeClass('unmark-edits') | |||
.addClass('mark-edits') | |||
.parent() | |||
.removeClass('yellowedit') | |||
.addClass('blueedit'); | |||
demo(); | |||
}); | |||
} | |||
if (mw.config.get('wgCanonicalSpecialPageName') == 'Watchlist') { | |||
var langcode = mw.user.options.get('language'), | |||
lang = langcode == 'he' ? 0 : 1, | |||
extendwatchlist = mw.user.options.get('extendwatchlist'), | |||
defected = {}, config, messages; | |||
if (extendwatchlist == 1) { | |||
$('.mw-body-content') | |||
.addClass(typeof window.orientation == 'undefined' ? 'WLM-desktop' : 'WLM-mobile'); | |||
importStylesheet('מדיה ויקי:Gadget-WLM.css'); | importStylesheet('מדיה ויקי:Gadget-WLM.css'); | ||
importStylesheet('משתמש:' + mw.config.get('wgUserName') + '/WLM.css'); | importStylesheet('משתמש:' + mw.config.get('wgUserName') + '/WLM.css'); | ||
importStylesheet('משתמש:' + mw.config.get('wgUserName') + '/common.css'); | |||
new mw.Api() | |||
.getMessages(['diff', 'last'], { | |||
amlang: langcode | |||
}) | |||
.then(function(result) { | |||
messages = result; | |||
}) | |||
.then(function() { | |||
$.get(mw.util.wikiScript(), { | |||
title: 'מדיה ויקי:Gadget-WLM.json', | |||
action: 'raw' | |||
}) | |||
.done(function(data) { | |||
config = JSON.parse(data); | |||
$.get(mw.util.wikiScript(), { | |||
title: 'משתמש:' + mw.config.get('wgUserName') + '/WLM.json', | |||
action: 'raw' | |||
}) | |||
.done(function(data1) { | |||
config = JSON.parse(data1); | |||
}) | |||
.always(main); | |||
}) | |||
.fail(function() { | |||
console.log('ERR: ' + i18n('jsonlost')); | |||
}); | |||
}); | |||
$('#mw-watchlist-form') | |||
.after($('<input>', { | |||
id: 'hideAll', | |||
type: 'submit', | |||
title: i18n('help') | |||
}) | |||
.click(function() { | |||
hider('hide'); | |||
})) | |||
.after($('<span>', { | |||
text: 'place', | |||
id: 'placeholder' | |||
}) | |||
.css({ | |||
visibility: 'hidden', | |||
})) | |||
.after($('<input>', { | |||
id: 'showAll', | |||
type: 'submit', | |||
title: i18n('help') | |||
}) | |||
.click(unhider)) | |||
.after($('<span>', { | |||
text: 'place', | |||
id: 'placeholder' | |||
}) | |||
.css({ | |||
visibility: 'hidden', | |||
})) | |||
.after($('<input>', { | |||
id: 'whatsnew', | |||
type: 'submit', | |||
title: i18n('help') | |||
}) | |||
.click(whatsnew)) | |||
.after($('<div>', { | |||
text: 'place', | |||
id: 'placeline' | |||
}) | |||
.css({ | |||
visibility: 'hidden', | |||
fontSize: '50%' | |||
})); | |||
$('#hideAll') | |||
.attr('value', i18n('hideAll')); | |||
$('#showAll') | |||
.attr('value', i18n('showAll')); | |||
$('#whatsnew') | |||
.attr('value', i18n('whatsnew')); | |||
checklog(); | |||
} | |||
} else if (mw.config.get('wgPageName') == 'עזרה:WLM') { | |||
$('.prescell') | |||
.attr('align', 'center') | |||
.each(function() { | |||
$(this) | |||
.html($('<a>') | |||
.addClass($(this) | |||
.attr('class'))); | |||
$(this) | |||
.removeClass('mark-edits unmark-edits'); | |||
}); | |||
$('#clear') | |||
.prepend($('<input>', { | |||
id: 'clearbutton', | |||
type: 'submit' | |||
}) | |||
.click(function() { | |||
$('.blueedit, .yellowedit') | |||
.removeClass('blueedit yellowedit'); | |||
})); | |||
$('#clearbutton') | |||
.attr('value', i18n('clear')); | |||
demo(); | |||
} | |||
}); | }); |