return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
},
- // internal
- callback : function(cb, scope, args, delay){
- if(typeof cb == "function"){
- if(delay){
- cb.defer(delay, scope, args || []);
- }else{
- cb.apply(scope, args || []);
- }
+ // internal (non-delayed, will get a return value..)
+ callback : function(cb, scope, args, delay)
+ {
+ if(typeof cb != "function"){
+ return false;
+ }
+ if(delay){
+ cb.defer(delay, scope, args || []);
+ return false
}
+ return cb.apply(scope, args || []);
+
},
/**
parent = p.parentNode,
doc = parent.ownerDocument,
items = [];
-
+
+ //Roo.log("Parsing: " + p.innerText) ;
var listtype = 'ul';
while (ns) {
if (ns.nodeType != 1) {
continue;
}
if (!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)) {
+ //Roo.log("Missing para r q1indent - got:" + ns.className);
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';
- }
+ if (!spans.length) {
+ continue;
+ }
+ var ff = spans[0].style.fontFamily;
+ if (!spans[0].hasAttribute('style') && spans.length > 1 && spans[1].hasAttribute('style')) {
+
+ ff = spans[1].style.fontFamily;
+ }
+ //var style = this.styleToObject(spans[0]);
+ //Roo.log("got font family: " + ff);
+ if (typeof(ff) != 'undefined' && !ff.match(/Symbol/)) {
+ listtype = 'ol';
}
continue;
}
+ //Roo.log("no mso-list?");
+
var spans = ns.getElementsByTagName('span');
if (!spans.length) {
break;
owner : false,
/**
- * @cfg {String} resizable 's' or 'se' or 'e' - wrapps the element in a
- * Roo.resizable.
+ * @cfg {String} css styling for resizing. (used on bootstrap only)
*/
- resizable : false,
+ resize : false,
/**
* @cfg {Number} height (in pixels)
*/
this.frameId = Roo.id();
-
-
- var iframe = this.owner.wrap.createChild({
+ var ifcfg = {
tag: 'iframe',
cls: 'form-control', // bootstrap..
id: this.frameId,
name: this.frameId,
frameBorder : 'no',
'src' : Roo.SSL_SECURE_URL ? Roo.SSL_SECURE_URL : "javascript:false"
- }, this.el
- );
+ };
+ if (this.resize) {
+ ifcfg.style = { resize : this.resize };
+ }
+
+ var iframe = this.owner.wrap.createChild(ifcfg, this.el);
this.iframe = iframe.dom;
e.preventDefault();
+ this.owner.fireEvent('paste', this);
return false;
// default behaveiour should be our local cleanup paste? (optional?)
// for simple editor - we want to hammer the paste and get rid of everything... - so over-rideable..
}
var ret = false;
try {
- ret = Roo.decode(response.responseText);
+ var rt = response.responseText;
+ if (rt.match(/^\<!--\[CDATA\[/)) {
+ rt = rt.replace(/^\<!--\[CDATA\[/,'');
+ rt = rt.replace(/\]\]--\>$/,'');
+ }
+
+ ret = Roo.decode(rt);
} catch (e) {
ret = {
success: false,