-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarkread_plus.js
70 lines (57 loc) · 2.08 KB
/
markread_plus.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function enh_mark_read() {
var feed = getActiveFeedId();
var is_cat = activeFeedIsCat();
var query = "backend.php?op=pluginhandler&plugin=markread_plus&method=setmarkenhanced"+
"&feed="+ feed + "&is_cat=" + is_cat;
if (dijit.byId("enhmarkDlg"))
dijit.byId("enhmarkDlg").destroyRecursive();
var dialog = new dijit.Dialog({
id: "enhmarkDlg",
title: __("Mark Read/Unread"),
style: "width: 400px",
execute: function() {
if (this.validate()) {
var feed = getActiveFeedId();
var is_cat = activeFeedIsCat();
var period = document.getElementsByName('enhmarkPeriod')[0].value;
var duration = document.getElementsByName('enhmarkDuration')[0].value;
var marktype = document.getElementsByName('enhmarkType')[0].value;
var markexpr = document.getElementsByName('enhmarkexpr')[0].value;
console.log(period + ':' + duration + ':type=' + marktype);
catchup_enhmark(period,duration, feed, is_cat,marktype, markexpr);
this.hide();
}
},
href: query});
dialog.show();
}
function catchup_enhmark(period, duration, feed, is_cat,marktype, markexpr)
{
if (is_cat == undefined) is_cat = false;
var fn = getFeedName(feed, is_cat);
console.log('fn is ' + fn);
var str = ""+ fn;
markexpr = (markexpr != null && markexpr != "")? "&markexpr=" + encodeURI(markexpr) : "";
var catchup_query = "&period=" + period + "&duration=" + duration +
"&feed_id=" + feed + "&is_cat=" + is_cat + "&marktype=" + marktype + markexpr;
console.log('****** query : ' + catchup_query);
notify_progress("Loading, please wait...", true);
new Ajax.Request("backend.php?op=pluginhandler&plugin=markread_plus&method=catchupMarkehanced",
{
parameters: catchup_query,
onComplete: function(transport) {
handle_rpc_json(transport);
var show_next_feed = getInitParam("on_catchup_show_next_feed") == "1";
if (show_next_feed) {
var nuf = getNextUnreadFeed(feed, is_cat);
if (nuf) {
viewfeed(nuf, '', is_cat);
}
} else {
if (feed == getActiveFeedId() && is_cat == activeFeedIsCat()) {
viewCurrentFeed();
}
}
notify("");
} });
}