update mouse handler

This commit is contained in:
Luke Pulverenti 2015-10-23 12:04:33 -04:00
parent f7c130f1b5
commit 8522ccbafb
2 changed files with 28 additions and 14 deletions

View File

@ -69,11 +69,12 @@
var receipt = product.transaction.appStoreReceipt;
var price = product.price;
var url = ApiClient.getUrl("Appstore/Register");
ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl("Appstore/Register"),
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
data: {
Parameters: JSON.stringify({
store: "Apple",
@ -89,10 +90,13 @@
}
}).done(function () {
alert('validate ok');
callback(true, product);
}).fail(function () {
}).fail(function (e) {
alert('validate fail: ' + e.status + ' ' + url);
alert(JSON.stringify(e));
callback(false, product);
});
}
@ -117,9 +121,11 @@
}
});
store.when(id).verified(function (p) {
p.finish();
});
if (requiresVerification) {
store.when(id).verified(function (p) {
p.finish();
});
}
// The play button can only be accessed when the user
// owns the full version.
@ -128,7 +134,7 @@
if (product.loaded && product.valid && product.state == store.APPROVED) {
Logger.log('finishing previously created transaction');
if (requiresVerification) {
product.verify();
//product.verify();
} else {
product.finish();
}

View File

@ -849,10 +849,6 @@
return;
}
function onBodyMouseMove() {
idleHandler();
}
function onFullScreenChange() {
if (self.isFullScreen()) {
enterFullScreen();
@ -863,6 +859,18 @@
}
}
var lastMousePosition = {};
function onMouseMove(evt) {
if (evt.clientX == lastMousePosition.x && evt.clientY == lastMousePosition.y) {
return;
}
lastMousePosition.x = evt.clientX;
lastMousePosition.y = evt.clientY;
idleHandler();
}
function bindEventsForPlayback(mediaRenderer) {
var hideElementsOnIdle = true;
@ -871,7 +879,7 @@
var itemVideo = document.querySelector('.itemVideo');
if (itemVideo) {
Events.on(itemVideo, 'mousemove', idleHandler);
//Events.on(itemVideo, 'mousemove', onMouseMove);
Events.on(itemVideo, 'keydown', idleHandler);
Events.on(itemVideo, 'scroll', idleHandler);
Events.on(itemVideo, 'mousedown', idleHandler);
@ -887,7 +895,7 @@
$(window).one("popstate", onPopState);
if (hideElementsOnIdle) {
$(document.body).on("mousemove", onBodyMouseMove);
$(document.body).on("mousemove", onMouseMove);
}
}
@ -901,11 +909,11 @@
// Stop playback on browser back button nav
$(window).off("popstate", onPopState);
$(document.body).off("mousemove", onBodyMouseMove);
$(document.body).off("mousemove", onMouseMove);
var itemVideo = document.querySelector('.itemVideo');
if (itemVideo) {
Events.off(itemVideo, 'mousemove', idleHandler);
//Events.off(itemVideo, 'mousemove', onMouseMove);
Events.off(itemVideo, 'keydown', idleHandler);
Events.off(itemVideo, 'scroll', idleHandler);
Events.off(itemVideo, 'mousedown', idleHandler);