]> git.wh0rd.org Git - tt-rss.git/commitdiff
label editor: bugfixes
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 7 Aug 2008 08:12:24 +0000 (09:12 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 7 Aug 2008 08:12:24 +0000 (09:12 +0100)
functions.js
functions.php

index 7f9f1d21e352074278db64338974af997aeb3eaf..42e226192f43ce607ead79168144d1a5cc0ff4d1 100644 (file)
@@ -1768,21 +1768,43 @@ function addLabelExample() {
                        }
 
                        if (op == "kw_title") {
+                               if (p.value == "") {
+                                       alert("This action requires a parameter.");
+                                       return false;
+                               }
                                tmp = tmp + "ttrss_entries.title like '%"+p.value+"%'";
                        }
+
                        if (op == "kw_content") {
+                               if (p.value == "") {
+                                       alert("This action requires a parameter.");
+                                       return false;
+                               }
+
                                tmp = tmp + "ttrss_entries.content like '%"+p.value+"%'";
                        }
 
                        if (op == "scoreE") {
+                               if (isNaN(parseInt(p.value))) {
+                                       alert("This action expects numeric parameter.");
+                                       return false;
+                               }
                                tmp = tmp + "score = " + p.value;
                        }
 
                        if (op == "scoreG") {
+                               if (isNaN(parseInt(p.value))) {
+                                       alert("This action expects numeric parameter.");
+                                       return false;
+                               }
                                tmp = tmp + "score > " + p.value;
                        }
 
                        if (op == "scoreL") {
+                               if (isNaN(parseInt(p.value))) {
+                                       alert("This action expects numeric parameter.");
+                                       return false;
+                               }
                                tmp = tmp + "score < " + p.value;
                        }
 
index 23d618b8df72d594840e3ff4431d154ce42cba17..eb67f520e25653dcdabc3be68c5ee64ddafd056e 100644 (file)
                print "<option value=\"updated\">".__("Updated articles")."</option>";
                print "<option value=\"kw_title\">".__("Title contains")."</option>";
                print "<option value=\"kw_content\">".__("Content contains")."</option>";
-               print "<option value=\"scoreE\">".__("Score is equals")."</option>";
-               print "<option value=\"scoreG\">".__("Score is less than")."</option>";
-               print "<option value=\"scoreL\">".__("Score is greater than")."</option>";
+               print "<option value=\"scoreE\">".__("Score equals")."</option>";
+               print "<option value=\"scoreG\">".__("Score is greater than")."</option>";
+               print "<option value=\"scoreL\">".__("Score is less than")."</option>";
                print "<option value=\"newerH\">".__("Articles newer than X hours")."</option>";
                print "<option value=\"newerD\">".__("Articles newer than X days")."</option>";