From d74a56aac1cb0f621ef0513b4b3e0aef2ae52cd0 Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Fri, 20 May 2016 10:16:11 -0700 Subject: [PATCH] popup blocker detection code --- app/app/components/document/page-wizard.js | 6 ++++++ app/app/services/session.js | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/app/components/document/page-wizard.js b/app/app/components/document/page-wizard.js index f9b79069..e70dc5a7 100644 --- a/app/app/components/document/page-wizard.js +++ b/app/app/components/document/page-wizard.js @@ -34,6 +34,10 @@ export default Ember.Component.extend(NotifierMixin, { }); this.set("sections", sections); + + if (this.session.get('popupBlocked')) { + this.showNotification("Hmm, looks like your browser is blocking popups..."); + } }, onCancel() { @@ -55,6 +59,8 @@ export default Ember.Component.extend(NotifierMixin, { return; } + this.audit.record('added section' + section.contentType); + this.attrs.onAction(title, contentType); } } diff --git a/app/app/services/session.js b/app/app/services/session.js index 45599421..f1ab0d48 100644 --- a/app/app/services/session.js +++ b/app/app/services/session.js @@ -1,11 +1,11 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com @@ -183,6 +183,15 @@ export default Ember.Service.extend({ }); } + var blockedPopupTest = window.open("http://d27wjpa4h6c9yx.cloudfront.net/", "directories=no,height=1,width=1,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,top=0,location=no"); + + if (!blockedPopupTest) { + this.set('popupBlocked', true); + } else { + blockedPopupTest.close(); + this.set('popupBlocked', false); + } + return new Ember.RSVP.Promise(function(resolve) { $.ajax({ url: self.get('appMeta').getUrl("public/meta"), @@ -230,4 +239,4 @@ export default Ember.Service.extend({ }); }); } -}); \ No newline at end of file +});