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

Content deleted Content added
No edit summary
No edit summary
Line 4,227:
 
// get the title="" parameter
regExpStr = ' href=\\"(' + wikEdServer + '|\\/|\\.\\/|(\\.\\.\/)+)(' + wikEdArticlePath + '|\\/\\.\\.|' + wikEdScriptPath + '|)([^\\">]*)\\"';
regExp = new RegExp(regExpStr);
regExpMatch = regExp.exec(linkPar);
Line 4,235:
regExpMatch = regExp.exec(linkPar);
if (regExpMatch != null) {
linkTitle = regExpMatch[21];
}
}
 
// get wiki article name from url parameter list
regExpStr = ' href=\\"(' + wikEdServer + '|\\/|\\.\\/|(\\.\\.\/)+)(' + wikEdScriptPath + '|)index\\.php\\?[^\\"]*?\\btitle=([^\\"]*?)(&|\\")';
regExp = new RegExp(regExpStr);
regExpMatch = regExp.exec(linkPar);
if (regExpMatch != null) {
linkArticle = regExpMatch[24];
if (linkArticle != '') {
linkArticle = linkArticle.replace(/_/g, ' ');
linkArticle = decodeURIComponent(linkArticle);
WED('param', '!');
 
// ISBN links
regExpStr = ' href=\\"(' + wikEdServer + '|\\/|\\.\\/|(\\.\\.\/)+)(' + wikEdScriptPath + '|)index\\.php\\?[^\\"]*?\\bisbn=(\\d+)(&|\\")';
regExp = new RegExp(regExpStr);
regExpMatch = regExp.exec(linkPar);
if (regExpMatch != null) {
returnWED('ISBN ', + 'regExpMatch[24]');
return('ISBN ' + regExpMatch[4]);
}
}
Line 4,261 ⟶ 4,263:
// get wiki article name from url
if (linkArticle == '') {
regExpStr = ' href=\\"(' + wikEdServer + '|\\/|\\.\\/|(\\.\\.\/)+)(' + wikEdArticlePath + '|)([^\\"]*)\\"';
regExp = new RegExp(regExpStr);
regExpMatch = regExp.exec(linkPar);
if (regExpMatch != null) {
linkArticle = regExpMatch[24];
if (linkArticle != '') {
linkArticle = linkArticle.replace(/_/g, ' ');
linkArticle = decodeURIComponent(linkArticle);
WED('url', '!');
}
}