From 01c98b86cddc100cdcedb3d5363b8fed6edacf1c Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Sun, 1 Aug 2010 08:24:39 +0000 Subject: jason: update timer view if autotimer upgraded --- skins/jason/autotimers.js | 30 +++++++++++++++--------------- skins/jason/chronicle.js | 4 ++-- skins/jason/form.js | 26 +++++++++++++------------- skins/jason/now.js | 40 +++++++++++++++++++--------------------- skins/jason/program.js | 10 +++++----- skins/jason/search.js | 11 +++++------ skins/jason/timers.js | 42 +++++++++++++++++++----------------------- 7 files changed, 78 insertions(+), 85 deletions(-) diff --git a/skins/jason/autotimers.js b/skins/jason/autotimers.js index 3981785..569dc96 100644 --- a/skins/jason/autotimers.js +++ b/skins/jason/autotimers.js @@ -1,6 +1,6 @@ /* * jason - Javascript based skin for xxv - * Copyright(c) 2008-2009, anbr + * Copyright(c) 2008-2010, anbr * * http://xxv.berlios.de/ * @@ -35,7 +35,6 @@ Ext.xxv.autotimerStore = function() { Ext.xxv.autotimerGrid = function(viewer, channels) { this.viewer = viewer; - //Ext.apply(this, {}); // Apply config // create the data store this.store = new Ext.xxv.autotimerStore(); @@ -59,8 +58,9 @@ Ext.xxv.autotimerGrid = function(viewer, channels) { ,width: 200 ,renderer: this.formatTitle }, - this.activeColumn, - { header: this.szColChannels + this.activeColumn, + { + header: this.szColChannels ,dataIndex: 'channels' ,width: 150 },{ @@ -100,8 +100,7 @@ Ext.xxv.autotimerGrid = function(viewer, channels) { pageSize: this.store.autoLoad.params.limit ,store: this.store ,displayInfo: true - ,items: [ - { + ,items: [{ id:'au' ,iconCls: 'upgrade-icon' ,tooltip: this.szUpgrade @@ -239,9 +238,8 @@ Ext.extend(Ext.xxv.autotimerGrid, Ext.grid.EditorGridPanel, { value, style ); } - /******************************************************************************/ - ,onDeleteSuccess : function( response,options ) - { +/******************************************************************************/ + ,onDeleteSuccess : function( response,options ) { this.loadMask.hide(); var o = eval("("+response.responseText+")"); @@ -273,8 +271,7 @@ Ext.extend(Ext.xxv.autotimerGrid, Ext.grid.EditorGridPanel, { } } - ,onDeleteFailure : function( response,options ) - { + ,onDeleteFailure : function( response,options ) { this.loadMask.hide(); new Ext.xxv.MessageBox().msgFailure(this.szDeleteFailure, response.statusText); } @@ -305,7 +302,7 @@ Ext.extend(Ext.xxv.autotimerGrid, Ext.grid.EditorGridPanel, { }); } - /******************************************************************************/ +/******************************************************************************/ ,EditItem : function( record ) { this.stopEditing(); var item; @@ -349,9 +346,8 @@ Ext.extend(Ext.xxv.autotimerGrid, Ext.grid.EditorGridPanel, { if(o && o.data && typeof(o.data) == 'string' && o.success) { - new Ext.xxv.MessageBox().msgSuccess(this.szUpgradeSuccess, o.data); - + this.updateTimer(); } else { var msg = ''; if(o && o.data && typeof(o.data) == 'string') { @@ -389,7 +385,11 @@ Ext.extend(Ext.xxv.autotimerGrid, Ext.grid.EditorGridPanel, { } }); } - + ,updateTimer : function() { + if(this.viewer.gridTimer) { + this.viewer.gridTimer.dataDirty = true; + } + } }); function createAutoTimerView(viewer,id) { diff --git a/skins/jason/chronicle.js b/skins/jason/chronicle.js index 03f04d1..7fceda1 100644 --- a/skins/jason/chronicle.js +++ b/skins/jason/chronicle.js @@ -245,8 +245,8 @@ Ext.extend(Ext.xxv.ChronicleGrid, Ext.grid.EditorGridPanel, { var todel = ""; for(var i = 0, len = sel.length; i < len; i++){ if(i != 0) - todel += ','; - todel += sel[i].data.id; + todel += ','; + todel += sel[i].data.id; } Ext.Ajax.request({ scope: this diff --git a/skins/jason/form.js b/skins/jason/form.js index de62ae5..7090d2c 100644 --- a/skins/jason/form.js +++ b/skins/jason/form.js @@ -117,7 +117,7 @@ Ext.extend(Ext.xxv.Question, Ext.Window, { config.baseCls = ''; config.style = 'border: 0px none;'; config.items = [{ - xtype: 'checkbox' + xtype: 'checkbox' ,labelSeparator: '' ,boxLabel: Ext.util.Format.ellipsis(r[i].data.fieldLabel,80) ,checked: r[i].data.valuedef == 'y' ? true : false @@ -126,7 +126,7 @@ Ext.extend(Ext.xxv.Question, Ext.Window, { ]; break; case 'checkbox': - config.xtype = 'checkboxgroup'; + config.xtype = 'checkboxgroup'; config.items = []; for(var f = 0, flen = r[i].data.choices.length; f < flen; f++){ config.items.push({ @@ -152,15 +152,15 @@ Ext.extend(Ext.xxv.Question, Ext.Window, { fields = [ {name: 'display'} ,{name: 'value'}, {name: 'groups'} ]; var cls = 'ux-mselect'; - var tpl = ''; + var tpl = ''; tpl+= '
{groups}
'; tpl+= '
{0} {1}
', @@ -360,9 +360,8 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel ,formatDuration: function(value, p, record) { return new Date(minTime().getTime()+(value * 1000)).dateFormat('H:i'); } - /******************************************************************************/ - ,onToggleSuccess : function( response,options ) - { +/******************************************************************************/ + ,onToggleSuccess : function( response,options ) { this.viewer.loadMask.hide(); var o = eval("("+response.responseText+")"); @@ -400,8 +399,7 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel } } - ,onToggleFailure : function( response,options ) - { + ,onToggleFailure : function( response,options ) { this.viewer.loadMask.hide(); new Ext.xxv.MessageBox().msgFailure(this.szToggleFailure, response.statusText); } @@ -419,8 +417,8 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel var todo = ""; for(var i = 0, len = sel.length; i < len; i++){ if(i != 0) - todo += ','; - todo += sel[i].data.id; + todo += ','; + todo += sel[i].data.id; } Ext.Ajax.request({ scope: this @@ -432,8 +430,7 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel }); } /******************************************************************************/ - ,onDeleteSuccess : function( response,options ) - { + ,onDeleteSuccess : function( response,options ) { this.viewer.loadMask.hide(); var o = eval("("+response.responseText+")"); @@ -443,7 +440,7 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel new Ext.xxv.MessageBox().msgSuccess(this.szDeleteSuccess, o.data); var gsm = this.getSelectionModel(); - var sel = options.params.data.split(","); + var sel = options.params.data.split(","); sel.reverse(); for(var i = 0, len = sel.length; i < len; i++){ if(gsm.isIdSelected(sel[i])) { @@ -465,8 +462,7 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel } } - ,onDeleteFailure : function( response,options ) - { + ,onDeleteFailure : function( response,options ) { this.viewer.loadMask.hide(); new Ext.xxv.MessageBox().msgFailure(this.szDeleteFailure, response.statusText); } @@ -484,8 +480,8 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel var todel = ""; for(var i = 0, len = sel.length; i < len; i++){ if(i != 0) - todel += ','; - todel += sel[i].data.id; + todel += ','; + todel += sel[i].data.id; } Ext.Ajax.request({ scope: this -- cgit v1.2.3