+ return manipulate(this, params, 'after');
+ },
+ children: function() {
+ var toret = [];
+ if(this instanceof DocumentTextElement)
+ return toret;
+
+
+ var elementContent = this.dom().contents();
+ var element = this;
+ elementContent.each(function(idx) {
+ var childElement = DocumentElement.fromHTMLElement(this, element.canvas);
+ if(idx === 0 && elementContent.length > 1 && elementContent[1].nodeType === Node.ELEMENT_NODE && (childElement instanceof DocumentTextElement) && $.trim($(this).text()) === '')
+ return true;
+ if(idx > 0 && childElement instanceof DocumentTextElement) {
+ if(toret[toret.length-1] instanceof DocumentNodeElement && $.trim($(this).text()) === '')
+ return true;
+ }
+ toret.push(childElement);
+ });
+ return toret;
+ },
+ childIndex: function(child) {
+ var children = this.children(),
+ toret = null;
+ children.forEach(function(c, idx) {
+ if(c.sameNode(child)) {
+ toret = idx;
+ return false;
+ }
+ });
+ return toret;
+ },
+ getWlxmlTag: function() {
+ return this.dom().attr('wlxml-tag');
+ },
+ setWlxmlTag: function(tag) {
+ this.dom().attr('wlxml-tag', tag);
+ },
+ getWlxmlClass: function() {
+ var klass = this.dom().attr('wlxml-class');
+ if(klass)
+ return klass.replace(/-/g, '.');
+ return undefined;
+ },
+ setWlxmlClass: function(klass) {
+ this.getWlxmlMetaAttrs().forEach(function(attr) {
+ if(!classAttributes.hasMetaAttr(klass, attr.name))
+ this.dom().removeAttr('wlxml-meta-' + attr.name);
+ }, this);
+
+ if(klass)
+ this.dom().attr('wlxml-class', klass.replace(/\./g, '-'));
+ else
+ this.dom().removeAttr('wlxml-class');
+ },
+ is: function(what) {
+ if(what === 'list' && _.contains(['list-items', 'list-items-enum'], this.dom().attr('wlxml-class')))
+ return true;
+ return false;
+ },
+
+
+ getWlxmlMetaAttr: function(attr) {
+ return this.dom().attr('wlxml-meta-'+attr);
+ },
+ getWlxmlMetaAttrs: function() {
+ var toret = [];
+ var attrList = classAttributes.getMetaAttrsList(this.getWlxmlClass());
+ attrList.all.forEach(function(attr) {
+ toret.push({name: attr.name, value: this.getWlxmlMetaAttr(attr.name) || ''});
+ }, this);
+ return toret;
+ },
+ setWlxmlMetaAttr: function(attr, value) {
+ this.dom().attr('wlxml-meta-'+attr, value);