Skip to content

Commit

Permalink
v2.3.2
Browse files Browse the repository at this point in the history
Backlog
  • Loading branch information
ccz-2 committed Mar 10, 2020
1 parent cab54ac commit 92e387a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 26 deletions.
Binary file modified NDFS.ankiaddon
Binary file not shown.
2 changes: 1 addition & 1 deletion NDFullScreen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//No Distractions Full Screen v2.3
//No Distractions Full Screen v2.3.2
//var op = .5; //Defined in python
console.log("appended")
$('head').append(`
Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# No Distractions Full Screen
# v2.3 2/9/2020
# v2.3.2 2/10/2020
# Copyright (c) 2020 Quip13 ([email protected])
#
# MIT License
Expand Down
60 changes: 36 additions & 24 deletions hide_cursor.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
//No Distractions Full Screen v2.3
//No Distractions Full Screen v2.3.2
//var cursorIdleTimer = 5000; //Defined in python

var cursorHidden = false;

function hide_mouse() {
pycmd("cursor_hide");
console.log("cursor_hide");
//$('*').css({cursor: 'none'});
cursorHidden = true;
}

function show_mouse() {
pycmd("cursor_show");
console.log("cursor_show");
//$('*').css({cursor: 'default'});
cursorHidden = false;
}

$(function hide_cursor() {
if (cursorIdleTimer >= 0){
var cursorHidden = false;
var timer = setTimeout(function () {
//$('*').css({cursor: 'none'});
pycmd("cursor_hide");
console.log("cursor_hide");
cursorHidden = true;
}, cursorIdleTimer);
$(document).mousemove(function () {
clearTimeout(timer);
timer = setTimeout(function () {
//$('*').css({cursor: 'none'});
pycmd("cursor_hide");
console.log("cursor_hide");
cursorHidden = true;
}, cursorIdleTimer);
if (cursorIdleTimer >= 0) {
var currentTime = Date.now();
var lastTime = currentTime;
var timer = setTimeout(function(){hide_mouse();}, cursorIdleTimer);

pycmd("cursor_show");
console.log("cursor_show");
cursorHidden = false;
return
});
}
});
$(document).mousemove(function() {
currentTime = Date.now();
if (cursorHidden){
show_mouse();
} else if (currentTime - lastTime > 500) {
show_mouse();
clearTimeout(timer);
timer = setTimeout(function(){hide_mouse();}, cursorIdleTimer);
lastTime = currentTime;
}
//console.log("skip");
});
}
});

0 comments on commit 92e387a

Please sign in to comment.