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 (-9 / +8 lines)
Lines 343-349 Link Here
343
                                </div> <!-- / #selections-toolbar -->
343
                                </div> <!-- / #selections-toolbar -->
344
                            </div> <!-- /#floating -->
344
                            </div> <!-- /#floating -->
345
345
346
                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform" class="checkboxed">
346
                            <form action="/cgi-bin/koha/opac-shelves.pl" method="post" id="myform" name="myform">
347
                                [% IF can_manage_shelf %]
347
                                [% IF can_manage_shelf %]
348
                                    <input type="hidden" name="op" value="remove_biblios" />
348
                                    <input type="hidden" name="op" value="remove_biblios" />
349
                                    <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
349
                                    <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" />
Lines 798-804 Link Here
798
798
799
[% INCLUDE 'opac-bottom.inc' %]
799
[% INCLUDE 'opac-bottom.inc' %]
800
[% BLOCK jsinclude %]
800
[% BLOCK jsinclude %]
801
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
802
[% Asset.js("lib/hc-sticky.js") | $raw %]
801
[% Asset.js("lib/hc-sticky.js") | $raw %]
803
[% IF OpenLibraryCovers || OpenLibrarySearch %]
802
[% IF OpenLibraryCovers || OpenLibrarySearch %]
804
    [% Asset.js("js/openlibrary.js") | $raw %]
803
    [% Asset.js("js/openlibrary.js") | $raw %]
Lines 869-875 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); Link Here
869
868
870
function enableCheckboxActions(){
869
function enableCheckboxActions(){
871
    // Enable/disable controls if checkboxes are checked
870
    // Enable/disable controls if checkboxes are checked
872
    var checkedBoxes = $(".checkboxed input:checkbox:checked");
871
    var checkedBoxes = $(".cb:checkbox:checked");
873
    if ($(checkedBoxes).size()) {
872
    if ($(checkedBoxes).size()) {
874
      $("#selections").html(_("With selected titles: "));
873
      $("#selections").html(_("With selected titles: "));
875
      $("#selections-toolbar .links a").removeClass("disabled");
874
      $("#selections-toolbar .links a").removeClass("disabled");
Lines 893-907 $(function() { Link Here
893
        });
892
        });
894
    [% END %]
893
    [% END %]
895
894
896
    $("#CheckAll").click(function(){
895
    $("#CheckAll").on("click",function(e){
897
        $(".checkboxed").checkCheckboxes();
896
        e.preventDefault();
897
        $(".cb").prop("checked", true);
898
        enableCheckboxActions();
898
        enableCheckboxActions();
899
        return false;
900
    });
899
    });
901
    $("#CheckNone").click(function(){
900
    $("#CheckNone").on("click",function(e){
902
        $(".checkboxed").unCheckCheckboxes();
901
        e.preventDefault();
902
        $(".cb").prop("checked", false);
903
        enableCheckboxActions();
903
        enableCheckboxActions();
904
        return false;
905
    });
904
    });
906
905
907
    $(".cb").click(function(){
906
    $(".cb").click(function(){
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt (-8 / +11 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-471 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 ) %]
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").each(function(){
506
                $(this).prop("checked", true);
507
            });
506
            enableCheckboxActions();
508
            enableCheckboxActions();
507
            return false;
508
        });
509
        });
509
        $("#CheckNone").click(function(){
510
        $("#CheckNone").on("click",function(e){
510
            $(".checkboxed").unCheckCheckboxes();
511
            e.preventDefault();
512
            $(".cb").each(function(){
513
                $(this).prop("checked", false);
514
            });
511
            enableCheckboxActions();
515
            enableCheckboxActions();
512
            return false;
513
        });
516
        });
514
        $(".cb").click(function(){
517
        $(".cb").click(function(){
515
          enableCheckboxActions();
518
          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