( ) Tag: sourceedit |
( ) Tag: sourceedit |
||
Line 1: | Line 1: | ||
Hi! Thanks for contacting me. |
Hi! Thanks for contacting me. |
||
− | I already posted and got a fix from [[User:SuperSajuuk]] '''[http://community.wikia.com/wiki/User_blog_comment:DaNASCAT/Technical_Update:_September_26,_2016/@comment-SpikeToronto-20160927181142?permalink=1119391#comm-1119391 here]'''. |
+ | I already posted and got a fix from [[User:SuperSajuuk]] '''[http://community.wikia.com/wiki/User_blog_comment:DaNASCAT/Technical_Update:_September_26,_2016/@comment-SpikeToronto-20160927181142?permalink=1119391#comm-1119391 here]'''. That fix is shown below, collapsed. |
+ | |||
+ | <source lang="JavaScript"> |
||
+ | |||
+ | // Add extra AccountNav options |
||
+ | // Prevent adding duplicate links (Added by Cblair91) |
||
+ | if(!window.CustomButtonsLoaded) |
||
+ | addOnloadHook(addCustomLinks); |
||
+ | var CustomButtonsLoaded = true; |
||
+ | |||
+ | function addCustomLinks() { |
||
+ | // Adds a link to User:SpikeToronto/talk |
||
+ | $('<li><a href="/wiki/User:SpikeToronto/talk">My talk</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first'); |
||
+ | // END Adds a link to User:SpikeToronto/talk |
||
+ | |||
+ | // Adds a link to User:SpikeToronto/Sandboxes |
||
+ | $('<li><a href="/wiki/User:SpikeToronto/Sandboxes">My sandboxes</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first'); |
||
+ | // END Adds a link to User:SpikeToronto/Sandboxes |
||
+ | |||
+ | // Adds a link to User_blog:SpikeToronto |
||
+ | $('<li><a href="/wiki/User_blog:SpikeToronto">My blogs</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first'); |
||
+ | // END Adds a link to User_blog:SpikeToronto |
||
+ | |||
+ | // Adds a link to Special:Log/SpikeToronto |
||
+ | $('<li><a href="/wiki/Special:Log/SpikeToronto">My logs</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first'); |
||
+ | // END Adds a link to Special:Log/SpikeToronto |
||
+ | |||
+ | // Adds a link to User:SpikeToronto/Status |
||
+ | $('<li><a href="/wiki/User:SpikeToronto/Status?action=edit">My status</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first'); |
||
+ | // END Adds a link to User:SpikeToronto/Status |
||
+ | |||
+ | // Adds a link to User:SpikeToronto/List |
||
+ | $('<li><a href="/wiki/User:SpikeToronto/List">My userspace</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first'); |
||
+ | // END Adds a link to User:SpikeToronto/List |
||
+ | } |
||
+ | // END Add extra AccountNav options |
||
+ | |||
+ | </source> |
||
Given current restrictions on where we can edit personal JS (i.e., so JS (sub-)subpages in personal userspace), I implemented the new version differently. I now put the code at '''[[User:SpikeToronto/wikia.js]]''', which for you would be '''[[Special:MyPage/wikia.js|here]]'''. |
Given current restrictions on where we can edit personal JS (i.e., so JS (sub-)subpages in personal userspace), I implemented the new version differently. I now put the code at '''[[User:SpikeToronto/wikia.js]]''', which for you would be '''[[Special:MyPage/wikia.js|here]]'''. |
Revision as of 05:07, 1 October 2016
Hi! Thanks for contacting me.
I already posted and got a fix from User:SuperSajuuk here. That fix is shown below, collapsed.
// Add extra AccountNav options
// Prevent adding duplicate links (Added by Cblair91)
if(!window.CustomButtonsLoaded)
addOnloadHook(addCustomLinks);
var CustomButtonsLoaded = true;
function addCustomLinks() {
// Adds a link to User:SpikeToronto/talk
$('<li><a href="/wiki/User:SpikeToronto/talk">My talk</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first');
// END Adds a link to User:SpikeToronto/talk
// Adds a link to User:SpikeToronto/Sandboxes
$('<li><a href="/wiki/User:SpikeToronto/Sandboxes">My sandboxes</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first');
// END Adds a link to User:SpikeToronto/Sandboxes
// Adds a link to User_blog:SpikeToronto
$('<li><a href="/wiki/User_blog:SpikeToronto">My blogs</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first');
// END Adds a link to User_blog:SpikeToronto
// Adds a link to Special:Log/SpikeToronto
$('<li><a href="/wiki/Special:Log/SpikeToronto">My logs</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first');
// END Adds a link to Special:Log/SpikeToronto
// Adds a link to User:SpikeToronto/Status
$('<li><a href="/wiki/User:SpikeToronto/Status?action=edit">My status</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first');
// END Adds a link to User:SpikeToronto/Status
// Adds a link to User:SpikeToronto/List
$('<li><a href="/wiki/User:SpikeToronto/List">My userspace</a></li>').insertBefore('.wds-global-navigation__user-menu .wds-dropdown__content li:first');
// END Adds a link to User:SpikeToronto/List
}
// END Add extra AccountNav options
Given current restrictions on where we can edit personal JS (i.e., so JS (sub-)subpages in personal userspace), I implemented the new version differently. I now put the code at User:SpikeToronto/wikia.js, which for you would be here.
I then import that script at User:SpikeToronto/global.js, which for you would be here using this code:
//Add extra AccountNav options
importScriptPage('User:SpikeToronto/wikia.js', 'community');
//END Add extra AccountNav options
which for you would read as
//Add extra AccountNav options
importScriptPage('User:C.Syde65/wikia.js', 'community');
//END Add extra AccountNav options
Hope this helps! If you have any questions, please feel free to ask here in this thread.