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.ValidationTextBox");
235 dojo.require("dijit.InlineEditBox");
236 dojo.require("dijit.layout.AccordionContainer");
237 dojo.require("dijit.layout.BorderContainer");
238 dojo.require("dijit.layout.ContentPane");
239 dojo.require("dijit.layout.TabContainer");
240 dojo.require("dijit.Menu");
241 dojo.require("dijit.ProgressBar");
242 dojo.require("dijit.ProgressBar");
243 dojo.require("dijit.Toolbar");
244 dojo.require("dijit.Tree");
245 dojo.require("dijit.tree.dndSource");
246 dojo.require("dojo.data.ItemFileWriteStore");
250 if (!genericSanityCheck())
253 loading_set_progress(30);
255 var a = document.createElement('audio');
257 var hasAudio = !!a.canPlayType;
258 var hasSandbox = "sandbox" in document.createElement("iframe");
259 var hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
260 var clientTzOffset = new Date().getTimezoneOffset() * 60;
262 new Ajax.Request("backend.php", {
263 parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
265 clientTzOffset: clientTzOffset,
266 hasSandbox: hasSandbox},
267 onComplete: function(transport) {
268 backend_sanity_check_callback(transport);
271 hotkey_actions["next_feed"] = function() {
272 var rv = dijit.byId("feedTree").getNextFeed(
273 getActiveFeedId(), activeFeedIsCat());
275 if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true);
277 hotkey_actions["prev_feed"] = function() {
278 var rv = dijit.byId("feedTree").getPreviousFeed(
279 getActiveFeedId(), activeFeedIsCat());
281 if (rv) viewfeed(rv[0], '', rv[1], null, null, null, true);
283 hotkey_actions["next_article"] = function() {
286 hotkey_actions["prev_article"] = function() {
289 hotkey_actions["next_article_noscroll"] = function() {
290 moveToPost('next', true);
292 hotkey_actions["prev_article_noscroll"] = function() {
293 moveToPost('prev', true);
295 hotkey_actions["next_article_noexpand"] = function() {
296 moveToPost('next', true, true);
298 hotkey_actions["prev_article_noexpand"] = function() {
299 moveToPost('prev', true, true);
301 hotkey_actions["collapse_article"] = function() {
302 var id = getActiveArticleId();
303 var elem = $("CICD-"+id);
305 cdmCollapseArticle(null, id);
308 cdmExpandArticle(id);
311 hotkey_actions["toggle_expand"] = function() {
312 var id = getActiveArticleId();
313 var elem = $("CICD-"+id);
315 cdmCollapseArticle(null, id, false);
318 cdmExpandArticle(id);
321 hotkey_actions["search_dialog"] = function() {
324 hotkey_actions["toggle_mark"] = function() {
325 selectionToggleMarked(undefined, false, true);
327 hotkey_actions["toggle_publ"] = function() {
328 selectionTogglePublished(undefined, false, true);
330 hotkey_actions["toggle_unread"] = function() {
331 selectionToggleUnread(undefined, false, true);
333 hotkey_actions["edit_tags"] = function() {
334 var id = getActiveArticleId();
339 hotkey_actions["dismiss_selected"] = function() {
340 dismissSelectedArticles();
342 hotkey_actions["dismiss_read"] = function() {
343 dismissReadArticles();
345 hotkey_actions["open_in_new_window"] = function() {
346 if (getActiveArticleId()) {
347 openArticleInNewWindow(getActiveArticleId());
351 hotkey_actions["catchup_below"] = function() {
352 catchupRelativeToArticle(1);
354 hotkey_actions["catchup_above"] = function() {
355 catchupRelativeToArticle(0);
357 hotkey_actions["article_scroll_down"] = function() {
358 var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
362 hotkey_actions["article_scroll_up"] = function() {
363 var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
367 hotkey_actions["close_article"] = function() {
369 if (!getInitParam("cdm_expanded")) {
370 cdmCollapseArticle(false, getActiveArticleId());
372 dismissArticle(getActiveArticleId());
378 hotkey_actions["email_article"] = function() {
379 if (typeof emailArticle != "undefined") {
381 } else if (typeof mailtoArticle != "undefined") {
384 alert(__("Please enable mail plugin first."));
387 hotkey_actions["select_all"] = function() {
388 selectArticles('all');
390 hotkey_actions["select_unread"] = function() {
391 selectArticles('unread');
393 hotkey_actions["select_marked"] = function() {
394 selectArticles('marked');
396 hotkey_actions["select_published"] = function() {
397 selectArticles('published');
399 hotkey_actions["select_invert"] = function() {
400 selectArticles('invert');
402 hotkey_actions["select_none"] = function() {
403 selectArticles('none');
405 hotkey_actions["feed_refresh"] = function() {
406 if (getActiveFeedId() != undefined) {
407 viewfeed(getActiveFeedId(), '', activeFeedIsCat());
411 hotkey_actions["feed_unhide_read"] = function() {
414 hotkey_actions["feed_subscribe"] = function() {
417 hotkey_actions["feed_debug_update"] = function() {
418 window.open("backend.php?op=feeds&method=view&feed=" + getActiveFeedId() +
419 "&view_mode=adaptive&order_by=default&update=&m=ForceUpdate&cat=" +
420 activeFeedIsCat() + "&DevForceUpdate=1&debug=1&xdebug=1&csrf_token=" +
421 getInitParam("csrf_token"));
423 hotkey_actions["feed_edit"] = function() {
424 if (activeFeedIsCat())
425 alert(__("You can't edit this kind of feed."));
427 editFeed(getActiveFeedId());
429 hotkey_actions["feed_catchup"] = function() {
430 if (getActiveFeedId() != undefined) {
431 catchupCurrentFeed();
435 hotkey_actions["feed_reverse"] = function() {
436 reverseHeadlineOrder();
438 hotkey_actions["catchup_all"] = function() {
441 hotkey_actions["cat_toggle_collapse"] = function() {
442 if (activeFeedIsCat()) {
443 dijit.byId("feedTree").collapseCat(getActiveFeedId());
447 hotkey_actions["goto_all"] = function() {
450 hotkey_actions["goto_fresh"] = function() {
453 hotkey_actions["goto_marked"] = function() {
456 hotkey_actions["goto_published"] = function() {
459 hotkey_actions["goto_tagcloud"] = function() {
460 displayDlg(__("Tag cloud"), "printTagCloud");
462 hotkey_actions["goto_prefs"] = function() {
465 hotkey_actions["select_article_cursor"] = function() {
466 var id = getArticleUnderPointer();
468 var row = $("RROW-" + id);
471 var cb = dijit.getEnclosingWidget(
472 row.getElementsByClassName("rchk")[0]);
475 cb.attr("checked", !cb.attr("checked"));
476 toggleSelectRowById(cb, "RROW-" + id);
482 hotkey_actions["create_label"] = function() {
485 hotkey_actions["create_filter"] = function() {
488 hotkey_actions["collapse_sidebar"] = function() {
491 hotkey_actions["toggle_embed_original"] = function() {
492 if (typeof embedOriginalArticle != "undefined") {
493 if (getActiveArticleId())
494 embedOriginalArticle(getActiveArticleId());
496 alert(__("Please enable embed_original plugin first."));
499 hotkey_actions["toggle_widescreen"] = function() {
501 _widescreen_mode = !_widescreen_mode;
503 // reset stored sizes because geometry changed
504 setCookie("ttrss_ci_width", 0);
505 setCookie("ttrss_ci_height", 0);
507 switchPanelMode(_widescreen_mode);
510 hotkey_actions["help_dialog"] = function() {
513 hotkey_actions["toggle_combined_mode"] = function() {
514 notify_progress("Loading, please wait...");
516 var value = isCdmMode() ? "false" : "true";
517 var query = "?op=rpc&method=setpref&key=COMBINED_DISPLAY_MODE&value=" + value;
519 new Ajax.Request("backend.php", {
521 onComplete: function(transport) {
522 setInitParam("combined_display_mode",
523 !getInitParam("combined_display_mode"));
530 hotkey_actions["toggle_cdm_expanded"] = function() {
531 notify_progress("Loading, please wait...");
533 var value = getInitParam("cdm_expanded") ? "false" : "true";
534 var query = "?op=rpc&method=setpref&key=CDM_EXPANDED&value=" + value;
536 new Ajax.Request("backend.php", {
538 onComplete: function(transport) {
539 setInitParam("cdm_expanded", !getInitParam("cdm_expanded"));
546 exception_error("init", e);
550 function init_second_stage() {
553 dojo.addOnLoad(function() {
557 if (parseInt(getCookie("ttrss_fh_width")) > 0) {
558 dijit.byId("feeds-holder").domNode.setStyle(
559 {width: getCookie("ttrss_fh_width") + "px" });
562 dijit.byId("main").resize();
564 var tmph = dojo.connect(dijit.byId('feeds-holder'), 'resize',
566 if (args && args.w >= 0) {
567 setCookie("ttrss_fh_width", args.w, getInitParam("cookie_lifetime"));
571 var tmph = dojo.connect(dijit.byId('content-insert'), 'resize',
573 if (args && args.w >= 0 && args.h >= 0) {
574 setCookie("ttrss_ci_width", args.w, getInitParam("cookie_lifetime"));
575 setCookie("ttrss_ci_height", args.h, getInitParam("cookie_lifetime"));
581 delCookie("ttrss_test");
583 var toolbar = document.forms["main_toolbar_form"];
585 dijit.getEnclosingWidget(toolbar.view_mode).attr('value',
586 getInitParam("default_view_mode"));
588 dijit.getEnclosingWidget(toolbar.order_by).attr('value',
589 getInitParam("default_view_order_by"));
591 feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
593 var hash_feed_id = hash_get('f');
594 var hash_feed_is_cat = hash_get('c') == "1";
596 if (hash_feed_id != undefined) {
597 setActiveFeedId(hash_feed_id, hash_feed_is_cat);
600 loading_set_progress(50);
602 // can't use cache_clear() here because viewfeed might not have initialized yet
603 if ('sessionStorage' in window && window['sessionStorage'] !== null)
604 sessionStorage.clear();
606 var hotkeys = getInitParam("hotkeys");
609 for (sequence in hotkeys[1]) {
610 filtered = sequence.replace(/\|.*$/, "");
611 tmp[filtered] = hotkeys[1][sequence];
615 setInitParam("hotkeys", hotkeys);
617 _widescreen_mode = getInitParam("widescreen");
618 switchPanelMode(_widescreen_mode);
620 console.log("second stage ok");
622 if (getInitParam("simple_update")) {
623 console.log("scheduling simple feed updater...");
624 window.setTimeout("update_random_feed()", 30*1000);
628 exception_error("init_second_stage", e);
632 function quickMenuGo(opid) {
642 displayDlg(__("Tag cloud"), "printTagCloud");
645 displayDlg(__("Select item(s) by tags"), "printTagSelect");
654 window.location.href = "backend.php?op=digest";
657 if (activeFeedIsCat())
658 alert(__("You can't edit this kind of feed."));
660 editFeed(getActiveFeedId());
662 case "qmcRemoveFeed":
663 var actid = getActiveFeedId();
665 if (activeFeedIsCat()) {
666 alert(__("You can't unsubscribe from the category."));
671 alert(__("Please select some feed first."));
675 var fn = getFeedName(actid);
677 var pr = __("Unsubscribe from %s?").replace("%s", fn);
680 unsubscribeFeed(actid);
683 case "qmcCatchupAll":
686 case "qmcShowOnlyUnread":
695 case "qmcRescoreFeed":
696 rescoreCurrentFeed();
698 case "qmcToggleWidescreen":
700 _widescreen_mode = !_widescreen_mode;
702 // reset stored sizes because geometry changed
703 setCookie("ttrss_ci_width", 0);
704 setCookie("ttrss_ci_height", 0);
706 switchPanelMode(_widescreen_mode);
713 console.log("quickMenuGo: unknown action: " + opid);
717 exception_error("quickMenuGo", e);
721 function toggleDispRead() {
724 var hide = !(getInitParam("hide_read_feeds") == "1");
726 hideOrShowFeeds(hide);
728 var query = "?op=rpc&method=setpref&key=HIDE_READ_FEEDS&value=" +
731 setInitParam("hide_read_feeds", hide);
733 new Ajax.Request("backend.php", {
735 onComplete: function(transport) {
739 exception_error("toggleDispRead", e);
743 function parse_runtime_info(data) {
745 //console.log("parsing runtime info...");
750 // console.log("RI: " + k + " => " + v);
752 if (k == "new_version_available") {
754 Element.show(dijit.byId("newVersionIcon").domNode);
756 Element.hide(dijit.byId("newVersionIcon").domNode);
761 if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) {
762 if (parseInt(getInitParam("dep_ts")) < parseInt(v) && getInitParam("reload_on_ts_change")) {
763 window.location.reload();
767 if (k == "daemon_is_running" && v != 1) {
768 notify_error("<span onclick=\"javascript:explainError(1)\">Update daemon is not running.</span>", true);
772 if (k == "daemon_stamp_ok" && v != 1) {
773 notify_error("<span onclick=\"javascript:explainError(3)\">Update daemon is not updating feeds.</span>", true);
777 if (k == "max_feed_id" || k == "num_feeds") {
778 if (init_params[k] != v) {
779 console.log("feed count changed, need to reload feedlist.");
788 PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
791 function collapse_feedlist() {
794 if (!Element.visible('feeds-holder')) {
795 Element.show('feeds-holder');
796 $("collapse_feeds_btn").innerHTML = "<<";
798 Element.hide('feeds-holder');
799 $("collapse_feeds_btn").innerHTML = ">>";
802 dijit.byId("main").resize();
805 exception_error("collapse_feedlist", e);
809 function viewModeChanged() {
811 return viewCurrentFeed('');
814 function rescoreCurrentFeed() {
816 var actid = getActiveFeedId();
818 if (activeFeedIsCat() || actid < 0) {
819 alert(__("You can't rescore this kind of feed."));
824 alert(__("Please select some feed first."));
828 var fn = getFeedName(actid);
829 var pr = __("Rescore articles in %s?").replace("%s", fn);
832 notify_progress("Rescoring articles...");
834 var query = "?op=pref-feeds&method=rescore&quiet=1&ids=" + actid;
836 new Ajax.Request("backend.php", {
838 onComplete: function(transport) {
844 function hotkey_handler(e) {
847 if (e.target.nodeName == "INPUT" || e.target.nodeName == "TEXTAREA") return;
850 var shift_key = false;
851 var ctrl_key = false;
853 var meta_key = false;
855 var cmdline = $('cmdline');
857 shift_key = e.shiftKey;
858 ctrl_key = e.ctrlKey;
860 meta_key = e.metaKey;
863 keycode = window.event.keyCode;
868 var keychar = String.fromCharCode(keycode);
870 if (keycode == 27) { // escape
871 hotkey_prefix = false;
874 if (keycode == 16) return; // ignore lone shift
875 if (keycode == 17) return; // ignore lone ctrl
877 keychar = keychar.toLowerCase();
879 var hotkeys = getInitParam("hotkeys");
881 if (!hotkey_prefix && hotkeys[0].indexOf(keychar) != -1) {
883 var date = new Date();
884 var ts = Math.round(date.getTime() / 1000);
886 hotkey_prefix = keychar;
887 hotkey_prefix_pressed = ts;
889 cmdline.innerHTML = keychar;
890 Element.show(cmdline);
895 Element.hide(cmdline);
897 var hotkey = keychar.search(/[a-zA-Z0-9]/) != -1 ? keychar : "(" + keycode + ")";
899 // ensure ^*char notation
900 if (shift_key) hotkey = "*" + hotkey;
901 if (ctrl_key) hotkey = "^" + hotkey;
902 if (alt_key) hotkey = "+" + hotkey;
903 if (meta_key) hotkey = "%" + hotkey;
905 hotkey = hotkey_prefix ? hotkey_prefix + " " + hotkey : hotkey;
906 hotkey_prefix = false;
908 var hotkey_action = false;
909 var hotkeys = getInitParam("hotkeys");
911 for (sequence in hotkeys[1]) {
912 if (sequence == hotkey) {
913 hotkey_action = hotkeys[1][sequence];
918 var action = hotkey_actions[hotkey_action];
920 if (action != null) {
926 exception_error("hotkey_handler", e);
930 function inPreferences() {
934 function reverseHeadlineOrder() {
937 /* var query_str = "?op=rpc&method=togglepref&key=REVERSE_HEADLINES";
939 new Ajax.Request("backend.php", {
940 parameters: query_str,
941 onComplete: function(transport) {
945 var toolbar = document.forms["main_toolbar_form"];
946 var order_by = dijit.getEnclosingWidget(toolbar.order_by);
948 var value = order_by.attr('value');
950 if (value == "date_reverse")
953 value = "date_reverse";
955 order_by.attr('value', value);
960 exception_error("reverseHeadlineOrder", e);
964 function newVersionDlg() {
966 var query = "backend.php?op=dlg&method=newVersion";
968 if (dijit.byId("newVersionDlg"))
969 dijit.byId("newVersionDlg").destroyRecursive();
971 dialog = new dijit.Dialog({
973 title: __("New version available!"),
974 style: "width: 600px",
981 exception_error("newVersionDlg", e);
985 function handle_rpc_json(transport, scheduled_call) {
987 var reply = JSON.parse(transport.responseText);
989 var netalert_dijit = dijit.byId("net-alert");
990 var netalert = false;
993 netalert = netalert_dijit.domNode;
997 var error = reply['error'];
1000 var code = error['code'];
1001 var msg = error['msg'];
1003 console.warn("[handle_rpc_json] received fatal error " + code + "/" + msg);
1006 fatalError(code, msg);
1011 var seq = reply['seq'];
1014 if (get_seq() != seq) {
1015 console.log("[handle_rpc_json] sequence mismatch: " + seq +
1016 " (want: " + get_seq() + ")");
1021 var message = reply['message'];
1024 if (message == "UPDATE_COUNTERS") {
1025 console.log("need to refresh counters...");
1026 setInitParam("last_article_id", -1);
1027 request_counters(true);
1031 var counters = reply['counters'];
1034 parse_counters(counters, scheduled_call);
1036 var runtime_info = reply['runtime-info'];
1039 parse_runtime_info(runtime_info);
1041 if (netalert) Element.hide(netalert);
1045 Element.show(netalert);
1047 notify_error("Communication problem with server.");
1052 Element.show(netalert);
1054 notify_error("Communication problem with server.");
1057 //exception_error("handle_rpc_json", e, transport);
1063 function switchPanelMode(wide) {
1065 if (isCdmMode()) return;
1067 article_id = getActiveArticleId();
1070 dijit.byId("headlines-wrap-inner").attr("design", 'sidebar');
1071 dijit.byId("content-insert").attr("region", "trailing");
1073 dijit.byId("content-insert").domNode.setStyle({width: '50%',
1075 borderTopWidth: '0px' });
1077 if (parseInt(getCookie("ttrss_ci_width")) > 0) {
1078 dijit.byId("content-insert").domNode.setStyle(
1079 {width: getCookie("ttrss_ci_width") + "px" });
1082 $("headlines-frame").setStyle({ borderBottomWidth: '0px' });
1083 $("headlines-frame").addClassName("wide");
1087 dijit.byId("content-insert").attr("region", "bottom");
1089 dijit.byId("content-insert").domNode.setStyle({width: 'auto',
1091 borderTopWidth: '0px'});
1093 if (parseInt(getCookie("ttrss_ci_height")) > 0) {
1094 dijit.byId("content-insert").domNode.setStyle(
1095 {height: getCookie("ttrss_ci_height") + "px" });
1098 $("headlines-frame").setStyle({ borderBottomWidth: '1px' });
1099 $("headlines-frame").removeClassName("wide");
1103 closeArticlePanel();
1105 if (article_id) view(article_id);
1107 new Ajax.Request("backend.php", {
1108 parameters: "op=rpc&method=setpanelmode&wide=" + (wide ? 1 : 0),
1109 onComplete: function(transport) {
1110 console.log(transport.responseText);
1115 exception_error("switchPanelMode", e);
1119 function update_random_feed() {
1121 console.log("in update_random_feed");
1123 new Ajax.Request("backend.php", {
1124 parameters: "op=rpc&method=updateRandomFeed",
1125 onComplete: function(transport) {
1126 handle_rpc_json(transport, true);
1127 window.setTimeout("update_random_feed()", 30*1000);
1131 exception_error("update_random_feed", e);
1135 function hash_get(key) {
1137 kv = window.location.hash.substring(1).toQueryParams();
1140 exception_error("hash_get", e);
1143 function hash_set(key, value) {
1145 kv = window.location.hash.substring(1).toQueryParams();
1147 window.location.hash = $H(kv).toQueryString();
1149 exception_error("hash_set", e);