Utilizator:GEO/common.js: Diferență între versiuni
Aspect
Conținut șters Conținut adăugat
GEO (discuție | contribuții) Fără descriere a modificării |
updated scripts, migrated deprecated functions |
||
Linia 1: | Linia 1: | ||
/** |
|||
⚫ | |||
* TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. |
|||
⚫ | |||
/************* |
|||
* @update-token [[File:pathoschild/templatescript.js]] |
|||
⚫ | |||
*/ |
|||
⚫ | |||
⚫ | |||
*** - adds a menu of user-defined, form-specific templates |
|||
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() { |
|||
*************/ |
|||
⚫ | |||
importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/TemplateScript.js&action=raw&ctype=text/javascript'); |
|||
⚫ | |||
⚫ | |||
// define templates |
|||
⚫ | |||
function define_templates() { |
|||
]); |
|||
// syntax (see documentation): new_template('type','name','text','optional 1','optional 2','optional 3'); |
|||
}); |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
/* Load script */ |
|||
addOnloadHook(function() {templatescript(define_templates())}); |
|||
⚫ |
Versiunea de la 25 august 2015 02:12
/**
* TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
* @see https://meta.wikimedia.org/wiki/TemplateScript
* @update-token [[File:pathoschild/templatescript.js]]
*/
// <nowiki>
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
pathoschild.TemplateScript.add([
{ name:'{{wikizare}}', template:'{{wikizare}}', editSummary:'+{{wikizare}}' },
{ name:'{{au-test1}}', template:'{{subst:au-test1}} --~~~~', editSummary:'+{{au-test1}}' },
{ name:'{{nesemnat}}', template:'{{subst:nesemnat}} --~~~~', editSummary:'+{{nesemnat}}' }
]);
});
// </nowiki>