父节点
00b5bcdc4b
当前提交
0a4a7e3a7b
|
@ -36,8 +36,6 @@
|
|||
"OO.": "https://doc.wikimedia.org/oojs/master/{type}.html"
|
||||
},
|
||||
"linkMap": {
|
||||
"Mixed": "#",
|
||||
|
||||
"Array": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
|
||||
"Error": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
|
||||
"Object": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
|
||||
|
|
|
@ -137,8 +137,8 @@ ve.ce.TableCellNode.prototype.onUpdate = function () {
|
|||
* Handle attribute changes to keep the live HTML element updated.
|
||||
*
|
||||
* @param {string} key Attribute name
|
||||
* @param {Mixed} from Old value
|
||||
* @param {Mixed} to Old value
|
||||
* @param {any} from Old value
|
||||
* @param {any} to Old value
|
||||
*/
|
||||
ve.ce.TableCellNode.prototype.onAttributeChange = function ( key, from, to ) {
|
||||
switch ( key ) {
|
||||
|
|
|
@ -510,7 +510,7 @@ ve.dm.ElementLinearData.prototype.setAnnotationHashesAtOffset = function ( offse
|
|||
*
|
||||
* @param {number} offset Offset to set/unset attribute at
|
||||
* @param {string} key Attribute name
|
||||
* @param {Mixed} value Value to set, or undefined to unset
|
||||
* @param {any} value Value to set, or undefined to unset
|
||||
*/
|
||||
ve.dm.ElementLinearData.prototype.setAttributeAtOffset = function ( offset, key, value ) {
|
||||
if ( !this.isElementData( offset ) ) {
|
||||
|
@ -866,7 +866,7 @@ ve.dm.ElementLinearData.prototype.getSourceText = function ( range ) {
|
|||
* @param {number} distance Number of valid offsets to move
|
||||
* @param {Function} callback Function to call to check if an offset is valid which will be
|
||||
* given initial argument of offset
|
||||
* @param {...Mixed} [args] Additional arguments to pass to the callback
|
||||
* @param {...any} [args] Additional arguments to pass to the callback
|
||||
* @return {number} Relative valid offset or -1 if there are no valid offsets in data
|
||||
*/
|
||||
ve.dm.ElementLinearData.prototype.getRelativeOffset = function ( offset, distance, callback ) {
|
||||
|
|
|
@ -253,7 +253,7 @@ ve.dm.Change.static.deserializeValue = function ( serialized, unsafe ) {
|
|||
*
|
||||
* @param {ve.dm.Transaction} transactionA Transaction A
|
||||
* @param {ve.dm.Transaction} transactionB Transaction B, with the same document start state
|
||||
* @return {Mixed[]} [ aRebasedOntoB, bRebasedOntoA ], or [ null, null ] if conflicting
|
||||
* @return {any[]} [ aRebasedOntoB, bRebasedOntoA ], or [ null, null ] if conflicting
|
||||
*/
|
||||
ve.dm.Change.static.rebaseTransactions = function ( transactionA, transactionB ) {
|
||||
transactionA = transactionA.clone();
|
||||
|
|
|
@ -1770,7 +1770,7 @@ ve.dm.Document.prototype.getDir = function () {
|
|||
* such as InternalList's nextUniqueNumber.
|
||||
*
|
||||
* @param {string|Object} [keyOrStorage] Key, or storage object to restore
|
||||
* @param {Mixed} [value] Serializable value, if key is set
|
||||
* @param {any} [value] Serializable value, if key is set
|
||||
* @fires ve.dm.Document#storage
|
||||
*/
|
||||
ve.dm.Document.prototype.setStorage = function ( keyOrStorage, value ) {
|
||||
|
@ -1786,7 +1786,7 @@ ve.dm.Document.prototype.setStorage = function ( keyOrStorage, value ) {
|
|||
* Get a value from the persistent static storage, or the whole store
|
||||
*
|
||||
* @param {string} [key] Key
|
||||
* @return {Mixed|Object} Value at key, or whole storage object if key not provided
|
||||
* @return {any|Object} Value at key, or whole storage object if key not provided
|
||||
*/
|
||||
ve.dm.Document.prototype.getStorage = function ( key ) {
|
||||
if ( key ) {
|
||||
|
|
|
@ -419,7 +419,7 @@ ve.dm.Model.prototype.getType = function () {
|
|||
* Return value is by reference if array or object.
|
||||
*
|
||||
* @param {string} key Name of attribute to get
|
||||
* @return {Mixed} Value of attribute, or undefined if no such attribute exists
|
||||
* @return {any} Value of attribute, or undefined if no such attribute exists
|
||||
*/
|
||||
ve.dm.Model.prototype.getAttribute = function ( key ) {
|
||||
return this.element && this.element.attributes ? this.element.attributes[ key ] : undefined;
|
||||
|
|
|
@ -27,7 +27,7 @@ OO.inheritClass( ve.dm.ModelFactory, OO.Factory );
|
|||
* Create a new item from a model element
|
||||
*
|
||||
* @param {Object} element Model element
|
||||
* @param {...Mixed} [args] Arguments to pass to the constructor
|
||||
* @param {...any} [args] Arguments to pass to the constructor
|
||||
* @return {ve.dm.Model} Model constructed from element
|
||||
* @throws {Error} Element must have a .type property
|
||||
*/
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
* @private
|
||||
* @param {Object} obj Object the array resides in
|
||||
* @param {...string} keys
|
||||
* @param {Mixed} value
|
||||
* @param {any} value
|
||||
*/
|
||||
function addType( obj, ...keys ) {
|
||||
var value = keys.pop(),
|
||||
|
@ -77,7 +77,7 @@
|
|||
* @private
|
||||
* @param {Object} obj Object the array resides in
|
||||
* @param {...string} keys
|
||||
* @param {Mixed} value to remove
|
||||
* @param {any} value to remove
|
||||
*/
|
||||
function removeType( obj, ...keys ) {
|
||||
var value = keys.pop(),
|
||||
|
|
|
@ -32,8 +32,8 @@ ve.dm.Node = function VeDmNode( element ) {
|
|||
/**
|
||||
* @event ve.dm.Node#attributeChange
|
||||
* @param {string} key
|
||||
* @param {Mixed} oldValue
|
||||
* @param {Mixed} newValue
|
||||
* @param {any} oldValue
|
||||
* @param {any} newValue
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -259,8 +259,8 @@ ve.dm.Transaction.prototype.pushReplaceOp = function ( remove, insert, insertedD
|
|||
* Build an attribute operation
|
||||
*
|
||||
* @param {string} key Name of attribute to change
|
||||
* @param {Mixed} from Value to change attribute from, or undefined if not previously set
|
||||
* @param {Mixed} to Value to change attribute to, or undefined to remove
|
||||
* @param {any} from Value to change attribute from, or undefined if not previously set
|
||||
* @param {any} to Value to change attribute to, or undefined to remove
|
||||
*/
|
||||
ve.dm.Transaction.prototype.pushAttributeOp = function ( key, from, to ) {
|
||||
this.operations.push( { type: 'attribute', key: key, from: from, to: to } );
|
||||
|
|
|
@ -239,7 +239,7 @@ ve.dm.TransactionBuilder.static.newFromDocumentInsertion = function ( doc, offse
|
|||
* @static
|
||||
* @param {ve.dm.Document} doc Document in pre-transaction state
|
||||
* @param {number} offset Offset of element
|
||||
* @param {Object.<string,Mixed>} attr List of attribute key and value pairs, use undefined value
|
||||
* @param {Object.<string,any>} attr List of attribute key and value pairs, use undefined value
|
||||
* to remove an attribute
|
||||
* @return {ve.dm.Transaction} Transaction that changes an element
|
||||
* @throws {Error} Cannot set attributes to non-element data
|
||||
|
@ -852,8 +852,8 @@ ve.dm.TransactionBuilder.prototype.pushReplacement = function ( doc, offset, rem
|
|||
* Add an element attribute change operation.
|
||||
*
|
||||
* @param {string} key Name of attribute to change
|
||||
* @param {Mixed} from Value change attribute from, or undefined if not previously set
|
||||
* @param {Mixed} to Value to change attribute to, or undefined to remove
|
||||
* @param {any} from Value change attribute from, or undefined if not previously set
|
||||
* @param {any} to Value to change attribute to, or undefined to remove
|
||||
*/
|
||||
ve.dm.TransactionBuilder.prototype.pushReplaceElementAttribute = function ( key, from, to ) {
|
||||
this.transaction.pushAttributeOp( key, from, to );
|
||||
|
|
|
@ -192,7 +192,7 @@ ve.dm.TransactionProcessor.prototype.rollbackModifications = function () {
|
|||
* @private
|
||||
* @param {ve.dm.Node} node
|
||||
* @param {string} event Event name
|
||||
* @param {...Mixed} [args] Additional arguments to be passed to the event when fired
|
||||
* @param {...any} [args] Additional arguments to be passed to the event when fired
|
||||
*/
|
||||
ve.dm.TransactionProcessor.prototype.queueEvent = function ( node ) {
|
||||
var args = Array.prototype.slice.call( arguments, 1 );
|
||||
|
@ -301,7 +301,7 @@ ve.dm.TransactionProcessor.modifiers.splice = function ( splices ) {
|
|||
*
|
||||
* @param {number} offset Offset in data array (unadjusted)
|
||||
* @param {string} key Attribute name
|
||||
* @param {Mixed} value New attribute value
|
||||
* @param {any} value New attribute value
|
||||
*/
|
||||
ve.dm.TransactionProcessor.modifiers.setAttribute = function ( offset, key, value ) {
|
||||
var data = this.document.data;
|
||||
|
@ -366,8 +366,8 @@ ve.dm.TransactionProcessor.processors.retain = function ( op ) {
|
|||
*
|
||||
* @param {Object} op Operation object
|
||||
* @param {string} op.key Attribute name
|
||||
* @param {Mixed} op.from Old attribute value, or undefined if not previously set
|
||||
* @param {Mixed} op.to New attribute value, or undefined to unset
|
||||
* @param {any} op.from Old attribute value, or undefined if not previously set
|
||||
* @param {any} op.to New attribute value, or undefined to unset
|
||||
*/
|
||||
ve.dm.TransactionProcessor.processors.attribute = function ( op ) {
|
||||
if ( !this.document.data.isElementData( this.cursor ) ) {
|
||||
|
|
|
@ -89,8 +89,8 @@ OO.initClass( ve.dm.TransactionSquasher );
|
|||
/**
|
||||
* Test whether two linmod items have equal values
|
||||
*
|
||||
* @param {Mixed} item1 A data item
|
||||
* @param {Mixed} item2 Another data item
|
||||
* @param {any} item1 A data item
|
||||
* @param {any} item2 Another data item
|
||||
* @return {boolean} Whether the items have equal values
|
||||
*/
|
||||
ve.dm.TransactionSquasher.static.equalItems = function ( item1, item2 ) {
|
||||
|
@ -380,8 +380,8 @@ ve.dm.TransactionSquasher.prototype.processInsert = function ( items ) {
|
|||
*
|
||||
* @private
|
||||
* @param {string} key The attribute key
|
||||
* @param {Mixed} from The old value
|
||||
* @param {Mixed} to The new value
|
||||
* @param {any} from The old value
|
||||
* @param {any} to The new value
|
||||
*/
|
||||
ve.dm.TransactionSquasher.prototype.processAttribute = function ( key, from, to ) {
|
||||
this.normalizePosition();
|
||||
|
@ -421,8 +421,8 @@ ve.dm.TransactionSquasher.prototype.processAttribute = function ( key, from, to
|
|||
* @private
|
||||
* @param {Object} openElement The open element
|
||||
* @param {string} key The attribute name
|
||||
* @param {Mixed} from Old value, or undefined if the attribute is being created
|
||||
* @param {Mixed} to New value, or undefined if the attribute is being removed
|
||||
* @param {any} from Old value, or undefined if the attribute is being created
|
||||
* @param {any} to New value, or undefined if the attribute is being removed
|
||||
*/
|
||||
ve.dm.TransactionSquasher.prototype.changeElement = function ( openElement, key, from, to ) {
|
||||
if ( !openElement.attributes ) {
|
||||
|
|
|
@ -136,7 +136,7 @@ ve.init.Platform.prototype.notify = null;
|
|||
*
|
||||
* @abstract
|
||||
* @param {string|string[]} key Config key, or list of keys
|
||||
* @return {Mixed|Object} Config value, or keyed object of config values if list of keys provided
|
||||
* @return {any|Object} Config value, or keyed object of config values if list of keys provided
|
||||
*/
|
||||
ve.init.Platform.prototype.getConfig = null;
|
||||
|
||||
|
@ -145,7 +145,7 @@ ve.init.Platform.prototype.getConfig = null;
|
|||
*
|
||||
* @abstract
|
||||
* @param {string|string[]} key Config key, or list of keys
|
||||
* @return {Mixed|Object} Config value, or keyed object of config values if list of keys provided
|
||||
* @return {any|Object} Config value, or keyed object of config values if list of keys provided
|
||||
*/
|
||||
ve.init.Platform.prototype.getUserConfig = null;
|
||||
|
||||
|
@ -154,7 +154,7 @@ ve.init.Platform.prototype.getUserConfig = null;
|
|||
*
|
||||
* @abstract
|
||||
* @param {string|Object} keyOrValueMap Key to set value for, or object mapping keys to values
|
||||
* @param {Mixed} [value] Value to set (optional, only in use when key is a string)
|
||||
* @param {any} [value] Value to set (optional, only in use when key is a string)
|
||||
*/
|
||||
ve.init.Platform.prototype.setUserConfig = null;
|
||||
|
||||
|
@ -209,7 +209,7 @@ ve.init.Platform.prototype.addMessages = null;
|
|||
*
|
||||
* @abstract
|
||||
* @param {string} key Message key
|
||||
* @param {...Mixed} [args] List of arguments which will be injected at $1, $2, etc. in the message
|
||||
* @param {...any} [args] List of arguments which will be injected at $1, $2, etc. in the message
|
||||
* @return {string} Localized message, or key or '<' + key + '>' if message not found
|
||||
*/
|
||||
ve.init.Platform.prototype.getMessage = null;
|
||||
|
@ -246,7 +246,7 @@ ve.init.Platform.prototype.formatNumber = null;
|
|||
*
|
||||
* @abstract
|
||||
* @param {string} key Message key
|
||||
* @param {...Mixed} [args] List of arguments which will be injected at $1, $2, etc. in the message
|
||||
* @param {...any} [args] List of arguments which will be injected at $1, $2, etc. in the message
|
||||
* @return {Node[]} Localized message, or key or '<' + key + '>' if message not found
|
||||
*/
|
||||
ve.init.Platform.prototype.getHtmlMessage = null;
|
||||
|
|
|
@ -148,7 +148,7 @@ ve.ui.CompletionAction.prototype.getSequenceLength = function () {
|
|||
* Make a menu item for a given suggestion
|
||||
*
|
||||
* @protected
|
||||
* @param {Mixed} suggestion Suggestion data, string by default
|
||||
* @param {any} suggestion Suggestion data, string by default
|
||||
* @return {OO.ui.MenuOptionWidget}
|
||||
*/
|
||||
ve.ui.CompletionAction.prototype.getMenuItemForSuggestion = function ( suggestion ) {
|
||||
|
@ -178,9 +178,9 @@ ve.ui.CompletionAction.prototype.updateMenuItems = function ( menuItems ) {
|
|||
* input to the list if alwaysIncludeInput and there wasn't an exact match.
|
||||
*
|
||||
* @protected
|
||||
* @param {Mixed[]} suggestions List of valid completions, strings by default
|
||||
* @param {any[]} suggestions List of valid completions, strings by default
|
||||
* @param {string} input Input to filter the suggestions to
|
||||
* @return {Mixed[]}
|
||||
* @return {any[]}
|
||||
*/
|
||||
ve.ui.CompletionAction.prototype.filterSuggestionsForInput = function ( suggestions, input ) {
|
||||
input = input.trim();
|
||||
|
@ -206,7 +206,7 @@ ve.ui.CompletionAction.prototype.filterSuggestionsForInput = function ( suggesti
|
|||
/**
|
||||
* Compare a suggestion to the normalized user input (lower case)
|
||||
*
|
||||
* @param {Mixed} suggestion Suggestion data, string by default
|
||||
* @param {any} suggestion Suggestion data, string by default
|
||||
* @param {string} normalizedInput Noramlized user input
|
||||
* @return {Object} Match object, containing two booleans, `isMatch` and `isExact`
|
||||
*/
|
||||
|
@ -222,7 +222,7 @@ ve.ui.CompletionAction.prototype.compareSuggestionToInput = function ( suggestio
|
|||
* Create a suggestion from an input
|
||||
*
|
||||
* @param {string} input User input
|
||||
* @return {Mixed} Suggestion data, string by default
|
||||
* @return {any} Suggestion data, string by default
|
||||
*/
|
||||
ve.ui.CompletionAction.prototype.createSuggestion = function ( input ) {
|
||||
return input;
|
||||
|
|
|
@ -685,7 +685,7 @@ ve.ui.Surface.prototype.getCommands = function () {
|
|||
*
|
||||
* @param {ve.ui.Trigger|string} triggerOrAction Trigger or symbolic name of action
|
||||
* @param {string} [method] Action method name
|
||||
* @param {...Mixed} [args] Additional arguments for action
|
||||
* @param {...any} [args] Additional arguments for action
|
||||
* @return {boolean} Action or command was executed
|
||||
*/
|
||||
ve.ui.Surface.prototype.execute = function ( triggerOrAction, method ) {
|
||||
|
@ -698,7 +698,7 @@ ve.ui.Surface.prototype.execute = function ( triggerOrAction, method ) {
|
|||
* @param {ve.ui.Trigger|string} triggerOrAction Trigger or symbolic name of action
|
||||
* @param {string} [method] Action method name
|
||||
* @param {string} [source] Action source, for logging
|
||||
* @param {...Mixed} [args] Additional arguments for action
|
||||
* @param {...any} [args] Additional arguments for action
|
||||
* @return {boolean} Action or command was executed
|
||||
*/
|
||||
ve.ui.Surface.prototype.executeWithSource = function ( triggerOrAction, method, source ) {
|
||||
|
|
|
@ -152,7 +152,7 @@ ve.Filibuster.prototype.observe = function ( action ) {
|
|||
* @param {string} funcName The name of the function
|
||||
* @param {string} action The function call phase: call|return|throw
|
||||
* @param {Array} [args] The call arguments (if action === 'call')
|
||||
* @param {Mixed} [returned] The return value (if action === 'return')
|
||||
* @param {any} [returned] The return value (if action === 'return')
|
||||
*/
|
||||
ve.Filibuster.prototype.log = function ( funcName, action, args, returned ) {
|
||||
if ( !this.active ) {
|
||||
|
|
|
@ -17,14 +17,14 @@ ve.debug = true;
|
|||
/**
|
||||
* Logs data to the console.
|
||||
*
|
||||
* @param {...Mixed} [data] Data to log
|
||||
* @param {...any} [data] Data to log
|
||||
*/
|
||||
ve.log = console.log;
|
||||
|
||||
/**
|
||||
* Logs error to the console.
|
||||
*
|
||||
* @param {...Mixed} [data] Data to log
|
||||
* @param {...any} [data] Data to log
|
||||
*/
|
||||
ve.error = console.error;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ ve.isInstanceOfAny = function ( subject, classes ) {
|
|||
*
|
||||
* @method
|
||||
* @param {Object} obj
|
||||
* @param {...Mixed} [keys]
|
||||
* @param {...any} [keys]
|
||||
* @return {Object|undefined} obj[arguments[1]][arguments[2]].... or undefined
|
||||
*/
|
||||
ve.getProp = OO.getProp;
|
||||
|
@ -54,8 +54,8 @@ ve.getProp = OO.getProp;
|
|||
*
|
||||
* @method
|
||||
* @param {Object} obj
|
||||
* @param {...Mixed} [keys]
|
||||
* @param {Mixed} [value]
|
||||
* @param {...any} [keys]
|
||||
* @param {any} [value]
|
||||
*/
|
||||
ve.setProp = OO.setProp;
|
||||
|
||||
|
@ -67,7 +67,7 @@ ve.setProp = OO.setProp;
|
|||
*
|
||||
* @method
|
||||
* @param {Object} obj
|
||||
* @param {...Mixed} [keys]
|
||||
* @param {...any} [keys]
|
||||
*/
|
||||
ve.deleteProp = OO.deleteProp;
|
||||
|
||||
|
@ -291,10 +291,10 @@ ve.isEmptyObject = $.isEmptyObject;
|
|||
*
|
||||
* @method
|
||||
* @param {boolean} [recursive=false]
|
||||
* @param {Mixed} [target] Object that will receive the new properties
|
||||
* @param {...Mixed} [sources] Variadic list of objects containing properties
|
||||
* @param {any} [target] Object that will receive the new properties
|
||||
* @param {...any} [sources] Variadic list of objects containing properties
|
||||
* to be merged into the target.
|
||||
* @return {Mixed} Modified version of first or second argument
|
||||
* @return {any} Modified version of first or second argument
|
||||
*/
|
||||
ve.extendObject = $.extend;
|
||||
|
||||
|
@ -451,7 +451,7 @@ ve.batchPush = function ( arr, data ) {
|
|||
*
|
||||
* This implementation does nothing, to add a real implementation ve.debug needs to be loaded.
|
||||
*
|
||||
* @param {...Mixed} [args] Data to log
|
||||
* @param {...any} [args] Data to log
|
||||
*/
|
||||
ve.log = ve.log || function () {
|
||||
// Don't do anything, this is just a stub
|
||||
|
@ -462,7 +462,7 @@ ve.log = ve.log || function () {
|
|||
*
|
||||
* This implementation does nothing, to add a real implementation ve.debug needs to be loaded.
|
||||
*
|
||||
* @param {...Mixed} [args] Data to log
|
||||
* @param {...any} [args] Data to log
|
||||
*/
|
||||
ve.error = ve.error || function () {
|
||||
// Don't do anything, this is just a stub
|
||||
|
@ -497,7 +497,7 @@ ve.deepFreeze = ve.deepFreeze || function ( obj ) {
|
|||
* Get a localized message.
|
||||
*
|
||||
* @param {string} key Message key
|
||||
* @param {...Mixed} [params] Message parameters
|
||||
* @param {...any} [params] Message parameters
|
||||
* @return {string} Localized message
|
||||
*/
|
||||
ve.msg = function () {
|
||||
|
@ -510,7 +510,7 @@ ve.msg = function () {
|
|||
* Get an HTML localized message with HTML or DOM arguments.
|
||||
*
|
||||
* @param {string} key Message key
|
||||
* @param {...Mixed} [params] Message parameters
|
||||
* @param {...any} [params] Message parameters
|
||||
* @return {Node[]} Localized message
|
||||
*/
|
||||
ve.htmlMsg = function () {
|
||||
|
@ -523,7 +523,7 @@ ve.htmlMsg = function () {
|
|||
* Get platform config value(s)
|
||||
*
|
||||
* @param {string|string[]} key Config key, or list of keys
|
||||
* @return {Mixed|Object} Config value, or keyed object of config values if list of keys provided
|
||||
* @return {any|Object} Config value, or keyed object of config values if list of keys provided
|
||||
*/
|
||||
ve.config = function () {
|
||||
return ve.init.platform.getConfig.apply( ve.init.platform, arguments );
|
||||
|
@ -533,8 +533,8 @@ ve.config = function () {
|
|||
* Get or set a user config value.
|
||||
*
|
||||
* @param {string|string[]|Object} key Config key, list of keys or object mapping keys to values
|
||||
* @param {Mixed} [value] Value to set, if setting and key is a string
|
||||
* @return {Mixed|Object|boolean} Config value, keyed object of config values if list of keys provided,
|
||||
* @param {any} [value] Value to set, if setting and key is a string
|
||||
* @return {any|Object|boolean} Config value, keyed object of config values if list of keys provided,
|
||||
* or success boolean if setting.
|
||||
*/
|
||||
ve.userConfig = function ( key ) {
|
||||
|
|
正在加载...
在新工单中引用