User:Jackmcbarn/advancedtemplatesandbox.js: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
fix calling this script twice adding duplicates of things
Jackmcbarn (talk | contribs)
collapse when not on a template
Line 12:
 
if($('#wpTemplateSandboxPage').attr('type') == 'hidden') {
$('#templatesandbox-editform').makeCollapsible().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}));
}