1 var hotkeys_enabled = true;
3 function disableHotkeys() {
4 hotkeys_enabled = false;
7 function enableHotkeys() {
8 hotkeys_enabled = true;
11 function xmlhttp_ready(obj) {
12 return obj.readyState == 4 || obj.readyState == 0 || !obj.readyState;
16 function notify_callback() {
17 var container = document.getElementById('notify');
18 if (xmlhttp.readyState == 4) {
19 container.innerHTML=xmlhttp.responseText;
23 function rpc_notify_callback() {
24 var container = document.getElementById('notify');
25 if (xmlhttp_rpc.readyState == 4) {
26 container.innerHTML=xmlhttp_rpc.responseText;
30 function param_escape(arg) {
31 if (typeof encodeURIComponent != 'undefined')
32 return encodeURIComponent(arg);
37 function param_unescape(arg) {
38 if (typeof decodeURIComponent != 'undefined')
39 return decodeURIComponent(arg);
46 then=new Date().getTime();
48 while((now-then)<gap) {
49 now=new Date().getTime();
53 function notify(msg) {
55 var n = document.getElementById("notify");
61 if (msg.length == 0) {
62 n.style.display = "none";
64 n.style.display = "block";
69 function printLockingError() {
70 notify("Please wait until operation finishes");}
74 function hotkey_handler(e) {
78 if (!hotkeys_enabled) return;
81 keycode = window.event.keyCode;
86 if (keycode == 13 || keycode == 27) {
89 seq = seq + "" + keycode;
92 var piggie = document.getElementById("piggie");
96 if (seq.match("807371717369")) {
97 localPiggieFunction(true);
99 localPiggieFunction(false);
103 if (typeof localHotkeyHandler != 'undefined') {
104 localHotkeyHandler(keycode);
109 function cleanSelected(element) {
110 var content = document.getElementById(element);
112 var rows = new Array();
114 for (i = 0; i < content.rows.length; i++) {
115 content.rows[i].className = content.rows[i].className.replace("Selected", "");
120 function getVisibleUnreadHeadlines() {
121 var content = document.getElementById("headlinesList");
123 var rows = new Array();
125 for (i = 0; i < content.rows.length; i++) {
126 var row_id = content.rows[i].id.replace("RROW-", "");
127 if (row_id.length > 0 && content.rows[i].className.match("Unread")) {
134 function getVisibleHeadlineIds() {
136 var content = document.getElementById("headlinesList");
138 var rows = new Array();
140 for (i = 0; i < content.rows.length; i++) {
141 var row_id = content.rows[i].id.replace("RROW-", "");
142 if (row_id.length > 0) {
149 function getFirstVisibleHeadlineId() {
150 var rows = getVisibleHeadlineIds();
154 function getLastVisibleHeadlineId() {
155 var rows = getVisibleHeadlineIds();
156 return rows[rows.length-1];
159 function markHeadline(id) {
160 var row = document.getElementById("RROW-" + id);
162 row.className = row.className + "Selected";
166 function getFeedIds() {
167 var content = document.getElementById("feedsList");
169 var rows = new Array();
171 for (i = 0; i < content.rows.length; i++) {
172 var id = content.rows[i].id.replace("FEEDR-", "");