]> git.wh0rd.org Git - tt-rss.git/commitdiff
add ability to toggle widescreen mode on the fly
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 5 Jan 2013 12:56:49 +0000 (16:56 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 5 Jan 2013 12:56:49 +0000 (16:56 +0400)
include/functions.php
index.php
js/tt-rss.js

index 7dc109460270cf479ff0071662aa77d51938300c..921c9235b2c330062501ba2532e386b0374797a2 100644 (file)
                                "article_scroll_down" => __("Scroll down"),
                                "article_scroll_up" => __("Scroll up"),
                                "select_article_cursor" => __("Select article under cursor"),
-                               "email_article" => __("Email article")),
+                               "email_article" => __("Email article"),
+                               "toggle_widescreen" => __("Toggle widescreen mode")),
                        __("Article selection") => array(
                                "select_all" => __("Select all articles"),
                                "select_unread" => __("Select unread"),
                                "c n" => "catchup_above",
                                "N" => "article_scroll_down",
                                "P" => "article_scroll_up",
+                               "a W" => "toggle_widescreen",
                                "e" => "email_article",
 //                     "article_selection" => array(
                                "a a" => "select_all",
index 36d87558f9c024ffaace4a71cd90da92733e925a..24ab0912c4fe050a80e19683d0f695d2b4a81040 100644 (file)
--- a/index.php
+++ b/index.php
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcDigest')"><?php echo __('Switch to digest...') ?></div>
                                        <?php } ?>
                                                <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagCloud')"><?php echo __('Show tag cloud...') ?></div>
+                                               <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcToggleWidescreen')"><?php echo __('Toggle widescreen mode') ?></div>
+
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcTagSelect')"><?php echo __('Select by tags...') ?></div>
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddLabel')"><?php echo __('Create label...') ?></div>
                                        <div dojoType="dijit.MenuItem" onclick="quickMenuGo('qmcAddFilter')"><?php echo __('Create filter...') ?></div>
index 18a7da9d3e695620b00c56c3f54437aeb981da40..5cbfbfa6e91e0b25b4b58ff97fa1aa8aa14f738f 100644 (file)
@@ -7,6 +7,7 @@ var hotkey_prefix = false;
 var hotkey_prefix_pressed = false;
 var _force_scheduled_update = false;
 var last_scheduled_update = false;
+var _widescreen_mode = false;
 
 var _rpc_seq = 0;
 
@@ -452,6 +453,15 @@ function quickMenuGo(opid) {
                        return;
                }
 
+               if (opid == "qmcToggleWidescreen") {
+                       if (!isCdmMode()) {
+                               _widescreen_mode = !_widescreen_mode;
+
+                               switchPanelMode(_widescreen_mode);
+                       }
+                       return;
+               }
+
                if (opid == "qmcHKhelp") {
                        helpDialog("main");
                }
@@ -839,6 +849,13 @@ function hotkey_handler(e) {
                case "collapse_sidebar":
                        collapse_feedlist();
                        return false;
+               case "toggle_widescreen":
+                       if (!isCdmMode()) {
+                               _widescreen_mode = !_widescreen_mode;
+
+                               switchPanelMode(_widescreen_mode);
+                       }
+                       return false;
                case "help_dialog":
                        helpDialog("main");
                        return false;
@@ -957,3 +974,36 @@ function handle_rpc_json(transport, scheduled_call) {
        return true;
 }
 
+function switchPanelMode(wide) {
+       try {
+               article_id = getActiveArticleId();
+
+               if (wide) {
+                       dijit.byId("headlines-wrap-inner").attr("design", 'sidebar');
+                       dijit.byId("content-insert").attr("region", "trailing");
+
+                       dijit.byId("content-insert").domNode.setStyle({width: '50%',
+                               height: 'auto',
+                               'border-top-width': '0px' });
+
+                       $("headlines-toolbar").setStyle({ 'border-bottom-width': '0px' });
+
+               } else {
+
+                       dijit.byId("content-insert").attr("region", "bottom");
+
+                       dijit.byId("content-insert").domNode.setStyle({width: 'auto',
+                               height: '50%',
+                               'border-top-width': '1px'});
+
+                       $("headlines-toolbar").setStyle({ 'border-bottom-width': '1px' });
+               }
+
+               closeArticlePanel();
+
+               if (article_id) view(article_id);
+
+       } catch (e) {
+               exception_error("switchPanelMode", e);
+       }
+}