|
|
@ -55,28 +55,59 @@ Ext.define('Rambox.ux.WebView',{ |
|
|
|
badgetextchange: me.onBadgeTextChange |
|
|
|
badgetextchange: me.onBadgeTextChange |
|
|
|
} |
|
|
|
} |
|
|
|
,clickEvent: 'dblclick' |
|
|
|
,clickEvent: 'dblclick' |
|
|
|
,menu: [ |
|
|
|
,menu: { |
|
|
|
{ |
|
|
|
plain: true |
|
|
|
text: 'Reload' |
|
|
|
,items: [ |
|
|
|
,glyph: 'xf021@FontAwesome' |
|
|
|
{ |
|
|
|
,scope: me |
|
|
|
xtype: 'toolbar' |
|
|
|
,handler: me.reloadService |
|
|
|
,items: [ |
|
|
|
} |
|
|
|
{ |
|
|
|
,{ |
|
|
|
xtype: 'segmentedbutton' |
|
|
|
text: localStorage.getItem('offline_'+me.id.replace('tab_', '')) ? 'Go Online' : 'Go Offline' |
|
|
|
,allowToggle: false |
|
|
|
,glyph: 'xf0ac@FontAwesome' |
|
|
|
,flex: 1 |
|
|
|
,scope: me |
|
|
|
,items: [ |
|
|
|
,offline: localStorage.getItem('offline_'+me.id.replace('tab_', '')) ? true : false |
|
|
|
{ |
|
|
|
,handler: me.setOffline |
|
|
|
text: 'Back' |
|
|
|
} |
|
|
|
,glyph: 'xf053@FontAwesome' |
|
|
|
,'-' |
|
|
|
,flex: 1 |
|
|
|
,{ |
|
|
|
,scope: me |
|
|
|
text: 'Toggle Developer Tools' |
|
|
|
,handler: me.goBack |
|
|
|
,glyph: 'xf121@FontAwesome' |
|
|
|
} |
|
|
|
,scope: me |
|
|
|
,{ |
|
|
|
,handler: me.toggleDevTools |
|
|
|
text: 'Foward' |
|
|
|
} |
|
|
|
,glyph: 'xf054@FontAwesome' |
|
|
|
] |
|
|
|
,iconAlign: 'right' |
|
|
|
|
|
|
|
,flex: 1 |
|
|
|
|
|
|
|
,scope: me |
|
|
|
|
|
|
|
,handler: me.goForward |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
,'-' |
|
|
|
|
|
|
|
,{ |
|
|
|
|
|
|
|
text: 'Reload' |
|
|
|
|
|
|
|
,glyph: 'xf021@FontAwesome' |
|
|
|
|
|
|
|
,scope: me |
|
|
|
|
|
|
|
,handler: me.reloadService |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
,{ |
|
|
|
|
|
|
|
text: localStorage.getItem('offline_'+me.id.replace('tab_', '')) ? 'Go Online' : 'Go Offline' |
|
|
|
|
|
|
|
,glyph: 'xf0ac@FontAwesome' |
|
|
|
|
|
|
|
,scope: me |
|
|
|
|
|
|
|
,offline: localStorage.getItem('offline_'+me.id.replace('tab_', '')) ? true : false |
|
|
|
|
|
|
|
,handler: me.setOffline |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
,'-' |
|
|
|
|
|
|
|
,{ |
|
|
|
|
|
|
|
text: 'Toggle Developer Tools' |
|
|
|
|
|
|
|
,glyph: 'xf121@FontAwesome' |
|
|
|
|
|
|
|
,scope: me |
|
|
|
|
|
|
|
,handler: me.toggleDevTools |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
,listeners: { |
|
|
|
,listeners: { |
|
|
|
afterrender: me.onAfterRender |
|
|
|
afterrender: me.onAfterRender |
|
|
@ -260,4 +291,18 @@ Ext.define('Rambox.ux.WebView',{ |
|
|
|
btn.setText(Ext.String.toggle(btn.text, 'Go Online', 'Go Offline')); |
|
|
|
btn.setText(Ext.String.toggle(btn.text, 'Go Online', 'Go Offline')); |
|
|
|
btn.offline ? localStorage.setItem('offline_'+me.id.replace('tab_', ''), true) : localStorage.removeItem('offline_'+me.id.replace('tab_', '')); |
|
|
|
btn.offline ? localStorage.setItem('offline_'+me.id.replace('tab_', ''), true) : localStorage.removeItem('offline_'+me.id.replace('tab_', '')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,goBack: function() { |
|
|
|
|
|
|
|
var me = this; |
|
|
|
|
|
|
|
var webview = me.down('component').el.dom; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
webview.goBack(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
,goForward: function() { |
|
|
|
|
|
|
|
var me = this; |
|
|
|
|
|
|
|
var webview = me.down('component').el.dom; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
webview.goForward(); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|