User:Jackmcbarn/advancedtemplatesandbox.js: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
this loads first apparently
Jackmcbarn (talk | contribs)
make the page box have autocomplete like the real thing does
 
(2 intermediate revisions by the same user not shown)
Line 12:
 
if($('#wpTemplateSandboxPage').attr('type') == 'hidden') {
mw.loader.using('jquery.makeCollapsible', function() {
$('#templatesandbox-editform').addClass('mw-collapsible mw-collapsed').prepend('<legend>Preview page with this template</legend>');
$('#templatesandbox-editform').makeCollapsible({collapsed: !$('#wpTemplateSandboxPage').attr('value') });
$('#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}));
});
$('#templatesandbox-editform').addClass('mw-collapsible mw-collapsed').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') {