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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (-9 lines)
Lines 67-78 var NO_LOCAL_JACKET = _("No cover image available"); Link Here
67
//]]>
67
//]]>
68
</script>
68
</script>
69
[% END %]
69
[% END %]
70
71
<script type="text/javascript" language="javascript">
72
$(document).ready(function() {
73
    $('.noEnterSubmit').keypress(function(e){
74
        if ( e.which == 13 ) return false;
75
        //if ( e.which == 13 ) e.preventDefault();
76
    });
77
});
78
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js (-19 / +10 lines)
Lines 5-15 function _(s) { return s } // dummy function for gettext Link Here
5
5
6
 $(document).ready(function() {
6
 $(document).ready(function() {
7
    $('#header_search').tabs().bind('tabsshow', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); });
7
    $('#header_search').tabs().bind('tabsshow', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); });
8
	$(".close").click(function(){ window.close(); });
8
9
    $(".close").click(function(){ window.close(); });
10
9
    if($("#header_search #checkin_search").length > 0){ $(document).bind('keydown','Alt+r',function (){ $("#header_search").tabs("select","#checkin_search"); $("#ret_barcode").focus(); }); } else { $(document).bind('keydown','Alt+r',function (){ location.href="/cgi-bin/koha/circ/returns.pl"; }); }
11
    if($("#header_search #checkin_search").length > 0){ $(document).bind('keydown','Alt+r',function (){ $("#header_search").tabs("select","#checkin_search"); $("#ret_barcode").focus(); }); } else { $(document).bind('keydown','Alt+r',function (){ location.href="/cgi-bin/koha/circ/returns.pl"; }); }
10
    if($("#header_search #circ_search").length > 0){ $(document).bind('keydown','Alt+u',function (){ $("#header_search").tabs("select","#circ_search"); $("#findborrower").focus(); }); } else { $(document).bind('keydown','Alt+u',function(){ location.href="/cgi-bin/koha/circ/circulation.pl"; }); }
12
    if($("#header_search #circ_search").length > 0){ $(document).bind('keydown','Alt+u',function (){ $("#header_search").tabs("select","#circ_search"); $("#findborrower").focus(); }); } else { $(document).bind('keydown','Alt+u',function(){ location.href="/cgi-bin/koha/circ/circulation.pl"; }); }
11
    if($("#header_search #catalog_search").length > 0){ $(document).bind('keydown','Alt+q',function (){ $("#header_search").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $(document).bind('keydown','Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); }
13
    if($("#header_search #catalog_search").length > 0){ $(document).bind('keydown','Alt+q',function (){ $("#header_search").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $(document).bind('keydown','Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); }
14
12
    $(".focus").focus();
15
    $(".focus").focus();
16
17
    $('.noEnterSubmit').keypress(function(e){
18
        if ( e.which == 13 ) return false;
19
        //if ( e.which == 13 ) e.preventDefault();
20
    });
21
13
 });
22
 });
14
23
15
 
24
 
Lines 73-96 YAHOO.util.Event.onContentReady("changelanguage", function () { Link Here
73
	});
82
	});
74
});
83
});
75
			
84
			
76
// http://jennifermadden.com/javascript/stringEnterKeyDetector.html
77
function checkEnter(e){ //e is event object passed from function invocation
78
	var characterCode; // literal character code will be stored in this variable
79
	if(e && e.which){ //if which property of event object is supported (NN4)
80
		e = e;
81
		characterCode = e.which; //character code is contained in NN4's which property
82
	} else {
83
		e = event;
84
		characterCode = e.keyCode; //character code is contained in IE's keyCode property
85
	}
86
87
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
88
		return false;
89
	} else {
90
		return true;
91
	}
92
}
93
94
function clearHoldFor(){
85
function clearHoldFor(){
95
	$.cookie("holdfor",null, { path: "/", expires: 0 });
86
	$.cookie("holdfor",null, { path: "/", expires: 0 });
96
}
87
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt (-1 / +1 lines)
Lines 9-15 $(document).ready(function(){ Link Here
9
            window.close();
9
            window.close();
10
        [% END %]
10
        [% END %]
11
    [% END %]
11
    [% END %]
12
		$("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
12
		$("fieldset.rows input").addClass("noEnterSubmit");
13
		/* Inline edit/delete links */
13
		/* Inline edit/delete links */
14
		var biblionumber = $("input[name='biblionumber']").attr("value");
14
		var biblionumber = $("input[name='biblionumber']").attr("value");
15
		$("td").click(function(event){
15
		$("td").click(function(event){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (-1 / +1 lines)
Lines 4-10 Link Here
4
<script type="text/javascript">
4
<script type="text/javascript">
5
//<![CDATA[
5
//<![CDATA[
6
$(document).ready(function(){
6
$(document).ready(function(){
7
	$("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
7
	$("fieldset.rows input").addClass("noEnterSubmit");
8
});
8
});
9
//]]>
9
//]]>
10
</script>
10
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-1 / +1 lines)
Lines 4-10 Link Here
4
<script type="text/javascript">
4
<script type="text/javascript">
5
//<![CDATA[
5
//<![CDATA[
6
$(document).ready(function(){
6
$(document).ready(function(){
7
	$("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
7
	$("fieldset.rows input").addClass("noEnterSubmit");
8
});
8
});
9
//]]>
9
//]]>
10
</script>
10
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-2 / +1 lines)
Lines 6-12 Link Here
6
<script type="text/JavaScript">
6
<script type="text/JavaScript">
7
//<![CDATA[
7
//<![CDATA[
8
    $(document).ready(function() {
8
    $(document).ready(function() {
9
		$("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
9
		$("fieldset.rows input").addClass("noEnterSubmit");
10
        $("#guarantordelete").click(function() {
10
        $("#guarantordelete").click(function() {
11
            $("#contact-details").hide().find('a').remove();
11
            $("#contact-details").hide().find('a').remove();
12
            $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
12
            $("#guarantorid, #contactname, #contactfirstname").each(function () { this.value = "" });
13
- 

Return to bug 8215