User:Salix alba/TDSkell.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | This user script seems to have a documentation page at User:Salix alba/TDSkell and an accompanying .css page at User:Salix alba/TDSkell.css. |
function TDSkel($) {
var teststr = "<blockquote class=\"templatequote\"><div class=\"Bug6200\">{{{text|{{{quote|{{{1|<noinclude>{{lorem ipsum}}</noinclude>"+
"<includeonly>{{error|Error: No text given for quotation (or equals sign used in the actual argument to an unnamed parameter)}}"+
"</includeonly>}}}}}}}}}</div>{{#if:{{{sign|{{{cite|{{{2|<noinclude>TRUE</noinclude>}}}}}}}}}"+
"|<div class=\"templatequotecite\">—{{{sign|{{{cite|{{{2|<noinclude>[[Someone's full name|Someone]]</noinclude>}}}}}}}}}{{#if:"+
"{{{source|{{{3|<noinclude>TRUE</noinclude>}}}}}}"+
" |, <cite>{{{source|{{{3|<noinclude>Source</noinclude>}}}}}}</cite>"+
" }}</div>"+
"}}</blockquote><noinclude>"+
"{{documentation}}"+
"<!-- Add cats and interwikis to the /doc subpage, not here! -->"+
"</noinclude>";
function start() {
alert("TDSkel 0.11");
findVars(teststr);
var pagename = "Template:Quote";
var URL = "http://en.wikipedia.org/w/index.php";
$.ajax({
url: URL,
data: { title: pagename, action: "raw" },
dataType: "text"
}).done(doneAjax);
}
function doneAjax(data) {
console.log("DoneAjax");
console.log("Match:", data.slice(0, 100));
console.log("DoneAjaxdone");
}
function findVars(data) {
console.log("findVars");
var pat = /\{\{\{([^\{\|\}]+)/g;
var matches;
while((matches=pat.exec(data)) != null) {
// if( console && console.log ) {
console.log("Match:", matches[0]);
// }
console.log("findVars done");
}
}
////////// START //////////
start();
}
if( $.inArray( mw.config.get('wgNamespaceNumber'), [ 2, 10 ] ) !== -1 && $.inArray( mw.config.get('wgAction'), [ 'edit', 'submit' ] ) !== -1 ) {
$(document).ready(TDSkel);
}