User:Cacycle/wikEd dev.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 4,201:
 
// <table>
 
obj.html = obj.html.replace(/[\s\u0000]*<table>[\s\u0000]*(\|-(?=[\n\u0000]))?/g, '\u0000\u0000{|\u0000');
obj.html = obj.html.replace(/[\s\u0000]*<(table) +([^>]*)>[\s\u0000]*(\|-(?=[\n\u0000]))?/g,
Line 4,223 ⟶ 4,222:
 
// internal wiki links
WED();
WED('linkPar', linkPar);
 
WED('wikEdServer', wikEdServer);
WED('wikEdArticlePath', wikEdArticlePath);
WED('wikEdScriptPath', wikEdScriptPath);
 
// get the title="" parameter
Line 4,244 ⟶ 4,237:
 
// get wiki article name from url parameter list
 
// class="internal" href="../index.php?title=Special:Booksources&amp;isbn=1894840364" _moz_dirty=""
regExpStr = ' href=\\"(' + wikEdServer + '|\\.|(\\.\\.\/)*\\.\\.)(' + wikEdScriptPath + '|\\/)index\\.php\\?[^\\"]*?\\btitle=([^\\"]*?)(&amp;|\\")';
regExp = new RegExp(regExpStr);
Line 4,254 ⟶ 4,245:
linkArticle = linkArticle.replace(/_/g, ' ');
linkArticle = decodeURIComponent(linkArticle);
WED('param', '!');
 
// ISBN links
Line 4,261 ⟶ 4,251:
regExpMatch = regExp.exec(linkPar);
if (regExpMatch != null) {
WED('ISBN', var isbn = 'regExpMatch[4]');
regExpMatch = regExp/((\d\-?){13}|(\d\-?){10})/.exec(linkAddrlinkText);
return('ISBN ' + regExpMatch[4]);
if (regExpMatch != null) {
isbn = regExpMatch[1];
}
return('ISBN ' + regExpMatch[4]isbn);
}
}
Line 4,274 ⟶ 4,268:
if (regExpMatch != null) {
linkArticle = regExpMatch[4];
 
WED('url', '!');
WED('regExpMatch[1]', regExpMatch[1]);
WED('regExpMatch[2]', regExpMatch[2]);
WED('regExpMatch[3]', regExpMatch[3]);
WED('regExpMatch[4]', regExpMatch[4]);
WED('regExpMatch[5]', regExpMatch[5]);
 
if (linkArticle != '') {
linkArticle = linkArticle.replace(/_/g, ' ');
Line 4,306 ⟶ 4,292:
return('[[' + linkArticle + imgWidth + ']]');
}
}
 
// ISBN link
regExpStr = '^(' + wikEdServer + '|\\.|(\\.\\.\/)*\\.\\.)(' + wikEdScriptPath + '|\\/)index\\.php\\?.*?\\btitle=.*?&amp;isbn=(\d+)';
regExp = new RegExp(regExpStr);
regExpMatch = regExp.exec(linkAddr);
if (regExpMatch != null) {
return('ISBN ' + regExpMatch[2]);
}