summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/deprecated.js23
-rw-r--r--js/feedlist.js24
-rwxr-xr-xjs/functions.js125
-rwxr-xr-xjs/prefs.js170
-rw-r--r--js/tt-rss.js5
-rwxr-xr-xjs/viewfeed.js4
6 files changed, 31 insertions, 320 deletions
diff --git a/js/deprecated.js b/js/deprecated.js
deleted file mode 100644
index dd286aa7f..000000000
--- a/js/deprecated.js
+++ /dev/null
@@ -1,23 +0,0 @@
-function selectTableRow(r, do_select) {
-
- if (do_select) {
- r.addClassName("Selected");
- } else {
- r.removeClassName("Selected");
- }
-}
-
-function selectTableRowById(elem_id, check_id, do_select) {
- var row = $(elem_id);
-
- if (row) {
- selectTableRow(row, do_select);
- }
-
- var check = $(check_id);
-
- if (check) {
- check.checked = do_select;
- }
-}
-
diff --git a/js/feedlist.js b/js/feedlist.js
index 887d84453..1e783f3b3 100644
--- a/js/feedlist.js
+++ b/js/feedlist.js
@@ -198,6 +198,28 @@ function feedlist_init() {
hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
+ if (getInitParam("is_default_pw")) {
+ console.warn("user password is at default value");
+
+ var dialog = new dijit.Dialog({
+ title: __("Your password is at default value"),
+ href: "backend.php?op=dlg&method=defaultpasswordwarning",
+ id: 'infoBox',
+ style: "width: 600px",
+ onCancel: function() {
+ return true;
+ },
+ onExecute: function() {
+ return true;
+ },
+ onClose: function() {
+ return true;
+ }
+ });
+
+ dialog.show();
+ }
+
// bw_limit disables timeout() so we request initial counters separately
if (getInitParam("bw_limit") == "1") {
request_counters(true);
@@ -304,7 +326,7 @@ function parse_counters(elems) {
if (id > 0) {
if (has_img) {
setFeedIcon(id, false,
- getInitParam("icons_url") + "/" + id + ".ico");
+ getInitParam("icons_url") + "/" + id + ".ico?" + has_img);
} else {
setFeedIcon(id, false, 'images/blank_icon.gif');
}
diff --git a/js/functions.js b/js/functions.js
index aff20a33c..4c5d67f6c 100755
--- a/js/functions.js
+++ b/js/functions.js
@@ -96,17 +96,7 @@ function exception_error(e, e_compat, filename, lineno, colno) {
}
function param_escape(arg) {
- if (typeof encodeURIComponent != 'undefined')
- return encodeURIComponent(arg);
- else
- return escape(arg);
-}
-
-function param_unescape(arg) {
- if (typeof decodeURIComponent != 'undefined')
- return decodeURIComponent(arg);
- else
- return unescape(arg);
+ return encodeURIComponent(arg);
}
function notify_real(msg, no_hide, n_type) {
@@ -255,50 +245,11 @@ function gotoMain() {
document.location.href = "index.php";
}
-/** * @(#)isNumeric.js * * Copyright (c) 2000 by Sundar Dorai-Raj
- * * @author Sundar Dorai-Raj
- * * Email: sdoraira@vt.edu
- * * This program is free software; you can redistribute it and/or
- * * modify it under the terms of the GNU General Public License
- * * as published by the Free Software Foundation; either version 2
- * * of the License, or (at your option) any later version,
- * * provided that any use properly credits the author.
- * * This program is distributed in the hope that it will be useful,
- * * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * * GNU General Public License for more details at http://www.gnu.org * * */
-
- var numbers=".0123456789";
- function isNumeric(x) {
- // is x a String or a character?
- if(x.length>1) {
- // remove negative sign
- x=Math.abs(x)+"";
- for(var j=0;j<x.length;j++) {
- // call isNumeric recursively for each character
- number=isNumeric(x.substring(j,j+1));
- if(!number) return number;
- }
- return number;
- }
- else {
- // if x is number return true
- if(numbers.indexOf(x)>=0) return true;
- return false;
- }
- }
-
-
function toggleSelectRowById(sender, id) {
var row = $(id);
return toggleSelectRow(sender, row);
}
-function toggleSelectListRow(sender) {
- var row = sender.parentNode;
- return toggleSelectRow(sender, row);
-}
-
/* this is for dijit Checkbox */
function toggleSelectListRow2(sender) {
var row = sender.domNode.parentNode;
@@ -345,20 +296,11 @@ function checkboxToggleElement(elem, id) {
}
}
-function dropboxSelect(e, v) {
- for (var i = 0; i < e.length; i++) {
- if (e[i].value == v) {
- e.selectedIndex = i;
- break;
- }
- }
-}
-
function getURLParam(param){
return String(window.location.href).parseQuery()[param];
}
-function closeInfoBox(cleanup) {
+function closeInfoBox() {
dialog = dijit.byId("infoBox");
if (dialog) dialog.hide();
@@ -530,13 +472,6 @@ function strip_tags(s) {
return s.replace(/<\/?[^>]+(>|$)/g, "");
}
-function truncate_string(s, length) {
- if (!length) length = 30;
- var tmp = s.substring(0, length);
- if (s.length > length) tmp += "&hellip;";
- return tmp;
-}
-
function hotkey_prefix_timeout() {
var date = new Date();
@@ -739,7 +674,6 @@ function quickAddFeed() {
dialog.show_error(__("XML validation failed: %s").
replace("%s", rc['message']));
break;
- break;
case 0:
dialog.show_error(__("You are already subscribed to this feed."));
break;
@@ -1200,31 +1134,6 @@ function backend_sanity_check_callback(transport) {
}
-function quickAddCat(elem) {
- var cat = prompt(__("Please enter category title:"));
-
- if (cat) {
-
- var query = "?op=rpc&method=quickAddCat&cat=" + param_escape(cat);
-
- notify_progress("Loading, please wait...", true);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function (transport) {
- var response = transport.responseXML;
- var select = response.getElementsByTagName("select")[0];
- var options = select.getElementsByTagName("option");
-
- dropbox_replace_options(elem, options);
-
- notify('');
-
- } });
-
- }
-}
-
function genUrlChangeKey(feed, is_cat) {
var ok = confirm(__("Generate new syndication address for this feed?"));
@@ -1263,34 +1172,6 @@ function genUrlChangeKey(feed, is_cat) {
return false;
}
-function dropbox_replace_options(elem, options) {
- while (elem.hasChildNodes())
- elem.removeChild(elem.firstChild);
-
- var sel_idx = -1;
-
- for (var i = 0; i < options.length; i++) {
- var text = options[i].firstChild.nodeValue;
- var value = options[i].getAttribute("value");
-
- if (value == undefined) value = text;
-
- var issel = options[i].getAttribute("selected") == "1";
-
- var option = new Option(text, value, issel);
-
- if (options[i].getAttribute("disabled"))
- option.setAttribute("disabled", true);
-
- elem.insert(option);
-
- if (issel) sel_idx = i;
- }
-
- // Chrome doesn't seem to just select stuff when you pass new Option(x, y, true)
- if (sel_idx >= 0) elem.selectedIndex = sel_idx;
-}
-
// mode = all, none, invert
function selectTableRows(id, mode) {
var rows = $(id).rows;
@@ -1361,7 +1242,7 @@ function getSelectedTableRowIds(id) {
return rows;
}
-function editFeed(feed, event) {
+function editFeed(feed) {
if (feed <= 0)
return alert(__("You can't edit this kind of feed."));
diff --git a/js/prefs.js b/js/prefs.js
index 34ccbac90..a3f32dcbc 100755
--- a/js/prefs.js
+++ b/js/prefs.js
@@ -9,7 +9,7 @@ function notify_callback2(transport, sticky) {
notify_info(transport.responseText, sticky);
}
-function updateFeedList(sort_key) {
+function updateFeedList() {
var user_search = $("feed_search");
var search = "";
@@ -83,7 +83,7 @@ function addUser() {
}
-function editUser(id, event) {
+function editUser(id) {
var query = "backend.php?op=pref-users&method=edit&id=" +
param_escape(id);
@@ -401,65 +401,6 @@ function removeSelectedFeeds() {
return false;
}
-function clearSelectedFeeds() {
-
- var sel_rows = getSelectedFeeds();
-
- if (sel_rows.length > 1) {
- alert(__("Please select only one feed."));
- return;
- }
-
- if (sel_rows.length > 0) {
-
- var ok = confirm(__("Erase all non-starred articles in selected feed?"));
-
- if (ok) {
- notify_progress("Clearing selected feed...");
- clearFeedArticles(sel_rows[0]);
- }
-
- } else {
-
- alert(__("No feeds are selected."));
-
- }
-
- return false;
-}
-
-function purgeSelectedFeeds() {
-
- var sel_rows = getSelectedFeeds();
-
- if (sel_rows.length > 0) {
-
- var pr = prompt(__("How many days of articles to keep (0 - use default)?"), "0");
-
- if (pr != undefined) {
- notify_progress("Purging selected feed...");
-
- var query = "?op=rpc&method=purge&ids="+
- param_escape(sel_rows.toString()) + "&days=" + pr;
-
- console.log(query);
-
- new Ajax.Request("prefs.php", {
- parameters: query,
- onComplete: function(transport) {
- notify('');
- } });
- }
-
- } else {
-
- alert(__("No feeds are selected."));
-
- }
-
- return false;
-}
-
function editSelectedUser() {
var rows = getSelectedUsers();
@@ -808,7 +749,7 @@ function updateSystemList() {
} });
}
-function selectTab(id, noupdate, method) {
+function selectTab(id, noupdate) {
if (!noupdate) {
notify_progress("Loading, please wait...");
@@ -1177,107 +1118,6 @@ function opmlRegenKey() {
return false;
}
-function feedActionChange() {
- var chooser = $("feedActionChooser");
- var opid = chooser[chooser.selectedIndex].value;
-
- chooser.selectedIndex = 0;
- feedActionGo(opid);
-}
-
-function feedActionGo(op) {
- if (op == "facEdit") {
-
- var rows = getSelectedFeeds();
-
- if (rows.length > 1) {
- editSelectedFeeds();
- } else {
- editSelectedFeed();
- }
- }
-
- if (op == "facClear") {
- clearSelectedFeeds();
- }
-
- if (op == "facPurge") {
- purgeSelectedFeeds();
- }
-
- if (op == "facEditCats") {
- editFeedCats();
- }
-
- if (op == "facRescore") {
- rescoreSelectedFeeds();
- }
-
- if (op == "facUnsubscribe") {
- removeSelectedFeeds();
- }
-}
-
-function clearFeedArticles(feed_id) {
-
- notify_progress("Clearing feed...");
-
- var query = "?op=pref-feeds&quiet=1&method=clear&id=" + feed_id;
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- notify('');
- } });
-
- return false;
-}
-
-function rescoreSelectedFeeds() {
-
- var sel_rows = getSelectedFeeds();
-
- if (sel_rows.length > 0) {
-
- //var ok = confirm(__("Rescore last 100 articles in selected feeds?"));
- var ok = confirm(__("Rescore articles in selected feeds?"));
-
- if (ok) {
- notify_progress("Rescoring selected feeds...", true);
-
- var query = "?op=pref-feeds&method=rescore&quiet=1&ids="+
- param_escape(sel_rows.toString());
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- notify_callback2(transport);
- } });
-
- }
- } else {
- alert(__("No feeds are selected."));
- }
-
- return false;
-}
-
-function rescore_all_feeds() {
- var ok = confirm(__("Rescore all articles? This operation may take a lot of time."));
-
- if (ok) {
- notify_progress("Rescoring feeds...", true);
-
- var query = "?op=pref-feeds&method=rescoreAll&quiet=1";
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- notify_callback2(transport);
- } });
- }
-}
-
function labelColorReset() {
var labels = getSelectedLabels();
@@ -1479,7 +1319,7 @@ function resetCatOrder() {
});
}
-function editCat(id, item, event) {
+function editCat(id, item) {
var new_name = prompt(__('Rename category to:'), item.name);
if (new_name && new_name != item.name) {
@@ -1500,7 +1340,7 @@ function editCat(id, item, event) {
}
}
-function editLabel(id, event) {
+function editLabel(id) {
var query = "backend.php?op=pref-labels&method=edit&id=" +
param_escape(id);
diff --git a/js/tt-rss.js b/js/tt-rss.js
index b498b5e99..4df1b04ee 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -365,7 +365,6 @@ function init_hotkey_actions() {
hotkey_actions["open_in_new_window"] = function() {
if (getActiveArticleId()) {
openArticleInNewWindow(getActiveArticleId());
- return;
}
};
hotkey_actions["catchup_below"] = function() {
@@ -375,13 +374,9 @@ function init_hotkey_actions() {
catchupRelativeToArticle(0);
};
hotkey_actions["article_scroll_down"] = function() {
- var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
-
scrollArticle(40);
};
hotkey_actions["article_scroll_up"] = function() {
- var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
-
scrollArticle(-40);
};
hotkey_actions["close_article"] = function() {
diff --git a/js/viewfeed.js b/js/viewfeed.js
index e0ad2dd32..ffd8fcf46 100755
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -423,11 +423,9 @@ function toggleMark(id, client_only) {
if (!row.hasClassName("marked")) {
img.src = img.src.replace("mark_unset", "mark_set");
- img.alt = __("Unstar article");
query = query + "&mark=1";
} else {
img.src = img.src.replace("mark_set", "mark_unset");
- img.alt = __("Star article");
query = query + "&mark=0";
}
}
@@ -477,11 +475,9 @@ function togglePub(id, client_only, no_effects, note) {
if (!row.hasClassName("published") || note != undefined) {
img.src = img.src.replace("pub_unset", "pub_set");
- img.alt = __("Unpublish article");
query = query + "&pub=1";
} else {
img.src = img.src.replace("pub_set", "pub_unset");
- img.alt = __("Publish article");
query = query + "&pub=0";
}
}