User:Microchip08/monobook.js
(Redirected from User talk:Microchip08/monobook.css)
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
$(function () {
if( wgPageName == "User:Microchip08/monobook.js" ) {
addPortletLink ('p-cactions', '/wiki/User:Microchip08/monobook.css', 'monobook.css', 'monocssswitch');
}
if( wgPageName == "User:Microchip08/global.js" ) {
addPortletLink ('p-cactions', '/wiki/User:Microchip08/monobook.js', 'monobook.js', 'monojsswitch');
}
if( wgPageName == "User:Microchip08/monobook.css" ) {
addPortletLink ('p-cactions', '/wiki/User:Microchip08/monobook.js', 'monobook.js', 'monojsswitch');
}
if( wgPageName == "User:Microchip08/global.js" ) {
addPortletLink ('p-cactions', '/wiki/User:Microchip08/global.css', 'global.css', 'globalcssswitch');
}
if( wgPageName == "User:Microchip08/global.css" ) {
addPortletLink ('p-cactions', '/wiki/User:Microchip08/global.js', 'global.js', 'globaljsswitch');
}
if( wgPageName == "User:Microchip08/monobook.js" ) {
addPortletLink ('p-cactions', '/wiki/User:Microchip08/global.js', 'global.js', 'globaljsswitch');
}
});
//<nowiki>
//WikiMark
//
//A bookmarking tool for Wikipedia.
//
//By User:Twinzor on enwp.
//
//99% of the code is copied from other scripts on WP.
//
//If you improve my sloppy code, I would
//appreaciate it if you could drop me
//a line on my talkpage. Thanks!
//
//Reading configuration or setting defaults if not present:
if(typeof WikimarkConfigWikimarksPage == 'undefined') {
var wikimarkspage = "/WikiMarks";
}
else {
var wikimarkspage = "/"+WikimarkConfigWikimarksPage;
}
if(typeof WikimarkConfigListType == 'undefined') {
var listtype = "*";
}
else {
var listtype = WikimarkConfigListType;
}
if(typeof WikimarkConfigAddMenu == 'undefined') {
var addMenulocation = "p-cactions";
var menuPrefix = "ca-";
}
else if( WikimarkConfigAddMenu == "cactions" ) {
var addMenulocation = "p-cactions";
var menuPrefix = "ca-";
}
else if( WikimarkConfigAddMenu == "personal" ) {
var addMenulocation = "p-personal";
var menuPrefix = "pt-";
}
else if( WikimarkConfigAddMenu == "toolbox" ) {
var addMenulocation = "p-tb";
var menuPrefix = "t-";
}
else if( WikimarkConfigAddMenu == "navigation" ) {
var addMenulocation = "p-navigation";
var menuPrefix = "n-";
}
else {
var addMenulocation = "p-cactions";
var menuPrefix = "ca-";
}
if(typeof WikimarkConfigViewMenu == 'undefined') {
var viewMenulocation = "p-cactions";
var menuPrefixV = "ca-";
}
else if( WikimarkConfigViewMenu == "cactions" ) {
var viewMenulocation = "p-cactions";
var menuPrefixV = "ca-";
}
else if( WikimarkConfigViewMenu == "personal" ) {
var viewMenulocation = "p-personal";
var menuPrefixV = "pt-";
}
else if( WikimarkConfigViewMenu == "toolbox" ) {
var viewMenulocation = "p-tb";
var menuPrefixV = "t-";
}
else if( WikimarkConfigViewMenu == "navigation" ) {
var viewMenulocation = "p-navigation";
var menuPrefixV = "n-";
}
else {
var viewMenulocation = "p-cactions";
var menuPrefixV = "ca-";
}
var wikimarklinkprefix = wgServer+wgScript;
var wikimarkEncodedUserName = encodeURIComponent(wgUserName);
$(WikiMarkInit);
function WikiMarkInit () {
if(typeof WikimarkConfigViewNextTo == 'undefined') {
var viewNextto = '';
}
else {
var viewNextto = document.getElementById(menuPrefixV+WikimarkConfigViewNextTo);
}
if(typeof WikimarkConfigAddNextTo == 'undefined') {
var addNextto = '';
}
else {
var addNextto = document.getElementById(menuPrefix+WikimarkConfigAddNextTo);
}
addPortletLink (addMenulocation, 'javascript:doAddWikiMark()', 'WikiMark', menuPrefix+'addwikimark', 'WikiMark this page', '', addNextto);
addPortletLink (viewMenulocation, wikimarklinkprefix+"?title=User:"+wikimarkEncodedUserName+wikimarkspage, 'My WikiMarks', menuPrefixV+'showwikimark', 'Open your WikiMarks', '', viewNextto);
}
function doAddWikiMark () {
var wikimarkNewpage = wgPageName.replace("_", " ");
var f;
f=document.createElement("IFRAME");
f.id="WikiMarksLoader";
f.onload=function() {
var wikimark_cmt = "Adding [["+wikimarkNewpage+"]] to my WikiMarks list. (Using WikiMark)";
e=f.contentWindow.document.editform,e.wpTextbox1.value+=listtype+"["+"["+wikimarkNewpage+"]"+"]\n",e.wpSummary.value=wikimark_cmt,e.wpSave.click();
var iframe = document.getElementById('WikiMarksLoader');
jsMsg("'''"+wikimarkNewpage+"''' has been added to your WikiMarks.");
iframe.style.display="none";
};
f.src=wikimarklinkprefix+"?title=User:"+wikimarkEncodedUserName+wikimarkspage+"&action=edit",document.body.appendChild(f);
};
// </nowiki>