mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-23 18:28:51 +00:00
Renamed expandContentData to getExpandedContentData
This commit is contained in:
parent
7e825a15fb
commit
91f0cd2d6b
|
@ -75,7 +75,7 @@ es.DocumentModelNode.prototype.getPlainObject = function() {
|
|||
obj.children.push( this.children[i].getPlainObject() );
|
||||
}
|
||||
} else if ( this.getContentLength() ) {
|
||||
obj.content = es.DocumentModel.expandContentData( this.getContent() );
|
||||
obj.content = es.DocumentModel.getExpandedContentData( this.getContent() );
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
|
|
@ -488,7 +488,7 @@ es.DocumentModel.flattenPlainObjectElementNode = function( obj ) {
|
|||
* @method
|
||||
* @returns {Object} Plain object representation
|
||||
*/
|
||||
es.DocumentModel.expandContentData = function( data ) {
|
||||
es.DocumentModel.getExpandedContentData = function( data ) {
|
||||
var stack = [];
|
||||
// Text and annotations
|
||||
function start( offset, annotation ) {
|
||||
|
|
|
@ -38,6 +38,21 @@ es.HtmlSerializer.getHtmlAttributes = function( attributes ) {
|
|||
return count ? htmlAttributes : null;
|
||||
};
|
||||
|
||||
es.HtmlSerializer.getExpandedListItems = function( node ) {
|
||||
var styles,
|
||||
levels = [];
|
||||
for ( var i = 0; i < this.children.length; i++ ) {
|
||||
styles = this.children[i].model.getElementAttribute( 'styles' );
|
||||
levels = levels.slice( 0, styles.length );
|
||||
if ( styles[styles.length - 1] === 'number' ) {
|
||||
if ( !levels[styles.length - 1] ) {
|
||||
levels[styles.length - 1] = 0;
|
||||
}
|
||||
this.children[i].setNumber( ++levels[styles.length - 1] );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* Methods */
|
||||
|
||||
es.HtmlSerializer.prototype.document = function( node, rawFirstParagraph ) {
|
||||
|
|
Loading…
Reference in a new issue