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)
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;
// only do this if we have ctrl key..
var br = doc.createElement('br');
br.className = 'clear';
- br.setAttribute('style', 'clear:all');
+ br.setAttribute('style', 'clear: both');
sel.insertNode(br, 'after');
}
store : {
xtype : 'SimpleStore',
data : [
- ['50%'],
+ ['100%'],
['80%'],
- ['100%']
+ ['50%'],
+ ['20%'],
+ ['10%']
],
fields : [ 'val'],
xns : Roo.data
contextMenu : function(toolbar)
{
+ console.log("htmleditor.BlockTd contextMenu");
+ console.log(toolbar);
var cell = function() {
return Roo.htmleditor.Block.factory(toolbar.tb.selectedNode);
*/
toObject : function()
{
-
+ console.log("htmleditor.BlockTd toObject");
var ret = {
tag : 'td',
contenteditable : 'true', // this stops cell selection from picking the table.
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'));
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){
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;
}
mergeRight: function()
{
+ console.log("htmleditor.BlockTd mergeRight");
// get the contents of the next cell along..
var tr = this.node.closest('tr');
},
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;
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;
},
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;