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' name: 'titleBlink'
,type: 'boolean' ,type: 'boolean'
,defaultValue: false ,defaultValue: false
},{
name: 'allow_popups'
,type: 'boolean'
,defaultValue: false
},{ },{
name: 'userAgent' name: 'userAgent'
,type: 'string' ,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.' ,description: 'Gmail, Google\'s free email service, is one of the world\'s most popular email programs.'
,url: 'https://mail.google.com/mail/' ,url: 'https://mail.google.com/mail/'
,type: 'email' ,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}});' ,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>' ,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' ,name: '_Custom Service'
,description: 'Add a custom service if is not listed above.' ,description: 'Add a custom service if is not listed above.'
,type: 'custom' ,type: 'custom'
,allow_popups: true
}, },
{ {
id: 'zinc' id: 'zinc'

11
app/ux/WebView.js

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

Loading…
Cancel
Save