]> git.wh0rd.org Git - tt-rss.git/commitdiff
add prototype of icon replacing control; misc tweaks
authorAndrew Dolgov <fox@bah.org.ru>
Thu, 14 Jan 2010 08:28:57 +0000 (11:28 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Thu, 14 Jan 2010 08:28:57 +0000 (11:28 +0300)
functions.js
modules/popup-dialog.php
modules/pref-feeds.php
prefs.js

index 884256df99bf0638ae7f784542d5c9e705af19b7..f0135f76a5b62bef04650fb0ade8ceb894f07520 100644 (file)
@@ -2248,3 +2248,34 @@ function feedArchiveRemove() {
        }
 }
 
+function uploadIconHandler(iframe) {
+       try {
+               notify_info("Icon changed!");
+
+               alert("Icon changed, blah blah");
+
+
+       } catch (e) {
+               exception_error("uploadIconHandler", e);
+       }
+}
+
+function uploadFeedIcon() {
+
+       try {
+
+               var file = $("icon_file");
+
+               if (file.value.length == 0) {
+                       alert(__("Please select an image file to upload."));
+                       return false;
+               } else {
+                       notify_progress("Uploading, please wait...", true);
+                       return true;
+               }
+
+       } catch (e) {
+               exception_error("uploadFeedIcon", e);
+       }
+}
+
index 06a82ad575ca2f0cd91cc82a9b7ffef177105ea1..25a6390a26e2a61f3a09d4010bda433515ec7896 100644 (file)
@@ -56,7 +56,7 @@
                        print "</div>";
 
                        print "<script type=\"text/javascript\">";
-                       print "parent.opml_import_handler(this)";
+                       print "parent.opmlImportHandler(this)";
                        print "</script>";
 
                        print "</div></div>";
index e724125ecd2c0a30ae81c02d3d154eac7eb9c1b6..85d1e3f7becb781de79eb6cc2600005473893de3 100644 (file)
                $quiet = $_REQUEST["quiet"];
                $mode = $_REQUEST["mode"];
 
+               if ($subop == "uploadicon") {
+                       print "<script type=\"text/javascript\">";
+                       print "parent.uploadIconHandler(this);";
+                       print "</script>";
+                       return;
+               }
+
 /*             if ($subop == "massSubscribe") {
                        $ids = split(",", db_escape_string($_REQUEST["ids"]));
 
 
                        print "</select>";
 
-
+       
                        print "</div>";
 
                        print "<div class=\"dlgSec\">".__("Update")."</div>";
 
                        print "</form>";
 
+                       /* Icon */
+
+                       print "<br/>";
+
+/*                     print "<div class=\"dlgSec\">".__("Icon")."</div>";
+                       print "<div class=\"dlgSecCont\">";
+
+                       print "<iframe name=\"icon_upload_iframe\"
+                               style=\"width: 400px; height: 100px; display: none;\"></iframe>";
+
+                       print "<form style='display : block' target=\"icon_upload_iframe\"
+                               enctype=\"multipart/form-data\" method=\"POST\" 
+                               action=\"backend.php\">
+                               <input id=\"icon_file\" name=\"icon_file\" type=\"file\">
+                               <input type=\"hidden\" name=\"op\" value=\"pref-feeds\">
+                               <input type=\"hidden\" name=\"subop\" value=\"uploadicon\">
+                               <button onclick=\"return uploadFeedIcon();\"
+                                       type=\"submit\">".__('Replace')."</button>
+                               </form>";
+
+                       print "</div>"; */
+
                        $title = htmlspecialchars($title, ENT_QUOTES);
 
                        print "<div class='dlgButtons'>
 
                print "&nbsp;"; */
 
-               print "<iframe name=\"upload_iframe\" onchange=\"opml_import_handler(this)\"
+               print "<iframe name=\"upload_iframe\"
                        style=\"width: 400px; height: 100px; display: none;\"></iframe>";
 
                print "<div style='float : left'>";
index 6c7f6f6366e321b5e935f37106b6b927ff6462a5..8dbe89c8f28fa264433abd961bf27c316b68e8c2 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -2233,13 +2233,12 @@ function opmlImportDone() {
        updateFeedList();
 }
 
-function opml_import_handler(iframe) {
+function opmlImportHandler(iframe) {
        try {
                var tmp = new Object();
                tmp.responseText = iframe.document.body.innerHTML;
                notify('');
                infobox_callback2(tmp);
-
        } catch (e) {
                exception_error("opml_import_handler", e);
        }