Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

User:Jackmcbarn/advancedtemplatesandbox.js

    From Wikipedia, the free encyclopedia
    <User:Jackmcbarn
    Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at theappropriate village pump.
    This codewill be executed when previewing this page.
    Documentation for thisuser script can be added atUser:Jackmcbarn/advancedtemplatesandbox.
    Note: After saving, you have to bypass your browser's cache to see the changes.Google Chrome,Firefox,Microsoft Edge andSafari: Hold down the⇧ Shift key and click theReload toolbar button. For details and instructions about other browsers, seeWikipedia:Bypass your cache.
    /*Enables TemplateSandbox on all pages, and allows previewing with a template other than the current page being edited (e.g. preview as Template:Foo when actually editing Template:Foo/sandbox)To use, add the following line to [[Special:MyPage/common.js]]:importScript('User:Jackmcbarn/advancedtemplatesandbox.js'); // Linkback: [[User:Jackmcbarn/advancedtemplatesandbox.js]]The linkback allows easier tracking of who uses this script.Known issues:This hardcodes contents of messages, rather than fetching them.The span is left as a span, rather than being changed to a fieldset.Tab indexes assume that we're the first thing after "Show changes". If we're not (or if any other code does this trick), tab order will be wrong. Also, it relies on non-integer tab indexes working.*/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><label for="wpTemplateSandboxPage">Page title:</label></span> ').after('<input 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><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}));}
    Retrieved from "https://en.wikipedia.org/w/index.php?title=User:Jackmcbarn/advancedtemplatesandbox.js&oldid=746232335"

    [8]ページ先頭

    ©2009-2025 Movatter.jp