1
0

Adding the 'select all' possibility to the bookmarks header.

This commit is contained in:
Stefan Frech
2008-06-12 19:14:20 +00:00
committed by Jonas Kattendick
parent 7782823d1d
commit b4308ee5ab
4 changed files with 18 additions and 20 deletions

View File

@@ -49,18 +49,7 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
echo "\t" . '<div class="bmleft">' . "\n"; echo "\t" . '<div class="bmleft">' . "\n";
# the checkbox # the checkbox
if ($show_checkbox){ if ($show_checkbox){
echo "\t\t" . '<input class="link" type="checkbox" name="' . $value['id'] . '">' . "\n"; echo "\t\t" . '<input type="checkbox" name="' . $value['id'] . '">' . "\n";
}
# the favicon
echo "\t\t";
if ($show_icon){
if ($value['favicon'] && is_file ($value['favicon'])) {
echo '<img src="' . $value['favicon'] . '" width="16" height="16">';
}
else {
echo $bookmark_image;
}
} }
echo "\n\t</div>\n"; echo "\n\t</div>\n";
@@ -97,9 +86,20 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
echo sprintf ($delete_image, "Delete"); echo sprintf ($delete_image, "Delete");
echo "</a>\n"; echo "</a>\n";
} }
echo "\t</div>\n"; echo "\t</div>\n";
# the favicon
echo "\t" . '<div class="link">' . "\n";
echo "\t\t";
if ($show_icon){
if ($value['favicon'] && is_file ($value['favicon'])) {
echo '<img src="' . $value['favicon'] . '" width="16" height="16" alt="">' . "\n";
}
else {
echo $bookmark_image . "\n";
}
}
# the link # the link
if ($settings['open_new_window']) { if ($settings['open_new_window']) {
$target = ' target="_blank"'; $target = ' target="_blank"';
@@ -114,7 +114,8 @@ function list_bookmarks ($bookmarks, $show_checkbox, $show_folder, $show_icon, $
else { else {
$link = $value['title']; $link = $value['title'];
} }
echo "\t" . '<div class="link">' . $link . "</div>\n"; echo "\t\t$link\n";
echo "\t</div>\n";
# the description and if not empty # the description and if not empty
if ($show_desc && $value['description'] != "") { if ($show_desc && $value['description'] != "") {

View File

@@ -135,7 +135,7 @@ else {
<div class="bookmarkcaption" style="background-color: #bbb;"> <div class="bookmarkcaption" style="background-color: #bbb;">
<div class="bmleft"> <div class="bmleft">
<input class="link" type="checkbox" name="CheckAll" onClick="selection('checkall')"> <input type="checkbox" name="CheckAll" onClick="selectthem('checkall', this.checked)">
<img src="./images/bookmark_image.gif" alt="" class="invisible"> <img src="./images/bookmark_image.gif" alt="" class="invisible">
</div> </div>
<div class="bmright"> <div class="bmright">

View File

@@ -89,7 +89,7 @@ var parameter='';
http://www.squarefree.com/bookmarklets/ http://www.squarefree.com/bookmarklets/
*/ */
function selection(boxes){ function selectthem(boxes, stat){
var x,k,f,j; var x,k,f,j;
x=document.forms; x=document.forms;
@@ -107,7 +107,7 @@ function selection(boxes){
f[j].checked = !f[j].checked ; f[j].checked = !f[j].checked ;
} }
else if (boxes == "checkall") { else if (boxes == "checkall") {
f[j].checked = document.getElementsByName('CheckAll')[0].checked; f[j].checked = stat;
} }
} }
} }

View File

@@ -166,9 +166,6 @@ div.description {
div.description, span.private, span.public, span.date { div.description, span.private, span.public, span.date {
font-size: smaller; font-size: smaller;
} }
input.link {
margin: 0;
}
.invisible { .invisible {
visibility: hidden; visibility: hidden;
} }