]>
git.wh0rd.org - tt-rss.git/blob - functions.js
f33b3970d356307bc325a603b61022f75a69eb4e
1 var hotkeys_enabled
= true;
3 function disableHotkeys() {
4 hotkeys_enabled
= false;
7 function enableHotkeys() {
8 hotkeys_enabled
= true;
11 function notify_callback() {
12 var container
= document
.getElementById('notify');
13 if (xmlhttp
.readyState
== 4) {
14 container
.innerHTML
=xmlhttp
.responseText
;
18 function rpc_notify_callback() {
19 var container
= document
.getElementById('notify');
20 if (xmlhttp_rpc
.readyState
== 4) {
21 container
.innerHTML
=xmlhttp_rpc
.responseText
;
25 function param_escape(arg
) {
26 if (typeof encodeURIComponent
!= 'undefined')
27 return encodeURIComponent(arg
);
32 function param_unescape(arg
) {
33 if (typeof decodeURIComponent
!= 'undefined')
34 return decodeURIComponent(arg
);
41 then
=new Date().getTime();
43 while((now
-then
)<gap
) {
44 now
=new Date().getTime();
48 function notify(msg
) {
50 var n
= document
.getElementById("notify");
54 if (msg
.length
== 0) {
55 n
.style
.display
= "none";
57 n
.style
.display
= "block";
62 function printLockingError() {
63 notify("Please wait until operation finishes");
68 function hotkey_handler(e
) {
72 if (!hotkeys_enabled
) return;
75 keycode
= window
.event
.keyCode
;
80 if (keycode
== 13 || keycode
== 27) {
83 seq
= seq
+ "" + keycode
;
86 var piggie
= document
.getElementById("piggie");
88 if (seq
.match("807371717369")) {
89 localPiggieFunction(true);
91 localPiggieFunction(false);
94 if (typeof localHotkeyHandler
!= 'undefined') {
95 localHotkeyHandler(keycode
);