summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2009-01-11 21:12:30 +0000
committerAndreas Brachold <vdr07@deltab.de>2009-01-11 21:12:30 +0000
commit865ca429d1cb9be7b040797aad3df2f943fa65c3 (patch)
treeeca910c75e5c9ec2e852baca35fe2db5bf18924e
parentf41270e16f2c1f2fe823393d37f74cea567d75a3 (diff)
downloadxxv-865ca429d1cb9be7b040797aad3df2f943fa65c3.tar.gz
xxv-865ca429d1cb9be7b040797aad3df2f943fa65c3.tar.bz2
Skins/jason: use browser history, if tab panel changed
-rw-r--r--skins/jason/index.tmpl7
-rw-r--r--skins/jason/main.js13
-rw-r--r--skins/jason/menus.js21
-rw-r--r--skins/jason/tabpanel.js78
4 files changed, 56 insertions, 63 deletions
diff --git a/skins/jason/index.tmpl b/skins/jason/index.tmpl
index cfc6d71..13be842 100644
--- a/skins/jason/index.tmpl
+++ b/skins/jason/index.tmpl
@@ -62,7 +62,12 @@
<script type="text/javascript" src="extjs/locale/ext-lang-<?% lang.0 %?>.js"></script>
<script type="text/javascript" src="locale/lang-<?% lang.0 %?>.js"></script>
<?% END %?>
-<!-- Template used for EPG Items -->
+<?% # Fields required for history management %?>
+<form id="history-form" class="x-hidden">
+ <input type="hidden" id="x-history-field" />
+ <iframe id="x-history-frame"></iframe>
+</form>
+<?% # Template used for EPG Items %?>
<div id="preview-tpl" style="display:none;">
<div class="preview-header">
<h3 class="preview-title">{content:this.getTitle}</h3><div class="preview-channel">{content:this.getChannel}</div>
diff --git a/skins/jason/main.js b/skins/jason/main.js
index a385bf6..8e4a549 100644
--- a/skins/jason/main.js
+++ b/skins/jason/main.js
@@ -21,6 +21,8 @@ Ext.onReady(function(){
// state: Ext.appState,
expires: new Date(new Date().getTime()+(1000*3600*24*365))
}));
+
+ Ext.History.init();
var tpl = Ext.Template.from('preview-tpl', {
compiled:true
@@ -77,8 +79,17 @@ Ext.onReady(function(){
]
});
+ // Handle this change event in order to restore the UI to the appropriate history state
+ Ext.History.on('change', function(token){
+ if(!token){
+ token = 'n';
+ }
+ XXV.tab.openTab(token);
+ });
+
XXV.tab.on('tabchange', function(tp, tab){
Ext.xxv.Panel.prototype.DocumentTitle(tab.title);
+ Ext.History.add(tab.id);
});
XXV.viewport.doLayout();
@@ -87,4 +98,6 @@ Ext.onReady(function(){
Ext.get('loading').remove();
Ext.get('loading-mask').fadeOut({remove:true});
}, 250);
+
+
});
diff --git a/skins/jason/menus.js b/skins/jason/menus.js
index d97406c..5809c93 100644
--- a/skins/jason/menus.js
+++ b/skins/jason/menus.js
@@ -53,15 +53,15 @@ Ext.xxv.MainMenu = function(/*config*/){
,menu: XXV.configMenu
},'-',{
text: Ext.xxv.movetimersGrid.prototype.szTitle,
- handler: function() { XXV.tab.MoveTimers(); },
+ handler: function() { XXV.tab.openTab('mtl'); },
iconCls:"movetimers-icon"
},{
text: Ext.xxv.vdrGrid.prototype.szTitle,
- handler: function() { XXV.tab.openVDRList(); },
+ handler: function() { XXV.tab.openTab('vl'); },
iconCls:"vdr-icon"
},{
text: Ext.xxv.usersGrid.prototype.szTitle,
- handler: function() { XXV.tab.openUsersList(); },
+ handler: function() { XXV.tab.openTab('ul'); },
iconCls:"users-icon"
}
]
@@ -90,12 +90,12 @@ Ext.xxv.MainMenu = function(/*config*/){
items:[
{
text: Ext.xxv.autotimerGrid.prototype.szTitle,
- handler: function() { XXV.tab.openAutoTimer(); },
+ handler: function() { XXV.tab.openTab('al'); },
iconCls:"autotimer-icon"
},
{
text: Ext.xxv.timerGrid.prototype.szTitle,
- handler: function() { XXV.tab.openTimer(); },
+ handler: function() { XXV.tab.openTab('tl'); },
iconCls:"timer-icon"
}
]
@@ -106,19 +106,24 @@ Ext.xxv.MainMenu = function(/*config*/){
items:[
{
text: Ext.xxv.recordingsDataView.prototype.szTitle,
- handler: function() { XXV.tab.openRecordings(); },
+ handler: function() { XXV.tab.openTab('rl'); },
iconCls:"recordings-icon"
}
,{
text: Ext.xxv.chronicleGrid.prototype.szTitle,
- handler: function() { XXV.tab.openChronicle(); },
+ handler: function() { XXV.tab.openTab('chrl'); },
iconCls:"chronicle-icon"
}
/*,{
text: Ext.xxv.musicDataView.prototype.szTitle,
- handler: function() { XXV.tab.openMusic(); },
+ handler: function() { XXV.tab.openTab('ml'); },
iconCls:"audio-icon",
disabled:true
+ },{
+ text: Ext.xxv.mediaDataView.prototype.szTitle,
+ handler: function() { XXV.tab.openTab('mll'); },
+ iconCls:"media-icon",
+ disabled:true
}*/
]
});
diff --git a/skins/jason/tabpanel.js b/skins/jason/tabpanel.js
index 358b538..fa56ce3 100644
--- a/skins/jason/tabpanel.js
+++ b/skins/jason/tabpanel.js
@@ -112,12 +112,13 @@ Ext.extend(Ext.xxv.tabPanel, Ext.TabPanel, {
Ext.state.Manager.set('preview-layout', m.iconCls);
}
}
- }
+ }
+
,openNow : function(){
var id = 'n';
var tab;
if(!(tab = this.getItem(id))){
- tab = creatNowView(this,'n');
+ tab = this.createTab(id);
} else {
tab.LoadTitle();
this.gridNow.reload();
@@ -134,38 +135,6 @@ Ext.extend(Ext.xxv.tabPanel, Ext.TabPanel, {
this.gridProgram.reload(data);
}
this.setActiveTab(tab);
- }
- ,openAutoTimer : function(){
- var id = 'al';
- var tab;
- if(!(tab = this.getItem(id))){
- tab = createAutoTimerView(this,id);
- }
- this.setActiveTab(tab);
- }
- ,openTimer : function(){
- var id = 'tl';
- var tab;
- if(!(tab = this.getItem(id))){
- tab = createTimerView(this,id);
- }
- this.setActiveTab(tab);
- }
- ,openRecordings : function(){
- var id = 'rl';
- var tab;
- if(!(tab = this.getItem(id))){
- tab = createRecordingsView(this,id);
- }
- this.setActiveTab(tab);
- }
- ,openChronicle : function(){
- var id = 'chrl';
- var tab;
- if(!(tab = this.getItem(id))){
- tab = createChronicleView(this,id);
- }
- this.setActiveTab(tab);
}
,openSearch : function(lookup){
var id = 's';
@@ -193,28 +162,29 @@ Ext.extend(Ext.xxv.tabPanel, Ext.TabPanel, {
if(!id) return;
this.gridNow.RecordID(id);
}
- ,MoveTimers : function(){
- var id = 'mtl';
- var tab;
- if(!(tab = this.getItem(id))){
- tab = createMoveTimersView(this,id);
- }
- this.setActiveTab(tab);
- }
- ,openVDRList : function(){
- var id = 'vl';
+
+ ,openTab : function(id){
var tab;
if(!(tab = this.getItem(id))){
- tab = createVDRView(this,id);
+ tab = this.createTab(id);
}
- this.setActiveTab(tab);
+ if(tab)
+ this.setActiveTab(tab);
+ this.show()
}
- ,openUsersList : function(){
- var id = 'ul';
- var tab;
- if(!(tab = this.getItem(id))){
- tab = createUsersView(this,id);
- }
- this.setActiveTab(tab);
- }
+
+ ,createTab : function(id){
+ switch(id){
+ case 'n': return creatNowView(this,id);
+ case 'al': return createAutoTimerView(this,id);
+ case 'tl': return createTimerView(this,id);
+ case 'rl': return createRecordingsView(this,id);
+ case 'chrl': return createChronicleView(this,id);
+ case 'mtl': return createMoveTimersView(this,id);
+ case 'vl': return createVDRView(this,id);
+ case 'ul': return createUsersView(this,id);
+ }
+
+ return 0;
+ }
});