]> git.wh0rd.org Git - tt-rss.git/commitdiff
help uses popup window, recolor infoBox, use subscribe dialog in prefs
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 14 May 2007 05:41:04 +0000 (06:41 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 14 May 2007 05:41:04 +0000 (06:41 +0100)
functions.js
modules/help.php
modules/popup-dialog.php
modules/pref-feeds.php
prefs.js
tt-rss.css
tt-rss.js
utility.css

index 1f031f149238b6b18fbde7706eb34993ddcda97a..21a0da7992b7a3973b19f89d09d16959f87e4f6b 100644 (file)
@@ -1389,6 +1389,22 @@ function infobox_callback() {
        }
 }
 
+function helpbox_callback() {
+       if (xmlhttp.readyState == 4) {
+               var box = document.getElementById('helpBox');
+               var shadow = document.getElementById('helpBoxShadow');
+               if (box) {                      
+                       box.innerHTML=xmlhttp.responseText;                     
+                       if (shadow) {
+                               shadow.style.display = "block";
+                       } else {
+                               box.style.display = "block";                            
+                       }
+               }
+               notify("");
+       }
+}
+
 function addFilter() {
 
        if (!xmlhttp_ready(xmlhttp)) {
index 751d6082e17cefb6063582d19f63d2af94d15bcd..3f6968db7ef15906768f72c2726f59bb916b1144 100644 (file)
@@ -4,30 +4,22 @@
                if (!$_GET["noheaders"]) {
                        print "<html><head>
                                <title>Tiny Tiny RSS : Help</title>
-                               <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
-                               <script type=\"text/javascript\" src=\"prototype.js\"></script>
-                               <script type=\"text/javascript\" src=\"functions.js?$script_dt_add\"></script>
+                               <link rel=\"stylesheet\" href=\"utility.css\" type=\"text/css\">
                                <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
                                </head><body>";
                }
 
                $tid = sprintf("%d", $_GET["tid"]);
 
-               print "<div id=\"infoBoxTitle\">".__('Help')."</div>";
-
-               print "<div class='infoBoxContents'>";
-
                if (file_exists("help/$tid.php")) {
                        include("help/$tid.php");
                } else {
                        print "<p>".__("Help topic not found.")."</p>";
                }
-
-               print "</div>";
-
                print "<div align='center'>
                        <input type='submit' class='button'                     
-                       onclick=\"closeInfoBox()\" value=\"".__('Close this window')."\"></div>";
+                       onclick=\"javascript:window.close()\" 
+                       value=\"".__('Close this window')."\"></div>";
 
                if (!$_GET["noheaders"]) { 
                        print "</body></html>";
index 7eab1bae7d654d742919883faa58fba284fd310f..56ba9f19cc428ac70f0bab85c41e0b2001c654c3 100644 (file)
@@ -47,8 +47,9 @@
                        print "<form id='feed_add_form' onsubmit='return false'>";
 
                        print "<input type=\"hidden\" name=\"op\" value=\"pref-feeds\">";
-                       print "<input type=\"hidden\" name=\"quiet\" value=\"1\">";
+                       print "<input type=\"hidden\" name=\"quiet\" value=\"0\">";
                        print "<input type=\"hidden\" name=\"subop\" value=\"add\">"; 
+                       print "<input type=\"hidden\" name=\"from\" value=\"tt-rss\">"; 
 
                        print "<table width='100%'>
                        <tr><td>Feed URL:</td><td>
index 78a2cff279b1ab7d1dea4652ab61f7e9664886c8..dbd610714480a23420428e83037c68729cf92bb1 100644 (file)
                                        print "</div></body></html>";
                                        return;
                                }
+
                        }
                }
 
                                }
                        }
 
-                       set_pref($link, "_PREFS_ACTIVE_TAB", "feedConfig");
-
                        print "<div class=\"prefGenericAddBox\">
                                <input id=\"fadd_cat\" 
                                        onkeypress=\"return filterCR(event, addFeedCat)\"
 
                if ($quiet) return;
 
+               set_pref($link, "_PREFS_ACTIVE_TAB", "feedConfig");
+
                $result = db_query($link, "SELECT COUNT(id) AS num_errors
                        FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
 
                                onclick=\"javascript:updateFeedList()\" value=\"".__('Search')."\">
                        </div>";
                
-               print "<input id=\"fadd_link\" 
+/*             print "<input id=\"fadd_link\" 
                                onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
                                onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
                                size=\"40\">
                        <input type=\"submit\" class=\"button\"
                                disabled=\"true\" id=\"fadd_submit_btn\"
-                               onclick=\"addFeed()\" value=\"".__('Subscribe')."\">";
+                               onclick=\"addFeed()\" value=\"".__('Subscribe')."\">"; */
+
+               print "<input onclick=\"javascript:displayDlg('quickAddFeed')\"
+                       type=\"submit\" id=\"fadd_subscribe_btn\" 
+                       class=\"button\" value=\"".__('Subscribe to feed')."\">"; 
 
                if (ENABLE_FEED_BROWSER && !SINGLE_USER_MODE) {
                        print " <input type=\"submit\" class=\"button\"
index d9eb9024d1a42f9f9717d15ad4bc968780320ed4..6901b08cf5b19cc3dd00f5e890f30658c5961988 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -54,6 +54,35 @@ function feedlist_callback() {
        }
 }
 
+/* stub for subscription dialog */
+
+function dlg_frefresh_callback() {
+       if (xmlhttp.readyState == 4) {          
+       //      setTimeout("updateFeedList()", 500);
+
+               try {
+                       var container = document.getElementById('prefContent'); 
+                       container.innerHTML=xmlhttp.responseText;
+                       selectTab("feedConfig", true);
+
+                       if (caller_subop) {
+                               var tuple = caller_subop.split(":");
+                               if (tuple[0] == 'editFeed') {
+                                       window.setTimeout('editFeed('+tuple[1]+')', 100);
+                               }                               
+
+                               caller_subop = false;
+                       }
+                       if (typeof correctPNG != 'undefined') {
+                               correctPNG();
+                       }
+                       notify("");
+               } catch (e) {
+                       exception_error("feedlist_callback", e);
+               }
+       }
+}
+
 function filterlist_callback() {
        var container = document.getElementById('prefContent');
        if (xmlhttp.readyState == 4) {
@@ -705,7 +734,7 @@ function labelTest() {
 
 function displayHelpInfobox(topic_id) {
 
-       if (!xmlhttp_ready(xmlhttp)) {
+/*     if (!xmlhttp_ready(xmlhttp)) {
                printLockingError();
                return
        }
@@ -713,10 +742,15 @@ function displayHelpInfobox(topic_id) {
        notify_progress("Loading help...");
 
        xmlhttp.open("GET", "backend.php?op=help&tid=" +
-               param_escape(topic_id) + "&noheaders=1", true);
+               param_escape(topic_id), true);
 
-       xmlhttp.onreadystatechange=infobox_callback;
-       xmlhttp.send(null);
+       xmlhttp.onreadystatechange=helpbox_callback;
+       xmlhttp.send(null); */
+
+       var url = "backend.php?op=help&tid=" + param_escape(topic_id);
+
+       var w = window.open(url, "ttrss_help", 
+               "status=0,toolbar=0,location=0,width=400,height=450,menubar=0");
 
 }
 
index 57627aa583fefb218eb214058c94bf9f2251ee60..87e3fb2bf81c7f13f19af3a2296fa3934a51f832 100644 (file)
@@ -459,6 +459,27 @@ div.helpResponse {
        border : 1px solid #f0f0f0;
 }
 
+#infoBoxTitle {
+       border-width : 1px 1px 1px 1px;
+       border-style : solid;
+       border-color : #99d67a;
+       background-color : #99d67a;
+       padding : 2px;
+       color : white;
+}
+
+#infoBox {     
+       border-width : 1px 1px 1px 1px;
+       border-style : solid;
+       border-color : #99d67a;
+       position : relative;
+       bottom : 2px;
+       right : 2px;
+       padding-bottom : 5px;   
+       background-color : #f8fcf5;
+}
+
+/*
 #infoBoxTitle {
        border-width : 1px 1px 1px 1px;
        border-style : solid;
@@ -468,7 +489,6 @@ div.helpResponse {
        color : white;
 }
 
-
 #infoBox {     
        border-width : 1px 1px 1px 1px;
        border-style : solid;
@@ -477,11 +497,8 @@ div.helpResponse {
        bottom : 2px;
        right : 2px;
        padding-bottom : 5px;   
-       background-image : url("images/prefs-content.png");
-       background-position : top left;
-       background-repeat : repeat-x;
-       background-color : white;
-}
+       background-color : #f7faff;
+} */
 
 #infoBoxShadow {
        background-image : url("images/shadow.png");
@@ -491,7 +508,7 @@ div.helpResponse {
        z-index : 3;
        position : absolute;
        display : none;
-}
+} 
 
 div.infoBoxContents {
        padding : 10px;
@@ -914,7 +931,7 @@ ul.userFeedList {
        height : 300px;
        overflow : auto;
        list-style-type : none;
-       border : 1px solid #88b0f0;
+       border : 1px solid #99d67a;
        background-color : white;
        margin : 0px 0px 5px 0px;
        padding : 0px;
@@ -932,7 +949,7 @@ ul.labelTestResults {
        list-style-type : none;
        margin : 0px 0px 5px 0px;
        padding : 0px;
-       border : 1px solid #88b0f0;
+       border : 1px solid #99d67a;
        background-color : white;
 }
 
@@ -942,7 +959,7 @@ ul.filterTestResults {
        list-style-type : none;
        margin : 0px 0px 5px 0px;
        padding : 0px;
-       border : 1px solid #88b0f0;
+       border : 1px solid #99d67a;
        background-color : white;
 }
 
@@ -952,7 +969,7 @@ ul.browseFeedList {
        list-style-type : none;
        margin : 0px 0px 5px 0px;
        padding : 0px;
-       border : 1px solid #88b0f0;
+       border : 1px solid #99d67a;
        background-color : white;
 }
 
index 6660a5d90c0bc82f6231acfab629fdda6fd3f885..b46c859acccfd3b1f30ab0a84000d1107bc2295b 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -476,8 +476,13 @@ function quickMenuGo(opid) {
        
                if (opid == "qmcRemoveFeed") {
                        var actid = getActiveFeedId();
-       
-                       if (!actid || activeFeedIsCat()) {
+
+                       if (activeFeedIsCat()) {
+                               alert("You can't unsubscribe from the category.");
+                               return;
+                       }       
+
+                       if (!actid) {
                                alert("Please select some feed first.");
                                return;
                        }
@@ -640,7 +645,7 @@ function editFeedDlg(feed) {
                return;
        }
 
-       if (feed <= 0 || active_feed_is_cat || tagsAreDisplayed()) {
+       if (feed <= 0 || activeFeedIsCat() || tagsAreDisplayed()) {
                alert("You can't edit this kind of feed.");
                return;
        }
index 8a254afc1576dca4181824807c415831967cf93e..54e5b0552f33431bb9d810a739c2273da33a7e4b 100644 (file)
@@ -61,3 +61,18 @@ div.error {
        width : 50%;
 }
 
+h1 {
+       color : #88b0f0;
+       font-size : 16pt;
+       border-width : 0px 0px 1px 0px;
+       border-color : black;
+       border-style : solid;
+}
+
+h2 {
+       color : #88b0f0;
+       font-size : 14pt;
+       border-width : 0px 0px 1px 0px;
+       border-color : black;
+       border-style : solid;
+}