n.className = "notify";
} else if (n_type == 2) {
n.className = "notifyProgress";
- msg = "<img src='images/indicator_white.gif'> " + msg;
+ msg = "<img src='"+getInitParam("sign_progress")+"'> " + msg;
} else if (n_type == 3) {
n.className = "notifyError";
- msg = "<img src='images/sign_excl.gif'> " + msg;
+ msg = "<img src='"+getInitParam("sign_excl")+"'> " + msg;
} else if (n_type == 4) {
n.className = "notifyInfo";
- msg = "<img src='images/sign_info.gif'> " + msg;
+ msg = "<img src='"+getInitParam("sign_info")+"'> " + msg;
}
// msg = "<img src='images/live_com_loading.gif'> " + msg;
return unescape(dc.substring(begin + prefix.length, end));
}
-function disableContainerChildren(id, disable, doc) {
-
- if (!doc) doc = document;
-
- var container = $(id);
-
- if (!container) {
- //alert("disableContainerChildren: element " + id + " not found");
- return;
- }
-
- for (var i = 0; i < container.childNodes.length; i++) {
- var child = container.childNodes[i];
-
- try {
- child.disabled = disable;
- } catch (E) {
-
- }
-
- if (disable) {
- if (child.className && child.className.match("button")) {
- child.className = "disabledButton";
- }
- } else {
- if (child.className && child.className.match("disabledButton")) {
- child.className = "button";
- }
- }
- }
-
-}
-
function gotoPreferences() {
document.location.href = "prefs.php";
}
}
- if (row_needs_hl && getInitParam("theme") != 'neon') {
+ if (row_needs_hl &&
+ !getInitParam("theme_options").match('no_highlights')) {
new Effect.Highlight(feedr, {duration: 1, startcolor: "#fff7d5",
queue: { position:'end', scope: 'EFQ-' + id, limit: 1 } } );
var content = $(content_id);
if (!content) {
- alert("[selectTableRows] Element " + content_id + " not found.");
+ debug("[selectTableRows] Element " + content_id + " not found.");
return;
}
var content = $(content_id);
if (!content) {
- alert("[getSelectedTableRowIds] Element " + content_id + " not found.");
- return;
+ debug("[getSelectedTableRowIds] Element " + content_id + " not found.");
+ return new Array();
}
var sel_rows = new Array();
}
}
-
function getRelativeFeedId(list, id, direction, unread_only) {
var rows = list.getElementsByTagName("LI");
var feeds = new Array();
Element.hide("dialog_overlay");
Element.hide("infoBoxShadow");
- if (cleanup) $("infoBoxShadow").innerHTML = " ";
+ if (cleanup) $("infoBox").innerHTML = " ";
}
} catch (e) {
exception_error("closeInfoBox", e);
}
}
-function addLabelExample() {
- try {
- var form = document.forms["label_edit_form"];
-
- var text = form.sql_exp;
- var op = form.label_fields[form.label_fields.selectedIndex];
- var p = form.label_fields_param;
-
- if (op) {
- op = op.value;
-
- var tmp = "";
-
- if (text.value != "") {
- if (text.value.substring(text.value.length-3, 3).toUpperCase() != "AND") {
- tmp = " AND ";
- } else {
- tmp = " ";
- }
- }
-
- if (op == "unread") {
- tmp = tmp + "unread = true";
- }
-
- if (op == "updated") {
- tmp = tmp + "last_read is null and unread = false";
- }
-
- if (op == "kw_title") {
- if (p.value == "") {
- alert("This action requires a parameter.");
- return false;
- }
- tmp = tmp + "ttrss_entries.title like '%"+p.value+"%'";
- }
-
- if (op == "kw_content") {
- if (p.value == "") {
- alert("This action requires a parameter.");
- return false;
- }
-
- tmp = tmp + "ttrss_entries.content like '%"+p.value+"%'";
- }
-
- if (op == "scoreE") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "score = " + p.value;
- }
-
- if (op == "scoreG") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "score > " + p.value;
- }
-
- if (op == "scoreL") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "score < " + p.value;
- }
-
- if (op == "newerD") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
- tmp = tmp + "updated > NOW() - INTERVAL '"+parseInt(p.value)+" days'";
- }
-
- if (op == "newerH") {
- if (isNaN(parseInt(p.value))) {
- alert("This action expects numeric parameter.");
- return false;
- }
-
- tmp = tmp + "updated > NOW() - INTERVAL '"+parseInt(p.value)+" hours'";
- }
-
- text.value = text.value + tmp;
-
- p.value = "";
-
- }
-
- } catch (e) {
- exception_error("addLabelExample", e);
- }
-
- return false;
-}
-
-function labelFieldsCheck(elem) {
- try {
- var op = elem[elem.selectedIndex].value;
-
- var p = document.forms["label_edit_form"].label_fields_param;
-
- if (op == "kw_title" || op == "kw_content" || op == "scoreL" ||
- op == "scoreG" || op == "scoreE" || op == "newerD" ||
- op == "newerH" ) {
- Element.show(p);
- } else {
- Element.hide(p);
- }
-
- } catch (e) {
- exception_error("labelFieldsCheck", e);
-
- }
-}
-
function getSelectedFeedsFromBrowser() {
var list = $("browseFeedList");
- if (!list) list = $("browseBigFeedList");
var selected = new Array();
}
-function browseFeeds(limit) {
-
- try {
-
-/* var query = "?op=ialog&subop=browse";
-
- notify_progress("Loading, please wait...", true);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- infobox_callback2(transport);
- } }); */
-
- displayDlg('feedBrowser');
-
- return false;
- } catch (e) {
- exception_error("browseFeeds", e);
- }
-}
-
function transport_error_check(transport) {
try {
if (transport.responseXML) {
return tmp;
}
-/*
-function switchToFlash(e) {
- try {
- var targ = e;
- if (!e) var e = window.event;
- if (e.target) targ = e.target;
- else if (e.srcElement) targ = e.srcElement;
- if (targ.nodeType == 3) // defeat Safari bug
- targ = targ.parentNode;
-
- //targ is the link that was clicked
- var audioTag=targ;
- do {
- audioTag=audioTag.previousSibling;
- } while(audioTag && audioTag.nodeType != 1)
-
- var flashPlayer = audioTag.getElementsByTagName('span')[0];
- targ.parentNode.insertBefore(flashPlayer,targ);
- targ.parentNode.removeChild(targ);
- audioTag.parentNode.removeChild(audioTag);
-
- return false;
- } catch (e) {
- exception_error("switchToFlash", e);
- }
-}
-
-function html5AudioOrFlash(type) {
- var audioTag = document.createElement('audio');
- if(! audioTag.canPlayType || audioTag.canPlayType(type) == "no" ||
- audioTag.canPlayType(type) == ""){
- if($('switchToFlashLink')){
- switchToFlash($('switchToFlashLink'));
- }
- }
-} */
-
function hotkey_prefix_timeout() {
try {
}
}
+function addLabel() {
+
+ try {
+
+ var caption = prompt(__("Please enter label caption:"), "");
+
+ if (caption != undefined) {
+
+ if (caption == "") {
+ alert(__("Can't create label: missing caption."));
+ return false;
+ }
+
+ var query = "?op=pref-labels&subop=add&caption=" +
+ param_escape(caption);
+
+ notify_progress("Loading, please wait...", true);
+
+ if (inPreferences()) active_tab = "labelConfig";
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ if (inPreferences()) {
+ infobox_submit_callback2(transport);
+ } else {
+ updateFeedList();
+ }
+ } });
+
+ }
+
+ } catch (e) {
+ exception_error("addLabel", e);
+ }
+}
+
+function quickAddFeed() {
+ displayDlg('quickAddFeed', '',
+ function () {$('feed_url').focus();});
+}
+
+function quickAddFilter() {
+ displayDlg('quickAddFilter', '',
+ function () {document.forms['filter_add_form'].reg_exp.focus();});
+}
+
+function unsubscribeFeed(feed_id, title) {
+
+ var msg = __("Unsubscribe from %s?").replace("%s", title);
+
+ if (title == undefined || confirm(msg)) {
+ notify_progress("Removing feed...");
+
+ var query = "?op=pref-feeds&quiet=1&subop=remove&ids=" + feed_id;
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+
+ closeInfoBox();
+
+ if (inPreferences()) {
+ updateFeedList();
+ } else {
+ dlg_frefresh_callback(transport, feed_id);
+ }
+
+ } });
+ }
+
+ return false;
+}
+
+
+