Actions

User

Difference between revisions of "Bezking/monobook.js"

From The RadioReference Wiki

< User:Bezking
Line 7: Line 7:
 
     s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
 
     s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
 
     document.write('<scr' + 'ipt type="text/javascript" src="'  
 
     document.write('<scr' + 'ipt type="text/javascript" src="'  
             + 'http://en.wikipedia.org/w/index.php?title=' + s
+
             + 'http://wiki.radioreference.comindex.php?title=' + s
 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'  
 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'  
 
             + 'ipt>');
 
             + 'ipt>');
Line 16: Line 16:
  
  
winc('[[User:Omegatron/monobook.js/replacetab.js]]');              // Regex replacements in the text (from [[User:Trilobite/Tools]])
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/replacetab.js]]');              // Regex replacements in the text (from [[User:Trilobite/Tools]])
winc('[[User:Omegatron/monobook.js/addlink.js]]');        /* Adds links to lists on the page, such as the personal tools section */
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/addlink.js]]');        /* Adds links to lists on the page, such as the personal tools section */
winc('[[User:Omegatron/monobook.js/edittop.js]]');        /* Adds a link to edit the top (intro) section of an article */
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/edittop.js]]');        /* Adds a link to edit the top (intro) section of an article */
/* winc('[[User:Omegatron/monobook.js/unwatch.js]]');          Adds unwatch links to watchlist entries */
+
/* winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/unwatch.js]]');          Adds unwatch links to watchlist entries */
/*winc('[[User:Omegatron/monobook.js/autolinker.js]]');      Make [[links]] and {{templates}} clickable */
+
/*winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/autolinker.js]]');      Make [[links]] and {{templates}} clickable */
  
  
Line 43: Line 43:
 
/* Add some extra tabs with different functionalities. */
 
/* Add some extra tabs with different functionalities. */
  
winc('[[User:Omegatron/monobook.js/replacetab.js]]');              // Regex replacements in the text (from [[User:Trilobite/Tools]])
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/replacetab.js]]');              // Regex replacements in the text (from [[User:Trilobite/Tools]])
winc('[[User:Omegatron/monobook.js/unverified.js]]');              // Tag unverified images (from [[User:Trilobite/Tools]])
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/unverified.js]]');              // Tag unverified images (from [[User:Trilobite/Tools]])
// winc('[[User:Omegatron/monobook.js/addsincetab.js]]');          // Shows difference between my last edit and current version ([[Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited]])
+
// winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/addsincetab.js]]');          // Shows difference between my last edit and current version ([[Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited]])
winc('[[User:Omegatron/monobook.js/dashfixer.js]]');                // Converts -- into — and so on (User:Omegatron)
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/dashfixer.js]]');                // Converts -- into — and so on (http://en.wikipedia.org/wiki/User:Omegatron)
winc('[[User:Omegatron/monobook.js/unitformatter.js]]');            // Formats units according to SI (User:Omegatron)
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/unitformatter.js]]');            // Formats units according to SI (http://en.wikipedia.org/wiki/User:Omegatron)
winc('[[User:Omegatron/monobook.js/mathcharacterfixer.js]]');      // Fixes up some math characters (not TeX) (User:Omegatron)
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/mathcharacterfixer.js]]');      // Fixes up some math characters (not TeX) (http://en.wikipedia.org/wiki/User:Omegatron)
winc('[[User:Omegatron/monobook.js/headingformattingfixer.js]]');  // Adds and removes whitespace to make formatting consistent and readable (User:Omegatron)
+
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/headingformattingfixer.js]]');  // Adds and removes whitespace to make formatting consistent and readable (http://en.wikipedia.org/wiki/User:Omegatron)
  
 
winc('[[User:Nohat/IPA.js]]');  // IPA pop-ups?
 
winc('[[User:Nohat/IPA.js]]');  // IPA pop-ups?
Line 59: Line 59:
 
// install [[User:Cacycle/diff]] text diff code
 
// install [[User:Cacycle/diff]] text diff code
 
document.write('<script type="text/javascript" src="'
 
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/diff.js'
+
+ 'http://wiki.radioreference.comindex.php?title=User:Cacycle/diff.js'
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
  
 
// install [[User:Pilaf/Live_Preview]] page preview tool
 
// install [[User:Pilaf/Live_Preview]] page preview tool
 
document.write('<script type="text/javascript" src="'
 
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Pilaf/livepreview.js'
+
+ 'http://wiki.radioreference.comindex.php?title=User:Pilaf/livepreview.js'
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
  
 
// install [[User:Mboverload/RegExTypoFix|RegExTypoFix]] common typo fixer
 
// install [[User:Mboverload/RegExTypoFix|RegExTypoFix]] common typo fixer
 
document.write('<script type="text/javascript" src="'
 
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/RegExTypoFix.js'
+
+ 'http://wiki.radioreference.comindex.php?title=User:Cacycle/RegExTypoFix.js'
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
  
Line 76: Line 76:
 
// install [[User:Cacycle/wikEd]] editing page extension
 
// install [[User:Cacycle/wikEd]] editing page extension
 
document.write('<script type="text/javascript" src="'
 
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+
+ 'http://wiki.radioreference.comindex.php?title=User:Cacycle/wikEd.js'
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
 
/* <pre> */
 
/* <pre> */
Line 112: Line 112:
 
     /* Adds some links to my ''personal tools'' section ("My monobook.js", "My monobook.css", "My sandbox") */
 
     /* Adds some links to my ''personal tools'' section ("My monobook.js", "My monobook.css", "My sandbox") */
  
     addLink('p-personal', '/wiki/User:Omegatron/monobook.js', 'My monobook.js', 'pt-monobookjs', 'monobook.js is used for storing user javascripts', '', 'pt-logout');
+
     addLink('p-personal', '/wiki/http://en.wikipedia.org/wiki/User:Omegatron/monobook.js', 'My monobook.js', 'pt-monobookjs', 'monobook.js is used for storing user javascripts', '', 'pt-logout');
     addLink('p-personal', '/wiki/User:Omegatron/monobook.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', 'pt-logout');
+
     addLink('p-personal', '/wiki/http://en.wikipedia.org/wiki/User:Omegatron/monobook.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', 'pt-logout');
     addLink('p-personal', '/wiki/User:Omegatron/Sandbox', 'My sandbox', 'pt-sandbox', 'My sandbox is used for testing things', '', 'pt-logout');
+
     addLink('p-personal', '/wiki/http://en.wikipedia.org/wiki/User:Omegatron/Sandbox', 'My sandbox', 'pt-sandbox', 'My sandbox is used for testing things', '', 'pt-logout');
     addLink('p-personal', '/w/index.php?title=Special%3AAllpages&from=Omegatron&namespace=2', 'My subpages', 'pt-subpages', 'Subpages of my userspace', '', 'pt-logout');
+
     addLink('p-personal', '/index.php?title=Special%3AAllpages&from=Omegatron&namespace=2', 'My subpages', 'pt-subpages', 'Subpages of my userspace', '', 'pt-logout');
  
 
     /* Shorten "edit this page" to just "edit" */
 
     /* Shorten "edit this page" to just "edit" */
Line 143: Line 143:
  
 
document.write('<scr' + 'ipt type="text/javascript" src="'  
 
document.write('<scr' + 'ipt type="text/javascript" src="'  
             + 'http://en.wikipedia.org/w/index.php?title=User:Omegatron/monobook.js/audiopops.js'
+
             + 'http://wiki.radioreference.comindex.php?title=http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/audiopops.js'
 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'  
 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></scr'  
 
             + 'ipt>');
 
             + 'ipt>');

Revision as of 09:38, 9 December 2007

/* <pre> */


/* This function is used to include scripts from other Wikipedia pages in mine.  I got it from [[User:Quarl/monobook.js]]. */

function winc(s) {
    s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
    document.write('<scr' + 'ipt type="text/javascript" src="' 
             + 'http://wiki.radioreference.comindex.php?title=' + s
             + '&action=raw&ctype=text/javascript&dontcountme=s"></scr' 
             + 'ipt>');
}


/* Included functions */


winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/replacetab.js]]');               // Regex replacements in the text (from [[User:Trilobite/Tools]])
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/addlink.js]]');         /* Adds links to lists on the page, such as the personal tools section */
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/edittop.js]]');         /* Adds a link to edit the top (intro) section of an article */
/* winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/unwatch.js]]');          Adds unwatch links to watchlist entries */
/*winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/autolinker.js]]');      Make [[links]] and {{templates}} clickable */


/* Let's try a different unwatch script */

winc('[[User:Alex Smotrov/wlunwatch.js]]');



if (wgCanonicalSpecialPageName && wgCanonicalSpecialPageName == 'Watchlist') 
addOnloadHook(function () {
 var lnk = document.createElement('a');
 var text = (window.wgAjaxWatch ? wgAjaxWatch.unwatchMsg : 'Unwatch') + '…';
 lnk.appendChild(document.createTextNode(text));
 lnk.href = 'javascript:importScript("ajaxUnwatch")';
 var frm = document.getElementsByTagName('form')[0];
 frm.parentNode.insertBefore(document.createTextNode(' | '), frm);
 frm.parentNode.insertBefore(lnk, frm);
})


/* Add some extra tabs with different functionalities. */

winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/replacetab.js]]');               // Regex replacements in the text (from [[User:Trilobite/Tools]])
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/unverified.js]]');               // Tag unverified images (from [[User:Trilobite/Tools]])
// winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/addsincetab.js]]');           // Shows difference between my last edit and current version ([[Wikipedia:WikiProject User scripts/Scripts/Changes since I last edited]])
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/dashfixer.js]]');                // Converts -- into — and so on (http://en.wikipedia.org/wiki/User:Omegatron)
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/unitformatter.js]]');            // Formats units according to SI (http://en.wikipedia.org/wiki/User:Omegatron)
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/mathcharacterfixer.js]]');       // Fixes up some math characters (not TeX) (http://en.wikipedia.org/wiki/User:Omegatron)
winc('[[http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/headingformattingfixer.js]]');   // Adds and removes whitespace to make formatting consistent and readable (http://en.wikipedia.org/wiki/User:Omegatron)

winc('[[User:Nohat/IPA.js]]');   // IPA pop-ups?


/* </pre> */
// installation of the wikEd editing page extension

// install [[User:Cacycle/diff]] text diff code
document.write('<script type="text/javascript" src="'
+ 'http://wiki.radioreference.comindex.php?title=User:Cacycle/diff.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Pilaf/Live_Preview]] page preview tool
document.write('<script type="text/javascript" src="'
+ 'http://wiki.radioreference.comindex.php?title=User:Pilaf/livepreview.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Mboverload/RegExTypoFix|RegExTypoFix]] common typo fixer
document.write('<script type="text/javascript" src="'
+ 'http://wiki.radioreference.comindex.php?title=User:Cacycle/RegExTypoFix.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// install [[User:Cacycle/wikEd international]] translation here

// install [[User:Cacycle/wikEd]] editing page extension
document.write('<script type="text/javascript" src="'
+ 'http://wiki.radioreference.comindex.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/* <pre> */


/* This function is used to include individual scripts from Quarl's pages in mine. */

function qinc(s) {
    document.write('<scr' + 'ipt type="text/javascript" src="' 
             + 'http://www.cubewano.org/wpt/scripts/' + s
             + '.js"></scr' 
             + 'ipt>');
}


/* Move things around so that sidebar can be fixed in position and content can scroll independently */
/* See [[meta:Help:User style/floating quickbar]] */

addOnloadHook(function () {
    var content = document.getElementById("column-content");    // Find the main content column

    var footer = document.getElementById("footer");  // Find the footer
    footer.parentNode.removeChild(footer);    // Remove the footer from the global wrapper
    content.appendChild(footer);    // Place footer at the end of the content column;

    var tabs = document.getElementById("p-cactions");   // Find the top tab list
    tabs.parentNode.removeChild(tabs);    // Remove the tab list from the side column
    content.insertBefore(tabs,content.firstChild);    // Place tab list at the beginning of the content column
});

/* Do some things when the page loads */

addOnloadHook(function () {

    /* Adds some links to my ''personal tools'' section ("My monobook.js", "My monobook.css", "My sandbox") */

    addLink('p-personal', '/wiki/http://en.wikipedia.org/wiki/User:Omegatron/monobook.js', 'My monobook.js', 'pt-monobookjs', 'monobook.js is used for storing user javascripts', '', 'pt-logout');
    addLink('p-personal', '/wiki/http://en.wikipedia.org/wiki/User:Omegatron/monobook.css', 'My monobook.css', 'pt-monobookcss', 'monobook.css is used for storing user CSS styles', '', 'pt-logout');
    addLink('p-personal', '/wiki/http://en.wikipedia.org/wiki/User:Omegatron/Sandbox', 'My sandbox', 'pt-sandbox', 'My sandbox is used for testing things', '', 'pt-logout');
    addLink('p-personal', '/index.php?title=Special%3AAllpages&from=Omegatron&namespace=2', 'My subpages', 'pt-subpages', 'Subpages of my userspace', '', 'pt-logout');

    /* Shorten "edit this page" to just "edit" */
    if(document.getElementById('ca-edit')) {
        document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';
    }

});


/* Duplicate all the tabs from the top on the bottom of the content box, too.  */
/* From [[Wikipedia:WikiProject User scripts/Scripts/Duplicate tabs at bottom]]. */

addOnloadHook(function () {
    var tabs = document.getElementById('p-cactions').cloneNode(true);
    tabs.id = 'mytabs';
    var listitems = tabs.getElementsByTagName('LI');
    for (i=0;i<listitems.length;i++) {
        if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id;
    }

    var content = document.getElementById("content");    // Find the content div
    content.parentNode.insertBefore(tabs, content.nextSibling);    // Place tab list right after content div
});

/* Popup audio help links */

document.write('<scr' + 'ipt type="text/javascript" src="' 
             + 'http://wiki.radioreference.comindex.php?title=http://en.wikipedia.org/wiki/User:Omegatron/monobook.js/audiopops.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s"></scr' 
             + 'ipt>');



/* </pre> */