defzone.net@gmail.comLiên hệ
DZ
DefZone.Net

Kien thuc cong nghe & giai tri

Bai vietDia diemAlbum anhGameCua hang
  1. Home
  2. Wiki
Template documentation[view] [edit] [history] [purge]


This template is used to create userscript listings, primarily for use at Wikipedia:User scripts, but it can be used on any page.

Usage

[edit]

{{userscript |code= [.js address] |name= [script name] |doc= [documentation page address] }}

At least |code= -or- |doc= is required. The template will attempt to determine defaults for any information not entered.

  • Check the accuracy of the links after placing this template! If any defaults are incorrect for your script, enter the necessary parameters explicitly.
  • If you end up leaving the template with no "(source)" link produced, make sure your documentation page includes complete installation instructions, along with any necessary code page addresses.
  • You can make up any name for the |name parameter. It is just for display purposes.
Default logic details
  • The template will add .js to the documentation page name to get a default code page, or remove .js from the code page name to get a default documentation page.
    • Entering |code=User:TheDJ/Sharebox.js will look for a page named User:TheDJ/Sharebox, and if found, will be linked as the documentation page.
    • Entering |doc=User:TheDJ/Sharebox will look for a page named User:TheDJ/Sharebox.js, and if found, will be linked as the code page.
  • If the default pages don't actually exist, they won't be linked (so defaults shouldn't produce red links).
  • If no name is entered, a default name will be produced from the code or doc page name.

Additional parameters

[edit]
  • This template enables an automatic installation link for editors who use automatic installer scripts like User:Enterprisey/script-installer or User:Equazcion/ScriptInstaller. If you have reason to disable automatic installation for a particular script (e.g. because it requires more than just the usual importScript line), add the following parameter: |noautoinstall=yes.
  • To suppress the creation of a footnote with installation instructions, set |noref=yes.

Examples

[edit]

All parameters specified: {{userscript|name=sharebox!!!!!|code=User:TheDJ/sharebox.js|doc=User:TheDJ/sharebox}}

  • Produces: sharebox!!!!![1] (source)

Code only: {{userscript|code=User:TheDJ/sharebox.js}}

  • Produces: sharebox[2] (source)

Doc only: {{userscript|doc=User:TheDJ/sharebox}}

  • Produces: sharebox[3] (source)

Use {{reflist}} to produce specific installation instructions:

  1. ^ Copy the following code, edit your user JavaScript, then paste:
    {{subst:lusc|1=User:TheDJ/sharebox.js}}
  2. ^ Copy the following code, edit your user JavaScript, then paste:
    {{subst:lusc|1=User:TheDJ/sharebox.js}}
  3. ^ Copy the following code, edit your user JavaScript, then paste:
    {{subst:lusc|1= User:TheDJ/sharebox.js}}

See also

[edit]
  • Wikipedia:User scripts/List
  • v
  • t
  • e
User scripts
Scripts lists
  • Main scripts list
  • The category for user scripts
  • Code snippets
  • Most imported scripts
  • Deprecated scripts list
New scripts
  • Requests
  • Scripts++ Newsletter
  • Code review
Script writing
  • Guide
  • Common techniques
  • Default ResourceLoader modules
  • Values in mw.config
Templates
  • {{Load user script}}
  • {{Infobox Wikipedia user script}}
  • {{userscript}}
  • {{user script table}}
Userboxes
  • {{user script developer}}
  • {{user script developer2}}
  • {{User script developer upon request}}
  • {{user scripts created}}
See also
  • Gadgets
  • Tools
  • User styles
  • Greasemonkey
  • IRC
    • scripts
  • Bots
  • Extensions
The above documentation is transcluded from Template:Userscript/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
DZ
DefZone.Net

Noi chia se kien thuc, huong dan va kham pha cong nghe.

Lien ket nhanh

Trang chủBài viếtWikiCửa hàngLiên hệ

Liên hệ

Email: defzone.net@gmail.com
Điện thoại: +84 762 559 696
Địa chỉ: Thiên Hương, Thủy Nguyên, Hải Phòng

Đăng ký nhận tin

Nhận bài viết và cập nhật mới nhất qua email.

© 2025 DefZone.Net. All rights reserved.
PrivacyTermsSitemap