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

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js (-7 / +7 lines)
Lines 11-20 KOHA.Preferences = { Link Here
11
    Save: function ( form ) {
11
    Save: function ( form ) {
12
        data = $( form ).find( '.modified' ).serialize();
12
        data = $( form ).find( '.modified' ).serialize();
13
        if ( !data ) {
13
        if ( !data ) {
14
            humanMsg.displayAlert( 'Nothing to save' );
14
            humanMsg.displayAlert( MSG_NOTHING_TO_SAVE );
15
            return;
15
            return;
16
        }
16
        }
17
        KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), _( 'Saving...' ) );
17
        KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), _( MSG_SAVING ) );
18
        KOHA.AJAX.Submit( {
18
        KOHA.AJAX.Submit( {
19
            data: data,
19
            data: data,
20
            url: '/cgi-bin/koha/svc/config/systempreferences/',
20
            url: '/cgi-bin/koha/svc/config/systempreferences/',
Lines 38-44 $( document ).ready( function () { Link Here
38
        $( this ).addClass( 'modified' );
38
        $( this ).addClass( 'modified' );
39
        var name_cell = $( this ).parents( '.name-row' ).find( '.name-cell' );
39
        var name_cell = $( this ).parents( '.name-row' ).find( '.name-cell' );
40
		if ( !name_cell.find( '.modified-warning' ).length )
40
		if ( !name_cell.find( '.modified-warning' ).length )
41
            name_cell.append( '<em class="modified-warning">(modified)</em>' );
41
            name_cell.append( '<em class="modified-warning">('+MSG_MODIFIED+')</em>' );
42
        KOHA.Preferences.Modified = true;
42
        KOHA.Preferences.Modified = true;
43
    }
43
    }
44
44
Lines 54-60 $( document ).ready( function () { Link Here
54
54
55
    window.onbeforeunload = function () {
55
    window.onbeforeunload = function () {
56
        if ( KOHA.Preferences.Modified ) {
56
        if ( KOHA.Preferences.Modified ) {
57
            return _( "You have made changes to system preferences." );
57
            return MSG_MADE_CHANGES;
58
        }
58
        }
59
    }
59
    }
60
60
Lines 73-88 $( document ).ready( function () { Link Here
73
        return false;
73
        return false;
74
    } ).nextAll( 'textarea, input[type=submit]' ).hide().css( { opacity: 0 } );
74
    } ).nextAll( 'textarea, input[type=submit]' ).hide().css( { opacity: 0 } );
75
75
76
    $("h3").attr("class","expanded").attr("title",_("Click to expand this section"));
76
    $("h3").attr("class","expanded").attr("title",MSG_CLICK_TO_EXPAND);
77
    var collapsible = $(".collapsed,.expanded");
77
    var collapsible = $(".collapsed,.expanded");
78
78
79
    $(collapsible).toggle(
79
    $(collapsible).toggle(
80
        function () {
80
        function () {
81
            $(this).addClass("collapsed").removeClass("expanded").attr("title",_("Click to expand this section"));
81
            $(this).addClass("collapsed").removeClass("expanded").attr("title",MSG_CLICK_TO_EXPAND);
82
            $(this).next("table").hide();
82
            $(this).next("table").hide();
83
        },
83
        },
84
        function () {
84
        function () {
85
            $(this).addClass("expanded").removeClass("collapsed").attr("title",_("Click to collapse this section"));
85
            $(this).addClass("expanded").removeClass("collapsed").attr("title",MSG_CLICK_TO_COLLAPSE);
86
            $(this).next("table").show();
86
            $(this).next("table").show();
87
        }
87
        }
88
    );
88
    );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl (-4 / +9 lines)
Lines 6-20 Link Here
6
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang"-->/css/humanmsg.css" />
6
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang"-->/css/humanmsg.css" />
7
<script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
7
<script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
8
<script src="<!-- TMPL_VAR NAME="themelang" -->/js/ajax.js" type="text/javascript"></script>
8
<script src="<!-- TMPL_VAR NAME="themelang" -->/js/ajax.js" type="text/javascript"></script>
9
<script src="<!-- TMPL_VAR NAME="themelang" -->/js/pages/preferences.js" type="text/javascript"></script>
10
<script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/jquery.highlight-3.js" type="text/javascript"></script>
11
<script type="text/javascript">
9
<script type="text/javascript">
12
 //<![CDATA[
10
//<![CDATA[
13
    // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
11
    // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
14
    var to_highlight = "<!-- TMPL_VAR NAME="searchfield" ESCAPE="JS"-->";
12
    var to_highlight = "<!-- TMPL_VAR NAME="searchfield" ESCAPE="JS"-->";
15
    var search_jumped = <!-- TMPL_IF NAME="search_jumped" -->true<!-- TMPL_ELSE -->false<!-- /TMPL_IF -->;
13
    var search_jumped = <!-- TMPL_IF NAME="search_jumped" -->true<!-- TMPL_ELSE -->false<!-- /TMPL_IF -->;
14
    var MSG_NOTHING_TO_SAVE = _("Nothing to save");
15
    var MSG_SAVING = _("Saving...");
16
    var MSG_MODIFIED = _("modified");
17
    var MSG_MADE_CHANGES = _("You have made changes to system preferences.");
18
    var MSG_CLICK_TO_EXPAND = _("Click to expand this section");
19
    var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section");
16
//]]>
20
//]]>
17
</script>
21
</script>
22
<script src="<!-- TMPL_VAR NAME="themelang" -->/js/pages/preferences.js" type="text/javascript"></script>
23
<script src="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/jquery.highlight-3.js" type="text/javascript"></script>
18
</head>
24
</head>
19
<body>
25
<body>
20
<!-- TMPL_INCLUDE NAME="header.inc" -->
26
<!-- TMPL_INCLUDE NAME="header.inc" -->
21
- 

Return to bug 5689