Sari la conținut

Utilizator:GEO/common.js: Diferență între versiuni

De la Wikipedia, enciclopedia liberă
Conținut șters Conținut adăugat
Fără descriere a modificării
updated scripts, migrated deprecated functions
Linia 1: Linia 1:
/**
// <pre>
* 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]]
*** TemplateScript
*/
*** by [[m:user:Pathoschild]] <http://meta.wikimedia.org/wiki/User:Pathoschild/Scripts/TemplateScript>
// <nowiki>
*** - 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() {
*************/
pathoschild.TemplateScript.add([
importScriptURI('http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/TemplateScript.js&action=raw&ctype=text/javascript');
{ name:'{{wikizare}}', template:'{{wikizare}}', editSummary:'+{{wikizare}}' },

{ name:'{{au-test1}}', template:'{{subst:au-test1}} --~~~~', editSummary:'+{{au-test1}}' },
// define templates
{ name:'{{nesemnat}}', template:'{{subst:nesemnat}} --~~~~', editSummary:'+{{nesemnat}}' }
function define_templates() {
]);
// syntax (see documentation): new_template('type','name','text','optional 1','optional 2','optional 3');
});
new_template('edit','{{wikizare}}','{{wikizare}}','+{{wikizare}}');
// </nowiki>
new_template('edit','{{au-test1}}','{{subst:au-test1}} --~~~~','+{{au-test1}}');
new_template('edit','{{nesemnat}}','{{subst:nesemnat}} --~~~~','+{{nesemnat}}');
}
/* Load script */
addOnloadHook(function() {templatescript(define_templates())});
// </pre>

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>