Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User:Shane/bsgbook.js: Difference between revisions

From the only original and legitimate Battlestar Wiki: the free-as-in-beer, non-corporate, open-content encyclopedia, analytical reference, and episode guide on all things Battlestar Galactica. Accept neither subpar substitutes nor subpar clones.
Shane (talk | contribs)
No edit summary
Shane (talk | contribs)
No edit summary
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* <pre><nowiki> */
/* <pre><nowiki> */


// ========== Basic Functions Needed ==========
function import_external(page) {
 
document.write('<script type="text/javascript" src="http://en.battlestarwiki.org/w/index.php?title=' + page + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
function addlilink(tabs, url, name, id, title, key) {
}  
var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if (id) {
li.id = id;
}
li.appendChild(na);
    tabs.appendChild(li);
    na.accesskey = key;
    var pref = 'alt-';
    if ((((clientPC.indexOf('AppleWebKit') != -1) && (clientPC.indexOf('spoofer') == -1)) || navigator.userAgent.toLowerCase().indexOf( 'mac' ) != -1 )) { pref = 'control-'; }
    if (clientPC.indexOf('opera') != -1) { pref = 'shift-esc-'; }
    if (key && title) { na.title = title + ' [' + pref + key + ']'; }
    else if (title) { na.title = title; }
    else if (key) { na.title = '[' + pref + key + ']'; }
akeytt();
    return li;
}


function addToolboxLink(url, name, id){
// Required
    var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
import_external('User:Shane/bsgbook.js/default.js');
    addlilink(tb, url, name, id);
}


function addTab(url, name, id, title, key) {
// Scripts
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
import_external('User:Shane/bsgbook.js/tabs.js');
    addlilink(tabs, url, name, id, title, key);
import_external('User:Shane/bsgbook.js/autoreport.js');
}


function getPname(alt) {
// Test Java Script Only
z = document.getElementById("content").childNodes;
//import_external('User:Shane/bsgbook.js/test.js');
for (var n = 0; n < z.length; n++) {
if (z[n].className == "firstHeading") {
stmpPage = z[n].textContent.replace(/Editing /,"");
if (alt == "name") {
stmpPage = stmpPage.replace(getNameSpace()+":","");
}
return stmpPage;
}
};
}


function getNameSpace() {
var admin = "true";
z = document.getElementById("content").childNodes;
var checkuser = "true";
for (var n = 0; n < z.length; n++) {
var debug = "false";
if (z[n].className == "firstHeading") {
if (z[n].textContent.indexOf("Template") != -1) { return "Template"; }
if (z[n].textContent.indexOf("Battlestar Wiki") != -1) { return "Battlestar Wiki"; }
if (z[n].textContent.indexOf("Podcast") != -1) { return "Podcast"; }
if (z[n].textContent.indexOf("Portal") != -1) { return "Portal"; }
if (z[n].textContent.indexOf("Sources") != -1) { return "Sources"; }
if (z[n].textContent.indexOf("Quotes") != -1) { return "Quotes"; }
if (z[n].textContent.indexOf("Image") != -1) { return "Image"; }
if (z[n].textContent.indexOf("Category") != -1) { return "Category"; }
if (z[n].textContent.indexOf("User") != -1) { return "User"; }
return "Article";
}
};
}
 
 
function import_external(page) {
document.write('<script type="text/javascript" src="http://www.battlestarwiki.org/en/index.php?title=' + page + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}


import_external('User:Shane/myskin.js/tabs.js');
// Do not copy below this line.
import_external('User:Shane/myskin.js/autoreport.js');
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');


/* </nowiki></pre> */
/* </nowiki></pre> */

Latest revision as of 10:22, 4 May 2007

/* <pre><nowiki> */

function import_external(page) {
document.write('<script type="text/javascript" src="http://en.battlestarwiki.org/w/index.php?title=' + page + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
} 

// Required
import_external('User:Shane/bsgbook.js/default.js');

// Scripts
import_external('User:Shane/bsgbook.js/tabs.js');
import_external('User:Shane/bsgbook.js/autoreport.js');

// Test Java Script Only
//import_external('User:Shane/bsgbook.js/test.js');

var admin = "true";
var checkuser = "true";
var debug = "false";

// Do not copy below this line.
// install [[User:Cacycle/wikEd]] in-browser text editor
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/* </nowiki></pre> */