rework preferences to use dijit stuff

This commit is contained in:
Andrew Dolgov 2010-11-17 14:49:06 +03:00
parent f8ce21fc72
commit 8df7184cad
7 changed files with 95 additions and 37 deletions

View File

@ -955,6 +955,9 @@
if ($quiet) return; if ($quiet) return;
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Feeds')."\">";
set_pref($link, "_PREFS_ACTIVE_TAB", "feedConfig"); set_pref($link, "_PREFS_ACTIVE_TAB", "feedConfig");
$result = db_query($link, "SELECT COUNT(id) AS num_errors $result = db_query($link, "SELECT COUNT(id) AS num_errors
@ -976,6 +979,8 @@
$feed_search = $_SESSION["prefs_feed_search"]; $feed_search = $_SESSION["prefs_feed_search"];
} }
print "<div dojoType=\"dijit.Toolbar\">";
print "<div style='float : right'> print "<div style='float : right'>
<input id=\"feed_search\" size=\"20\" type=\"search\" <input id=\"feed_search\" size=\"20\" type=\"search\"
onfocus=\"disableHotkeys();\" onfocus=\"disableHotkeys();\"
@ -1018,6 +1023,8 @@
} }
print "</div>"; # toolbar
$feeds_sort = db_escape_string($_REQUEST["sort"]); $feeds_sort = db_escape_string($_REQUEST["sort"]);
if (!$feeds_sort || $feeds_sort == "undefined") { if (!$feeds_sort || $feeds_sort == "undefined") {
@ -1229,17 +1236,9 @@
} }
print "<h3>".__('OPML')."</h3>"; print "</div>"; # feeds pane
/* print "<div style='float : left'> print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('OPML')."\">";
<form enctype=\"multipart/form-data\" method=\"POST\" action=\"opml.php\">
".__('File:')." <input id=\"opml_file\" name=\"opml_file\" type=\"file\">&nbsp;
<input type=\"hidden\" name=\"op\" value=\"Import\">
<button onclick=\"return validateOpmlImport();\"
type=\"submit\">".__('Import')."</button>
</form></div>";
print "&nbsp;"; */
print "<p>" . __("Using OPML you can export and import your feeds and Tiny Tiny RSS settings."); print "<p>" . __("Using OPML you can export and import your feeds and Tiny Tiny RSS settings.");
@ -1262,8 +1261,7 @@
</form>"; </form>";
print "</div>&nbsp;"; print "</div>&nbsp;";
print "<button onclick=\"gotoExportOpml()\">". print "<button onclick=\"gotoExportOpml()\">".__('Export OPML')."</button>";
__('Export OPML')."</button>";
print "<p>".__('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.'); print "<p>".__('Your OPML can be published publicly and can be subscribed by anyone who knows the URL below.');
@ -1273,9 +1271,11 @@
__('Display URL')."</button> "; __('Display URL')."</button> ";
if (strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) { print "</div>"; # pane
print "<h3>" . __("Firefox Integration") . "</h3>"; if (true || strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") !== false) {
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Firefox integration')."\">";
print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.') . "</p>"; print "<p>" . __('This Tiny Tiny RSS site can be used as a Firefox Feed Reader by clicking the link below.') . "</p>";
@ -1288,10 +1288,12 @@
"</button>"; "</button>";
print "</p>"; print "</p>";
print "</div>"; # pane
} }
print "<h3>".__("Subscribing via bookmarklet")."</h3>"; print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Subscribing using bookmarklet')."\">";
print "<p>" . __("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.") . "</p>"; print "<p>" . __("Drag the link below to your browser toolbar, open the feed you're interested in in your browser and click on the link to subscribe to it.") . "</p>";
$bm_subscribe_url = str_replace('%s', '', add_feed_url()); $bm_subscribe_url = str_replace('%s', '', add_feed_url());
@ -1302,7 +1304,9 @@
print "<a href=\"$bm_url\" class='visibleLink'>" . __('Subscribe in Tiny Tiny RSS'). "</a>"; print "<a href=\"$bm_url\" class='visibleLink'>" . __('Subscribe in Tiny Tiny RSS'). "</a>";
print "<h3>".__("Published articles")."</h3>"; print "</div>"; #pane
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Published articles and generated feeds')."\">";
print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."</p>"; print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the URL specified below.')."</p>";
@ -1315,6 +1319,9 @@
print "<button onclick=\"return clearFeedAccessKeys()\">". print "<button onclick=\"return clearFeedAccessKeys()\">".
__('Clear all generated URLs')."</button> "; __('Clear all generated URLs')."</button> ";
print "</div>"; #pane
print "</div>"; #container
} }
function print_feed_browser($link, $search, $limit, $mode = 1) { function print_feed_browser($link, $search, $limit, $mode = 1) {

View File

@ -298,16 +298,17 @@
} else { } else {
$filter_search = $_SESSION["prefs_filter_search"]; $filter_search = $_SESSION["prefs_filter_search"];
} }
print "<div id=\"pref-filter-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">";
print "<div id=\"pref-filter-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">";
print "<div id=\"pref-filter-toolbar\" dojoType=\"dijit.Toolbar\">";
print "<div style='float : right'> print "<div style='float : right; padding-right : 4px;'>
<input id=\"filter_search\" size=\"20\" type=\"search\" <input id=\"filter_search\" size=\"20\" type=\"search\"
onfocus=\"javascript:disableHotkeys();\" onfocus=\"javascript:disableHotkeys();\"
onblur=\"javascript:enableHotkeys();\" onblur=\"javascript:enableHotkeys();\"
onchange=\"javascript:updateFilterList()\" value=\"$filter_search\"> onchange=\"javascript:updateFilterList()\" value=\"$filter_search\">
<button onclick=\"javascript:updateFilterList()\">".__('Search')."</button> <button onclick=\"javascript:updateFilterList()\">".__('Search')."</button>
&nbsp;
<a class='helpLinkPic' href=\"javascript:displayHelpInfobox(2)\">
<img style='vertical-align : top;' src='".theme_image($link, "images/sign_quest.png")."'></a>
</div>"; </div>";
print "<button onclick=\"return quickAddFilter()\">". print "<button onclick=\"return quickAddFilter()\">".
@ -324,6 +325,10 @@
__('Rescore articles')."</button> "; __('Rescore articles')."</button> ";
} }
print "</div>"; # toolbar
print "</div>"; # toolbar-frame
print "<div id=\"pref-filter-content\" dojoType=\"dijit.layout.ContentPane\" region=\"center\">";
if ($filter_search) { if ($filter_search) {
$filter_search = split(' ', db_escape_string($filter_search)); $filter_search = split(' ', db_escape_string($filter_search));
@ -523,6 +528,9 @@
print "</p>"; print "</p>";
} }
print "</div>"; #pane
print "</div>"; #container
} }
?> ?>

View File

@ -150,7 +150,11 @@
$label_search = $_SESSION["prefs_label_search"]; $label_search = $_SESSION["prefs_label_search"];
} }
print "<div style='float : right'> print "<div id=\"pref-label-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">";
print "<div id=\"pref-label-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">";
print "<div id=\"pref-label-toolbar\" dojoType=\"dijit.Toolbar\">";
print "<div style='float : right; padding-right : 4px'>
<input id=\"label_search\" size=\"20\" type=\"search\" <input id=\"label_search\" size=\"20\" type=\"search\"
onfocus=\"javascript:disableHotkeys();\" onfocus=\"javascript:disableHotkeys();\"
onblur=\"javascript:enableHotkeys();\" onblur=\"javascript:enableHotkeys();\"
@ -158,19 +162,19 @@
<button onclick=\"javascript:updateLabelList()\">".__('Search')."</button> <button onclick=\"javascript:updateLabelList()\">".__('Search')."</button>
</div>"; </div>";
print "<div class=\"prefGenericAddBox\">";
print"<button onclick=\"return addLabel()\">". print"<button onclick=\"return addLabel()\">".
__('Create label')."</button> "; __('Create label')."</button> ";
print "<button onclick=\"javascript:removeSelectedLabels()\">". print "<button onclick=\"removeSelectedLabels()\">".
__('Remove')."</button> "; __('Remove')."</button> ";
print "<button onclick=\"labelColorReset()\">". print "<button onclick=\"labelColorReset()\">".
__('Clear colors')."</button>"; __('Clear colors')."</button>";
print "</div>"; print "</div>"; #toolbar
print "</div>"; #pane
print "<div id=\"pref-label-content\" dojoType=\"dijit.layout.ContentPane\" region=\"center\">";
if ($label_search) { if ($label_search) {
@ -269,6 +273,9 @@
print "</p>"; print "</p>";
} }
print "</div>"; #pane
print "</div>"; #container
} }
function print_color_picker($id) { function print_color_picker($id) {

View File

@ -195,10 +195,12 @@
$_SESSION["prefs_op_result"] = ""; $_SESSION["prefs_op_result"] = "";
print "<div dojoType=\"dijit.layout.AccordionContainer\" region=\"center\">";
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Personal data')."\">";
print "<form onsubmit='return false' id='change_email_form'>"; print "<form onsubmit='return false' id='change_email_form'>";
print "<table width=\"100%\" class=\"prefPrefsList\">"; print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<tr><td colspan='3'><h3>".__("Personal data")."</h3></tr></td>";
$result = db_query($link, "SELECT email,full_name, $result = db_query($link, "SELECT email,full_name,
access_level FROM ttrss_users access_level FROM ttrss_users
@ -240,11 +242,13 @@
print "<p><button onclick=\"return changeUserEmail()\">". print "<p><button onclick=\"return changeUserEmail()\">".
__("Save data")."</button>"; __("Save data")."</button>";
print "</div>"; # pane
print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Authentication')."\">";
print "<form onsubmit=\"return false\" print "<form onsubmit=\"return false\"
name=\"change_pass_form\" id=\"change_pass_form\">"; name=\"change_pass_form\" id=\"change_pass_form\">";
print "<table width=\"100%\" class=\"prefPrefsList\">"; print "<table width=\"100%\" class=\"prefPrefsList\">";
print "<tr><td colspan='3'><h3>".__("Authentication")."</h3></tr></td>";
print "<tr><td width=\"40%\">".__("Old password")."</td>"; print "<tr><td width=\"40%\">".__("Old password")."</td>";
print "<td class=\"prefValue\"><input class=\"editbox\" type=\"password\" print "<td class=\"prefValue\"><input class=\"editbox\" type=\"password\"
@ -279,8 +283,12 @@
print "<p><button onclick=\"return changeUserPassword()\">". print "<p><button onclick=\"return changeUserPassword()\">".
__("Change password")."</button>"; __("Change password")."</button>";
print "</div>"; #pane
} }
print "<div dojoType=\"dijit.layout.AccordionPane\" selected=\"true\" title=\"".__('Preferences')."\">";
if ($_SESSION["profile"]) { if ($_SESSION["profile"]) {
initialize_user_prefs($link, $_SESSION["uid"], $_SESSION["profile"]); initialize_user_prefs($link, $_SESSION["uid"], $_SESSION["profile"]);
$profile_qpart = "profile = '" . $_SESSION["profile"] . "'"; $profile_qpart = "profile = '" . $_SESSION["profile"] . "'";
@ -325,7 +333,7 @@
print "</table>"; print "</table>";
} }
print "<p><table width=\"100%\" class=\"prefPrefsList\">"; print "<table width=\"100%\" class=\"prefPrefsList\">";
$active_section = $line["section_name"]; $active_section = $line["section_name"];
@ -434,6 +442,9 @@
print "</form>"; print "</form>";
print "</div>"; #pane
print "</div>"; #container
} }
} }
?> ?>

View File

@ -347,6 +347,10 @@
} }
} }
print "<div id=\"pref-user-wrap\" dojoType=\"dijit.layout.BorderContainer\" gutters=\"false\">";
print "<div id=\"pref-user-header\" dojoType=\"dijit.layout.ContentPane\" region=\"top\">";
print "<div id=\"pref-user-toolbar\" dojoType=\"dijit.Toolbar\">";
set_pref($link, "_PREFS_ACTIVE_TAB", "userConfig"); set_pref($link, "_PREFS_ACTIVE_TAB", "userConfig");
$user_search = db_escape_string($_REQUEST["search"]); $user_search = db_escape_string($_REQUEST["search"]);
@ -357,7 +361,7 @@
$user_search = $_SESSION["prefs_user_search"]; $user_search = $_SESSION["prefs_user_search"];
} }
print "<div style='float : right'> print "<div style='float : right; padding-right : 4px;'>
<input id=\"user_search\" size=\"20\" type=\"search\" <input id=\"user_search\" size=\"20\" type=\"search\"
onfocus=\"javascript:disableHotkeys();\" onfocus=\"javascript:disableHotkeys();\"
onblur=\"javascript:enableHotkeys();\" onblur=\"javascript:enableHotkeys();\"
@ -384,7 +388,9 @@
<button onclick=\"javascript:resetSelectedUserPass()\">". <button onclick=\"javascript:resetSelectedUserPass()\">".
__('Reset password')."</button>"; __('Reset password')."</button>";
print "</div>"; print "</div>"; #toolbar
print "</div>"; #pane
print "<div id=\"pref-user-content\" dojoType=\"dijit.layout.ContentPane\" region=\"center\">";
if ($user_search) { if ($user_search) {
@ -485,5 +491,8 @@
} }
print "</div>"; #pane
print "</div>"; #container
} }
?> ?>

View File

@ -1148,8 +1148,11 @@ function init() {
dojo.require("dijit.layout.TabContainer"); dojo.require("dijit.layout.TabContainer");
dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.AccordionContainer");
dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.Dialog"); dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button");
dojo.require("dijit.Toolbar");
loading_set_progress(30); loading_set_progress(30);

View File

@ -312,6 +312,10 @@ table.prefPrefsList tr:hover td.prefValue input {
color : #88b0f0; color : #88b0f0;
} }
table.prefPrefsList h3 {
margin-top : 0px;
}
tr.title td { tr.title td {
border-width : 0px 0px 1px 0px; border-width : 0px 0px 1px 0px;
border-color : #ecf4ff; border-color : #ecf4ff;
@ -396,7 +400,7 @@ table.prefFeedList td.feedSelect {
div.prefFeedCatHolder { div.prefFeedCatHolder {
height : 250px; height : 250px;
overflow : auto; overflow : auto;
border : 1px solid #99d67a; border : 1px solid gray;
margin : 5px 0px 5px 0px; margin : 5px 0px 5px 0px;
background-color : white; background-color : white;
} }
@ -679,7 +683,7 @@ div.tagCloudContainer {
} }
div.errorExplained { div.errorExplained {
border : 1px solid #99d67a; border : 1px solid gray;
background-color : white; background-color : white;
margin : 5px 0px 5px 0px; margin : 5px 0px 5px 0px;
padding : 5px; padding : 5px;
@ -689,7 +693,7 @@ ul.feedErrorsList {
height : 300px; height : 300px;
overflow : auto; overflow : auto;
list-style-type : none; list-style-type : none;
border : 1px solid #99d67a; border : 1px solid gray;
background-color : white; background-color : white;
margin : 0px 0px 5px 0px; margin : 0px 0px 5px 0px;
padding : 0px; padding : 0px;
@ -699,7 +703,7 @@ ul.userFeedList {
height : 300px; height : 300px;
overflow : auto; overflow : auto;
list-style-type : none; list-style-type : none;
border : 1px solid #99d67a; border : 1px solid gray;
background-color : white; background-color : white;
margin : 0px 0px 5px 0px; margin : 0px 0px 5px 0px;
padding : 0px; padding : 0px;
@ -711,7 +715,7 @@ ul.browseFeedList {
list-style-type : none; list-style-type : none;
margin : 0px 0px 5px 0px; margin : 0px 0px 5px 0px;
padding : 0px; padding : 0px;
border : 1px solid #99d67a; border : 1px solid gray;
background-color : white; background-color : white;
} }
@ -1547,3 +1551,12 @@ div#pref-tabs .dijitContentPane h3 {
} */ } */
#pref-filter-wrap, #pref-filter-header, #pref-filter-content,
#pref-label-wrap, #pref-label-header, #pref-label-content,
#pref-user-wrap, #pref-user-header, #pref-user-content {
margin : 0px;
padding : 0px;
border-width : 0px;
}