From: Owen Leonard Date: Thu, 9 Jul 2009 01:09:01 +0000 (-0500) Subject: More changes to implement jQuery upgrade. X-Git-Tag: v3.00.04~211 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=cb22296344d0a8c7673d9f477b300dd3d0f6d2b2;p=koha.git More changes to implement jQuery upgrade. - Upgrading jquery checkboxes plugin - Correcting references to checkboxes plugin - Upgrading jquery hotkeys plugin - Upgrading syntax for calls to hotkeys plugin - Removing jquery dimensions plugin (functionality rolled into jQuery) Signed-off-by: John Beppu Signed-off-by: Galen Charlton --- diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc index 6d98e504fd..0d6e8e3ee0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc @@ -18,7 +18,7 @@ - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc index 174d4bed0f..aa71d736be 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc @@ -10,7 +10,7 @@ - + /css/" /> diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index 83a34c51ad..7810beff77 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -6,9 +6,9 @@ function _(s) { return s } // dummy function for gettext $(".focus").focus(); $('#header_search > ul').tabs().bind('show.ui-tabs', function(e, ui) { $('#header_search > div:not(.ui-tabs-hide)').find('input').eq(0).focus(); }); $(".close").click(function(){ window.close(); }); - if($("#header_search #checkin_search").length > 0){ $.hotkeys.add('Alt+r',function (){ $("#header_search > ul").tabs("select","#checkin_search"); $("#ret_barcode").focus(); }); } else { $.hotkeys.add('Alt+r',function (){ location.href="/cgi-bin/koha/circ/returns.pl"; }); } - if($("#header_search #circ_search").length > 0){ $.hotkeys.add('Alt+u',function (){ $("#header_search > ul").tabs("select","#circ_search"); $("#findborrower").focus(); }); } else { $.hotkeys.add('Alt+u',function(){ location.href="/cgi-bin/koha/circ/circulation.pl"; }); } - if($("#header_search #catalog_search").length > 0){ $.hotkeys.add('Alt+q',function (){ $("#header_search > ul").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $.hotkeys.add('Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); } + if($("#header_search #checkin_search").length > 0){ $(document).bind('keydown','Alt+r',function (){ $("#header_search > ul").tabs("select","#checkin_search"); $("#ret_barcode").focus(); }); } else { $(document).bind('keydown','Alt+r',function (){ location.href="/cgi-bin/koha/circ/returns.pl"; }); } + if($("#header_search #circ_search").length > 0){ $(document).bind('keydown','Alt+u',function (){ $("#header_search > ul").tabs("select","#circ_search"); $("#findborrower").focus(); }); } else { $(document).bind('keydown','Alt+u',function(){ location.href="/cgi-bin/koha/circ/circulation.pl"; }); } + if($("#header_search #catalog_search").length > 0){ $(document).bind('keydown','Alt+q',function (){ $("#header_search > ul").tabs("select","#catalog_search"); $("#search-form").focus(); }); } else { $(document).bind('keydown','Alt+q',function(){ location.href="/cgi-bin/koha/catalogue/search.pl"; }); } }); YAHOO.util.Event.onContentReady("header", function () { diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.checkboxes.min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.checkboxes.min.js new file mode 100644 index 0000000000..4ea9a512dc --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.checkboxes.min.js @@ -0,0 +1,13 @@ +/* + * + * Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * Version 2.1 + * Demo: http://www.texotela.co.uk/code/jquery/checkboxes/ + * + * $LastChangedDate$ + * $Rev$ + */ +;(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); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.checkboxes.pack.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.checkboxes.pack.js deleted file mode 100644 index 3801b44b2b..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.checkboxes.pack.js +++ /dev/null @@ -1,13 +0,0 @@ -/* - * - * Copyright (c) 2006/2007 Sam Collett (http://www.texotela.co.uk) - * Licensed under the MIT License: - * http://www.opensource.org/licenses/mit-license.php - * - * Version 2.0.1 - * Demo: http://www.texotela.co.uk/code/jquery/checkboxes/ - * - * $LastChangedDate$ - * $Rev$ - */ -eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2.g.q=1(b,c){b=b||"*";c=c||7;4 d=2([]);0.5(1(){4 a=2("9[@8=f]",0).6(b).5(1(){0.3=!0.3}).6(":3");d=a});e(!c){d=0}i d};2.g.p=1(b,c){b=b||"*";c=c||7;4 d=2([]);0.5(1(){4 a=2("9[@8=f]",0).6(b).5(1(){0.3=o}).6(":3");d=a});e(!c){d=0}i d};2.g.n=1(b,c){b=b||"*";c=c||7;4 d=2([]);0.5(1(){4 a=2("9[@8=f]",0).6(b).5(1(){0.3=7}).6(":j(:3)");d=a});e(!c){d=0}i d};2.m=1(a,b){b=b||"*";4 c="9[@8=f]";e(a){c+="[@l="+a+"]"}4 h=2(c).6(b);h.k(1(){h.j(0).5(1(){0.3=7}).r()})};',28,28,'this|function|jQuery|checked|var|each|filter|false|type|input|||||if|checkbox|fn|x|return|not|click|name|radioCheckboxGroup|unCheckCheckboxes|true|checkCheckboxes|toggleCheckboxes|end'.split('|'),0,{})) \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.hotkeys.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.hotkeys.js deleted file mode 100644 index 7d159e611a..0000000000 --- a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.hotkeys.js +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************************************************************** - - * @ Original idea by by Binny V A, Original version: 2.00.A - * @ http://www.openjs.com/scripts/events/keyboard_shortcuts/ - * @ Original License : BSD - - * @ jQuery Plugin by Tzury Bar Yochay - mail: tzury.by@gmail.com - blog: evalinux.wordpress.com - face: facebook.com/profile.php?id=513676303 - - (c) Copyrights 2007 - - * @ jQuery Plugin version Beta (0.0.2) - * @ License: jQuery-License. - -TODO: - add queue support (as in gmail) e.g. 'x' then 'y', etc. - add mouse + mouse wheel events. - -USAGE: - $.hotkeys.add('Ctrl+c', function(){ alert('copy anyone?');}); - $.hotkeys.add('Ctrl+c', {target:'div#editor', type:'keyup', propagate: true},function(){ alert('copy anyone?');});> - $.hotkeys.remove('Ctrl+c'); - $.hotkeys.remove('Ctrl+c', {target:'div#editor', type:'keypress'}); - -******************************************************************************************************************************/ -(function (jQuery){ - this.version = '(beta)(0.0.3)'; - this.all = {}; - this.special_keys = { - 27: 'esc', 9: 'tab', 32:'space', 13: 'return', 8:'backspace', 145: 'scroll', 20: 'capslock', - 144: 'numlock', 19:'pause', 45:'insert', 36:'home', 46:'del',35:'end', 33: 'pageup', - 34:'pagedown', 37:'left', 38:'up', 39:'right',40:'down', 112:'f1',113:'f2', 114:'f3', - 115:'f4', 116:'f5', 117:'f6', 118:'f7', 119:'f8', 120:'f9', 121:'f10', 122:'f11', 123:'f12'}; - - this.shift_nums = { "`":"~", "1":"!", "2":"@", "3":"#", "4":"$", "5":"%", "6":"^", "7":"&", - "8":"*", "9":"(", "0":")", "-":"_", "=":"+", ";":":", "'":"\"", ",":"<", - ".":">", "/":"?", "\\":"|" }; - - this.add = function(combi, options, callback) { - if (jQuery.isFunction(options)){ - callback = options; - options = {}; - } - var opt = {}, - defaults = {type: 'keydown', propagate: false, disableInInput: false, target: jQuery('html')[0], checkParent: true}, - that = this; - opt = jQuery.extend( opt , defaults, options || {} ); - combi = combi.toLowerCase(); - - // inspect if keystroke matches - var inspector = function(event) { - event = jQuery.event.fix(event); // jQuery event normalization. - var element = event.target; - // @ TextNode -> nodeType == 3 - element = (element.nodeType==3) ? element.parentNode : element; - - if(opt['disableInInput']) { // Disable shortcut keys in Input, Textarea fields - var target = jQuery(element); - if( target.is("input") || target.is("textarea")){ - return; - } - } - var code = event.which, - type = event.type, - character = String.fromCharCode(code).toLowerCase(), - special = that.special_keys[code], - shift = event.shiftKey, - ctrl = event.ctrlKey, - alt= event.altKey, - propagate = true, // default behaivour - mapPoint = null; - - // in opera + safari, the event.target is unpredictable. - // for example: 'keydown' might be associated with HtmlBodyElement - // or the element where you last clicked with your mouse. - if (jQuery.browser.opera || jQuery.browser.safari || opt.checkParent){ - while (!that.all[element] && element.parentNode){ - element = element.parentNode; - } - } - - var cbMap = that.all[element].events[type].callbackMap; - if(!shift && !ctrl && !alt) { // No Modifiers - mapPoint = cbMap[special] || cbMap[character] - } - // deals with combinaitons (alt|ctrl|shift+anything) - else{ - var modif = ''; - if(alt) modif +='alt+'; - if(ctrl) modif+= 'ctrl+'; - if(shift) modif += 'shift+'; - // modifiers + special keys or modifiers + characters or modifiers + shift characters - mapPoint = cbMap[modif+special] || cbMap[modif+character] || cbMap[modif+that.shift_nums[character]] - } - if (mapPoint){ - mapPoint.cb(event); - if(!mapPoint.propagate) { - event.stopPropagation(); - event.preventDefault(); - return false; - } - } - }; - // first hook for this element - if (!this.all[opt.target]){ - this.all[opt.target] = {events:{}}; - } - if (!this.all[opt.target].events[opt.type]){ - this.all[opt.target].events[opt.type] = {callbackMap: {}} - jQuery.event.add(opt.target, opt.type, inspector); - } - this.all[opt.target].events[opt.type].callbackMap[combi] = {cb: callback, propagate:opt.propagate}; - return jQuery; - }; - this.remove = function(exp, opt) { - opt = opt || {}; - target = opt.target || jQuery('html')[0]; - type = opt.type || 'keydown'; - exp = exp.toLowerCase(); - delete this.all[target].events[type].callbackMap[exp] - return jQuery; - }; - jQuery.hotkeys = this; - return jQuery; -})(jQuery); \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.hotkeys.min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.hotkeys.min.js new file mode 100644 index 0000000000..53e37cc7b2 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.hotkeys.min.js @@ -0,0 +1,19 @@ +(function(jQuery){jQuery.fn.__bind__=jQuery.fn.bind;jQuery.fn.__unbind__=jQuery.fn.unbind;jQuery.fn.__find__=jQuery.fn.find;var hotkeys={version:'0.7.9',override:/keypress|keydown|keyup/g,triggersMap:{},specialKeys:{27:'esc',9:'tab',32:'space',13:'return',8:'backspace',145:'scroll',20:'capslock',144:'numlock',19:'pause',45:'insert',36:'home',46:'del',35:'end',33:'pageup',34:'pagedown',37:'left',38:'up',39:'right',40:'down',109:'-',112:'f1',113:'f2',114:'f3',115:'f4',116:'f5',117:'f6',118:'f7',119:'f8',120:'f9',121:'f10',122:'f11',123:'f12',191:'/'},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":"\"",",":"<",".":">","/":"?","\\":"|"},newTrigger:function(type,combi,callback){var result={};result[type]={};result[type][combi]={cb:callback,disableInInput:false};return result;}};hotkeys.specialKeys=jQuery.extend(hotkeys.specialKeys,{96:'0',97:'1',98:'2',99:'3',100:'4',101:'5',102:'6',103:'7',104:'8',105:'9',106:'*',107:'+',109:'-',110:'.',111:'/'});jQuery.fn.find=function(selector){this.query=selector;return jQuery.fn.__find__.apply(this,arguments);};jQuery.fn.unbind=function(type,combi,fn){if(jQuery.isFunction(combi)){fn=combi;combi=null;} +if(combi&&typeof combi==='string'){var selectorId=((this.prevObject&&this.prevObject.query)||(this[0].id&&this[0].id)||this[0]).toString();var hkTypes=type.split(' ');for(var x=0;xKoha › Z39.50 Search Results - + - + + + - + + - + + + + +