Experimenting with styles for OPAC cart and lists button. Unfinished.
[koha.git] / koha-tmpl / opac-tmpl / prog / en / js / script.js
1         /**
2          * this function checks all checkbox 
3          * or uncheck all if there are already checked.
4          */
5         function CheckAll(){
6                 var checkboxes = document.getElementsByTagName('input');
7                 var nbCheckbox = checkboxes.length;
8                 var check = areAllChecked();
9                 for(var i=0;i<nbCheckbox;i++){
10                         if(checkboxes[i].getAttribute('type') == "checkbox" ){
11                                 checkboxes[i].checked = (check) ? 0 : 1;
12                         }
13                 }
14         }
15         /**
16          * this function return true if all checkbox are checked
17          */
18         function areAllChecked(){
19                 var checkboxes = document.getElementsByTagName('input');
20                 var nbCheckbox = checkboxes.length;
21                 for(var i=0;i<nbCheckbox;i++){
22                         if(checkboxes[i].getAttribute('type') == "checkbox" ){
23                                 if(checkboxes[i].checked == 0){
24                                         return false;
25                                 }
26                         }
27                 }
28                 return true;
29         }
30
31 function confirmDelete(message) {
32         return (confirm(message) ? true : false);
33 }
34
35 function Dopop(link) {
36         newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes');
37 }
38         
39 /*$(document).ready(function(){
40         $('#masthead').each(function(){
41                 $('a.button').each(function(){
42                         var b = $(this);
43                         var tt = b.text() || b.val();
44                         if ($(':submit,:button',this)) {
45                                 b = $('<a>').insertAfter(this).addClass('btn').attr('id',this.id).attr('href',this.href);
46                                 $(this).remove();
47                         }
48                         b.text('').css({cursor:'pointer'}). prepend('<i></i>').append($('<span>').
49                         text(tt).append('<i></i><span></span>'));
50                         });
51                 });
52         });*/