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() {
25 return _active_feed_id;
27 exception_error("getActiveFeedId", e);
31 function setActiveFeedId(id, is_cat) {
34 hash_set('c', is_cat ? 1 : 0);
37 _active_feed_is_cat = is_cat;
39 $("headlines-frame").setAttribute("feed-id", id);
40 $("headlines-frame").setAttribute("is-cat", is_cat ? 1 : 0);
42 selectFeed(id, is_cat);
44 PluginHost.run(PluginHost.HOOK_FEED_SET_ACTIVE, _active_article_id);
46 exception_error("setActiveFeedId", e);
51 function updateFeedList() {
54 // $("feeds-holder").innerHTML = "<div id=\"feedlistLoading\">" +
55 // __("Loading, please wait...") + "</div>";
57 Element.show("feedlistLoading");
59 if (dijit.byId("feedTree")) {
60 dijit.byId("feedTree").destroyRecursive();
63 var store = new dojo.data.ItemFileWriteStore({
64 url: "backend.php?op=pref_feeds&method=getfeedtree&mode=2"});
66 var treeModel = new fox.FeedStoreModel({
69 "type": getInitParam('enable_feed_cats') == 1 ? "category" : "feed"
73 childrenAttrs: ["items"]
76 var tree = new fox.FeedTree({
78 onClick: function (item, node) {
79 var id = String(item.id);
80 var is_cat = id.match("^CAT:");
81 var feed = id.substr(id.indexOf(":")+1);
82 viewfeed(feed, '', is_cat);
90 /* var menu = new dijit.Menu({id: 'feedMenu'});
92 menu.addChild(new dijit.MenuItem({
93 label: "Simple menu item"
96 // menu.bindDomNode(tree.domNode); */
98 var tmph = dojo.connect(dijit.byId('feedMenu'), '_openMyself', function (event) {
99 console.log(dijit.getEnclosingWidget(event.target));
100 dojo.disconnect(tmph);
103 $("feeds-holder").appendChild(tree.domNode);
105 var tmph = dojo.connect(tree, 'onLoad', function() {
106 dojo.disconnect(tmph);
107 Element.hide("feedlistLoading");
111 // var node = dijit.byId("feedTree")._itemNodesMap['FEED:-2'][0].domNode
112 // menu.bindDomNode(node);
114 loading_set_progress(25);
121 exception_error("updateFeedList", e);
125 function catchupAllFeeds() {
127 var str = __("Mark all articles as read?");
129 if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
131 var query_str = "backend.php?op=feeds&method=catchupAll";
133 notify_progress("Marking all feeds as read...");
135 //console.log("catchupAllFeeds Q=" + query_str);
137 new Ajax.Request("backend.php", {
138 parameters: query_str,
139 onComplete: function(transport) {
140 request_counters(true);
149 function viewCurrentFeed(method) {
150 console.log("viewCurrentFeed");
152 if (getActiveFeedId() != undefined) {
153 viewfeed(getActiveFeedId(), method, activeFeedIsCat());
155 return false; // block unneeded form submits
159 if (getInitParam("bw_limit") != "1") {
161 setTimeout("timeout()", 60*1000);
166 var query = "backend.php?op=feeds&method=search¶m=" +
167 param_escape(getActiveFeedId() + ":" + activeFeedIsCat());
169 if (dijit.byId("searchDlg"))
170 dijit.byId("searchDlg").destroyRecursive();
172 dialog = new dijit.Dialog({
175 style: "width: 600px",
176 execute: function() {
177 if (this.validate()) {
178 _search_query = dojo.objectToQuery(this.attr('value'));
188 function updateTitle() {
189 var tmp = "Tiny Tiny RSS";
191 if (global_unread > 0) {
192 tmp = "(" + global_unread + ") " + tmp;
196 if (global_unread > 0) {
197 window.fluid.dockBadge = global_unread;
199 window.fluid.dockBadge = "";
203 document.title = tmp;
206 function genericSanityCheck() {
207 setCookie("ttrss_test", "TEST");
209 if (getCookie("ttrss_test") != "TEST") {
210 return fatalError(2);
219 //dojo.registerModulePath("fox", "../../js/");
221 dojo.require("fox.FeedTree");
223 dojo.require("dijit.ColorPalette");
224 dojo.require("dijit.Dialog");
225 dojo.require("dijit.form.Button");
226 dojo.require("dijit.form.CheckBox");
227 dojo.require("dijit.form.DropDownButton");
228 dojo.require("dijit.form.FilteringSelect");
229 dojo.require("dijit.form.Form");
230 dojo.require("dijit.form.RadioButton");
231 dojo.require("dijit.form.Select");
232 dojo.require("dijit.form.SimpleTextarea");
233 dojo.require("dijit.form.TextBox");
234 dojo.require("dijit.form.ComboBox");
235 dojo.require("dijit.form.ValidationTextBox");
236 dojo.require("dijit.InlineEditBox");
237 dojo.require("dijit.layout.AccordionContainer");
238 dojo.require("dijit.layout.BorderContainer");
239 dojo.require("dijit.layout.ContentPane");
240 dojo.require("dijit.layout.TabContainer");
241 dojo.require("dijit.Menu");
242 dojo.require("dijit.ProgressBar");
243 dojo.require("dijit.ProgressBar");
244 dojo.require("dijit.Toolbar");
245 dojo.require("dijit.Tree");
246 dojo.require("dijit.tree.dndSource");
247 dojo.require("dojo.data.ItemFileWriteStore");
251 if (!genericSanityCheck())
254 loading_set_progress(30);
256 var a = document.createElement('audio');
258 var hasAudio = !!a.canPlayType;
259 var hasSandbox = "sandbox" in document.createElement("iframe");
260 var hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
261 var clientTzOffset = new Date().getTimezoneOffset() * 60;
263 new Ajax.Request("backend.php", {
264 parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
266 clientTzOffset: clientTzOffset,
267 hasSandbox: hasSandbox},
268 onComplete: function(transport) {
269 backend_sanity_check_callback(transport);
272 hotkey_actions["next_feed"] = function() {
273 var rv = dijit.byId("feedTree").getNextFeed(
274 getActiveFeedId(), activeFeedIsCat());
276 if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true);
278 hotkey_actions["prev_feed"] = function() {
279 var rv = dijit.byId("feedTree").getPreviousFeed(
280 getActiveFeedId(), activeFeedIsCat());
282 if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true);
284 hotkey_actions["next_article"] = function() {
287 hotkey_actions["prev_article"] = function() {
290 hotkey_actions["next_article_noscroll"] = function() {
291 moveToPost('next', true);
293 hotkey_actions["prev_article_noscroll"] = function() {
294 moveToPost('prev', true);
296 hotkey_actions["next_article_noexpand"] = function() {
297 moveToPost('next', true, true);
299 hotkey_actions["prev_article_noexpand"] = function() {
300 moveToPost('prev', true, true);
302 hotkey_actions["collapse_article"] = function() {
303 var id = getActiveArticleId();
304 var elem = $("CICD-"+id);
306 cdmCollapseArticle(null, id);
309 cdmExpandArticle(id);
312 hotkey_actions["toggle_expand"] = function() {
313 var id = getActiveArticleId();
314 var elem = $("CICD-"+id);
316 cdmCollapseArticle(null, id, false);
319 cdmExpandArticle(id);
322 hotkey_actions["search_dialog"] = function() {
325 hotkey_actions["toggle_mark"] = function() {
326 selectionToggleMarked(undefined, false, true);
328 hotkey_actions["toggle_publ"] = function() {
329 selectionTogglePublished(undefined, false, true);
331 hotkey_actions["toggle_unread"] = function() {
332 selectionToggleUnread(undefined, false, true);
334 hotkey_actions["edit_tags"] = function() {
335 var id = getActiveArticleId();
340 hotkey_actions["dismiss_selected"] = function() {
341 dismissSelectedArticles();
343 hotkey_actions["dismiss_read"] = function() {
344 dismissReadArticles();
346 hotkey_actions["open_in_new_window"] = function() {
347 if (getActiveArticleId()) {
348 openArticleInNewWindow(getActiveArticleId());
352 hotkey_actions["catchup_below"] = function() {
353 catchupRelativeToArticle(1);
355 hotkey_actions["catchup_above"] = function() {
356 catchupRelativeToArticle(0);
358 hotkey_actions["article_scroll_down"] = function() {
359 var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
363 hotkey_actions["article_scroll_up"] = function() {
364 var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
368 hotkey_actions["close_article"] = function() {
370 if (!getInitParam("cdm_expanded")) {
371 cdmCollapseArticle(false, getActiveArticleId());
373 dismissArticle(getActiveArticleId());
379 hotkey_actions["email_article"] = function() {
380 if (typeof emailArticle != "undefined") {
382 } else if (typeof mailtoArticle != "undefined") {
385 alert(__("Please enable mail plugin first."));
388 hotkey_actions["select_all"] = function() {
389 selectArticles('all');
391 hotkey_actions["select_unread"] = function() {
392 selectArticles('unread');
394 hotkey_actions["select_marked"] = function() {
395 selectArticles('marked');
397 hotkey_actions["select_published"] = function() {
398 selectArticles('published');
400 hotkey_actions["select_invert"] = function() {
401 selectArticles('invert');
403 hotkey_actions["select_none"] = function() {
404 selectArticles('none');
406 hotkey_actions["feed_refresh"] = function() {
407 if (getActiveFeedId() != undefined) {
408 viewfeed(getActiveFeedId(), '', activeFeedIsCat());
412 hotkey_actions["feed_unhide_read"] = function() {
415 hotkey_actions["feed_subscribe"] = function() {
418 hotkey_actions["feed_debug_update"] = function() {
419 window.open("backend.php?op=feeds&method=view&feed=" + getActiveFeedId() +
420 "&view_mode=adaptive&order_by=default&update=&m=ForceUpdate&cat=" +
421 activeFeedIsCat() + "&DevForceUpdate=1&debug=1&xdebug=1&csrf_token=" +
422 getInitParam("csrf_token"));
424 hotkey_actions["feed_edit"] = function() {
425 if (activeFeedIsCat())
426 alert(__("You can't edit this kind of feed."));
428 editFeed(getActiveFeedId());
430 hotkey_actions["feed_catchup"] = function() {
431 if (getActiveFeedId() != undefined) {
432 catchupCurrentFeed();
436 hotkey_actions["feed_reverse"] = function() {
437 reverseHeadlineOrder();
439 hotkey_actions["catchup_all"] = function() {
442 hotkey_actions["cat_toggle_collapse"] = function() {
443 if (activeFeedIsCat()) {
444 dijit.byId("feedTree").collapseCat(getActiveFeedId());
448 hotkey_actions["goto_all"] = function() {
451 hotkey_actions["goto_fresh"] = function() {
454 hotkey_actions["goto_marked"] = function() {
457 hotkey_actions["goto_published"] = function() {
460 hotkey_actions["goto_tagcloud"] = function() {
461 displayDlg(__("Tag cloud"), "printTagCloud");
463 hotkey_actions["goto_prefs"] = function() {
466 hotkey_actions["select_article_cursor"] = function() {
467 var id = getArticleUnderPointer();
469 var row = $("RROW-" + id);
472 var cb = dijit.getEnclosingWidget(
473 row.getElementsByClassName("rchk")[0]);
476 cb.attr("checked", !cb.attr("checked"));
477 toggleSelectRowById(cb, "RROW-" + id);
483 hotkey_actions["create_label"] = function() {
486 hotkey_actions["create_filter"] = function() {
489 hotkey_actions["collapse_sidebar"] = function() {
492 hotkey_actions["toggle_embed_original"] = function() {
493 if (typeof embedOriginalArticle != "undefined") {
494 if (getActiveArticleId())
495 embedOriginalArticle(getActiveArticleId());
497 alert(__("Please enable embed_original plugin first."));
500 hotkey_actions["toggle_widescreen"] = function() {
502 _widescreen_mode = !_widescreen_mode;
504 // reset stored sizes because geometry changed
505 setCookie("ttrss_ci_width", 0);
506 setCookie("ttrss_ci_height", 0);
508 switchPanelMode(_widescreen_mode);
511 hotkey_actions["help_dialog"] = function() {
514 hotkey_actions["toggle_combined_mode"] = function() {
515 notify_progress("Loading, please wait...");
517 var value = isCdmMode() ? "false" : "true";
518 var query = "?op=rpc&method=setpref&key=COMBINED_DISPLAY_MODE&value=" + value;
520 new Ajax.Request("backend.php", {
522 onComplete: function(transport) {
523 setInitParam("combined_display_mode",
524 !getInitParam("combined_display_mode"));
531 hotkey_actions["toggle_cdm_expanded"] = function() {
532 notify_progress("Loading, please wait...");
534 var value = getInitParam("cdm_expanded") ? "false" : "true";
535 var query = "?op=rpc&method=setpref&key=CDM_EXPANDED&value=" + value;
537 new Ajax.Request("backend.php", {
539 onComplete: function(transport) {
540 setInitParam("cdm_expanded", !getInitParam("cdm_expanded"));
547 exception_error("init", e);
551 function init_second_stage() {
554 dojo.addOnLoad(function() {
558 if (parseInt(getCookie("ttrss_fh_width")) > 0) {
559 dijit.byId("feeds-holder").domNode.setStyle(
560 {width: getCookie("ttrss_fh_width") + "px" });
563 dijit.byId("main").resize();
565 var tmph = dojo.connect(dijit.byId('feeds-holder'), 'resize',
567 if (args && args.w >= 0) {
568 setCookie("ttrss_fh_width", args.w, getInitParam("cookie_lifetime"));
572 var tmph = dojo.connect(dijit.byId('content-insert'), 'resize',
574 if (args && args.w >= 0 && args.h >= 0) {
575 setCookie("ttrss_ci_width", args.w, getInitParam("cookie_lifetime"));
576 setCookie("ttrss_ci_height", args.h, getInitParam("cookie_lifetime"));
582 delCookie("ttrss_test");
584 var toolbar = document.forms["main_toolbar_form"];
586 dijit.getEnclosingWidget(toolbar.view_mode).attr('value',
587 getInitParam("default_view_mode"));
589 dijit.getEnclosingWidget(toolbar.order_by).attr('value',
590 getInitParam("default_view_order_by"));
592 feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
594 var hash_feed_id = hash_get('f');
595 var hash_feed_is_cat = hash_get('c') == "1";
597 if (hash_feed_id != undefined) {
598 setActiveFeedId(hash_feed_id, hash_feed_is_cat);
601 loading_set_progress(50);
603 // can't use cache_clear() here because viewfeed might not have initialized yet
604 if ('sessionStorage' in window && window['sessionStorage'] !== null)
605 sessionStorage.clear();
607 var hotkeys = getInitParam("hotkeys");
610 for (sequence in hotkeys[1]) {
611 filtered = sequence.replace(/\|.*$/, "");
612 tmp[filtered] = hotkeys[1][sequence];
616 setInitParam("hotkeys", hotkeys);
618 _widescreen_mode = getInitParam("widescreen");
619 switchPanelMode(_widescreen_mode);
621 console.log("second stage ok");
623 if (getInitParam("simple_update")) {
624 console.log("scheduling simple feed updater...");
625 window.setTimeout("update_random_feed()", 30*1000);
629 exception_error("init_second_stage", e);
633 function quickMenuGo(opid) {
643 displayDlg(__("Tag cloud"), "printTagCloud");
646 displayDlg(__("Select item(s) by tags"), "printTagSelect");
655 window.location.href = "backend.php?op=digest";
658 if (activeFeedIsCat())
659 alert(__("You can't edit this kind of feed."));
661 editFeed(getActiveFeedId());
663 case "qmcRemoveFeed":
664 var actid = getActiveFeedId();
666 if (activeFeedIsCat()) {
667 alert(__("You can't unsubscribe from the category."));
672 alert(__("Please select some feed first."));
676 var fn = getFeedName(actid);
678 var pr = __("Unsubscribe from %s?").replace("%s", fn);
681 unsubscribeFeed(actid);
684 case "qmcCatchupAll":
687 case "qmcShowOnlyUnread":
696 case "qmcRescoreFeed":
697 rescoreCurrentFeed();
699 case "qmcToggleWidescreen":
701 _widescreen_mode = !_widescreen_mode;
703 // reset stored sizes because geometry changed
704 setCookie("ttrss_ci_width", 0);
705 setCookie("ttrss_ci_height", 0);
707 switchPanelMode(_widescreen_mode);
714 console.log("quickMenuGo: unknown action: " + opid);
718 exception_error("quickMenuGo", e);
722 function toggleDispRead() {
725 var hide = !(getInitParam("hide_read_feeds") == "1");
727 hideOrShowFeeds(hide);
729 var query = "?op=rpc&method=setpref&key=HIDE_READ_FEEDS&value=" +
732 setInitParam("hide_read_feeds", hide);
734 new Ajax.Request("backend.php", {
736 onComplete: function(transport) {
740 exception_error("toggleDispRead", e);
744 function parse_runtime_info(data) {
746 //console.log("parsing runtime info...");
751 // console.log("RI: " + k + " => " + v);
753 if (k == "new_version_available") {
755 Element.show(dijit.byId("newVersionIcon").domNode);
757 Element.hide(dijit.byId("newVersionIcon").domNode);
762 if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) {
763 if (parseInt(getInitParam("dep_ts")) < parseInt(v) && getInitParam("reload_on_ts_change")) {
764 window.location.reload();
768 if (k == "daemon_is_running" && v != 1) {
769 notify_error("<span onclick=\"javascript:explainError(1)\">Update daemon is not running.</span>", true);
773 if (k == "daemon_stamp_ok" && v != 1) {
774 notify_error("<span onclick=\"javascript:explainError(3)\">Update daemon is not updating feeds.</span>", true);
778 if (k == "max_feed_id" || k == "num_feeds") {
779 if (init_params[k] != v) {
780 console.log("feed count changed, need to reload feedlist.");
789 PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
792 function collapse_feedlist() {
795 if (!Element.visible('feeds-holder')) {
796 Element.show('feeds-holder');
797 $("collapse_feeds_btn").innerHTML = "<<";
799 Element.hide('feeds-holder');
800 $("collapse_feeds_btn").innerHTML = ">>";
803 dijit.byId("main").resize();
806 exception_error("collapse_feedlist", e);
810 function viewModeChanged() {
812 return viewCurrentFeed('');
815 function rescoreCurrentFeed() {
817 var actid = getActiveFeedId();
819 if (activeFeedIsCat() || actid < 0) {
820 alert(__("You can't rescore this kind of feed."));
825 alert(__("Please select some feed first."));
829 var fn = getFeedName(actid);
830 var pr = __("Rescore articles in %s?").replace("%s", fn);
833 notify_progress("Rescoring articles...");
835 var query = "?op=pref-feeds&method=rescore&quiet=1&ids=" + actid;
837 new Ajax.Request("backend.php", {
839 onComplete: function(transport) {
845 function hotkey_handler(e) {
848 if (e.target.nodeName == "INPUT" || e.target.nodeName == "TEXTAREA") return;
851 var shift_key = false;
852 var ctrl_key = false;
854 var meta_key = false;
856 var cmdline = $('cmdline');
858 shift_key = e.shiftKey;
859 ctrl_key = e.ctrlKey;
861 meta_key = e.metaKey;
864 keycode = window.event.keyCode;
869 var keychar = String.fromCharCode(keycode);
871 if (keycode == 27) { // escape
872 hotkey_prefix = false;
875 if (keycode == 16) return; // ignore lone shift
876 if (keycode == 17) return; // ignore lone ctrl
878 keychar = keychar.toLowerCase();
880 var hotkeys = getInitParam("hotkeys");
882 if (!hotkey_prefix && hotkeys[0].indexOf(keychar) != -1) {
884 var date = new Date();
885 var ts = Math.round(date.getTime() / 1000);
887 hotkey_prefix = keychar;
888 hotkey_prefix_pressed = ts;
890 cmdline.innerHTML = keychar;
891 Element.show(cmdline);
896 Element.hide(cmdline);
898 var hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")";
900 // ensure ^*char notation
901 if (shift_key) hotkey = "*" + hotkey;
902 if (ctrl_key) hotkey = "^" + hotkey;
903 if (alt_key) hotkey = "+" + hotkey;
904 if (meta_key) hotkey = "%" + hotkey;
906 hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey;
907 hotkey_prefix = false;
909 var hotkey_action = false;
910 var hotkeys = getInitParam("hotkeys");
912 for (sequence in hotkeys[1]) {
913 if (sequence == hotkey) {
914 hotkey_action = hotkeys[1][sequence];
919 var action = hotkey_actions[hotkey_action];
921 if (action != null) {
927 exception_error("hotkey_handler", e);
931 function inPreferences() {
935 function reverseHeadlineOrder() {
938 /* var query_str = "?op=rpc&method=togglepref&key=REVERSE_HEADLINES";
940 new Ajax.Request("backend.php", {
941 parameters: query_str,
942 onComplete: function(transport) {
946 var toolbar = document.forms["main_toolbar_form"];
947 var order_by = dijit.getEnclosingWidget(toolbar.order_by);
949 var value = order_by.attr('value');
951 if (value == "date_reverse")
954 value = "date_reverse";
956 order_by.attr('value', value);
961 exception_error("reverseHeadlineOrder", e);
965 function newVersionDlg() {
967 var query = "backend.php?op=dlg&method=newVersion";
969 if (dijit.byId("newVersionDlg"))
970 dijit.byId("newVersionDlg").destroyRecursive();
972 dialog = new dijit.Dialog({
974 title: __("New version available!"),
975 style: "width: 600px",
982 exception_error("newVersionDlg", e);
986 function handle_rpc_json(transport, scheduled_call) {
988 var reply = JSON.parse(transport.responseText);
990 var netalert_dijit = dijit.byId("net-alert");
991 var netalert = false;
994 netalert = netalert_dijit.domNode;
998 var error = reply['error'];
1001 var code = error['code'];
1002 var msg = error['msg'];
1004 console.warn("[handle_rpc_json] received fatal error " + code + "/" + msg);
1007 fatalError(code, msg);
1012 var seq = reply['seq'];
1015 if (get_seq() != seq) {
1016 console.log("[handle_rpc_json] sequence mismatch: " + seq +
1017 " (want: " + get_seq() + ")");
1022 var message = reply['message'];
1025 if (message == "UPDATE_COUNTERS") {
1026 console.log("need to refresh counters...");
1027 setInitParam("last_article_id", -1);
1028 request_counters(true);
1032 var counters = reply['counters'];
1035 parse_counters(counters, scheduled_call);
1037 var runtime_info = reply['runtime-info'];
1040 parse_runtime_info(runtime_info);
1042 if (netalert) Element.hide(netalert);
1046 Element.show(netalert);
1048 notify_error("Communication problem with server.");
1053 Element.show(netalert);
1055 notify_error("Communication problem with server.");
1058 //exception_error("handle_rpc_json", e, transport);
1064 function switchPanelMode(wide) {
1066 if (isCdmMode()) return;
1068 article_id = getActiveArticleId();
1071 dijit.byId("headlines-wrap-inner").attr("design", 'sidebar');
1072 dijit.byId("content-insert").attr("region", "trailing");
1074 dijit.byId("content-insert").domNode.setStyle({width: '50%',
1076 borderTopWidth: '0px' });
1078 if (parseInt(getCookie("ttrss_ci_width")) > 0) {
1079 dijit.byId("content-insert").domNode.setStyle(
1080 {width: getCookie("ttrss_ci_width") + "px" });
1083 $("headlines-frame").setStyle({ borderBottomWidth: '0px' });
1084 $("headlines-frame").addClassName("wide");
1088 dijit.byId("content-insert").attr("region", "bottom");
1090 dijit.byId("content-insert").domNode.setStyle({width: 'auto',
1092 borderTopWidth: '0px'});
1094 if (parseInt(getCookie("ttrss_ci_height")) > 0) {
1095 dijit.byId("content-insert").domNode.setStyle(
1096 {height: getCookie("ttrss_ci_height") + "px" });
1099 $("headlines-frame").setStyle({ borderBottomWidth: '1px' });
1100 $("headlines-frame").removeClassName("wide");
1104 closeArticlePanel();
1106 if (article_id) view(article_id);
1108 new Ajax.Request("backend.php", {
1109 parameters: "op=rpc&method=setpanelmode&wide=" + (wide ? 1 : 0),
1110 onComplete: function(transport) {
1111 console.log(transport.responseText);
1116 exception_error("switchPanelMode", e);
1120 function update_random_feed() {
1122 console.log("in update_random_feed");
1124 new Ajax.Request("backend.php", {
1125 parameters: "op=rpc&method=updateRandomFeed",
1126 onComplete: function(transport) {
1127 handle_rpc_json(transport, true);
1128 window.setTimeout("update_random_feed()", 30*1000);
1132 exception_error("update_random_feed", e);
1136 function hash_get(key) {
1138 kv = window.location.hash.substring(1).toQueryParams();
1141 exception_error("hash_get", e);
1144 function hash_set(key, value) {
1146 kv = window.location.hash.substring(1).toQueryParams();
1148 window.location.hash = $H(kv).toQueryString();
1150 exception_error("hash_set", e);