blechreiz-website/intern_area/static/js/jquery.uniform.min.js

1 line
7.6 KiB
JavaScript
Raw Normal View History

2013-06-02 16:05:37 +02:00
(function(e,t){"use strict";function n(e){var t=Array.prototype.slice.call(arguments,1);return e.prop?e.prop.apply(e,t):e.attr.apply(e,t)}function s(e,t,n){var s,a;for(s in n)n.hasOwnProperty(s)&&(a=s.replace(/ |$/g,t.eventNamespace),e.bind(s,n[s]))}function a(e,t,n){s(e,n,{focus:function(){t.addClass(n.focusClass)},blur:function(){t.removeClass(n.focusClass),t.removeClass(n.activeClass)},mouseenter:function(){t.addClass(n.hoverClass)},mouseleave:function(){t.removeClass(n.hoverClass),t.removeClass(n.activeClass)},"mousedown touchbegin":function(){e.is(":disabled")||t.addClass(n.activeClass)},"mouseup touchend":function(){t.removeClass(n.activeClass)}})}function i(e,t){e.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass)}function r(e,t,n){n?e.addClass(t):e.removeClass(t)}function o(e,t,n){var s="checked",a=t.is(":"+s);t.prop?t.prop(s,a):a?t.attr(s,s):t.removeAttr(s),r(e,n.checkedClass,a)}function l(e,t,n){r(e,n.disabledClass,t.is(":disabled"))}function u(e,t,n){switch(n){case"after":return e.after(t),e.next();case"before":return e.before(t),e.prev();case"wrap":return e.wrap(t),e.parent()}return null}function c(t,s,a){var i,r,o;return a||(a={}),a=e.extend({bind:{},divClass:null,divWrap:"wrap",spanClass:null,spanHtml:null,spanWrap:"wrap"},a),i=e("<div />"),r=e("<span />"),s.autoHide&&t.is(":hidden")&&"none"===t.css("display")&&i.hide(),a.divClass&&i.addClass(a.divClass),a.spanClass&&r.addClass(a.spanClass),o=n(t,"id"),s.useID&&o&&n(i,"id",s.idPrefix+"-"+o),a.spanHtml&&r.html(a.spanHtml),i=u(t,i,a.divWrap),r=u(t,r,a.spanWrap),l(i,t,s),{div:i,span:r}}function f(){var t,n,s,a;return a="rgb(120,2,153)",n=e('<div style="width:0;height:0;color:'+a+'">'),e("body").append(n),s=n.get(0),t=window.getComputedStyle?window.getComputedStyle(s,"").color:(s.currentStyle||s.style||{}).color,n.remove(),t.replace(/ /g,"")!==a}function d(t){return t?e("<span />").text(t).html():""}function m(e){var t;return e[0].multiple?!0:(t=n(e,"size"),!t||1>=t?!1:!0)}function p(){return!1}function v(e,t){var n="none";s(e,t,{"selectstart dragstart mousedown":p}),e.css({MozUserSelect:n,msUserSelect:n,webkitUserSelect:n,userSelect:n})}function h(e,t,n){var s=e.val();""===s?s=n.fileDefaultHtml:(s=s.split(/[\/\\]+/),s=s[s.length-1]),t.text(s)}function C(e,t,n){var s,a;for(s=[],e.each(function(){var e;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s.push({el:this,name:e,old:this.style[e]}),this.style[e]=t[e])}),n();s.length;)a=s.pop(),a.el.style[a.name]=a.old}function b(e,t){C(e.parents().andSelf().not(":visible"),{visibility:"hidden",display:"block",position:"absolute"},t)}function w(e,t){return function(){e.unwrap().unwrap().unbind(t.eventNamespace)}}var y=!0,g=!1,k=[{match:function(e){return e.is("a, button, :submit, :reset, input[type='button']")},apply:function(e,t){var r,o,u,f,m;return o=t.submitDefaultHtml,e.is(":reset")&&(o=t.resetDefaultHtml),f=e.is("a, button")?function(){return e.html()||o}:function(){return d(n(e,"value"))||o},u=c(e,t,{divClass:t.buttonClass,spanHtml:f()}),r=u.div,a(e,r,t),m=!1,s(r,t,{"click touchend":function(){var t,s,a,i;m||(m=!0,e[0].dispatchEvent?(t=document.createEvent("MouseEvents"),t.initEvent("click",!0,!0),s=e[0].dispatchEvent(t),(jQuery.browser.msie||jQuery.browser.mozilla)&&e.is("a")&&s&&(a=n(e,"target"),i=n(e,"href"),a&&"_self"!==a?window.open(i,a):document.location.href=i)):e.click(),m=!1)}}),v(r,t),{remove:function(){return r.after(e),r.remove(),e.unbind(t.eventNamespace),e},update:function(){i(r,t),l(r,e,t),u.span.html(f())}}}},{match:function(e){return e.is(":checkbox")},apply:function(e,t){var n,r,u;return n=c(e,t,{divClass:t.checkboxClass}),r=n.div,u=n.span,a(e,r,t),s(e,t,{"click touchend":function(){o(u,e,t)}}),o(u,e,t),{remove:w(e,t),update:function(){i(r,t),u.removeClass(t.checkedClass),o(u,e,t),l(r,e,t)}}}},{match:function(e){return e.is(":file")},apply:function(t,r){function o(){h(t,m,r)}var f,d,m,p;return f=c(t,r,{divClass:r.fileClass,spanClass:r.fileButtonClass,spanHtml:r.fileButtonHtml,spanWrap:"after"}),d=f.div,p=f.span,m=e("<span />").html(r.fileDefaultHtml),m.addClass(r.filenameClass)