User:Mxn/vector.js
Appearance
< User:Mxn
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:Mxn/vector.css. |
// importScript("User:ProveIt GT/ProveIt.js");
// [[User:ProveIt GT/ProveIt.js]]
//importScriptURI("http://toolserver.org/~magnus/wysiwtf/wysiwtf.js");
/**
* MediaWiki:Gadget-codeeditor.js
* Stub to load [[Extension:CodeEditor]] and Ace syntax-highlighting editor as a gadget.
*
* Requires enhanced editing toolbar (WikiEditor extension); integrates with toolbar.
*
* Gadget stub CC-BY-SA 2
* (c) 2011 Brion Vibber <brion @ pobox.com>
*
* Extension:CodeEditor JS bits are GPLv2 -- http://www.mediawiki.org/wiki/Extension:CodeEditor
*
* Syntax highlighting, auto-indenting code editor widget for on-wiki JS and CSS pages.
* Uses embedded Ajax.org Cloud9 Editor: http://ace.ajax.org/
* MPL/LGPL/GPL
*/
(function($) {
// @fixme need an SSL alternative
mw.config.set('wgCodeEditorAssetsPath', '//toolserver.org/~brion/extensions');
var moduleBase = mw.config.get('wgCodeEditorAssetsPath') + '/CodeEditor/modules',
$box = $('#wpTextbox1'),
matches = /\.(js|css)$/.exec(mw.config.get('wgTitle'));
if ($box.length && matches && (wgNamespaceNumber === 2 /* User: */ || wgNamespaceNumber === 8 /* MediaWiki: */)) {
$(function() {
var modules = [
moduleBase + '/ace/ace.js',
moduleBase + '/ace/mode-javascript.js',
moduleBase + '/ace/mode-css.js',
moduleBase + '/jquery.codeEditor.js',
moduleBase + '/ext.codeEditor.js'
];
var i = 0;
// @fixme loading serially is kinda lame, but it works for now
var ping = function() {
if ( i < modules.length ) {
var url = modules[i];
$.getScript(url, function() {
i++;
ping();
});
}
};
ping();
});
}
})(jQuery);
// /w/api.php?action=query&list=allpages&format=json&apfrom=Barn%20advertisement&aplimit=2&apdir=descending&generator=allpages&gapfrom=Barn%20advertisement&gaplimit=1&gapdir=descending
if (mw.config.get("wgAction") == "view") mw.loader.using("mediawiki.api", function () {
var api = new mw.Api();
function insertArticles() {
api.get({
list: "allpages",
apfrom: mw.config.get("wgPageName"),
apnamespace: 0,
aplimit: 2,
apdir: "descending",
}, {
ok: function () {
var title = data.query && data.query.allpages && data.query.allpages[1] && data.query.allpages[1].title;
},
});
}
$(insertArticles);
});