diff --git a/mobile/functions.php b/mobile/functions.php
index 606a42a2f..e5904d7b2 100644
--- a/mobile/functions.php
+++ b/mobile/functions.php
@@ -468,7 +468,7 @@
print "";
print "";
- print "
";
+ print "";
$page_art_ids = array();
@@ -529,8 +529,8 @@
print "- ";
- print "";
+ print "";
print "$marked_pic";
print "$published_pic";
@@ -559,13 +559,21 @@
/* print "Page, ";
print "Feed"; */
+ print "Select:
+ All,
+ Unread,
+ None,
+ Invert";
+
+ print " ";
+
print "
- ";
+ ";
print "";
diff --git a/mobile/tt-rss.js b/mobile/tt-rss.js
index 942122c7a..599e00725 100644
--- a/mobile/tt-rss.js
+++ b/mobile/tt-rss.js
@@ -1,16 +1,94 @@
function toggleSelectRow(cb, id) {
- var row = document.getElementById("HROW-" + id);
- var checked = cb.checked;
- if (row) {
- var unread = row.className.match("Unread");
- var new_classname = row.className;
+ try {
- new_classname = new_classname.replace("Selected", "");
- new_classname = new_classname.replace("Unread", "");
+ var row = document.getElementById("HROW-" + id);
+ var checked = cb.checked;
+ if (row) {
+ var unread = row.className.match("Unread");
+ var new_classname = row.className;
- if (unread) new_classname = new_classname + "Unread";
- if (checked) new_classname = new_classname + "Selected";
+ new_classname = new_classname.replace("Selected", "");
+ new_classname = new_classname.replace("Unread", "");
- row.className = new_classname;
+ if (unread) new_classname = new_classname + "Unread";
+ if (checked) new_classname = new_classname + "Selected";
+
+ row.className = new_classname;
+ }
+ } catch (e) {
+ exception_error("toggleSelectRow", e);
}
}
+
+function selectHeadlines(mode) {
+ try {
+
+ var cboxes = document.getElementsByTagName("INPUT");
+
+ for (var i = 0; i < cboxes.length; i++) {
+ if (cboxes[i].id && cboxes[i].id.match("HSCB-")) {
+ var row_id = cboxes[i].id.replace("HSCB-", "")
+ var row = document.getElementById("HROW-" + row_id);
+
+ if (row) {
+
+ if (mode == 1) {
+ cboxes[i].checked = true;
+ toggleSelectRow(cboxes[i], row_id);
+ }
+
+ if (mode == 2) {
+
+ var unread = row.className.match("Unread");
+
+ if (unread) {
+ cboxes[i].checked = true;
+ } else {
+ cboxes[i].checked = false;
+ }
+ }
+
+ if (mode == 3) {
+ cboxes[i].checked = false;
+ }
+
+ if (mode == 4) {
+ cboxes[i].checked = !cboxes[i].checked;
+ }
+
+ toggleSelectRow(cboxes[i], row_id);
+
+ }
+
+ }
+
+ }
+
+ } catch (e) {
+ exception_error("selectHeadlines", e);
+ }
+}
+
+function exception_error(location, e, silent) {
+ var msg;
+
+ if (e.fileName) {
+ var base_fname = e.fileName.substring(e.fileName.lastIndexOf("/") + 1);
+
+ msg = "Exception: " + e.name + ", " + e.message +
+ "\nFunction: " + location + "()" +
+ "\nLocation: " + base_fname + ":" + e.lineNumber;
+
+ } else if (e.description) {
+ msg = "Exception: " + e.description + "\nFunction: " + location + "()";
+ } else {
+ msg = "Exception: " + e + "\nFunction: " + location + "()";
+ }
+
+ debug("EXCEPTION: " + msg + "");
+
+ if (!silent) {
+ alert(msg);
+ }
+}
+