diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /maintenance/jsduck | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'maintenance/jsduck')
-rw-r--r-- | maintenance/jsduck/MetaTags.rb | 16 | ||||
-rw-r--r-- | maintenance/jsduck/categories.json | 25 | ||||
-rw-r--r-- | maintenance/jsduck/config.json | 15 | ||||
-rw-r--r-- | maintenance/jsduck/eg-iframe.html | 86 | ||||
-rw-r--r-- | maintenance/jsduck/external.js | 18 |
5 files changed, 140 insertions, 20 deletions
diff --git a/maintenance/jsduck/MetaTags.rb b/maintenance/jsduck/MetaTags.rb index 84e40213..83cc0884 100644 --- a/maintenance/jsduck/MetaTags.rb +++ b/maintenance/jsduck/MetaTags.rb @@ -3,6 +3,22 @@ # - https://github.com/senchalabs/jsduck/wiki/Custom-tags require 'jsduck/meta_tag' +class SourceTag < JsDuck::MetaTag + def initialize + # This defines the name of the @tag + @name = 'source' + end + + # Generate HTML output for this tag. + # One can make use of the #format method to easily support + # Markdown and {@link} tags inside the contents of the tag. + # + # @param tags All matches of this tag on one class. + def to_html(tags) + '<h3 class="pa">Source</h3>' + tags.map {|tag| format(tag) }.join("\n") + end +end + class ContextTag < JsDuck::MetaTag def initialize @name = 'context' diff --git a/maintenance/jsduck/categories.json b/maintenance/jsduck/categories.json index 4a8ba8c3..f96902d8 100644 --- a/maintenance/jsduck/categories.json +++ b/maintenance/jsduck/categories.json @@ -9,21 +9,30 @@ "mw.Map", "mw.Message", "mw.loader", + "mw.log", "mw.html", "mw.html.Cdata", - "mw.html.Raw" + "mw.html.Raw", + "mw.hook" ] }, { "name": "General", "classes": [ "mw.Title", + "mw.inspect", + "mw.inspect.reports", "mw.notification", + "mw.user", "mw.util", - "mw.plugin.notify" + "mw.plugin.*" ] }, { + "name": "Actions", + "classes": ["mw.toolbar"] + }, + { "name": "API", "classes": ["mw.Api*"] } @@ -33,20 +42,20 @@ "name": "jQuery", "groups": [ { - "name": "Core", - "classes": ["jQuery", "jQuery.Event", "jQuery.Promise", "jQuery.Deferred", "jQuery.jqXHR"] - }, - { "name": "Plugins", "classes": ["jQuery.plugin.*"] } ] }, { - "name": "Misc", + "name": "Upstream", "groups": [ { - "name": "Native", + "name": "jQuery", + "classes": ["jQuery", "jQuery.Event", "jQuery.Callbacks", "jQuery.Promise", "jQuery.Deferred", "jQuery.jqXHR", "QUnit"] + }, + { + "name": "JavaScript", "classes": ["Array", "Boolean", "Date", "Function", "Number", "Object", "RegExp", "String"] } ] diff --git a/maintenance/jsduck/config.json b/maintenance/jsduck/config.json index c4705d8f..e6e0f658 100644 --- a/maintenance/jsduck/config.json +++ b/maintenance/jsduck/config.json @@ -1,18 +1,27 @@ { - "--title": "MediaWiki Code Documentation", + "--title": "MediaWiki core - Documentation", + "--footer": "Documentation for MediaWiki core. Generated on {DATE} by {JSDUCK} {VERSION}.", "--categories": "./categories.json", "--meta-tags": "./MetaTags.rb", + "--eg-iframe": "./eg-iframe.html", "--warnings": ["-no_doc"], "--builtin-classes": true, "--output": "../../docs/js", "--": [ "./external.js", "../../resources/mediawiki/mediawiki.js", + "../../resources/mediawiki/mediawiki.log.js", "../../resources/mediawiki/mediawiki.util.js", "../../resources/mediawiki/mediawiki.Title.js", + "../../resources/mediawiki/mediawiki.inspect.js", "../../resources/mediawiki/mediawiki.notify.js", "../../resources/mediawiki/mediawiki.notification.js", + "../../resources/mediawiki/mediawiki.user.js", + "../../resources/mediawiki.action/mediawiki.action.edit.js", + "../../resources/mediawiki.action/mediawiki.action.view.postEdit.js", + "../../resources/mediawiki.page/mediawiki.page.startup.js", "../../resources/mediawiki.api", - "../../resources/jquery/jquery.localize.js" + "../../resources/jquery/jquery.localize.js", + "../../resources/jquery/jquery.spinner.js" ] -}
\ No newline at end of file +} diff --git a/maintenance/jsduck/eg-iframe.html b/maintenance/jsduck/eg-iframe.html index f53b4044..86eae4b6 100644 --- a/maintenance/jsduck/eg-iframe.html +++ b/maintenance/jsduck/eg-iframe.html @@ -2,19 +2,87 @@ <html> <head> <meta charset="utf-8"> - <title>MediaWiki Examples</title> + <title>MediaWiki Code Example</title> + <script src="modules/startup.js"></script> <script> - function loadInlineExample(code, options, callback) { + function startUp() { + mw.config = new mw.Map(); + } + </script> + <script src="modules/jquery/jquery.js"></script> + <script src="modules/mediawiki/mediawiki.js"></script> + <style> + .mw-jsduck-log { + position: relative; + min-height: 3em; + margin-top: 2em; + background: #f7f7f7; + border: 1px solid #e4e4e4; + } + + .mw-jsduck-log::after { + position: absolute; + bottom: 100%; + right: -1px; + padding: 0.5em; + background: #fff; + border: 1px solid #e4e4e4; + border-bottom: 0; + border-radius: 0.5em 0.5em 0 0; + font: normal 0.5em sans-serif; + content: 'console'; + } + + .mw-jsduck-log-line { + padding: 0.2em 0.5em; + white-space: pre-wrap; + } + + .mw-jsduck-log-line:nth-child(odd) { + background: #fff; + } + </style> +</head> +<body> + <script> + /** + * Basic log console for the example iframe in documentation pages. + */ + ( function () { + var pre; + mw.log = function () { + var str, i, len, line; + if ( !pre ) { + pre = document.createElement( 'pre' ); + pre.className = 'mw-jsduck-log'; + document.body.appendChild( pre ); + } + str = []; + for ( i = 0, len = arguments.length; i < len; i++ ) { + str.push( String( arguments[ i ] ) ); + } + line = document.createElement( 'div' ); + line.className = 'mw-jsduck-log-line'; + line.appendChild( + document.createTextNode( str.join( ' , ' ) + '\n' ) + ); + pre.appendChild( line ); + }; + }() ); + + /** + * Method called by jsduck to execute the example code. + */ + function loadInlineExample( code, options, callback ) { try { - document.body.innerHTML = ''; - eval(code); - callback && callback(true); + eval( code ); + callback && callback( true ); } catch (e) { - document.body.innerHTML = document.createTextNode(e); - callback && callback(false, e); + mw.log( 'Uncaught exception: ' + e ); + callback && callback( false, e ); + throw e; } } </script> -</head> -<body></body> +</body> </html> diff --git a/maintenance/jsduck/external.js b/maintenance/jsduck/external.js index 8ab102f4..4bb83694 100644 --- a/maintenance/jsduck/external.js +++ b/maintenance/jsduck/external.js @@ -1,26 +1,44 @@ /** * @class jQuery + * @source <http://api.jquery.com/> */ /** * @method ajax + * @static + * @source <http://api.jquery.com/jQuery.ajax/> * @return {jqXHR} */ /** * @class jQuery.Event + * @source <http://api.jquery.com/Types/#Event> + */ + +/** + * @class jQuery.Callbacks + * @source <http://api.jquery.com/jQuery.Callbacks/> */ /** * @class jQuery.Promise + * @source <http://api.jquery.com/Types/#Promise> */ /** * @class jQuery.Deferred * @mixins jQuery.Promise + * @source <http://api.jquery.com/jQuery.Deferred/> */ /** * @class jQuery.jqXHR + * @source <http://api.jquery.com/Types/#jqXHR> * @alternateClassName jqXHR */ + + +/** + * @class QUnit + * @source <http://api.qunitjs.com/> + */ |