Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
show-titlefalse
titleDescription

Userscripts for Confluence defines a userscript in form of a descriptor with a reference to the actual script code.

The userscript is configured for users by the administration team. Hence users can benefit from additional functions without bothering to validate the fitness of a script for their task by themselves. This makes extending Confluence easier, especially for team members without programming skills. While these additional features can be implemented in form of Confluence apps, many utilities simply rely on a short amount of JavaScript code. These few lines of code are easily shared and boost the productivity of teams.

Content Marker
first-child-fixtrue
idanatomy-of-userscript

The userscript consists of

  1. an 
    Static Document Link
    documentUserscript Identifier
    labelidentifier
    consisting of
    Static Document Link
    documentUserscript Namespace
    label${Short Name}
    to-lower-casetrue
    Static Document Link
    documentUserscript Name
    label${Short Name}
    to-lower-casetrue
    , and 
    Static Document Link
    documentUserscript Version
    label${Short Name}
    to-lower-casetrue
  2. a reference to the 
    Static Document Link
    documentUserscript Code
    to-lower-casetrue
    (
    Static Document Link
    documentUserscript Code URL
    labelscript
    )
  3. Static Document Link
    documentUserscript Metadata
    label${Short Name}
    to-lower-casetrue
    , like a 
    Static Document Link
    documentUserscript Description
    label${Short Name}
    to-lower-casetrue
    , a reference to further information (
    Static Document Link
    documentUserscript Documentation
    label${Short Name}
    to-lower-casetrue
    ), and an 
    Static Document Link
    documentUserscript AuthorSupport
    label${Short Name}
    to-lower-casetrue
  4. an activation record (
    Static Document Link
    documentActivation Record
    label${Short Name}
    to-lower-casetrue
    ) that defines when the userscript is actually executed

The following fragment shows the basic structure of a

Static Document Link
documentUserscript JSON
labeluserscript in JSON
.

{ "namespace": "...", "name": "...", "version": "...", "script": "...", "description": "...", "documentation": "...", "author": "...", "activation": { ... } }
Transclusion
document
Code Block
languagejs
titleUserscript Descriptor in JSON
JSON
idsanatomy-of-a-userscript

Section
titleList of related Terms
Table Merger
Tour-by-Property
render-modedefinition
render-classesrelated-terms-property-table, tour-by-property, related-terms-list
propertyRelated Terms
Display Table
doctypeglossary-item
render-no-hits-as-blanktrue
render-modedefinition
render-classesrelated-terms-list-table, display-table, related-terms-list
where$<Related Terms>=[${Name}]
exclude-selftrue

...

Section
titleResources

More information on userscripts:

Tour
render-no-hits-as-blanktrue
render-as-definition-listtrue
marker-column-property-nameTitle
replace-title-with-nametrue
TitleShort Description

System Link
fileUserscript
system-idwikipedia-en
titleWikipedia: A userscript is a program, usually written in JavaScript, for modifying web pages to augment browsing.

Entry on Userscript on Wikipedia.
Userscript (Datatype)