X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-ui-debug.js;h=32057dd1d3b4c82df591a9b4d8fde903abbee9f9;hb=6aeeaffae07719f56919487d31937794d442eff4;hp=8aa7439b1bace0c03e6ad38cdd801a73464d4198;hpb=700d6c83a34e097e8438094422f5a1da03db160b;p=roojs1 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 8aa7439b1b..32057dd1d3 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -21719,16 +21719,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) @@ -21798,6 +21811,10 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, if (nlvl > lvl) { //new indent 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; @@ -23319,7 +23336,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); @@ -23683,9 +23710,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 @@ -24473,6 +24502,8 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { contextMenu : function(toolbar) { + console.log("htmleditor.BlockTd contextMenu"); + console.log(toolbar); var cell = function() { return Roo.htmleditor.Block.factory(toolbar.tb.selectedNode); @@ -24755,7 +24786,7 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { */ toObject : function() { - + console.log("htmleditor.BlockTd toObject"); var ret = { tag : 'td', contenteditable : 'true', // this stops cell selection from picking the table. @@ -24791,6 +24822,8 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { readElement : function(node) { + console.log("htmleditor.BlockTd readElement"); + console.log(node); node = node ? node : this.node ; this.width = node.style.width; this.colspan = Math.max(1,1*node.getAttribute('colspan')); @@ -24823,6 +24856,7 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { toTableArray : function() { + console.log("htmleditor.BlockTd toTableArray"); var ret = []; var tab = this.node.closest('tr').closest('table'); Array.from(tab.rows).forEach(function(r, ri){ @@ -24855,6 +24889,8 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { if (typeof(this.colWidths[cn]) == 'undefined') { this.colWidths[cn] = ce.style.width; + console.log("colWidths " + cn); + console.log(ce.style.width); if (this.colWidths[cn] != '') { all_auto = false; } @@ -24897,6 +24933,7 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { mergeRight: function() { + console.log("htmleditor.BlockTd mergeRight"); // get the contents of the next cell along.. var tr = this.node.closest('tr'); @@ -25032,6 +25069,11 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { }, normalizeWidths : function(table) { + console.log("htmleditor.BlockTd normalizeWidths"); + console.log("colWidths 0"); + console.log(this.colWidths[0]); + console.log("colWidths 1"); + console.log(this.colWidths[1]); if (this.colWidths[0] === false) { var nw = 100.0 / this.colWidths.length; @@ -25078,7 +25120,9 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { shrinkColumn : function() { + console.log("htmleditor.BlockTd shrinkColumn"); var table = this.toTableArray(); + console.log(table); this.normalizeWidths(table); var col = this.cellData.col; var nw = this.colWidths[col] * 0.8; @@ -25098,7 +25142,9 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, { }, growColumn : function() { + console.log("htmleditor.BlockTd growColumn"); var table = this.toTableArray(); + console.log(table); this.normalizeWidths(table); var col = this.cellData.col; var nw = this.colWidths[col] * 1.2;