User:Sware/common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
mw.loader.load( '//de.wikipedia.org/w/index.php?title=Benutzer:TMg/autoFormatter.js&action=raw&ctype=text/javascript' ); | mw.loader.load( '//de.wikipedia.org/w/index.php?title=Benutzer:TMg/autoFormatter.js&action=raw&ctype=text/javascript' ); | ||
importScript('User:Jackmcbarn/advancedtemplatesandbox.js'); // Linkback: [[w:User:Jackmcbarn/advancedtemplatesandbox.js]] | importScript('User:Jackmcbarn/advancedtemplatesandbox.js'); // Linkback: [[w:User:Jackmcbarn/advancedtemplatesandbox.js]] | ||
if($('#wpTemplateSandboxPage').attr('type') == 'hidden') { | |||
mw.loader.using('jquery.makeCollapsible', function() { | |||
$('#templatesandbox-editform').makeCollapsible({collapsed: !$('#wpTemplateSandboxPage').attr('value') }); | |||
}); | |||
$('#templatesandbox-editform').prepend('<legend>Preview page with this template</legend>'); | |||
$('#wpTemplateSandboxPage').before('<span class="mw-templatesandbox-page" id="wpTemplateSandboxPageLabel"><label for="wpTemplateSandboxPage">Page title:</label></span> ').after('<input id="wpTemplateSandboxPreview" name="wpTemplateSandboxPreview" tabindex="' + (+($('#wpDiff').attr('tabIndex')) + 0.75) + '" value="Show preview" type="submit" />').replaceWith($('#wpTemplateSandboxPage').clone().attr({type: 'text', tabindex: +($('#wpDiff').attr('tabIndex')) + 0.5, size: 60, spellcheck: true, 'data-mw-searchsuggest': '{"wrapAsLink":false}'}).addClass('mw-searchInput')); | |||
} | |||
if($('#wpTemplateSandboxTemplate').attr('type') == 'hidden') { | |||
$('#wpTemplateSandboxTemplate').before('<span class="mw-templatesandbox-template" id="wpTemplateSandboxTemplateLabel"><label for="wpTemplateSandboxTemplate">Template name:</label></span> ').after('<br />').replaceWith($('#wpTemplateSandboxTemplate').clone().attr({type: 'text', tabindex: +($('#wpDiff').attr('tabIndex')) + 0.25, size: 60, spellcheck: true})); | |||
} |
Revision as of 22:05, 10 December 2020
mw.loader.load( '//de.wikipedia.org/w/index.php?title=Benutzer:TMg/autoFormatter.js&action=raw&ctype=text/javascript' );
importScript('User:Jackmcbarn/advancedtemplatesandbox.js'); // Linkback: [[w:User:Jackmcbarn/advancedtemplatesandbox.js]]
if($('#wpTemplateSandboxPage').attr('type') == 'hidden') {
mw.loader.using('jquery.makeCollapsible', function() {
$('#templatesandbox-editform').makeCollapsible({collapsed: !$('#wpTemplateSandboxPage').attr('value') });
});
$('#templatesandbox-editform').prepend('<legend>Preview page with this template</legend>');
$('#wpTemplateSandboxPage').before('<span class="mw-templatesandbox-page" id="wpTemplateSandboxPageLabel"><label for="wpTemplateSandboxPage">Page title:</label></span> ').after('<input id="wpTemplateSandboxPreview" name="wpTemplateSandboxPreview" tabindex="' + (+($('#wpDiff').attr('tabIndex')) + 0.75) + '" value="Show preview" type="submit" />').replaceWith($('#wpTemplateSandboxPage').clone().attr({type: 'text', tabindex: +($('#wpDiff').attr('tabIndex')) + 0.5, size: 60, spellcheck: true, 'data-mw-searchsuggest': '{"wrapAsLink":false}'}).addClass('mw-searchInput'));
}
if($('#wpTemplateSandboxTemplate').attr('type') == 'hidden') {
$('#wpTemplateSandboxTemplate').before('<span class="mw-templatesandbox-template" id="wpTemplateSandboxTemplateLabel"><label for="wpTemplateSandboxTemplate">Template name:</label></span> ').after('<br />').replaceWith($('#wpTemplateSandboxTemplate').clone().attr({type: 'text', tabindex: +($('#wpDiff').attr('tabIndex')) + 0.25, size: 60, spellcheck: true}));
}