From d62796de76dce06ef194cef1047610bd073a5cd4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Nov 2010 15:56:48 +0300 Subject: [PATCH] prefs: use Dijit stuff --- prefs.js | 51 +++++++++++++++-------------------------- prefs.php | 67 ++++++++++++++++++++++++------------------------------ tt-rss.css | 49 ++++++++++++++++++++++----------------- 3 files changed, 76 insertions(+), 91 deletions(-) diff --git a/prefs.js b/prefs.js index d858b6e7..be5cb0a9 100644 --- a/prefs.js +++ b/prefs.js @@ -1,5 +1,4 @@ var active_feed_cat = false; -var active_tab = false; var init_params = new Array(); @@ -17,7 +16,7 @@ function feedlist_callback2(transport) { try { - var container = $('prefContent'); + var container = $('feedConfigTab'); container.innerHTML=transport.responseText; selectTab("feedConfig", true); @@ -38,7 +37,7 @@ function feedlist_callback2(transport) { } function filterlist_callback2(transport) { - var container = $('prefContent'); + var container = $('filterConfigTab'); container.innerHTML=transport.responseText; notify(""); remove_splash(); @@ -71,7 +70,7 @@ function labellist_callback2(transport) { try { - var container = $('prefContent'); + var container = $('labelConfigTab'); closeInfoBox(); container.innerHTML=transport.responseText; @@ -87,7 +86,7 @@ function labellist_callback2(transport) { function userlist_callback2(transport) { try { - var container = $('prefContent'); + var container = $('userConfigTab'); if (transport.readyState == 4) { container.innerHTML=transport.responseText; notify(""); @@ -100,7 +99,7 @@ function userlist_callback2(transport) { function prefslist_callback2(transport) { try { - var container = $('prefContent'); + var container = $('genConfigTab'); container.innerHTML=transport.responseText; notify(""); remove_splash(); @@ -1062,20 +1061,8 @@ function updatePrefsList() { } function selectTab(id, noupdate, subop) { - -// alert(id); - - if (!id) id = active_tab; - try { - try { - if (id != active_tab) { - var c = $('prefContent'); - c.scrollTop = 0; - } - } catch (e) { }; - if (!noupdate) { console.log("selectTab: " + id + "(NU: " + noupdate + ")"); @@ -1102,6 +1089,10 @@ function selectTab(id, noupdate, subop) { } else if (id == "userConfig") { updateUsersList(); } + + var tab = dijit.byId(id + "Tab"); + dijit.byId("pref-tabs").selectChild(tab); + } /* clean selection from all tabs */ @@ -1112,8 +1103,6 @@ function selectTab(id, noupdate, subop) { $(id + "Tab").addClassName("Selected"); - active_tab = id; - } catch (e) { exception_error("selectTab", e); } @@ -1122,7 +1111,7 @@ function selectTab(id, noupdate, subop) { function init_second_stage() { try { - active_tab = getInitParam("prefs_active_tab"); + var active_tab = getInitParam("prefs_active_tab"); if (!$(active_tab+"Tab")) active_tab = "genConfig"; if (!active_tab || active_tab == '0') active_tab = "genConfig"; @@ -1138,20 +1127,15 @@ function init_second_stage() { caller_subop = caller_subop + ":" + getURLParam("subopparam"); } - if (tab) { - active_tab = tab; - } - - if (navigator.userAgent.match("Opera")) { - setTimeout("selectTab()", 500); - } else { - selectTab(active_tab); - } - notify(""); + if (tab) active_tab = tab; loading_set_progress(60); + selectTab(active_tab, true); + notify(""); + setTimeout("hotkey_prefix_timeout()", 5*1000); + remove_splash(); } catch (e) { exception_error("init_second_stage", e); @@ -1162,8 +1146,9 @@ function init() { try { - //dojo.require("dijit.layout.BorderContainer"); - //dojo.require("dijit.layout.ContentPane"); + dojo.require("dijit.layout.TabContainer"); + dojo.require("dijit.layout.BorderContainer"); + dojo.require("dijit.layout.ContentPane"); dojo.require("dijit.Dialog"); dojo.require("dijit.form.Button"); //dojo.require("dojo.data.ItemFileReadStore"); diff --git a/prefs.php b/prefs.php index 12ad10f0..5bedfb8a 100644 --- a/prefs.php +++ b/prefs.php @@ -61,6 +61,9 @@ +
 
+ +
@@ -87,61 +90,51 @@ -
+
+ + -
-
- ? -
- -
 
- -
-
-
-
- = 10) { ?> -
- +
+
+
+
+
+= 10) { ?> +
+
-
-
-

- -
-
- -
 
- - -
+ +
diff --git a/tt-rss.css b/tt-rss.css index 5c9b1f14..e1623444 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -402,10 +402,7 @@ pre { margin : 5px; } -input.extSearch { - width : 100%; -} - +/* div.firstTab { width : 10px; float : left; @@ -456,7 +453,7 @@ div.prefsTab.Selected { bottom : -1px; z-index : 3; height : 30px; -} +} */ div.notice { background : #ffffff; @@ -910,6 +907,14 @@ html, body#ttrssMain, #main { margin: 0; } +html, body#ttrssPrefs, #main { + width: 100%; + height: 100%; + border: 0; + padding: 0; + margin: 0; +} + #toolbar div.actionChooser { display : table-cell; text-align : right; @@ -918,7 +923,7 @@ html, body#ttrssMain, #main { /* preferences layout */ -#prefFooter { +/* #prefFooter { position : absolute; bottom : 0px; height : 20px; @@ -956,7 +961,7 @@ html, body#ttrssMain, #main { font-size : 12px; margin : 10px; height : 33px; -} +} */ div.return { float : right; @@ -972,7 +977,7 @@ div.return a:hover { color : black; } -#prefContentOuter { +/* #prefContentOuter { clear : left; position : absolute; bottom : 41px; @@ -998,8 +1003,7 @@ div.return a:hover { right : 0px; padding : 1em; overflow : auto; - -} +} */ div.topLinks img { vertical-align : middle; @@ -1197,16 +1201,6 @@ div#hotkey_help_overlay table.hho td.bottom { font-size : 11px; } -div.prefKbdHelp { - float : right; - font-size : 12px; - margin-right : 15px; -} - -div.prefKbdHelp img { - vertical-align : middle; -} - div#l_progress_o { width : 200px; border : 1px solid black; @@ -1488,7 +1482,7 @@ div.fatalError textarea { #footer { text-align : center; color : gray; - padding : 4px; + padding : 4px 4px 8px 4px; border-width : 0px; } @@ -1522,3 +1516,16 @@ div#feedlistLoading { padding : 5px; color : gray; } + +div#pref-tabs .dijitContentPane { + font-size : 12px; +} + +div#pref-tabs { + margin : 0px 5px 0px 5px; +} + +div#pref-tabs .dijitContentPane h3 { + font-size : 14px; + font-weight : bold; +} -- 2.39.2