disable pref toolbars when nothing is selected (take two)
This commit is contained in:
parent
ce3bf4089f
commit
c0ae0fdb9a
2 changed files with 34 additions and 24 deletions
10
backend.php
10
backend.php
|
@ -3627,7 +3627,7 @@
|
|||
|
||||
$login = db_fetch_result($result, 0, "login");
|
||||
|
||||
print "<h1>$login</h1>";
|
||||
# print "<h1>$login</h1>";
|
||||
|
||||
print "<table width='100%'>";
|
||||
|
||||
|
@ -3637,7 +3637,7 @@
|
|||
$stored_articles = db_fetch_result($result, 0, "stored_articles");
|
||||
|
||||
# print "<tr><td>Username</td><td>$login</td></tr>";
|
||||
print "<tr><td>Access level</td><td>$access_level</td></tr>";
|
||||
# print "<tr><td>Access level</td><td>$access_level</td></tr>";
|
||||
print "<tr><td>Last logged in</td><td>$last_login</td></tr>";
|
||||
print "<tr><td>Stored articles</td><td>$stored_articles</td></tr>";
|
||||
|
||||
|
@ -3906,9 +3906,9 @@
|
|||
onclick=\"updateBigFeedBrowser()\" value=\"Show\">
|
||||
</div>";
|
||||
|
||||
print "<p>Selection:
|
||||
print "<p id=\"fbrOpToolbar\">Selection:
|
||||
<input type='submit' class='button' onclick=\"feedBrowserSubscribe()\"
|
||||
value=\"Subscribe\">";
|
||||
disabled=\"true\" value=\"Subscribe\">";
|
||||
|
||||
print "<ul class='nomarks' id='browseBigFeedList'>";
|
||||
|
||||
|
@ -3940,7 +3940,7 @@
|
|||
$feed_icon = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\">";
|
||||
}
|
||||
|
||||
$check_box = "<input onclick='toggleSelectListRow(this)' class='feedBrowseCB'
|
||||
$check_box = "<input onclick='toggleSelectFBListRow(this)' class='feedBrowseCB'
|
||||
type=\"checkbox\" id=\"FBCHK-" . $details["id"] . "\">";
|
||||
|
||||
$class = ($feedctr % 2) ? "even" : "odd";
|
||||
|
|
48
prefs.js
48
prefs.js
|
@ -462,6 +462,29 @@ function getSelectedFeedCats() {
|
|||
return getSelectedTableRowIds("prefFeedCatList", "FCATR");
|
||||
}
|
||||
|
||||
function getSelectedFeedsFromBrowser() {
|
||||
|
||||
var list = document.getElementById("browseFeedList");
|
||||
if (!list) list = document.getElementById("browseBigFeedList");
|
||||
|
||||
var selected = new Array();
|
||||
|
||||
for (i = 0; i < list.childNodes.length; i++) {
|
||||
var child = list.childNodes[i];
|
||||
if (child.id && child.id.match("FBROW-")) {
|
||||
var id = child.id.replace("FBROW-", "");
|
||||
|
||||
var cb = document.getElementById("FBCHK-" + id);
|
||||
|
||||
if (cb.checked) {
|
||||
selected.push(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return selected;
|
||||
}
|
||||
|
||||
|
||||
/*function readSelectedFeeds(read) {
|
||||
|
||||
|
@ -585,7 +608,7 @@ function removeSelectedFeeds() {
|
|||
|
||||
if (sel_rows.length > 0) {
|
||||
|
||||
var ok = confirm("Remove selected feeds?");
|
||||
var ok = confirm("Unsubscribe from selected feeds?");
|
||||
|
||||
if (ok) {
|
||||
|
||||
|
@ -1376,24 +1399,8 @@ function browseFeeds(limit) {
|
|||
|
||||
function feedBrowserSubscribe() {
|
||||
try {
|
||||
var list = document.getElementById("browseFeedList");
|
||||
|
||||
if (!list) list = document.getElementById("browseBigFeedList");
|
||||
|
||||
var selected = new Array();
|
||||
|
||||
for (i = 0; i < list.childNodes.length; i++) {
|
||||
var child = list.childNodes[i];
|
||||
if (child.id && child.id.match("FBROW-")) {
|
||||
var id = child.id.replace("FBROW-", "");
|
||||
|
||||
var cb = document.getElementById("FBCHK-" + id);
|
||||
|
||||
if (cb.checked) {
|
||||
selected.push(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
var selected = getSelectedFeedsFromBrowser();
|
||||
|
||||
if (selected.length > 0) {
|
||||
closeInfoBox();
|
||||
|
@ -1548,4 +1555,7 @@ function toggleSelectPrefRow(sender, kind) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleSelectFBListRow(sender) {
|
||||
toggleSelectListRow(sender);
|
||||
disableContainerChildren("fbrOpToolbar", getSelectedFeedsFromBrowser() == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue