mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
Merge "Update VE core submodule to master (ca771b8bc)"
This commit is contained in:
commit
16437646fe
|
@ -106,7 +106,7 @@
|
|||
"ve.dm.NodeFactory",
|
||||
"ve.dm.Converter",
|
||||
"ve.dm.DataString",
|
||||
"ve.dm.IndexValueStore",
|
||||
"ve.dm.HashValueStore",
|
||||
"ve.dm.Scalable",
|
||||
"ve.dm.APIResultsProvider",
|
||||
"ve.dm.APIResultsQueue",
|
||||
|
|
|
@ -212,7 +212,7 @@
|
|||
<script src="lib/ve/src/dm/ve.dm.DocumentSlice.js"></script>
|
||||
<script src="lib/ve/src/dm/ve.dm.TableSlice.js"></script>
|
||||
<script src="lib/ve/src/dm/ve.dm.LinearData.js"></script>
|
||||
<script src="lib/ve/src/dm/ve.dm.IndexValueStore.js"></script>
|
||||
<script src="lib/ve/src/dm/ve.dm.HashValueStore.js"></script>
|
||||
<script src="lib/ve/src/dm/ve.dm.Converter.js"></script>
|
||||
<script src="lib/ve/src/dm/selections/ve.dm.LinearSelection.js"></script>
|
||||
<script src="lib/ve/src/dm/selections/ve.dm.NullSelection.js"></script>
|
||||
|
|
|
@ -641,7 +641,7 @@
|
|||
"lib/ve/src/dm/ve.dm.DocumentSlice.js",
|
||||
"lib/ve/src/dm/ve.dm.TableSlice.js",
|
||||
"lib/ve/src/dm/ve.dm.LinearData.js",
|
||||
"lib/ve/src/dm/ve.dm.IndexValueStore.js",
|
||||
"lib/ve/src/dm/ve.dm.HashValueStore.js",
|
||||
"lib/ve/src/dm/ve.dm.Converter.js",
|
||||
"lib/ve/src/dm/selections/ve.dm.LinearSelection.js",
|
||||
"lib/ve/src/dm/selections/ve.dm.NullSelection.js",
|
||||
|
|
|
@ -996,7 +996,7 @@ class VisualEditorHooks {
|
|||
'modules/ve-mw/tests/dm/nodes/ve.dm.MWTransclusionNode.test.js',
|
||||
'lib/ve/tests/dm/ve.dm.Document.test.js',
|
||||
'modules/ve-mw/tests/dm/ve.dm.Document.test.js',
|
||||
'lib/ve/tests/dm/ve.dm.IndexValueStore.test.js',
|
||||
'lib/ve/tests/dm/ve.dm.HashValueStore.test.js',
|
||||
'lib/ve/tests/dm/ve.dm.InternalList.test.js',
|
||||
'lib/ve/tests/dm/ve.dm.LinearData.test.js',
|
||||
'lib/ve/tests/dm/ve.dm.Transaction.test.js',
|
||||
|
|
2
lib/ve
2
lib/ve
|
@ -1 +1 @@
|
|||
Subproject commit 30cf85e1264c1fe1bd92b1afa1e85ab006b07580
|
||||
Subproject commit ca771b8bc74ae00cfcb2c9050b164a60f6a1769f
|
|
@ -33,7 +33,7 @@ ve.dm.MWNowikiAnnotation.static.matchRdfaTypes = [ 'mw:Nowiki' ];
|
|||
|
||||
ve.dm.MWNowikiAnnotation.static.toDomElements = function ( dataElement, doc, converter, childDomElements ) {
|
||||
var i, len,
|
||||
originalDomElements = converter.getStore().value( dataElement.originalDomElementsIndex ),
|
||||
originalDomElements = converter.getStore().value( dataElement.originalDomElementsHash ),
|
||||
originalChildren = originalDomElements && originalDomElements[ 0 ] && originalDomElements[ 0 ].childNodes,
|
||||
contentsChanged = false,
|
||||
domElement = document.createElement( 'span' );
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
nodeClass = ve.dm.modelRegistry.lookup( type );
|
||||
store = surfaceFragment.getDocument().getStore();
|
||||
hash = OO.getHash( [ nodeClass.static.getHashObjectForRendering( data[ 0 ] ), undefined ] );
|
||||
store.index( generatedContents, hash );
|
||||
store.hash( generatedContents, hash );
|
||||
}
|
||||
|
||||
if ( range.isCollapsed() ) {
|
||||
|
|
|
@ -100,16 +100,16 @@ ve.dm.MWExtensionNode.static.toDomElements = function ( dataElement, doc, conver
|
|||
// If the transclusion is unchanged just send back the
|
||||
// original DOM elements so selser can skip over it
|
||||
if (
|
||||
dataElement.originalDomElementsIndex &&
|
||||
dataElement.originalDomElementsHash &&
|
||||
originalMw && ve.compare( dataElement.attributes.mw, JSON.parse( originalMw ) )
|
||||
) {
|
||||
// originalDomElements is also used for CE rendering so return a copy
|
||||
els = ve.copyDomElements( converter.getStore().value( dataElement.originalDomElementsIndex ), doc );
|
||||
els = ve.copyDomElements( converter.getStore().value( dataElement.originalDomElementsHash ), doc );
|
||||
} else {
|
||||
if (
|
||||
converter.isForClipboard() &&
|
||||
// Use getHashObjectForRendering to get the rendering from the store
|
||||
( value = store.value( store.indexOfValue( null, OO.getHash( [ this.getHashObjectForRendering( dataElement ), undefined ] ) ) ) )
|
||||
( value = store.value( store.hashOfValue( null, OO.getHash( [ this.getHashObjectForRendering( dataElement ), undefined ] ) ) ) )
|
||||
) {
|
||||
// For the clipboard use the current DOM contents so the user has something
|
||||
// meaningful to paste into external applications
|
||||
|
|
|
@ -136,7 +136,7 @@ ve.dm.MWTransclusionNode.static.toDomElements = function ( dataElement, doc, con
|
|||
var els, i, len, span, value,
|
||||
store = converter.getStore(),
|
||||
originalMw = dataElement.attributes.originalMw,
|
||||
originalDomElements = store.value( dataElement.originalDomElementsIndex );
|
||||
originalDomElements = store.value( dataElement.originalDomElementsHash );
|
||||
|
||||
function wrapTextNode( node ) {
|
||||
var wrapper;
|
||||
|
@ -160,7 +160,7 @@ ve.dm.MWTransclusionNode.static.toDomElements = function ( dataElement, doc, con
|
|||
if (
|
||||
converter.isForClipboard() &&
|
||||
// Use getHashObjectForRendering to get the rendering from the store
|
||||
( value = store.value( store.indexOfValue( null, OO.getHash( [ this.getHashObjectForRendering( dataElement ), undefined ] ) ) ) )
|
||||
( value = store.value( store.hashOfValue( null, OO.getHash( [ this.getHashObjectForRendering( dataElement ), undefined ] ) ) ) )
|
||||
) {
|
||||
// For the clipboard use the current DOM contents so the user has something
|
||||
// meaningful to paste into external applications
|
||||
|
|
|
@ -12,7 +12,7 @@ QUnit.module( 've.dm.Document (MW)', ve.test.utils.mwEnvironment );
|
|||
// FIXME runner copypasted from core, use data provider
|
||||
QUnit.test( 'getRelativeRange (mwBlockImage / mwInlineImage)', function ( assert ) {
|
||||
var documentModel, i, j,
|
||||
store = new ve.dm.IndexValueStore(),
|
||||
store = new ve.dm.HashValueStore(),
|
||||
storeItems = [
|
||||
ve.dm.mwExample.MWBlockImage.storeItems,
|
||||
ve.dm.mwExample.MWInlineImage.storeItems
|
||||
|
@ -230,7 +230,7 @@ QUnit.test( 'getRelativeRange (mwBlockImage / mwInlineImage)', function ( assert
|
|||
|
||||
for ( i = 0; i < storeItems.length; i++ ) {
|
||||
for ( j = 0; j < storeItems[ i ].length; j++ ) {
|
||||
store.index( storeItems[ i ][ j ].value, storeItems[ i ][ j ].hash );
|
||||
store.hash( storeItems[ i ][ j ].value, storeItems[ i ][ j ].hash );
|
||||
}
|
||||
}
|
||||
for ( i = 0; i < tests.length; i++ ) {
|
||||
|
|
|
@ -205,17 +205,17 @@ ve.dm.mwExample.MWTransclusion.mixedDataClose = { type: '/mwTransclusionInline'
|
|||
|
||||
ve.dm.mwExample.MWTransclusion.blockParamsHash = OO.getHash( [ ve.dm.MWTransclusionNode.static.getHashObject( ve.dm.mwExample.MWTransclusion.blockData ), undefined ] );
|
||||
ve.dm.mwExample.MWTransclusion.blockStoreItems = {};
|
||||
ve.dm.mwExample.MWTransclusion.blockStoreItems[ ve.dm.IndexValueStore.prototype.indexOfValue( null, ve.dm.mwExample.MWTransclusion.blockParamsHash ) ] =
|
||||
ve.dm.mwExample.MWTransclusion.blockStoreItems[ ve.dm.HashValueStore.prototype.hashOfValue( null, ve.dm.mwExample.MWTransclusion.blockParamsHash ) ] =
|
||||
$( ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent ).toArray();
|
||||
|
||||
ve.dm.mwExample.MWTransclusion.inlineParamsHash = OO.getHash( [ ve.dm.MWTransclusionNode.static.getHashObject( ve.dm.mwExample.MWTransclusion.inlineData ), undefined ] );
|
||||
ve.dm.mwExample.MWTransclusion.inlineStoreItems = {};
|
||||
ve.dm.mwExample.MWTransclusion.inlineStoreItems[ ve.dm.IndexValueStore.prototype.indexOfValue( null, ve.dm.mwExample.MWTransclusion.inlineParamsHash ) ] =
|
||||
ve.dm.mwExample.MWTransclusion.inlineStoreItems[ ve.dm.HashValueStore.prototype.hashOfValue( null, ve.dm.mwExample.MWTransclusion.inlineParamsHash ) ] =
|
||||
$( ve.dm.mwExample.MWTransclusion.inlineOpen + ve.dm.mwExample.MWTransclusion.inlineContent + ve.dm.mwExample.MWTransclusion.inlineClose ).toArray();
|
||||
|
||||
ve.dm.mwExample.MWTransclusion.mixedParamsHash = OO.getHash( [ ve.dm.MWTransclusionNode.static.getHashObject( ve.dm.mwExample.MWTransclusion.mixedDataOpen ), undefined ] );
|
||||
ve.dm.mwExample.MWTransclusion.mixedStoreItems = {};
|
||||
ve.dm.mwExample.MWTransclusion.mixedStoreItems[ ve.dm.IndexValueStore.prototype.indexOfValue( null, ve.dm.mwExample.MWTransclusion.mixedParamsHash ) ] =
|
||||
ve.dm.mwExample.MWTransclusion.mixedStoreItems[ ve.dm.HashValueStore.prototype.hashOfValue( null, ve.dm.mwExample.MWTransclusion.mixedParamsHash ) ] =
|
||||
$( ve.dm.mwExample.MWTransclusion.mixed ).toArray();
|
||||
|
||||
ve.dm.mwExample.MWInternalLink = {
|
||||
|
@ -1187,24 +1187,24 @@ ve.dm.mwExample.domToDataCases = {
|
|||
generated: 'wrapper',
|
||||
metaItems: [
|
||||
{
|
||||
originalDomElementsIndex: 'h188ab6af88887790',
|
||||
originalDomElementsHash: 'h188ab6af88887790',
|
||||
type: 'mwLanguage',
|
||||
attributes: {
|
||||
href: 'http://de.wikipedia.org/wiki/Foo'
|
||||
},
|
||||
internal: {
|
||||
loadMetaParentIndex: 'hbc66e1df10d058e6',
|
||||
loadMetaParentHash: 'hbc66e1df10d058e6',
|
||||
loadMetaParentOffset: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
originalDomElementsIndex: 'h188ab6ff88887790',
|
||||
originalDomElementsHash: 'h188ab6ff88887790',
|
||||
type: 'mwLanguage',
|
||||
attributes: {
|
||||
href: 'http://fr.wikipedia.org/wiki/Foo'
|
||||
},
|
||||
internal: {
|
||||
loadMetaParentIndex: 'h4e7ce2a82b7ce627',
|
||||
loadMetaParentHash: 'h4e7ce2a82b7ce627',
|
||||
loadMetaParentOffset: 6
|
||||
}
|
||||
}
|
||||
|
@ -1481,7 +1481,7 @@ ve.dm.mwExample.domToDataCases = {
|
|||
'mw:Nowiki unwraps when annotations modified': {
|
||||
data: ve.dm.mwExample.mwNowiki,
|
||||
modify: function ( model ) {
|
||||
model.data.data[ 7 ][ 1 ].push( model.getStore().index( ve.dm.example.createAnnotation( ve.dm.example.bold ) ) );
|
||||
model.data.data[ 7 ][ 1 ].push( model.getStore().hash( ve.dm.example.createAnnotation( ve.dm.example.bold ) ) );
|
||||
},
|
||||
normalizedBody: '<p>Foo[[B<b>a</b>r]]Baz</p>'
|
||||
},
|
||||
|
|
|
@ -60,7 +60,7 @@ ve.test.utils.runWikitextStringHandlerTest = function ( assert, server, string,
|
|||
store = docOrData.getStore();
|
||||
} else {
|
||||
actualData = docOrData;
|
||||
store = new ve.dm.IndexValueStore();
|
||||
store = new ve.dm.HashValueStore();
|
||||
}
|
||||
ve.dm.example.postprocessAnnotations( actualData, store );
|
||||
if ( assertDom ) {
|
||||
|
|
Loading…
Reference in a new issue