Commit d7124004ce86eb276f3da3fb22f8fe4d15e0f3b1

Authored by 潘钊
2 parents d2d815f5 d3b6eb98

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
#	src/main/java/com/bsth/data/schedule/late_adjust/ScheduleLateThread.java
#	src/main/resources/static/real_control_v2/fragments/north/nav/dataManager/cars_move.html
Showing 30 changed files with 2448 additions and 2272 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -28,6 +28,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading;
28 28 import com.bsth.entity.mcy_forms.Waybillday;
29 29 import com.bsth.service.forms.ExportService;
30 30 import com.bsth.service.forms.FormsService;
  31 +import com.bsth.util.Arith;
31 32 import com.bsth.util.ReportUtils;
32 33  
33 34 @RestController
... ... @@ -167,7 +168,7 @@ public class ExportController {
167 168 }
168 169  
169 170 // 路单数据报表
170   - @RequestMapping(value = "/singledataExport", method = RequestMethod.POST)
  171 + @RequestMapping(value = "/singledataExport", method = RequestMethod.GET)
171 172 public List<Map<String, Object>> singledataExport(@RequestParam Map<String, Object> map) {
172 173 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
173 174 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -213,12 +214,12 @@ public class ExportController {
213 214 }
214 215  
215 216 // 车辆加注
216   - @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.POST)
  217 + @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET)
217 218 public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) {
218 219 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
219 220 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
220 221 ReportUtils ee = new ReportUtils();
221   - List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("gsdmVehic").toString(),map.get("fgsdmVehic").toString(),map.get("line").toString(),
  222 + List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(),
222 223 map.get("data").toString());
223 224 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
224 225 int i = 1;
... ... @@ -558,17 +559,13 @@ public class ExportController {
558 559 List<Daily> allline = formsService.daily(map);
559 560  
560 561 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
561   - Float zgl=0f;
562   - Float ks=0f;
563   - Float yh=0f;
564   - Float bc=0f;
  562 + double zgl=0.0;
  563 + double ks=0.0;
  564 + double yh=0.0;
  565 + int bc=0;
565 566 Map<String, Object> m ;
566 567 for (Daily d : allline) {
567 568 m = new HashMap<String, Object>();
568   - zgl +=d.getZlc()==""?0f:Float.valueOf(d.getZlc());
569   - ks +=d.getJzl1()==""?0f:Float.valueOf(d.getJzl1());
570   - yh +=d.getYh()==""?0f:Float.valueOf(d.getYh());
571   - bc +=d.getBc()==""?0f:Float.valueOf(d.getBc());
572 569 m.put("zbh", d.getZbh());
573 570 m.put("jgh",d.getJgh());
574 571 m.put("jName", d.getjName());
... ... @@ -576,9 +573,13 @@ public class ExportController {
576 573 m.put("jzl1", d.getJzl1());
577 574 m.put("yh", d.getYh());
578 575 m.put("bc", d.getBc());
  576 + zgl =Arith.add(zgl, d.getZlc());
  577 + ks =Arith.add(ks, d.getJzl1());
  578 + yh =Arith.add(yh, d.getYh());
  579 + bc +=Integer.parseInt(d.getBc());
579 580  
580 581 resList.add(m);
581   - }
  582 + }
582 583  
583 584 m=new HashMap<String,Object>();
584 585 m.put("total_zgl", zgl);
... ...
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
... ... @@ -73,17 +73,16 @@ public class MCY_FormsController {
73 73 }
74 74  
75 75 // 路单数据
76   - @RequestMapping(value = "/singledata", method = RequestMethod.POST)
  76 + @RequestMapping(value = "/singledata", method = RequestMethod.GET)
77 77 public List<Singledata> singledata(@RequestParam Map<String, Object> map) {
78 78  
79 79 return formsService.singledata(map);
80 80 }
81 81  
82 82 // 车辆加注
83   - @RequestMapping(value = "/vehicleloading", method = RequestMethod.POST)
84   - public List<Vehicleloading> vehicleloading(@RequestParam String gsdmVehic, @RequestParam String fgsdmVehic,
85   - @RequestParam String line, @RequestParam String data) {
86   - return formsService.vehicleloading(gsdmVehic, fgsdmVehic, line, data);
  83 + @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET)
  84 + public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) {
  85 + return formsService.vehicleloading(line, data);
87 86 }
88 87  
89 88 // 运营服务阶段报表
... ...
src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -238,9 +238,11 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
238 238 Map<String, Object> m = new HashMap<String, Object>();
239 239 m.put("rq", y.getRq());
240 240 m.put("gsname",y.getGsname() );
  241 + m.put("fgsname", y.getFgsname());
241 242 m.put("xlname", y.getXlname());
242 243 m.put("nbbm", y.getNbbm());
243 244 m.put("jsy", y.getJsy());
  245 + m.put("name", y.getName());
244 246 m.put("jzl", y.getJzl());
245 247 m.put("czlc", y.getCzlc());
246 248 m.put("jzlc", y.getJzlc());
... ...
src/main/java/com/bsth/controller/realcontrol/DataManagerController.java
1   -package com.bsth.controller.realcontrol;
2   -
3   -import com.bsth.service.realcontrol.DataManagerService;
4   -import org.apache.commons.lang3.StringEscapeUtils;
5   -import org.springframework.beans.factory.annotation.Autowired;
6   -import org.springframework.web.bind.annotation.RequestMapping;
7   -import org.springframework.web.bind.annotation.RequestParam;
8   -import org.springframework.web.bind.annotation.RestController;
9   -
10   -import java.util.Map;
11   -
12   -/**
13   - * 数据管理,包括从老系统的数据迁移。新系统的数据校验等
14   - * Created by panzhao on 2017/4/17.
15   - */
16   -@RestController
17   -@RequestMapping("dataManager")
18   -public class DataManagerController {
19   -
20   - @Autowired
21   - DataManagerService dataManagerService;
22   -
23   - @RequestMapping("cars/old_now")
24   - public Map<String, Object> carInfos(@RequestParam Integer lineId){
25   - return dataManagerService.carInfos(lineId);
26   - }
27   -
28   - @RequestMapping("car/updateDevices")
29   - public Map<String, Object> updateDevices(@RequestParam String jsonStr){
30   - jsonStr = StringEscapeUtils.unescapeHtml4(jsonStr);
31   - return dataManagerService.updateDevices(jsonStr);
32   - }
33   -}
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.service.realcontrol.DataManagerService;
  4 +import org.apache.commons.lang3.StringEscapeUtils;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestParam;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import java.util.Map;
  11 +
  12 +/**
  13 + * 数据管理,包括从老系统的数据迁移。新系统的数据校验等
  14 + * Created by panzhao on 2017/4/17.
  15 + */
  16 +@RestController
  17 +@RequestMapping("dataManager")
  18 +public class DataManagerController {
  19 +
  20 + @Autowired
  21 + DataManagerService dataManagerService;
  22 +
  23 + @RequestMapping("cars/old_now")
  24 + public Map<String, Object> carInfos(@RequestParam Integer lineId){
  25 + return dataManagerService.carInfos(lineId);
  26 + }
  27 +
  28 + @RequestMapping("car/updateDevices")
  29 + public Map<String, Object> updateDevices(@RequestParam String jsonStr){
  30 + jsonStr = StringEscapeUtils.unescapeHtml4(jsonStr);
  31 + return dataManagerService.updateDevices(jsonStr);
  32 + }
  33 +}
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -332,7 +332,8 @@ public class BasicData implements CommandLineRunner {
332 332 }
333 333  
334 334 perTempMap.put(jobCode, p);
335   - allPersonMap.put(jobCode, p.getPersonnelName());
  335 +
  336 + allPersonMap.put(jobCode.substring(jobCode.indexOf("-")+1), p.getPersonnelName());
336 337 }
337 338  
338 339 jsyMap = jsyTempMap;
... ...
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
... ... @@ -136,4 +136,4 @@ public class LateAdjustHandle implements ApplicationContextAware{
136 136 lineConfigData = applicationContext.getBean(LineConfigData.class);
137 137 sendUtils = applicationContext.getBean(SendUtils.class);
138 138 }
139 139 -}
  140 +}
140 141 \ No newline at end of file
... ...
src/main/java/com/bsth/data/schedule/late_adjust/ScheduleLateThread.java
... ... @@ -15,10 +15,10 @@ import java.util.Comparator;
15 15 import java.util.List;
16 16  
17 17 /**
18   - *
19   - * @ClassName: ScheduleLateThread
20   - * @Description: TODO(班次误点扫描线程)
21   - * @author PanZhao
  18 + *
  19 + * @ClassName: ScheduleLateThread
  20 + * @Description: TODO(班次误点扫描线程)
  21 + * @author PanZhao
22 22 * @date 2016年8月31日 下午3:09:02
23 23 *
24 24 */
... ... @@ -27,20 +27,20 @@ public class ScheduleLateThread extends Thread{
27 27  
28 28 @Autowired
29 29 DayOfSchedule dayOfSchedule;
30   -
  30 +
31 31 @Autowired
32 32 SendUtils sendUtils;
33   -
  33 +
34 34 private static Comparator<ScheduleRealInfo> cpm = new ScheduleComparator.FCSJ();
35   -
  35 +
36 36 @Override
37 37 public void run() {
38 38 List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll());
39 39 Collections.sort(all, cpm);
40   -
  40 +
41 41 long t = System.currentTimeMillis();
42 42 int size = all.size();
43   -
  43 +
44 44 ScheduleRealInfo sch;
45 45 for(int i = 0; i < size; i ++){
46 46 sch = all.get(i);
... ... @@ -67,4 +67,4 @@ public class ScheduleLateThread extends Thread{
67 67 }
68 68 }
69 69 }
70 70 -}
  71 +}
71 72 \ No newline at end of file
... ...
src/main/java/com/bsth/entity/oil/Ylb.java
... ... @@ -63,6 +63,11 @@ public class Ylb {
63 63 @Transient
64 64 private String gsname;
65 65  
  66 + @Transient
  67 + private String fgsname;
  68 +
  69 + @Transient
  70 + private String name;
66 71  
67 72 public Integer getId() {
68 73 return id;
... ... @@ -299,6 +304,22 @@ public class Ylb {
299 304 }
300 305  
301 306  
  307 + public String getFgsname() {
  308 + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm);
  309 + }
  310 +
  311 + public void setFgsname(String fgsname) {
  312 + this.fgsname = fgsname;
  313 + }
  314 +
  315 + public String getName() {
  316 + return BasicData.allPerson.get(this.jsy);
  317 + }
  318 +
  319 + public void setName(String name) {
  320 + this.name = name;
  321 + }
  322 +
302 323  
303 324  
304 325  
... ...
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
... ... @@ -56,7 +56,7 @@ public class OfflineServiceImpl implements OfflineService {
56 56 Object date=map.get("date");
57 57  
58 58 if(line!=null){
59   - sql +=" and line like'%"+line.toString()+"%'";
  59 + sql +=" and line like'%"+line.toString().trim()+"%'";
60 60 }
61 61  
62 62 if(nbbm!=null){
... ... @@ -131,6 +131,7 @@ public class OfflineServiceImpl implements OfflineService {
131 131 @SuppressWarnings("unchecked")
132 132 public PageObject <Offline> Pagequery(Map<String, Object> map) {
133 133 // TODO Auto-generated method stub
  134 +
134 135 String sql="select count(*) record from bsth_c_offline where 1=1 ";
135 136  
136 137 Object line=map.get("line");
... ... @@ -140,7 +141,7 @@ public class OfflineServiceImpl implements OfflineService {
140 141 Object date=map.get("date");
141 142  
142 143 if(line!=null){
143   - sql +=" and line like'%"+line.toString()+"%'";
  144 + sql +=" and line like'%"+line.toString().trim()+"%'";
144 145 }
145 146  
146 147 if(nbbm!=null){
... ... @@ -194,10 +195,9 @@ public class OfflineServiceImpl implements OfflineService {
194 195 Date datess = new Date(d1);
195 196 String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
196 197 String sk=new SimpleDateFormat("HH:mm").format(datess);
197   - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
198   - + " real_exec_date='"+dates+"' ";
199   -// + "and fcsj_actual > '"+sk+"' ";
200   -// + "and '"+sk+"' <dfsj";
  198 + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj"
  199 + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  200 + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ;
201 201 List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
202 202 new RowMapper<ScheduleRealInfo>(){
203 203 @Override
... ... @@ -208,20 +208,15 @@ public class OfflineServiceImpl implements OfflineService {
208 208 s.setLpName(rs.getString("lp_name"));
209 209 return s;
210 210 }
211   - });
212   - if(pbb.size()>0){
213   - list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
214   - list.get(i).setLpname(pbb.get(0).getLpName());
215   -
216   - }
217   -
  211 + });
  212 + if(pbb.size()>0){
  213 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  214 + list.get(i).setLpname(pbb.get(0).getLpName());
  215 + }
218 216 }
  217 +
219 218 PageObject<Offline> pageObject = pageHelper.getPageObject();
220   -// for (int i = 0; i < list.size(); i++) {
221   -// if(list.get(i).getLpname()!=null){
222 219 pageObject.setDataList(list);
223   -// }
224   -// }
225 220  
226 221 return pageObject;
227 222 }
... ...
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
... ... @@ -43,7 +43,7 @@ public class OutboundServiceImpl implements OutboundService{
43 43 Object updown=map.get("updown");
44 44 Object date=map.get("date");
45 45 if(line!=null){
46   - sql +=" and line like'%"+line.toString()+"%'";
  46 + sql +=" and line like'%"+line.toString().trim()+"%'";
47 47 }
48 48  
49 49 if(nbbm!=null){
... ... @@ -105,7 +105,7 @@ public class OutboundServiceImpl implements OutboundService{
105 105 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
106 106 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
107 107 outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
108   - outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
  108 +// outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
109 109 list.add(outbound);
110 110 }
111 111 return list;
... ... @@ -120,7 +120,7 @@ public class OutboundServiceImpl implements OutboundService{
120 120 Object updown=map.get("updown");
121 121 Object date=map.get("date");
122 122 if(line!=null){
123   - sql +=" and line like '%"+line.toString()+"%'";
  123 + sql +=" and line like '%"+line.toString().trim()+"%'";
124 124  
125 125 }
126 126  
... ... @@ -174,10 +174,9 @@ public class OutboundServiceImpl implements OutboundService{
174 174 Date datess = new Date(d1);
175 175 String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
176 176 String sk=new SimpleDateFormat("HH:mm").format(datess);
177   - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
178   - + " real_exec_date='"+dates+"' ";
179   -// + "and fcsj_actual > '"+sk+"' ";
180   -// + "and '"+sk+"' <dfsj";
  177 + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj"
  178 + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  179 + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ;
181 180 List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
182 181 new RowMapper<ScheduleRealInfo>(){
183 182 @Override
... ...
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
... ... @@ -46,7 +46,7 @@ public class SpeedingServiceImpl implements SpeedingService {
46 46 Object date=map.get("date");
47 47  
48 48 if(line!=null){
49   - sql +=" and line like'%"+line.toString()+"%'";
  49 + sql +=" and line like'%"+line.toString().trim()+"%'";
50 50 }
51 51  
52 52 if(nbbm!=null){
... ... @@ -125,7 +125,7 @@ public class SpeedingServiceImpl implements SpeedingService {
125 125 Object date=map.get("date");
126 126  
127 127 if(line!=null){
128   - sql +=" and line like'%"+line.toString()+"%'";
  128 + sql +=" and line like'%"+line.toString().trim()+"%'";
129 129 }
130 130  
131 131 if(nbbm!=null){
... ... @@ -177,10 +177,9 @@ public class SpeedingServiceImpl implements SpeedingService {
177 177 Date datess = new Date(d1);
178 178 String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
179 179 String sk=new SimpleDateFormat("HH:mm").format(datess);
180   - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
181   - + " real_exec_date='"+dates+"' ";
182   -// + "and fcsj_actual > '"+sk+"' ";
183   -// + "and '"+sk+"' <dfsj";
  180 + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj"
  181 + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  182 + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ;
184 183 List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
185 184 new RowMapper<ScheduleRealInfo>(){
186 185 @Override
... ...
src/main/java/com/bsth/service/forms/FormsService.java
... ... @@ -31,7 +31,7 @@ public interface FormsService {
31 31  
32 32 public List<Singledata> singledata(Map<String, Object> map);
33 33  
34   - public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line,String data);
  34 + public List<Vehicleloading> vehicleloading(String line,String data);
35 35  
36 36 public List<Operationservice> operationservice(Map<String, Object> map);
37 37  
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -25,7 +25,9 @@ import com.bsth.entity.mcy_forms.Singledata;
25 25 import com.bsth.entity.mcy_forms.Turnoutrate;
26 26 import com.bsth.entity.mcy_forms.Vehicleloading;
27 27 import com.bsth.entity.mcy_forms.Waybillday;
  28 +import com.bsth.entity.oil.Ylb;
28 29 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  30 +import com.bsth.repository.oil.YlbRepository;
29 31 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
30 32 import com.bsth.data.BasicData;
31 33 import com.bsth.entity.mcy_forms.Allline;
... ... @@ -55,6 +57,9 @@ public class FormsServiceImpl implements FormsService {
55 57  
56 58 @Autowired
57 59 CulateMileageService culateMileageService;
  60 +
  61 + @Autowired
  62 + YlbRepository ylbRepository;
58 63  
59 64 // 行车路单日报表
60 65 @Override
... ... @@ -417,7 +422,19 @@ public class FormsServiceImpl implements FormsService {
417 422 // 路单数据
418 423 @Override
419 424 public List<Singledata> singledata(Map<String, Object> map) {
420   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  425 +
  426 + String gsdm="";
  427 + if(map.get("gsdmSing")!=null){
  428 + gsdm=map.get("gsdmSing").toString();
  429 + }
  430 + String fgsdm="";
  431 + if(map.get("fgsdmSing")!=null){
  432 + fgsdm=map.get("fgsdmSing").toString();
  433 + }
  434 +
  435 + String xlbm=map.get("line").toString().trim();
  436 +
  437 + /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
421 438 SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
422 439 Date d = null;
423 440 Date d1 = null;
... ... @@ -429,60 +446,92 @@ public class FormsServiceImpl implements FormsService {
429 446 e.printStackTrace();
430 447 }
431 448 String rq2 = sdf1.format(d);
432   - String rq3 = sdf1.format(d1);
  449 + String rq3 = sdf1.format(d1);*/
433 450  
434   - rq = rq2 + "-" + rq3;
  451 +// rq = rq2 + "-" + rq3;
435 452 startDate = map.get("startDate").toString();
436   - endDate = map.get("endDate").toString();
437   - String sql = "select t.*,y.yh,y.jzl from ("
438   - + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
439   - + " from bsth_c_s_sp_info_real r where r.schedule_date_str "
440   - + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' "
441   - + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' "
442   - + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' "
443   - + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t "
444   - + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl "
445   - + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and "
446   - + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' "
447   - + "group by a.nbbm,a.jsy) y"
448   - + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh";
  453 +// endDate = map.get("endDate").toString();
  454 +// String sql = "select t.*,y.yh,y.jzl from ("
  455 +// + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  456 +// + " from bsth_c_s_sp_info_real r where r.schedule_date_str "
  457 +// + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' "
  458 +// + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' "
  459 +// + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' "
  460 +// + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t "
  461 +// + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl "
  462 +// + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and "
  463 +// + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' "
  464 +// + "group by a.nbbm,a.jsy) y"
  465 +// + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh";
449 466  
  467 + String sql="select r.s_gh,r.s_name, "
  468 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  469 + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'";
  470 + if(xlbm.equals("")){
  471 + sql +="and r.gs_bm='"+gsdm+"' "
  472 + + " and r.fgs_bm='"+fgsdm+"'";
  473 + }else{
  474 + sql += " and r.xl_bm = '"+xlbm+"'";
  475 + }
  476 + sql += " group by r.s_gh,r.s_name,"
  477 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm";
  478 +
450 479 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
451 480 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
452 481 @Override
453 482 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
454 483 Singledata sin = new Singledata();
455   - sin.setrQ(rq);
456   - sin.setgS(arg0.getString("gs_bm"));
  484 + sin.setrQ(startDate);
457 485 sin.setxL(arg0.getString("xl_name"));
458 486 sin.setClzbh(arg0.getString("cl_zbh"));
459 487 sin.setJsy(arg0.getString("j_gh"));
460 488 sin.setjName(arg0.getString("j_name"));
461   - sin.setHyl(arg0.getString("YH"));
462   - sin.setJzl(arg0.getString("JZL"));
463   - // sin.setJzl(arg0.getString(""));//非营业性用油
464   - sin.setJhjl(arg0.getString("JZL"));
  489 + sin.setSgh(arg0.getString("s_gh"));
  490 + sin.setsName(arg0.getString("s_name"));
  491 + sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm")));
465 492  
466 493 return sin;
467 494 }
468 495 });
469   - DecimalFormat df = new DecimalFormat("0.00");
470   - for(int i=0;i<list.size();i++){
471   -
472   - Singledata si=list.get(i);
473   - si.setgS(BasicData.businessCodeNameMap.get(si.getgS()));
474   - si.setJzl(df.format(Double.parseDouble(si.getJzl())));
475   - si.setHyl(df.format(Double.parseDouble(si.getHyl())));
476   - Map<String, Object> maps = new HashMap<>();
477   - maps = commonService.findKMBC1(si.getjName(),si.getClzbh(), startDate,
478   - endDate);
479   - //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString());
480   - si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString());
481   - si.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString());
482   - si.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString());
483   - si.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString());
484   - si.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString());
485 496  
  497 + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm");
  498 + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(xlbm, startDate);
  499 + for (int i = 0; i < list.size(); i++) {
  500 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  501 + Singledata sin=list.get(i);
  502 + String jsy=sin.getJsy();
  503 + String clzbh=sin.getClzbh();
  504 + for (int j = 0; j < listReal.size(); j++) {
  505 + ScheduleRealInfo s=listReal.get(j);
  506 + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){
  507 + newList.add(s);
  508 + }
  509 + }
  510 +
  511 + double jhgl=culateMileageService.culateJhgl(newList);
  512 + double yygl=culateMileageService.culateSjgl(newList);
  513 + double ljgl=culateMileageService.culateLjgl(newList);
  514 + double ksgl=culateMileageService.culateKsgl(newList);
  515 + double jcgl=culateMileageService.culateJccgl(newList);
  516 + double zyygl=Arith.add(yygl, ljgl);
  517 + double zksgl=Arith.add(ksgl, jcgl);
  518 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  519 + sin.setEmptMileage(String.valueOf(zksgl));
  520 + sin.setJhjl(String.valueOf(jhgl));
  521 + double yhl=0.0;
  522 + double jzl=0.0;
  523 + double fyy=0.0;
  524 + for (int j = 0; j < listYlb.size(); j++) {
  525 + Ylb y=listYlb.get(j);
  526 + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){
  527 + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh());
  528 + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl());
  529 + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh());
  530 + }
  531 + }
  532 + sin.setHyl(String.valueOf(yhl));
  533 + sin.setJzl(String.valueOf(jzl));
  534 + sin.setUnyyyl(String.valueOf(fyy));
486 535 }
487 536 return list;
488 537 }
... ... @@ -545,50 +594,72 @@ public class FormsServiceImpl implements FormsService {
545 594  
546 595 // 车辆加注
547 596 @Override
548   - public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line, String date) {
  597 + public List<Vehicleloading> vehicleloading(String line, String date) {
549 598  
550   - String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
551   - + " FROM bsth_c_s_sp_info_real r "
552   - + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
553   - + " where to_days(y.RQ)=to_days('" + date + "') and y.XLBM= '" + line + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y "
554   - + " on r.cl_zbh=y.nbbm "
555   - + " where to_days(r.schedule_date_str)=to_days('" + date + "')"
556   - + " and r.xl_bm='" + line + "' "
557   - + " AND r.gs_bm is not null"
558   - + " and r.bc_type not in('in','out')";
559   - if(gsdmVehic.toString()!=""){
560   - sql+=" and r.gs_bm='"+gsdmVehic+"'";
561   - }
562   - if(fgsdmVehic.toString()!=""){
563   - sql+=" and r.fgs_bm='"+fgsdmVehic +"'";
564   - }
565   - sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
  599 + String sql="select r.s_gh,r.s_name, "
  600 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  601 + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+date+"' "
  602 + + " and r.xl_bm = '"+line+"' group by r.s_gh,r.s_name,"
  603 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm";
  604 +
566 605 List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() {
567 606 @Override
568 607 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
569 608 Vehicleloading ve = new Vehicleloading();
570   - ve.setrQ(arg0.getString("schedule_date_str"));
571   - ve.setgS(arg0.getString("gs_name"));
  609 + ve.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm")));
572 610 ve.setxL(arg0.getString("xl_name"));
573 611 ve.setClzbh(arg0.getString("cl_zbh"));
574   - ve.setJzl(arg0.getString("JZL"));
575   - ve.setHyl(arg0.getString("YH"));
576   - // ve.setLs(arg0.getString("").toString());//尿素
577 612 ve.setJgh(arg0.getString("j_gh").toString());
578 613 return ve;
579 614 }
580 615 });
581 616  
582   - for(int i=0;i<list.size();i++){
583   - Vehicleloading v=list.get(i);
584   - Map<String, Object> maps = new HashMap<>();
585   - maps = commonService.findKMBC2(v.getJgh(), v.getClzbh(),
586   - v.getrQ());
587   - v.setJhlc(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString());
588   - v.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次
589   - v.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次
590   - }
591 617  
  618 + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, "", "", line, "", "xlbm");
  619 + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  620 + for (int i = 0; i < list.size(); i++) {
  621 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  622 + Vehicleloading sin=list.get(i);
  623 + sin.setrQ(date);
  624 + String jsy=sin.getJgh();
  625 + String clzbh=sin.getClzbh();
  626 + for (int j = 0; j < listReal.size(); j++) {
  627 + ScheduleRealInfo s=listReal.get(j);
  628 + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){
  629 + newList.add(s);
  630 + }
  631 + }
  632 +
  633 + int jhbc=culateMileageService.culateJhbc(newList, "");
  634 + int sjbc=culateMileageService.culateSjbc(newList, "");
  635 + int ljbc=culateMileageService.culateLjbc(newList, "");
  636 + double yygl=culateMileageService.culateSjgl(newList);
  637 + double ljgl=culateMileageService.culateLjgl(newList);
  638 + double ksgl=culateMileageService.culateKsgl(newList);
  639 + double jcgl=culateMileageService.culateJccgl(newList);
  640 + double zyygl=Arith.add(yygl, ljgl);
  641 + double zksgl=Arith.add(ksgl, jcgl);
  642 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  643 + sin.setJhbc(String.valueOf(jhbc));
  644 + sin.setSjbc(String.valueOf(sjbc+ljbc));
  645 + double yhl=0.0;
  646 + double jzl=0.0;
  647 + double fyy=0.0;
  648 + double ns=0.0;
  649 + for (int j = 0; j < listYlb.size(); j++) {
  650 + Ylb y=listYlb.get(j);
  651 + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){
  652 + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh());
  653 + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl());
  654 + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh());
  655 + ns =Arith.add(ns, y.getNs()==null?0:y.getNs());
  656 + }
  657 + }
  658 + sin.setHyl(String.valueOf(yhl));
  659 + sin.setJzl(String.valueOf(jzl));
  660 + sin.setUnyyyl(String.valueOf(fyy));
  661 + sin.setLs(String.valueOf(ns));
  662 + }
592 663 return list;
593 664 }
594 665  
... ... @@ -816,7 +887,7 @@ public class FormsServiceImpl implements FormsService {
816 887 }
817 888  
818 889 String fgsbm="";
819   - if(map.get("fgsdmDaily").toString()!=null){
  890 + if(map.get("fgsdmDaily")!=null){
820 891 fgsbm=map.get("fgsdmDaily").toString();
821 892 }
822 893  
... ... @@ -853,6 +924,12 @@ public class FormsServiceImpl implements FormsService {
853 924 for(int i=0;i<list.size();i++){
854 925 sList =new ArrayList<ScheduleRealInfo>();
855 926 Daily d=list.get(i);
  927 + if(d.getYh()==null){
  928 + d.setYh("0");
  929 + }else{
  930 + if(d.getYh().equals(""))
  931 + d.setYh("0");
  932 + }
856 933 for (int j = 0; j < lists.size(); j++) {
857 934 ScheduleRealInfo s=lists.get(j);
858 935 if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
... ...
src/main/java/com/bsth/service/realcontrol/DataManagerService.java
1   -package com.bsth.service.realcontrol;
2   -
3   -import java.util.Map;
4   -
5   -/**
6   - * Created by panzhao on 2017/4/18.
7   - */
8   -public interface DataManagerService {
9   -
10   - Map<String, Object> carInfos(Integer lineId);
11   -
12   - Map<String,Object> updateDevices(String jsonStr);
13   -}
  1 +package com.bsth.service.realcontrol;
  2 +
  3 +import java.util.Map;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/4/18.
  7 + */
  8 +public interface DataManagerService {
  9 +
  10 + Map<String, Object> carInfos(Integer lineId);
  11 +
  12 + Map<String,Object> updateDevices(String jsonStr);
  13 +}
... ...
src/main/java/com/bsth/service/realcontrol/impl/DataManagerServiceImpl.java
1   -package com.bsth.service.realcontrol.impl;
2   -
3   -import com.alibaba.fastjson.JSONArray;
4   -import com.alibaba.fastjson.JSONObject;
5   -import com.bsth.common.ResponseCode;
6   -import com.bsth.data.BasicData;
7   -import com.bsth.entity.Cars;
8   -import com.bsth.repository.CarsRepository;
9   -import com.bsth.service.realcontrol.DataManagerService;
10   -import com.bsth.util.db.DBUtils_oldSystem;
11   -import org.slf4j.Logger;
12   -import org.slf4j.LoggerFactory;
13   -import org.springframework.beans.factory.annotation.Autowired;
14   -import org.springframework.jdbc.core.JdbcTemplate;
15   -import org.springframework.stereotype.Service;
16   -
17   -import java.util.ArrayList;
18   -import java.util.HashMap;
19   -import java.util.List;
20   -import java.util.Map;
21   -
22   -/**
23   - * Created by panzhao on 2017/4/18.
24   - */
25   -@Service
26   -public class DataManagerServiceImpl implements DataManagerService{
27   -
28   - @Autowired
29   - CarsRepository carsRepository;
30   -
31   - @Autowired
32   - JdbcTemplate controlJdbcTemp;
33   -
34   - @Autowired
35   - BasicData.BasicDataLoader dataLoader;
36   -
37   - Logger logger = LoggerFactory.getLogger(this.getClass());
38   -
39   - @Override
40   - public Map<String, Object> carInfos(Integer lineId) {
41   -
42   - Map<String, Object> rs = new HashMap<>();
43   - try {
44   - List<Map<String, String>> nowData = new ArrayList<>();
45   - List<Map<String, String>> oldData = new ArrayList<>();
46   - Map<String, String> map;
47   -
48   - //查询新系统车辆信息
49   - List<Cars> list = carsRepository.findCarsByLineId(lineId);
50   - for(Cars c : list){
51   - map = new HashMap<>();
52   - map.put("nbbm", c.getInsideCode());
53   - map.put("device", c.getEquipmentCode());
54   - nowData.add(map);
55   - }
56   -
57   - //获取老系统数据
58   - JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_oldSystem.getDataSource());
59   - List<Map<String, Object>> oyList = jdbcTemplate.queryForList("select NBBM,SBBH from JJWGPS_T_CLXXB t where xlbm=?", BasicData.lineId2CodeMap.get(lineId));
60   - for(Map<String, Object> tempMap : oyList){
61   - map = new HashMap<>();
62   - map.put("nbbm", tempMap.get("NBBM").toString());
63   - map.put("device", tempMap.get("SBBH").toString());
64   - oldData.add(map);
65   - }
66   -
67   - rs.put("status", ResponseCode.SUCCESS);
68   - rs.put("nows", nowData);
69   - rs.put("olds", oldData);
70   - }catch (Exception e){
71   - logger.error("", e);
72   - rs.put("status", ResponseCode.ERROR);
73   - rs.put("msg", e.getMessage());
74   - }
75   -
76   - return rs;
77   - }
78   -
79   - /**
80   - * 更新设备号
81   - * @param jsonStr
82   - * @return
83   - */
84   - @Override
85   - public Map<String, Object> updateDevices(String jsonStr) {
86   - Map<String, Object> rs = new HashMap<>();
87   - try {
88   - int count=0;
89   - JSONArray array = JSONArray.parseArray(jsonStr);
90   - JSONObject jObj;
91   - for(int i = 0; i < array.size(); i ++){
92   - jObj = array.getJSONObject(i);
93   - count += controlJdbcTemp.update("update bsth_c_cars set equipment_code=? where inside_code=?"
94   - , jObj.getString("device"), jObj.getString("nbbm"));
95   - }
96   -
97   - //刷新缓存
98   - dataLoader.loadDeviceInfo();
99   - rs.put("status", ResponseCode.SUCCESS);
100   - rs.put("count", count);
101   - }catch (Exception e){
102   - logger.error("", e);
103   - rs.put("status", ResponseCode.ERROR);
104   - rs.put("msg", e.getMessage());
105   - }
106   - return rs;
107   - }
108   -}
  1 +package com.bsth.service.realcontrol.impl;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.common.ResponseCode;
  6 +import com.bsth.data.BasicData;
  7 +import com.bsth.entity.Cars;
  8 +import com.bsth.repository.CarsRepository;
  9 +import com.bsth.service.realcontrol.DataManagerService;
  10 +import com.bsth.util.db.DBUtils_oldSystem;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.jdbc.core.JdbcTemplate;
  15 +import org.springframework.stereotype.Service;
  16 +
  17 +import java.util.ArrayList;
  18 +import java.util.HashMap;
  19 +import java.util.List;
  20 +import java.util.Map;
  21 +
  22 +/**
  23 + * Created by panzhao on 2017/4/18.
  24 + */
  25 +@Service
  26 +public class DataManagerServiceImpl implements DataManagerService{
  27 +
  28 + @Autowired
  29 + CarsRepository carsRepository;
  30 +
  31 + @Autowired
  32 + JdbcTemplate controlJdbcTemp;
  33 +
  34 + @Autowired
  35 + BasicData.BasicDataLoader dataLoader;
  36 +
  37 + Logger logger = LoggerFactory.getLogger(this.getClass());
  38 +
  39 + @Override
  40 + public Map<String, Object> carInfos(Integer lineId) {
  41 +
  42 + Map<String, Object> rs = new HashMap<>();
  43 + try {
  44 + List<Map<String, String>> nowData = new ArrayList<>();
  45 + List<Map<String, String>> oldData = new ArrayList<>();
  46 + Map<String, String> map;
  47 +
  48 + //查询新系统车辆信息
  49 + List<Cars> list = carsRepository.findCarsByLineId(lineId);
  50 + for(Cars c : list){
  51 + map = new HashMap<>();
  52 + map.put("nbbm", c.getInsideCode());
  53 + map.put("device", c.getEquipmentCode());
  54 + nowData.add(map);
  55 + }
  56 +
  57 + //获取老系统数据
  58 + JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_oldSystem.getDataSource());
  59 + List<Map<String, Object>> oyList = jdbcTemplate.queryForList("select NBBM,SBBH from JJWGPS_T_CLXXB t where xlbm=?", BasicData.lineId2CodeMap.get(lineId));
  60 + for(Map<String, Object> tempMap : oyList){
  61 + map = new HashMap<>();
  62 + map.put("nbbm", tempMap.get("NBBM").toString());
  63 + map.put("device", tempMap.get("SBBH").toString());
  64 + oldData.add(map);
  65 + }
  66 +
  67 + rs.put("status", ResponseCode.SUCCESS);
  68 + rs.put("nows", nowData);
  69 + rs.put("olds", oldData);
  70 + }catch (Exception e){
  71 + logger.error("", e);
  72 + rs.put("status", ResponseCode.ERROR);
  73 + rs.put("msg", e.getMessage());
  74 + }
  75 +
  76 + return rs;
  77 + }
  78 +
  79 + /**
  80 + * 更新设备号
  81 + * @param jsonStr
  82 + * @return
  83 + */
  84 + @Override
  85 + public Map<String, Object> updateDevices(String jsonStr) {
  86 + Map<String, Object> rs = new HashMap<>();
  87 + try {
  88 + int count=0;
  89 + JSONArray array = JSONArray.parseArray(jsonStr);
  90 + JSONObject jObj;
  91 + for(int i = 0; i < array.size(); i ++){
  92 + jObj = array.getJSONObject(i);
  93 + count += controlJdbcTemp.update("update bsth_c_cars set equipment_code=? where inside_code=?"
  94 + , jObj.getString("device"), jObj.getString("nbbm"));
  95 + }
  96 +
  97 + //刷新缓存
  98 + dataLoader.loadDeviceInfo();
  99 + rs.put("status", ResponseCode.SUCCESS);
  100 + rs.put("count", count);
  101 + }catch (Exception e){
  102 + logger.error("", e);
  103 + rs.put("status", ResponseCode.ERROR);
  104 + rs.put("msg", e.getMessage());
  105 + }
  106 + return rs;
  107 + }
  108 +}
... ...
src/main/java/com/bsth/util/db/DBUtils_oldSystem.java
1   -package com.bsth.util.db;
2   -
3   -import com.mchange.v2.c3p0.DataSources;
4   -import org.apache.log4j.Logger;
5   -
6   -import javax.sql.DataSource;
7   -import java.sql.Connection;
8   -import java.sql.ResultSet;
9   -import java.sql.SQLException;
10   -import java.sql.Statement;
11   -import java.util.HashMap;
12   -import java.util.Map;
13   -
14   -/**
15   - * 老系统数据库连接池(保持少量的连接,不会对老系统有什么影响)
16   - * @author PanZhao
17   - *
18   - */
19   -//@Component
20   -public class DBUtils_oldSystem {
21   -
22   - private static String url = null;
23   -
24   - private static String username = null;
25   -
26   - private static String pwd = null;
27   -
28   - private static DataSource ds_pooled;
29   -
30   - static Logger logger = Logger.getLogger(DBUtils_oldSystem.class);
31   -
32   - static {
33   -
34   - try {
35   - // 1. 加载驱动类
36   - Class.forName("oracle.jdbc.driver.OracleDriver");
37   -
38   - url = "jdbc:oracle:thin:@10.10.200.225:1521:orcl";
39   - username = "jjwgps";
40   - pwd = "jjwgps";
41   -
42   - // 设置连接数据库的配置信息
43   - DataSource ds_unpooled = DataSources.unpooledDataSource(url,
44   - username, pwd);
45   -
46   - Map<String, Object> pool_conf = new HashMap<String, Object>();
47   - // 设置最大连接数
48   - pool_conf.put("maxPoolSize", 5);
49   -
50   - pool_conf.put("testConnectionOnCheckout", false);
51   - //异步检测连接的有效性
52   - pool_conf.put("testConnectionOnCheckin", true);
53   - //10分钟检测一次
54   - pool_conf.put("idleConnectionTestPeriod", 60 * 10);
55   - ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf);
56   - } catch (ClassNotFoundException e) {
57   - logger.error(e.toString());
58   - e.printStackTrace();
59   - } catch (SQLException e) {
60   - logger.error("初始化老系统连接池失败,非正式环境请忽略这个问题!");
61   - logger.error(e.toString());
62   - e.printStackTrace();
63   - }
64   - }
65   -
66   - /**
67   - * 获取连接对象
68   - */
69   - public static Connection getConnection() throws SQLException {
70   - return ds_pooled.getConnection();
71   - }
72   -
73   - /**
74   - * 释放连接池资源
75   - */
76   - public static void clearup() {
77   - if (ds_pooled != null) {
78   - try {
79   - DataSources.destroy(ds_pooled);
80   - } catch (SQLException e) {
81   - logger.error(e.toString());
82   - e.printStackTrace();
83   - }
84   - }
85   - }
86   -
87   - /**
88   - * 资源关闭
89   - *
90   - * @param rs
91   - * @param stmt
92   - * @param conn
93   - */
94   - public static void close(ResultSet rs, Statement stmt, Connection conn) {
95   - if (rs != null) {
96   - try {
97   - rs.close();
98   - } catch (SQLException e) {
99   - logger.error(e.toString());
100   - e.printStackTrace();
101   - }
102   - }
103   -
104   - if (stmt != null) {
105   - try {
106   - stmt.close();
107   - } catch (SQLException e) {
108   - logger.error(e.toString());
109   - e.printStackTrace();
110   - }
111   - }
112   -
113   - if (conn != null) {
114   - try {
115   - conn.close();
116   - } catch (SQLException e) {
117   - logger.error(e.toString());
118   - e.printStackTrace();
119   - }
120   - }
121   - }
122   -
123   - public static DataSource getDataSource(){
124   - return ds_pooled;
125   - }
126   -}
  1 +package com.bsth.util.db;
  2 +
  3 +import com.mchange.v2.c3p0.DataSources;
  4 +import org.apache.log4j.Logger;
  5 +
  6 +import javax.sql.DataSource;
  7 +import java.sql.Connection;
  8 +import java.sql.ResultSet;
  9 +import java.sql.SQLException;
  10 +import java.sql.Statement;
  11 +import java.util.HashMap;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 老系统数据库连接池(保持少量的连接,不会对老系统有什么影响)
  16 + * @author PanZhao
  17 + *
  18 + */
  19 +//@Component
  20 +public class DBUtils_oldSystem {
  21 +
  22 + private static String url = null;
  23 +
  24 + private static String username = null;
  25 +
  26 + private static String pwd = null;
  27 +
  28 + private static DataSource ds_pooled;
  29 +
  30 + static Logger logger = Logger.getLogger(DBUtils_oldSystem.class);
  31 +
  32 + static {
  33 +
  34 + try {
  35 + // 1. 加载驱动类
  36 + Class.forName("oracle.jdbc.driver.OracleDriver");
  37 +
  38 + url = "jdbc:oracle:thin:@10.10.200.225:1521:orcl";
  39 + username = "jjwgps";
  40 + pwd = "jjwgps";
  41 +
  42 + // 设置连接数据库的配置信息
  43 + DataSource ds_unpooled = DataSources.unpooledDataSource(url,
  44 + username, pwd);
  45 +
  46 + Map<String, Object> pool_conf = new HashMap<String, Object>();
  47 + // 设置最大连接数
  48 + pool_conf.put("maxPoolSize", 5);
  49 +
  50 + pool_conf.put("testConnectionOnCheckout", false);
  51 + //异步检测连接的有效性
  52 + pool_conf.put("testConnectionOnCheckin", true);
  53 + //10分钟检测一次
  54 + pool_conf.put("idleConnectionTestPeriod", 60 * 10);
  55 + ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf);
  56 + } catch (ClassNotFoundException e) {
  57 + logger.error(e.toString());
  58 + e.printStackTrace();
  59 + } catch (SQLException e) {
  60 + logger.error("初始化老系统连接池失败,非正式环境请忽略这个问题!");
  61 + logger.error(e.toString());
  62 + e.printStackTrace();
  63 + }
  64 + }
  65 +
  66 + /**
  67 + * 获取连接对象
  68 + */
  69 + public static Connection getConnection() throws SQLException {
  70 + return ds_pooled.getConnection();
  71 + }
  72 +
  73 + /**
  74 + * 释放连接池资源
  75 + */
  76 + public static void clearup() {
  77 + if (ds_pooled != null) {
  78 + try {
  79 + DataSources.destroy(ds_pooled);
  80 + } catch (SQLException e) {
  81 + logger.error(e.toString());
  82 + e.printStackTrace();
  83 + }
  84 + }
  85 + }
  86 +
  87 + /**
  88 + * 资源关闭
  89 + *
  90 + * @param rs
  91 + * @param stmt
  92 + * @param conn
  93 + */
  94 + public static void close(ResultSet rs, Statement stmt, Connection conn) {
  95 + if (rs != null) {
  96 + try {
  97 + rs.close();
  98 + } catch (SQLException e) {
  99 + logger.error(e.toString());
  100 + e.printStackTrace();
  101 + }
  102 + }
  103 +
  104 + if (stmt != null) {
  105 + try {
  106 + stmt.close();
  107 + } catch (SQLException e) {
  108 + logger.error(e.toString());
  109 + e.printStackTrace();
  110 + }
  111 + }
  112 +
  113 + if (conn != null) {
  114 + try {
  115 + conn.close();
  116 + } catch (SQLException e) {
  117 + logger.error(e.toString());
  118 + e.printStackTrace();
  119 + }
  120 + }
  121 + }
  122 +
  123 + public static DataSource getDataSource(){
  124 + return ds_pooled;
  125 + }
  126 +}
... ...
src/main/resources/static/pages/forms/mould/list.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/vehicleloading.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -92,8 +92,7 @@
92 92  
93 93 <script>
94 94 $(function(){
95   - var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};
96   - var fage=false;
  95 +
97 96 // 关闭左侧栏
98 97 if (!$('body').hasClass('page-sidebar-closed'))
99 98 $('.menu-toggler.sidebar-toggler').click();
... ... @@ -102,6 +101,7 @@
102 101 format : 'YYYY-MM-DD',
103 102 locale : 'zh-cn'
104 103 });
  104 + var fage=false;
105 105 var xlList;
106 106 var obj = [];
107 107  
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -551,7 +551,7 @@ letter-spacing: 20px;
551 551 <td>{{obj.fast}}</td>
552 552 <td>{{obj.slow}}</td>
553 553 <td>{{obj.fcsj}}</td>
554   - <td style="word-break: keep-all;white-space:nowrap;">{{obj.fcsjActual}}
  554 + <td>{{obj.fcsjActual}}
555 555 {{if obj.bcType== "in"}}
556 556 (进)
557 557 {{/if}}
... ...
src/main/resources/static/pages/mforms/operationservices/operationservice.html
... ... @@ -42,19 +42,20 @@
42 42 class="form-control" name="subCompany" id="fgsdmOperat"
43 43 style="width: 140px;"></select>
44 44 </div>
45   - <div style="display: inline-block;">
  45 + <div style="margin-top: 2px"></div>
  46 + <div style="display: inline-block;margin-left: 33px;">
46 47 <span class="item-label" style="width: 80px;">线路: </span> <select
47   - class="form-control" name="line" id="line" style="width: 180px;"></select>
  48 + class="form-control" name="line" id="line" style="width: 140px;"></select>
48 49 </div>
49 50 <div style="display: inline-block; margin-left: 15px;">
50 51 <span class="item-label" style="width: 80px;">开始时间: </span> <input
51 52 class="form-control" type="text" id="startDate"
52   - style="width: 120px;" />
  53 + style="width: 140px;" />
53 54 </div>
54 55 <div style="display: inline-block; margin-left: 15px;">
55 56 <span class="item-label" style="width: 80px;">结束时间: </span> <input
56 57 class="form-control" type="text" id="endDate"
57   - style="width: 120px;" />
  58 + style="width: 140px;" />
58 59 </div>
59 60 <div style="display: inline-block; margin-left: 15px">
60 61 <span class="item-label" style="width: 150px;">统计: </span>
... ... @@ -102,69 +103,94 @@
102 103 format : 'YYYY-MM-DD',
103 104 locale : 'zh-cn'
104 105 });
  106 +
  107 + var d = new Date();
  108 + var year = d.getFullYear();
  109 + var month = d.getMonth() + 1;
  110 + var day = d.getDate();
  111 + if(month < 10)
  112 + month = "0" + month;
  113 + if(day < 10)
  114 + day = "0" + day;
  115 + $("#startDate").val(year + "-" + month + "-" + day);
  116 + $("#endDate").val(year + "-" + month + "-" + day);
105 117  
106   - $.get('/basic/lineCode2Name', function(result) {
107   - var data = [];
108   -
109   - for ( var code in result) {
110   - data.push({
111   - id : code,
112   - text : result[code]
113   - });
114   - }
115   - initPinYinSelect2('#line', data, '');
116   -
117   - })
118   -
  118 + var fage=false;
  119 + var xlList;
119 120 var obj = [];
120   - $.get('/user/companyData', function(result) {
121   - obj = result;
122   - var options = '';
123   - for (var i = 0; i < obj.length; i++) {
124   - options += '<option value="'+obj[i].companyCode+'">'
125   - + obj[i].companyName + '</option>';
126   - }
127   -
128   - if (obj.length == 0) {
129   - $("#gsdmDiv_operat").css('display', 'none');
130   - $('#fgsdmDiv_operat').css('display', 'none');
131   - } else if (obj.length == 1) {
132   - $("#gsdmDiv_operat").css('display', 'none');
133   - if (obj[0].children.length == 1 || obj[0].children.length == 0)
134   - $('#fgsdmDiv_operat').css('display', 'none');
135   - }
136   - $('#gsdmOperat').html(options);
137   - updateCompany();
138   - });
139   -
140   - $("#gsdmOperat").on("change", updateCompany);
141   - function updateCompany() {
  121 +
  122 +
  123 + $.get('/report/lineList',function(result){
  124 + xlList=result;
  125 + $.get('/user/companyData', function(result){
  126 + obj = result;
  127 + var options = '';
  128 + for(var i = 0; i < obj.length; i++){
  129 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  130 + }
  131 +
  132 + if(obj.length ==0){
  133 + $("#gsdmDiv_operat").css('display','none');
  134 + }else if(obj.length ==1){
  135 + $("#gsdmDiv_operat").css('display','none');
  136 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  137 + $('#fgsdmDiv_operat').css('display','none');
  138 + }
  139 + $('#gsdmOperat').html(options);
  140 + updateCompany();
  141 + });
  142 + })
  143 + $("#gsdmOperat").on("change",updateCompany);
  144 + function updateCompany(){
142 145 var company = $('#gsdmOperat').val();
143 146 var options = '';
144   - for (var i = 0; i < obj.length; i++) {
145   - if (obj[i].companyCode == company) {
  147 + for(var i = 0; i < obj.length; i++){
  148 + if(obj[i].companyCode == company){
146 149 var children = obj[i].children;
147   - for (var j = 0; j < children.length; j++) {
148   - options += '<option value="'+children[j].code+'">'
149   - + children[j].name + '</option>';
  150 + for(var j = 0; j < children.length; j++){
  151 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
150 152 }
151 153 }
152 154 }
153 155 $('#fgsdmOperat').html(options);
  156 + initXl();
154 157 }
155 158  
156   - $.get('/basic/lineCode2Name', function(result) {
157   - var data = [];
158   -
159   - for ( var code in result) {
160   - data.push({
161   - id : code,
162   - text : result[code]
163   - });
  159 + /* $.get('/basic/lineCode2Name',function(result){
  160 + var data=[];
  161 +
  162 + for(var code in result){
  163 + data.push({id: code, text: result[code]});
164 164 }
165   - initPinYinSelect2('#line', data, '');
166   -
167   - })
  165 + initPinYinSelect2('#line',data,'');
  166 +
  167 + }) */
  168 +
  169 + $("#fgsdmOperat").on("change",initXl);
  170 + function initXl(){
  171 + var data=[];
  172 + if(fage){
  173 + $("#line").select2("destroy").html('');
  174 + }
  175 + var fgs=$('#fgsdmOperat').val();
  176 + var gs=$('#gsdmOperat').val();
  177 + for(var i=0;i<xlList.length;i++){
  178 + if(gs!=""){
  179 + if(fgs!=""){
  180 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  181 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  182 + }
  183 + }else{
  184 + if(xlList[i]["gsbm"]==gs){
  185 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  186 + }
  187 + }
  188 + }
  189 + }
  190 + initPinYinSelect2('#line',data,'');
  191 + fage=true;
  192 + }
  193 +
168 194  
169 195 $("#query").on(
170 196 "click",
... ...
src/main/resources/static/pages/mforms/singledatas/singledata.html
... ... @@ -37,18 +37,14 @@
37 37 <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
38 38 </div>
39 39 <div style="display: inline-block;">
40   - <span class="item-label" style="width: 80px;">线路: </span>
41   - <select class="form-control" name="line" id="line" style="width: 136px;"></select>
  40 + <span class="item-label" style="width: 80px;">&nbsp;线路: </span>
  41 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
42 42 </div>
43   - <div style="margin-top: 10px"></div>
44 43 <div style="display: inline-block;margin-left: 15px;">
45   - <span class="item-label" style="width: 80px;">开始时间: </span>
46   - <input class="form-control" type="text" id="startDate" style="width: 120px;"/>
47   - </div>
48   - <div style="display: inline-block;margin-left: 15px;">
49   - <span class="item-label" style="width: 80px;">结束时间: </span>
50   - <input class="form-control" type="text" id="endDate" style="width: 120px;"/>
  44 + <span class="item-label" style="width: 140px;">时间: </span>
  45 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
51 46 </div>
  47 +
52 48 <div style="display: inline-block;margin-left: 15px">
53 49 <span class="item-label" style="width: 150px;">统计: </span>
54 50 </div>
... ... @@ -101,26 +97,31 @@
101 97 locale : 'zh-cn'
102 98 });
103 99  
  100 + var fage=false;
  101 + var xlList;
104 102 var obj = [];
105   - $.get('/user/companyData', function(result){
106   - obj = result;
107   - var options = '';
108   - for(var i = 0; i < obj.length; i++){
109   - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
110   - }
111   -
112   - if(obj.length ==0){
113   - $("#gsdmDiv_sing").css('display','none');
114   - $('#fgsdmDiv_sing').css('display','none');
115   - }else if(obj.length ==1){
116   - $("#gsdmDiv_sing").css('display','none');
117   - if(obj[0].children.length == 1 || obj[0].children.length ==0)
118   - $('#fgsdmDiv_sing').css('display','none');
119   - }
120   - $('#gsdmSing').html(options);
121   - updateCompany();
122   - });
123   -
  103 +
  104 +
  105 + $.get('/report/lineList',function(result){
  106 + xlList=result;
  107 + $.get('/user/companyData', function(result){
  108 + obj = result;
  109 + var options = '';
  110 + for(var i = 0; i < obj.length; i++){
  111 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  112 + }
  113 +
  114 + if(obj.length ==0){
  115 + $("#gsdmDiv_sing").css('display','none');
  116 + }else if(obj.length ==1){
  117 + $("#gsdmDiv_sing").css('display','none');
  118 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  119 + $('#fgsdmDiv_sing').css('display','none');
  120 + }
  121 + $('#gsdmSing').html(options);
  122 + updateCompany();
  123 + });
  124 + })
124 125 $("#gsdmSing").on("change",updateCompany);
125 126 function updateCompany(){
126 127 var company = $('#gsdmSing').val();
... ... @@ -134,10 +135,10 @@
134 135 }
135 136 }
136 137 $('#fgsdmSing').html(options);
  138 + initXl();
137 139 }
138 140  
139   -
140   - $.get('/basic/lineCode2Name',function(result){
  141 + /* $.get('/basic/lineCode2Name',function(result){
141 142 var data=[];
142 143  
143 144 for(var code in result){
... ... @@ -145,19 +146,41 @@
145 146 }
146 147 initPinYinSelect2('#line',data,'');
147 148  
148   - })
  149 + }) */
  150 +
  151 + $("#fgsdmSing").on("change",initXl);
  152 + function initXl(){
  153 + var data=[];
  154 + if(fage){
  155 + $("#line").select2("destroy").html('');
  156 + }
  157 + var fgs=$('#fgsdmSing').val();
  158 + var gs=$('#gsdmSing').val();
  159 + for(var i=0;i<xlList.length;i++){
  160 + if(gs!=""){
  161 + if(fgs!=""){
  162 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  163 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  164 + }
  165 + }else{
  166 + if(xlList[i]["gsbm"]==gs){
  167 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  168 + }
  169 + }
  170 + }
  171 + }
  172 + initPinYinSelect2('#line',data,'');
  173 + fage=true;
  174 + }
149 175  
150 176  
151 177 $("#query").on("click",function(){
152 178 var line = $("#line").val();
153 179 var startDate = $("#startDate").val();
154   - var endDate = $("#endDate").val();
155 180 var lpName = $("#lpName").val();
156 181 var gsdmSing = $("#gsdmSing").val();
157   - var fgsdmSing = $("#fgsdmSing").val();
158   - $post("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){
159   - $("#sDate").text(startDate);
160   - $("#eDate").text(endDate);
  182 + var fgsdmSing = $("#fgsdmSing").val(); var params = {};
  183 + $get("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName},function(result){
161 184 var temp = {};
162 185 var today_account = 0;
163 186 temp["line"] = $("#line").text();
... ... @@ -181,7 +204,7 @@
181 204 var lpName = $("#lpName").val();
182 205 var gsdmSing = $("#gsdmSing").val();
183 206 var fgsdmSing = $("#fgsdmSing").val();
184   - $post('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
  207 + $get('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
185 208 window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD"));
186 209 });
187 210 });
... ... @@ -203,7 +226,7 @@
203 226 <td>{{obj.emptMileage}}</td>
204 227 <td>{{obj.hyl}}</td>
205 228 <td>{{obj.jzl}}</td>
206   - <td> </td>
  229 + <td>{{obj.unyyyl}}</td>
207 230 <td>{{obj.jhjl}}</td>
208 231 </tr>
209 232 {{/each}}
... ...
src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
... ... @@ -64,7 +64,7 @@
64 64 <th>耗油量(不含非营业性用油)</th>
65 65 <th>尿素</th>
66 66 <th>实际公里(含空放公里)</th>
67   - <th>非业性用油</th>
  67 + <th>非业性用油</th>
68 68 <th>计划班次</th>
69 69 <th>实际班次</th>
70 70 </tr>
... ... @@ -89,26 +89,31 @@
89 89 format : 'YYYY-MM-DD',
90 90 locale : 'zh-cn'
91 91 });
  92 + var fage=false;
  93 + var xlList;
  94 + var obj = [];
92 95  
93   - $.get('/user/companyData', function(result){
94   - obj = result;
95   - var options = '';
96   - for(var i = 0; i < obj.length; i++){
97   - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
98   - }
99   -
100   - if(obj.length ==0){
101   - $("#gsdmDiv_vehic").css('display','none');
102   - $('#fgsdmDiv_vehic').css('display','none');
103   - }else if(obj.length ==1){
104   - $("#gsdmDiv_vehic").css('display','none');
105   - if(obj[0].children.length == 1 || obj[0].children.length ==0)
106   - $('#fgsdmDiv_vehic').css('display','none');
107   - }
108   - $('#gsdmVehic').html(options);
109   - updateCompany();
110   - });
111   -
  96 +
  97 + $.get('/report/lineList',function(result){
  98 + xlList=result;
  99 + $.get('/user/companyData', function(result){
  100 + obj = result;
  101 + var options = '';
  102 + for(var i = 0; i < obj.length; i++){
  103 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  104 + }
  105 +
  106 + if(obj.length ==0){
  107 + $("#gsdmDiv_vehic").css('display','none');
  108 + }else if(obj.length ==1){
  109 + $("#gsdmDiv_vehic").css('display','none');
  110 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  111 + $('#fgsdmDiv_vehic').css('display','none');
  112 + }
  113 + $('#gsdmVehic').html(options);
  114 + updateCompany();
  115 + });
  116 + })
112 117 $("#gsdmVehic").on("change",updateCompany);
113 118 function updateCompany(){
114 119 var company = $('#gsdmVehic').val();
... ... @@ -122,9 +127,10 @@
122 127 }
123 128 }
124 129 $('#fgsdmVehic').html(options);
  130 + initXl();
125 131 }
126   -
127   - $.get('/basic/lineCode2Name',function(result){
  132 +
  133 + /* $.get('/basic/lineCode2Name',function(result){
128 134 var data=[];
129 135  
130 136 for(var code in result){
... ... @@ -132,9 +138,33 @@
132 138 }
133 139 initPinYinSelect2('#line',data,'');
134 140  
135   - })
  141 + }) */
  142 +
  143 + $("#fgsdmVehic").on("change",initXl);
  144 + function initXl(){
  145 + var data=[];
  146 + if(fage){
  147 + $("#line").select2("destroy").html('');
  148 + }
  149 + var fgs=$('#fgsdmVehic').val();
  150 + var gs=$('#gsdmVehic').val();
  151 + for(var i=0;i<xlList.length;i++){
  152 + if(gs!=""){
  153 + if(fgs!=""){
  154 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  155 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  156 + }
  157 + }else{
  158 + if(xlList[i]["gsbm"]==gs){
  159 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  160 + }
  161 + }
  162 + }
  163 + }
  164 + initPinYinSelect2('#line',data,'');
  165 + fage=true;
  166 + }
136 167  
137   -
138 168 var line ;
139 169 var date ;
140 170 var gsdmVehic ;
... ... @@ -142,9 +172,9 @@
142 172 $("#query").on("click",function(){
143 173 line = $("#line").val();
144 174 date = $("#date").val();
145   - gsdmVehic = $("#gsdmVehic").val();
146   - fgsdmVehic = $("#fgsdmVehic").val();
147   - $post('/mcy_forms/vehicleloading',{line:line,data:date, gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic},function(result){
  175 +// gsdmVehic = $("#gsdmVehic").val();
  176 +// fgsdmVehic = $("#fgsdmVehic").val();
  177 + $get('/mcy_forms/vehicleloading',{line:line,data:date},function(result){
148 178 // 把数据填充到模版中
149 179 var tbodyHtml = template('vehicleloading',{list:result});
150 180 // 把渲染好的模版html文本追加到表格中
... ... @@ -157,7 +187,7 @@
157 187 date = $("#date").val();
158 188 gsdmVehic = $("#gsdmVehic").val();
159 189 fgsdmVehic = $("#fgsdmVehic").val();
160   - $post('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){
  190 + $get('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){
161 191 window.open("/downloadFile/download?fileName=车辆加注"+moment(date).format("YYYYMMDD"));
162 192 });
163 193 });
... ... @@ -173,9 +203,9 @@
173 203 <td>{{obj.clzbh}}</td>
174 204 <td>{{obj.jzl}}</td>
175 205 <td>{{obj.hyl}}</td>
176   - <td> </td>
  206 + <td>{{obj.ls}}</td>
177 207 <td>{{obj.jhlc}}</td>
178   - <td> </td>
  208 + <td>{{obj.unyyyl}}</td>
179 209 <td>{{obj.jhbc}}</td>
180 210 <td>{{obj.sjbc}}</td>
181 211 </tr>
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -199,7 +199,7 @@
199 199 {{obj.rq}}
200 200 </td>
201 201 <td>
202   - {{obj.gsname}}
  202 + {{obj.fgsname}}
203 203 </td>
204 204 <td>
205 205 {{obj.xlname}}
... ...
src/main/resources/static/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css
1   -/* perfect-scrollbar v0.6.16 */
2   -.ps-container {
3   - -ms-touch-action: auto;
4   - touch-action: auto;
5   - overflow: hidden !important;
6   - -ms-overflow-style: none; }
7   - @supports (-ms-overflow-style: none) {
8   - .ps-container {
9   - overflow: auto !important; } }
10   - @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
11   - .ps-container {
12   - overflow: auto !important; } }
13   - .ps-container.ps-active-x > .ps-scrollbar-x-rail,
14   - .ps-container.ps-active-y > .ps-scrollbar-y-rail {
15   - display: block;
16   - background-color: transparent; }
17   - .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
18   - background-color: #eee;
19   - opacity: 0.9; }
20   - .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
21   - background-color: #999;
22   - height: 11px; }
23   - .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
24   - background-color: #eee;
25   - opacity: 0.9; }
26   - .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
27   - background-color: #999;
28   - width: 11px; }
29   - .ps-container > .ps-scrollbar-x-rail {
30   - display: none;
31   - position: absolute;
32   - /* please don't change 'position' */
33   - opacity: 0;
34   - -webkit-transition: background-color .2s linear, opacity .2s linear;
35   - -o-transition: background-color .2s linear, opacity .2s linear;
36   - -moz-transition: background-color .2s linear, opacity .2s linear;
37   - transition: background-color .2s linear, opacity .2s linear;
38   - bottom: 0px;
39   - /* there must be 'bottom' for ps-scrollbar-x-rail */
40   - height: 15px; }
41   - .ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x {
42   - position: absolute;
43   - /* please don't change 'position' */
44   - background-color: #aaa;
45   - -webkit-border-radius: 6px;
46   - -moz-border-radius: 6px;
47   - border-radius: 6px;
48   - -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
49   - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
50   - -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
51   - -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
52   - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
53   - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
54   - bottom: 2px;
55   - /* there must be 'bottom' for ps-scrollbar-x */
56   - height: 6px; }
57   - .ps-container > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x, .ps-container > .ps-scrollbar-x-rail:active > .ps-scrollbar-x {
58   - height: 11px; }
59   - .ps-container > .ps-scrollbar-y-rail {
60   - display: none;
61   - position: absolute;
62   - /* please don't change 'position' */
63   - opacity: 0;
64   - -webkit-transition: background-color .2s linear, opacity .2s linear;
65   - -o-transition: background-color .2s linear, opacity .2s linear;
66   - -moz-transition: background-color .2s linear, opacity .2s linear;
67   - transition: background-color .2s linear, opacity .2s linear;
68   - right: 0;
69   - /* there must be 'right' for ps-scrollbar-y-rail */
70   - width: 15px; }
71   - .ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y {
72   - position: absolute;
73   - /* please don't change 'position' */
74   - background-color: #aaa;
75   - -webkit-border-radius: 6px;
76   - -moz-border-radius: 6px;
77   - border-radius: 6px;
78   - -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
79   - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
80   - -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
81   - -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
82   - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
83   - transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
84   - right: 2px;
85   - /* there must be 'right' for ps-scrollbar-y */
86   - width: 6px; }
87   - .ps-container > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y, .ps-container > .ps-scrollbar-y-rail:active > .ps-scrollbar-y {
88   - width: 11px; }
89   - .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
90   - background-color: #eee;
91   - opacity: 0.9; }
92   - .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
93   - background-color: #999;
94   - height: 11px; }
95   - .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
96   - background-color: #eee;
97   - opacity: 0.9; }
98   - .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
99   - background-color: #999;
100   - width: 11px; }
101   - .ps-container:hover > .ps-scrollbar-x-rail,
102   - .ps-container:hover > .ps-scrollbar-y-rail {
103   - opacity: 0.6; }
104   - .ps-container:hover > .ps-scrollbar-x-rail:hover {
105   - background-color: #eee;
106   - opacity: 0.9; }
107   - .ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x {
108   - background-color: #999; }
109   - .ps-container:hover > .ps-scrollbar-y-rail:hover {
110   - background-color: #eee;
111   - opacity: 0.9; }
112   - .ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y {
113   - background-color: #999; }
  1 +/* perfect-scrollbar v0.6.16 */
  2 +.ps-container {
  3 + -ms-touch-action: auto;
  4 + touch-action: auto;
  5 + overflow: hidden !important;
  6 + -ms-overflow-style: none; }
  7 + @supports (-ms-overflow-style: none) {
  8 + .ps-container {
  9 + overflow: auto !important; } }
  10 + @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  11 + .ps-container {
  12 + overflow: auto !important; } }
  13 + .ps-container.ps-active-x > .ps-scrollbar-x-rail,
  14 + .ps-container.ps-active-y > .ps-scrollbar-y-rail {
  15 + display: block;
  16 + background-color: transparent; }
  17 + .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
  18 + background-color: #eee;
  19 + opacity: 0.9; }
  20 + .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
  21 + background-color: #999;
  22 + height: 11px; }
  23 + .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
  24 + background-color: #eee;
  25 + opacity: 0.9; }
  26 + .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
  27 + background-color: #999;
  28 + width: 11px; }
  29 + .ps-container > .ps-scrollbar-x-rail {
  30 + display: none;
  31 + position: absolute;
  32 + /* please don't change 'position' */
  33 + opacity: 0;
  34 + -webkit-transition: background-color .2s linear, opacity .2s linear;
  35 + -o-transition: background-color .2s linear, opacity .2s linear;
  36 + -moz-transition: background-color .2s linear, opacity .2s linear;
  37 + transition: background-color .2s linear, opacity .2s linear;
  38 + bottom: 0px;
  39 + /* there must be 'bottom' for ps-scrollbar-x-rail */
  40 + height: 15px; }
  41 + .ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x {
  42 + position: absolute;
  43 + /* please don't change 'position' */
  44 + background-color: #aaa;
  45 + -webkit-border-radius: 6px;
  46 + -moz-border-radius: 6px;
  47 + border-radius: 6px;
  48 + -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  49 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  50 + -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  51 + -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  52 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  53 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  54 + bottom: 2px;
  55 + /* there must be 'bottom' for ps-scrollbar-x */
  56 + height: 6px; }
  57 + .ps-container > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x, .ps-container > .ps-scrollbar-x-rail:active > .ps-scrollbar-x {
  58 + height: 11px; }
  59 + .ps-container > .ps-scrollbar-y-rail {
  60 + display: none;
  61 + position: absolute;
  62 + /* please don't change 'position' */
  63 + opacity: 0;
  64 + -webkit-transition: background-color .2s linear, opacity .2s linear;
  65 + -o-transition: background-color .2s linear, opacity .2s linear;
  66 + -moz-transition: background-color .2s linear, opacity .2s linear;
  67 + transition: background-color .2s linear, opacity .2s linear;
  68 + right: 0;
  69 + /* there must be 'right' for ps-scrollbar-y-rail */
  70 + width: 15px; }
  71 + .ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y {
  72 + position: absolute;
  73 + /* please don't change 'position' */
  74 + background-color: #aaa;
  75 + -webkit-border-radius: 6px;
  76 + -moz-border-radius: 6px;
  77 + border-radius: 6px;
  78 + -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  79 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  80 + -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  81 + -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  82 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  83 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  84 + right: 2px;
  85 + /* there must be 'right' for ps-scrollbar-y */
  86 + width: 6px; }
  87 + .ps-container > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y, .ps-container > .ps-scrollbar-y-rail:active > .ps-scrollbar-y {
  88 + width: 11px; }
  89 + .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
  90 + background-color: #eee;
  91 + opacity: 0.9; }
  92 + .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
  93 + background-color: #999;
  94 + height: 11px; }
  95 + .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
  96 + background-color: #eee;
  97 + opacity: 0.9; }
  98 + .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
  99 + background-color: #999;
  100 + width: 11px; }
  101 + .ps-container:hover > .ps-scrollbar-x-rail,
  102 + .ps-container:hover > .ps-scrollbar-y-rail {
  103 + opacity: 0.6; }
  104 + .ps-container:hover > .ps-scrollbar-x-rail:hover {
  105 + background-color: #eee;
  106 + opacity: 0.9; }
  107 + .ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x {
  108 + background-color: #999; }
  109 + .ps-container:hover > .ps-scrollbar-y-rail:hover {
  110 + background-color: #eee;
  111 + opacity: 0.9; }
  112 + .ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y {
  113 + background-color: #999; }
... ...
src/main/resources/static/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js
1   -/* perfect-scrollbar v0.6.16 */
2   -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
3   -'use strict';
4   -
5   -var ps = require('../main');
6   -var psInstances = require('../plugin/instances');
7   -
8   -function mountJQuery(jQuery) {
9   - jQuery.fn.perfectScrollbar = function (settingOrCommand) {
10   - return this.each(function () {
11   - if (typeof settingOrCommand === 'object' ||
12   - typeof settingOrCommand === 'undefined') {
13   - // If it's an object or none, initialize.
14   - var settings = settingOrCommand;
15   -
16   - if (!psInstances.get(this)) {
17   - ps.initialize(this, settings);
18   - }
19   - } else {
20   - // Unless, it may be a command.
21   - var command = settingOrCommand;
22   -
23   - if (command === 'update') {
24   - ps.update(this);
25   - } else if (command === 'destroy') {
26   - ps.destroy(this);
27   - }
28   - }
29   - });
30   - };
31   -}
32   -
33   -if (typeof define === 'function' && define.amd) {
34   - // AMD. Register as an anonymous module.
35   - define(['jquery'], mountJQuery);
36   -} else {
37   - var jq = window.jQuery ? window.jQuery : window.$;
38   - if (typeof jq !== 'undefined') {
39   - mountJQuery(jq);
40   - }
41   -}
42   -
43   -module.exports = mountJQuery;
44   -
45   -},{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){
46   -'use strict';
47   -
48   -function oldAdd(element, className) {
49   - var classes = element.className.split(' ');
50   - if (classes.indexOf(className) < 0) {
51   - classes.push(className);
52   - }
53   - element.className = classes.join(' ');
54   -}
55   -
56   -function oldRemove(element, className) {
57   - var classes = element.className.split(' ');
58   - var idx = classes.indexOf(className);
59   - if (idx >= 0) {
60   - classes.splice(idx, 1);
61   - }
62   - element.className = classes.join(' ');
63   -}
64   -
65   -exports.add = function (element, className) {
66   - if (element.classList) {
67   - element.classList.add(className);
68   - } else {
69   - oldAdd(element, className);
70   - }
71   -};
72   -
73   -exports.remove = function (element, className) {
74   - if (element.classList) {
75   - element.classList.remove(className);
76   - } else {
77   - oldRemove(element, className);
78   - }
79   -};
80   -
81   -exports.list = function (element) {
82   - if (element.classList) {
83   - return Array.prototype.slice.apply(element.classList);
84   - } else {
85   - return element.className.split(' ');
86   - }
87   -};
88   -
89   -},{}],3:[function(require,module,exports){
90   -'use strict';
91   -
92   -var DOM = {};
93   -
94   -DOM.e = function (tagName, className) {
95   - var element = document.createElement(tagName);
96   - element.className = className;
97   - return element;
98   -};
99   -
100   -DOM.appendTo = function (child, parent) {
101   - parent.appendChild(child);
102   - return child;
103   -};
104   -
105   -function cssGet(element, styleName) {
106   - return window.getComputedStyle(element)[styleName];
107   -}
108   -
109   -function cssSet(element, styleName, styleValue) {
110   - if (typeof styleValue === 'number') {
111   - styleValue = styleValue.toString() + 'px';
112   - }
113   - element.style[styleName] = styleValue;
114   - return element;
115   -}
116   -
117   -function cssMultiSet(element, obj) {
118   - for (var key in obj) {
119   - var val = obj[key];
120   - if (typeof val === 'number') {
121   - val = val.toString() + 'px';
122   - }
123   - element.style[key] = val;
124   - }
125   - return element;
126   -}
127   -
128   -DOM.css = function (element, styleNameOrObject, styleValue) {
129   - if (typeof styleNameOrObject === 'object') {
130   - // multiple set with object
131   - return cssMultiSet(element, styleNameOrObject);
132   - } else {
133   - if (typeof styleValue === 'undefined') {
134   - return cssGet(element, styleNameOrObject);
135   - } else {
136   - return cssSet(element, styleNameOrObject, styleValue);
137   - }
138   - }
139   -};
140   -
141   -DOM.matches = function (element, query) {
142   - if (typeof element.matches !== 'undefined') {
143   - return element.matches(query);
144   - } else {
145   - if (typeof element.matchesSelector !== 'undefined') {
146   - return element.matchesSelector(query);
147   - } else if (typeof element.webkitMatchesSelector !== 'undefined') {
148   - return element.webkitMatchesSelector(query);
149   - } else if (typeof element.mozMatchesSelector !== 'undefined') {
150   - return element.mozMatchesSelector(query);
151   - } else if (typeof element.msMatchesSelector !== 'undefined') {
152   - return element.msMatchesSelector(query);
153   - }
154   - }
155   -};
156   -
157   -DOM.remove = function (element) {
158   - if (typeof element.remove !== 'undefined') {
159   - element.remove();
160   - } else {
161   - if (element.parentNode) {
162   - element.parentNode.removeChild(element);
163   - }
164   - }
165   -};
166   -
167   -DOM.queryChildren = function (element, selector) {
168   - return Array.prototype.filter.call(element.childNodes, function (child) {
169   - return DOM.matches(child, selector);
170   - });
171   -};
172   -
173   -module.exports = DOM;
174   -
175   -},{}],4:[function(require,module,exports){
176   -'use strict';
177   -
178   -var EventElement = function (element) {
179   - this.element = element;
180   - this.events = {};
181   -};
182   -
183   -EventElement.prototype.bind = function (eventName, handler) {
184   - if (typeof this.events[eventName] === 'undefined') {
185   - this.events[eventName] = [];
186   - }
187   - this.events[eventName].push(handler);
188   - this.element.addEventListener(eventName, handler, false);
189   -};
190   -
191   -EventElement.prototype.unbind = function (eventName, handler) {
192   - var isHandlerProvided = (typeof handler !== 'undefined');
193   - this.events[eventName] = this.events[eventName].filter(function (hdlr) {
194   - if (isHandlerProvided && hdlr !== handler) {
195   - return true;
196   - }
197   - this.element.removeEventListener(eventName, hdlr, false);
198   - return false;
199   - }, this);
200   -};
201   -
202   -EventElement.prototype.unbindAll = function () {
203   - for (var name in this.events) {
204   - this.unbind(name);
205   - }
206   -};
207   -
208   -var EventManager = function () {
209   - this.eventElements = [];
210   -};
211   -
212   -EventManager.prototype.eventElement = function (element) {
213   - var ee = this.eventElements.filter(function (eventElement) {
214   - return eventElement.element === element;
215   - })[0];
216   - if (typeof ee === 'undefined') {
217   - ee = new EventElement(element);
218   - this.eventElements.push(ee);
219   - }
220   - return ee;
221   -};
222   -
223   -EventManager.prototype.bind = function (element, eventName, handler) {
224   - this.eventElement(element).bind(eventName, handler);
225   -};
226   -
227   -EventManager.prototype.unbind = function (element, eventName, handler) {
228   - this.eventElement(element).unbind(eventName, handler);
229   -};
230   -
231   -EventManager.prototype.unbindAll = function () {
232   - for (var i = 0; i < this.eventElements.length; i++) {
233   - this.eventElements[i].unbindAll();
234   - }
235   -};
236   -
237   -EventManager.prototype.once = function (element, eventName, handler) {
238   - var ee = this.eventElement(element);
239   - var onceHandler = function (e) {
240   - ee.unbind(eventName, onceHandler);
241   - handler(e);
242   - };
243   - ee.bind(eventName, onceHandler);
244   -};
245   -
246   -module.exports = EventManager;
247   -
248   -},{}],5:[function(require,module,exports){
249   -'use strict';
250   -
251   -module.exports = (function () {
252   - function s4() {
253   - return Math.floor((1 + Math.random()) * 0x10000)
254   - .toString(16)
255   - .substring(1);
256   - }
257   - return function () {
258   - return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
259   - s4() + '-' + s4() + s4() + s4();
260   - };
261   -})();
262   -
263   -},{}],6:[function(require,module,exports){
264   -'use strict';
265   -
266   -var cls = require('./class');
267   -var dom = require('./dom');
268   -
269   -var toInt = exports.toInt = function (x) {
270   - return parseInt(x, 10) || 0;
271   -};
272   -
273   -var clone = exports.clone = function (obj) {
274   - if (!obj) {
275   - return null;
276   - } else if (obj.constructor === Array) {
277   - return obj.map(clone);
278   - } else if (typeof obj === 'object') {
279   - var result = {};
280   - for (var key in obj) {
281   - result[key] = clone(obj[key]);
282   - }
283   - return result;
284   - } else {
285   - return obj;
286   - }
287   -};
288   -
289   -exports.extend = function (original, source) {
290   - var result = clone(original);
291   - for (var key in source) {
292   - result[key] = clone(source[key]);
293   - }
294   - return result;
295   -};
296   -
297   -exports.isEditable = function (el) {
298   - return dom.matches(el, "input,[contenteditable]") ||
299   - dom.matches(el, "select,[contenteditable]") ||
300   - dom.matches(el, "textarea,[contenteditable]") ||
301   - dom.matches(el, "button,[contenteditable]");
302   -};
303   -
304   -exports.removePsClasses = function (element) {
305   - var clsList = cls.list(element);
306   - for (var i = 0; i < clsList.length; i++) {
307   - var className = clsList[i];
308   - if (className.indexOf('ps-') === 0) {
309   - cls.remove(element, className);
310   - }
311   - }
312   -};
313   -
314   -exports.outerWidth = function (element) {
315   - return toInt(dom.css(element, 'width')) +
316   - toInt(dom.css(element, 'paddingLeft')) +
317   - toInt(dom.css(element, 'paddingRight')) +
318   - toInt(dom.css(element, 'borderLeftWidth')) +
319   - toInt(dom.css(element, 'borderRightWidth'));
320   -};
321   -
322   -exports.startScrolling = function (element, axis) {
323   - cls.add(element, 'ps-in-scrolling');
324   - if (typeof axis !== 'undefined') {
325   - cls.add(element, 'ps-' + axis);
326   - } else {
327   - cls.add(element, 'ps-x');
328   - cls.add(element, 'ps-y');
329   - }
330   -};
331   -
332   -exports.stopScrolling = function (element, axis) {
333   - cls.remove(element, 'ps-in-scrolling');
334   - if (typeof axis !== 'undefined') {
335   - cls.remove(element, 'ps-' + axis);
336   - } else {
337   - cls.remove(element, 'ps-x');
338   - cls.remove(element, 'ps-y');
339   - }
340   -};
341   -
342   -exports.env = {
343   - isWebKit: 'WebkitAppearance' in document.documentElement.style,
344   - supportsTouch: (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
345   - supportsIePointer: window.navigator.msMaxTouchPoints !== null
346   -};
347   -
348   -},{"./class":2,"./dom":3}],7:[function(require,module,exports){
349   -'use strict';
350   -
351   -var destroy = require('./plugin/destroy');
352   -var initialize = require('./plugin/initialize');
353   -var update = require('./plugin/update');
354   -
355   -module.exports = {
356   - initialize: initialize,
357   - update: update,
358   - destroy: destroy
359   -};
360   -
361   -},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(require,module,exports){
362   -'use strict';
363   -
364   -module.exports = {
365   - handlers: ['click-rail', 'drag-scrollbar', 'keyboard', 'wheel', 'touch'],
366   - maxScrollbarLength: null,
367   - minScrollbarLength: null,
368   - scrollXMarginOffset: 0,
369   - scrollYMarginOffset: 0,
370   - suppressScrollX: false,
371   - suppressScrollY: false,
372   - swipePropagation: true,
373   - useBothWheelAxes: false,
374   - wheelPropagation: false,
375   - wheelSpeed: 1,
376   - theme: 'default'
377   -};
378   -
379   -},{}],9:[function(require,module,exports){
380   -'use strict';
381   -
382   -var _ = require('../lib/helper');
383   -var dom = require('../lib/dom');
384   -var instances = require('./instances');
385   -
386   -module.exports = function (element) {
387   - var i = instances.get(element);
388   -
389   - if (!i) {
390   - return;
391   - }
392   -
393   - i.event.unbindAll();
394   - dom.remove(i.scrollbarX);
395   - dom.remove(i.scrollbarY);
396   - dom.remove(i.scrollbarXRail);
397   - dom.remove(i.scrollbarYRail);
398   - _.removePsClasses(element);
399   -
400   - instances.remove(element);
401   -};
402   -
403   -},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){
404   -'use strict';
405   -
406   -var instances = require('../instances');
407   -var updateGeometry = require('../update-geometry');
408   -var updateScroll = require('../update-scroll');
409   -
410   -function bindClickRailHandler(element, i) {
411   - function pageOffset(el) {
412   - return el.getBoundingClientRect();
413   - }
414   - var stopPropagation = function (e) { e.stopPropagation(); };
415   -
416   - i.event.bind(i.scrollbarY, 'click', stopPropagation);
417   - i.event.bind(i.scrollbarYRail, 'click', function (e) {
418   - var positionTop = e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top;
419   - var direction = positionTop > i.scrollbarYTop ? 1 : -1;
420   -
421   - updateScroll(element, 'top', element.scrollTop + direction * i.containerHeight);
422   - updateGeometry(element);
423   -
424   - e.stopPropagation();
425   - });
426   -
427   - i.event.bind(i.scrollbarX, 'click', stopPropagation);
428   - i.event.bind(i.scrollbarXRail, 'click', function (e) {
429   - var positionLeft = e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left;
430   - var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
431   -
432   - updateScroll(element, 'left', element.scrollLeft + direction * i.containerWidth);
433   - updateGeometry(element);
434   -
435   - e.stopPropagation();
436   - });
437   -}
438   -
439   -module.exports = function (element) {
440   - var i = instances.get(element);
441   - bindClickRailHandler(element, i);
442   -};
443   -
444   -},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){
445   -'use strict';
446   -
447   -var _ = require('../../lib/helper');
448   -var dom = require('../../lib/dom');
449   -var instances = require('../instances');
450   -var updateGeometry = require('../update-geometry');
451   -var updateScroll = require('../update-scroll');
452   -
453   -function bindMouseScrollXHandler(element, i) {
454   - var currentLeft = null;
455   - var currentPageX = null;
456   -
457   - function updateScrollLeft(deltaX) {
458   - var newLeft = currentLeft + (deltaX * i.railXRatio);
459   - var maxLeft = Math.max(0, i.scrollbarXRail.getBoundingClientRect().left) + (i.railXRatio * (i.railXWidth - i.scrollbarXWidth));
460   -
461   - if (newLeft < 0) {
462   - i.scrollbarXLeft = 0;
463   - } else if (newLeft > maxLeft) {
464   - i.scrollbarXLeft = maxLeft;
465   - } else {
466   - i.scrollbarXLeft = newLeft;
467   - }
468   -
469   - var scrollLeft = _.toInt(i.scrollbarXLeft * (i.contentWidth - i.containerWidth) / (i.containerWidth - (i.railXRatio * i.scrollbarXWidth))) - i.negativeScrollAdjustment;
470   - updateScroll(element, 'left', scrollLeft);
471   - }
472   -
473   - var mouseMoveHandler = function (e) {
474   - updateScrollLeft(e.pageX - currentPageX);
475   - updateGeometry(element);
476   - e.stopPropagation();
477   - e.preventDefault();
478   - };
479   -
480   - var mouseUpHandler = function () {
481   - _.stopScrolling(element, 'x');
482   - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
483   - };
484   -
485   - i.event.bind(i.scrollbarX, 'mousedown', function (e) {
486   - currentPageX = e.pageX;
487   - currentLeft = _.toInt(dom.css(i.scrollbarX, 'left')) * i.railXRatio;
488   - _.startScrolling(element, 'x');
489   -
490   - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
491   - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
492   -
493   - e.stopPropagation();
494   - e.preventDefault();
495   - });
496   -}
497   -
498   -function bindMouseScrollYHandler(element, i) {
499   - var currentTop = null;
500   - var currentPageY = null;
501   -
502   - function updateScrollTop(deltaY) {
503   - var newTop = currentTop + (deltaY * i.railYRatio);
504   - var maxTop = Math.max(0, i.scrollbarYRail.getBoundingClientRect().top) + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight));
505   -
506   - if (newTop < 0) {
507   - i.scrollbarYTop = 0;
508   - } else if (newTop > maxTop) {
509   - i.scrollbarYTop = maxTop;
510   - } else {
511   - i.scrollbarYTop = newTop;
512   - }
513   -
514   - var scrollTop = _.toInt(i.scrollbarYTop * (i.contentHeight - i.containerHeight) / (i.containerHeight - (i.railYRatio * i.scrollbarYHeight)));
515   - updateScroll(element, 'top', scrollTop);
516   - }
517   -
518   - var mouseMoveHandler = function (e) {
519   - updateScrollTop(e.pageY - currentPageY);
520   - updateGeometry(element);
521   - e.stopPropagation();
522   - e.preventDefault();
523   - };
524   -
525   - var mouseUpHandler = function () {
526   - _.stopScrolling(element, 'y');
527   - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
528   - };
529   -
530   - i.event.bind(i.scrollbarY, 'mousedown', function (e) {
531   - currentPageY = e.pageY;
532   - currentTop = _.toInt(dom.css(i.scrollbarY, 'top')) * i.railYRatio;
533   - _.startScrolling(element, 'y');
534   -
535   - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
536   - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
537   -
538   - e.stopPropagation();
539   - e.preventDefault();
540   - });
541   -}
542   -
543   -module.exports = function (element) {
544   - var i = instances.get(element);
545   - bindMouseScrollXHandler(element, i);
546   - bindMouseScrollYHandler(element, i);
547   -};
548   -
549   -},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){
550   -'use strict';
551   -
552   -var _ = require('../../lib/helper');
553   -var dom = require('../../lib/dom');
554   -var instances = require('../instances');
555   -var updateGeometry = require('../update-geometry');
556   -var updateScroll = require('../update-scroll');
557   -
558   -function bindKeyboardHandler(element, i) {
559   - var hovered = false;
560   - i.event.bind(element, 'mouseenter', function () {
561   - hovered = true;
562   - });
563   - i.event.bind(element, 'mouseleave', function () {
564   - hovered = false;
565   - });
566   -
567   - var shouldPrevent = false;
568   - function shouldPreventDefault(deltaX, deltaY) {
569   - var scrollTop = element.scrollTop;
570   - if (deltaX === 0) {
571   - if (!i.scrollbarYActive) {
572   - return false;
573   - }
574   - if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) {
575   - return !i.settings.wheelPropagation;
576   - }
577   - }
578   -
579   - var scrollLeft = element.scrollLeft;
580   - if (deltaY === 0) {
581   - if (!i.scrollbarXActive) {
582   - return false;
583   - }
584   - if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) {
585   - return !i.settings.wheelPropagation;
586   - }
587   - }
588   - return true;
589   - }
590   -
591   - i.event.bind(i.ownerDocument, 'keydown', function (e) {
592   - if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) {
593   - return;
594   - }
595   -
596   - var focused = dom.matches(i.scrollbarX, ':focus') ||
597   - dom.matches(i.scrollbarY, ':focus');
598   -
599   - if (!hovered && !focused) {
600   - return;
601   - }
602   -
603   - var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement;
604   - if (activeElement) {
605   - if (activeElement.tagName === 'IFRAME') {
606   - activeElement = activeElement.contentDocument.activeElement;
607   - } else {
608   - // go deeper if element is a webcomponent
609   - while (activeElement.shadowRoot) {
610   - activeElement = activeElement.shadowRoot.activeElement;
611   - }
612   - }
613   - if (_.isEditable(activeElement)) {
614   - return;
615   - }
616   - }
617   -
618   - var deltaX = 0;
619   - var deltaY = 0;
620   -
621   - switch (e.which) {
622   - case 37: // left
623   - if (e.metaKey) {
624   - deltaX = -i.contentWidth;
625   - } else if (e.altKey) {
626   - deltaX = -i.containerWidth;
627   - } else {
628   - deltaX = -30;
629   - }
630   - break;
631   - case 38: // up
632   - if (e.metaKey) {
633   - deltaY = i.contentHeight;
634   - } else if (e.altKey) {
635   - deltaY = i.containerHeight;
636   - } else {
637   - deltaY = 30;
638   - }
639   - break;
640   - case 39: // right
641   - if (e.metaKey) {
642   - deltaX = i.contentWidth;
643   - } else if (e.altKey) {
644   - deltaX = i.containerWidth;
645   - } else {
646   - deltaX = 30;
647   - }
648   - break;
649   - case 40: // down
650   - if (e.metaKey) {
651   - deltaY = -i.contentHeight;
652   - } else if (e.altKey) {
653   - deltaY = -i.containerHeight;
654   - } else {
655   - deltaY = -30;
656   - }
657   - break;
658   - case 33: // page up
659   - deltaY = 90;
660   - break;
661   - case 32: // space bar
662   - if (e.shiftKey) {
663   - deltaY = 90;
664   - } else {
665   - deltaY = -90;
666   - }
667   - break;
668   - case 34: // page down
669   - deltaY = -90;
670   - break;
671   - case 35: // end
672   - if (e.ctrlKey) {
673   - deltaY = -i.contentHeight;
674   - } else {
675   - deltaY = -i.containerHeight;
676   - }
677   - break;
678   - case 36: // home
679   - if (e.ctrlKey) {
680   - deltaY = element.scrollTop;
681   - } else {
682   - deltaY = i.containerHeight;
683   - }
684   - break;
685   - default:
686   - return;
687   - }
688   -
689   - updateScroll(element, 'top', element.scrollTop - deltaY);
690   - updateScroll(element, 'left', element.scrollLeft + deltaX);
691   - updateGeometry(element);
692   -
693   - shouldPrevent = shouldPreventDefault(deltaX, deltaY);
694   - if (shouldPrevent) {
695   - e.preventDefault();
696   - }
697   - });
698   -}
699   -
700   -module.exports = function (element) {
701   - var i = instances.get(element);
702   - bindKeyboardHandler(element, i);
703   -};
704   -
705   -},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
706   -'use strict';
707   -
708   -var instances = require('../instances');
709   -var updateGeometry = require('../update-geometry');
710   -var updateScroll = require('../update-scroll');
711   -
712   -function bindMouseWheelHandler(element, i) {
713   - var shouldPrevent = false;
714   -
715   - function shouldPreventDefault(deltaX, deltaY) {
716   - var scrollTop = element.scrollTop;
717   - if (deltaX === 0) {
718   - if (!i.scrollbarYActive) {
719   - return false;
720   - }
721   - if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) {
722   - return !i.settings.wheelPropagation;
723   - }
724   - }
725   -
726   - var scrollLeft = element.scrollLeft;
727   - if (deltaY === 0) {
728   - if (!i.scrollbarXActive) {
729   - return false;
730   - }
731   - if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) {
732   - return !i.settings.wheelPropagation;
733   - }
734   - }
735   - return true;
736   - }
737   -
738   - function getDeltaFromEvent(e) {
739   - var deltaX = e.deltaX;
740   - var deltaY = -1 * e.deltaY;
741   -
742   - if (typeof deltaX === "undefined" || typeof deltaY === "undefined") {
743   - // OS X Safari
744   - deltaX = -1 * e.wheelDeltaX / 6;
745   - deltaY = e.wheelDeltaY / 6;
746   - }
747   -
748   - if (e.deltaMode && e.deltaMode === 1) {
749   - // Firefox in deltaMode 1: Line scrolling
750   - deltaX *= 10;
751   - deltaY *= 10;
752   - }
753   -
754   - if (deltaX !== deltaX && deltaY !== deltaY/* NaN checks */) {
755   - // IE in some mouse drivers
756   - deltaX = 0;
757   - deltaY = e.wheelDelta;
758   - }
759   -
760   - if (e.shiftKey) {
761   - // reverse axis with shift key
762   - return [-deltaY, -deltaX];
763   - }
764   - return [deltaX, deltaY];
765   - }
766   -
767   - function shouldBeConsumedByChild(deltaX, deltaY) {
768   - var child = element.querySelector('textarea:hover, select[multiple]:hover, .ps-child:hover');
769   - if (child) {
770   - if (!window.getComputedStyle(child).overflow.match(/(scroll|auto)/)) {
771   - // if not scrollable
772   - return false;
773   - }
774   -
775   - var maxScrollTop = child.scrollHeight - child.clientHeight;
776   - if (maxScrollTop > 0) {
777   - if (!(child.scrollTop === 0 && deltaY > 0) && !(child.scrollTop === maxScrollTop && deltaY < 0)) {
778   - return true;
779   - }
780   - }
781   - var maxScrollLeft = child.scrollLeft - child.clientWidth;
782   - if (maxScrollLeft > 0) {
783   - if (!(child.scrollLeft === 0 && deltaX < 0) && !(child.scrollLeft === maxScrollLeft && deltaX > 0)) {
784   - return true;
785   - }
786   - }
787   - }
788   - return false;
789   - }
790   -
791   - function mousewheelHandler(e) {
792   - var delta = getDeltaFromEvent(e);
793   -
794   - var deltaX = delta[0];
795   - var deltaY = delta[1];
796   -
797   - if (shouldBeConsumedByChild(deltaX, deltaY)) {
798   - return;
799   - }
800   -
801   - shouldPrevent = false;
802   - if (!i.settings.useBothWheelAxes) {
803   - // deltaX will only be used for horizontal scrolling and deltaY will
804   - // only be used for vertical scrolling - this is the default
805   - updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed));
806   - updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed));
807   - } else if (i.scrollbarYActive && !i.scrollbarXActive) {
808   - // only vertical scrollbar is active and useBothWheelAxes option is
809   - // active, so let's scroll vertical bar using both mouse wheel axes
810   - if (deltaY) {
811   - updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed));
812   - } else {
813   - updateScroll(element, 'top', element.scrollTop + (deltaX * i.settings.wheelSpeed));
814   - }
815   - shouldPrevent = true;
816   - } else if (i.scrollbarXActive && !i.scrollbarYActive) {
817   - // useBothWheelAxes and only horizontal bar is active, so use both
818   - // wheel axes for horizontal bar
819   - if (deltaX) {
820   - updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed));
821   - } else {
822   - updateScroll(element, 'left', element.scrollLeft - (deltaY * i.settings.wheelSpeed));
823   - }
824   - shouldPrevent = true;
825   - }
826   -
827   - updateGeometry(element);
828   -
829   - shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY));
830   - if (shouldPrevent) {
831   - e.stopPropagation();
832   - e.preventDefault();
833   - }
834   - }
835   -
836   - if (typeof window.onwheel !== "undefined") {
837   - i.event.bind(element, 'wheel', mousewheelHandler);
838   - } else if (typeof window.onmousewheel !== "undefined") {
839   - i.event.bind(element, 'mousewheel', mousewheelHandler);
840   - }
841   -}
842   -
843   -module.exports = function (element) {
844   - var i = instances.get(element);
845   - bindMouseWheelHandler(element, i);
846   -};
847   -
848   -},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){
849   -'use strict';
850   -
851   -var instances = require('../instances');
852   -var updateGeometry = require('../update-geometry');
853   -
854   -function bindNativeScrollHandler(element, i) {
855   - i.event.bind(element, 'scroll', function () {
856   - updateGeometry(element);
857   - });
858   -}
859   -
860   -module.exports = function (element) {
861   - var i = instances.get(element);
862   - bindNativeScrollHandler(element, i);
863   -};
864   -
865   -},{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){
866   -'use strict';
867   -
868   -var _ = require('../../lib/helper');
869   -var instances = require('../instances');
870   -var updateGeometry = require('../update-geometry');
871   -var updateScroll = require('../update-scroll');
872   -
873   -function bindSelectionHandler(element, i) {
874   - function getRangeNode() {
875   - var selection = window.getSelection ? window.getSelection() :
876   - document.getSelection ? document.getSelection() : '';
877   - if (selection.toString().length === 0) {
878   - return null;
879   - } else {
880   - return selection.getRangeAt(0).commonAncestorContainer;
881   - }
882   - }
883   -
884   - var scrollingLoop = null;
885   - var scrollDiff = {top: 0, left: 0};
886   - function startScrolling() {
887   - if (!scrollingLoop) {
888   - scrollingLoop = setInterval(function () {
889   - if (!instances.get(element)) {
890   - clearInterval(scrollingLoop);
891   - return;
892   - }
893   -
894   - updateScroll(element, 'top', element.scrollTop + scrollDiff.top);
895   - updateScroll(element, 'left', element.scrollLeft + scrollDiff.left);
896   - updateGeometry(element);
897   - }, 50); // every .1 sec
898   - }
899   - }
900   - function stopScrolling() {
901   - if (scrollingLoop) {
902   - clearInterval(scrollingLoop);
903   - scrollingLoop = null;
904   - }
905   - _.stopScrolling(element);
906   - }
907   -
908   - var isSelected = false;
909   - i.event.bind(i.ownerDocument, 'selectionchange', function () {
910   - if (element.contains(getRangeNode())) {
911   - isSelected = true;
912   - } else {
913   - isSelected = false;
914   - stopScrolling();
915   - }
916   - });
917   - i.event.bind(window, 'mouseup', function () {
918   - if (isSelected) {
919   - isSelected = false;
920   - stopScrolling();
921   - }
922   - });
923   - i.event.bind(window, 'keyup', function () {
924   - if (isSelected) {
925   - isSelected = false;
926   - stopScrolling();
927   - }
928   - });
929   -
930   - i.event.bind(window, 'mousemove', function (e) {
931   - if (isSelected) {
932   - var mousePosition = {x: e.pageX, y: e.pageY};
933   - var containerGeometry = {
934   - left: element.offsetLeft,
935   - right: element.offsetLeft + element.offsetWidth,
936   - top: element.offsetTop,
937   - bottom: element.offsetTop + element.offsetHeight
938   - };
939   -
940   - if (mousePosition.x < containerGeometry.left + 3) {
941   - scrollDiff.left = -5;
942   - _.startScrolling(element, 'x');
943   - } else if (mousePosition.x > containerGeometry.right - 3) {
944   - scrollDiff.left = 5;
945   - _.startScrolling(element, 'x');
946   - } else {
947   - scrollDiff.left = 0;
948   - }
949   -
950   - if (mousePosition.y < containerGeometry.top + 3) {
951   - if (containerGeometry.top + 3 - mousePosition.y < 5) {
952   - scrollDiff.top = -5;
953   - } else {
954   - scrollDiff.top = -20;
955   - }
956   - _.startScrolling(element, 'y');
957   - } else if (mousePosition.y > containerGeometry.bottom - 3) {
958   - if (mousePosition.y - containerGeometry.bottom + 3 < 5) {
959   - scrollDiff.top = 5;
960   - } else {
961   - scrollDiff.top = 20;
962   - }
963   - _.startScrolling(element, 'y');
964   - } else {
965   - scrollDiff.top = 0;
966   - }
967   -
968   - if (scrollDiff.top === 0 && scrollDiff.left === 0) {
969   - stopScrolling();
970   - } else {
971   - startScrolling();
972   - }
973   - }
974   - });
975   -}
976   -
977   -module.exports = function (element) {
978   - var i = instances.get(element);
979   - bindSelectionHandler(element, i);
980   -};
981   -
982   -},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){
983   -'use strict';
984   -
985   -var _ = require('../../lib/helper');
986   -var instances = require('../instances');
987   -var updateGeometry = require('../update-geometry');
988   -var updateScroll = require('../update-scroll');
989   -
990   -function bindTouchHandler(element, i, supportsTouch, supportsIePointer) {
991   - function shouldPreventDefault(deltaX, deltaY) {
992   - var scrollTop = element.scrollTop;
993   - var scrollLeft = element.scrollLeft;
994   - var magnitudeX = Math.abs(deltaX);
995   - var magnitudeY = Math.abs(deltaY);
996   -
997   - if (magnitudeY > magnitudeX) {
998   - // user is perhaps trying to swipe up/down the page
999   -
1000   - if (((deltaY < 0) && (scrollTop === i.contentHeight - i.containerHeight)) ||
1001   - ((deltaY > 0) && (scrollTop === 0))) {
1002   - return !i.settings.swipePropagation;
1003   - }
1004   - } else if (magnitudeX > magnitudeY) {
1005   - // user is perhaps trying to swipe left/right across the page
1006   -
1007   - if (((deltaX < 0) && (scrollLeft === i.contentWidth - i.containerWidth)) ||
1008   - ((deltaX > 0) && (scrollLeft === 0))) {
1009   - return !i.settings.swipePropagation;
1010   - }
1011   - }
1012   -
1013   - return true;
1014   - }
1015   -
1016   - function applyTouchMove(differenceX, differenceY) {
1017   - updateScroll(element, 'top', element.scrollTop - differenceY);
1018   - updateScroll(element, 'left', element.scrollLeft - differenceX);
1019   -
1020   - updateGeometry(element);
1021   - }
1022   -
1023   - var startOffset = {};
1024   - var startTime = 0;
1025   - var speed = {};
1026   - var easingLoop = null;
1027   - var inGlobalTouch = false;
1028   - var inLocalTouch = false;
1029   -
1030   - function globalTouchStart() {
1031   - inGlobalTouch = true;
1032   - }
1033   - function globalTouchEnd() {
1034   - inGlobalTouch = false;
1035   - }
1036   -
1037   - function getTouch(e) {
1038   - if (e.targetTouches) {
1039   - return e.targetTouches[0];
1040   - } else {
1041   - // Maybe IE pointer
1042   - return e;
1043   - }
1044   - }
1045   - function shouldHandle(e) {
1046   - if (e.targetTouches && e.targetTouches.length === 1) {
1047   - return true;
1048   - }
1049   - if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
1050   - return true;
1051   - }
1052   - return false;
1053   - }
1054   - function touchStart(e) {
1055   - if (shouldHandle(e)) {
1056   - inLocalTouch = true;
1057   -
1058   - var touch = getTouch(e);
1059   -
1060   - startOffset.pageX = touch.pageX;
1061   - startOffset.pageY = touch.pageY;
1062   -
1063   - startTime = (new Date()).getTime();
1064   -
1065   - if (easingLoop !== null) {
1066   - clearInterval(easingLoop);
1067   - }
1068   -
1069   - e.stopPropagation();
1070   - }
1071   - }
1072   - function touchMove(e) {
1073   - if (!inLocalTouch && i.settings.swipePropagation) {
1074   - touchStart(e);
1075   - }
1076   - if (!inGlobalTouch && inLocalTouch && shouldHandle(e)) {
1077   - var touch = getTouch(e);
1078   -
1079   - var currentOffset = {pageX: touch.pageX, pageY: touch.pageY};
1080   -
1081   - var differenceX = currentOffset.pageX - startOffset.pageX;
1082   - var differenceY = currentOffset.pageY - startOffset.pageY;
1083   -
1084   - applyTouchMove(differenceX, differenceY);
1085   - startOffset = currentOffset;
1086   -
1087   - var currentTime = (new Date()).getTime();
1088   -
1089   - var timeGap = currentTime - startTime;
1090   - if (timeGap > 0) {
1091   - speed.x = differenceX / timeGap;
1092   - speed.y = differenceY / timeGap;
1093   - startTime = currentTime;
1094   - }
1095   -
1096   - if (shouldPreventDefault(differenceX, differenceY)) {
1097   - e.stopPropagation();
1098   - e.preventDefault();
1099   - }
1100   - }
1101   - }
1102   - function touchEnd() {
1103   - if (!inGlobalTouch && inLocalTouch) {
1104   - inLocalTouch = false;
1105   -
1106   - clearInterval(easingLoop);
1107   - easingLoop = setInterval(function () {
1108   - if (!instances.get(element)) {
1109   - clearInterval(easingLoop);
1110   - return;
1111   - }
1112   -
1113   - if (!speed.x && !speed.y) {
1114   - clearInterval(easingLoop);
1115   - return;
1116   - }
1117   -
1118   - if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
1119   - clearInterval(easingLoop);
1120   - return;
1121   - }
1122   -
1123   - applyTouchMove(speed.x * 30, speed.y * 30);
1124   -
1125   - speed.x *= 0.8;
1126   - speed.y *= 0.8;
1127   - }, 10);
1128   - }
1129   - }
1130   -
1131   - if (supportsTouch) {
1132   - i.event.bind(window, 'touchstart', globalTouchStart);
1133   - i.event.bind(window, 'touchend', globalTouchEnd);
1134   - i.event.bind(element, 'touchstart', touchStart);
1135   - i.event.bind(element, 'touchmove', touchMove);
1136   - i.event.bind(element, 'touchend', touchEnd);
1137   - } else if (supportsIePointer) {
1138   - if (window.PointerEvent) {
1139   - i.event.bind(window, 'pointerdown', globalTouchStart);
1140   - i.event.bind(window, 'pointerup', globalTouchEnd);
1141   - i.event.bind(element, 'pointerdown', touchStart);
1142   - i.event.bind(element, 'pointermove', touchMove);
1143   - i.event.bind(element, 'pointerup', touchEnd);
1144   - } else if (window.MSPointerEvent) {
1145   - i.event.bind(window, 'MSPointerDown', globalTouchStart);
1146   - i.event.bind(window, 'MSPointerUp', globalTouchEnd);
1147   - i.event.bind(element, 'MSPointerDown', touchStart);
1148   - i.event.bind(element, 'MSPointerMove', touchMove);
1149   - i.event.bind(element, 'MSPointerUp', touchEnd);
1150   - }
1151   - }
1152   -}
1153   -
1154   -module.exports = function (element) {
1155   - if (!_.env.supportsTouch && !_.env.supportsIePointer) {
1156   - return;
1157   - }
1158   -
1159   - var i = instances.get(element);
1160   - bindTouchHandler(element, i, _.env.supportsTouch, _.env.supportsIePointer);
1161   -};
1162   -
1163   -},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){
1164   -'use strict';
1165   -
1166   -var _ = require('../lib/helper');
1167   -var cls = require('../lib/class');
1168   -var instances = require('./instances');
1169   -var updateGeometry = require('./update-geometry');
1170   -
1171   -// Handlers
1172   -var handlers = {
1173   - 'click-rail': require('./handler/click-rail'),
1174   - 'drag-scrollbar': require('./handler/drag-scrollbar'),
1175   - 'keyboard': require('./handler/keyboard'),
1176   - 'wheel': require('./handler/mouse-wheel'),
1177   - 'touch': require('./handler/touch'),
1178   - 'selection': require('./handler/selection')
1179   -};
1180   -var nativeScrollHandler = require('./handler/native-scroll');
1181   -
1182   -module.exports = function (element, userSettings) {
1183   - userSettings = typeof userSettings === 'object' ? userSettings : {};
1184   -
1185   - cls.add(element, 'ps-container');
1186   -
1187   - // Create a plugin instance.
1188   - var i = instances.add(element);
1189   -
1190   - i.settings = _.extend(i.settings, userSettings);
1191   - cls.add(element, 'ps-theme-' + i.settings.theme);
1192   -
1193   - i.settings.handlers.forEach(function (handlerName) {
1194   - handlers[handlerName](element);
1195   - });
1196   -
1197   - nativeScrollHandler(element);
1198   -
1199   - updateGeometry(element);
1200   -};
1201   -
1202   -},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(require,module,exports){
1203   -'use strict';
1204   -
1205   -var _ = require('../lib/helper');
1206   -var cls = require('../lib/class');
1207   -var defaultSettings = require('./default-setting');
1208   -var dom = require('../lib/dom');
1209   -var EventManager = require('../lib/event-manager');
1210   -var guid = require('../lib/guid');
1211   -
1212   -var instances = {};
1213   -
1214   -function Instance(element) {
1215   - var i = this;
1216   -
1217   - i.settings = _.clone(defaultSettings);
1218   - i.containerWidth = null;
1219   - i.containerHeight = null;
1220   - i.contentWidth = null;
1221   - i.contentHeight = null;
1222   -
1223   - i.isRtl = dom.css(element, 'direction') === "rtl";
1224   - i.isNegativeScroll = (function () {
1225   - var originalScrollLeft = element.scrollLeft;
1226   - var result = null;
1227   - element.scrollLeft = -1;
1228   - result = element.scrollLeft < 0;
1229   - element.scrollLeft = originalScrollLeft;
1230   - return result;
1231   - })();
1232   - i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
1233   - i.event = new EventManager();
1234   - i.ownerDocument = element.ownerDocument || document;
1235   -
1236   - function focus() {
1237   - cls.add(element, 'ps-focus');
1238   - }
1239   -
1240   - function blur() {
1241   - cls.remove(element, 'ps-focus');
1242   - }
1243   -
1244   - i.scrollbarXRail = dom.appendTo(dom.e('div', 'ps-scrollbar-x-rail'), element);
1245   - i.scrollbarX = dom.appendTo(dom.e('div', 'ps-scrollbar-x'), i.scrollbarXRail);
1246   - i.scrollbarX.setAttribute('tabindex', 0);
1247   - i.event.bind(i.scrollbarX, 'focus', focus);
1248   - i.event.bind(i.scrollbarX, 'blur', blur);
1249   - i.scrollbarXActive = null;
1250   - i.scrollbarXWidth = null;
1251   - i.scrollbarXLeft = null;
1252   - i.scrollbarXBottom = _.toInt(dom.css(i.scrollbarXRail, 'bottom'));
1253   - i.isScrollbarXUsingBottom = i.scrollbarXBottom === i.scrollbarXBottom; // !isNaN
1254   - i.scrollbarXTop = i.isScrollbarXUsingBottom ? null : _.toInt(dom.css(i.scrollbarXRail, 'top'));
1255   - i.railBorderXWidth = _.toInt(dom.css(i.scrollbarXRail, 'borderLeftWidth')) + _.toInt(dom.css(i.scrollbarXRail, 'borderRightWidth'));
1256   - // Set rail to display:block to calculate margins
1257   - dom.css(i.scrollbarXRail, 'display', 'block');
1258   - i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
1259   - dom.css(i.scrollbarXRail, 'display', '');
1260   - i.railXWidth = null;
1261   - i.railXRatio = null;
1262   -
1263   - i.scrollbarYRail = dom.appendTo(dom.e('div', 'ps-scrollbar-y-rail'), element);
1264   - i.scrollbarY = dom.appendTo(dom.e('div', 'ps-scrollbar-y'), i.scrollbarYRail);
1265   - i.scrollbarY.setAttribute('tabindex', 0);
1266   - i.event.bind(i.scrollbarY, 'focus', focus);
1267   - i.event.bind(i.scrollbarY, 'blur', blur);
1268   - i.scrollbarYActive = null;
1269   - i.scrollbarYHeight = null;
1270   - i.scrollbarYTop = null;
1271   - i.scrollbarYRight = _.toInt(dom.css(i.scrollbarYRail, 'right'));
1272   - i.isScrollbarYUsingRight = i.scrollbarYRight === i.scrollbarYRight; // !isNaN
1273   - i.scrollbarYLeft = i.isScrollbarYUsingRight ? null : _.toInt(dom.css(i.scrollbarYRail, 'left'));
1274   - i.scrollbarYOuterWidth = i.isRtl ? _.outerWidth(i.scrollbarY) : null;
1275   - i.railBorderYWidth = _.toInt(dom.css(i.scrollbarYRail, 'borderTopWidth')) + _.toInt(dom.css(i.scrollbarYRail, 'borderBottomWidth'));
1276   - dom.css(i.scrollbarYRail, 'display', 'block');
1277   - i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
1278   - dom.css(i.scrollbarYRail, 'display', '');
1279   - i.railYHeight = null;
1280   - i.railYRatio = null;
1281   -}
1282   -
1283   -function getId(element) {
1284   - return element.getAttribute('data-ps-id');
1285   -}
1286   -
1287   -function setId(element, id) {
1288   - element.setAttribute('data-ps-id', id);
1289   -}
1290   -
1291   -function removeId(element) {
1292   - element.removeAttribute('data-ps-id');
1293   -}
1294   -
1295   -exports.add = function (element) {
1296   - var newId = guid();
1297   - setId(element, newId);
1298   - instances[newId] = new Instance(element);
1299   - return instances[newId];
1300   -};
1301   -
1302   -exports.remove = function (element) {
1303   - delete instances[getId(element)];
1304   - removeId(element);
1305   -};
1306   -
1307   -exports.get = function (element) {
1308   - return instances[getId(element)];
1309   -};
1310   -
1311   -},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
1312   -'use strict';
1313   -
1314   -var _ = require('../lib/helper');
1315   -var cls = require('../lib/class');
1316   -var dom = require('../lib/dom');
1317   -var instances = require('./instances');
1318   -var updateScroll = require('./update-scroll');
1319   -
1320   -function getThumbSize(i, thumbSize) {
1321   - if (i.settings.minScrollbarLength) {
1322   - thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
1323   - }
1324   - if (i.settings.maxScrollbarLength) {
1325   - thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
1326   - }
1327   - return thumbSize;
1328   -}
1329   -
1330   -function updateCss(element, i) {
1331   - var xRailOffset = {width: i.railXWidth};
1332   - if (i.isRtl) {
1333   - xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth;
1334   - } else {
1335   - xRailOffset.left = element.scrollLeft;
1336   - }
1337   - if (i.isScrollbarXUsingBottom) {
1338   - xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop;
1339   - } else {
1340   - xRailOffset.top = i.scrollbarXTop + element.scrollTop;
1341   - }
1342   - dom.css(i.scrollbarXRail, xRailOffset);
1343   -
1344   - var yRailOffset = {top: element.scrollTop, height: i.railYHeight};
1345   - if (i.isScrollbarYUsingRight) {
1346   - if (i.isRtl) {
1347   - yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth;
1348   - } else {
1349   - yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
1350   - }
1351   - } else {
1352   - if (i.isRtl) {
1353   - yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth;
1354   - } else {
1355   - yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
1356   - }
1357   - }
1358   - dom.css(i.scrollbarYRail, yRailOffset);
1359   -
1360   - dom.css(i.scrollbarX, {left: i.scrollbarXLeft, width: i.scrollbarXWidth - i.railBorderXWidth});
1361   - dom.css(i.scrollbarY, {top: i.scrollbarYTop, height: i.scrollbarYHeight - i.railBorderYWidth});
1362   -}
1363   -
1364   -module.exports = function (element) {
1365   - var i = instances.get(element);
1366   -
1367   - i.containerWidth = element.clientWidth;
1368   - i.containerHeight = element.clientHeight;
1369   - i.contentWidth = element.scrollWidth;
1370   - i.contentHeight = element.scrollHeight;
1371   -
1372   - var existingRails;
1373   - if (!element.contains(i.scrollbarXRail)) {
1374   - existingRails = dom.queryChildren(element, '.ps-scrollbar-x-rail');
1375   - if (existingRails.length > 0) {
1376   - existingRails.forEach(function (rail) {
1377   - dom.remove(rail);
1378   - });
1379   - }
1380   - dom.appendTo(i.scrollbarXRail, element);
1381   - }
1382   - if (!element.contains(i.scrollbarYRail)) {
1383   - existingRails = dom.queryChildren(element, '.ps-scrollbar-y-rail');
1384   - if (existingRails.length > 0) {
1385   - existingRails.forEach(function (rail) {
1386   - dom.remove(rail);
1387   - });
1388   - }
1389   - dom.appendTo(i.scrollbarYRail, element);
1390   - }
1391   -
1392   - if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) {
1393   - i.scrollbarXActive = true;
1394   - i.railXWidth = i.containerWidth - i.railXMarginWidth;
1395   - i.railXRatio = i.containerWidth / i.railXWidth;
1396   - i.scrollbarXWidth = getThumbSize(i, _.toInt(i.railXWidth * i.containerWidth / i.contentWidth));
1397   - i.scrollbarXLeft = _.toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth));
1398   - } else {
1399   - i.scrollbarXActive = false;
1400   - }
1401   -
1402   - if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) {
1403   - i.scrollbarYActive = true;
1404   - i.railYHeight = i.containerHeight - i.railYMarginHeight;
1405   - i.railYRatio = i.containerHeight / i.railYHeight;
1406   - i.scrollbarYHeight = getThumbSize(i, _.toInt(i.railYHeight * i.containerHeight / i.contentHeight));
1407   - i.scrollbarYTop = _.toInt(element.scrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight));
1408   - } else {
1409   - i.scrollbarYActive = false;
1410   - }
1411   -
1412   - if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
1413   - i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
1414   - }
1415   - if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
1416   - i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
1417   - }
1418   -
1419   - updateCss(element, i);
1420   -
1421   - if (i.scrollbarXActive) {
1422   - cls.add(element, 'ps-active-x');
1423   - } else {
1424   - cls.remove(element, 'ps-active-x');
1425   - i.scrollbarXWidth = 0;
1426   - i.scrollbarXLeft = 0;
1427   - updateScroll(element, 'left', 0);
1428   - }
1429   - if (i.scrollbarYActive) {
1430   - cls.add(element, 'ps-active-y');
1431   - } else {
1432   - cls.remove(element, 'ps-active-y');
1433   - i.scrollbarYHeight = 0;
1434   - i.scrollbarYTop = 0;
1435   - updateScroll(element, 'top', 0);
1436   - }
1437   -};
1438   -
1439   -},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){
1440   -'use strict';
1441   -
1442   -var instances = require('./instances');
1443   -
1444   -var lastTop;
1445   -var lastLeft;
1446   -
1447   -var createDOMEvent = function (name) {
1448   - var event = document.createEvent("Event");
1449   - event.initEvent(name, true, true);
1450   - return event;
1451   -};
1452   -
1453   -module.exports = function (element, axis, value) {
1454   - if (typeof element === 'undefined') {
1455   - throw 'You must provide an element to the update-scroll function';
1456   - }
1457   -
1458   - if (typeof axis === 'undefined') {
1459   - throw 'You must provide an axis to the update-scroll function';
1460   - }
1461   -
1462   - if (typeof value === 'undefined') {
1463   - throw 'You must provide a value to the update-scroll function';
1464   - }
1465   -
1466   - if (axis === 'top' && value <= 0) {
1467   - element.scrollTop = value = 0; // don't allow negative scroll
1468   - element.dispatchEvent(createDOMEvent('ps-y-reach-start'));
1469   - }
1470   -
1471   - if (axis === 'left' && value <= 0) {
1472   - element.scrollLeft = value = 0; // don't allow negative scroll
1473   - element.dispatchEvent(createDOMEvent('ps-x-reach-start'));
1474   - }
1475   -
1476   - var i = instances.get(element);
1477   -
1478   - if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
1479   - // don't allow scroll past container
1480   - value = i.contentHeight - i.containerHeight;
1481   - if (value - element.scrollTop <= 1) {
1482   - // mitigates rounding errors on non-subpixel scroll values
1483   - value = element.scrollTop;
1484   - } else {
1485   - element.scrollTop = value;
1486   - }
1487   - element.dispatchEvent(createDOMEvent('ps-y-reach-end'));
1488   - }
1489   -
1490   - if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
1491   - // don't allow scroll past container
1492   - value = i.contentWidth - i.containerWidth;
1493   - if (value - element.scrollLeft <= 1) {
1494   - // mitigates rounding errors on non-subpixel scroll values
1495   - value = element.scrollLeft;
1496   - } else {
1497   - element.scrollLeft = value;
1498   - }
1499   - element.dispatchEvent(createDOMEvent('ps-x-reach-end'));
1500   - }
1501   -
1502   - if (!lastTop) {
1503   - lastTop = element.scrollTop;
1504   - }
1505   -
1506   - if (!lastLeft) {
1507   - lastLeft = element.scrollLeft;
1508   - }
1509   -
1510   - if (axis === 'top' && value < lastTop) {
1511   - element.dispatchEvent(createDOMEvent('ps-scroll-up'));
1512   - }
1513   -
1514   - if (axis === 'top' && value > lastTop) {
1515   - element.dispatchEvent(createDOMEvent('ps-scroll-down'));
1516   - }
1517   -
1518   - if (axis === 'left' && value < lastLeft) {
1519   - element.dispatchEvent(createDOMEvent('ps-scroll-left'));
1520   - }
1521   -
1522   - if (axis === 'left' && value > lastLeft) {
1523   - element.dispatchEvent(createDOMEvent('ps-scroll-right'));
1524   - }
1525   -
1526   - if (axis === 'top') {
1527   - element.scrollTop = lastTop = value;
1528   - element.dispatchEvent(createDOMEvent('ps-scroll-y'));
1529   - }
1530   -
1531   - if (axis === 'left') {
1532   - element.scrollLeft = lastLeft = value;
1533   - element.dispatchEvent(createDOMEvent('ps-scroll-x'));
1534   - }
1535   -
1536   -};
1537   -
1538   -},{"./instances":18}],21:[function(require,module,exports){
1539   -'use strict';
1540   -
1541   -var _ = require('../lib/helper');
1542   -var dom = require('../lib/dom');
1543   -var instances = require('./instances');
1544   -var updateGeometry = require('./update-geometry');
1545   -var updateScroll = require('./update-scroll');
1546   -
1547   -module.exports = function (element) {
1548   - var i = instances.get(element);
1549   -
1550   - if (!i) {
1551   - return;
1552   - }
1553   -
1554   - // Recalcuate negative scrollLeft adjustment
1555   - i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
1556   -
1557   - // Recalculate rail margins
1558   - dom.css(i.scrollbarXRail, 'display', 'block');
1559   - dom.css(i.scrollbarYRail, 'display', 'block');
1560   - i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
1561   - i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
1562   -
1563   - // Hide scrollbars not to affect scrollWidth and scrollHeight
1564   - dom.css(i.scrollbarXRail, 'display', 'none');
1565   - dom.css(i.scrollbarYRail, 'display', 'none');
1566   -
1567   - updateGeometry(element);
1568   -
1569   - // Update top/left scroll to trigger events
1570   - updateScroll(element, 'top', element.scrollTop);
1571   - updateScroll(element, 'left', element.scrollLeft);
1572   -
1573   - dom.css(i.scrollbarXRail, 'display', '');
1574   - dom.css(i.scrollbarYRail, 'display', '');
1575   -};
1576   -
1577   -},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]);
  1 +/* perfect-scrollbar v0.6.16 */
  2 +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  3 +'use strict';
  4 +
  5 +var ps = require('../main');
  6 +var psInstances = require('../plugin/instances');
  7 +
  8 +function mountJQuery(jQuery) {
  9 + jQuery.fn.perfectScrollbar = function (settingOrCommand) {
  10 + return this.each(function () {
  11 + if (typeof settingOrCommand === 'object' ||
  12 + typeof settingOrCommand === 'undefined') {
  13 + // If it's an object or none, initialize.
  14 + var settings = settingOrCommand;
  15 +
  16 + if (!psInstances.get(this)) {
  17 + ps.initialize(this, settings);
  18 + }
  19 + } else {
  20 + // Unless, it may be a command.
  21 + var command = settingOrCommand;
  22 +
  23 + if (command === 'update') {
  24 + ps.update(this);
  25 + } else if (command === 'destroy') {
  26 + ps.destroy(this);
  27 + }
  28 + }
  29 + });
  30 + };
  31 +}
  32 +
  33 +if (typeof define === 'function' && define.amd) {
  34 + // AMD. Register as an anonymous module.
  35 + define(['jquery'], mountJQuery);
  36 +} else {
  37 + var jq = window.jQuery ? window.jQuery : window.$;
  38 + if (typeof jq !== 'undefined') {
  39 + mountJQuery(jq);
  40 + }
  41 +}
  42 +
  43 +module.exports = mountJQuery;
  44 +
  45 +},{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){
  46 +'use strict';
  47 +
  48 +function oldAdd(element, className) {
  49 + var classes = element.className.split(' ');
  50 + if (classes.indexOf(className) < 0) {
  51 + classes.push(className);
  52 + }
  53 + element.className = classes.join(' ');
  54 +}
  55 +
  56 +function oldRemove(element, className) {
  57 + var classes = element.className.split(' ');
  58 + var idx = classes.indexOf(className);
  59 + if (idx >= 0) {
  60 + classes.splice(idx, 1);
  61 + }
  62 + element.className = classes.join(' ');
  63 +}
  64 +
  65 +exports.add = function (element, className) {
  66 + if (element.classList) {
  67 + element.classList.add(className);
  68 + } else {
  69 + oldAdd(element, className);
  70 + }
  71 +};
  72 +
  73 +exports.remove = function (element, className) {
  74 + if (element.classList) {
  75 + element.classList.remove(className);
  76 + } else {
  77 + oldRemove(element, className);
  78 + }
  79 +};
  80 +
  81 +exports.list = function (element) {
  82 + if (element.classList) {
  83 + return Array.prototype.slice.apply(element.classList);
  84 + } else {
  85 + return element.className.split(' ');
  86 + }
  87 +};
  88 +
  89 +},{}],3:[function(require,module,exports){
  90 +'use strict';
  91 +
  92 +var DOM = {};
  93 +
  94 +DOM.e = function (tagName, className) {
  95 + var element = document.createElement(tagName);
  96 + element.className = className;
  97 + return element;
  98 +};
  99 +
  100 +DOM.appendTo = function (child, parent) {
  101 + parent.appendChild(child);
  102 + return child;
  103 +};
  104 +
  105 +function cssGet(element, styleName) {
  106 + return window.getComputedStyle(element)[styleName];
  107 +}
  108 +
  109 +function cssSet(element, styleName, styleValue) {
  110 + if (typeof styleValue === 'number') {
  111 + styleValue = styleValue.toString() + 'px';
  112 + }
  113 + element.style[styleName] = styleValue;
  114 + return element;
  115 +}
  116 +
  117 +function cssMultiSet(element, obj) {
  118 + for (var key in obj) {
  119 + var val = obj[key];
  120 + if (typeof val === 'number') {
  121 + val = val.toString() + 'px';
  122 + }
  123 + element.style[key] = val;
  124 + }
  125 + return element;
  126 +}
  127 +
  128 +DOM.css = function (element, styleNameOrObject, styleValue) {
  129 + if (typeof styleNameOrObject === 'object') {
  130 + // multiple set with object
  131 + return cssMultiSet(element, styleNameOrObject);
  132 + } else {
  133 + if (typeof styleValue === 'undefined') {
  134 + return cssGet(element, styleNameOrObject);
  135 + } else {
  136 + return cssSet(element, styleNameOrObject, styleValue);
  137 + }
  138 + }
  139 +};
  140 +
  141 +DOM.matches = function (element, query) {
  142 + if (typeof element.matches !== 'undefined') {
  143 + return element.matches(query);
  144 + } else {
  145 + if (typeof element.matchesSelector !== 'undefined') {
  146 + return element.matchesSelector(query);
  147 + } else if (typeof element.webkitMatchesSelector !== 'undefined') {
  148 + return element.webkitMatchesSelector(query);
  149 + } else if (typeof element.mozMatchesSelector !== 'undefined') {
  150 + return element.mozMatchesSelector(query);
  151 + } else if (typeof element.msMatchesSelector !== 'undefined') {
  152 + return element.msMatchesSelector(query);
  153 + }
  154 + }
  155 +};
  156 +
  157 +DOM.remove = function (element) {
  158 + if (typeof element.remove !== 'undefined') {
  159 + element.remove();
  160 + } else {
  161 + if (element.parentNode) {
  162 + element.parentNode.removeChild(element);
  163 + }
  164 + }
  165 +};
  166 +
  167 +DOM.queryChildren = function (element, selector) {
  168 + return Array.prototype.filter.call(element.childNodes, function (child) {
  169 + return DOM.matches(child, selector);
  170 + });
  171 +};
  172 +
  173 +module.exports = DOM;
  174 +
  175 +},{}],4:[function(require,module,exports){
  176 +'use strict';
  177 +
  178 +var EventElement = function (element) {
  179 + this.element = element;
  180 + this.events = {};
  181 +};
  182 +
  183 +EventElement.prototype.bind = function (eventName, handler) {
  184 + if (typeof this.events[eventName] === 'undefined') {
  185 + this.events[eventName] = [];
  186 + }
  187 + this.events[eventName].push(handler);
  188 + this.element.addEventListener(eventName, handler, false);
  189 +};
  190 +
  191 +EventElement.prototype.unbind = function (eventName, handler) {
  192 + var isHandlerProvided = (typeof handler !== 'undefined');
  193 + this.events[eventName] = this.events[eventName].filter(function (hdlr) {
  194 + if (isHandlerProvided && hdlr !== handler) {
  195 + return true;
  196 + }
  197 + this.element.removeEventListener(eventName, hdlr, false);
  198 + return false;
  199 + }, this);
  200 +};
  201 +
  202 +EventElement.prototype.unbindAll = function () {
  203 + for (var name in this.events) {
  204 + this.unbind(name);
  205 + }
  206 +};
  207 +
  208 +var EventManager = function () {
  209 + this.eventElements = [];
  210 +};
  211 +
  212 +EventManager.prototype.eventElement = function (element) {
  213 + var ee = this.eventElements.filter(function (eventElement) {
  214 + return eventElement.element === element;
  215 + })[0];
  216 + if (typeof ee === 'undefined') {
  217 + ee = new EventElement(element);
  218 + this.eventElements.push(ee);
  219 + }
  220 + return ee;
  221 +};
  222 +
  223 +EventManager.prototype.bind = function (element, eventName, handler) {
  224 + this.eventElement(element).bind(eventName, handler);
  225 +};
  226 +
  227 +EventManager.prototype.unbind = function (element, eventName, handler) {
  228 + this.eventElement(element).unbind(eventName, handler);
  229 +};
  230 +
  231 +EventManager.prototype.unbindAll = function () {
  232 + for (var i = 0; i < this.eventElements.length; i++) {
  233 + this.eventElements[i].unbindAll();
  234 + }
  235 +};
  236 +
  237 +EventManager.prototype.once = function (element, eventName, handler) {
  238 + var ee = this.eventElement(element);
  239 + var onceHandler = function (e) {
  240 + ee.unbind(eventName, onceHandler);
  241 + handler(e);
  242 + };
  243 + ee.bind(eventName, onceHandler);
  244 +};
  245 +
  246 +module.exports = EventManager;
  247 +
  248 +},{}],5:[function(require,module,exports){
  249 +'use strict';
  250 +
  251 +module.exports = (function () {
  252 + function s4() {
  253 + return Math.floor((1 + Math.random()) * 0x10000)
  254 + .toString(16)
  255 + .substring(1);
  256 + }
  257 + return function () {
  258 + return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
  259 + s4() + '-' + s4() + s4() + s4();
  260 + };
  261 +})();
  262 +
  263 +},{}],6:[function(require,module,exports){
  264 +'use strict';
  265 +
  266 +var cls = require('./class');
  267 +var dom = require('./dom');
  268 +
  269 +var toInt = exports.toInt = function (x) {
  270 + return parseInt(x, 10) || 0;
  271 +};
  272 +
  273 +var clone = exports.clone = function (obj) {
  274 + if (!obj) {
  275 + return null;
  276 + } else if (obj.constructor === Array) {
  277 + return obj.map(clone);
  278 + } else if (typeof obj === 'object') {
  279 + var result = {};
  280 + for (var key in obj) {
  281 + result[key] = clone(obj[key]);
  282 + }
  283 + return result;
  284 + } else {
  285 + return obj;
  286 + }
  287 +};
  288 +
  289 +exports.extend = function (original, source) {
  290 + var result = clone(original);
  291 + for (var key in source) {
  292 + result[key] = clone(source[key]);
  293 + }
  294 + return result;
  295 +};
  296 +
  297 +exports.isEditable = function (el) {
  298 + return dom.matches(el, "input,[contenteditable]") ||
  299 + dom.matches(el, "select,[contenteditable]") ||
  300 + dom.matches(el, "textarea,[contenteditable]") ||
  301 + dom.matches(el, "button,[contenteditable]");
  302 +};
  303 +
  304 +exports.removePsClasses = function (element) {
  305 + var clsList = cls.list(element);
  306 + for (var i = 0; i < clsList.length; i++) {
  307 + var className = clsList[i];
  308 + if (className.indexOf('ps-') === 0) {
  309 + cls.remove(element, className);
  310 + }
  311 + }
  312 +};
  313 +
  314 +exports.outerWidth = function (element) {
  315 + return toInt(dom.css(element, 'width')) +
  316 + toInt(dom.css(element, 'paddingLeft')) +
  317 + toInt(dom.css(element, 'paddingRight')) +
  318 + toInt(dom.css(element, 'borderLeftWidth')) +
  319 + toInt(dom.css(element, 'borderRightWidth'));
  320 +};
  321 +
  322 +exports.startScrolling = function (element, axis) {
  323 + cls.add(element, 'ps-in-scrolling');
  324 + if (typeof axis !== 'undefined') {
  325 + cls.add(element, 'ps-' + axis);
  326 + } else {
  327 + cls.add(element, 'ps-x');
  328 + cls.add(element, 'ps-y');
  329 + }
  330 +};
  331 +
  332 +exports.stopScrolling = function (element, axis) {
  333 + cls.remove(element, 'ps-in-scrolling');
  334 + if (typeof axis !== 'undefined') {
  335 + cls.remove(element, 'ps-' + axis);
  336 + } else {
  337 + cls.remove(element, 'ps-x');
  338 + cls.remove(element, 'ps-y');
  339 + }
  340 +};
  341 +
  342 +exports.env = {
  343 + isWebKit: 'WebkitAppearance' in document.documentElement.style,
  344 + supportsTouch: (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
  345 + supportsIePointer: window.navigator.msMaxTouchPoints !== null
  346 +};
  347 +
  348 +},{"./class":2,"./dom":3}],7:[function(require,module,exports){
  349 +'use strict';
  350 +
  351 +var destroy = require('./plugin/destroy');
  352 +var initialize = require('./plugin/initialize');
  353 +var update = require('./plugin/update');
  354 +
  355 +module.exports = {
  356 + initialize: initialize,
  357 + update: update,
  358 + destroy: destroy
  359 +};
  360 +
  361 +},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(require,module,exports){
  362 +'use strict';
  363 +
  364 +module.exports = {
  365 + handlers: ['click-rail', 'drag-scrollbar', 'keyboard', 'wheel', 'touch'],
  366 + maxScrollbarLength: null,
  367 + minScrollbarLength: null,
  368 + scrollXMarginOffset: 0,
  369 + scrollYMarginOffset: 0,
  370 + suppressScrollX: false,
  371 + suppressScrollY: false,
  372 + swipePropagation: true,
  373 + useBothWheelAxes: false,
  374 + wheelPropagation: false,
  375 + wheelSpeed: 1,
  376 + theme: 'default'
  377 +};
  378 +
  379 +},{}],9:[function(require,module,exports){
  380 +'use strict';
  381 +
  382 +var _ = require('../lib/helper');
  383 +var dom = require('../lib/dom');
  384 +var instances = require('./instances');
  385 +
  386 +module.exports = function (element) {
  387 + var i = instances.get(element);
  388 +
  389 + if (!i) {
  390 + return;
  391 + }
  392 +
  393 + i.event.unbindAll();
  394 + dom.remove(i.scrollbarX);
  395 + dom.remove(i.scrollbarY);
  396 + dom.remove(i.scrollbarXRail);
  397 + dom.remove(i.scrollbarYRail);
  398 + _.removePsClasses(element);
  399 +
  400 + instances.remove(element);
  401 +};
  402 +
  403 +},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){
  404 +'use strict';
  405 +
  406 +var instances = require('../instances');
  407 +var updateGeometry = require('../update-geometry');
  408 +var updateScroll = require('../update-scroll');
  409 +
  410 +function bindClickRailHandler(element, i) {
  411 + function pageOffset(el) {
  412 + return el.getBoundingClientRect();
  413 + }
  414 + var stopPropagation = function (e) { e.stopPropagation(); };
  415 +
  416 + i.event.bind(i.scrollbarY, 'click', stopPropagation);
  417 + i.event.bind(i.scrollbarYRail, 'click', function (e) {
  418 + var positionTop = e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top;
  419 + var direction = positionTop > i.scrollbarYTop ? 1 : -1;
  420 +
  421 + updateScroll(element, 'top', element.scrollTop + direction * i.containerHeight);
  422 + updateGeometry(element);
  423 +
  424 + e.stopPropagation();
  425 + });
  426 +
  427 + i.event.bind(i.scrollbarX, 'click', stopPropagation);
  428 + i.event.bind(i.scrollbarXRail, 'click', function (e) {
  429 + var positionLeft = e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left;
  430 + var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
  431 +
  432 + updateScroll(element, 'left', element.scrollLeft + direction * i.containerWidth);
  433 + updateGeometry(element);
  434 +
  435 + e.stopPropagation();
  436 + });
  437 +}
  438 +
  439 +module.exports = function (element) {
  440 + var i = instances.get(element);
  441 + bindClickRailHandler(element, i);
  442 +};
  443 +
  444 +},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){
  445 +'use strict';
  446 +
  447 +var _ = require('../../lib/helper');
  448 +var dom = require('../../lib/dom');
  449 +var instances = require('../instances');
  450 +var updateGeometry = require('../update-geometry');
  451 +var updateScroll = require('../update-scroll');
  452 +
  453 +function bindMouseScrollXHandler(element, i) {
  454 + var currentLeft = null;
  455 + var currentPageX = null;
  456 +
  457 + function updateScrollLeft(deltaX) {
  458 + var newLeft = currentLeft + (deltaX * i.railXRatio);
  459 + var maxLeft = Math.max(0, i.scrollbarXRail.getBoundingClientRect().left) + (i.railXRatio * (i.railXWidth - i.scrollbarXWidth));
  460 +
  461 + if (newLeft < 0) {
  462 + i.scrollbarXLeft = 0;
  463 + } else if (newLeft > maxLeft) {
  464 + i.scrollbarXLeft = maxLeft;
  465 + } else {
  466 + i.scrollbarXLeft = newLeft;
  467 + }
  468 +
  469 + var scrollLeft = _.toInt(i.scrollbarXLeft * (i.contentWidth - i.containerWidth) / (i.containerWidth - (i.railXRatio * i.scrollbarXWidth))) - i.negativeScrollAdjustment;
  470 + updateScroll(element, 'left', scrollLeft);
  471 + }
  472 +
  473 + var mouseMoveHandler = function (e) {
  474 + updateScrollLeft(e.pageX - currentPageX);
  475 + updateGeometry(element);
  476 + e.stopPropagation();
  477 + e.preventDefault();
  478 + };
  479 +
  480 + var mouseUpHandler = function () {
  481 + _.stopScrolling(element, 'x');
  482 + i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  483 + };
  484 +
  485 + i.event.bind(i.scrollbarX, 'mousedown', function (e) {
  486 + currentPageX = e.pageX;
  487 + currentLeft = _.toInt(dom.css(i.scrollbarX, 'left')) * i.railXRatio;
  488 + _.startScrolling(element, 'x');
  489 +
  490 + i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  491 + i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
  492 +
  493 + e.stopPropagation();
  494 + e.preventDefault();
  495 + });
  496 +}
  497 +
  498 +function bindMouseScrollYHandler(element, i) {
  499 + var currentTop = null;
  500 + var currentPageY = null;
  501 +
  502 + function updateScrollTop(deltaY) {
  503 + var newTop = currentTop + (deltaY * i.railYRatio);
  504 + var maxTop = Math.max(0, i.scrollbarYRail.getBoundingClientRect().top) + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight));
  505 +
  506 + if (newTop < 0) {
  507 + i.scrollbarYTop = 0;
  508 + } else if (newTop > maxTop) {
  509 + i.scrollbarYTop = maxTop;
  510 + } else {
  511 + i.scrollbarYTop = newTop;
  512 + }
  513 +
  514 + var scrollTop = _.toInt(i.scrollbarYTop * (i.contentHeight - i.containerHeight) / (i.containerHeight - (i.railYRatio * i.scrollbarYHeight)));
  515 + updateScroll(element, 'top', scrollTop);
  516 + }
  517 +
  518 + var mouseMoveHandler = function (e) {
  519 + updateScrollTop(e.pageY - currentPageY);
  520 + updateGeometry(element);
  521 + e.stopPropagation();
  522 + e.preventDefault();
  523 + };
  524 +
  525 + var mouseUpHandler = function () {
  526 + _.stopScrolling(element, 'y');
  527 + i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  528 + };
  529 +
  530 + i.event.bind(i.scrollbarY, 'mousedown', function (e) {
  531 + currentPageY = e.pageY;
  532 + currentTop = _.toInt(dom.css(i.scrollbarY, 'top')) * i.railYRatio;
  533 + _.startScrolling(element, 'y');
  534 +
  535 + i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  536 + i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
  537 +
  538 + e.stopPropagation();
  539 + e.preventDefault();
  540 + });
  541 +}
  542 +
  543 +module.exports = function (element) {
  544 + var i = instances.get(element);
  545 + bindMouseScrollXHandler(element, i);
  546 + bindMouseScrollYHandler(element, i);
  547 +};
  548 +
  549 +},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){
  550 +'use strict';
  551 +
  552 +var _ = require('../../lib/helper');
  553 +var dom = require('../../lib/dom');
  554 +var instances = require('../instances');
  555 +var updateGeometry = require('../update-geometry');
  556 +var updateScroll = require('../update-scroll');
  557 +
  558 +function bindKeyboardHandler(element, i) {
  559 + var hovered = false;
  560 + i.event.bind(element, 'mouseenter', function () {
  561 + hovered = true;
  562 + });
  563 + i.event.bind(element, 'mouseleave', function () {
  564 + hovered = false;
  565 + });
  566 +
  567 + var shouldPrevent = false;
  568 + function shouldPreventDefault(deltaX, deltaY) {
  569 + var scrollTop = element.scrollTop;
  570 + if (deltaX === 0) {
  571 + if (!i.scrollbarYActive) {
  572 + return false;
  573 + }
  574 + if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) {
  575 + return !i.settings.wheelPropagation;
  576 + }
  577 + }
  578 +
  579 + var scrollLeft = element.scrollLeft;
  580 + if (deltaY === 0) {
  581 + if (!i.scrollbarXActive) {
  582 + return false;
  583 + }
  584 + if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) {
  585 + return !i.settings.wheelPropagation;
  586 + }
  587 + }
  588 + return true;
  589 + }
  590 +
  591 + i.event.bind(i.ownerDocument, 'keydown', function (e) {
  592 + if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) {
  593 + return;
  594 + }
  595 +
  596 + var focused = dom.matches(i.scrollbarX, ':focus') ||
  597 + dom.matches(i.scrollbarY, ':focus');
  598 +
  599 + if (!hovered && !focused) {
  600 + return;
  601 + }
  602 +
  603 + var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement;
  604 + if (activeElement) {
  605 + if (activeElement.tagName === 'IFRAME') {
  606 + activeElement = activeElement.contentDocument.activeElement;
  607 + } else {
  608 + // go deeper if element is a webcomponent
  609 + while (activeElement.shadowRoot) {
  610 + activeElement = activeElement.shadowRoot.activeElement;
  611 + }
  612 + }
  613 + if (_.isEditable(activeElement)) {
  614 + return;
  615 + }
  616 + }
  617 +
  618 + var deltaX = 0;
  619 + var deltaY = 0;
  620 +
  621 + switch (e.which) {
  622 + case 37: // left
  623 + if (e.metaKey) {
  624 + deltaX = -i.contentWidth;
  625 + } else if (e.altKey) {
  626 + deltaX = -i.containerWidth;
  627 + } else {
  628 + deltaX = -30;
  629 + }
  630 + break;
  631 + case 38: // up
  632 + if (e.metaKey) {
  633 + deltaY = i.contentHeight;
  634 + } else if (e.altKey) {
  635 + deltaY = i.containerHeight;
  636 + } else {
  637 + deltaY = 30;
  638 + }
  639 + break;
  640 + case 39: // right
  641 + if (e.metaKey) {
  642 + deltaX = i.contentWidth;
  643 + } else if (e.altKey) {
  644 + deltaX = i.containerWidth;
  645 + } else {
  646 + deltaX = 30;
  647 + }
  648 + break;
  649 + case 40: // down
  650 + if (e.metaKey) {
  651 + deltaY = -i.contentHeight;
  652 + } else if (e.altKey) {
  653 + deltaY = -i.containerHeight;
  654 + } else {
  655 + deltaY = -30;
  656 + }
  657 + break;
  658 + case 33: // page up
  659 + deltaY = 90;
  660 + break;
  661 + case 32: // space bar
  662 + if (e.shiftKey) {
  663 + deltaY = 90;
  664 + } else {
  665 + deltaY = -90;
  666 + }
  667 + break;
  668 + case 34: // page down
  669 + deltaY = -90;
  670 + break;
  671 + case 35: // end
  672 + if (e.ctrlKey) {
  673 + deltaY = -i.contentHeight;
  674 + } else {
  675 + deltaY = -i.containerHeight;
  676 + }
  677 + break;
  678 + case 36: // home
  679 + if (e.ctrlKey) {
  680 + deltaY = element.scrollTop;
  681 + } else {
  682 + deltaY = i.containerHeight;
  683 + }
  684 + break;
  685 + default:
  686 + return;
  687 + }
  688 +
  689 + updateScroll(element, 'top', element.scrollTop - deltaY);
  690 + updateScroll(element, 'left', element.scrollLeft + deltaX);
  691 + updateGeometry(element);
  692 +
  693 + shouldPrevent = shouldPreventDefault(deltaX, deltaY);
  694 + if (shouldPrevent) {
  695 + e.preventDefault();
  696 + }
  697 + });
  698 +}
  699 +
  700 +module.exports = function (element) {
  701 + var i = instances.get(element);
  702 + bindKeyboardHandler(element, i);
  703 +};
  704 +
  705 +},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
  706 +'use strict';
  707 +
  708 +var instances = require('../instances');
  709 +var updateGeometry = require('../update-geometry');
  710 +var updateScroll = require('../update-scroll');
  711 +
  712 +function bindMouseWheelHandler(element, i) {
  713 + var shouldPrevent = false;
  714 +
  715 + function shouldPreventDefault(deltaX, deltaY) {
  716 + var scrollTop = element.scrollTop;
  717 + if (deltaX === 0) {
  718 + if (!i.scrollbarYActive) {
  719 + return false;
  720 + }
  721 + if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) {
  722 + return !i.settings.wheelPropagation;
  723 + }
  724 + }
  725 +
  726 + var scrollLeft = element.scrollLeft;
  727 + if (deltaY === 0) {
  728 + if (!i.scrollbarXActive) {
  729 + return false;
  730 + }
  731 + if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) {
  732 + return !i.settings.wheelPropagation;
  733 + }
  734 + }
  735 + return true;
  736 + }
  737 +
  738 + function getDeltaFromEvent(e) {
  739 + var deltaX = e.deltaX;
  740 + var deltaY = -1 * e.deltaY;
  741 +
  742 + if (typeof deltaX === "undefined" || typeof deltaY === "undefined") {
  743 + // OS X Safari
  744 + deltaX = -1 * e.wheelDeltaX / 6;
  745 + deltaY = e.wheelDeltaY / 6;
  746 + }
  747 +
  748 + if (e.deltaMode && e.deltaMode === 1) {
  749 + // Firefox in deltaMode 1: Line scrolling
  750 + deltaX *= 10;
  751 + deltaY *= 10;
  752 + }
  753 +
  754 + if (deltaX !== deltaX && deltaY !== deltaY/* NaN checks */) {
  755 + // IE in some mouse drivers
  756 + deltaX = 0;
  757 + deltaY = e.wheelDelta;
  758 + }
  759 +
  760 + if (e.shiftKey) {
  761 + // reverse axis with shift key
  762 + return [-deltaY, -deltaX];
  763 + }
  764 + return [deltaX, deltaY];
  765 + }
  766 +
  767 + function shouldBeConsumedByChild(deltaX, deltaY) {
  768 + var child = element.querySelector('textarea:hover, select[multiple]:hover, .ps-child:hover');
  769 + if (child) {
  770 + if (!window.getComputedStyle(child).overflow.match(/(scroll|auto)/)) {
  771 + // if not scrollable
  772 + return false;
  773 + }
  774 +
  775 + var maxScrollTop = child.scrollHeight - child.clientHeight;
  776 + if (maxScrollTop > 0) {
  777 + if (!(child.scrollTop === 0 && deltaY > 0) && !(child.scrollTop === maxScrollTop && deltaY < 0)) {
  778 + return true;
  779 + }
  780 + }
  781 + var maxScrollLeft = child.scrollLeft - child.clientWidth;
  782 + if (maxScrollLeft > 0) {
  783 + if (!(child.scrollLeft === 0 && deltaX < 0) && !(child.scrollLeft === maxScrollLeft && deltaX > 0)) {
  784 + return true;
  785 + }
  786 + }
  787 + }
  788 + return false;
  789 + }
  790 +
  791 + function mousewheelHandler(e) {
  792 + var delta = getDeltaFromEvent(e);
  793 +
  794 + var deltaX = delta[0];
  795 + var deltaY = delta[1];
  796 +
  797 + if (shouldBeConsumedByChild(deltaX, deltaY)) {
  798 + return;
  799 + }
  800 +
  801 + shouldPrevent = false;
  802 + if (!i.settings.useBothWheelAxes) {
  803 + // deltaX will only be used for horizontal scrolling and deltaY will
  804 + // only be used for vertical scrolling - this is the default
  805 + updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed));
  806 + updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed));
  807 + } else if (i.scrollbarYActive && !i.scrollbarXActive) {
  808 + // only vertical scrollbar is active and useBothWheelAxes option is
  809 + // active, so let's scroll vertical bar using both mouse wheel axes
  810 + if (deltaY) {
  811 + updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed));
  812 + } else {
  813 + updateScroll(element, 'top', element.scrollTop + (deltaX * i.settings.wheelSpeed));
  814 + }
  815 + shouldPrevent = true;
  816 + } else if (i.scrollbarXActive && !i.scrollbarYActive) {
  817 + // useBothWheelAxes and only horizontal bar is active, so use both
  818 + // wheel axes for horizontal bar
  819 + if (deltaX) {
  820 + updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed));
  821 + } else {
  822 + updateScroll(element, 'left', element.scrollLeft - (deltaY * i.settings.wheelSpeed));
  823 + }
  824 + shouldPrevent = true;
  825 + }
  826 +
  827 + updateGeometry(element);
  828 +
  829 + shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY));
  830 + if (shouldPrevent) {
  831 + e.stopPropagation();
  832 + e.preventDefault();
  833 + }
  834 + }
  835 +
  836 + if (typeof window.onwheel !== "undefined") {
  837 + i.event.bind(element, 'wheel', mousewheelHandler);
  838 + } else if (typeof window.onmousewheel !== "undefined") {
  839 + i.event.bind(element, 'mousewheel', mousewheelHandler);
  840 + }
  841 +}
  842 +
  843 +module.exports = function (element) {
  844 + var i = instances.get(element);
  845 + bindMouseWheelHandler(element, i);
  846 +};
  847 +
  848 +},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){
  849 +'use strict';
  850 +
  851 +var instances = require('../instances');
  852 +var updateGeometry = require('../update-geometry');
  853 +
  854 +function bindNativeScrollHandler(element, i) {
  855 + i.event.bind(element, 'scroll', function () {
  856 + updateGeometry(element);
  857 + });
  858 +}
  859 +
  860 +module.exports = function (element) {
  861 + var i = instances.get(element);
  862 + bindNativeScrollHandler(element, i);
  863 +};
  864 +
  865 +},{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){
  866 +'use strict';
  867 +
  868 +var _ = require('../../lib/helper');
  869 +var instances = require('../instances');
  870 +var updateGeometry = require('../update-geometry');
  871 +var updateScroll = require('../update-scroll');
  872 +
  873 +function bindSelectionHandler(element, i) {
  874 + function getRangeNode() {
  875 + var selection = window.getSelection ? window.getSelection() :
  876 + document.getSelection ? document.getSelection() : '';
  877 + if (selection.toString().length === 0) {
  878 + return null;
  879 + } else {
  880 + return selection.getRangeAt(0).commonAncestorContainer;
  881 + }
  882 + }
  883 +
  884 + var scrollingLoop = null;
  885 + var scrollDiff = {top: 0, left: 0};
  886 + function startScrolling() {
  887 + if (!scrollingLoop) {
  888 + scrollingLoop = setInterval(function () {
  889 + if (!instances.get(element)) {
  890 + clearInterval(scrollingLoop);
  891 + return;
  892 + }
  893 +
  894 + updateScroll(element, 'top', element.scrollTop + scrollDiff.top);
  895 + updateScroll(element, 'left', element.scrollLeft + scrollDiff.left);
  896 + updateGeometry(element);
  897 + }, 50); // every .1 sec
  898 + }
  899 + }
  900 + function stopScrolling() {
  901 + if (scrollingLoop) {
  902 + clearInterval(scrollingLoop);
  903 + scrollingLoop = null;
  904 + }
  905 + _.stopScrolling(element);
  906 + }
  907 +
  908 + var isSelected = false;
  909 + i.event.bind(i.ownerDocument, 'selectionchange', function () {
  910 + if (element.contains(getRangeNode())) {
  911 + isSelected = true;
  912 + } else {
  913 + isSelected = false;
  914 + stopScrolling();
  915 + }
  916 + });
  917 + i.event.bind(window, 'mouseup', function () {
  918 + if (isSelected) {
  919 + isSelected = false;
  920 + stopScrolling();
  921 + }
  922 + });
  923 + i.event.bind(window, 'keyup', function () {
  924 + if (isSelected) {
  925 + isSelected = false;
  926 + stopScrolling();
  927 + }
  928 + });
  929 +
  930 + i.event.bind(window, 'mousemove', function (e) {
  931 + if (isSelected) {
  932 + var mousePosition = {x: e.pageX, y: e.pageY};
  933 + var containerGeometry = {
  934 + left: element.offsetLeft,
  935 + right: element.offsetLeft + element.offsetWidth,
  936 + top: element.offsetTop,
  937 + bottom: element.offsetTop + element.offsetHeight
  938 + };
  939 +
  940 + if (mousePosition.x < containerGeometry.left + 3) {
  941 + scrollDiff.left = -5;
  942 + _.startScrolling(element, 'x');
  943 + } else if (mousePosition.x > containerGeometry.right - 3) {
  944 + scrollDiff.left = 5;
  945 + _.startScrolling(element, 'x');
  946 + } else {
  947 + scrollDiff.left = 0;
  948 + }
  949 +
  950 + if (mousePosition.y < containerGeometry.top + 3) {
  951 + if (containerGeometry.top + 3 - mousePosition.y < 5) {
  952 + scrollDiff.top = -5;
  953 + } else {
  954 + scrollDiff.top = -20;
  955 + }
  956 + _.startScrolling(element, 'y');
  957 + } else if (mousePosition.y > containerGeometry.bottom - 3) {
  958 + if (mousePosition.y - containerGeometry.bottom + 3 < 5) {
  959 + scrollDiff.top = 5;
  960 + } else {
  961 + scrollDiff.top = 20;
  962 + }
  963 + _.startScrolling(element, 'y');
  964 + } else {
  965 + scrollDiff.top = 0;
  966 + }
  967 +
  968 + if (scrollDiff.top === 0 && scrollDiff.left === 0) {
  969 + stopScrolling();
  970 + } else {
  971 + startScrolling();
  972 + }
  973 + }
  974 + });
  975 +}
  976 +
  977 +module.exports = function (element) {
  978 + var i = instances.get(element);
  979 + bindSelectionHandler(element, i);
  980 +};
  981 +
  982 +},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){
  983 +'use strict';
  984 +
  985 +var _ = require('../../lib/helper');
  986 +var instances = require('../instances');
  987 +var updateGeometry = require('../update-geometry');
  988 +var updateScroll = require('../update-scroll');
  989 +
  990 +function bindTouchHandler(element, i, supportsTouch, supportsIePointer) {
  991 + function shouldPreventDefault(deltaX, deltaY) {
  992 + var scrollTop = element.scrollTop;
  993 + var scrollLeft = element.scrollLeft;
  994 + var magnitudeX = Math.abs(deltaX);
  995 + var magnitudeY = Math.abs(deltaY);
  996 +
  997 + if (magnitudeY > magnitudeX) {
  998 + // user is perhaps trying to swipe up/down the page
  999 +
  1000 + if (((deltaY < 0) && (scrollTop === i.contentHeight - i.containerHeight)) ||
  1001 + ((deltaY > 0) && (scrollTop === 0))) {
  1002 + return !i.settings.swipePropagation;
  1003 + }
  1004 + } else if (magnitudeX > magnitudeY) {
  1005 + // user is perhaps trying to swipe left/right across the page
  1006 +
  1007 + if (((deltaX < 0) && (scrollLeft === i.contentWidth - i.containerWidth)) ||
  1008 + ((deltaX > 0) && (scrollLeft === 0))) {
  1009 + return !i.settings.swipePropagation;
  1010 + }
  1011 + }
  1012 +
  1013 + return true;
  1014 + }
  1015 +
  1016 + function applyTouchMove(differenceX, differenceY) {
  1017 + updateScroll(element, 'top', element.scrollTop - differenceY);
  1018 + updateScroll(element, 'left', element.scrollLeft - differenceX);
  1019 +
  1020 + updateGeometry(element);
  1021 + }
  1022 +
  1023 + var startOffset = {};
  1024 + var startTime = 0;
  1025 + var speed = {};
  1026 + var easingLoop = null;
  1027 + var inGlobalTouch = false;
  1028 + var inLocalTouch = false;
  1029 +
  1030 + function globalTouchStart() {
  1031 + inGlobalTouch = true;
  1032 + }
  1033 + function globalTouchEnd() {
  1034 + inGlobalTouch = false;
  1035 + }
  1036 +
  1037 + function getTouch(e) {
  1038 + if (e.targetTouches) {
  1039 + return e.targetTouches[0];
  1040 + } else {
  1041 + // Maybe IE pointer
  1042 + return e;
  1043 + }
  1044 + }
  1045 + function shouldHandle(e) {
  1046 + if (e.targetTouches && e.targetTouches.length === 1) {
  1047 + return true;
  1048 + }
  1049 + if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
  1050 + return true;
  1051 + }
  1052 + return false;
  1053 + }
  1054 + function touchStart(e) {
  1055 + if (shouldHandle(e)) {
  1056 + inLocalTouch = true;
  1057 +
  1058 + var touch = getTouch(e);
  1059 +
  1060 + startOffset.pageX = touch.pageX;
  1061 + startOffset.pageY = touch.pageY;
  1062 +
  1063 + startTime = (new Date()).getTime();
  1064 +
  1065 + if (easingLoop !== null) {
  1066 + clearInterval(easingLoop);
  1067 + }
  1068 +
  1069 + e.stopPropagation();
  1070 + }
  1071 + }
  1072 + function touchMove(e) {
  1073 + if (!inLocalTouch && i.settings.swipePropagation) {
  1074 + touchStart(e);
  1075 + }
  1076 + if (!inGlobalTouch && inLocalTouch && shouldHandle(e)) {
  1077 + var touch = getTouch(e);
  1078 +
  1079 + var currentOffset = {pageX: touch.pageX, pageY: touch.pageY};
  1080 +
  1081 + var differenceX = currentOffset.pageX - startOffset.pageX;
  1082 + var differenceY = currentOffset.pageY - startOffset.pageY;
  1083 +
  1084 + applyTouchMove(differenceX, differenceY);
  1085 + startOffset = currentOffset;
  1086 +
  1087 + var currentTime = (new Date()).getTime();
  1088 +
  1089 + var timeGap = currentTime - startTime;
  1090 + if (timeGap > 0) {
  1091 + speed.x = differenceX / timeGap;
  1092 + speed.y = differenceY / timeGap;
  1093 + startTime = currentTime;
  1094 + }
  1095 +
  1096 + if (shouldPreventDefault(differenceX, differenceY)) {
  1097 + e.stopPropagation();
  1098 + e.preventDefault();
  1099 + }
  1100 + }
  1101 + }
  1102 + function touchEnd() {
  1103 + if (!inGlobalTouch && inLocalTouch) {
  1104 + inLocalTouch = false;
  1105 +
  1106 + clearInterval(easingLoop);
  1107 + easingLoop = setInterval(function () {
  1108 + if (!instances.get(element)) {
  1109 + clearInterval(easingLoop);
  1110 + return;
  1111 + }
  1112 +
  1113 + if (!speed.x && !speed.y) {
  1114 + clearInterval(easingLoop);
  1115 + return;
  1116 + }
  1117 +
  1118 + if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
  1119 + clearInterval(easingLoop);
  1120 + return;
  1121 + }
  1122 +
  1123 + applyTouchMove(speed.x * 30, speed.y * 30);
  1124 +
  1125 + speed.x *= 0.8;
  1126 + speed.y *= 0.8;
  1127 + }, 10);
  1128 + }
  1129 + }
  1130 +
  1131 + if (supportsTouch) {
  1132 + i.event.bind(window, 'touchstart', globalTouchStart);
  1133 + i.event.bind(window, 'touchend', globalTouchEnd);
  1134 + i.event.bind(element, 'touchstart', touchStart);
  1135 + i.event.bind(element, 'touchmove', touchMove);
  1136 + i.event.bind(element, 'touchend', touchEnd);
  1137 + } else if (supportsIePointer) {
  1138 + if (window.PointerEvent) {
  1139 + i.event.bind(window, 'pointerdown', globalTouchStart);
  1140 + i.event.bind(window, 'pointerup', globalTouchEnd);
  1141 + i.event.bind(element, 'pointerdown', touchStart);
  1142 + i.event.bind(element, 'pointermove', touchMove);
  1143 + i.event.bind(element, 'pointerup', touchEnd);
  1144 + } else if (window.MSPointerEvent) {
  1145 + i.event.bind(window, 'MSPointerDown', globalTouchStart);
  1146 + i.event.bind(window, 'MSPointerUp', globalTouchEnd);
  1147 + i.event.bind(element, 'MSPointerDown', touchStart);
  1148 + i.event.bind(element, 'MSPointerMove', touchMove);
  1149 + i.event.bind(element, 'MSPointerUp', touchEnd);
  1150 + }
  1151 + }
  1152 +}
  1153 +
  1154 +module.exports = function (element) {
  1155 + if (!_.env.supportsTouch && !_.env.supportsIePointer) {
  1156 + return;
  1157 + }
  1158 +
  1159 + var i = instances.get(element);
  1160 + bindTouchHandler(element, i, _.env.supportsTouch, _.env.supportsIePointer);
  1161 +};
  1162 +
  1163 +},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){
  1164 +'use strict';
  1165 +
  1166 +var _ = require('../lib/helper');
  1167 +var cls = require('../lib/class');
  1168 +var instances = require('./instances');
  1169 +var updateGeometry = require('./update-geometry');
  1170 +
  1171 +// Handlers
  1172 +var handlers = {
  1173 + 'click-rail': require('./handler/click-rail'),
  1174 + 'drag-scrollbar': require('./handler/drag-scrollbar'),
  1175 + 'keyboard': require('./handler/keyboard'),
  1176 + 'wheel': require('./handler/mouse-wheel'),
  1177 + 'touch': require('./handler/touch'),
  1178 + 'selection': require('./handler/selection')
  1179 +};
  1180 +var nativeScrollHandler = require('./handler/native-scroll');
  1181 +
  1182 +module.exports = function (element, userSettings) {
  1183 + userSettings = typeof userSettings === 'object' ? userSettings : {};
  1184 +
  1185 + cls.add(element, 'ps-container');
  1186 +
  1187 + // Create a plugin instance.
  1188 + var i = instances.add(element);
  1189 +
  1190 + i.settings = _.extend(i.settings, userSettings);
  1191 + cls.add(element, 'ps-theme-' + i.settings.theme);
  1192 +
  1193 + i.settings.handlers.forEach(function (handlerName) {
  1194 + handlers[handlerName](element);
  1195 + });
  1196 +
  1197 + nativeScrollHandler(element);
  1198 +
  1199 + updateGeometry(element);
  1200 +};
  1201 +
  1202 +},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(require,module,exports){
  1203 +'use strict';
  1204 +
  1205 +var _ = require('../lib/helper');
  1206 +var cls = require('../lib/class');
  1207 +var defaultSettings = require('./default-setting');
  1208 +var dom = require('../lib/dom');
  1209 +var EventManager = require('../lib/event-manager');
  1210 +var guid = require('../lib/guid');
  1211 +
  1212 +var instances = {};
  1213 +
  1214 +function Instance(element) {
  1215 + var i = this;
  1216 +
  1217 + i.settings = _.clone(defaultSettings);
  1218 + i.containerWidth = null;
  1219 + i.containerHeight = null;
  1220 + i.contentWidth = null;
  1221 + i.contentHeight = null;
  1222 +
  1223 + i.isRtl = dom.css(element, 'direction') === "rtl";
  1224 + i.isNegativeScroll = (function () {
  1225 + var originalScrollLeft = element.scrollLeft;
  1226 + var result = null;
  1227 + element.scrollLeft = -1;
  1228 + result = element.scrollLeft < 0;
  1229 + element.scrollLeft = originalScrollLeft;
  1230 + return result;
  1231 + })();
  1232 + i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
  1233 + i.event = new EventManager();
  1234 + i.ownerDocument = element.ownerDocument || document;
  1235 +
  1236 + function focus() {
  1237 + cls.add(element, 'ps-focus');
  1238 + }
  1239 +
  1240 + function blur() {
  1241 + cls.remove(element, 'ps-focus');
  1242 + }
  1243 +
  1244 + i.scrollbarXRail = dom.appendTo(dom.e('div', 'ps-scrollbar-x-rail'), element);
  1245 + i.scrollbarX = dom.appendTo(dom.e('div', 'ps-scrollbar-x'), i.scrollbarXRail);
  1246 + i.scrollbarX.setAttribute('tabindex', 0);
  1247 + i.event.bind(i.scrollbarX, 'focus', focus);
  1248 + i.event.bind(i.scrollbarX, 'blur', blur);
  1249 + i.scrollbarXActive = null;
  1250 + i.scrollbarXWidth = null;
  1251 + i.scrollbarXLeft = null;
  1252 + i.scrollbarXBottom = _.toInt(dom.css(i.scrollbarXRail, 'bottom'));
  1253 + i.isScrollbarXUsingBottom = i.scrollbarXBottom === i.scrollbarXBottom; // !isNaN
  1254 + i.scrollbarXTop = i.isScrollbarXUsingBottom ? null : _.toInt(dom.css(i.scrollbarXRail, 'top'));
  1255 + i.railBorderXWidth = _.toInt(dom.css(i.scrollbarXRail, 'borderLeftWidth')) + _.toInt(dom.css(i.scrollbarXRail, 'borderRightWidth'));
  1256 + // Set rail to display:block to calculate margins
  1257 + dom.css(i.scrollbarXRail, 'display', 'block');
  1258 + i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
  1259 + dom.css(i.scrollbarXRail, 'display', '');
  1260 + i.railXWidth = null;
  1261 + i.railXRatio = null;
  1262 +
  1263 + i.scrollbarYRail = dom.appendTo(dom.e('div', 'ps-scrollbar-y-rail'), element);
  1264 + i.scrollbarY = dom.appendTo(dom.e('div', 'ps-scrollbar-y'), i.scrollbarYRail);
  1265 + i.scrollbarY.setAttribute('tabindex', 0);
  1266 + i.event.bind(i.scrollbarY, 'focus', focus);
  1267 + i.event.bind(i.scrollbarY, 'blur', blur);
  1268 + i.scrollbarYActive = null;
  1269 + i.scrollbarYHeight = null;
  1270 + i.scrollbarYTop = null;
  1271 + i.scrollbarYRight = _.toInt(dom.css(i.scrollbarYRail, 'right'));
  1272 + i.isScrollbarYUsingRight = i.scrollbarYRight === i.scrollbarYRight; // !isNaN
  1273 + i.scrollbarYLeft = i.isScrollbarYUsingRight ? null : _.toInt(dom.css(i.scrollbarYRail, 'left'));
  1274 + i.scrollbarYOuterWidth = i.isRtl ? _.outerWidth(i.scrollbarY) : null;
  1275 + i.railBorderYWidth = _.toInt(dom.css(i.scrollbarYRail, 'borderTopWidth')) + _.toInt(dom.css(i.scrollbarYRail, 'borderBottomWidth'));
  1276 + dom.css(i.scrollbarYRail, 'display', 'block');
  1277 + i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
  1278 + dom.css(i.scrollbarYRail, 'display', '');
  1279 + i.railYHeight = null;
  1280 + i.railYRatio = null;
  1281 +}
  1282 +
  1283 +function getId(element) {
  1284 + return element.getAttribute('data-ps-id');
  1285 +}
  1286 +
  1287 +function setId(element, id) {
  1288 + element.setAttribute('data-ps-id', id);
  1289 +}
  1290 +
  1291 +function removeId(element) {
  1292 + element.removeAttribute('data-ps-id');
  1293 +}
  1294 +
  1295 +exports.add = function (element) {
  1296 + var newId = guid();
  1297 + setId(element, newId);
  1298 + instances[newId] = new Instance(element);
  1299 + return instances[newId];
  1300 +};
  1301 +
  1302 +exports.remove = function (element) {
  1303 + delete instances[getId(element)];
  1304 + removeId(element);
  1305 +};
  1306 +
  1307 +exports.get = function (element) {
  1308 + return instances[getId(element)];
  1309 +};
  1310 +
  1311 +},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
  1312 +'use strict';
  1313 +
  1314 +var _ = require('../lib/helper');
  1315 +var cls = require('../lib/class');
  1316 +var dom = require('../lib/dom');
  1317 +var instances = require('./instances');
  1318 +var updateScroll = require('./update-scroll');
  1319 +
  1320 +function getThumbSize(i, thumbSize) {
  1321 + if (i.settings.minScrollbarLength) {
  1322 + thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
  1323 + }
  1324 + if (i.settings.maxScrollbarLength) {
  1325 + thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
  1326 + }
  1327 + return thumbSize;
  1328 +}
  1329 +
  1330 +function updateCss(element, i) {
  1331 + var xRailOffset = {width: i.railXWidth};
  1332 + if (i.isRtl) {
  1333 + xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth;
  1334 + } else {
  1335 + xRailOffset.left = element.scrollLeft;
  1336 + }
  1337 + if (i.isScrollbarXUsingBottom) {
  1338 + xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop;
  1339 + } else {
  1340 + xRailOffset.top = i.scrollbarXTop + element.scrollTop;
  1341 + }
  1342 + dom.css(i.scrollbarXRail, xRailOffset);
  1343 +
  1344 + var yRailOffset = {top: element.scrollTop, height: i.railYHeight};
  1345 + if (i.isScrollbarYUsingRight) {
  1346 + if (i.isRtl) {
  1347 + yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth;
  1348 + } else {
  1349 + yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
  1350 + }
  1351 + } else {
  1352 + if (i.isRtl) {
  1353 + yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth;
  1354 + } else {
  1355 + yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
  1356 + }
  1357 + }
  1358 + dom.css(i.scrollbarYRail, yRailOffset);
  1359 +
  1360 + dom.css(i.scrollbarX, {left: i.scrollbarXLeft, width: i.scrollbarXWidth - i.railBorderXWidth});
  1361 + dom.css(i.scrollbarY, {top: i.scrollbarYTop, height: i.scrollbarYHeight - i.railBorderYWidth});
  1362 +}
  1363 +
  1364 +module.exports = function (element) {
  1365 + var i = instances.get(element);
  1366 +
  1367 + i.containerWidth = element.clientWidth;
  1368 + i.containerHeight = element.clientHeight;
  1369 + i.contentWidth = element.scrollWidth;
  1370 + i.contentHeight = element.scrollHeight;
  1371 +
  1372 + var existingRails;
  1373 + if (!element.contains(i.scrollbarXRail)) {
  1374 + existingRails = dom.queryChildren(element, '.ps-scrollbar-x-rail');
  1375 + if (existingRails.length > 0) {
  1376 + existingRails.forEach(function (rail) {
  1377 + dom.remove(rail);
  1378 + });
  1379 + }
  1380 + dom.appendTo(i.scrollbarXRail, element);
  1381 + }
  1382 + if (!element.contains(i.scrollbarYRail)) {
  1383 + existingRails = dom.queryChildren(element, '.ps-scrollbar-y-rail');
  1384 + if (existingRails.length > 0) {
  1385 + existingRails.forEach(function (rail) {
  1386 + dom.remove(rail);
  1387 + });
  1388 + }
  1389 + dom.appendTo(i.scrollbarYRail, element);
  1390 + }
  1391 +
  1392 + if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) {
  1393 + i.scrollbarXActive = true;
  1394 + i.railXWidth = i.containerWidth - i.railXMarginWidth;
  1395 + i.railXRatio = i.containerWidth / i.railXWidth;
  1396 + i.scrollbarXWidth = getThumbSize(i, _.toInt(i.railXWidth * i.containerWidth / i.contentWidth));
  1397 + i.scrollbarXLeft = _.toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth));
  1398 + } else {
  1399 + i.scrollbarXActive = false;
  1400 + }
  1401 +
  1402 + if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) {
  1403 + i.scrollbarYActive = true;
  1404 + i.railYHeight = i.containerHeight - i.railYMarginHeight;
  1405 + i.railYRatio = i.containerHeight / i.railYHeight;
  1406 + i.scrollbarYHeight = getThumbSize(i, _.toInt(i.railYHeight * i.containerHeight / i.contentHeight));
  1407 + i.scrollbarYTop = _.toInt(element.scrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight));
  1408 + } else {
  1409 + i.scrollbarYActive = false;
  1410 + }
  1411 +
  1412 + if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
  1413 + i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
  1414 + }
  1415 + if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
  1416 + i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
  1417 + }
  1418 +
  1419 + updateCss(element, i);
  1420 +
  1421 + if (i.scrollbarXActive) {
  1422 + cls.add(element, 'ps-active-x');
  1423 + } else {
  1424 + cls.remove(element, 'ps-active-x');
  1425 + i.scrollbarXWidth = 0;
  1426 + i.scrollbarXLeft = 0;
  1427 + updateScroll(element, 'left', 0);
  1428 + }
  1429 + if (i.scrollbarYActive) {
  1430 + cls.add(element, 'ps-active-y');
  1431 + } else {
  1432 + cls.remove(element, 'ps-active-y');
  1433 + i.scrollbarYHeight = 0;
  1434 + i.scrollbarYTop = 0;
  1435 + updateScroll(element, 'top', 0);
  1436 + }
  1437 +};
  1438 +
  1439 +},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){
  1440 +'use strict';
  1441 +
  1442 +var instances = require('./instances');
  1443 +
  1444 +var lastTop;
  1445 +var lastLeft;
  1446 +
  1447 +var createDOMEvent = function (name) {
  1448 + var event = document.createEvent("Event");
  1449 + event.initEvent(name, true, true);
  1450 + return event;
  1451 +};
  1452 +
  1453 +module.exports = function (element, axis, value) {
  1454 + if (typeof element === 'undefined') {
  1455 + throw 'You must provide an element to the update-scroll function';
  1456 + }
  1457 +
  1458 + if (typeof axis === 'undefined') {
  1459 + throw 'You must provide an axis to the update-scroll function';
  1460 + }
  1461 +
  1462 + if (typeof value === 'undefined') {
  1463 + throw 'You must provide a value to the update-scroll function';
  1464 + }
  1465 +
  1466 + if (axis === 'top' && value <= 0) {
  1467 + element.scrollTop = value = 0; // don't allow negative scroll
  1468 + element.dispatchEvent(createDOMEvent('ps-y-reach-start'));
  1469 + }
  1470 +
  1471 + if (axis === 'left' && value <= 0) {
  1472 + element.scrollLeft = value = 0; // don't allow negative scroll
  1473 + element.dispatchEvent(createDOMEvent('ps-x-reach-start'));
  1474 + }
  1475 +
  1476 + var i = instances.get(element);
  1477 +
  1478 + if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
  1479 + // don't allow scroll past container
  1480 + value = i.contentHeight - i.containerHeight;
  1481 + if (value - element.scrollTop <= 1) {
  1482 + // mitigates rounding errors on non-subpixel scroll values
  1483 + value = element.scrollTop;
  1484 + } else {
  1485 + element.scrollTop = value;
  1486 + }
  1487 + element.dispatchEvent(createDOMEvent('ps-y-reach-end'));
  1488 + }
  1489 +
  1490 + if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
  1491 + // don't allow scroll past container
  1492 + value = i.contentWidth - i.containerWidth;
  1493 + if (value - element.scrollLeft <= 1) {
  1494 + // mitigates rounding errors on non-subpixel scroll values
  1495 + value = element.scrollLeft;
  1496 + } else {
  1497 + element.scrollLeft = value;
  1498 + }
  1499 + element.dispatchEvent(createDOMEvent('ps-x-reach-end'));
  1500 + }
  1501 +
  1502 + if (!lastTop) {
  1503 + lastTop = element.scrollTop;
  1504 + }
  1505 +
  1506 + if (!lastLeft) {
  1507 + lastLeft = element.scrollLeft;
  1508 + }
  1509 +
  1510 + if (axis === 'top' && value < lastTop) {
  1511 + element.dispatchEvent(createDOMEvent('ps-scroll-up'));
  1512 + }
  1513 +
  1514 + if (axis === 'top' && value > lastTop) {
  1515 + element.dispatchEvent(createDOMEvent('ps-scroll-down'));
  1516 + }
  1517 +
  1518 + if (axis === 'left' && value < lastLeft) {
  1519 + element.dispatchEvent(createDOMEvent('ps-scroll-left'));
  1520 + }
  1521 +
  1522 + if (axis === 'left' && value > lastLeft) {
  1523 + element.dispatchEvent(createDOMEvent('ps-scroll-right'));
  1524 + }
  1525 +
  1526 + if (axis === 'top') {
  1527 + element.scrollTop = lastTop = value;
  1528 + element.dispatchEvent(createDOMEvent('ps-scroll-y'));
  1529 + }
  1530 +
  1531 + if (axis === 'left') {
  1532 + element.scrollLeft = lastLeft = value;
  1533 + element.dispatchEvent(createDOMEvent('ps-scroll-x'));
  1534 + }
  1535 +
  1536 +};
  1537 +
  1538 +},{"./instances":18}],21:[function(require,module,exports){
  1539 +'use strict';
  1540 +
  1541 +var _ = require('../lib/helper');
  1542 +var dom = require('../lib/dom');
  1543 +var instances = require('./instances');
  1544 +var updateGeometry = require('./update-geometry');
  1545 +var updateScroll = require('./update-scroll');
  1546 +
  1547 +module.exports = function (element) {
  1548 + var i = instances.get(element);
  1549 +
  1550 + if (!i) {
  1551 + return;
  1552 + }
  1553 +
  1554 + // Recalcuate negative scrollLeft adjustment
  1555 + i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
  1556 +
  1557 + // Recalculate rail margins
  1558 + dom.css(i.scrollbarXRail, 'display', 'block');
  1559 + dom.css(i.scrollbarYRail, 'display', 'block');
  1560 + i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
  1561 + i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
  1562 +
  1563 + // Hide scrollbars not to affect scrollWidth and scrollHeight
  1564 + dom.css(i.scrollbarXRail, 'display', 'none');
  1565 + dom.css(i.scrollbarYRail, 'display', 'none');
  1566 +
  1567 + updateGeometry(element);
  1568 +
  1569 + // Update top/left scroll to trigger events
  1570 + updateScroll(element, 'top', element.scrollTop);
  1571 + updateScroll(element, 'left', element.scrollLeft);
  1572 +
  1573 + dom.css(i.scrollbarXRail, 'display', '');
  1574 + dom.css(i.scrollbarYRail, 'display', '');
  1575 +};
  1576 +
  1577 +},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]);
... ...
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css
1   -/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
  1 +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2 2 [data-uk-sticky].uk-active{z-index:980;box-sizing:border-box;-webkit-backface-visibility:hidden}[data-uk-sticky][class*=uk-animation-]{-webkit-animation-duration:.2s;animation-duration:.2s}[data-uk-sticky].uk-animation-reverse{-webkit-animation-duration:.2s;animation-duration:.2s}
3 3 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js
1   -/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
  1 +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2 2 !function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:n;if(i.length&&!(e.scrollTop()<0))for(var o,a,r,h,p=e.scrollTop(),c=s.height(),l=e.height(),m=c-l,d=p>m?m-p:0,u=0;u<i.length;u++)if(h=i[u],h.element.is(":visible")&&!h.animate){if(h.check()){if(h.top<0?o=0:(r=h.element.outerHeight(),o=c-r-h.top-h.options.bottom-p-d,o=0>o?o+h.top:h.top),h.boundary&&h.boundary.length){var f=h.boundary.offset().top;a=h.boundtoparent?c-(f+h.boundary.outerHeight())+parseInt(h.boundary.css("padding-bottom")):c-f,o=p+r>c-a-(h.top<0?0:h.top)?c-a-(p+r):o}if(h.currentTop!=o){if(h.element.css({position:"fixed",top:o,width:h.getWidthFrom.length?h.getWidthFrom.width():h.element.width()}),!h.init&&(h.element.addClass(h.options.clsinit),location.hash&&p>0&&h.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),s=e.top+t.outerHeight(),n=i.element.offset(),o=i.element.outerHeight(),a=n.top+o;n.top<s&&e.top<a&&(p=e.top-o-i.options.target,window.scrollTo(0,p))}}(g,h),0)}h.element.addClass(h.options.clsactive).removeClass(h.options.clsinactive),h.element.trigger("active.uk.sticky"),h.element.css("margin",""),h.options.animation&&h.init&&!t.Utils.isInView(h.wrapper)&&h.element.addClass(h.options.animation),h.currentTop=o}}else null!==h.currentTop&&h.reset();h.init=!0}}var e=t.$win,s=t.$doc,n=[],o=1;return t.component("sticky",{defaults:{top:0,bottom:0,animation:"",clsinit:"uk-sticky-init",clsactive:"uk-active",clsinactive:"",getWidthFrom:"",showup:!1,boundary:!1,media:!1,target:!1,disabled:!1},boot:function(){t.$doc.on("scrolling.uk.document",function(t,e){e&&e.dir&&(o=e.dir.y,i())}),t.$win.on("resize orientationchange",t.Utils.debounce(function(){if(n.length){for(var t=0;t<n.length;t++)n[t].reset(!0),n[t].self.computeWrapper();i()}},100)),t.ready(function(e){setTimeout(function(){t.$("[data-uk-sticky]",e).each(function(){var i=t.$(this);i.data("sticky")||t.sticky(i,t.Utils.options(i.attr("data-uk-sticky")))}),i()},0)})},init:function(){var i,a=this.options.boundary;this.wrapper=this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent(),this.computeWrapper(),this.wrapper.css({"margin-top":this.element.css("margin-top"),"margin-bottom":this.element.css("margin-bottom"),"margin-left":this.element.css("margin-left"),"margin-right":this.element.css("margin-right")}),this.element.css("margin",0),a&&(a===!0||"!"===a[0]?(a=a===!0?this.wrapper.parent():this.wrapper.closest(a.substr(1)),i=!0):"string"==typeof a&&(a=t.$(a))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:t.$(this.options.getWidthFrom||this.wrapper),boundary:a,boundtoparent:i,top:0,calcTop:function(){var i=this.options.top;if(this.options.top&&"string"==typeof this.options.top)if(this.options.top.match(/^(-|)(\d+)vh$/))i=window.innerHeight*parseInt(this.options.top,10)/100;else{var e=t.$(this.options.top).first();e.length&&e.is(":visible")&&(i=-1*(e.offset().top+e.outerHeight()-this.wrapper.offset().top))}this.top=i},reset:function(i){this.calcTop();var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.element.addClass(this.options.clsinactive),this.element.trigger("inactive.uk.sticky"),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation&&!t.Utils.isInView(this.wrapper)?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidth<this.options.media)return!1;break;case"string":if(window.matchMedia&&!window.matchMedia(this.options.media).matches)return!1}var i=e.scrollTop(),n=s.height(),a=n-window.innerHeight,r=i>a?a-i:0,h=this.wrapper.offset().top,p=h-this.top-r,c=i>=p;return c&&this.options.showup&&(1==o&&(c=!1),-1==o&&!this.element.hasClass(this.options.clsactive)&&t.Utils.isInView(this.wrapper)&&(c=!1)),c}},this.sticky.calcTop(),n.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:-1==["absolute","fixed"].indexOf(this.element.css("position"))?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):""}),"fixed"==this.element.css("position")&&this.element.css({width:this.sticky.getWidthFrom.length?this.sticky.getWidthFrom.width():this.element.width()})}}),t.sticky});
3 3 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/dataManager/cars_move.html
... ... @@ -183,4 +183,4 @@
183 183 });
184 184 })();
185 185 </script>
186 186 -</div>
  187 +</div>
187 188 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/dataManager/dataMoveAndVerification.html
1   -<div class="uk-modal" id="data-move-verification-modal">
2   - <div class="uk-modal-dialog" style="width: 650px;">
3   - <a href="" class="uk-modal-close uk-close"></a>
4   - <h2>数据迁移和校验</h2>
5   -
6   - <div class="uk-grid" data-uk-grid-margin>
7   - <div class="uk-width-medium-1-3">
8   - <a class="uk-panel uk-panel-hover detail_panel" data-href="/real_control_v2/fragments/north/nav/dataManager/cars_move.html">
9   - <h3 class="uk-panel-title">车辆数据</h3>
10   - 对照老系统的车辆设备信息,并增量更新到新系统
11   - </a>
12   - </div>
13   - <div class="uk-width-medium-1-3">
14   - <a class="uk-panel uk-panel-hover" >
15   - <h3 class="uk-panel-title">人员数据</h3>
16   - 对照老系统的人员信息,并增量更新到新系统 <code>不可用</code>
17   - </a>
18   - </div>
19   - <div class="uk-width-medium-1-3">
20   - <a class="uk-panel uk-panel-hover">
21   - <h3 class="uk-panel-title">路单数据</h3>
22   - 将老系统指定日期的路单同步到新系统,全量覆盖 <code>不可用</code>
23   - </a>
24   - </div>
25   - </div>
26   -
27   - </div>
28   -
29   -
30   - <script>
31   - (function () {
32   - var modal = '#data-move-verification-modal';
33   - $(modal).on('init', function (e, data) {
34   - e.stopPropagation();
35   -
36   - $('.detail_panel', modal).on('click', function () {
37   - var href = $(this).data('href');
38   - if(!href)
39   - return;
40   -
41   - open_modal(href, {}, {center: false, bgclose: false, modal: false});
42   - });
43   - });
44   - })();
45   - </script>
  1 +<div class="uk-modal" id="data-move-verification-modal">
  2 + <div class="uk-modal-dialog" style="width: 650px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h2>数据迁移和校验</h2>
  5 +
  6 + <div class="uk-grid" data-uk-grid-margin>
  7 + <div class="uk-width-medium-1-3">
  8 + <a class="uk-panel uk-panel-hover detail_panel" data-href="/real_control_v2/fragments/north/nav/dataManager/cars_move.html">
  9 + <h3 class="uk-panel-title">车辆数据</h3>
  10 + 对照老系统的车辆设备信息,并增量更新到新系统
  11 + </a>
  12 + </div>
  13 + <div class="uk-width-medium-1-3">
  14 + <a class="uk-panel uk-panel-hover" >
  15 + <h3 class="uk-panel-title">人员数据</h3>
  16 + 对照老系统的人员信息,并增量更新到新系统 <code>不可用</code>
  17 + </a>
  18 + </div>
  19 + <div class="uk-width-medium-1-3">
  20 + <a class="uk-panel uk-panel-hover">
  21 + <h3 class="uk-panel-title">路单数据</h3>
  22 + 将老系统指定日期的路单同步到新系统,全量覆盖 <code>不可用</code>
  23 + </a>
  24 + </div>
  25 + </div>
  26 +
  27 + </div>
  28 +
  29 +
  30 + <script>
  31 + (function () {
  32 + var modal = '#data-move-verification-modal';
  33 + $(modal).on('init', function (e, data) {
  34 + e.stopPropagation();
  35 +
  36 + $('.detail_panel', modal).on('click', function () {
  37 + var href = $(this).data('href');
  38 + if(!href)
  39 + return;
  40 +
  41 + open_modal(href, {}, {center: false, bgclose: false, modal: false});
  42 + });
  43 + });
  44 + })();
  45 + </script>
46 46 </div>
47 47 \ No newline at end of file
... ...