X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-bootstrap-debug.js;h=d4d6c1c3cbe1ad3285af5f7ca5320341e6a65381;hb=refs%2Fheads%2Fwip_alan_T6141_super_script_and_subscribe;hp=48a4704c89dd8038905967ab1a5abde65ce627f1;hpb=825a74c132eae7b97e43866ab3c00ff122fb239c;p=roojs1 diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 48a4704c89..d4d6c1c3cb 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -7,7 +7,7 @@ Roo.bootstrap.version = ( function() { var ret=3; Roo.each(document.styleSheets, function(s) { - if (s.href.match(/css-bootstrap4/)) { + if ( s.href && s.href.match(/css-bootstrap4/)) { ret=4; } }); @@ -2651,6 +2651,8 @@ Roo.extend(Roo.bootstrap.MenuSeparator, Roo.bootstrap.Component, { * @cfg {Boolean} animate default true * @cfg {Boolean} allow_close default true * @cfg {Boolean} fitwindow default false + * @cfg {Number} width fixed width - usefull for chrome extension only really. + * @cfg {Number} height fixed height - usefull for chrome extension only really. * @cfg {String} size (sm|lg) default empty * @cfg {Number} max_width set the max width of modal * @@ -2801,8 +2803,9 @@ Roo.extend(Roo.bootstrap.Modal, Roo.bootstrap.Component, { getAutoCreate : function() { + // we will default to modal-body-overflow - might need to remove or make optional later. var bdy = { - cls : 'modal-body', + cls : 'modal-body enable-modal-body-overflow ', html : this.html || '' }; @@ -20896,6 +20899,11 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, { inline: false, tooltip : '', + // checkbox success does not make any sense really.. + invalidClass : "", + validClass : "", + + getAutoCreate : function() { var align = (!this.labelAlign) ? this.parentLabelAlign() : this.labelAlign; @@ -20996,6 +21004,22 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, { } } + var boxLabelCfg = false; + + if(this.boxLabel){ + + boxLabelCfg = { + tag: 'label', + //'for': id, // box label is handled by onclick - so no for... + cls: 'box-label', + html: this.boxLabel + }; + if(this.tooltip){ + boxLabelCfg.tooltip = this.tooltip; + } + + } + if (align ==='left' && this.fieldLabel.length) { // Roo.log("left and has label"); @@ -21014,6 +21038,10 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, { } ]; + if (boxLabelCfg) { + cfg.cn[1].cn.push(boxLabelCfg); + } + if(this.labelWidth > 12){ cfg.cn[0].style = "width: " + this.labelWidth + 'px'; } @@ -21057,29 +21085,22 @@ Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, { inputblock ]; + if (boxLabelCfg) { + cfg.cn.push(boxLabelCfg); + } } else { // Roo.log(" no label && no align"); cfg.cn = [ inputblock ] ; - + if (boxLabelCfg) { + cfg.cn.push(boxLabelCfg); + } + } - if(this.boxLabel){ - var boxLabelCfg = { - tag: 'label', - //'for': id, // box label is handled by onclick - so no for... - cls: 'box-label', - html: this.boxLabel - }; - - if(this.tooltip){ - boxLabelCfg.tooltip = this.tooltip; - } - - cfg.cn.push(boxLabelCfg); - } + if(this.inputType != 'radio'){ cfg.cn.push(hidden); @@ -22318,17 +22339,32 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { html = this.cleanHtml(html); // fix up the special chars.. normaly like back quotes in word... // however we do not want to do this with chinese.. - html = html.replace(/([\x80-\uffff])/g, function (a, b) { - var cc = b.charCodeAt(); - if ( + html = html.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0080-\uFFFF]/g, function(match) { + + var cc = match.charCodeAt(); + + // Get the character value, handling surrogate pairs + if (match.length == 2) { + // It's a surrogate pair, calculate the Unicode code point + var high = match.charCodeAt(0) - 0xD800; + var low = match.charCodeAt(1) - 0xDC00; + cc = (high * 0x400) + low + 0x10000; + } else if ( (cc >= 0x4E00 && cc < 0xA000 ) || (cc >= 0x3400 && cc < 0x4E00 ) || (cc >= 0xf900 && cc < 0xfb00 ) ) { - return b; - } - return "&#"+cc+";" + return match; + } + + // No, use a numeric entity. Here we brazenly (and possibly mistakenly) + return "&#" + cc + ";"; + + }); + + + if(this.owner.fireEvent('beforesync', this, html) !== false){ this.el.dom.value = html; this.owner.fireEvent('sync', this, html); @@ -22512,7 +22548,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { insertTag : function(tg) { // could be a bit smarter... -> wrap the current selected tRoo.. - if (tg.toLowerCase() == 'span' || tg.toLowerCase() == 'code') { + if (tg.toLowerCase() == 'span' || + tg.toLowerCase() == 'code' || + tg.toLowerCase() == 'sup' || + tg.toLowerCase() == 'sub' + ) { range = this.createRange(this.getSelection()); var wrappingNode = this.doc.createElement(tg.toLowerCase()); @@ -23008,6 +23048,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { var remove_keep_children= Roo.HtmlEditorCore.remove.indexOf(node.tagName.toLowerCase()) > -1; + // spans with no attributes - just remove them.. + if ((!node.attributes || !node.attributes.length) && lcname == 'span') { + remove_keep_children = true; + } + // remove as rendering on yahoo mailer is borked with this. // this will have to be flaged elsewhere - perhaps ablack=name... on the mailer.. @@ -23028,6 +23073,10 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { } if (!node.attributes || !node.attributes.length) { + + + + this.cleanUpChildren(node); return; } @@ -23124,11 +23173,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (a.name == 'class') { if (a.value.match(/^Mso/)) { - node.className = ''; + node.removeAttribute('class'); } if (a.value.match(/^body$/)) { - node.className = ''; + node.removeAttribute('class'); } continue; } @@ -23158,11 +23207,17 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { node.nodeName == 'SPAN' && !node.hasAttributes() && node.childNodes.length == 1 && - node.firstChild.nodeName == "#text" + node.firstChild.nodeName == "#text" ) { - var text = ' ' + node.innerHTML + ' '; - var textNode = document.createTextNode(text); + var textNode = node.firstChild; + node.removeChild(textNode); + if (node.getAttribute('lang') != 'zh-CN') { // do not space pad on chinese characters.. + node.parentNode.insertBefore(node.ownerDocument.createTextNode(" "), node); + } node.parentNode.insertBefore(textNode, node); + if (node.getAttribute('lang') != 'zh-CN') { // do not space pad on chinese characters.. + node.parentNode.insertBefore(node.ownerDocument.createTextNode(" ") , node); + } node.parentNode.removeChild(node); } @@ -23180,16 +23235,20 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { node.parentNode.removeChild(node); return; } - + //Roo.log(node.tagName); // remove - but keep children.. - if (node.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|font)/)) { + if (node.tagName.toLowerCase().match(/^(meta|link|\\?xml:|st1:|o:|v:|font)/)) { + //Roo.log('-- removed'); while (node.childNodes.length) { var cn = node.childNodes[0]; node.removeChild(cn); node.parentNode.insertBefore(cn, node); + // move node to parent - and clean it.. + this.cleanWord(cn); } node.parentNode.removeChild(node); - this.iterateChildren(node, this.cleanWord); + /// no need to iterate chidlren = it's got none.. + //this.iterateChildren(node, this.cleanWord); return; } // clean styles