X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-debug.js;h=279e69f7829bfdf05c19d19e77dfe45a9b3b6575;hb=be2f093265f374154ff7e8bc0612b9e5d3366da9;hp=5180972350013de1844141e6803c3bd950a6e3f0;hpb=b969a627b10d8f6cc39466748ae28f50f97aba3b;p=roojs1 diff --git a/roojs-debug.js b/roojs-debug.js index 5180972350..279e69f782 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -1205,12 +1205,36 @@ document.write(dt.format(Date.patterns.ShortDate)); /** Returns the number of milliseconds between this date and date @param {Date} date (optional) Defaults to now + @param {Date} date (optional) Defaults to now + @param {String} interval A valid date interval enum value (eg. Date.DAY) @return {Number} The diff in milliseconds @member Date getElapsed */ -Date.prototype.getElapsed = function(date) { - return Math.abs((date || new Date()).getTime()-this.getTime()); +Date.prototype.getElapsed = function(date, interval) +{ + date = date || new Date(); + var ret = Math.abs(date.getTime()-this.getTime()); + switch (interval) { + + case Date.SECOND: + return Math.floor(ret / (1000)); + case Date.MINUTE: + return Math.floor(ret / (100*60)); + case Date.HOUR: + return Math.floor(ret / (100*60*60)); + case Date.DAY: + return Math.floor(ret / (100*60*60*24)); + case Date.MONTH: // this does not give exact number...?? + return ((date.format("Y") - this.format("Y")) * 12) + (date.format("m") - this.format("m")); + case Date.YEAR: // this does not give exact number...?? + return (date.format("Y") - this.format("Y")); + + case Date.MILLI: + default: + return ret; + } }; + // was in date file.. @@ -47989,6 +48013,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { data : [ ['auto'], ['50%'], + ['80%'], ['100%'] ], fields : [ 'val'], @@ -48071,7 +48096,7 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { var d = document.createElement('div'); d.innerHTML = this.caption; - var m = this.width == '50%' && this.align == 'center' ? '0 auto' : 0; + var m = this.width != '100%' && this.align == 'center' ? '0 auto' : 0; var iw = this.align == 'center' ? this.width : '100%'; var img = { @@ -48136,7 +48161,8 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { maxWidth : this.align == 'center' ? '100% !important' : (this.width + ' !important'), width : this.align == 'center' ? '100%' : this.width, margin: '0px', - padding: '10px' + padding: '10px', + textAlign : this.align // seems to work for email.. }, @@ -48164,7 +48190,8 @@ Roo.extend(Roo.htmleditor.BlockFigure, Roo.htmleditor.Block, { { tag: 'div', style : { - 'margin-top' : '16px' + marginTop : '16px', + textAlign : 'left' }, align: 'left', cn : [ @@ -50080,7 +50107,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { new Roo.htmleditor.FilterStyleToTag({ node : d }); new Roo.htmleditor.FilterAttributes({ node : d, - attrib_white : ['href', 'src', 'name', 'align'], + attrib_white : ['href', 'src', 'name', 'align', 'colspan', 'rowspan'], attrib_clean : ['href', 'src' ] }); new Roo.htmleditor.FilterBlack({ node : d, tag : this.black}); @@ -54340,7 +54367,7 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { * @cfg {String} itemCls A css class to apply to the x-form-item of fields. This property cascades to child containers. */ /** - * @cfg {String} buttonAlign Valid values are "left," "center" and "right" (defaults to "center") + * @cfg {String} (left|center|right) buttonAlign Valid values are "left," "center" and "right" (defaults to "center") */ buttonAlign:'center', @@ -54350,7 +54377,7 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { minButtonWidth:75, /** - * @cfg {String} labelAlign Valid values are "left," "top" and "right" (defaults to "left"). + * @cfg {String} labelAlign (left|top|right) Valid values are "left," "top" and "right" (defaults to "left"). * This property cascades to child containers if not set. */ labelAlign:'left', @@ -61411,7 +61438,7 @@ Roo.extend(Roo.grid.Grid, Roo.util.Observable, { * @cfg {Roo.grid.ColumnModel} cm[] The columns of the grid */ /** - * @cfg {Roo.grid.Store} ds The data store for the grid + * @cfg {Roo.data.Store} ds The data store for the grid */ /** * @cfg {Roo.Toolbar} toolbar a toolbar for buttons etc.