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

(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-22 / +10 lines)
Lines 1-5 Link Here
1
/* global shortcut delCookie delBasket Sticky */
1
/* global shortcut delBasket Sticky AUDIO_ALERT_PATH */
2
/* exported paramOfUrl addBibToContext delBibToContext */
2
/* exported addBibToContext delBibToContext escape_str escape_price openWindow _ removeFocus toUC confirmDelete confirmClone playSound */
3
if ( KOHA === undefined ) var KOHA = {};
3
if ( KOHA === undefined ) var KOHA = {};
4
4
5
function _(s) { return s; } // dummy function for gettext
5
function _(s) { return s; } // dummy function for gettext
Lines 48-55 $.fn.selectTabByID = function (tabID) { Link Here
48
    $(this).tabs("option", "active", $( tabID ).tabIndex());
48
    $(this).tabs("option", "active", $( tabID ).tabIndex());
49
};
49
};
50
50
51
 $(document).ready(function() {
51
$(document).ready(function() {
52
    $('#header_search').tabs().on( "tabsactivate", function(e, ui) { $(this).find("div:visible").find('input').eq(0).focus(); });
52
    $('#header_search').tabs().on( "tabsactivate", function() { $(this).find("div:visible").find('input').eq(0).focus(); });
53
53
54
    $(".close").click(function(){ window.close(); });
54
    $(".close").click(function(){ window.close(); });
55
55
Lines 213-219 function openHelp(){ Link Here
213
213
214
jQuery.fn.preventDoubleFormSubmit = function() {
214
jQuery.fn.preventDoubleFormSubmit = function() {
215
    jQuery(this).submit(function() {
215
    jQuery(this).submit(function() {
216
    $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting');
216
        $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting');
217
        if (this.beenSubmitted)
217
        if (this.beenSubmitted)
218
            return false;
218
            return false;
219
        else
219
        else
Lines 225-236 function openWindow(link,name,width,height) { Link Here
225
    name = (typeof name == "undefined")?'popup':name;
225
    name = (typeof name == "undefined")?'popup':name;
226
    width = (typeof width == "undefined")?'600':width;
226
    width = (typeof width == "undefined")?'600':width;
227
    height = (typeof height == "undefined")?'400':height;
227
    height = (typeof height == "undefined")?'400':height;
228
    var newwin;
229
    //IE <= 9 can't handle a "name" with whitespace
228
    //IE <= 9 can't handle a "name" with whitespace
230
    try {
229
    try {
231
        newin=window.open(link,name,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top');
230
        window.open(link,name,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top');
232
    } catch(e) {
231
    } catch(e) {
233
        newin=window.open(link,null,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top');
232
        window.open(link,null,'width='+width+',height='+height+',resizable=yes,toolbar=false,scrollbars=yes,top');
234
    }
233
    }
235
}
234
}
236
235
Lines 267-273 function keep_text(clicked_index) { Link Here
267
    var searchboxes = document.getElementsByClassName("head-searchbox");
266
    var searchboxes = document.getElementsByClassName("head-searchbox");
268
    var persist = searchboxes[0].value;
267
    var persist = searchboxes[0].value;
269
268
270
    for (i = 0; i < searchboxes.length - 1; i++) {
269
    for (var i = 0; i < searchboxes.length - 1; i++) {
271
        if (searchboxes[i].value != searchboxes[i+1].value) {
270
        if (searchboxes[i].value != searchboxes[i+1].value) {
272
            if (i === searchboxes.length-2) {
271
            if (i === searchboxes.length-2) {
273
                if (searchboxes[i].value != searchboxes[0].value) {
272
                if (searchboxes[i].value != searchboxes[0].value) {
Lines 306-323 function removeByValue(arr, val) { Link Here
306
    }
305
    }
307
}
306
}
308
307
309
function paramOfUrl( url, param ) {
310
    param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
311
    var regexS = "[\\?&]"+param+"=([^&#]*)";
312
    var regex = new RegExp( regexS );
313
    var results = regex.exec( url );
314
    if( results == null ) {
315
        return "";
316
    } else {
317
        return results[1];
318
    }
319
}
320
321
function addBibToContext( bibnum ) {
308
function addBibToContext( bibnum ) {
322
    bibnum = parseInt(bibnum, 10);
309
    bibnum = parseInt(bibnum, 10);
323
    var bibnums = getContextBiblioNumbers();
310
    var bibnums = getContextBiblioNumbers();
Lines 351-356 function resetSearchContext() { Link Here
351
338
352
function saveOrClearSimpleSearchParams() {
339
function saveOrClearSimpleSearchParams() {
353
    // Simple masthead search - pass value for display on details page
340
    // Simple masthead search - pass value for display on details page
341
    var pulldown_selection;
342
    var searchbox_value;
354
    if( $("#cat-search-block select.advsearch").length ){
343
    if( $("#cat-search-block select.advsearch").length ){
355
        pulldown_selection = $("#cat-search-block select.advsearch").val();
344
        pulldown_selection = $("#cat-search-block select.advsearch").val();
356
    } else {
345
    } else {
357
- 

Return to bug 28522