mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 08:10:35 +00:00
Merge "doc: Clean up spacing that caused <pre> or broken <ul>/<ol>"
This commit is contained in:
commit
5fdc9abdc8
|
@ -85,7 +85,7 @@ ve.dm.MWTransclusionModel.prototype.load = function ( data ) {
|
|||
*
|
||||
* @method
|
||||
* @param {Object[]} queue List of objects containing parts to add and optionally indexes to add
|
||||
* them at, if no index is given parts will be added at the end
|
||||
* them at, if no index is given parts will be added at the end
|
||||
* @emits add For each item added
|
||||
*/
|
||||
ve.dm.MWTransclusionModel.prototype.process = function ( queue ) {
|
||||
|
|
|
@ -41,7 +41,7 @@ ve.inheritClass( ve.ui.MWReferenceSearchWidget, ve.ui.SearchWidget );
|
|||
/**
|
||||
* @event select
|
||||
* @param {Object|string|null} data Reference node attributes, command string (e.g. 'create') or
|
||||
* null if no item is selected
|
||||
* null if no item is selected
|
||||
*/
|
||||
|
||||
/* Methods */
|
||||
|
|
|
@ -69,7 +69,7 @@ ve.ce.LeafNode.prototype.onTeardown = function () {
|
|||
*
|
||||
* @method
|
||||
* @returns {Array} Array of HTML fragments, i.e.
|
||||
* [ string | jQuery | [string|jQuery, ve.dm.AnnotationSet] ]
|
||||
* [ string | jQuery | [string|jQuery, ve.dm.AnnotationSet] ]
|
||||
*/
|
||||
ve.ce.LeafNode.prototype.getAnnotatedHtml = function () {
|
||||
return [ [ this.$, this.getModel().getAnnotations() ] ];
|
||||
|
|
|
@ -88,7 +88,7 @@ ve.dm.AnnotationSet.prototype.hasAnnotationWithName = function ( name ) {
|
|||
* @method
|
||||
* @param {number} [index] If set, only get the annotation at the index
|
||||
* @returns {ve.dm.Annotation[]|ve.dm.Annotation|undefined} The annotation at index, or an array of all
|
||||
* annotations in the set
|
||||
* annotations in the set
|
||||
*/
|
||||
ve.dm.AnnotationSet.prototype.get = function ( index ) {
|
||||
if ( index !== undefined ) {
|
||||
|
|
|
@ -490,20 +490,24 @@ ve.dm.Document.prototype.getText = function ( range ) {
|
|||
* top level. The tree is updated during this operation.
|
||||
*
|
||||
* Process:
|
||||
*
|
||||
* 1. Nodes between {index} and {index} + {numNodes} in {parent} will be removed
|
||||
* 2. Data will be retrieved from this.data using {offset} and {newLength}
|
||||
* 3. A document fragment will be generated from the retrieved data
|
||||
* 4. The document fragment's nodes will be inserted into {parent} at {index}
|
||||
*
|
||||
* Use cases:
|
||||
*
|
||||
* 1. Rebuild old nodes and offset data after a change to the linear model.
|
||||
* 2. Insert new nodes and offset data after a insertion in the linear model.
|
||||
*
|
||||
* @param {ve.dm.Node} parent Parent of the node(s) being rebuilt
|
||||
* @param {number} index Index within parent to rebuild or insert nodes
|
||||
*
|
||||
* - If {numNodes} == 0: Index to insert nodes at
|
||||
* - If {numNodes} >= 1: Index of first node to rebuild
|
||||
* @param {number} numNodes Total number of nodes to rebuild
|
||||
*
|
||||
* - If {numNodes} == 0: Nothing will be rebuilt, but the node(s) built from data will be
|
||||
* inserted before {index}. To insert nodes at the end, use number of children in 'parent'
|
||||
* - If {numNodes} == 1: Only the node at {index} will be rebuilt
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
* actions when the transaction is done being processed.
|
||||
*
|
||||
* IMPORTANT NOTE: It is assumed that:
|
||||
*
|
||||
* - The linear model has already been updated for the pushed actions
|
||||
* - Actions are pushed in increasing offset order
|
||||
* - Actions are non-overlapping
|
||||
|
|
|
@ -184,9 +184,9 @@ ve.dm.MetaList.prototype.onTransact = function ( tx, reversed ) {
|
|||
* @param {number} index Index in the metadata array associated with that offset
|
||||
* @param {string} [group] Group to search in. If not set, search in all groups
|
||||
* @param {boolean} [forInsertion] If the item is not found, return the index where it should have
|
||||
* been rather than null
|
||||
* been rather than null
|
||||
* @returns {number|null} Index into this.items or this.groups[group] where the item was found, or
|
||||
* null if not found
|
||||
* null if not found
|
||||
*/
|
||||
ve.dm.MetaList.prototype.findItem = function ( offset, index, group, forInsertion ) {
|
||||
// Binary search for the item
|
||||
|
|
|
@ -182,6 +182,7 @@ ve.dm.Model.static.enableAboutGrouping = false;
|
|||
* were already set by toDomElements().
|
||||
*
|
||||
* The value of this property can be one of the following:
|
||||
*
|
||||
* - true, to preserve all attributes (default)
|
||||
* - false, to preserve none
|
||||
* - a string, to preserve only that attribute
|
||||
|
|
|
@ -285,7 +285,7 @@ ve.dm.Surface.prototype.truncateUndoStack = function () {
|
|||
*
|
||||
* @method
|
||||
* @param {ve.dm.Transaction|ve.dm.Transaction[]|null} transactions One or more transactions to
|
||||
* process, or null to process none
|
||||
* process, or null to process none
|
||||
* @param {ve.Range|undefined} selection
|
||||
* @emits lock
|
||||
* @emits select
|
||||
|
|
|
@ -186,7 +186,7 @@ ve.dm.Transaction.newFromNodeReplacement = function ( doc, nodeOrRange, newData
|
|||
* @param {ve.dm.Document} doc Document to create transaction for
|
||||
* @param {number} offset Offset of element
|
||||
* @param {Object.<string,Mixed>} attr List of attribute key and value pairs, use undefined value
|
||||
* to remove an attribute
|
||||
* to remove an attribute
|
||||
* @returns {ve.dm.Transaction} Transaction that changes an element
|
||||
* @throws {Error} Cannot set attributes to non-element data
|
||||
* @throws {Error} Cannot set attributes on closing element
|
||||
|
|
|
@ -125,6 +125,7 @@ ve.ui.IndentationAction.prototype.indentListItem = function ( listItem ) {
|
|||
}
|
||||
/*
|
||||
* Indenting a list item is done as follows:
|
||||
*
|
||||
* 1. Wrap the listItem in a list and a listItem (<li> --> <li><ul><li>)
|
||||
* 2. Merge this wrapped listItem into the previous listItem if present
|
||||
* (<li>Previous</li><li><ul><li>This --> <li>Previous<ul><li>This)
|
||||
|
|
|
@ -54,7 +54,7 @@ ve.ui.FlaggableElement.prototype.getFlags = function () {
|
|||
*
|
||||
* @method
|
||||
* @param {string[]|Object.<string, boolean>} flags List of flags to add, or list of set/remove
|
||||
* values, keyed by flag name
|
||||
* values, keyed by flag name
|
||||
* @chainable
|
||||
*/
|
||||
ve.ui.FlaggableElement.prototype.setFlags = function ( flags ) {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* @param {ve.ui.OutlineWidget} outline Outline to control
|
||||
* @param {Object} [config] Config options
|
||||
* @cfg {Object[]} [adders] List of icons to show as addable item types, each an object with
|
||||
* name, title and icon properties
|
||||
* name, title and icon properties
|
||||
*/
|
||||
ve.ui.OutlineControlsWidget = function VeUiOutlineControlsWidget( outline, config ) {
|
||||
// Configuration initialization
|
||||
|
@ -108,7 +108,7 @@ ve.ui.OutlineControlsWidget.prototype.onOutlineChange = function () {
|
|||
*
|
||||
* @method
|
||||
* @param {Object[]} adders List of configuations for adder buttons, each containing a name, title
|
||||
* and icon property
|
||||
* and icon property
|
||||
*/
|
||||
ve.ui.OutlineControlsWidget.prototype.setupAdders = function ( adders ) {
|
||||
var i, len, addition, button,
|
||||
|
|
|
@ -48,8 +48,8 @@ ve.Document.prototype.getDocumentNode = function () {
|
|||
* - `leaves`: Return all leaf nodes in the given range (descends all the way down)
|
||||
* - `branches`': Return all branch nodes in the given range
|
||||
* - `covered`: Do not descend into nodes that are entirely covered by the range. The result
|
||||
* is similar to that of 'leaves' except that if a node is entirely covered, its
|
||||
* children aren't returned separately.
|
||||
* is similar to that of 'leaves' except that if a node is entirely covered, its
|
||||
* children aren't returned separately.
|
||||
* - `siblings`: Return a set of adjacent siblings covered by the range (descends as long as the
|
||||
* range is in a single node)
|
||||
* @returns {Array} List of objects describing nodes in the selection and the ranges therein:
|
||||
|
@ -65,7 +65,7 @@ ve.Document.prototype.getDocumentNode = function () {
|
|||
* - `nodeRange`: Range covering the inside of the entire node, not including wrapper
|
||||
* - `nodeOuterRange`: Range covering the entire node, including wrapper
|
||||
* - `parentOuterRange`: Outer range of node's parent. Missing if there is no parent
|
||||
* or if indexInNode is set.
|
||||
* or if indexInNode is set.
|
||||
*
|
||||
* @throws {Error} Range.start is out of range
|
||||
* @throws {Error} Range.end is out of range
|
||||
|
@ -493,9 +493,10 @@ ve.Document.prototype.selectNodes = function ( range, mode ) {
|
|||
*
|
||||
* @param {ve.Range} selection Range
|
||||
* @returns {Array} Array of objects. Each object has the following keys:
|
||||
* nodes: Array of sibling nodes covered by a part of range
|
||||
* parent: Parent of all of these nodes
|
||||
* grandparent: parent's parent
|
||||
*
|
||||
* - nodes: Array of sibling nodes covered by a part of range
|
||||
* - parent: Parent of all of these nodes
|
||||
* - grandparent: parent's parent
|
||||
*/
|
||||
ve.Document.prototype.getCoveredSiblingGroups = function ( selection ) {
|
||||
var i, firstCoveredSibling, lastCoveredSibling, node, parentNode, siblingNode,
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
* @param {Function} func Function to bind
|
||||
* @param {Object} context Context for the function
|
||||
* @param {Mixed...} [args] Variadic list of arguments to prepend to arguments
|
||||
* to the bound function
|
||||
* to the bound function
|
||||
* @returns {Function} The bound
|
||||
*/
|
||||
ve.bind = $.proxy;
|
||||
|
|
Loading…
Reference in a new issue