From: leon Date: Fri, 29 Apr 2022 05:13:37 +0000 (+0800) Subject: Merge branch 'master' into wip_leon_T7199_adding_images_to_bolierplates X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=47c96bffe20aebba2f6d3d95a6428931e0b3a2da;hp=fc82bff3902f6b9018e9efb96c6ea168fb4f5d7a Merge branch 'master' into wip_leon_T7199_adding_images_to_bolierplates --- diff --git a/Roo/data/MemoryProxy.js b/Roo/data/MemoryProxy.js index ac626fb9d4..6e9f84265d 100644 --- a/Roo/data/MemoryProxy.js +++ b/Roo/data/MemoryProxy.js @@ -10,14 +10,16 @@ */ /** * @class Roo.data.MemoryProxy + * @extends Roo.data.DataProxy * An implementation of Roo.data.DataProxy that simply passes the data specified in its constructor * to the Reader when its load method is called. * @constructor - * @param {Object} data The data object which the Reader uses to construct a block of Roo.data.Records. + * @param {Object} config A config object containing the objects needed for the Store to access data, */ -Roo.data.MemoryProxy = function(data){ - if (data.data) { - data = data.data; +Roo.data.MemoryProxy = function(config){ + var data = config; + if (typeof(config) != 'undefined' && typeof(config.data) != 'undefined') { + data = config.data; } Roo.data.MemoryProxy.superclass.constructor.call(this); this.data = data; @@ -25,6 +27,9 @@ Roo.data.MemoryProxy = function(data){ Roo.extend(Roo.data.MemoryProxy, Roo.data.DataProxy, { + /** + * @cfg {Object} data The data object which the Reader uses to construct a block of Roo.data.Records. + */ /** * Load data from the requested source (in this case an in-memory * data object passed to the constructor), read the data object into diff --git a/Roo/form/Column.js b/Roo/form/Column.js new file mode 100644 index 0000000000..3b9971fb21 --- /dev/null +++ b/Roo/form/Column.js @@ -0,0 +1,34 @@ + +/** + * @class Roo.form.Column + * @extends Roo.form.Layout + * @children Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet + * Creates a column container for layout and rendering of fields in an {@link Roo.form.Form}. + * @constructor + * @param {Object} config Configuration options + */ +Roo.form.Column = function(config){ + Roo.form.Column.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.form.Column, Roo.form.Layout, { + /** + * @cfg {Number/String} width + * The fixed width of the column in pixels or CSS value (defaults to "auto") + */ + /** + * @cfg {String/Object} autoCreate + * A DomHelper element spec used to autocreate the column (defaults to {tag: 'div', cls: 'x-form-ct x-form-column'}) + */ + + // private + defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-column'}, + + // private + onRender : function(ct, position){ + Roo.form.Column.superclass.onRender.call(this, ct, position); + if(this.width){ + this.el.setWidth(this.width); + } + } +}); diff --git a/Roo/form/FieldSet.js b/Roo/form/FieldSet.js new file mode 100644 index 0000000000..56a7f965ab --- /dev/null +++ b/Roo/form/FieldSet.js @@ -0,0 +1,41 @@ + +/** + * @class Roo.form.FieldSet + * @extends Roo.form.Layout + * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem + * Creates a fieldset container for layout and rendering of fields in an {@link Roo.form.Form}. + * @constructor + * @param {Object} config Configuration options + */ +Roo.form.FieldSet = function(config){ + Roo.form.FieldSet.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.form.FieldSet, Roo.form.Layout, { + /** + * @cfg {String} legend + * The text to display as the legend for the FieldSet (defaults to '') + */ + /** + * @cfg {String/Object} autoCreate + * A DomHelper element spec used to autocreate the fieldset (defaults to {tag: 'fieldset', cn: {tag:'legend'}}) + */ + + // private + defaultAutoCreate : {tag: 'fieldset', cn: {tag:'legend'}}, + + // private + onRender : function(ct, position){ + Roo.form.FieldSet.superclass.onRender.call(this, ct, position); + if(this.legend){ + this.setLegend(this.legend); + } + }, + + // private + setLegend : function(text){ + if(this.rendered){ + this.el.child('legend').update(text); + } + } +}); \ No newline at end of file diff --git a/Roo/form/Layout.js b/Roo/form/Layout.js index bea152474f..e9dbb44dfe 100644 --- a/Roo/form/Layout.js +++ b/Roo/form/Layout.js @@ -40,7 +40,7 @@ Roo.extend(Roo.form.Layout, Roo.Component, { * a function which returns such a specification. */ /** - * @cfg {String} labelAlign + * @cfg {String} labelAlign (left|top|right) * Valid values are "left," "top" and "right" (defaults to "left") */ /** @@ -160,155 +160,3 @@ Roo.extend(Roo.form.Layout, Roo.Component, { } }); -/** - * @class Roo.form.Column - * @extends Roo.form.Layout - * @children Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet - * Creates a column container for layout and rendering of fields in an {@link Roo.form.Form}. - * @constructor - * @param {Object} config Configuration options - */ -Roo.form.Column = function(config){ - Roo.form.Column.superclass.constructor.call(this, config); -}; - -Roo.extend(Roo.form.Column, Roo.form.Layout, { - /** - * @cfg {Number/String} width - * The fixed width of the column in pixels or CSS value (defaults to "auto") - */ - /** - * @cfg {String/Object} autoCreate - * A DomHelper element spec used to autocreate the column (defaults to {tag: 'div', cls: 'x-form-ct x-form-column'}) - */ - - // private - defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-column'}, - - // private - onRender : function(ct, position){ - Roo.form.Column.superclass.onRender.call(this, ct, position); - if(this.width){ - this.el.setWidth(this.width); - } - } -}); - - -/** - * @class Roo.form.Row - * @extends Roo.form.Layout - * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet - * Creates a row container for layout and rendering of fields in an {@link Roo.form.Form}. - * @constructor - * @param {Object} config Configuration options - */ - - -Roo.form.Row = function(config){ - Roo.form.Row.superclass.constructor.call(this, config); -}; - -Roo.extend(Roo.form.Row, Roo.form.Layout, { - /** - * @cfg {Number/String} width - * The fixed width of the column in pixels or CSS value (defaults to "auto") - */ - /** - * @cfg {Number/String} height - * The fixed height of the column in pixels or CSS value (defaults to "auto") - */ - defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-row'}, - - padWidth : 20, - // private - onRender : function(ct, position){ - //console.log('row render'); - if(!this.rowTpl){ - var t = new Roo.Template( - '
', - '', - '
', - '
', - '
' - ); - t.disableFormats = true; - t.compile(); - Roo.form.Layout.prototype.rowTpl = t; - } - this.fieldTpl = this.rowTpl; - - //console.log('lw' + this.labelWidth +', la:' + this.labelAlign); - var labelWidth = 100; - - if ((this.labelAlign != 'top')) { - if (typeof this.labelWidth == 'number') { - labelWidth = this.labelWidth - } - this.padWidth = 20 + labelWidth; - - } - - Roo.form.Column.superclass.onRender.call(this, ct, position); - if(this.width){ - this.el.setWidth(this.width); - } - if(this.height){ - this.el.setHeight(this.height); - } - }, - - // private - renderField : function(f){ - f.fieldEl = this.fieldTpl.append(this.el, [ - f.id, f.fieldLabel, - f.labelStyle||this.labelStyle||'', - this.elementStyle||'', - typeof f.labelSeparator == 'undefined' ? this.labelSeparator : f.labelSeparator, - f.itemCls||this.itemCls||'', - f.width ? f.width + this.padWidth : 160 + this.padWidth - ],true); - } -}); - - -/** - * @class Roo.form.FieldSet - * @extends Roo.form.Layout - * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem - * Creates a fieldset container for layout and rendering of fields in an {@link Roo.form.Form}. - * @constructor - * @param {Object} config Configuration options - */ -Roo.form.FieldSet = function(config){ - Roo.form.FieldSet.superclass.constructor.call(this, config); -}; - -Roo.extend(Roo.form.FieldSet, Roo.form.Layout, { - /** - * @cfg {String} legend - * The text to display as the legend for the FieldSet (defaults to '') - */ - /** - * @cfg {String/Object} autoCreate - * A DomHelper element spec used to autocreate the fieldset (defaults to {tag: 'fieldset', cn: {tag:'legend'}}) - */ - - // private - defaultAutoCreate : {tag: 'fieldset', cn: {tag:'legend'}}, - - // private - onRender : function(ct, position){ - Roo.form.FieldSet.superclass.onRender.call(this, ct, position); - if(this.legend){ - this.setLegend(this.legend); - } - }, - - // private - setLegend : function(text){ - if(this.rendered){ - this.el.child('legend').update(text); - } - } -}); \ No newline at end of file diff --git a/Roo/form/Row.js b/Roo/form/Row.js new file mode 100644 index 0000000000..2b3247b5df --- /dev/null +++ b/Roo/form/Row.js @@ -0,0 +1,77 @@ + +/** + * @class Roo.form.Row + * @extends Roo.form.Layout + * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet + * Creates a row container for layout and rendering of fields in an {@link Roo.form.Form}. + * @constructor + * @param {Object} config Configuration options + */ + + +Roo.form.Row = function(config){ + Roo.form.Row.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.form.Row, Roo.form.Layout, { + /** + * @cfg {Number/String} width + * The fixed width of the column in pixels or CSS value (defaults to "auto") + */ + /** + * @cfg {Number/String} height + * The fixed height of the column in pixels or CSS value (defaults to "auto") + */ + defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-row'}, + + padWidth : 20, + // private + onRender : function(ct, position){ + //console.log('row render'); + if(!this.rowTpl){ + var t = new Roo.Template( + '
', + '', + '
', + '
', + '
' + ); + t.disableFormats = true; + t.compile(); + Roo.form.Layout.prototype.rowTpl = t; + } + this.fieldTpl = this.rowTpl; + + //console.log('lw' + this.labelWidth +', la:' + this.labelAlign); + var labelWidth = 100; + + if ((this.labelAlign != 'top')) { + if (typeof this.labelWidth == 'number') { + labelWidth = this.labelWidth + } + this.padWidth = 20 + labelWidth; + + } + + Roo.form.Column.superclass.onRender.call(this, ct, position); + if(this.width){ + this.el.setWidth(this.width); + } + if(this.height){ + this.el.setHeight(this.height); + } + }, + + // private + renderField : function(f){ + f.fieldEl = this.fieldTpl.append(this.el, [ + f.id, f.fieldLabel, + f.labelStyle||this.labelStyle||'', + this.elementStyle||'', + typeof f.labelSeparator == 'undefined' ? this.labelSeparator : f.labelSeparator, + f.itemCls||this.itemCls||'', + f.width ? f.width + this.padWidth : 160 + this.padWidth + ],true); + } +}); + diff --git a/Roo/htmleditor/FilterWord.js b/Roo/htmleditor/FilterWord.js index 20849ad8f6..6773e5e63b 100644 --- a/Roo/htmleditor/FilterWord.js +++ b/Roo/htmleditor/FilterWord.js @@ -14,7 +14,7 @@ Roo.htmleditor.FilterWord = function(cfg) // no need to apply config. this.replaceDocBullets(cfg.node); - this.walk(cfg.node); + // this.walk(cfg.node); } @@ -125,7 +125,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, styleToObject: function(node) { - var styles = node.getAttribute("style").split(";"); + var styles = (node.getAttribute("style") || '').split(";"); var ret = {}; Roo.each(styles, function(s) { if (!s.match(/:/)) { @@ -134,7 +134,7 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, var kv = s.split(":"); // what ever is left... we allow. - ret[kv[0]] = kv[1]; + ret[kv[0].trim()] = kv[1]; }); return ret; }, @@ -142,10 +142,16 @@ 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 + + var listpara = doc.getElementsByClassName('ql-indent-1'); + while(listpara.length) { + this.replaceDocBullet(listpara.item(0)); + } + var listpara = doc.getElementsByClassName('MsoListParagraph'); while(listpara.length) { this.replaceDocBullet(listpara.item(0)); - //code } }, @@ -155,53 +161,85 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, var ns = p, parent = p.parentNode, doc = parent.ownerDocument, - items = []; + items = []; + + while (ns) { if (ns.nodeType != 1) { ns = ns.nextSibling; continue; } - if (!ns.className.match(/MsoListParagraph/i)) { + if (!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)) { break; } items.push(ns); ns = ns.nextSibling; - } + + var ul = parent.ownerDocument.createElement('ul'); // what about number lists... parent.insertBefore(ul, p); var lvl = 0; var stack = [ ul ]; var last_li = false; - items.forEach(function(n) { - parent.removeChild(n); + + items.forEach(function(n, ipos) { + //Roo.log("got innertHMLT=" + n.innerHTML); + var spans = n.getElementsByTagName('span'); - if (!spans.length || !n.isEqualNode(spans.item(0).parentNode)) { + if (!spans.length) { + //Roo.log("No spans found"); + + parent.removeChild(n); return; // skip it... } + + - var style = this.styleToObject(n); + var style = {}; + for(var i = 0; i < spans.length; i++) { + + style = this.styleToObject(spans[i]); + if (typeof(style['mso-list']) == 'undefined') { + continue; + } + + spans[i].parentNode.removeChild(spans[i]); // remove the fake bullet. + break; + } + //Roo.log("NOW GOT innertHMLT=" + n.innerHTML); + style = this.styleToObject(n); // mo-list is from the parent node. if (typeof(style['mso-list']) == 'undefined') { - return; // skip it. + //Roo.log("parent is missing level"); + parent.removeChild(n); + return; } - n.removeChild(spans.item(0)); // remove the fake bullet. - var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1; + + var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1 ; + + + if (nlvl > lvl) { //new indent var nul = doc.createElement('ul'); // what about number lists... last_li.appendChild(nul); stack[nlvl] = nul; + } lvl = nlvl; var nli = stack[nlvl].appendChild(doc.createElement('li')); last_li = nli; + nli.innerHTML = n.innerHTML; + //Roo.log("innerHTML = " + n.innerHTML); + parent.removeChild(n); + // copy children of p into nli - while(n.firstChild) { + /*while(n.firstChild) { var fc = n.firstChild; n.removeChild(fc); nli.appendChild(fc); - } + }*/ },this); diff --git a/Roo/htmleditor/TidyWriter.js b/Roo/htmleditor/TidyWriter.js index 9db08abc72..34a6b34c08 100644 --- a/Roo/htmleditor/TidyWriter.js +++ b/Roo/htmleditor/TidyWriter.js @@ -186,12 +186,14 @@ Roo.htmleditor.TidyWriter.prototype = { * @param {String} text String to write out. * @param {Boolean} raw Optional raw state if true the contents wont get encoded. */ - text: function(text, node) + text: function(in_text, node) { // if not in whitespace critical - if (text.length < 1) { + if (in_text.length < 1) { return; } + var text = new XMLSerializer().serializeToString(document.createTextNode(in_text)); // escape it properly? + if (this.in_pre) { this.html[this.html.length] = text; return; diff --git a/Roo/rtf/Parser.js b/Roo/rtf/Parser.js index 6a3d7082f3..1a4590a997 100644 --- a/Roo/rtf/Parser.js +++ b/Roo/rtf/Parser.js @@ -173,7 +173,7 @@ Roo.rtf.Parser.prototype = { this.hexStore.push(cmd); }, cmderror : function(cmd) { - throw new Exception (cmd.value); + throw cmd.value; }, /* @@ -303,7 +303,8 @@ Roo.rtf.Parser.prototype = { { this.emitText(); if (this.controlWord === '') { - this.emitError('empty control word'); + // do we want to track this - it seems just to cause problems. + //this.emitError('empty control word'); } else { this.push({ type: 'controlword', diff --git a/buildSDK/dependancy_ui.txt b/buildSDK/dependancy_ui.txt index 1a1846f884..5a8e5a9ac5 100644 --- a/buildSDK/dependancy_ui.txt +++ b/buildSDK/dependancy_ui.txt @@ -135,6 +135,9 @@ Roo.form.BasicForm Roo.form.Form Roo.form.Action Roo.form.Layout +Roo.form.Column +Roo.form.Row +Roo.form.FieldSet Roo.form.VTypes Roo.form.FCKeditor Roo.form.GridField diff --git a/docs/json/roodata.json b/docs/json/roodata.json index 49146ce23e..883e834671 100644 --- a/docs/json/roodata.json +++ b/docs/json/roodata.json @@ -189321,7 +189321,8 @@ "isAbstract" : true, "isBuilderTop" : false, "implementations" : [ - "Roo.data.HttpProxy" + "Roo.data.HttpProxy", + "Roo.data.MemoryProxy" ], "tree_children" : [], "tree_parent" : [] @@ -191708,9 +191709,301 @@ "tree_parent" : [] }, "Roo.data.MemoryProxy" : { - "props" : [], - "events" : [], + "props" : [ + { + "name" : "data", + "type" : "Object", + "desc" : "The data object which the Reader uses to construct a block of Roo.data.Records.", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "listeners", + "type" : "Object", + "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", + "memberOf" : "Roo.util.Observable", + "isOptional" : false, + "optvals" : [] + } + ], + "events" : [ + { + "name" : "beforeload", + "type" : "function", + "desc" : "Fires before a network request is made to retrieve a data object.", + "sig" : "function (This, params)\n{\n\n}", + "memberOf" : "Roo.data.DataProxy", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "This", + "type" : "Object", + "desc" : "DataProxy object.", + "isOptional" : false + }, + { + "name" : "params", + "type" : "Object", + "desc" : "The params parameter to the load function.", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "load", + "type" : "function", + "desc" : "Fires before the load method's callback is called.", + "sig" : "function (This, o, arg)\n{\n\n}", + "memberOf" : "Roo.data.DataProxy", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "This", + "type" : "Object", + "desc" : "DataProxy object.", + "isOptional" : false + }, + { + "name" : "o", + "type" : "Object", + "desc" : "The data object.", + "isOptional" : false + }, + { + "name" : "arg", + "type" : "Object", + "desc" : "The callback argument object passed to the load function.", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "loadexception", + "type" : "function", + "desc" : "Fires if an Exception occurs during data retrieval.", + "sig" : "function (This, o, arg, e)\n{\n\n}", + "memberOf" : "Roo.data.DataProxy", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "This", + "type" : "Object", + "desc" : "DataProxy object.", + "isOptional" : false + }, + { + "name" : "o", + "type" : "Object", + "desc" : "The data object.", + "isOptional" : false + }, + { + "name" : "arg", + "type" : "Object", + "desc" : "The callback argument object passed to the load function.", + "isOptional" : false + }, + { + "name" : "e", + "type" : "Object", + "desc" : "The Exception.", + "isOptional" : false + } + ], + "returns" : [] + } + ], "methods" : [ + { + "name" : "addEvents", + "type" : "function", + "desc" : "Used to define events on this Observable", + "sig" : "(object)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "object", + "type" : "Object", + "desc" : "The object with the events defined", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addListener", + "type" : "function", + "desc" : "Appends an event handler to this component", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:
\n

\nCombining Options
\nUsing the options argument, it is possible to combine different types of listeners:
\n
\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t

\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t
\n

\nAttaching multiple handlers in 1 call
\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n

\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t
\n

\nOr a shorthand syntax which passes the same scope object to all handlers:\n \t

\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t
", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "capture", + "type" : "function", + "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\nbefore the event is fired. If the supplied function returns false,\nthe event will not fire.", + "sig" : "(o, fn, scope)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to capture", + "isOptional" : false + }, + { + "name" : "fn", + "type" : "Function", + "desc" : "The function to call", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the fn", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "fireEvent", + "type" : "function", + "desc" : "Fires the specified event with the passed parameters (minus the event name).", + "sig" : "(eventName, args)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "", + "isOptional" : false + }, + { + "name" : "args", + "type" : "Object...", + "desc" : "Variable number of parameters are passed to handlers", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "returns false if any of the handlers return false otherwise it returns true" + } + ] + }, + { + "name" : "hasListener", + "type" : "function", + "desc" : "Checks to see if this object has any listeners for a specified event", + "sig" : "(eventName)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The name of the event to check for", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "True if the event is being listened for, else false" + } + ] + }, { "name" : "load", "type" : "function", @@ -191760,6 +192053,171 @@ } ], "returns" : [] + }, + { + "name" : "on", + "type" : "function", + "desc" : "Appends an event handler to this element (shorthand for addListener)", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional)", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "purgeListeners", + "type" : "function", + "desc" : "Removes all listeners for this object", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "releaseCapture", + "type" : "function", + "desc" : "Removes all added captures from the Observable.", + "sig" : "(o)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to release", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "removeListener", + "type" : "function", + "desc" : "Removes a listener", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "un", + "type" : "function", + "desc" : "Removes a listener (shorthand for removeListener)", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] } ], "isAbstract" : false, @@ -216590,10 +217048,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "Roo.form.Layout", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "labelSeparator", @@ -240588,10 +241050,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "Roo.form.Layout", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "labelSeparator", @@ -249968,10 +250434,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "labelSeparator", @@ -257674,10 +258144,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "Roo.form.Layout", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "labelSeparator", @@ -316755,6 +317229,7 @@ "Roo.data.DataProxy", "Roo.data.HttpProxy", "Roo.data.JsonStore", + "Roo.data.MemoryProxy", "Roo.data.Node", "Roo.data.SimpleStore", "Roo.data.Store", diff --git a/docs/src/Roo_data_MemoryProxy.js.html b/docs/src/Roo_data_MemoryProxy.js.html index c3da147a83..436738aecd 100644 --- a/docs/src/Roo_data_MemoryProxy.js.html +++ b/docs/src/Roo_data_MemoryProxy.js.html @@ -10,14 +10,16 @@ */ /** * @class Roo.data.MemoryProxy + * @extends Roo.data.DataProxy * An implementation of Roo.data.DataProxy that simply passes the data specified in its constructor * to the Reader when its load method is called. * @constructor - * @param {Object} data The data object which the Reader uses to construct a block of Roo.data.Records. + * @param {Object} config A config object containing the objects needed for the Store to access data, */ -Roo.data.MemoryProxy = function(data){ - if (data.data) { - data = data.data; +Roo.data.MemoryProxy = function(config){ + var data = config; + if (typeof(config) != 'undefined' && typeof(config.data) != 'undefined') { + data = config.data; } Roo.data.MemoryProxy.superclass.constructor.call(this); this.data = data; @@ -26,6 +28,9 @@ Roo.extend(Roo.data.MemoryProxy, Roo.data.DataProxy, { /** + * @cfg {Object} data The data object which the Reader uses to construct a block of Roo.data.Records. + */ + /** * Load data from the requested source (in this case an in-memory * data object passed to the constructor), read the data object into * a block of Roo.data.Records using the passed Roo.data.DataReader implementation, and diff --git a/docs/src/Roo_form_Column.js.html b/docs/src/Roo_form_Column.js.html new file mode 100644 index 0000000000..8f16da1e7e --- /dev/null +++ b/docs/src/Roo_form_Column.js.html @@ -0,0 +1,35 @@ +Roo/form/Column.js +/** + * @class Roo.form.Column + * @extends Roo.form.Layout + * @children Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet + * Creates a column container for layout and rendering of fields in an {@link Roo.form.Form}. + * @constructor + * @param {Object} config Configuration options + */ +Roo.form.Column = function(config){ + Roo.form.Column.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.form.Column, Roo.form.Layout, { + /** + * @cfg {Number/String} width + * The fixed width of the column in pixels or CSS value (defaults to "auto") + */ + /** + * @cfg {String/Object} autoCreate + * A DomHelper element spec used to autocreate the column (defaults to {tag: 'div', cls: 'x-form-ct x-form-column'}) + */ + + // private + defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-column'}, + + // private + onRender : function(ct, position){ + Roo.form.Column.superclass.onRender.call(this, ct, position); + if(this.width){ + this.el.setWidth(this.width); + } + } +}); + \ No newline at end of file diff --git a/docs/src/Roo_form_FieldSet.js.html b/docs/src/Roo_form_FieldSet.js.html new file mode 100644 index 0000000000..63cd7042d2 --- /dev/null +++ b/docs/src/Roo_form_FieldSet.js.html @@ -0,0 +1,41 @@ +Roo/form/FieldSet.js +/** + * @class Roo.form.FieldSet + * @extends Roo.form.Layout + * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem + * Creates a fieldset container for layout and rendering of fields in an {@link Roo.form.Form}. + * @constructor + * @param {Object} config Configuration options + */ +Roo.form.FieldSet = function(config){ + Roo.form.FieldSet.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.form.FieldSet, Roo.form.Layout, { + /** + * @cfg {String} legend + * The text to display as the legend for the FieldSet (defaults to '') + */ + /** + * @cfg {String/Object} autoCreate + * A DomHelper element spec used to autocreate the fieldset (defaults to {tag: 'fieldset', cn: {tag:'legend'}}) + */ + + // private + defaultAutoCreate : {tag: 'fieldset', cn: {tag:'legend'}}, + + // private + onRender : function(ct, position){ + Roo.form.FieldSet.superclass.onRender.call(this, ct, position); + if(this.legend){ + this.setLegend(this.legend); + } + }, + + // private + setLegend : function(text){ + if(this.rendered){ + this.el.child('legend').update(text); + } + } +}); \ No newline at end of file diff --git a/docs/src/Roo_form_Layout.js.html b/docs/src/Roo_form_Layout.js.html index 1dec91c98c..db1054f04c 100644 --- a/docs/src/Roo_form_Layout.js.html +++ b/docs/src/Roo_form_Layout.js.html @@ -40,7 +40,7 @@ * a function which returns such a specification. */ /** - * @cfg {String} labelAlign + * @cfg {String} labelAlign (left|top|right) * Valid values are "left," "top" and "right" (defaults to "left") */ /** @@ -160,155 +160,4 @@ } }); -/** - * @class Roo.form.Column - * @extends Roo.form.Layout - * @children Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet - * Creates a column container for layout and rendering of fields in an {@link Roo.form.Form}. - * @constructor - * @param {Object} config Configuration options - */ -Roo.form.Column = function(config){ - Roo.form.Column.superclass.constructor.call(this, config); -}; - -Roo.extend(Roo.form.Column, Roo.form.Layout, { - /** - * @cfg {Number/String} width - * The fixed width of the column in pixels or CSS value (defaults to "auto") - */ - /** - * @cfg {String/Object} autoCreate - * A DomHelper element spec used to autocreate the column (defaults to {tag: 'div', cls: 'x-form-ct x-form-column'}) - */ - - // private - defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-column'}, - - // private - onRender : function(ct, position){ - Roo.form.Column.superclass.onRender.call(this, ct, position); - if(this.width){ - this.el.setWidth(this.width); - } - } -}); - - -/** - * @class Roo.form.Row - * @extends Roo.form.Layout - * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet - * Creates a row container for layout and rendering of fields in an {@link Roo.form.Form}. - * @constructor - * @param {Object} config Configuration options - */ - - -Roo.form.Row = function(config){ - Roo.form.Row.superclass.constructor.call(this, config); -}; - -Roo.extend(Roo.form.Row, Roo.form.Layout, { - /** - * @cfg {Number/String} width - * The fixed width of the column in pixels or CSS value (defaults to "auto") - */ - /** - * @cfg {Number/String} height - * The fixed height of the column in pixels or CSS value (defaults to "auto") - */ - defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-row'}, - - padWidth : 20, - // private - onRender : function(ct, position){ - //console.log('row render'); - if(!this.rowTpl){ - var t = new Roo.Template( - '<div class="x-form-item {5}" style="float:left;width:{6}px">', - '<label for="{0}" style="{2}">{1}{4}</label>', - '<div class="x-form-element" id="x-form-el-{0}" style="{3}">', - '</div>', - '</div>' - ); - t.disableFormats = true; - t.compile(); - Roo.form.Layout.prototype.rowTpl = t; - } - this.fieldTpl = this.rowTpl; - - //console.log('lw' + this.labelWidth +', la:' + this.labelAlign); - var labelWidth = 100; - - if ((this.labelAlign != 'top')) { - if (typeof this.labelWidth == 'number') { - labelWidth = this.labelWidth - } - this.padWidth = 20 + labelWidth; - - } - - Roo.form.Column.superclass.onRender.call(this, ct, position); - if(this.width){ - this.el.setWidth(this.width); - } - if(this.height){ - this.el.setHeight(this.height); - } - }, - - // private - renderField : function(f){ - f.fieldEl = this.fieldTpl.append(this.el, [ - f.id, f.fieldLabel, - f.labelStyle||this.labelStyle||'', - this.elementStyle||'', - typeof f.labelSeparator == 'undefined' ? this.labelSeparator : f.labelSeparator, - f.itemCls||this.itemCls||'', - f.width ? f.width + this.padWidth : 160 + this.padWidth - ],true); - } -}); - - -/** - * @class Roo.form.FieldSet - * @extends Roo.form.Layout - * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem - * Creates a fieldset container for layout and rendering of fields in an {@link Roo.form.Form}. - * @constructor - * @param {Object} config Configuration options - */ -Roo.form.FieldSet = function(config){ - Roo.form.FieldSet.superclass.constructor.call(this, config); -}; - -Roo.extend(Roo.form.FieldSet, Roo.form.Layout, { - /** - * @cfg {String} legend - * The text to display as the legend for the FieldSet (defaults to '') - */ - /** - * @cfg {String/Object} autoCreate - * A DomHelper element spec used to autocreate the fieldset (defaults to {tag: 'fieldset', cn: {tag:'legend'}}) - */ - - // private - defaultAutoCreate : {tag: 'fieldset', cn: {tag:'legend'}}, - - // private - onRender : function(ct, position){ - Roo.form.FieldSet.superclass.onRender.call(this, ct, position); - if(this.legend){ - this.setLegend(this.legend); - } - }, - - // private - setLegend : function(text){ - if(this.rendered){ - this.el.child('legend').update(text); - } - } -}); \ No newline at end of file + \ No newline at end of file diff --git a/docs/src/Roo_form_Row.js.html b/docs/src/Roo_form_Row.js.html new file mode 100644 index 0000000000..3253955e75 --- /dev/null +++ b/docs/src/Roo_form_Row.js.html @@ -0,0 +1,78 @@ +Roo/form/Row.js +/** + * @class Roo.form.Row + * @extends Roo.form.Layout + * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem Roo.form.FieldSet + * Creates a row container for layout and rendering of fields in an {@link Roo.form.Form}. + * @constructor + * @param {Object} config Configuration options + */ + + +Roo.form.Row = function(config){ + Roo.form.Row.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.form.Row, Roo.form.Layout, { + /** + * @cfg {Number/String} width + * The fixed width of the column in pixels or CSS value (defaults to "auto") + */ + /** + * @cfg {Number/String} height + * The fixed height of the column in pixels or CSS value (defaults to "auto") + */ + defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-row'}, + + padWidth : 20, + // private + onRender : function(ct, position){ + //console.log('row render'); + if(!this.rowTpl){ + var t = new Roo.Template( + '<div class="x-form-item {5}" style="float:left;width:{6}px">', + '<label for="{0}" style="{2}">{1}{4}</label>', + '<div class="x-form-element" id="x-form-el-{0}" style="{3}">', + '</div>', + '</div>' + ); + t.disableFormats = true; + t.compile(); + Roo.form.Layout.prototype.rowTpl = t; + } + this.fieldTpl = this.rowTpl; + + //console.log('lw' + this.labelWidth +', la:' + this.labelAlign); + var labelWidth = 100; + + if ((this.labelAlign != 'top')) { + if (typeof this.labelWidth == 'number') { + labelWidth = this.labelWidth + } + this.padWidth = 20 + labelWidth; + + } + + Roo.form.Column.superclass.onRender.call(this, ct, position); + if(this.width){ + this.el.setWidth(this.width); + } + if(this.height){ + this.el.setHeight(this.height); + } + }, + + // private + renderField : function(f){ + f.fieldEl = this.fieldTpl.append(this.el, [ + f.id, f.fieldLabel, + f.labelStyle||this.labelStyle||'', + this.elementStyle||'', + typeof f.labelSeparator == 'undefined' ? this.labelSeparator : f.labelSeparator, + f.itemCls||this.itemCls||'', + f.width ? f.width + this.padWidth : 160 + this.padWidth + ],true); + } +}); + + \ No newline at end of file diff --git a/docs/src/Roo_htmleditor_FilterWord.js.html b/docs/src/Roo_htmleditor_FilterWord.js.html index 068de8ada7..2ce51a4eaa 100644 --- a/docs/src/Roo_htmleditor_FilterWord.js.html +++ b/docs/src/Roo_htmleditor_FilterWord.js.html @@ -14,10 +14,10 @@ // no need to apply config. this.replaceDocBullets(cfg.node); - this.walk(cfg.node); + // this.walk(cfg.node); -} +} Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter, { @@ -125,7 +125,7 @@ styleToObject: function(node) { - var styles = node.getAttribute("style").split(";"); + var styles = (node.getAttribute("style") || '').split(";"); var ret = {}; Roo.each(styles, function(s) { if (!s.match(/:/)) { @@ -134,7 +134,7 @@ var kv = s.split(":"); // what ever is left... we allow. - ret[kv[0]] = kv[1]; + ret[kv[0].trim()] = kv[1]; }); return ret; }, @@ -142,11 +142,17 @@ replaceDocBullets : function(doc) { + // this is a bit odd - but it appears some indents use ql-indent-1 + + var listpara = doc.getElementsByClassName('ql-indent-1'); + while(listpara.length) { + this.replaceDocBullet(listpara.item(0)); + } + var listpara = doc.getElementsByClassName('MsoListParagraph'); while(listpara.length) { this.replaceDocBullet(listpara.item(0)); - //code - } + } }, replaceDocBullet : function(p) @@ -156,55 +162,87 @@ parent = p.parentNode, doc = parent.ownerDocument, items = []; + + while (ns) { if (ns.nodeType != 1) { ns = ns.nextSibling; continue; } - if (!ns.className.match(/MsoListParagraph/i)) { + if (!ns.className.match(/(MsoListParagraph|ql-indent-1)/i)) { break; } items.push(ns); ns = ns.nextSibling; - } + + var ul = parent.ownerDocument.createElement('ul'); // what about number lists... parent.insertBefore(ul, p); var lvl = 0; var stack = [ ul ]; var last_li = false; - items.forEach(function(n) { - parent.removeChild(n); + + items.forEach(function(n, ipos) { + //Roo.log("got innertHMLT=" + n.innerHTML); + var spans = n.getElementsByTagName('span'); - if (!spans.length || !n.isEqualNode(spans.item(0).parentNode)) { + if (!spans.length) { + //Roo.log("No spans found"); + + parent.removeChild(n); return; // skip it... } - var style = this.styleToObject(n); + + + var style = {}; + for(var i = 0; i < spans.length; i++) { + + style = this.styleToObject(spans[i]); + if (typeof(style['mso-list']) == 'undefined') { + continue; + } + + spans[i].parentNode.removeChild(spans[i]); // remove the fake bullet. + break; + } + //Roo.log("NOW GOT innertHMLT=" + n.innerHTML); + style = this.styleToObject(n); // mo-list is from the parent node. if (typeof(style['mso-list']) == 'undefined') { - return; // skip it. - } - n.removeChild(spans.item(0)); // remove the fake bullet. - var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1; + //Roo.log("parent is missing level"); + parent.removeChild(n); + return; + } + + var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1 ; + + + if (nlvl > lvl) { //new indent var nul = doc.createElement('ul'); // what about number lists... last_li.appendChild(nul); stack[nlvl] = nul; + } lvl = nlvl; var nli = stack[nlvl].appendChild(doc.createElement('li')); last_li = nli; + nli.innerHTML = n.innerHTML; + //Roo.log("innerHTML = " + n.innerHTML); + parent.removeChild(n); + // copy children of p into nli - while(n.firstChild) { - var fc = n.firstChild; - n.removeChild(fc); - nli.appendChild(fc); - } + /*while(n.firstChild) { + var fc = n.firstChild; + n.removeChild(fc); + nli.appendChild(fc); + }*/ - },this); + },this); diff --git a/docs/src/Roo_htmleditor_TidyWriter.js.html b/docs/src/Roo_htmleditor_TidyWriter.js.html index 3dd67335ea..16d42bb90b 100644 --- a/docs/src/Roo_htmleditor_TidyWriter.js.html +++ b/docs/src/Roo_htmleditor_TidyWriter.js.html @@ -186,12 +186,14 @@ * @param {String} text String to write out. * @param {Boolean} raw Optional raw state if true the contents wont get encoded. */ - text: function(text, node) + text: function(in_text, node) { // if not in whitespace critical - if (text.length < 1) { + if (in_text.length < 1) { return; } + var text = new XMLSerializer().serializeToString(document.createTextNode(in_text)); // escape it properly? + if (this.in_pre) { this.html[this.html.length] = text; return; diff --git a/docs/src/Roo_rtf_Parser.js.html b/docs/src/Roo_rtf_Parser.js.html index 26d7659d38..cb72a4efb0 100644 --- a/docs/src/Roo_rtf_Parser.js.html +++ b/docs/src/Roo_rtf_Parser.js.html @@ -173,7 +173,7 @@ this.hexStore.push(cmd); }, cmderror : function(cmd) { - throw new Exception (cmd.value); + throw cmd.value; }, /* @@ -303,8 +303,9 @@ { this.emitText(); if (this.controlWord === '') { - this.emitError('empty control word'); - } else { + // do we want to track this - it seems just to cause problems. + //this.emitError('empty control word'); + } else { this.push({ type: 'controlword', value: this.controlWord, diff --git a/docs/symbols/Roo.data.DataProxy.json b/docs/symbols/Roo.data.DataProxy.json index 002b6040a6..88a04d3a6f 100644 --- a/docs/symbols/Roo.data.DataProxy.json +++ b/docs/symbols/Roo.data.DataProxy.json @@ -5,7 +5,8 @@ ], "childClasses" : { "Roo.data.DataProxy" : [ - "Roo.data.HttpProxy" + "Roo.data.HttpProxy", + "Roo.data.MemoryProxy" ] }, "tree_children" : [], diff --git a/docs/symbols/Roo.data.MemoryProxy.json b/docs/symbols/Roo.data.MemoryProxy.json index 52686be67f..999fdf5e0c 100644 --- a/docs/symbols/Roo.data.MemoryProxy.json +++ b/docs/symbols/Roo.data.MemoryProxy.json @@ -1,6 +1,9 @@ { "name" : "Roo.data.MemoryProxy", - "augments" : [], + "augments" : [ + "Roo.data.DataProxy", + "Roo.util.Observable" + ], "childClasses" : { }, "tree_children" : [], "tree_parent" : [], @@ -17,16 +20,33 @@ "see" : "", "params" : [ { - "name" : "data", + "name" : "config", "type" : "Object", - "desc" : "The data object which the Reader uses to construct a block of Roo.data.Records.", + "desc" : "A config object containing the objects needed for the Store to access data,", "isOptional" : false } ], "returns" : [], "throws" : "", "requires" : "", - "config" : [], + "config" : [ + { + "name" : "listeners", + "type" : "Object", + "desc" : "list of events and functions to call for this object, \nFor example :\n
\n    listeners :  { \n       'click' : function(e) {\n           ..... \n        } ,\n        .... \n    } \n  
", + "memberOf" : "Roo.util.Observable", + "isOptional" : false, + "optvals" : [] + }, + { + "name" : "data", + "type" : "Object", + "desc" : "The data object which the Reader uses to construct a block of Roo.data.Records.", + "memberOf" : "", + "isOptional" : false, + "optvals" : [] + } + ], "methods" : [ { "name" : "load", @@ -77,7 +97,447 @@ } ], "returns" : [] + }, + { + "name" : "purgeListeners", + "type" : "function", + "desc" : "Removes all listeners for this object", + "sig" : "()\n{\n\n}", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [], + "returns" : [] + }, + { + "name" : "on", + "type" : "function", + "desc" : "Appends an event handler to this element (shorthand for addListener)", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional)", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "un", + "type" : "function", + "desc" : "Removes a listener (shorthand for removeListener)", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addEvents", + "type" : "function", + "desc" : "Used to define events on this Observable", + "sig" : "(object)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "object", + "type" : "Object", + "desc" : "The object with the events defined", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "releaseCapture", + "type" : "function", + "desc" : "Removes all added captures from the Observable.", + "sig" : "(o)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to release", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "removeListener", + "type" : "function", + "desc" : "Removes a listener", + "sig" : "(eventName, handler, scope)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The handler to remove", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the handler", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "fireEvent", + "type" : "function", + "desc" : "Fires the specified event with the passed parameters (minus the event name).", + "sig" : "(eventName, args)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "", + "isOptional" : false + }, + { + "name" : "args", + "type" : "Object...", + "desc" : "Variable number of parameters are passed to handlers", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "returns false if any of the handlers return false otherwise it returns true" + } + ] + }, + { + "name" : "hasListener", + "type" : "function", + "desc" : "Checks to see if this object has any listeners for a specified event", + "sig" : "(eventName)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The name of the event to check for", + "isOptional" : false + } + ], + "returns" : [ + { + "name" : "", + "type" : "Boolean", + "desc" : "True if the event is being listened for, else false" + } + ] + }, + { + "name" : "capture", + "type" : "function", + "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\nbefore the event is fired. If the supplied function returns false,\nthe event will not fire.", + "sig" : "(o, fn, scope)", + "static" : true, + "memberOf" : "Roo.util.Observable", + "isStatic" : true, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "o", + "type" : "Observable", + "desc" : "The Observable to capture", + "isOptional" : false + }, + { + "name" : "fn", + "type" : "Function", + "desc" : "The function to call", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope (this object) for the fn", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "addListener", + "type" : "function", + "desc" : "Appends an event handler to this component", + "sig" : "(eventName, handler, scope, options)", + "static" : false, + "memberOf" : "Roo.util.Observable", + "isStatic" : false, + "isConstructor" : false, + "isPrivate" : false, + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "exceptions" : "", + "requires" : "", + "params" : [ + { + "name" : "eventName", + "type" : "String", + "desc" : "The type of event to listen for", + "isOptional" : false + }, + { + "name" : "handler", + "type" : "Function", + "desc" : "The method the event invokes", + "isOptional" : false + }, + { + "name" : "scope", + "type" : "Object", + "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.", + "isOptional" : false + }, + { + "name" : "options", + "type" : "Object", + "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:
\n

\nCombining Options
\nUsing the options argument, it is possible to combine different types of listeners:
\n
\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t

\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n    \t\tdelay: 100,\n    \t\tforumId: 4\n\t\t});\n\t\t
\n

\nAttaching multiple handlers in 1 call
\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n

\n\t\tel.on({\n\t\t\t'click': {\n        \t\tfn: this.onClick,\n        \t\tscope: this,\n        \t\tdelay: 100\n    \t\t}, \n    \t\t'mouseover': {\n        \t\tfn: this.onMouseOver,\n        \t\tscope: this\n    \t\t},\n    \t\t'mouseout': {\n        \t\tfn: this.onMouseOut,\n        \t\tscope: this\n    \t\t}\n\t\t});\n\t\t
\n

\nOr a shorthand syntax which passes the same scope object to all handlers:\n \t

\n\t\tel.on({\n\t\t\t'click': this.onClick,\n    \t\t'mouseover': this.onMouseOver,\n    \t\t'mouseout': this.onMouseOut,\n    \t\tscope: this\n\t\t});\n\t\t
", + "isOptional" : false + } + ], + "returns" : [] } ], - "events" : [] + "events" : [ + { + "name" : "load", + "type" : "function", + "desc" : "Fires before the load method's callback is called.", + "sig" : "function (This, o, arg)\n{\n\n}", + "memberOf" : "Roo.data.DataProxy", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "This", + "type" : "Object", + "desc" : "DataProxy object.", + "isOptional" : false + }, + { + "name" : "o", + "type" : "Object", + "desc" : "The data object.", + "isOptional" : false + }, + { + "name" : "arg", + "type" : "Object", + "desc" : "The callback argument object passed to the load function.", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "beforeload", + "type" : "function", + "desc" : "Fires before a network request is made to retrieve a data object.", + "sig" : "function (This, params)\n{\n\n}", + "memberOf" : "Roo.data.DataProxy", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "This", + "type" : "Object", + "desc" : "DataProxy object.", + "isOptional" : false + }, + { + "name" : "params", + "type" : "Object", + "desc" : "The params parameter to the load function.", + "isOptional" : false + } + ], + "returns" : [] + }, + { + "name" : "loadexception", + "type" : "function", + "desc" : "Fires if an Exception occurs during data retrieval.", + "sig" : "function (This, o, arg, e)\n{\n\n}", + "memberOf" : "Roo.data.DataProxy", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "This", + "type" : "Object", + "desc" : "DataProxy object.", + "isOptional" : false + }, + { + "name" : "o", + "type" : "Object", + "desc" : "The data object.", + "isOptional" : false + }, + { + "name" : "arg", + "type" : "Object", + "desc" : "The callback argument object passed to the load function.", + "isOptional" : false + }, + { + "name" : "e", + "type" : "Object", + "desc" : "The Exception.", + "isOptional" : false + } + ], + "returns" : [] + } + ] } \ No newline at end of file diff --git a/docs/symbols/Roo.form.Column.json b/docs/symbols/Roo.form.Column.json index 50c0bcb0bb..8d9a5f7c3e 100644 --- a/docs/symbols/Roo.form.Column.json +++ b/docs/symbols/Roo.form.Column.json @@ -63,10 +63,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "Roo.form.Layout", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "listeners", diff --git a/docs/symbols/Roo.form.FieldSet.json b/docs/symbols/Roo.form.FieldSet.json index 19bc1d66f6..f8fb804b20 100644 --- a/docs/symbols/Roo.form.FieldSet.json +++ b/docs/symbols/Roo.form.FieldSet.json @@ -63,10 +63,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "Roo.form.Layout", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "listeners", diff --git a/docs/symbols/Roo.form.Layout.json b/docs/symbols/Roo.form.Layout.json index e0365c2b85..33cd2a41f8 100644 --- a/docs/symbols/Roo.form.Layout.json +++ b/docs/symbols/Roo.form.Layout.json @@ -69,10 +69,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "listeners", diff --git a/docs/symbols/Roo.form.Row.json b/docs/symbols/Roo.form.Row.json index 938d380858..72746ebec6 100644 --- a/docs/symbols/Roo.form.Row.json +++ b/docs/symbols/Roo.form.Row.json @@ -64,10 +64,14 @@ { "name" : "labelAlign", "type" : "String", - "desc" : "Valid values are \"left,\" \"top\" and \"right\" (defaults to \"left\")", + "desc" : "t)\nValid values are \"left,\" \"top\" and \"right\" (defaults to \"left", "memberOf" : "Roo.form.Layout", "isOptional" : false, - "optvals" : [] + "optvals" : [ + "left", + "top", + "right" + ] }, { "name" : "listeners", diff --git a/docs/symbols/Roo.htmleditor.FilterFileWarning.json b/docs/symbols/Roo.htmleditor.FilterFileWarning.json new file mode 100644 index 0000000000..d05a9152d9 --- /dev/null +++ b/docs/symbols/Roo.htmleditor.FilterFileWarning.json @@ -0,0 +1,32 @@ +{ + "name" : "Roo.htmleditor.FilterFileWarning", + "augments" : [], + "childClasses" : { }, + "tree_children" : [], + "tree_parent" : [], + "desc" : "clean attributes and styles including http:// etc.. in attribute", + "isSingleton" : false, + "isStatic" : false, + "isBuiltin" : false, + "isAbstract" : false, + "isBuilderTop" : false, + "memberOf" : "FilterFileWarning", + "example" : "", + "deprecated" : "", + "since" : "", + "see" : "", + "params" : [ + { + "name" : "config", + "type" : "Object", + "desc" : "Configuration options", + "isOptional" : false + } + ], + "returns" : [], + "throws" : "", + "requires" : "", + "config" : [], + "methods" : [], + "events" : [] +} \ No newline at end of file diff --git a/docs/symbols/Roo.util.Observable.json b/docs/symbols/Roo.util.Observable.json index 5b1166440a..8b0f673dcc 100644 --- a/docs/symbols/Roo.util.Observable.json +++ b/docs/symbols/Roo.util.Observable.json @@ -51,7 +51,8 @@ "Roo.JsonView" ], "Roo.data.DataProxy" : [ - "Roo.data.HttpProxy" + "Roo.data.HttpProxy", + "Roo.data.MemoryProxy" ], "Roo.menu.Menu" : [ "Roo.menu.ColorMenu", diff --git a/examples/grid/ArrayGrid.bjs b/examples/grid/ArrayGrid.bjs new file mode 100644 index 0000000000..0c18073388 --- /dev/null +++ b/examples/grid/ArrayGrid.bjs @@ -0,0 +1,107 @@ +{ + "name" : "ArrayGrid", + "parent" : "#grid-panel", + "title" : "", + "path" : "/home/alan/gitlive/roojs1/examples/grid/ArrayGrid.bjs", + "permname" : "", + "modOrder" : "001", + "strings" : { + "1c76cbfe21c6f44c1d1e59d54f3e4420" : "Company", + "30870648ed968ed5a3e00631e4ad0699" : "% Change", + "3601146c4e948c32b6424d2c0a7f0118" : "Price", + "f4ec5f57bd4d31b803312d873be40da9" : "Change", + "4221d3e17c6eca2ca6337251a3cf9c4e" : "Last Updated" + }, + "items" : [ + { + "xtype" : "GridPanel", + "$ xns" : "Roo", + "items" : [ + { + "listeners" : { + "render" : "function (grid)\n{\n _this.grid = this;\n}" + }, + "xtype" : "Grid", + "$ xns" : "Roo.grid", + "String autoExpandColumn" : "company", + "* prop" : "grid", + "items" : [ + { + "xtype" : "Store", + "$ xns" : "Roo.data", + "* prop" : "ds", + "items" : [ + { + "xtype" : "MemoryProxy", + "$ data" : "[]", + "$ xns" : "Roo.data", + "* prop" : "proxy" + }, + { + "$ Array fields" : "[\n {name: 'company'},\n {name: 'price', type: 'float'}, \n {name: 'change', type: 'float'},\n {name: 'pctChange', type: 'float'},\n {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}\n]", + "xtype" : "ArrayReader", + "$ xns" : "Roo.data", + "* prop" : "reader" + } + ] + }, + { + "String header" : "Company", + "String dataIndex" : "company", + "Number width" : 160, + "xtype" : "ColumnModel", + "$ xns" : "Roo.grid", + "Boolean sortable" : true, + "* prop" : "cm[]", + "Boolean locked" : false + }, + { + "String header" : "Price", + "String dataIndex" : "price", + "Number width" : 75, + "$ Function renderer" : " Roo.util.Format.usMoney", + "xtype" : "ColumnModel", + "$ xns" : "Roo.grid", + "Boolean sortable" : true, + "* prop" : "cm[]", + "Boolean locked" : false + }, + { + "String header" : "Change", + "String dataIndex" : "change", + "Number width" : 75, + "$ Function renderer" : "function (val){\n if(val > 0){\n return '' + val + '';\n }else if(val < 0){\n return '' + val + '';\n }\n return val;\n}", + "xtype" : "ColumnModel", + "$ xns" : "Roo.grid", + "Boolean sortable" : true, + "* prop" : "cm[]", + "Boolean locked" : false + }, + { + "String header" : "% Change", + "String dataIndex" : "pctChange", + "Number width" : 75, + "$ Function renderer" : "function (val){\n if(val > 0){\n return '' + val + '%';\n }else if(val < 0){\n return '' + val + '%';\n }\n return val;\n}", + "xtype" : "ColumnModel", + "$ xns" : "Roo.grid", + "Boolean sortable" : true, + "* prop" : "cm[]", + "Boolean locked" : false + }, + { + "String header" : "Last Updated", + "String dataIndex" : "lastChange", + "Number width" : 85, + "$ Function renderer" : "Roo.util.Format.dateRenderer('m/d/Y')", + "xtype" : "ColumnModel", + "$ xns" : "Roo.grid", + "Boolean sortable" : true, + "* prop" : "cm[]", + "Boolean locked" : false + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/examples/grid/ArrayGrid.js b/examples/grid/ArrayGrid.js new file mode 100644 index 0000000000..80d04e5276 --- /dev/null +++ b/examples/grid/ArrayGrid.js @@ -0,0 +1,136 @@ +// - - - - - - - - - -

Array Grid Example

-

This example shows how to create a grid from Array data.

-

Note that the js is not minified so it is readable. See - and - .

- -
-
-
- - + + + + +Array Grid Example + + + + + + + + + + + + + + + + + + +

Array Panel Example

+ +

This example demostrates how to use a Roo.data.Store with a Roo.data.MemoryProxy and a Roo.data.ArrayReader along with loading the data from a javascript call +The grid is set up in which was generated using the roobuilder tool, and +the data is loading on the buildcomplete event in .

+ + +

+ and + +
+ +
+ + + + + diff --git a/examples/grid/array-grid.js b/examples/grid/array-grid.js index fdfc59e53f..dc9a372731 100644 --- a/examples/grid/array-grid.js +++ b/examples/grid/array-grid.js @@ -7,112 +7,112 @@ * * Fork - LGPL *