summaryrefslogtreecommitdiff
path: root/maintenance/jsduck
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /maintenance/jsduck
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'maintenance/jsduck')
-rw-r--r--maintenance/jsduck/categories.json11
-rw-r--r--maintenance/jsduck/custom_tags.rb (renamed from maintenance/jsduck/CustomTags.rb)32
-rw-r--r--maintenance/jsduck/eg-iframe.html71
3 files changed, 68 insertions, 46 deletions
diff --git a/maintenance/jsduck/categories.json b/maintenance/jsduck/categories.json
index d6163bde..eab2b632 100644
--- a/maintenance/jsduck/categories.json
+++ b/maintenance/jsduck/categories.json
@@ -13,7 +13,9 @@
"mw.html",
"mw.html.Cdata",
"mw.html.Raw",
- "mw.hook"
+ "mw.hook",
+ "mw.template",
+ "mw.errorLogger"
]
},
{
@@ -21,6 +23,7 @@
"classes": [
"mw.Title",
"mw.Uri",
+ "mw.messagePoster.*",
"mw.notification",
"mw.Notification_",
"mw.user",
@@ -54,7 +57,8 @@
{
"name": "Interfaces",
"classes": [
- "mw.Feedback"
+ "mw.Feedback",
+ "mw.Feedback.Dialog"
]
},
{
@@ -69,8 +73,7 @@
"mw.log",
"mw.inspect",
"mw.inspect.reports",
- "mw.Debug",
- "mw.Debug.profile"
+ "mw.Debug"
]
}
]
diff --git a/maintenance/jsduck/CustomTags.rb b/maintenance/jsduck/custom_tags.rb
index 2aff9881..39589a06 100644
--- a/maintenance/jsduck/CustomTags.rb
+++ b/maintenance/jsduck/custom_tags.rb
@@ -11,16 +11,16 @@ class CommonTag < JsDuck::Tag::Tag
@repeatable = true
end
- def parse_doc(scanner, position)
+ def parse_doc(scanner, _position)
if @multiline
- return { :tagname => @tagname, :doc => :multiline }
+ return { tagname: @tagname, doc: :multiline }
else
text = scanner.match(/.*$/)
- return { :tagname => @tagname, :doc => text }
+ return { tagname: @tagname, doc: text }
end
end
- def process_doc(context, tags, position)
+ def process_doc(context, tags, _position)
context[@tagname] = tags
end
@@ -34,7 +34,7 @@ end
class SourceTag < CommonTag
def initialize
@tagname = :source
- @pattern = "source"
+ @pattern = 'source'
super
end
@@ -51,7 +51,7 @@ end
class SeeTag < CommonTag
def initialize
@tagname = :see
- @pattern = "see"
+ @pattern = 'see'
super
end
@@ -66,18 +66,20 @@ class SeeTag < CommonTag
<<-EOHTML
<h3 class="pa">Related</h3>
<ul>
- #{ context[@tagname].map {|tag| tag[:doc] }.join("\n") }
+ #{ context[@tagname].map { |tag| tag[:doc] }.join("\n") }
</ul>
EOHTML
end
def render_long_see(tag, formatter, position)
- if tag =~ /\A([^\s]+)( .*)?\Z/m
- name = $1
- doc = $2 ? ': ' + $2 : ''
+ match = /\A([^\s]+)( .*)?\Z/m.match(tag)
+
+ if match
+ name = match[1]
+ doc = match[2] ? ': ' + match[2] : ''
return formatter.format("{@link #{name}} #{doc}")
else
- JsDuck::Logger.warn(nil, 'Unexpected @see argument: "'+tag+'"', position)
+ JsDuck::Logger.warn(nil, 'Unexpected @see argument: "' + tag + '"', position)
return tag
end
end
@@ -105,11 +107,13 @@ class ContextTag < CommonTag
end
def render_long_context(tag, formatter, position)
- if tag =~ /\A([^\s]+)/m
- name = $1
+ match = /\A([^\s]+)/m.match(tag)
+
+ if match
+ name = match[1]
return formatter.format("`context` : {@link #{name}}")
else
- JsDuck::Logger.warn(nil, 'Unexpected @context argument: "'+tag+'"', position)
+ JsDuck::Logger.warn(nil, 'Unexpected @context argument: "' + tag + '"', position)
return tag
end
end
diff --git a/maintenance/jsduck/eg-iframe.html b/maintenance/jsduck/eg-iframe.html
index 7dc4afa8..fca839d9 100644
--- a/maintenance/jsduck/eg-iframe.html
+++ b/maintenance/jsduck/eg-iframe.html
@@ -3,14 +3,46 @@
<head>
<meta charset="utf-8">
<title>MediaWiki Code Example</title>
- <script src="modules/startup.js"></script>
+ <script>
+ /**
+ * Basic log console for the example iframe in documentation pages.
+ */
+ var log = ( function () {
+ var pre;
+ return function () {
+ var str, i, len, line;
+ if ( !pre ) {
+ pre = document.createElement( 'pre' );
+ pre.className = 'mw-jsduck-log';
+ ( document.body || document.documentElement ).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 );
+ };
+ }() );
+
+ window.onerror = function ( error, filePath, linerNr ) {
+ log( error + '\n' + filePath + ':' + linerNr );
+ };
+ </script>
+ <script src="modules/src/startup.js"></script>
<script>
function startUp() {
mw.config = new mw.Map();
}
</script>
- <script src="modules/jquery/jquery.js"></script>
- <script src="modules/mediawiki/mediawiki.js"></script>
+ <script src="modules/lib/jquery/jquery.js"></script>
+ <script src="modules/src/mediawiki/mediawiki.js"></script>
+ <script src="modules/src/mediawiki/mediawiki.errorLogger.js"></script>
+ <script src="modules/src/mediawiki/mediawiki.startUp.js"></script>
<style>
.mw-jsduck-log {
position: relative;
@@ -45,30 +77,13 @@
</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 );
- };
- }() );
+ if ( window.mw ) {
+ mw.log = log;
+ }
+
+ window.onerror = function ( error, filePath, linerNr ) {
+ log( filePath + ':' + linerNr );
+ };
/**
* Method called by jsduck to execute the example code.
@@ -78,7 +93,7 @@
eval( code );
callback && callback( true );
} catch ( e ) {
- mw.log( 'Uncaught exception: ' + e );
+ log( 'Uncaught ' + e );
callback && callback( false, e );
throw e;
}