X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-ui-debug.js;h=3a7892ae3f1d8bc8c1b2f1fdfe5dc008954ba748;hb=682b55a93857ddf7a1e4c0a1876d412dbc199b0c;hp=5f0b4e6301bf6bdf4f26c91a1df202c63e4c78bc;hpb=41a76ad00f5fc61e2452862ddf6908ae45d7fd73;p=roojs1 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 5f0b4e6301..3a7892ae3f 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -2197,35 +2197,35 @@ Roo.extend(Roo.data.ArrayReader, Roo.data.JsonReader, { readRecords : function(o) { var sid = this.meta ? this.meta.id : null; - var recordType = this.recordType, fields = recordType.prototype.fields; - var records = []; - var root = o; - for(var i = 0; i < root.length; i++){ - var n = root[i]; - var values = {}; - var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); - for(var j = 0, jlen = fields.length; j < jlen; j++){ - var f = fields.items[j]; - var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; - var v = n[k] !== undefined ? n[k] : f.defaultValue; - v = f.convert(v); - values[f.name] = v; - } - var record = new recordType(values, id); - record.json = n; - records[records.length] = record; - } - return { - records : records, - totalRecords : records.length - }; + var recordType = this.recordType, fields = recordType.prototype.fields; + var records = []; + var root = o; + for(var i = 0; i < root.length; i++){ + var n = root[i]; + var values = {}; + var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null); + for(var j = 0, jlen = fields.length; j < jlen; j++){ + var f = fields.items[j]; + var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; + var v = n[k] !== undefined ? n[k] : f.defaultValue; + v = f.convert(v); + values[f.name] = v; + } + var record = new recordType(values, id); + record.json = n; + records[records.length] = record; + } + return { + records : records, + totalRecords : records.length + }; }, // used when loading children.. @see loadDataFromChildren toLoadData: function(rec) { - // expect rec just to be an array.. eg [a,b,c, [...] << cn ] - return typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn; - + // expect rec just to be an array.. eg [a,b,c, [...] << cn ] + return typeof(rec.data.cn) == 'undefined' ? [] : rec.data.cn; + } @@ -3055,6 +3055,7 @@ Roo.Shadow.prototype = { * frame: Shadow displays equally on all four sides
* drop: Traditional bottom-right drop shadow (default) */ + mode: false, /** * @cfg {String} offset * The number of pixels to offset the shadow from the element (defaults to 4) @@ -7031,7 +7032,7 @@ Roo.Toolbar.prototype = { * @cfg {Array} items * array of button configs or elements to add (will be converted to a MixedCollection) */ - + items: false, /** * @cfg {String/HTMLElement/Element} container * The id or element that will contain the toolbar @@ -15346,7 +15347,7 @@ Roo.menu.TextItem = function(cfg){ Roo.extend(Roo.menu.TextItem, Roo.menu.BaseItem, { /** - * @cfg {Boolean} text Text to show on item. + * @cfg {String} text Text to show on item. */ text : '', @@ -20607,6 +20608,10 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { */ stylesheets: false, + /** + * @cfg {boolean} allowComments - default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this. + */ + allowComments: false, // id of frame.. frameId: false, @@ -20653,10 +20658,11 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { st = ''; - } else { - st = ''; + } else { + for (var i in this.stylesheets) { + st += ''; + } + } st += '' + - ' '; + ' '; }, // private @@ -21520,7 +21526,9 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { return; } if (node.nodeName == "#comment") { - node.parentNode.removeChild(node); + if (!this.allowComments) { + node.parentNode.removeChild(node); + } // clean up silly Windows -- stuff? return; } @@ -21582,6 +21590,9 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { if (v.match(/^#/)) { return; } + if (v.match(/^\{/)) { // allow template editing. + return; + } // Roo.log("(REMOVE TAG)"+ node.tagName +'.' + n + '=' + v); node.removeAttribute(n); @@ -22215,8 +22226,8 @@ Roo.HtmlEditorCore.cblack= [ Roo.HtmlEditorCore.swapCodes =[ - [ 8211, "--" ], - [ 8212, "--" ], + [ 8211, "–" ], + [ 8212, "—" ], [ 8216, "'" ], [ 8217, "'" ], [ 8220, '"' ], @@ -22313,6 +22324,10 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, { * */ white: false, + /** + * @cfg {boolean} allowComments - default false - allow comments in HTML source - by default they are stripped - if you are editing email you may need this. + */ + allowComments: false, // id of frame.. frameId: false, @@ -24595,7 +24610,26 @@ Roo.extend(Roo.form.BasicForm, Roo.util.Observable, { return valid; }, - + /** + * Returns array of invalid form fields. + * @return Array + */ + + invalidFields : function() + { + var ret = []; + this.items.each(function(f){ + if(f.validate()){ + return; + } + ret.push(f); + + }); + + return ret; + }, + + /** * DEPRICATED Returns true if any fields in this form have changed since their original load. * @return Boolean @@ -28443,10 +28477,10 @@ Roo.DDView = function(container, tpl, config) { this.getEl().setStyle("outline", "0px none"); this.getEl().unselectable(); if (this.dragGroup) { - this.setDraggable(this.dragGroup.split(",")); + this.setDraggable(this.dragGroup.split(",")); } if (this.dropGroup) { - this.setDroppable(this.dropGroup.split(",")); + this.setDroppable(this.dropGroup.split(",")); } if (this.deletable) { this.setDeletable(); @@ -31189,6 +31223,7 @@ Roo.LayoutStateManager.prototype = { * @cfg {String/Object} params When used with {@link #url}, calls {@link #setUrl} with this value * @cfg {Boolean} loadOnce When used with {@link #url}, calls {@link #setUrl} with this value * @cfg {String} content Raw content to fill content panel with (uses setContent on construction.) + * @cfg {String} style Extra style to add to the content panel * @constructor * Create a new ContentPanel. @@ -31226,6 +31261,8 @@ Roo.ContentPanel = function(el, config, content){ {tag: "div", cls: "x-layout-inactive-content", id: config.id||el}, true); } } + + this.closable = false; this.loaded = false; this.active = false; @@ -31879,19 +31916,14 @@ Roo.extend(Roo.ScrollPanel, Roo.ContentPanel, { - - - - - - /** * @class Roo.TreePanel * @extends Roo.ContentPanel + * Treepanel component + * * @constructor * Create a new TreePanel. - defaults to fit/scoll contents. * @param {String/Object} config A string to set only the panel's title, or a config object - * @cfg {Roo.tree.TreePanel} tree The tree TreePanel, with config etc. */ Roo.TreePanel = function(config){ var el = config.el; @@ -31934,7 +31966,12 @@ Roo.TreePanel = function(config){ Roo.extend(Roo.TreePanel, Roo.ContentPanel, { fitToFrame : true, - autoScroll : true + autoScroll : true, + /* + * @cfg {Roo.tree.TreePanel} tree The tree TreePanel, with config etc. + */ + tree : false + }); @@ -32377,6 +32414,9 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {String} ddGroup - drag drop group. */ + /** + * @cfg {String} dragGroup - drag group (?? not sure if needed.) + */ /** * @cfg {Number} minColumnWidth The minimum width a column can be resized to. Default is 25. @@ -32413,6 +32453,9 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {Boolean} enableDrag True to enable drag of rows. Default is false. (double check if this is needed?) + */ + /** + * @cfg {Boolean} enableDrop True to enable drop of elements. Default is false. (double check if this is needed?) */ /** @@ -32487,6 +32530,15 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { /** * @cfg {Number} maxHeight Sets the maximum height of the grid - ignored if autoHeight is not on. */ + + + /** + * @cfg {String} ddText Configures the text is the drag proxy (defaults to "%0 selected row(s)"). + * %0 is replaced with the number of selected rows. + */ + ddText : "{0} selected row{1}", + + /** * Called once after all setup has been completed and the grid is ready to be rendered. * @return {Roo.grid.Grid} this @@ -32797,11 +32849,17 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { getView : function(){ if(!this.view){ this.view = new Roo.grid.GridView(this.viewConfig); + this.relayEvents(this.view, [ + "beforerowremoved", "beforerowsinserted", + "beforerefresh", "rowremoved", + "rowsinserted", "rowupdated" ,"refresh" + ]); } return this.view; }, /** * Called to get grid's drag proxy text, by default returns this.ddText. + * Override this to put something different in the dragged text. * @return {String} */ getDragDropText : function(){ @@ -32809,12 +32867,7 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { return String.format(this.ddText, count, count == 1 ? '' : 's'); } }); -/** - * Configures the text is the drag proxy (defaults to "%0 selected row(s)"). - * %0 is replaced with the number of selected rows. - * @type String - */ -Roo.grid.Grid.prototype.ddText = "{0} selected row{1}";/* +/* * Based on: * Ext JS Library 1.1.1 * Copyright(c) 2006-2007, Ext JS, LLC. @@ -33729,7 +33782,7 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { ); */ if(ctop < stop){ - c.scrollTop = ctop; + c.scrollTop = ctop; //Roo.log("set scrolltop to ctop DISABLE?"); }else if(cbot > sbot){ //Roo.log("set scrolltop to cbot-ch"); @@ -34724,7 +34777,8 @@ Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, { } }, - layout : function(initialRender, is2ndPass){ + layout : function(initialRender, is2ndPass) + { var g = this.grid; var auto = g.autoHeight; var scrollOffset = 16; @@ -34881,19 +34935,34 @@ Roo.extend(Roo.grid.GridView.ColumnDragZone, Roo.grid.HeaderDragZone, { * Fork - LGPL *