]> git.wh0rd.org Git - tt-rss.git/commitdiff
batch feed editor: add workaround for Form.serialize() ignoring unchecked checkboxes
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 11 Sep 2008 06:45:39 +0000 (07:45 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 11 Sep 2008 06:45:39 +0000 (07:45 +0100)
modules/pref-feeds.php
prefs.js

index 5220219177d3aba40316bdf393cf994d6c9359c8..24996eea9c4bc9376f1a01569ae6c4605978f87d 100644 (file)
                                                        $qpart = "include_in_digest = '$include_in_digest'";
                                                        break;
 
+                                               case "cache_images":
+                                                       $qpart = "cache_images = '$cache_images'";
+                                                       break;
+
+                                               case "rtl_content":
+                                                       $qpart = "rtl_content = '$rtl_content'";
+                                                       break;
+
                                                case "update_method":
                                                        $qpart = "update_method = '$update_method'";
                                                        break;
index 72b72fcbac755ecedfd28aa157ca7d754c7d3f9e..2f8ca4c3be35a477101ad42f0a99e75ae3fd3f9b 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -2250,11 +2250,41 @@ function feedsEditSave() {
                        return
                }
 
-               var ok = confirm(__("Save changes to selected feeds?"));
+//             var ok = confirm(__("Save changes to selected feeds?"));
+               var ok = true;
 
                if (ok) {
 
+                       var f = document.forms["batch_edit_feed_form"];
+
                        var query = Form.serialize("batch_edit_feed_form");
+
+                       /* Form.serialize ignores unchecked checkboxes */
+
+                       if (!query.match("hidden=") && 
+                                       f.hidden.disabled == false) {
+                               query = query + "&hidden=false";
+                       }
+
+                       if (!query.match("rtl_content=") && 
+                                       f.rtl_content.disabled == false) {
+                               query = query + "&rtl_content=false";
+                       }
+
+                       if (!query.match("private=") && 
+                                       f.private.disabled == false) {
+                               query = query + "&private=false";
+                       }
+
+                       if (!query.match("cache_images=") && 
+                                       f.cache_images.disabled == false) {
+                               query = query + "&cache_images=false";
+                       }
+
+                       if (!query.match("include_in_digest=") && 
+                                       f.include_in_digest.disabled == false) {
+                               query = query + "&include_in_digest=false";
+                       }
        
                        closeInfoBox();