mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update mouse handler
This commit is contained in:
parent
f7c130f1b5
commit
8522ccbafb
2 changed files with 28 additions and 14 deletions
18
dashboard-ui/cordova/iap.js
vendored
18
dashboard-ui/cordova/iap.js
vendored
|
@ -69,11 +69,12 @@
|
||||||
var receipt = product.transaction.appStoreReceipt;
|
var receipt = product.transaction.appStoreReceipt;
|
||||||
var price = product.price;
|
var price = product.price;
|
||||||
|
|
||||||
|
var url = ApiClient.getUrl("Appstore/Register");
|
||||||
|
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
|
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ApiClient.getUrl("Appstore/Register"),
|
url: ApiClient.getUrl("Appstore/Register"),
|
||||||
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
||||||
data: {
|
data: {
|
||||||
Parameters: JSON.stringify({
|
Parameters: JSON.stringify({
|
||||||
store: "Apple",
|
store: "Apple",
|
||||||
|
@ -89,10 +90,13 @@
|
||||||
}
|
}
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
|
|
||||||
|
alert('validate ok');
|
||||||
callback(true, product);
|
callback(true, product);
|
||||||
|
|
||||||
}).fail(function () {
|
}).fail(function (e) {
|
||||||
|
|
||||||
|
alert('validate fail: ' + e.status + ' ' + url);
|
||||||
|
alert(JSON.stringify(e));
|
||||||
callback(false, product);
|
callback(false, product);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -117,9 +121,11 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
store.when(id).verified(function (p) {
|
if (requiresVerification) {
|
||||||
p.finish();
|
store.when(id).verified(function (p) {
|
||||||
});
|
p.finish();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// The play button can only be accessed when the user
|
// The play button can only be accessed when the user
|
||||||
// owns the full version.
|
// owns the full version.
|
||||||
|
@ -128,7 +134,7 @@
|
||||||
if (product.loaded && product.valid && product.state == store.APPROVED) {
|
if (product.loaded && product.valid && product.state == store.APPROVED) {
|
||||||
Logger.log('finishing previously created transaction');
|
Logger.log('finishing previously created transaction');
|
||||||
if (requiresVerification) {
|
if (requiresVerification) {
|
||||||
product.verify();
|
//product.verify();
|
||||||
} else {
|
} else {
|
||||||
product.finish();
|
product.finish();
|
||||||
}
|
}
|
||||||
|
|
|
@ -849,10 +849,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBodyMouseMove() {
|
|
||||||
idleHandler();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onFullScreenChange() {
|
function onFullScreenChange() {
|
||||||
if (self.isFullScreen()) {
|
if (self.isFullScreen()) {
|
||||||
enterFullScreen();
|
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) {
|
function bindEventsForPlayback(mediaRenderer) {
|
||||||
|
|
||||||
var hideElementsOnIdle = true;
|
var hideElementsOnIdle = true;
|
||||||
|
@ -871,7 +879,7 @@
|
||||||
|
|
||||||
var itemVideo = document.querySelector('.itemVideo');
|
var itemVideo = document.querySelector('.itemVideo');
|
||||||
if (itemVideo) {
|
if (itemVideo) {
|
||||||
Events.on(itemVideo, 'mousemove', idleHandler);
|
//Events.on(itemVideo, 'mousemove', onMouseMove);
|
||||||
Events.on(itemVideo, 'keydown', idleHandler);
|
Events.on(itemVideo, 'keydown', idleHandler);
|
||||||
Events.on(itemVideo, 'scroll', idleHandler);
|
Events.on(itemVideo, 'scroll', idleHandler);
|
||||||
Events.on(itemVideo, 'mousedown', idleHandler);
|
Events.on(itemVideo, 'mousedown', idleHandler);
|
||||||
|
@ -887,7 +895,7 @@
|
||||||
$(window).one("popstate", onPopState);
|
$(window).one("popstate", onPopState);
|
||||||
|
|
||||||
if (hideElementsOnIdle) {
|
if (hideElementsOnIdle) {
|
||||||
$(document.body).on("mousemove", onBodyMouseMove);
|
$(document.body).on("mousemove", onMouseMove);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -901,11 +909,11 @@
|
||||||
// Stop playback on browser back button nav
|
// Stop playback on browser back button nav
|
||||||
$(window).off("popstate", onPopState);
|
$(window).off("popstate", onPopState);
|
||||||
|
|
||||||
$(document.body).off("mousemove", onBodyMouseMove);
|
$(document.body).off("mousemove", onMouseMove);
|
||||||
|
|
||||||
var itemVideo = document.querySelector('.itemVideo');
|
var itemVideo = document.querySelector('.itemVideo');
|
||||||
if (itemVideo) {
|
if (itemVideo) {
|
||||||
Events.off(itemVideo, 'mousemove', idleHandler);
|
//Events.off(itemVideo, 'mousemove', onMouseMove);
|
||||||
Events.off(itemVideo, 'keydown', idleHandler);
|
Events.off(itemVideo, 'keydown', idleHandler);
|
||||||
Events.off(itemVideo, 'scroll', idleHandler);
|
Events.off(itemVideo, 'scroll', idleHandler);
|
||||||
Events.off(itemVideo, 'mousedown', idleHandler);
|
Events.off(itemVideo, 'mousedown', idleHandler);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue