fix report function in exception dialog
This commit is contained in:
parent
fb5662dec0
commit
be2f5e1a44
199
functions.js
199
functions.js
|
@ -33,13 +33,21 @@ function exception_error(location, e, ext_info) {
|
||||||
var content = "<div class=\"fatalError\">" +
|
var content = "<div class=\"fatalError\">" +
|
||||||
"<pre>" + msg + "</pre>";
|
"<pre>" + msg + "</pre>";
|
||||||
|
|
||||||
|
content += "<form name=\"exceptionForm\" id=\"exceptionForm\" target=\"_blank\" "+
|
||||||
|
"action=\"http://tt-rss.org/report.php\" method=\"POST\">";
|
||||||
|
|
||||||
|
content += "<textarea style=\"display : none\" name=\"message\">" + msg + "</textarea>";
|
||||||
|
content += "<textarea style=\"display : none\" name=\"params\">N/A</textarea>";
|
||||||
|
|
||||||
if (ext_info) {
|
if (ext_info) {
|
||||||
content += "<div><b>Additional information:</b></div>" +
|
content += "<div><b>Additional information:</b></div>" +
|
||||||
"<textarea readonly=\"1\">" + ext_info + "</textarea>";
|
"<textarea name=\"xinfo\" readonly=\"1\">" + ext_info + "</textarea>";
|
||||||
}
|
}
|
||||||
|
|
||||||
content += "<div><b>Stack trace:</b></div>" +
|
content += "<div><b>Stack trace:</b></div>" +
|
||||||
"<textarea readonly=\"1\">" + e.stack + "</textarea>";
|
"<textarea name=\"stack\" readonly=\"1\">" + e.stack + "</textarea>";
|
||||||
|
|
||||||
|
content += "</form>";
|
||||||
|
|
||||||
content += "</div>";
|
content += "</div>";
|
||||||
|
|
||||||
|
@ -49,7 +57,7 @@ function exception_error(location, e, ext_info) {
|
||||||
"onclick=\"dijit.byId('exceptionDlg').report()\">" +
|
"onclick=\"dijit.byId('exceptionDlg').report()\">" +
|
||||||
__('Report to tt-rss.org') + "</button> ";
|
__('Report to tt-rss.org') + "</button> ";
|
||||||
content += "<button dojoType=\"dijit.form.Button\" "+
|
content += "<button dojoType=\"dijit.form.Button\" "+
|
||||||
"onclick=\"dijit.byId('exceptionDlg').hide()\">" +
|
"onclick=\"dijit.byId('exceptionDlg').hide()\">" +
|
||||||
__('Close') + "</button>";
|
__('Close') + "</button>";
|
||||||
content += "</div>";
|
content += "</div>";
|
||||||
|
|
||||||
|
@ -61,19 +69,14 @@ function exception_error(location, e, ext_info) {
|
||||||
report: function() {
|
report: function() {
|
||||||
if (confirm(__("Are you sure to report this exception to tt-rss.org? The report will include your browser information. Your IP would be saved in the database."))) {
|
if (confirm(__("Are you sure to report this exception to tt-rss.org? The report will include your browser information. Your IP would be saved in the database."))) {
|
||||||
|
|
||||||
var params = $H({
|
document.forms['exceptionForm'].params.value = $H({
|
||||||
message: msg,
|
|
||||||
xinfo: ext_info,
|
|
||||||
stack: e.stack,
|
|
||||||
browserName: navigator.appName,
|
browserName: navigator.appName,
|
||||||
browserVersion: navigator.appVersion,
|
browserVersion: navigator.appVersion,
|
||||||
browserPlatform: navigator.platform,
|
browserPlatform: navigator.platform,
|
||||||
browserCookies: navigator.cookieEnabled,
|
browserCookies: navigator.cookieEnabled,
|
||||||
});
|
}).toQueryString();
|
||||||
|
|
||||||
var url = "http://tt-rss.org/report.php?" + params.toQueryString();
|
document.forms['exceptionForm'].submit();
|
||||||
|
|
||||||
window.open(url);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -92,8 +95,8 @@ function format_exception_error(location, e) {
|
||||||
|
|
||||||
if (e.fileName) {
|
if (e.fileName) {
|
||||||
var base_fname = e.fileName.substring(e.fileName.lastIndexOf("/") + 1);
|
var base_fname = e.fileName.substring(e.fileName.lastIndexOf("/") + 1);
|
||||||
|
|
||||||
msg = "Exception: " + e.name + ", " + e.message +
|
msg = "Exception: " + e.name + ", " + e.message +
|
||||||
"\nFunction: " + location + "()" +
|
"\nFunction: " + location + "()" +
|
||||||
"\nLocation: " + base_fname + ":" + e.lineNumber;
|
"\nLocation: " + base_fname + ":" + e.lineNumber;
|
||||||
|
|
||||||
|
@ -110,14 +113,14 @@ function format_exception_error(location, e) {
|
||||||
|
|
||||||
function param_escape(arg) {
|
function param_escape(arg) {
|
||||||
if (typeof encodeURIComponent != 'undefined')
|
if (typeof encodeURIComponent != 'undefined')
|
||||||
return encodeURIComponent(arg);
|
return encodeURIComponent(arg);
|
||||||
else
|
else
|
||||||
return escape(arg);
|
return escape(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function param_unescape(arg) {
|
function param_unescape(arg) {
|
||||||
if (typeof decodeURIComponent != 'undefined')
|
if (typeof decodeURIComponent != 'undefined')
|
||||||
return decodeURIComponent(arg);
|
return decodeURIComponent(arg);
|
||||||
else
|
else
|
||||||
return unescape(arg);
|
return unescape(arg);
|
||||||
}
|
}
|
||||||
|
@ -129,7 +132,7 @@ function hide_notify() {
|
||||||
if (n) {
|
if (n) {
|
||||||
n.style.display = "none";
|
n.style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function notify_silent_next() {
|
function notify_silent_next() {
|
||||||
notify_silent = true;
|
notify_silent = true;
|
||||||
|
@ -213,16 +216,16 @@ function notify_info(msg, no_hide) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCookie(name, value, lifetime, path, domain, secure) {
|
function setCookie(name, value, lifetime, path, domain, secure) {
|
||||||
|
|
||||||
var d = false;
|
var d = false;
|
||||||
|
|
||||||
if (lifetime) {
|
if (lifetime) {
|
||||||
d = new Date();
|
d = new Date();
|
||||||
d.setTime(d.getTime() + (lifetime * 1000));
|
d.setTime(d.getTime() + (lifetime * 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("setCookie: " + name + " => " + value + ": " + d);
|
console.log("setCookie: " + name + " => " + value + ": " + d);
|
||||||
|
|
||||||
int_setCookie(name, value, d, path, domain, secure);
|
int_setCookie(name, value, d, path, domain, secure);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -243,7 +246,7 @@ function delCookie(name, path, domain) {
|
||||||
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getCookie(name) {
|
function getCookie(name) {
|
||||||
|
|
||||||
|
@ -281,10 +284,10 @@ function gotoExportOpml() {
|
||||||
* * @author Sundar Dorai-Raj
|
* * @author Sundar Dorai-Raj
|
||||||
* * Email: sdoraira@vt.edu
|
* * Email: sdoraira@vt.edu
|
||||||
* * This program is free software; you can redistribute it and/or
|
* * This program is free software; you can redistribute it and/or
|
||||||
* * modify it under the terms of the GNU General Public License
|
* * modify it under the terms of the GNU General Public License
|
||||||
* * as published by the Free Software Foundation; either version 2
|
* * as published by the Free Software Foundation; either version 2
|
||||||
* * of the License, or (at your option) any later version,
|
* * of the License, or (at your option) any later version,
|
||||||
* * provided that any use properly credits the author.
|
* * provided that any use properly credits the author.
|
||||||
* * This program is distributed in the hope that it will be useful,
|
* * This program is distributed in the hope that it will be useful,
|
||||||
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
@ -372,7 +375,7 @@ function dropboxSelect(e, v) {
|
||||||
|
|
||||||
function getURLParam(param){
|
function getURLParam(param){
|
||||||
return String(window.location.href).parseQuery()[param];
|
return String(window.location.href).parseQuery()[param];
|
||||||
}
|
}
|
||||||
|
|
||||||
function leading_zero(p) {
|
function leading_zero(p) {
|
||||||
var s = String(p);
|
var s = String(p);
|
||||||
|
@ -449,7 +452,7 @@ function infobox_callback2(transport) {
|
||||||
title = title.firstChild.nodeValue;
|
title = title.firstChild.nodeValue;
|
||||||
|
|
||||||
var content = transport.responseXML.getElementsByTagName("content")[0];
|
var content = transport.responseXML.getElementsByTagName("content")[0];
|
||||||
|
|
||||||
content = content.firstChild.nodeValue;
|
content = content.firstChild.nodeValue;
|
||||||
|
|
||||||
if (!dialog) {
|
if (!dialog) {
|
||||||
|
@ -510,14 +513,14 @@ function setInitParam(key, value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function fatalError(code, msg, ext_info) {
|
function fatalError(code, msg, ext_info) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (code == 6) {
|
if (code == 6) {
|
||||||
window.location.href = "tt-rss.php";
|
window.location.href = "tt-rss.php";
|
||||||
} else if (code == 5) {
|
} else if (code == 5) {
|
||||||
window.location.href = "db-updater.php";
|
window.location.href = "db-updater.php";
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (msg == "") msg = "Unknown error";
|
if (msg == "") msg = "Unknown error";
|
||||||
|
|
||||||
if (ext_info) {
|
if (ext_info) {
|
||||||
|
@ -529,13 +532,13 @@ function fatalError(code, msg, ext_info) {
|
||||||
if (ERRORS && ERRORS[code] && !msg) {
|
if (ERRORS && ERRORS[code] && !msg) {
|
||||||
msg = ERRORS[code];
|
msg = ERRORS[code];
|
||||||
}
|
}
|
||||||
|
|
||||||
var content = "<div><b>Error code:</b> " + code + "</div>" +
|
var content = "<div><b>Error code:</b> " + code + "</div>" +
|
||||||
"<p>" + msg + "</p>";
|
"<p>" + msg + "</p>";
|
||||||
|
|
||||||
if (ext_info) {
|
if (ext_info) {
|
||||||
content = content + "<div><b>Additional information:</b></div>" +
|
content = content + "<div><b>Additional information:</b></div>" +
|
||||||
"<textarea style='width: 100%' readonly=\"1\">" +
|
"<textarea style='width: 100%' readonly=\"1\">" +
|
||||||
ext_info + "</textarea>";
|
ext_info + "</textarea>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,7 +623,7 @@ function filterDlgCheckDate() {
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
|
|
||||||
var reply = JSON.parse(transport.responseText);
|
var reply = JSON.parse(transport.responseText);
|
||||||
|
|
||||||
|
@ -647,7 +650,7 @@ function displayHelpInfobox(topic_id) {
|
||||||
|
|
||||||
var url = "backend.php?op=help&tid=" + param_escape(topic_id);
|
var url = "backend.php?op=help&tid=" + param_escape(topic_id);
|
||||||
|
|
||||||
var w = window.open(url, "ttrss_help",
|
var w = window.open(url, "ttrss_help",
|
||||||
"status=0,toolbar=0,location=0,width=450,height=500,scrollbars=1,menubar=0");
|
"status=0,toolbar=0,location=0,width=450,height=500,scrollbars=1,menubar=0");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -773,14 +776,14 @@ function removeFeedIcon(id) {
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
notify_info("Feed icon removed.");
|
notify_info("Feed icon removed.");
|
||||||
if (inPreferences()) {
|
if (inPreferences()) {
|
||||||
updateFeedList();
|
updateFeedList();
|
||||||
} else {
|
} else {
|
||||||
setTimeout('updateFeedList(false, false)', 50);
|
setTimeout('updateFeedList(false, false)', 50);
|
||||||
}
|
}
|
||||||
} });
|
} });
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -818,13 +821,13 @@ function addLabel(select, callback) {
|
||||||
var caption = prompt(__("Please enter label caption:"), "");
|
var caption = prompt(__("Please enter label caption:"), "");
|
||||||
|
|
||||||
if (caption != undefined) {
|
if (caption != undefined) {
|
||||||
|
|
||||||
if (caption == "") {
|
if (caption == "") {
|
||||||
alert(__("Can't create label: missing caption."));
|
alert(__("Can't create label: missing caption."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = "?op=pref-labels&subop=add&caption=" +
|
var query = "?op=pref-labels&subop=add&caption=" +
|
||||||
param_escape(caption);
|
param_escape(caption);
|
||||||
|
|
||||||
if (select)
|
if (select)
|
||||||
|
@ -836,7 +839,7 @@ function addLabel(select, callback) {
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(transport);
|
callback(transport);
|
||||||
} else if (inPreferences()) {
|
} else if (inPreferences()) {
|
||||||
|
@ -874,22 +877,22 @@ function quickAddFeed() {
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: dojo.objectToQuery(this.attr('value')),
|
parameters: dojo.objectToQuery(this.attr('value')),
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
var reply = JSON.parse(transport.responseText);
|
var reply = JSON.parse(transport.responseText);
|
||||||
|
|
||||||
var rc = parseInt(reply['result']);
|
var rc = parseInt(reply['result']);
|
||||||
|
|
||||||
notify('');
|
notify('');
|
||||||
|
|
||||||
console.log("GOT RC: " + rc);
|
console.log("GOT RC: " + rc);
|
||||||
|
|
||||||
switch (rc) {
|
switch (rc) {
|
||||||
case 1:
|
case 1:
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
notify_info(__("Subscribed to %s").replace("%s", feed_url));
|
notify_info(__("Subscribed to %s").replace("%s", feed_url));
|
||||||
|
|
||||||
updateFeedList();
|
updateFeedList();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -925,9 +928,9 @@ function quickAddFeed() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (count > 5) count = 5;
|
// if (count > 5) count = 5;
|
||||||
// select.size = count;
|
// select.size = count;
|
||||||
|
|
||||||
Effect.Appear('feedDlg_feedsContainer', {duration : 0.5});
|
Effect.Appear('feedDlg_feedsContainer', {duration : 0.5});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
@ -938,11 +941,11 @@ function quickAddFeed() {
|
||||||
alert(__("You are already subscribed to this feed."));
|
alert(__("You are already subscribed to this feed."));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("subscribeToFeed", e);
|
exception_error("subscribeToFeed", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
} });
|
} });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -969,7 +972,7 @@ function quickAddFilter() {
|
||||||
execute: function() {
|
execute: function() {
|
||||||
if (this.validate()) {
|
if (this.validate()) {
|
||||||
|
|
||||||
var query = "?op=rpc&subop=verifyRegexp®_exp=" +
|
var query = "?op=rpc&subop=verifyRegexp®_exp=" +
|
||||||
param_escape(dialog.attr('value').reg_exp);
|
param_escape(dialog.attr('value').reg_exp);
|
||||||
|
|
||||||
notify_progress("Verifying regular expression...");
|
notify_progress("Verifying regular expression...");
|
||||||
|
@ -977,7 +980,7 @@ function quickAddFilter() {
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
var reply = JSON.parse(transport.responseText);
|
var reply = JSON.parse(transport.responseText);
|
||||||
|
|
||||||
if (reply) {
|
if (reply) {
|
||||||
notify('');
|
notify('');
|
||||||
|
@ -996,10 +999,10 @@ function quickAddFilter() {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
notify_info(transport.responseText);
|
notify_info(transport.responseText);
|
||||||
if (inPreferences()) {
|
if (inPreferences()) {
|
||||||
updateFilterList();
|
updateFilterList();
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
@ -1026,9 +1029,9 @@ function unsubscribeFeed(feed_id, title) {
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
|
|
||||||
if (dijit.byId("feedEditDlg")) dijit.byId("feedEditDlg").hide();
|
if (dijit.byId("feedEditDlg")) dijit.byId("feedEditDlg").hide();
|
||||||
|
|
||||||
if (inPreferences()) {
|
if (inPreferences()) {
|
||||||
updateFeedList();
|
updateFeedList();
|
||||||
} else {
|
} else {
|
||||||
if (feed_id == getActiveFeedId())
|
if (feed_id == getActiveFeedId())
|
||||||
setTimeout("viewfeed(-5)", 100);
|
setTimeout("viewfeed(-5)", 100);
|
||||||
|
@ -1054,7 +1057,7 @@ function backend_sanity_check_callback(transport) {
|
||||||
|
|
||||||
if (!transport.responseXML) {
|
if (!transport.responseXML) {
|
||||||
if (!store) {
|
if (!store) {
|
||||||
fatalError(3, "Sanity check: Received reply is not XML",
|
fatalError(3, "Sanity check: Received reply is not XML",
|
||||||
transport.responseText);
|
transport.responseText);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1068,7 +1071,7 @@ function backend_sanity_check_callback(transport) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var error_code = reply.getAttribute("error-code");
|
var error_code = reply.getAttribute("error-code");
|
||||||
|
|
||||||
if (error_code && error_code != 0) {
|
if (error_code && error_code != 0) {
|
||||||
return fatalError(error_code, reply.getAttribute("error-msg"));
|
return fatalError(error_code, reply.getAttribute("error-msg"));
|
||||||
}
|
}
|
||||||
|
@ -1097,8 +1100,8 @@ function backend_sanity_check_callback(transport) {
|
||||||
init_second_stage();
|
init_second_stage();
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("backend_sanity_check_callback", e, transport);
|
exception_error("backend_sanity_check_callback", e, transport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function has_local_storage() {
|
function has_local_storage() {
|
||||||
|
@ -1106,7 +1109,7 @@ function has_local_storage() {
|
||||||
return 'sessionStorage' in window && window['sessionStorage'] != null;
|
return 'sessionStorage' in window && window['sessionStorage'] != null;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function catSelectOnChange(elem) {
|
function catSelectOnChange(elem) {
|
||||||
|
@ -1163,12 +1166,12 @@ function genUrlChangeKey(feed, is_cat) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ok = confirm(__("Generate new syndication address for this feed?"));
|
var ok = confirm(__("Generate new syndication address for this feed?"));
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
|
||||||
notify_progress("Trying to change address...", true);
|
notify_progress("Trying to change address...", true);
|
||||||
|
|
||||||
var query = "?op=rpc&subop=regenFeedKey&id=" + param_escape(feed) +
|
var query = "?op=rpc&subop=regenFeedKey&id=" + param_escape(feed) +
|
||||||
"&is_cat=" + param_escape(is_cat);
|
"&is_cat=" + param_escape(is_cat);
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
|
@ -1176,12 +1179,12 @@ function genUrlChangeKey(feed, is_cat) {
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
var reply = JSON.parse(transport.responseText);
|
var reply = JSON.parse(transport.responseText);
|
||||||
var new_link = reply.link;
|
var new_link = reply.link;
|
||||||
|
|
||||||
var e = $('gen_feed_url');
|
var e = $('gen_feed_url');
|
||||||
|
|
||||||
if (new_link) {
|
if (new_link) {
|
||||||
|
|
||||||
e.innerHTML = e.innerHTML.replace(/\&key=.*$/,
|
e.innerHTML = e.innerHTML.replace(/\&key=.*$/,
|
||||||
"&key=" + new_link);
|
"&key=" + new_link);
|
||||||
|
|
||||||
e.href = e.href.replace(/\&key=.*$/,
|
e.href = e.href.replace(/\&key=.*$/,
|
||||||
|
@ -1190,7 +1193,7 @@ function genUrlChangeKey(feed, is_cat) {
|
||||||
new Effect.Highlight(e);
|
new Effect.Highlight(e);
|
||||||
|
|
||||||
notify('');
|
notify('');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
notify_error("Could not change feed URL.");
|
notify_error("Could not change feed URL.");
|
||||||
}
|
}
|
||||||
|
@ -1286,7 +1289,7 @@ function selectTableRows(id, mode) {
|
||||||
for (var j = 0; j < inputs.length; j++) {
|
for (var j = 0; j < inputs.length; j++) {
|
||||||
var input = inputs[j];
|
var input = inputs[j];
|
||||||
|
|
||||||
if (input.getAttribute("type") == "checkbox" &&
|
if (input.getAttribute("type") == "checkbox" &&
|
||||||
input.id.match(bare_id)) {
|
input.id.match(bare_id)) {
|
||||||
|
|
||||||
cb = input;
|
cb = input;
|
||||||
|
@ -1401,95 +1404,95 @@ function feedBrowser() {
|
||||||
getSelectedFeeds: function() {
|
getSelectedFeeds: function() {
|
||||||
var list = $$("#browseFeedList li[id*=FBROW]");
|
var list = $$("#browseFeedList li[id*=FBROW]");
|
||||||
var selected = new Array();
|
var selected = new Array();
|
||||||
|
|
||||||
list.each(function(child) {
|
list.each(function(child) {
|
||||||
var id = child.id.replace("FBROW-", "");
|
var id = child.id.replace("FBROW-", "");
|
||||||
|
|
||||||
if (child.hasClassName('Selected')) {
|
if (child.hasClassName('Selected')) {
|
||||||
selected.push(id);
|
selected.push(id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return selected;
|
return selected;
|
||||||
},
|
},
|
||||||
subscribe: function() {
|
subscribe: function() {
|
||||||
var selected = this.getSelectedFeeds();
|
var selected = this.getSelectedFeeds();
|
||||||
var mode = this.attr('value').mode;
|
var mode = this.attr('value').mode;
|
||||||
|
|
||||||
if (selected.length > 0) {
|
if (selected.length > 0) {
|
||||||
dijit.byId("feedBrowserDlg").hide();
|
dijit.byId("feedBrowserDlg").hide();
|
||||||
|
|
||||||
notify_progress("Loading, please wait...", true);
|
notify_progress("Loading, please wait...", true);
|
||||||
|
|
||||||
var query = "?op=rpc&subop=massSubscribe&ids="+
|
var query = "?op=rpc&subop=massSubscribe&ids="+
|
||||||
param_escape(selected.toString()) + "&mode=" + param_escape(mode);
|
param_escape(selected.toString()) + "&mode=" + param_escape(mode);
|
||||||
|
|
||||||
console.log(query);
|
console.log(query);
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
if (inPreferences()) {
|
if (inPreferences()) {
|
||||||
updateFeedList();
|
updateFeedList();
|
||||||
}
|
}
|
||||||
} });
|
} });
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
alert(__("No feeds are selected."));
|
alert(__("No feeds are selected."));
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
update: function() {
|
update: function() {
|
||||||
var query = dojo.objectToQuery(dialog.attr('value'));
|
var query = dojo.objectToQuery(dialog.attr('value'));
|
||||||
|
|
||||||
Element.show('feed_browser_spinner');
|
Element.show('feed_browser_spinner');
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
notify('');
|
notify('');
|
||||||
|
|
||||||
Element.hide('feed_browser_spinner');
|
Element.hide('feed_browser_spinner');
|
||||||
|
|
||||||
var c = $("browseFeedList");
|
var c = $("browseFeedList");
|
||||||
|
|
||||||
var reply = JSON.parse(transport.responseText);
|
var reply = JSON.parse(transport.responseText);
|
||||||
|
|
||||||
var r = reply['content'];
|
var r = reply['content'];
|
||||||
var mode = reply['mode'];
|
var mode = reply['mode'];
|
||||||
|
|
||||||
if (c && r) {
|
if (c && r) {
|
||||||
c.innerHTML = r;
|
c.innerHTML = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
dojo.parser.parse("browseFeedList");
|
dojo.parser.parse("browseFeedList");
|
||||||
|
|
||||||
if (mode == 2) {
|
if (mode == 2) {
|
||||||
Element.show(dijit.byId('feed_archive_remove').domNode);
|
Element.show(dijit.byId('feed_archive_remove').domNode);
|
||||||
} else {
|
} else {
|
||||||
Element.hide(dijit.byId('feed_archive_remove').domNode);
|
Element.hide(dijit.byId('feed_archive_remove').domNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
} });
|
} });
|
||||||
},
|
},
|
||||||
removeFromArchive: function() {
|
removeFromArchive: function() {
|
||||||
var selected = this.getSelectedFeeds();
|
var selected = this.getSelectedFeeds();
|
||||||
|
|
||||||
if (selected.length > 0) {
|
if (selected.length > 0) {
|
||||||
|
|
||||||
var pr = __("Remove selected feeds from the archive? Feeds with stored articles will not be removed.");
|
var pr = __("Remove selected feeds from the archive? Feeds with stored articles will not be removed.");
|
||||||
|
|
||||||
if (confirm(pr)) {
|
if (confirm(pr)) {
|
||||||
Element.show('feed_browser_spinner');
|
Element.show('feed_browser_spinner');
|
||||||
|
|
||||||
var query = "?op=rpc&subop=remarchived&ids=" +
|
var query = "?op=rpc&subop=remarchived&ids=" +
|
||||||
param_escape(selected.toString());;
|
param_escape(selected.toString());;
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
dialog.update();
|
dialog.update();
|
||||||
} });
|
} });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue