Mediawiki where is common js




















Viewed 5k times. Improve this question. MirroredFate MirroredFate Add a comment. Active Oldest Votes. Improve this answer. Ilmari Karonen Ilmari Karonen This is great!

Much more useful than the wiki docs. Use of common. Another option is to define it to load in LocalSettings. Put the code in the "MediaWiki:common. Harry Wood 1, 2 2 gold badges 20 20 silver badges 43 43 bronze badges. The page on Common. I sincerely hope you will edit your answer to include an example or two of what you're talking about.

Have you tried searching your filesystem for common. Does it exist? I did. There is no file named "Common. If you run dev tools F12 and see which files the page is loading is it trying to request a common. As I understand any JS you want to add to a page would go in common.

Figured it out. There is no common. There is a page called MediaWiki:Common. Type that into the search bar in the wiki installation and edit that page with your code. Show 3 more comments. You can put javascript code in the "MediaWiki:common. For example edit the page and just add the one line: mw. We were using an addOnloadHook event which was intended to follow on from loading this, so we've ended up doing it the jQuery way: jQuery.

Harry Wood Harry Wood 1, 2 2 gold badges 20 20 silver badges 43 43 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? There are similar pages affecting only users of specific skins see below. Extension:Gadgets makes it easier for site admins and users to share JavaScript, see Gadget kitchen. This page covers the state and configuration variables available.

To facilitate JavaScript programming, the MediaWiki software exposes a number of configuration values in an object called mw. These values can be accessed through mw. In MediaWiki 1. This array contains only explicit protections. Namespace-wide protections e. On such pages, the value is normally [] , unless additional protections have been applied specifically to that page. Some additional information will be available when the site supports Wikibase :.

Translate this page. Other languages:. Most of these variables have a wg prefix. Besides the names in this list, many extensions also set additional JavaScript config variables prefixed with 'wg'. This variable is badly named — it is not related to a page being a main namespace "article". Category : JavaScript. Namespaces Manual Discussion. Views Read Edit View history. Bug tracker Code docs Code repository Statistics. Add links.

Interface user-specific, group-specific and site-wide ContentHandler facility for supporting js as page content Snippets Extensions that allow you to add js Extension:Gadgets , Extension:Widgets. Since MediaWiki 1. The internal name of the currently used skin.

The "Classic" skin is called "standard". Full URL to the root directory for skins, containing stylesheets and skin-specific scripts. The IDs of the namespaces treated as case-sensitive by MediaWiki. The language code for the default content language of the wiki. The IDs of the namespaces considered "content namespaces" by MediaWiki.

Root path used for extension static assets e. Gives a mapping from namespace IDs to localized namespace names. For each namespace, the object has one entry that has the stringified namespace number as the key and the namespace name as its value. Aliases or canonical names are not included.

Gives a mapping from namespace names to namespace IDs. For each namespace name, including aliases, the object has one entry that has namespace name as the key and the namespace ID as its integer value. Canonical names are not included. The keys are all lowercase, with spaces replaced by underscores.

Full path to the main access point script, starting at the root, including the full script name with extension. This is the path to use for direct calls to the php access points such as index. If a wiki has language variants such as the Chinese and the Serbian Wikipedias , set to a path beginning at the root for language variants other than wgContentLanguage. If the wiki does not have language variants, set to false. The action performed, e.

See Manual:Parameters to index. The canonical i. On special pages, the canonical i. The list of all the categories a page belongs to.



0コメント

  • 1000 / 1000