summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-01-14 11:28:57 +0300
committerAndrew Dolgov <[email protected]>2010-01-14 11:28:57 +0300
commitc3b7b797f51793825b5fa992635d951736df239a (patch)
tree92ea87aca633965ec265e30498f2c516a6c6300f
parentb6a6e262bebfdcea6b9523e63c287f94b4ffcff6 (diff)
add prototype of icon replacing control; misc tweaks
-rw-r--r--functions.js31
-rw-r--r--modules/popup-dialog.php2
-rw-r--r--modules/pref-feeds.php33
-rw-r--r--prefs.js3
4 files changed, 64 insertions, 5 deletions
diff --git a/functions.js b/functions.js
index 884256df9..f0135f76a 100644
--- a/functions.js
+++ b/functions.js
@@ -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);
+ }
+}
+
diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php
index 06a82ad57..25a6390a2 100644
--- a/modules/popup-dialog.php
+++ b/modules/popup-dialog.php
@@ -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>";
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php
index e724125ec..85d1e3f7b 100644
--- a/modules/pref-feeds.php
+++ b/modules/pref-feeds.php
@@ -15,6 +15,13 @@
$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"]));
@@ -247,7 +254,7 @@
print "</select>";
-
+
print "</div>";
print "<div class=\"dlgSec\">".__("Update")."</div>";
@@ -389,6 +396,28 @@
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'>
@@ -1391,7 +1420,7 @@
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'>";
diff --git a/prefs.js b/prefs.js
index 6c7f6f636..8dbe89c8f 100644
--- 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);
}