]> git.wh0rd.org Git - tt-rss.git/commitdiff
some opera-related fixes
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Aug 2006 06:28:13 +0000 (07:28 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 20 Aug 2006 06:28:13 +0000 (07:28 +0100)
backend.php
functions.js
prefs.js

index 114c1d8cd4c9243576fe8aee0ceb057ba924b414..11e5464594d644af16ff1e5c4119e82dc6b8fdab 100644 (file)
 
                        print "<div align='right'>";
 
-                       print "<input type=\"submit\" onclick=\"return labelTest()\" value=\"Test\">
+                       $is_disabled = (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== FALSE) ? "disabled" : "";
+
+                       print "<input $is_disabled type=\"submit\" onclick=\"return labelTest()\" value=\"Test\">
                                ";
 
                        print "<input type=\"submit\" 
index 269093022f82e9a8aad616ed348abde95f8cbe81..2b74731e10e71a595ad903546553f771ef3bc228 100644 (file)
@@ -7,6 +7,10 @@ function browser_has_opacity() {
                navigator.userAgent.match("Opera") != null;
 }
 
+function is_opera() {
+       return navigator.userAgent.match("Opera");
+}
+
 function exception_error(location, e, silent) {
        var msg;
 
index 668f9ce478525e4d05222ccf2bae978a268dd636..eabdd3016d377ff94113345d3b5552a8d49a2af4 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -729,17 +729,20 @@ function labelEditSave() {
                return
        }
 
-       var sql_exp = document.forms["label_edit_form"].sql_exp.value;
-       var description = document.forms["label_edit_form"].description.value;
+       if (!is_opera()) {
 
-       if (sql_exp.length == 0) {
-               alert("SQL Expression cannot be blank.");
-               return false;
-       }
-
-       if (description.length == 0) {
-               alert("Caption field cannot be blank.");
-               return false;
+               var sql_exp = document.forms["label_edit_form"].sql_exp.value;
+               var description = document.forms["label_edit_form"].description.value;
+       
+               if (sql_exp.length == 0) {
+                       alert("SQL Expression cannot be blank.");
+                       return false;
+               }
+       
+               if (description.length == 0) {
+                       alert("Caption field cannot be blank.");
+                       return false;
+               }
        }
 
        closeInfoBox();
@@ -792,11 +795,13 @@ function filterEditSave() {
                return
        }
 
-       var reg_exp = document.forms["filter_edit_form"].reg_exp.value;
-
-       if (reg_exp.length == 0) {
-               alert("Filter expression field cannot be blank.");
-               return;
+       if (!is_opera()) {
+               var reg_exp = document.forms["filter_edit_form"].reg_exp.value;
+       
+               if (reg_exp.length == 0) {
+                       alert("Filter expression field cannot be blank.");
+                       return;
+               }
        }
 
        notify("Saving filter...");