User:Cqm/startwiki.js

/** __NOWYSIWYG__ * Re-purposing start a wiki button * @author Cåm */ importArticles ({	type: "style",	article: 'u:camtest:User:Cåm/startWiki.css' }); /** * For talk page link * To do: Find out what Blogs are for * Article comments seem to co-exist along with Talk pages, not sure what to do with these */ var namespace // Check for mainspace if ( mw.config.get( 'wgNamespaceNumber' ) == '0' ) { namespace = 'Talk'; // Check for Message Wall, Message Wall Greeting, User blog, User blog comment, Board, Topic, Thread } else if (mw.config.get( 'wgNamespaceNumber' ) == ('1200' || '1202' || '500' || '501' || '2000' || '2002' || '1201' )) { namespace = mw.config.get( 'wgCanonicalNamespace' ); // Check for talk namespace } else if ( mw.config.get( 'wgNamespaceNumber' ) % 2 != 0 ) { namespace = mw.config.get( 'wgCanonicalNamespace' ); // Switch to talk namespace } else { namespace = mw.config.get( 'wgCanonicalNamespace' ) + '_talk'; } /** * Admin only tools * Returning undefined for some reason */ var admintools if( $.inArray( 'sysop', mw.config.get( 'wgUserGroups' ) ) > -1 ) { admintools = 'DeleteProtect'; } else { admintools = ''; } /** * Edit tools * Links to: Talk page, History, Move, Delete (admin only), Protect (admin only). */ if( mw.config.get( 'wgAction' ) == 'edit' ) { $( '.start-a-wiki' ).replaceWith('  Edit tools TalkHistory</a></li><a href="/wiki/Special:MovePage/' + mw.config.get( 'wgPageName' ) + '" title="Move">Move</a></li>' + admintools + '</ul>   </li>'); } else { /** * Admin tools * Links to: MediaWiki:Wikia.js, MediaWiki:Wikia.css, MediaWiki:Wiki-navigation, MediaWiki:Common.js, MediaWiki:Common.css * To do: Add ability to customise links */	$( '.start-a-wiki' ).replaceWith('  Admin pages <ul class="startwiki-list"><a href="/wiki/MediaWiki:Wikia.js" title="MediaWiki:Wikia.js">MediaWiki:Wikia.js</a></li><a href="/wiki/MediaWiki:Wikia.css" title="MediaWiki:Wikia.css">MediaWiki:Wikia.css</a></li><a href="/wiki/MediaWiki:Wiki-navigation" title="MediaWiki:Wiki-navigation">MediaWiki:Wiki-navigation</a></li><a href="/wiki/MediaWiki:Common.js" title="MediaWiki:Common.js">MediaWiki:Common.js</a></li><a href="/wiki/MediaWiki:Common.css" title="MediaWiki:Common.css">MediaWiki:Common.css</a></li></ul>   </li>'); }

/* */