]> git.wh0rd.org Git - tt-rss.git/commitdiff
Revert "headlines buffer: remove dijit-based RCHK elements"
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Feb 2013 11:48:09 +0000 (15:48 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 28 Feb 2013 11:48:09 +0000 (15:48 +0400)
This reverts commit f7945c99d0495f5b2e0e789d99e32b1e121ae1cf.

classes/feeds.php
js/functions.js
js/tt-rss.js
js/viewfeed.js

index 77366deec3b8dfbb3bdca49a7ef5a036e34efb34..0f2bbf31e9f296556da4e13bb9e65f86e6d28c9c 100644 (file)
@@ -417,8 +417,8 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<div class='hlLeft'>";
 
-                                       $reply['content'] .= "<input
-                                                       type=\"checkbox\" onclick=\"toggleSelectRow(this)\"
+                                       $reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
+                                                       type=\"checkbox\" onclick=\"toggleSelectRow2(this)\"
                                                        id=\"RCHK-$id\">";
 
                                        $reply['content'] .= "$marked_pic";
@@ -520,8 +520,8 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<div>";
 
-                                       $reply['content'] .= "<input
-                                                       type=\"checkbox\" onclick=\"toggleSelectRow(this, false, true)\"
+                                       $reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
+                                                       type=\"checkbox\" onclick=\"toggleSelectRow2(this, false, true)\"
                                                        id=\"RCHK-$id\">";
 
                                        $reply['content'] .= "$marked_pic";
index 175a00fc708653b070c3747441a6e19512a253f3..be12d257aab85bc149e9e80826b76d18a1df8a2f 100644 (file)
@@ -366,13 +366,9 @@ function toggleSelectRow2(sender, row, is_cdm) {
 }
 
 
-function toggleSelectRow(sender, row, is_cdm) {
+function toggleSelectRow(sender, row) {
 
-       if (!row)
-               if (!is_cdm)
-                       row = sender.parentNode.parentNode;
-               else
-                       row = sender.parentNode.parentNode.parentNode;
+       if (!row) row = sender.parentNode.parentNode;
 
        if (sender.checked && !row.hasClassName('Selected'))
                row.addClassName('Selected');
index e47d5878a06f80dcfce9612c9d9c22b71d7aa008..9814718f09aeef03857beb0de98322ea9032fceb 100644 (file)
@@ -737,9 +737,9 @@ function hotkey_handler(e) {
                case "select_article_cursor":
                        var id = getArticleUnderPointer();
                        if (id) {
-                               var cb = $("RCHK-" + id)
+                               var cb = dijit.byId("RCHK-" + id);
                                if (cb) {
-                                       cb.checked = !cb.checked;
+                                       cb.attr("checked", !cb.attr("checked"));
                                        toggleSelectRowById(cb, "RROW-" + id);
                                        return false;
                                }
index a907a05d6be89460f389ca472bb1f7bfde4ede7e..6c25f6eeb21a66325f941ae7ab26edd0f350f3be 100644 (file)
@@ -162,7 +162,11 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
                                        initHeadlinesMenu();
 
                                        new_elems.each(function(child) {
-                                               if (!$("RCHK-" + child.id.replace("RROW-", "RCHK-"))) {
+                                               var cb = dijit.byId(child.id.replace("RROW-", "RCHK-"));
+
+                                               if (!cb) {
+                                                       dojo.parser.parse(child);
+
                                                        if (!Element.visible(child))
                                                                new Effect.Appear(child, { duration : 0.5 });
                                                } else {
@@ -212,7 +216,6 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 
                _infscroll_request_sent = 0;
 
-
                notify("");
 
        } catch (e) {
@@ -602,16 +605,16 @@ function moveToPost(mode, noscroll) {
 function toggleSelected(id, force_on) {
        try {
 
-               var cb = $("RCHK-" + id);
+               var cb = dijit.byId("RCHK-" + id);
                var row = $("RROW-" + id);
 
                if (row) {
                        if (row.hasClassName('Selected') && !force_on) {
                                row.removeClassName('Selected');
-                               if (cb) cb.checked = false;
+                               if (cb) cb.attr("checked", false);
                        } else {
                                row.addClassName('Selected');
-                               if (cb) cb.checked = true;
+                               if (cb) cb.attr("checked", true);
                        }
                }
        } catch (e) {
@@ -897,52 +900,52 @@ function selectArticles(mode) {
 
                children.each(function(child) {
                        var id = child.id.replace("RROW-", "");
-                       var cb = $("RCHK-" + id);
+                       var cb = dijit.byId("RCHK-" + id);
 
                        if (mode == "all") {
                                child.addClassName("Selected");
-                               if (cb) cb.checked= true;
+                               if (cb) cb.attr("checked", true);
                        } else if (mode == "unread") {
                                if (child.hasClassName("Unread")) {
                                        child.addClassName("Selected");
-                                       if (cb) cb.checked = true;
+                                       if (cb) cb.attr("checked", true);
                                } else {
                                        child.removeClassName("Selected");
-                                       if (cb) cb.checked = false;
+                                       if (cb) cb.attr("checked", false);
                                }
                        } else if (mode == "marked") {
                                var img = $("FMPIC-" + child.id.replace("RROW-", ""));
 
                                if (img && img.src.match("mark_set")) {
                                        child.addClassName("Selected");
-                                       if (cb) cb.checked = true;
+                                       if (cb) cb.attr("checked", true);
                                } else {
                                        child.removeClassName("Selected");
-                                       if (cb) cb.checked = false;
+                                       if (cb) cb.attr("checked", false);
                                }
                        } else if (mode == "published") {
                                var img = $("FPPIC-" + child.id.replace("RROW-", ""));
 
                                if (img && img.src.match("pub_set")) {
                                        child.addClassName("Selected");
-                                       if (cb) cb.checked = true;
+                                       if (cb) cb.attr("checked", true);
                                } else {
                                        child.removeClassName("Selected");
-                                       if (cb) cb.checked = false;
+                                       if (cb) cb.attr("checked", false);
                                }
 
                        } else if (mode == "invert") {
                                if (child.hasClassName("Selected")) {
                                        child.removeClassName("Selected");
-                                       if (cb) cb.checked = false;
+                                       if (cb) cb.attr("checked", false);
                                } else {
                                        child.addClassName("Selected");
-                                       if (cb) cb.checked = true;
+                                       if (cb) cb.attr("checked", true);
                                }
 
                        } else {
                                child.removeClassName("Selected");
-                               if (cb) cb.checked = false;
+                               if (cb) cb.attr("checked", false);
                        }
                });
 
@@ -1633,10 +1636,10 @@ function isCdmMode() {
 function markHeadline(id) {
        var row = $("RROW-" + id);
        if (row) {
-               var check = $("RCHK-" + id);
+               var check = dijit.byId("RCHK-" + id);
 
                if (check) {
-                       check.checked = true;
+                       check.attr("checked", true);
                }
 
                row.addClassName("Selected");