ഉപയോക്താവ്:AswiniKP/subpages.js

വിക്കിപീഡിയ, ഒരു സ്വതന്ത്ര വിജ്ഞാനകോശം.

ശ്രദ്ധിക്കുക: സേവ് ചെയ്തശേഷം മാറ്റങ്ങൾ കാണാനായി താങ്കൾക്ക് ബ്രൗസറിന്റെ കാഷെ ഒഴിവാക്കേണ്ടി വന്നേക്കാം.

  • ഫയർഫോക്സ് / സഫാരി: Reload ബട്ടൺ അമർത്തുമ്പോൾ Shift കീ അമർത്തി പിടിക്കുകയോ, Ctrl-F5 അല്ലെങ്കിൽ Ctrl-R (മാക്കിന്റോഷിൽ ⌘-R ) എന്ന് ഒരുമിച്ച് അമർത്തുകയോ ചെയ്യുക
  • ഗൂഗിൾ ക്രോം: Ctrl-Shift-R (മാക്കിന്റോഷിൽ ⌘-Shift-R ) അമർത്തുക
  • ഇന്റർനെറ്റ് എക്സ്പ്ലോറർ: Refresh ബട്ടൺ അമർത്തുമ്പോൾ Ctrl കീ അമർത്തിപിടിക്കുക. അല്ലെങ്കിൽ Ctrl-F5 അമർത്തുക
  • ഓപ്പറ: Menu → Settings എടുക്കുക (മാക്കിൽ Opera → Preferences) എന്നിട്ട് Privacy & security → Clear browsing data → Cached images and files ചെയ്യുക.
// "Fail gracefully" if skin not supported
switch (skin) {
    case 'modern': case 'monobook': case 'vector':
 
    // Global variables
    if (typeof(cactions) == 'undefined') var cactions;
    eval(function () {
        var globals = cactions ? cactions : null;
        cactions = {
            admin: wgUserGroups.indexOf('sysop') > -1 ? true : false,
            areqs: [],
            hovms: (skin == 'vector') ? 50 : 400,
            itabs: true,
            menus: [],
            mouse: null,
            mwsvr: wgServer.indexOf('secure.wikimedia.org') == -1 ? wgServer.split('://')[1] : null,
            pname: encodeURIComponent(mw.config.get('wgPageName')),
            svars: [],
            tbusr: false,
            timer: [],
            xmlhr: true
        };
        if (globals) for (i in globals) cactions[i] = globals[i];
    }());
 
    // Propose new languages at http://en.wikipedia.org/wiki/User_talk:Haza-w
    mw.loader.load('//ml.wikipedia.org/w/index.php?title=User:AswiniKP/cactions-languages.js&action=raw&ctype=text/javascript');
 
    function xhr(request,url,orsc) {
        with (request) {
            open('GET',url,true);
            onreadystatechange = orsc;
            send(null);
        }
    }
 
    // Find absolute position of element
    function findPos(eid,offset) {
        var obj = document.getElementById(eid), pos = [0,0];
        do with (obj) {
            pos[0] += offsetLeft;
            pos[1] += offsetTop;
        } while (obj = obj.offsetParent);
        pos[0] += offset[0]; pos[1] += offset[1];
        return pos;
    }
 
    // Create menu div element
    function createMenu(mid,vectorise,html) {
        var menu = document.createElement('div');
        with (menu) {
            id = 'opt-' + mid;
            className = 'ca-menu';
            style.display = 'none';
        }
        menu.onmouseover = function () {showMenu('opt-'+mid)};
        menu.onmouseout = function () {hideMenu('opt-'+mid)};
 
        var elements = {
            ul: document.createElement('ul'),
            li: null,
            a: null,
            txt: null
        };
        with (elements) {
            for (var i = 0; i < html.length; i++) if (html[i].length) {
                li = document.createElement('li'); li.id = html[i][0];
                a = document.createElement('a'); a.href = html[i][1];
                txt = document.createTextNode(cactions._lang[html[i][0].replace(/-/g,'_')]);
                a.appendChild(txt); li.appendChild(a); ul.appendChild(li);
            }
            menu.appendChild(ul);
        }
 
        document.body.appendChild(menu);
        if (vectorise) createTab(mid);
 
        return 'opt-' + mid;
    }
 
    // Create cactions LI tab
    function createTab(mid) {
        var mtitle = mid.charAt(0).toUpperCase() + mid.substr(1);
 
        if (skin == 'vector') {
            var cid = 'p-' + mid;
            var elements = {
                div: document.createElement('div'),
                h3: document.createElement('h3'),
                span: document.createElement('span'),
                a: document.createElement('a'),
                txt: null
            };
            with (elements) {
                div.id = cid;
                div.className = 'vectorMenu extraMenu';
 
                txt = document.createTextNode(mtitle);
                span.appendChild(txt); h3.appendChild(span);
 
                a.href = '#';
                a.onmouseover = function () {showMenu('opt-'+mid,findPos(cid,[0,40]))};
                a.onmouseout = function () {hideMenu('opt-'+mid)};
 
                span = document.createElement('span');
                txt = document.createTextNode(mtitle);
                span.appendChild(txt); a.appendChild(span); h3.appendChild(a);
 
                div.appendChild(h3);
                document.getElementById('right-navigation').insertBefore(div,document.getElementById('p-search'));
            }
        }
        else {
            var cid = 'ca-' + mid;
            var elements = {
                li: document.createElement('li'),
                a: document.createElement('a'),
                txt: document.createTextNode(mtitle)
            };
            with (elements) {
                li.id = cid;
                a.href = '#';
                a.onmouseover = function () {showMenu('opt-'+mid,findPos(cid,[-10,20]))};
                a.onmouseout = function () {hideMenu('opt-'+mid)};
                a.appendChild(txt); li.appendChild(a);
 
                document.getElementById('p-cactions').getElementsByTagName('div')[0].getElementsByTagName('ul')[0].appendChild(li);
            }
        }
    }
 
    // CSS hide elements
    function hideElements(elements,conditionals) {
        if (typeof(conditionals) == 'undefined') {
            for (var i = 0; i < elements.length; i++) if (document.getElementById(elements[i])) document.getElementById(elements[i]).style.display = 'none';
        }
        else for (var i = 0; i < elements.length; i++) if (document.getElementById(elements[i])) {
            document.getElementById(elements[i]).style.display = 'none';
            if (conditionals[i]) document.getElementById(conditionals[i]).style.display = 'none';
        }
    }
 
    // Show/hide menu functions
    function showMenu(mid,pos) {
        with (cactions) {
            mouse = mid;
            if (pos) for (var i = 0; i < menus.length; i++) {
                if (timer[menus[i]]) {
                    clearTimeout(timer[menus[i]]);
                    timer[menus[i]] = null;
                }
                if (mid.replace(/-[^-]+$/,'') == menus[i]) continue;
                document.getElementById(menus[i]).style.display = 'none';
            }
            if (!timer[mid]) with (document.getElementById(mid).style) {
                display = '';
                if (pos) {
                    left = pos[0]+'px';
                    top = pos[1]+'px';
                }
            }
            else {
                clearTimeout(timer[mid]);
                timer[mid] = null;
            }
        }
    }
    function hideMenu(mid) {
        with (cactions) {
            if (mid == mouse.replace(/-[^-]+$/,'')) timer[mid] = null;
 
            if (timer[mid]) {
                timer[mid] = null;
                document.getElementById(mid).style.display = 'none';
                if (mid == mouse && mid.search(/opt-.*-/) != -1) document.getElementById(mid.replace(/-[^-]+$/,'')).style.display = 'none';
            }
            else timer[mid] = setTimeout('hideMenu(\''+mid+'\');',hovms);
        }
    }
 
    // Delink element
    function removeLink(eid) {
        var element = document.getElementById(eid);
        if (!element.getElementsByTagName('a').length) return false;
 
        var a = element.getElementsByTagName('a')[0];
        element.appendChild(a.removeChild(a.firstChild));
        element.removeChild(a);
 
        element.className = 'ca-disabled';
    }
 
    // CSS styles
    importStylesheetURI('//ml.wikipedia.org/w/index.php?title=User:AswiniKP/cactions.css&ctype=text/css&action=raw');
 
    // User options hook
    $(function () {
        switch (wgNamespaceNumber) {
            case 2: case 3: cactions['uname'] = encodeURIComponent(wgTitle.split('/')[0].replace(/ /g,'_'));
        }
        if (wgCanonicalSpecialPageName == 'Contributions') for (var i = 0, hl; hl = document.getElementById('contentSub').getElementsByTagName('a')[i]; i++) {
            if (hl.href.indexOf('user=') > -1) {
                cactions['uname'] = hl.href.split('user=')[1].split('&amp;')[0];
                break;
            }
        }
 
        if (cactions.uname) {
            with (cactions) {
                menus[menus.length] = createMenu('user',true,Array(
                                                    ['c-u-logs',        '#']                                                                                                                                                    ,
                    mwsvr == 'en.wikipedia.org'?    ['c-u-rfx',         '#']                                                                                                                                                :[] ,
                                                    ['c-u-blocks',      '#']                                                                                                                                                    ,
                                                    ['c-u-contribs',    wgScript+'?title=Special:Contributions/'+uname+'&action=view']                                                                                          ,
                    mwsvr?                          ['c-u-editcount',   'http://toolserver.org/~soxred93/count/index.php?lang='+mwsvr.split('.')[0]+'&wiki='+mwsvr.split('.')[1]+'&name='+uname.replace(/_/g,'+')]          :[] ,
                    mwsvr?                          ['c-u-editsum',     'http://toolserver.org/~soxred93/editsummary/index.php?lang='+mwsvr.split('.')[0]+'&wiki='+mwsvr.split('.')[1]+'&name='+uname.replace(/_/g,'+')]    :[] ,
                    mwsvr == 'en.wikipedia.org'?    ['c-u-wcuser',      'http://en.wikichecker.com/user/?l=all&t='+uname]                                                                                                   :[] ,
                                                    ['c-u-sul',         'http://toolserver.org/~vvv/sulutil.php?user='+uname]                                                                                                   ,
                                                    ['c-u-subpages',    wgScript+'?title=Special:PrefixIndex/User:'+uname+'/&action=view']                                                                                      ,
                                                    ['c-u-email',      wgScript+'?title=Special:EmailUser/'+uname+'&action=view']                                                                                              ,
                                                    ['c-u-groups',      wgScript+'?title=Special:ListUsers&action=view&limit=1&username='+uname]                                                                                ,
                                                    ['c-u-rightslog',   wgScript+'?title=Special:Log&action=view&type=rights&page=User:'+uname]
                ));
 
                menus[menus.length] = createMenu('user-logs',false,Array(
                                                    ['c-ul-logs',       wgScript+'?title=Special:Log&action=view&user='+uname]                  ,
                                                    ['c-ul-blocks',     wgScript+'?title=Special:Log&action=view&type=block&user='+uname]       ,
                                                    ['c-ul-deletes',    wgScript+'?title=Special:Log&action=view&type=delete&user='+uname]      ,
                                                    ['c-ul-moves',      wgScript+'?title=Special:Log&action=view&type=move&user='+uname]        ,
                                                    ['c-ul-patrols',    wgScript+'?title=Special:Log&action=view&type=patrol&user='+uname]      ,
                                                    ['c-ul-protects',   wgScript+'?title=Special:Log&action=view&type=protect&user='+uname]     ,
                                                    ['c-ul-uploads',    wgScript+'?title=Special:Log&action=view&type=upload&user='+uname]      ,
                                                    ['c-ul-rights',     wgScript+'?title=Special:Log&action=view&type=rights&user='+uname]
                ));
 
                menus[menus.length] = createMenu('user-blocks',false,Array(
                    admin?                          ['c-ub-block',      wgScript+'?title=Special:BlockIP/'+uname+'&action=view']            :[] ,
                    admin?                          ['c-ub-unblock',    wgScript+'?title=Special:IPBlockList&action=unblock&ip='+uname]     :[] ,
                                                    ['c-ub-ipblock',    wgScript+'?title=Special:IPBlockList&action=view&ip='+uname]            ,
                                                    ['c-ub-blocklog',   wgScript+'?title=Special:Log&action=view&type=block&page=User:'+uname]
                ));
 
                menus[menus.length] = createMenu('user-rfx',false,Array(
                                                    ['c-ux-rfa',        wgScript+'?title=Special:PrefixIndex/Wikipedia:Requests_for_adminship/'+uname+'&action=view'],
                                                    ['c-ux-rfb',        wgScript+'?title=Special:PrefixIndex/Wikipedia:Requests_for_bureaucratship/'+uname+'&action=view'],
                                                    ['c-ux-rfar',       wgScript+'?title=Wikipedia:Requests_for_arbitration/'+uname+'&action=view'],
                                                    ['c-ux-rfc',        wgScript+'?title=Wikipedia:Requests_for_comment/'+uname+'&action=view'],
                                                    ['c-ux-rfcu',       wgScript+'?title=Wikipedia:Requests_for_checkuser/Case/'+uname+'&action=view'],
                                                    ['c-ux-spi',        wgScript+'?title=Wikipedia:Sockpuppet_investigations/'+uname+'&action=view']
                ));
 
                if (xmlhr && sajax_init_object() && true) {
                    if (uname.search(/(?:\d{1,3}\.){3}\d{1,3}/) == 0) {
                        areqs['ip'] = new sajax_init_object();
                        xhr(areqs['ip'],wgScriptPath+'/api.php?format=json&action=query&list=blocks&bkusers='+uname+'&bkprop=id&xhr='+Math.random(),function () {
                            with (areqs['ip']) if (readyState == 4 && status == 200) {
                                var api = eval('('+responseText+')');
                                if (api.query.blocks.length) {
                                    hideElements(['c-ub-block']);
                                    document.getElementById('c-ub-ipblock').getElementsByTagName('a')[0].style.color = '#EE1111';
                                }
                                else {
                                    hideElements(['c-ub-unblock']);
                                    removeLink('c-ub-ipblock');
                                }
                            }
                        } );
                    }
                    else {
                        areqs['user'] = new sajax_init_object();
                        xhr(areqs['user'],wgScriptPath+'/api.php?format=json&action=query&list=users&ususers='+uname+'&usprop=blockinfo|groups&xhr='+Math.random(),function () {
                            with (areqs['user']) if (readyState == 4 && status == 200) {
                                var api = eval('('+responseText+')');
                                with (api.query.users[0]) {
                                    if (typeof(missing) != 'undefined') hideElements(['ca-user']);
                                    else {
                                        if (typeof(blockedby) != 'undefined') {
                                            hideElements(['c-ub-block']);
                                            document.getElementById('c-ub-ipblock').getElementsByTagName('a')[0].style.color = '#EE1111';
                                        }
                                        else {
                                            hideElements(['c-ub-unblock']);
                                            removeLink('c-ub-ipblock');
                                        }
 
                                        if (typeof(groups) == 'undefined' || groups.join().indexOf('sysop') == -1) hideElements(['c-ul-blocks','c-ul-deletes','c-ul-protects','c-ul-rights']);
                                    }
                                }
                            }
                        } );
 
                        if (document.getElementById('c-u-rfx')) {
                            areqs['rfa'] = new sajax_init_object();
                            xhr(areqs['rfa'],wgScriptPath+'/api.php?format=json&action=query&list=allpages&apprefix=Requests_for_adminship%2F'+uname+'&apnamespace=4&aplimit=1&xhr='+Math.random(),function () {
                                with (areqs['rfa']) if (readyState == 4 && status == 200) {
                                    var api = eval('('+responseText+')');
                                    if (!api.query.allpages.length) removeLink('c-ux-rfa');
                                }
                            } );
 
                            areqs['rfb'] = new sajax_init_object();
                            xhr(areqs['rfb'],wgScriptPath+'/api.php?format=json&action=query&list=allpages&apprefix=Requests_for_bureaucratship%2F'+uname+'&apnamespace=4&aplimit=1&xhr='+Math.random(),function () {
                                with (areqs['rfb']) if (readyState == 4 && status == 200) {
                                    var api = eval('('+responseText+')');
                                    if (!api.query.allpages.length) removeLink('c-ux-rfb');
                                }
                            } );
                        }
 
                        areqs['uspace'] = new sajax_init_object();
                        xhr(areqs['uspace'],wgScriptPath+'/api.php?format=json&action=query&list=allpages&apprefix='+uname+'%2F&apnamespace=2&aplimit=1&xhr='+Math.random(),function () {
                            with (areqs['uspace']) if (readyState == 4 && status == 200) {
                                var api = eval('('+responseText+')');
                                if (!api.query.allpages.length) removeLink('c-u-subpages');
                            }
                        } );
                    }
 
                    if (document.getElementById('c-u-rfx')) {
                        areqs['rfx'] = new sajax_init_object();
                        xhr(areqs['rfx'],wgScriptPath+'/api.php?format=json&action=query&titles=Wikipedia:Requests_for_arbitration/'+uname+'|Wikipedia:Requests_for_comment/'+uname+'|Wikipedia:Requests_for_checkuser/Case/'+uname+'|Wikipedia:Sockpuppet_investigations/'+uname+'&letype=block&letitle=User:'+uname+'&prop=info&xhr='+Math.random(),function () {
                            with (areqs['rfx']) if (readyState == 4 && status == 200) {
                                var api = eval('('+responseText+')');
                                for (i in api.query.pages) switch (api.query.pages[i].title.split('/')[0]) {
                                    case 'Wikipedia:Requests for arbitration': if (typeof(api.query.pages[i].missing) != 'undefined') removeLink('c-ux-rfar'); break;
                                    case 'Wikipedia:Requests for comment': if (typeof(api.query.pages[i].missing) != 'undefined') removeLink('c-ux-rfc'); break;
                                    case 'Wikipedia:Requests for checkuser': if (typeof(api.query.pages[i].missing) != 'undefined') removeLink('c-ux-rfcu'); break;
                                    case 'Wikipedia:Sockpuppet investigations': if (typeof(api.query.pages[i].missing) != 'undefined') removeLink('c-ux-spi'); break;
                                }
                            }
                        } );
                    }
 
                    areqs['ublocks'] = new sajax_init_object();
                    xhr(areqs['ublocks'],wgScriptPath+'/api.php?format=json&action=query&list=logevents&letype=block&letitle=User:'+uname+'&lelimit=1&xhr='+Math.random(),function () {
                        with (areqs['ublocks']) if (readyState == 4 && status == 200) {
                            var api = eval('('+responseText+')');
                            if (!api.query.logevents.length) removeLink('c-ub-blocklog');
                        }
                    } );
                }
                else hideElements(['c-ub-ipblock','c-ul-blocks','c-ul-deletes','c-ul-protects','c-ul-rights']);
 
                if (!tbusr) hideElements(['t-contributions','t-log','t-emailuser']);
            }
 
            document.getElementById('c-u-logs').onmouseover = function () {showMenu('opt-user-logs',findPos('c-u-logs',[40,0]))};
            document.getElementById('c-u-logs').onmouseout = function () {hideMenu('opt-user-logs')};
            document.getElementById('c-u-logs').style.fontWeight = 'bold';
 
            document.getElementById('c-u-blocks').onmouseover = function () {showMenu('opt-user-blocks',findPos('c-u-blocks',[40,0]))};
            document.getElementById('c-u-blocks').onmouseout = function () {hideMenu('opt-user-blocks')};
            document.getElementById('c-u-blocks').style.fontWeight = 'bold';
 
            if (document.getElementById('c-u-rfx')) {
                document.getElementById('c-u-rfx').onmouseover = function () {showMenu('opt-user-rfx',findPos('c-u-rfx',[40,0]))};
                document.getElementById('c-u-rfx').onmouseout = function () {hideMenu('opt-user-rfx')};
                document.getElementById('c-u-rfx').style.fontWeight = 'bold';
                document.getElementById('opt-user-rfx').style.width = '50px';
            }
 
            if (cactions.uname.search(/(?:\d{1,3}\.){3}\d{1,3}/) == 0) hideElements(['c-u-logs','c-ux-rfa','c-ux-rfb','c-u-editcount','c-u-editsum','c-u-wcuser','c-u-sul','c-u-subpages','c-u-email','c-u-groups','c-u-rightslog']);
        }
    } );
 
    // Page options hook
    $(function () {
        if (!wgCanonicalSpecialPageName) {
            with (cactions) {
                menus[menus.length] = createMenu('page',true,Array(
                                                                ['c-p-logs',        '#'],
                    wgArticleId?                                ['c-p-history',     wgScript+'?title='+pname+'&action=history']                         :[] ,
                    wgArticleId?                                ['c-p-move',        wgScript+'?title=Special:Movepage/'+pname+'&action=view']           :[] ,
                    skin != 'vector'?                           ['c-p-watch',       wgScript+'?title='+pname+'&action=watch']                           :[] ,
                    skin != 'vector'?                           ['c-p-unwatch',     wgScript+'?title='+pname+'&action=unwatch']                         :[] ,
                    admin?                                      ['c-p-protect',     wgScript+'?title='+pname+'&action=protect']                         :[] ,
                    admin?                                      ['c-p-unprotect',   wgScript+'?title='+pname+'&action=unprotect']                       :[] ,
                    admin?                                      ['c-p-delete',      wgScript+'?title='+pname+'&action=delete']                          :[] ,
                    admin?                                      ['c-p-undelete',    wgScript+'?title=Special:Undelete/'+pname+'&action=view']           :[] ,
                    wgArticleId?                                ['c-p-diff',        wgScript+'?title='+pname+'&action=view&diff='+wgCurRevisionId]      :[] ,
                    wgArticleId?                                ['c-p-editzero',    wgScript+'?title='+pname+'&action=edit&section=0']                  :[] ,
                    wgArticleId && mwsvr == 'en.wikipedia.org'? ['c-p-wcpage',      'http://en.wikichecker.com/article/?a='+pname]                      :[] ,
                                                                ['c-p-purge',       wgScript+'?title='+pname+'&action=purge']
                ));
 
                menus[menus.length] = createMenu('page-logs',false,Array(
                                                                ['c-pl-logs',       wgScript+'?title=Special:Log&action=view&page='+pname]                  ,
                                                                ['c-pl-deletes',    wgScript+'?title=Special:Log&type=delete&page='+pname]                  ,
                                                                ['c-pl-moves',      wgScript+'?title=Special:Log&action=view&type=move&page='+pname]        ,
                    wgArticleId?                                ['c-pl-patrols',    wgScript+'?title=Special:Log&action=view&type=patrol&page='+pname]  :[] ,
                                                                ['c-pl-protects',   wgScript+'?title=Special:Log&action=view&type=protect&page='+pname]     ,
                    wgNamespaceNumber == 6?                     ['c-pl-uploads',    wgScript+'?title=Special:Log&action=view&type=upload&page='+pname]  :[]
                ));
            }
 
            if (cactions.itabs) {
                hideElements(['ca-protect','ca-unprotect','ca-delete','ca-undelete','ca-history','ca-move'],['c-p-unprotect','c-p-protect','c-p-undelete','c-p-delete']);
                if (skin != 'vector') hideElements(['ca-watch','ca-unwatch'],['c-p-unwatch','c-p-watch']);
            }
            else hideElements(['c-p-history','c-p-move','c-p-watch','c-p-unwatch','c-p-protect','c-p-unprotect','c-p-delete','c-p-undelete']);
 
            document.getElementById('c-p-logs').onmouseover = function () {showMenu('opt-page-logs',findPos('c-p-logs',[40,0]))};
            document.getElementById('c-p-logs').onmouseout = function () {hideMenu('opt-page-logs')};
            document.getElementById('c-p-logs').style.fontWeight = 'bold';
        }
    } );
 
    // shortcuts portlet hook
    $(function () {
        with (cactions) if (svars.length) {
            var portlet = document.createElement('div');
            with (portlet) {
                id = 'p-sc';
                className = (skin == 'vector') ? 'portal collapsed' : 'portlet';
            }
 
            var elements = {
                h3: document.createElement('h3'),
                div: document.createElement('div'),
                ul: document.createElement('ul'),
                li: null,
                a: null,
                txt: null
            };
            with (elements) {
                h3.appendChild(document.createTextNode('Shortcuts'));
                portlet.appendChild(h3);
 
                div.className = (skin == 'vector') ? 'body' : 'pBody';
 
                for (var i = 0; i < svars.length; i++) if (!svars[i][1].indexOf('/') || !svars[i][1].search(/http[s]?:\/\//)) {
                    li = document.createElement('li'); li.id = 's-'+svars[i][0].toLowerCase().replace(/\W/g,'');
                    a = document.createElement('a'); a.href = svars[i][1];
                    txt = document.createTextNode(svars[i][0]);
                    a.appendChild(txt); li.appendChild(a); ul.appendChild(li);
                }
                div.appendChild(ul);
                portlet.appendChild(div);
            }
 
            switch (skin) {
                case 'modern': var sidebarID = 'mw_portlets'; break;
                case 'monobook': var sidebarID = 'column-one'; break;
                case 'vector': var sidebarID = 'panel'; break;
            }
            document.getElementById(sidebarID).insertBefore(portlet,document.getElementById('p-lang'));
        }
    } );
}

 
(function () {
'use strict';
if (window.uploadLink || mw.user.isAnon()) return;
 
window.uploadLink = { // extra-object to prevent pollution of "window"
  getUserName: function () {
    var username = '';
    switch (mw.config.get('wgNamespaceNumber')) {
    case 3: // User_talk
    case 2: // User
      username = mw.config.get('wgPageName').match(/.*?\:(.*?)(\/.*)*$/)[1];
      break;
    case -1: // Special pages
      try {
        if ("Contributions" === mw.config.get('wgCanonicalSpecialPageName')) {
          if (-1 !== location.href.indexOf("\/Special:Contributions\/")) {
            username = decodeURI(location.href.match(/Special\:Contributions\/(.*?)$/)[1]);
          } else if (-1 !== location.href.indexOf(mw.config.get('wgScript'))) {
            username = mw.util.getParamValue('target');
          }
        }
        if ("Log" === mw.config.get('wgCanonicalSpecialPageName')) {
          if (mw.util.getParamValue('user')) username = mw.util.getParamValue('user');
          if (mw.util.getParamValue('page')) {
            if (/User:+./.test(mw.util.getParamValue('page'))) {
              username = mw.util.getParamValue('page').replace("User:", "");
            }
          }
        }
      } catch (ex) {}
      break;
    }
    return username;
  },
 
  install: function () {
    var link, userlink, username = encodeURI(this.getUserName());
 
      link = mw.config.get('wgScript') + '?title=' + 'Special:MyUploads';
      userlink = mw.config.get('wgScript') + '?title=' + 'Special:ListFiles/' + username;
 
    var userlinkTexts = {
      // Translations of the menu item
      i18n: {
        'be-tarask': 'Загрузкі ўдзельніка',
        'be-x-old': 'Загрузкі ўдзельніка',
        'de': 'Benutzeruploads',
        'en': 'User uploads',
        'et': 'Kasutaja üleslaadimised',
        'fr': 'Imports de l’utilisateur',
        'it': 'Caricamenti utente',
        'ml': 'ഉപയോക്താവിന്റെ അപ്\u200cലോഡുകൾ',
        'ru': 'Загрузки участника'
      }
    };
 
    var linkTextList = {
      // Translations of the menu item
      i18n: {
        'be-tarask': 'Мае загрузкі',
        'be-x-old': 'Мае загрузкі',
        'bn': 'আমার আপলোড',
        'ca': 'Les meves càrregues',
        'cs': 'Mé soubory',
        'de': 'Eigene Dateien',
        'el': 'Οι επιφορτώσεις μου',
        'en': 'My uploads', // default
        'eo': 'Miaj alŝutoj',
        'es': 'Mis archivos subidos',
        'et': 'Üleslaadimised',
        'fa': '\u067e\u0631\u0648\u0646\u062f\u0647\u200c\u0647\u0627\u06cc \u0645\u0646',
        'fi': 'Omat tallennukset',
        'fr': 'Imports',
        'gl': 'As miñas cargas',
        'he': 'העלאות שלי',
        'hr': 'Moje datoteke',
        'hu': 'Feltöltéseim',
        'it': 'miei caricamenti',
        'ja': '自分のアップロード',
        'ko': '내가 올린 파일',
        'ksh': 'Ming Dateie',
        'lb': 'Meng Fichieren',
        'mk': 'Мои подигања',
        'ml': 'എന്റെ അപ്\u200cലോഡുകൾ',
        'nb': 'Egne opplastinger',
        'nl': 'Mijn uploads',
        'nn': 'Eigne opplastingar',
        'no': 'Egne opplastinger',
        'pl': 'Moje pliki',
        'pt': 'Meus carregamentos',
        'pt-br': 'Meus carregamentos',
        'ro': 'Încărcări',
        'ru': 'Мои загрузки',
        'sq': 'Ngarkimet e mia',
        'sv': 'Mina uppladdningar',
        'tr': 'Yüklemelerim',
        'uk': 'Мої завантаження',
        'zh': '我上傳的檔案',
        'zh-hans': '我上传的文件'
      }
    };
 
    var linkTooltipList = {
      // Translations of the menu item tooltip
      i18n: {
        'be-tarask': 'Сьпіс файлаў, якія вы загрузілі',
        'be-x-old': 'Сьпіс файлаў, якія вы загрузілі',
        'bn': 'আপনার আপলোডকৃত ফাইলের তালিকা',
        'ca': 'Llista de fitxers que heu carregat',
        'cs': 'Seznam vašich načtených souborů',
        'de': 'Liste der Dateien, die du hochgeladen hast',
        'el': 'Κατάλογος των αρχείων που έχετε επιφορτώσει',
        'eo': 'Listo de dosieroj kiujn mi alŝutis',
        'en': 'List of files you have uploaded', // default
        'es': 'Lista de archivos que has subido',
        'et': 'Kõigi sinu üles laaditud failide loend',
        'fa': '\u0641\u0647\u0631\u0633\u062a \u067e\u0631\u0648\u0646\u062f\u0647\u200c\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u06a9\u0631\u062f\u0647\u200c\u0627\u06cc\u062f',
        'fi': 'Luettelo tiedostoista, jotka olet tallentanut',
        'fr': 'Liste des fichiers que vous avez importés',
        'gl': 'Lista dos ficheiros que cargou',
        'he': 'רשימת קבצים שהעלאת',
        'hr': 'Popis datoteka koje ste postavili',
        'hu': 'A feltöltött fájljaid listája',
        'it': 'Lista dei file che hai caricato',
        'ja': '自分のアップロードしたファイルの一覧',
        'ko': '내가 올린 파일의 목록',
        'ksh': 'Zeisch en Leß met de Dateije, di De sellver huhjelaade häß',
        'lb': 'Lëscht vun de Fichieren, déi Dir eropgelueden hutt',
        'mk': 'Список на податотеки што ги имате подигнато',
        'ml': 'താങ്കൾ അപ്\u200cലോഡ് ചെയ്ത പ്രമാണങ്ങളുടെ പട്ടിക',
        'nb': 'Liste over filer du har lastet opp.',
        'nl': 'Lijst van door jou geüploade bestanden',
        'nn': 'Liste over filer du har lasta opp.',
        'no': 'Liste over filer du har lastet opp.',
        'pl': 'Lista plików załadowanych przez Ciebie',
        'pt': 'Lista de arquivos que você carregou',
        'pt-br': 'Lista de arquivos que você carregou',
        'ro': 'Lista fișierelor încărcate de tine',
        'ru': 'Список загруженных вами файлов',
        'sq': 'Lista e skedave që keni ngarkuar',
        'sv': 'Lista över filer som du har laddat upp',
        'tr': 'Yüklediğiniz dosyaların listesi',
        'uk': 'Список завантажених мною файлів',
        'zh': '列出您上傳的所有檔案',
        'zh-hans': '列出您上传的所有文件'
      }
    };
 
    var linkText = linkTextList.i18n[mw.config.get('wgUserLanguage')] || linkTextList.i18n[mw.config.get('wgUserLanguage').split('-')[0]] || linkTextList.i18n.en;
    var linkTooltip = linkTooltipList.i18n[mw.config.get('wgUserLanguage')] || linkTooltipList.i18n[mw.config.get('wgUserLanguage').split('-')[0]] || linkTooltipList.i18n.en;
 
    mw.util.addPortletLink('p-personal', link, linkText, 'pt-upl', linkTooltip, '', document.getElementById('pt-logout'));
 
    var userlinkText = userlinkTexts.i18n[mw.config.get('wgUserLanguage')] || userlinkTexts.i18n[mw.config.get('wgUserLanguage').split('-')[0]] || userlinkTexts.i18n.en;
    if (username) {
      mw.util.addPortletLink('p-tb', userlink, userlinkText, 't-JSONListUploads', '', '', document.getElementById('t-log'));
    }
  } // function
}; // object
try {
  window.uploadLink.install();
} catch (ex) {}
 
})();
"https://ml.wikipedia.org/w/index.php?title=ഉപയോക്താവ്:AswiniKP/subpages.js&oldid=3701729" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്