User:Newmanbe/common.js: Difference between revisions
Appearance
Content deleted Content added
Pathoschild (talk | contribs) m updated write path |
Pathoschild (talk | contribs) 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. |
|||
⚫ | |||
* @update-token [[File:pathoschild/templatescript.js]] |
|||
⚫ | |||
// <pre> |
// <pre> |
||
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() { |
|||
⚫ | |||
⚫ | |||
######### |
|||
⚫ | |||
⚫ | |||
]); |
|||
### by [[user:Pathoschild]] |
|||
}); |
|||
### * adds a menu of user-defined, form-specific templates |
|||
⚫ | |||
######### |
|||
⚫ | |||
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 ### */ |
|||
⚫ | |||
/* ### 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>