]>
git.wh0rd.org - tt-rss.git/blob - js/tt-rss.js
1 var global_unread
= -1;
2 var hotkey_prefix
= false;
3 var hotkey_prefix_pressed
= false;
4 var hotkey_actions
= {};
5 var _widescreen_mode
= false;
7 var _active_feed_id
= 0;
8 var _active_feed_is_cat
= false;
19 function activeFeedIsCat() {
20 return _active_feed_is_cat
;
23 function getActiveFeedId() {
24 return _active_feed_id
;
27 function setActiveFeedId(id
, is_cat
) {
29 hash_set('c', is_cat
? 1 : 0);
32 _active_feed_is_cat
= is_cat
;
34 $("headlines-frame").setAttribute("feed-id", id
);
35 $("headlines-frame").setAttribute("is-cat", is_cat
? 1 : 0);
37 selectFeed(id
, is_cat
);
39 PluginHost
.run(PluginHost
.HOOK_FEED_SET_ACTIVE
, _active_article_id
);
43 function updateFeedList() {
45 Element
.show("feedlistLoading");
49 if (dijit
.byId("feedTree")) {
50 dijit
.byId("feedTree").destroyRecursive();
53 var store
= new dojo
.data
.ItemFileWriteStore({
54 url
: "backend.php?op=pref_feeds&method=getfeedtree&mode=2"
57 var treeModel
= new fox
.FeedStoreModel({
60 "type": getInitParam('enable_feed_cats') == 1 ? "category" : "feed"
64 childrenAttrs
: ["items"]
67 var tree
= new fox
.FeedTree({
69 onClick: function (item
, node
) {
70 var id
= String(item
.id
);
71 var is_cat
= id
.match("^CAT:");
72 var feed
= id
.substr(id
.indexOf(":") + 1);
73 viewfeed({feed
: feed
, is_cat
: is_cat
});
82 /* var menu = new dijit.Menu({id: 'feedMenu'});
84 menu.addChild(new dijit.MenuItem({
85 label: "Simple menu item"
88 // menu.bindDomNode(tree.domNode); */
90 var tmph
= dojo
.connect(dijit
.byId('feedMenu'), '_openMyself', function (event
) {
91 console
.log(dijit
.getEnclosingWidget(event
.target
));
92 dojo
.disconnect(tmph
);
95 $("feeds-holder").appendChild(tree
.domNode
);
97 var tmph
= dojo
.connect(tree
, 'onLoad', function () {
98 dojo
.disconnect(tmph
);
99 Element
.hide("feedlistLoading");
104 loading_set_progress(25);
116 function catchupAllFeeds() {
118 var str
= __("Mark all articles as read?");
120 if (getInitParam("confirm_feed_catchup") != 1 || confirm(str
)) {
122 var query_str
= "backend.php?op=feeds&method=catchupAll";
124 notify_progress("Marking all feeds as read...");
126 //console.log("catchupAllFeeds Q=" + query_str);
128 new Ajax
.Request("backend.php", {
129 parameters
: query_str
,
130 onComplete: function(transport
) {
131 request_counters(true);
140 function viewCurrentFeed(method
) {
141 console
.log("viewCurrentFeed: " + method
);
143 if (getActiveFeedId() != undefined) {
144 viewfeed({feed
: getActiveFeedId(), is_cat
: activeFeedIsCat(), method
: method
});
146 return false; // block unneeded form submits
150 if (getInitParam("bw_limit") != "1") {
151 request_counters(true);
152 setTimeout(timeout
, 60*1000);
157 var query
= "backend.php?op=feeds&method=search¶m=" +
158 param_escape(getActiveFeedId() + ":" + activeFeedIsCat());
160 if (dijit
.byId("searchDlg"))
161 dijit
.byId("searchDlg").destroyRecursive();
163 dialog
= new dijit
.Dialog({
166 style
: "width: 600px",
167 execute: function() {
168 if (this.validate()) {
169 _search_query
= dojo
.objectToQuery(this.attr('value'));
179 function updateTitle() {
180 var tmp
= "Tiny Tiny RSS";
182 if (global_unread
> 0) {
183 tmp
= "(" + global_unread
+ ") " + tmp
;
187 if (global_unread
> 0) {
188 window
.fluid
.dockBadge
= global_unread
;
190 window
.fluid
.dockBadge
= "";
194 document
.title
= tmp
;
197 function genericSanityCheck() {
198 setCookie("ttrss_test", "TEST");
200 if (getCookie("ttrss_test") != "TEST") {
201 return fatalError(2);
210 window
.onerror = function(message
, filename
, lineno
, colno
, error
) {
211 report_error(message
, filename
, lineno
, colno
, error
);
214 require(["dojo/_base/kernel",
221 "dijit/ColorPalette",
224 "dijit/form/ComboButton",
225 "dijit/form/CheckBox",
226 "dijit/form/DropDownButton",
227 "dijit/form/FilteringSelect",
229 "dijit/form/RadioButton",
231 "dijit/form/MultiSelect",
232 "dijit/form/SimpleTextarea",
233 "dijit/form/TextBox",
234 "dijit/form/ComboBox",
235 "dijit/form/ValidationTextBox",
236 "dijit/InlineEditBox",
237 "dijit/layout/AccordionContainer",
238 "dijit/layout/BorderContainer",
239 "dijit/layout/ContentPane",
240 "dijit/layout/TabContainer",
241 "dijit/PopupMenuItem",
245 "dijit/tree/dndSource",
246 "dijit/tree/ForestStoreModel",
247 "dojo/data/ItemFileWriteStore",
248 "fox/FeedTree" ], function (dojo
, ready
, parser
) {
255 if (!genericSanityCheck())
258 loading_set_progress(30);
260 var a
= document
.createElement('audio');
262 var hasAudio
= !!a
.canPlayType
;
263 var hasSandbox
= "sandbox" in document
.createElement("iframe");
264 var hasMp3
= !!(a
.canPlayType
&& a
.canPlayType('audio/mpeg;').replace(/no
/, ''));
265 var clientTzOffset
= new Date().getTimezoneOffset() * 60;
267 init_hotkey_actions();
269 new Ajax
.Request("backend.php", {
271 op
: "rpc", method
: "sanityCheck", hasAudio
: hasAudio
,
273 clientTzOffset
: clientTzOffset
,
274 hasSandbox
: hasSandbox
276 onComplete: function (transport
) {
277 backend_sanity_check_callback(transport
);
290 function init_hotkey_actions() {
291 hotkey_actions
["next_feed"] = function() {
292 var rv
= dijit
.byId("feedTree").getNextFeed(
293 getActiveFeedId(), activeFeedIsCat());
295 if (rv
) viewfeed({feed
: rv
[0], is_cat
: rv
[1], can_wait
: true})
297 hotkey_actions
["prev_feed"] = function() {
298 var rv
= dijit
.byId("feedTree").getPreviousFeed(
299 getActiveFeedId(), activeFeedIsCat());
301 if (rv
) viewfeed({feed
: rv
[0], is_cat
: rv
[1], can_wait
: true})
303 hotkey_actions
["next_article"] = function() {
306 hotkey_actions
["prev_article"] = function() {
309 hotkey_actions
["next_article_noscroll"] = function() {
310 moveToPost('next', true);
312 hotkey_actions
["prev_article_noscroll"] = function() {
313 moveToPost('prev', true);
315 hotkey_actions
["next_article_noexpand"] = function() {
316 moveToPost('next', true, true);
318 hotkey_actions
["prev_article_noexpand"] = function() {
319 moveToPost('prev', true, true);
321 hotkey_actions
["collapse_article"] = function() {
322 var id
= getActiveArticleId();
323 var elem
= $("CICD-"+id
);
326 if (elem
.visible()) {
327 cdmCollapseArticle(null, id
);
330 cdmExpandArticle(id
);
334 hotkey_actions
["toggle_expand"] = function() {
335 var id
= getActiveArticleId();
336 var elem
= $("CICD-"+id
);
339 if (elem
.visible()) {
340 cdmCollapseArticle(null, id
, false);
343 cdmExpandArticle(id
);
347 hotkey_actions
["search_dialog"] = function() {
350 hotkey_actions
["toggle_mark"] = function() {
351 selectionToggleMarked(undefined, false, true);
353 hotkey_actions
["toggle_publ"] = function() {
354 selectionTogglePublished(undefined, false, true);
356 hotkey_actions
["toggle_unread"] = function() {
357 selectionToggleUnread(undefined, false, true);
359 hotkey_actions
["edit_tags"] = function() {
360 var id
= getActiveArticleId();
365 hotkey_actions
["open_in_new_window"] = function() {
366 if (getActiveArticleId()) {
367 openArticleInNewWindow(getActiveArticleId());
371 hotkey_actions
["catchup_below"] = function() {
372 catchupRelativeToArticle(1);
374 hotkey_actions
["catchup_above"] = function() {
375 catchupRelativeToArticle(0);
377 hotkey_actions
["article_scroll_down"] = function() {
378 var ctr
= $("content_insert") ? $("content_insert") : $("headlines-frame");
382 hotkey_actions
["article_scroll_up"] = function() {
383 var ctr
= $("content_insert") ? $("content_insert") : $("headlines-frame");
387 hotkey_actions
["close_article"] = function() {
389 if (!getInitParam("cdm_expanded")) {
390 cdmCollapseArticle(false, getActiveArticleId());
396 hotkey_actions
["email_article"] = function() {
397 if (typeof emailArticle
!= "undefined") {
399 } else if (typeof mailtoArticle
!= "undefined") {
402 alert(__("Please enable mail plugin first."));
405 hotkey_actions
["select_all"] = function() {
406 selectArticles('all');
408 hotkey_actions
["select_unread"] = function() {
409 selectArticles('unread');
411 hotkey_actions
["select_marked"] = function() {
412 selectArticles('marked');
414 hotkey_actions
["select_published"] = function() {
415 selectArticles('published');
417 hotkey_actions
["select_invert"] = function() {
418 selectArticles('invert');
420 hotkey_actions
["select_none"] = function() {
421 selectArticles('none');
423 hotkey_actions
["feed_refresh"] = function() {
424 if (getActiveFeedId() != undefined) {
425 viewfeed({feed
: getActiveFeedId(), is_cat
: activeFeedIsCat()});
429 hotkey_actions
["feed_unhide_read"] = function() {
432 hotkey_actions
["feed_subscribe"] = function() {
435 hotkey_actions
["feed_debug_update"] = function() {
436 if (!activeFeedIsCat() && parseInt(getActiveFeedId()) > 0) {
437 window
.open("backend.php?op=feeds&method=update_debugger&feed_id=" + getActiveFeedId() +
438 "&csrf_token=" + getInitParam("csrf_token"));
440 alert("You can't debug this kind of feed.");
444 hotkey_actions
["feed_debug_viewfeed"] = function() {
445 viewfeed({feed
: getActiveFeedId(), is_cat
: activeFeedIsCat(), viewfeed_debug
: true});
448 hotkey_actions
["feed_edit"] = function() {
449 if (activeFeedIsCat())
450 alert(__("You can't edit this kind of feed."));
452 editFeed(getActiveFeedId());
454 hotkey_actions
["feed_catchup"] = function() {
455 if (getActiveFeedId() != undefined) {
456 catchupCurrentFeed();
460 hotkey_actions
["feed_reverse"] = function() {
461 reverseHeadlineOrder();
463 hotkey_actions
["feed_toggle_vgroup"] = function() {
464 var query_str
= "?op=rpc&method=togglepref&key=VFEED_GROUP_BY_FEED";
466 new Ajax
.Request("backend.php", {
467 parameters
: query_str
,
468 onComplete: function(transport
) {
473 hotkey_actions
["catchup_all"] = function() {
476 hotkey_actions
["cat_toggle_collapse"] = function() {
477 if (activeFeedIsCat()) {
478 dijit
.byId("feedTree").collapseCat(getActiveFeedId());
482 hotkey_actions
["goto_all"] = function() {
483 viewfeed({feed
: -4});
485 hotkey_actions
["goto_fresh"] = function() {
486 viewfeed({feed
: -3});
488 hotkey_actions
["goto_marked"] = function() {
489 viewfeed({feed
: -1});
491 hotkey_actions
["goto_published"] = function() {
492 viewfeed({feed
: -2});
494 hotkey_actions
["goto_tagcloud"] = function() {
495 displayDlg(__("Tag cloud"), "printTagCloud");
497 hotkey_actions
["goto_prefs"] = function() {
500 hotkey_actions
["select_article_cursor"] = function() {
501 var id
= getArticleUnderPointer();
503 var row
= $("RROW-" + id
);
506 var cb
= dijit
.getEnclosingWidget(
507 row
.getElementsByClassName("rchk")[0]);
510 cb
.attr("checked", !cb
.attr("checked"));
511 toggleSelectRowById(cb
, "RROW-" + id
);
517 hotkey_actions
["create_label"] = function() {
520 hotkey_actions
["create_filter"] = function() {
523 hotkey_actions
["collapse_sidebar"] = function() {
526 hotkey_actions
["toggle_embed_original"] = function() {
527 if (typeof embedOriginalArticle
!= "undefined") {
528 if (getActiveArticleId())
529 embedOriginalArticle(getActiveArticleId());
531 alert(__("Please enable embed_original plugin first."));
534 hotkey_actions
["toggle_widescreen"] = function() {
536 _widescreen_mode
= !_widescreen_mode
;
538 // reset stored sizes because geometry changed
539 setCookie("ttrss_ci_width", 0);
540 setCookie("ttrss_ci_height", 0);
542 switchPanelMode(_widescreen_mode
);
544 alert(__("Widescreen is not available in combined mode."));
547 hotkey_actions
["help_dialog"] = function() {
550 hotkey_actions
["toggle_combined_mode"] = function() {
551 notify_progress("Loading, please wait...");
553 var value
= isCdmMode() ? "false" : "true";
554 var query
= "?op=rpc&method=setpref&key=COMBINED_DISPLAY_MODE&value=" + value
;
556 new Ajax
.Request("backend.php", {
558 onComplete: function(transport
) {
559 setInitParam("combined_display_mode",
560 !getInitParam("combined_display_mode"));
567 hotkey_actions
["toggle_cdm_expanded"] = function() {
568 notify_progress("Loading, please wait...");
570 var value
= getInitParam("cdm_expanded") ? "false" : "true";
571 var query
= "?op=rpc&method=setpref&key=CDM_EXPANDED&value=" + value
;
573 new Ajax
.Request("backend.php", {
575 onComplete: function(transport
) {
576 setInitParam("cdm_expanded", !getInitParam("cdm_expanded"));
582 function init_second_stage() {
586 if (parseInt(getCookie("ttrss_fh_width")) > 0) {
587 dijit
.byId("feeds-holder").domNode
.setStyle(
588 {width
: getCookie("ttrss_fh_width") + "px" });
591 dijit
.byId("main").resize();
593 var tmph
= dojo
.connect(dijit
.byId('feeds-holder'), 'resize',
595 if (args
&& args
.w
>= 0) {
596 setCookie("ttrss_fh_width", args
.w
, getInitParam("cookie_lifetime"));
600 var tmph
= dojo
.connect(dijit
.byId('content-insert'), 'resize',
602 if (args
&& args
.w
>= 0 && args
.h
>= 0) {
603 setCookie("ttrss_ci_width", args
.w
, getInitParam("cookie_lifetime"));
604 setCookie("ttrss_ci_height", args
.h
, getInitParam("cookie_lifetime"));
608 delCookie("ttrss_test");
610 var toolbar
= document
.forms
["main_toolbar_form"];
612 dijit
.getEnclosingWidget(toolbar
.view_mode
).attr('value',
613 getInitParam("default_view_mode"));
615 dijit
.getEnclosingWidget(toolbar
.order_by
).attr('value',
616 getInitParam("default_view_order_by"));
618 feeds_sort_by_unread
= getInitParam("feeds_sort_by_unread") == 1;
620 var hash_feed_id
= hash_get('f');
621 var hash_feed_is_cat
= hash_get('c') == "1";
623 if (hash_feed_id
!= undefined) {
624 setActiveFeedId(hash_feed_id
, hash_feed_is_cat
);
627 loading_set_progress(50);
629 // can't use cache_clear() here because viewfeed might not have initialized yet
630 if ('sessionStorage' in window
&& window
['sessionStorage'] !== null)
631 sessionStorage
.clear();
633 var hotkeys
= getInitParam("hotkeys");
636 for (sequence
in hotkeys
[1]) {
637 filtered
= sequence
.replace(/\|.*$/, "");
638 tmp
[filtered
] = hotkeys
[1][sequence
];
642 setInitParam("hotkeys", hotkeys
);
644 _widescreen_mode
= getInitParam("widescreen");
645 switchPanelMode(_widescreen_mode
);
647 console
.log("second stage ok");
649 if (getInitParam("simple_update")) {
650 console
.log("scheduling simple feed updater...");
651 window
.setTimeout(update_random_feed
, 30*1000);
655 function quickMenuGo(opid
) {
664 displayDlg(__("Tag cloud"), "printTagCloud");
673 window
.location
.href
= "backend.php?op=digest";
676 if (activeFeedIsCat())
677 alert(__("You can't edit this kind of feed."));
679 editFeed(getActiveFeedId());
681 case "qmcRemoveFeed":
682 var actid
= getActiveFeedId();
684 if (activeFeedIsCat()) {
685 alert(__("You can't unsubscribe from the category."));
690 alert(__("Please select some feed first."));
694 var fn
= getFeedName(actid
);
696 var pr
= __("Unsubscribe from %s?").replace("%s", fn
);
699 unsubscribeFeed(actid
);
702 case "qmcCatchupAll":
705 case "qmcShowOnlyUnread":
714 case "qmcRescoreFeed":
715 rescoreCurrentFeed();
717 case "qmcToggleWidescreen":
719 _widescreen_mode
= !_widescreen_mode
;
721 // reset stored sizes because geometry changed
722 setCookie("ttrss_ci_width", 0);
723 setCookie("ttrss_ci_height", 0);
725 switchPanelMode(_widescreen_mode
);
727 alert(__("Widescreen is not available in combined mode."));
734 console
.log("quickMenuGo: unknown action: " + opid
);
738 function toggleDispRead() {
740 var hide
= !(getInitParam("hide_read_feeds") == "1");
742 hideOrShowFeeds(hide
);
744 var query
= "?op=rpc&method=setpref&key=HIDE_READ_FEEDS&value=" +
747 setInitParam("hide_read_feeds", hide
);
749 new Ajax
.Request("backend.php", {
751 onComplete: function(transport
) {
756 function parse_runtime_info(data
) {
758 //console.log("parsing runtime info...");
763 // console.log("RI: " + k + " => " + v);
765 if (k
== "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) {
766 if (parseInt(getInitParam("dep_ts")) < parseInt(v
) && getInitParam("reload_on_ts_change")) {
767 window
.location
.reload();
771 if (k
== "daemon_is_running" && v
!= 1) {
772 notify_error("<span onclick=\"explainError(1)\">Update daemon is not running.</span>", true);
776 if (k
== "update_result") {
777 var updatesIcon
= dijit
.byId("updatesIcon").domNode
;
780 Element
.show(updatesIcon
);
782 Element
.hide(updatesIcon
);
786 if (k
== "daemon_stamp_ok" && v
!= 1) {
787 notify_error("<span onclick=\"explainError(3)\">Update daemon is not updating feeds.</span>", true);
791 if (k
== "max_feed_id" || k
== "num_feeds") {
792 if (init_params
[k
] != v
) {
793 console
.log("feed count changed, need to reload feedlist.");
802 PluginHost
.run(PluginHost
.HOOK_RUNTIME_INFO_LOADED
, data
);
805 function collapse_feedlist() {
806 Element
.toggle("feeds-holder");
808 var splitter
= $("feeds-holder_splitter");
810 Element
.visible("feeds-holder") ? splitter
.show() : splitter
.hide();
812 dijit
.byId("main").resize();
815 function viewModeChanged() {
817 return viewCurrentFeed('');
820 function rescoreCurrentFeed() {
822 var actid
= getActiveFeedId();
824 if (activeFeedIsCat() || actid
< 0) {
825 alert(__("You can't rescore this kind of feed."));
830 alert(__("Please select some feed first."));
834 var fn
= getFeedName(actid
);
835 var pr
= __("Rescore articles in %s?").replace("%s", fn
);
838 notify_progress("Rescoring articles...");
840 var query
= "?op=pref-feeds&method=rescore&quiet=1&ids=" + actid
;
842 new Ajax
.Request("backend.php", {
844 onComplete: function(transport
) {
850 function hotkey_handler(e
) {
852 if (e
.target
.nodeName
== "INPUT" || e
.target
.nodeName
== "TEXTAREA") return;
856 var cmdline
= $('cmdline');
859 keycode
= window
.event
.keyCode
;
864 if (keycode
== 27) { // escape
865 hotkey_prefix
= false;
868 if (keycode
== 16) return; // ignore lone shift
869 if (keycode
== 17) return; // ignore lone ctrl
871 var hotkeys
= getInitParam("hotkeys");
872 var keychar
= String
.fromCharCode(keycode
).toLowerCase();
874 if (!hotkey_prefix
&& hotkeys
[0].indexOf(keychar
) != -1) {
876 var date
= new Date();
877 var ts
= Math
.round(date
.getTime() / 1000);
879 hotkey_prefix
= keychar
;
880 hotkey_prefix_pressed
= ts
;
882 cmdline
.innerHTML
= keychar
;
883 Element
.show(cmdline
);
887 // returning false here literally disables ctrl-c in browser lol (because C is a valid prefix)
891 Element
.hide(cmdline
);
893 var hotkey
= keychar
.search(/[a-zA-Z0-9]/) != -1 ? keychar
: "(" + keycode
+ ")";
895 // ensure ^*char notation
896 if (e
.shiftKey
) hotkey
= "*" + hotkey
;
897 if (e
.ctrlKey
) hotkey
= "^" + hotkey
;
898 if (e
.altKey
) hotkey
= "+" + hotkey
;
899 if (e
.metaKey
) hotkey
= "%" + hotkey
;
901 hotkey
= hotkey_prefix
? hotkey_prefix
+ " " + hotkey
: hotkey
;
902 hotkey_prefix
= false;
904 var hotkey_action
= false;
905 var hotkeys
= getInitParam("hotkeys");
907 for (sequence
in hotkeys
[1]) {
908 if (sequence
== hotkey
) {
909 hotkey_action
= hotkeys
[1][sequence
];
914 var action
= hotkey_actions
[hotkey_action
];
916 if (action
!= null) {
923 function inPreferences() {
927 function reverseHeadlineOrder() {
929 var toolbar
= document
.forms
["main_toolbar_form"];
930 var order_by
= dijit
.getEnclosingWidget(toolbar
.order_by
);
932 var value
= order_by
.attr('value');
934 if (value
== "date_reverse")
937 value
= "date_reverse";
939 order_by
.attr('value', value
);
945 function handle_rpc_json(transport
, scheduled_call
) {
947 var netalert_dijit
= dijit
.byId("net-alert");
948 var netalert
= false;
950 if (netalert_dijit
) netalert
= netalert_dijit
.domNode
;
953 var reply
= JSON
.parse(transport
.responseText
);
957 var error
= reply
['error'];
960 var code
= error
['code'];
961 var msg
= error
['msg'];
963 console
.warn("[handle_rpc_json] received fatal error " + code
+ "/" + msg
);
966 fatalError(code
, msg
);
971 var seq
= reply
['seq'];
974 if (get_seq() != seq
) {
975 console
.log("[handle_rpc_json] sequence mismatch: " + seq
+
976 " (want: " + get_seq() + ")");
981 var message
= reply
['message'];
984 if (message
== "UPDATE_COUNTERS") {
985 console
.log("need to refresh counters...");
986 setInitParam("last_article_id", -1);
987 request_counters(true);
991 var counters
= reply
['counters'];
994 parse_counters(counters
, scheduled_call
);
996 var runtime_info
= reply
['runtime-info'];
999 parse_runtime_info(runtime_info
);
1001 if (netalert
) netalert
.hide();
1007 notify_error("Communication problem with server.");
1014 notify_error("Communication problem with server.");
1022 function switchPanelMode(wide
) {
1023 if (isCdmMode()) return;
1025 article_id
= getActiveArticleId();
1028 dijit
.byId("headlines-wrap-inner").attr("design", 'sidebar');
1029 dijit
.byId("content-insert").attr("region", "trailing");
1031 dijit
.byId("content-insert").domNode
.setStyle({width
: '50%',
1033 borderTopWidth
: '0px' });
1035 if (parseInt(getCookie("ttrss_ci_width")) > 0) {
1036 dijit
.byId("content-insert").domNode
.setStyle(
1037 {width
: getCookie("ttrss_ci_width") + "px" });
1040 $("headlines-frame").setStyle({ borderBottomWidth
: '0px' });
1041 $("headlines-frame").addClassName("wide");
1045 dijit
.byId("content-insert").attr("region", "bottom");
1047 dijit
.byId("content-insert").domNode
.setStyle({width
: 'auto',
1049 borderTopWidth
: '0px'});
1051 if (parseInt(getCookie("ttrss_ci_height")) > 0) {
1052 dijit
.byId("content-insert").domNode
.setStyle(
1053 {height
: getCookie("ttrss_ci_height") + "px" });
1056 $("headlines-frame").setStyle({ borderBottomWidth
: '1px' });
1057 $("headlines-frame").removeClassName("wide");
1061 closeArticlePanel();
1063 if (article_id
) view(article_id
);
1065 new Ajax
.Request("backend.php", {
1066 parameters
: "op=rpc&method=setpanelmode&wide=" + (wide
? 1 : 0),
1067 onComplete: function(transport
) {
1068 console
.log(transport
.responseText
);
1072 function update_random_feed() {
1073 console
.log("in update_random_feed");
1075 new Ajax
.Request("backend.php", {
1076 parameters
: "op=rpc&method=updateRandomFeed",
1077 onComplete: function(transport
) {
1078 handle_rpc_json(transport
, true);
1079 window
.setTimeout(update_random_feed
, 30*1000);
1083 function hash_get(key
) {
1084 kv
= window
.location
.hash
.substring(1).toQueryParams();
1087 function hash_set(key
, value
) {
1088 kv
= window
.location
.hash
.substring(1).toQueryParams();
1090 window
.location
.hash
= $H(kv
).toQueryString();