Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/62429
Change subject: Code style fixes
......................................................................
Code style fixes
* "function(" -> "function ("
* "{String}" -> "{string}"
* collapse unintentional double spaces
Change-Id: I3ce3f02d1e31d4797b44e04d28457dec363be296
---
M modules/ve/ce/nodes/ve.ce.AlienNode.js
M modules/ve/ce/ve.ce.Surface.js
M modules/ve/ce/ve.ce.js
M modules/ve/dm/nodes/ve.dm.GeneratedContentNode.js
M modules/ve/dm/ve.dm.Converter.js
M modules/ve/dm/ve.dm.DataString.js
M modules/ve/dm/ve.dm.Document.js
M modules/ve/dm/ve.dm.IndexValueStore.js
M modules/ve/dm/ve.dm.MetaList.js
M modules/ve/dm/ve.dm.Surface.js
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
M modules/ve/test/actions/ve.FormatAction.test.js
M modules/ve/test/actions/ve.IndentationAction.test.js
M modules/ve/test/dm/ve.dm.DocumentSynchronizer.test.js
M modules/ve/test/dm/ve.dm.SurfaceFragment.test.js
M modules/ve/test/dm/ve.dm.Transaction.test.js
M modules/ve/test/dm/ve.dm.TransactionProcessor.test.js
M modules/ve/test/dm/ve.dm.example.js
M modules/ve/ui/ve.ui.Inspector.js
M modules/ve/ui/widgets/ve.ui.InputWidget.js
M modules/ve/ui/widgets/ve.ui.MWCategoryInputWidget.js
M modules/ve/ui/widgets/ve.ui.MWCategoryItemWidget.js
M modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
M modules/ve/ve.TriggerRegistry.js
M modules/ve/ve.js
25 files changed, 59 insertions(+), 59 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/29/62429/1
diff --git a/modules/ve/ce/nodes/ve.ce.AlienNode.js
b/modules/ve/ce/nodes/ve.ce.AlienNode.js
index 4be174d..cd59a85 100644
--- a/modules/ve/ce/nodes/ve.ce.AlienNode.js
+++ b/modules/ve/ce/nodes/ve.ce.AlienNode.js
@@ -178,7 +178,7 @@
*
* @method
*/
-ve.ce.AlienNode.prototype.clearPhantoms = function() {
+ve.ce.AlienNode.prototype.clearPhantoms = function () {
var surface = this.root.getSurface();
surface.replacePhantoms( null );
surface.$.unbind( '.phantoms' );
diff --git a/modules/ve/ce/ve.ce.Surface.js b/modules/ve/ce/ve.ce.Surface.js
index 39bc563..1940955 100644
--- a/modules/ve/ce/ve.ce.Surface.js
+++ b/modules/ve/ce/ve.ce.Surface.js
@@ -730,9 +730,9 @@
(
lengthDiff > 0 &&
previous.text.substring( 0, previousStart ) ===
- next.text.substring( 0, previousStart
) &&
+ next.text.substring( 0, previousStart )
&&
previous.text.substring( previousStart ) ===
- next.text.substring( nextStart )
+ next.text.substring( nextStart )
) ||
(
lengthDiff < 0 &&
@@ -928,7 +928,7 @@
offsetDelta,
e.altKey === true || e.ctrlKey === true ? 'word' :
'character' // unit
);
- if ( e.shiftKey === true ) { // expanded range
+ if ( e.shiftKey === true ) { // expanded range
range = new ve.Range( selection.from, offset );
} else { // collapsed range (just a cursor)
range = new ve.Range( offset );
@@ -964,13 +964,13 @@
rangyRange = rangy.createRange();
rangyRange.selectNode( $element[0] );
rangySelection.setSingleRange( rangyRange );
- setTimeout( ve.bind( function() {
+ setTimeout( ve.bind( function () {
if ( !$element.hasClass( 've-ce-slug' ) ) {
$element.remove();
}
this.surfaceObserver.start();
this.surfaceObserver.stop( false );
- if ( e.shiftKey === true ) { // expanded range
+ if ( e.shiftKey === true ) { // expanded range
range = new ve.Range( selection.from,
this.model.getSelection().to );
} else { // collapsed range (just a cursor)
range = new ve.Range(
this.model.getSelection().to );
@@ -1352,7 +1352,7 @@
* @method
* @param {jQuery} $phantoms Phantoms to append
*/
-ve.ce.Surface.prototype.replacePhantoms = function( $phantoms ) {
+ve.ce.Surface.prototype.replacePhantoms = function ( $phantoms ) {
this.$phantoms.empty().append( $phantoms );
};
diff --git a/modules/ve/ce/ve.ce.js b/modules/ve/ce/ve.ce.js
index 1192f35..7273bc1 100644
--- a/modules/ve/ce/ve.ce.js
+++ b/modules/ve/ce/ve.ce.js
@@ -246,7 +246,7 @@
* @returns {number} Linear model offset
* @throws {Error}
*/
-ve.ce.getOffsetOfSlug = function ( $node ) {
+ve.ce.getOffsetOfSlug = function ( $node ) {
var model;
if ( $node.index() === 0 ) {
model = $node.parent().data( 'view' ).getModel();
diff --git a/modules/ve/dm/nodes/ve.dm.GeneratedContentNode.js
b/modules/ve/dm/nodes/ve.dm.GeneratedContentNode.js
index 1058de4..1eb081c 100644
--- a/modules/ve/dm/nodes/ve.dm.GeneratedContentNode.js
+++ b/modules/ve/dm/nodes/ve.dm.GeneratedContentNode.js
@@ -39,7 +39,7 @@
* @param {ve.dm.IndexValueStore} store Index-value store
* @returns {number} Index of stored data
*/
-ve.dm.GeneratedContentNode.static.storeDomElements = function( dataElement,
domElements, store ) {
+ve.dm.GeneratedContentNode.static.storeDomElements = function ( dataElement,
domElements, store ) {
var hash = ve.getHash( this.getHashObject( dataElement ) );
return store.index( domElements, hash );
};
diff --git a/modules/ve/dm/ve.dm.Converter.js b/modules/ve/dm/ve.dm.Converter.js
index 6425eb0..1008f4f 100644
--- a/modules/ve/dm/ve.dm.Converter.js
+++ b/modules/ve/dm/ve.dm.Converter.js
@@ -139,7 +139,7 @@
* @method
* @returns {Object|null} Context object, or null if not converting
*/
-ve.dm.Converter.prototype.getCurrentContext = function () {
+ve.dm.Converter.prototype.getCurrentContext = function () {
return this.contextStack === null ? null :
this.contextStack[this.contextStack.length - 1];
};
diff --git a/modules/ve/dm/ve.dm.DataString.js
b/modules/ve/dm/ve.dm.DataString.js
index 269bd68..946ec42 100644
--- a/modules/ve/dm/ve.dm.DataString.js
+++ b/modules/ve/dm/ve.dm.DataString.js
@@ -25,7 +25,7 @@
* @param {number} position Position in data to read from
* @returns {string|null} Character at position, or null if not text
*/
-ve.dm.DataString.prototype.read = function( position ) {
+ve.dm.DataString.prototype.read = function ( position ) {
var dataAt = this.data[position];
// check data is present at position and is not an element
if ( dataAt !== undefined && dataAt.type === undefined ) {
diff --git a/modules/ve/dm/ve.dm.Document.js b/modules/ve/dm/ve.dm.Document.js
index 1608091..228babb 100644
--- a/modules/ve/dm/ve.dm.Document.js
+++ b/modules/ve/dm/ve.dm.Document.js
@@ -292,7 +292,7 @@
* @param {Array} insert Element data being inserted
* @returns {Object} Metadata replace operation to keep data & metadata in sync
*/
-ve.dm.Document.prototype.getMetadataReplace = function( offset, remove, insert
) {
+ve.dm.Document.prototype.getMetadataReplace = function ( offset, remove,
insert ) {
var removeMetadata, insertMetadata, replace = {};
if ( remove > insert.length ) {
// if we are removing more than we are inserting we need to
collapse the excess metadata
diff --git a/modules/ve/dm/ve.dm.IndexValueStore.js
b/modules/ve/dm/ve.dm.IndexValueStore.js
index 773dfa1..2646a09 100644
--- a/modules/ve/dm/ve.dm.IndexValueStore.js
+++ b/modules/ve/dm/ve.dm.IndexValueStore.js
@@ -26,8 +26,8 @@
* If the hash is not found the value is added to the store.
*
* @method
- * @param {Object|String|Array} value Value to lookup or store
- * @param {String} [hash] Value hash. Uses ve.getHash( value ) if not provided.
+ * @param {Object|string|Array} value Value to lookup or store
+ * @param {string} [hash] Value hash. Uses ve.getHash( value ) if not provided.
* @returns {number} The index of the value in the store
*/
ve.dm.IndexValueStore.prototype.index = function ( value, hash ) {
@@ -55,7 +55,7 @@
* Returns null if the hash is not found.
*
* @method
- * @param {Object|String|Array} hash Value hash.
+ * @param {Object|string|Array} hash Value hash.
* @returns {number|null} The index of the value in the store, or undefined if
it is not found
*/
ve.dm.IndexValueStore.prototype.indexOfHash = function ( hash ) {
diff --git a/modules/ve/dm/ve.dm.MetaList.js b/modules/ve/dm/ve.dm.MetaList.js
index 142f054..a794709 100644
--- a/modules/ve/dm/ve.dm.MetaList.js
+++ b/modules/ve/dm/ve.dm.MetaList.js
@@ -288,7 +288,7 @@
* insertItem().
*
* @param {number} offset Offset in the linear model of the new item
- * @param {number} index Index of the new item in the metadata array at offset
+ * @param {number} index Index of the new item in the metadata array at offset
* @param {ve.dm.MetaItem} item Item object
* @emits insert
*/
diff --git a/modules/ve/dm/ve.dm.Surface.js b/modules/ve/dm/ve.dm.Surface.js
index 73def24..20fabd1 100644
--- a/modules/ve/dm/ve.dm.Surface.js
+++ b/modules/ve/dm/ve.dm.Surface.js
@@ -207,7 +207,7 @@
* @method
* @returns {boolean} Has a future state
*/
-ve.dm.Surface.prototype.hasFutureState = function() {
+ve.dm.Surface.prototype.hasFutureState = function () {
return this.undoIndex > 0;
};
@@ -217,7 +217,7 @@
* @method
* @returns {boolean} Has a past state
*/
-ve.dm.Surface.prototype.hasPastState = function() {
+ve.dm.Surface.prototype.hasPastState = function () {
return this.bigStack.length - this.undoIndex > 0;
};
@@ -258,7 +258,7 @@
* @method
* @emits history
*/
-ve.dm.Surface.prototype.truncateUndoStack = function() {
+ve.dm.Surface.prototype.truncateUndoStack = function () {
this.bigStack = this.bigStack.slice( 0, this.bigStack.length -
this.undoIndex );
this.undoIndex = 0;
this.emit( 'history' );
@@ -371,7 +371,7 @@
}
// Only emit one context change event
- if ( contextChange ) {
+ if ( contextChange ) {
this.emit( 'contextChange' );
}
diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index 9e8c03d..a75ef62 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -755,7 +755,7 @@
action = this.pageExists ? 'edit' : 'create';
pTabsId = $( '#p-views' ).length ? 'p-views' : 'p-cactions';
- // Add independent "VisualEditor" tab (#ca-ve-edit).
+ // Add independent "VisualEditor" tab (#ca-ve-edit).
if ( this.tabLayout === 'add' ) {
caVeEdit = mw.util.addPortletLink(
@@ -1421,7 +1421,7 @@
this.$toolbarWrapper = $( '.ve-ui-toolbar-wrapper' )
.insertBefore( $( '#firstHeading' ) )
.find( '.ve-ui-toolbar' )
- .slideDown( 'fast', ve.bind( function() {
+ .slideDown( 'fast', ve.bind( function () {
this.surface.getContext().update();
}, this ) )
.end();
diff --git a/modules/ve/test/actions/ve.FormatAction.test.js
b/modules/ve/test/actions/ve.FormatAction.test.js
index 7d9f11b..936d458 100644
--- a/modules/ve/test/actions/ve.FormatAction.test.js
+++ b/modules/ve/test/actions/ve.FormatAction.test.js
@@ -41,7 +41,7 @@
'type': 'MWheading',
'attributes': { level: 2 },
'expectedSelection': new ve.Range( 14, 16 ),
- 'expectedData': function( data ) {
+ 'expectedData': function ( data ) {
data.splice( 11, 2, { 'type': '/list'
}, { 'type': 'MWheading', 'attributes': { 'level': 2 } } );
data.splice( 19, 2, { 'type':
'/MWheading' }, { 'type': 'list', 'attributes': { 'style': 'bullet' } } );
},
@@ -52,7 +52,7 @@
'type': 'MWheading',
'attributes': { level: 3 },
'expectedSelection': new ve.Range( 15, 44 ),
- 'expectedData': function( data ) {
+ 'expectedData': function ( data ) {
data.splice( 11, 2, { 'type': '/list'
}, { 'type': 'MWheading', 'attributes': { 'level': 3 } } );
data.splice( 19, 4, { 'type':
'/MWheading' }, { 'type': 'MWheading', 'attributes': { 'level': 3 } } );
data.splice( 27, 4, { 'type':
'/MWheading' }, { 'type': 'MWheading', 'attributes': { 'level': 3 } } );
@@ -66,7 +66,7 @@
'type': 'MWheading',
'attributes': { level: 1 },
'expectedSelection': new ve.Range( 2, 22 ),
- 'expectedData': function( data ) {
+ 'expectedData': function ( data ) {
data.splice( 0, 3, { 'type':
'MWheading', 'attributes': { 'level': 1 } } );
data.splice( 7, 4, { 'type':
'/MWheading' }, { 'type': 'MWheading', 'attributes': { 'level': 1 } } );
data.splice( 15, 4, { 'type':
'/MWheading' }, { 'type': 'MWheading', 'attributes': { 'level': 1 } } );
@@ -79,7 +79,7 @@
'type': 'MWpreformatted',
'attributes': undefined,
'expectedSelection': new ve.Range( 3, 20 ),
- 'expectedData': function( data ) {
+ 'expectedData': function ( data ) {
data.splice( 0, 3, { 'type':
'MWpreformatted' } );
data.splice( 7, 4, { 'type':
'/MWpreformatted' }, { 'type': 'MWpreformatted' } );
data.splice( 15, 4, { 'type':
'/MWpreformatted' }, { 'type': 'MWpreformatted' } );
@@ -92,7 +92,7 @@
'type': 'paragraph',
'attributes': undefined,
'expectedSelection': new ve.Range( 146, 159 ),
- 'expectedData': function( data ) {
+ 'expectedData': function ( data ) {
data.splice( 145, 1, { 'type':
'paragraph' } );
data.splice( 159, 1, { 'type':
'/paragraph' } );
},
@@ -103,7 +103,7 @@
'type': 'paragraph',
'attributes': undefined,
'expectedSelection': new ve.Range( 165, 180 ),
- 'expectedData': function( data ) {
+ 'expectedData': function ( data ) {
data.splice( 162, 1, { 'type':
'paragraph' } );
data.splice( 183, 1, { 'type':
'/paragraph' } );
},
diff --git a/modules/ve/test/actions/ve.IndentationAction.test.js
b/modules/ve/test/actions/ve.IndentationAction.test.js
index 279da9f..055b310 100644
--- a/modules/ve/test/actions/ve.IndentationAction.test.js
+++ b/modules/ve/test/actions/ve.IndentationAction.test.js
@@ -43,11 +43,11 @@
'range': new ve.Range( 14, 16 ),
'method': 'decrease',
'expectedSelection': new ve.Range( 14, 16 ),
- 'expectedData': function( data ) {
+ 'expectedData': function ( data ) {
data.splice( 11, 2, { 'type': '/list'
}, { 'type': 'paragraph' } );
data.splice( 19, 2, { 'type':
'/paragraph' }, { 'type': 'list', 'attributes': { 'style': 'bullet' } } );
},
- 'expectedOriginalData': function( data ) {
+ 'expectedOriginalData': function ( data ) {
// generated: 'wrapper' is removed by
the action and not restored by undo
delete data[12].internal;
},
diff --git a/modules/ve/test/dm/ve.dm.DocumentSynchronizer.test.js
b/modules/ve/test/dm/ve.dm.DocumentSynchronizer.test.js
index c17f34b..303d65a 100644
--- a/modules/ve/test/dm/ve.dm.DocumentSynchronizer.test.js
+++ b/modules/ve/test/dm/ve.dm.DocumentSynchronizer.test.js
@@ -47,11 +47,11 @@
firstTextNodeLengthChanges.push( diff );
} );
doc.getDocumentNode().getChildren()[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0]
- .on( 'update', function () {
+ .on( 'update', function () {
secondTextNodeUpdates++;
} );
doc.getDocumentNode().getChildren()[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0]
- .on( 'annotation', function () {
+ .on( 'annotation', function () {
secondTextNodeAnnotations++;
} );
doc.getDocumentNode().getChildren()[1].getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0].getChildren()[0]
diff --git a/modules/ve/test/dm/ve.dm.SurfaceFragment.test.js
b/modules/ve/test/dm/ve.dm.SurfaceFragment.test.js
index d9354ef..c9cbdde 100644
--- a/modules/ve/test/dm/ve.dm.SurfaceFragment.test.js
+++ b/modules/ve/test/dm/ve.dm.SurfaceFragment.test.js
@@ -417,7 +417,7 @@
fragment = new ve.dm.SurfaceFragment( surface, new ve.Range( 5, 37 ) );
- assert.throws( function() {
+ assert.throws( function () {
fragment.unwrapNodes( 0, 20 );
}, /cannot unwrap by greater depth/, 'error thrown trying to unwrap
more nodes that it is possible to contain' );
@@ -504,19 +504,19 @@
}
QUnit.test( 'isolateAndUnwrap', 4, function ( assert ) {
- runIsolateTest( assert, 'MWheading', new ve.Range( 12, 20 ), function(
data ) {
+ runIsolateTest( assert, 'MWheading', new ve.Range( 12, 20 ), function (
data ) {
data.splice( 11, 0, { 'type': '/list' } );
data.splice( 12, 1 );
data.splice( 20, 1, { 'type': 'list', 'attributes': { 'style':
'bullet' } });
}, 'isolating paragraph in list item "Item 2" for MWheading');
- runIsolateTest( assert, 'heading', new ve.Range( 12, 20 ), function(
data ) {
+ runIsolateTest( assert, 'heading', new ve.Range( 12, 20 ), function (
data ) {
data.splice( 11, 0, { 'type': 'listItem' } );
data.splice( 12, 1 );
data.splice( 20, 1, { 'type': '/listItem' });
}, 'isolating paragraph in list item "Item 2" for heading');
- runIsolateTest( assert, 'MWheading', new ve.Range( 89, 97 ), function(
data ) {
+ runIsolateTest( assert, 'MWheading', new ve.Range( 89, 97 ), function (
data ) {
data.splice( 88, 1,
{ 'type': '/tableRow' },
{ 'type': '/tableSection' },
@@ -529,7 +529,7 @@
);
}, 'isolating "Cell 2" for MWheading');
- runIsolateTest( assert, 'MWheading', new ve.Range( 202, 212 ),
function( data ) {
+ runIsolateTest( assert, 'MWheading', new ve.Range( 202, 212 ), function
( data ) {
data.splice( 201, 1,
{ 'type': '/list' }, { 'type': '/listItem' }, { 'type':
'/list' }
);
diff --git a/modules/ve/test/dm/ve.dm.Transaction.test.js
b/modules/ve/test/dm/ve.dm.Transaction.test.js
index 0da11ef..97b2e36 100644
--- a/modules/ve/test/dm/ve.dm.Transaction.test.js
+++ b/modules/ve/test/dm/ve.dm.Transaction.test.js
@@ -1448,7 +1448,7 @@
runBuilderTests( assert, cases );
} );
-QUnit.test( 'newFromMetadataInsertion', function( assert ) {
+QUnit.test( 'newFromMetadataInsertion', function ( assert ) {
var doc = ve.dm.example.createExampleDocument( 'withMeta' ),
element = {
'type': 'alienMeta',
@@ -1489,7 +1489,7 @@
runConstructorTests( assert,
ve.dm.Transaction.newFromMetadataInsertion, cases );
} );
-QUnit.test( 'newFromMetadataRemoval', function( assert ) {
+QUnit.test( 'newFromMetadataRemoval', function ( assert ) {
var doc = ve.dm.example.createExampleDocument( 'withMeta' ),
allElements = ve.dm.example.withMetaMetaData[11],
someElements = allElements.slice( 1, 3 ),
@@ -1533,7 +1533,7 @@
runConstructorTests( assert, ve.dm.Transaction.newFromMetadataRemoval,
cases );
} );
-QUnit.test( 'newFromMetadataElementReplacement', function( assert ) {
+QUnit.test( 'newFromMetadataElementReplacement', function ( assert ) {
var doc = ve.dm.example.createExampleDocument( 'withMeta' ),
newElement = {
'type': 'alienMeta',
diff --git a/modules/ve/test/dm/ve.dm.TransactionProcessor.test.js
b/modules/ve/test/dm/ve.dm.TransactionProcessor.test.js
index 689eed2..38be249 100644
--- a/modules/ve/test/dm/ve.dm.TransactionProcessor.test.js
+++ b/modules/ve/test/dm/ve.dm.TransactionProcessor.test.js
@@ -254,7 +254,7 @@
['pushRetainMetadata', 2 ],
['pushRetain', 1 ],
],
- 'expected': function( data ) {
+ 'expected': function ( data ) {
data.splice( 25, 0, metaElementInsert,
metaElementInsertClose );
}
},
@@ -265,7 +265,7 @@
['pushReplaceMetadata', [], [
metaElementInsert ] ],
['pushRetain', 9 ],
],
- 'expected': function( data ) {
+ 'expected': function ( data ) {
data.splice( 7, 0, metaElementInsert,
metaElementInsertClose );
}
},
@@ -276,7 +276,7 @@
['pushReplaceMetadata',
ve.dm.example.withMetaMetaData[11], [] ],
['pushRetain', 1 ],
],
- 'expected': function( data ) {
+ 'expected': function ( data ) {
data.splice( 21, 8 );
}
},
@@ -289,7 +289,7 @@
['pushRetainMetadata', 1 ],
['pushRetain', 1 ],
],
- 'expected': function( data ) {
+ 'expected': function ( data ) {
data.splice( 23, 4 );
}
},
@@ -301,7 +301,7 @@
['pushReplaceMetadata', [
ve.dm.example.withMetaMetaData[11][3] ], [ metaElementInsert ] ],
['pushRetain', 1 ],
],
- 'expected': function( data ) {
+ 'expected': function ( data ) {
data.splice( 27, 2, metaElementInsert,
metaElementInsertClose );
}
},
@@ -312,7 +312,7 @@
['pushReplace', 7, 2, []],
['pushRetain', 2 ],
],
- 'expected': function( data ) {
+ 'expected': function ( data ) {
data.splice( 15, 2 );
}
}
diff --git a/modules/ve/test/dm/ve.dm.example.js
b/modules/ve/test/dm/ve.dm.example.js
index 259dc66..ba14c3d 100644
--- a/modules/ve/test/dm/ve.dm.example.js
+++ b/modules/ve/test/dm/ve.dm.example.js
@@ -96,7 +96,7 @@
* @returns {ve.dm.Document} Document
* @throws {Error} Example data not found
*/
-ve.dm.example.createExampleDocument = function( name, store ) {
+ve.dm.example.createExampleDocument = function ( name, store ) {
name = name || 'data';
store = store || new ve.dm.IndexValueStore();
if ( ve.dm.example[name] === undefined ) {
@@ -991,7 +991,7 @@
'storeItems': [
ve.dm.example.MWTemplate.blockStoreItems
],
- 'modify': function( data ) {
+ 'modify': function ( data ) {
data[0].attributes.mw.params['1'].wt = 'Hello, globe!';
},
'normalizedHtml': ve.dm.example.MWTemplate.blockSpanModified
@@ -1020,7 +1020,7 @@
'storeItems': [
ve.dm.example.MWTemplate.inlineStoreItems
],
- 'modify': function( data ) {
+ 'modify': function ( data ) {
data[1].attributes.mw.params['1'].wt = '5,678';
},
'normalizedHtml': ve.dm.example.MWTemplate.inlineOpenModified +
ve.dm.example.MWTemplate.inlineClose
diff --git a/modules/ve/ui/ve.ui.Inspector.js b/modules/ve/ui/ve.ui.Inspector.js
index 6cf84b5..18c1e68 100644
--- a/modules/ve/ui/ve.ui.Inspector.js
+++ b/modules/ve/ui/ve.ui.Inspector.js
@@ -83,7 +83,7 @@
*
* @method
*/
-ve.ui.Inspector.prototype.onRemoveButtonClick = function() {
+ve.ui.Inspector.prototype.onRemoveButtonClick = function () {
this.close( 'remove' );
};
diff --git a/modules/ve/ui/widgets/ve.ui.InputWidget.js
b/modules/ve/ui/widgets/ve.ui.InputWidget.js
index 725b05b..35aabf2 100644
--- a/modules/ve/ui/widgets/ve.ui.InputWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.InputWidget.js
@@ -95,7 +95,7 @@
* @method
* @param {boolean} isRTL
*/
-ve.ui.InputWidget.prototype.setRTL = function( isRTL ) {
+ve.ui.InputWidget.prototype.setRTL = function ( isRTL ) {
if ( isRTL ) {
this.$input.removeClass( 've-ui-ltr' );
this.$input.addClass( 've-ui-rtl' );
diff --git a/modules/ve/ui/widgets/ve.ui.MWCategoryInputWidget.js
b/modules/ve/ui/widgets/ve.ui.MWCategoryInputWidget.js
index aa0e372..bcf2c0a 100644
--- a/modules/ve/ui/widgets/ve.ui.MWCategoryInputWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.MWCategoryInputWidget.js
@@ -82,7 +82,7 @@
ve.ui.MWCategoryInputWidget.prototype.getLookupCacheItemFromData = function (
data ) {
return ve.isArray( data ) && data.length ?
data[1].map( ve.bind( function ( item ) {
- return item.replace( new RegExp( this.categoryPrefix,
'gi' ), '' );
+ return item.replace( new RegExp( this.categoryPrefix,
'gi' ), '' );
}, this ) ) :
[];
};
diff --git a/modules/ve/ui/widgets/ve.ui.MWCategoryItemWidget.js
b/modules/ve/ui/widgets/ve.ui.MWCategoryItemWidget.js
index 7ba514f..c8f4d21 100644
--- a/modules/ve/ui/widgets/ve.ui.MWCategoryItemWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.MWCategoryItemWidget.js
@@ -35,7 +35,7 @@
// Events
this.$categoryItem.on( {
- 'click': ve.bind( this.onClick, this ),
+ 'click': ve.bind( this.onClick, this ),
'mounsedown': ve.bind( this.onMouseDown, this )
} );
diff --git a/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
b/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
index 251ce83..5ed254b 100644
--- a/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
+++ b/modules/ve/ui/widgets/ve.ui.MWCategoryWidget.js
@@ -94,7 +94,7 @@
*/
ve.ui.MWCategoryWidget.prototype.onLookupMenuItemSelect = function ( item ) {
if ( item && item.getData() !== '' ) {
- this.emit( 'newCategory',
this.categoryInput.getCategoryItemFromValue( item.getData() ) );
+ this.emit( 'newCategory',
this.categoryInput.getCategoryItemFromValue( item.getData() ) );
this.categoryInput.setValue( '' );
}
};
@@ -102,7 +102,7 @@
/**
* Calls metaItem remove method
*
- * @param {String} name category name
+ * @param {string} name category name
*/
ve.ui.MWCategoryWidget.prototype.onRemoveCategory = function ( name ) {
this.categories[name].metaItem.remove();
@@ -111,8 +111,8 @@
/**
* Update sortkey value, emit upsteSortkey event
*
- * @param {String} name
- * @param {String} value
+ * @param {string} name
+ * @param {string} value
*/
ve.ui.MWCategoryWidget.prototype.onUpdateSortkey = function ( name, value ) {
this.categories[name].sortKey = value;
diff --git a/modules/ve/ve.TriggerRegistry.js b/modules/ve/ve.TriggerRegistry.js
index 385e037..c96e90e 100644
--- a/modules/ve/ve.TriggerRegistry.js
+++ b/modules/ve/ve.TriggerRegistry.js
@@ -42,7 +42,7 @@
if ( typeof name !== 'string' && !ve.isArray( name ) ) {
throw new Error( 'name must be a string or array, cannot be a '
+ typeof name );
}
- if ( !( trigger instanceof ve.Trigger ) && !ve.isPlainObject( trigger
) ) {
+ if ( !( trigger instanceof ve.Trigger ) && !ve.isPlainObject( trigger )
) {
throw new Error(
'trigger must be an instance of ve.Trigger or an object
containing instances of ' +
've.Trigger, cannot be a ' + typeof trigger
diff --git a/modules/ve/ve.js b/modules/ve/ve.js
index 2883510..9a30c7c 100644
--- a/modules/ve/ve.js
+++ b/modules/ve/ve.js
@@ -1063,7 +1063,7 @@
// `<pre>Foo</pre>` or `<pre>\nFoo</pre>` , but that's a
syntactic difference, not a
// semantic one, and handling that is Parsoid's job.
$element = $( element ).clone();
- $element.find( 'pre, textarea, listing' ).each( function() {
+ $element.find( 'pre, textarea, listing' ).each( function () {
var matches;
if ( this.firstChild && this.firstChild.nodeType ===
Node.TEXT_NODE ) {
matches = this.firstChild.data.match(
/^(\r\n|\r|\n)/ );
--
To view, visit https://gerrit.wikimedia.org/r/62429
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ce3f02d1e31d4797b44e04d28457dec363be296
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits