מדיה ויקי:Gadget-TemplatesExternalLinks.js: הבדלים בין גרסאות בדף
עד סוף הקטגוריה "תבניות קישורים חיצוניים" - סה"כ חמישים ומשהו. |
אנצ דעת |
||
| שורה 35: | שורה 35: | ||
b.onclick = function() { | b.onclick = function() { | ||
var matches = this.urlInput.value.match(this.regexDict.regex); | var matches = this.urlInput.value.match(this.regexDict.regex); | ||
if (matches) | if (matches) | ||
for (var i = 1; i < matches.length; i++) { | for (var i = 1; i < matches.length; i++) { | ||
var fieldIndex = this.regexDict.params[i-1]; //parameters are counted from one, we count from 0. | var fieldIndex = this.regexDict.params[i-1]; //parameters are counted from one, we count from 0. | ||
| שורה 41: | שורה 41: | ||
this.doc.allFields[fieldIndex-1].value = matches[i]; | this.doc.allFields[fieldIndex-1].value = matches[i]; | ||
} | } | ||
} | } | ||
body.appendChild(b); | body.appendChild(b); | ||
| שורה 74: | שורה 73: | ||
body.appendChild(refCheckBox); | body.appendChild(refCheckBox); | ||
body.appendChild(doc.createElement("p")); | body.appendChild(doc.createElement("p")); | ||
b = doc.createElement("input"); | |||
b.type = "button"; | |||
b.value = "אישור"; | |||
b.father = this; | |||
b.doc = doc; | |||
b.popup = popup; | |||
b.refCheckBox = refCheckBox; | |||
b.onclick = function() { | |||
this.father.createAndInsertLinkTemplate(this.doc.templateName, this.doc.allFields, this.refCheckBox.checked); | this.father.createAndInsertLinkTemplate(this.doc.templateName, this.doc.allFields, this.refCheckBox.checked); | ||
this.popup.close(); | this.popup.close(); | ||
} | } | ||
body.appendChild( | body.appendChild(b); | ||
var | var b = doc.createElement("input"); | ||
b.type = "button"; | |||
b.value = "ביטול"; | |||
b.popup = popup; | |||
b.onclick = function() { | |||
this.popup.close(); | this.popup.close(); | ||
} | } | ||
| שורה 129: | שורה 128: | ||
popupPredefinedLinkTemplate(templateName, templateParams, templateRegex(templateName)); | popupPredefinedLinkTemplate(templateName, templateParams, templateRegex(templateName)); | ||
} | } | ||
| שורה 177: | שורה 177: | ||
"כותרת הספר/שם הקהילה", | "כותרת הספר/שם הקהילה", | ||
"מספר גיליון, תאריך פרסום ומספרי עמודים", | "מספר גיליון, תאריך פרסום ומספרי עמודים", | ||
]; | ]; | ||
| שורה 235: | שורה 236: | ||
"ספר פרויקט גוטנברג":[1,24,3], | "ספר פרויקט גוטנברג":[1,24,3], | ||
"תכלת":[1,2,3,4], | "תכלת":[1,2,3,4], | ||
"אנצ דעת":[3,27], | |||
/* | /* | ||
"":[], | "":[], | ||
| שורה 293: | שורה 295: | ||
"ספר פרויקט גוטנברג": {regex: /ebooks\/(\d+)/i, params:[3]}, | "ספר פרויקט גוטנברג": {regex: /ebooks\/(\d+)/i, params:[3]}, | ||
"תכלת": {regex: /article\.php\?id=(\d+)/i, params:[3]}, | "תכלת": {regex: /article\.php\?id=(\d+)/i, params:[3]}, | ||
":אנצ דעת": {regex: /value\.asp\?id1=(\d+)/i, params:[1]}, | |||
/* | /* | ||
"": {regex: //i, params:[]}, | "": {regex: //i, params:[]}, | ||