Skip to content

Instantly share code, notes, and snippets.

@marcsolanadal
Created February 15, 2016 15:35
Show Gist options
  • Save marcsolanadal/2b5c2039382ee095261b to your computer and use it in GitHub Desktop.
Save marcsolanadal/2b5c2039382ee095261b to your computer and use it in GitHub Desktop.
showLicenseConditions: function (firstAcc) {
var self = this;
Hybreed.UI.showSpinner();
if (firstAcc) {
navigator.silkUA.checkUserAgreement(this.language, function (res) {
console.log('<Controller.js> language: ' + res);
Hybreed.UI.hideSpinner();
Broker.reqres.request("dbManager:setFirstAccess", {firstAccess: 0})
.then(function () {
Hybreed.UI.hideSpinner();
self.showLoginView();
});
}, function (err) {
console.log(err);
});
} else {
navigator.silkUA.showUserAgreement(this.language, function(html) {
console.log(html);
var wnd = window.open("about:blank","_blank","directories=no,status=no,menubar=no,scrollbars=no,resizable=no,EnableViewPortScale=yes");
wnd.addEventListener("loadstop", function(res) {
console.log(res);
alert("Before write");
wnd.executeScript({ code: 'document.write(' + html + ');' });
alert("after write");
Hybreed.UI.hideSpinner();
});
}, function(err) {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment