1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 03:35:56 +00:00

code cleanup

This commit is contained in:
Andrew Dolgov
2010-02-03 16:06:24 +03:00
parent d1277c7be5
commit d002edc715
8 changed files with 39 additions and 436 deletions

View File

@@ -202,10 +202,6 @@ function scheduleFeedUpdate(force) {
query_str = query_str + "&omode=" + omode;
query_str = query_str + "&uctr=" + global_unread;
var date = new Date();
var timestamp = Math.round(date.getTime() / 1000);
query_str = query_str + "&ts=" + timestamp
debug("REFETCH query: " + query_str);
new Ajax.Request("backend.php", {
@@ -234,10 +230,6 @@ function updateFeedList(silent, fetch) {
if (getActiveFeedId() && !activeFeedIsCat()) {
query_str = query_str + "&actid=" + getActiveFeedId();
}
var date = new Date();
var timestamp = Math.round(date.getTime() / 1000);
query_str = query_str + "&ts=" + timestamp
if (fetch) query_str = query_str + "&fetch=yes";
@@ -283,7 +275,6 @@ function viewCurrentFeed(subop) {
if (getActiveFeedId() != undefined) {
viewfeed(getActiveFeedId(), subop, activeFeedIsCat());
} else {
disableContainerChildren("headlinesToolbar", false, document);
// viewfeed(-1, subop); // FIXME
}
return false; // block unneeded form submits
@@ -363,8 +354,6 @@ function init() {
init_gears();
disableContainerChildren("headlinesToolbar", true);
Form.disable("main_toolbar_form");
if (!genericSanityCheck())
@@ -578,31 +567,6 @@ function quickMenuGo(opid) {
return;
}
if (opid == "qmcClearFeed") {
var actid = getActiveFeedId();
if (!actid) {
alert(__("Please select some feed first."));
return;
}
if (activeFeedIsCat() || actid < 0) {
alert(__("You can't clear this type of feed."));
return;
}
var fn = getFeedName(actid);
var pr = __("Erase all non-starred articles in %s?").replace("%s", fn);
if (confirm(pr)) {
clearFeedArticles(actid);
}
return;
}
if (opid == "qmcUpdateFeeds") {
scheduleFeedUpdate(true);
return;
@@ -868,21 +832,6 @@ function feedEditSave() {
}
}
function clearFeedArticles(feed_id) {
notify_progress("Clearing feed...");
var query = "?op=pref-feeds&quiet=1&subop=clear&id=" + feed_id;
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
dlg_frefresh_callback(transport, feed_id);
} });
return false;
}
function collapse_feedlist() {
try {
debug("collapse_feedlist");
@@ -1427,41 +1376,6 @@ function feedsSortByUnread() {
return feeds_sort_by_unread;
}
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);
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
updateFeedList();
} });
}
} catch (e) {
exception_error("addLabel", e);
}
}
function visitOfficialSite() {
window.open("http://tt-rss.org/");
}
function inPreferences() {
return false;
}