mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Converted some instances of "var\t" to "var "
Change-Id: I02154e0381d5ae65b482bbcfc21ac93d0bf30d86
This commit is contained in:
parent
6b34f09df2
commit
a0f537712e
|
@ -133,7 +133,7 @@ ve.dm.Converter.prototype.getDomElementFromDataElement = function( dataElement )
|
|||
) {
|
||||
return false;
|
||||
}
|
||||
var domElement = this.elements.toDomElement[dataElementType]( dataElementType, dataElement ),
|
||||
var domElement = this.elements.toDomElement[dataElementType]( dataElementType, dataElement ),
|
||||
dataElementAttributes = dataElement.attributes;
|
||||
if ( dataElementAttributes ) {
|
||||
for ( var key in dataElementAttributes ) {
|
||||
|
@ -189,7 +189,7 @@ ve.dm.Converter.prototype.getDataElementFromDomElement = function( domElement )
|
|||
* @returns {Object|false} Annotation object, or false if this node is not an annotation
|
||||
*/
|
||||
ve.dm.Converter.prototype.getDataAnnotationFromDomElement = function( domElement ) {
|
||||
var domElementType = domElement.nodeName.toLowerCase(),
|
||||
var domElementType = domElement.nodeName.toLowerCase(),
|
||||
toDataAnnotation = this.annotations.toDataAnnotation[domElementType];
|
||||
if ( typeof toDataAnnotation === 'function' ) {
|
||||
return toDataAnnotation( domElementType, domElement );
|
||||
|
@ -205,7 +205,7 @@ ve.dm.Converter.prototype.getDataAnnotationFromDomElement = function( domElement
|
|||
* @returns {HTMLElement|false} HTML DOM node, or false if this annotation is not known
|
||||
*/
|
||||
ve.dm.Converter.prototype.getDomElementFromDataAnnotation = function( dataAnnotation ) {
|
||||
var split = dataAnnotation.type.split( '/', 2 ),
|
||||
var split = dataAnnotation.type.split( '/', 2 ),
|
||||
baseType = split[0],
|
||||
subType = split.slice( 1 ).join( '/' ),
|
||||
toDomElement = this.annotations.toDomElement[baseType];
|
||||
|
|
|
@ -623,7 +623,7 @@ ve.dm.Document.getMatchingAnnotations = function( annotations, pattern ) {
|
|||
*/
|
||||
ve.dm.Document.prototype.getAnnotationsFromRange = function( range, all ) {
|
||||
range.normalize();
|
||||
var annotations = {},
|
||||
var annotations = {},
|
||||
count = 0,
|
||||
left,
|
||||
right,
|
||||
|
@ -1206,7 +1206,7 @@ ve.dm.Document.prototype.fixupInsertion = function( data, offset ) {
|
|||
* @returns {Array} Balanced snippet of linear model data
|
||||
*/
|
||||
ve.dm.Document.prototype.getBalancedData = function( range ) {
|
||||
var node = this.getNodeFromOffset( range.start ),
|
||||
var node = this.getNodeFromOffset( range.start ),
|
||||
selection = this.selectNodes( range, 'siblings' ),
|
||||
addOpenings = [],
|
||||
addClosings = [];
|
||||
|
@ -1219,7 +1219,7 @@ ve.dm.Document.prototype.getBalancedData = function( range ) {
|
|||
return this.data.slice( range.start, range.end );
|
||||
}
|
||||
|
||||
var first = selection[0],
|
||||
var first = selection[0],
|
||||
last = selection[selection.length - 1],
|
||||
firstNode = first.node,
|
||||
lastNode = last.node;
|
||||
|
|
|
@ -240,7 +240,7 @@ ve.dm.Node.prototype.getClonedElement = function() {
|
|||
* @returns {Boolean} Nodes can be merged
|
||||
*/
|
||||
ve.dm.Node.prototype.canBeMergedWith = function( node ) {
|
||||
var n1 = this,
|
||||
var n1 = this,
|
||||
n2 = node;
|
||||
// Move up from n1 and n2 simultaneously until we find a common ancestor
|
||||
while ( n1 !== n2 ) {
|
||||
|
|
|
@ -374,7 +374,7 @@ ve.dm.Transaction.newFromWrap = function( doc, range, unwrapOuter, wrapOuter, un
|
|||
}
|
||||
|
||||
if ( wrapEach.length > 0 || unwrapEach.length > 0 ) {
|
||||
var closingUnwrapEach = closingArray( unwrapEach ),
|
||||
var closingUnwrapEach = closingArray( unwrapEach ),
|
||||
closingWrapEach = closingArray( wrapEach ),
|
||||
depth = 0,
|
||||
startOffset,
|
||||
|
|
|
@ -193,7 +193,7 @@ ve.dm.TransactionProcessor.processors.attribute = function( op ) {
|
|||
* @param {Array} op.insert Linear model data to insert
|
||||
*/
|
||||
ve.dm.TransactionProcessor.processors.replace = function( op ) {
|
||||
var remove = this.reversed ? op.insert : op.remove,
|
||||
var remove = this.reversed ? op.insert : op.remove,
|
||||
insert = this.reversed ? op.remove : op.insert,
|
||||
removeIsContent = ve.dm.Document.isContentData( remove ),
|
||||
insertIsContent = ve.dm.Document.isContentData( insert ),
|
||||
|
@ -211,7 +211,7 @@ ve.dm.TransactionProcessor.processors.replace = function( op ) {
|
|||
),
|
||||
'leaves'
|
||||
);
|
||||
var removeHasStructure = ve.dm.Document.containsElementData( remove ),
|
||||
var removeHasStructure = ve.dm.Document.containsElementData( remove ),
|
||||
insertHasStructure = ve.dm.Document.containsElementData( insert );
|
||||
if ( removeHasStructure || insertHasStructure ) {
|
||||
// Replacement is not exclusively text
|
||||
|
@ -253,7 +253,7 @@ ve.dm.TransactionProcessor.processors.replace = function( op ) {
|
|||
opAdjustment = 0;
|
||||
while ( true ) {
|
||||
if ( operation.type === 'replace' ) {
|
||||
var opRemove = this.reversed ? operation.insert : operation.remove,
|
||||
var opRemove = this.reversed ? operation.insert : operation.remove,
|
||||
opInsert = this.reversed ? operation.remove : operation.insert;
|
||||
// Update the linear model for this insert
|
||||
ve.batchSplice( this.document.data, this.cursor, opRemove.length, opInsert );
|
||||
|
|
|
@ -70,7 +70,7 @@ ve.FormatDropdownTool = function( toolbar, name, title ) {
|
|||
/* Methods */
|
||||
|
||||
ve.FormatDropdownTool.splitAndUnwrap = function( model, list, firstItem, lastItem, selection ) {
|
||||
var doc = model.getDocument(),
|
||||
var doc = model.getDocument(),
|
||||
start = firstItem.getOuterRange().start,
|
||||
end = lastItem.getOuterRange().end,
|
||||
tx;
|
||||
|
@ -102,7 +102,7 @@ ve.FormatDropdownTool.splitAndUnwrap = function( model, list, firstItem, lastIte
|
|||
};
|
||||
|
||||
ve.FormatDropdownTool.prototype.onSelect = function( item ) {
|
||||
var surfaceView = this.toolbar.getSurfaceView(),
|
||||
var surfaceView = this.toolbar.getSurfaceView(),
|
||||
model = surfaceView.getModel(),
|
||||
selection = model.getSelection(),
|
||||
doc = model.getDocument();
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
ve.ui.IndentationButtonTool.prototype.onClick = function() {
|
||||
if ( !this.$.hasClass( 'es-toolbarButtonTool-disabled' ) ) {
|
||||
var listItems = [],
|
||||
var listItems = [],
|
||||
listItem,
|
||||
i;
|
||||
// FIXME old code, doesn't work
|
||||
|
@ -47,7 +47,7 @@ ve.ui.IndentationButtonTool.prototype.onClick = function() {
|
|||
|
||||
ve.ui.IndentationButtonTool.prototype.indent = function( listItems ) {
|
||||
// FIXME old code, doesn't work
|
||||
var surface = this.toolbar.surfaceView,
|
||||
var surface = this.toolbar.surfaceView,
|
||||
styles,
|
||||
i,
|
||||
tx;
|
||||
|
@ -68,7 +68,7 @@ ve.ui.IndentationButtonTool.prototype.indent = function( listItems ) {
|
|||
|
||||
ve.ui.IndentationButtonTool.prototype.outdent = function( listItems ) {
|
||||
// FIXME old code, doesn't work
|
||||
var surface = this.toolbar.surfaceView,
|
||||
var surface = this.toolbar.surfaceView,
|
||||
styles,
|
||||
i,
|
||||
tx;
|
||||
|
|
|
@ -115,7 +115,7 @@ ve.ui.ListButtonTool.prototype.onClick = function() {
|
|||
};
|
||||
|
||||
ve.ui.ListButtonTool.prototype.updateState = function( annotations, nodes ) {
|
||||
var surfaceView = this.toolbar.getSurfaceView(),
|
||||
var surfaceView = this.toolbar.getSurfaceView(),
|
||||
surfaceModel = surfaceView.getModel(),
|
||||
doc = surfaceView.getDocument(),
|
||||
selection = surfaceModel.getSelection(),
|
||||
|
|
|
@ -123,7 +123,7 @@ ve.ui.Context.prototype.set = function() {
|
|||
ve.ui.Context.prototype.positionIcon = function() {
|
||||
this.$.removeClass( 'es-contextView-position-start es-contextView-position-end' );
|
||||
|
||||
var selection = this.surfaceView.model.getSelection(),
|
||||
var selection = this.surfaceView.model.getSelection(),
|
||||
selectionRect = this.surfaceView.getSelectionRect();
|
||||
|
||||
if( selection.to > selection.from ) {
|
||||
|
|
|
@ -19,7 +19,7 @@ ve.ui.Toolbar = function( $container, surfaceView, config ) {
|
|||
}
|
||||
|
||||
// References for use in closures
|
||||
var _this = this,
|
||||
var _this = this,
|
||||
$window = $( window );
|
||||
|
||||
// Properties
|
||||
|
@ -113,7 +113,7 @@ ve.ui.Toolbar.prototype.getSurfaceView = function() {
|
|||
|
||||
ve.ui.Toolbar.prototype.setup = function() {
|
||||
for ( var i = 0; i < this.config.length; i++ ) {
|
||||
var $group = $( '<div>' )
|
||||
var $group = $( '<div>' )
|
||||
.addClass( 'es-toolbarGroup' )
|
||||
.addClass( 'es-toolbarGroup-' + this.config[i].name );
|
||||
if ( this.config[i].label ) {
|
||||
|
|
|
@ -182,7 +182,7 @@ ve.BranchNode.prototype.getOffsetFromNode = function( node ) {
|
|||
*/
|
||||
ve.BranchNode.prototype.traverseLeafNodes = function( callback, from, reverse ) {
|
||||
// Stack of indices that lead from this to node
|
||||
var indexStack = [],
|
||||
var indexStack = [],
|
||||
// Node whose children we're currently traversing
|
||||
node = this,
|
||||
// Index of the child node we're currently visiting
|
||||
|
|
|
@ -55,7 +55,7 @@ ve.Document.prototype.getDocumentNode = function() {
|
|||
*/
|
||||
ve.Document.prototype.selectNodes = function( range, mode ) {
|
||||
range.normalize();
|
||||
var doc = this.documentNode,
|
||||
var doc = this.documentNode,
|
||||
retval = [],
|
||||
start = range.start,
|
||||
end = range.end,
|
||||
|
|
|
@ -173,7 +173,7 @@ ve.Surface.prototype.makeMainEditorToolbarFloat = function() {
|
|||
var toolbarWrapperOffset = $toolbarWrapper.offset();
|
||||
if ( $window.scrollTop() > toolbarWrapperOffset.top ) {
|
||||
if ( !$toolbarWrapper.hasClass( 'float' ) ) {
|
||||
var left = toolbarWrapperOffset.left,
|
||||
var left = toolbarWrapperOffset.left,
|
||||
right = $window.width() - $toolbarWrapper.outerWidth() - left;
|
||||
$toolbarWrapper.css( 'height', $toolbarWrapper.height() ).addClass( 'float' );
|
||||
$toolbar.css( { 'left': left, 'right': right } );
|
||||
|
@ -329,7 +329,7 @@ ve.Surface.prototype.defineModes = function() {
|
|||
'$': _this.$base.find( '.es-mode-history' ),
|
||||
'$panel': _this.$base.find( '.es-panel-history' ),
|
||||
'update': function() {
|
||||
var history = _this.model.getHistory(),
|
||||
var history = _this.model.getHistory(),
|
||||
i = history.length,
|
||||
end = Math.max( 0, i - 25 ),
|
||||
j,
|
||||
|
|
|
@ -157,7 +157,7 @@ test( 'traverseLeafNodes', 1, function() {
|
|||
];
|
||||
|
||||
function executeTest( test ) {
|
||||
var realLeaves = [],
|
||||
var realLeaves = [],
|
||||
callback = function( node ) {
|
||||
var retval;
|
||||
realLeaves.push( node );
|
||||
|
|
Loading…
Reference in a new issue