Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function FakeTalk() {
- var sub = ['Talk', 'talk']; //pages to check
- var on = false;
- for(var i = 0; i < sub.length; i++) {
- if(wgPageName == 'User:' + wgUserName + '/' + sub[i]) {on = true; break;}
- }
- if(!on) {
- xhr = new XMLHttpRequest();
- xhr.open('GET', '/api.php?action=query&prop=info&titles=User:' + wgUserName + '/' + sub.join('|User:' + wgUserName + '/') + '&format=json', true);
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.onreadystatechange = function() {
- if(this.readyState == 4 && this.status == 200) {
- var pages = JSON.parse(this.responseText).query.pages;
- for(var i in pages) {
- if(i > 0 && pages[i].lastrevid > localStorage.getItem('msgwl_' + pages[i].title.substring(pages[i].title.indexOf('/') + 1))) {
- if(skin == 'oasis') {
- document.getElementById('WikiaFooter').getElementsByTagName('ul')[0].outerHTML += '<ul id="WikiaNotifications" class="WikiaNotifications"><li><div data-type="1"><a class="sprite close-notification"></a>You have <a href="/index.php?title=' + pages[i].title + '&redirect=no" title="' + pages[i].title + '">new messages</a>.</div></li></ul>';
- }
- else {
- document.getElementById('contentSub').outerHTML += '<div class="usermessage">You have <a href="/index.php?title=' + pages[i].title + '&redirect=no" title="' + pages[i].title + '">new messages</a> (<a href="/index.php?title=' + pages[i].title + '&diff=cur" title="' + pages[i].title + '">show most recent</a>).</div>';
- }
- }
- }
- }
- }
- xhr.send();
- }
- else {localStorage.setItem('msgwl_' + wgPageName.substring(wgPageName.lastIndexOf('/') + 1), wgCurRevisionId);}
- }
- addOnloadHook(FakeTalk);
Advertisement
Add Comment
Please, Sign In to add comment