مدیاویکی:Gadget-VeDirectionMarkTool.js: تفاوت میان نسخهها
ظاهر
imported>Yamaha5 بدون خلاصۀ ویرایش |
imported>Yamaha5 بدون خلاصۀ ویرایش |
||
| خط ۲۹: | خط ۲۹: | ||
template: { | template: { | ||
target: { | target: { | ||
href: wgFormattedNamespaces[10]+ ':'+ mw.config.get('rlmTemplateName'), | href: mw.config.get('wgFormattedNamespaces')[10]+ ':'+ mw.config.get('rlmTemplateName'), | ||
wt: mw.config.get('rlmTemplateName') | wt: mw.config.get('rlmTemplateName') | ||
}, | }, | ||
نسخهٔ کنونی تا ۸ مهٔ ۲۰۲۰، ساعت ۱۷:۵۲
/**
* Adds direction mark tool to VE (for adding RLM)
*/
(function () {
// localization for button name
if(!mw.messages.exists('DirectionTool-toolname')){
mw.messages.set('DirectionTool-toolname', 'الگو تغییر جهت');
}
// localization for rlm template name
if(!mw.config.exists('rlmTemplateName')){
mw.config.set('rlmTemplateName', 'رچ');
}
//end of localization
function DirectionTool( toolGroup, config ) {
OO.ui.Tool.call( this, toolGroup, config );
}
OO.inheritClass( DirectionTool, OO.ui.Tool );
DirectionTool.static.name = 'DirectionTool';
DirectionTool.static.title = mw.msg('DirectionTool-toolname');
DirectionTool.prototype.onSelect = function () {
this.toolbar.getSurface().getModel().getFragment().collapseToEnd().insertContent([{
'type': 'mwTransclusionInline',
'attributes': {
'mw': {
parts: [ {
template: {
target: {
href: mw.config.get('wgFormattedNamespaces')[10]+ ':'+ mw.config.get('rlmTemplateName'),
wt: mw.config.get('rlmTemplateName')
},
params: {}
}
}]
}
}
}]);
};
DirectionTool.prototype.onUpdateState = function () {
this.setActive( false );
};
ve.ui.toolFactory.register( DirectionTool );
})();