more i18n work, add some report notices

master
Andrew Dolgov 18 years ago
parent 4dccf1ed93
commit 5e6f933a32

@ -1343,7 +1343,9 @@ function infobox_submit_callback() {
} }
} catch (e) { } } catch (e) { }
// notify_info(xmlhttp.responseText); if (xmlhttp.responseText) {
notify_info(xmlhttp.responseText);
}
} }
} }
@ -1364,7 +1366,7 @@ function infobox_callback() {
} }
} }
function qaddFilter() { function addFilter() {
if (!xmlhttp_ready(xmlhttp)) { if (!xmlhttp_ready(xmlhttp)) {
printLockingError(); printLockingError();
@ -1400,7 +1402,7 @@ function isValidURL(s) {
return s.match("http://") != null || s.match("https://") != null || s.match("feed://") != null; return s.match("http://") != null || s.match("https://") != null || s.match("feed://") != null;
} }
function qafAdd() { function qaddFeed() {
if (!xmlhttp_ready(xmlhttp)) { if (!xmlhttp_ready(xmlhttp)) {
printLockingError(); printLockingError();

@ -36,6 +36,7 @@
print "</div>"; print "</div>";
return;
} }
if ($id == "quickAddFeed") { if ($id == "quickAddFeed") {
@ -52,7 +53,7 @@
print "<table width='100%'> print "<table width='100%'>
<tr><td>Feed URL:</td><td> <tr><td>Feed URL:</td><td>
<input class=\"iedit\" onblur=\"javascript:enableHotkeys()\" <input class=\"iedit\" onblur=\"javascript:enableHotkeys()\"
onkeypress=\"return filterCR(event, qafAdd)\" onkeypress=\"return filterCR(event, qaddFeed)\"
onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\" onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\" onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
onfocus=\"javascript:disableHotkeys()\" name=\"feed_url\"></td></tr>"; onfocus=\"javascript:disableHotkeys()\" name=\"feed_url\"></td></tr>";
@ -69,10 +70,12 @@
print "<div align='right'> print "<div align='right'>
<input class=\"button\" <input class=\"button\"
id=\"fadd_submit_btn\" disabled=\"true\" id=\"fadd_submit_btn\" disabled=\"true\"
type=\"submit\" onclick=\"return qafAdd()\" value=\"".__('Subscribe')."\"> type=\"submit\" onclick=\"return qaddFeed()\" value=\"".__('Subscribe')."\">
<input class=\"button\" <input class=\"button\"
type=\"submit\" onclick=\"return closeInfoBox()\" type=\"submit\" onclick=\"return closeInfoBox()\"
value=\"".__('Cancel')."\"></div>"; value=\"".__('Cancel')."\"></div>";
return;
} }
if ($id == "search") { if ($id == "search") {
@ -153,6 +156,8 @@
print "</div>"; print "</div>";
return;
} }
if ($id == "quickAddLabel") { if ($id == "quickAddLabel") {
@ -200,6 +205,8 @@
print "<input class=\"button\" print "<input class=\"button\"
type=\"submit\" onclick=\"return labelEditCancel()\" type=\"submit\" onclick=\"return labelEditCancel()\"
value=\"".__('Cancel')."\">"; value=\"".__('Cancel')."\">";
return;
} }
if ($id == "quickAddFilter") { if ($id == "quickAddFilter") {
@ -279,7 +286,7 @@
print "<input type=\"submit\" print "<input type=\"submit\"
id=\"infobox_submit\" id=\"infobox_submit\"
class=\"button\" onclick=\"return qaddFilter()\" class=\"button\" onclick=\"return addFilter()\"
disabled=\"true\" value=\"".__('Create')."\"> "; disabled=\"true\" value=\"".__('Create')."\"> ";
print "<input class=\"button\" print "<input class=\"button\"
@ -290,6 +297,7 @@
// print "</td></tr></table>"; // print "</td></tr></table>";
return;
} }
if ($id == "feedUpdateErrors") { if ($id == "feedUpdateErrors") {
@ -379,8 +387,13 @@
print "</div>"; print "</div>";
return;
} }
print "</div>"; print "<div id='infoBoxTitle'>Internal Error</div>
<div id='infoBoxContents'>
<p>Unknown dialog <b>$id</b></p>
</div></div>";
} }
?> ?>

@ -750,9 +750,8 @@
<input type=\"submit\" class=\"button\" <input type=\"submit\" class=\"button\"
onclick=\"javascript:updateFeedList()\" value=\"".__('Search')."\"> onclick=\"javascript:updateFeedList()\" value=\"".__('Search')."\">
</div>"; </div>";
print "<div class=\"prefGenericAddBox\"> print "<input id=\"fadd_link\"
<input id=\"fadd_link\"
onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\" onkeyup=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\" onchange=\"toggleSubmitNotEmpty(this, 'fadd_submit_btn')\"
size=\"40\"> size=\"40\">
@ -765,8 +764,6 @@
onclick=\"javascript:browseFeeds()\" value=\"".__('Top 25')."\">"; onclick=\"javascript:browseFeeds()\" value=\"".__('Top 25')."\">";
} }
print "</div>";
$feeds_sort = db_escape_string($_GET["sort"]); $feeds_sort = db_escape_string($_GET["sort"]);
if (!$feeds_sort || $feeds_sort == "undefined") { if (!$feeds_sort || $feeds_sort == "undefined") {

@ -149,7 +149,11 @@
inverse = $inverse, inverse = $inverse,
action_param = '$action_param' action_param = '$action_param'
WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]); WHERE id = '$filter_id' AND owner_uid = " . $_SESSION["uid"]);
if (db_affected_rows($link, $result) != 0) {
print_notice(T_sprintf("Saved filter <b>%s</b>", htmlspecialchars($reg_exp)));
}
} }
if ($subop == "remove") { if ($subop == "remove") {
@ -186,7 +190,11 @@
('$regexp', '$filter_type','".$_SESSION["uid"]."', ('$regexp', '$filter_type','".$_SESSION["uid"]."',
$feed_id, '$action_id', '$action_param', $inverse)"); $feed_id, '$action_id', '$action_param', $inverse)");
print_notice(T_sprintf("Created filter <b>%s</b>", htmlspecialchars($regexp))); if (db_affected_rows($link, $result) != 0) {
print T_sprintf("Created filter <b>%s</b>", htmlspecialchars($regexp));
}
return;
} }
if ($quiet) return; if ($quiet) return;

@ -153,6 +153,11 @@
sql_exp = '$sql_exp', sql_exp = '$sql_exp',
description = '$descr' description = '$descr'
WHERE id = '$label_id'"); WHERE id = '$label_id'");
if (db_affected_rows($link, $result) != 0) {
print_notice(T_sprintf("Saved label <b>%s</b>", htmlspecialchars($descr)));
}
} }
if ($subop == "remove") { if ($subop == "remove") {
@ -169,19 +174,22 @@
} }
if ($subop == "add") { if ($subop == "add") {
if (!WEB_DEMO_MODE) {
// no escaping is done here on purpose // no escaping is done here on purpose
$sql_exp = trim($_GET["sql_exp"]); $sql_exp = trim($_GET["sql_exp"]);
$description = db_escape_string($_GET["description"]); $description = db_escape_string($_GET["description"]);
if (!$sql_exp || !$description) return; if (!$sql_exp || !$description) return;
$result = db_query($link, $result = db_query($link,
"INSERT INTO ttrss_labels (sql_exp,description,owner_uid) "INSERT INTO ttrss_labels (sql_exp,description,owner_uid)
VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')"); VALUES ('$sql_exp', '$description', '".$_SESSION["uid"]."')");
}
if (db_affected_rows($link, $result) != 0) {
print T_sprintf("Created label <b>%s</b>", htmlspecialchars($description));
}
return;
} }
$sort = db_escape_string($_GET["sort"]); $sort = db_escape_string($_GET["sort"]);

Loading…
Cancel
Save