diff options
Diffstat (limited to 'semantic/dist/components/slider.min.js')
| -rw-r--r-- | semantic/dist/components/slider.min.js | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/semantic/dist/components/slider.min.js b/semantic/dist/components/slider.min.js deleted file mode 100644 index d38da3d..0000000 --- a/semantic/dist/components/slider.min.js +++ /dev/null @@ -1,11 +0,0 @@ - /* - * # Fomantic UI - 2.8.7 - * https://github.com/fomantic/Fomantic-UI - * http://fomantic-ui.com/ - * - * Copyright 2014 Contributors - * Released under the MIT license - * http://opensource.org/licenses/MIT - * - */ -!function(U,t,X,Y){"use strict";t=void 0!==t&&t.Math==Math?t:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),U.fn.slider=function(F){var S,e=U(this),A=U(t),D=e.selector||"",O=(new Date).getTime(),N=[],j=F,z="string"==typeof j,I=[].slice.call(arguments,1),R=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],B=0;return e.each(function(){var l,o,s,e,c,r,t,i,d,m,f,u,n,g,v,b=U.isPlainObject(F)?U.extend(!0,{},U.fn.slider.settings,F):U.extend({},U.fn.slider.settings),a=b.className,h=b.metadata,p=b.namespace,k=b.error,V=b.keys,T=b.interpretLabel,w=!1,y="."+p,M="module-"+p,x=U(this),P=this,E=x.data(M),C=1,L={initialize:function(){L.debug("Initializing slider",b),v=!0,t=B+=1,n=L.setup.testOutTouch(),L.setup.layout(),L.setup.labels(),L.is.disabled()||L.bind.events(),L.read.metadata(),L.read.settings(),v=!1,L.instantiate()},instantiate:function(){L.verbose("Storing instance of slider",L),E=L,x.data(M,L)},destroy:function(){L.verbose("Destroying previous slider for",x),clearInterval(E.interval),L.unbind.events(),L.unbind.slidingEvents(),x.removeData(M),E=Y},setup:{layout:function(){x.attr("tabindex")===Y&&x.attr("tabindex",0),0==x.find(".inner").length&&x.append("<div class='inner'><div class='track'></div><div class='track-fill'></div><div class='thumb'></div></div>"),u=L.get.precision(),o=x.find(".thumb:not(.second)"),l=o,L.is.range()&&(0==x.find(".thumb.second").length&&x.find(".inner").append("<div class='thumb second'></div>"),s=x.find(".thumb.second")),e=x.find(".track"),c=x.find(".track-fill"),f=o.width()/2},labels:function(){L.is.labeled()&&(0!=(r=x.find(".labels:not(.auto)")).length?L.setup.customLabel():L.setup.autoLabel(),b.showLabelTicks&&x.addClass(a.ticked))},testOutTouch:function(){try{return X.createEvent("TouchEvent"),!0}catch(e){return!1}},customLabel:function(){var n,e=r.find(".label"),a=e.length,o=L.get.min(),s=L.get.max();e.each(function(e){var t=U(this).attr("data-value");n=t?((t=s<t?s:t<o?o:t)-o)/(s-o):(e+1)/(a+1),L.update.labelPosition(n,U(this))})},autoLabel:function(){if(0!=L.get.step()){0!=(r=x.find(".labels")).length?r.empty():r=x.append('<ul class="auto labels"></ul>').find(".labels");for(var e=0,t=L.get.numLabels();e<=t;e++){var n=L.get.label(e),a=""!==n?e%L.get.gapRatio()?U('<li class="halftick label"></li>'):U('<li class="label">'+n+"</li>"):null,n=e/t;a&&(L.update.labelPosition(n,a),r.append(a))}}}},bind:{events:function(){L.bind.globalKeyboardEvents(),L.bind.keyboardEvents(),L.bind.mouseEvents(),L.is.touch()&&L.bind.touchEvents(),b.autoAdjustLabels&&L.bind.windowEvents()},keyboardEvents:function(){L.verbose("Binding keyboard events"),x.on("keydown"+y,L.event.keydown)},globalKeyboardEvents:function(){U(X).on("keydown"+y+t,L.event.activateFocus)},mouseEvents:function(){L.verbose("Binding mouse events"),x.find(".track, .thumb, .inner").on("mousedown"+y,function(e){e.stopImmediatePropagation(),e.preventDefault(),L.event.down(e)}),x.on("mousedown"+y,L.event.down),x.on("mouseenter"+y,function(e){w=!0}),x.on("mouseleave"+y,function(e){w=!1})},touchEvents:function(){L.verbose("Binding touch events"),x.find(".track, .thumb, .inner").on("touchstart"+y,function(e){e.stopImmediatePropagation(),e.preventDefault(),L.event.down(e)}),x.on("touchstart"+y,L.event.down)},slidingEvents:function(){L.verbose("Binding page wide events while handle is being draged"),L.is.touch()?(U(X).on("touchmove"+y,L.event.move),U(X).on("touchend"+y,L.event.up)):(U(X).on("mousemove"+y,L.event.move),U(X).on("mouseup"+y,L.event.up))},windowEvents:function(){A.on("resize"+y,L.event.resize)}},unbind:{events:function(){x.find(".track, .thumb, .inner").off("mousedown"+y),x.find(".track, .thumb, .inner").off("touchstart"+y),x.off("mousedown"+y),x.off("mouseenter"+y),x.off("mouseleave"+y),x.off("touchstart"+y),x.off("keydown"+y),x.off("focusout"+y),U(X).off("keydown"+y+t,L.event.activateFocus),A.off("resize"+y)},slidingEvents:function(){L.is.touch()?(U(X).off("touchmove"+y),U(X).off("touchend"+y)):(U(X).off("mousemove"+y),U(X).off("mouseup"+y))}},event:{down:function(e){e.preventDefault(),L.is.range()&&(e=L.determine.eventPos(e),e=L.determine.pos(e),l=b.preventCrossover&&L.is.range()&&L.thumbVal===L.secondThumbVal?(g=e,Y):L.determine.closestThumb(e)),L.is.disabled()||L.bind.slidingEvents()},move:function(e){e.preventDefault();var t,n,a=L.determine.valueFromEvent(e);l===Y&&(t=L.determine.eventPos(e),n=L.determine.pos(t),l=n<g?o:s),0==L.get.step()||L.is.smooth()?(t=L.thumbVal,n=L.secondThumbVal,e=L.determine.smoothValueFromEvent(e),l.hasClass("second")?(b.preventCrossover&&L.is.range()&&(a=Math.max(t,a),e=Math.max(t,e)),n=a):(b.preventCrossover&&L.is.range()&&(a=Math.min(n,a),e=Math.min(n,e)),t=a),a=Math.abs(t-(n||0)),L.update.position(e),b.onMove.call(P,a,t,n)):L.update.value(a,function(e,t,n){b.onMove.call(P,e,t,n)})},up:function(e){e.preventDefault();e=L.determine.valueFromEvent(e);L.set.value(e),L.unbind.slidingEvents()},keydown:function(e,t){if(b.preventCrossover&&L.is.range()&&L.thumbVal===L.secondThumbVal&&(l=Y),L.is.focused()&&U(X).trigger(e),t||L.is.focused()){t=L.determine.keyMovement(e);if(0!=t)switch(e.preventDefault(),t){case 1:L.takeStep();break;case 2:L.takeStep(L.get.multiplier());break;case-1:L.backStep();break;case-2:L.backStep(L.get.multiplier())}}},activateFocus:function(e){!L.is.focused()&&L.is.hover()&&0!=L.determine.keyMovement(e)&&(e.preventDefault(),L.event.keydown(e,!0),x.focus())},resize:function(e){C!=L.get.gapRatio()&&(L.setup.labels(),C=L.get.gapRatio())}},resync:function(){L.verbose("Resyncing thumb position based on value"),L.is.range()&&L.update.position(L.secondThumbVal,s),L.update.position(L.thumbVal,o),L.setup.labels()},takeStep:function(e){var e=e!=Y?e:1,t=L.get.step(),n=L.get.currentThumbValue();L.verbose("Taking a step"),0<t?L.set.value(n+t*e):0==t&&(e=n+e/(n=L.get.precision()),L.set.value(Math.round(e*n)/n))},backStep:function(e){var e=e!=Y?e:1,t=L.get.step(),n=L.get.currentThumbValue();L.verbose("Going back a step"),0<t?L.set.value(n-t*e):0==t&&(e=n-e/(n=L.get.precision()),L.set.value(Math.round(e*n)/n))},is:{range:function(){return x.hasClass(b.className.range)},hover:function(){return w},focused:function(){return x.is(":focus")},disabled:function(){return x.hasClass(b.className.disabled)},labeled:function(){return x.hasClass(b.className.labeled)},reversed:function(){return x.hasClass(b.className.reversed)},vertical:function(){return x.hasClass(b.className.vertical)},smooth:function(){return b.smooth||x.hasClass(b.className.smooth)},touch:function(){return n}},get:{trackOffset:function(){return L.is.vertical()?e.offset().top:e.offset().left},trackLength:function(){return L.is.vertical()?e.height():e.width()},trackLeft:function(){return L.is.vertical()?e.position().top:e.position().left},trackStartPos:function(){return L.is.reversed()?L.get.trackLeft()+L.get.trackLength():L.get.trackLeft()},trackEndPos:function(){return L.is.reversed()?L.get.trackLeft():L.get.trackLeft()+L.get.trackLength()},trackStartMargin:function(){var e=L.is.vertical()?L.is.reversed()?x.css("padding-bottom"):x.css("padding-top"):L.is.reversed()?x.css("padding-right"):x.css("padding-left");return e||"0px"},trackEndMargin:function(){var e=L.is.vertical()?L.is.reversed()?x.css("padding-top"):x.css("padding-bottom"):L.is.reversed()?x.css("padding-left"):x.css("padding-right");return e||"0px"},precision:function(){var e=L.get.step();t=0!=e?2==(t=String(e).split(".")).length?t[1].length:0:b.decimalPlaces;var t=Math.pow(10,t);return L.debug("Precision determined",t),t},min:function(){return b.min},max:function(){var e=L.get.step(),t=L.get.min(),n=0===e?0:Math.floor((b.max-t)/e);return 0==(0===e?0:(b.max-t)%e)?b.max:t+n*e},step:function(){return b.step},numLabels:function(){var e=Math.round((L.get.max()-L.get.min())/L.get.step());return L.debug("Determined that there should be "+e+" labels"),e},labelType:function(){return b.labelType},label:function(e){if(T)return T(e);switch(b.labelType){case b.labelTypes.number:return Math.round((e*L.get.step()+L.get.min())*u)/u;case b.labelTypes.letter:return R[e%26];default:return e}},value:function(){return i},currentThumbValue:function(){return l!==Y&&l.hasClass("second")?L.secondThumbVal:L.thumbVal},thumbValue:function(e){switch(e){case"second":if(L.is.range())return L.secondThumbVal;L.error(k.notrange);break;case"first":default:return L.thumbVal}},multiplier:function(){return b.pageMultiplier},thumbPosition:function(e){switch(e){case"second":if(L.is.range())return m;L.error(k.notrange);break;case"first":default:return d}},gapRatio:function(){var e=1;if(b.autoAdjustLabels){var t=L.get.numLabels(),n=L.get.trackLength(),a=1;if(0<n)for(;n/t*a<b.labelDistance;)t%a||(e=a),a+=1}return e}},determine:{pos:function(e){return L.is.reversed()?L.get.trackStartPos()-e+L.get.trackOffset():e-L.get.trackOffset()-L.get.trackStartPos()},closestThumb:function(e){var t=parseFloat(L.determine.thumbPos(o)),n=Math.abs(e-t),t=parseFloat(L.determine.thumbPos(s)),t=Math.abs(e-t);return(n!==t||L.get.thumbValue()!==L.get.min())&&n<=t?o:s},closestThumbPos:function(e){var t=parseFloat(L.determine.thumbPos(o)),n=Math.abs(e-t),a=parseFloat(L.determine.thumbPos(s));return n<=Math.abs(e-a)?t:a},thumbPos:function(e){return L.is.vertical()?L.is.reversed()?e.css("bottom"):e.css("top"):L.is.reversed()?e.css("right"):e.css("left")},positionFromValue:function(e){var t=L.get.min(),n=L.get.max(),e=n<e?n:e<t?t:e,a=L.get.trackLength(),t=(e-t)/(n-t),a=Math.round(t*a);return L.verbose("Determined position: "+a+" from value: "+e),a},positionFromRatio:function(e){var t=L.get.trackLength(),n=L.get.step(),t=Math.round(e*t);return 0==n?t:Math.round(t/n)*n},valueFromEvent:function(e){var t=L.determine.eventPos(e),e=L.determine.pos(t),e=t<L.get.trackOffset()?L.is.reversed()?L.get.max():L.get.min():t>L.get.trackOffset()+L.get.trackLength()?L.is.reversed()?L.get.min():L.get.max():L.determine.value(e);return e},smoothValueFromEvent:function(e){var t=L.get.min(),n=L.get.max(),a=L.get.trackLength(),e=L.determine.eventPos(e)-L.get.trackOffset(),a=(e=e<0?0:a<e?a:e)/a;return L.is.reversed()&&(a=1-a),a*(n-t)+t},eventPos:function(e){if(L.is.touch()){var t=e.changedTouches?e:e.originalEvent,n=t.changedTouches[0]?t.changedTouches:t.touches,t=n[0].pageY,n=n[0].pageX;return L.is.vertical()?t:n}n=e.pageY||e.originalEvent.pageY,e=e.pageX||e.originalEvent.pageX;return L.is.vertical()?n:e},value:function(e){var t=L.is.reversed()?L.get.trackEndPos():L.get.trackStartPos(),n=(e-t)/((L.is.reversed()?L.get.trackStartPos():L.get.trackEndPos())-t),a=L.get.max()-L.get.min(),t=L.get.step(),a=n*a,t=0==t?a:Math.round(a/t)*t;return L.verbose("Determined value based upon position: "+e+" as: "+a),a!=t&&L.verbose("Rounding value to closest step: "+t),L.verbose("Cutting off additional decimal places"),Math.round((t+L.get.min())*u)/u},keyMovement:function(e){var t=e.which,n=!L.is.vertical()||L.is.reversed()?V.downArrow:V.upArrow,a=!L.is.vertical()||L.is.reversed()?V.upArrow:V.downArrow,o=!L.is.vertical()&&L.is.reversed()?V.rightArrow:V.leftArrow,e=!L.is.vertical()&&L.is.reversed()?V.leftArrow:V.rightArrow;return t==n||t==o?-1:t==a||t==e?1:t==V.pageDown?-2:t==V.pageUp?2:0}},handleNewValuePosition:function(e){var t=L.get.min(),n=L.get.max();return e<=t?e=t:n<=e&&(e=n),L.determine.positionFromValue(e)},set:{value:function(e){L.update.value(e,function(e,t,n){v&&!b.fireOnInit||(b.onChange.call(P,e,t,n),b.onMove.call(P,e,t,n))})},rangeValue:function(e,t){var n,a;L.is.range()?(n=L.get.min(),a=L.get.max(),e<=n?e=n:a<=e&&(e=a),t<=n?t=n:a<=t&&(t=a),L.thumbVal=e,L.secondThumbVal=t,i=Math.abs(L.thumbVal-L.secondThumbVal),L.update.position(L.thumbVal,o),L.update.position(L.secondThumbVal,s),v&&!b.fireOnInit||(b.onChange.call(P,i,L.thumbVal,L.secondThumbVal),b.onMove.call(P,i,L.thumbVal,L.secondThumbVal))):L.error(k.notrange)},position:function(e,t){e=L.determine.value(e);"second"===t?(L.secondThumbVal=e,L.update.position(e,s)):(L.thumbVal=e,L.update.position(e,o)),i=Math.abs(L.thumbVal-(L.secondThumbVal||0)),L.set.value(i)}},update:{value:function(e,t){var n=L.get.min(),a=L.get.max();e<=n?e=n:a<=e&&(e=a),L.is.range()?(l===Y&&(l=e<=L.get.currentThumbValue()?o:s),l.hasClass("second")?(b.preventCrossover&&L.is.range()&&(e=Math.max(L.thumbVal,e)),L.secondThumbVal=e):(b.preventCrossover&&L.is.range()&&(e=Math.min(L.secondThumbVal,e)),L.thumbVal=e),i=Math.abs(L.thumbVal-L.secondThumbVal)):(i=e,L.thumbVal=i),L.update.position(e),L.debug("Setting slider value to "+i),"function"==typeof t&&t(i,L.thumbVal,L.secondThumbVal)},position:function(e,t){var n=L.handleNewValuePosition(e),a=t!=Y?t:l,o=L.thumbVal||L.get.min(),s=L.secondThumbVal||L.get.min();L.is.range()&&a.hasClass("second")?(m=n,s=e):(d=n,o=e);var r,i=L.get.min(),u=L.get.max(),t=100*(e-i)/(u-i),e=100*(Math.min(o,s)-i)/(u-i),i=100*(1-(Math.max(o,s)-i)/(u-i)),i=L.is.vertical()?L.is.reversed()?(r={bottom:"calc("+t+"% - "+f+"px)",top:"auto"},{bottom:e+"%",top:i+"%"}):(r={top:"calc("+t+"% - "+f+"px)",bottom:"auto"},{top:e+"%",bottom:i+"%"}):L.is.reversed()?(r={right:"calc("+t+"% - "+f+"px)",left:"auto"},{right:e+"%",left:i+"%"}):(r={left:"calc("+t+"% - "+f+"px)",right:"auto"},{left:e+"%",right:i+"%"});a.css(r),c.css(i),L.debug("Setting slider position to "+n)},labelPosition:function(e,t){var n=L.get.trackStartMargin(),a=L.get.trackEndMargin(),o=L.is.vertical()?L.is.reversed()?"bottom":"top":L.is.reversed()?"right":"left",s=L.is.reversed()&&!L.is.vertical()?" - ":" + ",e="(100% - "+n+" - "+a+") * "+e;t.css(o,"calc("+e+s+n+")")}},goto:{max:function(){L.set.value(L.get.max())},min:function(){L.set.value(L.get.min())}},read:{metadata:function(){var e={thumbVal:x.data(h.thumbVal),secondThumbVal:x.data(h.secondThumbVal)};e.thumbVal&&(L.is.range()&&e.secondThumbVal?(L.debug("Current value set from metadata",e.thumbVal,e.secondThumbVal),L.set.rangeValue(e.thumbVal,e.secondThumbVal)):(L.debug("Current value set from metadata",e.thumbVal),L.set.value(e.thumbVal)))},settings:function(){!1!==b.start&&(L.is.range()?(L.debug("Start position set from settings",b.start,b.end),L.set.rangeValue(b.start,b.end)):(L.debug("Start position set from settings",b.start),L.set.value(b.start)))}},setting:function(e,t){if(L.debug("Changing setting",e,t),U.isPlainObject(e))U.extend(!0,b,e);else{if(t===Y)return b[e];U.isPlainObject(b[e])?U.extend(!0,b[e],t):b[e]=t}},internal:function(e,t){if(U.isPlainObject(e))U.extend(!0,L,e);else{if(t===Y)return L[e];L[e]=t}},debug:function(){!b.silent&&b.debug&&(b.performance?L.performance.log(arguments):(L.debug=Function.prototype.bind.call(console.info,console,b.name+":"),L.debug.apply(console,arguments)))},verbose:function(){!b.silent&&b.verbose&&b.debug&&(b.performance?L.performance.log(arguments):(L.verbose=Function.prototype.bind.call(console.info,console,b.name+":"),L.verbose.apply(console,arguments)))},error:function(){b.silent||(L.error=Function.prototype.bind.call(console.error,console,b.name+":"),L.error.apply(console,arguments))},performance:{log:function(e){var t,n;b.performance&&(n=(t=(new Date).getTime())-(O||t),O=t,N.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:P,"Execution Time":n})),clearTimeout(L.performance.timer),L.performance.timer=setTimeout(L.performance.display,500)},display:function(){var e=b.name+":",n=0;O=!1,clearTimeout(L.performance.timer),U.each(N,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",D&&(e+=" '"+D+"'"),(console.group!==Y||console.table!==Y)&&0<N.length&&(console.groupCollapsed(e),console.table?console.table(N):U.each(N,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),N=[]}},invoke:function(a,e,t){var o,s,n,r=E;return e=e||I,t=P||t,"string"==typeof a&&r!==Y&&(a=a.split(/[\. ]/),o=a.length-1,U.each(a,function(e,t){var n=e!=o?t+a[e+1].charAt(0).toUpperCase()+a[e+1].slice(1):a;if(U.isPlainObject(r[n])&&e!=o)r=r[n];else{if(r[n]!==Y)return s=r[n],!1;{if(!U.isPlainObject(r[t])||e==o)return r[t]!==Y?s=r[t]:L.error(k.method,a),!1;r=r[t]}}})),U.isFunction(s)?n=s.apply(t,e):s!==Y&&(n=s),U.isArray(S)?S.push(n):S!==Y?S=[S,n]:n!==Y&&(S=n),s}};z?(E===Y&&L.initialize(),L.invoke(j)):(E!==Y&&E.invoke("destroy"),L.initialize())}),S!==Y?S:this},U.fn.slider.settings={silent:!1,debug:!1,verbose:!1,performance:!0,name:"Slider",namespace:"slider",error:{method:"The method you called is not defined.",notrange:"This slider is not a range slider"},metadata:{thumbVal:"thumbVal",secondThumbVal:"secondThumbVal"},min:0,max:20,step:1,start:0,end:20,labelType:"number",showLabelTicks:!1,smooth:!1,autoAdjustLabels:!0,labelDistance:100,preventCrossover:!0,fireOnInit:!1,interpretLabel:!1,decimalPlaces:2,pageMultiplier:2,selector:{},className:{reversed:"reversed",disabled:"disabled",labeled:"labeled",ticked:"ticked",vertical:"vertical",range:"range",smooth:"smooth"},keys:{pageUp:33,pageDown:34,leftArrow:37,upArrow:38,rightArrow:39,downArrow:40},labelTypes:{number:"number",letter:"letter"},onChange:function(e,t,n){},onMove:function(e,t,n){}}}(jQuery,window,document);
\ No newline at end of file |