diff --git a/400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/all-pin.png b/400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/all-pin.png
new file mode 100644
index 0000000..c5b0af6
--- /dev/null
+++ b/400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/all-pin.png
diff --git a/400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/hide-pin.png b/400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/hide-pin.png
new file mode 100644
index 0000000..f4f3a65
--- /dev/null
+++ b/400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/hide-pin.png
diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery.sticky.js b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery.sticky.js
new file mode 100644
index 0000000..28ae4f9
--- /dev/null
+++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery.sticky.js
@@ -0,0 +1,270 @@
+// Sticky Plugin v1.0.3 for jQuery
+// =============
+// Author: Anthony Garand
+// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
+// Improvements by Leonardo C. Daronco (daronco)
+// Created: 02/14/2011
+// Date: 07/20/2015
+// Website: http://stickyjs.com/
+// Description: Makes an element on the page stick on the screen as you scroll
+// It will only set the 'top' and 'position' of your element, you
+// might need to adjust the width in some cases.
+
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && module.exports) {
+ // Node/CommonJS
+ module.exports = factory(require('jquery'));
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+ var slice = Array.prototype.slice; // save ref to original slice()
+ var splice = Array.prototype.splice; // save ref to original slice()
+
+ var defaults = {
+ topSpacing: 0,
+ bottomSpacing: 0,
+ className: 'is-sticky',
+ wrapperClassName: 'sticky-wrapper',
+ center: false,
+ getWidthFrom: '',
+ widthFromWrapper: true, // works only when .getWidthFrom is empty
+ responsiveWidth: false
+ },
+ $window = $(window),
+ $document = $(document),
+ sticked = [],
+ windowHeight = $window.height(),
+ scroller = function() {
+ var scrollTop = $window.scrollTop(),
+ documentHeight = $document.height(),
+ dwh = documentHeight - windowHeight,
+ extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
+
+ for (var i = 0, l = sticked.length; i < l; i++) {
+ var s = sticked[i],
+ elementTop = s.stickyWrapper.offset().top,
+ etse = elementTop - s.topSpacing - extra;
+
+ //update height in case of dynamic content
+ s.stickyWrapper.css('height', s.stickyElement.outerHeight());
+
+ if (scrollTop <= etse) {
+ if (s.currentTop !== null) {
+ s.stickyElement
+ .css({
+ 'width': '',
+ 'position': '',
+ 'top': ''
+ });
+ s.stickyElement.parent().removeClass(s.className);
+ s.stickyElement.trigger('sticky-end', [s]);
+ s.currentTop = null;
+ }
+ }
+ else {
+ var newTop = documentHeight - s.stickyElement.outerHeight()
+ - s.topSpacing - s.bottomSpacing - scrollTop - extra;
+ if (newTop < 0) {
+ newTop = newTop + s.topSpacing;
+ } else {
+ newTop = s.topSpacing;
+ }
+ if (s.currentTop !== newTop) {
+ var newWidth;
+ if (s.getWidthFrom) {
+ newWidth = $(s.getWidthFrom).width() || null;
+ } else if (s.widthFromWrapper) {
+ newWidth = s.stickyWrapper.width();
+ }
+ if (newWidth == null) {
+ newWidth = s.stickyElement.width();
+ }
+ s.stickyElement
+ .css('width', newWidth)
+ .css('position', 'fixed')
+ .css('z-index', '')
+ .css('top', 0);
+
+ s.stickyElement.parent().addClass(s.className);
+
+ if (s.currentTop === null) {
+ s.stickyElement.trigger('sticky-start', [s]);
+ } else {
+ // sticky is started but it have to be repositioned
+ s.stickyElement.trigger('sticky-update', [s]);
+ }
+
+ if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) {
+ // just reached bottom || just started to stick but bottom is already reached
+ s.stickyElement.trigger('sticky-bottom-reached', [s]);
+ } else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) {
+ // sticky is started && sticked at topSpacing && overflowing from top just finished
+ s.stickyElement.trigger('sticky-bottom-unreached', [s]);
+ }
+
+ s.currentTop = newTop;
+ }
+
+ // Check if sticky has reached end of container and stop sticking
+ var stickyWrapperContainer = s.stickyWrapper.parent();
+ var unstick = (s.stickyElement.offset().top + s.stickyElement.outerHeight() >= stickyWrapperContainer.offset().top + stickyWrapperContainer.outerHeight()) && (s.stickyElement.offset().top <= s.topSpacing);
+
+ if( unstick ) {
+ s.stickyElement
+ .css('position', 'absolute')
+ .css('top', '')
+ .css('bottom', 0);
+ } else {
+ s.stickyElement
+ .css('position', 'fixed')
+ .css('top', 89)
+ .css('z-index', '999')
+ .css('bottom', '');
+ }
+ }
+ }
+ },
+ resizer = function() {
+ windowHeight = $window.height();
+
+ for (var i = 0, l = sticked.length; i < l; i++) {
+ var s = sticked[i];
+ var newWidth = null;
+ if (s.getWidthFrom) {
+ if (s.responsiveWidth) {
+ newWidth = $(s.getWidthFrom).width();
+ }
+ } else if(s.widthFromWrapper) {
+ newWidth = s.stickyWrapper.width();
+ }
+ if (newWidth != null) {
+ s.stickyElement.css('width', newWidth);
+ }
+ }
+ },
+ methods = {
+ init: function(options) {
+ var o = $.extend({}, defaults, options);
+ return this.each(function() {
+ var stickyElement = $(this);
+
+ var stickyId = stickyElement.attr('id');
+ var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName;
+ var wrapper = $('
')
+ .attr('id', wrapperId)
+ .addClass(o.wrapperClassName);
+
+ stickyElement.wrapAll(wrapper);
+
+ var stickyWrapper = stickyElement.parent();
+
+ if (o.center) {
+ stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
+ }
+
+ if (stickyElement.css("float") === "right") {
+ stickyElement.css({"float":"none"}).parent().css({"float":"right"});
+ }
+
+ o.stickyElement = stickyElement;
+ o.stickyWrapper = stickyWrapper;
+ o.currentTop = null;
+
+ sticked.push(o);
+
+ methods.setWrapperHeight(this);
+ methods.setupChangeListeners(this);
+ });
+ },
+
+ setWrapperHeight: function(stickyElement) {
+ var element = $(stickyElement);
+ var stickyWrapper = element.parent();
+ if (stickyWrapper) {
+ stickyWrapper.css('height', element.outerHeight());
+ }
+ },
+
+ setupChangeListeners: function(stickyElement) {
+ if (window.MutationObserver) {
+ var mutationObserver = new window.MutationObserver(function(mutations) {
+ if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) {
+ methods.setWrapperHeight(stickyElement);
+ }
+ });
+ mutationObserver.observe(stickyElement, {subtree: true, childList: true});
+ } else {
+ stickyElement.addEventListener('DOMNodeInserted', function() {
+ methods.setWrapperHeight(stickyElement);
+ }, false);
+ stickyElement.addEventListener('DOMNodeRemoved', function() {
+ methods.setWrapperHeight(stickyElement);
+ }, false);
+ }
+ },
+ update: scroller,
+ unstick: function(options) {
+ return this.each(function() {
+ var that = this;
+ var unstickyElement = $(that);
+
+ var removeIdx = -1;
+ var i = sticked.length;
+ while (i-- > 0) {
+ if (sticked[i].stickyElement.get(0) === that) {
+ splice.call(sticked,i,1);
+ removeIdx = i;
+ }
+ }
+ if(removeIdx !== -1) {
+ unstickyElement.unwrap();
+ unstickyElement
+ .css({
+ 'width': '',
+ 'position': '',
+ 'top': '',
+ 'float': ''
+ })
+ ;
+ }
+ });
+ }
+ };
+
+ // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
+ if (window.addEventListener) {
+ window.addEventListener('scroll', scroller, false);
+ window.addEventListener('resize', resizer, false);
+ } else if (window.attachEvent) {
+ window.attachEvent('onscroll', scroller);
+ window.attachEvent('onresize', resizer);
+ }
+
+ $.fn.sticky = function(method) {
+ if (methods[method]) {
+ return methods[method].apply(this, slice.call(arguments, 1));
+ } else if (typeof method === 'object' || !method ) {
+ return methods.init.apply( this, arguments );
+ } else {
+ $.error('Method ' + method + ' does not exist on jQuery.sticky');
+ }
+ };
+
+ $.fn.unstick = function(method) {
+ if (methods[method]) {
+ return methods[method].apply(this, slice.call(arguments, 1));
+ } else if (typeof method === 'object' || !method ) {
+ return methods.unstick.apply( this, arguments );
+ } else {
+ $.error('Method ' + method + ' does not exist on jQuery.sticky');
+ }
+ };
+ $(function() {
+ setTimeout(scroller, 0);
+ });
+}));
diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js
index 7cd8769..b77233c 100644
--- a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js
+++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js
@@ -1,810 +1,810 @@
-/*! jQuery-ui-Slider-Pips - v1.11.1 - 2015-11-30
-* Copyright (c) 2015 Simon Goellner
; Licensed MIT */
-
-
-
-(function($) {
-
- "use strict";
-
- var extensionMethods = {
-
-
-
-
-
- // pips
-
- pips: function( settings ) {
-
- var slider = this,
- i, j, p,
- collection = "",
- mousedownHandlers,
- min = slider._valueMin(),
- max = slider._valueMax(),
- pips = ( max - min ) / slider.options.step,
- $handles = slider.element.find(".ui-slider-handle"),
- $pips;
-
- var options = {
-
- first: "label",
- /* "label", "pip", false */
-
- last: "label",
- /* "label", "pip", false */
-
- rest: "pip",
- /* "label", "pip", false */
-
- labels: false,
- /* [array], { first: "string", rest: [array], last: "string" }, false */
-
- prefix: "",
- /* "", string */
-
- suffix: "",
- /* "", string */
-
- step: ( pips > 100 ) ? Math.floor( pips * 0.05 ) : 1,
- /* number */
-
- formatLabel: function(value) {
- return this.prefix + value + this.suffix;
- }
- /* function
- must return a value to display in the pip labels */
-
- };
-
- if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
-
- $.extend( options, settings );
- slider.element.data("pips-options", options );
-
- } else {
-
- if ( settings === "destroy" ) {
-
- destroy();
-
- } else if ( settings === "refresh" ) {
-
- slider.element.slider( "pips", slider.element.data("pips-options") );
-
- }
-
- return;
-
- }
-
-
- // we don't want the step ever to be a floating point.
- slider.options.pipStep = Math.round( options.step );
-
- // get rid of all pips that might already exist.
- slider.element
- .off( ".selectPip" )
- .addClass("ui-slider-pips")
- .find(".ui-slider-pip")
- .remove();
-
- // small object with functions for marking pips as selected.
-
- var selectPip = {
-
- single: function(value) {
-
- this.resetClasses();
-
- $pips
- .filter(".ui-slider-pip-" + this.classLabel(value) )
- .addClass("ui-slider-pip-selected");
-
- if ( slider.options.range ) {
-
- $pips.each(function(k, v) {
-
- var pipVal = $(v).children(".ui-slider-label").data("value");
-
- if (( slider.options.range === "min" && pipVal < value ) ||
- ( slider.options.range === "max" && pipVal > value )) {
-
- $(v).addClass("ui-slider-pip-inrange");
-
- }
-
- });
-
- }
-
- },
-
- range: function(values) {
-
- this.resetClasses();
-
- for ( i = 0; i < values.length; i++ ) {
-
- $pips
- .filter(".ui-slider-pip-" + this.classLabel(values[i]) )
- .addClass("ui-slider-pip-selected-" + ( i + 1 ) );
-
- }
-
- if ( slider.options.range ) {
-
- $pips.each(function(k, v) {
-
- var pipVal = $(v).children(".ui-slider-label").data("value");
-
- if ( pipVal > values[0] && pipVal < values[1] ) {
-
- $(v).addClass("ui-slider-pip-inrange");
-
- }
-
- });
-
- }
-
- },
-
- classLabel: function(value) {
-
- return value.toString().replace(".", "-");
-
- },
-
- resetClasses: function() {
-
- var regex = /(^|\s*)(ui-slider-pip-selected|ui-slider-pip-inrange)(-{1,2}\d+|\s|$)/gi;
-
- $pips.removeClass( function(index, css) {
- return ( css.match(regex) || [] ).join(" ");
- });
-
- }
-
- };
-
- function getClosestHandle( val ) {
-
- var h, k,
- sliderVals,
- comparedVals,
- closestVal,
- tempHandles = [],
- closestHandle = 0;
-
- if ( slider.values() && slider.values().length ) {
-
- // get the current values of the slider handles
- sliderVals = slider.values();
-
- // find the offset value from the `val` for each
- // handle, and store it in a new array
- comparedVals = $.map( sliderVals, function(v) {
- return Math.abs( v - val );
- });
-
- // figure out the closest handles to the value
- closestVal = Math.min.apply( Math, comparedVals );
-
- // if a comparedVal is the closestVal, then
- // set the value accordingly, and set the closest handle.
- for ( h = 0; h < comparedVals.length; h++ ) {
- if ( comparedVals[h] === closestVal ) {
- tempHandles.push(h);
- }
- }
-
- // set the closest handle to the first handle in array,
- // just incase we have no _lastChangedValue to compare to.
- closestHandle = tempHandles[0];
-
- // now we want to find out if any of the closest handles were
- // the last changed handle, if so we specify that handle to change
- for ( k = 0; k < tempHandles.length; k++ ) {
- if ( slider._lastChangedValue === tempHandles[k] ) {
- closestHandle = tempHandles[k];
- }
- }
-
- if ( slider.options.range && tempHandles.length === 2 ) {
-
- if ( val > sliderVals[1] ) {
-
- closestHandle = tempHandles[1];
-
- } else if ( val < sliderVals[0] ) {
-
- closestHandle = tempHandles[0];
-
- }
-
- }
-
- }
-
- return closestHandle;
-
- }
-
- function destroy() {
-
- slider.element
- .off(".selectPip")
- .on("mousedown.slider", slider.element.data("mousedown-original") )
- .removeClass("ui-slider-pips")
- .find(".ui-slider-pip")
- .remove();
-
- }
-
- // when we click on a label, we want to make sure the
- // slider's handle actually goes to that label!
- // so we check all the handles and see which one is closest
- // to the label we clicked. If 2 handles are equidistant then
- // we move both of them. We also want to trigger focus on the
- // handle.
-
- // without this method the label is just treated like a part
- // of the slider and there's no accuracy in the selected value
-
- function labelClick( label, e ) {
-
- if (slider.option("disabled")) {
- return;
- }
-
- var val = $(label).data("value"),
- indexToChange = getClosestHandle( val );
-
- if ( slider.values() && slider.values().length ) {
-
- slider.options.values[ indexToChange ] = slider._trimAlignValue( val );
-
- } else {
-
- slider.options.value = slider._trimAlignValue( val );
-
- }
-
- slider._refreshValue();
- slider._change( e, indexToChange );
-
- }
-
- // method for creating a pip. We loop this for creating all
- // the pips.
-
- function createPip( which ) {
-
- var label,
- percent,
- number = which,
- classes = "ui-slider-pip",
- css = "",
- value = slider.value(),
- values = slider.values();
-
- if ( which === "first" ) {
-
- number = 0;
-
- } else if ( which === "last" ) {
-
- number = pips;
-
- }
-
- // labelValue is the actual value of the pip based on the min/step
- var labelValue = min + ( slider.options.step * number );
-
- // classLabel replaces any decimals with hyphens
- var classLabel = labelValue.toString().replace(".","-");
-
- // we need to set the human-readable label to either the
- // corresponding element in the array, or the appropriate
- // item in the object... or an empty string.
-
- if ( $.type(options.labels) === "array" ) {
-
- label = options.labels[number] || "";
-
- } else if ( $.type( options.labels ) === "object" ) {
-
- if ( which === "first" ) {
-
- // set first label
- label = options.labels.first || "";
-
- } else if ( which === "last" ) {
-
- // set last label
- label = options.labels.last || "";
-
- } else if ( $.type( options.labels.rest ) === "array" ) {
-
- // set other labels, but our index should start at -1
- // because of the first pip.
-
- label = options.labels.rest[ number - 1 ] || "";
-
- } else {
-
- // urrggh, the options must be f**ked, just show nothing.
- label = labelValue;
-
- }
-
- } else {
-
- label = labelValue;
-
- }
-
-
-
-
- if ( which === "first" ) {
-
- // first Pip on the Slider
- percent = "0%";
-
- classes += " ui-slider-pip-first";
- classes += ( options.first === "label" ) ? " ui-slider-pip-label" : "";
- classes += ( options.first === false ) ? " ui-slider-pip-hide" : "";
-
- } else if ( which === "last" ) {
-
- // last Pip on the Slider
- percent = "100%";
-
- classes += " ui-slider-pip-last";
- classes += ( options.last === "label" ) ? " ui-slider-pip-label" : "";
- classes += ( options.last === false ) ? " ui-slider-pip-hide" : "";
-
- } else {
-
- // all other Pips
- percent = (( 100 / pips ) * which ).toFixed(4) + "%";
-
- classes += ( options.rest === "label" ) ? " ui-slider-pip-label" : "";
- classes += ( options.rest === false ) ? " ui-slider-pip-hide" : "";
-
- }
-
- classes += " ui-slider-pip-" + classLabel;
-
-
- // add classes for the initial-selected values.
- if ( values && values.length ) {
-
- for ( i = 0; i < values.length; i++ ) {
-
- if ( labelValue === values[i] ) {
-
- classes += " ui-slider-pip-initial-" + ( i + 1 );
- classes += " ui-slider-pip-selected-" + ( i + 1 );
-
- }
-
- }
-
- if ( slider.options.range ) {
-
- if ( labelValue > values[0] &&
- labelValue < values[1] ) {
-
- classes += " ui-slider-pip-inrange";
-
- }
-
- }
-
- } else {
-
- if ( labelValue === value ) {
-
- classes += " ui-slider-pip-initial";
- classes += " ui-slider-pip-selected";
-
- }
-
- if ( slider.options.range ) {
-
- if (( slider.options.range === "min" && labelValue < value ) ||
- ( slider.options.range === "max" && labelValue > value )) {
-
- classes += " ui-slider-pip-inrange";
-
- }
-
- }
-
- }
-
-
-
- css = ( slider.options.orientation === "horizontal" ) ?
- "left: " + percent :
- "bottom: " + percent;
-
-
- // add this current pip to the collection
- return "" +
- "" +
- "" + options.formatLabel(label) + "" +
- "";
-
- }
-
- // create our first pip
- collection += createPip("first");
-
- // for every stop in the slider; we create a pip.
- for ( p = 1; p < pips; p++ ) {
- if ( p % slider.options.pipStep === 0 ) {
- collection += createPip( p );
- }
- }
-
- // create our last pip
- collection += createPip("last");
-
- // append the collection of pips.
- slider.element.append( collection );
-
- // store the pips for setting classes later.
- $pips = slider.element.find(".ui-slider-pip");
-
-
-
- // store the mousedown handlers for later, just in case we reset
- // the slider, the handler would be lost!
-
- if ( $._data( slider.element.get(0), "events").mousedown &&
- $._data( slider.element.get(0), "events").mousedown.length ) {
-
- mousedownHandlers = $._data( slider.element.get(0), "events").mousedown;
-
- } else {
-
- mousedownHandlers = slider.element.data("mousedown-handlers");
-
- }
-
- slider.element.data("mousedown-handlers", mousedownHandlers.slice() );
-
- // loop through all the mousedown handlers on the slider,
- // and store the original namespaced (.slider) event handler so
- // we can trigger it later.
- for ( j = 0; j < mousedownHandlers.length; j++ ) {
- if ( mousedownHandlers[j].namespace === "slider" ) {
- slider.element.data("mousedown-original", mousedownHandlers[j].handler );
- }
- }
-
- // unbind the mousedown.slider event, because it interferes with
- // the labelClick() method (stops smooth animation), and decide
- // if we want to trigger the original event based on which element
- // was clicked.
- slider.element
- .off("mousedown.slider")
- .on("mousedown.selectPip", function(e) {
-
- var $target = $(e.target),
- closest = getClosestHandle( $target.data("value") ),
- $handle = $handles.eq( closest );
-
- $handle.addClass("ui-state-active");
-
- if ( $target.is(".ui-slider-label") ) {
-
- labelClick( $target, e );
-
- slider.element
- .one("mouseup.selectPip", function() {
-
- $handle
- .removeClass("ui-state-active")
- .focus();
-
- });
-
- } else {
-
- var originalMousedown = slider.element.data("mousedown-original");
- originalMousedown(e);
-
- }
-
- });
-
-
-
-
- slider.element.on( "slide.selectPip slidechange.selectPip", function(e, ui) {
-
- var $slider = $(this),
- value = $slider.slider("value"),
- values = $slider.slider("values");
-
- if ( ui ) {
-
- value = ui.value;
- values = ui.values;
-
- }
-
- if ( slider.values() && slider.values().length ) {
-
- selectPip.range( values );
-
- } else {
-
- selectPip.single( value );
-
- }
-
- });
-
-
-
-
- },
-
-
-
-
-
-
-
-
- // floats
-
- float: function( settings ) {
-
- var i,
- slider = this,
- min = slider._valueMin(),
- max = slider._valueMax(),
- value = slider._value(),
- values = slider._values(),
- tipValues = [],
- $handles = slider.element.find(".ui-slider-handle");
-
- var options = {
-
- handle: true,
- /* false */
-
- pips: false,
- /* true */
-
- labels: false,
- /* [array], { first: "string", rest: [array], last: "string" }, false */
-
- prefix: "",
- /* "", string */
-
- suffix: "",
- /* "", string */
-
- event: "slidechange slide",
- /* "slidechange", "slide", "slidechange slide" */
-
- formatLabel: function(value) {
- return this.prefix + value + this.suffix;
- }
- /* function
- must return a value to display in the floats */
-
- };
-
- if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
-
- $.extend( options, settings );
- slider.element.data("float-options", options );
-
- } else {
-
- if ( settings === "destroy" ) {
-
- destroy();
-
- } else if ( settings === "refresh" ) {
-
- slider.element.slider( "float", slider.element.data("float-options") );
-
- }
-
- return;
-
- }
-
-
-
-
- if ( value < min ) {
- value = min;
- }
-
- if ( value > max ) {
- value = max;
- }
-
- if ( values && values.length ) {
-
- for ( i = 0; i < values.length; i++ ) {
-
- if ( values[i] < min ) {
- values[i] = min;
- }
-
- if ( values[i] > max ) {
- values[i] = max;
- }
-
- }
-
- }
-
- // add a class for the CSS
- slider.element
- .addClass("ui-slider-float")
- .find(".ui-slider-tip, .ui-slider-tip-label")
- .remove();
-
-
-
- function destroy() {
-
- slider.element
- .off(".sliderFloat")
- .removeClass("ui-slider-float")
- .find(".ui-slider-tip, .ui-slider-tip-label")
- .remove();
-
- }
-
-
- function getPipLabels( values ) {
-
- // when checking the array we need to divide
- // by the step option, so we store those values here.
-
- var vals = [],
- steppedVals = $.map( values, function(v) {
- return Math.ceil(( v - min ) / slider.options.step);
- });
-
- // now we just get the values we need to return
- // by looping through the values array and assigning the
- // label if it exists.
-
- if ( $.type( options.labels ) === "array" ) {
-
- for ( i = 0; i < values.length; i++ ) {
-
- vals[i] = options.labels[ steppedVals[i] ] || values[i];
-
- }
-
- } else if ( $.type( options.labels ) === "object" ) {
-
- for ( i = 0; i < values.length; i++ ) {
-
- if ( values[i] === min ) {
-
- vals[i] = options.labels.first || min;
-
- } else if ( values[i] === max ) {
-
- vals[i] = options.labels.last || max;
-
- } else if ( $.type( options.labels.rest ) === "array" ) {
-
- vals[i] = options.labels.rest[ steppedVals[i] - 1 ] || values[i];
-
- } else {
-
- vals[i] = values[i];
-
- }
-
- }
-
- } else {
-
- for ( i = 0; i < values.length; i++ ) {
-
- vals[i] = values[i];
-
- }
-
- }
-
- return vals;
-
- }
-
- // apply handle tip if settings allows.
- if ( options.handle ) {
-
- // we need to set the human-readable label to either the
- // corresponding element in the array, or the appropriate
- // item in the object... or an empty string.
-
- tipValues = ( slider.values() && slider.values().length ) ?
- getPipLabels( values ) :
- getPipLabels( [ value ] );
-
- for ( i = 0; i < tipValues.length; i++ ) {
-
- $handles
- .eq( i )
- .append( $(""+ options.formatLabel(tipValues[i]) +"") );
-
- }
-
- }
-
- if ( options.pips ) {
-
- // if this slider also has pip-labels, we make those into tips, too.
- slider.element.find(".ui-slider-label").each(function(k, v) {
-
- var $this = $(v),
- val = [ $this.data("value") ],
- label,
- $tip;
-
-
- label = options.formatLabel( getPipLabels( val )[0] );
-
- // create a tip element
- $tip =
- $("" + label + "")
- .insertAfter( $this );
-
- });
-
- }
-
- // check that the event option is actually valid against our
- // own list of the slider's events.
- if ( options.event !== "slide" &&
- options.event !== "slidechange" &&
- options.event !== "slide slidechange" &&
- options.event !== "slidechange slide" ) {
-
- options.event = "slidechange slide";
-
- }
-
- // when slider changes, update handle tip label.
- slider.element
- .off(".sliderFloat")
- .on( options.event + ".sliderFloat", function( e, ui ) {
-
- var uiValue = ( $.type( ui.value ) === "array" ) ? ui.value : [ ui.value ],
- val = options.formatLabel( getPipLabels( uiValue )[0] );
-
- $(ui.handle)
- .find(".ui-slider-tip")
- .html( val );
-
- });
-
- }
-
- };
-
- $.extend(true, $.ui.slider.prototype, extensionMethods);
-
-})(jQuery);
+/*! jQuery-ui-Slider-Pips - v1.11.1 - 2015-11-30
+* Copyright (c) 2015 Simon Goellner ; Licensed MIT */
+
+
+
+(function($) {
+
+ "use strict";
+
+ var extensionMethods = {
+
+
+
+
+
+ // pips
+
+ pips: function( settings ) {
+
+ var slider = this,
+ i, j, p,
+ collection = "",
+ mousedownHandlers,
+ min = slider._valueMin(),
+ max = slider._valueMax(),
+ pips = ( max - min ) / slider.options.step,
+ $handles = slider.element.find(".ui-slider-handle"),
+ $pips;
+
+ var options = {
+
+ first: "label",
+ /* "label", "pip", false */
+
+ last: "label",
+ /* "label", "pip", false */
+
+ rest: "pip",
+ /* "label", "pip", false */
+
+ labels: false,
+ /* [array], { first: "string", rest: [array], last: "string" }, false */
+
+ prefix: "",
+ /* "", string */
+
+ suffix: "",
+ /* "", string */
+
+ step: ( pips > 100 ) ? Math.floor( pips * 0.05 ) : 1,
+ /* number */
+
+ formatLabel: function(value) {
+ return this.prefix + value + this.suffix;
+ }
+ /* function
+ must return a value to display in the pip labels */
+
+ };
+
+ if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
+
+ $.extend( options, settings );
+ slider.element.data("pips-options", options );
+
+ } else {
+
+ if ( settings === "destroy" ) {
+
+ destroy();
+
+ } else if ( settings === "refresh" ) {
+
+ slider.element.slider( "pips", slider.element.data("pips-options") );
+
+ }
+
+ return;
+
+ }
+
+
+ // we don't want the step ever to be a floating point.
+ slider.options.pipStep = Math.round( options.step );
+
+ // get rid of all pips that might already exist.
+ slider.element
+ .off( ".selectPip" )
+ .addClass("ui-slider-pips")
+ .find(".ui-slider-pip")
+ .remove();
+
+ // small object with functions for marking pips as selected.
+
+ var selectPip = {
+
+ single: function(value) {
+
+ this.resetClasses();
+
+ $pips
+ .filter(".ui-slider-pip-" + this.classLabel(value) )
+ .addClass("ui-slider-pip-selected");
+
+ if ( slider.options.range ) {
+
+ $pips.each(function(k, v) {
+
+ var pipVal = $(v).children(".ui-slider-label").data("value");
+
+ if (( slider.options.range === "min" && pipVal < value ) ||
+ ( slider.options.range === "max" && pipVal > value )) {
+
+ $(v).addClass("ui-slider-pip-inrange");
+
+ }
+
+ });
+
+ }
+
+ },
+
+ range: function(values) {
+
+ this.resetClasses();
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ $pips
+ .filter(".ui-slider-pip-" + this.classLabel(values[i]) )
+ .addClass("ui-slider-pip-selected-" + ( i + 1 ) );
+
+ }
+
+ if ( slider.options.range ) {
+
+ $pips.each(function(k, v) {
+
+ var pipVal = $(v).children(".ui-slider-label").data("value");
+
+ if ( pipVal > values[0] && pipVal < values[1] ) {
+
+ $(v).addClass("ui-slider-pip-inrange");
+
+ }
+
+ });
+
+ }
+
+ },
+
+ classLabel: function(value) {
+
+ return value.toString().replace(".", "-");
+
+ },
+
+ resetClasses: function() {
+
+ var regex = /(^|\s*)(ui-slider-pip-selected|ui-slider-pip-inrange)(-{1,2}\d+|\s|$)/gi;
+
+ $pips.removeClass( function(index, css) {
+ return ( css.match(regex) || [] ).join(" ");
+ });
+
+ }
+
+ };
+
+ function getClosestHandle( val ) {
+
+ var h, k,
+ sliderVals,
+ comparedVals,
+ closestVal,
+ tempHandles = [],
+ closestHandle = 0;
+
+ if ( slider.values() && slider.values().length ) {
+
+ // get the current values of the slider handles
+ sliderVals = slider.values();
+
+ // find the offset value from the `val` for each
+ // handle, and store it in a new array
+ comparedVals = $.map( sliderVals, function(v) {
+ return Math.abs( v - val );
+ });
+
+ // figure out the closest handles to the value
+ closestVal = Math.min.apply( Math, comparedVals );
+
+ // if a comparedVal is the closestVal, then
+ // set the value accordingly, and set the closest handle.
+ for ( h = 0; h < comparedVals.length; h++ ) {
+ if ( comparedVals[h] === closestVal ) {
+ tempHandles.push(h);
+ }
+ }
+
+ // set the closest handle to the first handle in array,
+ // just incase we have no _lastChangedValue to compare to.
+ closestHandle = tempHandles[0];
+
+ // now we want to find out if any of the closest handles were
+ // the last changed handle, if so we specify that handle to change
+ for ( k = 0; k < tempHandles.length; k++ ) {
+ if ( slider._lastChangedValue === tempHandles[k] ) {
+ closestHandle = tempHandles[k];
+ }
+ }
+
+ if ( slider.options.range && tempHandles.length === 2 ) {
+
+ if ( val > sliderVals[1] ) {
+
+ closestHandle = tempHandles[1];
+
+ } else if ( val < sliderVals[0] ) {
+
+ closestHandle = tempHandles[0];
+
+ }
+
+ }
+
+ }
+
+ return closestHandle;
+
+ }
+
+ function destroy() {
+
+ slider.element
+ .off(".selectPip")
+ .on("mousedown.slider", slider.element.data("mousedown-original") )
+ .removeClass("ui-slider-pips")
+ .find(".ui-slider-pip")
+ .remove();
+
+ }
+
+ // when we click on a label, we want to make sure the
+ // slider's handle actually goes to that label!
+ // so we check all the handles and see which one is closest
+ // to the label we clicked. If 2 handles are equidistant then
+ // we move both of them. We also want to trigger focus on the
+ // handle.
+
+ // without this method the label is just treated like a part
+ // of the slider and there's no accuracy in the selected value
+
+ function labelClick( label, e ) {
+
+ if (slider.option("disabled")) {
+ return;
+ }
+
+ var val = $(label).data("value"),
+ indexToChange = getClosestHandle( val );
+
+ if ( slider.values() && slider.values().length ) {
+
+ slider.options.values[ indexToChange ] = slider._trimAlignValue( val );
+
+ } else {
+
+ slider.options.value = slider._trimAlignValue( val );
+
+ }
+
+ slider._refreshValue();
+ slider._change( e, indexToChange );
+
+ }
+
+ // method for creating a pip. We loop this for creating all
+ // the pips.
+
+ function createPip( which ) {
+
+ var label,
+ percent,
+ number = which,
+ classes = "ui-slider-pip",
+ css = "",
+ value = slider.value(),
+ values = slider.values();
+
+ if ( which === "first" ) {
+
+ number = 0;
+
+ } else if ( which === "last" ) {
+
+ number = pips;
+
+ }
+
+ // labelValue is the actual value of the pip based on the min/step
+ var labelValue = min + ( slider.options.step * number );
+
+ // classLabel replaces any decimals with hyphens
+ var classLabel = labelValue.toString().replace(".","-");
+
+ // we need to set the human-readable label to either the
+ // corresponding element in the array, or the appropriate
+ // item in the object... or an empty string.
+
+ if ( $.type(options.labels) === "array" ) {
+
+ label = options.labels[number] || "";
+
+ } else if ( $.type( options.labels ) === "object" ) {
+
+ if ( which === "first" ) {
+
+ // set first label
+ label = options.labels.first || "";
+
+ } else if ( which === "last" ) {
+
+ // set last label
+ label = options.labels.last || "";
+
+ } else if ( $.type( options.labels.rest ) === "array" ) {
+
+ // set other labels, but our index should start at -1
+ // because of the first pip.
+
+ label = options.labels.rest[ number - 1 ] || "";
+
+ } else {
+
+ // urrggh, the options must be f**ked, just show nothing.
+ label = labelValue;
+
+ }
+
+ } else {
+
+ label = labelValue;
+
+ }
+
+
+
+
+ if ( which === "first" ) {
+
+ // first Pip on the Slider
+ percent = "0%";
+
+ classes += " ui-slider-pip-first";
+ classes += ( options.first === "label" ) ? " ui-slider-pip-label" : "";
+ classes += ( options.first === false ) ? " ui-slider-pip-hide" : "";
+
+ } else if ( which === "last" ) {
+
+ // last Pip on the Slider
+ percent = "100%";
+
+ classes += " ui-slider-pip-last";
+ classes += ( options.last === "label" ) ? " ui-slider-pip-label" : "";
+ classes += ( options.last === false ) ? " ui-slider-pip-hide" : "";
+
+ } else {
+
+ // all other Pips
+ percent = (( 100 / pips ) * which ).toFixed(4) + "%";
+
+ classes += ( options.rest === "label" ) ? " ui-slider-pip-label" : "";
+ classes += ( options.rest === false ) ? " ui-slider-pip-hide" : "";
+
+ }
+
+ classes += " ui-slider-pip-" + classLabel;
+
+
+ // add classes for the initial-selected values.
+ if ( values && values.length ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ if ( labelValue === values[i] ) {
+
+ classes += " ui-slider-pip-initial-" + ( i + 1 );
+ classes += " ui-slider-pip-selected-" + ( i + 1 );
+
+ }
+
+ }
+
+ if ( slider.options.range ) {
+
+ if ( labelValue > values[0] &&
+ labelValue < values[1] ) {
+
+ classes += " ui-slider-pip-inrange";
+
+ }
+
+ }
+
+ } else {
+
+ if ( labelValue === value ) {
+
+ classes += " ui-slider-pip-initial";
+ classes += " ui-slider-pip-selected";
+
+ }
+
+ if ( slider.options.range ) {
+
+ if (( slider.options.range === "min" && labelValue < value ) ||
+ ( slider.options.range === "max" && labelValue > value )) {
+
+ classes += " ui-slider-pip-inrange";
+
+ }
+
+ }
+
+ }
+
+
+
+ css = ( slider.options.orientation === "horizontal" ) ?
+ "left: " + percent :
+ "bottom: " + percent;
+
+
+ // add this current pip to the collection
+ return "" +
+ "" +
+ "" + options.formatLabel(label) + "" +
+ "";
+
+ }
+
+ // create our first pip
+ collection += createPip("first");
+
+ // for every stop in the slider; we create a pip.
+ for ( p = 1; p < pips; p++ ) {
+ if ( p % slider.options.pipStep === 0 ) {
+ collection += createPip( p );
+ }
+ }
+
+ // create our last pip
+ collection += createPip("last");
+
+ // append the collection of pips.
+ slider.element.append( collection );
+
+ // store the pips for setting classes later.
+ $pips = slider.element.find(".ui-slider-pip");
+
+
+
+ // store the mousedown handlers for later, just in case we reset
+ // the slider, the handler would be lost!
+
+ if ( $._data( slider.element.get(0), "events").mousedown &&
+ $._data( slider.element.get(0), "events").mousedown.length ) {
+
+ mousedownHandlers = $._data( slider.element.get(0), "events").mousedown;
+
+ } else {
+
+ mousedownHandlers = slider.element.data("mousedown-handlers");
+
+ }
+
+ slider.element.data("mousedown-handlers", mousedownHandlers.slice() );
+
+ // loop through all the mousedown handlers on the slider,
+ // and store the original namespaced (.slider) event handler so
+ // we can trigger it later.
+ for ( j = 0; j < mousedownHandlers.length; j++ ) {
+ if ( mousedownHandlers[j].namespace === "slider" ) {
+ slider.element.data("mousedown-original", mousedownHandlers[j].handler );
+ }
+ }
+
+ // unbind the mousedown.slider event, because it interferes with
+ // the labelClick() method (stops smooth animation), and decide
+ // if we want to trigger the original event based on which element
+ // was clicked.
+ slider.element
+ .off("mousedown.slider")
+ .on("mousedown.selectPip", function(e) {
+
+ var $target = $(e.target),
+ closest = getClosestHandle( $target.data("value") ),
+ $handle = $handles.eq( closest );
+
+ $handle.addClass("ui-state-active");
+
+ if ( $target.is(".ui-slider-label") ) {
+
+ labelClick( $target, e );
+
+ slider.element
+ .one("mouseup.selectPip", function() {
+
+ $handle
+ .removeClass("ui-state-active")
+ .focus();
+
+ });
+
+ } else {
+
+ var originalMousedown = slider.element.data("mousedown-original");
+ originalMousedown(e);
+
+ }
+
+ });
+
+
+
+
+ slider.element.on( "slide.selectPip slidechange.selectPip", function(e, ui) {
+
+ var $slider = $(this),
+ value = $slider.slider("value"),
+ values = $slider.slider("values");
+
+ if ( ui ) {
+
+ value = ui.value;
+ values = ui.values;
+
+ }
+
+ if ( slider.values() && slider.values().length ) {
+
+ selectPip.range( values );
+
+ } else {
+
+ selectPip.single( value );
+
+ }
+
+ });
+
+
+
+
+ },
+
+
+
+
+
+
+
+
+ // floats
+
+ float: function( settings ) {
+
+ var i,
+ slider = this,
+ min = slider._valueMin(),
+ max = slider._valueMax(),
+ value = slider._value(),
+ values = slider._values(),
+ tipValues = [],
+ $handles = slider.element.find(".ui-slider-handle");
+
+ var options = {
+
+ handle: true,
+ /* false */
+
+ pips: false,
+ /* true */
+
+ labels: false,
+ /* [array], { first: "string", rest: [array], last: "string" }, false */
+
+ prefix: "",
+ /* "", string */
+
+ suffix: "",
+ /* "", string */
+
+ event: "slidechange slide",
+ /* "slidechange", "slide", "slidechange slide" */
+
+ formatLabel: function(value) {
+ return this.prefix + value + this.suffix;
+ }
+ /* function
+ must return a value to display in the floats */
+
+ };
+
+ if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
+
+ $.extend( options, settings );
+ slider.element.data("float-options", options );
+
+ } else {
+
+ if ( settings === "destroy" ) {
+
+ destroy();
+
+ } else if ( settings === "refresh" ) {
+
+ slider.element.slider( "float", slider.element.data("float-options") );
+
+ }
+
+ return;
+
+ }
+
+
+
+
+ if ( value < min ) {
+ value = min;
+ }
+
+ if ( value > max ) {
+ value = max;
+ }
+
+ if ( values && values.length ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ if ( values[i] < min ) {
+ values[i] = min;
+ }
+
+ if ( values[i] > max ) {
+ values[i] = max;
+ }
+
+ }
+
+ }
+
+ // add a class for the CSS
+ slider.element
+ .addClass("ui-slider-float")
+ .find(".ui-slider-tip, .ui-slider-tip-label")
+ .remove();
+
+
+
+ function destroy() {
+
+ slider.element
+ .off(".sliderFloat")
+ .removeClass("ui-slider-float")
+ .find(".ui-slider-tip, .ui-slider-tip-label")
+ .remove();
+
+ }
+
+
+ function getPipLabels( values ) {
+
+ // when checking the array we need to divide
+ // by the step option, so we store those values here.
+
+ var vals = [],
+ steppedVals = $.map( values, function(v) {
+ return Math.ceil(( v - min ) / slider.options.step);
+ });
+
+ // now we just get the values we need to return
+ // by looping through the values array and assigning the
+ // label if it exists.
+
+ if ( $.type( options.labels ) === "array" ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ vals[i] = options.labels[ steppedVals[i] ] || values[i];
+
+ }
+
+ } else if ( $.type( options.labels ) === "object" ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ if ( values[i] === min ) {
+
+ vals[i] = options.labels.first || min;
+
+ } else if ( values[i] === max ) {
+
+ vals[i] = options.labels.last || max;
+
+ } else if ( $.type( options.labels.rest ) === "array" ) {
+
+ vals[i] = options.labels.rest[ steppedVals[i] - 1 ] || values[i];
+
+ } else {
+
+ vals[i] = values[i];
+
+ }
+
+ }
+
+ } else {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ vals[i] = values[i];
+
+ }
+
+ }
+
+ return vals;
+
+ }
+
+ // apply handle tip if settings allows.
+ if ( options.handle ) {
+
+ // we need to set the human-readable label to either the
+ // corresponding element in the array, or the appropriate
+ // item in the object... or an empty string.
+
+ tipValues = ( slider.values() && slider.values().length ) ?
+ getPipLabels( values ) :
+ getPipLabels( [ value ] );
+
+ for ( i = 0; i < tipValues.length; i++ ) {
+
+ $handles
+ .eq( i )
+ .append( $(""+ options.formatLabel(tipValues[i]) +"") );
+
+ }
+
+ }
+
+ if ( options.pips ) {
+
+ // if this slider also has pip-labels, we make those into tips, too.
+ slider.element.find(".ui-slider-label").each(function(k, v) {
+
+ var $this = $(v),
+ val = [ $this.data("value") ],
+ label,
+ $tip;
+
+
+ label = options.formatLabel( getPipLabels( val )[0] );
+
+ // create a tip element
+ $tip =
+ $("" + label + "")
+ .insertAfter( $this );
+
+ });
+
+ }
+
+ // check that the event option is actually valid against our
+ // own list of the slider's events.
+ if ( options.event !== "slide" &&
+ options.event !== "slidechange" &&
+ options.event !== "slide slidechange" &&
+ options.event !== "slidechange slide" ) {
+
+ options.event = "slidechange slide";
+
+ }
+
+ // when slider changes, update handle tip label.
+ slider.element
+ .off(".sliderFloat")
+ .on( options.event + ".sliderFloat", function( e, ui ) {
+
+ var uiValue = ( $.type( ui.value ) === "array" ) ? ui.value : [ ui.value ],
+ val = options.formatLabel( getPipLabels( uiValue )[0] );
+
+ $(ui.handle)
+ .find(".ui-slider-tip")
+ .html( val );
+
+ });
+
+ }
+
+ };
+
+ $.extend(true, $.ui.slider.prototype, extensionMethods);
+
+})(jQuery);
diff --git a/400-SOURCECODE/AIAHTML5.Web/themes/default/scripts/custom/custom.js b/400-SOURCECODE/AIAHTML5.Web/themes/default/scripts/custom/custom.js
new file mode 100644
index 0000000..981626e
--- /dev/null
+++ b/400-SOURCECODE/AIAHTML5.Web/themes/default/scripts/custom/custom.js
@@ -0,0 +1,69 @@
+$(function(){
+ "use strict";
+ /*** Sidebar Toggle ***/
+ var barPos=0;
+ var bar = $('.sidebar');
+ var main = $('.main');
+ $('.toggleBar').click(function() {
+ /*barPos = parseInt($('.sidebar').css('left'));
+ if(barPos!==0 && !bar.hasClass('active'))
+ {
+ bar.addClass('active');
+ main.addClass('active');
+ }
+ else
+ {
+ bar.removeClass('active');
+ main.removeClass('active');
+ }*/
+ bar.toggleClass('active');
+ main.toggleClass('active');
+ });
+});
+
+$(function(){
+ "use strict";
+ /*** Sidebar Toggle ***/
+ var barPos=0;
+ var bar = $('.tools');
+ var main = $('.main2');
+ $('.toggleBar').click(function() {
+ /*barPos = parseInt($('.tools').css('left'));
+ if(barPos!==0 && !bar.hasClass('active'))
+ {
+ bar.addClass('active');
+ main.addClass('active');
+ }
+ else
+ {
+ bar.removeClass('active');
+ main.removeClass('active');
+ }*/
+ bar.toggleClass('active');
+ main.toggleClass('active');
+ });
+});
+
+
+$(function(){
+ "use strict";
+ /*** Sidebar Toggle ***/
+ var barPos=0;
+ var bar = $('.treeview-left');
+ var main = $('.main-treeview');
+ $('.toggleBar').click(function() {
+ /*barPos = parseInt($('.sidebar').css('left'));
+ if(barPos!==0 && !bar.hasClass('active'))
+ {
+ bar.addClass('active');
+ main.addClass('active');
+ }
+ else
+ {
+ bar.removeClass('active');
+ main.removeClass('active');
+ }*/
+ bar.toggleClass('active');
+ main.toggleClass('active');
+ });
+});
diff --git a/400-SOURCECODE/AIAHTML5.Web/themes/jquery-ui-slider-pips.js b/400-SOURCECODE/AIAHTML5.Web/themes/jquery-ui-slider-pips.js
new file mode 100644
index 0000000..b77233c
--- /dev/null
+++ b/400-SOURCECODE/AIAHTML5.Web/themes/jquery-ui-slider-pips.js
@@ -0,0 +1,810 @@
+/*! jQuery-ui-Slider-Pips - v1.11.1 - 2015-11-30
+* Copyright (c) 2015 Simon Goellner ; Licensed MIT */
+
+
+
+(function($) {
+
+ "use strict";
+
+ var extensionMethods = {
+
+
+
+
+
+ // pips
+
+ pips: function( settings ) {
+
+ var slider = this,
+ i, j, p,
+ collection = "",
+ mousedownHandlers,
+ min = slider._valueMin(),
+ max = slider._valueMax(),
+ pips = ( max - min ) / slider.options.step,
+ $handles = slider.element.find(".ui-slider-handle"),
+ $pips;
+
+ var options = {
+
+ first: "label",
+ /* "label", "pip", false */
+
+ last: "label",
+ /* "label", "pip", false */
+
+ rest: "pip",
+ /* "label", "pip", false */
+
+ labels: false,
+ /* [array], { first: "string", rest: [array], last: "string" }, false */
+
+ prefix: "",
+ /* "", string */
+
+ suffix: "",
+ /* "", string */
+
+ step: ( pips > 100 ) ? Math.floor( pips * 0.05 ) : 1,
+ /* number */
+
+ formatLabel: function(value) {
+ return this.prefix + value + this.suffix;
+ }
+ /* function
+ must return a value to display in the pip labels */
+
+ };
+
+ if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
+
+ $.extend( options, settings );
+ slider.element.data("pips-options", options );
+
+ } else {
+
+ if ( settings === "destroy" ) {
+
+ destroy();
+
+ } else if ( settings === "refresh" ) {
+
+ slider.element.slider( "pips", slider.element.data("pips-options") );
+
+ }
+
+ return;
+
+ }
+
+
+ // we don't want the step ever to be a floating point.
+ slider.options.pipStep = Math.round( options.step );
+
+ // get rid of all pips that might already exist.
+ slider.element
+ .off( ".selectPip" )
+ .addClass("ui-slider-pips")
+ .find(".ui-slider-pip")
+ .remove();
+
+ // small object with functions for marking pips as selected.
+
+ var selectPip = {
+
+ single: function(value) {
+
+ this.resetClasses();
+
+ $pips
+ .filter(".ui-slider-pip-" + this.classLabel(value) )
+ .addClass("ui-slider-pip-selected");
+
+ if ( slider.options.range ) {
+
+ $pips.each(function(k, v) {
+
+ var pipVal = $(v).children(".ui-slider-label").data("value");
+
+ if (( slider.options.range === "min" && pipVal < value ) ||
+ ( slider.options.range === "max" && pipVal > value )) {
+
+ $(v).addClass("ui-slider-pip-inrange");
+
+ }
+
+ });
+
+ }
+
+ },
+
+ range: function(values) {
+
+ this.resetClasses();
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ $pips
+ .filter(".ui-slider-pip-" + this.classLabel(values[i]) )
+ .addClass("ui-slider-pip-selected-" + ( i + 1 ) );
+
+ }
+
+ if ( slider.options.range ) {
+
+ $pips.each(function(k, v) {
+
+ var pipVal = $(v).children(".ui-slider-label").data("value");
+
+ if ( pipVal > values[0] && pipVal < values[1] ) {
+
+ $(v).addClass("ui-slider-pip-inrange");
+
+ }
+
+ });
+
+ }
+
+ },
+
+ classLabel: function(value) {
+
+ return value.toString().replace(".", "-");
+
+ },
+
+ resetClasses: function() {
+
+ var regex = /(^|\s*)(ui-slider-pip-selected|ui-slider-pip-inrange)(-{1,2}\d+|\s|$)/gi;
+
+ $pips.removeClass( function(index, css) {
+ return ( css.match(regex) || [] ).join(" ");
+ });
+
+ }
+
+ };
+
+ function getClosestHandle( val ) {
+
+ var h, k,
+ sliderVals,
+ comparedVals,
+ closestVal,
+ tempHandles = [],
+ closestHandle = 0;
+
+ if ( slider.values() && slider.values().length ) {
+
+ // get the current values of the slider handles
+ sliderVals = slider.values();
+
+ // find the offset value from the `val` for each
+ // handle, and store it in a new array
+ comparedVals = $.map( sliderVals, function(v) {
+ return Math.abs( v - val );
+ });
+
+ // figure out the closest handles to the value
+ closestVal = Math.min.apply( Math, comparedVals );
+
+ // if a comparedVal is the closestVal, then
+ // set the value accordingly, and set the closest handle.
+ for ( h = 0; h < comparedVals.length; h++ ) {
+ if ( comparedVals[h] === closestVal ) {
+ tempHandles.push(h);
+ }
+ }
+
+ // set the closest handle to the first handle in array,
+ // just incase we have no _lastChangedValue to compare to.
+ closestHandle = tempHandles[0];
+
+ // now we want to find out if any of the closest handles were
+ // the last changed handle, if so we specify that handle to change
+ for ( k = 0; k < tempHandles.length; k++ ) {
+ if ( slider._lastChangedValue === tempHandles[k] ) {
+ closestHandle = tempHandles[k];
+ }
+ }
+
+ if ( slider.options.range && tempHandles.length === 2 ) {
+
+ if ( val > sliderVals[1] ) {
+
+ closestHandle = tempHandles[1];
+
+ } else if ( val < sliderVals[0] ) {
+
+ closestHandle = tempHandles[0];
+
+ }
+
+ }
+
+ }
+
+ return closestHandle;
+
+ }
+
+ function destroy() {
+
+ slider.element
+ .off(".selectPip")
+ .on("mousedown.slider", slider.element.data("mousedown-original") )
+ .removeClass("ui-slider-pips")
+ .find(".ui-slider-pip")
+ .remove();
+
+ }
+
+ // when we click on a label, we want to make sure the
+ // slider's handle actually goes to that label!
+ // so we check all the handles and see which one is closest
+ // to the label we clicked. If 2 handles are equidistant then
+ // we move both of them. We also want to trigger focus on the
+ // handle.
+
+ // without this method the label is just treated like a part
+ // of the slider and there's no accuracy in the selected value
+
+ function labelClick( label, e ) {
+
+ if (slider.option("disabled")) {
+ return;
+ }
+
+ var val = $(label).data("value"),
+ indexToChange = getClosestHandle( val );
+
+ if ( slider.values() && slider.values().length ) {
+
+ slider.options.values[ indexToChange ] = slider._trimAlignValue( val );
+
+ } else {
+
+ slider.options.value = slider._trimAlignValue( val );
+
+ }
+
+ slider._refreshValue();
+ slider._change( e, indexToChange );
+
+ }
+
+ // method for creating a pip. We loop this for creating all
+ // the pips.
+
+ function createPip( which ) {
+
+ var label,
+ percent,
+ number = which,
+ classes = "ui-slider-pip",
+ css = "",
+ value = slider.value(),
+ values = slider.values();
+
+ if ( which === "first" ) {
+
+ number = 0;
+
+ } else if ( which === "last" ) {
+
+ number = pips;
+
+ }
+
+ // labelValue is the actual value of the pip based on the min/step
+ var labelValue = min + ( slider.options.step * number );
+
+ // classLabel replaces any decimals with hyphens
+ var classLabel = labelValue.toString().replace(".","-");
+
+ // we need to set the human-readable label to either the
+ // corresponding element in the array, or the appropriate
+ // item in the object... or an empty string.
+
+ if ( $.type(options.labels) === "array" ) {
+
+ label = options.labels[number] || "";
+
+ } else if ( $.type( options.labels ) === "object" ) {
+
+ if ( which === "first" ) {
+
+ // set first label
+ label = options.labels.first || "";
+
+ } else if ( which === "last" ) {
+
+ // set last label
+ label = options.labels.last || "";
+
+ } else if ( $.type( options.labels.rest ) === "array" ) {
+
+ // set other labels, but our index should start at -1
+ // because of the first pip.
+
+ label = options.labels.rest[ number - 1 ] || "";
+
+ } else {
+
+ // urrggh, the options must be f**ked, just show nothing.
+ label = labelValue;
+
+ }
+
+ } else {
+
+ label = labelValue;
+
+ }
+
+
+
+
+ if ( which === "first" ) {
+
+ // first Pip on the Slider
+ percent = "0%";
+
+ classes += " ui-slider-pip-first";
+ classes += ( options.first === "label" ) ? " ui-slider-pip-label" : "";
+ classes += ( options.first === false ) ? " ui-slider-pip-hide" : "";
+
+ } else if ( which === "last" ) {
+
+ // last Pip on the Slider
+ percent = "100%";
+
+ classes += " ui-slider-pip-last";
+ classes += ( options.last === "label" ) ? " ui-slider-pip-label" : "";
+ classes += ( options.last === false ) ? " ui-slider-pip-hide" : "";
+
+ } else {
+
+ // all other Pips
+ percent = (( 100 / pips ) * which ).toFixed(4) + "%";
+
+ classes += ( options.rest === "label" ) ? " ui-slider-pip-label" : "";
+ classes += ( options.rest === false ) ? " ui-slider-pip-hide" : "";
+
+ }
+
+ classes += " ui-slider-pip-" + classLabel;
+
+
+ // add classes for the initial-selected values.
+ if ( values && values.length ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ if ( labelValue === values[i] ) {
+
+ classes += " ui-slider-pip-initial-" + ( i + 1 );
+ classes += " ui-slider-pip-selected-" + ( i + 1 );
+
+ }
+
+ }
+
+ if ( slider.options.range ) {
+
+ if ( labelValue > values[0] &&
+ labelValue < values[1] ) {
+
+ classes += " ui-slider-pip-inrange";
+
+ }
+
+ }
+
+ } else {
+
+ if ( labelValue === value ) {
+
+ classes += " ui-slider-pip-initial";
+ classes += " ui-slider-pip-selected";
+
+ }
+
+ if ( slider.options.range ) {
+
+ if (( slider.options.range === "min" && labelValue < value ) ||
+ ( slider.options.range === "max" && labelValue > value )) {
+
+ classes += " ui-slider-pip-inrange";
+
+ }
+
+ }
+
+ }
+
+
+
+ css = ( slider.options.orientation === "horizontal" ) ?
+ "left: " + percent :
+ "bottom: " + percent;
+
+
+ // add this current pip to the collection
+ return "" +
+ "" +
+ "" + options.formatLabel(label) + "" +
+ "";
+
+ }
+
+ // create our first pip
+ collection += createPip("first");
+
+ // for every stop in the slider; we create a pip.
+ for ( p = 1; p < pips; p++ ) {
+ if ( p % slider.options.pipStep === 0 ) {
+ collection += createPip( p );
+ }
+ }
+
+ // create our last pip
+ collection += createPip("last");
+
+ // append the collection of pips.
+ slider.element.append( collection );
+
+ // store the pips for setting classes later.
+ $pips = slider.element.find(".ui-slider-pip");
+
+
+
+ // store the mousedown handlers for later, just in case we reset
+ // the slider, the handler would be lost!
+
+ if ( $._data( slider.element.get(0), "events").mousedown &&
+ $._data( slider.element.get(0), "events").mousedown.length ) {
+
+ mousedownHandlers = $._data( slider.element.get(0), "events").mousedown;
+
+ } else {
+
+ mousedownHandlers = slider.element.data("mousedown-handlers");
+
+ }
+
+ slider.element.data("mousedown-handlers", mousedownHandlers.slice() );
+
+ // loop through all the mousedown handlers on the slider,
+ // and store the original namespaced (.slider) event handler so
+ // we can trigger it later.
+ for ( j = 0; j < mousedownHandlers.length; j++ ) {
+ if ( mousedownHandlers[j].namespace === "slider" ) {
+ slider.element.data("mousedown-original", mousedownHandlers[j].handler );
+ }
+ }
+
+ // unbind the mousedown.slider event, because it interferes with
+ // the labelClick() method (stops smooth animation), and decide
+ // if we want to trigger the original event based on which element
+ // was clicked.
+ slider.element
+ .off("mousedown.slider")
+ .on("mousedown.selectPip", function(e) {
+
+ var $target = $(e.target),
+ closest = getClosestHandle( $target.data("value") ),
+ $handle = $handles.eq( closest );
+
+ $handle.addClass("ui-state-active");
+
+ if ( $target.is(".ui-slider-label") ) {
+
+ labelClick( $target, e );
+
+ slider.element
+ .one("mouseup.selectPip", function() {
+
+ $handle
+ .removeClass("ui-state-active")
+ .focus();
+
+ });
+
+ } else {
+
+ var originalMousedown = slider.element.data("mousedown-original");
+ originalMousedown(e);
+
+ }
+
+ });
+
+
+
+
+ slider.element.on( "slide.selectPip slidechange.selectPip", function(e, ui) {
+
+ var $slider = $(this),
+ value = $slider.slider("value"),
+ values = $slider.slider("values");
+
+ if ( ui ) {
+
+ value = ui.value;
+ values = ui.values;
+
+ }
+
+ if ( slider.values() && slider.values().length ) {
+
+ selectPip.range( values );
+
+ } else {
+
+ selectPip.single( value );
+
+ }
+
+ });
+
+
+
+
+ },
+
+
+
+
+
+
+
+
+ // floats
+
+ float: function( settings ) {
+
+ var i,
+ slider = this,
+ min = slider._valueMin(),
+ max = slider._valueMax(),
+ value = slider._value(),
+ values = slider._values(),
+ tipValues = [],
+ $handles = slider.element.find(".ui-slider-handle");
+
+ var options = {
+
+ handle: true,
+ /* false */
+
+ pips: false,
+ /* true */
+
+ labels: false,
+ /* [array], { first: "string", rest: [array], last: "string" }, false */
+
+ prefix: "",
+ /* "", string */
+
+ suffix: "",
+ /* "", string */
+
+ event: "slidechange slide",
+ /* "slidechange", "slide", "slidechange slide" */
+
+ formatLabel: function(value) {
+ return this.prefix + value + this.suffix;
+ }
+ /* function
+ must return a value to display in the floats */
+
+ };
+
+ if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
+
+ $.extend( options, settings );
+ slider.element.data("float-options", options );
+
+ } else {
+
+ if ( settings === "destroy" ) {
+
+ destroy();
+
+ } else if ( settings === "refresh" ) {
+
+ slider.element.slider( "float", slider.element.data("float-options") );
+
+ }
+
+ return;
+
+ }
+
+
+
+
+ if ( value < min ) {
+ value = min;
+ }
+
+ if ( value > max ) {
+ value = max;
+ }
+
+ if ( values && values.length ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ if ( values[i] < min ) {
+ values[i] = min;
+ }
+
+ if ( values[i] > max ) {
+ values[i] = max;
+ }
+
+ }
+
+ }
+
+ // add a class for the CSS
+ slider.element
+ .addClass("ui-slider-float")
+ .find(".ui-slider-tip, .ui-slider-tip-label")
+ .remove();
+
+
+
+ function destroy() {
+
+ slider.element
+ .off(".sliderFloat")
+ .removeClass("ui-slider-float")
+ .find(".ui-slider-tip, .ui-slider-tip-label")
+ .remove();
+
+ }
+
+
+ function getPipLabels( values ) {
+
+ // when checking the array we need to divide
+ // by the step option, so we store those values here.
+
+ var vals = [],
+ steppedVals = $.map( values, function(v) {
+ return Math.ceil(( v - min ) / slider.options.step);
+ });
+
+ // now we just get the values we need to return
+ // by looping through the values array and assigning the
+ // label if it exists.
+
+ if ( $.type( options.labels ) === "array" ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ vals[i] = options.labels[ steppedVals[i] ] || values[i];
+
+ }
+
+ } else if ( $.type( options.labels ) === "object" ) {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ if ( values[i] === min ) {
+
+ vals[i] = options.labels.first || min;
+
+ } else if ( values[i] === max ) {
+
+ vals[i] = options.labels.last || max;
+
+ } else if ( $.type( options.labels.rest ) === "array" ) {
+
+ vals[i] = options.labels.rest[ steppedVals[i] - 1 ] || values[i];
+
+ } else {
+
+ vals[i] = values[i];
+
+ }
+
+ }
+
+ } else {
+
+ for ( i = 0; i < values.length; i++ ) {
+
+ vals[i] = values[i];
+
+ }
+
+ }
+
+ return vals;
+
+ }
+
+ // apply handle tip if settings allows.
+ if ( options.handle ) {
+
+ // we need to set the human-readable label to either the
+ // corresponding element in the array, or the appropriate
+ // item in the object... or an empty string.
+
+ tipValues = ( slider.values() && slider.values().length ) ?
+ getPipLabels( values ) :
+ getPipLabels( [ value ] );
+
+ for ( i = 0; i < tipValues.length; i++ ) {
+
+ $handles
+ .eq( i )
+ .append( $(""+ options.formatLabel(tipValues[i]) +"") );
+
+ }
+
+ }
+
+ if ( options.pips ) {
+
+ // if this slider also has pip-labels, we make those into tips, too.
+ slider.element.find(".ui-slider-label").each(function(k, v) {
+
+ var $this = $(v),
+ val = [ $this.data("value") ],
+ label,
+ $tip;
+
+
+ label = options.formatLabel( getPipLabels( val )[0] );
+
+ // create a tip element
+ $tip =
+ $("" + label + "")
+ .insertAfter( $this );
+
+ });
+
+ }
+
+ // check that the event option is actually valid against our
+ // own list of the slider's events.
+ if ( options.event !== "slide" &&
+ options.event !== "slidechange" &&
+ options.event !== "slide slidechange" &&
+ options.event !== "slidechange slide" ) {
+
+ options.event = "slidechange slide";
+
+ }
+
+ // when slider changes, update handle tip label.
+ slider.element
+ .off(".sliderFloat")
+ .on( options.event + ".sliderFloat", function( e, ui ) {
+
+ var uiValue = ( $.type( ui.value ) === "array" ) ? ui.value : [ ui.value ],
+ val = options.formatLabel( getPipLabels( uiValue )[0] );
+
+ $(ui.handle)
+ .find(".ui-slider-tip")
+ .html( val );
+
+ });
+
+ }
+
+ };
+
+ $.extend(true, $.ui.slider.prototype, extensionMethods);
+
+})(jQuery);