X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=ea98f39293ebc9d9850e83975b91a05af6fe48ec;hp=98a354fcf515ce2a0ec9d19687b2e7baf0277c22;hb=8f5eb4c4c8c1b9d0a7198e29efe26ac2d9e0bff8;hpb=792f4512f3c3ea5ad56ef9f532acf298e49f5411 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 98a354fcf5..ea98f39293 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -26038,6 +26038,8 @@ Roo.htmleditor.Filter.prototype = { return; case this.tag === true: // everything + case e.tagName.indexOf(":") > -1 && typeof(this.tag) == 'object' && this.tag.indexOf(":") > -1: + case e.tagName.indexOf(":") > -1 && typeof(this.tag) == 'string' && this.tag == ":": case typeof(this.tag) == 'object' && this.tag.indexOf(e.tagName) > -1: // array and it matches. case typeof(this.tag) == 'string' && this.tag == e.tagName: // array and it matches. if (this.replaceTag && false === this.replaceTag(e)) { @@ -26465,6 +26467,7 @@ Roo.htmleditor.FilterWord = function(cfg) // no need to apply config. this.replaceDocBullets(cfg.node); + // this is disabled as the removal is done by other filters; // this.walk(cfg.node); @@ -26585,7 +26588,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, var kv = s.split(":"); // what ever is left... we allow. - ret[kv[0]] = kv[1]; + ret[kv[0].trim()] = kv[1]; }); return ret; }, @@ -26594,16 +26597,29 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, replaceDocBullets : function(doc) { // this is a bit odd - but it appears some indents use ql-indent-1 + //Roo.log(doc.innerHTML); - var listpara = doc.getElementsByClassName('ql-indent-1'); + var listpara = doc.getElementsByClassName('MsoListParagraphCxSpFirst'); + for( var i = 0; i < listpara.length; i ++) { + listpara.item(i).className = "MsoListParagraph"; + } + // this is a bit hacky - we had one word document where h2 had a miso-list attribute. + var htwo = doc.getElementsByTagName('h2'); + for( var i = 0; i < htwo.length; i ++) { + if (htwo.item(i).getAttribute('style').match(/mso-list:/)) { + htwo.item(i).className = "MsoListParagraph"; + } + } + + listpara = doc.getElementsByClassName('ql-indent-1'); while(listpara.length) { this.replaceDocBullet(listpara.item(0)); } - - var listpara = doc.getElementsByClassName('MsoListParagraph'); + listpara = doc.getElementsByClassName('MsoListParagraph'); while(listpara.length) { this.replaceDocBullet(listpara.item(0)); } + }, replaceDocBullet : function(p) @@ -26612,7 +26628,9 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, var ns = p, parent = p.parentNode, doc = parent.ownerDocument, - items = []; + items = []; + + while (ns) { if (ns.nodeType != 1) { ns = ns.nextSibling; @@ -26623,16 +26641,16 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, } items.push(ns); ns = ns.nextSibling; - } + + var ul = parent.ownerDocument.createElement('ul'); // what about number lists... parent.insertBefore(ul, p); var lvl = 0; var stack = [ ul ]; var last_li = false; - var base_lvl = 0; - items.forEach(function(n) { + items.forEach(function(n, ipos) { //Roo.log("got innertHMLT=" + n.innerHTML); var spans = n.getElementsByTagName('span'); @@ -26664,20 +26682,19 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, return; } - var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1; + var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1 ; if (nlvl > lvl) { //new indent - if (last_li) { - var nul = doc.createElement('ul'); // what about number lists... - last_li.appendChild(nul); - stack[nlvl] = nul; - } else { - // occurs when we get a level (1) but no parent - just put all the children on the top most.. - stack[nlvl] = stack[stack.length-1]; + var nul = doc.createElement('ul'); // what about number lists... + if (!last_li) { + last_li = doc.createElement('li'); + stack[lvl].appendChild(last_li); } + last_li.appendChild(nul); + stack[nlvl] = nul; } lvl = nlvl; @@ -26930,7 +26947,17 @@ Roo.htmleditor.KeyEnter.prototype = { var pc = range.closest([ 'ol', 'ul']); var pli = range.closest('li'); if (!pc || e.ctrlKey) { - sel.insertNode('br', 'after'); + // on it list, or ctrl pressed. + if (!e.ctrlKey) { + sel.insertNode('br', 'after'); + } else { + // only do this if we have ctrl key.. + var br = doc.createElement('br'); + br.className = 'clear'; + br.setAttribute('style', 'clear: both'); + sel.insertNode(br, 'after'); + } + this.core.undoManager.addEvent(); this.core.fireEditorEvent(e); @@ -27294,9 +27321,11 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { store : { xtype : 'SimpleStore', data : [ - ['50%'], + ['100%'], ['80%'], - ['100%'] + ['50%'], + ['20%'], + ['10%'] ], fields : [ 'val'], xns : Roo.data @@ -29405,7 +29434,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { }); new Roo.htmleditor.FilterBlack({ node : d, tag : this.black}); // should be fonts.. - new Roo.htmleditor.FilterKeepChildren({node : d, tag : [ 'FONT', 'O:P' ]} ); + new Roo.htmleditor.FilterKeepChildren({node : d, tag : [ 'FONT', ':' ]} ); new Roo.htmleditor.FilterParagraph({ node : d }); new Roo.htmleditor.FilterSpan({ node : d }); new Roo.htmleditor.FilterLongBr({ node : d }); @@ -30095,6 +30124,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { cleanWord : function(node) { new Roo.htmleditor.FilterWord({ node : node ? node : this.doc.body }); + new Roo.htmleditor.FilterKeepChildren({node : node ? node : this.doc.body, tag : [ 'FONT', ':' ]} ); },