summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-20 21:06:36 +0300
committerAndrew Dolgov <[email protected]>2010-11-20 21:06:36 +0300
commit11b9d0becdfc894c04afaa912798917911ff35a8 (patch)
treeba2b38e833d8db36287d4bd7e9c95e3f566859bd /modules
parentec39a02cd89ee48c0a568c7edbb6b45a1218e3ef (diff)
refactor feed subscription/browser dialogs
Diffstat (limited to 'modules')
-rw-r--r--modules/popup-dialog.php102
-rw-r--r--modules/pref-feeds.php22
2 files changed, 59 insertions, 65 deletions
diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php
index 2f339e669..351d4b0f9 100644
--- a/modules/popup-dialog.php
+++ b/modules/popup-dialog.php
@@ -240,109 +240,101 @@
if ($id == "quickAddFeed") {
- print "<title>".__('Subscribe to Feed')."</title>";
- print "<content><![CDATA[";
-
- print "<form id='feed_add_form' onsubmit='return false'>";
-
- print "<input type=\"hidden\" name=\"op\" value=\"rpc\">";
- print "<input type=\"hidden\" name=\"subop\" value=\"addfeed\">";
- //print "<input type=\"hidden\" name=\"from\" value=\"tt-rss\">";
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"addfeed\">";
print "<div class=\"dlgSec\">".__("Feed")."</div>";
print "<div class=\"dlgSecCont\">";
- print __("URL:") . " ";
-
- print "<input size=\"40\"
- onkeypress=\"return filterCR(event, subscribeToFeed)\"
- name=\"feed\" id=\"feed_url\">";
+ print "<input style=\"font-size : 16px; width : 20em;\"
+ placeHolder=\"".__("Feed URL")."\"
+ dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"feed\" id=\"feedDlg_feedUrl\">";
print "<br/>";
if (get_pref($link, 'ENABLE_FEED_CATS')) {
print __('Place in category:') . " ";
- print_feed_cat_select($link, "cat");
+ print_feed_cat_select($link, "cat", false, 'dojoType="dijit.form.Select"');
}
print "</div>";
- print '<div id="fadd_feeds_container" style="display:none">
+ print '<div id="feedDlg_feedsContainer" style="display : none">
<div class="dlgSec">' . __('Available feeds') . '</div>
- <div class="dlgSecCont">'
-
- . ' <select name="feed" id="faad_feeds_container_select" size="3"></select>'
- . '</div></div>';
-
- print "<div id='fadd_login_container' style='display:none'>
+ <div class="dlgSecCont">'.
+ '<select id="feedDlg_feedContainerSelect"
+ dojoType="dijit.form.Select" size="3">
+ <script type="dojo/method" event="onChange" args="value">
+ dijit.byId("feedDlg_feedUrl").attr("value", value);
+ </script>
+ </select>'.
+ '</div></div>';
+
+ print "<div id='feedDlg_loginContainer' style='display : none'>
<div class=\"dlgSec\">".__("Authentication")."</div>
<div class=\"dlgSecCont\">".
- __('Login:') . " <input name='login' size=\"20\"
- onkeypress=\"return filterCR(event, subscribeToFeed)\"> ".
- __('Password:') . "<input type='password'
- name='pass' size=\"20\"
- onkeypress=\"return filterCR(event, subscribeToFeed)\">
+ " <input dojoType=\"dijit.form.TextBox\" name='login'\"
+ placeHolder=\"".__("Login")."\"
+ style=\"width : 10em;\"> ".
+ " <input
+ placeHolder=\"".__("Password")."\"
+ dojoType=\"dijit.form.TextBox\" type='password'
+ style=\"width : 10em;\" name='pass'\">
</div></div>";
- print "<div style=\"clear : both\">
- <input type=\"checkbox\" id=\"fadd_login_check\"
- onclick='checkboxToggleElement(this, \"fadd_login_container\")'>
- <label for=\"fadd_login_check\">".
+ print "<div style=\"clear : both\">
+ <input type=\"checkbox\" dojoType=\"dijit.form.CheckBox\" id=\"feedDlg_loginCheck\"
+ onclick='checkboxToggleElement(this, \"feedDlg_loginContainer\")'>
+ <label for=\"feedDlg_loginCheck\">".
__('This feed requires authentication.')."</div>";
print "</form>";
print "<div class=\"dlgButtons\">
- <button class=\"button\" id=\"fadd_submit_btn\"
- onclick=\"return subscribeToFeed()\">".__('Subscribe')."</button>
- <button onclick=\"return displayDlg('feedBrowser')\">".__('More feeds')."</button>
- <button onclick=\"return closeInfoBox()\">".__('Cancel')."</button></div>";
-
- print "]]></content>";
+ <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button>
+ <button dojoType=\"dijit.form.Button\" onclick=\"return feedBrowser()\">".__('More feeds')."</button>
+ <button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button>
+ </div>";
//return;
}
if ($id == "feedBrowser") {
- print "<title>".__('Feed Browser')."</title>";
-
- print "<content><![CDATA[";
-
$browser_search = db_escape_string($_REQUEST["search"]);
- print "<form onsubmit='return false;' display='inline'
- name='feed_browser' id='feed_browser'>";
+# print "<form onsubmit='return false;' display='inline'
+# name='feed_browser' id='feed_browser'>";
- print "<input type=\"hidden\" name=\"op\" value=\"rpc\">";
- print "<input type=\"hidden\" name=\"subop\" value=\"updateFeedBrowser\">";
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"updateFeedBrowser\">";
print "<div dojoType=\"dijit.Toolbar\">
<div style='float : right'>
<img style='display : none'
id='feed_browser_spinner' src='".
theme_image($link, 'images/indicator_white.gif')."'>
- <input name=\"search\" size=\"20\" type=\"search\"
- onchange=\"javascript:updateFeedBrowser()\" value=\"$browser_search\">
- <button onclick=\"javascript:updateFeedBrowser()\">".__('Search')."</button>
+ <input name=\"search\" dojoType=\"dijit.form.TextBox\" size=\"20\" type=\"search\"
+ onchange=\"dijit.byId('feedBrowserDlg').update()\" value=\"$browser_search\">
+ <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').update()\">".__('Search')."</button>
</div>";
- print " <select name=\"mode\" onchange=\"updateFeedBrowser()\">
+ print " <select name=\"mode\" dojoType=\"dijit.form.Select\" onchange=\"dijit.byId('feedBrowserDlg').update()\">
<option value='1'>" . __('Popular feeds') . "</option>
<option value='2'>" . __('Feed archive') . "</option>
</select> ";
print __("limit:");
- print " <select name=\"limit\" onchange='updateFeedBrowser()'>";
+ print " <select dojoType=\"dijit.form.Select\" name=\"limit\" onchange=\"dijit.byId('feedBrowserDlg').update()\">";
foreach (array(25, 50, 100, 200) as $l) {
- $issel = ($l == $limit) ? "selected" : "";
- print "<option $issel>$l</option>";
+ $issel = ($l == $limit) ? "selected=\"1\"" : "";
+ print "<option $issel value=\"$l\">$l</option>";
}
print "</select> ";
@@ -356,12 +348,10 @@
print "</ul>";
print "<div align='center'>
- <button onclick=\"feedBrowserSubscribe()\">".__('Subscribe')."</button>
- <button style='display : none' id='feed_archive_remove' onclick=\"feedArchiveRemove()\">".__('Remove')."</button>
- <button onclick=\"closeInfoBox()\" >".__('Cancel')."</button></div>";
+ <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').execute()\">".__('Subscribe')."</button>
+ <button dojoType=\"dijit.form.Button\" style='display : none' id='feed_archive_remove' onclick=\"dijit.byId('feedBrowserDlg').removeFromArchive()\">".__('Remove')."</button>
+ <button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('feedBrowserDlg').hide()\" >".__('Cancel')."</button></div>";
- print "]]></content>";
- //return;
}
if ($id == "search") {
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php
index 698aa1525..d0bc194a4 100644
--- a/modules/pref-feeds.php
+++ b/modules/pref-feeds.php
@@ -265,6 +265,7 @@
/* Title */
print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
+ placeHolder=\"".__("Feed Title")."\"
style=\"font-size : 16px; width: 20em\" name=\"title\" value=\"$title\">";
/* Feed URL */
@@ -277,6 +278,7 @@
print __('URL:') . " ";
print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\"
+ placeHolder=\"".__("Feed URL")."\"
regExp='^(http|https)://.*' style=\"width : 20em\"
name=\"feed_url\" value=\"$feed_url\">";
@@ -339,21 +341,23 @@
$auth_login = htmlspecialchars(db_fetch_result($result, 0, "auth_login"));
- print "<table>";
+# print "<table>";
- print "<tr><td>" . __('Login:') . "</td><td>";
+# print "<tr><td>" . __('Login:') . "</td><td>";
print "<input dojoType=\"dijit.form.TextBox\"
- name=\"auth_login\" value=\"$auth_login\">";
+ placeHolder=\"".__("Login")."\"
+ name=\"auth_login\" value=\"$auth_login\"><br/>";
- print "</tr><tr><td>" . __("Password:") . "</td><td>";
+# print "</tr><tr><td>" . __("Password:") . "</td><td>";
$auth_pass = htmlspecialchars(db_fetch_result($result, 0, "auth_pass"));
print "<input dojoType=\"dijit.form.TextBox\" type=\"password\" name=\"auth_pass\"
+ placeHolder=\"".__("Password")."\"
value=\"$auth_pass\">";
- print "</td></tr></table>";
+# print "</td></tr></table>";
print "</div>";
print "<div class=\"dlgSec\">".__("Options")."</div>";
@@ -613,7 +617,7 @@
<input type=\"submit\" class=\"button\"
onclick=\"return feedsEditSave()\" value=\"".__('Save')."\">
<input type='submit' class='button'
- onclick=\"return feedEditCancel()\" value=\"".__('Cancel')."\">
+ onclick=\"return closeInfoBox()\" value=\"".__('Cancel')."\">
</div>";
print "]]></content></dlg>";
@@ -1411,7 +1415,7 @@
$check_box = "<input onclick='toggleSelectListRow2(this)'
dojoType=\"dijit.form.CheckBox\"
- type=\"checkbox\" id=\"FBCHK-" . $details["id"] . "\">";
+ type=\"checkbox\" \">";
$class = ($feedctr % 2) ? "even" : "odd";
@@ -1449,8 +1453,8 @@
$feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
}
- $check_box = "<input onclick='toggleSelectListRow(this)' class='feedBrowseCB'
- type=\"checkbox\" id=\"FBCHK-" . $line["id"] . "\">";
+ $check_box = "<input onclick='toggleSelectListRow2(this)' dojoType=\"dijit.form.CheckBox\"
+ type=\"checkbox\">";
$class = ($feedctr % 2) ? "even" : "odd";