var active_feed_cat = false;
-var active_tab = false;
var init_params = new Array();
try {
- var container = $('prefContent');
- container.innerHTML=transport.responseText;
+ dijit.byId('feedConfigTab').attr('content', transport.responseText);
+
selectTab("feedConfig", true);
if (caller_subop) {
}
function filterlist_callback2(transport) {
- var container = $('prefContent');
- container.innerHTML=transport.responseText;
+ dijit.byId('filterConfigTab').attr('content', transport.responseText);
notify("");
remove_splash();
}
try {
- var container = $('prefContent');
- closeInfoBox();
- container.innerHTML=transport.responseText;
+ dijit.byId('labelConfigTab').attr('content', transport.responseText);
+ closeInfoBox();
- init_label_inline_editor();
+ init_label_inline_editor();
- notify("");
- remove_splash();
+ notify("");
+ remove_splash();
} catch (e) {
exception_error("labellist_callback2", e);
function userlist_callback2(transport) {
try {
- var container = $('prefContent');
- if (transport.readyState == 4) {
- container.innerHTML=transport.responseText;
- notify("");
- remove_splash();
- }
+ dijit.byId('userConfigTab').attr('content', transport.responseText);
+
+ notify("");
+ remove_splash();
} catch (e) {
exception_error("userlist_callback2", e);
}
function prefslist_callback2(transport) {
try {
- var container = $('prefContent');
- container.innerHTML=transport.responseText;
+ dijit.byId('genConfigTab').attr('content', transport.responseText);
+
notify("");
remove_splash();
} catch (e) {
try {
if (!event || !event.ctrlKey) {
- disableHotkeys();
-
notify_progress("Loading, please wait...");
selectTableRows('prefUserList', 'none');
if (!event || !event.ctrlKey) {
- disableHotkeys();
-
notify_progress("Loading, please wait...");
selectTableRows('prefFilterList', 'none');
if (event && !event.ctrlKey) {
- disableHotkeys();
-
notify_progress("Loading, please wait...");
- selectTableRows('prefFeedList', 'none');
- selectTableRowById('FEEDR-'+feed, 'FRCHK-'+feed, true);
+// selectTableRows('prefFeedList', 'none');
+// selectTableRowById('FEEDR-'+feed, 'FRCHK-'+feed, true);
var query = "?op=pref-feeds&subop=editfeed&id=" +
param_escape(feed);
} });
} else if (event.ctrlKey) {
- var cb = $('FRCHK-' + feed);
- cb.checked = !cb.checked;
- toggleSelectRow(cb);
+// var cb = $('FRCHK-' + feed);
+// cb.checked = !cb.checked;
+// toggleSelectRow(cb);
}
}
function getSelectedFeeds() {
- return getSelectedTableRowIds("prefFeedList");
+ var tree = dijit.byId("feedTree");
+ var items = tree.model.getCheckedItems();
+ var rv = [];
+
+ items.each(function(item) {
+ rv.push(tree.model.store.getValue(item, 'bare_id'));
+ });
+
+ return rv;
}
function getSelectedFilters() {
notify("");
- disableHotkeys();
-
notify_progress("Loading, please wait...");
var query = "?op=pref-feeds&subop=editfeeds&ids=" +
}
function selectTab(id, noupdate, subop) {
-
-// alert(id);
-
- if (!id) id = active_tab;
-
try {
- try {
- if (id != active_tab) {
- var c = $('prefContent');
- c.scrollTop = 0;
- }
- } catch (e) { };
-
if (!noupdate) {
console.log("selectTab: " + id + "(NU: " + noupdate + ")");
} else if (id == "userConfig") {
updateUsersList();
}
+
+ var tab = dijit.byId(id + "Tab");
+ dijit.byId("pref-tabs").selectChild(tab);
+
}
/* clean selection from all tabs */
$(id + "Tab").addClassName("Selected");
- active_tab = id;
-
} catch (e) {
exception_error("selectTab", e);
}
function init_second_stage() {
try {
- active_tab = getInitParam("prefs_active_tab");
- if (!$(active_tab+"Tab")) active_tab = "genConfig";
- if (!active_tab || active_tab == '0') active_tab = "genConfig";
document.onkeydown = pref_hotkey_handler;
document.onmousedown = mouse_down_handler;
document.onmouseup = mouse_up_handler;
- var tab = getURLParam('tab');
-
caller_subop = getURLParam('subop');
if (getURLParam("subopparam")) {
caller_subop = caller_subop + ":" + getURLParam("subopparam");
}
- if (tab) {
- active_tab = tab;
- }
+ loading_set_progress(60);
- if (navigator.userAgent.match("Opera")) {
- setTimeout("selectTab()", 500);
- } else {
- selectTab(active_tab);
- }
notify("");
- loading_set_progress(60);
+ dojo.addOnLoad(function() {
+
+ var active_tab = getInitParam("prefs_active_tab");
+ if (!$(active_tab+"Tab")) active_tab = "genConfig";
+ if (!active_tab || active_tab == '0') active_tab = "genConfig";
+
+ var http_tab = getURLParam('tab');
+
+ if (http_tab) active_tab = http_tab;
+
+ var tab = dijit.byId(active_tab + "Tab");
+
+ if (tab) dijit.byId("pref-tabs").selectChild(tab);
+
+ });
setTimeout("hotkey_prefix_timeout()", 5*1000);
+ remove_splash();
} catch (e) {
exception_error("init_second_stage", e);
try {
+ dojo.require("dijit.layout.TabContainer");
+ dojo.require("dijit.layout.BorderContainer");
+ dojo.require("dijit.layout.AccordionContainer");
+ dojo.require("dijit.layout.ContentPane");
+ dojo.require("dijit.Dialog");
+ dojo.require("dijit.form.Button");
+ dojo.require("dijit.form.TextBox");
+ dojo.require("dijit.form.RadioButton");
+ dojo.require("dijit.form.Select");
+ dojo.require("dijit.Toolbar");
+ dojo.require("dojo.data.ItemFileWriteStore");
+ dojo.require("dijit.Tree");
+ dojo.require("dijit.form.DropDownButton");
+ dojo.require("dijit.Menu");
+ dojo.require("dijit.tree.dndSource");
+ dojo.require("dijit.TooltipDialog");
+
+ dojo.registerModulePath("lib", "..");
+ dojo.registerModulePath("fox", "../..");
+
+ dojo.require("lib.CheckBoxTree");
+ dojo.require("fox.PrefFeedTree");
+
loading_set_progress(30);
var query = "?op=rpc&subop=sanityCheck";
closeInfoBox();
}
- if (!hotkeys_enabled) {
+ var dialog = dijit.byId("infoBox");
+ var dialog_visible = false;
+
+ if (dialog)
+ dialog_visible = Element.visible(dialog.domNode);
+
+ if (dialog_visible || !hotkeys_enabled) {
console.log("hotkeys disabled");
return;
}
if (keycode == 16) return; // ignore lone shift
+ if (keycode == 17) return; // ignore lone ctrl
if ((keycode == 67 || keycode == 71) && !hotkey_prefix) {
hotkey_prefix = keycode;
return true;
}
+function resetFeedOrder() {
+ try {
+ notify_progress("Loading, please wait...");
+
+ new Ajax.Request("backend.php", {
+ parameters: "?op=pref-feeds&subop=feedsortreset",
+ onComplete: function(transport) {
+ updateFeedList();
+ } });
+
+
+ } catch (e) {
+ exception_error("resetFeedOrder");
+ }
+}
+
+function resetCatOrder() {
+ try {
+ notify_progress("Loading, please wait...");
+
+ new Ajax.Request("backend.php", {
+ parameters: "?op=pref-feeds&subop=catsortreset",
+ onComplete: function(transport) {
+ updateFeedList();
+ } });
+
+
+ } catch (e) {
+ exception_error("resetCatOrder");
+ }
+}
+
+function editCat(id, item, event) {
+ try {
+ var new_name = prompt(__('Rename category to:'), item.name);
+
+ if (new_name && new_name != item.name) {
+
+ notify_progress("Loading, please wait...");
+
+ new Ajax.Request("backend.php", {
+ parameters: {
+ op: 'pref-feeds',
+ subop: 'renamecat',
+ id: id,
+ title: new_name,
+ },
+ onComplete: function(transport) {
+ updateFeedList();
+ } });
+ }
+
+ } catch (e) {
+ exception_error("editCat", e);
+ }
+}