1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-08 06:55:28 +02:00

popup blocker detection code

This commit is contained in:
Harvey Kandola 2016-05-20 10:16:11 -07:00
parent 434358088d
commit d74a56aac1
2 changed files with 18 additions and 3 deletions

View file

@ -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);
}
}

View file

@ -1,11 +1,11 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
// by contacting <sales@documize.com>.
//
// 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({
});
});
}
});
});