-
Notifications
You must be signed in to change notification settings - Fork 55
/
cck.dev-3.17.0.min.js
executable file
·3 lines (3 loc) · 2.54 KB
/
cck.dev-3.17.0.min.js
1
2
3
/* Copyright (C) 2009 - 2018 SEBLOD. All Rights Reserved. */
if("undefined"===typeof JCck)var JCck={};
!function(f){JCck.submitForm=function(e,t){void 0===t&&(t=document.getElementById("adminForm")),void 0!==e&&""!==e&&(t.task.value=e),"function"==typeof t.onsubmit&&t.onsubmit(),"function"==typeof t.fireEvent&&t.fireEvent("onsubmit"),"function"==typeof jQuery&&jQuery(t).submit(),t.submit()},JCck.transliterate=function(e,t){var n=new String(e);if(n){var i={},s=[],a=0;for(var r in t)for(var l=t[r].split(","),u=l.length,c=0;c<u;c++){var o=l[c];s[a]=o,i[o]=r,a++}if(s.length){var h=new RegExp(s.join("|"),"g");n=n.replace(h,function(e){return i[e]?i[e]:e})}}return n},f.fn.isDisabledWhen=function(e,t){var n=f("#"+e),i=t.split(","),s=f(this);null!=n&&(0<=f.inArray(n.val(),i)?s.prop("disabled",!0):s.prop("disabled",!1),n.change(function(){var e=n.val();0<=f.inArray(e,i)?s.prop("disabled",!0):s.prop("disabled",!1)}))},f.fn.isVisibleWhen=function(e,t,n,i){var s=f("#"+e),a=t.split(","),r=!0;if(1==n||"true"==n)var l="";else if(0==n||"false"==n){l="";r=!1}else l=n||"";if("visibility"==i)var u="visible",c="hidden";else{i="display";u="",c="none"}var o=f(this),h=f(this).attr("id");if(void 0!==h)var v=f("#"+h+"_chzn");else v="";null!=s&&(0<=f.inArray(s.val(),a)?v&&v.length?v.css(i,u):1==r?o.parent(l).css(i,u):o.css(i,u):v&&v.length?v.css(i,c):1==r?o.parent(l).css(i,c):o.css(i,c),s.change(function(){var e=s.val();0<=f.inArray(e,a)?v&&v.length?v.css(i,u):1==r?o.parent(l).css(i,u):o.css(i,u):v&&v.length?v.css(i,c):1==r?o.parent(l).css(i,c):o.css(i,c)}))},f.fn.myVal=function(e){if(1==arguments.length)var t=1;else t=0,e="";if(!this[0])return"";var n=this[0];if("FIELDSET"!=n.tagName&&"DIV"!=n.tagName)return"SELECT"==n.tagName&&this.prop("multiple")?t?e?this.val(e.split(",")):this.val(e):this.val():t?this.val(e):this.val();var i="#"+this.attr("id"),s="";if(e)f(i+" input").val(e.split(","));else{if(1<f(i+" input:checked").length)return f(i+" input:checked").each(function(){s+=","+f(this).val()}),s.substr(1);if(1==f(i+" input:checked").length)return f(i+" input:checked").val()}},f.fn.serializeObject=function(){var e={},t=this.serializeArray();return f.each(t,function(){e[this.name]?(e[this.name].push||(e[this.name]=[e[this.name]]),e[this.name].push(this.value||"")):e[this.name]=this.value||""}),e},f.fn.triggersDropdown=function(){return this.each(function(e,t){if(document.createEvent){var n=document.createEvent("MouseEvents");n.initMouseEvent("mousedown",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}else element.fireEvent&&t.fireEvent("onmousedown")})}}(jQuery);