View | Details | Raw Unified | Return to bug 26805
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt (-7 / +6 lines)
Lines 290-296 Link Here
290
290
291
[% INCLUDE 'opac-bottom.inc' %]
291
[% INCLUDE 'opac-bottom.inc' %]
292
[% BLOCK jsinclude %]
292
[% BLOCK jsinclude %]
293
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
294
    <script>
293
    <script>
295
        var q_array = new Array();  // will hold the search terms, if possible
294
        var q_array = new Array();  // will hold the search terms, if possible
296
        $(document).ready(function(){
295
        $(document).ready(function(){
Lines 331-343 Link Here
331
                    return false;
330
                    return false;
332
                }
331
                }
333
            }
332
            }
334
            $("#CheckAll").click(function(){
333
            $("#CheckAll").on("click", function(e){
335
                $("#bookbag_form").checkCheckboxes();
334
                e.preventDefault();
336
                return false;
335
                $("#bookbag_form").find("input:checkbox").prop("checked", true);
337
            });
336
            });
338
            $("#CheckNone").click(function(){
337
            $("#CheckNone").on("click", function(e){
339
                $("#bookbag_form").unCheckCheckboxes();
338
                e.preventDefault();
340
                return false;
339
                $("#bookbag_form").find("input:checkbox").prop("checked", true);
341
            });
340
            });
342
            [% IF ( query_desc ) %]
341
            [% IF ( query_desc ) %]
343
            var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
342
            var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-9 / +8 lines)
Lines 160-166 Link Here
160
                    [% IF ( total ) %]
160
                    [% IF ( total ) %]
161
161
162
                        <div class="searchresults">
162
                        <div class="searchresults">
163
                            <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
163
                            <form action="/cgi-bin/koha/opac-search.pl" method="get" name="bookbag_form" id="bookbag_form">
164
                                [% IF ( searchdesc ) %]
164
                                [% IF ( searchdesc ) %]
165
                                    [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
165
                                    [% FOREACH QUERY_INPUT IN QUERY_INPUTS %]
166
                                        <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
166
                                        <input type="hidden" name="[% QUERY_INPUT.input_name | html %]" value="[% QUERY_INPUT.input_value | html %]"/>
Lines 625-631 Link Here
625
    [% END %]
625
    [% END %]
626
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
626
    [% IF ( OverDriveEnabled ) %][% Asset.js("js/overdrive.js") | $raw %][% END %]
627
    [% IF ( RecordedBooksEnabled ) %][% Asset.js("js/recordedbooks.js") | $raw %][% END %]
627
    [% IF ( RecordedBooksEnabled ) %][% Asset.js("js/recordedbooks.js") | $raw %][% END %]
628
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
629
    [% Asset.js("js/authtoresults.js") | $raw %]
628
    [% Asset.js("js/authtoresults.js") | $raw %]
630
    [% Asset.js("lib/hc-sticky.js") | $raw %]
629
    [% Asset.js("lib/hc-sticky.js") | $raw %]
631
    [% IF ( OpacHighlightedWords ) %]
630
    [% IF ( OpacHighlightedWords ) %]
Lines 710-716 Link Here
710
709
711
        function enableCheckboxActions(){
710
        function enableCheckboxActions(){
712
            // Enable/disable controls if checkboxes are checked
711
            // Enable/disable controls if checkboxes are checked
713
            var checkedBoxes = $(".checkboxed input:checkbox:checked");
712
            var checkedBoxes = $(".cb:checked");
714
            var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, #selections-toolbar .links label, #selections-toolbar .links button");
713
            var controls = $("#selections-toolbar .links a, #selections-toolbar .links input, #selections-toolbar .links select, #selections-toolbar .links label, #selections-toolbar .links button");
715
            if ($(checkedBoxes).size()) {
714
            if ($(checkedBoxes).size()) {
716
            $("#selections").html(_("With selected titles: "));
715
            $("#selections").html(_("With selected titles: "));
Lines 879-893 Link Here
879
                    return false;
878
                    return false;
880
                }
879
                }
881
            }
880
            }
882
            $("#CheckAll").click(function(){
881
            $("#CheckAll").on("click",function(e){
883
                $("#bookbag_form").checkCheckboxes();
882
                e.preventDefault();
883
                $(".cb").prop("checked", true);
884
                enableCheckboxActions();
884
                enableCheckboxActions();
885
                return false;
886
            });
885
            });
887
            $("#CheckNone").click(function(){
886
            $("#CheckNone").on("click",function(e){
888
                $("#bookbag_form").unCheckCheckboxes();
887
                e.preventDefault();
888
                $(".cb").prop("checked", false);
889
                enableCheckboxActions();
889
                enableCheckboxActions();
890
                return false;
891
            });
890
            });
892
891
893
            [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
892
            [% IF ( ( Koha.Preference( 'RequestOnOpac' ) == 1 ) && ( Koha.Preference( 'opacuserlogin' ) == 1 ) && DisplayMultiPlaceHold ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt (-3 / +2 lines)
Lines 241-247 Link Here
241
[% INCLUDE 'opac-bottom.inc' %]
241
[% INCLUDE 'opac-bottom.inc' %]
242
[% BLOCK jsinclude %]
242
[% BLOCK jsinclude %]
243
[% INCLUDE 'datatables.inc' %]
243
[% INCLUDE 'datatables.inc' %]
244
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
245
<script>
244
<script>
246
245
247
    var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
246
    var MSG_CONFIRM_DELETE_HISTORY = _("Are you sure you want to delete selected search history entries?");
Lines 261-273 Link Here
261
        $(".CheckNone").click(function(e){
260
        $(".CheckNone").click(function(e){
262
            e.preventDefault();
261
            e.preventDefault();
263
            var form = $(this).parents("form").get(0);
262
            var form = $(this).parents("form").get(0);
264
            $(form).unCheckCheckboxes();
263
            $(form).find("input:checkbox").prop("checked", false);
265
            enableCheckboxActions(form);
264
            enableCheckboxActions(form);
266
        });
265
        });
267
        $(".CheckAll").click(function(e){
266
        $(".CheckAll").click(function(e){
268
            e.preventDefault();
267
            e.preventDefault();
269
            var form = $(this).parents("form").get(0);
268
            var form = $(this).parents("form").get(0);
270
            $(form).checkCheckboxes();
269
            $(form).find("input:checkbox").prop("checked", true);
271
            enableCheckboxActions(form);
270
            enableCheckboxActions(form);
272
        });
271
        });
273
272
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-10 / +9 lines)
Lines 354-360 Link Here
354
                                </div> <!-- / #selections-toolbar -->
354
                                </div> <!-- / #selections-toolbar -->
355
                            </div> <!-- /#floating -->
355
                            </div> <!-- /#floating -->
356
356
357
                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform" class="checkboxed">
357
                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform">
358
                                [% IF can_manage_shelf %]
358
                                [% IF can_manage_shelf %]
359
                                    <input type="hidden" name="op" value="remove_biblios" />
359
                                    <input type="hidden" name="op" value="remove_biblios" />
360
                                    <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
360
                                    <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
Lines 804-810 Link Here
804
804
805
[% INCLUDE 'opac-bottom.inc' %]
805
[% INCLUDE 'opac-bottom.inc' %]
806
[% BLOCK jsinclude %]
806
[% BLOCK jsinclude %]
807
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
808
[% Asset.js("lib/hc-sticky.js") | $raw %]
807
[% Asset.js("lib/hc-sticky.js") | $raw %]
809
[% IF OpenLibraryCovers || OpenLibrarySearch %]
808
[% IF OpenLibraryCovers || OpenLibrarySearch %]
810
    [% Asset.js("js/openlibrary.js") | $raw %]
809
    [% Asset.js("js/openlibrary.js") | $raw %]
Lines 875-881 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); Link Here
875
874
876
function enableCheckboxActions(){
875
function enableCheckboxActions(){
877
    // Enable/disable controls if checkboxes are checked
876
    // Enable/disable controls if checkboxes are checked
878
    var checkedBoxes = $(".checkboxed input:checkbox:checked");
877
    var checkedBoxes = $(".cb:checked");
879
    if ($(checkedBoxes).size()) {
878
    if ($(checkedBoxes).size()) {
880
      $("#selections").html(_("With selected titles: "));
879
      $("#selections").html(_("With selected titles: "));
881
      $("#selections-toolbar .links a").removeClass("disabled");
880
      $("#selections-toolbar .links a").removeClass("disabled");
Lines 899-913 $(function() { Link Here
899
        });
898
        });
900
    [% END %]
899
    [% END %]
901
900
902
    $("#CheckAll").click(function(){
901
    $("#CheckAll").on("click",function(e){
903
        $(".checkboxed").checkCheckboxes();
902
        e.preventDefault();
903
        $(".cb").prop("checked", true);
904
        enableCheckboxActions();
904
        enableCheckboxActions();
905
        return false;
906
    });
905
    });
907
    $("#CheckNone").click(function(){
906
    $("#CheckNone").on("click",function(e){
908
        $(".checkboxed").unCheckCheckboxes();
907
        e.preventDefault();
908
        $(".cb").prop("checked", false);
909
        enableCheckboxActions();
909
        enableCheckboxActions();
910
        return false;
911
    });
910
    });
912
911
913
    $(".cb").click(function(){
912
    $(".cb").click(function(){
Lines 967-973 $(function() { Link Here
967
        });
966
        });
968
967
969
        $("#myform").submit(function(){
968
        $("#myform").submit(function(){
970
            var checkedBoxes = $(".checkboxed input:checkbox:checked");
969
            var checkedBoxes = $(".cb:checked");
971
            var numchecked = $(checkedBoxes).size();
970
            var numchecked = $(checkedBoxes).size();
972
            if (numchecked) {
971
            if (numchecked) {
973
                if( numchecked > 1 ){
972
                if( numchecked > 1 ){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-9 / +8 lines)
Lines 337-343 Link Here
337
                                        </div>
337
                                        </div>
338
                                    [% END %]
338
                                    [% END %]
339
339
340
                                    <table id="suggestt" class="checkboxed table table-bordered table-striped">
340
                                    <table id="suggestt" class="table table-bordered table-striped">
341
                                        <thead>
341
                                        <thead>
342
                                            <tr>
342
                                            <tr>
343
                                                [% IF ( loggedinusername ) %]<th>&nbsp;</th>[% END %]
343
                                                [% IF ( loggedinusername ) %]<th>&nbsp;</th>[% END %]
Lines 465-477 Link Here
465
465
466
[% INCLUDE 'opac-bottom.inc' %]
466
[% INCLUDE 'opac-bottom.inc' %]
467
[% BLOCK jsinclude %]
467
[% BLOCK jsinclude %]
468
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
469
[% INCLUDE 'datatables.inc' %]
468
[% INCLUDE 'datatables.inc' %]
470
<script>
469
<script>
471
    [% IF ( loggedinusername ) %]
470
    [% IF ( loggedinusername ) %]
472
        function enableCheckboxActions(){
471
        function enableCheckboxActions(){
473
            // Enable/disable controls if checkboxes are checked
472
            // Enable/disable controls if checkboxes are checked
474
            var checkedBoxes = $(".checkboxed input:checkbox:checked");
473
            var checkedBoxes = $(".cb:checked");
475
            if ($(checkedBoxes).size()) {
474
            if ($(checkedBoxes).size()) {
476
              $("#selections").html(_("With selected suggestions: "));
475
              $("#selections").html(_("With selected suggestions: "));
477
              $("#selections-toolbar .links a").removeClass("disabled");
476
              $("#selections-toolbar .links a").removeClass("disabled");
Lines 501-515 Link Here
501
        }));
500
        }));
502
        [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
501
        [% IF ( loggedinusername ) %]$("span.clearall").html("<a id=\"CheckNone\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Clear all")+"<\/a>");
503
        $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
502
        $("span.checkall").html("<a id=\"CheckAll\" class=\"btn btn-link btn-sm\" href=\"#\">"+_("Select all")+"<\/a>");
504
        $("#CheckAll").click(function(){
503
        $("#CheckAll").on("click",function(e){
505
            $(".checkboxed").checkCheckboxes();
504
            e.preventDefault();
505
            $(".cb").prop("checked", true);
506
            enableCheckboxActions();
506
            enableCheckboxActions();
507
            return false;
508
        });
507
        });
509
        $("#CheckNone").click(function(){
508
        $("#CheckNone").on("click",function(e){
510
            $(".checkboxed").unCheckCheckboxes();
509
            e.preventDefault();
510
            $(".cb").prop("checked", false);
511
            enableCheckboxActions();
511
            enableCheckboxActions();
512
            return false;
513
        });
512
        });
514
        $(".cb").click(function(){
513
        $(".cb").click(function(){
515
          enableCheckboxActions();
514
          enableCheckboxActions();
(-)a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.checkboxes.min.js (-14 lines)
Lines 1-13 Link Here
1
/*
2
 *
3
 * Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk)
4
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
5
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
6
 *
7
 * Version 2.1
8
 * Demo: http://www.texotela.co.uk/code/jquery/checkboxes/
9
 *
10
 * $LastChangedDate$
11
 * $Rev$
12
 */
13
;(function(d){d.fn.toggleCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=!this.checked}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.checkCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=true}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.unCheckCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=false}).filter(":not(:checked)");c=e});if(!b){c=this}return c};d.radioCheckboxGroup=function(e,a){a=a||"*";var b="input[type=checkbox]";if(e){b+="[name="+e+"]"}var c=d(b).filter(a);c.click(function(){c.not(this).each(function(){this.checked=false}).end()})}})(jQuery);
14
- 

Return to bug 26805