X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-debug.js;h=db783cf0d6d5c8254ce2c0b9f48a8b9572e9e551;hp=b3be73aa08baf099559af3b0b7c1f7d1c1ff774a;hb=89b03a0009ad29be68bd417551948042c2b146b3;hpb=3a2d263256e7a309ae5c514a0123a153ac934780 diff --git a/roojs-debug.js b/roojs-debug.js index b3be73aa08..db783cf0d6 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -46262,12 +46262,26 @@ 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); + //Roo.log(doc.innerHTML); var listpara = doc.getElementsByClassName('MsoListParagraphCxSpFirst'); for( var i = 0; i < listpara.length; i ++) { listpara.item(i).className = "MsoListParagraph"; } + + listpara = doc.getElementsByClassName('MsoListParagraphCxSpMiddle'); + for( var i = 0; i < listpara.length; i ++) { + listpara.item(i).className = "MsoListParagraph"; + } + listpara = doc.getElementsByClassName('MsoListParagraphCxSpLast'); + for( var i = 0; i < listpara.length; i ++) { + listpara.item(i).className = "MsoListParagraph"; + } + listpara = doc.getElementsByClassName('ql-indent-1'); + 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 ++) { @@ -46283,11 +46297,12 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, listpara.item(0).className = "MsoNormalx"; } } - listpara = doc.getElementsByClassName('ql-indent-1'); - while(listpara.length) { - this.replaceDocBullet(listpara.item(0)); - } + listpara = doc.getElementsByClassName('MsoListParagraph'); + + + //Roo.log(doc.innerHTML); + while(listpara.length) { this.replaceDocBullet(listpara.item(0)); @@ -46305,7 +46320,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, doc = parent.ownerDocument, items = []; - + var listtype = 'ul'; while (ns) { if (ns.nodeType != 1) { ns = ns.nextSibling; @@ -46314,10 +46329,18 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, if (!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)) { break; } + var spans = ns.getElementsByTagName('span'); if (ns.hasAttribute('style') && ns.getAttribute('style').match(/mso-list/)) { items.push(ns); ns = ns.nextSibling; has_list = true; + if (spans.length && spans[0].hasAttribute('style')) { + var style = this.styleToObject(spans[0]); + if (typeof(style['font-family']) != 'undefined' && !style['font-family'].match(/Symbol/)) { + listtype = 'ol'; + } + } + continue; } var spans = ns.getElementsByTagName('span'); @@ -46344,7 +46367,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, return; } - var ul = parent.ownerDocument.createElement('ul'); // what about number lists... + var ul = parent.ownerDocument.createElement(listtype); // what about number lists... parent.insertBefore(ul, p); var lvl = 0; var stack = [ ul ]; @@ -46367,7 +46390,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, } - + var num = 1; var style = {}; for(var i = 0; i < spans.length; i++) { @@ -46375,7 +46398,9 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, if (typeof(style['mso-list']) == 'undefined') { continue; } - + if (listtype == 'ol') { + num = spans[i].innerText.replace(/[^0-9]+]/g,'') * 1; + } spans[i].parentNode.removeChild(spans[i]); // remove the fake bullet. break; } @@ -46398,7 +46423,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, if (nlvl > lvl) { //new indent - var nul = doc.createElement('ul'); // what about number lists... + var nul = doc.createElement(listtype); // what about number lists... if (!last_li) { last_li = doc.createElement('li'); stack[lvl].appendChild(last_li); @@ -46409,6 +46434,11 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, } lvl = nlvl; + // not starting at 1.. + if (!stack[nlvl].hasAttribute("start") && num > 1) { + stack[nlvl].setAttribute("start", num); + } + var nli = stack[nlvl].appendChild(doc.createElement('li')); last_li = nli; nli.innerHTML = n.innerHTML; @@ -50420,7 +50450,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { new Roo.htmleditor.FilterStyleToTag({ node : d }); new Roo.htmleditor.FilterAttributes({ node : d, - attrib_white : ['href', 'src', 'name', 'align', 'colspan', 'rowspan', 'data-display', 'data-width'], + attrib_white : ['href', 'src', 'name', 'align', 'colspan', 'rowspan', 'data-display', 'data-width', 'start'], attrib_clean : ['href', 'src' ] }); new Roo.htmleditor.FilterBlack({ node : d, tag : this.black});