Commit 6dff470021a2b208ce11b78716dc547d3afa2e32

Authored by Amrita Vishnoi
1 parent 40551497

Able to open the AA Open view but not the dynamic one.

400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj
... ... @@ -66,6 +66,7 @@
66 66 <Content Include="app\views\3dA\3d-anatomy-details.html" />
67 67 <Content Include="app\views\3dA\3dA-view.html" />
68 68 <Content Include="app\views\ADAMImg\ADAMImg-view.html" />
  69 + <Content Include="app\views\atlas-anatomy-detail.html" />
69 70 <Content Include="app\views\ca\clinical-animations-detail.html" />
70 71 <Content Include="app\views\ci\clinical-illustrations-detail.html" />
71 72 <Content Include="app\views\da\da-view.html" />
... ... @@ -597,6 +598,8 @@
597 598 <Content Include="content\images\3da\3d-6.jpg" />
598 599 <Content Include="content\images\3da\3d-7.jpg" />
599 600 <Content Include="content\images\3da\3d-8.jpg" />
  601 + <Content Include="content\images\aa\LeftMenu\all-pin.png" />
  602 + <Content Include="content\images\aa\LeftMenu\hide-pin.png" />
600 603 <Content Include="content\images\aa\thumbnails\aa_tni_2862.jpg" />
601 604 <Content Include="content\images\aa\thumbnails\aa_tni_2863.jpg" />
602 605 <Content Include="content\images\aa\thumbnails\aa_tni_2864.jpg" />
... ... @@ -44092,6 +44095,7 @@
44092 44095 <Content Include="libs\jcanvas\jcanvas.handle.min.js" />
44093 44096 <Content Include="libs\jcanvas\jcanvas.min.js" />
44094 44097 <Content Include="libs\jinqJs.js" />
  44098 + <Content Include="libs\jquery\jquery.sticky.js" />
44095 44099 <Content Include="libs\jquery\jquery_plugin\color-picker\jquery.minicolors.min.js" />
44096 44100 <Content Include="libs\jquery\2.1.3\jquery.min.js" />
44097 44101 <Content Include="libs\jquery\jquery_plugin\jqueryui.js" />
... ... @@ -44302,12 +44306,14 @@
44302 44306 <Content Include="themes\default\scripts\bootstrap\3.3.6\bootstrap.js" />
44303 44307 <Content Include="themes\default\scripts\bootstrap\3.3.6\bootstrap.min.js" />
44304 44308 <Content Include="themes\default\scripts\bootstrap\3.3.6\npm.js" />
  44309 + <Content Include="themes\default\scripts\custom\custom.js" />
44305 44310 <Content Include="themes\default\scripts\custom\main.js" />
44306 44311 <Content Include="themes\default\scripts\easyTree.js" />
44307 44312 <Content Include="libs\jquery\jquery_plugin\slider-pips\jquery-ui-slider-pips.js" />
44308 44313 <Content Include="libs\jquery\jquery_plugin\jquery.mCustomScrollbar.concat.min.js" />
44309 44314 <Content Include="libs\jquery\jquery_plugin\jquery.sticky.js" />
44310 44315 <Content Include="app\widget\TopMenu.html" />
  44316 + <Content Include="themes\jquery-ui-slider-pips.js" />
44311 44317 <Content Include="Web.config">
44312 44318 <SubType>Designer</SubType>
44313 44319 </Content>
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
1   -'use strict';
  1 +/// <reference path="../views/atlas-anatomy-detail.html" />
  2 +/// <reference path="../views/atlas-anatomy-detail.html" />
  3 +'use strict';
2 4  
3 5 AIA.controller("TileViewListController", ["$scope", "$rootScope", "$compile", "$http", "$log", "$location", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "$timeout", "Modules", "$routeParams", "DataService","ModuleService" ,
4 6 function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, BodySystems, ViewOrientations, ImageTypes, $timeout, Modules, $routeParam, DataService,ModuleService)
... ... @@ -135,47 +137,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, BodyRegions, Bod
135 137  
136 138 $scope.openModuleItem = function (event) {
137 139  
138   - // debugger;
  140 + alert('hi');
  141 + //// debugger;
139 142 var moduleItemDataToBeSaved = event.target.id;
140 143  
141 144 var OpendTileData = [];
142 145  
143 146 OpendTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData);
144   -
145   - alert('openModuleItem is called');
146   -
147   - }
  147 +
  148 + //var u = $location.url();
  149 + $location.url('/atlas-anatomy-detail');
148 150  
149   - $scope.openView = function ($event) {
150   - //$rootScope.disableAnnotationTB = false;
151   - //$rootScope.CIAnotationIdentifyModeOff = true;
152   - //$rootScope.currentBodyViewId = $event.currentTarget.id;
153   - //if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") {
154   - // var CITitle = [];
155   - // CITitle = new jinqJs()
156   - // .from($scope.selectedCIListViewData)
157   - // .where('_id = ' + $event.currentTarget.id)
158   - // .select('_Title');
159   -
160   - // // console.log(CITitle);
161   - // // console.log($scope.selectedCIListViewData);
162   -
163   - // $rootScope.ViewTitle = CITitle[0]._Title;
164   - //}
165   - //else {
166   - // $rootScope.ViewTitle = $event.currentTarget.textContent;
167   -
168   - //}
169   -
170   -
171   - //localStorage.setItem("currentViewTitleFromJson", $rootScope.ViewTitle);
172   - //localStorage.setItem("currentBodyViewId", $event.currentTarget.id);
173   -
174   - var u = $location.url();
175   - $location.url('/atlas-anatomy-detail.html');
176   -
177   - // console.log($location.url('/clinical-illustrations-detail'));
178   -
179 151 }
180 152  
  153 +
181 154 }]);
... ...
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... ... @@ -173,6 +173,12 @@ AIA.constant(&#39;pages&#39;, [
173 173 pageController: '3dAController'
174 174  
175 175 },
  176 + { //id:2,
  177 + name: 'Atlas Anatomy',
  178 + pageSlug: 'atlas-anatomy-detail',
  179 + pageUrl: 'app/views/atlas-anatomy-detail.html',
  180 + pageController: 'TileViewListController'
  181 + },
176 182 ]);
177 183  
178 184  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/atlas-anatomy-detail.html
1   -<!DOCTYPE html>
2   -<html lang="en">
3   -<head>
4   -<meta charset="utf-8">
5   -<meta http-equiv="X-UA-Compatible" content="IE=edge">
6   -<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
7   -<title>A.D.A.M. Interactive Anatomy</title>
8   -<link href="css/bootstrap.css" rel="stylesheet">
9   -<link href="css/main.css" rel="stylesheet">
10   -
11   -<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
12   -<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,800,700,600,400italic">
13   -
14   -<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
15   -<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
16   -<!--[if lt IE 9]>
17   - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
18   - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
19   - <![endif]-->
20   -
  1 +
  2 +<div id="imaginary_container">
  3 + <div class="input-group stylish-input-group paddTop5 hidden-sm">
  4 + <input type="text" class="form-control width120" placeholder="Search">
  5 + <span class="input-group-addon">
  6 + <button type="submit">
  7 + <span class="fa fa-search color-green"></span>
  8 + </button>
  9 + </span>
  10 + </div>
21 11  
22   -<!-- include the jQuery and jQuery UI scripts -->
23   -<script src="https://code.jquery.com/jquery-2.1.1.js"></script>
24   -<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
25   -<!-- plus a jQuery UI theme, here I use "flick" -->
26   -<link rel="stylesheet" href="css/jquery-ui-slider-pips.css">
27   -<link rel="stylesheet" href="css/jquery-ui.css">
28   -</head>
29   -<body>
30   -<div class="container-fluid ">
31   - <!--Header-->
32   - <nav class="navbar navbar-inverse navbar-fixed-top">
33   - <div class="container-fluid">
34   - <!-- Brand and toggle get grouped for better mobile display -->
35   - <div class="navbar-header">
36   - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#topFixedNavbar1" aria-expanded="false"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
37   - <a class="frameLogo navbar-brand" href="welcome.html"><img src="img/logo-main.png" class="img-responsive" alt=""></a> </div>
38   - <div class="collapse navbar-collapse" id="topFixedNavbar1">
39   - <ul class="nav navbar-nav toperMenu-spaceleft">
40   - <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">File<span class="caret"></span></a>
41   - <ul class="dropdown-menu">
42   - <li><a href="#">Open Resources</a></li>
43   - <li><a href="#">Open My Pictures</a></li>
44   - <li><a href="#">Open My Animations</a></li>
45   - <li role="separator" class="divider"></li>
46   - <li><a href="#">Test Creator</a></li>
47   - <li><a href="#">Open Test</a></li>
48   - <li><a href="#">Save Test As</a></li>
49   - <li role="separator" class="divider"></li>
50   - <li><a href="#">New Curriculum</a></li>
51   - <li><a href="#">Open Existing Curriculum</a></li>
52   - <li><a href="#">Save Curriculum As</a></li>
53   - <li role="separator" class="divider"></li>
54   - <li><a href="#">Export Image</a></li>
55   - <li role="separator" class="divider"></li>
56   - <li><a href="#">Print Active Viewer</a></li>
57   - <li><a href="#">Print All Open Viewers</a></li>
58   - <li><a href="#">Print Priview</a></li>
  12 + <div class="visible-sm visible-md pull-right marginTop5">
  13 + <div class="dropdown">
  14 + <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown">
  15 + <i class="fa fa-search color-white"></i>
  16 + </button>
  17 + <!--<div class="hidden-xs marginR5 dropdown-toggle marginTop5" id="dropdownMenu1" data-toggle="dropdown" data-placement="top" title="Logout"><a href="index.html"><i class="fa fa-search color-white"></i></a></div>-->
  18 + <ul class="dropdown-menu right0" aria-labelledby="dropdownMenu1">
  19 + <li>
  20 + <!--<div class="input-group"><input type="text" aria-label="Amount (to the nearest dollar)" class="form-control"> <span class="input-group-addon"><i class="fa fa-search color-green"></i></span> </div>-->
  21 + <div class="input-group stylish-input-group ">
  22 + <input type="text" class="form-control" placeholder="Search" style="width:100%;">
  23 + <span class="input-group-addon">
  24 + <button type="submit">
  25 + <span class="fa fa-search color-green"></span>
  26 + </button>
  27 + </span>
  28 + </div>
  29 + </li>
59 30 </ul>
60   - </li>
61   - <li><a href="#" data-toggle="modal" data-target=".bs-example-modal-sm">Annotation</a></li>
62   -
  31 + </div>
  32 + </div>
  33 +</div>
  34 +
  35 +<!--Body-->
  36 +<div class="bodyWrap row">
  37 + <div class="col-sm-12 pageHeading">
  38 + <!--<button type="button" class="btn btn-success pull-left toggleBar btn-sm" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </button>-->
  39 + <!--<div class=" pull-left toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-exchange"></i> </div>-->
  40 + <h4 class="pull-left">1<sup>st</sup> &amp; 2<sup>nd</sup> Intercostal Spaces</h4>
  41 + <div class="pull-right btn-group paddTop4 hidden-xs"> <a href="#" class="btn btn-xs btn-default"><i class="fa fa-minus"></i></a> <a href="#" class="btn btn-xs btn-default"><i class="fa fa-clone"></i></a> <a href="#" class="btn btn-xs btn-default"><i class="fa fa-close"></i></a> </div>
  42 + <div class="clearfix"></div>
  43 + </div>
  44 + <div class="tools pull-left" style="top:44px;">
  45 + <div class="toggle-icon toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"></div>
  46 + <div class="">
  47 + <div class="col-sm-6" title="Hide Pins"><button class="btn btn-black btn-sm"> <img src="../content/images/aa/LeftMenu/hide-pin.png" alt="" title=""></button> </div>
  48 + <div class="col-sm-6" title="Show Selected Pins"><button class="btn btn-black btn-sm pull-right"><img src="img/draw-pin.png" alt="" title=""></button></div>
  49 + <div class="col-sm-6" title="Show All Pins in System(s)"><button class="btn btn-primary btn-sm marginTop5"><img src="../content/images/aa/LeftMenu/all-pin.png" alt="" title=""></button></div>
  50 + <div class="col-sm-6" title="Select System">
  51 + <button class="btn btn-black btn-sm pull-right marginTop5 dropdown-toggle" type="button" id="dropdownMenu221" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><img src="img/icon-highlight.png" alt="" title=""></button>
  52 + <ul class="dropdown-menu" aria-labelledby="dropdownMenu221">
  53 + <li><a href="#" title="Current Structure">All</a></li>
  54 + <li role="separator" class="divider"></li>
  55 + <li><a href="#" title="Cardiovascular">Cardiovascular</a></li>
  56 + <li><a href="#" title="Digestive">Digestive</a></li>
  57 + <li class="disabled"><a href="#" title="Endocrine">Endocrine</a></li>
  58 + <li class="disabled"><a href="#" title="Immune">Immune</a></li>
  59 + <li class="disabled"><a href="#" title="Integumentary">Integumentary</a></li>
  60 + <li class="disabled"><a href="#" title="Lymphatic">Lymphatic</a></li>
  61 + <li><a href="#" title="Muscular">Muscular</a></li>
  62 + <li class="disabled"><a href="#" title="Nervous">Nervous</a></li>
  63 + <li class="disabled"><a href="#" title="Reproductive">Reproductive</a></li>
  64 + <li class="disabled"><a href="#" title="Respiratory">Respiratory</a></li>
  65 + <li><a href="#" title="Skeletal">Skeletal</a></li>
  66 + <li class="disabled"><a href="#" title="Urinary">Urinary</a></li>
  67 + </ul>
63 68  
64   -
65   - <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Options<span class="caret"></span></a>
66   - <ul class="dropdown-menu">
67   - <li><a href="#">List Manager</a></li>
68   - <li><a href="#">Annotation Toolbar</a></li>
69   - <li><a href="#">Add to Existing Curriculum</a></li>
70   - <li><a href="#">Settings</a></li>
71   - <li role="separator" class="divider"></li>
72   - <li><a href="#">Lab Exercises PDF</a></li>
73   - </ul>
74   - </li>
75   - <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Help<span class="caret"></span></a>
76   - <ul class="dropdown-menu">
77   - <li><a href="#">Help Topics</a></li>
78   - <li><a href="#">Customer Support</a></li>
79   - <li role="separator" class="divider"></li>
80   - <li><a href="#">About A.D.A.M.</a></li>
81   - </ul>
82   - </li>
83   - <li><a href="#">Admin</a></li>
84   - </ul>
85   - <ul class="nav navbar-nav navbar-right">
86   - <li class="visible-xs"><a href="index.html">Logout</a></li>
87   - <li class="hidden-xs marginR5" data-toggle="tooltip" data-placement="top" title="Logout"><a href="index.html"><i class="fa fa-power-off"></i></a></li>
88   - </ul>
89   - <!--<form class="navbar-form navbar-right" role="search">
90   - <div class="input-group">
91   - <select class="form-control">
92   - <option selected>----Select----</option>
93   - <option>1</option>
94   - <option>2</option>
95   - <option>3</option>
96   - <option>4</option>
97   - </select>
98   - <span class="input-group-btn">
99   - <button class="btn btn-success" type="button"><i class="fa fa-search"></i> Search</button>
100   - </span> </div>
101   - </form>-->
102   - <div id="imaginary_container">
103   - <div class="input-group stylish-input-group paddTop5 hidden-sm">
104   - <input type="text" class="form-control width120" placeholder="Search" >
105   - <span class="input-group-addon">
106   - <button type="submit" >
107   - <span class="fa fa-search color-green"></span>
108   - </button>
109   - </span>
110   - </div>
111   -
112   - <div class="visible-sm visible-md pull-right marginTop5">
113   - <div class="dropdown">
114   - <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" >
115   - <i class="fa fa-search color-white"></i>
116   - </button>
117   - <!--<div class="hidden-xs marginR5 dropdown-toggle marginTop5" id="dropdownMenu1" data-toggle="dropdown" data-placement="top" title="Logout"><a href="index.html"><i class="fa fa-search color-white"></i></a></div>-->
118   - <ul class="dropdown-menu right0" aria-labelledby="dropdownMenu1">
119   - <li>
120   - <!--<div class="input-group"><input type="text" aria-label="Amount (to the nearest dollar)" class="form-control"> <span class="input-group-addon"><i class="fa fa-search color-green"></i></span> </div>-->
121   - <div class="input-group stylish-input-group ">
122   - <input type="text" class="form-control" placeholder="Search" style="width:100%;" >
123   - <span class="input-group-addon">
124   - <button type="submit" >
125   - <span class="fa fa-search color-green"></span>
126   - </button>
127   - </span>
128   - </div>
129   - </li>
130   - </ul>
131   - </div>
132   - </div>
133 69 </div>
134   - </div>
  70 + <div class="col-sm-12" data-toggle="tooltip" data-placement="top" title="Show/Hide Structure Name Boxes"><button class="btn btn-black btn-sm marginTop5 btn-block"> <img src="img/comment-box.png" alt="" title=""></button> </div>
  71 + </div>
  72 + <div class="pips-slider" style="margin-top:125px">
  73 + <h3>Zoom <i class="fa fa-search-plus"></i></h3>
  74 + <div class="slider" id="vertical-slider"></div>
  75 + </div>
135 76 </div>
136   - </nav>
137   - <!--Body-->
138   - <div class="bodyWrap row">
139   - <div class="col-sm-12 pageHeading">
140   - <!--<button type="button" class="btn btn-success pull-left toggleBar btn-sm" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-bars"></i> </button>-->
141   -
142   - <!--<div class=" pull-left toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"> <i class="fa fa-exchange"></i> </div>-->
143   - <h4 class="pull-left">1<sup>st</sup> &amp; 2<sup>nd</sup> Intercostal Spaces</h4>
144   - <div class="pull-right btn-group paddTop4 hidden-xs"> <a href="#" class="btn btn-xs btn-default"><i class="fa fa-minus"></i></a> <a href="#" class="btn btn-xs btn-default"><i class="fa fa-clone"></i></a> <a href="#" class="btn btn-xs btn-default"><i class="fa fa-close"></i></a> </div>
145   - <div class="clearfix"></div>
146   - </div>
147   - <div class="tools pull-left" style="top:44px;">
148   - <div class="toggle-icon toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"></div>
149   - <div class="">
150   - <div class="col-sm-6" title="Hide Pins"><button class="btn btn-black btn-sm"> <img src="img/hide-pin.png" alt="" title=""></button> </div>
151   - <div class="col-sm-6" title="Show Selected Pins"><button class="btn btn-black btn-sm pull-right"><img src="img/draw-pin.png" alt="" title=""></button></div>
152   - <div class="col-sm-6" title="Show All Pins in System(s)"><button class="btn btn-primary btn-sm marginTop5"><img src="img/all-pin.png" alt="" title=""></button></div>
153   - <div class="col-sm-6" title="Select System">
154   - <button class="btn btn-black btn-sm pull-right marginTop5 dropdown-toggle" type="button" id="dropdownMenu221" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><img src="img/icon-highlight.png" alt="" title=""></button>
155   - <ul class="dropdown-menu" aria-labelledby="dropdownMenu221">
156   - <li><a href="#" title="Current Structure">All</a></li>
157   - <li role="separator" class="divider"></li>
158   - <li><a href="#" title="Cardiovascular">Cardiovascular</a></li>
159   - <li><a href="#" title="Digestive">Digestive</a></li>
160   - <li class="disabled"><a href="#" title="Endocrine">Endocrine</a></li>
161   - <li class="disabled"><a href="#" title="Immune">Immune</a></li>
162   - <li class="disabled"><a href="#" title="Integumentary">Integumentary</a></li>
163   - <li class="disabled"><a href="#" title="Lymphatic">Lymphatic</a></li>
164   - <li><a href="#" title="Muscular">Muscular</a></li>
165   - <li class="disabled"><a href="#" title="Nervous">Nervous</a></li>
166   - <li class="disabled"><a href="#" title="Reproductive">Reproductive</a></li>
167   - <li class="disabled"><a href="#" title="Respiratory">Respiratory</a></li>
168   - <li><a href="#" title="Skeletal">Skeletal</a></li>
169   - <li class="disabled"><a href="#" title="Urinary">Urinary</a></li>
170   - </ul>
171   -
172   - </div>
173   - <div class="col-sm-12" data-toggle="tooltip" data-placement="top" title="Show/Hide Structure Name Boxes"><button class="btn btn-black btn-sm marginTop5 btn-block"> <img src="img/comment-box.png" alt="" title=""></button> </div>
174   - </div>
175   - <div class="pips-slider" style="margin-top:125px">
176   - <h3>Zoom <i class="fa fa-search-plus"></i></h3>
177   - <div class="slider" id="vertical-slider"></div>
178   - </div>
179   - </div>
180   -
181   - <div class="main2">
182   - <div class="col-sm-12 stickey-area">
183   - <div class="breadcrumb">
184   - <div class="">
  77 +</div>
  78 +
  79 +
  80 +
  81 +<div class="col-sm-12 stickey-area">
  82 + <div class="breadcrumb">
  83 + <div class="">
185 84 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left">
186   - <input class="form-control input-sm " type="text" placeholder="Anterior cutaneous branch of first intercostal nerve">
187   - <!--<select class="form-control input-sm ">
188   - <option>---Select---</option>
189   - <option selected>Anterior cutaneous branch of first intercostal nerve</option>
190   - <option>Anterior cutaneous branch of second intercostal nerve</option>
191   - <option>Anterior cutaneous branch of third intercostal nerve</option>
192   - <option>Anterior intercostal artery</option>
193   - <option>Anterior intercostal vein</option>
194   - </select>-->
195   - <!--<div class="input-group-addon btn btn-primary btn-sm"></div>-->
196   - </div>
197   - &nbsp;
198   - <!-- Single button -->
  85 + <input class="form-control input-sm " type="text" placeholder="Anterior cutaneous branch of first intercostal nerve">
  86 + <!--<select class="form-control input-sm ">
  87 + <option>---Select---</option>
  88 + <option selected>Anterior cutaneous branch of first intercostal nerve</option>
  89 + <option>Anterior cutaneous branch of second intercostal nerve</option>
  90 + <option>Anterior cutaneous branch of third intercostal nerve</option>
  91 + <option>Anterior intercostal artery</option>
  92 + <option>Anterior intercostal vein</option>
  93 + </select>-->
  94 + <!--<div class="input-group-addon btn btn-primary btn-sm"></div>-->
  95 + </div>
  96 + &nbsp;
  97 + <!-- Single button -->
199 98 <div class="btn-group">
200   - <button type="button" class="btn btn-success dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
201   - <i class="fa fa-arrow-circle-right"></i>
202   - </button>
203   - <ul class="dropdown-menu">
204   - <li><a href="#">1<sup>st</sup> &amp; 2<sup>nd</sup> Intercostal Spaces</a></li>
205   - <li role="separator" class="divider"></li>
206   - <li><a href="#">All</a></li>
207   - </ul>
  99 + <button type="button" class="btn btn-success dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  100 + <i class="fa fa-arrow-circle-right"></i>
  101 + </button>
  102 + <!--<ul class="dropdown-menu">
  103 + <li><a href="#">1<sup>st</sup> &amp; 2<sup>nd</sup> Intercostal Spaces</a></li>
  104 + <li role="separator" class="divider"></li>
  105 + <li><a href="#">All</a></li>
  106 + </ul>-->
208 107 </div>
209 108 <div class="btn-group">
210   - <button type="button" class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
211   - <i class="fa fa-male"></i>
212   - </button>
213   - <ul class="dropdown-menu" style="min-width:auto;">
214   - <li><img src="img/position.jpg" class="img-responsive"></li>
215   - </ul>
  109 + <button type="button" class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  110 + <i class="fa fa-male"></i>
  111 + </button>
  112 + <ul class="dropdown-menu" style="min-width:auto;">
  113 + <li><img src="img/position.jpg" class="img-responsive"></li>
  114 + </ul>
216 115 </div>
217 116  
218   - </div>
219 117 </div>
220   - </div>
221   - <div class="col-sm-12">
222   - <div class="container-fluid">
  118 + </div>
  119 +</div>
  120 +<div class="col-sm-12">
  121 + <div class="container-fluid">
223 122 <div class="row">
224 123 <div class="col-sm-12 img-thumbnail" align="center"><img src="img/1000x600.jpg" alt="" title="" class="img-responsive"></div>
225 124 <!--<div class="col-sm-1 img-thumbnail pull-right" align="center"><img src="img/500x300.jpg" alt="" title="" class="img-responsive"></div>
226 125 <div class="clearfix"></div>-->
227 126 </div>
228   - </div>
229   - </div>
230   - <div class="clearfix"></div>
231   -
232   -
233   -
234 127 </div>
235   - </div>
236 128 </div>
  129 +<div class="clearfix"></div>
237 130  
238   -<!--Annotation Modal-->
239   -<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="z-index:9999;" id="draggable">
240   - <div class="modal-dialog modal-sm" role="document">
241   - <div class="modal-content">
242   - <div class="modal-header annotation-modal-header">
243   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
244   - <h4 class="modal-title" id="myModalLabel">Annotation</h4>
245   - </div>
246   - <div class="modal-body">
247   - <div class="row">
248   - <div class="col-sm-12">
249   - <h5>Mode</h5>
250   - <!--<div class="btn-group" role="group" aria-label="...">
251   - <button type="button" class="btn btn-primary btn-sm">Identify</button>
252   - <button type="button" class="btn btn-primary btn-sm">Draw</button>
253   - </div>-->
254   - <div class="btn-group btn-group-justified" role="group" aria-label="...">
255   - <div class="btn-group" role="group">
256   - <button type="button" class="btn btn-sm btn-success">Identify</button>
257   - </div>
258   - <div class="btn-group" role="group">
259   - <button type="button" class="btn btn-sm btn-success">Draw</button>
260   - </div>
261   - </div>
262   -
263   - </div>
264   - <div class="col-sm-12">
265   - <h5>Tools</h5>
266   - <div class="well well-popup">
267   - <div class="" role="" aria-label="...">
268   - <div class="" role="group" align="center">
269   - <button type="button" class="btn btn-black btn-xs mrgnBtm5" data-toggle="tooltip" data-placement="top" title="Select Shapes(S)"><img src="img/icon-identity.png" alt="" title=""></button>
270   - <button type="button" class="btn btn-black btn-xs mrgnBtm5" data-toggle="tooltip" data-placement="top" title="Draw Pin"><img src="img/draw-pin.png" alt="" title=""></button>
271   - <button type="button" class="btn btn-black btn-xs mrgnBtm5" data-toggle="tooltip" data-placement="top" title="Draw Arrow"><img src="img/draw-arrow.png" alt="" title=""></button>
272   - <button type="button" class="btn btn-black btn-xs mrgnBtm5" data-toggle="tooltip" data-placement="top" title="Draw Text"><img src="img/draw-text.png" alt="" title=""></button>
273   - </div>
274   - <div class="" role="group" align="center">
275   - <button type="button" class="btn btn-black btn-xs " data-toggle="tooltip" data-placement="top" title="Draw Line"><img src="img/draw-line.png" alt="" title=""></button>
276   - <button type="button" class="btn btn-black btn-xs" data-toggle="tooltip" data-placement="top" title="Draw Rectangle"><img src="img/draw-rec.png" alt="" title=""></button>
277   - <button type="button" class="btn btn-black btn-xs" data-toggle="tooltip" data-placement="top" title="Draw Circle"><img src="img/draw-cir.png" alt="" title=""></button>
278   - <button type="button" class="btn btn-black btn-xs" data-toggle="tooltip" data-placement="top" title="Draw Polygon"><img src="img/draw-poly.png" alt="" title=""></button>
279   - </div>
280   - </div>
281   - </div>
282   - <div class="well-popup well">
283   - <img src="img/blank-shape.jpg" alt="..." class="img-rounded img-responsive">
284   - </div>
285   - <div class="well well-popup">
286   - <div class="" role="group" aria-label="...">
287   - <div>
288   - <button type="button" class="btn btn-primary btn-xs pull-left" data-toggle="tooltip" data-placement="top" title="Paint" style="margin-right:1%;"><i class="fa fa-paint-brush"></i></button>
289   - <button type="button" class="btn btn-primary btn-xs pull-left" data-toggle="tooltip" data-placement="top" title="Erase"><i class="fa fa-eraser"></i></button>&nbsp;
290   - <div class="marginL2 pull-left"><input type="number" id="amount-2" value="25" step="1" style="width:60px;" ></div>&nbsp;
291   - <div class="pull-left" style="width:45%; margin-left:2%;">
292   - <div id="slider-range-min-2"></div>
293   - </div>
294   - <div class="clearfix"></div>
295   - </div>
296   -
297   -
298   - </div>
299   -
300   -
301   - </div>
302   -
303   - </div>
304   - </div>
305   - </div>
306   -
307   - </div>
308   - </div>
309   -</div>
310 131  
311   -<script src="js/jquery-1.11.3.min.js"></script>
312   -<script src="js/bootstrap.js"></script>
313   -<script src="js/custom.js"></script>
314   -<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
315   -<script src="js/jquery.sticky.js"></script>
  132 +<!--<script src="../libs/jquery/1.11.3/jquery.min.js"></script>-->
  133 +<!--<script src="../../themes/default/scripts/bootstrap/3.3.5/bootstrap.js"></script>
  134 +<script src="../../themes/default/scripts/custom/custom.js"></script>
  135 +<script src="../../libs/jquery/jquery.sticky.js"></script>
  136 +<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>-->
  137 +
  138 +<script>
  139 + $(window).load(function () {
  140 + $(".stickey-area").sticky();
  141 + });
  142 +</script>
316 143 <script>
317   -$(window).load(function(){
318   - $(".stickey-area").sticky();
319   -});
  144 + $(function () {
  145 + $("#slider-range-min-2").slider({
  146 + range: "min",
  147 + min: 1,
  148 + max: 60,
  149 + value: 10,
  150 + slide: function (event, ui) {
  151 + $("#amount-2").val(ui.value);
  152 + }
  153 + });
  154 + $("#amount-2").val($("#slider-vertical-2").slider("value"));
  155 +
  156 + });
320 157 </script>
321   - <script>
322   - $(function() {
323   - $( "#slider-range-min-2" ).slider({
324   - range: "min",
325   - min: 1,
326   - max: 60,
327   - value: 10,
328   - slide: function( event, ui ) {
329   - $( "#amount-2" ).val( ui.value );
330   - }
  158 +
  159 +<script>
  160 + $(document).ready(function () {
  161 + $('[data-toggle="tooltip"]').tooltip();
331 162 });
332   - $( "#amount-2" ).val( $( "#slider-vertical-2" ).slider( "value" ) );
333   -
334   - });
335   - </script>
336   -
337   - <script>
338   -$(document).ready(function(){
339   - $('[data-toggle="tooltip"]').tooltip();
340   -});
341 163 </script>
342   -<script src="js/jquery-ui-slider-pips.js"></script>
  164 +
  165 +<script src="../../libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js"></script>
343 166 <script>
344   - $(".slider")
345   -
346   - .slider({
347   - min: 25,
  167 + $(".slider")
  168 +
  169 + .slider({
  170 + min: 25,
348 171 max: 100,
349   - value: 100,
350   - range: "min",
  172 + value: 100,
  173 + range: "min",
351 174 orientation: "vertical"
352 175 })
353   -
  176 +
354 177 .slider("pips", {
355 178 rest: "label",
356 179 step: "15"
... ... @@ -358,11 +181,8 @@ $(document).ready(function(){
358 181 </script>
359 182  
360 183 <script>
361   - $(function() {
362   - $( "#draggable" ).draggable();
363   - });
364   - </script>
365   -
  184 + $(function () {
  185 + $("#draggable").draggable();
  186 + });
  187 +</script>
366 188  
367   -</body>
368   -</html>
369 189 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html
... ... @@ -59,7 +59,7 @@
59 59 <!--<div role="tabpanel" class="tab-pane active" id="grid-view">-->
60 60 <div role="tabpanel" id="grid-view">
61 61 <div ng-repeat="(key,val) in moduleLandingData.data.root.Item">
62   - <div id="{{val._Id}}" class="col-sm-3 col-md-3" title="{{val._Title}}" data-ng-click="openModuleItem($event)">
  62 + <div id="{{val._Id}}" class="col-sm-3 col-md-3" title="{{val._Title}}" ng-click="openModuleItem($event)">
63 63 <div class="thumbnail">
64 64 <img class="tinyImg" id="{{val._Title}}" ng-src="../content/images/aa/thumbnails/{{val._TileImageName}}" alt="" title="">
65 65 <div class="caption"><p>{{val._Title}}</p></div>
... ...
400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/all-pin.png 0 → 100644

1.02 KB

400-SOURCECODE/AIAHTML5.Web/content/images/aa/LeftMenu/hide-pin.png 0 → 100644

1.24 KB

400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery.sticky.js 0 → 100644
  1 +// Sticky Plugin v1.0.3 for jQuery
  2 +// =============
  3 +// Author: Anthony Garand
  4 +// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
  5 +// Improvements by Leonardo C. Daronco (daronco)
  6 +// Created: 02/14/2011
  7 +// Date: 07/20/2015
  8 +// Website: http://stickyjs.com/
  9 +// Description: Makes an element on the page stick on the screen as you scroll
  10 +// It will only set the 'top' and 'position' of your element, you
  11 +// might need to adjust the width in some cases.
  12 +
  13 +(function (factory) {
  14 + if (typeof define === 'function' && define.amd) {
  15 + // AMD. Register as an anonymous module.
  16 + define(['jquery'], factory);
  17 + } else if (typeof module === 'object' && module.exports) {
  18 + // Node/CommonJS
  19 + module.exports = factory(require('jquery'));
  20 + } else {
  21 + // Browser globals
  22 + factory(jQuery);
  23 + }
  24 +}(function ($) {
  25 + var slice = Array.prototype.slice; // save ref to original slice()
  26 + var splice = Array.prototype.splice; // save ref to original slice()
  27 +
  28 + var defaults = {
  29 + topSpacing: 0,
  30 + bottomSpacing: 0,
  31 + className: 'is-sticky',
  32 + wrapperClassName: 'sticky-wrapper',
  33 + center: false,
  34 + getWidthFrom: '',
  35 + widthFromWrapper: true, // works only when .getWidthFrom is empty
  36 + responsiveWidth: false
  37 + },
  38 + $window = $(window),
  39 + $document = $(document),
  40 + sticked = [],
  41 + windowHeight = $window.height(),
  42 + scroller = function() {
  43 + var scrollTop = $window.scrollTop(),
  44 + documentHeight = $document.height(),
  45 + dwh = documentHeight - windowHeight,
  46 + extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
  47 +
  48 + for (var i = 0, l = sticked.length; i < l; i++) {
  49 + var s = sticked[i],
  50 + elementTop = s.stickyWrapper.offset().top,
  51 + etse = elementTop - s.topSpacing - extra;
  52 +
  53 + //update height in case of dynamic content
  54 + s.stickyWrapper.css('height', s.stickyElement.outerHeight());
  55 +
  56 + if (scrollTop <= etse) {
  57 + if (s.currentTop !== null) {
  58 + s.stickyElement
  59 + .css({
  60 + 'width': '',
  61 + 'position': '',
  62 + 'top': ''
  63 + });
  64 + s.stickyElement.parent().removeClass(s.className);
  65 + s.stickyElement.trigger('sticky-end', [s]);
  66 + s.currentTop = null;
  67 + }
  68 + }
  69 + else {
  70 + var newTop = documentHeight - s.stickyElement.outerHeight()
  71 + - s.topSpacing - s.bottomSpacing - scrollTop - extra;
  72 + if (newTop < 0) {
  73 + newTop = newTop + s.topSpacing;
  74 + } else {
  75 + newTop = s.topSpacing;
  76 + }
  77 + if (s.currentTop !== newTop) {
  78 + var newWidth;
  79 + if (s.getWidthFrom) {
  80 + newWidth = $(s.getWidthFrom).width() || null;
  81 + } else if (s.widthFromWrapper) {
  82 + newWidth = s.stickyWrapper.width();
  83 + }
  84 + if (newWidth == null) {
  85 + newWidth = s.stickyElement.width();
  86 + }
  87 + s.stickyElement
  88 + .css('width', newWidth)
  89 + .css('position', 'fixed')
  90 + .css('z-index', '')
  91 + .css('top', 0);
  92 +
  93 + s.stickyElement.parent().addClass(s.className);
  94 +
  95 + if (s.currentTop === null) {
  96 + s.stickyElement.trigger('sticky-start', [s]);
  97 + } else {
  98 + // sticky is started but it have to be repositioned
  99 + s.stickyElement.trigger('sticky-update', [s]);
  100 + }
  101 +
  102 + if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) {
  103 + // just reached bottom || just started to stick but bottom is already reached
  104 + s.stickyElement.trigger('sticky-bottom-reached', [s]);
  105 + } else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) {
  106 + // sticky is started && sticked at topSpacing && overflowing from top just finished
  107 + s.stickyElement.trigger('sticky-bottom-unreached', [s]);
  108 + }
  109 +
  110 + s.currentTop = newTop;
  111 + }
  112 +
  113 + // Check if sticky has reached end of container and stop sticking
  114 + var stickyWrapperContainer = s.stickyWrapper.parent();
  115 + var unstick = (s.stickyElement.offset().top + s.stickyElement.outerHeight() >= stickyWrapperContainer.offset().top + stickyWrapperContainer.outerHeight()) && (s.stickyElement.offset().top <= s.topSpacing);
  116 +
  117 + if( unstick ) {
  118 + s.stickyElement
  119 + .css('position', 'absolute')
  120 + .css('top', '')
  121 + .css('bottom', 0);
  122 + } else {
  123 + s.stickyElement
  124 + .css('position', 'fixed')
  125 + .css('top', 89)
  126 + .css('z-index', '999')
  127 + .css('bottom', '');
  128 + }
  129 + }
  130 + }
  131 + },
  132 + resizer = function() {
  133 + windowHeight = $window.height();
  134 +
  135 + for (var i = 0, l = sticked.length; i < l; i++) {
  136 + var s = sticked[i];
  137 + var newWidth = null;
  138 + if (s.getWidthFrom) {
  139 + if (s.responsiveWidth) {
  140 + newWidth = $(s.getWidthFrom).width();
  141 + }
  142 + } else if(s.widthFromWrapper) {
  143 + newWidth = s.stickyWrapper.width();
  144 + }
  145 + if (newWidth != null) {
  146 + s.stickyElement.css('width', newWidth);
  147 + }
  148 + }
  149 + },
  150 + methods = {
  151 + init: function(options) {
  152 + var o = $.extend({}, defaults, options);
  153 + return this.each(function() {
  154 + var stickyElement = $(this);
  155 +
  156 + var stickyId = stickyElement.attr('id');
  157 + var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName;
  158 + var wrapper = $('<div></div>')
  159 + .attr('id', wrapperId)
  160 + .addClass(o.wrapperClassName);
  161 +
  162 + stickyElement.wrapAll(wrapper);
  163 +
  164 + var stickyWrapper = stickyElement.parent();
  165 +
  166 + if (o.center) {
  167 + stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
  168 + }
  169 +
  170 + if (stickyElement.css("float") === "right") {
  171 + stickyElement.css({"float":"none"}).parent().css({"float":"right"});
  172 + }
  173 +
  174 + o.stickyElement = stickyElement;
  175 + o.stickyWrapper = stickyWrapper;
  176 + o.currentTop = null;
  177 +
  178 + sticked.push(o);
  179 +
  180 + methods.setWrapperHeight(this);
  181 + methods.setupChangeListeners(this);
  182 + });
  183 + },
  184 +
  185 + setWrapperHeight: function(stickyElement) {
  186 + var element = $(stickyElement);
  187 + var stickyWrapper = element.parent();
  188 + if (stickyWrapper) {
  189 + stickyWrapper.css('height', element.outerHeight());
  190 + }
  191 + },
  192 +
  193 + setupChangeListeners: function(stickyElement) {
  194 + if (window.MutationObserver) {
  195 + var mutationObserver = new window.MutationObserver(function(mutations) {
  196 + if (mutations[0].addedNodes.length || mutations[0].removedNodes.length) {
  197 + methods.setWrapperHeight(stickyElement);
  198 + }
  199 + });
  200 + mutationObserver.observe(stickyElement, {subtree: true, childList: true});
  201 + } else {
  202 + stickyElement.addEventListener('DOMNodeInserted', function() {
  203 + methods.setWrapperHeight(stickyElement);
  204 + }, false);
  205 + stickyElement.addEventListener('DOMNodeRemoved', function() {
  206 + methods.setWrapperHeight(stickyElement);
  207 + }, false);
  208 + }
  209 + },
  210 + update: scroller,
  211 + unstick: function(options) {
  212 + return this.each(function() {
  213 + var that = this;
  214 + var unstickyElement = $(that);
  215 +
  216 + var removeIdx = -1;
  217 + var i = sticked.length;
  218 + while (i-- > 0) {
  219 + if (sticked[i].stickyElement.get(0) === that) {
  220 + splice.call(sticked,i,1);
  221 + removeIdx = i;
  222 + }
  223 + }
  224 + if(removeIdx !== -1) {
  225 + unstickyElement.unwrap();
  226 + unstickyElement
  227 + .css({
  228 + 'width': '',
  229 + 'position': '',
  230 + 'top': '',
  231 + 'float': ''
  232 + })
  233 + ;
  234 + }
  235 + });
  236 + }
  237 + };
  238 +
  239 + // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
  240 + if (window.addEventListener) {
  241 + window.addEventListener('scroll', scroller, false);
  242 + window.addEventListener('resize', resizer, false);
  243 + } else if (window.attachEvent) {
  244 + window.attachEvent('onscroll', scroller);
  245 + window.attachEvent('onresize', resizer);
  246 + }
  247 +
  248 + $.fn.sticky = function(method) {
  249 + if (methods[method]) {
  250 + return methods[method].apply(this, slice.call(arguments, 1));
  251 + } else if (typeof method === 'object' || !method ) {
  252 + return methods.init.apply( this, arguments );
  253 + } else {
  254 + $.error('Method ' + method + ' does not exist on jQuery.sticky');
  255 + }
  256 + };
  257 +
  258 + $.fn.unstick = function(method) {
  259 + if (methods[method]) {
  260 + return methods[method].apply(this, slice.call(arguments, 1));
  261 + } else if (typeof method === 'object' || !method ) {
  262 + return methods.unstick.apply( this, arguments );
  263 + } else {
  264 + $.error('Method ' + method + ' does not exist on jQuery.sticky');
  265 + }
  266 + };
  267 + $(function() {
  268 + setTimeout(scroller, 0);
  269 + });
  270 +}));
... ...
400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js
1   -/*! jQuery-ui-Slider-Pips - v1.11.1 - 2015-11-30
2   -* Copyright (c) 2015 Simon Goellner <simey.me@gmail.com>; Licensed MIT */
3   -
4   -
5   -
6   -(function($) {
7   -
8   - "use strict";
9   -
10   - var extensionMethods = {
11   -
12   -
13   -
14   -
15   -
16   - // pips
17   -
18   - pips: function( settings ) {
19   -
20   - var slider = this,
21   - i, j, p,
22   - collection = "",
23   - mousedownHandlers,
24   - min = slider._valueMin(),
25   - max = slider._valueMax(),
26   - pips = ( max - min ) / slider.options.step,
27   - $handles = slider.element.find(".ui-slider-handle"),
28   - $pips;
29   -
30   - var options = {
31   -
32   - first: "label",
33   - /* "label", "pip", false */
34   -
35   - last: "label",
36   - /* "label", "pip", false */
37   -
38   - rest: "pip",
39   - /* "label", "pip", false */
40   -
41   - labels: false,
42   - /* [array], { first: "string", rest: [array], last: "string" }, false */
43   -
44   - prefix: "",
45   - /* "", string */
46   -
47   - suffix: "",
48   - /* "", string */
49   -
50   - step: ( pips > 100 ) ? Math.floor( pips * 0.05 ) : 1,
51   - /* number */
52   -
53   - formatLabel: function(value) {
54   - return this.prefix + value + this.suffix;
55   - }
56   - /* function
57   - must return a value to display in the pip labels */
58   -
59   - };
60   -
61   - if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
62   -
63   - $.extend( options, settings );
64   - slider.element.data("pips-options", options );
65   -
66   - } else {
67   -
68   - if ( settings === "destroy" ) {
69   -
70   - destroy();
71   -
72   - } else if ( settings === "refresh" ) {
73   -
74   - slider.element.slider( "pips", slider.element.data("pips-options") );
75   -
76   - }
77   -
78   - return;
79   -
80   - }
81   -
82   -
83   - // we don't want the step ever to be a floating point.
84   - slider.options.pipStep = Math.round( options.step );
85   -
86   - // get rid of all pips that might already exist.
87   - slider.element
88   - .off( ".selectPip" )
89   - .addClass("ui-slider-pips")
90   - .find(".ui-slider-pip")
91   - .remove();
92   -
93   - // small object with functions for marking pips as selected.
94   -
95   - var selectPip = {
96   -
97   - single: function(value) {
98   -
99   - this.resetClasses();
100   -
101   - $pips
102   - .filter(".ui-slider-pip-" + this.classLabel(value) )
103   - .addClass("ui-slider-pip-selected");
104   -
105   - if ( slider.options.range ) {
106   -
107   - $pips.each(function(k, v) {
108   -
109   - var pipVal = $(v).children(".ui-slider-label").data("value");
110   -
111   - if (( slider.options.range === "min" && pipVal < value ) ||
112   - ( slider.options.range === "max" && pipVal > value )) {
113   -
114   - $(v).addClass("ui-slider-pip-inrange");
115   -
116   - }
117   -
118   - });
119   -
120   - }
121   -
122   - },
123   -
124   - range: function(values) {
125   -
126   - this.resetClasses();
127   -
128   - for ( i = 0; i < values.length; i++ ) {
129   -
130   - $pips
131   - .filter(".ui-slider-pip-" + this.classLabel(values[i]) )
132   - .addClass("ui-slider-pip-selected-" + ( i + 1 ) );
133   -
134   - }
135   -
136   - if ( slider.options.range ) {
137   -
138   - $pips.each(function(k, v) {
139   -
140   - var pipVal = $(v).children(".ui-slider-label").data("value");
141   -
142   - if ( pipVal > values[0] && pipVal < values[1] ) {
143   -
144   - $(v).addClass("ui-slider-pip-inrange");
145   -
146   - }
147   -
148   - });
149   -
150   - }
151   -
152   - },
153   -
154   - classLabel: function(value) {
155   -
156   - return value.toString().replace(".", "-");
157   -
158   - },
159   -
160   - resetClasses: function() {
161   -
162   - var regex = /(^|\s*)(ui-slider-pip-selected|ui-slider-pip-inrange)(-{1,2}\d+|\s|$)/gi;
163   -
164   - $pips.removeClass( function(index, css) {
165   - return ( css.match(regex) || [] ).join(" ");
166   - });
167   -
168   - }
169   -
170   - };
171   -
172   - function getClosestHandle( val ) {
173   -
174   - var h, k,
175   - sliderVals,
176   - comparedVals,
177   - closestVal,
178   - tempHandles = [],
179   - closestHandle = 0;
180   -
181   - if ( slider.values() && slider.values().length ) {
182   -
183   - // get the current values of the slider handles
184   - sliderVals = slider.values();
185   -
186   - // find the offset value from the `val` for each
187   - // handle, and store it in a new array
188   - comparedVals = $.map( sliderVals, function(v) {
189   - return Math.abs( v - val );
190   - });
191   -
192   - // figure out the closest handles to the value
193   - closestVal = Math.min.apply( Math, comparedVals );
194   -
195   - // if a comparedVal is the closestVal, then
196   - // set the value accordingly, and set the closest handle.
197   - for ( h = 0; h < comparedVals.length; h++ ) {
198   - if ( comparedVals[h] === closestVal ) {
199   - tempHandles.push(h);
200   - }
201   - }
202   -
203   - // set the closest handle to the first handle in array,
204   - // just incase we have no _lastChangedValue to compare to.
205   - closestHandle = tempHandles[0];
206   -
207   - // now we want to find out if any of the closest handles were
208   - // the last changed handle, if so we specify that handle to change
209   - for ( k = 0; k < tempHandles.length; k++ ) {
210   - if ( slider._lastChangedValue === tempHandles[k] ) {
211   - closestHandle = tempHandles[k];
212   - }
213   - }
214   -
215   - if ( slider.options.range && tempHandles.length === 2 ) {
216   -
217   - if ( val > sliderVals[1] ) {
218   -
219   - closestHandle = tempHandles[1];
220   -
221   - } else if ( val < sliderVals[0] ) {
222   -
223   - closestHandle = tempHandles[0];
224   -
225   - }
226   -
227   - }
228   -
229   - }
230   -
231   - return closestHandle;
232   -
233   - }
234   -
235   - function destroy() {
236   -
237   - slider.element
238   - .off(".selectPip")
239   - .on("mousedown.slider", slider.element.data("mousedown-original") )
240   - .removeClass("ui-slider-pips")
241   - .find(".ui-slider-pip")
242   - .remove();
243   -
244   - }
245   -
246   - // when we click on a label, we want to make sure the
247   - // slider's handle actually goes to that label!
248   - // so we check all the handles and see which one is closest
249   - // to the label we clicked. If 2 handles are equidistant then
250   - // we move both of them. We also want to trigger focus on the
251   - // handle.
252   -
253   - // without this method the label is just treated like a part
254   - // of the slider and there's no accuracy in the selected value
255   -
256   - function labelClick( label, e ) {
257   -
258   - if (slider.option("disabled")) {
259   - return;
260   - }
261   -
262   - var val = $(label).data("value"),
263   - indexToChange = getClosestHandle( val );
264   -
265   - if ( slider.values() && slider.values().length ) {
266   -
267   - slider.options.values[ indexToChange ] = slider._trimAlignValue( val );
268   -
269   - } else {
270   -
271   - slider.options.value = slider._trimAlignValue( val );
272   -
273   - }
274   -
275   - slider._refreshValue();
276   - slider._change( e, indexToChange );
277   -
278   - }
279   -
280   - // method for creating a pip. We loop this for creating all
281   - // the pips.
282   -
283   - function createPip( which ) {
284   -
285   - var label,
286   - percent,
287   - number = which,
288   - classes = "ui-slider-pip",
289   - css = "",
290   - value = slider.value(),
291   - values = slider.values();
292   -
293   - if ( which === "first" ) {
294   -
295   - number = 0;
296   -
297   - } else if ( which === "last" ) {
298   -
299   - number = pips;
300   -
301   - }
302   -
303   - // labelValue is the actual value of the pip based on the min/step
304   - var labelValue = min + ( slider.options.step * number );
305   -
306   - // classLabel replaces any decimals with hyphens
307   - var classLabel = labelValue.toString().replace(".","-");
308   -
309   - // we need to set the human-readable label to either the
310   - // corresponding element in the array, or the appropriate
311   - // item in the object... or an empty string.
312   -
313   - if ( $.type(options.labels) === "array" ) {
314   -
315   - label = options.labels[number] || "";
316   -
317   - } else if ( $.type( options.labels ) === "object" ) {
318   -
319   - if ( which === "first" ) {
320   -
321   - // set first label
322   - label = options.labels.first || "";
323   -
324   - } else if ( which === "last" ) {
325   -
326   - // set last label
327   - label = options.labels.last || "";
328   -
329   - } else if ( $.type( options.labels.rest ) === "array" ) {
330   -
331   - // set other labels, but our index should start at -1
332   - // because of the first pip.
333   -
334   - label = options.labels.rest[ number - 1 ] || "";
335   -
336   - } else {
337   -
338   - // urrggh, the options must be f**ked, just show nothing.
339   - label = labelValue;
340   -
341   - }
342   -
343   - } else {
344   -
345   - label = labelValue;
346   -
347   - }
348   -
349   -
350   -
351   -
352   - if ( which === "first" ) {
353   -
354   - // first Pip on the Slider
355   - percent = "0%";
356   -
357   - classes += " ui-slider-pip-first";
358   - classes += ( options.first === "label" ) ? " ui-slider-pip-label" : "";
359   - classes += ( options.first === false ) ? " ui-slider-pip-hide" : "";
360   -
361   - } else if ( which === "last" ) {
362   -
363   - // last Pip on the Slider
364   - percent = "100%";
365   -
366   - classes += " ui-slider-pip-last";
367   - classes += ( options.last === "label" ) ? " ui-slider-pip-label" : "";
368   - classes += ( options.last === false ) ? " ui-slider-pip-hide" : "";
369   -
370   - } else {
371   -
372   - // all other Pips
373   - percent = (( 100 / pips ) * which ).toFixed(4) + "%";
374   -
375   - classes += ( options.rest === "label" ) ? " ui-slider-pip-label" : "";
376   - classes += ( options.rest === false ) ? " ui-slider-pip-hide" : "";
377   -
378   - }
379   -
380   - classes += " ui-slider-pip-" + classLabel;
381   -
382   -
383   - // add classes for the initial-selected values.
384   - if ( values && values.length ) {
385   -
386   - for ( i = 0; i < values.length; i++ ) {
387   -
388   - if ( labelValue === values[i] ) {
389   -
390   - classes += " ui-slider-pip-initial-" + ( i + 1 );
391   - classes += " ui-slider-pip-selected-" + ( i + 1 );
392   -
393   - }
394   -
395   - }
396   -
397   - if ( slider.options.range ) {
398   -
399   - if ( labelValue > values[0] &&
400   - labelValue < values[1] ) {
401   -
402   - classes += " ui-slider-pip-inrange";
403   -
404   - }
405   -
406   - }
407   -
408   - } else {
409   -
410   - if ( labelValue === value ) {
411   -
412   - classes += " ui-slider-pip-initial";
413   - classes += " ui-slider-pip-selected";
414   -
415   - }
416   -
417   - if ( slider.options.range ) {
418   -
419   - if (( slider.options.range === "min" && labelValue < value ) ||
420   - ( slider.options.range === "max" && labelValue > value )) {
421   -
422   - classes += " ui-slider-pip-inrange";
423   -
424   - }
425   -
426   - }
427   -
428   - }
429   -
430   -
431   -
432   - css = ( slider.options.orientation === "horizontal" ) ?
433   - "left: " + percent :
434   - "bottom: " + percent;
435   -
436   -
437   - // add this current pip to the collection
438   - return "<span class=\"" + classes + "\" style=\"" + css + "\">" +
439   - "<span class=\"ui-slider-line\"></span>" +
440   - "<span class=\"ui-slider-label\" data-value=\"" +
441   - labelValue + "\">" + options.formatLabel(label) + "</span>" +
442   - "</span>";
443   -
444   - }
445   -
446   - // create our first pip
447   - collection += createPip("first");
448   -
449   - // for every stop in the slider; we create a pip.
450   - for ( p = 1; p < pips; p++ ) {
451   - if ( p % slider.options.pipStep === 0 ) {
452   - collection += createPip( p );
453   - }
454   - }
455   -
456   - // create our last pip
457   - collection += createPip("last");
458   -
459   - // append the collection of pips.
460   - slider.element.append( collection );
461   -
462   - // store the pips for setting classes later.
463   - $pips = slider.element.find(".ui-slider-pip");
464   -
465   -
466   -
467   - // store the mousedown handlers for later, just in case we reset
468   - // the slider, the handler would be lost!
469   -
470   - if ( $._data( slider.element.get(0), "events").mousedown &&
471   - $._data( slider.element.get(0), "events").mousedown.length ) {
472   -
473   - mousedownHandlers = $._data( slider.element.get(0), "events").mousedown;
474   -
475   - } else {
476   -
477   - mousedownHandlers = slider.element.data("mousedown-handlers");
478   -
479   - }
480   -
481   - slider.element.data("mousedown-handlers", mousedownHandlers.slice() );
482   -
483   - // loop through all the mousedown handlers on the slider,
484   - // and store the original namespaced (.slider) event handler so
485   - // we can trigger it later.
486   - for ( j = 0; j < mousedownHandlers.length; j++ ) {
487   - if ( mousedownHandlers[j].namespace === "slider" ) {
488   - slider.element.data("mousedown-original", mousedownHandlers[j].handler );
489   - }
490   - }
491   -
492   - // unbind the mousedown.slider event, because it interferes with
493   - // the labelClick() method (stops smooth animation), and decide
494   - // if we want to trigger the original event based on which element
495   - // was clicked.
496   - slider.element
497   - .off("mousedown.slider")
498   - .on("mousedown.selectPip", function(e) {
499   -
500   - var $target = $(e.target),
501   - closest = getClosestHandle( $target.data("value") ),
502   - $handle = $handles.eq( closest );
503   -
504   - $handle.addClass("ui-state-active");
505   -
506   - if ( $target.is(".ui-slider-label") ) {
507   -
508   - labelClick( $target, e );
509   -
510   - slider.element
511   - .one("mouseup.selectPip", function() {
512   -
513   - $handle
514   - .removeClass("ui-state-active")
515   - .focus();
516   -
517   - });
518   -
519   - } else {
520   -
521   - var originalMousedown = slider.element.data("mousedown-original");
522   - originalMousedown(e);
523   -
524   - }
525   -
526   - });
527   -
528   -
529   -
530   -
531   - slider.element.on( "slide.selectPip slidechange.selectPip", function(e, ui) {
532   -
533   - var $slider = $(this),
534   - value = $slider.slider("value"),
535   - values = $slider.slider("values");
536   -
537   - if ( ui ) {
538   -
539   - value = ui.value;
540   - values = ui.values;
541   -
542   - }
543   -
544   - if ( slider.values() && slider.values().length ) {
545   -
546   - selectPip.range( values );
547   -
548   - } else {
549   -
550   - selectPip.single( value );
551   -
552   - }
553   -
554   - });
555   -
556   -
557   -
558   -
559   - },
560   -
561   -
562   -
563   -
564   -
565   -
566   -
567   -
568   - // floats
569   -
570   - float: function( settings ) {
571   -
572   - var i,
573   - slider = this,
574   - min = slider._valueMin(),
575   - max = slider._valueMax(),
576   - value = slider._value(),
577   - values = slider._values(),
578   - tipValues = [],
579   - $handles = slider.element.find(".ui-slider-handle");
580   -
581   - var options = {
582   -
583   - handle: true,
584   - /* false */
585   -
586   - pips: false,
587   - /* true */
588   -
589   - labels: false,
590   - /* [array], { first: "string", rest: [array], last: "string" }, false */
591   -
592   - prefix: "",
593   - /* "", string */
594   -
595   - suffix: "",
596   - /* "", string */
597   -
598   - event: "slidechange slide",
599   - /* "slidechange", "slide", "slidechange slide" */
600   -
601   - formatLabel: function(value) {
602   - return this.prefix + value + this.suffix;
603   - }
604   - /* function
605   - must return a value to display in the floats */
606   -
607   - };
608   -
609   - if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
610   -
611   - $.extend( options, settings );
612   - slider.element.data("float-options", options );
613   -
614   - } else {
615   -
616   - if ( settings === "destroy" ) {
617   -
618   - destroy();
619   -
620   - } else if ( settings === "refresh" ) {
621   -
622   - slider.element.slider( "float", slider.element.data("float-options") );
623   -
624   - }
625   -
626   - return;
627   -
628   - }
629   -
630   -
631   -
632   -
633   - if ( value < min ) {
634   - value = min;
635   - }
636   -
637   - if ( value > max ) {
638   - value = max;
639   - }
640   -
641   - if ( values && values.length ) {
642   -
643   - for ( i = 0; i < values.length; i++ ) {
644   -
645   - if ( values[i] < min ) {
646   - values[i] = min;
647   - }
648   -
649   - if ( values[i] > max ) {
650   - values[i] = max;
651   - }
652   -
653   - }
654   -
655   - }
656   -
657   - // add a class for the CSS
658   - slider.element
659   - .addClass("ui-slider-float")
660   - .find(".ui-slider-tip, .ui-slider-tip-label")
661   - .remove();
662   -
663   -
664   -
665   - function destroy() {
666   -
667   - slider.element
668   - .off(".sliderFloat")
669   - .removeClass("ui-slider-float")
670   - .find(".ui-slider-tip, .ui-slider-tip-label")
671   - .remove();
672   -
673   - }
674   -
675   -
676   - function getPipLabels( values ) {
677   -
678   - // when checking the array we need to divide
679   - // by the step option, so we store those values here.
680   -
681   - var vals = [],
682   - steppedVals = $.map( values, function(v) {
683   - return Math.ceil(( v - min ) / slider.options.step);
684   - });
685   -
686   - // now we just get the values we need to return
687   - // by looping through the values array and assigning the
688   - // label if it exists.
689   -
690   - if ( $.type( options.labels ) === "array" ) {
691   -
692   - for ( i = 0; i < values.length; i++ ) {
693   -
694   - vals[i] = options.labels[ steppedVals[i] ] || values[i];
695   -
696   - }
697   -
698   - } else if ( $.type( options.labels ) === "object" ) {
699   -
700   - for ( i = 0; i < values.length; i++ ) {
701   -
702   - if ( values[i] === min ) {
703   -
704   - vals[i] = options.labels.first || min;
705   -
706   - } else if ( values[i] === max ) {
707   -
708   - vals[i] = options.labels.last || max;
709   -
710   - } else if ( $.type( options.labels.rest ) === "array" ) {
711   -
712   - vals[i] = options.labels.rest[ steppedVals[i] - 1 ] || values[i];
713   -
714   - } else {
715   -
716   - vals[i] = values[i];
717   -
718   - }
719   -
720   - }
721   -
722   - } else {
723   -
724   - for ( i = 0; i < values.length; i++ ) {
725   -
726   - vals[i] = values[i];
727   -
728   - }
729   -
730   - }
731   -
732   - return vals;
733   -
734   - }
735   -
736   - // apply handle tip if settings allows.
737   - if ( options.handle ) {
738   -
739   - // we need to set the human-readable label to either the
740   - // corresponding element in the array, or the appropriate
741   - // item in the object... or an empty string.
742   -
743   - tipValues = ( slider.values() && slider.values().length ) ?
744   - getPipLabels( values ) :
745   - getPipLabels( [ value ] );
746   -
747   - for ( i = 0; i < tipValues.length; i++ ) {
748   -
749   - $handles
750   - .eq( i )
751   - .append( $("<span class=\"ui-slider-tip\">"+ options.formatLabel(tipValues[i]) +"</span>") );
752   -
753   - }
754   -
755   - }
756   -
757   - if ( options.pips ) {
758   -
759   - // if this slider also has pip-labels, we make those into tips, too.
760   - slider.element.find(".ui-slider-label").each(function(k, v) {
761   -
762   - var $this = $(v),
763   - val = [ $this.data("value") ],
764   - label,
765   - $tip;
766   -
767   -
768   - label = options.formatLabel( getPipLabels( val )[0] );
769   -
770   - // create a tip element
771   - $tip =
772   - $("<span class=\"ui-slider-tip-label\">" + label + "</span>")
773   - .insertAfter( $this );
774   -
775   - });
776   -
777   - }
778   -
779   - // check that the event option is actually valid against our
780   - // own list of the slider's events.
781   - if ( options.event !== "slide" &&
782   - options.event !== "slidechange" &&
783   - options.event !== "slide slidechange" &&
784   - options.event !== "slidechange slide" ) {
785   -
786   - options.event = "slidechange slide";
787   -
788   - }
789   -
790   - // when slider changes, update handle tip label.
791   - slider.element
792   - .off(".sliderFloat")
793   - .on( options.event + ".sliderFloat", function( e, ui ) {
794   -
795   - var uiValue = ( $.type( ui.value ) === "array" ) ? ui.value : [ ui.value ],
796   - val = options.formatLabel( getPipLabels( uiValue )[0] );
797   -
798   - $(ui.handle)
799   - .find(".ui-slider-tip")
800   - .html( val );
801   -
802   - });
803   -
804   - }
805   -
806   - };
807   -
808   - $.extend(true, $.ui.slider.prototype, extensionMethods);
809   -
810   -})(jQuery);
  1 +/*! jQuery-ui-Slider-Pips - v1.11.1 - 2015-11-30
  2 +* Copyright (c) 2015 Simon Goellner <simey.me@gmail.com>; Licensed MIT */
  3 +
  4 +
  5 +
  6 +(function($) {
  7 +
  8 + "use strict";
  9 +
  10 + var extensionMethods = {
  11 +
  12 +
  13 +
  14 +
  15 +
  16 + // pips
  17 +
  18 + pips: function( settings ) {
  19 +
  20 + var slider = this,
  21 + i, j, p,
  22 + collection = "",
  23 + mousedownHandlers,
  24 + min = slider._valueMin(),
  25 + max = slider._valueMax(),
  26 + pips = ( max - min ) / slider.options.step,
  27 + $handles = slider.element.find(".ui-slider-handle"),
  28 + $pips;
  29 +
  30 + var options = {
  31 +
  32 + first: "label",
  33 + /* "label", "pip", false */
  34 +
  35 + last: "label",
  36 + /* "label", "pip", false */
  37 +
  38 + rest: "pip",
  39 + /* "label", "pip", false */
  40 +
  41 + labels: false,
  42 + /* [array], { first: "string", rest: [array], last: "string" }, false */
  43 +
  44 + prefix: "",
  45 + /* "", string */
  46 +
  47 + suffix: "",
  48 + /* "", string */
  49 +
  50 + step: ( pips > 100 ) ? Math.floor( pips * 0.05 ) : 1,
  51 + /* number */
  52 +
  53 + formatLabel: function(value) {
  54 + return this.prefix + value + this.suffix;
  55 + }
  56 + /* function
  57 + must return a value to display in the pip labels */
  58 +
  59 + };
  60 +
  61 + if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
  62 +
  63 + $.extend( options, settings );
  64 + slider.element.data("pips-options", options );
  65 +
  66 + } else {
  67 +
  68 + if ( settings === "destroy" ) {
  69 +
  70 + destroy();
  71 +
  72 + } else if ( settings === "refresh" ) {
  73 +
  74 + slider.element.slider( "pips", slider.element.data("pips-options") );
  75 +
  76 + }
  77 +
  78 + return;
  79 +
  80 + }
  81 +
  82 +
  83 + // we don't want the step ever to be a floating point.
  84 + slider.options.pipStep = Math.round( options.step );
  85 +
  86 + // get rid of all pips that might already exist.
  87 + slider.element
  88 + .off( ".selectPip" )
  89 + .addClass("ui-slider-pips")
  90 + .find(".ui-slider-pip")
  91 + .remove();
  92 +
  93 + // small object with functions for marking pips as selected.
  94 +
  95 + var selectPip = {
  96 +
  97 + single: function(value) {
  98 +
  99 + this.resetClasses();
  100 +
  101 + $pips
  102 + .filter(".ui-slider-pip-" + this.classLabel(value) )
  103 + .addClass("ui-slider-pip-selected");
  104 +
  105 + if ( slider.options.range ) {
  106 +
  107 + $pips.each(function(k, v) {
  108 +
  109 + var pipVal = $(v).children(".ui-slider-label").data("value");
  110 +
  111 + if (( slider.options.range === "min" && pipVal < value ) ||
  112 + ( slider.options.range === "max" && pipVal > value )) {
  113 +
  114 + $(v).addClass("ui-slider-pip-inrange");
  115 +
  116 + }
  117 +
  118 + });
  119 +
  120 + }
  121 +
  122 + },
  123 +
  124 + range: function(values) {
  125 +
  126 + this.resetClasses();
  127 +
  128 + for ( i = 0; i < values.length; i++ ) {
  129 +
  130 + $pips
  131 + .filter(".ui-slider-pip-" + this.classLabel(values[i]) )
  132 + .addClass("ui-slider-pip-selected-" + ( i + 1 ) );
  133 +
  134 + }
  135 +
  136 + if ( slider.options.range ) {
  137 +
  138 + $pips.each(function(k, v) {
  139 +
  140 + var pipVal = $(v).children(".ui-slider-label").data("value");
  141 +
  142 + if ( pipVal > values[0] && pipVal < values[1] ) {
  143 +
  144 + $(v).addClass("ui-slider-pip-inrange");
  145 +
  146 + }
  147 +
  148 + });
  149 +
  150 + }
  151 +
  152 + },
  153 +
  154 + classLabel: function(value) {
  155 +
  156 + return value.toString().replace(".", "-");
  157 +
  158 + },
  159 +
  160 + resetClasses: function() {
  161 +
  162 + var regex = /(^|\s*)(ui-slider-pip-selected|ui-slider-pip-inrange)(-{1,2}\d+|\s|$)/gi;
  163 +
  164 + $pips.removeClass( function(index, css) {
  165 + return ( css.match(regex) || [] ).join(" ");
  166 + });
  167 +
  168 + }
  169 +
  170 + };
  171 +
  172 + function getClosestHandle( val ) {
  173 +
  174 + var h, k,
  175 + sliderVals,
  176 + comparedVals,
  177 + closestVal,
  178 + tempHandles = [],
  179 + closestHandle = 0;
  180 +
  181 + if ( slider.values() && slider.values().length ) {
  182 +
  183 + // get the current values of the slider handles
  184 + sliderVals = slider.values();
  185 +
  186 + // find the offset value from the `val` for each
  187 + // handle, and store it in a new array
  188 + comparedVals = $.map( sliderVals, function(v) {
  189 + return Math.abs( v - val );
  190 + });
  191 +
  192 + // figure out the closest handles to the value
  193 + closestVal = Math.min.apply( Math, comparedVals );
  194 +
  195 + // if a comparedVal is the closestVal, then
  196 + // set the value accordingly, and set the closest handle.
  197 + for ( h = 0; h < comparedVals.length; h++ ) {
  198 + if ( comparedVals[h] === closestVal ) {
  199 + tempHandles.push(h);
  200 + }
  201 + }
  202 +
  203 + // set the closest handle to the first handle in array,
  204 + // just incase we have no _lastChangedValue to compare to.
  205 + closestHandle = tempHandles[0];
  206 +
  207 + // now we want to find out if any of the closest handles were
  208 + // the last changed handle, if so we specify that handle to change
  209 + for ( k = 0; k < tempHandles.length; k++ ) {
  210 + if ( slider._lastChangedValue === tempHandles[k] ) {
  211 + closestHandle = tempHandles[k];
  212 + }
  213 + }
  214 +
  215 + if ( slider.options.range && tempHandles.length === 2 ) {
  216 +
  217 + if ( val > sliderVals[1] ) {
  218 +
  219 + closestHandle = tempHandles[1];
  220 +
  221 + } else if ( val < sliderVals[0] ) {
  222 +
  223 + closestHandle = tempHandles[0];
  224 +
  225 + }
  226 +
  227 + }
  228 +
  229 + }
  230 +
  231 + return closestHandle;
  232 +
  233 + }
  234 +
  235 + function destroy() {
  236 +
  237 + slider.element
  238 + .off(".selectPip")
  239 + .on("mousedown.slider", slider.element.data("mousedown-original") )
  240 + .removeClass("ui-slider-pips")
  241 + .find(".ui-slider-pip")
  242 + .remove();
  243 +
  244 + }
  245 +
  246 + // when we click on a label, we want to make sure the
  247 + // slider's handle actually goes to that label!
  248 + // so we check all the handles and see which one is closest
  249 + // to the label we clicked. If 2 handles are equidistant then
  250 + // we move both of them. We also want to trigger focus on the
  251 + // handle.
  252 +
  253 + // without this method the label is just treated like a part
  254 + // of the slider and there's no accuracy in the selected value
  255 +
  256 + function labelClick( label, e ) {
  257 +
  258 + if (slider.option("disabled")) {
  259 + return;
  260 + }
  261 +
  262 + var val = $(label).data("value"),
  263 + indexToChange = getClosestHandle( val );
  264 +
  265 + if ( slider.values() && slider.values().length ) {
  266 +
  267 + slider.options.values[ indexToChange ] = slider._trimAlignValue( val );
  268 +
  269 + } else {
  270 +
  271 + slider.options.value = slider._trimAlignValue( val );
  272 +
  273 + }
  274 +
  275 + slider._refreshValue();
  276 + slider._change( e, indexToChange );
  277 +
  278 + }
  279 +
  280 + // method for creating a pip. We loop this for creating all
  281 + // the pips.
  282 +
  283 + function createPip( which ) {
  284 +
  285 + var label,
  286 + percent,
  287 + number = which,
  288 + classes = "ui-slider-pip",
  289 + css = "",
  290 + value = slider.value(),
  291 + values = slider.values();
  292 +
  293 + if ( which === "first" ) {
  294 +
  295 + number = 0;
  296 +
  297 + } else if ( which === "last" ) {
  298 +
  299 + number = pips;
  300 +
  301 + }
  302 +
  303 + // labelValue is the actual value of the pip based on the min/step
  304 + var labelValue = min + ( slider.options.step * number );
  305 +
  306 + // classLabel replaces any decimals with hyphens
  307 + var classLabel = labelValue.toString().replace(".","-");
  308 +
  309 + // we need to set the human-readable label to either the
  310 + // corresponding element in the array, or the appropriate
  311 + // item in the object... or an empty string.
  312 +
  313 + if ( $.type(options.labels) === "array" ) {
  314 +
  315 + label = options.labels[number] || "";
  316 +
  317 + } else if ( $.type( options.labels ) === "object" ) {
  318 +
  319 + if ( which === "first" ) {
  320 +
  321 + // set first label
  322 + label = options.labels.first || "";
  323 +
  324 + } else if ( which === "last" ) {
  325 +
  326 + // set last label
  327 + label = options.labels.last || "";
  328 +
  329 + } else if ( $.type( options.labels.rest ) === "array" ) {
  330 +
  331 + // set other labels, but our index should start at -1
  332 + // because of the first pip.
  333 +
  334 + label = options.labels.rest[ number - 1 ] || "";
  335 +
  336 + } else {
  337 +
  338 + // urrggh, the options must be f**ked, just show nothing.
  339 + label = labelValue;
  340 +
  341 + }
  342 +
  343 + } else {
  344 +
  345 + label = labelValue;
  346 +
  347 + }
  348 +
  349 +
  350 +
  351 +
  352 + if ( which === "first" ) {
  353 +
  354 + // first Pip on the Slider
  355 + percent = "0%";
  356 +
  357 + classes += " ui-slider-pip-first";
  358 + classes += ( options.first === "label" ) ? " ui-slider-pip-label" : "";
  359 + classes += ( options.first === false ) ? " ui-slider-pip-hide" : "";
  360 +
  361 + } else if ( which === "last" ) {
  362 +
  363 + // last Pip on the Slider
  364 + percent = "100%";
  365 +
  366 + classes += " ui-slider-pip-last";
  367 + classes += ( options.last === "label" ) ? " ui-slider-pip-label" : "";
  368 + classes += ( options.last === false ) ? " ui-slider-pip-hide" : "";
  369 +
  370 + } else {
  371 +
  372 + // all other Pips
  373 + percent = (( 100 / pips ) * which ).toFixed(4) + "%";
  374 +
  375 + classes += ( options.rest === "label" ) ? " ui-slider-pip-label" : "";
  376 + classes += ( options.rest === false ) ? " ui-slider-pip-hide" : "";
  377 +
  378 + }
  379 +
  380 + classes += " ui-slider-pip-" + classLabel;
  381 +
  382 +
  383 + // add classes for the initial-selected values.
  384 + if ( values && values.length ) {
  385 +
  386 + for ( i = 0; i < values.length; i++ ) {
  387 +
  388 + if ( labelValue === values[i] ) {
  389 +
  390 + classes += " ui-slider-pip-initial-" + ( i + 1 );
  391 + classes += " ui-slider-pip-selected-" + ( i + 1 );
  392 +
  393 + }
  394 +
  395 + }
  396 +
  397 + if ( slider.options.range ) {
  398 +
  399 + if ( labelValue > values[0] &&
  400 + labelValue < values[1] ) {
  401 +
  402 + classes += " ui-slider-pip-inrange";
  403 +
  404 + }
  405 +
  406 + }
  407 +
  408 + } else {
  409 +
  410 + if ( labelValue === value ) {
  411 +
  412 + classes += " ui-slider-pip-initial";
  413 + classes += " ui-slider-pip-selected";
  414 +
  415 + }
  416 +
  417 + if ( slider.options.range ) {
  418 +
  419 + if (( slider.options.range === "min" && labelValue < value ) ||
  420 + ( slider.options.range === "max" && labelValue > value )) {
  421 +
  422 + classes += " ui-slider-pip-inrange";
  423 +
  424 + }
  425 +
  426 + }
  427 +
  428 + }
  429 +
  430 +
  431 +
  432 + css = ( slider.options.orientation === "horizontal" ) ?
  433 + "left: " + percent :
  434 + "bottom: " + percent;
  435 +
  436 +
  437 + // add this current pip to the collection
  438 + return "<span class=\"" + classes + "\" style=\"" + css + "\">" +
  439 + "<span class=\"ui-slider-line\"></span>" +
  440 + "<span class=\"ui-slider-label\" data-value=\"" +
  441 + labelValue + "\">" + options.formatLabel(label) + "</span>" +
  442 + "</span>";
  443 +
  444 + }
  445 +
  446 + // create our first pip
  447 + collection += createPip("first");
  448 +
  449 + // for every stop in the slider; we create a pip.
  450 + for ( p = 1; p < pips; p++ ) {
  451 + if ( p % slider.options.pipStep === 0 ) {
  452 + collection += createPip( p );
  453 + }
  454 + }
  455 +
  456 + // create our last pip
  457 + collection += createPip("last");
  458 +
  459 + // append the collection of pips.
  460 + slider.element.append( collection );
  461 +
  462 + // store the pips for setting classes later.
  463 + $pips = slider.element.find(".ui-slider-pip");
  464 +
  465 +
  466 +
  467 + // store the mousedown handlers for later, just in case we reset
  468 + // the slider, the handler would be lost!
  469 +
  470 + if ( $._data( slider.element.get(0), "events").mousedown &&
  471 + $._data( slider.element.get(0), "events").mousedown.length ) {
  472 +
  473 + mousedownHandlers = $._data( slider.element.get(0), "events").mousedown;
  474 +
  475 + } else {
  476 +
  477 + mousedownHandlers = slider.element.data("mousedown-handlers");
  478 +
  479 + }
  480 +
  481 + slider.element.data("mousedown-handlers", mousedownHandlers.slice() );
  482 +
  483 + // loop through all the mousedown handlers on the slider,
  484 + // and store the original namespaced (.slider) event handler so
  485 + // we can trigger it later.
  486 + for ( j = 0; j < mousedownHandlers.length; j++ ) {
  487 + if ( mousedownHandlers[j].namespace === "slider" ) {
  488 + slider.element.data("mousedown-original", mousedownHandlers[j].handler );
  489 + }
  490 + }
  491 +
  492 + // unbind the mousedown.slider event, because it interferes with
  493 + // the labelClick() method (stops smooth animation), and decide
  494 + // if we want to trigger the original event based on which element
  495 + // was clicked.
  496 + slider.element
  497 + .off("mousedown.slider")
  498 + .on("mousedown.selectPip", function(e) {
  499 +
  500 + var $target = $(e.target),
  501 + closest = getClosestHandle( $target.data("value") ),
  502 + $handle = $handles.eq( closest );
  503 +
  504 + $handle.addClass("ui-state-active");
  505 +
  506 + if ( $target.is(".ui-slider-label") ) {
  507 +
  508 + labelClick( $target, e );
  509 +
  510 + slider.element
  511 + .one("mouseup.selectPip", function() {
  512 +
  513 + $handle
  514 + .removeClass("ui-state-active")
  515 + .focus();
  516 +
  517 + });
  518 +
  519 + } else {
  520 +
  521 + var originalMousedown = slider.element.data("mousedown-original");
  522 + originalMousedown(e);
  523 +
  524 + }
  525 +
  526 + });
  527 +
  528 +
  529 +
  530 +
  531 + slider.element.on( "slide.selectPip slidechange.selectPip", function(e, ui) {
  532 +
  533 + var $slider = $(this),
  534 + value = $slider.slider("value"),
  535 + values = $slider.slider("values");
  536 +
  537 + if ( ui ) {
  538 +
  539 + value = ui.value;
  540 + values = ui.values;
  541 +
  542 + }
  543 +
  544 + if ( slider.values() && slider.values().length ) {
  545 +
  546 + selectPip.range( values );
  547 +
  548 + } else {
  549 +
  550 + selectPip.single( value );
  551 +
  552 + }
  553 +
  554 + });
  555 +
  556 +
  557 +
  558 +
  559 + },
  560 +
  561 +
  562 +
  563 +
  564 +
  565 +
  566 +
  567 +
  568 + // floats
  569 +
  570 + float: function( settings ) {
  571 +
  572 + var i,
  573 + slider = this,
  574 + min = slider._valueMin(),
  575 + max = slider._valueMax(),
  576 + value = slider._value(),
  577 + values = slider._values(),
  578 + tipValues = [],
  579 + $handles = slider.element.find(".ui-slider-handle");
  580 +
  581 + var options = {
  582 +
  583 + handle: true,
  584 + /* false */
  585 +
  586 + pips: false,
  587 + /* true */
  588 +
  589 + labels: false,
  590 + /* [array], { first: "string", rest: [array], last: "string" }, false */
  591 +
  592 + prefix: "",
  593 + /* "", string */
  594 +
  595 + suffix: "",
  596 + /* "", string */
  597 +
  598 + event: "slidechange slide",
  599 + /* "slidechange", "slide", "slidechange slide" */
  600 +
  601 + formatLabel: function(value) {
  602 + return this.prefix + value + this.suffix;
  603 + }
  604 + /* function
  605 + must return a value to display in the floats */
  606 +
  607 + };
  608 +
  609 + if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
  610 +
  611 + $.extend( options, settings );
  612 + slider.element.data("float-options", options );
  613 +
  614 + } else {
  615 +
  616 + if ( settings === "destroy" ) {
  617 +
  618 + destroy();
  619 +
  620 + } else if ( settings === "refresh" ) {
  621 +
  622 + slider.element.slider( "float", slider.element.data("float-options") );
  623 +
  624 + }
  625 +
  626 + return;
  627 +
  628 + }
  629 +
  630 +
  631 +
  632 +
  633 + if ( value < min ) {
  634 + value = min;
  635 + }
  636 +
  637 + if ( value > max ) {
  638 + value = max;
  639 + }
  640 +
  641 + if ( values && values.length ) {
  642 +
  643 + for ( i = 0; i < values.length; i++ ) {
  644 +
  645 + if ( values[i] < min ) {
  646 + values[i] = min;
  647 + }
  648 +
  649 + if ( values[i] > max ) {
  650 + values[i] = max;
  651 + }
  652 +
  653 + }
  654 +
  655 + }
  656 +
  657 + // add a class for the CSS
  658 + slider.element
  659 + .addClass("ui-slider-float")
  660 + .find(".ui-slider-tip, .ui-slider-tip-label")
  661 + .remove();
  662 +
  663 +
  664 +
  665 + function destroy() {
  666 +
  667 + slider.element
  668 + .off(".sliderFloat")
  669 + .removeClass("ui-slider-float")
  670 + .find(".ui-slider-tip, .ui-slider-tip-label")
  671 + .remove();
  672 +
  673 + }
  674 +
  675 +
  676 + function getPipLabels( values ) {
  677 +
  678 + // when checking the array we need to divide
  679 + // by the step option, so we store those values here.
  680 +
  681 + var vals = [],
  682 + steppedVals = $.map( values, function(v) {
  683 + return Math.ceil(( v - min ) / slider.options.step);
  684 + });
  685 +
  686 + // now we just get the values we need to return
  687 + // by looping through the values array and assigning the
  688 + // label if it exists.
  689 +
  690 + if ( $.type( options.labels ) === "array" ) {
  691 +
  692 + for ( i = 0; i < values.length; i++ ) {
  693 +
  694 + vals[i] = options.labels[ steppedVals[i] ] || values[i];
  695 +
  696 + }
  697 +
  698 + } else if ( $.type( options.labels ) === "object" ) {
  699 +
  700 + for ( i = 0; i < values.length; i++ ) {
  701 +
  702 + if ( values[i] === min ) {
  703 +
  704 + vals[i] = options.labels.first || min;
  705 +
  706 + } else if ( values[i] === max ) {
  707 +
  708 + vals[i] = options.labels.last || max;
  709 +
  710 + } else if ( $.type( options.labels.rest ) === "array" ) {
  711 +
  712 + vals[i] = options.labels.rest[ steppedVals[i] - 1 ] || values[i];
  713 +
  714 + } else {
  715 +
  716 + vals[i] = values[i];
  717 +
  718 + }
  719 +
  720 + }
  721 +
  722 + } else {
  723 +
  724 + for ( i = 0; i < values.length; i++ ) {
  725 +
  726 + vals[i] = values[i];
  727 +
  728 + }
  729 +
  730 + }
  731 +
  732 + return vals;
  733 +
  734 + }
  735 +
  736 + // apply handle tip if settings allows.
  737 + if ( options.handle ) {
  738 +
  739 + // we need to set the human-readable label to either the
  740 + // corresponding element in the array, or the appropriate
  741 + // item in the object... or an empty string.
  742 +
  743 + tipValues = ( slider.values() && slider.values().length ) ?
  744 + getPipLabels( values ) :
  745 + getPipLabels( [ value ] );
  746 +
  747 + for ( i = 0; i < tipValues.length; i++ ) {
  748 +
  749 + $handles
  750 + .eq( i )
  751 + .append( $("<span class=\"ui-slider-tip\">"+ options.formatLabel(tipValues[i]) +"</span>") );
  752 +
  753 + }
  754 +
  755 + }
  756 +
  757 + if ( options.pips ) {
  758 +
  759 + // if this slider also has pip-labels, we make those into tips, too.
  760 + slider.element.find(".ui-slider-label").each(function(k, v) {
  761 +
  762 + var $this = $(v),
  763 + val = [ $this.data("value") ],
  764 + label,
  765 + $tip;
  766 +
  767 +
  768 + label = options.formatLabel( getPipLabels( val )[0] );
  769 +
  770 + // create a tip element
  771 + $tip =
  772 + $("<span class=\"ui-slider-tip-label\">" + label + "</span>")
  773 + .insertAfter( $this );
  774 +
  775 + });
  776 +
  777 + }
  778 +
  779 + // check that the event option is actually valid against our
  780 + // own list of the slider's events.
  781 + if ( options.event !== "slide" &&
  782 + options.event !== "slidechange" &&
  783 + options.event !== "slide slidechange" &&
  784 + options.event !== "slidechange slide" ) {
  785 +
  786 + options.event = "slidechange slide";
  787 +
  788 + }
  789 +
  790 + // when slider changes, update handle tip label.
  791 + slider.element
  792 + .off(".sliderFloat")
  793 + .on( options.event + ".sliderFloat", function( e, ui ) {
  794 +
  795 + var uiValue = ( $.type( ui.value ) === "array" ) ? ui.value : [ ui.value ],
  796 + val = options.formatLabel( getPipLabels( uiValue )[0] );
  797 +
  798 + $(ui.handle)
  799 + .find(".ui-slider-tip")
  800 + .html( val );
  801 +
  802 + });
  803 +
  804 + }
  805 +
  806 + };
  807 +
  808 + $.extend(true, $.ui.slider.prototype, extensionMethods);
  809 +
  810 +})(jQuery);
... ...
400-SOURCECODE/AIAHTML5.Web/themes/default/scripts/custom/custom.js 0 → 100644
  1 +$(function(){
  2 + "use strict";
  3 + /*** Sidebar Toggle ***/
  4 + var barPos=0;
  5 + var bar = $('.sidebar');
  6 + var main = $('.main');
  7 + $('.toggleBar').click(function() {
  8 + /*barPos = parseInt($('.sidebar').css('left'));
  9 + if(barPos!==0 && !bar.hasClass('active'))
  10 + {
  11 + bar.addClass('active');
  12 + main.addClass('active');
  13 + }
  14 + else
  15 + {
  16 + bar.removeClass('active');
  17 + main.removeClass('active');
  18 + }*/
  19 + bar.toggleClass('active');
  20 + main.toggleClass('active');
  21 + });
  22 +});
  23 +
  24 +$(function(){
  25 + "use strict";
  26 + /*** Sidebar Toggle ***/
  27 + var barPos=0;
  28 + var bar = $('.tools');
  29 + var main = $('.main2');
  30 + $('.toggleBar').click(function() {
  31 + /*barPos = parseInt($('.tools').css('left'));
  32 + if(barPos!==0 && !bar.hasClass('active'))
  33 + {
  34 + bar.addClass('active');
  35 + main.addClass('active');
  36 + }
  37 + else
  38 + {
  39 + bar.removeClass('active');
  40 + main.removeClass('active');
  41 + }*/
  42 + bar.toggleClass('active');
  43 + main.toggleClass('active');
  44 + });
  45 +});
  46 +
  47 +
  48 +$(function(){
  49 + "use strict";
  50 + /*** Sidebar Toggle ***/
  51 + var barPos=0;
  52 + var bar = $('.treeview-left');
  53 + var main = $('.main-treeview');
  54 + $('.toggleBar').click(function() {
  55 + /*barPos = parseInt($('.sidebar').css('left'));
  56 + if(barPos!==0 && !bar.hasClass('active'))
  57 + {
  58 + bar.addClass('active');
  59 + main.addClass('active');
  60 + }
  61 + else
  62 + {
  63 + bar.removeClass('active');
  64 + main.removeClass('active');
  65 + }*/
  66 + bar.toggleClass('active');
  67 + main.toggleClass('active');
  68 + });
  69 +});
... ...
400-SOURCECODE/AIAHTML5.Web/themes/jquery-ui-slider-pips.js 0 → 100644
  1 +/*! jQuery-ui-Slider-Pips - v1.11.1 - 2015-11-30
  2 +* Copyright (c) 2015 Simon Goellner <simey.me@gmail.com>; Licensed MIT */
  3 +
  4 +
  5 +
  6 +(function($) {
  7 +
  8 + "use strict";
  9 +
  10 + var extensionMethods = {
  11 +
  12 +
  13 +
  14 +
  15 +
  16 + // pips
  17 +
  18 + pips: function( settings ) {
  19 +
  20 + var slider = this,
  21 + i, j, p,
  22 + collection = "",
  23 + mousedownHandlers,
  24 + min = slider._valueMin(),
  25 + max = slider._valueMax(),
  26 + pips = ( max - min ) / slider.options.step,
  27 + $handles = slider.element.find(".ui-slider-handle"),
  28 + $pips;
  29 +
  30 + var options = {
  31 +
  32 + first: "label",
  33 + /* "label", "pip", false */
  34 +
  35 + last: "label",
  36 + /* "label", "pip", false */
  37 +
  38 + rest: "pip",
  39 + /* "label", "pip", false */
  40 +
  41 + labels: false,
  42 + /* [array], { first: "string", rest: [array], last: "string" }, false */
  43 +
  44 + prefix: "",
  45 + /* "", string */
  46 +
  47 + suffix: "",
  48 + /* "", string */
  49 +
  50 + step: ( pips > 100 ) ? Math.floor( pips * 0.05 ) : 1,
  51 + /* number */
  52 +
  53 + formatLabel: function(value) {
  54 + return this.prefix + value + this.suffix;
  55 + }
  56 + /* function
  57 + must return a value to display in the pip labels */
  58 +
  59 + };
  60 +
  61 + if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
  62 +
  63 + $.extend( options, settings );
  64 + slider.element.data("pips-options", options );
  65 +
  66 + } else {
  67 +
  68 + if ( settings === "destroy" ) {
  69 +
  70 + destroy();
  71 +
  72 + } else if ( settings === "refresh" ) {
  73 +
  74 + slider.element.slider( "pips", slider.element.data("pips-options") );
  75 +
  76 + }
  77 +
  78 + return;
  79 +
  80 + }
  81 +
  82 +
  83 + // we don't want the step ever to be a floating point.
  84 + slider.options.pipStep = Math.round( options.step );
  85 +
  86 + // get rid of all pips that might already exist.
  87 + slider.element
  88 + .off( ".selectPip" )
  89 + .addClass("ui-slider-pips")
  90 + .find(".ui-slider-pip")
  91 + .remove();
  92 +
  93 + // small object with functions for marking pips as selected.
  94 +
  95 + var selectPip = {
  96 +
  97 + single: function(value) {
  98 +
  99 + this.resetClasses();
  100 +
  101 + $pips
  102 + .filter(".ui-slider-pip-" + this.classLabel(value) )
  103 + .addClass("ui-slider-pip-selected");
  104 +
  105 + if ( slider.options.range ) {
  106 +
  107 + $pips.each(function(k, v) {
  108 +
  109 + var pipVal = $(v).children(".ui-slider-label").data("value");
  110 +
  111 + if (( slider.options.range === "min" && pipVal < value ) ||
  112 + ( slider.options.range === "max" && pipVal > value )) {
  113 +
  114 + $(v).addClass("ui-slider-pip-inrange");
  115 +
  116 + }
  117 +
  118 + });
  119 +
  120 + }
  121 +
  122 + },
  123 +
  124 + range: function(values) {
  125 +
  126 + this.resetClasses();
  127 +
  128 + for ( i = 0; i < values.length; i++ ) {
  129 +
  130 + $pips
  131 + .filter(".ui-slider-pip-" + this.classLabel(values[i]) )
  132 + .addClass("ui-slider-pip-selected-" + ( i + 1 ) );
  133 +
  134 + }
  135 +
  136 + if ( slider.options.range ) {
  137 +
  138 + $pips.each(function(k, v) {
  139 +
  140 + var pipVal = $(v).children(".ui-slider-label").data("value");
  141 +
  142 + if ( pipVal > values[0] && pipVal < values[1] ) {
  143 +
  144 + $(v).addClass("ui-slider-pip-inrange");
  145 +
  146 + }
  147 +
  148 + });
  149 +
  150 + }
  151 +
  152 + },
  153 +
  154 + classLabel: function(value) {
  155 +
  156 + return value.toString().replace(".", "-");
  157 +
  158 + },
  159 +
  160 + resetClasses: function() {
  161 +
  162 + var regex = /(^|\s*)(ui-slider-pip-selected|ui-slider-pip-inrange)(-{1,2}\d+|\s|$)/gi;
  163 +
  164 + $pips.removeClass( function(index, css) {
  165 + return ( css.match(regex) || [] ).join(" ");
  166 + });
  167 +
  168 + }
  169 +
  170 + };
  171 +
  172 + function getClosestHandle( val ) {
  173 +
  174 + var h, k,
  175 + sliderVals,
  176 + comparedVals,
  177 + closestVal,
  178 + tempHandles = [],
  179 + closestHandle = 0;
  180 +
  181 + if ( slider.values() && slider.values().length ) {
  182 +
  183 + // get the current values of the slider handles
  184 + sliderVals = slider.values();
  185 +
  186 + // find the offset value from the `val` for each
  187 + // handle, and store it in a new array
  188 + comparedVals = $.map( sliderVals, function(v) {
  189 + return Math.abs( v - val );
  190 + });
  191 +
  192 + // figure out the closest handles to the value
  193 + closestVal = Math.min.apply( Math, comparedVals );
  194 +
  195 + // if a comparedVal is the closestVal, then
  196 + // set the value accordingly, and set the closest handle.
  197 + for ( h = 0; h < comparedVals.length; h++ ) {
  198 + if ( comparedVals[h] === closestVal ) {
  199 + tempHandles.push(h);
  200 + }
  201 + }
  202 +
  203 + // set the closest handle to the first handle in array,
  204 + // just incase we have no _lastChangedValue to compare to.
  205 + closestHandle = tempHandles[0];
  206 +
  207 + // now we want to find out if any of the closest handles were
  208 + // the last changed handle, if so we specify that handle to change
  209 + for ( k = 0; k < tempHandles.length; k++ ) {
  210 + if ( slider._lastChangedValue === tempHandles[k] ) {
  211 + closestHandle = tempHandles[k];
  212 + }
  213 + }
  214 +
  215 + if ( slider.options.range && tempHandles.length === 2 ) {
  216 +
  217 + if ( val > sliderVals[1] ) {
  218 +
  219 + closestHandle = tempHandles[1];
  220 +
  221 + } else if ( val < sliderVals[0] ) {
  222 +
  223 + closestHandle = tempHandles[0];
  224 +
  225 + }
  226 +
  227 + }
  228 +
  229 + }
  230 +
  231 + return closestHandle;
  232 +
  233 + }
  234 +
  235 + function destroy() {
  236 +
  237 + slider.element
  238 + .off(".selectPip")
  239 + .on("mousedown.slider", slider.element.data("mousedown-original") )
  240 + .removeClass("ui-slider-pips")
  241 + .find(".ui-slider-pip")
  242 + .remove();
  243 +
  244 + }
  245 +
  246 + // when we click on a label, we want to make sure the
  247 + // slider's handle actually goes to that label!
  248 + // so we check all the handles and see which one is closest
  249 + // to the label we clicked. If 2 handles are equidistant then
  250 + // we move both of them. We also want to trigger focus on the
  251 + // handle.
  252 +
  253 + // without this method the label is just treated like a part
  254 + // of the slider and there's no accuracy in the selected value
  255 +
  256 + function labelClick( label, e ) {
  257 +
  258 + if (slider.option("disabled")) {
  259 + return;
  260 + }
  261 +
  262 + var val = $(label).data("value"),
  263 + indexToChange = getClosestHandle( val );
  264 +
  265 + if ( slider.values() && slider.values().length ) {
  266 +
  267 + slider.options.values[ indexToChange ] = slider._trimAlignValue( val );
  268 +
  269 + } else {
  270 +
  271 + slider.options.value = slider._trimAlignValue( val );
  272 +
  273 + }
  274 +
  275 + slider._refreshValue();
  276 + slider._change( e, indexToChange );
  277 +
  278 + }
  279 +
  280 + // method for creating a pip. We loop this for creating all
  281 + // the pips.
  282 +
  283 + function createPip( which ) {
  284 +
  285 + var label,
  286 + percent,
  287 + number = which,
  288 + classes = "ui-slider-pip",
  289 + css = "",
  290 + value = slider.value(),
  291 + values = slider.values();
  292 +
  293 + if ( which === "first" ) {
  294 +
  295 + number = 0;
  296 +
  297 + } else if ( which === "last" ) {
  298 +
  299 + number = pips;
  300 +
  301 + }
  302 +
  303 + // labelValue is the actual value of the pip based on the min/step
  304 + var labelValue = min + ( slider.options.step * number );
  305 +
  306 + // classLabel replaces any decimals with hyphens
  307 + var classLabel = labelValue.toString().replace(".","-");
  308 +
  309 + // we need to set the human-readable label to either the
  310 + // corresponding element in the array, or the appropriate
  311 + // item in the object... or an empty string.
  312 +
  313 + if ( $.type(options.labels) === "array" ) {
  314 +
  315 + label = options.labels[number] || "";
  316 +
  317 + } else if ( $.type( options.labels ) === "object" ) {
  318 +
  319 + if ( which === "first" ) {
  320 +
  321 + // set first label
  322 + label = options.labels.first || "";
  323 +
  324 + } else if ( which === "last" ) {
  325 +
  326 + // set last label
  327 + label = options.labels.last || "";
  328 +
  329 + } else if ( $.type( options.labels.rest ) === "array" ) {
  330 +
  331 + // set other labels, but our index should start at -1
  332 + // because of the first pip.
  333 +
  334 + label = options.labels.rest[ number - 1 ] || "";
  335 +
  336 + } else {
  337 +
  338 + // urrggh, the options must be f**ked, just show nothing.
  339 + label = labelValue;
  340 +
  341 + }
  342 +
  343 + } else {
  344 +
  345 + label = labelValue;
  346 +
  347 + }
  348 +
  349 +
  350 +
  351 +
  352 + if ( which === "first" ) {
  353 +
  354 + // first Pip on the Slider
  355 + percent = "0%";
  356 +
  357 + classes += " ui-slider-pip-first";
  358 + classes += ( options.first === "label" ) ? " ui-slider-pip-label" : "";
  359 + classes += ( options.first === false ) ? " ui-slider-pip-hide" : "";
  360 +
  361 + } else if ( which === "last" ) {
  362 +
  363 + // last Pip on the Slider
  364 + percent = "100%";
  365 +
  366 + classes += " ui-slider-pip-last";
  367 + classes += ( options.last === "label" ) ? " ui-slider-pip-label" : "";
  368 + classes += ( options.last === false ) ? " ui-slider-pip-hide" : "";
  369 +
  370 + } else {
  371 +
  372 + // all other Pips
  373 + percent = (( 100 / pips ) * which ).toFixed(4) + "%";
  374 +
  375 + classes += ( options.rest === "label" ) ? " ui-slider-pip-label" : "";
  376 + classes += ( options.rest === false ) ? " ui-slider-pip-hide" : "";
  377 +
  378 + }
  379 +
  380 + classes += " ui-slider-pip-" + classLabel;
  381 +
  382 +
  383 + // add classes for the initial-selected values.
  384 + if ( values && values.length ) {
  385 +
  386 + for ( i = 0; i < values.length; i++ ) {
  387 +
  388 + if ( labelValue === values[i] ) {
  389 +
  390 + classes += " ui-slider-pip-initial-" + ( i + 1 );
  391 + classes += " ui-slider-pip-selected-" + ( i + 1 );
  392 +
  393 + }
  394 +
  395 + }
  396 +
  397 + if ( slider.options.range ) {
  398 +
  399 + if ( labelValue > values[0] &&
  400 + labelValue < values[1] ) {
  401 +
  402 + classes += " ui-slider-pip-inrange";
  403 +
  404 + }
  405 +
  406 + }
  407 +
  408 + } else {
  409 +
  410 + if ( labelValue === value ) {
  411 +
  412 + classes += " ui-slider-pip-initial";
  413 + classes += " ui-slider-pip-selected";
  414 +
  415 + }
  416 +
  417 + if ( slider.options.range ) {
  418 +
  419 + if (( slider.options.range === "min" && labelValue < value ) ||
  420 + ( slider.options.range === "max" && labelValue > value )) {
  421 +
  422 + classes += " ui-slider-pip-inrange";
  423 +
  424 + }
  425 +
  426 + }
  427 +
  428 + }
  429 +
  430 +
  431 +
  432 + css = ( slider.options.orientation === "horizontal" ) ?
  433 + "left: " + percent :
  434 + "bottom: " + percent;
  435 +
  436 +
  437 + // add this current pip to the collection
  438 + return "<span class=\"" + classes + "\" style=\"" + css + "\">" +
  439 + "<span class=\"ui-slider-line\"></span>" +
  440 + "<span class=\"ui-slider-label\" data-value=\"" +
  441 + labelValue + "\">" + options.formatLabel(label) + "</span>" +
  442 + "</span>";
  443 +
  444 + }
  445 +
  446 + // create our first pip
  447 + collection += createPip("first");
  448 +
  449 + // for every stop in the slider; we create a pip.
  450 + for ( p = 1; p < pips; p++ ) {
  451 + if ( p % slider.options.pipStep === 0 ) {
  452 + collection += createPip( p );
  453 + }
  454 + }
  455 +
  456 + // create our last pip
  457 + collection += createPip("last");
  458 +
  459 + // append the collection of pips.
  460 + slider.element.append( collection );
  461 +
  462 + // store the pips for setting classes later.
  463 + $pips = slider.element.find(".ui-slider-pip");
  464 +
  465 +
  466 +
  467 + // store the mousedown handlers for later, just in case we reset
  468 + // the slider, the handler would be lost!
  469 +
  470 + if ( $._data( slider.element.get(0), "events").mousedown &&
  471 + $._data( slider.element.get(0), "events").mousedown.length ) {
  472 +
  473 + mousedownHandlers = $._data( slider.element.get(0), "events").mousedown;
  474 +
  475 + } else {
  476 +
  477 + mousedownHandlers = slider.element.data("mousedown-handlers");
  478 +
  479 + }
  480 +
  481 + slider.element.data("mousedown-handlers", mousedownHandlers.slice() );
  482 +
  483 + // loop through all the mousedown handlers on the slider,
  484 + // and store the original namespaced (.slider) event handler so
  485 + // we can trigger it later.
  486 + for ( j = 0; j < mousedownHandlers.length; j++ ) {
  487 + if ( mousedownHandlers[j].namespace === "slider" ) {
  488 + slider.element.data("mousedown-original", mousedownHandlers[j].handler );
  489 + }
  490 + }
  491 +
  492 + // unbind the mousedown.slider event, because it interferes with
  493 + // the labelClick() method (stops smooth animation), and decide
  494 + // if we want to trigger the original event based on which element
  495 + // was clicked.
  496 + slider.element
  497 + .off("mousedown.slider")
  498 + .on("mousedown.selectPip", function(e) {
  499 +
  500 + var $target = $(e.target),
  501 + closest = getClosestHandle( $target.data("value") ),
  502 + $handle = $handles.eq( closest );
  503 +
  504 + $handle.addClass("ui-state-active");
  505 +
  506 + if ( $target.is(".ui-slider-label") ) {
  507 +
  508 + labelClick( $target, e );
  509 +
  510 + slider.element
  511 + .one("mouseup.selectPip", function() {
  512 +
  513 + $handle
  514 + .removeClass("ui-state-active")
  515 + .focus();
  516 +
  517 + });
  518 +
  519 + } else {
  520 +
  521 + var originalMousedown = slider.element.data("mousedown-original");
  522 + originalMousedown(e);
  523 +
  524 + }
  525 +
  526 + });
  527 +
  528 +
  529 +
  530 +
  531 + slider.element.on( "slide.selectPip slidechange.selectPip", function(e, ui) {
  532 +
  533 + var $slider = $(this),
  534 + value = $slider.slider("value"),
  535 + values = $slider.slider("values");
  536 +
  537 + if ( ui ) {
  538 +
  539 + value = ui.value;
  540 + values = ui.values;
  541 +
  542 + }
  543 +
  544 + if ( slider.values() && slider.values().length ) {
  545 +
  546 + selectPip.range( values );
  547 +
  548 + } else {
  549 +
  550 + selectPip.single( value );
  551 +
  552 + }
  553 +
  554 + });
  555 +
  556 +
  557 +
  558 +
  559 + },
  560 +
  561 +
  562 +
  563 +
  564 +
  565 +
  566 +
  567 +
  568 + // floats
  569 +
  570 + float: function( settings ) {
  571 +
  572 + var i,
  573 + slider = this,
  574 + min = slider._valueMin(),
  575 + max = slider._valueMax(),
  576 + value = slider._value(),
  577 + values = slider._values(),
  578 + tipValues = [],
  579 + $handles = slider.element.find(".ui-slider-handle");
  580 +
  581 + var options = {
  582 +
  583 + handle: true,
  584 + /* false */
  585 +
  586 + pips: false,
  587 + /* true */
  588 +
  589 + labels: false,
  590 + /* [array], { first: "string", rest: [array], last: "string" }, false */
  591 +
  592 + prefix: "",
  593 + /* "", string */
  594 +
  595 + suffix: "",
  596 + /* "", string */
  597 +
  598 + event: "slidechange slide",
  599 + /* "slidechange", "slide", "slidechange slide" */
  600 +
  601 + formatLabel: function(value) {
  602 + return this.prefix + value + this.suffix;
  603 + }
  604 + /* function
  605 + must return a value to display in the floats */
  606 +
  607 + };
  608 +
  609 + if ( $.type( settings ) === "object" || $.type( settings ) === "undefined" ) {
  610 +
  611 + $.extend( options, settings );
  612 + slider.element.data("float-options", options );
  613 +
  614 + } else {
  615 +
  616 + if ( settings === "destroy" ) {
  617 +
  618 + destroy();
  619 +
  620 + } else if ( settings === "refresh" ) {
  621 +
  622 + slider.element.slider( "float", slider.element.data("float-options") );
  623 +
  624 + }
  625 +
  626 + return;
  627 +
  628 + }
  629 +
  630 +
  631 +
  632 +
  633 + if ( value < min ) {
  634 + value = min;
  635 + }
  636 +
  637 + if ( value > max ) {
  638 + value = max;
  639 + }
  640 +
  641 + if ( values && values.length ) {
  642 +
  643 + for ( i = 0; i < values.length; i++ ) {
  644 +
  645 + if ( values[i] < min ) {
  646 + values[i] = min;
  647 + }
  648 +
  649 + if ( values[i] > max ) {
  650 + values[i] = max;
  651 + }
  652 +
  653 + }
  654 +
  655 + }
  656 +
  657 + // add a class for the CSS
  658 + slider.element
  659 + .addClass("ui-slider-float")
  660 + .find(".ui-slider-tip, .ui-slider-tip-label")
  661 + .remove();
  662 +
  663 +
  664 +
  665 + function destroy() {
  666 +
  667 + slider.element
  668 + .off(".sliderFloat")
  669 + .removeClass("ui-slider-float")
  670 + .find(".ui-slider-tip, .ui-slider-tip-label")
  671 + .remove();
  672 +
  673 + }
  674 +
  675 +
  676 + function getPipLabels( values ) {
  677 +
  678 + // when checking the array we need to divide
  679 + // by the step option, so we store those values here.
  680 +
  681 + var vals = [],
  682 + steppedVals = $.map( values, function(v) {
  683 + return Math.ceil(( v - min ) / slider.options.step);
  684 + });
  685 +
  686 + // now we just get the values we need to return
  687 + // by looping through the values array and assigning the
  688 + // label if it exists.
  689 +
  690 + if ( $.type( options.labels ) === "array" ) {
  691 +
  692 + for ( i = 0; i < values.length; i++ ) {
  693 +
  694 + vals[i] = options.labels[ steppedVals[i] ] || values[i];
  695 +
  696 + }
  697 +
  698 + } else if ( $.type( options.labels ) === "object" ) {
  699 +
  700 + for ( i = 0; i < values.length; i++ ) {
  701 +
  702 + if ( values[i] === min ) {
  703 +
  704 + vals[i] = options.labels.first || min;
  705 +
  706 + } else if ( values[i] === max ) {
  707 +
  708 + vals[i] = options.labels.last || max;
  709 +
  710 + } else if ( $.type( options.labels.rest ) === "array" ) {
  711 +
  712 + vals[i] = options.labels.rest[ steppedVals[i] - 1 ] || values[i];
  713 +
  714 + } else {
  715 +
  716 + vals[i] = values[i];
  717 +
  718 + }
  719 +
  720 + }
  721 +
  722 + } else {
  723 +
  724 + for ( i = 0; i < values.length; i++ ) {
  725 +
  726 + vals[i] = values[i];
  727 +
  728 + }
  729 +
  730 + }
  731 +
  732 + return vals;
  733 +
  734 + }
  735 +
  736 + // apply handle tip if settings allows.
  737 + if ( options.handle ) {
  738 +
  739 + // we need to set the human-readable label to either the
  740 + // corresponding element in the array, or the appropriate
  741 + // item in the object... or an empty string.
  742 +
  743 + tipValues = ( slider.values() && slider.values().length ) ?
  744 + getPipLabels( values ) :
  745 + getPipLabels( [ value ] );
  746 +
  747 + for ( i = 0; i < tipValues.length; i++ ) {
  748 +
  749 + $handles
  750 + .eq( i )
  751 + .append( $("<span class=\"ui-slider-tip\">"+ options.formatLabel(tipValues[i]) +"</span>") );
  752 +
  753 + }
  754 +
  755 + }
  756 +
  757 + if ( options.pips ) {
  758 +
  759 + // if this slider also has pip-labels, we make those into tips, too.
  760 + slider.element.find(".ui-slider-label").each(function(k, v) {
  761 +
  762 + var $this = $(v),
  763 + val = [ $this.data("value") ],
  764 + label,
  765 + $tip;
  766 +
  767 +
  768 + label = options.formatLabel( getPipLabels( val )[0] );
  769 +
  770 + // create a tip element
  771 + $tip =
  772 + $("<span class=\"ui-slider-tip-label\">" + label + "</span>")
  773 + .insertAfter( $this );
  774 +
  775 + });
  776 +
  777 + }
  778 +
  779 + // check that the event option is actually valid against our
  780 + // own list of the slider's events.
  781 + if ( options.event !== "slide" &&
  782 + options.event !== "slidechange" &&
  783 + options.event !== "slide slidechange" &&
  784 + options.event !== "slidechange slide" ) {
  785 +
  786 + options.event = "slidechange slide";
  787 +
  788 + }
  789 +
  790 + // when slider changes, update handle tip label.
  791 + slider.element
  792 + .off(".sliderFloat")
  793 + .on( options.event + ".sliderFloat", function( e, ui ) {
  794 +
  795 + var uiValue = ( $.type( ui.value ) === "array" ) ? ui.value : [ ui.value ],
  796 + val = options.formatLabel( getPipLabels( uiValue )[0] );
  797 +
  798 + $(ui.handle)
  799 + .find(".ui-slider-tip")
  800 + .html( val );
  801 +
  802 + });
  803 +
  804 + }
  805 +
  806 + };
  807 +
  808 + $.extend(true, $.ui.slider.prototype, extensionMethods);
  809 +
  810 +})(jQuery);
... ...