Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21c345d3b663a24

Jump to content

Wikipedia:WikiProject User scripts/Scripts/Inclusion

From Wikipedia, the free encyclopedia

Use these commands to include things from other places:

Javascript

[edit]

importScript(); is now built into the site

/* Include a script from another location */

function winc(s) {
    s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
    document.write('<scr' + 'ipt type="text/javascript" src="' 
             + 'http://en.wikipedia.org/w/index.php?title=' + s
             + '&action=raw&ctype=text/javascript"></scr' 
             + 'ipt>'); /* (Broken up so that page preview doesn't get confused) */

then include a script like so:

winc('[[User:SOMEONE/monobook.js]]');         /* Comment about what the script does */

See User:Quarl/monobook.js

Synchronize across wikis

[edit]

A more concise version for including your user js to synchronize across wikis:

document.write('<scr' + 'ipt type="text/javascript" src="http://en.wikipedia.org/w/index.php?title='
             + 'User:YOURUSERNAME/monobook.js'  /* <-- Replace this with your monobook.js location */
             + '&action=raw&ctype=text/javascript"></scr'
             + 'ipt>'); /* (Broken up so that page preview doesn't get confused) */

See meta:User:Omegatron/monobook.js.

CSS

[edit]
/* Include css from en */

@import url(http://en.wikipedia.org/w/index.php?title=User:YOURUSERNAME/monobook.css&action=raw&ctype=text/css);

See meta:User:Omegatron/monobook.css

For Internet explorer' users:

/* Include css from es */

@import "http://es.wikipedia.org/w/index.php?title=Usuario:Axxgreazz/monobook.css&action=raw&ctype=text/css";

See en:User:Axxgreazz/monobook.css