Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Clear the cache in Tools → Preferences
For details and instructions about other browsers, see Wikipedia:Bypass your cache.
Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the central discussion page, Scriptorium. The code will be executed when previewing this page under some skins, including Monobook. You can in the interim if you wish to refresh the content sooner under another skin. |
Documentation for this script can be added at User:Phe/Auto create page. |
// Auto create page when requesting a non existent Page:*, inefficient since there is
// two request per page, see setupNextLink() which avoid it in most case.
function autoCreatePage() {
if (wgArticleId == 0 && wgAction == 'view') {
url = document.URL.slice((wgServer + '/wiki/').length);
url = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + url + '&action=edit';
window.location = url;
}
}
if (wgCanonicalNamespace == 'Page')
addOnloadHook(autoCreatePage);
// when acting on a Page:* setup the next link to edit mode if the next page doesn't exist.
function setupNextLink()
{
ca_next = document.getElementById('ca-next');
if (!ca_next) return;
href = ca_next.firstChild;
if (!href) return;
var r = new RegExp("(\\d+)$");
page = Number(r.exec(wgTitle)[1]) + 1;
next_page = wgPageName.replace(/\d+$/g, page);
var url = wgServer + wgScriptPath
+ "/api.php?format=xml&action=query&prop=info&titles="
+ encodeURIComponent(next_page);
var request = sajax_init_object();
request.open('GET', url, true);
request.onreadystatechange = function () {
if (request.readyState == 4) {
var xml = request.responseXML ;
if (xml == null) return ;
var page = xml.getElementsByTagName( "page" )[0];
if (page.getAttribute("missing") == "")
href.href = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + encodeURIComponent(next_page) + '&action=edit';
}
};
request.send(null);
}
if (wgCanonicalNamespace == 'Page')
addOnloadHook(setupNextLink);