Browse Source

Fixes #308

pull/347/head
Ramiro Saenz 9 years ago
parent
commit
e90b3b543c
  1. 4
      app/model/ServiceList.js
  2. 2
      app/store/ServicesList.js
  3. 11
      app/ux/WebView.js

4
app/model/ServiceList.js

@ -27,6 +27,10 @@ Ext.define('Rambox.model.ServiceList', {
name: 'titleBlink'
,type: 'boolean'
,defaultValue: false
},{
name: 'allow_popups'
,type: 'boolean'
,defaultValue: false
},{
name: 'userAgent'
,type: 'string'

2
app/store/ServicesList.js

@ -110,6 +110,7 @@ Ext.define('Rambox.store.ServicesList', {
,description: 'Gmail, Google\'s free email service, is one of the world\'s most popular email programs.'
,url: 'https://mail.google.com/mail/'
,type: 'email'
,allow_popups: true
,js_unread: 'Object.defineProperty(document,"title",{configurable:!0,set:function(a){var b=document.getElementsByClassName("aim")[0];t=0,b.textContent.indexOf("(")!=-1&&(t=parseInt(b.textContent.replace(/[^0-9]/g,""))),document.getElementsByTagName("title")[0].innerHTML="("+t+") Gmail"},get:function(){return document.getElementsByTagName("title")[0].innerHTML}});'
,note: 'To enable desktop notifications, you have to go to Settings inside Gmail. <a href="https://support.google.com/mail/answer/1075549?ref_topic=3394466" target="_blank">Read more...</a>'
},
@ -352,6 +353,7 @@ Ext.define('Rambox.store.ServicesList', {
,name: '_Custom Service'
,description: 'Add a custom service if is not listed above.'
,type: 'custom'
,allow_popups: true
},
{
id: 'zinc'

11
app/ux/WebView.js

@ -124,15 +124,16 @@ Ext.define('Rambox.ux.WebView',{
,webViewConstructor: function(enabled) {
var me = this;
var cfg;
if ( !enabled ) {
return {
cfg = {
xtype: 'container'
,html: '<h3>Service Disabled</h3>'
,style: 'text-align:center;'
,padding: 100
};
} else {
return {
cfg = {
xtype: 'component'
,hideMode: 'offsets'
,autoRender: true
@ -145,13 +146,16 @@ Ext.define('Rambox.ux.WebView',{
,plugins: 'true'
,allowtransparency: 'on'
,autosize: 'on'
,allowpopups: 'on'
,disablewebsecurity: 'on'
,blinkfeatures: 'ApplicationCache,GlobalCacheStorage'
,useragent: Ext.getStore('ServicesList').getById(me.type).get('userAgent')
}
};
if ( Ext.getStore('ServicesList').getById(me.type).get('allow_popups') ) cfg.autoEl.allowpopups = 'on';
}
return cfg;
}
,onBadgeTextChange: function( tab, badgeText, oldBadgeText ) {
@ -194,6 +198,7 @@ Ext.define('Rambox.ux.WebView',{
// Open links in default browser
webview.addEventListener('new-window', function(e) {
console.log('new-window', e);
switch ( me.type ) {
case 'skype':
// hack to fix multiple browser tabs on Skype link click, re #11

Loading…
Cancel
Save