// oldid not available for non existing pages
$url = htmlspecialchars( wfExpandIRI( $this->getTitle()->getCanonicalURL() ) );
}
- return $this->msg( 'retrievedfrom', '<a href="' . $url . '">' . $url . '</a>' )->text();
+ return $this->msg( 'retrievedfrom', '<a dir="ltr" href="' . $url . '">' . $url . '</a>' )->text();
}
/**
->inContentLanguage()->text();
}
$keys['$OLDID'] = $this->oldid;
- // @deprecated Remove in MediaWiki 1.23.
+ // Deprecated since MediaWiki 1.21, not used by default. Kept for backwards-compatibility.
$keys['$CHANGEDORCREATED'] = wfMessage( 'changed' )->inContentLanguage()->text();
} else {
# clear $OLDID placeholder in the message template
$keys['$OLDID'] = '';
$keys['$NEWPAGE'] = '';
- // @deprecated Remove in MediaWiki 1.23.
+ // Deprecated since MediaWiki 1.21, not used by default. Kept for backwards-compatibility.
$keys['$CHANGEDORCREATED'] = wfMessage( 'created' )->inContentLanguage()->text();
}
if ( !$options['changed'] ) {
$good = 0;
- $total = 0;
} elseif ( $options['created'] ) {
$good = (int)$this->isCountable( $editInfo );
- $total = 1;
} elseif ( $options['oldcountable'] !== null ) {
$good = (int)$this->isCountable( $editInfo ) - (int)$options['oldcountable'];
- $total = 0;
} else {
$good = 0;
- $total = 0;
}
+ $edits = $options['changed'] ? 1 : 0;
+ $total = $options['created'] ? 1 : 0;
- DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, $good, $total ) );
+ DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, $edits, $good, $total ) );
DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content ) );
// If this is another user's talk page, update newtalk.
* Get the Title object
*
* @since 1.18
- * @return Title
+ * @return Title|null
*/
public function getTitle() {
return $this->getContext()->getTitle();
/**
* Get the Title object
*
- * @return Title
+ * @return Title|null
*/
public function getTitle() {
if ( !is_null( $this->title ) ) {
/**
* Get the Title object
*
- * @return Title
+ * @return Title|null
*/
public function getTitle();
/**
* Get the Title object
*
- * @return Title
+ * @return Title|null
*/
public function getTitle() {
if ( $this->title === null ) {
+++ /dev/null
-# Custom tags for JSDuck 4.x
-# See also:
-# - https://github.com/senchalabs/jsduck/wiki/Tags
-# - https://github.com/senchalabs/jsduck/wiki/Custom-tags
-# - https://github.com/senchalabs/jsduck/wiki/Custom-tags/7f5c32e568eab9edc8e3365e935bcb836cb11f1d
-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'
- end
-
- # @param tags All matches of this tag on one class.
- def to_html(tags)
- return '<h3 class="pa">Context</h3>' + render_long_context(tags.last)
- end
-
- def render_long_context(tag)
- if tag =~ /\A([^\s]+)/m
- name = $1
- return format("`this` : {@link #{name}}")
- end
- end
-end
-
-class SeeTag < JsDuck::MetaTag
- def initialize
- @name = 'see'
- @multiline = true
- end
-
- # @param tags All matches of this tag on one class.
- def to_html(tags)
- doc = []
- doc << '<h3 class="pa">Related</h3>'
- doc << [
- '<ul>',
- tags.map {|tag| render_long_see(tag) },
- '</ul>',
- ]
- doc
- end
-
- def render_long_see(tag)
- if tag =~ /\A([^\s]+)( .*)?\Z/m
- name = $1
- doc = $2 ? ': ' + $2 : ''
- return [
- '<li>',
- format("{@link #{name}} #{doc}"),
- '</li>'
- ]
- end
- end
-end
-
-# As of JSDuck 5 this is in core
-class FiresTag < JsDuck::MetaTag
- def initialize
- @name = 'fires'
- @multiline = true
- end
-
- # @param tags All matches of this tag on one class.
- def to_html(tags)
- doc = []
- doc << '<h3 class="pa">Fires</h3>'
- doc << [
- '<ul>',
- tags.map {|tag| render_long_event(tag) },
- '</ul>',
- ]
- doc
- end
-
- def render_long_event(tag)
- if tag =~ /\A(\w+)( .*)?\Z/m
- name = $1
- doc = $2 ? ': ' + $2 : ''
- return [
- '<li>',
- format("{@link #event-#{name}} #{doc}"),
- '</li>'
- ]
- end
- end
-end
{
"--title": "MediaWiki core - Documentation",
- "--footer": "Documentation for MediaWiki core. Generated on {DATE} by {JSDUCK} {VERSION}.",
"--categories": "./categories.json",
"--eg-iframe": "./eg-iframe.html",
+ "--tags": "./CustomTags.rb",
+ "--warnings": ["-nodoc(class,public)"],
"--builtin-classes": true,
- "--output": "../../docs/js",
+ "--warnings-exit-nonzero": true,
"--external": "HTMLElement,HTMLDocument,Window",
+ "--footer": "Documentation for MediaWiki core. Generated on {DATE} by {JSDUCK} {VERSION}.",
+ "--output": "../../docs/js",
"--": [
"./external.js",
"../../resources/src/mediawiki",
- "../../resources/src/mediawiki.action/mediawiki.action.edit.js",
- "../../resources/src/mediawiki.action/mediawiki.action.view.postEdit.js",
- "../../resources/src/mediawiki.page/mediawiki.page.startup.js",
- "../../resources/src/mediawiki.page/mediawiki.page.watch.ajax.js",
+ "../../resources/src/mediawiki.action",
+ "../../resources/src/mediawiki.page",
"../../resources/src/mediawiki.api",
"../../resources/src/mediawiki.language",
"../../resources/src/jquery/jquery.accessKeyLabel.js",
"../../resources/src/jquery/jquery.arrowSteps.js",
"../../resources/src/jquery/jquery.autoEllipsis.js",
"../../resources/src/jquery/jquery.badge.js",
+ "../../resources/src/jquery/jquery.byteLength.js",
"../../resources/src/jquery/jquery.byteLimit.js",
+ "../../resources/src/jquery/jquery.checkboxShiftClick.js",
"../../resources/src/jquery/jquery.client.js",
"../../resources/src/jquery/jquery.colorUtil.js",
+ "../../resources/src/jquery/jquery.footHovzer.js",
+ "../../resources/src/jquery/jquery.getAttrs.js",
+ "../../resources/src/jquery/jquery.hidpi.js",
"../../resources/src/jquery/jquery.localize.js",
"../../resources/src/jquery/jquery.makeCollapsible.js",
"../../resources/src/jquery/jquery.spinner.js",
+ "../../resources/src/jquery/jquery.tabIndex.js",
"../../resources/lib/oojs",
"../../resources/lib/oojs-ui"
]
MWCORE_DIR=$(cd $(dirname $0)/..; pwd)
-# Support jsduck 4.x and 5.x
-JSDUCK_VERSION="$(jsduck --version | sed -e 's/[.].*//')"
-if [ "$JSDUCK_VERSION" = "JSDuck 4" ]; then
- JSDUCK_VERSION_OPT="--meta-tags $MWCORE_DIR/maintenance/jsduck/MetaTags.rb --warnings=-no_doc"
-else
- JSDUCK_VERSION_OPT="--tags $MWCORE_DIR/maintenance/jsduck/CustomTags.rb --warnings=-nodoc(class,public)"
-fi
-
jsduck \
--config=$MWCORE_DIR/maintenance/jsduck/config.json \
-$JSDUCK_VERSION_OPT \
--footer="Documentation for branch ($JSDUCK_MWVERSION) on {DATE} by {JSDUCK} {VERSION}." \
---processes 0 --warnings-exit-nonzero \
+--processes 0 \
&& echo 'JSDuck execution finished.' \
&& ln -s ../../resources $MWCORE_DIR/docs/js/modules
/**
- * jQuery.byteLength
- *
- * Calculate the byte length of a string (accounting for UTF-8).
- *
+ * @class jQuery.plugin.byteLength
* @author Jan Paul Posma, 2011
* @author Timo Tijhof, 2012
* @author David Chan, 2013
*/
-jQuery.byteLength = function ( str ) {
+/**
+ * Calculate the byte length of a string (accounting for UTF-8).
+ *
+ * @static
+ */
+jQuery.byteLength = function ( str ) {
// This basically figures out how many bytes a UTF-16 string (which is what js sees)
// will take in UTF-8 by replacing a 2 byte character with 2 *'s, etc, and counting that.
// Note, surrogate (\uD800-\uDFFF) characters are counted as 2 bytes, since there's two of them
.replace( /[\u0080-\u07FF\uD800-\uDFFF]/g, '**' )
.replace( /[\u0800-\uD7FF\uE000-\uFFFF]/g, '***' )
.length;
-
};
+
+/**
+ * @class jQuery
+ * @mixins jQuery.plugin.byteLength
+ */
/**
- * jQuery checkboxShiftClick
- *
- * This will enable checkboxes to be checked or unchecked in a row by clicking one,
- * holding shift and clicking another one.
- *
- * @author Timo Tijhof, 2011 - 2012
- * @license GPL v2
+ * @class jQuery.plugin.checkboxShiftClick
*/
( function ( $ ) {
+
+ /**
+ * Enable checkboxes to be checked or unchecked in a row by clicking one,
+ * holding shift and clicking another one.
+ *
+ * @return {jQuery}
+ * @chainable
+ */
$.fn.checkboxShiftClick = function () {
var prevCheckbox = null,
$box = this;
} );
return $box;
};
+
+ /**
+ * @class jQuery
+ * @mixins jQuery.plugin.checkboxShiftClick
+ */
+
}( jQuery ) );
/**
- * Utility to stack stuff in an overlay fixed on the bottom of the page.
- *
- * Usage:
- * <code>
- * var hovzer = $.getFootHovzer();
- * hovzer.$.append( $myCollection );
- * hovzer.update();
- * </code>
- *
- * @author Timo Tijhof, 2012
+ * @class jQuery.plugin.footHovzer
*/
( function ( $ ) {
var $hovzer, footHovzer, prevHeight, newHeight;
return $hovzer;
}
+ /**
+ * Utility to stack stuff in an overlay fixed on the bottom of the page.
+ *
+ * Usage:
+ *
+ * var hovzer = $.getFootHovzer();
+ * hovzer.$.append( $myCollection );
+ * hovzer.update();
+ *
+ * @static
+ * @inheritable
+ * @return {jQuery.footHovzer}
+ */
+ $.getFootHovzer = function () {
+ footHovzer.$ = getHovzer();
+ return footHovzer;
+ };
+
+ /**
+ * @private
+ * @class jQuery.footHovzer
+ */
footHovzer = {
+
+ /**
+ * @property {jQuery} $ The stack container
+ */
+
+ /**
+ * Update dimensions of stack to account for changes in the subtree.
+ */
update: function () {
var $body;
$body = $( 'body' );
if ( prevHeight === undefined ) {
- prevHeight = getHovzer().outerHeight( /*includeMargin=*/true );
+ prevHeight = getHovzer().outerHeight( /* includeMargin = */ true );
$body.css( 'paddingBottom', '+=' + prevHeight + 'px' );
} else {
newHeight = getHovzer().outerHeight( true );
}
};
- $.getFootHovzer = function () {
- footHovzer.$ = getHovzer();
- return footHovzer;
- };
+ /**
+ * @class jQuery
+ * @mixins jQuery.plugin.footHovzer
+ */
}( jQuery ) );
/**
- * Utility to get all attributes of an element directy as an object.
+ * @class jQuery.plugin.getAttrs
+ */
+
+/**
+ * Get the attributes of an element directy as a plain object.
+ *
+ * If there are more elements in the collection, like most jQuery get/read methods,
+ * this method will use the first element in the collection.
+ *
+ * In IE6, the `attributes` map of a node includes *all* allowed attributes
+ * for an element (including those not set). Those will have values like
+ * `undefined`, `null`, `0`, `false`, `""` or `"inherit"`.
*
- * @author Timo Tijhof, 2011
+ * However there may be attributes genuinely set to one of those values, and there
+ * is no way to distinguish between attributes set to that and those not set and
+ * it being the default. If you need them, set `all` to `true`. They are filtered out
+ * by default.
+ *
+ * @param {boolean} [all=false]
+ * @return {Object}
*/
jQuery.fn.getAttrs = function ( all ) {
var map = this[0].attributes,
i, v;
for ( i = 0; i < len; i++ ) {
- // IE6 includes *all* allowed attributes for thew element (including those
- // not set). Those have values like undefined, null, 0, false, "" or "inherit".
- // However there may be genuine attributes set to that. If you need them,
- // set all to true. They are excluded by default.
v = map[i].nodeValue;
if ( all || ( v && v !== 'inherit' ) ) {
attrs[ map[i].nodeName ] = v;
return attrs;
};
+
+/**
+ * @class jQuery
+ * @mixins jQuery.plugin.getAttrs
+ */
/**
- * Responsive images based on 'srcset' and 'window.devicePixelRatio' emulation where needed.
+ * Responsive images based on `srcset` and `window.devicePixelRatio` emulation where needed.
*
- * Call $().hidpi() on a document or part of a document to replace image srcs in that section.
+ * Call `.hidpi()` on a document or part of a document to proces image srcsets within that section.
*
- * $.devicePixelRatio() can be used to supplement window.devicePixelRatio with support on
- * some additional browsers.
+ * `$.devicePixelRatio()` can be used as a substitute for `window.devicePixelRatio`.
+ * It provides a familiar interface to retrieve the pixel ratio for browsers that don't
+ * implement `window.devicePixelRatio` but do have a different way of getting it.
+ *
+ * @class jQuery.plugin.hidpi
*/
( function ( $ ) {
/**
- * Detect reported or approximate device pixel ratio.
- * 1.0 means 1 CSS pixel is 1 hardware pixel
- * 2.0 means 1 CSS pixel is 2 hardware pixels
- * etc
+ * Get reported or approximate device pixel ratio.
+ *
+ * - 1.0 means 1 CSS pixel is 1 hardware pixel
+ * - 2.0 means 1 CSS pixel is 2 hardware pixels
+ * - etc.
*
- * Uses window.devicePixelRatio if available, or CSS media queries on IE.
+ * Uses `window.devicePixelRatio` if available, or CSS media queries on IE.
*
+ * @static
* @return {number} Device pixel ratio
*/
$.devicePixelRatio = function () {
* native srcset support.
*
* @return {jQuery} This selection
+ * @chainable
*/
$.fn.hidpi = function () {
var $target = this,
*
* Exposed for testing.
*
+ * @private
+ * @static
* @param {number} devicePixelRatio
* @param {string} srcset
- * @return {mixed} null or the matching src string
+ * @return {Mixed} null or the matching src string
*/
$.matchSrcSet = function ( devicePixelRatio, srcset ) {
var candidates,
return selectedSrc;
};
+/**
+ * @class jQuery
+ * @mixins jQuery.plugin.hidpi
+ */
+
}( jQuery ) );
/**
- * jQuery tabIndex
+ * @class jQuery.plugin.tabIndex
*/
( function ( $ ) {
/**
- * Finds the lowerst tabindex in use within a selection
+ * Find the lowest tabindex in use within a selection.
*
- * @return number Lowest tabindex on the page
+ * @return {number} Lowest tabindex on the page
*/
$.fn.firstTabIndex = function () {
var minTabIndex = null;
};
/**
- * Finds the highest tabindex in use within a selection
+ * Find the highest tabindex in use within a selection.
*
- * @return number Highest tabindex on the page
+ * @return {number} Highest tabindex on the page
*/
$.fn.lastTabIndex = function () {
var maxTabIndex = null;
return maxTabIndex;
};
+ /**
+ * @class jQuery
+ * @mixins jQuery.plugin.tabIndex
+ */
+
}( jQuery ) );
-/**
+/*!
* Live edit preview.
*/
( function ( mw, $ ) {
/**
+ * @ignore
* @param {jQuery.Event} e
*/
function doLivePreview( e ) {
-/**
+/*!
* Styles for elements of the editing form.
*/
-/**
+/*!
* JavaScript for History action
*/
jQuery( function ( $ ) {
$lis = $( '#pagehistory > li' );
/**
+ * @ignore
* @context {Element} input
* @param e {jQuery.Event}
*/
-/**
- * This module enables double-click-to-edit functionality.
+/*!
+ * Enables double-click-to-edit functionality.
*/
( function ( mw, $ ) {
$( function () {
-/**
+/*!
* Exif metadata display for MediaWiki file uploads
*
* Add an expand/collapse link and collapse by default if set to
-/**
+/*!
* JavaScript to scroll the page to an id, when a redirect with fragment is viewed.
*/
( function ( mw, $ ) {
-/**
+/*!
* JavaScript to enable right click edit functionality.
* When the user right-clicks in a heading, it will open the
* edit screen.
-/**
+/*!
* Show gallery captions when focused. Copied directly from jquery.mw-jump.js.
* Also Dynamically resize images to justify them.
*/
-/**
+/*!
* Change multi-page image navigation so that the current page display can be changed
* without a page reload. Currently, the only image formats that can be multi-page images are
* PDF and DjVu files
-/**
+/*!
* Animate patrol links to use asynchronous API requests to
* patrol pages, rather than navigating to a different URI.
*
*
* This was reserved for future use but never ended up being used.
*
- * @deprecated since 1.22: Let deprecated identifiers keep their original name
+ * @deprecated since 1.22 Let deprecated identifiers keep their original name
* and use mw.log#deprecate to create an access container for tracking.
* @property
*/
/**
* @inheritdoc #getName
- * @deprecated since 1.20 use #getName instead
+ * @deprecated since 1.20 Use #getName instead
*/
name: function () {
return user.getName();
/**
* @inheritdoc #isAnon
- * @deprecated since 1.20 use #isAnon instead
+ * @deprecated since 1.20 Use #isAnon instead
*/
anonymous: function () {
return user.isAnon();
/**
* User-agent sniffing.
- * To be removed in MediaWiki 1.23.
*
* @deprecated since 1.17 Use jquery.client instead
*/
/**
* DOM utilities for handling of events, text nodes and selecting elements
*
- * To be removed in MediaWiki 1.23.
- *
* @deprecated since 1.17 Use jQuery instead
*/
msg = 'Use jQuery instead.';
/**
* Toggle checkboxes with shift selection
*
- * To be removed in MediaWiki 1.23.
- *
* @deprecated since 1.17 Use jquery.checkboxShiftClick instead
*/
msg = 'Use jquery.checkboxShiftClick instead.';
/**
* Add a button to the default editor toolbar
*
- * To be removed in MediaWiki 1.23.
- *
* @deprecated since 1.17 Use mw.toolbar instead
*/
mw.log.deprecate( win, 'mwEditButtons', [], 'Use mw.toolbar instead.' );
/**
* Spinner creation, injection and removal
*
- * To be removed in MediaWiki 1.23.
- *
* @deprecated since 1.18 Use jquery.spinner instead
*/
mw.log.deprecate( win, 'injectSpinner', $.noop, 'Use jquery.spinner instead.' );
/**
* Escape utilities
*
- * To be removed in MediaWiki 1.23.
- *
* @deprecated since 1.18 Use mw.html instead
*/
mw.log.deprecate( win, 'escapeQuotes', $.noop, 'Use mw.html instead.' );
/**
* Display a message to the user
*
- * To be removed in MediaWiki 1.23.
- *
* @deprecated since 1.17 Use mediawiki.notify instead
* @param {string|HTMLElement} message To be put inside the message box
*/
/**
* Misc. utilities
*
- * To be removed in MediaWiki 1.23.
- *
* @deprecated since 1.17 Use mediawiki.util instead
*/
msg = 'Use mediawiki.util instead.';