Jump to content

User:Newmanbe/common.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m updated write path
updated scripts
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/**
* 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]]
*/
// <pre>
// <pre>
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
/*
pathoschild.TemplateScript.add([
#########
{ name:'Permission in OTRS', template:'{{PermissionOTRS\n|ticket=\n}} --~~~~', editSummary:'Permission is in OTRS' },
### TemplateScript 0.5-alpha
]);
### by [[user:Pathoschild]]
});
### * adds a menu of user-defined, form-specific templates
### * documentation: [http://meta.wikimedia.org/wiki/user:pathoschild/Script:TemplateScript]
#########
*/

document.write('<script type="text/javascript" src="'
+ 'http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Script:TemplateScript.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/* define templates */
function define_templates() {
/* syntax: new_template('type','name','text','optional 1','optional 2','optional 3');
see documentation
*/

/* ### edit templates below ### */
new_template('edit','Permission in OTRS','{{PermissionOTRS\n|ticket=\n}} --~~~~');
/* ### edit templates above ### */
}

/* Load script */
addOnloadHook(function() {templatescript(define_templates())});

// </pre>
// </pre>

Latest revision as of 21:58, 29 August 2015

/**
 * 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]]
 */
// <pre>
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
	pathoschild.TemplateScript.add([
		{ name:'Permission in OTRS', template:'{{PermissionOTRS\n|ticket=\n}} --~~~~', editSummary:'Permission is in OTRS' },
	]);
});
// </pre>