diff options
| author | Andreas Brachold <vdr07@deltab.de> | 2010-07-21 20:32:36 +0000 |
|---|---|---|
| committer | Andreas Brachold <vdr07@deltab.de> | 2010-07-21 20:32:36 +0000 |
| commit | 32b9ea3f0445eb738c8f2526ad83aa3f4285048b (patch) | |
| tree | ac189c7fffb922e39fb7747a6164a965f4e6aea8 /skins/jason/program.js | |
| parent | 6ae3413729aebda77dc1b4f0359a54ab0303b009 (diff) | |
| download | xxv-32b9ea3f0445eb738c8f2526ad83aa3f4285048b.tar.gz xxv-32b9ea3f0445eb738c8f2526ad83aa3f4285048b.tar.bz2 | |
jason: note update eol-style (native)
jason: remote fix wrong keycodes for adjust volume
jason: allow download music files (save button on player window)
jason: update group views
Diffstat (limited to 'skins/jason/program.js')
| -rw-r--r-- | skins/jason/program.js | 348 |
1 files changed, 175 insertions, 173 deletions
diff --git a/skins/jason/program.js b/skins/jason/program.js index add763a..2d88fee 100644 --- a/skins/jason/program.js +++ b/skins/jason/program.js @@ -1,7 +1,7 @@ -/*
- * jason - Javascript based skin for xxv
- * Copyright(c) 2008-2009, anbr
- *
+/* + * jason - Javascript based skin for xxv + * Copyright(c) 2008-2010, anbr + * * http://xxv.berlios.de/ * * $Id$ @@ -12,61 +12,62 @@ Ext.xxv.programStore = function(data) { title:data.name ,baseParams:{cmd:'p',data: data.id} ,autoLoad:{params:{start:0, limit:configuration.pageSize}} - ,reader: new Ext.xxv.jsonReader({
- fields: [
+ ,reader: new Ext.xxv.jsonReader({ + fields: [ {name: 'id', type: 'string'} - ,{name: 'title', type: 'string'}
- ,{name: 'subtitle', type: 'string'}
- ,{name: 'start', type: 'string' }
+ ,{name: 'title', type: 'string'} + ,{name: 'subtitle', type: 'string'} + ,{name: 'start', type: 'string' } ,{name: 'stop', type: 'string' } - ,{name: 'day', type:'date', dateFormat:'timestamp'}
+ ,{name: 'day', type:'date', dateFormat:'timestamp'} ,{name: 'description', type: 'string'} ,{name: 'video', type: 'string'} ,{name: 'audio', type: 'string'} - ,{name: 'vps', type:'date', dateFormat:'timestamp'}
+ ,{name: 'vps', type:'date', dateFormat:'timestamp'} ,{name: 'timerid', type: 'string'} ,{name: 'timeractiv', type: 'string'} ,{name: 'running', type: 'string'} ] }), - proxy : new Ext.data.HttpProxy({
- url: XXV.help.baseURL()
- ,method: 'GET'
+ proxy : new Ext.data.HttpProxy({ + url: XXV.help.baseURL() + ,method: 'GET' }), sortInfo:{field:'day', direction:'ASC'}, groupField:'day' }); } -
-Ext.xxv.programGrid = function(viewer, record) {
+ +Ext.xxv.programGrid = function(viewer, record) { this.viewer = viewer; - this.preview = new Ext.xxv.programPreview(viewer);
- //Ext.apply(this, config);
+ this.preview = new Ext.xxv.programPreview(viewer); + //Ext.apply(this, config); // create the data store this.store = new Ext.xxv.programStore(record); - this.store.setDefaultSort('day', "ASC");
-
+ this.store.setDefaultSort('day', "ASC"); + this.columns = [{ - id:'expand'
- ,header: this.szColTitle
- ,dataIndex: 'title'
- ,width: 150
+ id:'expand' + ,header: this.szColTitle + ,dataIndex: 'title' + ,width: 150 ,renderer: { fn: this.viewer.gridNow.formatTitle, scope: this.viewer.gridNow } - },{
header: this.szColDay,
- dataIndex: 'day',
+ },{ + header: this.szColDay, + dataIndex: 'day', width: 50, - hidden: true,
- renderer: Ext.util.Format.dateRenderer(this.szColDayFormat)
- },{
- header: this.szColStart,
- dataIndex: 'start',
- width: 50
- },{
- header: this.szColStop,
- dataIndex: 'stop',
- width: 50
- }];
+ hidden: true, + renderer: Ext.util.Format.dateRenderer(this.szColDayFormat) + },{ + header: this.szColStart, + dataIndex: 'start', + width: 50 + },{ + header: this.szColStop, + dataIndex: 'stop', + width: 50 + }]; var cm = new Ext.grid.ColumnModel(this.columns); cm.defaultSortable = true; @@ -81,20 +82,21 @@ Ext.xxv.programGrid = function(viewer, record) { ,query:'filter' } }); -
- Ext.xxv.programGrid.superclass.constructor.call(this, {
- region: 'center'
- ,id: 'program-grid'
+ + Ext.xxv.programGrid.superclass.constructor.call(this, { + region: 'center' + ,id: 'program-grid' ,loadMask: false ,autoExpandColumn:'expand' - ,cm: cm
- ,sm: new Ext.grid.RowSelectionModel({
- singleSelect:false
- })
- ,view: new Ext.grid.GroupingView({
- enableGroupingMenu:false - ,forceFit:true
- ,showGroupName: false + ,cm: cm + ,sm: new Ext.grid.RowSelectionModel({ + singleSelect:false + }) + ,view: new Ext.grid.GroupingView({ + enableGroupingMenu:false, + forceFit:true, + showGroupName: false, + enableGrouping:true }) ,tbar:new Ext.PagingToolbar({ pageSize: configuration.pageSize @@ -102,26 +104,26 @@ Ext.xxv.programGrid = function(viewer, record) { ,displayInfo: true }) ,plugins:[this.filter] - });
+ }); - this.store.on({
+ this.store.on({ 'load' : this.onLoad - ,'beforeload' : this.onBeforeLoad
- ,'loadexception' : this.onLoadException
- ,scope:this
+ ,'beforeload' : this.onBeforeLoad + ,'loadexception' : this.onLoadException + ,scope:this }); this.on('rowcontextmenu', this.onContextClick, this); this.getSelectionModel().on('rowselect', this.select, this, {buffer:50}); -};
-
-Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, {
+}; + +Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, { szTitle : "Program guide" ,szFindReRun : "Find rerun" ,szRecord : "Record" ,szColTitle : "Title" - ,szColDay : "Day"
- ,szColStart : "Start"
+ ,szColDay : "Day" + ,szColStart : "Start" ,szColStop : "Stop" ,szColDayFormat : "l, m/d/Y" ,szLoadException : "Couldn't get program data!\r\n{0}" @@ -138,53 +140,53 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, { this.getSelectionModel().selectFirstRow(); this.ownerCt.SetPanelTitle(store.title); } - ,onContextClick : function(grid, index, e){
- if(!this.menu){ // create context menu on first right click
- this.menu = new Ext.menu.Menu({
- id:'grid-ctx',
+ ,onContextClick : function(grid, index, e){ + if(!this.menu){ // create context menu on first right click + this.menu = new Ext.menu.Menu({ + id:'grid-ctx', items: [{ - itemId:'s'
- ,text: this.szFindReRun
- ,iconCls: 'find-icon'
+ itemId:'s' + ,text: this.szFindReRun + ,iconCls: 'find-icon' ,scope:this - ,disabled: true
+ ,disabled: true ,handler: function(){ this.viewer.searchTab(this.ctxRecord); } },{ - itemId:'tn'
- ,text: this.szRecord
- ,iconCls: 'record-icon'
+ itemId:'tn' + ,text: this.szRecord + ,iconCls: 'record-icon' ,scope:this - ,disabled: true
+ ,disabled: true ,handler: function(){ this.Record(null); } },{ - itemId:'te'
- ,text: this.viewer.gridNow.szEditTimer
- ,iconCls: 'timer-edit-icon'
+ itemId:'te' + ,text: this.viewer.gridNow.szEditTimer + ,iconCls: 'timer-edit-icon' ,scope:this - ,disabled: true
+ ,disabled: true ,handler: function() { this.EditTimer(this.ctxRecord); } },{ - itemId:'td'
- ,text: this.viewer.gridNow.szDeleteTimer
- ,iconCls: 'timer-delete-icon'
+ itemId:'td' + ,text: this.viewer.gridNow.szDeleteTimer + ,iconCls: 'timer-delete-icon' ,scope:this - ,disabled: true
+ ,disabled: true ,handler: function() { this.DeleteTimer(this.ctxRecord); } } - ]
- });
- this.menu.on('hide', this.onContextHide, this);
- }
- e.stopEvent();
- if(this.ctxRow){
- Ext.fly(this.ctxRow).removeClass('x-node-ctx');
- this.ctxRow = null;
- }
- this.ctxRow = this.view.getRow(index);
- this.ctxRecord = this.store.getAt(index);
- Ext.fly(this.ctxRow).addClass('x-node-ctx');
+ ] + }); + this.menu.on('hide', this.onContextHide, this); + } + e.stopEvent(); + if(this.ctxRow){ + Ext.fly(this.ctxRow).removeClass('x-node-ctx'); + this.ctxRow = null; + } + this.ctxRow = this.view.getRow(index); + this.ctxRecord = this.store.getAt(index); + Ext.fly(this.ctxRow).addClass('x-node-ctx'); var timerid = this.ctxRecord.data.timerid; - var items = this.menu.items;
+ var items = this.menu.items; if(items) { items.eachKey(function(key, f) { if(f.itemId == 'tn') { if(timerid) f.hide(); else f.show(); } else if(f.itemId == 'te') { if(timerid) f.show(); else f.hide(); } @@ -194,32 +196,32 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, { },items); } - this.menu.showAt(e.getXY());
- }
-
- ,onContextHide : function(){
- if(this.ctxRow){
- Ext.fly(this.ctxRow).removeClass('x-node-ctx');
- this.ctxRow = null;
+ this.menu.showAt(e.getXY()); + } + + ,onContextHide : function(){ + if(this.ctxRow){ + Ext.fly(this.ctxRow).removeClass('x-node-ctx'); + this.ctxRow = null; } if(this.menu) { this.menu.destroy(); delete this.menu; this.menu = null; - }
- }
-
+ } + } + ,reload : function(data) { if(this.filter.field.isValid()) { this.filter.field.setValue(''); } this.store.baseParams = { - cmd: 'p'
- ,data: data.id
+ cmd: 'p' + ,data: data.id }; - this.store.title = data.name;
- this.store.load({params:{start:0, limit:configuration.pageSize}});
- }
+ this.store.title = data.name; + this.store.load({params:{start:0, limit:configuration.pageSize}}); + } ,Record : function( record ) { var gsm = this.getSelectionModel(); var sel = gsm.getSelections() @@ -233,7 +235,7 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, { ids += ','; ids += sel[i].data.id; } - this.viewer.RecordID(ids);
+ this.viewer.RecordID(ids); } ,EditTimer : function(record) { this.viewer.gridNow.EditTimer(record, this.store); @@ -258,63 +260,63 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, { } ,select : function(sm, index, record){ this.preview.select(record, this.filter.getValue()); - }
+ } }); Ext.xxv.programPreview = function(viewer) { this.viewer = viewer; - Ext.xxv.programPreview.superclass.constructor.call(this, {
- id: 'program-preview',
- region: 'south',
- cls:'preview',
- autoScroll: true,
- stateful:false,
- tbar: [ {
- id:'s',
- tooltip: Ext.xxv.NowGrid.prototype.szFindReRun,
- iconCls: 'find-icon',
- disabled:true,
- scope: this.viewer,
- handler: function(){ this.searchTab(this.gridProgram.getSelectionModel().getSelected()); }
- } ,{
- id:'tn',
- tooltip: this.viewer.gridNow.szRecord,
- iconCls: 'record-icon',
- disabled:true,
- scope: this.viewer,
- handler: function(){ this.Record(this.gridProgram.getSelectionModel().getSelected()); }
- },{
- id:'te',
- tooltip: this.viewer.gridNow.szEditTimer,
- iconCls: 'timer-edit-icon',
- disabled:true,
- scope: viewer,
+ Ext.xxv.programPreview.superclass.constructor.call(this, { + id: 'program-preview', + region: 'south', + cls:'preview', + autoScroll: true, + stateful:false, + tbar: [ { + id:'s', + tooltip: Ext.xxv.NowGrid.prototype.szFindReRun, + iconCls: 'find-icon', + disabled:true, + scope: this.viewer, + handler: function(){ this.searchTab(this.gridProgram.getSelectionModel().getSelected()); } + } ,{ + id:'tn', + tooltip: this.viewer.gridNow.szRecord, + iconCls: 'record-icon', + disabled:true, + scope: this.viewer, + handler: function(){ this.Record(this.gridProgram.getSelectionModel().getSelected()); } + },{ + id:'te', + tooltip: this.viewer.gridNow.szEditTimer, + iconCls: 'timer-edit-icon', + disabled:true, + scope: viewer, handler: function(){ this.gridProgram.EditTimer(this.gridProgram.getSelectionModel().getSelected()); - }
- },{
- id:'td',
- tooltip: this.viewer.gridNow.szDeleteTimer,
- iconCls: 'timer-delete-icon',
- disabled:true,
- scope: viewer,
+ } + },{ + id:'td', + tooltip: this.viewer.gridNow.szDeleteTimer, + iconCls: 'timer-delete-icon', + disabled:true, + scope: viewer, handler: function(){ this.gridProgram.DeleteTimer(this.gridProgram.getSelectionModel().getSelected()); - }
- } ]
+ } + } ] }); }; Ext.extend(Ext.xxv.programPreview, Ext.Panel, { select : function(record, lookup){ - if(this.body)
+ if(this.body) XXV.getTemplate().overwrite(this.body, record.data); if(lookup) highlightText(this.body.dom,lookup,'x-highlight',1); // Enable all toolbar buttons - var items = this.topToolbar.items;
+ var items = this.topToolbar.items; if(items) { items.eachKey(function(key, f) { if(f.id == 'tn') { if(record.data.timerid) f.hide(); else f.show(); } @@ -323,13 +325,13 @@ Ext.extend(Ext.xxv.programPreview, Ext.Panel, { if(XXV.help.cmdAllowed(key)) f.enable(); },items); } - }
+ } ,clear: function(){ - if(this) {
+ if(this) { if(this.body) - this.body.update('');
+ this.body.update(''); // Disable all items - var items = this.topToolbar.items;
+ var items = this.topToolbar.items; if(items) { items.eachKey(function(key, f){f.disable();},items); } } } @@ -339,34 +341,34 @@ function createProgramView(viewer,id, record) { viewer.gridProgram = new Ext.xxv.programGrid(viewer, record); - var tab = new Ext.xxv.Panel({
+ var tab = new Ext.xxv.Panel({ id:id, - iconCls: 'channel-icon',
+ iconCls: 'channel-icon', layout:'border', - stateful:true,
- closable:true,
- items:[
+ stateful:true, + closable:true, + items:[ viewer.gridProgram, - {
- id:'program-bottom-preview',
- layout:'fit',
- items:XXV.BottomPreview ? 0 : viewer.gridProgram.preview,
- height: 250,
- split: true,
- border:false,
- region:'south',
- hidden:XXV.BottomPreview
- }, {
- id:'program-right-preview',
- layout:'fit',
+ { + id:'program-bottom-preview', + layout:'fit', + items:XXV.BottomPreview ? 0 : viewer.gridProgram.preview, + height: 250, + split: true, + border:false, + region:'south', + hidden:XXV.BottomPreview + }, { + id:'program-right-preview', + layout:'fit', items:XXV.RightPreview ? 0 : viewer.gridProgram.preview, - border:false,
- region:'east',
- width:350,
- split: true,
- hidden:XXV.RightPreview
+ border:false, + region:'east', + width:350, + split: true, + hidden:XXV.RightPreview }] - });
+ }); viewer.add(tab); return tab; |
