]> git.wh0rd.org Git - tt-rss.git/commitdiff
rework main toolbar
authorAndrew Dolgov <fox@fakecake.org>
Sat, 20 Nov 2010 21:06:51 +0000 (00:06 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Sat, 20 Nov 2010 21:06:51 +0000 (00:06 +0300)
tt-rss.js
tt-rss.php

index a0c1b70f46f837ae3e203b45a1d71c9b1b72546a..08abbbe3ce1f24d0bcfbdbdc488e97280db3870a 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -265,7 +265,7 @@ function genericSanityCheck() {
 
 function init() {
        try {
-               Form.disable("main_toolbar_form");
+               //Form.disable("main_toolbar_form");
 
                dojo.require("dijit.layout.BorderContainer");
                dojo.require("dijit.layout.TabContainer");
@@ -328,8 +328,11 @@ function init_second_stage() {
 
                var toolbar = document.forms["main_toolbar_form"];
 
-               dropboxSelect(toolbar.view_mode, getInitParam("default_view_mode"));
-               dropboxSelect(toolbar.order_by, getInitParam("default_view_order_by"));
+               dijit.getEnclosingWidget(toolbar.view_mode).attr('value', 
+                       getInitParam("default_view_mode"));
+
+               dijit.getEnclosingWidget(toolbar.order_by).attr('value', 
+                       getInitParam("default_view_order_by"));
 
                feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
 
@@ -345,12 +348,9 @@ function init_second_stage() {
        }
 }
 
-function quickMenuChange() {
-       var chooser = $("quickMenuChooser");
-       var opid = chooser[chooser.selectedIndex].value;
-
-       chooser.selectedIndex = 0;
-       quickMenuGo(opid);
+function quickMenuChange(elem) {
+       quickMenuGo(elem.value);
+       elem.attr('value', 'qmcDefault');
 }
 
 function quickMenuGo(opid) {
index 8ee817f9051e03762a841702410b4a57886a0681..5b9d1f1fe0f562b949cf5d8afb1764e4f8bfa23b 100644 (file)
 
                <form id="main_toolbar_form" action="" onsubmit='return false'>
 
-               <button id="collapse_feeds_btn" onclick="collapse_feedlist()"
+               <button dojoType="dijit.form.Button" id="collapse_feeds_btn" 
+                       onclick="collapse_feedlist()"
                        title="<?php echo __('Collapse feedlist') ?>" style="display : inline">
                        &lt;&lt;</button>
 
                <select name="view_mode" title="<?php echo __('Show articles') ?>" 
-                               onchange="viewModeChanged()">
+                       onchange="viewModeChanged()"
+                       dojoType="dijit.form.Select" style="width : 100px">
                        <option selected="selected" value="adaptive"><?php echo __('Adaptive') ?></option>
                        <option value="all_articles"><?php echo __('All Articles') ?></option>
                        <option value="marked"><?php echo __('Starred') ?></option>
                        <option value="updated"><?php echo __('Updated') ?></option>
                </select>
 
-               <select title="<?php echo __('Sort articles') ?>" 
-                               name="order_by" onchange="viewModeChanged()">
+               <select title="<?php echo __('Sort articles') ?>"
+                       onchange="viewModeChanged()" 
+                       dojoType="dijit.form.Select" name="order_by" style="width : 100px">
                        <option selected="selected" value="default"><?php echo __('Default') ?></option>
                        <option value="date"><?php echo __('Date') ?></option>
                        <option value="title"><?php echo __('Title') ?></option>
                        <option value="score"><?php echo __('Score') ?></option>
                </select>
 
-               <button name="update" onclick="return scheduleFeedUpdate()">
+               <button dojoType="dijit.form.Button" name="update" 
+                       onclick="scheduleFeedUpdate()">
                        <?php echo __('Update') ?></button>
 
-               <button onclick="return catchupCurrentFeed()">
+               <button dojoType="dijit.form.Button" 
+                       onclick="catchupCurrentFeed()">
                        <?php echo __('Mark as read') ?></button>
 
                </form>
 
                <div class="actionChooser">
-                       <select id="quickMenuChooser" onchange="quickMenuChange()">
+                       <select onchange="quickMenuChange(this)" dojoType="dijit.form.Select"
+                               style="width : 150px">
                                        <option value="qmcDefault" selected="selected"><?php echo __('Actions...') ?></option>
                                        <option value="qmcSearch"><?php echo __('Search...') ?></option>
-                                       <optgroup label="<?php echo __('Feed actions:') ?>">
+                                       <option disabled="1" value="x"><?php echo __('Feed actions:') ?></option>
                                        <option value="qmcAddFeed"><?php echo __('Subscribe to feed...') ?></option>
                                        <option value="qmcEditFeed"><?php echo __('Edit this feed...') ?></option>
                                        <option value="qmcRescoreFeed"><?php echo __('Rescore feed') ?></option>
                                        <option value="qmcRemoveFeed"><?php echo __('Unsubscribe') ?></option>
-                                       </optgroup>
-                                       <optgroup label="<?php echo __('All feeds:') ?>">
+                                       <option disabled="1" value="x"><?php echo __('All feeds:') ?></option>
                                        <option value="qmcCatchupAll"><?php echo __('Mark as read') ?></option>
                                        <option value="qmcShowOnlyUnread"><?php echo __('(Un)hide read feeds') ?></option>
-                                       </optgroup>
-
-                                       <optgroup label="<?php echo __('Other actions:') ?>">
-
+                                       <option disabled="1" value="x"><?php echo __('Other actions:') ?></option>
                                        <option value="qmcTagCloud"><?php echo __('Show tag cloud...') ?></option>
                                        <option value="qmcAddLabel"><?php echo __('Create label...') ?></option>
                                        <option value="qmcAddFilter"><?php echo __('Create filter...') ?></option>
                                        <option value="qmcHKhelp"><?php echo __('Keyboard shortcuts help') ?></option>
-                                       </optgroup>
-
                        </select>
                </div>