From 836d8dba7143f75d493936e65747c899d642bfe8 Mon Sep 17 00:00:00 2001 From: tenzap Date: Thu, 12 Dec 2024 11:54:17 +0100 Subject: [PATCH] update jquery.field.min.js to v0.9.7 --- docs/CREDITS | 2 +- media/js/jquery-plugin/jquery.field.min.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/CREDITS b/docs/CREDITS index fd054c442..ca1603f75 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -12,7 +12,7 @@ jQuery Plugin: * Hotkeys * jQuery Validation 1.19.5 or * Autosize 6.0.1 - © Jack Moore , License: MIT - * Field 0.9.6 + * Field 0.9.7 * jQuery Tags Input Revisited Plugin 2.1 * Form 4.3.0 or Chart.js API 4.4.7 diff --git a/media/js/jquery-plugin/jquery.field.min.js b/media/js/jquery-plugin/jquery.field.min.js index 4da5cb7d5..f5eb7999e 100644 --- a/media/js/jquery-plugin/jquery.field.min.js +++ b/media/js/jquery-plugin/jquery.field.min.js @@ -7,6 +7,6 @@ * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * - * Version: 0.9.6 + * Version: 0.9.7 */ -(function($){var defaults={delimiter:",",checkboxRangeKeyBinding:"shiftKey",useArray:false};$.Field={version:"0.9.6",setDefaults:function(options){$.extend(defaults,options)},setProperty:function(prop,value){defaults[prop]=value},getProperty:function(prop){return defaults[prop]}};$.fn.fieldArray=function(v){var t=$type(v);if(t=="undefined")return getValue(this);if(t=="string"||t=="number"){v=v.toString().split(defaults.delimiter);t="array"}if(t=="array")return setValue(this,v);return this};$.fn.getValue=function(){return getValue(this).join(defaults.delimiter)};var getValue=function(jq){var v=[];jq.each(function(lc){var t=getType(this);switch(t){case"checkbox":case"radio":if(this.checked)v.push(this.value);break;case"select":if(this.type=="select-one"){v.push((this.selectedIndex==-1)?"":getOptionVal(this[this.selectedIndex]))}else{for(var i=0;i-1))return true;if($field.getValue().length>=$field.attr("maxlength")){var $next=$field.moveNext().select();if($.isFunction(callback))callback.apply($field,[$next])}})};$.fn.moveNext=function(){return this.moveIndex("next")};$.fn.movePrev=function(){return this.moveIndex("prev")};$.fn.moveIndex=function(i){var pos=getFieldPosition(this);if(i=="next")i=pos[0]+1;else if(i=="prev")i=pos[0]-1;if(i<0)i=pos[1].length-1;else if(i>=pos[1].length)i=0;return $(pos[1][i]).trigger("focus")};$.fn.getTabIndex=function(){return getFieldPosition(this)[0]};var getFieldPosition=function(jq){var $field=jq.filter("input, select, textarea").get(0),tabIndex=[],posIndex=[];if(!$field)return[-1,[]];$.each($field.form.elements,function(i,o){if(o.tagName!="FIELDSET"&&!o.disabled&&jQuery(o).is(":visible")){if(o.tabIndex>0){tabIndex.push(o)}else{posIndex.push(o)}}});tabIndex.sort(function(a,b){return a.tabIndex-b.tabIndex});tabIndex=$.merge(tabIndex,posIndex);for(var i=0;iopt.limit){return(this.type=="select-multiple")?undoSelect():opt.onfailure.apply(self,[opt.limit])}opt.onsuccess.apply(self,[opt.limit]);return true})};$.fn.createCheckboxRange=function(callback){var opt=jQuery.extend((callback&&callback.constructor==Object?callback:{bind:defaults.checkboxRangeKeyBinding,click:callback}),callback);var iLastSelection=0,self=this,bCallback=$.isFunction(opt.click);if(bCallback)this.each(function(){opt.click.apply(this,[$.event.fix({type:null}),$(this).is(":checked")])});return this.each(function(){if(this.type!="checkbox")return false;var el=this;var updateLastCheckbox=function(e){iLastSelection=self.index(e.target)};var checkboxClicked=function(e){var bSetChecked=this.checked,current=self.index(e.target),low=Math.min(iLastSelection,current),high=Math.max(iLastSelection+1,current);if(bCallback)opt.click.apply(this,[e,bSetChecked]);if(!e[opt.bind])return;for(var i=low;i-1)};var $type=function(o){var t=(typeof o).toLowerCase();if(t=="object"){if(o instanceof Array)t="array";else if(o instanceof Date)t="date"}return t};var $isType=function(o,v){return($type(o)==String(v).toLowerCase())}})(jQuery); \ No newline at end of file +!function(e){var t={delimiter:",",checkboxRangeKeyBinding:"shiftKey",useArray:!1};e.Field={version:"0.9.7",setDefaults:function(i){e.extend(t,i)},setProperty:function(e,i){t[e]=i},getProperty:function(e){return t[e]}},e.fn.fieldArray=function(e){var r=u(e);return"undefined"==r?i(this):("string"!=r&&"number"!=r||(e=e.toString().split(t.delimiter),r="array"),"array"==r?n(this,e):this)},e.fn.getValue=function(){return i(this).join(t.delimiter)};var i=function(e){var t=[];return e.each((function(e){switch(a(this)){case"checkbox":case"radio":this.checked&&t.push(this.value);break;case"select":if("select-one"==this.type)t.push(-1==this.selectedIndex?"":c(this[this.selectedIndex]));else for(var i=0;i-1)return!0;if(n.getValue().length>=n.attr("maxlength")){var a=n.moveNext().select();e.isFunction(t)&&t.apply(n,[a])}}))},e.fn.moveNext=function(){return this.moveIndex("next")},e.fn.movePrev=function(){return this.moveIndex("prev")},e.fn.moveIndex=function(t){var i=r(this);return"next"==t?t=i[0]+1:"prev"==t&&(t=i[0]-1),t<0?t=i[1].length-1:t>=i[1].length&&(t=0),e(i[1][t]).trigger("focus")},e.fn.getTabIndex=function(){return r(this)[0]};var r=function(t){var i=t.filter("input, select, textarea").get(0),n=[],r=[];if(!i)return[-1,[]];e.each(i.form.elements,(function(e,t){"FIELDSET"!=t.tagName&&!t.disabled&&jQuery(t).is(":visible")&&(t.tabIndex>0?n.push(t):r.push(t))})),n.sort((function(e,t){return e.tabIndex-t.tabIndex})),n=e.merge(n,r);for(var a=0;aa.limit?"select-multiple"==this.type?(n(c,i(c).slice(0,a.limit)),a.onfailure.apply(c,[a.limit])):a.onfailure.apply(c,[a.limit]):(a.onsuccess.apply(c,[a.limit]),!0);var t}))},e.fn.createCheckboxRange=function(i){var n=jQuery.extend(i&&i.constructor==Object?i:{bind:t.checkboxRangeKeyBinding,click:i},i),r=0,a=this,c=e.isFunction(n.click);return c&&this.each((function(){n.click.apply(this,[e.event.fix({type:null}),e(this).is(":checked")])})),this.each((function(){if("checkbox"!=this.type)return!1;return e(this).unbind("click.createCheckboxRange").bind("click.createCheckboxRange",(function(e){var t=this.checked,i=a.index(e.target),s=Math.min(r,i),u=Math.max(r+1,i);if(c&&n.click.apply(this,[e,t]),e[n.bind]){for(var l=s;l-1},u=function(e){var t=(typeof e).toLowerCase();return"object"==t&&(e instanceof Array?t="array":e instanceof Date&&(t="date")),t}}(jQuery); \ No newline at end of file