User:Jackmcbarn/advancedtemplatesandbox.js: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
Expand functionality
Jackmcbarn (talk | contribs)
Fix tab indices
Line 13:
if($('#wpTemplateSandboxPage').attr('type') == 'hidden') {
$('#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="' + (0.75 + parseFloat($('#wpDiff').attr('tabIndex')) + 0.75) + '" value="Show preview" type="submit" />').replaceWith($('#wpTemplateSandboxPage').clone().attr({type: 'text', tabindex: 0.5 + parseFloat($('#wpDiff').attr('tabIndex')) + 0.5, size: 60, spellcheck: true}));
}
$('#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: 0.25 + parseFloat($('#wpDiff').attr('tabIndex')) + 0.25, size: 60, spellcheck: true}));