Community Central
Community Central
mNo edit summary
Tag: sourceedit
No edit summary
Tag: sourceedit
Line 18: Line 18:
 
]
 
]
 
});
 
});
  +
  +
addOnloadHook( addSandboxLink );
  +
  +
function addSandboxLink() {
  +
var dropdown = document.querySelector( "#globalNavigation .wds-list" ),
  +
li = document.createElement( "li" ),
  +
a = document.createElement( "a" ),
  +
isKorean = location.host.split(".")[0] == "ko",
  +
linkName = isKorean ? "내 연습장" : "My Sandbox",
  +
articleName = isKorean ? "연습장" : "Sandbox";
  +
  +
li.appendChild( a );
  +
a.appendChild( document.createTextNode( linkName ) );
  +
a.setAttribute( "href", "/wiki/User:Cafeinlove/" + articleName );
  +
  +
dropdown.insertBefore( li, dropdown.childNodes[0] );
  +
}

Revision as of 13:12, 12 January 2017

importArticles({
    type: 'script',
    articles: [
        /*
        * PurgeButton
        * @author Uberfuzzy, Grunny, Pecoes
        */
        'u:dev:PurgeButton/code.js',
        /*
        * Ajax Batch Delete
        * @description Delete listed multiple pages
        * Does not need to go to Special:BlankPage to use
        * Includes the option to protect after deleting
        * Includes the option to grab a whole category's contents
        * @author Ozank Cx
        */
        'u:dev:AjaxBatchDelete/code.2.js'
    ]
});

addOnloadHook( addSandboxLink );

function addSandboxLink() {
    var dropdown = document.querySelector( "#globalNavigation .wds-list" ),
        li = document.createElement( "li" ),
        a = document.createElement( "a" ),
        isKorean = location.host.split(".")[0] == "ko",
        linkName = isKorean ? "내 연습장" : "My Sandbox",
        articleName = isKorean ? "연습장" : "Sandbox";
    
    li.appendChild( a );
    a.appendChild( document.createTextNode( linkName ) );
    a.setAttribute( "href", "/wiki/User:Cafeinlove/" + articleName  );
    
    dropdown.insertBefore( li, dropdown.childNodes[0] );
}