Commit 9f06b22892eb7d70b73d2ed2b134754c5fdf4400
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
24 changed files
with
1858 additions
and
1737 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -488,7 +488,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 488 | 488 | long t = new Date().getTime(); |
| 489 | 489 | if(c != 1) |
| 490 | 490 | t -= ONE_DAY - (1000 * 60 * 60 * 2); |
| 491 | - for(int i = 0; i < 10; i ++){ | |
| 491 | + for(int i = 0; i < 3; i ++){ | |
| 492 | 492 | rs.add(fmtyyyyMMdd.print(t)); |
| 493 | 493 | t -= ONE_DAY; |
| 494 | 494 | } | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
| ... | ... | @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; |
| 11 | 11 | * @date 2016年5月11日 下午4:32:07 |
| 12 | 12 | * |
| 13 | 13 | */ |
| 14 | -public class GpsEntity { | |
| 14 | +public class GpsEntity implements Cloneable{ | |
| 15 | 15 | |
| 16 | 16 | /** 公司代码 */ |
| 17 | 17 | private Short companyCode; |
| ... | ... | @@ -98,6 +98,14 @@ public class GpsEntity { |
| 98 | 98 | */ |
| 99 | 99 | private int source = -1; |
| 100 | 100 | |
| 101 | + public Object clone() { | |
| 102 | + try { | |
| 103 | + return super.clone(); | |
| 104 | + } catch (CloneNotSupportedException e) { | |
| 105 | + return null; | |
| 106 | + } | |
| 107 | + } | |
| 108 | + | |
| 101 | 109 | public String getDeviceId() { |
| 102 | 110 | return deviceId; |
| 103 | 111 | } | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
| ... | ... | @@ -41,7 +41,7 @@ public class GpsRealAnalyse { |
| 41 | 41 | @Autowired |
| 42 | 42 | GpsRealData gpsRealData; |
| 43 | 43 | |
| 44 | - static ExecutorService threadPool = Executors.newFixedThreadPool(20); | |
| 44 | + static ExecutorService threadPool = Executors.newFixedThreadPool(25); | |
| 45 | 45 | |
| 46 | 46 | public static long st; |
| 47 | 47 | public static CountDownLatch count; | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| ... | ... | @@ -90,6 +90,11 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 90 | 90 | if(prev.getInstation() > 0 && gps.getInstation() > 0 |
| 91 | 91 | && !prev.getStopNo().equals(gps.getStopNo())) |
| 92 | 92 | return true; |
| 93 | + | |
| 94 | + //在被起点站覆盖的情况下出场 | |
| 95 | + if(isOutPark(gps, prev)){ | |
| 96 | + return true; | |
| 97 | + } | |
| 93 | 98 | return false; |
| 94 | 99 | } |
| 95 | 100 | |
| ... | ... | @@ -110,11 +115,15 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 110 | 115 | if(prev.getInstation() == 2 && gps.getInstation() == 1){ |
| 111 | 116 | return true; |
| 112 | 117 | } |
| 118 | + | |
| 119 | + //被起点站覆盖的情况下进场 | |
| 120 | + if(isInPark(gps, prev)) | |
| 121 | + return true; | |
| 113 | 122 | return false; |
| 114 | 123 | } |
| 115 | 124 | |
| 116 | 125 | /** |
| 117 | - * 出站 | |
| 126 | + * 出站/出场 | |
| 118 | 127 | * @param gps 当前点 |
| 119 | 128 | * @param prev 上一个点 |
| 120 | 129 | */ |
| ... | ... | @@ -133,7 +142,9 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 133 | 142 | return; |
| 134 | 143 | |
| 135 | 144 | //起点发车 |
| 136 | - if(qdzCode != null && prev.getStopNo().equals(qdzCode) | |
| 145 | + if(qdzCode != null | |
| 146 | + && prev.getStopNo().equals(qdzCode) | |
| 147 | + && (gps.getInstation()==0 || !gps.getStopNo().equals(prev.getStopNo())) | |
| 137 | 148 | && !willDepart(gps, prev, sch)){ |
| 138 | 149 | |
| 139 | 150 | //发车班次匹配 |
| ... | ... | @@ -168,6 +179,21 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 168 | 179 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); |
| 169 | 180 | } |
| 170 | 181 | else if(sch.getBcType().equals("out")){ |
| 182 | + //有出场动作(起点站覆盖停车场时,并且不设置出站既出场,逻辑可能会走到这里) | |
| 183 | + try{ | |
| 184 | + if(isOutPark(gps, prev)){ | |
| 185 | + if(prev.getCarparkNo().equals(sch.getQdzCode())){ | |
| 186 | + //再试一下出场 | |
| 187 | + GpsEntity prevClone = (GpsEntity) prev.clone(), | |
| 188 | + gpsClone = (GpsEntity) gps.clone(); | |
| 189 | + prevClone.setStopNo(prevClone.getCarparkNo()); | |
| 190 | + gpsClone.setInstation(0); | |
| 191 | + outStation(gpsClone, prevClone); | |
| 192 | + return; | |
| 193 | + } | |
| 194 | + } | |
| 195 | + }catch (Exception e){logger.error("",e);} | |
| 196 | + | |
| 171 | 197 | ScheduleRealInfo next = dayOfSchedule.nextSame(sch); |
| 172 | 198 | //如果下一个班次是区间,并且是环线 |
| 173 | 199 | if(next != null && next.getBcType().equals("region")){ |
| ... | ... | @@ -255,7 +281,8 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 255 | 281 | private void inStation(GpsEntity gps, GpsEntity prev){ |
| 256 | 282 | ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm()); |
| 257 | 283 | |
| 258 | - if(gps.getStopNo().equals(sch.getZdzCode())){ | |
| 284 | + if(gps.getStopNo().equals(sch.getZdzCode()) | |
| 285 | + && !gps.getStopNo().equals(prev.getStopNo())){ | |
| 259 | 286 | |
| 260 | 287 | int diff = 0; |
| 261 | 288 | try{ |
| ... | ... | @@ -336,6 +363,25 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 336 | 363 | scheduleSignalState.signalRetrospect(gps, sch); |
| 337 | 364 | } |
| 338 | 365 | */ |
| 366 | + //被起点站覆盖的情况下进场,没有设置出站既是出场,逻辑会走到这里(模拟进站信号) | |
| 367 | + if(sch.getBcType().equals("in")){ | |
| 368 | + try{ | |
| 369 | + if(isInPark(gps, prev)){ | |
| 370 | + if(gps.getCarparkNo().equals(sch.getZdzCode())){ | |
| 371 | + //再试一下进场 | |
| 372 | + GpsEntity gpsClone = (GpsEntity) gps.clone(), | |
| 373 | + prevClone = (GpsEntity) prev.clone(); | |
| 374 | + gpsClone.setStopNo(gpsClone.getCarparkNo()); | |
| 375 | + prevClone.setStopNo(null); | |
| 376 | + inStation(gpsClone, prevClone); | |
| 377 | + return; | |
| 378 | + } | |
| 379 | + } | |
| 380 | + }catch (Exception e){ | |
| 381 | + logger.error("", e); | |
| 382 | + } | |
| 383 | + } | |
| 384 | + | |
| 339 | 385 | //如果当前班次是出场,并且进的是下一个班次的终点 |
| 340 | 386 | if(sch.getBcType().equals("out")){ |
| 341 | 387 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
| ... | ... | @@ -447,4 +493,16 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 447 | 493 | }*/ |
| 448 | 494 | return false; |
| 449 | 495 | } |
| 496 | + | |
| 497 | + private boolean isOutPark(GpsEntity gps, GpsEntity prve){ | |
| 498 | + if(StringUtils.isNotEmpty(prve.getCarparkNo()) && StringUtils.isEmpty(gps.getCarparkNo())) | |
| 499 | + return true; | |
| 500 | + return false; | |
| 501 | + } | |
| 502 | + | |
| 503 | + private boolean isInPark(GpsEntity gps, GpsEntity prve){ | |
| 504 | + if(StringUtils.isNotEmpty(gps.getCarparkNo()) && StringUtils.isEmpty(prve.getCarparkNo())) | |
| 505 | + return true; | |
| 506 | + return false; | |
| 507 | + } | |
| 450 | 508 | } |
| 451 | 509 | \ No newline at end of file | ... | ... |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/StationInsideHandle.java
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
| ... | ... | @@ -48,8 +48,8 @@ public class GpsDataRecovery implements ApplicationContextAware { |
| 48 | 48 | //按线路分组数据 |
| 49 | 49 | ArrayListMultimap<String, GpsEntity> listMap = ArrayListMultimap.create(); |
| 50 | 50 | for (GpsEntity gps : list) { |
| 51 | - if (gps.getLineId() != null) | |
| 52 | - listMap.put(gps.getLineId(), gps); | |
| 51 | + if (gps.getNbbm() != null) | |
| 52 | + listMap.put(gps.getNbbm(), gps); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| ... | ... | @@ -57,10 +57,10 @@ public class GpsDataRecovery implements ApplicationContextAware { |
| 57 | 57 | |
| 58 | 58 | CountDownLatch count = new CountDownLatch(keys.size()); |
| 59 | 59 | GpsComp comp = new GpsComp(); |
| 60 | - for (String lineId : keys) { | |
| 61 | - Collections.sort(listMap.get(lineId), comp); | |
| 62 | - threadPool.execute(new RecoveryThread(listMap.get(lineId), count)); | |
| 63 | - /*if(nbbm.equals("W7E-016")) | |
| 60 | + for (String nbbm : keys) { | |
| 61 | + Collections.sort(listMap.get(nbbm), comp); | |
| 62 | + threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); | |
| 63 | + /*if(nbbm.equals("W9H-088")) | |
| 64 | 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ |
| 65 | 65 | /*if(lineId.equals("60028")) |
| 66 | 66 | new RecoveryThread(listMap.get(lineId), count).run();*/ |
| ... | ... | @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { |
| 84 | 84 | Calendar calendar = Calendar.getInstance(); |
| 85 | 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); |
| 86 | 86 | |
| 87 | - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=194";// + dayOfYear; | |
| 87 | + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=207";// + dayOfYear; | |
| 88 | 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 89 | 89 | |
| 90 | 90 | List<GpsEntity> list = |
| ... | ... | @@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware { |
| 153 | 153 | boolean task; |
| 154 | 154 | for (GpsEntity gps : list) { |
| 155 | 155 | try { |
| 156 | - /*if(gps.getTimestamp() >= 1495512240000L){ | |
| 156 | + /*if(gps.getTimestamp() >= 1500942270000L){ | |
| 157 | 157 | System.out.println("debugger..."); |
| 158 | 158 | }*/ |
| 159 | 159 | //是否有任务 | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -884,8 +884,12 @@ public class DayOfSchedule { |
| 884 | 884 | } |
| 885 | 885 | |
| 886 | 886 | public void addExecPlan(ScheduleRealInfo sch) { |
| 887 | - if (sch != null) | |
| 888 | - carExecutePlanMap.put(sch.getClZbh(), sch); | |
| 887 | + if (sch != null){ | |
| 888 | + if(sch.getStatus()==2) | |
| 889 | + reCalcExecPlan(sch.getClZbh()); | |
| 890 | + else | |
| 891 | + carExecutePlanMap.put(sch.getClZbh(), sch); | |
| 892 | + } | |
| 889 | 893 | else |
| 890 | 894 | carExecutePlanMap.remove(sch.getClZbh()); |
| 891 | 895 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -3611,7 +3611,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3611 | 3611 | Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime(); |
| 3612 | 3612 | for (int i = 0; i < list.size(); i++) { |
| 3613 | 3613 | DutyEmployee t = list.get(i); |
| 3614 | - if(!(dbdp.indexOf(",")>0)){ | |
| 3614 | + if(dbdp.indexOf(t.getuName()) == -1){ | |
| 3615 | 3615 | if(!(dbdp.length()>0)){ |
| 3616 | 3616 | dbdp =t.getuName(); |
| 3617 | 3617 | }else{ | ... | ... |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| ... | ... | @@ -425,7 +425,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 425 | 425 | if(scheduleRealInfo.getStatus() == -1){ |
| 426 | 426 | boolean fage=false; |
| 427 | 427 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 428 | - if(it.hasNext()){ | |
| 428 | + while(it.hasNext()){ | |
| 429 | 429 | ChildTaskPlan childTaskPlan = it.next(); |
| 430 | 430 | if(!childTaskPlan.isDestroy()){ |
| 431 | 431 | if(childTaskPlan.getMileageType().equals("service")){ |
| ... | ... | @@ -448,8 +448,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | - } | |
| 452 | - /*else{ | |
| 451 | + }else{ | |
| 453 | 452 | if(item.equals("zgf")){ |
| 454 | 453 | if(fcsj>=zgf1 && fcsj<=zgf2){ |
| 455 | 454 | sjbc++; |
| ... | ... | @@ -461,7 +460,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ |
| 461 | 460 | }else{ |
| 462 | 461 | sjbc++; |
| 463 | 462 | } |
| 464 | - }*/ | |
| 463 | + } | |
| 465 | 464 | } |
| 466 | 465 | } |
| 467 | 466 | } | ... | ... |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| ... | ... | @@ -1870,4 +1870,55 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { |
| 1870 | 1870 | return resList; |
| 1871 | 1871 | } |
| 1872 | 1872 | |
| 1873 | + /*@Override | |
| 1874 | + public List<Map<String, Object>> commandState(Map<String, Object> map) { | |
| 1875 | + // TODO Auto-generated method stub | |
| 1876 | + String company = map.get("company").toString(); | |
| 1877 | + String subCompany = map.get("subCompany").toString(); | |
| 1878 | + String line = map.get("line").toString(); | |
| 1879 | + String date = map.get("date").toString(); | |
| 1880 | + String code = map.get("code").toString(); | |
| 1881 | + String type = map.get("type").toString(); | |
| 1882 | + | |
| 1883 | + String sql_="select * from bsth_c_s_sp_info_real " | |
| 1884 | + + " WHERE schedule_date_str = '"+date+"' "; | |
| 1885 | + if(line.equals("")){ | |
| 1886 | + sql_ += "and gs_bm='"+company+"'and fgs_bm='"+subCompany+"'"; | |
| 1887 | + }else{ | |
| 1888 | + sql_ += " and xl_bm = '"+line+"'"; | |
| 1889 | + } | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + String sql="SELECT r.id,r.schedule_date_str,r.xl_name,r.cl_zbh,r.j_gh,r.j_name," | |
| 1893 | + + " r.fcsj,d. TIMESTAMP,d.reply46,d.reply47,d.reply46time,d.reply47time," | |
| 1894 | + + " r.gs_name,r.fgs_name,CONCAT(r.xl_bm,'_',r.id) as line_sch FROM ("+sql_+") " | |
| 1895 | + + " AS r LEFT JOIN bsth_v_directive_60 AS d ON r.id = d.sch AND d.is_dispatch = 1" | |
| 1896 | + + " order by r.xl_name,r.id,d.timestamp desc "; | |
| 1897 | + | |
| 1898 | + List<Map<String, Object>> list = jdbcTemplate.query(sql, | |
| 1899 | + new RowMapper<Map<String, Object>>(){ | |
| 1900 | + @Override | |
| 1901 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 1902 | + Map<String, Object> map = new HashMap<String, Object>(); | |
| 1903 | + map.put("id", rs.getString("id")); | |
| 1904 | + map.put("date", rs.getString("schedule_date_str")); | |
| 1905 | + map.put("line", rs.getString("xl_name")); | |
| 1906 | + map.put("clZbh", rs.getString("cl_zbh")); | |
| 1907 | + map.put("jGh", rs.getString("j_gh")); | |
| 1908 | + map.put("jName", rs.getString("j_name")); | |
| 1909 | + map.put("fcsj", rs.getString("fcsj")); | |
| 1910 | + map.put("timestamp", rs.getString("timestamp")); | |
| 1911 | + map.put("reply46", rs.getString("reply46")); | |
| 1912 | + map.put("reply47", rs.getString("reply47")); | |
| 1913 | + map.put("reply46time", rs.getString("reply46time")); | |
| 1914 | + map.put("reply47time", rs.getString("reply47time")); | |
| 1915 | + map.put("company", rs.getObject("gs_name")); | |
| 1916 | + map.put("subCompany", rs.getObject("fgs_name")); | |
| 1917 | + map.put("lineSch", rs.getString("line_sch")); | |
| 1918 | + return map; | |
| 1919 | + } | |
| 1920 | + }); | |
| 1921 | + return null; | |
| 1922 | + }*/ | |
| 1923 | + | |
| 1873 | 1924 | } | ... | ... |
src/main/resources/static/assets/plugins/uk3.0/uikit-icons.min.js
| 1 | -/*! UIkit 3.0.0-beta.25 | http://www.getuikit.com | (c) 2014 - 2017 YOOtheme | MIT License */ | |
| 2 | - | |
| 1 | +/*! UIkit 3.0.0-beta.25 | http://www.getuikit.com | (c) 2014 - 2017 YOOtheme | MIT License */ | |
| 2 | + | |
| 3 | 3 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("uikiticons",e):t.UIkitIcons=e()}(this,function(){"use strict";function t(i){t.installed||i.icon.add(e)}var e={album:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="5" y="2" width="10" height="1"></rect><rect x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17" height="11"></rect></svg>',ban:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><line fill="none" stroke="#000" stroke-width="1.1" x1="4" y1="3.5" x2="16" y2="16.5"></line></svg>',behance:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.5,10.6c-0.4-0.5-0.9-0.9-1.6-1.1c1.7-1,2.2-3.2,0.7-4.7C7.8,4,6.3,4,5.2,4C3.5,4,1.7,4,0,4v12c1.7,0,3.4,0,5.2,0 c1,0,2.1,0,3.1-0.5C10.2,14.6,10.5,12.3,9.5,10.6L9.5,10.6z M5.6,6.1c1.8,0,1.8,2.7-0.1,2.7c-1,0-2,0-2.9,0V6.1H5.6z M2.6,13.8v-3.1 c1.1,0,2.1,0,3.2,0c2.1,0,2.1,3.2,0.1,3.2L2.6,13.8z"></path><path d="M19.9,10.9C19.7,9.2,18.7,7.6,17,7c-4.2-1.3-7.3,3.4-5.3,7.1c0.9,1.7,2.8,2.3,4.7,2.1c1.7-0.2,2.9-1.3,3.4-2.9h-2.2 c-0.4,1.3-2.4,1.5-3.5,0.6c-0.4-0.4-0.6-1.1-0.6-1.7H20C20,11.7,19.9,10.9,19.9,10.9z M13.5,10.6c0-1.6,2.3-2.7,3.5-1.4 c0.4,0.4,0.5,0.9,0.6,1.4H13.5L13.5,10.6z"></path><rect x="13" y="4" width="5" height="1.4"></rect></svg>',bell:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.1" d="M17,15.5 L3,15.5 C2.99,14.61 3.79,13.34 4.1,12.51 C4.58,11.3 4.72,10.35 5.19,7.01 C5.54,4.53 5.89,3.2 7.28,2.16 C8.13,1.56 9.37,1.5 9.81,1.5 L9.96,1.5 C9.96,1.5 11.62,1.41 12.67,2.17 C14.08,3.2 14.42,4.54 14.77,7.02 C15.26,10.35 15.4,11.31 15.87,12.52 C16.2,13.34 17.01,14.61 17,15.5 L17,15.5 Z"></path><path fill="none" stroke="#000" d="M12.39,16 C12.39,17.37 11.35,18.43 9.91,18.43 C8.48,18.43 7.42,17.37 7.42,16"></path></svg>',bold:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5,15.3 C5.66,15.3 5.9,15 5.9,14.53 L5.9,5.5 C5.9,4.92 5.56,4.7 5,4.7 L5,4 L8.95,4 C12.6,4 13.7,5.37 13.7,6.9 C13.7,7.87 13.14,9.17 10.86,9.59 L10.86,9.7 C13.25,9.86 14.29,11.28 14.3,12.54 C14.3,14.47 12.94,16 9,16 L5,16 L5,15.3 Z M9,9.3 C11.19,9.3 11.8,8.5 11.85,7 C11.85,5.65 11.3,4.8 9,4.8 L7.67,4.8 L7.67,9.3 L9,9.3 Z M9.185,15.22 C11.97,15 12.39,14 12.4,12.58 C12.4,11.15 11.39,10 9,10 L7.67,10 L7.67,15 L9.18,15 Z"></path></svg>',bolt:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4.74,20 L7.73,12 L3,12 L15.43,1 L12.32,9 L17.02,9 L4.74,20 L4.74,20 L4.74,20 Z M9.18,11 L7.1,16.39 L14.47,10 L10.86,10 L12.99,4.67 L5.61,11 L9.18,11 L9.18,11 L9.18,11 Z"></path></svg>',bookmark:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon fill="none" stroke="#000" points="5.5 1.5 15.5 1.5 15.5 17.5 10.5 12.5 5.5 17.5"></polygon></svg>',calendar:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M 2,3 2,17 18,17 18,3 2,3 Z M 17,16 3,16 3,8 17,8 17,16 Z M 17,7 3,7 3,4 17,4 17,7 Z"></path><rect width="1" height="3" x="6" y="2"></rect><rect width="1" height="3" x="13" y="2"></rect></svg>',camera:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10.8" r="3.8"></circle><path fill="none" stroke="#000" d="M1,4.5 C0.7,4.5 0.5,4.7 0.5,5 L0.5,17 C0.5,17.3 0.7,17.5 1,17.5 L19,17.5 C19.3,17.5 19.5,17.3 19.5,17 L19.5,5 C19.5,4.7 19.3,4.5 19,4.5 L13.5,4.5 L13.5,2.9 C13.5,2.6 13.3,2.5 13,2.5 L7,2.5 C6.7,2.5 6.5,2.6 6.5,2.9 L6.5,4.5 L1,4.5 L1,4.5 Z"></path></svg>',cart:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="7.3" cy="17.3" r="1.4"></circle><circle cx="13.3" cy="17.3" r="1.4"></circle><polyline fill="none" stroke="#000" points="0 2 3.2 4 5.3 12.5 16 12.5 18 6.5 8 6.5"></polyline></svg>',check:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.1" points="4,10 8,15 17,4"></polyline></svg>',clock:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><rect x="9" y="4" width="1" height="7"></rect><path fill="none" stroke="#000" stroke-width="1.1" d="M13.018,14.197 L9.445,10.625"></path></svg>',close:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.06" d="M16,16 L4,4"></path><path fill="none" stroke="#000" stroke-width="1.06" d="M16,4 L4,16"></path></svg>',code:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.01" points="13,4 19,10 13,16"></polyline><polyline fill="none" stroke="#000" stroke-width="1.01" points="7,4 1,10 7,16"></polyline></svg>',cog:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle><path fill="none" stroke="#000" d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>',comment:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6,18.71 L6,14 L1,14 L1,1 L19,1 L19,14 L10.71,14 L6,18.71 L6,18.71 Z M2,13 L7,13 L7,16.29 L10.29,13 L18,13 L18,2 L2,2 L2,13 L2,13 Z"></path></svg>',commenting:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon fill="none" stroke="#000" points="1.5,1.5 18.5,1.5 18.5,13.5 10.5,13.5 6.5,17.5 6.5,13.5 1.5,13.5"></polygon><circle cx="10" cy="8" r="1"></circle><circle cx="6" cy="8" r="1"></circle><circle cx="14" cy="8" r="1"></circle></svg>',comments:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" points="2 0.5 19.5 0.5 19.5 13"></polyline><path d="M5,19.71 L5,15 L0,15 L0,2 L18,2 L18,15 L9.71,15 L5,19.71 L5,19.71 L5,19.71 Z M1,14 L6,14 L6,17.29 L9.29,14 L17,14 L17,3 L1,3 L1,14 L1,14 L1,14 Z"></path></svg>',copy:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect fill="none" stroke="#000" x="3.5" y="2.5" width="12" height="16"></rect><polyline fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg>',database:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><ellipse fill="none" stroke="#000" cx="10" cy="4.64" rx="7.5" ry="3.14"></ellipse><path fill="none" stroke="#000" d="M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11"></path><path fill="none" stroke="#000" d="M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25"></path><path fill="none" stroke="#000" d="M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64"></path></svg>',desktop:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="8" y="15" width="1" height="2"></rect><rect x="11" y="15" width="1" height="2"></rect><rect x="5" y="16" width="10" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="3.5" width="17" height="11"></rect></svg>',download:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg>',dribbble:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.4" d="M1.3,8.9c0,0,5,0.1,8.6-1c1.4-0.4,2.6-0.9,4-1.9 c1.4-1.1,2.5-2.5,2.5-2.5"></path><path fill="none" stroke="#000" stroke-width="1.4" d="M3.9,16.6c0,0,1.7-2.8,3.5-4.2 c1.8-1.3,4-2,5.7-2.2C16,10,19,10.6,19,10.6"></path><path fill="none" stroke="#000" stroke-width="1.4" d="M6.9,1.6c0,0,3.3,4.6,4.2,6.8 c0.4,0.9,1.3,3.1,1.9,5.2c0.6,2,0.9,4.4,0.9,4.4"></path><circle fill="none" stroke="#000" stroke-width="1.4" cx="10" cy="10" r="9"></circle></svg>',expand:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="13 2 18 2 18 7 17 7 17 3 13 3"></polygon><polygon points="2 13 3 13 3 17 7 17 7 18 2 18"></polygon><path fill="none" stroke="#000" stroke-width="1.1" d="M11,9 L17,3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M3,17 L9,11"></path></svg>',facebook:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11,10h2.6l0.4-3H11V5.3c0-0.9,0.2-1.5,1.5-1.5H14V1.1c-0.3,0-1-0.1-2.1-0.1C9.6,1,8,2.4,8,5v2H5.5v3H8v8h3V10z"></path></svg>',file:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect fill="none" stroke="#000" x="3.5" y="1.5" width="13" height="17"></rect></svg>',flickr:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="5.5" cy="9.5" r="3.5"></circle><circle cx="14.5" cy="9.5" r="3.5"></circle></svg>',folder:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon fill="none" stroke="#000" points="9.5 5.5 8.5 3.5 1.5 3.5 1.5 16.5 18.5 16.5 18.5 5.5"></polygon></svg>',forward:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.47,13.11 C4.02,10.02 6.27,7.85 9.04,6.61 C9.48,6.41 10.27,6.13 11,5.91 L11,2 L18.89,9 L11,16 L11,12.13 C9.25,12.47 7.58,13.19 6.02,14.25 C3.03,16.28 1.63,18.54 1.63,18.54 C1.63,18.54 1.38,15.28 2.47,13.11 L2.47,13.11 Z M5.3,13.53 C6.92,12.4 9.04,11.4 12,10.92 L12,13.63 L17.36,9 L12,4.25 L12,6.8 C11.71,6.86 10.86,7.02 9.67,7.49 C6.79,8.65 4.58,10.96 3.49,13.08 C3.18,13.7 2.68,14.87 2.49,16 C3.28,15.05 4.4,14.15 5.3,13.53 L5.3,13.53 Z"></path></svg>',foursquare:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.23,2 C15.96,2 16.4,2.41 16.5,2.86 C16.57,3.15 16.56,3.44 16.51,3.73 C16.46,4.04 14.86,11.72 14.75,12.03 C14.56,12.56 14.16,12.82 13.61,12.83 C13.03,12.84 11.09,12.51 10.69,13 C10.38,13.38 7.79,16.39 6.81,17.53 C6.61,17.76 6.4,17.96 6.08,17.99 C5.68,18.04 5.29,17.87 5.17,17.45 C5.12,17.28 5.1,17.09 5.1,16.91 C5.1,12.4 4.86,7.81 5.11,3.31 C5.17,2.5 5.81,2.12 6.53,2 L15.23,2 L15.23,2 Z M9.76,11.42 C9.94,11.19 10.17,11.1 10.45,11.1 L12.86,11.1 C13.12,11.1 13.31,10.94 13.36,10.69 C13.37,10.64 13.62,9.41 13.74,8.83 C13.81,8.52 13.53,8.28 13.27,8.28 C12.35,8.29 11.42,8.28 10.5,8.28 C9.84,8.28 9.83,7.69 9.82,7.21 C9.8,6.85 10.13,6.55 10.5,6.55 C11.59,6.56 12.67,6.55 13.76,6.55 C14.03,6.55 14.23,6.4 14.28,6.14 C14.34,5.87 14.67,4.29 14.67,4.29 C14.67,4.29 14.82,3.74 14.19,3.74 L7.34,3.74 C7,3.75 6.84,4.02 6.84,4.33 C6.84,7.58 6.85,14.95 6.85,14.99 C6.87,15 8.89,12.51 9.76,11.42 L9.76,11.42 Z"></path></svg>',future:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline points="19 2 18 2 18 6 14 6 14 7 19 7 19 2"></polyline><path fill="none" stroke="#000" stroke-width="1.1" d="M18,6.548 C16.709,3.29 13.354,1 9.6,1 C4.6,1 0.6,5 0.6,10 C0.6,15 4.6,19 9.6,19 C14.6,19 18.6,15 18.6,10"></path><rect x="9" y="4" width="1" height="7"></rect><path d="M13.018,14.197 L9.445,10.625" fill="none" stroke="#000" stroke-width="1.1"></path></svg>',github:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10,1 C5.03,1 1,5.03 1,10 C1,13.98 3.58,17.35 7.16,18.54 C7.61,18.62 7.77,18.34 7.77,18.11 C7.77,17.9 7.76,17.33 7.76,16.58 C5.26,17.12 4.73,15.37 4.73,15.37 C4.32,14.33 3.73,14.05 3.73,14.05 C2.91,13.5 3.79,13.5 3.79,13.5 C4.69,13.56 5.17,14.43 5.17,14.43 C5.97,15.8 7.28,15.41 7.79,15.18 C7.87,14.6 8.1,14.2 8.36,13.98 C6.36,13.75 4.26,12.98 4.26,9.53 C4.26,8.55 4.61,7.74 5.19,7.11 C5.1,6.88 4.79,5.97 5.28,4.73 C5.28,4.73 6.04,4.49 7.75,5.65 C8.47,5.45 9.24,5.35 10,5.35 C10.76,5.35 11.53,5.45 12.25,5.65 C13.97,4.48 14.72,4.73 14.72,4.73 C15.21,5.97 14.9,6.88 14.81,7.11 C15.39,7.74 15.73,8.54 15.73,9.53 C15.73,12.99 13.63,13.75 11.62,13.97 C11.94,14.25 12.23,14.8 12.23,15.64 C12.23,16.84 12.22,17.81 12.22,18.11 C12.22,18.35 12.38,18.63 12.84,18.54 C16.42,17.35 19,13.98 19,10 C19,5.03 14.97,1 10,1 L10,1 Z"></path></svg>',gitter:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="3.5" y="1" width="1.531" height="11.471"></rect><rect x="7.324" y="4.059" width="1.529" height="15.294"></rect><rect x="11.148" y="4.059" width="1.527" height="15.294"></rect><rect x="14.971" y="4.059" width="1.529" height="8.412"></rect></svg>',google:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.86,9.09 C18.46,12.12 17.14,16.05 13.81,17.56 C9.45,19.53 4.13,17.68 2.47,12.87 C0.68,7.68 4.22,2.42 9.5,2.03 C11.57,1.88 13.42,2.37 15.05,3.65 C15.22,3.78 15.37,3.93 15.61,4.14 C14.9,4.81 14.23,5.45 13.5,6.14 C12.27,5.08 10.84,4.72 9.28,4.98 C8.12,5.17 7.16,5.76 6.37,6.63 C4.88,8.27 4.62,10.86 5.76,12.82 C6.95,14.87 9.17,15.8 11.57,15.25 C13.27,14.87 14.76,13.33 14.89,11.75 L10.51,11.75 L10.51,9.09 L17.86,9.09 L17.86,9.09 Z"></path></svg>',grid:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="3" height="3"></rect><rect x="8" y="2" width="3" height="3"></rect><rect x="14" y="2" width="3" height="3"></rect><rect x="2" y="8" width="3" height="3"></rect><rect x="8" y="8" width="3" height="3"></rect><rect x="14" y="8" width="3" height="3"></rect><rect x="2" y="14" width="3" height="3"></rect><rect x="8" y="14" width="3" height="3"></rect><rect x="14" y="14" width="3" height="3"></rect></svg>',happy:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="13" cy="7" r="1"></circle><circle cx="7" cy="7" r="1"></circle><circle fill="none" stroke="#000" cx="10" cy="10" r="8.5"></circle><path fill="none" stroke="#000" d="M14.6,11.4 C13.9,13.3 12.1,14.5 10,14.5 C7.9,14.5 6.1,13.3 5.4,11.4"></path></svg>',hashtag:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.431,8 L15.661,7 L12.911,7 L13.831,3 L12.901,3 L11.98,7 L9.29,7 L10.21,3 L9.281,3 L8.361,7 L5.23,7 L5,8 L8.13,8 L7.21,12 L4.23,12 L4,13 L6.98,13 L6.061,17 L6.991,17 L7.911,13 L10.601,13 L9.681,17 L10.611,17 L11.531,13 L14.431,13 L14.661,12 L11.76,12 L12.681,8 L15.431,8 Z M10.831,12 L8.141,12 L9.061,8 L11.75,8 L10.831,12 Z"></path></svg>',heart:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.03" d="M10,4 C10,4 8.1,2 5.74,2 C3.38,2 1,3.55 1,6.73 C1,8.84 2.67,10.44 2.67,10.44 L10,18 L17.33,10.44 C17.33,10.44 19,8.84 19,6.73 C19,3.55 16.62,2 14.26,2 C11.9,2 10,4 10,4 L10,4 Z"></path></svg>',history:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="#000" points="1 2 2 2 2 6 6 6 6 7 1 7 1 2"></polyline><path fill="none" stroke="#000" stroke-width="1.1" d="M2.1,6.548 C3.391,3.29 6.746,1 10.5,1 C15.5,1 19.5,5 19.5,10 C19.5,15 15.5,19 10.5,19 C5.5,19 1.5,15 1.5,10"></path><rect x="9" y="4" width="1" height="7"></rect><path fill="none" stroke="#000" stroke-width="1.1" d="M13.018,14.197 L9.445,10.625" id="Shape"></path></svg>',home:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="18.65 11.35 10 2.71 1.35 11.35 0.65 10.65 10 1.29 19.35 10.65"></polygon><polygon points="15 4 18 4 18 7 17 7 17 5 15 5"></polygon><polygon points="3 11 4 11 4 18 7 18 7 12 12 12 12 18 16 18 16 11 17 11 17 19 11 19 11 13 8 13 8 19 3 19"></polygon></svg>',image:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="16.1" cy="6.1" r="1.1"></circle><rect fill="none" stroke="#000" x="0.5" y="2.5" width="19" height="15"></rect><polyline fill="none" stroke="#000" stroke-width="1.01" points="4,13 8,9 13,14"></polyline><polyline fill="none" stroke="#000" stroke-width="1.01" points="11,12 12.5,10.5 16,14"></polyline></svg>',info:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg>',instagram:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M13.55,1H6.46C3.45,1,1,3.44,1,6.44v7.12c0,3,2.45,5.44,5.46,5.44h7.08c3.02,0,5.46-2.44,5.46-5.44V6.44 C19.01,3.44,16.56,1,13.55,1z M17.5,14c0,1.93-1.57,3.5-3.5,3.5H6c-1.93,0-3.5-1.57-3.5-3.5V6c0-1.93,1.57-3.5,3.5-3.5h8 c1.93,0,3.5,1.57,3.5,3.5V14z"></path><circle cx="14.87" cy="5.26" r="1.09"></circle><path d="M10.03,5.45c-2.55,0-4.63,2.06-4.63,4.6c0,2.55,2.07,4.61,4.63,4.61c2.56,0,4.63-2.061,4.63-4.61 C14.65,7.51,12.58,5.45,10.03,5.45L10.03,5.45L10.03,5.45z M10.08,13c-1.66,0-3-1.34-3-2.99c0-1.65,1.34-2.99,3-2.99s3,1.34,3,2.99 C13.08,11.66,11.74,13,10.08,13L10.08,13L10.08,13z"></path></svg>',italic:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.63,5.48 L10.15,14.52 C10,15.08 10.37,15.25 11.92,15.3 L11.72,16 L6,16 L6.2,15.31 C7.78,15.26 8.19,15.09 8.34,14.53 L10.82,5.49 C10.97,4.92 10.63,4.76 9.09,4.71 L9.28,4 L15,4 L14.81,4.69 C13.23,4.75 12.78,4.91 12.63,5.48 L12.63,5.48 Z"></path></svg>',joomla:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M7.8,13.4l1.7-1.7L5.9,8c-0.6-0.5-0.6-1.5,0-2c0.6-0.6,1.4-0.6,2,0l1.7-1.7c-1-1-2.3-1.3-3.6-1C5.8,2.2,4.8,1.4,3.7,1.4 c-1.3,0-2.3,1-2.3,2.3c0,1.1,0.8,2,1.8,2.3c-0.4,1.3-0.1,2.8,1,3.8L7.8,13.4L7.8,13.4z"></path><path d="M10.2,4.3c1-1,2.5-1.4,3.8-1c0.2-1.1,1.1-2,2.3-2c1.3,0,2.3,1,2.3,2.3c0,1.2-0.9,2.2-2,2.3c0.4,1.3,0,2.8-1,3.8L13.9,8 c0.6-0.5,0.6-1.5,0-2c-0.5-0.6-1.5-0.6-2,0L8.2,9.7L6.5,8"></path><path d="M14.1,16.8c-1.3,0.4-2.8,0.1-3.8-1l1.7-1.7c0.6,0.6,1.5,0.6,2,0c0.5-0.6,0.6-1.5,0-2l-3.7-3.7L12,6.7l3.7,3.7 c1,1,1.3,2.4,1,3.6c1.1,0.2,2,1.1,2,2.3c0,1.3-1,2.3-2.3,2.3C15.2,18.6,14.3,17.8,14.1,16.8"></path><path d="M13.2,12.2l-3.7,3.7c-1,1-2.4,1.3-3.6,1c-0.2,1-1.2,1.8-2.2,1.8c-1.3,0-2.3-1-2.3-2.3c0-1.1,0.8-2,1.8-2.3 c-0.3-1.3,0-2.7,1-3.7l1.7,1.7c-0.6,0.6-0.6,1.5,0,2c0.6,0.6,1.4,0.6,2,0l3.7-3.7"></path></svg>',laptop:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect y="16" width="20" height="1"></rect><rect fill="none" stroke="#000" x="2.5" y="4.5" width="15" height="10"></rect></svg>',lifesaver:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10,0.5 C4.76,0.5 0.5,4.76 0.5,10 C0.5,15.24 4.76,19.5 10,19.5 C15.24,19.5 19.5,15.24 19.5,10 C19.5,4.76 15.24,0.5 10,0.5 L10,0.5 Z M10,1.5 C11.49,1.5 12.89,1.88 14.11,2.56 L11.85,4.82 C11.27,4.61 10.65,4.5 10,4.5 C9.21,4.5 8.47,4.67 7.79,4.96 L5.58,2.75 C6.87,1.95 8.38,1.5 10,1.5 L10,1.5 Z M4.96,7.8 C4.67,8.48 4.5,9.21 4.5,10 C4.5,10.65 4.61,11.27 4.83,11.85 L2.56,14.11 C1.88,12.89 1.5,11.49 1.5,10 C1.5,8.38 1.95,6.87 2.75,5.58 L4.96,7.79 L4.96,7.8 L4.96,7.8 Z M10,18.5 C8.25,18.5 6.62,17.97 5.27,17.06 L7.46,14.87 C8.22,15.27 9.08,15.5 10,15.5 C10.79,15.5 11.53,15.33 12.21,15.04 L14.42,17.25 C13.13,18.05 11.62,18.5 10,18.5 L10,18.5 Z M10,14.5 C7.52,14.5 5.5,12.48 5.5,10 C5.5,7.52 7.52,5.5 10,5.5 C12.48,5.5 14.5,7.52 14.5,10 C14.5,12.48 12.48,14.5 10,14.5 L10,14.5 Z M15.04,12.21 C15.33,11.53 15.5,10.79 15.5,10 C15.5,9.08 15.27,8.22 14.87,7.46 L17.06,5.27 C17.97,6.62 18.5,8.25 18.5,10 C18.5,11.62 18.05,13.13 17.25,14.42 L15.04,12.21 L15.04,12.21 Z"></path></svg>',link:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.1" d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M7.925,11.875 L11.925,7.975"></path></svg>',linkedin:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5.77,17.89 L5.77,7.17 L2.21,7.17 L2.21,17.89 L5.77,17.89 L5.77,17.89 Z M3.99,5.71 C5.23,5.71 6.01,4.89 6.01,3.86 C5.99,2.8 5.24,2 4.02,2 C2.8,2 2,2.8 2,3.85 C2,4.88 2.77,5.7 3.97,5.7 L3.99,5.7 L3.99,5.71 L3.99,5.71 Z"></path><path d="M7.75,17.89 L11.31,17.89 L11.31,11.9 C11.31,11.58 11.33,11.26 11.43,11.03 C11.69,10.39 12.27,9.73 13.26,9.73 C14.55,9.73 15.06,10.71 15.06,12.15 L15.06,17.89 L18.62,17.89 L18.62,11.74 C18.62,8.45 16.86,6.92 14.52,6.92 C12.6,6.92 11.75,7.99 11.28,8.73 L11.3,8.73 L11.3,7.17 L7.75,7.17 C7.79,8.17 7.75,17.89 7.75,17.89 L7.75,17.89 L7.75,17.89 Z"></path></svg>',list:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="6" y="4" width="12" height="1"></rect><rect x="6" y="9" width="12" height="1"></rect><rect x="6" y="14" width="12" height="1"></rect><rect x="2" y="4" width="2" height="1"></rect><rect x="2" y="9" width="2" height="1"></rect><rect x="2" y="14" width="2" height="1"></rect></svg>',location:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.01" d="M10,0.5 C6.41,0.5 3.5,3.39 3.5,6.98 C3.5,11.83 10,19 10,19 C10,19 16.5,11.83 16.5,6.98 C16.5,3.39 13.59,0.5 10,0.5 L10,0.5 Z"></path><circle fill="none" stroke="#000" cx="10" cy="6.8" r="2.3"></circle></svg>',lock:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect fill="none" stroke="#000" height="10" width="13" y="8.5" x="3.5"></rect><path fill="none" stroke="#000" d="M6.5,8 L6.5,4.88 C6.5,3.01 8.07,1.5 10,1.5 C11.93,1.5 13.5,3.01 13.5,4.88 L13.5,8"></path></svg>',mail:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" points="1.4,6.5 10,11 18.6,6.5"></polyline><path d="M 1,4 1,16 19,16 19,4 1,4 Z M 18,15 2,15 2,5 18,5 18,15 Z"></path></svg>',menu:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="4" width="16" height="1"></rect><rect x="2" y="9" width="16" height="1"></rect><rect x="2" y="14" width="16" height="1"></rect></svg>',minus:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect height="1" width="18" y="9" x="1"></rect></svg>',more:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="3" cy="10" r="2"></circle><circle cx="10" cy="10" r="2"></circle><circle cx="17" cy="10" r="2"></circle></svg>',move:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="4,5 1,5 1,9 2,9 2,6 4,6 "></polygon><polygon points="1,16 2,16 2,18 4,18 4,19 1,19 "></polygon><polygon points="14,16 14,19 11,19 11,18 13,18 13,16 "></polygon><rect fill="none" stroke="#000" x="5.5" y="1.5" width="13" height="13"></rect><rect x="1" y="11" width="1" height="3"></rect><rect x="6" y="18" width="3" height="1"></rect></svg>',nut:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon fill="none" stroke="#000" points="2.5,5.7 10,1.3 17.5,5.7 17.5,14.3 10,18.7 2.5,14.3"></polygon><circle fill="none" stroke="#000" cx="10" cy="10" r="3.5"></circle></svg>',pagekit:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="3,1 17,1 17,16 10,16 10,13 14,13 14,4 6,4 6,16 10,16 10,19 3,19 "></polygon></svg>',pencil:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" d="M17.25,6.01 L7.12,16.1 L3.82,17.2 L5.02,13.9 L15.12,3.88 C15.71,3.29 16.66,3.29 17.25,3.88 C17.83,4.47 17.83,5.42 17.25,6.01 L17.25,6.01 Z"></path><path fill="none" stroke="#000" d="M15.98,7.268 L13.851,5.148"></path></svg>',phone:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" d="M15.5,17 C15.5,17.8 14.8,18.5 14,18.5 L7,18.5 C6.2,18.5 5.5,17.8 5.5,17 L5.5,3 C5.5,2.2 6.2,1.5 7,1.5 L14,1.5 C14.8,1.5 15.5,2.2 15.5,3 L15.5,17 L15.5,17 L15.5,17 Z"></path><circle cx="10.5" cy="16.5" r="0.8"></circle></svg>',pinterest:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.21,1 C5.5,1 3,4.16 3,7.61 C3,9.21 3.85,11.2 5.22,11.84 C5.43,11.94 5.54,11.89 5.58,11.69 C5.62,11.54 5.8,10.8 5.88,10.45 C5.91,10.34 5.89,10.24 5.8,10.14 C5.36,9.59 5,8.58 5,7.65 C5,5.24 6.82,2.91 9.93,2.91 C12.61,2.91 14.49,4.74 14.49,7.35 C14.49,10.3 13,12.35 11.06,12.35 C9.99,12.35 9.19,11.47 9.44,10.38 C9.75,9.08 10.35,7.68 10.35,6.75 C10.35,5.91 9.9,5.21 8.97,5.21 C7.87,5.21 6.99,6.34 6.99,7.86 C6.99,8.83 7.32,9.48 7.32,9.48 C7.32,9.48 6.24,14.06 6.04,14.91 C5.7,16.35 6.08,18.7 6.12,18.9 C6.14,19.01 6.26,19.05 6.33,18.95 C6.44,18.81 7.74,16.85 8.11,15.44 C8.24,14.93 8.79,12.84 8.79,12.84 C9.15,13.52 10.19,14.09 11.29,14.09 C14.58,14.09 16.96,11.06 16.96,7.3 C16.94,3.7 14,1 10.21,1"></path></svg>',play:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon fill="none" stroke="#000" points="6.5,5 14.5,10 6.5,15"></polygon></svg>',plus:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>',pull:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="6.85,8 9.5,10.6 12.15,8 12.85,8.7 9.5,12 6.15,8.7"></polygon><line fill="none" stroke="#000" x1="9.5" y1="11" x2="9.5" y2="2"></line><polyline fill="none" stroke="#000" points="6,5.5 3.5,5.5 3.5,18.5 15.5,18.5 15.5,5.5 13,5.5"></polyline></svg>',push:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="12.15,4 9.5,1.4 6.85,4 6.15,3.3 9.5,0 12.85,3.3"></polygon><line fill="none" stroke="#000" x1="9.5" y1="10" x2="9.5" y2="1"></line><polyline fill="none" stroke="#000" points="6 5.5 3.5 5.5 3.5 18.5 15.5 18.5 15.5 5.5 13 5.5"></polyline></svg>',question:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><circle cx="10.44" cy="14.42" r="1.05"></circle><path fill="none" stroke="#000" stroke-width="1.2" d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path></svg>',receiver:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.01" d="M6.189,13.611C8.134,15.525 11.097,18.239 13.867,18.257C16.47,18.275 18.2,16.241 18.2,16.241L14.509,12.551L11.539,13.639L6.189,8.29L7.313,5.355L3.76,1.8C3.76,1.8 1.732,3.537 1.7,6.092C1.667,8.809 4.347,11.738 6.189,13.611"></path></svg>',refresh:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.1" d="M17.08,11.15 C17.09,11.31 17.1,11.47 17.1,11.64 C17.1,15.53 13.94,18.69 10.05,18.69 C6.16,18.68 3,15.53 3,11.63 C3,7.74 6.16,4.58 10.05,4.58 C10.9,4.58 11.71,4.73 12.46,5"></path><polyline fill="none" stroke="#000" points="9.9 2 12.79 4.89 9.79 7.9"></polyline></svg>',reply:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.7,13.11 C16.12,10.02 13.84,7.85 11.02,6.61 C10.57,6.41 9.75,6.13 9,5.91 L9,2 L1,9 L9,16 L9,12.13 C10.78,12.47 12.5,13.19 14.09,14.25 C17.13,16.28 18.56,18.54 18.56,18.54 C18.56,18.54 18.81,15.28 17.7,13.11 L17.7,13.11 Z M14.82,13.53 C13.17,12.4 11.01,11.4 8,10.92 L8,13.63 L2.55,9 L8,4.25 L8,6.8 C8.3,6.86 9.16,7.02 10.37,7.49 C13.3,8.65 15.54,10.96 16.65,13.08 C16.97,13.7 17.48,14.86 17.68,16 C16.87,15.05 15.73,14.15 14.82,13.53 L14.82,13.53 Z"></path></svg>',rss:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="3.12" cy="16.8" r="1.85"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1.5,8.2 C1.78,8.18 2.06,8.16 2.35,8.16 C7.57,8.16 11.81,12.37 11.81,17.57 C11.81,17.89 11.79,18.19 11.76,18.5"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M1.5,2.52 C1.78,2.51 2.06,2.5 2.35,2.5 C10.72,2.5 17.5,9.24 17.5,17.57 C17.5,17.89 17.49,18.19 17.47,18.5"></path></svg>',search:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>',server:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="1" height="2"></rect><rect x="5" y="3" width="1" height="2"></rect><rect x="7" y="3" width="1" height="2"></rect><rect x="16" y="3" width="1" height="1"></rect><rect x="16" y="10" width="1" height="1"></rect><circle fill="none" stroke="#000" cx="9.9" cy="17.4" r="1.4"></circle><rect x="3" y="10" width="1" height="2"></rect><rect x="5" y="10" width="1" height="2"></rect><rect x="9.5" y="14" width="1" height="2"></rect><rect x="3" y="17" width="6" height="1"></rect><rect x="11" y="17" width="6" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="1.5" width="17" height="5"></rect><rect fill="none" stroke="#000" x="1.5" y="8.5" width="17" height="5"></rect></svg>',settings:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><ellipse fill="none" stroke="#000" cx="6.11" cy="3.55" rx="2.11" ry="2.15"></ellipse><ellipse fill="none" stroke="#000" cx="6.11" cy="15.55" rx="2.11" ry="2.15"></ellipse><circle fill="none" stroke="#000" cx="13.15" cy="9.55" r="2.15"></circle><rect x="1" y="3" width="3" height="1"></rect><rect x="10" y="3" width="8" height="1"></rect><rect x="1" y="9" width="8" height="1"></rect><rect x="15" y="9" width="3" height="1"></rect><rect x="1" y="15" width="3" height="1"></rect><rect x="10" y="15" width="8" height="1"></rect></svg>',shrink:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="11 4 12 4 12 8 16 8 16 9 11 9"></polygon><polygon points="4 11 9 11 9 16 8 16 8 12 4 12"></polygon><path fill="none" stroke="#000" stroke-width="1.1" d="M12,8 L18,2"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M2,18 L8,12"></path></svg>',social:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><line fill="none" stroke="#000" stroke-width="1.1" x1="13.4" y1="14" x2="6.3" y2="10.7"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="13.5" y1="5.5" x2="6.5" y2="8.8"></line><circle fill="none" stroke="#000" stroke-width="1.1" cx="15.5" cy="4.6" r="2.3"></circle><circle fill="none" stroke="#000" stroke-width="1.1" cx="15.5" cy="14.8" r="2.3"></circle><circle fill="none" stroke="#000" stroke-width="1.1" cx="4.5" cy="9.8" r="2.3"></circle></svg>',soundcloud:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.2,9.4c-0.4,0-0.8,0.1-1.101,0.2c-0.199-2.5-2.399-4.5-5-4.5c-0.6,0-1.2,0.1-1.7,0.3C9.2,5.5,9.1,5.6,9.1,5.6V15h8 c1.601,0,2.801-1.2,2.801-2.8C20,10.7,18.7,9.4,17.2,9.4L17.2,9.4z"></path><rect x="6" y="6.5" width="1.5" height="8.5"></rect><rect x="3" y="8" width="1.5" height="7"></rect><rect y="10" width="1.5" height="5"></rect></svg>',star:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon fill="none" stroke="#000" stroke-width="1.01" points="10 2 12.63 7.27 18.5 8.12 14.25 12.22 15.25 18 10 15.27 4.75 18 5.75 12.22 1.5 8.12 7.37 7.27"></polygon></svg>',strikethrough:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6,13.02 L6.65,13.02 C7.64,15.16 8.86,16.12 10.41,16.12 C12.22,16.12 12.92,14.93 12.92,13.89 C12.92,12.55 11.99,12.03 9.74,11.23 C8.05,10.64 6.23,10.11 6.23,7.83 C6.23,5.5 8.09,4.09 10.4,4.09 C11.44,4.09 12.13,4.31 12.72,4.54 L13.33,4 L13.81,4 L13.81,7.59 L13.16,7.59 C12.55,5.88 11.52,4.89 10.07,4.89 C8.84,4.89 7.89,5.69 7.89,7.03 C7.89,8.29 8.89,8.78 10.88,9.45 C12.57,10.03 14.38,10.6 14.38,12.91 C14.38,14.75 13.27,16.93 10.18,16.93 C9.18,16.93 8.17,16.69 7.46,16.39 L6.52,17 L6,17 L6,13.02 L6,13.02 Z"></path><rect x="3" y="10" width="15" height="1"></rect></svg>',table:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="18" height="1"></rect><rect x="1" y="7" width="18" height="1"></rect><rect x="1" y="11" width="18" height="1"></rect><rect x="1" y="15" width="18" height="1"></rect></svg>',tablet:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" d="M5,18.5 C4.2,18.5 3.5,17.8 3.5,17 L3.5,3 C3.5,2.2 4.2,1.5 5,1.5 L16,1.5 C16.8,1.5 17.5,2.2 17.5,3 L17.5,17 C17.5,17.8 16.8,18.5 16,18.5 L5,18.5 L5,18.5 L5,18.5 Z"></path><circle cx="10.5" cy="16.3" r="0.8"></circle></svg>',tag:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.1" d="M17.5,3.71 L17.5,7.72 C17.5,7.96 17.4,8.2 17.21,8.39 L8.39,17.2 C7.99,17.6 7.33,17.6 6.93,17.2 L2.8,13.07 C2.4,12.67 2.4,12.01 2.8,11.61 L11.61,2.8 C11.81,2.6 12.08,2.5 12.34,2.5 L16.19,2.5 C16.52,2.5 16.86,2.63 17.11,2.88 C17.35,3.11 17.48,3.4 17.5,3.71 L17.5,3.71 Z"></path><circle cx="14" cy="6" r="1"></circle></svg>',thumbnails:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect fill="none" stroke="#000" x="3.5" y="3.5" width="5" height="5"></rect><rect fill="none" stroke="#000" x="11.5" y="3.5" width="5" height="5"></rect><rect fill="none" stroke="#000" x="11.5" y="11.5" width="5" height="5"></rect><rect fill="none" stroke="#000" x="3.5" y="11.5" width="5" height="5"></rect></svg>',trash:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" points="6.5 3 6.5 1.5 13.5 1.5 13.5 3"></polyline><polyline fill="none" stroke="#000" points="4.5 4 4.5 18.5 15.5 18.5 15.5 4"></polyline><rect x="8" y="7" width="1" height="9"></rect><rect x="11" y="7" width="1" height="9"></rect><rect x="2" y="3" width="16" height="1"></rect></svg>',tripadvisor:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M19.021,7.866C19.256,6.862,20,5.854,20,5.854h-3.346C14.781,4.641,12.504,4,9.98,4C7.363,4,4.999,4.651,3.135,5.876H0\tc0,0,0.738,0.987,0.976,1.988c-0.611,0.837-0.973,1.852-0.973,2.964c0,2.763,2.249,5.009,5.011,5.009\tc1.576,0,2.976-0.737,3.901-1.879l1.063,1.599l1.075-1.615c0.475,0.611,1.1,1.111,1.838,1.451c1.213,0.547,2.574,0.612,3.825,0.15\tc2.589-0.963,3.913-3.852,2.964-6.439c-0.175-0.463-0.4-0.876-0.675-1.238H19.021z M16.38,14.594\tc-1.002,0.371-2.088,0.328-3.06-0.119c-0.688-0.317-1.252-0.817-1.657-1.438c-0.164-0.25-0.313-0.52-0.417-0.811\tc-0.124-0.328-0.186-0.668-0.217-1.014c-0.063-0.689,0.037-1.396,0.339-2.043c0.448-0.971,1.251-1.71,2.25-2.079\tc2.075-0.765,4.375,0.3,5.14,2.366c0.762,2.066-0.301,4.37-2.363,5.134L16.38,14.594L16.38,14.594z M8.322,13.066\tc-0.72,1.059-1.935,1.76-3.309,1.76c-2.207,0-4.001-1.797-4.001-3.996c0-2.203,1.795-4.002,4.001-4.002\tc2.204,0,3.999,1.8,3.999,4.002c0,0.137-0.024,0.261-0.04,0.396c-0.067,0.678-0.284,1.313-0.648,1.853v-0.013H8.322z M2.472,10.775\tc0,1.367,1.112,2.479,2.476,2.479c1.363,0,2.472-1.11,2.472-2.479c0-1.359-1.11-2.468-2.472-2.468\tC3.584,8.306,2.473,9.416,2.472,10.775L2.472,10.775z M12.514,10.775c0,1.367,1.104,2.479,2.471,2.479\tc1.363,0,2.474-1.108,2.474-2.479c0-1.359-1.11-2.468-2.474-2.468c-1.364,0-2.477,1.109-2.477,2.468H12.514z M3.324,10.775\tc0-0.893,0.726-1.618,1.614-1.618c0.889,0,1.625,0.727,1.625,1.618c0,0.898-0.725,1.627-1.625,1.627\tc-0.901,0-1.625-0.729-1.625-1.627H3.324z M13.354,10.775c0-0.893,0.726-1.618,1.627-1.618c0.886,0,1.61,0.727,1.61,1.618\tc0,0.898-0.726,1.627-1.626,1.627s-1.625-0.729-1.625-1.627H13.354z M9.977,4.875c1.798,0,3.425,0.324,4.849,0.968\tc-0.535,0.015-1.061,0.108-1.586,0.3c-1.264,0.463-2.264,1.388-2.815,2.604c-0.262,0.551-0.398,1.133-0.448,1.72\tC9.79,7.905,7.677,5.873,5.076,5.82C6.501,5.208,8.153,4.875,9.94,4.875H9.977z"></path></svg>',tumblr:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M6.885,8.598c0,0,0,3.393,0,4.996c0,0.282,0,0.66,0.094,0.942c0.377,1.509,1.131,2.545,2.545,3.11 c1.319,0.472,2.356,0.472,3.676,0c0.565-0.188,1.132-0.659,1.132-0.659l-0.849-2.263c0,0-1.036,0.378-1.603,0.283 c-0.565-0.094-1.226-0.66-1.226-1.508c0-1.603,0-4.902,0-4.902h2.828V5.771h-2.828V2H8.205c0,0-0.094,0.66-0.188,0.942 C7.828,3.791,7.262,4.733,6.603,5.394C5.848,6.147,5,6.43,5,6.43v2.168H6.885z"></path></svg>',tv:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="7" y="16" width="6" height="1"></rect><rect fill="none" stroke="#000" x="0.5" y="3.5" width="19" height="11"></rect></svg>',twitter:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M19,4.74 C18.339,5.029 17.626,5.229 16.881,5.32 C17.644,4.86 18.227,4.139 18.503,3.28 C17.79,3.7 17.001,4.009 16.159,4.17 C15.485,3.45 14.526,3 13.464,3 C11.423,3 9.771,4.66 9.771,6.7 C9.771,6.99 9.804,7.269 9.868,7.539 C6.795,7.38 4.076,5.919 2.254,3.679 C1.936,4.219 1.754,4.86 1.754,5.539 C1.754,6.82 2.405,7.95 3.397,8.61 C2.79,8.589 2.22,8.429 1.723,8.149 L1.723,8.189 C1.723,9.978 2.997,11.478 4.686,11.82 C4.376,11.899 4.049,11.939 3.713,11.939 C3.475,11.939 3.245,11.919 3.018,11.88 C3.49,13.349 4.852,14.419 6.469,14.449 C5.205,15.429 3.612,16.019 1.882,16.019 C1.583,16.019 1.29,16.009 1,15.969 C2.635,17.019 4.576,17.629 6.662,17.629 C13.454,17.629 17.17,12 17.17,7.129 C17.17,6.969 17.166,6.809 17.157,6.649 C17.879,6.129 18.504,5.478 19,4.74"></path></svg>',uikit:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="14.4,3.1 11.3,5.1 15,7.3 15,12.9 10,15.7 5,12.9 5,8.5 2,6.8 2,14.8 9.9,19.5 18,14.8 18,5.3"></polygon><polygon points="9.8,4.2 6.7,2.4 9.8,0.4 12.9,2.3"></polygon></svg>',unlock:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect fill="none" stroke="#000" x="3.5" y="8.5" width="13" height="10"></rect><path fill="none" stroke="#000" d="M6.5,8.5 L6.5,4.9 C6.5,3 8.1,1.5 10,1.5 C11.9,1.5 13.5,3 13.5,4.9"></path></svg>',upload:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" points="5 8 9.5 3.5 14 8 "></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="15" x2="9.5" y2="4"></line></svg>',user:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9.9" cy="6.4" r="4.4"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1.5,19 C2.3,14.5 5.8,11.2 10,11.2 C14.2,11.2 17.7,14.6 18.5,19.2"></path></svg>',users:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="7.7" cy="8.6" r="3.5"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg>',vimeo:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.065,7.59C1.84,7.367,1.654,7.082,1.468,6.838c-0.332-0.42-0.137-0.411,0.274-0.772c1.026-0.91,2.004-1.896,3.127-2.688 c1.017-0.713,2.365-1.173,3.286-0.039c0.849,1.045,0.869,2.629,1.084,3.891c0.215,1.309,0.421,2.648,0.88,3.901 c0.127,0.352,0.37,1.018,0.81,1.074c0.567,0.078,1.145-0.917,1.408-1.289c0.684-0.987,1.611-2.317,1.494-3.587 c-0.115-1.349-1.572-1.095-2.482-0.773c0.146-1.514,1.555-3.216,2.912-3.792c1.439-0.597,3.579-0.587,4.302,1.036 c0.772,1.759,0.078,3.802-0.763,5.396c-0.918,1.731-2.1,3.333-3.363,4.829c-1.114,1.329-2.432,2.787-4.093,3.422 c-1.897,0.723-3.021-0.686-3.667-2.318c-0.705-1.777-1.056-3.771-1.565-5.621C4.898,8.726,4.644,7.836,4.136,7.191 C3.473,6.358,2.72,7.141,2.065,7.59C1.977,7.502,2.115,7.551,2.065,7.59L2.065,7.59z"></path></svg>',warning:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="14" r="1"></circle><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><path d="M10.97,7.72 C10.85,9.54 10.56,11.29 10.56,11.29 C10.51,11.87 10.27,12 9.99,12 C9.69,12 9.49,11.87 9.43,11.29 C9.43,11.29 9.16,9.54 9.03,7.72 C8.96,6.54 9.03,6 9.03,6 C9.03,5.45 9.46,5.02 9.99,5 C10.53,5.01 10.97,5.44 10.97,6 C10.97,6 11.04,6.54 10.97,7.72 L10.97,7.72 Z"></path></svg>',whatsapp:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M16.7,3.3c-1.8-1.8-4.1-2.8-6.7-2.8c-5.2,0-9.4,4.2-9.4,9.4c0,1.7,0.4,3.3,1.3,4.7l-1.3,4.9l5-1.3c1.4,0.8,2.9,1.2,4.5,1.2 l0,0l0,0c5.2,0,9.4-4.2,9.4-9.4C19.5,7.4,18.5,5,16.7,3.3 M10.1,17.7L10.1,17.7c-1.4,0-2.8-0.4-4-1.1l-0.3-0.2l-3,0.8l0.8-2.9 l-0.2-0.3c-0.8-1.2-1.2-2.7-1.2-4.2c0-4.3,3.5-7.8,7.8-7.8c2.1,0,4.1,0.8,5.5,2.3c1.5,1.5,2.3,3.4,2.3,5.5 C17.9,14.2,14.4,17.7,10.1,17.7 M14.4,11.9c-0.2-0.1-1.4-0.7-1.6-0.8c-0.2-0.1-0.4-0.1-0.5,0.1c-0.2,0.2-0.6,0.8-0.8,0.9 c-0.1,0.2-0.3,0.2-0.5,0.1c-0.2-0.1-1-0.4-1.9-1.2c-0.7-0.6-1.2-1.4-1.3-1.6c-0.1-0.2,0-0.4,0.1-0.5C8,8.8,8.1,8.7,8.2,8.5 c0.1-0.1,0.2-0.2,0.2-0.4c0.1-0.2,0-0.3,0-0.4C8.4,7.6,7.9,6.5,7.7,6C7.5,5.5,7.3,5.6,7.2,5.6c-0.1,0-0.3,0-0.4,0 c-0.2,0-0.4,0.1-0.6,0.3c-0.2,0.2-0.8,0.8-0.8,2c0,1.2,0.8,2.3,1,2.4c0.1,0.2,1.7,2.5,4,3.5c0.6,0.2,1,0.4,1.3,0.5 c0.6,0.2,1.1,0.2,1.5,0.1c0.5-0.1,1.4-0.6,1.6-1.1c0.2-0.5,0.2-1,0.1-1.1C14.8,12.1,14.6,12,14.4,11.9"></path></svg>',wordpress:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10,0.5c-5.2,0-9.5,4.3-9.5,9.5s4.3,9.5,9.5,9.5c5.2,0,9.5-4.3,9.5-9.5S15.2,0.5,10,0.5L10,0.5L10,0.5z M15.6,3.9h-0.1 c-0.8,0-1.4,0.7-1.4,1.5c0,0.7,0.4,1.3,0.8,1.9c0.3,0.6,0.7,1.3,0.7,2.3c0,0.7-0.3,1.5-0.6,2.7L14.1,15l-3-8.9 c0.5,0,0.9-0.1,0.9-0.1C12.5,6,12.5,5.3,12,5.4c0,0-1.3,0.1-2.2,0.1C9,5.5,7.7,5.4,7.7,5.4C7.2,5.3,7.2,6,7.6,6c0,0,0.4,0.1,0.9,0.1 l1.3,3.5L8,15L5,6.1C5.5,6.1,5.9,6,5.9,6C6.4,6,6.3,5.3,5.9,5.4c0,0-1.3,0.1-2.2,0.1c-0.2,0-0.3,0-0.5,0c1.5-2.2,4-3.7,6.9-3.7 C12.2,1.7,14.1,2.6,15.6,3.9L15.6,3.9L15.6,3.9z M2.5,6.6l3.9,10.8c-2.7-1.3-4.6-4.2-4.6-7.4C1.8,8.8,2,7.6,2.5,6.6L2.5,6.6L2.5,6.6 z M10.2,10.7l2.5,6.9c0,0,0,0.1,0.1,0.1C11.9,18,11,18.2,10,18.2c-0.8,0-1.6-0.1-2.3-0.3L10.2,10.7L10.2,10.7L10.2,10.7z M14.2,17.1 l2.5-7.3c0.5-1.2,0.6-2.1,0.6-2.9c0-0.3,0-0.6-0.1-0.8c0.6,1.2,1,2.5,1,4C18.3,13,16.6,15.7,14.2,17.1L14.2,17.1L14.2,17.1z"></path></svg>',world:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" d="M1,10.5 L19,10.5"></path><path fill="none" stroke="#000" d="M2.35,15.5 L17.65,15.5"></path><path fill="none" stroke="#000" d="M2.35,5.5 L17.523,5.5"></path><path fill="none" stroke="#000" d="M10,19.46 L9.98,19.46 C7.31,17.33 5.61,14.141 5.61,10.58 C5.61,7.02 7.33,3.83 10,1.7 C10.01,1.7 9.99,1.7 10,1.7 L10,1.7 C12.67,3.83 14.4,7.02 14.4,10.58 C14.4,14.141 12.67,17.33 10,19.46 L10,19.46 L10,19.46 L10,19.46 Z"></path><circle fill="none" stroke="#000" cx="10" cy="10.5" r="9"></circle></svg>',xing:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M4.4,4.56 C4.24,4.56 4.11,4.61 4.05,4.72 C3.98,4.83 3.99,4.97 4.07,5.12 L5.82,8.16 L5.82,8.17 L3.06,13.04 C2.99,13.18 2.99,13.33 3.06,13.44 C3.12,13.55 3.24,13.62 3.4,13.62 L6,13.62 C6.39,13.62 6.57,13.36 6.71,13.12 C6.71,13.12 9.41,8.35 9.51,8.16 C9.49,8.14 7.72,5.04 7.72,5.04 C7.58,4.81 7.39,4.56 6.99,4.56 L4.4,4.56 L4.4,4.56 Z"></path><path d="M15.3,1 C14.91,1 14.74,1.25 14.6,1.5 C14.6,1.5 9.01,11.42 8.82,11.74 C8.83,11.76 12.51,18.51 12.51,18.51 C12.64,18.74 12.84,19 13.23,19 L15.82,19 C15.98,19 16.1,18.94 16.16,18.83 C16.23,18.72 16.23,18.57 16.16,18.43 L12.5,11.74 L12.5,11.72 L18.25,1.56 C18.32,1.42 18.32,1.27 18.25,1.16 C18.21,1.06 18.08,1 17.93,1 L15.3,1 L15.3,1 Z"></path></svg>',yelp:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.175,14.971c-0.112,0.77-1.686,2.767-2.406,3.054c-0.246,0.1-0.487,0.076-0.675-0.069\tc-0.122-0.096-2.446-3.859-2.446-3.859c-0.194-0.293-0.157-0.682,0.083-0.978c0.234-0.284,0.581-0.393,0.881-0.276\tc0.016,0.01,4.21,1.394,4.332,1.482c0.178,0.148,0.263,0.379,0.225,0.646L17.175,14.971L17.175,14.971z M11.464,10.789\tc-0.203-0.307-0.199-0.666,0.009-0.916c0,0,2.625-3.574,2.745-3.657c0.203-0.135,0.452-0.141,0.69-0.025\tc0.691,0.335,2.085,2.405,2.167,3.199v0.027c0.024,0.271-0.082,0.491-0.273,0.623c-0.132,0.083-4.43,1.155-4.43,1.155\tc-0.322,0.096-0.68-0.06-0.882-0.381L11.464,10.789z M9.475,9.563C9.32,9.609,8.848,9.757,8.269,8.817c0,0-3.916-6.16-4.007-6.351\tc-0.057-0.212,0.011-0.455,0.202-0.65C5.047,1.211,8.21,0.327,9.037,0.529c0.27,0.069,0.457,0.238,0.522,0.479\tc0.047,0.266,0.433,5.982,0.488,7.264C10.098,9.368,9.629,9.517,9.475,9.563z M9.927,19.066c-0.083,0.225-0.273,0.373-0.54,0.421\tc-0.762,0.13-3.15-0.751-3.647-1.342c-0.096-0.131-0.155-0.262-0.167-0.394c-0.011-0.095,0-0.189,0.036-0.272\tc0.061-0.155,2.917-3.538,2.917-3.538c0.214-0.272,0.595-0.355,0.952-0.213c0.345,0.13,0.56,0.428,0.536,0.749\tC10.014,14.479,9.977,18.923,9.927,19.066z M3.495,13.912c-0.235-0.009-0.444-0.148-0.568-0.382c-0.089-0.17-0.151-0.453-0.19-0.794\tC2.63,11.701,2.761,10.144,3.07,9.648c0.145-0.226,0.357-0.345,0.592-0.336c0.154,0,4.255,1.667,4.255,1.667\tc0.321,0.118,0.521,0.453,0.5,0.833c-0.023,0.37-0.236,0.655-0.551,0.738L3.495,13.912z"></path></svg>',youtube:'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15,4.1c1,0.1,2.3,0,3,0.8c0.8,0.8,0.9,2.1,0.9,3.1C19,9.2,19,10.9,19,12c-0.1,1.1,0,2.4-0.5,3.4c-0.5,1.1-1.4,1.5-2.5,1.6 c-1.2,0.1-8.6,0.1-11,0c-1.1-0.1-2.4-0.1-3.2-1c-0.7-0.8-0.7-2-0.8-3C1,11.8,1,10.1,1,8.9c0-1.1,0-2.4,0.5-3.4C2,4.5,3,4.3,4.1,4.2 C5.3,4.1,12.6,4,15,4.1z M8,7.5v6l5.5-3L8,7.5z"></path></svg>',"500px":'<?xml version="1.0" encoding="utf-8"?>\x3c!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\t width="20px" height="20px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve"><path d="M9.624,11.866c-0.141,0.132,0.479,0.658,0.662,0.418c0.051-0.046,0.607-0.61,0.662-0.664c0,0,0.738,0.719,0.814,0.719\tc0.1,0,0.207-0.055,0.322-0.17c0.27-0.269,0.135-0.416,0.066-0.495l-0.631-0.616l0.658-0.668c0.146-0.156,0.021-0.314-0.1-0.449\tc-0.182-0.18-0.359-0.226-0.471-0.125l-0.656,0.654l-0.654-0.654c-0.033-0.034-0.08-0.045-0.124-0.045\tc-0.079,0-0.191,0.068-0.307,0.181c-0.202,0.202-0.247,0.351-0.133,0.462l0.665,0.665L9.624,11.866z"/><path d="M11.066,2.884c-1.061,0-2.185,0.248-3.011,0.604c-0.087,0.034-0.141,0.106-0.15,0.205C7.893,3.784,7.919,3.909,7.982,4.066\tc0.05,0.136,0.187,0.474,0.452,0.372c0.844-0.326,1.779-0.507,2.633-0.507c0.963,0,1.9,0.191,2.781,0.564\tc0.695,0.292,1.357,0.719,2.078,1.34c0.051,0.044,0.105,0.068,0.164,0.068c0.143,0,0.273-0.137,0.389-0.271\tc0.191-0.214,0.324-0.395,0.135-0.575c-0.686-0.654-1.436-1.138-2.363-1.533C13.24,3.097,12.168,2.884,11.066,2.884z"/><path d="M16.43,15.747c-0.092-0.028-0.242,0.05-0.309,0.119l0,0c-0.652,0.652-1.42,1.169-2.268,1.521\tc-0.877,0.371-1.814,0.551-2.779,0.551c-0.961,0-1.896-0.189-2.775-0.564c-0.848-0.36-1.612-0.879-2.268-1.53\tc-0.682-0.688-1.196-1.455-1.529-2.268c-0.325-0.799-0.471-1.643-0.471-1.643c-0.045-0.24-0.258-0.249-0.567-0.203\tc-0.128,0.021-0.519,0.079-0.483,0.36v0.01c0.105,0.644,0.289,1.284,0.545,1.895c0.417,0.969,1.002,1.849,1.756,2.604\tc0.757,0.754,1.636,1.34,2.604,1.757C8.901,18.785,9.97,19,11.088,19c1.104,0,2.186-0.215,3.188-0.645\tc1.838-0.896,2.604-1.757,2.604-1.757c0.182-0.204,0.227-0.317-0.1-0.643C16.779,15.956,16.525,15.774,16.43,15.747z"/><path d="M5.633,13.287c0.293,0.71,0.723,1.341,1.262,1.882c0.54,0.54,1.172,0.971,1.882,1.264c0.731,0.303,1.509,0.461,2.298,0.461\tc0.801,0,1.578-0.158,2.297-0.461c0.711-0.293,1.344-0.724,1.883-1.264c0.543-0.541,0.971-1.172,1.264-1.882\tc0.314-0.721,0.463-1.5,0.463-2.298c0-0.79-0.148-1.569-0.463-2.289c-0.293-0.699-0.721-1.329-1.264-1.881\tc-0.539-0.541-1.172-0.959-1.867-1.263c-0.721-0.303-1.5-0.461-2.299-0.461c-0.802,0-1.613,0.159-2.322,0.461\tc-0.577,0.25-1.544,0.867-2.119,1.454v0.012V2.108h8.16C15.1,2.104,15.1,1.69,15.1,1.552C15.1,1.417,15.1,1,14.809,1H5.915\tC5.676,1,5.527,1.192,5.527,1.384v6.84c0,0.214,0.273,0.372,0.529,0.428c0.5,0.105,0.614-0.056,0.737-0.224l0,0\tc0.18-0.273,0.776-0.884,0.787-0.894c0.901-0.905,2.117-1.408,3.416-1.408c1.285,0,2.5,0.501,3.412,1.408\tc0.914,0.914,1.408,2.122,1.408,3.405c0,1.288-0.508,2.496-1.408,3.405c-0.9,0.896-2.152,1.406-3.438,1.406\tc-0.877,0-1.711-0.229-2.433-0.671v-4.158c0-0.553,0.237-1.151,0.643-1.614c0.462-0.519,1.094-0.799,1.782-0.799\tc0.664,0,1.293,0.253,1.758,0.715c0.459,0.459,0.709,1.071,0.709,1.723c0,1.385-1.094,2.468-2.488,2.468\tc-0.273,0-0.769-0.121-0.781-0.125c-0.281-0.087-0.405,0.306-0.438,0.436c-0.159,0.496,0.079,0.585,0.123,0.607\tc0.452,0.137,0.743,0.157,1.129,0.157c1.973,0,3.572-1.6,3.572-3.57c0-1.964-1.6-3.552-3.572-3.552c-0.97,0-1.872,0.36-2.546,1.038\tc-0.656,0.631-1.027,1.487-1.027,2.322v3.438v-0.011c-0.372-0.42-0.732-1.041-0.981-1.682c-0.102-0.248-0.315-0.202-0.607-0.113\tc-0.135,0.035-0.519,0.157-0.44,0.439C5.372,12.799,5.577,13.164,5.633,13.287z"/></svg>',"arrow-down":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="10.5,16.08 5.63,10.66 6.37,10 10.5,14.58 14.63,10 15.37,10.66"></polygon><line fill="none" stroke="#000" x1="10.5" y1="4" x2="10.5" y2="15"></line></svg>',"arrow-left":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" points="10 14 5 9.5 10 5"></polyline><line fill="none" stroke="#000" x1="16" y1="9.5" x2="5" y2="9.52"></line></svg>',"arrow-right":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" points="10 5 15 9.5 10 14"></polyline><line fill="none" stroke="#000" x1="4" y1="9.5" x2="15" y2="9.5"></line></svg>',"arrow-up":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="10.5,4 15.37,9.4 14.63,10.08 10.5,5.49 6.37,10.08 5.63,9.4"></polygon><line fill="none" stroke="#000" x1="10.5" y1="16" x2="10.5" y2="5"></line></svg>',"chevron-down":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg>',"chevron-left":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg>',"chevron-right":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>',"chevron-up":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.03" points="4 13 10 7 16 13"></polyline></svg>',"cloud-download":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.1" d="M6.5,14.61 L3.75,14.61 C1.96,14.61 0.5,13.17 0.5,11.39 C0.5,9.76 1.72,8.41 3.3,8.2 C3.38,5.31 5.75,3 8.68,3 C11.19,3 13.31,4.71 13.89,7.02 C14.39,6.8 14.93,6.68 15.5,6.68 C17.71,6.68 19.5,8.45 19.5,10.64 C19.5,12.83 17.71,14.6 15.5,14.6 L12.5,14.6"></path><polyline fill="none" stroke="#000" points="11.75 16 9.5 18.25 7.25 16"></polyline><path fill="none" stroke="#000" d="M9.5,18 L9.5,9.5"></path></svg>',"cloud-upload":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" stroke-width="1.1" d="M6.5,14.61 L3.75,14.61 C1.96,14.61 0.5,13.17 0.5,11.39 C0.5,9.76 1.72,8.41 3.31,8.2 C3.38,5.31 5.75,3 8.68,3 C11.19,3 13.31,4.71 13.89,7.02 C14.39,6.8 14.93,6.68 15.5,6.68 C17.71,6.68 19.5,8.45 19.5,10.64 C19.5,12.83 17.71,14.6 15.5,14.6 L12.5,14.6"></path><polyline fill="none" stroke="#000" points="7.25 11.75 9.5 9.5 11.75 11.75"></polyline><path fill="none" stroke="#000" d="M9.5,18 L9.5,9.5"></path></svg>',"credit-card":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect fill="none" stroke="#000" x="1.5" y="4.5" width="17" height="12"></rect><rect x="1" y="7" width="18" height="3"></rect></svg>',"file-edit":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" d="M18.65,1.68 C18.41,1.45 18.109,1.33 17.81,1.33 C17.499,1.33 17.209,1.45 16.98,1.68 L8.92,9.76 L8,12.33 L10.55,11.41 L18.651,3.34 C19.12,2.87 19.12,2.15 18.65,1.68 L18.65,1.68 L18.65,1.68 Z"></path><polyline fill="none" stroke="#000" points="16.5 8.482 16.5 18.5 3.5 18.5 3.5 1.5 14.211 1.5"></polyline></svg>',"git-branch":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.2" cx="7" cy="3" r="2"></circle><circle fill="none" stroke="#000" stroke-width="1.2" cx="14" cy="6" r="2"></circle><circle fill="none" stroke="#000" stroke-width="1.2" cx="7" cy="17" r="2"></circle><path fill="none" stroke="#000" stroke-width="2" d="M14,8 C14,10.41 12.43,10.87 10.56,11.25 C9.09,11.54 7,12.06 7,15 L7,5"></path></svg>',"git-fork":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.2" cx="5.79" cy="2.79" r="1.79"></circle><circle fill="none" stroke="#000" stroke-width="1.2" cx="14.19" cy="2.79" r="1.79"></circle><ellipse fill="none" stroke="#000" stroke-width="1.2" cx="10.03" cy="16.79" rx="1.79" ry="1.79"></ellipse><path fill="none" stroke="#000" stroke-width="2" d="M5.79,4.57 L5.79,6.56 C5.79,9.19 10.03,10.22 10.03,13.31 C10.03,14.86 10.04,14.55 10.04,14.55 C10.04,14.37 10.04,14.86 10.04,13.31 C10.04,10.22 14.2,9.19 14.2,6.56 L14.2,4.57"></path></svg>',"github-alt":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10,0.5 C4.75,0.5 0.5,4.76 0.5,10.01 C0.5,15.26 4.75,19.51 10,19.51 C15.24,19.51 19.5,15.26 19.5,10.01 C19.5,4.76 15.25,0.5 10,0.5 L10,0.5 Z M12.81,17.69 C12.81,17.69 12.81,17.7 12.79,17.69 C12.47,17.75 12.35,17.59 12.35,17.36 L12.35,16.17 C12.35,15.45 12.09,14.92 11.58,14.56 C12.2,14.51 12.77,14.39 13.26,14.21 C13.87,13.98 14.36,13.69 14.74,13.29 C15.42,12.59 15.76,11.55 15.76,10.17 C15.76,9.25 15.45,8.46 14.83,7.8 C15.1,7.08 15.07,6.29 14.75,5.44 L14.51,5.42 C14.34,5.4 14.06,5.46 13.67,5.61 C13.25,5.78 12.79,6.03 12.31,6.35 C11.55,6.16 10.81,6.05 10.09,6.05 C9.36,6.05 8.61,6.15 7.88,6.35 C7.28,5.96 6.75,5.68 6.26,5.54 C6.07,5.47 5.9,5.44 5.78,5.44 L5.42,5.44 C5.06,6.29 5.04,7.08 5.32,7.8 C4.7,8.46 4.4,9.25 4.4,10.17 C4.4,11.94 4.96,13.16 6.08,13.84 C6.53,14.13 7.05,14.32 7.69,14.43 C8.03,14.5 8.32,14.54 8.55,14.55 C8.07,14.89 7.82,15.42 7.82,16.16 L7.82,17.51 C7.8,17.69 7.7,17.8 7.51,17.8 C4.21,16.74 1.82,13.65 1.82,10.01 C1.82,5.5 5.49,1.83 10,1.83 C14.5,1.83 18.17,5.5 18.17,10.01 C18.18,13.53 15.94,16.54 12.81,17.69 L12.81,17.69 Z"></path></svg>',"google-plus":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M12.9,9c0,2.7-0.6,5-3.2,6.3c-3.7,1.8-8.1,0.2-9.4-3.6C-1.1,7.6,1.9,3.3,6.1,3c1.7-0.1,3.2,0.3,4.6,1.3 c0.1,0.1,0.3,0.2,0.4,0.4c-0.5,0.5-1.2,1-1.7,1.6c-1-0.8-2.1-1.1-3.5-0.9C5,5.6,4.2,6,3.6,6.7c-1.3,1.3-1.5,3.4-0.5,5 c1,1.7,2.6,2.3,4.6,1.9c1.4-0.3,2.4-1.2,2.6-2.6H6.9V9H12.9z"></path><polygon points="20,9 20,11 18,11 18,13 16,13 16,11 14,11 14,9 16,9 16,7 18,7 18,9 "></polygon></svg>',"minus-circle":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9.5" cy="9.5" r="9"></circle><line fill="none" stroke="#000" x1="5" y1="9.5" x2="14" y2="9.5"></line></svg>',"more-vertical":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="3" r="2"></circle><circle cx="10" cy="10" r="2"></circle><circle cx="10" cy="17" r="2"></circle></svg>',"paint-bucket":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.21,1 L0,11.21 L8.1,19.31 L18.31,9.1 L10.21,1 L10.21,1 Z M16.89,9.1 L15,11 L1.7,11 L10.21,2.42 L16.89,9.1 Z"></path><path fill="none" stroke="#000" stroke-width="1.1" d="M6.42,2.33 L11.7,7.61"></path><path d="M18.49,12 C18.49,12 20,14.06 20,15.36 C20,16.28 19.24,17 18.49,17 L18.49,17 C17.74,17 17,16.28 17,15.36 C17,14.06 18.49,12 18.49,12 L18.49,12 Z"></path></svg>',"phone-landscape":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" d="M17,5.5 C17.8,5.5 18.5,6.2 18.5,7 L18.5,14 C18.5,14.8 17.8,15.5 17,15.5 L3,15.5 C2.2,15.5 1.5,14.8 1.5,14 L1.5,7 C1.5,6.2 2.2,5.5 3,5.5 L17,5.5 L17,5.5 L17,5.5 Z"></path><circle cx="3.8" cy="10.5" r="0.8"></circle></svg>',"play-circle":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon fill="none" stroke="#000" stroke-width="1.1" points="8.5 7 13.5 10 8.5 13"></polygon><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg>',"plus-circle":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9.5" cy="9.5" r="9"></circle><line fill="none" stroke="#000" x1="9.5" y1="5" x2="9.5" y2="14"></line><line fill="none" stroke="#000" x1="5" y1="9.5" x2="14" y2="9.5"></line></svg>',"quote-right":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17.27,7.79 C17.27,9.45 16.97,10.43 15.99,12.02 C14.98,13.64 13,15.23 11.56,15.97 L11.1,15.08 C12.34,14.2 13.14,13.51 14.02,11.82 C14.27,11.34 14.41,10.92 14.49,10.54 C14.3,10.58 14.09,10.6 13.88,10.6 C12.06,10.6 10.59,9.12 10.59,7.3 C10.59,5.48 12.06,4 13.88,4 C15.39,4 16.67,5.02 17.05,6.42 C17.19,6.82 17.27,7.27 17.27,7.79 L17.27,7.79 Z"></path><path d="M8.68,7.79 C8.68,9.45 8.38,10.43 7.4,12.02 C6.39,13.64 4.41,15.23 2.97,15.97 L2.51,15.08 C3.75,14.2 4.55,13.51 5.43,11.82 C5.68,11.34 5.82,10.92 5.9,10.54 C5.71,10.58 5.5,10.6 5.29,10.6 C3.47,10.6 2,9.12 2,7.3 C2,5.48 3.47,4 5.29,4 C6.8,4 8.08,5.02 8.46,6.42 C8.6,6.82 8.68,7.27 8.68,7.79 L8.68,7.79 Z"></path></svg>',"sign-in":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="7 2 17 2 17 17 7 17 7 16 16 16 16 3 7 3"></polygon><polygon points="9.1 13.4 8.5 12.8 11.28 10 4 10 4 9 11.28 9 8.5 6.2 9.1 5.62 13 9.5"></polygon></svg>',"sign-out":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="13.1 13.4 12.5 12.8 15.28 10 8 10 8 9 15.28 9 12.5 6.2 13.1 5.62 17 9.5"></polygon><polygon points="13 2 3 2 3 17 13 17 13 16 4 16 4 3 13 3"></polygon></svg>',"tablet-landscape":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill="none" stroke="#000" d="M1.5,5 C1.5,4.2 2.2,3.5 3,3.5 L17,3.5 C17.8,3.5 18.5,4.2 18.5,5 L18.5,16 C18.5,16.8 17.8,17.5 17,17.5 L3,17.5 C2.2,17.5 1.5,16.8 1.5,16 L1.5,5 L1.5,5 L1.5,5 Z"></path><circle cx="3.7" cy="10.5" r="0.8"></circle></svg>',"triangle-down":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="5 7 15 7 10 12"></polygon></svg>',"triangle-left":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="12 5 7 10 12 15"></polygon></svg>',"triangle-right":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="8 5 13 10 8 15"></polygon></svg>',"triangle-up":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="5 13 10 8 15 13"></polygon></svg>',"video-camera":'<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><polygon points="18,6 18,14 12,10 "></polygon><rect x="2" y="5" width="12" height="10"></rect></svg>'};return"undefined"!=typeof window&&window.UIkit&&window.UIkit.use(t),t}); |
| 4 | 4 | \ No newline at end of file | ... | ... |
src/main/resources/static/assets/plugins/uk3.0/uikit.min.js
| 1 | -/*! UIkit 3.0.0-beta.25 | http://www.getuikit.com | (c) 2014 - 2017 YOOtheme | MIT License */ | |
| 2 | - | |
| 1 | +/*! UIkit 3.0.0-beta.25 | http://www.getuikit.com | (c) 2014 - 2017 YOOtheme | MIT License */ | |
| 2 | + | |
| 3 | 3 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define("uikit",["jquery"],e):t.UIkit=e(t.jQuery)}(this,function(t){"use strict";function e(){return"complete"===document.readyState||"loading"!==document.readyState&&!Gt.doScroll}function i(t){var i=function(){s(document,"DOMContentLoaded",i),s(window,"load",i),t()};e()?t():(n(document,"DOMContentLoaded",i),n(window,"load",i))}function n(t,e,i,n){e.split(" ").forEach(function(e){return P(t).addEventListener(e,i,n)})}function s(t,e,i,n){e.split(" ").forEach(function(e){return P(t).removeEventListener(e,i,n)})}function o(t,e,i,n){void 0===i&&(i=400),void 0===n&&(n="linear");var s=$(function(o,r){t=Xt(t);for(var a in e)t.css(a,t.css(a));var l=setTimeout(function(){return t.trigger($e||"transitionend")},i);t.one($e||"transitionend",function(e,i){e.promise=s,clearTimeout(l),t.removeClass("uk-transition").css("transition",""),i?r():o()}).addClass("uk-transition").css("transition","all "+i+"ms "+n).css(e)}).then(null,function(){});return s}function r(t,e,i,n,s){void 0===i&&(i=200);var o=$(function(r){function a(){t.css("animation-duration","").removeClass(l+" "+e)}var l=s?"uk-animation-leave":"uk-animation-enter";t=Xt(t),0===e.lastIndexOf("uk-animation-",0)&&(n&&(e+=" uk-animation-"+n),s&&(e+=" uk-animation-reverse")),a(),t.one(ke||"animationend",function(t){t.promise=o,o.then(a),r()}).css("animation-duration",i+"ms").addClass(e).addClass(l),ke||ue(function(){return ee.cancel(t)})});return o}function a(t){return t instanceof Xt}function l(t,e){return!!(t=Xt(t)).is(e)||(A(e)?t.parents(e).length:P(e).contains(t[0]))}function h(t,e,i,n){return(t=Xt(t)).attr(e,function(t,e){return e?e.replace(i,n):e})}function c(t,e){return h(t,"class",new RegExp("(^|\\s)"+e+"(?!\\S)","g"),"")}function u(t,e,i,n){if(void 0===e&&(e=!0),void 0===i&&(i=!1),void 0===n&&(n=!1),A(t)){var s=document.createEvent("Event");s.initEvent(t,e,i),t=s}return n&&he(t,n),t}function d(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var n=P(t).getBoundingClientRect();return n.bottom>=-1*e&&n.right>=-1*i&&n.top<=window.innerHeight+e&&n.left<=window.innerWidth+i}function f(t){var e=(t=P(t)).offsetHeight,i=w(t),n=window.innerHeight,s=n+Math.min(0,i-n),o=Math.max(0,n-(p()-(i+e)));return R((s+window.pageYOffset-i)/((s+(e-(o<n?o:0)))/100)/100)}function p(){return Math.max(Gt.offsetHeight,Gt.scrollHeight)}function g(t,e,i){void 0===i&&(i=0),e=Xt(e);var n=Xt(e).length;return t=(O(t)?t:"next"===t?i+1:"previous"===t?i-1:A(t)?parseInt(t,10):e.index(t))%n,t<0?t+n:t}function m(t){return ie[P(t).tagName.toLowerCase()]}function v(t,e){var i=N(t);return i?i.reduce(function(t,e){return B(e,t)},e):B(t)}function w(t){var e=0;do{e+=t.offsetTop}while(t=t.offsetParent);return e}function b(t,e){return function(i){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,i):t.call(e)}}function y(t,e){return se.call(t,e)}function $(t){if(pe)return new Promise(t);var e=Xt.Deferred();return t(e.resolve,e.reject),e}function x(t){return t.replace(/(?:^|[-_\/])(\w)/g,function(t,e){return e?e.toUpperCase():""})}function k(t){return t.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()}function C(t){return t.replace(oe,T)}function T(t,e){return e?e.toUpperCase():""}function _(t){return"function"==typeof t}function E(t){return null!==t&&"object"==typeof t}function S(t){return E(t)&&Object.getPrototypeOf(t)===Object.prototype}function A(t){return"string"==typeof t}function O(t){return"number"==typeof t}function D(t){return void 0===t}function I(t){return A(t)&&t.match(/^[!>+-]/)}function N(t){return I(t)&&t.split(/(?=\s[!>+-])/g).map(function(t){return t.trim()})}function B(t,e){if(!0===t)return null;try{if(e&&I(t)&&">"!==t[0]){var i=ae[t[0]],n=t.substr(1);e=Xt(e),"closest"===i&&(e=e.parent(),n=n||"*"),t=e[i](n)}else t=Xt(t,e)}catch(t){return null}return t.length?t:null}function P(t){return t&&(a(t)?t[0]:t)}function H(t){return"boolean"==typeof t?t:"true"===t||"1"===t||""===t||"false"!==t&&"0"!==t&&t}function M(t){var e=Number(t);return!isNaN(e)&&e}function j(e){return re(e)?e:A(e)?e.split(",").map(function(e){return t.isNumeric(e)?M(e):H(e.trim())}):[e]}function F(t){if(A(t))if("@"===t[0]){var e="media-"+t.substr(1);t=le[e]||(le[e]=parseFloat(Y(e)))}else if(t.match(/^\(min-width:/))return t;return!(!t||isNaN(t))&&"(min-width: "+t+"px)"}function z(t,e,i){return t===Boolean?H(e):t===Number?M(e):"jQuery"===t?v(e,i):"list"===t?j(e):"media"===t?F(e):t?t(e):e}function L(t){return t?"ms"===t.substr(-2)?parseFloat(t):1e3*parseFloat(t):0}function W(t,e,i){return t.replace(new RegExp(e+"|"+i,"mg"),function(t){return t===e?i:e})}function R(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=1),Math.min(Math.max(t,e),i)}function q(t,e,i){return(window.getComputedStyle(P(t),i)||{})[e]}function Y(t){var e,i=document.documentElement,n=i.appendChild(document.createElement("div"));n.classList.add("var-"+t);try{e=q(n,"content",":before").replace(/^["'](.*)["']$/,"$1"),e=JSON.parse(e)}catch(t){}return i.removeChild(n),e||void 0}function U(t){return $(function(e,i){var n=new Image;n.onerror=i,n.onload=function(){return e(n)},n.src=t})}function V(t,e){var i,n=x(t),s=x(e).toLowerCase(),o=x(e),r=document.body||document.documentElement,a=(i={},i["Webkit"+n]="webkit"+o,i["Moz"+n]=s,i["o"+n]="o"+o+" o"+s,i[t]=s,i);for(t in a)if(void 0!==r.style[t])return a[t]}function X(){Ce.scheduled||(Ce.scheduled=!0,ue(Ce.flush.bind(Ce)))}function G(t){for(var e;e=t.shift();)e()}function Q(t,e){var i=t.indexOf(e);return!!~i&&!!t.splice(i,1)}function J(){}function Z(t,e){return(e.y-t.y)/(e.x-t.x)}function K(t,e){function i(i){s[i]=(Te[i]||De)(t[i],e[i])}var n,s={};if(e.mixins)for(var o=0,r=e.mixins.length;o<r;o++)t=K(t,e.mixins[o]);for(n in t)i(n);for(n in e)y(t,n)||i(n);return s}function tt(e,i,n,s,o,r,a,l){n=ot(n),s=ot(s);var h={element:n,target:s};if(!e)return h;var c=et(e),u=et(i),d=u;return st(d,n,c,-1),st(d,s,u,1),o=rt(o,c.width,c.height),r=rt(r,u.width,u.height),o.x+=r.x,o.y+=r.y,d.left+=o.x,d.top+=o.y,l=et(l||window),a&&t.each(Ie,function(t,e){function i(e,i){var n=d[f]+e+i-2*o[t];if(n>=l[f]&&n+c[r]<=l[p])return d[f]=n,["element","target"].forEach(function(i){h[i][t]=e?h[i][t]===Ie[t][1]?Ie[t][2]:Ie[t][1]:h[i][t]}),!0}var r=e[0],f=e[1],p=e[2];if(!0===a||~a.indexOf(t)){var g=n[t]===f?-c[r]:n[t]===p?c[r]:0,m=s[t]===f?u[r]:s[t]===p?-u[r]:0;if(d[f]<l[f]||d[f]+c[r]>l[p]){var v=c[r]/2,w="center"===s[t]?-u[r]/2:0;"center"===n[t]&&(i(v,w)||i(-v,-w))||i(g,m)}}}),Xt(e).offset({left:d.left,top:d.top}),h}function et(t){var e=nt(t=P(t)),i=e.pageYOffset,n=e.pageXOffset;if(!t.ownerDocument)return{top:i,left:n,height:e.innerHeight,width:e.innerWidth,bottom:i+e.innerHeight,right:n+e.innerWidth};var s=!1;t.offsetHeight||(s=t.style.display,t.style.display="block");var o=t.getBoundingClientRect();return!1!==s&&(t.style.display=s),{height:o.height,width:o.width,top:o.top+i,left:o.left+n,bottom:o.bottom+i,right:o.right+n}}function it(t){return(t=P(t)).getBoundingClientRect().top+nt(t).pageYOffset}function nt(t){return t&&t.ownerDocument?t.ownerDocument.defaultView:window}function st(e,i,n,s){t.each(Ie,function(t,o){var r=o[0],a=o[1],l=o[2];i[t]===l?e[a]+=n[r]*s:"center"===i[t]&&(e[a]+=n[r]*s/2)})}function ot(t){var e=/left|center|right/,i=/top|center|bottom/;return 1===(t=(t||"").split(" ")).length&&(t=e.test(t[0])?t.concat(["center"]):i.test(t[0])?["center"].concat(t):["center","center"]),{x:e.test(t[0])?t[0]:"center",y:i.test(t[1])?t[1]:"center"}}function rt(t,e,i){return t=(t||"").split(" "),{x:t[0]?parseFloat(t[0])*("%"===t[0][t[0].length-1]?e/100:1):0,y:t[1]?parseFloat(t[1])*("%"===t[1][t[1].length-1]?i/100:1):0}}function at(t){switch(t){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";default:return t}}function lt(t,e,i,n){return Math.abs(t-e)>=Math.abs(i-n)?t-e>0?"Left":"Right":i-n>0?"Up":"Down"}function ht(){_e&&clearTimeout(_e),Ee&&clearTimeout(Ee),Se&&clearTimeout(Se),_e=Ee=Se=null,Ne={}}function ct(t){return Be||"touch"===(t.originalEvent||t).pointerType}function ut(t){Jt.on((e={},e["click."+t]=function(t){Fe&&Fe.bgClose&&!t.isDefaultPrevented()&&!l(t.target,Fe.panel)&&Fe.hide()},e["keydown."+t]=function(t){27===t.keyCode&&Fe&&Fe.escClose&&(t.preventDefault(),Fe.hide())},e));var e}function dt(t){Jt.off("click."+t).off("keydown."+t)}function ft(t){t.component("accordion",{mixins:[Le,We],props:{targets:String,active:null,collapsible:Boolean,multiple:Boolean,toggle:String,content:String,transition:String},defaults:{targets:"> *",active:!1,animation:[!0],collapsible:!0,multiple:!1,clsOpen:"uk-open",toggle:"> .uk-accordion-title",content:"> .uk-accordion-content",transition:"ease"},computed:{items:function(){var t=this,e=Xt(this.targets,this.$el);return this._changed=!this._items||e.length!==this._items.length||e.toArray().some(function(e,i){return e!==t._items.get(i)}),this._items=e}},events:[{name:"click",delegate:function(){return this.targets+" "+this.$props.toggle},handler:function(t){t.preventDefault(),this.toggle(this.items.find(this.$props.toggle).index(t.currentTarget))}}],update:function(){var t=this;if(this.items.length&&this._changed){this.items.each(function(e,i){i=Xt(i),t.toggleNow(i.find(t.content),i.hasClass(t.clsOpen))});var e=!1!==this.active&&B(this.items.eq(Number(this.active)))||!this.collapsible&&B(this.items.eq(0));e&&!e.hasClass(this.clsOpen)&&this.toggle(e,!1)}},methods:{toggle:function(t,e){var i=this,n=g(t,this.items),s=this.items.filter("."+this.clsOpen);(t=this.items.eq(n)).add(!this.multiple&&s).each(function(n,o){var r=(o=Xt(o)).is(t),a=r&&!o.hasClass(i.clsOpen);if(a||!r||i.collapsible||!(s.length<2)){o.toggleClass(i.clsOpen,a);var l=o[0]._wrapper?o[0]._wrapper.children().first():o.find(i.content);o[0]._wrapper||(o[0]._wrapper=l.wrap("<div>").parent().attr("hidden",a)),i._toggleImmediate(l,!0),i.toggleElement(o[0]._wrapper,a,e).then(function(){o.hasClass(i.clsOpen)===a&&(a||i._toggleImmediate(l,!1),o[0]._wrapper=null,l.unwrap())})}})}}})}function pt(t){t.component("alert",{mixins:[Le,We],args:"animation",props:{close:String},defaults:{animation:[!0],close:".uk-alert-close",duration:150,hideProps:{opacity:0}},events:[{name:"click",delegate:function(){return this.close},handler:function(t){t.preventDefault(),this.closeAlert()}}],methods:{closeAlert:function(){var t=this;this.toggleElement(this.$el).then(function(){return t.$destroy(!0)})}}})}function gt(t){t.component("cover",{mixins:[Le],props:{automute:Boolean,width:Number,height:Number},defaults:{automute:!0},computed:{el:function(){return this.$el[0]},parent:function(){return this.el.parentNode}},ready:function(){if(this.$el.is("iframe")&&(this.$el.css("pointerEvents","none"),this.automute)){var t=this.$el.attr("src");this.$el.attr("src",t+(~t.indexOf("?")?"&":"?")+"enablejsapi=1&api=1").on("load",function(t){return t.target.contentWindow.postMessage('{"event": "command", "func": "mute", "method":"setVolume", "value":0}',"*")})}},update:{write:function(){0!==this.el.offsetHeight&&this.$el.css({width:"",height:""}).css(ne.cover({width:this.width||this.el.clientWidth,height:this.height||this.el.clientHeight},{width:this.parent.offsetWidth,height:this.parent.offsetHeight}))},events:["load","resize"]},events:{loadedmetadata:function(){this.$emit()}}})}function mt(t){function e(){n||(n=!0,Jt.on("click",function(t){for(var e;i&&i!==e&&!l(t.target,i.$el)&&(!i.toggle||!l(t.target,i.toggle.$el));)e=i,i.hide(!1)}))}var i;t.component("drop",{mixins:[qe,We],args:"pos",props:{mode:"list",toggle:Boolean,boundary:"jQuery",boundaryAlign:Boolean,delayShow:Number,delayHide:Number,clsDrop:String},defaults:{mode:["click","hover"],toggle:"- :first",boundary:window,boundaryAlign:!1,delayShow:0,delayHide:800,clsDrop:!1,hoverIdle:200,animation:["uk-animation-fade"],cls:"uk-open"},init:function(){this.tracker=new J,this.clsDrop=this.clsDrop||"uk-"+this.$options.name,this.clsPos=this.clsDrop,this.$addClass(this.clsDrop)},ready:function(){this.updateAria(this.$el),this.toggle&&(this.toggle=t.toggle(v(this.toggle,this.$el),{target:this.$el,mode:this.mode}))},events:[{name:"click",delegate:function(){return"."+this.clsDrop+"-close"},handler:function(t){t.preventDefault(),this.hide(!1)}},{name:"click",delegate:function(){return'a[href^="#"]'},handler:function(t){if(!t.isDefaultPrevented()){var e=Xt(t.target).attr("href");1===e.length&&t.preventDefault(),1!==e.length&&l(e,this.$el)||this.hide(!1)}}},{name:"toggle",handler:function(t,e){e&&!this.$el.is(e.target)||(t.preventDefault(),this.isToggled()?this.hide(!1):this.show(e,!1))}},{name:be,filter:function(){return~this.mode.indexOf("hover")},handler:function(t){ct(t)||(i&&i!==this&&i.toggle&&~i.toggle.mode.indexOf("hover")&&!l(t.target,i.$el)&&!l(t.target,i.toggle.$el)&&i.hide(!1),t.preventDefault(),this.show(this.toggle))}},{name:"toggleshow",handler:function(t,e){e&&!this.$el.is(e.target)||(t.preventDefault(),this.show(e||this.toggle))}},{name:"togglehide "+ye,handler:function(t,e){ct(t)||e&&!this.$el.is(e.target)||(t.preventDefault(),this.toggle&&~this.toggle.mode.indexOf("hover")&&this.hide())}},{name:"beforeshow",self:!0,handler:function(){this.clearTimers()}},{name:"show",self:!0,handler:function(){this.tracker.init(),this.toggle.$el.addClass(this.cls).attr("aria-expanded","true"),e()}},{name:"beforehide",self:!0,handler:function(){this.clearTimers()}},{name:"hide",handler:function(t){var e=t.target;this.$el.is(e)?(i=this.isActive()?null:i,this.toggle.$el.removeClass(this.cls).attr("aria-expanded","false").blur().find("a, button").blur(),this.tracker.cancel()):i=null===i&&l(e,this.$el)&&this.isToggled()?this:i}}],update:{write:function(){this.isToggled()&&!ee.inProgress(this.$el)&&this.position()},events:["resize"]},methods:{show:function(t,e){var n=this;void 0===e&&(e=!0);var s=function(){n.isToggled()||(n.position(),n.toggleElement(n.$el,!0))},o=function(){if(n.toggle=t||n.toggle,n.clearTimers(),!n.isActive())if(e&&i&&i!==n&&i.isDelaying)n.showTimer=setTimeout(n.show,10);else{if(n.isParentOf(i)){if(!i.hideTimer)return;i.hide(!1)}else if(i&&!n.isChildOf(i)&&!n.isParentOf(i))for(var o;i&&i!==o;)o=i,i.hide(!1);e&&n.delayShow?n.showTimer=setTimeout(s,n.delayShow):s(),i=n}};t&&this.toggle&&!this.toggle.$el.is(t.$el)?(this.$el.one("hide",o),this.hide(!1)):o()},hide:function(t){var e=this;void 0===t&&(t=!0);var i=function(){return e.toggleNow(e.$el,!1)};this.clearTimers(),this.isDelaying=this.tracker.movesTo(this.$el),t&&this.isDelaying?this.hideTimer=setTimeout(this.hide,this.hoverIdle):t&&this.delayHide?this.hideTimer=setTimeout(i,this.delayHide):i()},clearTimers:function(){clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.showTimer=null,this.hideTimer=null,this.isDelaying=!1},isActive:function(){return i===this},isChildOf:function(t){return t&&t!==this&&l(this.$el,t.$el)},isParentOf:function(t){return t&&t!==this&&l(t.$el,this.$el)},position:function(){c(this.$el,this.clsDrop+"-(stack|boundary)").css({top:"",left:""}),this.$el.show().toggleClass(this.clsDrop+"-boundary",this.boundaryAlign);var t=et(this.boundary),e=this.boundaryAlign?t:et(this.toggle.$el);if("justify"===this.align){var i="y"===this.getAxis()?"width":"height";this.$el.css(i,e[i])}else this.$el.outerWidth()>Math.max(t.right-e.left,e.right-t.left)&&(this.$addClass(this.clsDrop+"-stack"),this.$el.trigger("stack",[this]));this.positionAt(this.$el,this.boundaryAlign?this.boundary:this.toggle.$el,this.boundary),this.$el[0].style.display=""}}}),t.drop.getActive=function(){return i};var n}function vt(t){t.component("dropdown",t.components.drop.extend({name:"dropdown"}))}function wt(t){t.component("form-custom",{mixins:[Le],args:"target",props:{target:Boolean},defaults:{target:!1},computed:{input:function(){return this.$el.find(":input:first")},state:function(){return this.input.next()},target:function(){return this.$props.target&&v(!0===this.$props.target?"> :input:first + :first":this.$props.target,this.$el)}},connected:function(){this.input.trigger("change")},events:[{name:"focusin focusout mouseenter mouseleave",delegate:":input:first",handler:function(t){var e=t.type;this.state.toggleClass("uk-"+(~e.indexOf("focus")?"focus":"hover"),~["focusin","mouseenter"].indexOf(e))}},{name:"change",handler:function(){this.target&&this.target[this.target.is(":input")?"val":"text"](this.input[0].files&&this.input[0].files[0]?this.input[0].files[0].name:this.input.is("select")?this.input.find("option:selected").text():this.input.val())}}]})}function bt(t){t.component("gif",{update:{read:function(){var t=d(this.$el);!this.isInView&&t&&(this.$el[0].src=this.$el[0].src),this.isInView=t},events:["scroll","load","resize"]}})}function yt(t){t.component("grid",t.components.margin.extend({mixins:[Le],name:"grid",defaults:{margin:"uk-grid-margin",clsStack:"uk-grid-stack"},update:{write:function(){this.$toggleClass(this.clsStack,this.stacks)},events:["load","resize"]}}))}function $t(t){t.component("height-match",{args:"target",props:{target:String,row:Boolean},defaults:{target:"> *",row:!0},computed:{elements:function(){return Xt(this.target,this.$el)}},update:{read:function(){var t=this,e=!1;this.elements.css("minHeight",""),this.rows=this.row?this.elements.toArray().reduce(function(t,i){return e!==i.offsetTop?t.push([i]):t[t.length-1].push(i),e=i.offsetTop,t},[]).map(function(e){return t.match(Xt(e))}):[this.match(this.elements)]},write:function(){this.rows.forEach(function(t){var e=t.height,i=t.elements;return i&&i.each(function(t,i){return i.style.minHeight=e+"px"})})},events:["load","resize"]},methods:{match:function(t){if(t.length<2)return{};var e=0,i=[];return t=t.each(function(t,n){var s,o,r;0===n.offsetHeight&&(o=(s=Xt(n)).attr("style")||null,r=s.attr("hidden")||null,s.attr({style:o+";display:block !important;",hidden:null})),e=Math.max(e,n.offsetHeight),i.push(n.offsetHeight),s&&s.attr({style:o,hidden:r})}).filter(function(t){return i[t]<e}),{height:e,elements:t}}}})}function xt(e){e.component("height-viewport",{props:{expand:Boolean,offsetTop:Boolean,offsetBottom:Boolean},defaults:{expand:!1,offsetTop:!1,offsetBottom:!1},update:{write:function(){this.$el.css("boxSizing","border-box");var e,i=window.innerHeight,n=0;if(this.expand){this.$el.css({height:"",minHeight:""});var s=i-document.documentElement.offsetHeight;s>0&&this.$el.css("min-height",e=this.$el.outerHeight()+s)}else{var o=it(this.$el);if(o<i&&this.offsetTop&&(n+=o),!0===this.offsetBottom)n+=this.$el.next().outerHeight()||0;else if(t.isNumeric(this.offsetBottom))n+=i/100*this.offsetBottom;else if(this.offsetBottom&&"px"===this.offsetBottom.substr(-2))n+=parseFloat(this.offsetBottom);else if(A(this.offsetBottom)){var r=v(this.offsetBottom,this.$el);n+=r&&r.outerHeight()||0}this.$el.css("min-height",e=n?"calc(100vh - "+n+"px)":"100vh")}this.$el.height(""),e&&i-n>=this.$el.outerHeight()&&this.$el.css("height",e)},events:["load","resize"]}})}function kt(t){i(function(){if(ge){var e="uk-hover";Zt.on("tap",function(t){var i=t.target;return Xt("."+e).filter(function(t,e){return!l(i,e)}).removeClass(e)}),Object.defineProperty(t,"hoverSelector",{set:function(t){Zt.on("tap",t,function(t){return t.currentTarget.classList.add(e)})}}),t.hoverSelector=".uk-animation-toggle, .uk-transition-toggle, [uk-hover]"}})}function Ct(t){function e(e,i){t.component(e,t.components.icon.extend({name:e,mixins:i?[i]:[],defaults:{icon:e}}))}var i={},n={spinner:oi,totop:ri,marker:Ve,"close-icon":Ye,"close-large":Ue,"navbar-toggle-icon":Xe,"overlay-icon":Ge,"pagination-next":Qe,"pagination-previous":Je,"search-icon":Ze,"search-large":Ke,"search-navbar":ti,"slidenav-next":ei,"slidenav-next-large":ii,"slidenav-previous":ni,"slidenav-previous-large":si};t.component("icon",t.components.svg.extend({attrs:["icon","ratio"],mixins:[Le],name:"icon",args:"icon",props:["icon"],defaults:{exclude:["id","style","class","src","icon"]},init:function(){this.$addClass("uk-icon"),Kt&&(this.icon=W(W(this.icon,"left","right"),"previous","next"))},update:{read:function(){if(this.delay){var t=this.getIcon();t&&this.delay(t)}},events:["load"]},methods:{getSvg:function(){var t=this,e=this.getIcon();return e?$.resolve(e):"complete"!==document.readyState?$(function(e){t.delay=e}):$.reject("Icon not found.")},getIcon:function(){return n[this.icon]?(i[this.icon]||(i[this.icon]=this.parse(n[this.icon])),i[this.icon]):null}}})),["marker","navbar-toggle-icon","overlay-icon","pagination-previous","pagination-next","totop"].forEach(function(t){return e(t)}),["slidenav-previous","slidenav-next"].forEach(function(t){return e(t,{init:function(){this.$addClass("uk-slidenav"),this.$hasClass("uk-slidenav-large")&&(this.icon+="-large")}})}),e("search-icon",{init:function(){this.$hasClass("uk-search-icon")&&this.$el.parents(".uk-search-large").length?this.icon="search-large":this.$el.parents(".uk-search-navbar").length&&(this.icon="search-navbar")}}),e("close",{init:function(){this.icon="close-"+(this.$hasClass("uk-close-large")?"large":"icon")}}),e("spinner",{connected:function(){var t=this;this.height=this.width=this.$el.width(),this.svg.then(function(e){var i=Xt(e).find("circle"),n=Math.floor(t.width/2);e.setAttribute("viewBox","0 0 "+t.width+" "+t.width),i.attr({cx:n,cy:n,r:n-parseFloat(i.css("stroke-width")||0)})})}}),t.icon.add=function(t){return he(n,t)}}function Tt(t){t.component("margin",{props:{margin:String,firstColumn:Boolean},defaults:{margin:"uk-margin-small-top",firstColumn:"uk-first-column"},computed:{items:function(){return this.$el[0].children}},update:{read:function(){var t=this;if(this.items.length&&0!==this.$el[0].offsetHeight){this.stacks=!0;for(var e=[[]],i=0;i<this.items.length;i++){var n=t.items[i],s=n.getBoundingClientRect();if(s.height)for(var o=e.length-1;o>=0;o--){var r=e[o];if(!r[0]){r.push(n);break}var a=r[0].getBoundingClientRect();if(s.top>=a.bottom){e.push([n]);break}if(s.bottom>a.top){if(t.stacks=!1,s.left<a.left&&!Kt){r.unshift(n);break}r.push(n);break}if(0===o){e.unshift([n]);break}}}this.rows=e}else this.rows=!1},write:function(){var t=this;this.rows&&this.rows.forEach(function(e,i){return e.forEach(function(e,n){t.$toggleClass(e,t.margin,0!==i),t.$toggleClass(e,t.firstColumn,0===n)})})},events:["load","resize"]}})}function _t(t){t.component("modal",{mixins:[Re],props:{center:Boolean},defaults:{center:!1,clsPage:"uk-modal-page",clsPanel:"uk-modal-dialog",selClose:".uk-modal-close, .uk-modal-close-default, .uk-modal-close-outside, .uk-modal-close-full"},update:{write:function(){"block"===this.$el.css("display")&&this.center&&this.$el.removeClass("uk-flex uk-flex-center uk-flex-middle").css("display","block").toggleClass("uk-flex uk-flex-center uk-flex-middle",window.innerHeight>this.panel.outerHeight(!0)).css("display",this.$el.hasClass("uk-flex")?"":"block")},events:["resize"]},events:[{name:"beforeshow",self:!0,handler:function(){this.$el.css("display","block").height()}},{name:"hidden",self:!0,handler:function(){this.$el.css("display","").removeClass("uk-flex uk-flex-center uk-flex-middle")}}]}),t.component("overflow-auto",{mixins:[Le],computed:{panel:function(){return this.$el.closest(".uk-modal-dialog")}},connected:function(){this.$el.css("min-height",150)},update:{write:function(){var t=this.$el.css("max-height");this.$el.css("max-height",150).css("max-height",Math.max(150,150-(this.panel.outerHeight(!0)-window.innerHeight))),t!==this.$el.css("max-height")&&this.$el.trigger("resize")},events:["load","resize"]}}),t.modal.dialog=function(e,i){var n=t.modal('<div class="uk-modal">\n <div class="uk-modal-dialog">'+e+"</div>\n </div>",i);return n.$el.on("hidden",function(t){t.target===t.currentTarget&&n.$destroy(!0)}),n.show(),n},t.modal.alert=function(e,i){return i=he({bgClose:!1,escClose:!1,labels:t.modal.labels},i),$(function(n){return t.modal.dialog('\n <div class="uk-modal-body">'+(A(e)?e:Xt(e).html())+'</div>\n <div class="uk-modal-footer uk-text-right">\n <button class="uk-button uk-button-primary uk-modal-close" autofocus>'+i.labels.ok+"</button>\n </div>\n ",i).$el.on("hide",n)})},t.modal.confirm=function(e,i){return i=he({bgClose:!1,escClose:!1,labels:t.modal.labels},i),$(function(n,s){return t.modal.dialog('\n <div class="uk-modal-body">'+(A(e)?e:Xt(e).html())+'</div>\n <div class="uk-modal-footer uk-text-right">\n <button class="uk-button uk-button-default uk-modal-close">'+i.labels.cancel+'</button>\n <button class="uk-button uk-button-primary uk-modal-close" autofocus>'+i.labels.ok+"</button>\n </div>\n ",i).$el.on("click",".uk-modal-footer button",function(t){return 0===Xt(t.target).index()?s():n()})})},t.modal.prompt=function(e,i,n){return n=he({bgClose:!1,escClose:!1,labels:t.modal.labels},n),$(function(s){var o=!1,r=t.modal.dialog('\n <form class="uk-form-stacked">\n <div class="uk-modal-body">\n <label>'+(A(e)?e:Xt(e).html())+'</label>\n <input class="uk-input" type="text" autofocus>\n </div>\n <div class="uk-modal-footer uk-text-right">\n <button class="uk-button uk-button-default uk-modal-close" type="button">'+n.labels.cancel+'</button>\n <button class="uk-button uk-button-primary" type="submit">'+n.labels.ok+"</button>\n </div>\n </form>\n ",n),a=r.$el.find("input").val(i);r.$el.on("submit","form",function(t){t.preventDefault(),s(a.val()),o=!0,r.hide()}).on("hide",function(){o||s(null)})})},t.modal.labels={ok:"Ok",cancel:"Cancel"}}function Et(t){t.component("nav",t.components.accordion.extend({name:"nav",defaults:{targets:"> .uk-parent",toggle:"> a",content:"ul:first"}}))}function St(t){t.component("navbar",{mixins:[Le],props:{dropdown:String,mode:"list",align:String,offset:Number,boundary:Boolean,boundaryAlign:Boolean,clsDrop:String,delayShow:Number,delayHide:Number,dropbar:Boolean,dropbarMode:String,dropbarAnchor:"jQuery",duration:Number},defaults:{dropdown:".uk-navbar-nav > li",align:Kt?"right":"left",clsDrop:"uk-navbar-dropdown",mode:void 0,offset:void 0,delayShow:void 0,delayHide:void 0,boundaryAlign:void 0,flip:"x",boundary:!0,dropbar:!1,dropbarMode:"slide",dropbarAnchor:!1,duration:200},computed:{boundary:function(){return!0===this.$props.boundary||this.boundaryAlign?this.$el:this.$props.boundary},pos:function(){return"bottom-"+this.align}},ready:function(){this.dropbar&&t.navbarDropbar(v(this.dropbar,this.$el)||Xt("<div></div>").insertAfter(this.dropbarAnchor||this.$el),{clsDrop:this.clsDrop,mode:this.dropbarMode,duration:this.duration,navbar:this})},update:function(){t.drop(Xt(this.dropdown+" ."+this.clsDrop,this.$el),he({},this.$props,{boundary:this.boundary,pos:this.pos}))},events:[{name:be,delegate:function(){return this.dropdown},handler:function(t){var e=t.currentTarget,i=this.getActive();i&&i.toggle&&!l(i.toggle.$el,e)&&!i.tracker.movesTo(i.$el)&&i.hide(!1)}}],methods:{getActive:function(){var e=t.drop.getActive();return e&&"click"!==e.mode&&l(e.toggle.$el,this.$el)&&e}}}),t.component("navbar-dropbar",{mixins:[Le],defaults:{clsDrop:"",mode:"slide",navbar:null,duration:200},init:function(){"slide"===this.mode&&this.$addClass("uk-navbar-dropbar-slide")},events:[{name:"beforeshow",el:function(){return this.navbar.$el},handler:function(t,e){var i=e.$el;if("bottom"===e.dir&&!l(i,this.$el))return i.appendTo(this.$el),e.show(),!1}},{name:"mouseleave",handler:function(){var t=this.navbar.getActive();t&&!this.$el.is(":hover")&&t.hide()}},{name:"beforeshow",handler:function(t,e){var i=e.$el;this.clsDrop&&i.addClass(this.clsDrop+"-dropbar"),this.transitionTo(i.outerHeight(!0))}},{name:"beforehide",handler:function(t,e){var i=e.$el,n=this.navbar.getActive();if(this.$el.is(":hover")&&n&&n.$el.is(i))return!1}},{name:"hide",handler:function(t,e){var i=e.$el,n=this.navbar.getActive();(!n||n&&n.$el.is(i))&&this.transitionTo(0)}}],methods:{transitionTo:function(t){var e=this;return this.$el.height(this.$el[0].offsetHeight?this.$el.height():0),te.cancel(this.$el).then(function(){return te.start(e.$el,{height:t},e.duration)})}}})}function At(t){t.component("offcanvas",{mixins:[Re],args:"mode",props:{content:String,mode:String,flip:Boolean,overlay:Boolean},defaults:{content:".uk-offcanvas-content:first",mode:"slide",flip:!1,overlay:!1,clsPage:"uk-offcanvas-page",clsContainer:"uk-offcanvas-container",clsPanel:"uk-offcanvas-bar",clsFlip:"uk-offcanvas-flip",clsContent:"uk-offcanvas-content",clsContentAnimation:"uk-offcanvas-content-animation",clsSidebarAnimation:"uk-offcanvas-bar-animation",clsMode:"uk-offcanvas",clsOverlay:"uk-offcanvas-overlay",selClose:".uk-offcanvas-close"},computed:{content:function(){return Xt(v(this.$props.content,this.$el))},clsFlip:function(){return this.flip?this.$props.clsFlip:""},clsOverlay:function(){return this.overlay?this.$props.clsOverlay:""},clsMode:function(){return this.$props.clsMode+"-"+this.mode},clsSidebarAnimation:function(){return"none"===this.mode||"reveal"===this.mode?"":this.$props.clsSidebarAnimation},clsContentAnimation:function(){return"push"!==this.mode&&"reveal"!==this.mode?"":this.$props.clsContentAnimation},transitionElement:function(){return"reveal"===this.mode?this.panel.parent():this.panel}},update:{write:function(){this.isToggled()&&((this.overlay||this.clsContentAnimation)&&this.content.width(window.innerWidth-this.scrollbarWidth),this.overlay&&(this.content.height(window.innerHeight),ze&&this.content.scrollTop(ze.y)))},events:["resize"]},events:[{name:"beforeshow",self:!0,handler:function(){ze=ze||{x:window.pageXOffset,y:window.pageYOffset},"reveal"!==this.mode||this.panel.parent().hasClass(this.clsMode)||this.panel.wrap("<div>").parent().addClass(this.clsMode),Zt.css("overflow-y",(!this.clsContentAnimation||this.flip)&&this.scrollbarWidth&&this.overlay?"scroll":""),this.body.addClass(this.clsContainer+" "+this.clsFlip+" "+this.clsOverlay).height(),this.content.addClass(this.clsContentAnimation),this.panel.addClass(this.clsSidebarAnimation+" "+("reveal"!==this.mode?this.clsMode:"")),this.$el.addClass(this.clsOverlay).css("display","block").height()}},{name:"beforehide",self:!0,handler:function(){this.content.removeClass(this.clsContentAnimation),("none"===this.mode||this.getActive()&&this.getActive()!==this)&&this.panel.trigger($e)}},{name:"hidden",self:!0,handler:function(){"reveal"===this.mode&&this.panel.unwrap(),this.overlay||(ze={x:window.pageXOffset,y:window.pageYOffset}),this.panel.removeClass(this.clsSidebarAnimation+" "+this.clsMode),this.$el.removeClass(this.clsOverlay).css("display",""),this.body.removeClass(this.clsContainer+" "+this.clsFlip+" "+this.clsOverlay).scrollTop(ze.y),Zt.css("overflow-y",""),this.content.width("").height(""),window.scrollTo(ze.x,ze.y),ze=null}},{name:"swipeLeft swipeRight",handler:function(t){this.isToggled()&&ct(t)&&("swipeLeft"===t.type&&!this.flip||"swipeRight"===t.type&&this.flip)&&this.hide()}}]})}function Ot(t){t.component("responsive",{props:["width","height"],init:function(){this.$addClass("uk-responsive-width")},update:{read:function(){this.dim=!!(this.$el.is(":visible")&&this.width&&this.height)&&{width:this.$el.parent().width(),height:this.height}},write:function(){this.dim&&this.$el.height(ne.contain({height:this.height,width:this.width},this.dim).height)},events:["load","resize"]}})}function Dt(t){t.component("scroll",{props:{duration:Number,easing:String,offset:Number},defaults:{duration:1e3,easing:"easeOutExpo",offset:0},methods:{scrollToElement:function(t){var e=this,i=it(Xt(t))-this.offset,n=p(),s=window.innerHeight;i+s>n&&(i=n-s),Xt("html,body").stop().animate({scrollTop:Math.round(i)},this.duration,this.easing).promise().then(function(){return e.$el.trigger("scrolled",[e])})}},events:{click:function(t){t.isDefaultPrevented()||(t.preventDefault(),this.scrollToElement(Xt(this.$el[0].hash).length?this.$el[0].hash:"body"))}}}),Xt.easing.easeOutExpo=Xt.easing.easeOutExpo||function(t,e,i,n,s){return e===s?i+n:n*(1-Math.pow(2,-10*e/s))+i}}function It(t){t.component("scrollspy",{args:"cls",props:{cls:"list",target:String,hidden:Boolean,offsetTop:Number,offsetLeft:Number,repeat:Boolean,delay:Number},defaults:{cls:["uk-scrollspy-inview"],target:!1,hidden:!0,offsetTop:0,offsetLeft:0,repeat:!1,delay:0,inViewClass:"uk-scrollspy-inview"},computed:{elements:function(){return this.target&&Xt(this.target,this.$el)||this.$el}},update:[{write:function(){this.hidden&&this.elements.filter(":not(."+this.inViewClass+")").css("visibility","hidden")}},{read:function(){var t=this;this.elements.each(function(e,i){if(!i._scrollspy){var n=Xt(i).attr("uk-scrollspy-class");i._scrollspy={toggles:n&&n.split(",")||t.cls}}i._scrollspy.show=d(i,t.offsetTop,t.offsetLeft)})},write:function(){var t=this,e=1===this.elements.length?1:0;this.elements.each(function(i,n){var s=Xt(n),o=n._scrollspy,r=o.toggles[i]||o.toggles[0];if(o.show){if(!o.inview&&!o.timer){var a=function(){s.css("visibility","").addClass(t.inViewClass).toggleClass(r).trigger("inview"),t.$update(),o.inview=!0,delete o.timer};t.delay&&e?o.timer=setTimeout(a,t.delay*e):a(),e++}}else o.inview&&t.repeat&&(o.timer&&(clearTimeout(o.timer),delete o.timer),s.removeClass(t.inViewClass).toggleClass(r).css("visibility",t.hidden?"hidden":"").trigger("outview"),t.$update(),o.inview=!1)})},events:["scroll","load","resize"]}]})}function Nt(t){t.component("scrollspy-nav",{props:{cls:String,closest:String,scroll:Boolean,overflow:Boolean,offset:Number},defaults:{cls:"uk-active",closest:!1,scroll:!1,overflow:!0,offset:0},computed:{links:function(){return this.$el.find('a[href^="#"]').filter(function(t,e){return e.hash})},elements:function(){return this.closest?this.links.closest(this.closest):this.links},targets:function(){return Xt(this.links.toArray().map(function(t){return t.hash}).join(","))}},update:[{read:function(){this.scroll&&t.scroll(this.links,{offset:this.offset||0})}},{read:function(){var t=this,e=window.pageYOffset+this.offset,i=p()-window.innerHeight+this.offset;this.active=!1,this.targets.each(function(n,s){var o=it(s=Xt(s)),r=n+1===t.targets.length;if(!t.overflow&&(0===n&&o>e||r&&o+s[0].offsetTop<e))return!1;if(r||!(it(t.targets.eq(n+1))<=e)){if(e>=i)for(var a=t.targets.length-1;a>n;a--)if(d(t.targets.eq(a))){s=t.targets.eq(a);break}return!(t.active=B(t.links.filter('[href="#'+s.attr("id")+'"]')))}})},write:function(){this.links.blur(),this.elements.removeClass(this.cls),this.active&&this.$el.trigger("active",[this.active,(this.closest?this.active.closest(this.closest):this.active).addClass(this.cls)])},events:["scroll","load","resize"]}]})}function Bt(e){e.component("sticky",{mixins:[Le],attrs:!0,props:{top:null,bottom:Boolean,offset:Number,animation:String,clsActive:String,clsInactive:String,clsFixed:String,clsBelow:String,widthElement:"jQuery",showOnUp:Boolean,media:"media",target:Number},defaults:{top:0,bottom:!1,offset:0,animation:"",clsActive:"uk-active",clsInactive:"",clsFixed:"uk-sticky-fixed",clsBelow:"uk-sticky-below",widthElement:!1,showOnUp:!1,media:!1,target:!1},connected:function(){this.placeholder=Xt('<div class="uk-sticky-placeholder"></div>'),this.widthElement=this.$props.widthElement||this.placeholder,this.isActive||this.$addClass(this.clsInactive)},disconnected:function(){this.isActive&&(this.isActive=!1,this.hide(),this.$removeClass(this.clsInactive)),this.placeholder.remove(),this.placeholder=null,this.widthElement=null},ready:function(){var t=this;if(this.target&&location.hash&&window.pageYOffset>0){var e=v(location.hash);e&&ue(function(){var i=it(e),n=it(t.$el),s=t.$el[0].offsetHeight;n+s>=i&&n<=i+e[0].offsetHeight&&window.scrollTo(0,i-s-t.target-t.offset)})}},update:[{write:function(){var e,i=this,n=(this.isActive?this.placeholder:this.$el)[0].offsetHeight;this.placeholder.css("height","absolute"!==this.$el.css("position")?n:"").css(this.$el.css(["marginTop","marginBottom","marginLeft","marginRight"])),document.documentElement.contains(this.placeholder[0])||this.placeholder.insertAfter(this.$el).attr("hidden",!0),this.width=this.widthElement.attr("hidden",null)[0].offsetWidth,this.widthElement.attr("hidden",!this.isActive),this.topOffset=it(this.isActive?this.placeholder:this.$el),this.bottomOffset=this.topOffset+n,["top","bottom"].forEach(function(n){i[n]=i.$props[n],i[n]&&(t.isNumeric(i[n])?i[n]=i[n+"Offset"]+parseFloat(i[n]):A(i[n])&&i[n].match(/^-?\d+vh$/)?i[n]=window.innerHeight*parseFloat(i[n])/100:(e=!0===i[n]?i.$el.parent():v(i[n],i.$el))&&(i[n]=it(e)+e[0].offsetHeight))}),this.top=Math.max(parseFloat(this.top),this.topOffset)-this.offset,this.bottom=this.bottom&&this.bottom-n,this.inactive=this.media&&!window.matchMedia(this.media).matches,this.isActive&&this.update()},events:["load","resize"]},{read:function(){this.offsetTop=it(this.$el),this.scroll=window.pageYOffset,this.visible=this.$el.is(":visible")},write:function(t){var e=this;void 0===t&&(t={});var i=t.dir,n=this.scroll;if(!(n<0||!this.visible||this.disabled||this.showOnUp&&!i))if(this.inactive||n<this.top||this.showOnUp&&(n<=this.top||"down"===i||"up"===i&&!this.isActive&&n<=this.bottomOffset)){if(!this.isActive)return;this.isActive=!1,this.animation&&n>this.topOffset?ee.cancel(this.$el).then(function(){return ee.out(e.$el,e.animation).then(function(){return e.hide()})}):this.hide()}else this.isActive?this.update():this.animation?ee.cancel(this.$el).then(function(){e.show(),ee.in(e.$el,e.animation)}):this.show()},events:["scroll"]}],methods:{show:function(){this.isActive=!0,this.update(),this.$el.trigger("active"),this.placeholder.attr("hidden",null)},hide:function(){this.$addClass(this.clsInactive),this.$removeClass(this.clsFixed,this.clsActive,this.clsBelow),this.$el.css({position:"",top:"",width:""}).trigger("inactive"),this.placeholder.attr("hidden",!0)},update:function(){var t=Math.max(0,this.offset),e=this.scroll>this.top;this.bottom&&this.scroll>this.bottom-this.offset&&(t=this.bottom-this.scroll),this.$el.css({position:"fixed",top:t+"px",width:this.width}),this.$addClass(this.clsFixed),this.$toggleClass(this.clsActive,e),this.$toggleClass(this.clsInactive,!e),this.$toggleClass(this.clsBelow,this.scroll>this.bottomOffset)}}})}function Pt(e){e.component("svg",{attrs:!0,props:{id:String,icon:String,src:String,style:String,width:Number,height:Number,ratio:Number,class:String},defaults:{ratio:1,id:!1,exclude:["src"],class:""},init:function(){this.class+=" uk-svg"},connected:function(){var t=this;if(!this.icon&&this.src&&~this.src.indexOf("#")){var e=this.src.split("#");e.length>1&&(this.src=e[0],this.icon=e[1])}this.width=this.$props.width,this.height=this.$props.height,this.svg=this.getSvg().then(function(e){return $(function(i,n){return Ce.mutate(function(){var s,o;if(e){if(t.icon)if(s=e.getElementById(t.icon)){var r=s.outerHTML;if(!r){var a=document.createElement("div");a.appendChild(s.cloneNode(!0)),r=a.innerHTML}r=r.replace(/<symbol/g,"<svg"+(~r.indexOf("xmlns")?"":' xmlns="http://www.w3.org/2000/svg"')).replace(/symbol>/g,"svg>"),o=li.parseFromString(r,"image/svg+xml").documentElement}else e.querySelector("symbol")||(o=e.documentElement.cloneNode(!0));else o=e.documentElement.cloneNode(!0);if(o){var l=o.getAttribute("viewBox");l&&(l=l.split(" "),t.width=t.width||l[2],t.height=t.height||l[3]),t.width*=t.ratio,t.height*=t.ratio;for(var h in t.$options.props)t[h]&&!~t.exclude.indexOf(h)&&o.setAttribute(h,t[h]);t.id||o.removeAttribute("id"),t.width&&!t.height&&o.removeAttribute("height"),t.height&&!t.width&&o.removeAttribute("width");var c=t.$el[0];m(c)||"CANVAS"===c.tagName?(t.$el.attr({hidden:!0,id:null}),c.nextSibling?c.parentNode.insertBefore(o,c.nextSibling):c.parentNode.appendChild(o)):c.appendChild(o),i(o)}else n("SVG not found.")}else n("SVG not found.")})})}).then(null,function(){})},disconnected:function(){m(this.$el)&&this.$el.attr({hidden:null,id:this.id||null}),this.svg&&(this.svg.then(function(t){return t&&t.parentNode&&t.parentNode.removeChild(t)}),this.svg=null)},methods:{getSvg:function(){var e=this;return this.src?ai[this.src]?ai[this.src]:(ai[this.src]=$(function(i,n){0===e.src.lastIndexOf("data:",0)?i(e.parse(decodeURIComponent(e.src.split(",")[1]))):t.ajax(e.src,{dataType:"html"}).then(function(t){i(e.parse(t))},function(){n("SVG not found.")})}),ai[this.src]):$.reject()},parse:function(t){var e=li.parseFromString(t,"image/svg+xml");return e.documentElement&&"svg"===e.documentElement.nodeName?e:null}}})}function Ht(t){t.component("switcher",{mixins:[We],args:"connect",props:{connect:String,toggle:String,active:Number,swiping:Boolean},defaults:{connect:!1,toggle:" > *",active:0,swiping:!0,cls:"uk-active",clsContainer:"uk-switcher",attrItem:"uk-switcher-item",queued:!0},computed:{connects:function(){return v(this.connect,this.$el)||Xt(this.$el.next("."+this.clsContainer))},toggles:function(){return Xt(this.toggle,this.$el)}},events:[{name:"click",delegate:function(){return this.toggle+":not(.uk-disabled)"},handler:function(t){t.preventDefault(),this.show(t.currentTarget)}},{name:"click",el:function(){return this.connects},delegate:function(){return"["+this.attrItem+"],[data-"+this.attrItem+"]"},handler:function(t){t.preventDefault(),this.show(Xt(t.currentTarget)[t.currentTarget.hasAttribute(this.attrItem)?"attr":"data"](this.attrItem))}},{name:"swipeRight swipeLeft",filter:function(){return this.swiping},el:function(){return this.connects},handler:function(t){ct(t)&&(t.preventDefault(),window.getSelection().toString()||this.show("swipeLeft"===t.type?"next":"previous"))}}],update:function(){this.updateAria(this.connects.children()),this.show(B(this.toggles.filter("."+this.cls+":first"))||B(this.toggles.eq(this.active))||this.toggles.first())},methods:{show:function(t){for(var e,i=this,n=this.toggles.length,s=this.connects.children("."+this.cls).index(),o=s>=0,r=g(t,this.toggles,s),a="previous"===t?-1:1,l=0;l<n;l++,r=(r+a+n)%n)if(!i.toggles.eq(r).is(".uk-disabled, [disabled]")){e=i.toggles.eq(r);break}!e||s>=0&&e.hasClass(this.cls)||s===r||(this.toggles.removeClass(this.cls).attr("aria-expanded",!1),e.addClass(this.cls).attr("aria-expanded",!0),o?this.toggleElement(this.connects.children(":nth-child("+(s+1)+"),:nth-child("+(r+1)+")")):this.toggleNow(this.connects.children(":nth-child("+(r+1)+")")))}}})}function Mt(t){t.component("tab",t.components.switcher.extend({mixins:[Le],name:"tab",props:{media:"media"},defaults:{media:960,attrItem:"uk-tab-item"},init:function(){var e=this.$hasClass("uk-tab-left")&&"uk-tab-left"||this.$hasClass("uk-tab-right")&&"uk-tab-right";e&&t.toggle(this.$el,{cls:e,mode:"media",media:this.media})}}))}function jt(e){e.component("toggle",{mixins:[e.mixin.togglable],args:"target",props:{href:String,target:null,mode:"list",media:"media"},defaults:{href:!1,target:!1,mode:"click",queued:!0,media:!1},computed:{target:function(){return v(this.$props.target||this.href,this.$el)||this.$el}},events:[{name:be+" "+ye,filter:function(){return~this.mode.indexOf("hover")},handler:function(t){ct(t)||this.toggle("toggle"+(t.type===be?"show":"hide"))}},{name:"click",filter:function(){return~this.mode.indexOf("click")||ge},handler:function(t){if(ct(t)||~this.mode.indexOf("click")){var e=Xt(t.target).closest("a[href]");(Xt(t.target).closest('a[href="#"], button').length||e.length&&(this.cls||!this.target.is(":visible")||"#"===e.attr("href")[0]&&this.target.is(e.attr("href"))))&&t.preventDefault(),this.toggle()}}}],update:{write:function(){if(~this.mode.indexOf("media")&&this.media){var t=this.isToggled(this.target);(window.matchMedia(this.media).matches?!t:t)&&this.toggle()}},events:["load","resize"]},methods:{toggle:function(e){var i=t.Event(e||"toggle");this.target.triggerHandler(i,[this]),i.isDefaultPrevented()||this.toggleElement(this.target)}}})}function Ft(t){t.component("leader",{mixins:[Le],props:{fill:String,media:"media"},defaults:{fill:"",media:!1,clsWrapper:"uk-leader-fill",clsHide:"uk-leader-hide",attrFill:"data-fill"},computed:{fill:function(){return this.$props.fill||Y("leader-fill")}},connected:function(){this.wrapper=this.$el.wrapInner('<span class="'+this.clsWrapper+'">').children().first()},disconnected:function(){this.wrapper.contents().unwrap()},update:[{read:function(){var t=this._width;this._width=Math.floor(this.$el[0].offsetWidth/2),this._changed=t!==this._width,this._hide=this.media&&!window.matchMedia(this.media).matches},write:function(){this.wrapper.toggleClass(this.clsHide,this._hide),this._changed&&this.wrapper.attr(this.attrFill,new Array(this._width).join(this.fill))},events:["load","resize"]}]})}function zt(t){function e(t){var e=t-Date.now();return{total:e,seconds:e/1e3%60,minutes:e/1e3/60%60,hours:e/1e3/60/60%24,days:e/1e3/60/60/24}}zt.installed||t.component("countdown",{mixins:[t.mixin.class],attrs:!0,props:{date:String,clsWrapper:String},defaults:{date:"",clsWrapper:".uk-countdown-%unit%"},computed:{date:function(){return Date.parse(this.$props.date)},days:function(){return this.$el.find(this.clsWrapper.replace("%unit%","days"))},hours:function(){return this.$el.find(this.clsWrapper.replace("%unit%","hours"))},minutes:function(){return this.$el.find(this.clsWrapper.replace("%unit%","minutes"))},seconds:function(){return this.$el.find(this.clsWrapper.replace("%unit%","seconds"))},units:function(){var t=this;return["days","hours","minutes","seconds"].filter(function(e){return t[e].length})}},connected:function(){this.start()},disconnected:function(){var t=this;this.stop(),this.units.forEach(function(e){return t[e].empty()})},update:{write:function(){var t=this,i=e(this.date);i.total<=0&&(this.stop(),i.days=i.hours=i.minutes=i.seconds=0),this.units.forEach(function(e){var n=String(Math.floor(i[e]));if(n=n.length<2?"0"+n:n,t[e].text()!==n){var s=t[e];(n=n.split("")).length!==s.children().length&&s.empty().append(n.map(function(){return"<span></span>"}).join("")),n.forEach(function(t,e){return s[0].childNodes[e].innerText=t})}})}},methods:{start:function(){var t=this;this.stop(),this.date&&this.units.length&&(this.$emit(),this.timer=setInterval(function(){return t.$emit()},1e3))},stop:function(){this.timer&&(clearInterval(this.timer),this.timer=null)}}})}function Lt(t){if(!Lt.installed){var e=t.util,i=e.$,n=e.ajax,s=e.assign,o=e.doc,r=e.Event,a=e.Dimensions,l=e.getIndex,h=e.Transition;t.component("lightbox",{name:"lightbox",props:{toggle:String,duration:Number,inverse:Boolean},defaults:{toggle:"a",duration:400,dark:!1,attrItem:"uk-lightbox-item",items:[],index:0},computed:{toggles:function(){var t=this;return i(this.toggle,this.$el).each(function(e,i){return t.items.push({source:i.getAttribute("href"),title:i.getAttribute("title"),type:i.getAttribute("type")})})}},events:[{name:"click",delegate:function(){return this.toggle+":not(.uk-disabled)"},handler:function(t){t.preventDefault(),this.show(this.toggles.index(t.currentTarget))}},{name:"showitem",handler:function(t){this.getItem().content&&(this.$update(),t.stopImmediatePropagation())}}],update:{write:function(){var t=this,e=this.getItem();if(this.modal&&e.content){var n=this.modal.panel,s={width:n.width(),height:n.height()},o={width:window.innerWidth-(n.outerWidth(!0)-s.width),height:window.innerHeight-(n.outerHeight(!0)-s.height)},r=a.contain({width:e.width,height:e.height},o);h.stop(n),h.stop(this.modal.content),this.modal.content&&this.modal.content.remove(),this.modal.content=i(e.content).css("opacity",0).appendTo(n),n.css(s),h.start(n,r,this.duration).then(function(){h.start(t.modal.content,{opacity:1},400).then(function(){n.find("[uk-transition-hide]").show(),n.find("[uk-transition-show]").hide()})})}},events:["resize"]},methods:{show:function(e){var n=this;this.index=l(e,this.items,this.index),this.modal||(this.modal=t.modal.dialog('\n <button class="uk-modal-close-outside" uk-transition-hide type="button" uk-close></button>\n <span class="uk-position-center" uk-transition-show uk-spinner></span>\n ',{center:!0}),this.modal.$el.css("overflow","hidden").addClass("uk-modal-lightbox"),this.modal.panel.css({width:200,height:200}),this.modal.caption=i('<div class="uk-modal-caption" uk-transition-hide></div>').appendTo(this.modal.panel),this.items.length>1&&i('<div class="'+(this.dark?"uk-dark":"uk-light")+'" uk-transition-hide>\n <a href="#" class="uk-position-center-left" uk-slidenav-previous uk-lightbox-item="previous"></a>\n <a href="#" class="uk-position-center-right" uk-slidenav-next uk-lightbox-item="next"></a>\n </div>\n ').appendTo(this.modal.panel.addClass("uk-slidenav-position")),this.modal.$el.on("hidden",this.hide).on("click","["+this.attrItem+"]",function(t){t.preventDefault(),n.show(i(t.currentTarget).attr(n.attrItem))}).on("swipeRight swipeLeft",function(t){t.preventDefault(),window.getSelection().toString()||n.show("swipeLeft"===t.type?"next":"previous")})),this.modal.panel.find("[uk-transition-hide]").hide(),this.modal.panel.find("[uk-transition-show]").show(),this.modal.content&&this.modal.content.remove(),this.modal.caption.text(this.getItem().title);var s=r("showitem");this.$el.trigger(s),s.isImmediatePropagationStopped()||this.setError(this.getItem()),o.on("keydown."+this.$options.name,function(t){switch(t.keyCode){case 37:n.show("previous");break;case 39:n.show("next")}})},hide:function(){var t=this;o.off("keydown."+this.$options.name),this.modal.hide().then(function(){t.modal.$destroy(!0),t.modal=null})},getItem:function(){return this.items[this.index]||{source:"",title:"",type:""}},setItem:function(t,e,i,n){void 0===i&&(i=200),void 0===n&&(n=200),s(t,{content:e,width:i,height:n}),this.$update()},setError:function(t){this.setItem(t,'<div class="uk-position-cover uk-flex uk-flex-middle uk-flex-center"><strong>Loading resource failed!</strong></div>',400,300)}}}),t.mixin({events:{showitem:function(t){var e=this,i=this.getItem();if("image"===i.type||!i.source||i.source.match(/\.(jp(e)?g|png|gif|svg)$/i)){var n=new Image;n.onerror=function(){return e.setError(i)},n.onload=function(){return e.setItem(i,'<img class="uk-responsive-width" width="'+n.width+'" height="'+n.height+'" src ="'+i.source+'">',n.width,n.height)},n.src=i.source,t.stopImmediatePropagation()}}}},"lightbox"),t.mixin({events:{showitem:function(t){var e=this,n=this.getItem();if("video"===n.type||!n.source||n.source.match(/\.(mp4|webm|ogv)$/i)){var s=i('<video class="uk-responsive-width" controls></video>').on("loadedmetadata",function(){return e.setItem(n,s.attr({width:s[0].videoWidth,height:s[0].videoHeight}),s[0].videoWidth,s[0].videoHeight)}).attr("src",n.source);t.stopImmediatePropagation()}}}},"lightbox"),t.mixin({events:{showitem:function(t){var e,i=this,n=this.getItem();if((e=n.source.match(/\/\/.*?youtube\.[a-z]+\/watch\?v=([^&]+)&?(.*)/))||n.source.match(/youtu\.be\/(.*)/)){var s=e[1],o=new Image,r=!1,a=function(t,e){return i.setItem(n,'<iframe src="//www.youtube.com/embed/'+s+'" width="'+t+'" height="'+e+'" style="max-width:100%;box-sizing:border-box;"></iframe>',t,e)};o.onerror=function(){return a(640,320)},o.onload=function(){120===o.width&&90===o.height?r?a(640,320):(r=!0,o.src="//img.youtube.com/vi/"+s+"/0.jpg"):a(o.width,o.height)},o.src="//img.youtube.com/vi/"+s+"/maxresdefault.jpg",t.stopImmediatePropagation()}}}},"lightbox"),t.mixin({events:{showitem:function(t){var e,i=this,s=this.getItem();if(e=s.source.match(/(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/)){var o=e[2],r=function(t,e){return i.setItem(s,'<iframe src="//player.vimeo.com/video/'+o+'" width="'+t+'" height="'+e+'" style="max-width:100%;box-sizing:border-box;"></iframe>',t,e)};n({type:"GET",url:"http://vimeo.com/api/oembed.json?url="+encodeURI(s.source),jsonp:"callback",dataType:"jsonp"}).then(function(t){return r(t.width,t.height)}),t.stopImmediatePropagation()}}}},"lightbox")}}function Wt(t){if(!Wt.installed){var e=t.util,i=e.$,n=e.each,s=e.pointerEnter,o=e.pointerLeave,r=e.Transition,a={};t.component("notification",{functional:!0,args:["message","status"],defaults:{message:"",status:"",timeout:5e3,group:null,pos:"top-center",onClose:null,clsClose:"uk-notification-close",clsMsg:"uk-notification-message"},created:function(){a[this.pos]||(a[this.pos]=i('<div class="uk-notification uk-notification-'+this.pos+'"></div>').appendTo(t.container)),this.$mount(i('<div class="'+this.clsMsg+(this.status?" "+this.clsMsg+"-"+this.status:"")+'">\n <a href="#" class="'+this.clsClose+'" data-uk-close></a>\n <div>'+this.message+"</div>\n </div>").appendTo(a[this.pos].show())[0])},ready:function(){var t=this,e=parseInt(this.$el.css("margin-bottom"),10);r.start(this.$el.css({opacity:0,marginTop:-1*this.$el.outerHeight(),marginBottom:0}),{opacity:1,marginTop:0,marginBottom:e}).then(function(){t.timeout&&(t.timer=setTimeout(t.close,t.timeout))})},events:(l={click:function(t){i(t.target).closest('a[href="#"]').length&&t.preventDefault(),this.close()}},l[s]=function(){this.timer&&clearTimeout(this.timer)},l[o]=function(){this.timeout&&(this.timer=setTimeout(this.close,this.timeout))},l),methods:{close:function(t){var e=this,i=function(){e.onClose&&e.onClose(),e.$el.trigger("close",[e]).remove(),a[e.pos].children().length||a[e.pos].hide()};this.timer&&clearTimeout(this.timer),t?i():r.start(this.$el,{opacity:0,marginTop:-1*this.$el.outerHeight(),marginBottom:0}).then(i)}}});var l;t.notification.closeAll=function(e,i){n(t.instances,function(t,n){"notification"!==n.$options.name||e&&e!==n.group||n.close(i)})}}}function Rt(t){function e(i){return t.getComponent(i,"sortable")||i.parentNode&&e(i.parentNode)}function i(){var t=setTimeout(function(){return a.trigger("click")},0),e=function(i){i.preventDefault(),i.stopPropagation(),clearTimeout(t),f(a,"click",e,!0)};d(a,"click",e,!0)}if(!Rt.installed){var n=t.mixin,s=t.util,o=s.$,r=s.assign,a=s.docElement,l=s.docHeight,h=s.fastdom,c=s.getDimensions,u=s.isWithin,d=s.on,f=s.off,p=s.offsetTop,g=s.pointerDown,m=s.pointerMove,v=s.pointerUp,w=s.promise,b=s.win;t.component("sortable",{mixins:[n.class],props:{group:String,animation:Number,threshold:Number,clsItem:String,clsPlaceholder:String,clsDrag:String,clsDragState:String,clsBase:String,clsNoDrag:String,clsEmpty:String,clsCustom:String,handle:String},defaults:{group:!1,animation:150,threshold:5,clsItem:"uk-sortable-item",clsPlaceholder:"uk-sortable-placeholder",clsDrag:"uk-sortable-drag",clsDragState:"uk-drag",clsBase:"uk-sortable",clsNoDrag:"uk-sortable-nodrag",clsEmpty:"uk-sortable-empty",clsCustom:"",handle:!1},init:function(){var t=this;["init","start","move","end"].forEach(function(e){var i=t[e];t[e]=function(e){e=e.originalEvent||e,t.scrollY=window.scrollY;var n=e.touches&&e.touches[0]||e,s=n.pageX,o=n.pageY;t.pos={x:s,y:o},i(e)}})},events:(y={},y[g]="init",y),update:{write:function(){var t=this;if(this.clsEmpty&&this.$toggleClass(this.clsEmpty,!this.$el.children().length),this.drag){this.drag.offset({top:this.pos.y+this.origin.top,left:this.pos.x+this.origin.left});var e=p(this.drag),i=e+this.drag[0].offsetHeight;e>0&&e<this.scrollY?setTimeout(function(){return b.scrollTop(t.scrollY-5)},5):i<l()&&i>window.innerHeight+this.scrollY&&setTimeout(function(){return b.scrollTop(t.scrollY+5)},5)}}},methods:{init:function(t){var e=o(t.target),i=this.$el.children().filter(function(e,i){return u(t.target,i)});!i.length||e.is(":input")||this.handle&&!u(e,this.handle)||t.button&&0!==t.button||u(e,"."+this.clsNoDrag)||(t.preventDefault(),t.stopPropagation(),this.touched=[this],this.placeholder=i,this.origin=r({target:e,index:this.placeholder.index()},this.pos),a.on(m,this.move),a.on(v,this.end),b.on("scroll",this.scroll),this.threshold||this.start(t))},start:function(e){this.drag=o(this.placeholder[0].outerHTML.replace(/^<li/i,"<div").replace(/li>$/i,"div>")).attr("uk-no-boot","").addClass(this.clsDrag+" "+this.clsCustom).css({boxSizing:"border-box",width:this.placeholder.outerWidth(),height:this.placeholder.outerHeight()}).css(this.placeholder.css(["paddingLeft","paddingRight","paddingTop","paddingBottom"])).appendTo(t.container),this.drag.children().first().height(this.placeholder.children().height());var i=c(this.placeholder),n=i.left,s=i.top;r(this.origin,{left:n-this.pos.x,top:s-this.pos.y}),this.placeholder.addClass(this.clsPlaceholder),this.$el.children().addClass(this.clsItem),a.addClass(this.clsDragState),this.$el.trigger("start",[this,this.placeholder,this.drag]),this.move(e)},move:function(t){if(this.drag){this.$emit();var i="mousemove"===t.type?t.target:document.elementFromPoint(this.pos.x-document.body.scrollLeft,this.pos.y-document.body.scrollTop),n=e(i),s=e(this.placeholder[0]),r=n!==s;if(n&&!u(i,this.placeholder)&&(!r||n.group&&n.group===s.group)){if(i=n.$el.is(i.parentNode)&&o(i)||n.$el.children().has(i),r)s.remove(this.placeholder);else if(!i.length)return;n.insert(this.placeholder,i),~this.touched.indexOf(n)||this.touched.push(n)}}else(Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(t)},scroll:function(){var t=window.scrollY;t!==this.scrollY&&(this.pos.y+=t-this.scrollY,this.scrollY=t,this.$emit())},end:function(t){if(a.off(m,this.move),a.off(v,this.end),b.off("scroll",this.scroll),this.drag){i();var n=e(this.placeholder[0]);this===n?this.origin.index!==this.placeholder.index()&&this.$el.trigger("change",[this,this.placeholder,"moved"]):(n.$el.trigger("change",[n,this.placeholder,"added"]),this.$el.trigger("change",[this,this.placeholder,"removed"])),this.$el.trigger("stop",[this]),this.drag.remove(),this.drag=null;var s=this.touched.map(function(t){return t.clsPlaceholder+" "+t.clsItem}).join(" ");this.touched.forEach(function(t){return t.$el.children().removeClass(s)}),a.removeClass(this.clsDragState)}else"mouseup"!==t.type&&u(t.target,"a[href]")&&(location.href=o(t.target).closest("a[href]").attr("href"))},insert:function(t,e){var i=this;this.$el.children().addClass(this.clsItem);var n=function(){e.length?!i.$el.has(t).length||t.prevAll().filter(e).length?t.insertBefore(e):t.insertAfter(e):i.$el.append(t)};this.animation?this.animate(n):n()},remove:function(t){this.$el.has(t).length&&(this.animation?this.animate(function(){return t.detach()}):t.detach())},animate:function(t){var e=this,i=[],n=this.$el.children().toArray().map(function(t){return t=o(t),i.push(r({position:"absolute",pointerEvents:"none",width:t.outerWidth(),height:t.outerHeight()},t.position())),t}),s={position:"",width:"",height:"",pointerEvents:"",top:"",left:""};t(),n.forEach(function(t){return t.stop()}),this.$el.children().css(s),this.$update("update",!0),h.flush(),this.$el.css("min-height",this.$el.height());var a=n.map(function(t){return t.position()});w.all(n.map(function(t,n){return t.css(i[n]).animate(a[n],e.animation).promise()})).then(function(){e.$el.css("min-height","").children().css(s),e.$update("update",!0),h.flush()})}}});var y}}function qt(t){if(!qt.installed){var e=t.util,i=t.mixin,n=e.$,s=e.doc,o=e.fastdom,r=e.flipPosition,a=e.isTouch,l=e.isWithin,h=e.pointerDown,c=e.pointerEnter,u=e.pointerLeave,d=[];t.component("tooltip",{attrs:!0,mixins:[i.togglable,i.position],props:{delay:Number,container:Boolean,title:String},defaults:{pos:"top",title:"",delay:0,animation:["uk-animation-scale-up"],duration:100,cls:"uk-active",clsPos:"uk-tooltip",container:!0},computed:{container:function(){return n(!0===this.$props.container&&t.container||this.$props.container||t.container)}},connected:function(){var t=this;o.mutate(function(){return t.$el.removeAttr("title").attr("aria-expanded",!1)})},disconnected:function(){this.hide()},methods:{show:function(){var t=this;~d.indexOf(this)||(d.forEach(function(t){return t.hide()}),d.push(this),s.on("click."+this.$options.name,function(e){l(e.target,t.$el)||t.hide()}),clearTimeout(this.showTimer),this.tooltip=n('<div class="'+this.clsPos+'" aria-hidden="true"><div class="'+this.clsPos+'-inner">'+this.title+"</div></div>").appendTo(this.container),this.$el.attr("aria-expanded",!0),this.positionAt(this.tooltip,this.$el),this.origin="y"===this.getAxis()?r(this.dir)+"-"+this.align:this.align+"-"+r(this.dir),this.showTimer=setTimeout(function(){t.toggleElement(t.tooltip,!0),t.hideTimer=setInterval(function(){t.$el.is(":visible")||t.hide()},150)},this.delay))},hide:function(){var t=d.indexOf(this);!~t||this.$el.is("input")&&this.$el[0]===document.activeElement||(d.splice(t,1),clearTimeout(this.showTimer),clearInterval(this.hideTimer),this.$el.attr("aria-expanded",!1),this.toggleElement(this.tooltip,!1),this.tooltip&&this.tooltip.remove(),this.tooltip=!1,s.off("click."+this.$options.name))}},events:(f={blur:"hide"},f["focus "+c+" "+h]=function(t){t.type===h&&a(t)||this.show()},f[u]=function(t){a(t)||this.hide()},f)});var f}}function Yt(t){function e(t,e){return e.match(new RegExp("^"+t.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$","i"))}function i(t,e){for(var i=[],n=0;n<t.length;n+=e){for(var s=[],o=0;o<e;o++)s.push(t[n+o]);i.push(s)}return i}if(!Yt.installed){var n=t.util,s=n.$,o=n.ajax,r=n.on;t.component("upload",{props:{allow:String,clsDragover:String,concurrent:Number,dataType:String,mime:String,msgInvalidMime:String,msgInvalidName:String,multiple:Boolean,name:String,params:Object,type:String,url:String},defaults:{allow:!1,clsDragover:"uk-dragover",concurrent:1,dataType:void 0,mime:!1,msgInvalidMime:"Invalid File Type: %s",msgInvalidName:"Invalid File Name: %s",multiple:!1,name:"files[]",params:{},type:"POST",url:"",abort:null,beforeAll:null,beforeSend:null,complete:null,completeAll:null,error:null,fail:function(t){alert(t)},load:null,loadEnd:null,loadStart:null,progress:null},events:{change:function(t){s(t.target).is('input[type="file"]')&&(t.preventDefault(),t.target.files&&this.upload(t.target.files),t.target.value="")},drop:function(t){t.preventDefault(),t.stopPropagation();var e=t.originalEvent.dataTransfer;e&&e.files&&(this.$removeClass(this.clsDragover),this.upload(e.files))},dragenter:function(t){t.preventDefault(),t.stopPropagation()},dragover:function(t){t.preventDefault(),t.stopPropagation(),this.$addClass(this.clsDragover)},dragleave:function(t){t.preventDefault(),t.stopPropagation(),this.$removeClass(this.clsDragover)}},methods:{upload:function(t){var n=this;if(t.length){this.$el.trigger("upload",[t]);for(var a=0;a<t.length;a++){if(n.allow&&!e(n.allow,t[a].name))return void n.fail(n.msgInvalidName.replace(/%s/,n.allow));if(n.mime&&!e(n.mime,t[a].type))return void n.fail(n.msgInvalidMime.replace(/%s/,n.mime))}this.multiple||(t=[t[0]]),this.beforeAll&&this.beforeAll(this,t);var l=i(t,this.concurrent),h=function(t){var e=new FormData;t.forEach(function(t){return e.append(n.name,t)});for(var i in n.params)e.append(i,n.params[i]);o({data:e,url:n.url,type:n.type,dataType:n.dataType,beforeSend:n.beforeSend,complete:[n.complete,function(t,e){l.length?h(l.shift()):n.completeAll&&n.completeAll(t),"abort"===e&&n.abort&&n.abort(t)}],cache:!1,contentType:!1,processData:!1,xhr:function(){var t=s.ajaxSettings.xhr();return t.upload&&n.progress&&r(t.upload,"progress",n.progress),["loadStart","load","loadEnd","error","abort"].forEach(function(e){return n[e]&&r(t,e.toLowerCase(),n[e])}),t}})};h(l.shift())}}}})}}function Ut(t){function e(t,e){return t.sort(function(t,i){return t[e]>i[e]?1:i[e]>t[e]?-1:0})}if(!Ut.installed){var i=t.util.scrolledOver;t.component("grid-parallax",t.components.grid.extend({props:{target:String,translate:Number},defaults:{target:!1,translate:150},init:function(){this.$addClass("uk-grid")},disconnected:function(){this.reset(),this.$el.css("margin-bottom","")},computed:{translate:function(){return Math.abs(this.$props.translate)},items:function(){return(this.target?this.$el.find(this.target):this.$el.children()).toArray()}},update:[{read:function(){this.columns=this.rows&&this.rows[0]&&this.rows[0].length||0,this.rows=this.rows&&this.rows.map(function(t){return e(t,"offsetLeft")})},write:function(){this.$el.css("margin-bottom","").css("margin-bottom",this.columns>1?this.translate+parseFloat(this.$el.css("margin-bottom")):"")},events:["load","resize"]},{read:function(){this.scrolled=i(this.$el)*this.translate},write:function(){var t=this;if(!this.rows||1===this.columns||!this.scrolled)return this.reset();this.rows.forEach(function(e){return e.forEach(function(e,i){return e.style.transform="translateY("+(i%2?t.scrolled:t.scrolled/8)+"px)"})})},events:["scroll","load","resize"]}],methods:{reset:function(){this.items.forEach(function(t){return t.style.transform=""})}}})),t.component("grid-parallax").options.update.unshift({read:function(){this.reset()},events:["load","resize"]})}}function Vt(t){function e(t){return t.split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(function(t){return parseFloat(t)})}function i(t,e){var i=!1;return Object.keys(t).reduce(function(s,o){var r=t[o],a=n(r,e);switch(o){case"x":case"y":if(i)break;var l=["x","y"].map(function(i){return o===i?a+r.unit:t[i]?n(t[i],e)+t[i].unit:0}),h=l[0],c=l[1];i=s.transform+=" translate3d("+h+", "+c+", 0)";break;case"rotate":s.transform+=" rotate("+a+"deg)";break;case"scale":s.transform+=" scale("+a+")";break;case"bgy":case"bgx":s["background-position-"+o[2]]="calc("+r.pos+" + "+(a+r.unit)+")";break;case"color":case"backgroundColor":case"borderColor":s[o]="rgba("+r.start.map(function(t,i){return t+=e*(r.end[i]-t),3===i?parseFloat(t):parseInt(t,10)}).join(",")+")";break;case"blur":s.filter+=" blur("+a+"px)";break;case"hue":s.filter+=" hue-rotate("+a+"deg)";break;case"fopacity":s.filter+=" opacity("+a+"%)";break;case"grayscale":case"invert":case"saturate":case"sepia":s.filter+=" "+o+"("+a+"%)";break;default:s[o]=a}return s},{transform:"",filter:""})}function n(t,e){return+(h(t.diff)?+t.end:t.start+t.diff*e*(t.start<t.end?1:-1)).toFixed(2)}if(!Vt.installed){var s=t.util,o=(s.$,s.assign),r=s.clamp,a=s.Dimensions,l=s.getImage,h=s.isUndefined,c=s.scrolledOver,u=s.query,d=["x","y","bgx","bgy","rotate","scale","color","backgroundColor","borderColor","opacity","blur","hue","grayscale","invert","saturate","sepia","fopacity"];t.component("parallax",{props:d.reduce(function(t,e){return t[e]="list",t},{easing:Number,target:String,viewport:Number,media:"media"}),defaults:d.reduce(function(t,e){return t[e]=void 0,t},{easing:1,target:!1,viewport:1,media:!1}),computed:{target:function(){return this.$props.target&&u(this.$props.target,this.$el)||this.$el},props:function(){var t=this;return d.reduce(function(i,n){if(h(t.$props[n]))return i;var s=n.match(/color/i),r=s||"opacity"===n,a=t.$props[n];r&&t.$el.css(n,"");var l,c=(h(a[1])?"scale"===n?1:r?t.$el.css(n):0:a[0])||0,u=h(a[1])?a[0]:a[1],d=~a.join("").indexOf("%")?"%":"px";if(s){var f=t.$el[0].style.color;t.$el[0].style.color=c,c=e(t.$el.css("color")),t.$el[0].style.color=u,u=e(t.$el.css("color")),t.$el[0].style.color=f}else c=parseFloat(c),u=parseFloat(u),l=Math.abs(c-u);if(i[n]={start:c,end:u,diff:l,unit:d},n.match(/^bg/)){var p="background-position-"+n[2];i[n].pos=t.$el.css(p,"").css(p),t.covers&&o(i[n],{start:0,end:c<=u?l:-l})}return i},{})},bgProps:function(){var t=this;return["bgx","bgy"].filter(function(e){return e in t.props})},covers:function(){return"cover"===this.$el.css("backgroundSize","").css("backgroundSize")}},disconnected:function(){delete this._prev,delete this._image},update:[{read:function(){var t=this;if(delete this._prev,delete this._computeds.props,this._active=!this.media||window.matchMedia(this.media).matches,this._image&&(this._image.dimEl={width:this.$el[0].offsetWidth,height:this.$el[0].offsetHeight}),h(this._image)&&this.covers&&this.bgProps.length){var e=this.$el.css("backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");e&&(this._image=!1,l(e).then(function(e){t._image={width:e.naturalWidth,height:e.naturalHeight},t.$emit()}))}},write:function(){var t=this;if(this._image)if(this._active){var e=this._image,i=e.dimEl,n=a.cover(e,i);this.bgProps.forEach(function(s){var o=t.props[s],l=o.start,h=o.end,c=o.pos,u=o.diff,d="bgy"===s?"height":"width",f=n[d]-i[d];if(c.match(/%$/)){if(l>=h)f<u?(i[d]=n[d]+u-f,t.props[s].pos="0px"):(c=-1*f/100*parseFloat(c),c=r(c,u-f,0),t.props[s].pos=c+"px");else{if(f<u)i[d]=n[d]+u-f;else if(f/100*parseFloat(c)>u)return;t.props[s].pos="-"+u+"px"}n=a.cover(e,i)}}),this.$el.css({backgroundSize:n.width+"px "+n.height+"px",backgroundRepeat:"no-repeat"})}else this.$el.css({backgroundSize:"",backgroundRepeat:""})},events:["load","resize"]},{read:function(){var t=c(this.target)/(this.viewport||1);this._percent=r(t*(1-(this.easing-this.easing*t)))},write:function(){var t=this;this._active?this._prev!==this._percent&&(this.$el.css(i(this.props,this._percent)),this._prev=this._percent):Object.keys(i(this.props,0)).forEach(function(e){return t.$el.css(e,"")})},events:["scroll","load","resize"]}]})}}var Xt="default"in t?t.default:t,Gt=document.documentElement,Qt=Xt(window),Jt=Xt(document),Zt=Xt(Gt),Kt="rtl"===Gt.getAttribute("dir"),te={start:o,stop:function(e,i){var n=t.Event($e||"transitionend");return Xt(e).triggerHandler(n,[i]),n.promise||$.resolve()},cancel:function(t){return this.stop(t,!0)},inProgress:function(t){return Xt(t).hasClass("uk-transition")}},ee={in:function(t,e,i,n){return r(t,e,i,n,!1)},out:function(t,e,i,n){return r(t,e,i,n,!0)},inProgress:function(t){return Xt(t).hasClass("uk-animation-enter")||Xt(t).hasClass("uk-animation-leave")},cancel:function(e){var i=t.Event(ke||"animationend");return Xt(e).triggerHandler(i),i.promise||$.resolve()}},ie={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},ne={ratio:function(t,e,i){var n="width"===e?"height":"width";return s={},s[n]=Math.round(i*t[n]/t[e]),s[e]=i,s;var s},contain:function(e,i){var n=this;return e=he({},e),t.each(e,function(t){return e=e[t]>i[t]?n.ratio(e,t,i[t]):e}),e},cover:function(e,i){var n=this;return e=this.contain(e,i),t.each(e,function(t){return e=e[t]<i[t]?n.ratio(e,t,i[t]):e}),e}},se=Object.prototype.hasOwnProperty;$.resolve=function(t){return $(function(e){e(t)})},$.reject=function(t){return $(function(e,i){i(t)})},$.all=function(t){return pe?Promise.all(t):Xt.when.apply(Xt,t)};var oe=/-(\w)/g,re=Array.isArray,ae={"!":"closest","+":"nextAll","-":"prevAll"},le={},he=Object.assign||function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];t=Object(t);for(var n=0;n<e.length;n++){var s=e[n];if(null!==s)for(var o in s)y(s,o)&&(t[o]=s[o])}return t},ce=window.MutationObserver||window.WebKitMutationObserver,ue=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},de="ontouchstart"in window,fe=window.PointerEvent,pe="Promise"in window,ge="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||navigator.msPointerEnabled&&navigator.msMaxTouchPoints||navigator.pointerEnabled&&navigator.maxTouchPoints,me=ge?"mousedown "+(de?"touchstart":"pointerdown"):"mousedown",ve=ge?"mousemove "+(de?"touchmove":"pointermove"):"mousemove",we=ge?"mouseup "+(de?"touchend":"pointerup"):"mouseup",be=ge&&fe?"pointerenter":"mouseenter",ye=ge&&fe?"pointerleave":"mouseleave",$e=V("transition","transition-end"),xe=V("animation","animation-start"),ke=V("animation","animation-end"),Ce={reads:[],writes:[],measure:function(t){return this.reads.push(t),X(),t},mutate:function(t){return this.writes.push(t),X(),t},clear:function(t){return Q(this.reads,t)||Q(this.writes,t)},flush:function(){G(this.reads),G(this.writes.splice(0,this.writes.length)),this.scheduled=!1,(this.reads.length||this.writes.length)&&X()}};J.prototype={positions:[],position:null,init:function(){var t=this;this.positions=[],this.position=null;var e=!1;this.handler=function(i){e||setTimeout(function(){var n=Date.now(),s=t.positions.length;s&&n-t.positions[s-1].time>100&&t.positions.splice(0,s),t.positions.push({time:n,x:i.pageX,y:i.pageY}),t.positions.length>5&&t.positions.shift(),e=!1},5),e=!0},Jt.on("mousemove",this.handler)},cancel:function(){this.handler&&Jt.off("mousemove",this.handler)},movesTo:function(t){if(this.positions.length<2)return!1;var e=et(t),i=this.positions[this.positions.length-1],n=this.positions[0];if(e.left<=i.x&&i.x<=e.right&&e.top<=i.y&&i.y<=e.bottom)return!1;var s=[[{x:e.left,y:e.top},{x:e.right,y:e.bottom}],[{x:e.right,y:e.top},{x:e.left,y:e.bottom}]];return e.right<=i.x||(e.left>=i.x?(s[0].reverse(),s[1].reverse()):e.bottom<=i.y?s[0].reverse():e.top>=i.y&&s[1].reverse()),!!s.reduce(function(t,e){return t+(Z(n,e[0])<Z(i,e[0])&&Z(n,e[1])>Z(i,e[1]))},0)}};var Te={};Te.args=Te.created=Te.events=Te.init=Te.ready=Te.connected=Te.disconnected=Te.destroy=function(t,e){return t=t&&!re(t)?[t]:t,e?t?t.concat(e):re(e)?e:[e]:t},Te.update=function(t,e){return Te.args(t,_(e)?{read:e}:e)},Te.props=function(t,e){return re(e)&&(e=e.reduce(function(t,e){return t[e]=String,t},{})),Te.methods(t,e)},Te.computed=Te.defaults=Te.methods=function(t,e){return e?t?he({},t,e):e:t};var _e,Ee,Se,Ae,Oe,De=function(t,e){return D(e)?t:e},Ie={x:["width","left","right"],y:["height","top","bottom"]},Ne={};i(function(){var e,i,s=0,o=0;"MSGesture"in window&&((Ae=new MSGesture).target=document.body),n(document,"click",function(){return Oe=!0},!0),n(document,"MSGestureEnd gestureend",function(t){var e=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;e&&void 0!==Ne.el&&(Ne.el.trigger("swipe"),Ne.el.trigger("swipe"+e))}),n(document,me,function(t){var n=t.touches?t.touches[0]:t,s=n.target,o=n.pageX,r=n.pageY;e=Date.now(),i=e-(Ne.last||e),Ne.el=Xt("tagName"in s?s:s.parentNode),_e&&clearTimeout(_e),Ne.x1=o,Ne.y1=r,i>0&&i<=250&&(Ne.isDoubleTap=!0),Ne.last=e,!Ae||"pointerdown"!==t.type&&"touchstart"!==t.type||Ae.addPointer(t.pointerId),Oe=t.button>0}),n(document,ve,function(t){var e=t.touches?t.touches[0]:t,i=e.pageX,n=e.pageY;Ne.x2=i,Ne.y2=n,s+=Math.abs(Ne.x1-Ne.x2),o+=Math.abs(Ne.y1-Ne.y2)}),n(document,we,function(){Ne.x2&&Math.abs(Ne.x1-Ne.x2)>30||Ne.y2&&Math.abs(Ne.y1-Ne.y2)>30?Se=setTimeout(function(){void 0!==Ne.el&&(Ne.el.trigger("swipe"),Ne.el.trigger("swipe"+lt(Ne.x1,Ne.x2,Ne.y1,Ne.y2))),Ne={}}):"last"in Ne&&(isNaN(s)||s<30&&o<30?Ee=setTimeout(function(){var e=t.Event("tap");e.cancelTouch=ht,void 0!==Ne.el&&Ne.el.trigger(e),Ne.isDoubleTap?(void 0!==Ne.el&&Ne.el.trigger("doubleTap"),Ne={}):_e=setTimeout(function(){_e=null,void 0!==Ne.el&&(Ne.el.trigger("singleTap"),Oe||Ne.el.trigger("click")),Ne={}},350)}):Ne={},s=o=0)}),n(document,"touchcancel",ht),n(window,"scroll",ht)});var Be=!1;n(document,"touchstart",function(){return Be=!0},!0),n(document,"click",function(){Be=!1}),n(document,"touchcancel",function(){return Be=!1},!0);var Pe,He,Me=Object.freeze({win:Qt,doc:Jt,docElement:Zt,isRtl:Kt,isReady:e,ready:i,on:n,off:s,transition:o,Transition:te,animate:r,Animation:ee,isJQuery:a,isWithin:l,attrFilter:h,removeClass:c,createEvent:u,isInView:d,scrolledOver:f,docHeight:p,getIndex:g,isVoidElement:m,Dimensions:ne,query:v,Observer:ce,requestAnimationFrame:ue,hasPromise:pe,hasTouch:ge,pointerDown:me,pointerMove:ve,pointerUp:we,pointerEnter:be,pointerLeave:ye,transitionend:$e,animationstart:xe,animationend:ke,getStyle:q,getCssVar:Y,getImage:U,fastdom:Ce,$:Xt,bind:b,hasOwn:y,promise:$,classify:x,hyphenate:k,camelize:C,isArray:re,isFunction:_,isObject:E,isPlainObject:S,isString:A,isNumber:O,isUndefined:D,isContextSelector:I,getContextSelectors:N,toJQuery:B,toNode:P,toBoolean:H,toNumber:M,toList:j,toMedia:F,coerce:z,toMs:L,swap:W,assign:he,clamp:R,ajax:t.ajax,each:t.each,Event:t.Event,isNumeric:t.isNumeric,MouseTracker:J,mergeOptions:K,position:tt,getDimensions:et,offsetTop:it,flipPosition:at,isTouch:ct});!function(){var t=document.createElement("_").classList;t.add("a","b"),t.toggle("c",!1),Pe=t.contains("b"),He=!t.contains("c"),t=null}();var je=function(t){this._init(t)};je.util=Me,je.data="__uikit__",je.prefix="uk-",je.options={},je.instances={},je.elements=[],function(t){function e(t){return new Function("return function "+x(t)+" (options) { this._init(options); }")()}function i(t,e){if(t.nodeType===Node.ELEMENT_NODE)for(e(t),t=t.firstChild;t;)i(t,e),t=t.nextSibling}function n(t,e){if(t)for(var i in t)t[i]._isReady&&t[i]._callUpdate(e)}var s=t.data;t.use=function(t){if(!t.installed)return t.call(null,this),t.installed=!0,this},t.mixin=function(e,i){i=(A(i)?t.components[i]:i)||this,(e=K({},e)).mixins=i.options.mixins,delete i.options.mixins,i.options=K(e,i.options)},t.extend=function(t){var i=this,n=e((t=t||{}).name||i.options.name||"UIkitComponent");return n.prototype=Object.create(i.prototype),n.prototype.constructor=n,n.options=K(i.options,t),n.super=i,n.extend=i.extend,n},t.update=function(e,o,r){if(void 0===r&&(r=!1),e=u(e||"update"),o)if(o=P(o),r)do{n(o[s],e),o=o.parentNode}while(o);else i(o,function(t){return n(t[s],e)});else n(t.instances,e)};var o;Object.defineProperty(t,"container",{get:function(){return o||document.body},set:function(t){o=t}})}(je),function(t){t.prototype._callHook=function(t){var e=this,i=this.$options[t];i&&i.forEach(function(t){return t.call(e)})},t.prototype._callReady=function(){this._isReady||(this._isReady=!0,this._callHook("ready"),this._callUpdate())},t.prototype._callConnected=function(){var e=this;this._connected||(~t.elements.indexOf(this.$options.el)||t.elements.push(this.$options.el),t.instances[this._uid]=this,this._initEvents(),this._callHook("connected"),this._connected=!0,this._initObserver(),this._isReady||i(function(){return e._callReady()}),this._callUpdate())},t.prototype._callDisconnected=function(){if(this._connected){this._observer&&(this._observer.disconnect(),this._observer=null);var e=t.elements.indexOf(this.$options.el);~e&&t.elements.splice(e,1),delete t.instances[this._uid],this._initEvents(!0),this._callHook("disconnected"),this._connected=!1}},t.prototype._callUpdate=function(t){var e=this;"update"===(t=u(t||"update")).type&&(this._computeds={});var i=this.$options.update;i&&i.forEach(function(i,n){("update"===t.type||i.events&&~i.events.indexOf(t.type))&&(i.read&&!~Ce.reads.indexOf(e._frames.reads[n])&&(e._frames.reads[n]=Ce.measure(function(){i.read.call(e,t),delete e._frames.reads[n]})),i.write&&!~Ce.writes.indexOf(e._frames.writes[n])&&(e._frames.writes[n]=Ce.mutate(function(){i.write.call(e,t),delete e._frames.writes[n]})))})}}(je),function(t){function e(t,e,i){Object.defineProperty(t,e,{enumerable:!0,get:function(){return y(t._computeds,e)||(t._computeds[e]=i.call(t)),t._computeds[e]},set:function(i){t._computeds[e]=i}})}function i(t,e,i,s){S(i)||(i={name:s,handler:i});var o=i.name,r=i.el,a=i.delegate,l=i.self,h=i.filter,c=i.handler,u="."+t.$options.name+"."+t._uid;if(r=r&&r.call(t)||t.$el,o=o.split(" ").map(function(t){return t+"."+u}).join(" "),e)r.off(o);else{if(h&&!h.call(t))return;c=A(c)?t[c]:b(c,t),l&&(c=n(c,t)),a?r.on(o,A(a)?a:a.call(t),c):r.on(o,c)}}function n(t,e){return function(i){if(i.target===i.currentTarget)return t.call(e,i)}}function s(t,e){return t.every(function(t){return!t||!y(t,e)})}function o(t,e){return D(t)||t===e||a(t)&&a(e)&&t.is(e)}var r=0;t.prototype.props={},t.prototype._init=function(e){e=e||{},e=this.$options=K(this.constructor.options,e,this),this.$el=null,this.$name=t.prefix+k(this.$options.name),this.$props={},this._frames={reads:{},writes:{}},this._uid=r++,this._initData(),this._initMethods(),this._initComputeds(),this._callHook("created"),e.el&&this.$mount(e.el)},t.prototype._initData=function(){var t=this,e=this.$options,i=e.defaults,n=e.data;void 0===n&&(n={});var s=e.args;void 0===s&&(s=[]);var o=e.props;void 0===o&&(o={});var r=e.el;s.length&&re(n)&&(n=n.slice(0,s.length).reduce(function(t,e,i){return S(e)?he(t,e):t[s[i]]=e,t},{}));for(var a in i)t.$props[a]=t[a]=y(n,a)&&!D(n[a])?z(o[a],n[a],r):re(i[a])?i[a].concat():i[a]},t.prototype._initMethods=function(){var t=this,e=this.$options.methods;if(e)for(var i in e)t[i]=b(e[i],t)},t.prototype._initComputeds=function(){var t=this,i=this.$options.computed;if(this._computeds={},i)for(var n in i)e(t,n,i[n])},t.prototype._initProps=function(t){var e=this;this._computeds={},he(this.$props,t||this._getProps());var i=[this.$options.computed,this.$options.methods];for(var n in e.$props)s(i,n)&&(e[n]=e.$props[n])},t.prototype._initEvents=function(t){var e=this,n=this.$options.events;n&&n.forEach(function(n){if(y(n,"handler"))i(e,t,n);else for(var s in n)i(e,t,n[s],s)})},t.prototype._initObserver=function(){var t=this,e=this.$options,i=e.attrs,n=e.props,s=e.el;!this._observer&&n&&i&&ce&&(i=re(i)?i:Object.keys(n).map(function(t){return k(t)}),this._observer=new ce(function(){var e=t._getProps();i.some(function(i){return!o(e[i],t.$props[i])})&&t.$reset(e)}),this._observer.observe(s,{attributes:!0,attributeFilter:i.concat([this.$name,"data-"+this.$name])}))},t.prototype._getProps=function(){var t={},e=this.$options,i=e.args;void 0===i&&(i=[]);var n=e.props;void 0===n&&(n={});var s,o,r=e.el,a=r.getAttribute(this.$name)||r.getAttribute("data-"+this.$name);if(!n)return t;for(s in n)if(o=k(s),r.hasAttribute(o)){var l=z(n[s],r.getAttribute(o),r);if("target"===o&&(!l||0===l.lastIndexOf("_",0)))continue;t[s]=l}if(!a)return t;if("{"===a[0])try{a=JSON.parse(a)}catch(t){console.warn("Invalid JSON."),a={}}else if(i.length&&!~a.indexOf(":")){(h={})[i[0]]=a,a=h;var h}else{var c={};a.split(";").forEach(function(t){var e=t.split(/:(.+)/),i=e[0],n=e[1];i&&n&&(c[i.trim()]=n.trim())}),a=c}for(s in a||{})void 0!==n[o=C(s)]&&(t[o]=z(n[o],a[s],r));return t}}(je),function(t){var e=t.data;t.prototype.$mount=function(t){var i=this.$options.name;t[e]||(t[e]={}),t[e][i]||(t[e][i]=this,this.$options.el=this.$options.el||t,this.$el=Xt(t),this._initProps(),this._callHook("init"),document.documentElement.contains(t)&&this._callConnected())},t.prototype.$emit=function(t){this._callUpdate(t)},t.prototype.$update=function(e,i){t.update(e,this.$options.el,i)},t.prototype.$reset=function(t){this._callDisconnected(),this._initProps(t),this._callConnected()},t.prototype.$destroy=function(t){void 0===t&&(t=!1);var i=this.$options,n=i.el,s=i.name;n&&this._callDisconnected(),this._callHook("destroy"),n&&n[e]&&(delete n[e][s],Object.keys(n[e]).length||delete n[e],t&&this.$el.remove())}}(je),function(t){var e=t.data;t.components={},t.component=function(e,i){var n=C(e);if(S(i))i.name=n,i=t.extend(i);else{if(D(i))return t.components[n];i.options.name=n}return t.components[n]=i,t[n]=function(e,i){function s(e){return t.getComponent(e,n)||new t.components[n]({el:e,data:i||{}})}for(var o=arguments.length,r=Array(o);o--;)r[o]=arguments[o];return S(e)?new t.components[n]({data:e}):t.components[n].options.functional?new t.components[n]({data:[].concat(r)}):e&&e.nodeType?s(e):Xt(e).toArray().map(s)[0]},t._initialized&&!i.options.functional&&Ce.measure(function(){return t[n]("[uk-"+e+"],[data-uk-"+e+"]")}),t.components[n]},t.getComponents=function(t){return t&&(t=a(t)?t[0]:t)&&t[e]||{}},t.getComponent=function(e,i){return t.getComponents(e)[i]},t.connect=function(i){var n;if(i[e])for(n in i[e])i[e][n]._callConnected();for(var s=0;s<i.attributes.length;s++)0!==(n=i.attributes[s].name).lastIndexOf("uk-",0)&&0!==n.lastIndexOf("data-uk-",0)||(n=C(n.replace("data-uk-","").replace("uk-","")),t[n]&&t[n](i))},t.disconnect=function(t){for(var i in t[e])t[e][i]._callDisconnected()}}(je),function(t){function e(t,e,n){(e=i(e,t))&&(Pe?e[0][n].apply(e[0],e.slice(1)):e.slice(1).forEach(function(t){return e[0][n](t)}))}function i(t,e){return A(t[0])&&t.unshift(e),t[0]=P(t[0]).classList,t.forEach(function(e,i){return i>0&&A(e)&&~e.indexOf(" ")&&Array.prototype.splice.apply(t,[i,1].concat(t[i].split(" ")))}),!!(t[1]&&t.length>1)&&t}t.prototype.$addClass=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];e(this.$options.el,t,"add")},t.prototype.$removeClass=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];e(this.$options.el,t,"remove")},t.prototype.$hasClass=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return(t=i(t,this.$options.el))&&t[0].contains(t[1])},t.prototype.$toggleClass=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var n=(t=i(t,this.$options.el))&&!A(t[t.length-1])?t.pop():void 0,s=1;s<t.length;s++)t[0]&&He?t[0].toggle(t[s],n):t[0][(D(n)?!t[0].contains(t[s]):n)?"add":"remove"](t[s])}}(je);var Fe,ze,Le={init:function(){this.$addClass(this.$name)}},We={props:{cls:Boolean,animation:"list",duration:Number,origin:String,transition:String,queued:Boolean},defaults:{cls:!1,animation:[!1],duration:200,origin:!1,transition:"linear",queued:!1,initProps:{overflow:"",height:"",paddingTop:"",paddingBottom:"",marginTop:"",marginBottom:""},hideProps:{overflow:"hidden",height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0}},computed:{hasAnimation:function(){return!!this.animation[0]},hasTransition:function(){return this.hasAnimation&&!0===this.animation[0]}},methods:{toggleElement:function(t,e,i){var n,s=this,o=document.body,r=o.scrollTop,a=function(t){return $.all(t.toArray().map(function(t){return s._toggleElement(t,e,i)})).then(null,function(){})},l=function(t){var e=a(t);return s._queued=null,o.scrollTop=r,e};return t=Xt(t),!this.hasAnimation||!this.queued||t.length<2?a(t):this._queued?l(t.not(this._queued)):(this._queued=t.not(n=t.filter(function(t,e){return s.isToggled(e)})),a(n).then(function(){return s._queued&&l(s._queued)}))},toggleNow:function(t,e){var i=this;return $.all(Xt(t).toArray().map(function(t){return i._toggleElement(t,e,!1)})).then(null,function(){})},isToggled:function(t){return t=t&&Xt(t)||this.$el,this.cls?t.hasClass(this.cls.split(" ")[0]):!t.attr("hidden")},updateAria:function(t){!1===this.cls&&t.attr("aria-hidden",!this.isToggled(t))},_toggleElement:function(e,i,n){var s=this;if(e=Xt(e),ee.inProgress(e))return ee.cancel(e).then(function(){return s._toggleElement(e,i,n)});i="boolean"==typeof i?i:!this.isToggled(e);var o=t.Event("before"+(i?"show":"hide"));if(e.trigger(o,[this]),!1===o.result)return $.reject();var r=(!1!==n&&this.hasAnimation?this.hasTransition?this._toggleHeight:this._toggleAnimation:this._toggleImmediate)(e,i);return e.trigger(i?"show":"hide",[this]),r.then(function(){return e.trigger(i?"shown":"hidden",[s])})},_toggle:function(t,e){t=Xt(t),this.cls?t.toggleClass(this.cls,~this.cls.indexOf(" ")?void 0:e):t.attr("hidden",!e),t.find("[autofocus]:visible").focus(),this.updateAria(t),je.update(null,t)},_toggleImmediate:function(t,e){return this._toggle(t,e),$.resolve()},_toggleHeight:function(t,e){var i,n=this,s=te.inProgress(t),o=parseFloat(t.children().first().css("margin-top"))+parseFloat(t.children().last().css("margin-bottom")),r=t[0].offsetHeight?t.height()+(s?0:o):0;return te.cancel(t).then(function(){return n.isToggled(t)||n._toggle(t,!0),t.height(""),$(function(a){return ue(function(){i=t.height()+(s?0:o),t.height(r),(e?te.start(t,he(n.initProps,{overflow:"hidden",height:i}),Math.round(n.duration*(1-r/i)),n.transition):te.start(t,n.hideProps,Math.round(n.duration*(r/i)),n.transition).then(function(){n._toggle(t,!1),t.css(n.initProps)})).then(a)})})})},_toggleAnimation:function(t,e){var i=this;return e?(this._toggle(t,!0),ee.in(t,this.animation[0],this.duration,this.origin)):ee.out(t,this.animation[1]||this.animation[0],this.duration,this.origin).then(function(){return i._toggle(t,!1)})}}},Re={mixins:[Le,We],props:{clsPanel:String,selClose:String,escClose:Boolean,bgClose:Boolean,stack:Boolean,container:Boolean},defaults:{cls:"uk-open",escClose:!0,bgClose:!0,overlay:!0,stack:!1,container:!0},computed:{body:function(){return Xt(document.body)},panel:function(){return this.$el.find("."+this.clsPanel)},container:function(){return P(!0===this.$props.container&&je.container||this.$props.container&&B(this.$props.container))},transitionElement:function(){return this.panel},transitionDuration:function(){return L(this.transitionElement.css("transition-duration"))}},events:[{name:"click",delegate:function(){return this.selClose},handler:function(t){t.preventDefault(),this.hide()}},{name:"toggle",handler:function(t){t.preventDefault(),this.toggle()}},{name:"beforeshow",self:!0,handler:function(){var t=this;if(this.isToggled())return!1;var e=Fe&&Fe!==this&&Fe;if(Fe=this,e){if(!this.stack)return e.hide().then(this.show),!1;this.prev=e}else ue(function(){return ut(t.$options.name)});e||(this.scrollbarWidth=window.innerWidth-Zt[0].offsetWidth,this.body.css("overflow-y",this.scrollbarWidth&&this.overlay?"scroll":"")),Zt.addClass(this.clsPage)}},{name:"beforehide",self:!0,handler:function(){if(!this.isToggled())return!1;(Fe=Fe&&Fe!==this&&Fe||this.prev)||dt(this.$options.name)}},{name:"hidden",self:!0,handler:function(){Fe||(Zt.removeClass(this.clsPage),this.body.css("overflow-y",""))}}],methods:{toggle:function(){return this.isToggled()?this.hide():this.show()},show:function(){var t=this;return this.container&&!this.$el.parent().is(this.container)?(this.container.appendChild(this.$el[0]),$(function(e){return ue(function(){return e(t.show())})})):this.toggleNow(this.$el,!0)},hide:function(){return this.toggleNow(this.$el,!1)},getActive:function(){return Fe},_toggleImmediate:function(t,e){var i=this;return this._toggle(t,e),this.transitionDuration?$(function(t,e){i._transition&&(i.transitionElement.off($e,i._transition.handler),i._transition.reject()),i._transition={reject:e,handler:function(){t(),i._transition=null}},i.transitionElement.one($e,i._transition.handler)}):$.resolve()}}},qe={props:{pos:String,offset:null,flip:Boolean,clsPos:String},defaults:{pos:Kt?"bottom-right":"bottom-left",flip:!0,offset:!1,clsPos:""},computed:{pos:function(){return(this.$props.pos+(~this.$props.pos.indexOf("-")?"":"-center")).split("-")},dir:function(){return this.pos[0]},align:function(){return this.pos[1]}},methods:{positionAt:function(t,e,i){c(t,this.clsPos+"-(top|bottom|left|right)(-[a-z]+)?").css({top:"",left:""});var n=M(this.offset)||0,s=this.getAxis(),o=tt(t,e,"x"===s?at(this.dir)+" "+this.align:this.align+" "+at(this.dir),"x"===s?this.dir+" "+this.align:this.align+" "+this.dir,"x"===s?""+("left"===this.dir?-1*n:n):" "+("top"===this.dir?-1*n:n),null,this.flip,i);this.dir="x"===s?o.target.x:o.target.y,this.align="x"===s?o.target.y:o.target.x,t.toggleClass(this.clsPos+"-"+this.dir+"-"+this.align,!1===this.offset)},getAxis:function(){return"top"===this.dir||"bottom"===this.dir?"y":"x"}}},Ye='<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line></svg>',Ue='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><line fill="none" stroke="#000" stroke-width="1.4" x1="1" y1="1" x2="19" y2="19"></line><line fill="none" stroke="#000" stroke-width="1.4" x1="19" y1="1" x2="1" y2="19"></line></svg>',Ve='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect x="9" y="4" width="1" height="11"></rect><rect x="4" y="9" width="11" height="1"></rect></svg>',Xe='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><rect y="9" width="20" height="2"></rect><rect y="3" width="20" height="2"></rect><rect y="15" width="20" height="2"></rect></svg>',Ge='<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><rect x="19" y="0" width="1" height="40"></rect><rect x="0" y="19" width="40" height="1"></rect></svg>',Qe='<svg width="7" height="12" viewBox="0 0 7 12" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.2" points="1 1 6 6 1 11"></polyline></svg>',Je='<svg width="7" height="12" viewBox="0 0 7 12" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.2" points="6 1 1 6 6 11"></polyline></svg>',Ze='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>',Ke='<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.8" cx="17.5" cy="17.5" r="16.5"></circle><line fill="none" stroke="#000" stroke-width="1.8" x1="38" y1="39" x2="29" y2="30"></line></svg>',ti='<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" stroke-width="1.1" cx="10.5" cy="10.5" r="9.5"/><line fill="none" stroke="#000" stroke-width="1.1" x1="23" y1="23" x2="17" y2="17"/></svg>',ei='<svg width="11" height="20" viewBox="0 0 11 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.2" points="1 1 10 10 1 19"></polyline></svg>',ii='<svg width="18" height="34" viewBox="0 0 18 34" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.4" points="1 1 17 17 1 33"></polyline></svg>',ni='<svg width="11" height="20" viewBox="0 0 11 20" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.2" points="10 1 1 10 10 19"></polyline></svg>',si='<svg width="18" height="34" viewBox="0 0 18 34" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.4" points="17 1 1 17 17 33"></polyline></svg>',oi='<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"><circle fill="none" stroke="#000" cx="15" cy="15" r="14"></circle></svg>',ri='<svg width="18" height="10" viewBox="0 0 18 10" xmlns="http://www.w3.org/2000/svg"><polyline fill="none" stroke="#000" stroke-width="1.2" points="1 9 9 1 17 9 "></polyline></svg>',ai={},li=new DOMParser;return je.version="3.0.0-beta.25",function(t){t.mixin.class=Le,t.mixin.modal=Re,t.mixin.position=qe,t.mixin.togglable=We}(je),function(t){var e=0,i=0;n(window,"load resize",t.update),n(window,"scroll",function(i){i.dir=e<window.pageYOffset?"down":"up",e=window.pageYOffset,t.update(i),Ce.flush()}),n(document,xe,function(t){var e=t.target;(q(e,"animationName")||"").match(/^uk-.*(left|right)/)&&(i++,document.body.style.overflowX="hidden",setTimeout(function(){--i||(document.body.style.overflowX="")},L(q(e,"animationDuration"))+100))},!0),t.use(jt),t.use(ft),t.use(pt),t.use(gt),t.use(mt),t.use(vt),t.use(wt),t.use($t),t.use(xt),t.use(kt),t.use(Tt),t.use(bt),t.use(yt),t.use(Ft),t.use(_t),t.use(Et),t.use(St),t.use(At),t.use(Ot),t.use(Dt),t.use(It),t.use(Nt),t.use(Bt),t.use(Pt),t.use(Ct),t.use(Ht),t.use(Mt)}(je),je.use(zt),je.use(Lt),je.use(Wt),je.use(Rt),je.use(qt),je.use(Yt),je.use(Ut),je.use(Vt),function(t){function e(){s(document.body,r),Ce.flush(),new ce(function(e){return e.forEach(function(e){for(var i=e.addedNodes,n=e.removedNodes,o=e.target,l=0;l<i.length;l++)s(i[l],r);for(l=0;l<n.length;l++)s(n[l],a);t.update("update",o,!0)})}).observe(o,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["href"]}),t._initialized=!0}function s(t,e){if(t.nodeType===Node.ELEMENT_NODE&&!t.hasAttribute("uk-no-boot"))for(e(t),t=t.firstChild;t;){var i=t.nextSibling;s(t,e),t=i}}var o=document.documentElement,r=t.connect,a=t.disconnect;ce?document.body?e():new ce(function(){document.body&&(this.disconnect(),e())}).observe(o,{childList:!0,subtree:!0}):i(function(){s(document.body,r),n(o,"DOMNodeInserted",function(t){return s(t.target,r)}),n(o,"DOMNodeRemoved",function(t){return s(t.target,a)})})}(je),je}); |
| 4 | 4 | \ No newline at end of file | ... | ... |
src/main/resources/static/assets/plugins/ztree_v3/css/zTreeStyle/zTreeStyle.css
| 1 | -/*------------------------------------- | |
| 2 | -zTree Style | |
| 3 | - | |
| 4 | -version: 3.5.19 | |
| 5 | -author: Hunter.z | |
| 6 | -email: hunter.z@263.net | |
| 7 | -website: http://code.google.com/p/jquerytree/ | |
| 8 | - | |
| 9 | --------------------------------------*/ | |
| 10 | - | |
| 11 | -.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} | |
| 12 | -.ztree {margin:0; padding:5px; color:#333} | |
| 13 | -.ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} | |
| 14 | -.ztree li ul{ margin:0; padding:0 0 0 18px} | |
| 15 | -.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;} | |
| 16 | - | |
| 17 | -.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; | |
| 18 | - text-decoration:none; vertical-align:top; display: inline-block} | |
| 19 | -.ztree li a:hover {text-decoration:underline} | |
| 20 | -.ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} | |
| 21 | -.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} | |
| 22 | -.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; | |
| 23 | - opacity:0.8; filter:alpha(opacity=80)} | |
| 24 | -.ztree li a.tmpTargetNode_prev {} | |
| 25 | -.ztree li a.tmpTargetNode_next {} | |
| 26 | -.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; | |
| 27 | - font-size:12px; border:1px #7EC4CC solid; *border:0px} | |
| 28 | -.ztree li span {line-height:16px; margin-right:2px} | |
| 29 | -.ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; | |
| 30 | - border:0 none; cursor: pointer;outline:none; | |
| 31 | - background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; | |
| 32 | - background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} | |
| 33 | - | |
| 34 | -.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} | |
| 35 | -.ztree li span.button.chk.checkbox_false_full {background-position:0 0} | |
| 36 | -.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} | |
| 37 | -.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} | |
| 38 | -.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} | |
| 39 | -.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} | |
| 40 | -.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} | |
| 41 | -.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} | |
| 42 | -.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} | |
| 43 | -.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} | |
| 44 | -.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} | |
| 45 | -.ztree li span.button.chk.radio_false_full {background-position:-28px 0} | |
| 46 | -.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} | |
| 47 | -.ztree li span.button.chk.radio_false_part {background-position:-28px -28px} | |
| 48 | -.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} | |
| 49 | -.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} | |
| 50 | -.ztree li span.button.chk.radio_true_full {background-position:-42px 0} | |
| 51 | -.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} | |
| 52 | -.ztree li span.button.chk.radio_true_part {background-position:-42px -28px} | |
| 53 | -.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} | |
| 54 | -.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} | |
| 55 | - | |
| 56 | -.ztree li span.button.switch {width:18px; height:18px} | |
| 57 | -.ztree li span.button.root_open{background-position:-92px -54px} | |
| 58 | -.ztree li span.button.root_close{background-position:-74px -54px} | |
| 59 | -.ztree li span.button.roots_open{background-position:-92px 0} | |
| 60 | -.ztree li span.button.roots_close{background-position:-74px 0} | |
| 61 | -.ztree li span.button.center_open{background-position:-92px -18px} | |
| 62 | -.ztree li span.button.center_close{background-position:-74px -18px} | |
| 63 | -.ztree li span.button.bottom_open{background-position:-92px -36px} | |
| 64 | -.ztree li span.button.bottom_close{background-position:-74px -36px} | |
| 65 | -.ztree li span.button.noline_open{background-position:-92px -72px} | |
| 66 | -.ztree li span.button.noline_close{background-position:-74px -72px} | |
| 67 | -.ztree li span.button.root_docu{ background:none;} | |
| 68 | -.ztree li span.button.roots_docu{background-position:-56px 0} | |
| 69 | -.ztree li span.button.center_docu{background-position:-56px -18px} | |
| 70 | -.ztree li span.button.bottom_docu{background-position:-56px -36px} | |
| 71 | -.ztree li span.button.noline_docu{ background:none;} | |
| 72 | - | |
| 73 | -.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} | |
| 74 | -.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} | |
| 75 | -.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} | |
| 76 | -.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} | |
| 77 | -.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} | |
| 78 | - | |
| 79 | -.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} | |
| 80 | - | |
| 81 | -ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} | |
| 82 | - | |
| 83 | -span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; | |
| 84 | - background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; | |
| 85 | - background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} | |
| 86 | - | |
| 87 | -ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} | |
| 88 | -.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} | |
| 89 | - | |
| 90 | -/* level style*/ | |
| 91 | -/*.ztree li span.button.level0 { | |
| 92 | - display:none; | |
| 93 | -} | |
| 94 | -.ztree li ul.level0 { | |
| 95 | - padding:0; | |
| 96 | - background:none; | |
| 1 | +/*------------------------------------- | |
| 2 | +zTree Style | |
| 3 | + | |
| 4 | +version: 3.5.19 | |
| 5 | +author: Hunter.z | |
| 6 | +email: hunter.z@263.net | |
| 7 | +website: http://code.google.com/p/jquerytree/ | |
| 8 | + | |
| 9 | +-------------------------------------*/ | |
| 10 | + | |
| 11 | +.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} | |
| 12 | +.ztree {margin:0; padding:5px; color:#333} | |
| 13 | +.ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} | |
| 14 | +.ztree li ul{ margin:0; padding:0 0 0 18px} | |
| 15 | +.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;} | |
| 16 | + | |
| 17 | +.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; | |
| 18 | + text-decoration:none; vertical-align:top; display: inline-block} | |
| 19 | +.ztree li a:hover {text-decoration:underline} | |
| 20 | +.ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} | |
| 21 | +.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} | |
| 22 | +.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; | |
| 23 | + opacity:0.8; filter:alpha(opacity=80)} | |
| 24 | +.ztree li a.tmpTargetNode_prev {} | |
| 25 | +.ztree li a.tmpTargetNode_next {} | |
| 26 | +.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; | |
| 27 | + font-size:12px; border:1px #7EC4CC solid; *border:0px} | |
| 28 | +.ztree li span {line-height:16px; margin-right:2px} | |
| 29 | +.ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; | |
| 30 | + border:0 none; cursor: pointer;outline:none; | |
| 31 | + background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; | |
| 32 | + background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} | |
| 33 | + | |
| 34 | +.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} | |
| 35 | +.ztree li span.button.chk.checkbox_false_full {background-position:0 0} | |
| 36 | +.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} | |
| 37 | +.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} | |
| 38 | +.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} | |
| 39 | +.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} | |
| 40 | +.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} | |
| 41 | +.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} | |
| 42 | +.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} | |
| 43 | +.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} | |
| 44 | +.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} | |
| 45 | +.ztree li span.button.chk.radio_false_full {background-position:-28px 0} | |
| 46 | +.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} | |
| 47 | +.ztree li span.button.chk.radio_false_part {background-position:-28px -28px} | |
| 48 | +.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} | |
| 49 | +.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} | |
| 50 | +.ztree li span.button.chk.radio_true_full {background-position:-42px 0} | |
| 51 | +.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} | |
| 52 | +.ztree li span.button.chk.radio_true_part {background-position:-42px -28px} | |
| 53 | +.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} | |
| 54 | +.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} | |
| 55 | + | |
| 56 | +.ztree li span.button.switch {width:18px; height:18px} | |
| 57 | +.ztree li span.button.root_open{background-position:-92px -54px} | |
| 58 | +.ztree li span.button.root_close{background-position:-74px -54px} | |
| 59 | +.ztree li span.button.roots_open{background-position:-92px 0} | |
| 60 | +.ztree li span.button.roots_close{background-position:-74px 0} | |
| 61 | +.ztree li span.button.center_open{background-position:-92px -18px} | |
| 62 | +.ztree li span.button.center_close{background-position:-74px -18px} | |
| 63 | +.ztree li span.button.bottom_open{background-position:-92px -36px} | |
| 64 | +.ztree li span.button.bottom_close{background-position:-74px -36px} | |
| 65 | +.ztree li span.button.noline_open{background-position:-92px -72px} | |
| 66 | +.ztree li span.button.noline_close{background-position:-74px -72px} | |
| 67 | +.ztree li span.button.root_docu{ background:none;} | |
| 68 | +.ztree li span.button.roots_docu{background-position:-56px 0} | |
| 69 | +.ztree li span.button.center_docu{background-position:-56px -18px} | |
| 70 | +.ztree li span.button.bottom_docu{background-position:-56px -36px} | |
| 71 | +.ztree li span.button.noline_docu{ background:none;} | |
| 72 | + | |
| 73 | +.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} | |
| 74 | +.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} | |
| 75 | +.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} | |
| 76 | +.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} | |
| 77 | +.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} | |
| 78 | + | |
| 79 | +.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} | |
| 80 | + | |
| 81 | +ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} | |
| 82 | + | |
| 83 | +span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; | |
| 84 | + background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; | |
| 85 | + background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} | |
| 86 | + | |
| 87 | +ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} | |
| 88 | +.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} | |
| 89 | + | |
| 90 | +/* level style*/ | |
| 91 | +/*.ztree li span.button.level0 { | |
| 92 | + display:none; | |
| 93 | +} | |
| 94 | +.ztree li ul.level0 { | |
| 95 | + padding:0; | |
| 96 | + background:none; | |
| 97 | 97 | }*/ |
| 98 | 98 | \ No newline at end of file | ... | ... |
src/main/resources/static/assets/plugins/ztree_v3/js/jquery.ztree.all.min.js
| 1 | - | |
| 2 | -/* | |
| 3 | - * JQuery zTree core v3.5.29 | |
| 4 | - * http://treejs.cn/ | |
| 5 | - * | |
| 6 | - * Copyright (c) 2010 Hunter.z | |
| 7 | - * | |
| 8 | - * Licensed same as jquery - MIT License | |
| 9 | - * http://www.opensource.org/licenses/mit-license.php | |
| 10 | - * | |
| 11 | - * email: hunter.z@263.net | |
| 12 | - * Date: 2017-06-19 | |
| 13 | - */ | |
| 14 | -(function(r){var I,J,K,L,M,N,v,s={},w={},x={},O={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url",icon:"icon"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text", | |
| 15 | -url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},y=[function(b){var a=b.treeObj,c=f.event;a.bind(c.NODECREATED,function(a,c,g){j.apply(b.callback.onNodeCreated, | |
| 16 | -[a,c,g])});a.bind(c.CLICK,function(a,c,g,k,h){j.apply(b.callback.onClick,[c,g,k,h])});a.bind(c.EXPAND,function(a,c,g){j.apply(b.callback.onExpand,[a,c,g])});a.bind(c.COLLAPSE,function(a,c,g){j.apply(b.callback.onCollapse,[a,c,g])});a.bind(c.ASYNC_SUCCESS,function(a,c,g,k){j.apply(b.callback.onAsyncSuccess,[a,c,g,k])});a.bind(c.ASYNC_ERROR,function(a,c,g,k,h,f){j.apply(b.callback.onAsyncError,[a,c,g,k,h,f])});a.bind(c.REMOVE,function(a,c,g){j.apply(b.callback.onRemove,[a,c,g])});a.bind(c.SELECTED, | |
| 17 | -function(a,c,g){j.apply(b.callback.onSelected,[c,g])});a.bind(c.UNSELECTED,function(a,c,g){j.apply(b.callback.onUnSelected,[c,g])})}],z=[function(b){var a=f.event;b.treeObj.unbind(a.NODECREATED).unbind(a.CLICK).unbind(a.EXPAND).unbind(a.COLLAPSE).unbind(a.ASYNC_SUCCESS).unbind(a.ASYNC_ERROR).unbind(a.REMOVE).unbind(a.SELECTED).unbind(a.UNSELECTED)}],A=[function(b){var a=h.getCache(b);a||(a={},h.setCache(b,a));a.nodes=[];a.doms=[]}],B=[function(b,a,c,d,e,g){if(c){var k=h.getRoot(b),f=b.data.key.children; | |
| 18 | -c.level=a;c.tId=b.treeId+"_"+ ++k.zId;c.parentTId=d?d.tId:null;c.open=typeof c.open=="string"?j.eqs(c.open,"true"):!!c.open;c[f]&&c[f].length>0?(c.isParent=!0,c.zAsync=!0):(c.isParent=typeof c.isParent=="string"?j.eqs(c.isParent,"true"):!!c.isParent,c.open=c.isParent&&!b.async.enable?c.open:!1,c.zAsync=!c.isParent);c.isFirstNode=e;c.isLastNode=g;c.getParentNode=function(){return h.getNodeCache(b,c.parentTId)};c.getPreNode=function(){return h.getPreNode(b,c)};c.getNextNode=function(){return h.getNextNode(b, | |
| 19 | -c)};c.getIndex=function(){return h.getNodeIndex(b,c)};c.getPath=function(){return h.getNodePath(b,c)};c.isAjaxing=!1;h.fixPIdKeyValue(b,c)}}],u=[function(b){var a=b.target,c=h.getSetting(b.data.treeId),d="",e=null,g="",k="",p=null,i=null,q=null;if(j.eqs(b.type,"mousedown"))k="mousedown";else if(j.eqs(b.type,"mouseup"))k="mouseup";else if(j.eqs(b.type,"contextmenu"))k="contextmenu";else if(j.eqs(b.type,"click"))if(j.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+f.id.SWITCH)!==null)d=j.getNodeMainDom(a).id, | |
| 20 | -g="switchNode";else{if(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}]))d=j.getNodeMainDom(q).id,g="clickNode"}else if(j.eqs(b.type,"dblclick")&&(k="dblclick",q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id,g="switchNode";if(k.length>0&&d.length==0&&(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id;if(d.length>0)switch(e=h.getNodeCache(c,d),g){case "switchNode":e.isParent?j.eqs(b.type,"click")||j.eqs(b.type,"dblclick")&& | |
| 21 | -j.apply(c.view.dblClickExpand,[c.treeId,e],c.view.dblClickExpand)?p=I:g="":g="";break;case "clickNode":p=J}switch(k){case "mousedown":i=K;break;case "mouseup":i=L;break;case "dblclick":i=M;break;case "contextmenu":i=N}return{stop:!1,node:e,nodeEventType:g,nodeEventCallback:p,treeEventType:k,treeEventCallback:i}}],C=[function(b){var a=h.getRoot(b);a||(a={},h.setRoot(b,a));a[b.data.key.children]=[];a.expandTriggerFlag=!1;a.curSelectedList=[];a.noSelection=!0;a.createdNodes=[];a.zId=0;a._ver=(new Date).getTime()}], | |
| 22 | -D=[],E=[],F=[],G=[],H=[],h={addNodeCache:function(b,a){h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=a},getNodeCacheId:function(b){return b.substring(b.lastIndexOf("_")+1)},addAfterA:function(b){E.push(b)},addBeforeA:function(b){D.push(b)},addInnerAfterA:function(b){G.push(b)},addInnerBeforeA:function(b){F.push(b)},addInitBind:function(b){y.push(b)},addInitUnBind:function(b){z.push(b)},addInitCache:function(b){A.push(b)},addInitNode:function(b){B.push(b)},addInitProxy:function(b,a){a?u.splice(0,0, | |
| 23 | -b):u.push(b)},addInitRoot:function(b){C.push(b)},addNodesData:function(b,a,c,d){var e=b.data.key.children;a[e]?c>=a[e].length&&(c=-1):(a[e]=[],c=-1);if(a[e].length>0&&c===0)a[e][0].isFirstNode=!1,i.setNodeLineIcos(b,a[e][0]);else if(a[e].length>0&&c<0)a[e][a[e].length-1].isLastNode=!1,i.setNodeLineIcos(b,a[e][a[e].length-1]);a.isParent=!0;c<0?a[e]=a[e].concat(d):(b=[c,0].concat(d),a[e].splice.apply(a[e],b))},addSelectedNode:function(b,a){var c=h.getRoot(b);h.isSelectedNode(b,a)||c.curSelectedList.push(a)}, | |
| 24 | -addCreatedNode:function(b,a){(b.callback.onNodeCreated||b.view.addDiyDom)&&h.getRoot(b).createdNodes.push(a)},addZTreeTools:function(b){H.push(b)},exSetting:function(b){r.extend(!0,O,b)},fixPIdKeyValue:function(b,a){b.data.simpleData.enable&&(a[b.data.simpleData.pIdKey]=a.parentTId?a.getParentNode()[b.data.simpleData.idKey]:b.data.simpleData.rootPId)},getAfterA:function(b,a,c){for(var d=0,e=E.length;d<e;d++)E[d].apply(this,arguments)},getBeforeA:function(b,a,c){for(var d=0,e=D.length;d<e;d++)D[d].apply(this, | |
| 25 | -arguments)},getInnerAfterA:function(b,a,c){for(var d=0,e=G.length;d<e;d++)G[d].apply(this,arguments)},getInnerBeforeA:function(b,a,c){for(var d=0,e=F.length;d<e;d++)F[d].apply(this,arguments)},getCache:function(b){return x[b.treeId]},getNodeIndex:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e;return-1},getNextNode:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId? | |
| 26 | -a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e==g?null:d[c][e+1];return null},getNodeByParam:function(b,a,c,d){if(!a||!c)return null;for(var e=b.data.key.children,g=0,k=a.length;g<k;g++){if(a[g][c]==d)return a[g];var f=h.getNodeByParam(b,a[g][e],c,d);if(f)return f}return null},getNodeCache:function(b,a){if(!a)return null;var c=x[b.treeId].nodes[h.getNodeCacheId(a)];return c?c:null},getNodeName:function(b,a){return""+a[b.data.key.name]},getNodePath:function(b,a){if(!a)return null; | |
| 27 | -var c;(c=a.parentTId?a.getParentNode().getPath():[])&&c.push(a);return c},getNodeTitle:function(b,a){return""+a[b.data.key.title===""?b.data.key.name:b.data.key.title]},getNodes:function(b){return h.getRoot(b)[b.data.key.children]},getNodesByParam:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children,g=[],k=0,f=a.length;k<f;k++)a[k][c]==d&&g.push(a[k]),g=g.concat(h.getNodesByParam(b,a[k][e],c,d));return g},getNodesByParamFuzzy:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children, | |
| 28 | -g=[],d=d.toLowerCase(),k=0,f=a.length;k<f;k++)typeof a[k][c]=="string"&&a[k][c].toLowerCase().indexOf(d)>-1&&g.push(a[k]),g=g.concat(h.getNodesByParamFuzzy(b,a[k][e],c,d));return g},getNodesByFilter:function(b,a,c,d,e){if(!a)return d?null:[];for(var g=b.data.key.children,k=d?null:[],f=0,i=a.length;f<i;f++){if(j.apply(c,[a[f],e],!1)){if(d)return a[f];k.push(a[f])}var q=h.getNodesByFilter(b,a[f][g],c,d,e);if(d&&q)return q;k=d?q:k.concat(q)}return k},getPreNode:function(b,a){if(!a)return null;for(var c= | |
| 29 | -b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length;e<g;e++)if(d[c][e]===a)return e==0?null:d[c][e-1];return null},getRoot:function(b){return b?w[b.treeId]:null},getRoots:function(){return w},getSetting:function(b){return s[b]},getSettings:function(){return s},getZTreeTools:function(b){return(b=this.getRoot(this.getSetting(b)))?b.treeTools:null},initCache:function(b){for(var a=0,c=A.length;a<c;a++)A[a].apply(this,arguments)},initNode:function(b,a,c,d,e,g){for(var k= | |
| 30 | -0,f=B.length;k<f;k++)B[k].apply(this,arguments)},initRoot:function(b){for(var a=0,c=C.length;a<c;a++)C[a].apply(this,arguments)},isSelectedNode:function(b,a){for(var c=h.getRoot(b),d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d])return!0;return!1},removeNodeCache:function(b,a){var c=b.data.key.children;if(a[c])for(var d=0,e=a[c].length;d<e;d++)h.removeNodeCache(b,a[c][d]);h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=null},removeSelectedNode:function(b,a){for(var c=h.getRoot(b), | |
| 31 | -d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d]||!h.getNodeCache(b,c.curSelectedList[d].tId))c.curSelectedList.splice(d,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,a]),d--,e--},setCache:function(b,a){x[b.treeId]=a},setRoot:function(b,a){w[b.treeId]=a},setZTreeTools:function(b,a){for(var c=0,d=H.length;c<d;c++)H[c].apply(this,arguments)},transformToArrayFormat:function(b,a){if(!a)return[];var c=b.data.key.children,d=[];if(j.isArray(a))for(var e=0,g=a.length;e<g;e++)d.push(a[e]), | |
| 32 | -a[e][c]&&(d=d.concat(h.transformToArrayFormat(b,a[e][c])));else d.push(a),a[c]&&(d=d.concat(h.transformToArrayFormat(b,a[c])));return d},transformTozTreeFormat:function(b,a){var c,d,e=b.data.simpleData.idKey,g=b.data.simpleData.pIdKey,k=b.data.key.children;if(!e||e==""||!a)return[];if(j.isArray(a)){var f=[],h={};for(c=0,d=a.length;c<d;c++)h[a[c][e]]=a[c];for(c=0,d=a.length;c<d;c++)h[a[c][g]]&&a[c][e]!=a[c][g]?(h[a[c][g]][k]||(h[a[c][g]][k]=[]),h[a[c][g]][k].push(a[c])):f.push(a[c]);return f}else return[a]}}, | |
| 33 | -m={bindEvent:function(b){for(var a=0,c=y.length;a<c;a++)y[a].apply(this,arguments)},unbindEvent:function(b){for(var a=0,c=z.length;a<c;a++)z[a].apply(this,arguments)},bindTree:function(b){var a={treeId:b.treeId},c=b.treeObj;b.view.txtSelectedEnable||c.bind("selectstart",v).css({"-moz-user-select":"-moz-none"});c.bind("click",a,m.proxy);c.bind("dblclick",a,m.proxy);c.bind("mouseover",a,m.proxy);c.bind("mouseout",a,m.proxy);c.bind("mousedown",a,m.proxy);c.bind("mouseup",a,m.proxy);c.bind("contextmenu", | |
| 34 | -a,m.proxy)},unbindTree:function(b){b.treeObj.unbind("selectstart",v).unbind("click",m.proxy).unbind("dblclick",m.proxy).unbind("mouseover",m.proxy).unbind("mouseout",m.proxy).unbind("mousedown",m.proxy).unbind("mouseup",m.proxy).unbind("contextmenu",m.proxy)},doProxy:function(b){for(var a=[],c=0,d=u.length;c<d;c++){var e=u[c].apply(this,arguments);a.push(e);if(e.stop)break}return a},proxy:function(b){var a=h.getSetting(b.data.treeId);if(!j.uCanDo(a,b))return!0;for(var a=m.doProxy(b),c=!0,d=0,e=a.length;d< | |
| 35 | -e;d++){var g=a[d];g.nodeEventCallback&&(c=g.nodeEventCallback.apply(g,[b,g.node])&&c);g.treeEventCallback&&(c=g.treeEventCallback.apply(g,[b,g.node])&&c)}return c}};I=function(b,a){var c=h.getSetting(b.data.treeId);if(a.open){if(j.apply(c.callback.beforeCollapse,[c.treeId,a],!0)==!1)return!0}else if(j.apply(c.callback.beforeExpand,[c.treeId,a],!0)==!1)return!0;h.getRoot(c).expandTriggerFlag=!0;i.switchNode(c,a);return!0};J=function(b,a){var c=h.getSetting(b.data.treeId),d=c.view.autoCancelSelected&& | |
| 36 | -(b.ctrlKey||b.metaKey)&&h.isSelectedNode(c,a)?0:c.view.autoCancelSelected&&(b.ctrlKey||b.metaKey)&&c.view.selectedMulti?2:1;if(j.apply(c.callback.beforeClick,[c.treeId,a,d],!0)==!1)return!0;d===0?i.cancelPreSelectedNode(c,a):i.selectNode(c,a,d===2);c.treeObj.trigger(f.event.CLICK,[b,c.treeId,a,d]);return!0};K=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeMouseDown,[c.treeId,a],!0)&&j.apply(c.callback.onMouseDown,[b,c.treeId,a]);return!0};L=function(b,a){var c=h.getSetting(b.data.treeId); | |
| 37 | -j.apply(c.callback.beforeMouseUp,[c.treeId,a],!0)&&j.apply(c.callback.onMouseUp,[b,c.treeId,a]);return!0};M=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeDblClick,[c.treeId,a],!0)&&j.apply(c.callback.onDblClick,[b,c.treeId,a]);return!0};N=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeRightClick,[c.treeId,a],!0)&&j.apply(c.callback.onRightClick,[b,c.treeId,a]);return typeof c.callback.onRightClick!="function"};v=function(b){b=b.originalEvent.srcElement.nodeName.toLowerCase(); | |
| 38 | -return b==="input"||b==="textarea"};var j={apply:function(b,a,c){return typeof b=="function"?b.apply(P,a?a:[]):c},canAsync:function(b,a){var c=b.data.key.children;return b.async.enable&&a&&a.isParent&&!(a.zAsync||a[c]&&a[c].length>0)},clone:function(b){if(b===null)return null;var a=j.isArray(b)?[]:{},c;for(c in b)a[c]=b[c]instanceof Date?new Date(b[c].getTime()):typeof b[c]==="object"?j.clone(b[c]):b[c];return a},eqs:function(b,a){return b.toLowerCase()===a.toLowerCase()},isArray:function(b){return Object.prototype.toString.apply(b)=== | |
| 39 | -"[object Array]"},isElement:function(b){return typeof HTMLElement==="object"?b instanceof HTMLElement:b&&typeof b==="object"&&b!==null&&b.nodeType===1&&typeof b.nodeName==="string"},$:function(b,a,c){a&&typeof a!="string"&&(c=a,a="");return typeof b=="string"?r(b,c?c.treeObj.get(0).ownerDocument:null):r("#"+b.tId+a,c?c.treeObj:null)},getMDom:function(b,a,c){if(!a)return null;for(;a&&a.id!==b.treeId;){for(var d=0,e=c.length;a.tagName&&d<e;d++)if(j.eqs(a.tagName,c[d].tagName)&&a.getAttribute(c[d].attrName)!== | |
| 40 | -null)return a;a=a.parentNode}return null},getNodeMainDom:function(b){return r(b).parent("li").get(0)||r(b).parentsUntil("li").parent().get(0)},isChildOrSelf:function(b,a){return r(b).closest("#"+a).length>0},uCanDo:function(){return!0}},i={addNodes:function(b,a,c,d,e){if(!b.data.keep.leaf||!a||a.isParent)if(j.isArray(d)||(d=[d]),b.data.simpleData.enable&&(d=h.transformTozTreeFormat(b,d)),a){var g=l(a,f.id.SWITCH,b),k=l(a,f.id.ICON,b),p=l(a,f.id.UL,b);if(!a.open)i.replaceSwitchClass(a,g,f.folder.CLOSE), | |
| 41 | -i.replaceIcoClass(a,k,f.folder.CLOSE),a.open=!1,p.css({display:"none"});h.addNodesData(b,a,c,d);i.createNodes(b,a.level+1,d,a,c);e||i.expandCollapseParentNode(b,a,!0)}else h.addNodesData(b,h.getRoot(b),c,d),i.createNodes(b,0,d,null,c)},appendNodes:function(b,a,c,d,e,g,k){if(!c)return[];var f=[],j=b.data.key.children,q=(d?d:h.getRoot(b))[j],l,Q;if(!q||e>=q.length-c.length)e=-1;for(var t=0,m=c.length;t<m;t++){var o=c[t];g&&(l=(e===0||q.length==c.length)&&t==0,Q=e<0&&t==c.length-1,h.initNode(b,a,o,d, | |
| 42 | -l,Q,k),h.addNodeCache(b,o));l=[];o[j]&&o[j].length>0&&(l=i.appendNodes(b,a+1,o[j],o,-1,g,k&&o.open));k&&(i.makeDOMNodeMainBefore(f,b,o),i.makeDOMNodeLine(f,b,o),h.getBeforeA(b,o,f),i.makeDOMNodeNameBefore(f,b,o),h.getInnerBeforeA(b,o,f),i.makeDOMNodeIcon(f,b,o),h.getInnerAfterA(b,o,f),i.makeDOMNodeNameAfter(f,b,o),h.getAfterA(b,o,f),o.isParent&&o.open&&i.makeUlHtml(b,o,f,l.join("")),i.makeDOMNodeMainAfter(f,b,o),h.addCreatedNode(b,o))}return f},appendParentULDom:function(b,a){var c=[],d=l(a,b);!d.get(0)&& | |
| 43 | -a.parentTId&&(i.appendParentULDom(b,a.getParentNode()),d=l(a,b));var e=l(a,f.id.UL,b);e.get(0)&&e.remove();e=i.appendNodes(b,a.level+1,a[b.data.key.children],a,-1,!1,!0);i.makeUlHtml(b,a,c,e.join(""));d.append(c.join(""))},asyncNode:function(b,a,c,d){var e,g;if(a&&!a.isParent)return j.apply(d),!1;else if(a&&a.isAjaxing)return!1;else if(j.apply(b.callback.beforeAsync,[b.treeId,a],!0)==!1)return j.apply(d),!1;if(a)a.isAjaxing=!0,l(a,f.id.ICON,b).attr({style:"","class":f.className.BUTTON+" "+f.className.ICO_LOADING}); | |
| 44 | -var k={};for(e=0,g=b.async.autoParam.length;a&&e<g;e++){var p=b.async.autoParam[e].split("="),n=p;p.length>1&&(n=p[1],p=p[0]);k[n]=a[p]}if(j.isArray(b.async.otherParam))for(e=0,g=b.async.otherParam.length;e<g;e+=2)k[b.async.otherParam[e]]=b.async.otherParam[e+1];else for(var q in b.async.otherParam)k[q]=b.async.otherParam[q];var m=h.getRoot(b)._ver;r.ajax({contentType:b.async.contentType,cache:!1,type:b.async.type,url:j.apply(b.async.url,[b.treeId,a],b.async.url),data:b.async.contentType.indexOf("application/json")> | |
| 45 | --1?JSON.stringify(k):k,dataType:b.async.dataType,success:function(g){if(m==h.getRoot(b)._ver){var e=[];try{e=!g||g.length==0?[]:typeof g=="string"?eval("("+g+")"):g}catch(k){e=g}if(a)a.isAjaxing=null,a.zAsync=!0;i.setNodeLineIcos(b,a);e&&e!==""?(e=j.apply(b.async.dataFilter,[b.treeId,a,e],e),i.addNodes(b,a,-1,e?j.clone(e):[],!!c)):i.addNodes(b,a,-1,[],!!c);b.treeObj.trigger(f.event.ASYNC_SUCCESS,[b.treeId,a,g]);j.apply(d)}},error:function(c,d,g){if(m==h.getRoot(b)._ver){if(a)a.isAjaxing=null;i.setNodeLineIcos(b, | |
| 46 | -a);b.treeObj.trigger(f.event.ASYNC_ERROR,[b.treeId,a,c,d,g])}}});return!0},cancelPreSelectedNode:function(b,a,c){var d=h.getRoot(b).curSelectedList,e,g;for(e=d.length-1;e>=0;e--)if(g=d[e],a===g||!a&&(!c||c!==g))if(l(g,f.id.A,b).removeClass(f.node.CURSELECTED),a){h.removeSelectedNode(b,a);break}else d.splice(e,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,g])},createNodeCallback:function(b){if(b.callback.onNodeCreated||b.view.addDiyDom)for(var a=h.getRoot(b);a.createdNodes.length>0;){var c=a.createdNodes.shift(); | |
| 47 | -j.apply(b.view.addDiyDom,[b.treeId,c]);b.callback.onNodeCreated&&b.treeObj.trigger(f.event.NODECREATED,[b.treeId,c])}},createNodes:function(b,a,c,d,e){if(c&&c.length!=0){var g=h.getRoot(b),k=b.data.key.children,k=!d||d.open||!!l(d[k][0],b).get(0);g.createdNodes=[];var a=i.appendNodes(b,a,c,d,e,!0,k),j,n;d?(d=l(d,f.id.UL,b),d.get(0)&&(j=d)):j=b.treeObj;j&&(e>=0&&(n=j.children()[e]),e>=0&&n?r(n).before(a.join("")):j.append(a.join("")));i.createNodeCallback(b)}},destroy:function(b){b&&(h.initCache(b), | |
| 48 | -h.initRoot(b),m.unbindTree(b),m.unbindEvent(b),b.treeObj.empty(),delete s[b.treeId])},expandCollapseNode:function(b,a,c,d,e){var g=h.getRoot(b),k=b.data.key.children,p;if(a){if(g.expandTriggerFlag)p=e,e=function(){p&&p();a.open?b.treeObj.trigger(f.event.EXPAND,[b.treeId,a]):b.treeObj.trigger(f.event.COLLAPSE,[b.treeId,a])},g.expandTriggerFlag=!1;if(!a.open&&a.isParent&&(!l(a,f.id.UL,b).get(0)||a[k]&&a[k].length>0&&!l(a[k][0],b).get(0)))i.appendParentULDom(b,a),i.createNodeCallback(b);if(a.open==c)j.apply(e, | |
| 49 | -[]);else{var c=l(a,f.id.UL,b),g=l(a,f.id.SWITCH,b),n=l(a,f.id.ICON,b);a.isParent?(a.open=!a.open,a.iconOpen&&a.iconClose&&n.attr("style",i.makeNodeIcoStyle(b,a)),a.open?(i.replaceSwitchClass(a,g,f.folder.OPEN),i.replaceIcoClass(a,n,f.folder.OPEN),d==!1||b.view.expandSpeed==""?(c.show(),j.apply(e,[])):a[k]&&a[k].length>0?c.slideDown(b.view.expandSpeed,e):(c.show(),j.apply(e,[]))):(i.replaceSwitchClass(a,g,f.folder.CLOSE),i.replaceIcoClass(a,n,f.folder.CLOSE),d==!1||b.view.expandSpeed==""||!(a[k]&& | |
| 50 | -a[k].length>0)?(c.hide(),j.apply(e,[])):c.slideUp(b.view.expandSpeed,e))):j.apply(e,[])}}else j.apply(e,[])},expandCollapseParentNode:function(b,a,c,d,e){a&&(a.parentTId?(i.expandCollapseNode(b,a,c,d),a.parentTId&&i.expandCollapseParentNode(b,a.getParentNode(),c,d,e)):i.expandCollapseNode(b,a,c,d,e))},expandCollapseSonNode:function(b,a,c,d,e){var g=h.getRoot(b),f=b.data.key.children,g=a?a[f]:g[f],f=a?!1:d,j=h.getRoot(b).expandTriggerFlag;h.getRoot(b).expandTriggerFlag=!1;if(g)for(var n=0,l=g.length;n< | |
| 51 | -l;n++)g[n]&&i.expandCollapseSonNode(b,g[n],c,f);h.getRoot(b).expandTriggerFlag=j;i.expandCollapseNode(b,a,c,d,e)},isSelectedNode:function(b,a){if(!a)return!1;var c=h.getRoot(b).curSelectedList,d;for(d=c.length-1;d>=0;d--)if(a===c[d])return!0;return!1},makeDOMNodeIcon:function(b,a,c){var d=h.getNodeName(a,c),d=a.view.nameIsHTML?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");b.push("<span id='",c.tId,f.id.ICON,"' title='' treeNode",f.id.ICON," class='",i.makeNodeIcoClass(a,c),"' style='", | |
| 52 | -i.makeNodeIcoStyle(a,c),"'></span><span id='",c.tId,f.id.SPAN,"' class='",f.className.NAME,"'>",d,"</span>")},makeDOMNodeLine:function(b,a,c){b.push("<span id='",c.tId,f.id.SWITCH,"' title='' class='",i.makeNodeLineClass(a,c),"' treeNode",f.id.SWITCH,"></span>")},makeDOMNodeMainAfter:function(b){b.push("</li>")},makeDOMNodeMainBefore:function(b,a,c){b.push("<li id='",c.tId,"' class='",f.className.LEVEL,c.level,"' tabindex='0' hidefocus='true' treenode>")},makeDOMNodeNameAfter:function(b){b.push("</a>")}, | |
| 53 | -makeDOMNodeNameBefore:function(b,a,c){var d=h.getNodeTitle(a,c),e=i.makeNodeUrl(a,c),g=i.makeNodeFontCss(a,c),k=[],p;for(p in g)k.push(p,":",g[p],";");b.push("<a id='",c.tId,f.id.A,"' class='",f.className.LEVEL,c.level,"' treeNode",f.id.A,' onclick="',c.click||"",'" ',e!=null&&e.length>0?"href='"+e+"'":""," target='",i.makeNodeTarget(c),"' style='",k.join(""),"'");j.apply(a.view.showTitle,[a.treeId,c],a.view.showTitle)&&d&&b.push("title='",d.replace(/'/g,"'").replace(/</g,"<").replace(/>/g, | |
| 54 | -">"),"'");b.push(">")},makeNodeFontCss:function(b,a){var c=j.apply(b.view.fontCss,[b.treeId,a],b.view.fontCss);return c&&typeof c!="function"?c:{}},makeNodeIcoClass:function(b,a){var c=["ico"];a.isAjaxing||(c[0]=(a.iconSkin?a.iconSkin+"_":"")+c[0],a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU));return f.className.BUTTON+" "+c.join("_")},makeNodeIcoStyle:function(b,a){var c=[];if(!a.isAjaxing){var d=a.isParent&&a.iconOpen&&a.iconClose?a.open?a.iconOpen:a.iconClose: | |
| 55 | -a[b.data.key.icon];d&&c.push("background:url(",d,") 0 0 no-repeat;");(b.view.showIcon==!1||!j.apply(b.view.showIcon,[b.treeId,a],!0))&&c.push("width:0px;height:0px;")}return c.join("")},makeNodeLineClass:function(b,a){var c=[];b.view.showLine?a.level==0&&a.isFirstNode&&a.isLastNode?c.push(f.line.ROOT):a.level==0&&a.isFirstNode?c.push(f.line.ROOTS):a.isLastNode?c.push(f.line.BOTTOM):c.push(f.line.CENTER):c.push(f.line.NOLINE);a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU); | |
| 56 | -return i.makeNodeLineClassEx(a)+c.join("_")},makeNodeLineClassEx:function(b){return f.className.BUTTON+" "+f.className.LEVEL+b.level+" "+f.className.SWITCH+" "},makeNodeTarget:function(b){return b.target||"_blank"},makeNodeUrl:function(b,a){var c=b.data.key.url;return a[c]?a[c]:null},makeUlHtml:function(b,a,c,d){c.push("<ul id='",a.tId,f.id.UL,"' class='",f.className.LEVEL,a.level," ",i.makeUlLineClass(b,a),"' style='display:",a.open?"block":"none","'>");c.push(d);c.push("</ul>")},makeUlLineClass:function(b, | |
| 57 | -a){return b.view.showLine&&!a.isLastNode?f.line.LINE:""},removeChildNodes:function(b,a){if(a){var c=b.data.key.children,d=a[c];if(d){for(var e=0,g=d.length;e<g;e++)h.removeNodeCache(b,d[e]);h.removeSelectedNode(b);delete a[c];b.data.keep.parent?l(a,f.id.UL,b).empty():(a.isParent=!1,a.open=!1,c=l(a,f.id.SWITCH,b),d=l(a,f.id.ICON,b),i.replaceSwitchClass(a,c,f.folder.DOCU),i.replaceIcoClass(a,d,f.folder.DOCU),l(a,f.id.UL,b).remove())}}},scrollIntoView:function(b){if(b){if(!Element.prototype.scrollIntoViewIfNeeded)Element.prototype.scrollIntoViewIfNeeded= | |
| 58 | -function(a){function b(a,d,e,f){return{left:a,top:d,width:e,height:f,right:a+e,bottom:d+f,translate:function(g,k){return b(g+a,k+d,e,f)},relativeFromTo:function(k,h){var i=a,j=d,k=k.offsetParent,h=h.offsetParent;if(k===h)return g;for(;k;k=k.offsetParent)i+=k.offsetLeft+k.clientLeft,j+=k.offsetTop+k.clientTop;for(;h;h=h.offsetParent)i-=h.offsetLeft+h.clientLeft,j-=h.offsetTop+h.clientTop;return b(i,j,e,f)}}}for(var d,e=this,g=b(this.offsetLeft,this.offsetTop,this.offsetWidth,this.offsetHeight);j.isElement(d= | |
| 59 | -e.parentNode);){var f=d.offsetLeft+d.clientLeft,h=d.offsetTop+d.clientTop,g=g.relativeFromTo(e,d).translate(-f,-h);d.scrollLeft=!1===a||g.left<=d.scrollLeft+d.clientWidth&&d.scrollLeft<=g.right-d.clientWidth+d.clientWidth?Math.min(g.left,Math.max(g.right-d.clientWidth,d.scrollLeft)):(g.right-d.clientWidth+g.left)/2;d.scrollTop=!1===a||g.top<=d.scrollTop+d.clientHeight&&d.scrollTop<=g.bottom-d.clientHeight+d.clientHeight?Math.min(g.top,Math.max(g.bottom-d.clientHeight,d.scrollTop)):(g.bottom-d.clientHeight+ | |
| 60 | -g.top)/2;g=g.translate(f-d.scrollLeft,h-d.scrollTop);e=d}};b.scrollIntoViewIfNeeded()}},setFirstNode:function(b,a){var c=b.data.key.children;if(a[c].length>0)a[c][0].isFirstNode=!0},setLastNode:function(b,a){var c=b.data.key.children,d=a[c].length;if(d>0)a[c][d-1].isLastNode=!0},removeNode:function(b,a){var c=h.getRoot(b),d=b.data.key.children,e=a.parentTId?a.getParentNode():c;a.isFirstNode=!1;a.isLastNode=!1;a.getPreNode=function(){return null};a.getNextNode=function(){return null};if(h.getNodeCache(b, | |
| 61 | -a.tId)){l(a,b).remove();h.removeNodeCache(b,a);h.removeSelectedNode(b,a);for(var g=0,k=e[d].length;g<k;g++)if(e[d][g].tId==a.tId){e[d].splice(g,1);break}i.setFirstNode(b,e);i.setLastNode(b,e);var j,g=e[d].length;if(!b.data.keep.parent&&g==0)e.isParent=!1,e.open=!1,g=l(e,f.id.UL,b),k=l(e,f.id.SWITCH,b),j=l(e,f.id.ICON,b),i.replaceSwitchClass(e,k,f.folder.DOCU),i.replaceIcoClass(e,j,f.folder.DOCU),g.css("display","none");else if(b.view.showLine&&g>0){var n=e[d][g-1],g=l(n,f.id.UL,b),k=l(n,f.id.SWITCH, | |
| 62 | -b);j=l(n,f.id.ICON,b);e==c?e[d].length==1?i.replaceSwitchClass(n,k,f.line.ROOT):(c=l(e[d][0],f.id.SWITCH,b),i.replaceSwitchClass(e[d][0],c,f.line.ROOTS),i.replaceSwitchClass(n,k,f.line.BOTTOM)):i.replaceSwitchClass(n,k,f.line.BOTTOM);g.removeClass(f.line.LINE)}}},replaceIcoClass:function(b,a,c){if(a&&!b.isAjaxing&&(b=a.attr("class"),b!=void 0)){b=b.split("_");switch(c){case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:b[b.length-1]=c}a.attr("class",b.join("_"))}},replaceSwitchClass:function(b, | |
| 63 | -a,c){if(a){var d=a.attr("class");if(d!=void 0){d=d.split("_");switch(c){case f.line.ROOT:case f.line.ROOTS:case f.line.CENTER:case f.line.BOTTOM:case f.line.NOLINE:d[0]=i.makeNodeLineClassEx(b)+c;break;case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:d[1]=c}a.attr("class",d.join("_"));c!==f.folder.DOCU?a.removeAttr("disabled"):a.attr("disabled","disabled")}}},selectNode:function(b,a,c){c||i.cancelPreSelectedNode(b,null,a);l(a,f.id.A,b).addClass(f.node.CURSELECTED);h.addSelectedNode(b,a); | |
| 64 | -b.treeObj.trigger(f.event.SELECTED,[b.treeId,a])},setNodeFontCss:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeFontCss(b,a);d&&c.css(d)},setNodeLineIcos:function(b,a){if(a){var c=l(a,f.id.SWITCH,b),d=l(a,f.id.UL,b),e=l(a,f.id.ICON,b),g=i.makeUlLineClass(b,a);g.length==0?d.removeClass(f.line.LINE):d.addClass(g);c.attr("class",i.makeNodeLineClass(b,a));a.isParent?c.removeAttr("disabled"):c.attr("disabled","disabled");e.removeAttr("style");e.attr("style",i.makeNodeIcoStyle(b,a));e.attr("class",i.makeNodeIcoClass(b, | |
| 65 | -a))}},setNodeName:function(b,a){var c=h.getNodeTitle(b,a),d=l(a,f.id.SPAN,b);d.empty();b.view.nameIsHTML?d.html(h.getNodeName(b,a)):d.text(h.getNodeName(b,a));j.apply(b.view.showTitle,[b.treeId,a],b.view.showTitle)&&l(a,f.id.A,b).attr("title",!c?"":c)},setNodeTarget:function(b,a){l(a,f.id.A,b).attr("target",i.makeNodeTarget(a))},setNodeUrl:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeUrl(b,a);d==null||d.length==0?c.removeAttr("href"):c.attr("href",d)},switchNode:function(b,a){a.open||!j.canAsync(b, | |
| 66 | -a)?i.expandCollapseNode(b,a,!a.open):b.async.enable?i.asyncNode(b,a)||i.expandCollapseNode(b,a,!a.open):a&&i.expandCollapseNode(b,a,!a.open)}};r.fn.zTree={consts:{className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch",NAME:"node_name"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"}, | |
| 67 | -id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_z:{tools:j,view:i,event:m,data:h},getZTreeObj:function(b){return(b=h.getZTreeTools(b))?b:null},destroy:function(b){if(b&&b.length>0)i.destroy(h.getSetting(b));else for(var a in s)i.destroy(s[a])},init:function(b,a,c){var d=j.clone(O);r.extend(!0,d,a);d.treeId= | |
| 68 | -b.attr("id");d.treeObj=b;d.treeObj.empty();s[d.treeId]=d;if(typeof document.body.style.maxHeight==="undefined")d.view.expandSpeed="";h.initRoot(d);b=h.getRoot(d);a=d.data.key.children;c=c?j.clone(j.isArray(c)?c:[c]):[];b[a]=d.data.simpleData.enable?h.transformTozTreeFormat(d,c):c;h.initCache(d);m.unbindTree(d);m.bindTree(d);m.unbindEvent(d);m.bindEvent(d);var e={setting:d,addNodes:function(a,b,c,e){function f(){i.addNodes(d,a,b,l,e==!0)}a||(a=null);if(a&&!a.isParent&&d.data.keep.leaf)return null; | |
| 69 | -var h=parseInt(b,10);isNaN(h)?(e=!!c,c=b,b=-1):b=h;if(!c)return null;var l=j.clone(j.isArray(c)?c:[c]);j.canAsync(d,a)?i.asyncNode(d,a,e,f):f();return l},cancelSelectedNode:function(a){i.cancelPreSelectedNode(d,a)},destroy:function(){i.destroy(d)},expandAll:function(a){a=!!a;i.expandCollapseSonNode(d,null,a,!0);return a},expandNode:function(a,b,c,e,f){function m(){var b=l(a,d).get(0);b&&e!==!1&&i.scrollIntoView(b)}if(!a||!a.isParent)return null;b!==!0&&b!==!1&&(b=!a.open);if((f=!!f)&&b&&j.apply(d.callback.beforeExpand, | |
| 70 | -[d.treeId,a],!0)==!1)return null;else if(f&&!b&&j.apply(d.callback.beforeCollapse,[d.treeId,a],!0)==!1)return null;b&&a.parentTId&&i.expandCollapseParentNode(d,a.getParentNode(),b,!1);if(b===a.open&&!c)return null;h.getRoot(d).expandTriggerFlag=f;!j.canAsync(d,a)&&c?i.expandCollapseSonNode(d,a,b,!0,m):(a.open=!b,i.switchNode(this.setting,a),m());return b},getNodes:function(){return h.getNodes(d)},getNodeByParam:function(a,b,c){return!a?null:h.getNodeByParam(d,c?c[d.data.key.children]:h.getNodes(d), | |
| 71 | -a,b)},getNodeByTId:function(a){return h.getNodeCache(d,a)},getNodesByParam:function(a,b,c){return!a?null:h.getNodesByParam(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByParamFuzzy:function(a,b,c){return!a?null:h.getNodesByParamFuzzy(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByFilter:function(a,b,c,e){b=!!b;return!a||typeof a!="function"?b?null:[]:h.getNodesByFilter(d,c?c[d.data.key.children]:h.getNodes(d),a,b,e)},getNodeIndex:function(a){if(!a)return null;for(var b=d.data.key.children, | |
| 72 | -c=a.parentTId?a.getParentNode():h.getRoot(d),e=0,f=c[b].length;e<f;e++)if(c[b][e]==a)return e;return-1},getSelectedNodes:function(){for(var a=[],b=h.getRoot(d).curSelectedList,c=0,e=b.length;c<e;c++)a.push(b[c]);return a},isSelectedNode:function(a){return h.isSelectedNode(d,a)},reAsyncChildNodesPromise:function(a,b,c){return new Promise(function(d,f){try{e.reAsyncChildNodes(a,b,c,function(){d(a)})}catch(h){f(h)}})},reAsyncChildNodes:function(a,b,c,e){if(this.setting.async.enable){var j=!a;j&&(a=h.getRoot(d)); | |
| 73 | -if(b=="refresh"){for(var b=this.setting.data.key.children,m=0,r=a[b]?a[b].length:0;m<r;m++)h.removeNodeCache(d,a[b][m]);h.removeSelectedNode(d);a[b]=[];j?this.setting.treeObj.empty():l(a,f.id.UL,d).empty()}i.asyncNode(this.setting,j?null:a,!!c,e)}},refresh:function(){this.setting.treeObj.empty();var a=h.getRoot(d),b=a[d.data.key.children];h.initRoot(d);a[d.data.key.children]=b;h.initCache(d);i.createNodes(d,0,a[d.data.key.children],null,-1)},removeChildNodes:function(a){if(!a)return null;var b=a[d.data.key.children]; | |
| 74 | -i.removeChildNodes(d,a);return b?b:null},removeNode:function(a,b){a&&(b=!!b,b&&j.apply(d.callback.beforeRemove,[d.treeId,a],!0)==!1||(i.removeNode(d,a),b&&this.setting.treeObj.trigger(f.event.REMOVE,[d.treeId,a])))},selectNode:function(a,b,c){function e(){if(!c){var b=l(a,d).get(0);i.scrollIntoView(b)}}if(a&&j.uCanDo(d)){b=d.view.selectedMulti&&b;if(a.parentTId)i.expandCollapseParentNode(d,a.getParentNode(),!0,!1,e);else if(!c)try{l(a,d).focus().blur()}catch(f){}i.selectNode(d,a,b)}},transformTozTreeNodes:function(a){return h.transformTozTreeFormat(d, | |
| 75 | -a)},transformToArray:function(a){return h.transformToArrayFormat(d,a)},updateNode:function(a){a&&l(a,d).get(0)&&j.uCanDo(d)&&(i.setNodeName(d,a),i.setNodeTarget(d,a),i.setNodeUrl(d,a),i.setNodeLineIcos(d,a),i.setNodeFontCss(d,a))}};b.treeTools=e;h.setZTreeTools(d,e);b[a]&&b[a].length>0?i.createNodes(d,0,b[a],null,-1):d.async.enable&&d.async.url&&d.async.url!==""&&i.asyncNode(d);return e}};var P=r.fn.zTree,l=j.$,f=P.consts})(jQuery); | |
| 76 | - | |
| 77 | -/* | |
| 78 | - * JQuery zTree excheck v3.5.29 | |
| 79 | - * http://treejs.cn/ | |
| 80 | - * | |
| 81 | - * Copyright (c) 2010 Hunter.z | |
| 82 | - * | |
| 83 | - * Licensed same as jquery - MIT License | |
| 84 | - * http://www.opensource.org/licenses/mit-license.php | |
| 85 | - * | |
| 86 | - * email: hunter.z@263.net | |
| 87 | - * Date: 2017-06-19 | |
| 88 | - */ | |
| 89 | -(function(m){var p,q,r,o={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},v={check:{enable:!1,autoCheckTrigger:!1,chkStyle:o.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:o.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}};p=function(c, | |
| 90 | -a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=b.data.key.checked;if(k.apply(b.callback.beforeCheck,[b.treeId,a],!0)==!1)return!0;a[d]=!a[d];e.checkNodeRelation(b,a);d=n(a,j.id.CHECK,b);e.setChkClass(b,d,a);e.repairParentChkClassWithSelf(b,a);b.treeObj.trigger(j.event.CHECK,[c,b.treeId,a]);return!0};q=function(c,a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!0;e.setChkClass(b,d,a);return!0};r=function(c,a){if(a.chkDisabled=== | |
| 91 | -!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!1;e.setChkClass(b,d,a);return!0};m.extend(!0,m.fn.zTree.consts,o);m.extend(!0,m.fn.zTree._z,{tools:{},view:{checkNodeRelation:function(c,a){var b,d,h,i=c.data.key.children,l=c.data.key.checked;b=j.radio;if(c.check.chkStyle==b.STYLE){var f=g.getRadioCheckedList(c);if(a[l])if(c.check.radioType==b.TYPE_ALL){for(d=f.length-1;d>=0;d--)b=f[d],b[l]&&b!=a&&(b[l]=!1,f.splice(d,1),e.setChkClass(c,n(b,j.id.CHECK,c),b),b.parentTId!= | |
| 92 | -a.parentTId&&e.repairParentChkClassWithSelf(c,b));f.push(a)}else{f=a.parentTId?a.getParentNode():g.getRoot(c);for(d=0,h=f[i].length;d<h;d++)b=f[i][d],b[l]&&b!=a&&(b[l]=!1,e.setChkClass(c,n(b,j.id.CHECK,c),b))}else if(c.check.radioType==b.TYPE_ALL)for(d=0,h=f.length;d<h;d++)if(a==f[d]){f.splice(d,1);break}}else a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.Y.indexOf("s")>-1)&&e.setSonNodeCheckBox(c,a,!0),!a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.N.indexOf("s")>-1)&&e.setSonNodeCheckBox(c, | |
| 93 | -a,!1),a[l]&&c.check.chkboxType.Y.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!0),!a[l]&&c.check.chkboxType.N.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!1)},makeChkClass:function(c,a){var b=c.data.key.checked,d=j.checkbox,h=j.radio,i="",i=a.chkDisabled===!0?d.DISABLED:a.halfCheck?d.PART:c.check.chkStyle==h.STYLE?a.check_Child_State<1?d.FULL:d.PART:a[b]?a.check_Child_State===2||a.check_Child_State===-1?d.FULL:d.PART:a.check_Child_State<1?d.FULL:d.PART,b=c.check.chkStyle+"_"+(a[b]?d.TRUE:d.FALSE)+ | |
| 94 | -"_"+i,b=a.check_Focus&&a.chkDisabled!==!0?b+"_"+d.FOCUS:b;return j.className.BUTTON+" "+d.DEFAULT+" "+b},repairAllChk:function(c,a){if(c.check.enable&&c.check.chkStyle===j.checkbox.STYLE)for(var b=c.data.key.checked,d=c.data.key.children,h=g.getRoot(c),i=0,l=h[d].length;i<l;i++){var f=h[d][i];f.nocheck!==!0&&f.chkDisabled!==!0&&(f[b]=a);e.setSonNodeCheckBox(c,f,a)}},repairChkClass:function(c,a){if(a&&(g.makeChkFlag(c,a),a.nocheck!==!0)){var b=n(a,j.id.CHECK,c);e.setChkClass(c,b,a)}},repairParentChkClass:function(c, | |
| 95 | -a){if(a&&a.parentTId){var b=a.getParentNode();e.repairChkClass(c,b);e.repairParentChkClass(c,b)}},repairParentChkClassWithSelf:function(c,a){if(a){var b=c.data.key.children;a[b]&&a[b].length>0?e.repairParentChkClass(c,a[b][0]):e.repairParentChkClass(c,a)}},repairSonChkDisabled:function(c,a,b,d){if(a){var h=c.data.key.children;if(a.chkDisabled!=b)a.chkDisabled=b;e.repairChkClass(c,a);if(a[h]&&d)for(var i=0,l=a[h].length;i<l;i++)e.repairSonChkDisabled(c,a[h][i],b,d)}},repairParentChkDisabled:function(c, | |
| 96 | -a,b,d){if(a){if(a.chkDisabled!=b&&d)a.chkDisabled=b;e.repairChkClass(c,a);e.repairParentChkDisabled(c,a.getParentNode(),b,d)}},setChkClass:function(c,a,b){a&&(b.nocheck===!0?a.hide():a.show(),a.attr("class",e.makeChkClass(c,b)))},setParentNodeCheckBox:function(c,a,b,d){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);g.makeChkFlag(c,a);a.nocheck!==!0&&a.chkDisabled!==!0&&(a[i]=b,e.setChkClass(c,l,a),c.check.autoCheckTrigger&&a!=d&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId, | |
| 97 | -a]));if(a.parentTId){l=!0;if(!b)for(var h=a.getParentNode()[h],f=0,k=h.length;f<k;f++)if(h[f].nocheck!==!0&&h[f].chkDisabled!==!0&&h[f][i]||(h[f].nocheck===!0||h[f].chkDisabled===!0)&&h[f].check_Child_State>0){l=!1;break}l&&e.setParentNodeCheckBox(c,a.getParentNode(),b,d)}},setSonNodeCheckBox:function(c,a,b,d){if(a){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);var f=!1;if(a[h])for(var k=0,m=a[h].length;k<m;k++){var o=a[h][k];e.setSonNodeCheckBox(c,o,b,d);o.chkDisabled=== | |
| 98 | -!0&&(f=!0)}if(a!=g.getRoot(c)&&a.chkDisabled!==!0){f&&a.nocheck!==!0&&g.makeChkFlag(c,a);if(a.nocheck!==!0&&a.chkDisabled!==!0){if(a[i]=b,!f)a.check_Child_State=a[h]&&a[h].length>0?b?2:0:-1}else a.check_Child_State=-1;e.setChkClass(c,l,a);c.check.autoCheckTrigger&&a!=d&&a.nocheck!==!0&&a.chkDisabled!==!0&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId,a])}}}},event:{},data:{getRadioCheckedList:function(c){for(var a=g.getRoot(c).radioCheckedList,b=0,d=a.length;b<d;b++)g.getNodeCache(c,a[b].tId)||(a.splice(b, | |
| 99 | -1),b--,d--);return a},getCheckStatus:function(c,a){if(!c.check.enable||a.nocheck||a.chkDisabled)return null;var b=c.data.key.checked;return{checked:a[b],half:a.halfCheck?a.halfCheck:c.check.chkStyle==j.radio.STYLE?a.check_Child_State===2:a[b]?a.check_Child_State>-1&&a.check_Child_State<2:a.check_Child_State>0}},getTreeCheckedNodes:function(c,a,b,d){if(!a)return[];for(var h=c.data.key.children,i=c.data.key.checked,e=b&&c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL,d=!d?[]:d, | |
| 100 | -f=0,k=a.length;f<k;f++){if(a[f].nocheck!==!0&&a[f].chkDisabled!==!0&&a[f][i]==b&&(d.push(a[f]),e))break;g.getTreeCheckedNodes(c,a[f][h],b,d);if(e&&d.length>0)break}return d},getTreeChangeCheckedNodes:function(c,a,b){if(!a)return[];for(var d=c.data.key.children,h=c.data.key.checked,b=!b?[]:b,i=0,e=a.length;i<e;i++)a[i].nocheck!==!0&&a[i].chkDisabled!==!0&&a[i][h]!=a[i].checkedOld&&b.push(a[i]),g.getTreeChangeCheckedNodes(c,a[i][d],b);return b},makeChkFlag:function(c,a){if(a){var b=c.data.key.children, | |
| 101 | -d=c.data.key.checked,h=-1;if(a[b])for(var i=0,e=a[b].length;i<e;i++){var f=a[b][i],g=-1;if(c.check.chkStyle==j.radio.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?2:f[d]?2:f.check_Child_State>0?2:0,g==2){h=2;break}else g==0&&(h=0);else if(c.check.chkStyle==j.checkbox.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?1:f[d]?f.check_Child_State===-1||f.check_Child_State===2?2:1:f.check_Child_State>0?1:0,g===1){h=1;break}else if(g=== | |
| 102 | -2&&h>-1&&i>0&&g!==h){h=1;break}else if(h===2&&g>-1&&g<2){h=1;break}else g>-1&&(h=g)}a.check_Child_State=h}}}});var m=m.fn.zTree,k=m._z.tools,j=m.consts,e=m._z.view,g=m._z.data,n=k.$;g.exSetting(v);g.addInitBind(function(c){c.treeObj.bind(j.event.CHECK,function(a,b,d,h){a.srcEvent=b;k.apply(c.callback.onCheck,[a,d,h])})});g.addInitUnBind(function(c){c.treeObj.unbind(j.event.CHECK)});g.addInitCache(function(){});g.addInitNode(function(c,a,b,d){if(b){a=c.data.key.checked;typeof b[a]=="string"&&(b[a]= | |
| 103 | -k.eqs(b[a],"true"));b[a]=!!b[a];b.checkedOld=b[a];if(typeof b.nocheck=="string")b.nocheck=k.eqs(b.nocheck,"true");b.nocheck=!!b.nocheck||c.check.nocheckInherit&&d&&!!d.nocheck;if(typeof b.chkDisabled=="string")b.chkDisabled=k.eqs(b.chkDisabled,"true");b.chkDisabled=!!b.chkDisabled||c.check.chkDisabledInherit&&d&&!!d.chkDisabled;if(typeof b.halfCheck=="string")b.halfCheck=k.eqs(b.halfCheck,"true");b.halfCheck=!!b.halfCheck;b.check_Child_State=-1;b.check_Focus=!1;b.getCheckStatus=function(){return g.getCheckStatus(c, | |
| 104 | -b)};c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL&&b[a]&&g.getRoot(c).radioCheckedList.push(b)}});g.addInitProxy(function(c){var a=c.target,b=g.getSetting(c.data.treeId),d="",h=null,e="",l=null;if(k.eqs(c.type,"mouseover")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="mouseoverCheck"}else if(k.eqs(c.type,"mouseout")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d= | |
| 105 | -k.getNodeMainDom(a).id,e="mouseoutCheck"}else if(k.eqs(c.type,"click")&&b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="checkNode";if(d.length>0)switch(h=g.getNodeCache(b,d),e){case "checkNode":l=p;break;case "mouseoverCheck":l=q;break;case "mouseoutCheck":l=r}return{stop:e==="checkNode",node:h,nodeEventType:e,nodeEventCallback:l,treeEventType:"",treeEventCallback:null}},!0);g.addInitRoot(function(c){g.getRoot(c).radioCheckedList=[]}); | |
| 106 | -g.addBeforeA(function(c,a,b){c.check.enable&&(g.makeChkFlag(c,a),b.push("<span ID='",a.tId,j.id.CHECK,"' class='",e.makeChkClass(c,a),"' treeNode",j.id.CHECK,a.nocheck===!0?" style='display:none;'":"","></span>"))});g.addZTreeTools(function(c,a){a.checkNode=function(a,b,c,g){var f=this.setting.data.key.checked;if(a.chkDisabled!==!0&&(b!==!0&&b!==!1&&(b=!a[f]),g=!!g,(a[f]!==b||c)&&!(g&&k.apply(this.setting.callback.beforeCheck,[this.setting.treeId,a],!0)==!1)&&k.uCanDo(this.setting)&&this.setting.check.enable&& | |
| 107 | -a.nocheck!==!0))a[f]=b,b=n(a,j.id.CHECK,this.setting),(c||this.setting.check.chkStyle===j.radio.STYLE)&&e.checkNodeRelation(this.setting,a),e.setChkClass(this.setting,b,a),e.repairParentChkClassWithSelf(this.setting,a),g&&this.setting.treeObj.trigger(j.event.CHECK,[null,this.setting.treeId,a])};a.checkAllNodes=function(a){e.repairAllChk(this.setting,!!a)};a.getCheckedNodes=function(a){var b=this.setting.data.key.children;return g.getTreeCheckedNodes(this.setting,g.getRoot(this.setting)[b],a!==!1)}; | |
| 108 | -a.getChangeCheckedNodes=function(){var a=this.setting.data.key.children;return g.getTreeChangeCheckedNodes(this.setting,g.getRoot(this.setting)[a])};a.setChkDisabled=function(a,b,c,g){b=!!b;c=!!c;e.repairSonChkDisabled(this.setting,a,b,!!g);e.repairParentChkDisabled(this.setting,a.getParentNode(),b,c)};var b=a.updateNode;a.updateNode=function(c,g){b&&b.apply(a,arguments);if(c&&this.setting.check.enable&&n(c,this.setting).get(0)&&k.uCanDo(this.setting)){var i=n(c,j.id.CHECK,this.setting);(g==!0||this.setting.check.chkStyle=== | |
| 109 | -j.radio.STYLE)&&e.checkNodeRelation(this.setting,c);e.setChkClass(this.setting,i,c);e.repairParentChkClassWithSelf(this.setting,c)}}});var s=e.createNodes;e.createNodes=function(c,a,b,d,g){s&&s.apply(e,arguments);b&&e.repairParentChkClassWithSelf(c,d)};var t=e.removeNode;e.removeNode=function(c,a){var b=a.getParentNode();t&&t.apply(e,arguments);a&&b&&(e.repairChkClass(c,b),e.repairParentChkClass(c,b))};var u=e.appendNodes;e.appendNodes=function(c,a,b,d,h,i,j){var f="";u&&(f=u.apply(e,arguments)); | |
| 110 | -d&&g.makeChkFlag(c,d);return f}})(jQuery); | |
| 111 | - | |
| 112 | -/* | |
| 113 | - * JQuery zTree exedit v3.5.29 | |
| 114 | - * http://treejs.cn/ | |
| 115 | - * | |
| 116 | - * Copyright (c) 2010 Hunter.z | |
| 117 | - * | |
| 118 | - * Licensed same as jquery - MIT License | |
| 119 | - * http://www.opensource.org/licenses/mit-license.php | |
| 120 | - * | |
| 121 | - * email: hunter.z@263.net | |
| 122 | - * Date: 2017-06-19 | |
| 123 | - */ | |
| 124 | -(function(v){var J={event:{DRAG:"ztree_drag",DROP:"ztree_drop",RENAME:"ztree_rename",DRAGMOVE:"ztree_dragmove"},id:{EDIT:"_edit",INPUT:"_input",REMOVE:"_remove"},move:{TYPE_INNER:"inner",TYPE_PREV:"prev",TYPE_NEXT:"next"},node:{CURSELECTED_EDIT:"curSelectedNode_Edit",TMPTARGET_TREE:"tmpTargetzTree",TMPTARGET_NODE:"tmpTargetNode"}},x={onHoverOverNode:function(b,a){var c=m.getSetting(b.data.treeId),d=m.getRoot(c);if(d.curHoverNode!=a)x.onHoverOutNode(b);d.curHoverNode=a;f.addHoverDom(c,a)},onHoverOutNode:function(b){var b= | |
| 125 | -m.getSetting(b.data.treeId),a=m.getRoot(b);if(a.curHoverNode&&!m.isSelectedNode(b,a.curHoverNode))f.removeTreeDom(b,a.curHoverNode),a.curHoverNode=null},onMousedownNode:function(b,a){function c(b){if(B.dragFlag==0&&Math.abs(O-b.clientX)<e.edit.drag.minMoveSize&&Math.abs(P-b.clientY)<e.edit.drag.minMoveSize)return!0;var a,c,n,k,i;i=e.data.key.children;M.css("cursor","pointer");if(B.dragFlag==0){if(g.apply(e.callback.beforeDrag,[e.treeId,l],!0)==!1)return r(b),!0;for(a=0,c=l.length;a<c;a++){if(a==0)B.dragNodeShowBefore= | |
| 126 | -[];n=l[a];n.isParent&&n.open?(f.expandCollapseNode(e,n,!n.open),B.dragNodeShowBefore[n.tId]=!0):B.dragNodeShowBefore[n.tId]=!1}B.dragFlag=1;t.showHoverDom=!1;g.showIfameMask(e,!0);n=!0;k=-1;if(l.length>1){var j=l[0].parentTId?l[0].getParentNode()[i]:m.getNodes(e);i=[];for(a=0,c=j.length;a<c;a++)if(B.dragNodeShowBefore[j[a].tId]!==void 0&&(n&&k>-1&&k+1!==a&&(n=!1),i.push(j[a]),k=a),l.length===i.length){l=i;break}}n&&(I=l[0].getPreNode(),R=l[l.length-1].getNextNode());D=o("<ul class='zTreeDragUL'></ul>", | |
| 127 | -e);for(a=0,c=l.length;a<c;a++)n=l[a],n.editNameFlag=!1,f.selectNode(e,n,a>0),f.removeTreeDom(e,n),a>e.edit.drag.maxShowNodeNum-1||(k=o("<li id='"+n.tId+"_tmp'></li>",e),k.append(o(n,d.id.A,e).clone()),k.css("padding","0"),k.children("#"+n.tId+d.id.A).removeClass(d.node.CURSELECTED),D.append(k),a==e.edit.drag.maxShowNodeNum-1&&(k=o("<li id='"+n.tId+"_moretmp'><a> ... </a></li>",e),D.append(k)));D.attr("id",l[0].tId+d.id.UL+"_tmp");D.addClass(e.treeObj.attr("class"));D.appendTo(M);A=o("<span class='tmpzTreeMove_arrow'></span>", | |
| 128 | -e);A.attr("id","zTreeMove_arrow_tmp");A.appendTo(M);e.treeObj.trigger(d.event.DRAG,[b,e.treeId,l])}if(B.dragFlag==1){s&&A.attr("id")==b.target.id&&u&&b.clientX+G.scrollLeft()+2>v("#"+u+d.id.A,s).offset().left?(n=v("#"+u+d.id.A,s),b.target=n.length>0?n.get(0):b.target):s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER)); | |
| 129 | -u=s=null;K=!1;h=e;n=m.getSettings();for(var y in n)if(n[y].treeId&&n[y].edit.enable&&n[y].treeId!=e.treeId&&(b.target.id==n[y].treeId||v(b.target).parents("#"+n[y].treeId).length>0))K=!0,h=n[y];y=G.scrollTop();k=G.scrollLeft();i=h.treeObj.offset();a=h.treeObj.get(0).scrollHeight;n=h.treeObj.get(0).scrollWidth;c=b.clientY+y-i.top;var p=h.treeObj.height()+i.top-b.clientY-y,q=b.clientX+k-i.left,H=h.treeObj.width()+i.left-b.clientX-k;i=c<e.edit.drag.borderMax&&c>e.edit.drag.borderMin;var j=p<e.edit.drag.borderMax&& | |
| 130 | -p>e.edit.drag.borderMin,F=q<e.edit.drag.borderMax&&q>e.edit.drag.borderMin,x=H<e.edit.drag.borderMax&&H>e.edit.drag.borderMin,p=c>e.edit.drag.borderMin&&p>e.edit.drag.borderMin&&q>e.edit.drag.borderMin&&H>e.edit.drag.borderMin,q=i&&h.treeObj.scrollTop()<=0,H=j&&h.treeObj.scrollTop()+h.treeObj.height()+10>=a,N=F&&h.treeObj.scrollLeft()<=0,Q=x&&h.treeObj.scrollLeft()+h.treeObj.width()+10>=n;if(b.target&&g.isChildOrSelf(b.target,h.treeId)){for(var E=b.target;E&&E.tagName&&!g.eqs(E.tagName,"li")&&E.id!= | |
| 131 | -h.treeId;)E=E.parentNode;var S=!0;for(a=0,c=l.length;a<c;a++)if(n=l[a],E.id===n.tId){S=!1;break}else if(o(n,e).find("#"+E.id).length>0){S=!1;break}if(S&&b.target&&g.isChildOrSelf(b.target,E.id+d.id.A))s=v(E),u=E.id}n=l[0];if(p&&g.isChildOrSelf(b.target,h.treeId)){if(!s&&(b.target.id==h.treeId||q||H||N||Q)&&(K||!K&&n.parentTId))s=h.treeObj;i?h.treeObj.scrollTop(h.treeObj.scrollTop()-10):j&&h.treeObj.scrollTop(h.treeObj.scrollTop()+10);F?h.treeObj.scrollLeft(h.treeObj.scrollLeft()-10):x&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+ | |
| 132 | -10);s&&s!=h.treeObj&&s.offset().left<h.treeObj.offset().left&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+s.offset().left-h.treeObj.offset().left)}D.css({top:b.clientY+y+3+"px",left:b.clientX+k+3+"px"});c=a=0;if(s&&s.attr("id")!=h.treeId){var z=u==null?null:m.getNodeCache(h,u);i=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;k=!!(I&&u===I.tId);F=!!(R&&u===R.tId);j=n.parentTId&&n.parentTId==u;n=(i||!F)&&g.apply(h.edit.drag.prev,[h.treeId,l,z], | |
| 133 | -!!h.edit.drag.prev);k=(i||!k)&&g.apply(h.edit.drag.next,[h.treeId,l,z],!!h.edit.drag.next);i=(i||!j)&&!(h.data.keep.leaf&&!z.isParent)&&g.apply(h.edit.drag.inner,[h.treeId,l,z],!!h.edit.drag.inner);j=function(){s=null;u="";w=d.move.TYPE_INNER;A.css({display:"none"});if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null};if(!n&&!k&&!i)j();else if(F=v("#"+u+d.id.A,s),x=z.isLastNode?null:v("#"+z.getNextNode().tId+d.id.A,s.next()),p=F.offset().top,q=F.offset().left, | |
| 134 | -H=n?i?0.25:k?0.5:1:-1,N=k?i?0.75:n?0.5:0:-1,y=(b.clientY+y-p)/F.height(),(H==1||y<=H&&y>=-0.2)&&n?(a=1-A.width(),c=p-A.height()/2,w=d.move.TYPE_PREV):(N==0||y>=N&&y<=1.2)&&k?(a=1-A.width(),c=x==null||z.isParent&&z.open?p+F.height()-A.height()/2:x.offset().top-A.height()/2,w=d.move.TYPE_NEXT):i?(a=5-A.width(),c=p,w=d.move.TYPE_INNER):j(),s){A.css({display:"block",top:c+"px",left:q+a+"px"});F.addClass(d.node.TMPTARGET_NODE+"_"+w);if(T!=u||U!=w)L=(new Date).getTime();if(z&&z.isParent&&w==d.move.TYPE_INNER&& | |
| 135 | -(y=!0,window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId!==z.tId?(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null):window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId===z.tId&&(y=!1),y))window.zTreeMoveTimer=setTimeout(function(){w==d.move.TYPE_INNER&&z&&z.isParent&&!z.open&&(new Date).getTime()-L>h.edit.drag.autoOpenTime&&g.apply(h.callback.beforeDragOpen,[h.treeId,z],!0)&&(f.switchNode(h,z),h.edit.drag.autoExpandTrigger&&h.treeObj.trigger(d.event.EXPAND,[h.treeId,z]))}, | |
| 136 | -h.edit.drag.autoOpenTime+50),window.zTreeMoveTargetNodeTId=z.tId}}else if(w=d.move.TYPE_INNER,s&&g.apply(h.edit.drag.inner,[h.treeId,l,null],!!h.edit.drag.inner)?s.addClass(d.node.TMPTARGET_TREE):s=null,A.css({display:"none"}),window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;T=u;U=w;e.treeObj.trigger(d.event.DRAGMOVE,[b,e.treeId,l])}return!1}function r(b){if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;U=T= | |
| 137 | -null;G.unbind("mousemove",c);G.unbind("mouseup",r);G.unbind("selectstart",k);M.css("cursor","");s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER));g.showIfameMask(e,!1);t.showHoverDom=!0;if(B.dragFlag!=0){B.dragFlag=0;var a,i,j;for(a=0,i=l.length;a<i;a++)j=l[a],j.isParent&&B.dragNodeShowBefore[j.tId]&&!j.open&&(f.expandCollapseNode(e, | |
| 138 | -j,!j.open),delete B.dragNodeShowBefore[j.tId]);D&&D.remove();A&&A.remove();var p=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;!p&&s&&u&&l[0].parentTId&&u==l[0].parentTId&&w==d.move.TYPE_INNER&&(s=null);if(s){var q=u==null?null:m.getNodeCache(h,u);if(g.apply(e.callback.beforeDrop,[h.treeId,l,q,w,p],!0)==!1)f.selectNodes(x,l);else{var C=p?g.clone(l):l;a=function(){if(K){if(!p)for(var a=0,c=l.length;a<c;a++)f.removeNode(e,l[a]);w==d.move.TYPE_INNER? | |
| 139 | -f.addNodes(h,q,-1,C):f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C)}else if(p&&w==d.move.TYPE_INNER)f.addNodes(h,q,-1,C);else if(p)f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C);else if(w!=d.move.TYPE_NEXT)for(a=0,c=C.length;a<c;a++)f.moveNode(h,q,C[a],w,!1);else for(a=-1,c=C.length-1;a<c;c--)f.moveNode(h,q,C[c],w,!1);f.selectNodes(h,C);a=o(C[0],e).get(0);f.scrollIntoView(a);e.treeObj.trigger(d.event.DROP,[b,h.treeId,C,q,w,p])}; | |
| 140 | -w==d.move.TYPE_INNER&&g.canAsync(h,q)?f.asyncNode(h,q,!1,a):a()}}else f.selectNodes(x,l),e.treeObj.trigger(d.event.DROP,[b,e.treeId,l,null,null,null])}}function k(){return!1}var i,j,e=m.getSetting(b.data.treeId),B=m.getRoot(e),t=m.getRoots();if(b.button==2||!e.edit.enable||!e.edit.drag.isCopy&&!e.edit.drag.isMove)return!0;var p=b.target,q=m.getRoot(e).curSelectedList,l=[];if(m.isSelectedNode(e,a))for(i=0,j=q.length;i<j;i++){if(q[i].editNameFlag&&g.eqs(p.tagName,"input")&&p.getAttribute("treeNode"+ | |
| 141 | -d.id.INPUT)!==null)return!0;l.push(q[i]);if(l[0].parentTId!==q[i].parentTId){l=[a];break}}else l=[a];f.editNodeBlur=!0;f.cancelCurEditNode(e);var G=v(e.treeObj.get(0).ownerDocument),M=v(e.treeObj.get(0).ownerDocument.body),D,A,s,K=!1,h=e,x=e,I,R,T=null,U=null,u=null,w=d.move.TYPE_INNER,O=b.clientX,P=b.clientY,L=(new Date).getTime();g.uCanDo(e)&&G.bind("mousemove",c);G.bind("mouseup",r);G.bind("selectstart",k);b.preventDefault&&b.preventDefault();return!0}};v.extend(!0,v.fn.zTree.consts,J);v.extend(!0, | |
| 142 | -v.fn.zTree._z,{tools:{getAbs:function(b){b=b.getBoundingClientRect();return[b.left+(document.body.scrollLeft+document.documentElement.scrollLeft),b.top+(document.body.scrollTop+document.documentElement.scrollTop)]},inputFocus:function(b){b.get(0)&&(b.focus(),g.setCursorPosition(b.get(0),b.val().length))},inputSelect:function(b){b.get(0)&&(b.focus(),b.select())},setCursorPosition:function(b,a){if(b.setSelectionRange)b.focus(),b.setSelectionRange(a,a);else if(b.createTextRange){var c=b.createTextRange(); | |
| 143 | -c.collapse(!0);c.moveEnd("character",a);c.moveStart("character",a);c.select()}},showIfameMask:function(b,a){for(var c=m.getRoot(b);c.dragMaskList.length>0;)c.dragMaskList[0].remove(),c.dragMaskList.shift();if(a)for(var d=o("iframe",b),f=0,i=d.length;f<i;f++){var j=d.get(f),e=g.getAbs(j),j=o("<div id='zTreeMask_"+f+"' class='zTreeMask' style='top:"+e[1]+"px; left:"+e[0]+"px; width:"+j.offsetWidth+"px; height:"+j.offsetHeight+"px;'></div>",b);j.appendTo(o("body",b));c.dragMaskList.push(j)}}},view:{addEditBtn:function(b, | |
| 144 | -a){if(!(a.editNameFlag||o(a,d.id.EDIT,b).length>0)&&g.apply(b.edit.showRenameBtn,[b.treeId,a],b.edit.showRenameBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" edit' id='"+a.tId+d.id.EDIT+"' title='"+g.apply(b.edit.renameTitle,[b.treeId,a],b.edit.renameTitle)+"' treeNode"+d.id.EDIT+" style='display:none;'></span>";c.append(r);o(a,d.id.EDIT,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeEditName,[b.treeId,a],!0)==!1)return!1;f.editNode(b,a);return!1}).show()}}, | |
| 145 | -addRemoveBtn:function(b,a){if(!(a.editNameFlag||o(a,d.id.REMOVE,b).length>0)&&g.apply(b.edit.showRemoveBtn,[b.treeId,a],b.edit.showRemoveBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" remove' id='"+a.tId+d.id.REMOVE+"' title='"+g.apply(b.edit.removeTitle,[b.treeId,a],b.edit.removeTitle)+"' treeNode"+d.id.REMOVE+" style='display:none;'></span>";c.append(r);o(a,d.id.REMOVE,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeRemove,[b.treeId,a],!0)==!1)return!1;f.removeNode(b, | |
| 146 | -a);b.treeObj.trigger(d.event.REMOVE,[b.treeId,a]);return!1}).bind("mousedown",function(){return!0}).show()}},addHoverDom:function(b,a){if(m.getRoots().showHoverDom)a.isHover=!0,b.edit.enable&&(f.addEditBtn(b,a),f.addRemoveBtn(b,a)),g.apply(b.view.addHoverDom,[b.treeId,a])},cancelCurEditNode:function(b,a,c){var r=m.getRoot(b),k=b.data.key.name,i=r.curEditNode;if(i){var j=r.curEditInput,a=a?a:c?i[k]:j.val();if(g.apply(b.callback.beforeRename,[b.treeId,i,a,c],!0)===!1)return!1;i[k]=a;o(i,d.id.A,b).removeClass(d.node.CURSELECTED_EDIT); | |
| 147 | -j.unbind();f.setNodeName(b,i);i.editNameFlag=!1;r.curEditNode=null;r.curEditInput=null;f.selectNode(b,i,!1);b.treeObj.trigger(d.event.RENAME,[b.treeId,i,c])}return r.noSelection=!0},editNode:function(b,a){var c=m.getRoot(b);f.editNodeBlur=!1;if(m.isSelectedNode(b,a)&&c.curEditNode==a&&a.editNameFlag)setTimeout(function(){g.inputFocus(c.curEditInput)},0);else{var r=b.data.key.name;a.editNameFlag=!0;f.removeTreeDom(b,a);f.cancelCurEditNode(b);f.selectNode(b,a,!1);o(a,d.id.SPAN,b).html("<input type=text class='rename' id='"+ | |
| 148 | -a.tId+d.id.INPUT+"' treeNode"+d.id.INPUT+" >");var k=o(a,d.id.INPUT,b);k.attr("value",a[r]);b.edit.editNameSelectAll?g.inputSelect(k):g.inputFocus(k);k.bind("blur",function(){f.editNodeBlur||f.cancelCurEditNode(b)}).bind("keydown",function(a){a.keyCode=="13"?(f.editNodeBlur=!0,f.cancelCurEditNode(b)):a.keyCode=="27"&&f.cancelCurEditNode(b,null,!0)}).bind("click",function(){return!1}).bind("dblclick",function(){return!1});o(a,d.id.A,b).addClass(d.node.CURSELECTED_EDIT);c.curEditInput=k;c.noSelection= | |
| 149 | -!1;c.curEditNode=a}},moveNode:function(b,a,c,r,k,i){var j=m.getRoot(b),e=b.data.key.children;if(a!=c&&(!b.data.keep.leaf||!a||a.isParent||r!=d.move.TYPE_INNER)){var g=c.parentTId?c.getParentNode():j,t=a===null||a==j;t&&a===null&&(a=j);if(t)r=d.move.TYPE_INNER;j=a.parentTId?a.getParentNode():j;if(r!=d.move.TYPE_PREV&&r!=d.move.TYPE_NEXT)r=d.move.TYPE_INNER;if(r==d.move.TYPE_INNER)if(t)c.parentTId=null;else{if(!a.isParent)a.isParent=!0,a.open=!!a.open,f.setNodeLineIcos(b,a);c.parentTId=a.tId}var p; | |
| 150 | -t?p=t=b.treeObj:(!i&&r==d.move.TYPE_INNER?f.expandCollapseNode(b,a,!0,!1):i||f.expandCollapseNode(b,a.getParentNode(),!0,!1),t=o(a,b),p=o(a,d.id.UL,b),t.get(0)&&!p.get(0)&&(p=[],f.makeUlHtml(b,a,p,""),t.append(p.join(""))),p=o(a,d.id.UL,b));var q=o(c,b);q.get(0)?t.get(0)||q.remove():q=f.appendNodes(b,c.level,[c],null,-1,!1,!0).join("");p.get(0)&&r==d.move.TYPE_INNER?p.append(q):t.get(0)&&r==d.move.TYPE_PREV?t.before(q):t.get(0)&&r==d.move.TYPE_NEXT&&t.after(q);var l=-1,v=0,x=null,t=null,D=c.level; | |
| 151 | -if(c.isFirstNode){if(l=0,g[e].length>1)x=g[e][1],x.isFirstNode=!0}else if(c.isLastNode)l=g[e].length-1,x=g[e][l-1],x.isLastNode=!0;else for(p=0,q=g[e].length;p<q;p++)if(g[e][p].tId==c.tId){l=p;break}l>=0&&g[e].splice(l,1);if(r!=d.move.TYPE_INNER)for(p=0,q=j[e].length;p<q;p++)j[e][p].tId==a.tId&&(v=p);if(r==d.move.TYPE_INNER){a[e]||(a[e]=[]);if(a[e].length>0)t=a[e][a[e].length-1],t.isLastNode=!1;a[e].splice(a[e].length,0,c);c.isLastNode=!0;c.isFirstNode=a[e].length==1}else a.isFirstNode&&r==d.move.TYPE_PREV? | |
| 152 | -(j[e].splice(v,0,c),t=a,t.isFirstNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!0,c.isLastNode=!1):a.isLastNode&&r==d.move.TYPE_NEXT?(j[e].splice(v+1,0,c),t=a,t.isLastNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!0):(r==d.move.TYPE_PREV?j[e].splice(v,0,c):j[e].splice(v+1,0,c),c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!1);m.fixPIdKeyValue(b,c);m.setSonNodeLevel(b,c.getParentNode(),c);f.setNodeLineIcos(b,c);f.repairNodeLevelClass(b,c,D);!b.data.keep.parent&&g[e].length< | |
| 153 | -1?(g.isParent=!1,g.open=!1,a=o(g,d.id.UL,b),r=o(g,d.id.SWITCH,b),e=o(g,d.id.ICON,b),f.replaceSwitchClass(g,r,d.folder.DOCU),f.replaceIcoClass(g,e,d.folder.DOCU),a.css("display","none")):x&&f.setNodeLineIcos(b,x);t&&f.setNodeLineIcos(b,t);b.check&&b.check.enable&&f.repairChkClass&&(f.repairChkClass(b,g),f.repairParentChkClassWithSelf(b,g),g!=c.parent&&f.repairParentChkClassWithSelf(b,c));i||f.expandCollapseParentNode(b,c.getParentNode(),!0,k)}},removeEditBtn:function(b,a){o(a,d.id.EDIT,b).unbind().remove()}, | |
| 154 | -removeRemoveBtn:function(b,a){o(a,d.id.REMOVE,b).unbind().remove()},removeTreeDom:function(b,a){a.isHover=!1;f.removeEditBtn(b,a);f.removeRemoveBtn(b,a);g.apply(b.view.removeHoverDom,[b.treeId,a])},repairNodeLevelClass:function(b,a,c){if(c!==a.level){var f=o(a,b),g=o(a,d.id.A,b),b=o(a,d.id.UL,b),c=d.className.LEVEL+c,a=d.className.LEVEL+a.level;f.removeClass(c);f.addClass(a);g.removeClass(c);g.addClass(a);b.removeClass(c);b.addClass(a)}},selectNodes:function(b,a){for(var c=0,d=a.length;c<d;c++)f.selectNode(b, | |
| 155 | -a[c],c>0)}},event:{},data:{setSonNodeLevel:function(b,a,c){if(c){var d=b.data.key.children;c.level=a?a.level+1:0;if(c[d])for(var a=0,f=c[d].length;a<f;a++)c[d][a]&&m.setSonNodeLevel(b,c,c[d][a])}}}});var I=v.fn.zTree,g=I._z.tools,d=I.consts,f=I._z.view,m=I._z.data,o=g.$;m.exSetting({edit:{enable:!1,editNameSelectAll:!1,showRemoveBtn:!0,showRenameBtn:!0,removeTitle:"remove",renameTitle:"rename",drag:{autoExpandTrigger:!1,isCopy:!0,isMove:!0,prev:!0,next:!0,inner:!0,minMoveSize:5,borderMax:10,borderMin:-5, | |
| 156 | -maxShowNodeNum:5,autoOpenTime:500}},view:{addHoverDom:null,removeHoverDom:null},callback:{beforeDrag:null,beforeDragOpen:null,beforeDrop:null,beforeEditName:null,beforeRename:null,onDrag:null,onDragMove:null,onDrop:null,onRename:null}});m.addInitBind(function(b){var a=b.treeObj,c=d.event;a.bind(c.RENAME,function(a,c,d,f){g.apply(b.callback.onRename,[a,c,d,f])});a.bind(c.DRAG,function(a,c,d,f){g.apply(b.callback.onDrag,[c,d,f])});a.bind(c.DRAGMOVE,function(a,c,d,f){g.apply(b.callback.onDragMove,[c, | |
| 157 | -d,f])});a.bind(c.DROP,function(a,c,d,f,e,m,o){g.apply(b.callback.onDrop,[c,d,f,e,m,o])})});m.addInitUnBind(function(b){var b=b.treeObj,a=d.event;b.unbind(a.RENAME);b.unbind(a.DRAG);b.unbind(a.DRAGMOVE);b.unbind(a.DROP)});m.addInitCache(function(){});m.addInitNode(function(b,a,c){if(c)c.isHover=!1,c.editNameFlag=!1});m.addInitProxy(function(b){var a=b.target,c=m.getSetting(b.data.treeId),f=b.relatedTarget,k="",i=null,j="",e=null,o=null;if(g.eqs(b.type,"mouseover")){if(o=g.getMDom(c,a,[{tagName:"a", | |
| 158 | -attrName:"treeNode"+d.id.A}]))k=g.getNodeMainDom(o).id,j="hoverOverNode"}else if(g.eqs(b.type,"mouseout"))o=g.getMDom(c,f,[{tagName:"a",attrName:"treeNode"+d.id.A}]),o||(k="remove",j="hoverOutNode");else if(g.eqs(b.type,"mousedown")&&(o=g.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+d.id.A}])))k=g.getNodeMainDom(o).id,j="mousedownNode";if(k.length>0)switch(i=m.getNodeCache(c,k),j){case "mousedownNode":e=x.onMousedownNode;break;case "hoverOverNode":e=x.onHoverOverNode;break;case "hoverOutNode":e= | |
| 159 | -x.onHoverOutNode}return{stop:!1,node:i,nodeEventType:j,nodeEventCallback:e,treeEventType:"",treeEventCallback:null}});m.addInitRoot(function(b){var b=m.getRoot(b),a=m.getRoots();b.curEditNode=null;b.curEditInput=null;b.curHoverNode=null;b.dragFlag=0;b.dragNodeShowBefore=[];b.dragMaskList=[];a.showHoverDom=!0});m.addZTreeTools(function(b,a){a.cancelEditName=function(a){m.getRoot(this.setting).curEditNode&&f.cancelCurEditNode(this.setting,a?a:null,!0)};a.copyNode=function(a,b,k,i){if(!b)return null; | |
| 160 | -if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;var j=this,e=g.clone(b);if(!a)a=null,k=d.move.TYPE_INNER;k==d.move.TYPE_INNER?(b=function(){f.addNodes(j.setting,a,-1,[e],i)},g.canAsync(this.setting,a)?f.asyncNode(this.setting,a,i,b):b()):(f.addNodes(this.setting,a.parentNode,-1,[e],i),f.moveNode(this.setting,a,e,k,!1,i));return e};a.editName=function(a){a&&a.tId&&a===m.getNodeCache(this.setting,a.tId)&&(a.parentTId&&f.expandCollapseParentNode(this.setting,a.getParentNode(), | |
| 161 | -!0),f.editNode(this.setting,a))};a.moveNode=function(a,b,k,i){function j(){f.moveNode(e.setting,a,b,k,!1,i)}if(!b)return b;if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;else if(a&&(b.parentTId==a.tId&&k==d.move.TYPE_INNER||o(b,this.setting).find("#"+a.tId).length>0))return null;else a||(a=null);var e=this;g.canAsync(this.setting,a)&&k===d.move.TYPE_INNER?f.asyncNode(this.setting,a,i,j):j();return b};a.setEditable=function(a){this.setting.edit.enable=a;return this.refresh()}}); | |
| 162 | -var O=f.cancelPreSelectedNode;f.cancelPreSelectedNode=function(b,a){for(var c=m.getRoot(b).curSelectedList,d=0,g=c.length;d<g;d++)if(!a||a===c[d])if(f.removeTreeDom(b,c[d]),a)break;O&&O.apply(f,arguments)};var P=f.createNodes;f.createNodes=function(b,a,c,d,g){P&&P.apply(f,arguments);c&&f.repairParentChkClassWithSelf&&f.repairParentChkClassWithSelf(b,d)};var W=f.makeNodeUrl;f.makeNodeUrl=function(b,a){return b.edit.enable?null:W.apply(f,arguments)};var L=f.removeNode;f.removeNode=function(b,a){var c= | |
| 163 | -m.getRoot(b);if(c.curEditNode===a)c.curEditNode=null;L&&L.apply(f,arguments)};var Q=f.selectNode;f.selectNode=function(b,a,c){var d=m.getRoot(b);if(m.isSelectedNode(b,a)&&d.curEditNode==a&&a.editNameFlag)return!1;Q&&Q.apply(f,arguments);f.addHoverDom(b,a);return!0};var V=g.uCanDo;g.uCanDo=function(b,a){var c=m.getRoot(b);if(a&&(g.eqs(a.type,"mouseover")||g.eqs(a.type,"mouseout")||g.eqs(a.type,"mousedown")||g.eqs(a.type,"mouseup")))return!0;if(c.curEditNode)f.editNodeBlur=!1,c.curEditInput.focus(); | |
| 164 | -return!c.curEditNode&&(V?V.apply(f,arguments):!0)}})(jQuery); | |
| 165 | - | |
| 1 | + | |
| 2 | +/* | |
| 3 | + * JQuery zTree core v3.5.29 | |
| 4 | + * http://treejs.cn/ | |
| 5 | + * | |
| 6 | + * Copyright (c) 2010 Hunter.z | |
| 7 | + * | |
| 8 | + * Licensed same as jquery - MIT License | |
| 9 | + * http://www.opensource.org/licenses/mit-license.php | |
| 10 | + * | |
| 11 | + * email: hunter.z@263.net | |
| 12 | + * Date: 2017-06-19 | |
| 13 | + */ | |
| 14 | +(function(r){var I,J,K,L,M,N,v,s={},w={},x={},O={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url",icon:"icon"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text", | |
| 15 | +url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},y=[function(b){var a=b.treeObj,c=f.event;a.bind(c.NODECREATED,function(a,c,g){j.apply(b.callback.onNodeCreated, | |
| 16 | +[a,c,g])});a.bind(c.CLICK,function(a,c,g,k,h){j.apply(b.callback.onClick,[c,g,k,h])});a.bind(c.EXPAND,function(a,c,g){j.apply(b.callback.onExpand,[a,c,g])});a.bind(c.COLLAPSE,function(a,c,g){j.apply(b.callback.onCollapse,[a,c,g])});a.bind(c.ASYNC_SUCCESS,function(a,c,g,k){j.apply(b.callback.onAsyncSuccess,[a,c,g,k])});a.bind(c.ASYNC_ERROR,function(a,c,g,k,h,f){j.apply(b.callback.onAsyncError,[a,c,g,k,h,f])});a.bind(c.REMOVE,function(a,c,g){j.apply(b.callback.onRemove,[a,c,g])});a.bind(c.SELECTED, | |
| 17 | +function(a,c,g){j.apply(b.callback.onSelected,[c,g])});a.bind(c.UNSELECTED,function(a,c,g){j.apply(b.callback.onUnSelected,[c,g])})}],z=[function(b){var a=f.event;b.treeObj.unbind(a.NODECREATED).unbind(a.CLICK).unbind(a.EXPAND).unbind(a.COLLAPSE).unbind(a.ASYNC_SUCCESS).unbind(a.ASYNC_ERROR).unbind(a.REMOVE).unbind(a.SELECTED).unbind(a.UNSELECTED)}],A=[function(b){var a=h.getCache(b);a||(a={},h.setCache(b,a));a.nodes=[];a.doms=[]}],B=[function(b,a,c,d,e,g){if(c){var k=h.getRoot(b),f=b.data.key.children; | |
| 18 | +c.level=a;c.tId=b.treeId+"_"+ ++k.zId;c.parentTId=d?d.tId:null;c.open=typeof c.open=="string"?j.eqs(c.open,"true"):!!c.open;c[f]&&c[f].length>0?(c.isParent=!0,c.zAsync=!0):(c.isParent=typeof c.isParent=="string"?j.eqs(c.isParent,"true"):!!c.isParent,c.open=c.isParent&&!b.async.enable?c.open:!1,c.zAsync=!c.isParent);c.isFirstNode=e;c.isLastNode=g;c.getParentNode=function(){return h.getNodeCache(b,c.parentTId)};c.getPreNode=function(){return h.getPreNode(b,c)};c.getNextNode=function(){return h.getNextNode(b, | |
| 19 | +c)};c.getIndex=function(){return h.getNodeIndex(b,c)};c.getPath=function(){return h.getNodePath(b,c)};c.isAjaxing=!1;h.fixPIdKeyValue(b,c)}}],u=[function(b){var a=b.target,c=h.getSetting(b.data.treeId),d="",e=null,g="",k="",p=null,i=null,q=null;if(j.eqs(b.type,"mousedown"))k="mousedown";else if(j.eqs(b.type,"mouseup"))k="mouseup";else if(j.eqs(b.type,"contextmenu"))k="contextmenu";else if(j.eqs(b.type,"click"))if(j.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+f.id.SWITCH)!==null)d=j.getNodeMainDom(a).id, | |
| 20 | +g="switchNode";else{if(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}]))d=j.getNodeMainDom(q).id,g="clickNode"}else if(j.eqs(b.type,"dblclick")&&(k="dblclick",q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id,g="switchNode";if(k.length>0&&d.length==0&&(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id;if(d.length>0)switch(e=h.getNodeCache(c,d),g){case "switchNode":e.isParent?j.eqs(b.type,"click")||j.eqs(b.type,"dblclick")&& | |
| 21 | +j.apply(c.view.dblClickExpand,[c.treeId,e],c.view.dblClickExpand)?p=I:g="":g="";break;case "clickNode":p=J}switch(k){case "mousedown":i=K;break;case "mouseup":i=L;break;case "dblclick":i=M;break;case "contextmenu":i=N}return{stop:!1,node:e,nodeEventType:g,nodeEventCallback:p,treeEventType:k,treeEventCallback:i}}],C=[function(b){var a=h.getRoot(b);a||(a={},h.setRoot(b,a));a[b.data.key.children]=[];a.expandTriggerFlag=!1;a.curSelectedList=[];a.noSelection=!0;a.createdNodes=[];a.zId=0;a._ver=(new Date).getTime()}], | |
| 22 | +D=[],E=[],F=[],G=[],H=[],h={addNodeCache:function(b,a){h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=a},getNodeCacheId:function(b){return b.substring(b.lastIndexOf("_")+1)},addAfterA:function(b){E.push(b)},addBeforeA:function(b){D.push(b)},addInnerAfterA:function(b){G.push(b)},addInnerBeforeA:function(b){F.push(b)},addInitBind:function(b){y.push(b)},addInitUnBind:function(b){z.push(b)},addInitCache:function(b){A.push(b)},addInitNode:function(b){B.push(b)},addInitProxy:function(b,a){a?u.splice(0,0, | |
| 23 | +b):u.push(b)},addInitRoot:function(b){C.push(b)},addNodesData:function(b,a,c,d){var e=b.data.key.children;a[e]?c>=a[e].length&&(c=-1):(a[e]=[],c=-1);if(a[e].length>0&&c===0)a[e][0].isFirstNode=!1,i.setNodeLineIcos(b,a[e][0]);else if(a[e].length>0&&c<0)a[e][a[e].length-1].isLastNode=!1,i.setNodeLineIcos(b,a[e][a[e].length-1]);a.isParent=!0;c<0?a[e]=a[e].concat(d):(b=[c,0].concat(d),a[e].splice.apply(a[e],b))},addSelectedNode:function(b,a){var c=h.getRoot(b);h.isSelectedNode(b,a)||c.curSelectedList.push(a)}, | |
| 24 | +addCreatedNode:function(b,a){(b.callback.onNodeCreated||b.view.addDiyDom)&&h.getRoot(b).createdNodes.push(a)},addZTreeTools:function(b){H.push(b)},exSetting:function(b){r.extend(!0,O,b)},fixPIdKeyValue:function(b,a){b.data.simpleData.enable&&(a[b.data.simpleData.pIdKey]=a.parentTId?a.getParentNode()[b.data.simpleData.idKey]:b.data.simpleData.rootPId)},getAfterA:function(b,a,c){for(var d=0,e=E.length;d<e;d++)E[d].apply(this,arguments)},getBeforeA:function(b,a,c){for(var d=0,e=D.length;d<e;d++)D[d].apply(this, | |
| 25 | +arguments)},getInnerAfterA:function(b,a,c){for(var d=0,e=G.length;d<e;d++)G[d].apply(this,arguments)},getInnerBeforeA:function(b,a,c){for(var d=0,e=F.length;d<e;d++)F[d].apply(this,arguments)},getCache:function(b){return x[b.treeId]},getNodeIndex:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e;return-1},getNextNode:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId? | |
| 26 | +a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e==g?null:d[c][e+1];return null},getNodeByParam:function(b,a,c,d){if(!a||!c)return null;for(var e=b.data.key.children,g=0,k=a.length;g<k;g++){if(a[g][c]==d)return a[g];var f=h.getNodeByParam(b,a[g][e],c,d);if(f)return f}return null},getNodeCache:function(b,a){if(!a)return null;var c=x[b.treeId].nodes[h.getNodeCacheId(a)];return c?c:null},getNodeName:function(b,a){return""+a[b.data.key.name]},getNodePath:function(b,a){if(!a)return null; | |
| 27 | +var c;(c=a.parentTId?a.getParentNode().getPath():[])&&c.push(a);return c},getNodeTitle:function(b,a){return""+a[b.data.key.title===""?b.data.key.name:b.data.key.title]},getNodes:function(b){return h.getRoot(b)[b.data.key.children]},getNodesByParam:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children,g=[],k=0,f=a.length;k<f;k++)a[k][c]==d&&g.push(a[k]),g=g.concat(h.getNodesByParam(b,a[k][e],c,d));return g},getNodesByParamFuzzy:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children, | |
| 28 | +g=[],d=d.toLowerCase(),k=0,f=a.length;k<f;k++)typeof a[k][c]=="string"&&a[k][c].toLowerCase().indexOf(d)>-1&&g.push(a[k]),g=g.concat(h.getNodesByParamFuzzy(b,a[k][e],c,d));return g},getNodesByFilter:function(b,a,c,d,e){if(!a)return d?null:[];for(var g=b.data.key.children,k=d?null:[],f=0,i=a.length;f<i;f++){if(j.apply(c,[a[f],e],!1)){if(d)return a[f];k.push(a[f])}var q=h.getNodesByFilter(b,a[f][g],c,d,e);if(d&&q)return q;k=d?q:k.concat(q)}return k},getPreNode:function(b,a){if(!a)return null;for(var c= | |
| 29 | +b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length;e<g;e++)if(d[c][e]===a)return e==0?null:d[c][e-1];return null},getRoot:function(b){return b?w[b.treeId]:null},getRoots:function(){return w},getSetting:function(b){return s[b]},getSettings:function(){return s},getZTreeTools:function(b){return(b=this.getRoot(this.getSetting(b)))?b.treeTools:null},initCache:function(b){for(var a=0,c=A.length;a<c;a++)A[a].apply(this,arguments)},initNode:function(b,a,c,d,e,g){for(var k= | |
| 30 | +0,f=B.length;k<f;k++)B[k].apply(this,arguments)},initRoot:function(b){for(var a=0,c=C.length;a<c;a++)C[a].apply(this,arguments)},isSelectedNode:function(b,a){for(var c=h.getRoot(b),d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d])return!0;return!1},removeNodeCache:function(b,a){var c=b.data.key.children;if(a[c])for(var d=0,e=a[c].length;d<e;d++)h.removeNodeCache(b,a[c][d]);h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=null},removeSelectedNode:function(b,a){for(var c=h.getRoot(b), | |
| 31 | +d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d]||!h.getNodeCache(b,c.curSelectedList[d].tId))c.curSelectedList.splice(d,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,a]),d--,e--},setCache:function(b,a){x[b.treeId]=a},setRoot:function(b,a){w[b.treeId]=a},setZTreeTools:function(b,a){for(var c=0,d=H.length;c<d;c++)H[c].apply(this,arguments)},transformToArrayFormat:function(b,a){if(!a)return[];var c=b.data.key.children,d=[];if(j.isArray(a))for(var e=0,g=a.length;e<g;e++)d.push(a[e]), | |
| 32 | +a[e][c]&&(d=d.concat(h.transformToArrayFormat(b,a[e][c])));else d.push(a),a[c]&&(d=d.concat(h.transformToArrayFormat(b,a[c])));return d},transformTozTreeFormat:function(b,a){var c,d,e=b.data.simpleData.idKey,g=b.data.simpleData.pIdKey,k=b.data.key.children;if(!e||e==""||!a)return[];if(j.isArray(a)){var f=[],h={};for(c=0,d=a.length;c<d;c++)h[a[c][e]]=a[c];for(c=0,d=a.length;c<d;c++)h[a[c][g]]&&a[c][e]!=a[c][g]?(h[a[c][g]][k]||(h[a[c][g]][k]=[]),h[a[c][g]][k].push(a[c])):f.push(a[c]);return f}else return[a]}}, | |
| 33 | +m={bindEvent:function(b){for(var a=0,c=y.length;a<c;a++)y[a].apply(this,arguments)},unbindEvent:function(b){for(var a=0,c=z.length;a<c;a++)z[a].apply(this,arguments)},bindTree:function(b){var a={treeId:b.treeId},c=b.treeObj;b.view.txtSelectedEnable||c.bind("selectstart",v).css({"-moz-user-select":"-moz-none"});c.bind("click",a,m.proxy);c.bind("dblclick",a,m.proxy);c.bind("mouseover",a,m.proxy);c.bind("mouseout",a,m.proxy);c.bind("mousedown",a,m.proxy);c.bind("mouseup",a,m.proxy);c.bind("contextmenu", | |
| 34 | +a,m.proxy)},unbindTree:function(b){b.treeObj.unbind("selectstart",v).unbind("click",m.proxy).unbind("dblclick",m.proxy).unbind("mouseover",m.proxy).unbind("mouseout",m.proxy).unbind("mousedown",m.proxy).unbind("mouseup",m.proxy).unbind("contextmenu",m.proxy)},doProxy:function(b){for(var a=[],c=0,d=u.length;c<d;c++){var e=u[c].apply(this,arguments);a.push(e);if(e.stop)break}return a},proxy:function(b){var a=h.getSetting(b.data.treeId);if(!j.uCanDo(a,b))return!0;for(var a=m.doProxy(b),c=!0,d=0,e=a.length;d< | |
| 35 | +e;d++){var g=a[d];g.nodeEventCallback&&(c=g.nodeEventCallback.apply(g,[b,g.node])&&c);g.treeEventCallback&&(c=g.treeEventCallback.apply(g,[b,g.node])&&c)}return c}};I=function(b,a){var c=h.getSetting(b.data.treeId);if(a.open){if(j.apply(c.callback.beforeCollapse,[c.treeId,a],!0)==!1)return!0}else if(j.apply(c.callback.beforeExpand,[c.treeId,a],!0)==!1)return!0;h.getRoot(c).expandTriggerFlag=!0;i.switchNode(c,a);return!0};J=function(b,a){var c=h.getSetting(b.data.treeId),d=c.view.autoCancelSelected&& | |
| 36 | +(b.ctrlKey||b.metaKey)&&h.isSelectedNode(c,a)?0:c.view.autoCancelSelected&&(b.ctrlKey||b.metaKey)&&c.view.selectedMulti?2:1;if(j.apply(c.callback.beforeClick,[c.treeId,a,d],!0)==!1)return!0;d===0?i.cancelPreSelectedNode(c,a):i.selectNode(c,a,d===2);c.treeObj.trigger(f.event.CLICK,[b,c.treeId,a,d]);return!0};K=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeMouseDown,[c.treeId,a],!0)&&j.apply(c.callback.onMouseDown,[b,c.treeId,a]);return!0};L=function(b,a){var c=h.getSetting(b.data.treeId); | |
| 37 | +j.apply(c.callback.beforeMouseUp,[c.treeId,a],!0)&&j.apply(c.callback.onMouseUp,[b,c.treeId,a]);return!0};M=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeDblClick,[c.treeId,a],!0)&&j.apply(c.callback.onDblClick,[b,c.treeId,a]);return!0};N=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeRightClick,[c.treeId,a],!0)&&j.apply(c.callback.onRightClick,[b,c.treeId,a]);return typeof c.callback.onRightClick!="function"};v=function(b){b=b.originalEvent.srcElement.nodeName.toLowerCase(); | |
| 38 | +return b==="input"||b==="textarea"};var j={apply:function(b,a,c){return typeof b=="function"?b.apply(P,a?a:[]):c},canAsync:function(b,a){var c=b.data.key.children;return b.async.enable&&a&&a.isParent&&!(a.zAsync||a[c]&&a[c].length>0)},clone:function(b){if(b===null)return null;var a=j.isArray(b)?[]:{},c;for(c in b)a[c]=b[c]instanceof Date?new Date(b[c].getTime()):typeof b[c]==="object"?j.clone(b[c]):b[c];return a},eqs:function(b,a){return b.toLowerCase()===a.toLowerCase()},isArray:function(b){return Object.prototype.toString.apply(b)=== | |
| 39 | +"[object Array]"},isElement:function(b){return typeof HTMLElement==="object"?b instanceof HTMLElement:b&&typeof b==="object"&&b!==null&&b.nodeType===1&&typeof b.nodeName==="string"},$:function(b,a,c){a&&typeof a!="string"&&(c=a,a="");return typeof b=="string"?r(b,c?c.treeObj.get(0).ownerDocument:null):r("#"+b.tId+a,c?c.treeObj:null)},getMDom:function(b,a,c){if(!a)return null;for(;a&&a.id!==b.treeId;){for(var d=0,e=c.length;a.tagName&&d<e;d++)if(j.eqs(a.tagName,c[d].tagName)&&a.getAttribute(c[d].attrName)!== | |
| 40 | +null)return a;a=a.parentNode}return null},getNodeMainDom:function(b){return r(b).parent("li").get(0)||r(b).parentsUntil("li").parent().get(0)},isChildOrSelf:function(b,a){return r(b).closest("#"+a).length>0},uCanDo:function(){return!0}},i={addNodes:function(b,a,c,d,e){if(!b.data.keep.leaf||!a||a.isParent)if(j.isArray(d)||(d=[d]),b.data.simpleData.enable&&(d=h.transformTozTreeFormat(b,d)),a){var g=l(a,f.id.SWITCH,b),k=l(a,f.id.ICON,b),p=l(a,f.id.UL,b);if(!a.open)i.replaceSwitchClass(a,g,f.folder.CLOSE), | |
| 41 | +i.replaceIcoClass(a,k,f.folder.CLOSE),a.open=!1,p.css({display:"none"});h.addNodesData(b,a,c,d);i.createNodes(b,a.level+1,d,a,c);e||i.expandCollapseParentNode(b,a,!0)}else h.addNodesData(b,h.getRoot(b),c,d),i.createNodes(b,0,d,null,c)},appendNodes:function(b,a,c,d,e,g,k){if(!c)return[];var f=[],j=b.data.key.children,q=(d?d:h.getRoot(b))[j],l,Q;if(!q||e>=q.length-c.length)e=-1;for(var t=0,m=c.length;t<m;t++){var o=c[t];g&&(l=(e===0||q.length==c.length)&&t==0,Q=e<0&&t==c.length-1,h.initNode(b,a,o,d, | |
| 42 | +l,Q,k),h.addNodeCache(b,o));l=[];o[j]&&o[j].length>0&&(l=i.appendNodes(b,a+1,o[j],o,-1,g,k&&o.open));k&&(i.makeDOMNodeMainBefore(f,b,o),i.makeDOMNodeLine(f,b,o),h.getBeforeA(b,o,f),i.makeDOMNodeNameBefore(f,b,o),h.getInnerBeforeA(b,o,f),i.makeDOMNodeIcon(f,b,o),h.getInnerAfterA(b,o,f),i.makeDOMNodeNameAfter(f,b,o),h.getAfterA(b,o,f),o.isParent&&o.open&&i.makeUlHtml(b,o,f,l.join("")),i.makeDOMNodeMainAfter(f,b,o),h.addCreatedNode(b,o))}return f},appendParentULDom:function(b,a){var c=[],d=l(a,b);!d.get(0)&& | |
| 43 | +a.parentTId&&(i.appendParentULDom(b,a.getParentNode()),d=l(a,b));var e=l(a,f.id.UL,b);e.get(0)&&e.remove();e=i.appendNodes(b,a.level+1,a[b.data.key.children],a,-1,!1,!0);i.makeUlHtml(b,a,c,e.join(""));d.append(c.join(""))},asyncNode:function(b,a,c,d){var e,g;if(a&&!a.isParent)return j.apply(d),!1;else if(a&&a.isAjaxing)return!1;else if(j.apply(b.callback.beforeAsync,[b.treeId,a],!0)==!1)return j.apply(d),!1;if(a)a.isAjaxing=!0,l(a,f.id.ICON,b).attr({style:"","class":f.className.BUTTON+" "+f.className.ICO_LOADING}); | |
| 44 | +var k={};for(e=0,g=b.async.autoParam.length;a&&e<g;e++){var p=b.async.autoParam[e].split("="),n=p;p.length>1&&(n=p[1],p=p[0]);k[n]=a[p]}if(j.isArray(b.async.otherParam))for(e=0,g=b.async.otherParam.length;e<g;e+=2)k[b.async.otherParam[e]]=b.async.otherParam[e+1];else for(var q in b.async.otherParam)k[q]=b.async.otherParam[q];var m=h.getRoot(b)._ver;r.ajax({contentType:b.async.contentType,cache:!1,type:b.async.type,url:j.apply(b.async.url,[b.treeId,a],b.async.url),data:b.async.contentType.indexOf("application/json")> | |
| 45 | +-1?JSON.stringify(k):k,dataType:b.async.dataType,success:function(g){if(m==h.getRoot(b)._ver){var e=[];try{e=!g||g.length==0?[]:typeof g=="string"?eval("("+g+")"):g}catch(k){e=g}if(a)a.isAjaxing=null,a.zAsync=!0;i.setNodeLineIcos(b,a);e&&e!==""?(e=j.apply(b.async.dataFilter,[b.treeId,a,e],e),i.addNodes(b,a,-1,e?j.clone(e):[],!!c)):i.addNodes(b,a,-1,[],!!c);b.treeObj.trigger(f.event.ASYNC_SUCCESS,[b.treeId,a,g]);j.apply(d)}},error:function(c,d,g){if(m==h.getRoot(b)._ver){if(a)a.isAjaxing=null;i.setNodeLineIcos(b, | |
| 46 | +a);b.treeObj.trigger(f.event.ASYNC_ERROR,[b.treeId,a,c,d,g])}}});return!0},cancelPreSelectedNode:function(b,a,c){var d=h.getRoot(b).curSelectedList,e,g;for(e=d.length-1;e>=0;e--)if(g=d[e],a===g||!a&&(!c||c!==g))if(l(g,f.id.A,b).removeClass(f.node.CURSELECTED),a){h.removeSelectedNode(b,a);break}else d.splice(e,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,g])},createNodeCallback:function(b){if(b.callback.onNodeCreated||b.view.addDiyDom)for(var a=h.getRoot(b);a.createdNodes.length>0;){var c=a.createdNodes.shift(); | |
| 47 | +j.apply(b.view.addDiyDom,[b.treeId,c]);b.callback.onNodeCreated&&b.treeObj.trigger(f.event.NODECREATED,[b.treeId,c])}},createNodes:function(b,a,c,d,e){if(c&&c.length!=0){var g=h.getRoot(b),k=b.data.key.children,k=!d||d.open||!!l(d[k][0],b).get(0);g.createdNodes=[];var a=i.appendNodes(b,a,c,d,e,!0,k),j,n;d?(d=l(d,f.id.UL,b),d.get(0)&&(j=d)):j=b.treeObj;j&&(e>=0&&(n=j.children()[e]),e>=0&&n?r(n).before(a.join("")):j.append(a.join("")));i.createNodeCallback(b)}},destroy:function(b){b&&(h.initCache(b), | |
| 48 | +h.initRoot(b),m.unbindTree(b),m.unbindEvent(b),b.treeObj.empty(),delete s[b.treeId])},expandCollapseNode:function(b,a,c,d,e){var g=h.getRoot(b),k=b.data.key.children,p;if(a){if(g.expandTriggerFlag)p=e,e=function(){p&&p();a.open?b.treeObj.trigger(f.event.EXPAND,[b.treeId,a]):b.treeObj.trigger(f.event.COLLAPSE,[b.treeId,a])},g.expandTriggerFlag=!1;if(!a.open&&a.isParent&&(!l(a,f.id.UL,b).get(0)||a[k]&&a[k].length>0&&!l(a[k][0],b).get(0)))i.appendParentULDom(b,a),i.createNodeCallback(b);if(a.open==c)j.apply(e, | |
| 49 | +[]);else{var c=l(a,f.id.UL,b),g=l(a,f.id.SWITCH,b),n=l(a,f.id.ICON,b);a.isParent?(a.open=!a.open,a.iconOpen&&a.iconClose&&n.attr("style",i.makeNodeIcoStyle(b,a)),a.open?(i.replaceSwitchClass(a,g,f.folder.OPEN),i.replaceIcoClass(a,n,f.folder.OPEN),d==!1||b.view.expandSpeed==""?(c.show(),j.apply(e,[])):a[k]&&a[k].length>0?c.slideDown(b.view.expandSpeed,e):(c.show(),j.apply(e,[]))):(i.replaceSwitchClass(a,g,f.folder.CLOSE),i.replaceIcoClass(a,n,f.folder.CLOSE),d==!1||b.view.expandSpeed==""||!(a[k]&& | |
| 50 | +a[k].length>0)?(c.hide(),j.apply(e,[])):c.slideUp(b.view.expandSpeed,e))):j.apply(e,[])}}else j.apply(e,[])},expandCollapseParentNode:function(b,a,c,d,e){a&&(a.parentTId?(i.expandCollapseNode(b,a,c,d),a.parentTId&&i.expandCollapseParentNode(b,a.getParentNode(),c,d,e)):i.expandCollapseNode(b,a,c,d,e))},expandCollapseSonNode:function(b,a,c,d,e){var g=h.getRoot(b),f=b.data.key.children,g=a?a[f]:g[f],f=a?!1:d,j=h.getRoot(b).expandTriggerFlag;h.getRoot(b).expandTriggerFlag=!1;if(g)for(var n=0,l=g.length;n< | |
| 51 | +l;n++)g[n]&&i.expandCollapseSonNode(b,g[n],c,f);h.getRoot(b).expandTriggerFlag=j;i.expandCollapseNode(b,a,c,d,e)},isSelectedNode:function(b,a){if(!a)return!1;var c=h.getRoot(b).curSelectedList,d;for(d=c.length-1;d>=0;d--)if(a===c[d])return!0;return!1},makeDOMNodeIcon:function(b,a,c){var d=h.getNodeName(a,c),d=a.view.nameIsHTML?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");b.push("<span id='",c.tId,f.id.ICON,"' title='' treeNode",f.id.ICON," class='",i.makeNodeIcoClass(a,c),"' style='", | |
| 52 | +i.makeNodeIcoStyle(a,c),"'></span><span id='",c.tId,f.id.SPAN,"' class='",f.className.NAME,"'>",d,"</span>")},makeDOMNodeLine:function(b,a,c){b.push("<span id='",c.tId,f.id.SWITCH,"' title='' class='",i.makeNodeLineClass(a,c),"' treeNode",f.id.SWITCH,"></span>")},makeDOMNodeMainAfter:function(b){b.push("</li>")},makeDOMNodeMainBefore:function(b,a,c){b.push("<li id='",c.tId,"' class='",f.className.LEVEL,c.level,"' tabindex='0' hidefocus='true' treenode>")},makeDOMNodeNameAfter:function(b){b.push("</a>")}, | |
| 53 | +makeDOMNodeNameBefore:function(b,a,c){var d=h.getNodeTitle(a,c),e=i.makeNodeUrl(a,c),g=i.makeNodeFontCss(a,c),k=[],p;for(p in g)k.push(p,":",g[p],";");b.push("<a id='",c.tId,f.id.A,"' class='",f.className.LEVEL,c.level,"' treeNode",f.id.A,' onclick="',c.click||"",'" ',e!=null&&e.length>0?"href='"+e+"'":""," target='",i.makeNodeTarget(c),"' style='",k.join(""),"'");j.apply(a.view.showTitle,[a.treeId,c],a.view.showTitle)&&d&&b.push("title='",d.replace(/'/g,"'").replace(/</g,"<").replace(/>/g, | |
| 54 | +">"),"'");b.push(">")},makeNodeFontCss:function(b,a){var c=j.apply(b.view.fontCss,[b.treeId,a],b.view.fontCss);return c&&typeof c!="function"?c:{}},makeNodeIcoClass:function(b,a){var c=["ico"];a.isAjaxing||(c[0]=(a.iconSkin?a.iconSkin+"_":"")+c[0],a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU));return f.className.BUTTON+" "+c.join("_")},makeNodeIcoStyle:function(b,a){var c=[];if(!a.isAjaxing){var d=a.isParent&&a.iconOpen&&a.iconClose?a.open?a.iconOpen:a.iconClose: | |
| 55 | +a[b.data.key.icon];d&&c.push("background:url(",d,") 0 0 no-repeat;");(b.view.showIcon==!1||!j.apply(b.view.showIcon,[b.treeId,a],!0))&&c.push("width:0px;height:0px;")}return c.join("")},makeNodeLineClass:function(b,a){var c=[];b.view.showLine?a.level==0&&a.isFirstNode&&a.isLastNode?c.push(f.line.ROOT):a.level==0&&a.isFirstNode?c.push(f.line.ROOTS):a.isLastNode?c.push(f.line.BOTTOM):c.push(f.line.CENTER):c.push(f.line.NOLINE);a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU); | |
| 56 | +return i.makeNodeLineClassEx(a)+c.join("_")},makeNodeLineClassEx:function(b){return f.className.BUTTON+" "+f.className.LEVEL+b.level+" "+f.className.SWITCH+" "},makeNodeTarget:function(b){return b.target||"_blank"},makeNodeUrl:function(b,a){var c=b.data.key.url;return a[c]?a[c]:null},makeUlHtml:function(b,a,c,d){c.push("<ul id='",a.tId,f.id.UL,"' class='",f.className.LEVEL,a.level," ",i.makeUlLineClass(b,a),"' style='display:",a.open?"block":"none","'>");c.push(d);c.push("</ul>")},makeUlLineClass:function(b, | |
| 57 | +a){return b.view.showLine&&!a.isLastNode?f.line.LINE:""},removeChildNodes:function(b,a){if(a){var c=b.data.key.children,d=a[c];if(d){for(var e=0,g=d.length;e<g;e++)h.removeNodeCache(b,d[e]);h.removeSelectedNode(b);delete a[c];b.data.keep.parent?l(a,f.id.UL,b).empty():(a.isParent=!1,a.open=!1,c=l(a,f.id.SWITCH,b),d=l(a,f.id.ICON,b),i.replaceSwitchClass(a,c,f.folder.DOCU),i.replaceIcoClass(a,d,f.folder.DOCU),l(a,f.id.UL,b).remove())}}},scrollIntoView:function(b){if(b){if(!Element.prototype.scrollIntoViewIfNeeded)Element.prototype.scrollIntoViewIfNeeded= | |
| 58 | +function(a){function b(a,d,e,f){return{left:a,top:d,width:e,height:f,right:a+e,bottom:d+f,translate:function(g,k){return b(g+a,k+d,e,f)},relativeFromTo:function(k,h){var i=a,j=d,k=k.offsetParent,h=h.offsetParent;if(k===h)return g;for(;k;k=k.offsetParent)i+=k.offsetLeft+k.clientLeft,j+=k.offsetTop+k.clientTop;for(;h;h=h.offsetParent)i-=h.offsetLeft+h.clientLeft,j-=h.offsetTop+h.clientTop;return b(i,j,e,f)}}}for(var d,e=this,g=b(this.offsetLeft,this.offsetTop,this.offsetWidth,this.offsetHeight);j.isElement(d= | |
| 59 | +e.parentNode);){var f=d.offsetLeft+d.clientLeft,h=d.offsetTop+d.clientTop,g=g.relativeFromTo(e,d).translate(-f,-h);d.scrollLeft=!1===a||g.left<=d.scrollLeft+d.clientWidth&&d.scrollLeft<=g.right-d.clientWidth+d.clientWidth?Math.min(g.left,Math.max(g.right-d.clientWidth,d.scrollLeft)):(g.right-d.clientWidth+g.left)/2;d.scrollTop=!1===a||g.top<=d.scrollTop+d.clientHeight&&d.scrollTop<=g.bottom-d.clientHeight+d.clientHeight?Math.min(g.top,Math.max(g.bottom-d.clientHeight,d.scrollTop)):(g.bottom-d.clientHeight+ | |
| 60 | +g.top)/2;g=g.translate(f-d.scrollLeft,h-d.scrollTop);e=d}};b.scrollIntoViewIfNeeded()}},setFirstNode:function(b,a){var c=b.data.key.children;if(a[c].length>0)a[c][0].isFirstNode=!0},setLastNode:function(b,a){var c=b.data.key.children,d=a[c].length;if(d>0)a[c][d-1].isLastNode=!0},removeNode:function(b,a){var c=h.getRoot(b),d=b.data.key.children,e=a.parentTId?a.getParentNode():c;a.isFirstNode=!1;a.isLastNode=!1;a.getPreNode=function(){return null};a.getNextNode=function(){return null};if(h.getNodeCache(b, | |
| 61 | +a.tId)){l(a,b).remove();h.removeNodeCache(b,a);h.removeSelectedNode(b,a);for(var g=0,k=e[d].length;g<k;g++)if(e[d][g].tId==a.tId){e[d].splice(g,1);break}i.setFirstNode(b,e);i.setLastNode(b,e);var j,g=e[d].length;if(!b.data.keep.parent&&g==0)e.isParent=!1,e.open=!1,g=l(e,f.id.UL,b),k=l(e,f.id.SWITCH,b),j=l(e,f.id.ICON,b),i.replaceSwitchClass(e,k,f.folder.DOCU),i.replaceIcoClass(e,j,f.folder.DOCU),g.css("display","none");else if(b.view.showLine&&g>0){var n=e[d][g-1],g=l(n,f.id.UL,b),k=l(n,f.id.SWITCH, | |
| 62 | +b);j=l(n,f.id.ICON,b);e==c?e[d].length==1?i.replaceSwitchClass(n,k,f.line.ROOT):(c=l(e[d][0],f.id.SWITCH,b),i.replaceSwitchClass(e[d][0],c,f.line.ROOTS),i.replaceSwitchClass(n,k,f.line.BOTTOM)):i.replaceSwitchClass(n,k,f.line.BOTTOM);g.removeClass(f.line.LINE)}}},replaceIcoClass:function(b,a,c){if(a&&!b.isAjaxing&&(b=a.attr("class"),b!=void 0)){b=b.split("_");switch(c){case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:b[b.length-1]=c}a.attr("class",b.join("_"))}},replaceSwitchClass:function(b, | |
| 63 | +a,c){if(a){var d=a.attr("class");if(d!=void 0){d=d.split("_");switch(c){case f.line.ROOT:case f.line.ROOTS:case f.line.CENTER:case f.line.BOTTOM:case f.line.NOLINE:d[0]=i.makeNodeLineClassEx(b)+c;break;case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:d[1]=c}a.attr("class",d.join("_"));c!==f.folder.DOCU?a.removeAttr("disabled"):a.attr("disabled","disabled")}}},selectNode:function(b,a,c){c||i.cancelPreSelectedNode(b,null,a);l(a,f.id.A,b).addClass(f.node.CURSELECTED);h.addSelectedNode(b,a); | |
| 64 | +b.treeObj.trigger(f.event.SELECTED,[b.treeId,a])},setNodeFontCss:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeFontCss(b,a);d&&c.css(d)},setNodeLineIcos:function(b,a){if(a){var c=l(a,f.id.SWITCH,b),d=l(a,f.id.UL,b),e=l(a,f.id.ICON,b),g=i.makeUlLineClass(b,a);g.length==0?d.removeClass(f.line.LINE):d.addClass(g);c.attr("class",i.makeNodeLineClass(b,a));a.isParent?c.removeAttr("disabled"):c.attr("disabled","disabled");e.removeAttr("style");e.attr("style",i.makeNodeIcoStyle(b,a));e.attr("class",i.makeNodeIcoClass(b, | |
| 65 | +a))}},setNodeName:function(b,a){var c=h.getNodeTitle(b,a),d=l(a,f.id.SPAN,b);d.empty();b.view.nameIsHTML?d.html(h.getNodeName(b,a)):d.text(h.getNodeName(b,a));j.apply(b.view.showTitle,[b.treeId,a],b.view.showTitle)&&l(a,f.id.A,b).attr("title",!c?"":c)},setNodeTarget:function(b,a){l(a,f.id.A,b).attr("target",i.makeNodeTarget(a))},setNodeUrl:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeUrl(b,a);d==null||d.length==0?c.removeAttr("href"):c.attr("href",d)},switchNode:function(b,a){a.open||!j.canAsync(b, | |
| 66 | +a)?i.expandCollapseNode(b,a,!a.open):b.async.enable?i.asyncNode(b,a)||i.expandCollapseNode(b,a,!a.open):a&&i.expandCollapseNode(b,a,!a.open)}};r.fn.zTree={consts:{className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch",NAME:"node_name"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"}, | |
| 67 | +id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_z:{tools:j,view:i,event:m,data:h},getZTreeObj:function(b){return(b=h.getZTreeTools(b))?b:null},destroy:function(b){if(b&&b.length>0)i.destroy(h.getSetting(b));else for(var a in s)i.destroy(s[a])},init:function(b,a,c){var d=j.clone(O);r.extend(!0,d,a);d.treeId= | |
| 68 | +b.attr("id");d.treeObj=b;d.treeObj.empty();s[d.treeId]=d;if(typeof document.body.style.maxHeight==="undefined")d.view.expandSpeed="";h.initRoot(d);b=h.getRoot(d);a=d.data.key.children;c=c?j.clone(j.isArray(c)?c:[c]):[];b[a]=d.data.simpleData.enable?h.transformTozTreeFormat(d,c):c;h.initCache(d);m.unbindTree(d);m.bindTree(d);m.unbindEvent(d);m.bindEvent(d);var e={setting:d,addNodes:function(a,b,c,e){function f(){i.addNodes(d,a,b,l,e==!0)}a||(a=null);if(a&&!a.isParent&&d.data.keep.leaf)return null; | |
| 69 | +var h=parseInt(b,10);isNaN(h)?(e=!!c,c=b,b=-1):b=h;if(!c)return null;var l=j.clone(j.isArray(c)?c:[c]);j.canAsync(d,a)?i.asyncNode(d,a,e,f):f();return l},cancelSelectedNode:function(a){i.cancelPreSelectedNode(d,a)},destroy:function(){i.destroy(d)},expandAll:function(a){a=!!a;i.expandCollapseSonNode(d,null,a,!0);return a},expandNode:function(a,b,c,e,f){function m(){var b=l(a,d).get(0);b&&e!==!1&&i.scrollIntoView(b)}if(!a||!a.isParent)return null;b!==!0&&b!==!1&&(b=!a.open);if((f=!!f)&&b&&j.apply(d.callback.beforeExpand, | |
| 70 | +[d.treeId,a],!0)==!1)return null;else if(f&&!b&&j.apply(d.callback.beforeCollapse,[d.treeId,a],!0)==!1)return null;b&&a.parentTId&&i.expandCollapseParentNode(d,a.getParentNode(),b,!1);if(b===a.open&&!c)return null;h.getRoot(d).expandTriggerFlag=f;!j.canAsync(d,a)&&c?i.expandCollapseSonNode(d,a,b,!0,m):(a.open=!b,i.switchNode(this.setting,a),m());return b},getNodes:function(){return h.getNodes(d)},getNodeByParam:function(a,b,c){return!a?null:h.getNodeByParam(d,c?c[d.data.key.children]:h.getNodes(d), | |
| 71 | +a,b)},getNodeByTId:function(a){return h.getNodeCache(d,a)},getNodesByParam:function(a,b,c){return!a?null:h.getNodesByParam(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByParamFuzzy:function(a,b,c){return!a?null:h.getNodesByParamFuzzy(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByFilter:function(a,b,c,e){b=!!b;return!a||typeof a!="function"?b?null:[]:h.getNodesByFilter(d,c?c[d.data.key.children]:h.getNodes(d),a,b,e)},getNodeIndex:function(a){if(!a)return null;for(var b=d.data.key.children, | |
| 72 | +c=a.parentTId?a.getParentNode():h.getRoot(d),e=0,f=c[b].length;e<f;e++)if(c[b][e]==a)return e;return-1},getSelectedNodes:function(){for(var a=[],b=h.getRoot(d).curSelectedList,c=0,e=b.length;c<e;c++)a.push(b[c]);return a},isSelectedNode:function(a){return h.isSelectedNode(d,a)},reAsyncChildNodesPromise:function(a,b,c){return new Promise(function(d,f){try{e.reAsyncChildNodes(a,b,c,function(){d(a)})}catch(h){f(h)}})},reAsyncChildNodes:function(a,b,c,e){if(this.setting.async.enable){var j=!a;j&&(a=h.getRoot(d)); | |
| 73 | +if(b=="refresh"){for(var b=this.setting.data.key.children,m=0,r=a[b]?a[b].length:0;m<r;m++)h.removeNodeCache(d,a[b][m]);h.removeSelectedNode(d);a[b]=[];j?this.setting.treeObj.empty():l(a,f.id.UL,d).empty()}i.asyncNode(this.setting,j?null:a,!!c,e)}},refresh:function(){this.setting.treeObj.empty();var a=h.getRoot(d),b=a[d.data.key.children];h.initRoot(d);a[d.data.key.children]=b;h.initCache(d);i.createNodes(d,0,a[d.data.key.children],null,-1)},removeChildNodes:function(a){if(!a)return null;var b=a[d.data.key.children]; | |
| 74 | +i.removeChildNodes(d,a);return b?b:null},removeNode:function(a,b){a&&(b=!!b,b&&j.apply(d.callback.beforeRemove,[d.treeId,a],!0)==!1||(i.removeNode(d,a),b&&this.setting.treeObj.trigger(f.event.REMOVE,[d.treeId,a])))},selectNode:function(a,b,c){function e(){if(!c){var b=l(a,d).get(0);i.scrollIntoView(b)}}if(a&&j.uCanDo(d)){b=d.view.selectedMulti&&b;if(a.parentTId)i.expandCollapseParentNode(d,a.getParentNode(),!0,!1,e);else if(!c)try{l(a,d).focus().blur()}catch(f){}i.selectNode(d,a,b)}},transformTozTreeNodes:function(a){return h.transformTozTreeFormat(d, | |
| 75 | +a)},transformToArray:function(a){return h.transformToArrayFormat(d,a)},updateNode:function(a){a&&l(a,d).get(0)&&j.uCanDo(d)&&(i.setNodeName(d,a),i.setNodeTarget(d,a),i.setNodeUrl(d,a),i.setNodeLineIcos(d,a),i.setNodeFontCss(d,a))}};b.treeTools=e;h.setZTreeTools(d,e);b[a]&&b[a].length>0?i.createNodes(d,0,b[a],null,-1):d.async.enable&&d.async.url&&d.async.url!==""&&i.asyncNode(d);return e}};var P=r.fn.zTree,l=j.$,f=P.consts})(jQuery); | |
| 76 | + | |
| 77 | +/* | |
| 78 | + * JQuery zTree excheck v3.5.29 | |
| 79 | + * http://treejs.cn/ | |
| 80 | + * | |
| 81 | + * Copyright (c) 2010 Hunter.z | |
| 82 | + * | |
| 83 | + * Licensed same as jquery - MIT License | |
| 84 | + * http://www.opensource.org/licenses/mit-license.php | |
| 85 | + * | |
| 86 | + * email: hunter.z@263.net | |
| 87 | + * Date: 2017-06-19 | |
| 88 | + */ | |
| 89 | +(function(m){var p,q,r,o={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},v={check:{enable:!1,autoCheckTrigger:!1,chkStyle:o.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:o.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}};p=function(c, | |
| 90 | +a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=b.data.key.checked;if(k.apply(b.callback.beforeCheck,[b.treeId,a],!0)==!1)return!0;a[d]=!a[d];e.checkNodeRelation(b,a);d=n(a,j.id.CHECK,b);e.setChkClass(b,d,a);e.repairParentChkClassWithSelf(b,a);b.treeObj.trigger(j.event.CHECK,[c,b.treeId,a]);return!0};q=function(c,a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!0;e.setChkClass(b,d,a);return!0};r=function(c,a){if(a.chkDisabled=== | |
| 91 | +!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!1;e.setChkClass(b,d,a);return!0};m.extend(!0,m.fn.zTree.consts,o);m.extend(!0,m.fn.zTree._z,{tools:{},view:{checkNodeRelation:function(c,a){var b,d,h,i=c.data.key.children,l=c.data.key.checked;b=j.radio;if(c.check.chkStyle==b.STYLE){var f=g.getRadioCheckedList(c);if(a[l])if(c.check.radioType==b.TYPE_ALL){for(d=f.length-1;d>=0;d--)b=f[d],b[l]&&b!=a&&(b[l]=!1,f.splice(d,1),e.setChkClass(c,n(b,j.id.CHECK,c),b),b.parentTId!= | |
| 92 | +a.parentTId&&e.repairParentChkClassWithSelf(c,b));f.push(a)}else{f=a.parentTId?a.getParentNode():g.getRoot(c);for(d=0,h=f[i].length;d<h;d++)b=f[i][d],b[l]&&b!=a&&(b[l]=!1,e.setChkClass(c,n(b,j.id.CHECK,c),b))}else if(c.check.radioType==b.TYPE_ALL)for(d=0,h=f.length;d<h;d++)if(a==f[d]){f.splice(d,1);break}}else a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.Y.indexOf("s")>-1)&&e.setSonNodeCheckBox(c,a,!0),!a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.N.indexOf("s")>-1)&&e.setSonNodeCheckBox(c, | |
| 93 | +a,!1),a[l]&&c.check.chkboxType.Y.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!0),!a[l]&&c.check.chkboxType.N.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!1)},makeChkClass:function(c,a){var b=c.data.key.checked,d=j.checkbox,h=j.radio,i="",i=a.chkDisabled===!0?d.DISABLED:a.halfCheck?d.PART:c.check.chkStyle==h.STYLE?a.check_Child_State<1?d.FULL:d.PART:a[b]?a.check_Child_State===2||a.check_Child_State===-1?d.FULL:d.PART:a.check_Child_State<1?d.FULL:d.PART,b=c.check.chkStyle+"_"+(a[b]?d.TRUE:d.FALSE)+ | |
| 94 | +"_"+i,b=a.check_Focus&&a.chkDisabled!==!0?b+"_"+d.FOCUS:b;return j.className.BUTTON+" "+d.DEFAULT+" "+b},repairAllChk:function(c,a){if(c.check.enable&&c.check.chkStyle===j.checkbox.STYLE)for(var b=c.data.key.checked,d=c.data.key.children,h=g.getRoot(c),i=0,l=h[d].length;i<l;i++){var f=h[d][i];f.nocheck!==!0&&f.chkDisabled!==!0&&(f[b]=a);e.setSonNodeCheckBox(c,f,a)}},repairChkClass:function(c,a){if(a&&(g.makeChkFlag(c,a),a.nocheck!==!0)){var b=n(a,j.id.CHECK,c);e.setChkClass(c,b,a)}},repairParentChkClass:function(c, | |
| 95 | +a){if(a&&a.parentTId){var b=a.getParentNode();e.repairChkClass(c,b);e.repairParentChkClass(c,b)}},repairParentChkClassWithSelf:function(c,a){if(a){var b=c.data.key.children;a[b]&&a[b].length>0?e.repairParentChkClass(c,a[b][0]):e.repairParentChkClass(c,a)}},repairSonChkDisabled:function(c,a,b,d){if(a){var h=c.data.key.children;if(a.chkDisabled!=b)a.chkDisabled=b;e.repairChkClass(c,a);if(a[h]&&d)for(var i=0,l=a[h].length;i<l;i++)e.repairSonChkDisabled(c,a[h][i],b,d)}},repairParentChkDisabled:function(c, | |
| 96 | +a,b,d){if(a){if(a.chkDisabled!=b&&d)a.chkDisabled=b;e.repairChkClass(c,a);e.repairParentChkDisabled(c,a.getParentNode(),b,d)}},setChkClass:function(c,a,b){a&&(b.nocheck===!0?a.hide():a.show(),a.attr("class",e.makeChkClass(c,b)))},setParentNodeCheckBox:function(c,a,b,d){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);g.makeChkFlag(c,a);a.nocheck!==!0&&a.chkDisabled!==!0&&(a[i]=b,e.setChkClass(c,l,a),c.check.autoCheckTrigger&&a!=d&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId, | |
| 97 | +a]));if(a.parentTId){l=!0;if(!b)for(var h=a.getParentNode()[h],f=0,k=h.length;f<k;f++)if(h[f].nocheck!==!0&&h[f].chkDisabled!==!0&&h[f][i]||(h[f].nocheck===!0||h[f].chkDisabled===!0)&&h[f].check_Child_State>0){l=!1;break}l&&e.setParentNodeCheckBox(c,a.getParentNode(),b,d)}},setSonNodeCheckBox:function(c,a,b,d){if(a){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);var f=!1;if(a[h])for(var k=0,m=a[h].length;k<m;k++){var o=a[h][k];e.setSonNodeCheckBox(c,o,b,d);o.chkDisabled=== | |
| 98 | +!0&&(f=!0)}if(a!=g.getRoot(c)&&a.chkDisabled!==!0){f&&a.nocheck!==!0&&g.makeChkFlag(c,a);if(a.nocheck!==!0&&a.chkDisabled!==!0){if(a[i]=b,!f)a.check_Child_State=a[h]&&a[h].length>0?b?2:0:-1}else a.check_Child_State=-1;e.setChkClass(c,l,a);c.check.autoCheckTrigger&&a!=d&&a.nocheck!==!0&&a.chkDisabled!==!0&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId,a])}}}},event:{},data:{getRadioCheckedList:function(c){for(var a=g.getRoot(c).radioCheckedList,b=0,d=a.length;b<d;b++)g.getNodeCache(c,a[b].tId)||(a.splice(b, | |
| 99 | +1),b--,d--);return a},getCheckStatus:function(c,a){if(!c.check.enable||a.nocheck||a.chkDisabled)return null;var b=c.data.key.checked;return{checked:a[b],half:a.halfCheck?a.halfCheck:c.check.chkStyle==j.radio.STYLE?a.check_Child_State===2:a[b]?a.check_Child_State>-1&&a.check_Child_State<2:a.check_Child_State>0}},getTreeCheckedNodes:function(c,a,b,d){if(!a)return[];for(var h=c.data.key.children,i=c.data.key.checked,e=b&&c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL,d=!d?[]:d, | |
| 100 | +f=0,k=a.length;f<k;f++){if(a[f].nocheck!==!0&&a[f].chkDisabled!==!0&&a[f][i]==b&&(d.push(a[f]),e))break;g.getTreeCheckedNodes(c,a[f][h],b,d);if(e&&d.length>0)break}return d},getTreeChangeCheckedNodes:function(c,a,b){if(!a)return[];for(var d=c.data.key.children,h=c.data.key.checked,b=!b?[]:b,i=0,e=a.length;i<e;i++)a[i].nocheck!==!0&&a[i].chkDisabled!==!0&&a[i][h]!=a[i].checkedOld&&b.push(a[i]),g.getTreeChangeCheckedNodes(c,a[i][d],b);return b},makeChkFlag:function(c,a){if(a){var b=c.data.key.children, | |
| 101 | +d=c.data.key.checked,h=-1;if(a[b])for(var i=0,e=a[b].length;i<e;i++){var f=a[b][i],g=-1;if(c.check.chkStyle==j.radio.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?2:f[d]?2:f.check_Child_State>0?2:0,g==2){h=2;break}else g==0&&(h=0);else if(c.check.chkStyle==j.checkbox.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?1:f[d]?f.check_Child_State===-1||f.check_Child_State===2?2:1:f.check_Child_State>0?1:0,g===1){h=1;break}else if(g=== | |
| 102 | +2&&h>-1&&i>0&&g!==h){h=1;break}else if(h===2&&g>-1&&g<2){h=1;break}else g>-1&&(h=g)}a.check_Child_State=h}}}});var m=m.fn.zTree,k=m._z.tools,j=m.consts,e=m._z.view,g=m._z.data,n=k.$;g.exSetting(v);g.addInitBind(function(c){c.treeObj.bind(j.event.CHECK,function(a,b,d,h){a.srcEvent=b;k.apply(c.callback.onCheck,[a,d,h])})});g.addInitUnBind(function(c){c.treeObj.unbind(j.event.CHECK)});g.addInitCache(function(){});g.addInitNode(function(c,a,b,d){if(b){a=c.data.key.checked;typeof b[a]=="string"&&(b[a]= | |
| 103 | +k.eqs(b[a],"true"));b[a]=!!b[a];b.checkedOld=b[a];if(typeof b.nocheck=="string")b.nocheck=k.eqs(b.nocheck,"true");b.nocheck=!!b.nocheck||c.check.nocheckInherit&&d&&!!d.nocheck;if(typeof b.chkDisabled=="string")b.chkDisabled=k.eqs(b.chkDisabled,"true");b.chkDisabled=!!b.chkDisabled||c.check.chkDisabledInherit&&d&&!!d.chkDisabled;if(typeof b.halfCheck=="string")b.halfCheck=k.eqs(b.halfCheck,"true");b.halfCheck=!!b.halfCheck;b.check_Child_State=-1;b.check_Focus=!1;b.getCheckStatus=function(){return g.getCheckStatus(c, | |
| 104 | +b)};c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL&&b[a]&&g.getRoot(c).radioCheckedList.push(b)}});g.addInitProxy(function(c){var a=c.target,b=g.getSetting(c.data.treeId),d="",h=null,e="",l=null;if(k.eqs(c.type,"mouseover")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="mouseoverCheck"}else if(k.eqs(c.type,"mouseout")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d= | |
| 105 | +k.getNodeMainDom(a).id,e="mouseoutCheck"}else if(k.eqs(c.type,"click")&&b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="checkNode";if(d.length>0)switch(h=g.getNodeCache(b,d),e){case "checkNode":l=p;break;case "mouseoverCheck":l=q;break;case "mouseoutCheck":l=r}return{stop:e==="checkNode",node:h,nodeEventType:e,nodeEventCallback:l,treeEventType:"",treeEventCallback:null}},!0);g.addInitRoot(function(c){g.getRoot(c).radioCheckedList=[]}); | |
| 106 | +g.addBeforeA(function(c,a,b){c.check.enable&&(g.makeChkFlag(c,a),b.push("<span ID='",a.tId,j.id.CHECK,"' class='",e.makeChkClass(c,a),"' treeNode",j.id.CHECK,a.nocheck===!0?" style='display:none;'":"","></span>"))});g.addZTreeTools(function(c,a){a.checkNode=function(a,b,c,g){var f=this.setting.data.key.checked;if(a.chkDisabled!==!0&&(b!==!0&&b!==!1&&(b=!a[f]),g=!!g,(a[f]!==b||c)&&!(g&&k.apply(this.setting.callback.beforeCheck,[this.setting.treeId,a],!0)==!1)&&k.uCanDo(this.setting)&&this.setting.check.enable&& | |
| 107 | +a.nocheck!==!0))a[f]=b,b=n(a,j.id.CHECK,this.setting),(c||this.setting.check.chkStyle===j.radio.STYLE)&&e.checkNodeRelation(this.setting,a),e.setChkClass(this.setting,b,a),e.repairParentChkClassWithSelf(this.setting,a),g&&this.setting.treeObj.trigger(j.event.CHECK,[null,this.setting.treeId,a])};a.checkAllNodes=function(a){e.repairAllChk(this.setting,!!a)};a.getCheckedNodes=function(a){var b=this.setting.data.key.children;return g.getTreeCheckedNodes(this.setting,g.getRoot(this.setting)[b],a!==!1)}; | |
| 108 | +a.getChangeCheckedNodes=function(){var a=this.setting.data.key.children;return g.getTreeChangeCheckedNodes(this.setting,g.getRoot(this.setting)[a])};a.setChkDisabled=function(a,b,c,g){b=!!b;c=!!c;e.repairSonChkDisabled(this.setting,a,b,!!g);e.repairParentChkDisabled(this.setting,a.getParentNode(),b,c)};var b=a.updateNode;a.updateNode=function(c,g){b&&b.apply(a,arguments);if(c&&this.setting.check.enable&&n(c,this.setting).get(0)&&k.uCanDo(this.setting)){var i=n(c,j.id.CHECK,this.setting);(g==!0||this.setting.check.chkStyle=== | |
| 109 | +j.radio.STYLE)&&e.checkNodeRelation(this.setting,c);e.setChkClass(this.setting,i,c);e.repairParentChkClassWithSelf(this.setting,c)}}});var s=e.createNodes;e.createNodes=function(c,a,b,d,g){s&&s.apply(e,arguments);b&&e.repairParentChkClassWithSelf(c,d)};var t=e.removeNode;e.removeNode=function(c,a){var b=a.getParentNode();t&&t.apply(e,arguments);a&&b&&(e.repairChkClass(c,b),e.repairParentChkClass(c,b))};var u=e.appendNodes;e.appendNodes=function(c,a,b,d,h,i,j){var f="";u&&(f=u.apply(e,arguments)); | |
| 110 | +d&&g.makeChkFlag(c,d);return f}})(jQuery); | |
| 111 | + | |
| 112 | +/* | |
| 113 | + * JQuery zTree exedit v3.5.29 | |
| 114 | + * http://treejs.cn/ | |
| 115 | + * | |
| 116 | + * Copyright (c) 2010 Hunter.z | |
| 117 | + * | |
| 118 | + * Licensed same as jquery - MIT License | |
| 119 | + * http://www.opensource.org/licenses/mit-license.php | |
| 120 | + * | |
| 121 | + * email: hunter.z@263.net | |
| 122 | + * Date: 2017-06-19 | |
| 123 | + */ | |
| 124 | +(function(v){var J={event:{DRAG:"ztree_drag",DROP:"ztree_drop",RENAME:"ztree_rename",DRAGMOVE:"ztree_dragmove"},id:{EDIT:"_edit",INPUT:"_input",REMOVE:"_remove"},move:{TYPE_INNER:"inner",TYPE_PREV:"prev",TYPE_NEXT:"next"},node:{CURSELECTED_EDIT:"curSelectedNode_Edit",TMPTARGET_TREE:"tmpTargetzTree",TMPTARGET_NODE:"tmpTargetNode"}},x={onHoverOverNode:function(b,a){var c=m.getSetting(b.data.treeId),d=m.getRoot(c);if(d.curHoverNode!=a)x.onHoverOutNode(b);d.curHoverNode=a;f.addHoverDom(c,a)},onHoverOutNode:function(b){var b= | |
| 125 | +m.getSetting(b.data.treeId),a=m.getRoot(b);if(a.curHoverNode&&!m.isSelectedNode(b,a.curHoverNode))f.removeTreeDom(b,a.curHoverNode),a.curHoverNode=null},onMousedownNode:function(b,a){function c(b){if(B.dragFlag==0&&Math.abs(O-b.clientX)<e.edit.drag.minMoveSize&&Math.abs(P-b.clientY)<e.edit.drag.minMoveSize)return!0;var a,c,n,k,i;i=e.data.key.children;M.css("cursor","pointer");if(B.dragFlag==0){if(g.apply(e.callback.beforeDrag,[e.treeId,l],!0)==!1)return r(b),!0;for(a=0,c=l.length;a<c;a++){if(a==0)B.dragNodeShowBefore= | |
| 126 | +[];n=l[a];n.isParent&&n.open?(f.expandCollapseNode(e,n,!n.open),B.dragNodeShowBefore[n.tId]=!0):B.dragNodeShowBefore[n.tId]=!1}B.dragFlag=1;t.showHoverDom=!1;g.showIfameMask(e,!0);n=!0;k=-1;if(l.length>1){var j=l[0].parentTId?l[0].getParentNode()[i]:m.getNodes(e);i=[];for(a=0,c=j.length;a<c;a++)if(B.dragNodeShowBefore[j[a].tId]!==void 0&&(n&&k>-1&&k+1!==a&&(n=!1),i.push(j[a]),k=a),l.length===i.length){l=i;break}}n&&(I=l[0].getPreNode(),R=l[l.length-1].getNextNode());D=o("<ul class='zTreeDragUL'></ul>", | |
| 127 | +e);for(a=0,c=l.length;a<c;a++)n=l[a],n.editNameFlag=!1,f.selectNode(e,n,a>0),f.removeTreeDom(e,n),a>e.edit.drag.maxShowNodeNum-1||(k=o("<li id='"+n.tId+"_tmp'></li>",e),k.append(o(n,d.id.A,e).clone()),k.css("padding","0"),k.children("#"+n.tId+d.id.A).removeClass(d.node.CURSELECTED),D.append(k),a==e.edit.drag.maxShowNodeNum-1&&(k=o("<li id='"+n.tId+"_moretmp'><a> ... </a></li>",e),D.append(k)));D.attr("id",l[0].tId+d.id.UL+"_tmp");D.addClass(e.treeObj.attr("class"));D.appendTo(M);A=o("<span class='tmpzTreeMove_arrow'></span>", | |
| 128 | +e);A.attr("id","zTreeMove_arrow_tmp");A.appendTo(M);e.treeObj.trigger(d.event.DRAG,[b,e.treeId,l])}if(B.dragFlag==1){s&&A.attr("id")==b.target.id&&u&&b.clientX+G.scrollLeft()+2>v("#"+u+d.id.A,s).offset().left?(n=v("#"+u+d.id.A,s),b.target=n.length>0?n.get(0):b.target):s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER)); | |
| 129 | +u=s=null;K=!1;h=e;n=m.getSettings();for(var y in n)if(n[y].treeId&&n[y].edit.enable&&n[y].treeId!=e.treeId&&(b.target.id==n[y].treeId||v(b.target).parents("#"+n[y].treeId).length>0))K=!0,h=n[y];y=G.scrollTop();k=G.scrollLeft();i=h.treeObj.offset();a=h.treeObj.get(0).scrollHeight;n=h.treeObj.get(0).scrollWidth;c=b.clientY+y-i.top;var p=h.treeObj.height()+i.top-b.clientY-y,q=b.clientX+k-i.left,H=h.treeObj.width()+i.left-b.clientX-k;i=c<e.edit.drag.borderMax&&c>e.edit.drag.borderMin;var j=p<e.edit.drag.borderMax&& | |
| 130 | +p>e.edit.drag.borderMin,F=q<e.edit.drag.borderMax&&q>e.edit.drag.borderMin,x=H<e.edit.drag.borderMax&&H>e.edit.drag.borderMin,p=c>e.edit.drag.borderMin&&p>e.edit.drag.borderMin&&q>e.edit.drag.borderMin&&H>e.edit.drag.borderMin,q=i&&h.treeObj.scrollTop()<=0,H=j&&h.treeObj.scrollTop()+h.treeObj.height()+10>=a,N=F&&h.treeObj.scrollLeft()<=0,Q=x&&h.treeObj.scrollLeft()+h.treeObj.width()+10>=n;if(b.target&&g.isChildOrSelf(b.target,h.treeId)){for(var E=b.target;E&&E.tagName&&!g.eqs(E.tagName,"li")&&E.id!= | |
| 131 | +h.treeId;)E=E.parentNode;var S=!0;for(a=0,c=l.length;a<c;a++)if(n=l[a],E.id===n.tId){S=!1;break}else if(o(n,e).find("#"+E.id).length>0){S=!1;break}if(S&&b.target&&g.isChildOrSelf(b.target,E.id+d.id.A))s=v(E),u=E.id}n=l[0];if(p&&g.isChildOrSelf(b.target,h.treeId)){if(!s&&(b.target.id==h.treeId||q||H||N||Q)&&(K||!K&&n.parentTId))s=h.treeObj;i?h.treeObj.scrollTop(h.treeObj.scrollTop()-10):j&&h.treeObj.scrollTop(h.treeObj.scrollTop()+10);F?h.treeObj.scrollLeft(h.treeObj.scrollLeft()-10):x&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+ | |
| 132 | +10);s&&s!=h.treeObj&&s.offset().left<h.treeObj.offset().left&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+s.offset().left-h.treeObj.offset().left)}D.css({top:b.clientY+y+3+"px",left:b.clientX+k+3+"px"});c=a=0;if(s&&s.attr("id")!=h.treeId){var z=u==null?null:m.getNodeCache(h,u);i=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;k=!!(I&&u===I.tId);F=!!(R&&u===R.tId);j=n.parentTId&&n.parentTId==u;n=(i||!F)&&g.apply(h.edit.drag.prev,[h.treeId,l,z], | |
| 133 | +!!h.edit.drag.prev);k=(i||!k)&&g.apply(h.edit.drag.next,[h.treeId,l,z],!!h.edit.drag.next);i=(i||!j)&&!(h.data.keep.leaf&&!z.isParent)&&g.apply(h.edit.drag.inner,[h.treeId,l,z],!!h.edit.drag.inner);j=function(){s=null;u="";w=d.move.TYPE_INNER;A.css({display:"none"});if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null};if(!n&&!k&&!i)j();else if(F=v("#"+u+d.id.A,s),x=z.isLastNode?null:v("#"+z.getNextNode().tId+d.id.A,s.next()),p=F.offset().top,q=F.offset().left, | |
| 134 | +H=n?i?0.25:k?0.5:1:-1,N=k?i?0.75:n?0.5:0:-1,y=(b.clientY+y-p)/F.height(),(H==1||y<=H&&y>=-0.2)&&n?(a=1-A.width(),c=p-A.height()/2,w=d.move.TYPE_PREV):(N==0||y>=N&&y<=1.2)&&k?(a=1-A.width(),c=x==null||z.isParent&&z.open?p+F.height()-A.height()/2:x.offset().top-A.height()/2,w=d.move.TYPE_NEXT):i?(a=5-A.width(),c=p,w=d.move.TYPE_INNER):j(),s){A.css({display:"block",top:c+"px",left:q+a+"px"});F.addClass(d.node.TMPTARGET_NODE+"_"+w);if(T!=u||U!=w)L=(new Date).getTime();if(z&&z.isParent&&w==d.move.TYPE_INNER&& | |
| 135 | +(y=!0,window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId!==z.tId?(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null):window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId===z.tId&&(y=!1),y))window.zTreeMoveTimer=setTimeout(function(){w==d.move.TYPE_INNER&&z&&z.isParent&&!z.open&&(new Date).getTime()-L>h.edit.drag.autoOpenTime&&g.apply(h.callback.beforeDragOpen,[h.treeId,z],!0)&&(f.switchNode(h,z),h.edit.drag.autoExpandTrigger&&h.treeObj.trigger(d.event.EXPAND,[h.treeId,z]))}, | |
| 136 | +h.edit.drag.autoOpenTime+50),window.zTreeMoveTargetNodeTId=z.tId}}else if(w=d.move.TYPE_INNER,s&&g.apply(h.edit.drag.inner,[h.treeId,l,null],!!h.edit.drag.inner)?s.addClass(d.node.TMPTARGET_TREE):s=null,A.css({display:"none"}),window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;T=u;U=w;e.treeObj.trigger(d.event.DRAGMOVE,[b,e.treeId,l])}return!1}function r(b){if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;U=T= | |
| 137 | +null;G.unbind("mousemove",c);G.unbind("mouseup",r);G.unbind("selectstart",k);M.css("cursor","");s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER));g.showIfameMask(e,!1);t.showHoverDom=!0;if(B.dragFlag!=0){B.dragFlag=0;var a,i,j;for(a=0,i=l.length;a<i;a++)j=l[a],j.isParent&&B.dragNodeShowBefore[j.tId]&&!j.open&&(f.expandCollapseNode(e, | |
| 138 | +j,!j.open),delete B.dragNodeShowBefore[j.tId]);D&&D.remove();A&&A.remove();var p=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;!p&&s&&u&&l[0].parentTId&&u==l[0].parentTId&&w==d.move.TYPE_INNER&&(s=null);if(s){var q=u==null?null:m.getNodeCache(h,u);if(g.apply(e.callback.beforeDrop,[h.treeId,l,q,w,p],!0)==!1)f.selectNodes(x,l);else{var C=p?g.clone(l):l;a=function(){if(K){if(!p)for(var a=0,c=l.length;a<c;a++)f.removeNode(e,l[a]);w==d.move.TYPE_INNER? | |
| 139 | +f.addNodes(h,q,-1,C):f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C)}else if(p&&w==d.move.TYPE_INNER)f.addNodes(h,q,-1,C);else if(p)f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C);else if(w!=d.move.TYPE_NEXT)for(a=0,c=C.length;a<c;a++)f.moveNode(h,q,C[a],w,!1);else for(a=-1,c=C.length-1;a<c;c--)f.moveNode(h,q,C[c],w,!1);f.selectNodes(h,C);a=o(C[0],e).get(0);f.scrollIntoView(a);e.treeObj.trigger(d.event.DROP,[b,h.treeId,C,q,w,p])}; | |
| 140 | +w==d.move.TYPE_INNER&&g.canAsync(h,q)?f.asyncNode(h,q,!1,a):a()}}else f.selectNodes(x,l),e.treeObj.trigger(d.event.DROP,[b,e.treeId,l,null,null,null])}}function k(){return!1}var i,j,e=m.getSetting(b.data.treeId),B=m.getRoot(e),t=m.getRoots();if(b.button==2||!e.edit.enable||!e.edit.drag.isCopy&&!e.edit.drag.isMove)return!0;var p=b.target,q=m.getRoot(e).curSelectedList,l=[];if(m.isSelectedNode(e,a))for(i=0,j=q.length;i<j;i++){if(q[i].editNameFlag&&g.eqs(p.tagName,"input")&&p.getAttribute("treeNode"+ | |
| 141 | +d.id.INPUT)!==null)return!0;l.push(q[i]);if(l[0].parentTId!==q[i].parentTId){l=[a];break}}else l=[a];f.editNodeBlur=!0;f.cancelCurEditNode(e);var G=v(e.treeObj.get(0).ownerDocument),M=v(e.treeObj.get(0).ownerDocument.body),D,A,s,K=!1,h=e,x=e,I,R,T=null,U=null,u=null,w=d.move.TYPE_INNER,O=b.clientX,P=b.clientY,L=(new Date).getTime();g.uCanDo(e)&&G.bind("mousemove",c);G.bind("mouseup",r);G.bind("selectstart",k);b.preventDefault&&b.preventDefault();return!0}};v.extend(!0,v.fn.zTree.consts,J);v.extend(!0, | |
| 142 | +v.fn.zTree._z,{tools:{getAbs:function(b){b=b.getBoundingClientRect();return[b.left+(document.body.scrollLeft+document.documentElement.scrollLeft),b.top+(document.body.scrollTop+document.documentElement.scrollTop)]},inputFocus:function(b){b.get(0)&&(b.focus(),g.setCursorPosition(b.get(0),b.val().length))},inputSelect:function(b){b.get(0)&&(b.focus(),b.select())},setCursorPosition:function(b,a){if(b.setSelectionRange)b.focus(),b.setSelectionRange(a,a);else if(b.createTextRange){var c=b.createTextRange(); | |
| 143 | +c.collapse(!0);c.moveEnd("character",a);c.moveStart("character",a);c.select()}},showIfameMask:function(b,a){for(var c=m.getRoot(b);c.dragMaskList.length>0;)c.dragMaskList[0].remove(),c.dragMaskList.shift();if(a)for(var d=o("iframe",b),f=0,i=d.length;f<i;f++){var j=d.get(f),e=g.getAbs(j),j=o("<div id='zTreeMask_"+f+"' class='zTreeMask' style='top:"+e[1]+"px; left:"+e[0]+"px; width:"+j.offsetWidth+"px; height:"+j.offsetHeight+"px;'></div>",b);j.appendTo(o("body",b));c.dragMaskList.push(j)}}},view:{addEditBtn:function(b, | |
| 144 | +a){if(!(a.editNameFlag||o(a,d.id.EDIT,b).length>0)&&g.apply(b.edit.showRenameBtn,[b.treeId,a],b.edit.showRenameBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" edit' id='"+a.tId+d.id.EDIT+"' title='"+g.apply(b.edit.renameTitle,[b.treeId,a],b.edit.renameTitle)+"' treeNode"+d.id.EDIT+" style='display:none;'></span>";c.append(r);o(a,d.id.EDIT,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeEditName,[b.treeId,a],!0)==!1)return!1;f.editNode(b,a);return!1}).show()}}, | |
| 145 | +addRemoveBtn:function(b,a){if(!(a.editNameFlag||o(a,d.id.REMOVE,b).length>0)&&g.apply(b.edit.showRemoveBtn,[b.treeId,a],b.edit.showRemoveBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" remove' id='"+a.tId+d.id.REMOVE+"' title='"+g.apply(b.edit.removeTitle,[b.treeId,a],b.edit.removeTitle)+"' treeNode"+d.id.REMOVE+" style='display:none;'></span>";c.append(r);o(a,d.id.REMOVE,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeRemove,[b.treeId,a],!0)==!1)return!1;f.removeNode(b, | |
| 146 | +a);b.treeObj.trigger(d.event.REMOVE,[b.treeId,a]);return!1}).bind("mousedown",function(){return!0}).show()}},addHoverDom:function(b,a){if(m.getRoots().showHoverDom)a.isHover=!0,b.edit.enable&&(f.addEditBtn(b,a),f.addRemoveBtn(b,a)),g.apply(b.view.addHoverDom,[b.treeId,a])},cancelCurEditNode:function(b,a,c){var r=m.getRoot(b),k=b.data.key.name,i=r.curEditNode;if(i){var j=r.curEditInput,a=a?a:c?i[k]:j.val();if(g.apply(b.callback.beforeRename,[b.treeId,i,a,c],!0)===!1)return!1;i[k]=a;o(i,d.id.A,b).removeClass(d.node.CURSELECTED_EDIT); | |
| 147 | +j.unbind();f.setNodeName(b,i);i.editNameFlag=!1;r.curEditNode=null;r.curEditInput=null;f.selectNode(b,i,!1);b.treeObj.trigger(d.event.RENAME,[b.treeId,i,c])}return r.noSelection=!0},editNode:function(b,a){var c=m.getRoot(b);f.editNodeBlur=!1;if(m.isSelectedNode(b,a)&&c.curEditNode==a&&a.editNameFlag)setTimeout(function(){g.inputFocus(c.curEditInput)},0);else{var r=b.data.key.name;a.editNameFlag=!0;f.removeTreeDom(b,a);f.cancelCurEditNode(b);f.selectNode(b,a,!1);o(a,d.id.SPAN,b).html("<input type=text class='rename' id='"+ | |
| 148 | +a.tId+d.id.INPUT+"' treeNode"+d.id.INPUT+" >");var k=o(a,d.id.INPUT,b);k.attr("value",a[r]);b.edit.editNameSelectAll?g.inputSelect(k):g.inputFocus(k);k.bind("blur",function(){f.editNodeBlur||f.cancelCurEditNode(b)}).bind("keydown",function(a){a.keyCode=="13"?(f.editNodeBlur=!0,f.cancelCurEditNode(b)):a.keyCode=="27"&&f.cancelCurEditNode(b,null,!0)}).bind("click",function(){return!1}).bind("dblclick",function(){return!1});o(a,d.id.A,b).addClass(d.node.CURSELECTED_EDIT);c.curEditInput=k;c.noSelection= | |
| 149 | +!1;c.curEditNode=a}},moveNode:function(b,a,c,r,k,i){var j=m.getRoot(b),e=b.data.key.children;if(a!=c&&(!b.data.keep.leaf||!a||a.isParent||r!=d.move.TYPE_INNER)){var g=c.parentTId?c.getParentNode():j,t=a===null||a==j;t&&a===null&&(a=j);if(t)r=d.move.TYPE_INNER;j=a.parentTId?a.getParentNode():j;if(r!=d.move.TYPE_PREV&&r!=d.move.TYPE_NEXT)r=d.move.TYPE_INNER;if(r==d.move.TYPE_INNER)if(t)c.parentTId=null;else{if(!a.isParent)a.isParent=!0,a.open=!!a.open,f.setNodeLineIcos(b,a);c.parentTId=a.tId}var p; | |
| 150 | +t?p=t=b.treeObj:(!i&&r==d.move.TYPE_INNER?f.expandCollapseNode(b,a,!0,!1):i||f.expandCollapseNode(b,a.getParentNode(),!0,!1),t=o(a,b),p=o(a,d.id.UL,b),t.get(0)&&!p.get(0)&&(p=[],f.makeUlHtml(b,a,p,""),t.append(p.join(""))),p=o(a,d.id.UL,b));var q=o(c,b);q.get(0)?t.get(0)||q.remove():q=f.appendNodes(b,c.level,[c],null,-1,!1,!0).join("");p.get(0)&&r==d.move.TYPE_INNER?p.append(q):t.get(0)&&r==d.move.TYPE_PREV?t.before(q):t.get(0)&&r==d.move.TYPE_NEXT&&t.after(q);var l=-1,v=0,x=null,t=null,D=c.level; | |
| 151 | +if(c.isFirstNode){if(l=0,g[e].length>1)x=g[e][1],x.isFirstNode=!0}else if(c.isLastNode)l=g[e].length-1,x=g[e][l-1],x.isLastNode=!0;else for(p=0,q=g[e].length;p<q;p++)if(g[e][p].tId==c.tId){l=p;break}l>=0&&g[e].splice(l,1);if(r!=d.move.TYPE_INNER)for(p=0,q=j[e].length;p<q;p++)j[e][p].tId==a.tId&&(v=p);if(r==d.move.TYPE_INNER){a[e]||(a[e]=[]);if(a[e].length>0)t=a[e][a[e].length-1],t.isLastNode=!1;a[e].splice(a[e].length,0,c);c.isLastNode=!0;c.isFirstNode=a[e].length==1}else a.isFirstNode&&r==d.move.TYPE_PREV? | |
| 152 | +(j[e].splice(v,0,c),t=a,t.isFirstNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!0,c.isLastNode=!1):a.isLastNode&&r==d.move.TYPE_NEXT?(j[e].splice(v+1,0,c),t=a,t.isLastNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!0):(r==d.move.TYPE_PREV?j[e].splice(v,0,c):j[e].splice(v+1,0,c),c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!1);m.fixPIdKeyValue(b,c);m.setSonNodeLevel(b,c.getParentNode(),c);f.setNodeLineIcos(b,c);f.repairNodeLevelClass(b,c,D);!b.data.keep.parent&&g[e].length< | |
| 153 | +1?(g.isParent=!1,g.open=!1,a=o(g,d.id.UL,b),r=o(g,d.id.SWITCH,b),e=o(g,d.id.ICON,b),f.replaceSwitchClass(g,r,d.folder.DOCU),f.replaceIcoClass(g,e,d.folder.DOCU),a.css("display","none")):x&&f.setNodeLineIcos(b,x);t&&f.setNodeLineIcos(b,t);b.check&&b.check.enable&&f.repairChkClass&&(f.repairChkClass(b,g),f.repairParentChkClassWithSelf(b,g),g!=c.parent&&f.repairParentChkClassWithSelf(b,c));i||f.expandCollapseParentNode(b,c.getParentNode(),!0,k)}},removeEditBtn:function(b,a){o(a,d.id.EDIT,b).unbind().remove()}, | |
| 154 | +removeRemoveBtn:function(b,a){o(a,d.id.REMOVE,b).unbind().remove()},removeTreeDom:function(b,a){a.isHover=!1;f.removeEditBtn(b,a);f.removeRemoveBtn(b,a);g.apply(b.view.removeHoverDom,[b.treeId,a])},repairNodeLevelClass:function(b,a,c){if(c!==a.level){var f=o(a,b),g=o(a,d.id.A,b),b=o(a,d.id.UL,b),c=d.className.LEVEL+c,a=d.className.LEVEL+a.level;f.removeClass(c);f.addClass(a);g.removeClass(c);g.addClass(a);b.removeClass(c);b.addClass(a)}},selectNodes:function(b,a){for(var c=0,d=a.length;c<d;c++)f.selectNode(b, | |
| 155 | +a[c],c>0)}},event:{},data:{setSonNodeLevel:function(b,a,c){if(c){var d=b.data.key.children;c.level=a?a.level+1:0;if(c[d])for(var a=0,f=c[d].length;a<f;a++)c[d][a]&&m.setSonNodeLevel(b,c,c[d][a])}}}});var I=v.fn.zTree,g=I._z.tools,d=I.consts,f=I._z.view,m=I._z.data,o=g.$;m.exSetting({edit:{enable:!1,editNameSelectAll:!1,showRemoveBtn:!0,showRenameBtn:!0,removeTitle:"remove",renameTitle:"rename",drag:{autoExpandTrigger:!1,isCopy:!0,isMove:!0,prev:!0,next:!0,inner:!0,minMoveSize:5,borderMax:10,borderMin:-5, | |
| 156 | +maxShowNodeNum:5,autoOpenTime:500}},view:{addHoverDom:null,removeHoverDom:null},callback:{beforeDrag:null,beforeDragOpen:null,beforeDrop:null,beforeEditName:null,beforeRename:null,onDrag:null,onDragMove:null,onDrop:null,onRename:null}});m.addInitBind(function(b){var a=b.treeObj,c=d.event;a.bind(c.RENAME,function(a,c,d,f){g.apply(b.callback.onRename,[a,c,d,f])});a.bind(c.DRAG,function(a,c,d,f){g.apply(b.callback.onDrag,[c,d,f])});a.bind(c.DRAGMOVE,function(a,c,d,f){g.apply(b.callback.onDragMove,[c, | |
| 157 | +d,f])});a.bind(c.DROP,function(a,c,d,f,e,m,o){g.apply(b.callback.onDrop,[c,d,f,e,m,o])})});m.addInitUnBind(function(b){var b=b.treeObj,a=d.event;b.unbind(a.RENAME);b.unbind(a.DRAG);b.unbind(a.DRAGMOVE);b.unbind(a.DROP)});m.addInitCache(function(){});m.addInitNode(function(b,a,c){if(c)c.isHover=!1,c.editNameFlag=!1});m.addInitProxy(function(b){var a=b.target,c=m.getSetting(b.data.treeId),f=b.relatedTarget,k="",i=null,j="",e=null,o=null;if(g.eqs(b.type,"mouseover")){if(o=g.getMDom(c,a,[{tagName:"a", | |
| 158 | +attrName:"treeNode"+d.id.A}]))k=g.getNodeMainDom(o).id,j="hoverOverNode"}else if(g.eqs(b.type,"mouseout"))o=g.getMDom(c,f,[{tagName:"a",attrName:"treeNode"+d.id.A}]),o||(k="remove",j="hoverOutNode");else if(g.eqs(b.type,"mousedown")&&(o=g.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+d.id.A}])))k=g.getNodeMainDom(o).id,j="mousedownNode";if(k.length>0)switch(i=m.getNodeCache(c,k),j){case "mousedownNode":e=x.onMousedownNode;break;case "hoverOverNode":e=x.onHoverOverNode;break;case "hoverOutNode":e= | |
| 159 | +x.onHoverOutNode}return{stop:!1,node:i,nodeEventType:j,nodeEventCallback:e,treeEventType:"",treeEventCallback:null}});m.addInitRoot(function(b){var b=m.getRoot(b),a=m.getRoots();b.curEditNode=null;b.curEditInput=null;b.curHoverNode=null;b.dragFlag=0;b.dragNodeShowBefore=[];b.dragMaskList=[];a.showHoverDom=!0});m.addZTreeTools(function(b,a){a.cancelEditName=function(a){m.getRoot(this.setting).curEditNode&&f.cancelCurEditNode(this.setting,a?a:null,!0)};a.copyNode=function(a,b,k,i){if(!b)return null; | |
| 160 | +if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;var j=this,e=g.clone(b);if(!a)a=null,k=d.move.TYPE_INNER;k==d.move.TYPE_INNER?(b=function(){f.addNodes(j.setting,a,-1,[e],i)},g.canAsync(this.setting,a)?f.asyncNode(this.setting,a,i,b):b()):(f.addNodes(this.setting,a.parentNode,-1,[e],i),f.moveNode(this.setting,a,e,k,!1,i));return e};a.editName=function(a){a&&a.tId&&a===m.getNodeCache(this.setting,a.tId)&&(a.parentTId&&f.expandCollapseParentNode(this.setting,a.getParentNode(), | |
| 161 | +!0),f.editNode(this.setting,a))};a.moveNode=function(a,b,k,i){function j(){f.moveNode(e.setting,a,b,k,!1,i)}if(!b)return b;if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;else if(a&&(b.parentTId==a.tId&&k==d.move.TYPE_INNER||o(b,this.setting).find("#"+a.tId).length>0))return null;else a||(a=null);var e=this;g.canAsync(this.setting,a)&&k===d.move.TYPE_INNER?f.asyncNode(this.setting,a,i,j):j();return b};a.setEditable=function(a){this.setting.edit.enable=a;return this.refresh()}}); | |
| 162 | +var O=f.cancelPreSelectedNode;f.cancelPreSelectedNode=function(b,a){for(var c=m.getRoot(b).curSelectedList,d=0,g=c.length;d<g;d++)if(!a||a===c[d])if(f.removeTreeDom(b,c[d]),a)break;O&&O.apply(f,arguments)};var P=f.createNodes;f.createNodes=function(b,a,c,d,g){P&&P.apply(f,arguments);c&&f.repairParentChkClassWithSelf&&f.repairParentChkClassWithSelf(b,d)};var W=f.makeNodeUrl;f.makeNodeUrl=function(b,a){return b.edit.enable?null:W.apply(f,arguments)};var L=f.removeNode;f.removeNode=function(b,a){var c= | |
| 163 | +m.getRoot(b);if(c.curEditNode===a)c.curEditNode=null;L&&L.apply(f,arguments)};var Q=f.selectNode;f.selectNode=function(b,a,c){var d=m.getRoot(b);if(m.isSelectedNode(b,a)&&d.curEditNode==a&&a.editNameFlag)return!1;Q&&Q.apply(f,arguments);f.addHoverDom(b,a);return!0};var V=g.uCanDo;g.uCanDo=function(b,a){var c=m.getRoot(b);if(a&&(g.eqs(a.type,"mouseover")||g.eqs(a.type,"mouseout")||g.eqs(a.type,"mousedown")||g.eqs(a.type,"mouseup")))return!0;if(c.curEditNode)f.editNodeBlur=!1,c.curEditInput.focus(); | |
| 164 | +return!c.curEditNode&&(V?V.apply(f,arguments):!0)}})(jQuery); | |
| 165 | + | ... | ... |
src/main/resources/static/assets/plugins/ztree_v3/js/jquery.ztree.core.min.js
| 1 | -/* | |
| 2 | - * JQuery zTree core v3.5.29 | |
| 3 | - * http://treejs.cn/ | |
| 4 | - * | |
| 5 | - * Copyright (c) 2010 Hunter.z | |
| 6 | - * | |
| 7 | - * Licensed same as jquery - MIT License | |
| 8 | - * http://www.opensource.org/licenses/mit-license.php | |
| 9 | - * | |
| 10 | - * email: hunter.z@263.net | |
| 11 | - * Date: 2017-06-19 | |
| 12 | - */ | |
| 13 | -(function(r){var I,J,K,L,M,N,v,s={},w={},x={},O={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url",icon:"icon"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text", | |
| 14 | -url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},y=[function(b){var a=b.treeObj,c=f.event;a.bind(c.NODECREATED,function(a,c,g){j.apply(b.callback.onNodeCreated, | |
| 15 | -[a,c,g])});a.bind(c.CLICK,function(a,c,g,k,h){j.apply(b.callback.onClick,[c,g,k,h])});a.bind(c.EXPAND,function(a,c,g){j.apply(b.callback.onExpand,[a,c,g])});a.bind(c.COLLAPSE,function(a,c,g){j.apply(b.callback.onCollapse,[a,c,g])});a.bind(c.ASYNC_SUCCESS,function(a,c,g,k){j.apply(b.callback.onAsyncSuccess,[a,c,g,k])});a.bind(c.ASYNC_ERROR,function(a,c,g,k,h,f){j.apply(b.callback.onAsyncError,[a,c,g,k,h,f])});a.bind(c.REMOVE,function(a,c,g){j.apply(b.callback.onRemove,[a,c,g])});a.bind(c.SELECTED, | |
| 16 | -function(a,c,g){j.apply(b.callback.onSelected,[c,g])});a.bind(c.UNSELECTED,function(a,c,g){j.apply(b.callback.onUnSelected,[c,g])})}],z=[function(b){var a=f.event;b.treeObj.unbind(a.NODECREATED).unbind(a.CLICK).unbind(a.EXPAND).unbind(a.COLLAPSE).unbind(a.ASYNC_SUCCESS).unbind(a.ASYNC_ERROR).unbind(a.REMOVE).unbind(a.SELECTED).unbind(a.UNSELECTED)}],A=[function(b){var a=h.getCache(b);a||(a={},h.setCache(b,a));a.nodes=[];a.doms=[]}],B=[function(b,a,c,d,e,g){if(c){var k=h.getRoot(b),f=b.data.key.children; | |
| 17 | -c.level=a;c.tId=b.treeId+"_"+ ++k.zId;c.parentTId=d?d.tId:null;c.open=typeof c.open=="string"?j.eqs(c.open,"true"):!!c.open;c[f]&&c[f].length>0?(c.isParent=!0,c.zAsync=!0):(c.isParent=typeof c.isParent=="string"?j.eqs(c.isParent,"true"):!!c.isParent,c.open=c.isParent&&!b.async.enable?c.open:!1,c.zAsync=!c.isParent);c.isFirstNode=e;c.isLastNode=g;c.getParentNode=function(){return h.getNodeCache(b,c.parentTId)};c.getPreNode=function(){return h.getPreNode(b,c)};c.getNextNode=function(){return h.getNextNode(b, | |
| 18 | -c)};c.getIndex=function(){return h.getNodeIndex(b,c)};c.getPath=function(){return h.getNodePath(b,c)};c.isAjaxing=!1;h.fixPIdKeyValue(b,c)}}],u=[function(b){var a=b.target,c=h.getSetting(b.data.treeId),d="",e=null,g="",k="",p=null,i=null,q=null;if(j.eqs(b.type,"mousedown"))k="mousedown";else if(j.eqs(b.type,"mouseup"))k="mouseup";else if(j.eqs(b.type,"contextmenu"))k="contextmenu";else if(j.eqs(b.type,"click"))if(j.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+f.id.SWITCH)!==null)d=j.getNodeMainDom(a).id, | |
| 19 | -g="switchNode";else{if(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}]))d=j.getNodeMainDom(q).id,g="clickNode"}else if(j.eqs(b.type,"dblclick")&&(k="dblclick",q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id,g="switchNode";if(k.length>0&&d.length==0&&(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id;if(d.length>0)switch(e=h.getNodeCache(c,d),g){case "switchNode":e.isParent?j.eqs(b.type,"click")||j.eqs(b.type,"dblclick")&& | |
| 20 | -j.apply(c.view.dblClickExpand,[c.treeId,e],c.view.dblClickExpand)?p=I:g="":g="";break;case "clickNode":p=J}switch(k){case "mousedown":i=K;break;case "mouseup":i=L;break;case "dblclick":i=M;break;case "contextmenu":i=N}return{stop:!1,node:e,nodeEventType:g,nodeEventCallback:p,treeEventType:k,treeEventCallback:i}}],C=[function(b){var a=h.getRoot(b);a||(a={},h.setRoot(b,a));a[b.data.key.children]=[];a.expandTriggerFlag=!1;a.curSelectedList=[];a.noSelection=!0;a.createdNodes=[];a.zId=0;a._ver=(new Date).getTime()}], | |
| 21 | -D=[],E=[],F=[],G=[],H=[],h={addNodeCache:function(b,a){h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=a},getNodeCacheId:function(b){return b.substring(b.lastIndexOf("_")+1)},addAfterA:function(b){E.push(b)},addBeforeA:function(b){D.push(b)},addInnerAfterA:function(b){G.push(b)},addInnerBeforeA:function(b){F.push(b)},addInitBind:function(b){y.push(b)},addInitUnBind:function(b){z.push(b)},addInitCache:function(b){A.push(b)},addInitNode:function(b){B.push(b)},addInitProxy:function(b,a){a?u.splice(0,0, | |
| 22 | -b):u.push(b)},addInitRoot:function(b){C.push(b)},addNodesData:function(b,a,c,d){var e=b.data.key.children;a[e]?c>=a[e].length&&(c=-1):(a[e]=[],c=-1);if(a[e].length>0&&c===0)a[e][0].isFirstNode=!1,i.setNodeLineIcos(b,a[e][0]);else if(a[e].length>0&&c<0)a[e][a[e].length-1].isLastNode=!1,i.setNodeLineIcos(b,a[e][a[e].length-1]);a.isParent=!0;c<0?a[e]=a[e].concat(d):(b=[c,0].concat(d),a[e].splice.apply(a[e],b))},addSelectedNode:function(b,a){var c=h.getRoot(b);h.isSelectedNode(b,a)||c.curSelectedList.push(a)}, | |
| 23 | -addCreatedNode:function(b,a){(b.callback.onNodeCreated||b.view.addDiyDom)&&h.getRoot(b).createdNodes.push(a)},addZTreeTools:function(b){H.push(b)},exSetting:function(b){r.extend(!0,O,b)},fixPIdKeyValue:function(b,a){b.data.simpleData.enable&&(a[b.data.simpleData.pIdKey]=a.parentTId?a.getParentNode()[b.data.simpleData.idKey]:b.data.simpleData.rootPId)},getAfterA:function(b,a,c){for(var d=0,e=E.length;d<e;d++)E[d].apply(this,arguments)},getBeforeA:function(b,a,c){for(var d=0,e=D.length;d<e;d++)D[d].apply(this, | |
| 24 | -arguments)},getInnerAfterA:function(b,a,c){for(var d=0,e=G.length;d<e;d++)G[d].apply(this,arguments)},getInnerBeforeA:function(b,a,c){for(var d=0,e=F.length;d<e;d++)F[d].apply(this,arguments)},getCache:function(b){return x[b.treeId]},getNodeIndex:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e;return-1},getNextNode:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId? | |
| 25 | -a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e==g?null:d[c][e+1];return null},getNodeByParam:function(b,a,c,d){if(!a||!c)return null;for(var e=b.data.key.children,g=0,k=a.length;g<k;g++){if(a[g][c]==d)return a[g];var f=h.getNodeByParam(b,a[g][e],c,d);if(f)return f}return null},getNodeCache:function(b,a){if(!a)return null;var c=x[b.treeId].nodes[h.getNodeCacheId(a)];return c?c:null},getNodeName:function(b,a){return""+a[b.data.key.name]},getNodePath:function(b,a){if(!a)return null; | |
| 26 | -var c;(c=a.parentTId?a.getParentNode().getPath():[])&&c.push(a);return c},getNodeTitle:function(b,a){return""+a[b.data.key.title===""?b.data.key.name:b.data.key.title]},getNodes:function(b){return h.getRoot(b)[b.data.key.children]},getNodesByParam:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children,g=[],k=0,f=a.length;k<f;k++)a[k][c]==d&&g.push(a[k]),g=g.concat(h.getNodesByParam(b,a[k][e],c,d));return g},getNodesByParamFuzzy:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children, | |
| 27 | -g=[],d=d.toLowerCase(),k=0,f=a.length;k<f;k++)typeof a[k][c]=="string"&&a[k][c].toLowerCase().indexOf(d)>-1&&g.push(a[k]),g=g.concat(h.getNodesByParamFuzzy(b,a[k][e],c,d));return g},getNodesByFilter:function(b,a,c,d,e){if(!a)return d?null:[];for(var g=b.data.key.children,k=d?null:[],f=0,i=a.length;f<i;f++){if(j.apply(c,[a[f],e],!1)){if(d)return a[f];k.push(a[f])}var q=h.getNodesByFilter(b,a[f][g],c,d,e);if(d&&q)return q;k=d?q:k.concat(q)}return k},getPreNode:function(b,a){if(!a)return null;for(var c= | |
| 28 | -b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length;e<g;e++)if(d[c][e]===a)return e==0?null:d[c][e-1];return null},getRoot:function(b){return b?w[b.treeId]:null},getRoots:function(){return w},getSetting:function(b){return s[b]},getSettings:function(){return s},getZTreeTools:function(b){return(b=this.getRoot(this.getSetting(b)))?b.treeTools:null},initCache:function(b){for(var a=0,c=A.length;a<c;a++)A[a].apply(this,arguments)},initNode:function(b,a,c,d,e,g){for(var k= | |
| 29 | -0,f=B.length;k<f;k++)B[k].apply(this,arguments)},initRoot:function(b){for(var a=0,c=C.length;a<c;a++)C[a].apply(this,arguments)},isSelectedNode:function(b,a){for(var c=h.getRoot(b),d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d])return!0;return!1},removeNodeCache:function(b,a){var c=b.data.key.children;if(a[c])for(var d=0,e=a[c].length;d<e;d++)h.removeNodeCache(b,a[c][d]);h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=null},removeSelectedNode:function(b,a){for(var c=h.getRoot(b), | |
| 30 | -d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d]||!h.getNodeCache(b,c.curSelectedList[d].tId))c.curSelectedList.splice(d,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,a]),d--,e--},setCache:function(b,a){x[b.treeId]=a},setRoot:function(b,a){w[b.treeId]=a},setZTreeTools:function(b,a){for(var c=0,d=H.length;c<d;c++)H[c].apply(this,arguments)},transformToArrayFormat:function(b,a){if(!a)return[];var c=b.data.key.children,d=[];if(j.isArray(a))for(var e=0,g=a.length;e<g;e++)d.push(a[e]), | |
| 31 | -a[e][c]&&(d=d.concat(h.transformToArrayFormat(b,a[e][c])));else d.push(a),a[c]&&(d=d.concat(h.transformToArrayFormat(b,a[c])));return d},transformTozTreeFormat:function(b,a){var c,d,e=b.data.simpleData.idKey,g=b.data.simpleData.pIdKey,k=b.data.key.children;if(!e||e==""||!a)return[];if(j.isArray(a)){var f=[],h={};for(c=0,d=a.length;c<d;c++)h[a[c][e]]=a[c];for(c=0,d=a.length;c<d;c++)h[a[c][g]]&&a[c][e]!=a[c][g]?(h[a[c][g]][k]||(h[a[c][g]][k]=[]),h[a[c][g]][k].push(a[c])):f.push(a[c]);return f}else return[a]}}, | |
| 32 | -m={bindEvent:function(b){for(var a=0,c=y.length;a<c;a++)y[a].apply(this,arguments)},unbindEvent:function(b){for(var a=0,c=z.length;a<c;a++)z[a].apply(this,arguments)},bindTree:function(b){var a={treeId:b.treeId},c=b.treeObj;b.view.txtSelectedEnable||c.bind("selectstart",v).css({"-moz-user-select":"-moz-none"});c.bind("click",a,m.proxy);c.bind("dblclick",a,m.proxy);c.bind("mouseover",a,m.proxy);c.bind("mouseout",a,m.proxy);c.bind("mousedown",a,m.proxy);c.bind("mouseup",a,m.proxy);c.bind("contextmenu", | |
| 33 | -a,m.proxy)},unbindTree:function(b){b.treeObj.unbind("selectstart",v).unbind("click",m.proxy).unbind("dblclick",m.proxy).unbind("mouseover",m.proxy).unbind("mouseout",m.proxy).unbind("mousedown",m.proxy).unbind("mouseup",m.proxy).unbind("contextmenu",m.proxy)},doProxy:function(b){for(var a=[],c=0,d=u.length;c<d;c++){var e=u[c].apply(this,arguments);a.push(e);if(e.stop)break}return a},proxy:function(b){var a=h.getSetting(b.data.treeId);if(!j.uCanDo(a,b))return!0;for(var a=m.doProxy(b),c=!0,d=0,e=a.length;d< | |
| 34 | -e;d++){var g=a[d];g.nodeEventCallback&&(c=g.nodeEventCallback.apply(g,[b,g.node])&&c);g.treeEventCallback&&(c=g.treeEventCallback.apply(g,[b,g.node])&&c)}return c}};I=function(b,a){var c=h.getSetting(b.data.treeId);if(a.open){if(j.apply(c.callback.beforeCollapse,[c.treeId,a],!0)==!1)return!0}else if(j.apply(c.callback.beforeExpand,[c.treeId,a],!0)==!1)return!0;h.getRoot(c).expandTriggerFlag=!0;i.switchNode(c,a);return!0};J=function(b,a){var c=h.getSetting(b.data.treeId),d=c.view.autoCancelSelected&& | |
| 35 | -(b.ctrlKey||b.metaKey)&&h.isSelectedNode(c,a)?0:c.view.autoCancelSelected&&(b.ctrlKey||b.metaKey)&&c.view.selectedMulti?2:1;if(j.apply(c.callback.beforeClick,[c.treeId,a,d],!0)==!1)return!0;d===0?i.cancelPreSelectedNode(c,a):i.selectNode(c,a,d===2);c.treeObj.trigger(f.event.CLICK,[b,c.treeId,a,d]);return!0};K=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeMouseDown,[c.treeId,a],!0)&&j.apply(c.callback.onMouseDown,[b,c.treeId,a]);return!0};L=function(b,a){var c=h.getSetting(b.data.treeId); | |
| 36 | -j.apply(c.callback.beforeMouseUp,[c.treeId,a],!0)&&j.apply(c.callback.onMouseUp,[b,c.treeId,a]);return!0};M=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeDblClick,[c.treeId,a],!0)&&j.apply(c.callback.onDblClick,[b,c.treeId,a]);return!0};N=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeRightClick,[c.treeId,a],!0)&&j.apply(c.callback.onRightClick,[b,c.treeId,a]);return typeof c.callback.onRightClick!="function"};v=function(b){b=b.originalEvent.srcElement.nodeName.toLowerCase(); | |
| 37 | -return b==="input"||b==="textarea"};var j={apply:function(b,a,c){return typeof b=="function"?b.apply(P,a?a:[]):c},canAsync:function(b,a){var c=b.data.key.children;return b.async.enable&&a&&a.isParent&&!(a.zAsync||a[c]&&a[c].length>0)},clone:function(b){if(b===null)return null;var a=j.isArray(b)?[]:{},c;for(c in b)a[c]=b[c]instanceof Date?new Date(b[c].getTime()):typeof b[c]==="object"?j.clone(b[c]):b[c];return a},eqs:function(b,a){return b.toLowerCase()===a.toLowerCase()},isArray:function(b){return Object.prototype.toString.apply(b)=== | |
| 38 | -"[object Array]"},isElement:function(b){return typeof HTMLElement==="object"?b instanceof HTMLElement:b&&typeof b==="object"&&b!==null&&b.nodeType===1&&typeof b.nodeName==="string"},$:function(b,a,c){a&&typeof a!="string"&&(c=a,a="");return typeof b=="string"?r(b,c?c.treeObj.get(0).ownerDocument:null):r("#"+b.tId+a,c?c.treeObj:null)},getMDom:function(b,a,c){if(!a)return null;for(;a&&a.id!==b.treeId;){for(var d=0,e=c.length;a.tagName&&d<e;d++)if(j.eqs(a.tagName,c[d].tagName)&&a.getAttribute(c[d].attrName)!== | |
| 39 | -null)return a;a=a.parentNode}return null},getNodeMainDom:function(b){return r(b).parent("li").get(0)||r(b).parentsUntil("li").parent().get(0)},isChildOrSelf:function(b,a){return r(b).closest("#"+a).length>0},uCanDo:function(){return!0}},i={addNodes:function(b,a,c,d,e){if(!b.data.keep.leaf||!a||a.isParent)if(j.isArray(d)||(d=[d]),b.data.simpleData.enable&&(d=h.transformTozTreeFormat(b,d)),a){var g=l(a,f.id.SWITCH,b),k=l(a,f.id.ICON,b),p=l(a,f.id.UL,b);if(!a.open)i.replaceSwitchClass(a,g,f.folder.CLOSE), | |
| 40 | -i.replaceIcoClass(a,k,f.folder.CLOSE),a.open=!1,p.css({display:"none"});h.addNodesData(b,a,c,d);i.createNodes(b,a.level+1,d,a,c);e||i.expandCollapseParentNode(b,a,!0)}else h.addNodesData(b,h.getRoot(b),c,d),i.createNodes(b,0,d,null,c)},appendNodes:function(b,a,c,d,e,g,k){if(!c)return[];var f=[],j=b.data.key.children,q=(d?d:h.getRoot(b))[j],l,Q;if(!q||e>=q.length-c.length)e=-1;for(var t=0,m=c.length;t<m;t++){var o=c[t];g&&(l=(e===0||q.length==c.length)&&t==0,Q=e<0&&t==c.length-1,h.initNode(b,a,o,d, | |
| 41 | -l,Q,k),h.addNodeCache(b,o));l=[];o[j]&&o[j].length>0&&(l=i.appendNodes(b,a+1,o[j],o,-1,g,k&&o.open));k&&(i.makeDOMNodeMainBefore(f,b,o),i.makeDOMNodeLine(f,b,o),h.getBeforeA(b,o,f),i.makeDOMNodeNameBefore(f,b,o),h.getInnerBeforeA(b,o,f),i.makeDOMNodeIcon(f,b,o),h.getInnerAfterA(b,o,f),i.makeDOMNodeNameAfter(f,b,o),h.getAfterA(b,o,f),o.isParent&&o.open&&i.makeUlHtml(b,o,f,l.join("")),i.makeDOMNodeMainAfter(f,b,o),h.addCreatedNode(b,o))}return f},appendParentULDom:function(b,a){var c=[],d=l(a,b);!d.get(0)&& | |
| 42 | -a.parentTId&&(i.appendParentULDom(b,a.getParentNode()),d=l(a,b));var e=l(a,f.id.UL,b);e.get(0)&&e.remove();e=i.appendNodes(b,a.level+1,a[b.data.key.children],a,-1,!1,!0);i.makeUlHtml(b,a,c,e.join(""));d.append(c.join(""))},asyncNode:function(b,a,c,d){var e,g;if(a&&!a.isParent)return j.apply(d),!1;else if(a&&a.isAjaxing)return!1;else if(j.apply(b.callback.beforeAsync,[b.treeId,a],!0)==!1)return j.apply(d),!1;if(a)a.isAjaxing=!0,l(a,f.id.ICON,b).attr({style:"","class":f.className.BUTTON+" "+f.className.ICO_LOADING}); | |
| 43 | -var k={};for(e=0,g=b.async.autoParam.length;a&&e<g;e++){var p=b.async.autoParam[e].split("="),n=p;p.length>1&&(n=p[1],p=p[0]);k[n]=a[p]}if(j.isArray(b.async.otherParam))for(e=0,g=b.async.otherParam.length;e<g;e+=2)k[b.async.otherParam[e]]=b.async.otherParam[e+1];else for(var q in b.async.otherParam)k[q]=b.async.otherParam[q];var m=h.getRoot(b)._ver;r.ajax({contentType:b.async.contentType,cache:!1,type:b.async.type,url:j.apply(b.async.url,[b.treeId,a],b.async.url),data:b.async.contentType.indexOf("application/json")> | |
| 44 | --1?JSON.stringify(k):k,dataType:b.async.dataType,success:function(g){if(m==h.getRoot(b)._ver){var e=[];try{e=!g||g.length==0?[]:typeof g=="string"?eval("("+g+")"):g}catch(k){e=g}if(a)a.isAjaxing=null,a.zAsync=!0;i.setNodeLineIcos(b,a);e&&e!==""?(e=j.apply(b.async.dataFilter,[b.treeId,a,e],e),i.addNodes(b,a,-1,e?j.clone(e):[],!!c)):i.addNodes(b,a,-1,[],!!c);b.treeObj.trigger(f.event.ASYNC_SUCCESS,[b.treeId,a,g]);j.apply(d)}},error:function(c,d,g){if(m==h.getRoot(b)._ver){if(a)a.isAjaxing=null;i.setNodeLineIcos(b, | |
| 45 | -a);b.treeObj.trigger(f.event.ASYNC_ERROR,[b.treeId,a,c,d,g])}}});return!0},cancelPreSelectedNode:function(b,a,c){var d=h.getRoot(b).curSelectedList,e,g;for(e=d.length-1;e>=0;e--)if(g=d[e],a===g||!a&&(!c||c!==g))if(l(g,f.id.A,b).removeClass(f.node.CURSELECTED),a){h.removeSelectedNode(b,a);break}else d.splice(e,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,g])},createNodeCallback:function(b){if(b.callback.onNodeCreated||b.view.addDiyDom)for(var a=h.getRoot(b);a.createdNodes.length>0;){var c=a.createdNodes.shift(); | |
| 46 | -j.apply(b.view.addDiyDom,[b.treeId,c]);b.callback.onNodeCreated&&b.treeObj.trigger(f.event.NODECREATED,[b.treeId,c])}},createNodes:function(b,a,c,d,e){if(c&&c.length!=0){var g=h.getRoot(b),k=b.data.key.children,k=!d||d.open||!!l(d[k][0],b).get(0);g.createdNodes=[];var a=i.appendNodes(b,a,c,d,e,!0,k),j,n;d?(d=l(d,f.id.UL,b),d.get(0)&&(j=d)):j=b.treeObj;j&&(e>=0&&(n=j.children()[e]),e>=0&&n?r(n).before(a.join("")):j.append(a.join("")));i.createNodeCallback(b)}},destroy:function(b){b&&(h.initCache(b), | |
| 47 | -h.initRoot(b),m.unbindTree(b),m.unbindEvent(b),b.treeObj.empty(),delete s[b.treeId])},expandCollapseNode:function(b,a,c,d,e){var g=h.getRoot(b),k=b.data.key.children,p;if(a){if(g.expandTriggerFlag)p=e,e=function(){p&&p();a.open?b.treeObj.trigger(f.event.EXPAND,[b.treeId,a]):b.treeObj.trigger(f.event.COLLAPSE,[b.treeId,a])},g.expandTriggerFlag=!1;if(!a.open&&a.isParent&&(!l(a,f.id.UL,b).get(0)||a[k]&&a[k].length>0&&!l(a[k][0],b).get(0)))i.appendParentULDom(b,a),i.createNodeCallback(b);if(a.open==c)j.apply(e, | |
| 48 | -[]);else{var c=l(a,f.id.UL,b),g=l(a,f.id.SWITCH,b),n=l(a,f.id.ICON,b);a.isParent?(a.open=!a.open,a.iconOpen&&a.iconClose&&n.attr("style",i.makeNodeIcoStyle(b,a)),a.open?(i.replaceSwitchClass(a,g,f.folder.OPEN),i.replaceIcoClass(a,n,f.folder.OPEN),d==!1||b.view.expandSpeed==""?(c.show(),j.apply(e,[])):a[k]&&a[k].length>0?c.slideDown(b.view.expandSpeed,e):(c.show(),j.apply(e,[]))):(i.replaceSwitchClass(a,g,f.folder.CLOSE),i.replaceIcoClass(a,n,f.folder.CLOSE),d==!1||b.view.expandSpeed==""||!(a[k]&& | |
| 49 | -a[k].length>0)?(c.hide(),j.apply(e,[])):c.slideUp(b.view.expandSpeed,e))):j.apply(e,[])}}else j.apply(e,[])},expandCollapseParentNode:function(b,a,c,d,e){a&&(a.parentTId?(i.expandCollapseNode(b,a,c,d),a.parentTId&&i.expandCollapseParentNode(b,a.getParentNode(),c,d,e)):i.expandCollapseNode(b,a,c,d,e))},expandCollapseSonNode:function(b,a,c,d,e){var g=h.getRoot(b),f=b.data.key.children,g=a?a[f]:g[f],f=a?!1:d,j=h.getRoot(b).expandTriggerFlag;h.getRoot(b).expandTriggerFlag=!1;if(g)for(var n=0,l=g.length;n< | |
| 50 | -l;n++)g[n]&&i.expandCollapseSonNode(b,g[n],c,f);h.getRoot(b).expandTriggerFlag=j;i.expandCollapseNode(b,a,c,d,e)},isSelectedNode:function(b,a){if(!a)return!1;var c=h.getRoot(b).curSelectedList,d;for(d=c.length-1;d>=0;d--)if(a===c[d])return!0;return!1},makeDOMNodeIcon:function(b,a,c){var d=h.getNodeName(a,c),d=a.view.nameIsHTML?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");b.push("<span id='",c.tId,f.id.ICON,"' title='' treeNode",f.id.ICON," class='",i.makeNodeIcoClass(a,c),"' style='", | |
| 51 | -i.makeNodeIcoStyle(a,c),"'></span><span id='",c.tId,f.id.SPAN,"' class='",f.className.NAME,"'>",d,"</span>")},makeDOMNodeLine:function(b,a,c){b.push("<span id='",c.tId,f.id.SWITCH,"' title='' class='",i.makeNodeLineClass(a,c),"' treeNode",f.id.SWITCH,"></span>")},makeDOMNodeMainAfter:function(b){b.push("</li>")},makeDOMNodeMainBefore:function(b,a,c){b.push("<li id='",c.tId,"' class='",f.className.LEVEL,c.level,"' tabindex='0' hidefocus='true' treenode>")},makeDOMNodeNameAfter:function(b){b.push("</a>")}, | |
| 52 | -makeDOMNodeNameBefore:function(b,a,c){var d=h.getNodeTitle(a,c),e=i.makeNodeUrl(a,c),g=i.makeNodeFontCss(a,c),k=[],p;for(p in g)k.push(p,":",g[p],";");b.push("<a id='",c.tId,f.id.A,"' class='",f.className.LEVEL,c.level,"' treeNode",f.id.A,' onclick="',c.click||"",'" ',e!=null&&e.length>0?"href='"+e+"'":""," target='",i.makeNodeTarget(c),"' style='",k.join(""),"'");j.apply(a.view.showTitle,[a.treeId,c],a.view.showTitle)&&d&&b.push("title='",d.replace(/'/g,"'").replace(/</g,"<").replace(/>/g, | |
| 53 | -">"),"'");b.push(">")},makeNodeFontCss:function(b,a){var c=j.apply(b.view.fontCss,[b.treeId,a],b.view.fontCss);return c&&typeof c!="function"?c:{}},makeNodeIcoClass:function(b,a){var c=["ico"];a.isAjaxing||(c[0]=(a.iconSkin?a.iconSkin+"_":"")+c[0],a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU));return f.className.BUTTON+" "+c.join("_")},makeNodeIcoStyle:function(b,a){var c=[];if(!a.isAjaxing){var d=a.isParent&&a.iconOpen&&a.iconClose?a.open?a.iconOpen:a.iconClose: | |
| 54 | -a[b.data.key.icon];d&&c.push("background:url(",d,") 0 0 no-repeat;");(b.view.showIcon==!1||!j.apply(b.view.showIcon,[b.treeId,a],!0))&&c.push("width:0px;height:0px;")}return c.join("")},makeNodeLineClass:function(b,a){var c=[];b.view.showLine?a.level==0&&a.isFirstNode&&a.isLastNode?c.push(f.line.ROOT):a.level==0&&a.isFirstNode?c.push(f.line.ROOTS):a.isLastNode?c.push(f.line.BOTTOM):c.push(f.line.CENTER):c.push(f.line.NOLINE);a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU); | |
| 55 | -return i.makeNodeLineClassEx(a)+c.join("_")},makeNodeLineClassEx:function(b){return f.className.BUTTON+" "+f.className.LEVEL+b.level+" "+f.className.SWITCH+" "},makeNodeTarget:function(b){return b.target||"_blank"},makeNodeUrl:function(b,a){var c=b.data.key.url;return a[c]?a[c]:null},makeUlHtml:function(b,a,c,d){c.push("<ul id='",a.tId,f.id.UL,"' class='",f.className.LEVEL,a.level," ",i.makeUlLineClass(b,a),"' style='display:",a.open?"block":"none","'>");c.push(d);c.push("</ul>")},makeUlLineClass:function(b, | |
| 56 | -a){return b.view.showLine&&!a.isLastNode?f.line.LINE:""},removeChildNodes:function(b,a){if(a){var c=b.data.key.children,d=a[c];if(d){for(var e=0,g=d.length;e<g;e++)h.removeNodeCache(b,d[e]);h.removeSelectedNode(b);delete a[c];b.data.keep.parent?l(a,f.id.UL,b).empty():(a.isParent=!1,a.open=!1,c=l(a,f.id.SWITCH,b),d=l(a,f.id.ICON,b),i.replaceSwitchClass(a,c,f.folder.DOCU),i.replaceIcoClass(a,d,f.folder.DOCU),l(a,f.id.UL,b).remove())}}},scrollIntoView:function(b){if(b){if(!Element.prototype.scrollIntoViewIfNeeded)Element.prototype.scrollIntoViewIfNeeded= | |
| 57 | -function(a){function b(a,d,e,f){return{left:a,top:d,width:e,height:f,right:a+e,bottom:d+f,translate:function(g,k){return b(g+a,k+d,e,f)},relativeFromTo:function(k,h){var i=a,j=d,k=k.offsetParent,h=h.offsetParent;if(k===h)return g;for(;k;k=k.offsetParent)i+=k.offsetLeft+k.clientLeft,j+=k.offsetTop+k.clientTop;for(;h;h=h.offsetParent)i-=h.offsetLeft+h.clientLeft,j-=h.offsetTop+h.clientTop;return b(i,j,e,f)}}}for(var d,e=this,g=b(this.offsetLeft,this.offsetTop,this.offsetWidth,this.offsetHeight);j.isElement(d= | |
| 58 | -e.parentNode);){var f=d.offsetLeft+d.clientLeft,h=d.offsetTop+d.clientTop,g=g.relativeFromTo(e,d).translate(-f,-h);d.scrollLeft=!1===a||g.left<=d.scrollLeft+d.clientWidth&&d.scrollLeft<=g.right-d.clientWidth+d.clientWidth?Math.min(g.left,Math.max(g.right-d.clientWidth,d.scrollLeft)):(g.right-d.clientWidth+g.left)/2;d.scrollTop=!1===a||g.top<=d.scrollTop+d.clientHeight&&d.scrollTop<=g.bottom-d.clientHeight+d.clientHeight?Math.min(g.top,Math.max(g.bottom-d.clientHeight,d.scrollTop)):(g.bottom-d.clientHeight+ | |
| 59 | -g.top)/2;g=g.translate(f-d.scrollLeft,h-d.scrollTop);e=d}};b.scrollIntoViewIfNeeded()}},setFirstNode:function(b,a){var c=b.data.key.children;if(a[c].length>0)a[c][0].isFirstNode=!0},setLastNode:function(b,a){var c=b.data.key.children,d=a[c].length;if(d>0)a[c][d-1].isLastNode=!0},removeNode:function(b,a){var c=h.getRoot(b),d=b.data.key.children,e=a.parentTId?a.getParentNode():c;a.isFirstNode=!1;a.isLastNode=!1;a.getPreNode=function(){return null};a.getNextNode=function(){return null};if(h.getNodeCache(b, | |
| 60 | -a.tId)){l(a,b).remove();h.removeNodeCache(b,a);h.removeSelectedNode(b,a);for(var g=0,k=e[d].length;g<k;g++)if(e[d][g].tId==a.tId){e[d].splice(g,1);break}i.setFirstNode(b,e);i.setLastNode(b,e);var j,g=e[d].length;if(!b.data.keep.parent&&g==0)e.isParent=!1,e.open=!1,g=l(e,f.id.UL,b),k=l(e,f.id.SWITCH,b),j=l(e,f.id.ICON,b),i.replaceSwitchClass(e,k,f.folder.DOCU),i.replaceIcoClass(e,j,f.folder.DOCU),g.css("display","none");else if(b.view.showLine&&g>0){var n=e[d][g-1],g=l(n,f.id.UL,b),k=l(n,f.id.SWITCH, | |
| 61 | -b);j=l(n,f.id.ICON,b);e==c?e[d].length==1?i.replaceSwitchClass(n,k,f.line.ROOT):(c=l(e[d][0],f.id.SWITCH,b),i.replaceSwitchClass(e[d][0],c,f.line.ROOTS),i.replaceSwitchClass(n,k,f.line.BOTTOM)):i.replaceSwitchClass(n,k,f.line.BOTTOM);g.removeClass(f.line.LINE)}}},replaceIcoClass:function(b,a,c){if(a&&!b.isAjaxing&&(b=a.attr("class"),b!=void 0)){b=b.split("_");switch(c){case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:b[b.length-1]=c}a.attr("class",b.join("_"))}},replaceSwitchClass:function(b, | |
| 62 | -a,c){if(a){var d=a.attr("class");if(d!=void 0){d=d.split("_");switch(c){case f.line.ROOT:case f.line.ROOTS:case f.line.CENTER:case f.line.BOTTOM:case f.line.NOLINE:d[0]=i.makeNodeLineClassEx(b)+c;break;case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:d[1]=c}a.attr("class",d.join("_"));c!==f.folder.DOCU?a.removeAttr("disabled"):a.attr("disabled","disabled")}}},selectNode:function(b,a,c){c||i.cancelPreSelectedNode(b,null,a);l(a,f.id.A,b).addClass(f.node.CURSELECTED);h.addSelectedNode(b,a); | |
| 63 | -b.treeObj.trigger(f.event.SELECTED,[b.treeId,a])},setNodeFontCss:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeFontCss(b,a);d&&c.css(d)},setNodeLineIcos:function(b,a){if(a){var c=l(a,f.id.SWITCH,b),d=l(a,f.id.UL,b),e=l(a,f.id.ICON,b),g=i.makeUlLineClass(b,a);g.length==0?d.removeClass(f.line.LINE):d.addClass(g);c.attr("class",i.makeNodeLineClass(b,a));a.isParent?c.removeAttr("disabled"):c.attr("disabled","disabled");e.removeAttr("style");e.attr("style",i.makeNodeIcoStyle(b,a));e.attr("class",i.makeNodeIcoClass(b, | |
| 64 | -a))}},setNodeName:function(b,a){var c=h.getNodeTitle(b,a),d=l(a,f.id.SPAN,b);d.empty();b.view.nameIsHTML?d.html(h.getNodeName(b,a)):d.text(h.getNodeName(b,a));j.apply(b.view.showTitle,[b.treeId,a],b.view.showTitle)&&l(a,f.id.A,b).attr("title",!c?"":c)},setNodeTarget:function(b,a){l(a,f.id.A,b).attr("target",i.makeNodeTarget(a))},setNodeUrl:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeUrl(b,a);d==null||d.length==0?c.removeAttr("href"):c.attr("href",d)},switchNode:function(b,a){a.open||!j.canAsync(b, | |
| 65 | -a)?i.expandCollapseNode(b,a,!a.open):b.async.enable?i.asyncNode(b,a)||i.expandCollapseNode(b,a,!a.open):a&&i.expandCollapseNode(b,a,!a.open)}};r.fn.zTree={consts:{className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch",NAME:"node_name"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"}, | |
| 66 | -id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_z:{tools:j,view:i,event:m,data:h},getZTreeObj:function(b){return(b=h.getZTreeTools(b))?b:null},destroy:function(b){if(b&&b.length>0)i.destroy(h.getSetting(b));else for(var a in s)i.destroy(s[a])},init:function(b,a,c){var d=j.clone(O);r.extend(!0,d,a);d.treeId= | |
| 67 | -b.attr("id");d.treeObj=b;d.treeObj.empty();s[d.treeId]=d;if(typeof document.body.style.maxHeight==="undefined")d.view.expandSpeed="";h.initRoot(d);b=h.getRoot(d);a=d.data.key.children;c=c?j.clone(j.isArray(c)?c:[c]):[];b[a]=d.data.simpleData.enable?h.transformTozTreeFormat(d,c):c;h.initCache(d);m.unbindTree(d);m.bindTree(d);m.unbindEvent(d);m.bindEvent(d);var e={setting:d,addNodes:function(a,b,c,e){function f(){i.addNodes(d,a,b,l,e==!0)}a||(a=null);if(a&&!a.isParent&&d.data.keep.leaf)return null; | |
| 68 | -var h=parseInt(b,10);isNaN(h)?(e=!!c,c=b,b=-1):b=h;if(!c)return null;var l=j.clone(j.isArray(c)?c:[c]);j.canAsync(d,a)?i.asyncNode(d,a,e,f):f();return l},cancelSelectedNode:function(a){i.cancelPreSelectedNode(d,a)},destroy:function(){i.destroy(d)},expandAll:function(a){a=!!a;i.expandCollapseSonNode(d,null,a,!0);return a},expandNode:function(a,b,c,e,f){function m(){var b=l(a,d).get(0);b&&e!==!1&&i.scrollIntoView(b)}if(!a||!a.isParent)return null;b!==!0&&b!==!1&&(b=!a.open);if((f=!!f)&&b&&j.apply(d.callback.beforeExpand, | |
| 69 | -[d.treeId,a],!0)==!1)return null;else if(f&&!b&&j.apply(d.callback.beforeCollapse,[d.treeId,a],!0)==!1)return null;b&&a.parentTId&&i.expandCollapseParentNode(d,a.getParentNode(),b,!1);if(b===a.open&&!c)return null;h.getRoot(d).expandTriggerFlag=f;!j.canAsync(d,a)&&c?i.expandCollapseSonNode(d,a,b,!0,m):(a.open=!b,i.switchNode(this.setting,a),m());return b},getNodes:function(){return h.getNodes(d)},getNodeByParam:function(a,b,c){return!a?null:h.getNodeByParam(d,c?c[d.data.key.children]:h.getNodes(d), | |
| 70 | -a,b)},getNodeByTId:function(a){return h.getNodeCache(d,a)},getNodesByParam:function(a,b,c){return!a?null:h.getNodesByParam(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByParamFuzzy:function(a,b,c){return!a?null:h.getNodesByParamFuzzy(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByFilter:function(a,b,c,e){b=!!b;return!a||typeof a!="function"?b?null:[]:h.getNodesByFilter(d,c?c[d.data.key.children]:h.getNodes(d),a,b,e)},getNodeIndex:function(a){if(!a)return null;for(var b=d.data.key.children, | |
| 71 | -c=a.parentTId?a.getParentNode():h.getRoot(d),e=0,f=c[b].length;e<f;e++)if(c[b][e]==a)return e;return-1},getSelectedNodes:function(){for(var a=[],b=h.getRoot(d).curSelectedList,c=0,e=b.length;c<e;c++)a.push(b[c]);return a},isSelectedNode:function(a){return h.isSelectedNode(d,a)},reAsyncChildNodesPromise:function(a,b,c){return new Promise(function(d,f){try{e.reAsyncChildNodes(a,b,c,function(){d(a)})}catch(h){f(h)}})},reAsyncChildNodes:function(a,b,c,e){if(this.setting.async.enable){var j=!a;j&&(a=h.getRoot(d)); | |
| 72 | -if(b=="refresh"){for(var b=this.setting.data.key.children,m=0,r=a[b]?a[b].length:0;m<r;m++)h.removeNodeCache(d,a[b][m]);h.removeSelectedNode(d);a[b]=[];j?this.setting.treeObj.empty():l(a,f.id.UL,d).empty()}i.asyncNode(this.setting,j?null:a,!!c,e)}},refresh:function(){this.setting.treeObj.empty();var a=h.getRoot(d),b=a[d.data.key.children];h.initRoot(d);a[d.data.key.children]=b;h.initCache(d);i.createNodes(d,0,a[d.data.key.children],null,-1)},removeChildNodes:function(a){if(!a)return null;var b=a[d.data.key.children]; | |
| 73 | -i.removeChildNodes(d,a);return b?b:null},removeNode:function(a,b){a&&(b=!!b,b&&j.apply(d.callback.beforeRemove,[d.treeId,a],!0)==!1||(i.removeNode(d,a),b&&this.setting.treeObj.trigger(f.event.REMOVE,[d.treeId,a])))},selectNode:function(a,b,c){function e(){if(!c){var b=l(a,d).get(0);i.scrollIntoView(b)}}if(a&&j.uCanDo(d)){b=d.view.selectedMulti&&b;if(a.parentTId)i.expandCollapseParentNode(d,a.getParentNode(),!0,!1,e);else if(!c)try{l(a,d).focus().blur()}catch(f){}i.selectNode(d,a,b)}},transformTozTreeNodes:function(a){return h.transformTozTreeFormat(d, | |
| 74 | -a)},transformToArray:function(a){return h.transformToArrayFormat(d,a)},updateNode:function(a){a&&l(a,d).get(0)&&j.uCanDo(d)&&(i.setNodeName(d,a),i.setNodeTarget(d,a),i.setNodeUrl(d,a),i.setNodeLineIcos(d,a),i.setNodeFontCss(d,a))}};b.treeTools=e;h.setZTreeTools(d,e);b[a]&&b[a].length>0?i.createNodes(d,0,b[a],null,-1):d.async.enable&&d.async.url&&d.async.url!==""&&i.asyncNode(d);return e}};var P=r.fn.zTree,l=j.$,f=P.consts})(jQuery); | |
| 1 | +/* | |
| 2 | + * JQuery zTree core v3.5.29 | |
| 3 | + * http://treejs.cn/ | |
| 4 | + * | |
| 5 | + * Copyright (c) 2010 Hunter.z | |
| 6 | + * | |
| 7 | + * Licensed same as jquery - MIT License | |
| 8 | + * http://www.opensource.org/licenses/mit-license.php | |
| 9 | + * | |
| 10 | + * email: hunter.z@263.net | |
| 11 | + * Date: 2017-06-19 | |
| 12 | + */ | |
| 13 | +(function(r){var I,J,K,L,M,N,v,s={},w={},x={},O={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url",icon:"icon"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text", | |
| 14 | +url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},y=[function(b){var a=b.treeObj,c=f.event;a.bind(c.NODECREATED,function(a,c,g){j.apply(b.callback.onNodeCreated, | |
| 15 | +[a,c,g])});a.bind(c.CLICK,function(a,c,g,k,h){j.apply(b.callback.onClick,[c,g,k,h])});a.bind(c.EXPAND,function(a,c,g){j.apply(b.callback.onExpand,[a,c,g])});a.bind(c.COLLAPSE,function(a,c,g){j.apply(b.callback.onCollapse,[a,c,g])});a.bind(c.ASYNC_SUCCESS,function(a,c,g,k){j.apply(b.callback.onAsyncSuccess,[a,c,g,k])});a.bind(c.ASYNC_ERROR,function(a,c,g,k,h,f){j.apply(b.callback.onAsyncError,[a,c,g,k,h,f])});a.bind(c.REMOVE,function(a,c,g){j.apply(b.callback.onRemove,[a,c,g])});a.bind(c.SELECTED, | |
| 16 | +function(a,c,g){j.apply(b.callback.onSelected,[c,g])});a.bind(c.UNSELECTED,function(a,c,g){j.apply(b.callback.onUnSelected,[c,g])})}],z=[function(b){var a=f.event;b.treeObj.unbind(a.NODECREATED).unbind(a.CLICK).unbind(a.EXPAND).unbind(a.COLLAPSE).unbind(a.ASYNC_SUCCESS).unbind(a.ASYNC_ERROR).unbind(a.REMOVE).unbind(a.SELECTED).unbind(a.UNSELECTED)}],A=[function(b){var a=h.getCache(b);a||(a={},h.setCache(b,a));a.nodes=[];a.doms=[]}],B=[function(b,a,c,d,e,g){if(c){var k=h.getRoot(b),f=b.data.key.children; | |
| 17 | +c.level=a;c.tId=b.treeId+"_"+ ++k.zId;c.parentTId=d?d.tId:null;c.open=typeof c.open=="string"?j.eqs(c.open,"true"):!!c.open;c[f]&&c[f].length>0?(c.isParent=!0,c.zAsync=!0):(c.isParent=typeof c.isParent=="string"?j.eqs(c.isParent,"true"):!!c.isParent,c.open=c.isParent&&!b.async.enable?c.open:!1,c.zAsync=!c.isParent);c.isFirstNode=e;c.isLastNode=g;c.getParentNode=function(){return h.getNodeCache(b,c.parentTId)};c.getPreNode=function(){return h.getPreNode(b,c)};c.getNextNode=function(){return h.getNextNode(b, | |
| 18 | +c)};c.getIndex=function(){return h.getNodeIndex(b,c)};c.getPath=function(){return h.getNodePath(b,c)};c.isAjaxing=!1;h.fixPIdKeyValue(b,c)}}],u=[function(b){var a=b.target,c=h.getSetting(b.data.treeId),d="",e=null,g="",k="",p=null,i=null,q=null;if(j.eqs(b.type,"mousedown"))k="mousedown";else if(j.eqs(b.type,"mouseup"))k="mouseup";else if(j.eqs(b.type,"contextmenu"))k="contextmenu";else if(j.eqs(b.type,"click"))if(j.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+f.id.SWITCH)!==null)d=j.getNodeMainDom(a).id, | |
| 19 | +g="switchNode";else{if(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}]))d=j.getNodeMainDom(q).id,g="clickNode"}else if(j.eqs(b.type,"dblclick")&&(k="dblclick",q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id,g="switchNode";if(k.length>0&&d.length==0&&(q=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+f.id.A}])))d=j.getNodeMainDom(q).id;if(d.length>0)switch(e=h.getNodeCache(c,d),g){case "switchNode":e.isParent?j.eqs(b.type,"click")||j.eqs(b.type,"dblclick")&& | |
| 20 | +j.apply(c.view.dblClickExpand,[c.treeId,e],c.view.dblClickExpand)?p=I:g="":g="";break;case "clickNode":p=J}switch(k){case "mousedown":i=K;break;case "mouseup":i=L;break;case "dblclick":i=M;break;case "contextmenu":i=N}return{stop:!1,node:e,nodeEventType:g,nodeEventCallback:p,treeEventType:k,treeEventCallback:i}}],C=[function(b){var a=h.getRoot(b);a||(a={},h.setRoot(b,a));a[b.data.key.children]=[];a.expandTriggerFlag=!1;a.curSelectedList=[];a.noSelection=!0;a.createdNodes=[];a.zId=0;a._ver=(new Date).getTime()}], | |
| 21 | +D=[],E=[],F=[],G=[],H=[],h={addNodeCache:function(b,a){h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=a},getNodeCacheId:function(b){return b.substring(b.lastIndexOf("_")+1)},addAfterA:function(b){E.push(b)},addBeforeA:function(b){D.push(b)},addInnerAfterA:function(b){G.push(b)},addInnerBeforeA:function(b){F.push(b)},addInitBind:function(b){y.push(b)},addInitUnBind:function(b){z.push(b)},addInitCache:function(b){A.push(b)},addInitNode:function(b){B.push(b)},addInitProxy:function(b,a){a?u.splice(0,0, | |
| 22 | +b):u.push(b)},addInitRoot:function(b){C.push(b)},addNodesData:function(b,a,c,d){var e=b.data.key.children;a[e]?c>=a[e].length&&(c=-1):(a[e]=[],c=-1);if(a[e].length>0&&c===0)a[e][0].isFirstNode=!1,i.setNodeLineIcos(b,a[e][0]);else if(a[e].length>0&&c<0)a[e][a[e].length-1].isLastNode=!1,i.setNodeLineIcos(b,a[e][a[e].length-1]);a.isParent=!0;c<0?a[e]=a[e].concat(d):(b=[c,0].concat(d),a[e].splice.apply(a[e],b))},addSelectedNode:function(b,a){var c=h.getRoot(b);h.isSelectedNode(b,a)||c.curSelectedList.push(a)}, | |
| 23 | +addCreatedNode:function(b,a){(b.callback.onNodeCreated||b.view.addDiyDom)&&h.getRoot(b).createdNodes.push(a)},addZTreeTools:function(b){H.push(b)},exSetting:function(b){r.extend(!0,O,b)},fixPIdKeyValue:function(b,a){b.data.simpleData.enable&&(a[b.data.simpleData.pIdKey]=a.parentTId?a.getParentNode()[b.data.simpleData.idKey]:b.data.simpleData.rootPId)},getAfterA:function(b,a,c){for(var d=0,e=E.length;d<e;d++)E[d].apply(this,arguments)},getBeforeA:function(b,a,c){for(var d=0,e=D.length;d<e;d++)D[d].apply(this, | |
| 24 | +arguments)},getInnerAfterA:function(b,a,c){for(var d=0,e=G.length;d<e;d++)G[d].apply(this,arguments)},getInnerBeforeA:function(b,a,c){for(var d=0,e=F.length;d<e;d++)F[d].apply(this,arguments)},getCache:function(b){return x[b.treeId]},getNodeIndex:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e;return-1},getNextNode:function(b,a){if(!a)return null;for(var c=b.data.key.children,d=a.parentTId? | |
| 25 | +a.getParentNode():h.getRoot(b),e=0,g=d[c].length-1;e<=g;e++)if(d[c][e]===a)return e==g?null:d[c][e+1];return null},getNodeByParam:function(b,a,c,d){if(!a||!c)return null;for(var e=b.data.key.children,g=0,k=a.length;g<k;g++){if(a[g][c]==d)return a[g];var f=h.getNodeByParam(b,a[g][e],c,d);if(f)return f}return null},getNodeCache:function(b,a){if(!a)return null;var c=x[b.treeId].nodes[h.getNodeCacheId(a)];return c?c:null},getNodeName:function(b,a){return""+a[b.data.key.name]},getNodePath:function(b,a){if(!a)return null; | |
| 26 | +var c;(c=a.parentTId?a.getParentNode().getPath():[])&&c.push(a);return c},getNodeTitle:function(b,a){return""+a[b.data.key.title===""?b.data.key.name:b.data.key.title]},getNodes:function(b){return h.getRoot(b)[b.data.key.children]},getNodesByParam:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children,g=[],k=0,f=a.length;k<f;k++)a[k][c]==d&&g.push(a[k]),g=g.concat(h.getNodesByParam(b,a[k][e],c,d));return g},getNodesByParamFuzzy:function(b,a,c,d){if(!a||!c)return[];for(var e=b.data.key.children, | |
| 27 | +g=[],d=d.toLowerCase(),k=0,f=a.length;k<f;k++)typeof a[k][c]=="string"&&a[k][c].toLowerCase().indexOf(d)>-1&&g.push(a[k]),g=g.concat(h.getNodesByParamFuzzy(b,a[k][e],c,d));return g},getNodesByFilter:function(b,a,c,d,e){if(!a)return d?null:[];for(var g=b.data.key.children,k=d?null:[],f=0,i=a.length;f<i;f++){if(j.apply(c,[a[f],e],!1)){if(d)return a[f];k.push(a[f])}var q=h.getNodesByFilter(b,a[f][g],c,d,e);if(d&&q)return q;k=d?q:k.concat(q)}return k},getPreNode:function(b,a){if(!a)return null;for(var c= | |
| 28 | +b.data.key.children,d=a.parentTId?a.getParentNode():h.getRoot(b),e=0,g=d[c].length;e<g;e++)if(d[c][e]===a)return e==0?null:d[c][e-1];return null},getRoot:function(b){return b?w[b.treeId]:null},getRoots:function(){return w},getSetting:function(b){return s[b]},getSettings:function(){return s},getZTreeTools:function(b){return(b=this.getRoot(this.getSetting(b)))?b.treeTools:null},initCache:function(b){for(var a=0,c=A.length;a<c;a++)A[a].apply(this,arguments)},initNode:function(b,a,c,d,e,g){for(var k= | |
| 29 | +0,f=B.length;k<f;k++)B[k].apply(this,arguments)},initRoot:function(b){for(var a=0,c=C.length;a<c;a++)C[a].apply(this,arguments)},isSelectedNode:function(b,a){for(var c=h.getRoot(b),d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d])return!0;return!1},removeNodeCache:function(b,a){var c=b.data.key.children;if(a[c])for(var d=0,e=a[c].length;d<e;d++)h.removeNodeCache(b,a[c][d]);h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=null},removeSelectedNode:function(b,a){for(var c=h.getRoot(b), | |
| 30 | +d=0,e=c.curSelectedList.length;d<e;d++)if(a===c.curSelectedList[d]||!h.getNodeCache(b,c.curSelectedList[d].tId))c.curSelectedList.splice(d,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,a]),d--,e--},setCache:function(b,a){x[b.treeId]=a},setRoot:function(b,a){w[b.treeId]=a},setZTreeTools:function(b,a){for(var c=0,d=H.length;c<d;c++)H[c].apply(this,arguments)},transformToArrayFormat:function(b,a){if(!a)return[];var c=b.data.key.children,d=[];if(j.isArray(a))for(var e=0,g=a.length;e<g;e++)d.push(a[e]), | |
| 31 | +a[e][c]&&(d=d.concat(h.transformToArrayFormat(b,a[e][c])));else d.push(a),a[c]&&(d=d.concat(h.transformToArrayFormat(b,a[c])));return d},transformTozTreeFormat:function(b,a){var c,d,e=b.data.simpleData.idKey,g=b.data.simpleData.pIdKey,k=b.data.key.children;if(!e||e==""||!a)return[];if(j.isArray(a)){var f=[],h={};for(c=0,d=a.length;c<d;c++)h[a[c][e]]=a[c];for(c=0,d=a.length;c<d;c++)h[a[c][g]]&&a[c][e]!=a[c][g]?(h[a[c][g]][k]||(h[a[c][g]][k]=[]),h[a[c][g]][k].push(a[c])):f.push(a[c]);return f}else return[a]}}, | |
| 32 | +m={bindEvent:function(b){for(var a=0,c=y.length;a<c;a++)y[a].apply(this,arguments)},unbindEvent:function(b){for(var a=0,c=z.length;a<c;a++)z[a].apply(this,arguments)},bindTree:function(b){var a={treeId:b.treeId},c=b.treeObj;b.view.txtSelectedEnable||c.bind("selectstart",v).css({"-moz-user-select":"-moz-none"});c.bind("click",a,m.proxy);c.bind("dblclick",a,m.proxy);c.bind("mouseover",a,m.proxy);c.bind("mouseout",a,m.proxy);c.bind("mousedown",a,m.proxy);c.bind("mouseup",a,m.proxy);c.bind("contextmenu", | |
| 33 | +a,m.proxy)},unbindTree:function(b){b.treeObj.unbind("selectstart",v).unbind("click",m.proxy).unbind("dblclick",m.proxy).unbind("mouseover",m.proxy).unbind("mouseout",m.proxy).unbind("mousedown",m.proxy).unbind("mouseup",m.proxy).unbind("contextmenu",m.proxy)},doProxy:function(b){for(var a=[],c=0,d=u.length;c<d;c++){var e=u[c].apply(this,arguments);a.push(e);if(e.stop)break}return a},proxy:function(b){var a=h.getSetting(b.data.treeId);if(!j.uCanDo(a,b))return!0;for(var a=m.doProxy(b),c=!0,d=0,e=a.length;d< | |
| 34 | +e;d++){var g=a[d];g.nodeEventCallback&&(c=g.nodeEventCallback.apply(g,[b,g.node])&&c);g.treeEventCallback&&(c=g.treeEventCallback.apply(g,[b,g.node])&&c)}return c}};I=function(b,a){var c=h.getSetting(b.data.treeId);if(a.open){if(j.apply(c.callback.beforeCollapse,[c.treeId,a],!0)==!1)return!0}else if(j.apply(c.callback.beforeExpand,[c.treeId,a],!0)==!1)return!0;h.getRoot(c).expandTriggerFlag=!0;i.switchNode(c,a);return!0};J=function(b,a){var c=h.getSetting(b.data.treeId),d=c.view.autoCancelSelected&& | |
| 35 | +(b.ctrlKey||b.metaKey)&&h.isSelectedNode(c,a)?0:c.view.autoCancelSelected&&(b.ctrlKey||b.metaKey)&&c.view.selectedMulti?2:1;if(j.apply(c.callback.beforeClick,[c.treeId,a,d],!0)==!1)return!0;d===0?i.cancelPreSelectedNode(c,a):i.selectNode(c,a,d===2);c.treeObj.trigger(f.event.CLICK,[b,c.treeId,a,d]);return!0};K=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeMouseDown,[c.treeId,a],!0)&&j.apply(c.callback.onMouseDown,[b,c.treeId,a]);return!0};L=function(b,a){var c=h.getSetting(b.data.treeId); | |
| 36 | +j.apply(c.callback.beforeMouseUp,[c.treeId,a],!0)&&j.apply(c.callback.onMouseUp,[b,c.treeId,a]);return!0};M=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeDblClick,[c.treeId,a],!0)&&j.apply(c.callback.onDblClick,[b,c.treeId,a]);return!0};N=function(b,a){var c=h.getSetting(b.data.treeId);j.apply(c.callback.beforeRightClick,[c.treeId,a],!0)&&j.apply(c.callback.onRightClick,[b,c.treeId,a]);return typeof c.callback.onRightClick!="function"};v=function(b){b=b.originalEvent.srcElement.nodeName.toLowerCase(); | |
| 37 | +return b==="input"||b==="textarea"};var j={apply:function(b,a,c){return typeof b=="function"?b.apply(P,a?a:[]):c},canAsync:function(b,a){var c=b.data.key.children;return b.async.enable&&a&&a.isParent&&!(a.zAsync||a[c]&&a[c].length>0)},clone:function(b){if(b===null)return null;var a=j.isArray(b)?[]:{},c;for(c in b)a[c]=b[c]instanceof Date?new Date(b[c].getTime()):typeof b[c]==="object"?j.clone(b[c]):b[c];return a},eqs:function(b,a){return b.toLowerCase()===a.toLowerCase()},isArray:function(b){return Object.prototype.toString.apply(b)=== | |
| 38 | +"[object Array]"},isElement:function(b){return typeof HTMLElement==="object"?b instanceof HTMLElement:b&&typeof b==="object"&&b!==null&&b.nodeType===1&&typeof b.nodeName==="string"},$:function(b,a,c){a&&typeof a!="string"&&(c=a,a="");return typeof b=="string"?r(b,c?c.treeObj.get(0).ownerDocument:null):r("#"+b.tId+a,c?c.treeObj:null)},getMDom:function(b,a,c){if(!a)return null;for(;a&&a.id!==b.treeId;){for(var d=0,e=c.length;a.tagName&&d<e;d++)if(j.eqs(a.tagName,c[d].tagName)&&a.getAttribute(c[d].attrName)!== | |
| 39 | +null)return a;a=a.parentNode}return null},getNodeMainDom:function(b){return r(b).parent("li").get(0)||r(b).parentsUntil("li").parent().get(0)},isChildOrSelf:function(b,a){return r(b).closest("#"+a).length>0},uCanDo:function(){return!0}},i={addNodes:function(b,a,c,d,e){if(!b.data.keep.leaf||!a||a.isParent)if(j.isArray(d)||(d=[d]),b.data.simpleData.enable&&(d=h.transformTozTreeFormat(b,d)),a){var g=l(a,f.id.SWITCH,b),k=l(a,f.id.ICON,b),p=l(a,f.id.UL,b);if(!a.open)i.replaceSwitchClass(a,g,f.folder.CLOSE), | |
| 40 | +i.replaceIcoClass(a,k,f.folder.CLOSE),a.open=!1,p.css({display:"none"});h.addNodesData(b,a,c,d);i.createNodes(b,a.level+1,d,a,c);e||i.expandCollapseParentNode(b,a,!0)}else h.addNodesData(b,h.getRoot(b),c,d),i.createNodes(b,0,d,null,c)},appendNodes:function(b,a,c,d,e,g,k){if(!c)return[];var f=[],j=b.data.key.children,q=(d?d:h.getRoot(b))[j],l,Q;if(!q||e>=q.length-c.length)e=-1;for(var t=0,m=c.length;t<m;t++){var o=c[t];g&&(l=(e===0||q.length==c.length)&&t==0,Q=e<0&&t==c.length-1,h.initNode(b,a,o,d, | |
| 41 | +l,Q,k),h.addNodeCache(b,o));l=[];o[j]&&o[j].length>0&&(l=i.appendNodes(b,a+1,o[j],o,-1,g,k&&o.open));k&&(i.makeDOMNodeMainBefore(f,b,o),i.makeDOMNodeLine(f,b,o),h.getBeforeA(b,o,f),i.makeDOMNodeNameBefore(f,b,o),h.getInnerBeforeA(b,o,f),i.makeDOMNodeIcon(f,b,o),h.getInnerAfterA(b,o,f),i.makeDOMNodeNameAfter(f,b,o),h.getAfterA(b,o,f),o.isParent&&o.open&&i.makeUlHtml(b,o,f,l.join("")),i.makeDOMNodeMainAfter(f,b,o),h.addCreatedNode(b,o))}return f},appendParentULDom:function(b,a){var c=[],d=l(a,b);!d.get(0)&& | |
| 42 | +a.parentTId&&(i.appendParentULDom(b,a.getParentNode()),d=l(a,b));var e=l(a,f.id.UL,b);e.get(0)&&e.remove();e=i.appendNodes(b,a.level+1,a[b.data.key.children],a,-1,!1,!0);i.makeUlHtml(b,a,c,e.join(""));d.append(c.join(""))},asyncNode:function(b,a,c,d){var e,g;if(a&&!a.isParent)return j.apply(d),!1;else if(a&&a.isAjaxing)return!1;else if(j.apply(b.callback.beforeAsync,[b.treeId,a],!0)==!1)return j.apply(d),!1;if(a)a.isAjaxing=!0,l(a,f.id.ICON,b).attr({style:"","class":f.className.BUTTON+" "+f.className.ICO_LOADING}); | |
| 43 | +var k={};for(e=0,g=b.async.autoParam.length;a&&e<g;e++){var p=b.async.autoParam[e].split("="),n=p;p.length>1&&(n=p[1],p=p[0]);k[n]=a[p]}if(j.isArray(b.async.otherParam))for(e=0,g=b.async.otherParam.length;e<g;e+=2)k[b.async.otherParam[e]]=b.async.otherParam[e+1];else for(var q in b.async.otherParam)k[q]=b.async.otherParam[q];var m=h.getRoot(b)._ver;r.ajax({contentType:b.async.contentType,cache:!1,type:b.async.type,url:j.apply(b.async.url,[b.treeId,a],b.async.url),data:b.async.contentType.indexOf("application/json")> | |
| 44 | +-1?JSON.stringify(k):k,dataType:b.async.dataType,success:function(g){if(m==h.getRoot(b)._ver){var e=[];try{e=!g||g.length==0?[]:typeof g=="string"?eval("("+g+")"):g}catch(k){e=g}if(a)a.isAjaxing=null,a.zAsync=!0;i.setNodeLineIcos(b,a);e&&e!==""?(e=j.apply(b.async.dataFilter,[b.treeId,a,e],e),i.addNodes(b,a,-1,e?j.clone(e):[],!!c)):i.addNodes(b,a,-1,[],!!c);b.treeObj.trigger(f.event.ASYNC_SUCCESS,[b.treeId,a,g]);j.apply(d)}},error:function(c,d,g){if(m==h.getRoot(b)._ver){if(a)a.isAjaxing=null;i.setNodeLineIcos(b, | |
| 45 | +a);b.treeObj.trigger(f.event.ASYNC_ERROR,[b.treeId,a,c,d,g])}}});return!0},cancelPreSelectedNode:function(b,a,c){var d=h.getRoot(b).curSelectedList,e,g;for(e=d.length-1;e>=0;e--)if(g=d[e],a===g||!a&&(!c||c!==g))if(l(g,f.id.A,b).removeClass(f.node.CURSELECTED),a){h.removeSelectedNode(b,a);break}else d.splice(e,1),b.treeObj.trigger(f.event.UNSELECTED,[b.treeId,g])},createNodeCallback:function(b){if(b.callback.onNodeCreated||b.view.addDiyDom)for(var a=h.getRoot(b);a.createdNodes.length>0;){var c=a.createdNodes.shift(); | |
| 46 | +j.apply(b.view.addDiyDom,[b.treeId,c]);b.callback.onNodeCreated&&b.treeObj.trigger(f.event.NODECREATED,[b.treeId,c])}},createNodes:function(b,a,c,d,e){if(c&&c.length!=0){var g=h.getRoot(b),k=b.data.key.children,k=!d||d.open||!!l(d[k][0],b).get(0);g.createdNodes=[];var a=i.appendNodes(b,a,c,d,e,!0,k),j,n;d?(d=l(d,f.id.UL,b),d.get(0)&&(j=d)):j=b.treeObj;j&&(e>=0&&(n=j.children()[e]),e>=0&&n?r(n).before(a.join("")):j.append(a.join("")));i.createNodeCallback(b)}},destroy:function(b){b&&(h.initCache(b), | |
| 47 | +h.initRoot(b),m.unbindTree(b),m.unbindEvent(b),b.treeObj.empty(),delete s[b.treeId])},expandCollapseNode:function(b,a,c,d,e){var g=h.getRoot(b),k=b.data.key.children,p;if(a){if(g.expandTriggerFlag)p=e,e=function(){p&&p();a.open?b.treeObj.trigger(f.event.EXPAND,[b.treeId,a]):b.treeObj.trigger(f.event.COLLAPSE,[b.treeId,a])},g.expandTriggerFlag=!1;if(!a.open&&a.isParent&&(!l(a,f.id.UL,b).get(0)||a[k]&&a[k].length>0&&!l(a[k][0],b).get(0)))i.appendParentULDom(b,a),i.createNodeCallback(b);if(a.open==c)j.apply(e, | |
| 48 | +[]);else{var c=l(a,f.id.UL,b),g=l(a,f.id.SWITCH,b),n=l(a,f.id.ICON,b);a.isParent?(a.open=!a.open,a.iconOpen&&a.iconClose&&n.attr("style",i.makeNodeIcoStyle(b,a)),a.open?(i.replaceSwitchClass(a,g,f.folder.OPEN),i.replaceIcoClass(a,n,f.folder.OPEN),d==!1||b.view.expandSpeed==""?(c.show(),j.apply(e,[])):a[k]&&a[k].length>0?c.slideDown(b.view.expandSpeed,e):(c.show(),j.apply(e,[]))):(i.replaceSwitchClass(a,g,f.folder.CLOSE),i.replaceIcoClass(a,n,f.folder.CLOSE),d==!1||b.view.expandSpeed==""||!(a[k]&& | |
| 49 | +a[k].length>0)?(c.hide(),j.apply(e,[])):c.slideUp(b.view.expandSpeed,e))):j.apply(e,[])}}else j.apply(e,[])},expandCollapseParentNode:function(b,a,c,d,e){a&&(a.parentTId?(i.expandCollapseNode(b,a,c,d),a.parentTId&&i.expandCollapseParentNode(b,a.getParentNode(),c,d,e)):i.expandCollapseNode(b,a,c,d,e))},expandCollapseSonNode:function(b,a,c,d,e){var g=h.getRoot(b),f=b.data.key.children,g=a?a[f]:g[f],f=a?!1:d,j=h.getRoot(b).expandTriggerFlag;h.getRoot(b).expandTriggerFlag=!1;if(g)for(var n=0,l=g.length;n< | |
| 50 | +l;n++)g[n]&&i.expandCollapseSonNode(b,g[n],c,f);h.getRoot(b).expandTriggerFlag=j;i.expandCollapseNode(b,a,c,d,e)},isSelectedNode:function(b,a){if(!a)return!1;var c=h.getRoot(b).curSelectedList,d;for(d=c.length-1;d>=0;d--)if(a===c[d])return!0;return!1},makeDOMNodeIcon:function(b,a,c){var d=h.getNodeName(a,c),d=a.view.nameIsHTML?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");b.push("<span id='",c.tId,f.id.ICON,"' title='' treeNode",f.id.ICON," class='",i.makeNodeIcoClass(a,c),"' style='", | |
| 51 | +i.makeNodeIcoStyle(a,c),"'></span><span id='",c.tId,f.id.SPAN,"' class='",f.className.NAME,"'>",d,"</span>")},makeDOMNodeLine:function(b,a,c){b.push("<span id='",c.tId,f.id.SWITCH,"' title='' class='",i.makeNodeLineClass(a,c),"' treeNode",f.id.SWITCH,"></span>")},makeDOMNodeMainAfter:function(b){b.push("</li>")},makeDOMNodeMainBefore:function(b,a,c){b.push("<li id='",c.tId,"' class='",f.className.LEVEL,c.level,"' tabindex='0' hidefocus='true' treenode>")},makeDOMNodeNameAfter:function(b){b.push("</a>")}, | |
| 52 | +makeDOMNodeNameBefore:function(b,a,c){var d=h.getNodeTitle(a,c),e=i.makeNodeUrl(a,c),g=i.makeNodeFontCss(a,c),k=[],p;for(p in g)k.push(p,":",g[p],";");b.push("<a id='",c.tId,f.id.A,"' class='",f.className.LEVEL,c.level,"' treeNode",f.id.A,' onclick="',c.click||"",'" ',e!=null&&e.length>0?"href='"+e+"'":""," target='",i.makeNodeTarget(c),"' style='",k.join(""),"'");j.apply(a.view.showTitle,[a.treeId,c],a.view.showTitle)&&d&&b.push("title='",d.replace(/'/g,"'").replace(/</g,"<").replace(/>/g, | |
| 53 | +">"),"'");b.push(">")},makeNodeFontCss:function(b,a){var c=j.apply(b.view.fontCss,[b.treeId,a],b.view.fontCss);return c&&typeof c!="function"?c:{}},makeNodeIcoClass:function(b,a){var c=["ico"];a.isAjaxing||(c[0]=(a.iconSkin?a.iconSkin+"_":"")+c[0],a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU));return f.className.BUTTON+" "+c.join("_")},makeNodeIcoStyle:function(b,a){var c=[];if(!a.isAjaxing){var d=a.isParent&&a.iconOpen&&a.iconClose?a.open?a.iconOpen:a.iconClose: | |
| 54 | +a[b.data.key.icon];d&&c.push("background:url(",d,") 0 0 no-repeat;");(b.view.showIcon==!1||!j.apply(b.view.showIcon,[b.treeId,a],!0))&&c.push("width:0px;height:0px;")}return c.join("")},makeNodeLineClass:function(b,a){var c=[];b.view.showLine?a.level==0&&a.isFirstNode&&a.isLastNode?c.push(f.line.ROOT):a.level==0&&a.isFirstNode?c.push(f.line.ROOTS):a.isLastNode?c.push(f.line.BOTTOM):c.push(f.line.CENTER):c.push(f.line.NOLINE);a.isParent?c.push(a.open?f.folder.OPEN:f.folder.CLOSE):c.push(f.folder.DOCU); | |
| 55 | +return i.makeNodeLineClassEx(a)+c.join("_")},makeNodeLineClassEx:function(b){return f.className.BUTTON+" "+f.className.LEVEL+b.level+" "+f.className.SWITCH+" "},makeNodeTarget:function(b){return b.target||"_blank"},makeNodeUrl:function(b,a){var c=b.data.key.url;return a[c]?a[c]:null},makeUlHtml:function(b,a,c,d){c.push("<ul id='",a.tId,f.id.UL,"' class='",f.className.LEVEL,a.level," ",i.makeUlLineClass(b,a),"' style='display:",a.open?"block":"none","'>");c.push(d);c.push("</ul>")},makeUlLineClass:function(b, | |
| 56 | +a){return b.view.showLine&&!a.isLastNode?f.line.LINE:""},removeChildNodes:function(b,a){if(a){var c=b.data.key.children,d=a[c];if(d){for(var e=0,g=d.length;e<g;e++)h.removeNodeCache(b,d[e]);h.removeSelectedNode(b);delete a[c];b.data.keep.parent?l(a,f.id.UL,b).empty():(a.isParent=!1,a.open=!1,c=l(a,f.id.SWITCH,b),d=l(a,f.id.ICON,b),i.replaceSwitchClass(a,c,f.folder.DOCU),i.replaceIcoClass(a,d,f.folder.DOCU),l(a,f.id.UL,b).remove())}}},scrollIntoView:function(b){if(b){if(!Element.prototype.scrollIntoViewIfNeeded)Element.prototype.scrollIntoViewIfNeeded= | |
| 57 | +function(a){function b(a,d,e,f){return{left:a,top:d,width:e,height:f,right:a+e,bottom:d+f,translate:function(g,k){return b(g+a,k+d,e,f)},relativeFromTo:function(k,h){var i=a,j=d,k=k.offsetParent,h=h.offsetParent;if(k===h)return g;for(;k;k=k.offsetParent)i+=k.offsetLeft+k.clientLeft,j+=k.offsetTop+k.clientTop;for(;h;h=h.offsetParent)i-=h.offsetLeft+h.clientLeft,j-=h.offsetTop+h.clientTop;return b(i,j,e,f)}}}for(var d,e=this,g=b(this.offsetLeft,this.offsetTop,this.offsetWidth,this.offsetHeight);j.isElement(d= | |
| 58 | +e.parentNode);){var f=d.offsetLeft+d.clientLeft,h=d.offsetTop+d.clientTop,g=g.relativeFromTo(e,d).translate(-f,-h);d.scrollLeft=!1===a||g.left<=d.scrollLeft+d.clientWidth&&d.scrollLeft<=g.right-d.clientWidth+d.clientWidth?Math.min(g.left,Math.max(g.right-d.clientWidth,d.scrollLeft)):(g.right-d.clientWidth+g.left)/2;d.scrollTop=!1===a||g.top<=d.scrollTop+d.clientHeight&&d.scrollTop<=g.bottom-d.clientHeight+d.clientHeight?Math.min(g.top,Math.max(g.bottom-d.clientHeight,d.scrollTop)):(g.bottom-d.clientHeight+ | |
| 59 | +g.top)/2;g=g.translate(f-d.scrollLeft,h-d.scrollTop);e=d}};b.scrollIntoViewIfNeeded()}},setFirstNode:function(b,a){var c=b.data.key.children;if(a[c].length>0)a[c][0].isFirstNode=!0},setLastNode:function(b,a){var c=b.data.key.children,d=a[c].length;if(d>0)a[c][d-1].isLastNode=!0},removeNode:function(b,a){var c=h.getRoot(b),d=b.data.key.children,e=a.parentTId?a.getParentNode():c;a.isFirstNode=!1;a.isLastNode=!1;a.getPreNode=function(){return null};a.getNextNode=function(){return null};if(h.getNodeCache(b, | |
| 60 | +a.tId)){l(a,b).remove();h.removeNodeCache(b,a);h.removeSelectedNode(b,a);for(var g=0,k=e[d].length;g<k;g++)if(e[d][g].tId==a.tId){e[d].splice(g,1);break}i.setFirstNode(b,e);i.setLastNode(b,e);var j,g=e[d].length;if(!b.data.keep.parent&&g==0)e.isParent=!1,e.open=!1,g=l(e,f.id.UL,b),k=l(e,f.id.SWITCH,b),j=l(e,f.id.ICON,b),i.replaceSwitchClass(e,k,f.folder.DOCU),i.replaceIcoClass(e,j,f.folder.DOCU),g.css("display","none");else if(b.view.showLine&&g>0){var n=e[d][g-1],g=l(n,f.id.UL,b),k=l(n,f.id.SWITCH, | |
| 61 | +b);j=l(n,f.id.ICON,b);e==c?e[d].length==1?i.replaceSwitchClass(n,k,f.line.ROOT):(c=l(e[d][0],f.id.SWITCH,b),i.replaceSwitchClass(e[d][0],c,f.line.ROOTS),i.replaceSwitchClass(n,k,f.line.BOTTOM)):i.replaceSwitchClass(n,k,f.line.BOTTOM);g.removeClass(f.line.LINE)}}},replaceIcoClass:function(b,a,c){if(a&&!b.isAjaxing&&(b=a.attr("class"),b!=void 0)){b=b.split("_");switch(c){case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:b[b.length-1]=c}a.attr("class",b.join("_"))}},replaceSwitchClass:function(b, | |
| 62 | +a,c){if(a){var d=a.attr("class");if(d!=void 0){d=d.split("_");switch(c){case f.line.ROOT:case f.line.ROOTS:case f.line.CENTER:case f.line.BOTTOM:case f.line.NOLINE:d[0]=i.makeNodeLineClassEx(b)+c;break;case f.folder.OPEN:case f.folder.CLOSE:case f.folder.DOCU:d[1]=c}a.attr("class",d.join("_"));c!==f.folder.DOCU?a.removeAttr("disabled"):a.attr("disabled","disabled")}}},selectNode:function(b,a,c){c||i.cancelPreSelectedNode(b,null,a);l(a,f.id.A,b).addClass(f.node.CURSELECTED);h.addSelectedNode(b,a); | |
| 63 | +b.treeObj.trigger(f.event.SELECTED,[b.treeId,a])},setNodeFontCss:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeFontCss(b,a);d&&c.css(d)},setNodeLineIcos:function(b,a){if(a){var c=l(a,f.id.SWITCH,b),d=l(a,f.id.UL,b),e=l(a,f.id.ICON,b),g=i.makeUlLineClass(b,a);g.length==0?d.removeClass(f.line.LINE):d.addClass(g);c.attr("class",i.makeNodeLineClass(b,a));a.isParent?c.removeAttr("disabled"):c.attr("disabled","disabled");e.removeAttr("style");e.attr("style",i.makeNodeIcoStyle(b,a));e.attr("class",i.makeNodeIcoClass(b, | |
| 64 | +a))}},setNodeName:function(b,a){var c=h.getNodeTitle(b,a),d=l(a,f.id.SPAN,b);d.empty();b.view.nameIsHTML?d.html(h.getNodeName(b,a)):d.text(h.getNodeName(b,a));j.apply(b.view.showTitle,[b.treeId,a],b.view.showTitle)&&l(a,f.id.A,b).attr("title",!c?"":c)},setNodeTarget:function(b,a){l(a,f.id.A,b).attr("target",i.makeNodeTarget(a))},setNodeUrl:function(b,a){var c=l(a,f.id.A,b),d=i.makeNodeUrl(b,a);d==null||d.length==0?c.removeAttr("href"):c.attr("href",d)},switchNode:function(b,a){a.open||!j.canAsync(b, | |
| 65 | +a)?i.expandCollapseNode(b,a,!a.open):b.async.enable?i.asyncNode(b,a)||i.expandCollapseNode(b,a,!a.open):a&&i.expandCollapseNode(b,a,!a.open)}};r.fn.zTree={consts:{className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch",NAME:"node_name"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"}, | |
| 66 | +id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_z:{tools:j,view:i,event:m,data:h},getZTreeObj:function(b){return(b=h.getZTreeTools(b))?b:null},destroy:function(b){if(b&&b.length>0)i.destroy(h.getSetting(b));else for(var a in s)i.destroy(s[a])},init:function(b,a,c){var d=j.clone(O);r.extend(!0,d,a);d.treeId= | |
| 67 | +b.attr("id");d.treeObj=b;d.treeObj.empty();s[d.treeId]=d;if(typeof document.body.style.maxHeight==="undefined")d.view.expandSpeed="";h.initRoot(d);b=h.getRoot(d);a=d.data.key.children;c=c?j.clone(j.isArray(c)?c:[c]):[];b[a]=d.data.simpleData.enable?h.transformTozTreeFormat(d,c):c;h.initCache(d);m.unbindTree(d);m.bindTree(d);m.unbindEvent(d);m.bindEvent(d);var e={setting:d,addNodes:function(a,b,c,e){function f(){i.addNodes(d,a,b,l,e==!0)}a||(a=null);if(a&&!a.isParent&&d.data.keep.leaf)return null; | |
| 68 | +var h=parseInt(b,10);isNaN(h)?(e=!!c,c=b,b=-1):b=h;if(!c)return null;var l=j.clone(j.isArray(c)?c:[c]);j.canAsync(d,a)?i.asyncNode(d,a,e,f):f();return l},cancelSelectedNode:function(a){i.cancelPreSelectedNode(d,a)},destroy:function(){i.destroy(d)},expandAll:function(a){a=!!a;i.expandCollapseSonNode(d,null,a,!0);return a},expandNode:function(a,b,c,e,f){function m(){var b=l(a,d).get(0);b&&e!==!1&&i.scrollIntoView(b)}if(!a||!a.isParent)return null;b!==!0&&b!==!1&&(b=!a.open);if((f=!!f)&&b&&j.apply(d.callback.beforeExpand, | |
| 69 | +[d.treeId,a],!0)==!1)return null;else if(f&&!b&&j.apply(d.callback.beforeCollapse,[d.treeId,a],!0)==!1)return null;b&&a.parentTId&&i.expandCollapseParentNode(d,a.getParentNode(),b,!1);if(b===a.open&&!c)return null;h.getRoot(d).expandTriggerFlag=f;!j.canAsync(d,a)&&c?i.expandCollapseSonNode(d,a,b,!0,m):(a.open=!b,i.switchNode(this.setting,a),m());return b},getNodes:function(){return h.getNodes(d)},getNodeByParam:function(a,b,c){return!a?null:h.getNodeByParam(d,c?c[d.data.key.children]:h.getNodes(d), | |
| 70 | +a,b)},getNodeByTId:function(a){return h.getNodeCache(d,a)},getNodesByParam:function(a,b,c){return!a?null:h.getNodesByParam(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByParamFuzzy:function(a,b,c){return!a?null:h.getNodesByParamFuzzy(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByFilter:function(a,b,c,e){b=!!b;return!a||typeof a!="function"?b?null:[]:h.getNodesByFilter(d,c?c[d.data.key.children]:h.getNodes(d),a,b,e)},getNodeIndex:function(a){if(!a)return null;for(var b=d.data.key.children, | |
| 71 | +c=a.parentTId?a.getParentNode():h.getRoot(d),e=0,f=c[b].length;e<f;e++)if(c[b][e]==a)return e;return-1},getSelectedNodes:function(){for(var a=[],b=h.getRoot(d).curSelectedList,c=0,e=b.length;c<e;c++)a.push(b[c]);return a},isSelectedNode:function(a){return h.isSelectedNode(d,a)},reAsyncChildNodesPromise:function(a,b,c){return new Promise(function(d,f){try{e.reAsyncChildNodes(a,b,c,function(){d(a)})}catch(h){f(h)}})},reAsyncChildNodes:function(a,b,c,e){if(this.setting.async.enable){var j=!a;j&&(a=h.getRoot(d)); | |
| 72 | +if(b=="refresh"){for(var b=this.setting.data.key.children,m=0,r=a[b]?a[b].length:0;m<r;m++)h.removeNodeCache(d,a[b][m]);h.removeSelectedNode(d);a[b]=[];j?this.setting.treeObj.empty():l(a,f.id.UL,d).empty()}i.asyncNode(this.setting,j?null:a,!!c,e)}},refresh:function(){this.setting.treeObj.empty();var a=h.getRoot(d),b=a[d.data.key.children];h.initRoot(d);a[d.data.key.children]=b;h.initCache(d);i.createNodes(d,0,a[d.data.key.children],null,-1)},removeChildNodes:function(a){if(!a)return null;var b=a[d.data.key.children]; | |
| 73 | +i.removeChildNodes(d,a);return b?b:null},removeNode:function(a,b){a&&(b=!!b,b&&j.apply(d.callback.beforeRemove,[d.treeId,a],!0)==!1||(i.removeNode(d,a),b&&this.setting.treeObj.trigger(f.event.REMOVE,[d.treeId,a])))},selectNode:function(a,b,c){function e(){if(!c){var b=l(a,d).get(0);i.scrollIntoView(b)}}if(a&&j.uCanDo(d)){b=d.view.selectedMulti&&b;if(a.parentTId)i.expandCollapseParentNode(d,a.getParentNode(),!0,!1,e);else if(!c)try{l(a,d).focus().blur()}catch(f){}i.selectNode(d,a,b)}},transformTozTreeNodes:function(a){return h.transformTozTreeFormat(d, | |
| 74 | +a)},transformToArray:function(a){return h.transformToArrayFormat(d,a)},updateNode:function(a){a&&l(a,d).get(0)&&j.uCanDo(d)&&(i.setNodeName(d,a),i.setNodeTarget(d,a),i.setNodeUrl(d,a),i.setNodeLineIcos(d,a),i.setNodeFontCss(d,a))}};b.treeTools=e;h.setZTreeTools(d,e);b[a]&&b[a].length>0?i.createNodes(d,0,b[a],null,-1):d.async.enable&&d.async.url&&d.async.url!==""&&i.asyncNode(d);return e}};var P=r.fn.zTree,l=j.$,f=P.consts})(jQuery); | ... | ... |
src/main/resources/static/assets/plugins/ztree_v3/js/jquery.ztree.excheck.min.js
| 1 | -/* | |
| 2 | - * JQuery zTree excheck v3.5.29 | |
| 3 | - * http://treejs.cn/ | |
| 4 | - * | |
| 5 | - * Copyright (c) 2010 Hunter.z | |
| 6 | - * | |
| 7 | - * Licensed same as jquery - MIT License | |
| 8 | - * http://www.opensource.org/licenses/mit-license.php | |
| 9 | - * | |
| 10 | - * email: hunter.z@263.net | |
| 11 | - * Date: 2017-06-19 | |
| 12 | - */ | |
| 13 | -(function(m){var p,q,r,o={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},v={check:{enable:!1,autoCheckTrigger:!1,chkStyle:o.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:o.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}};p=function(c, | |
| 14 | -a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=b.data.key.checked;if(k.apply(b.callback.beforeCheck,[b.treeId,a],!0)==!1)return!0;a[d]=!a[d];e.checkNodeRelation(b,a);d=n(a,j.id.CHECK,b);e.setChkClass(b,d,a);e.repairParentChkClassWithSelf(b,a);b.treeObj.trigger(j.event.CHECK,[c,b.treeId,a]);return!0};q=function(c,a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!0;e.setChkClass(b,d,a);return!0};r=function(c,a){if(a.chkDisabled=== | |
| 15 | -!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!1;e.setChkClass(b,d,a);return!0};m.extend(!0,m.fn.zTree.consts,o);m.extend(!0,m.fn.zTree._z,{tools:{},view:{checkNodeRelation:function(c,a){var b,d,h,i=c.data.key.children,l=c.data.key.checked;b=j.radio;if(c.check.chkStyle==b.STYLE){var f=g.getRadioCheckedList(c);if(a[l])if(c.check.radioType==b.TYPE_ALL){for(d=f.length-1;d>=0;d--)b=f[d],b[l]&&b!=a&&(b[l]=!1,f.splice(d,1),e.setChkClass(c,n(b,j.id.CHECK,c),b),b.parentTId!= | |
| 16 | -a.parentTId&&e.repairParentChkClassWithSelf(c,b));f.push(a)}else{f=a.parentTId?a.getParentNode():g.getRoot(c);for(d=0,h=f[i].length;d<h;d++)b=f[i][d],b[l]&&b!=a&&(b[l]=!1,e.setChkClass(c,n(b,j.id.CHECK,c),b))}else if(c.check.radioType==b.TYPE_ALL)for(d=0,h=f.length;d<h;d++)if(a==f[d]){f.splice(d,1);break}}else a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.Y.indexOf("s")>-1)&&e.setSonNodeCheckBox(c,a,!0),!a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.N.indexOf("s")>-1)&&e.setSonNodeCheckBox(c, | |
| 17 | -a,!1),a[l]&&c.check.chkboxType.Y.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!0),!a[l]&&c.check.chkboxType.N.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!1)},makeChkClass:function(c,a){var b=c.data.key.checked,d=j.checkbox,h=j.radio,i="",i=a.chkDisabled===!0?d.DISABLED:a.halfCheck?d.PART:c.check.chkStyle==h.STYLE?a.check_Child_State<1?d.FULL:d.PART:a[b]?a.check_Child_State===2||a.check_Child_State===-1?d.FULL:d.PART:a.check_Child_State<1?d.FULL:d.PART,b=c.check.chkStyle+"_"+(a[b]?d.TRUE:d.FALSE)+ | |
| 18 | -"_"+i,b=a.check_Focus&&a.chkDisabled!==!0?b+"_"+d.FOCUS:b;return j.className.BUTTON+" "+d.DEFAULT+" "+b},repairAllChk:function(c,a){if(c.check.enable&&c.check.chkStyle===j.checkbox.STYLE)for(var b=c.data.key.checked,d=c.data.key.children,h=g.getRoot(c),i=0,l=h[d].length;i<l;i++){var f=h[d][i];f.nocheck!==!0&&f.chkDisabled!==!0&&(f[b]=a);e.setSonNodeCheckBox(c,f,a)}},repairChkClass:function(c,a){if(a&&(g.makeChkFlag(c,a),a.nocheck!==!0)){var b=n(a,j.id.CHECK,c);e.setChkClass(c,b,a)}},repairParentChkClass:function(c, | |
| 19 | -a){if(a&&a.parentTId){var b=a.getParentNode();e.repairChkClass(c,b);e.repairParentChkClass(c,b)}},repairParentChkClassWithSelf:function(c,a){if(a){var b=c.data.key.children;a[b]&&a[b].length>0?e.repairParentChkClass(c,a[b][0]):e.repairParentChkClass(c,a)}},repairSonChkDisabled:function(c,a,b,d){if(a){var h=c.data.key.children;if(a.chkDisabled!=b)a.chkDisabled=b;e.repairChkClass(c,a);if(a[h]&&d)for(var i=0,l=a[h].length;i<l;i++)e.repairSonChkDisabled(c,a[h][i],b,d)}},repairParentChkDisabled:function(c, | |
| 20 | -a,b,d){if(a){if(a.chkDisabled!=b&&d)a.chkDisabled=b;e.repairChkClass(c,a);e.repairParentChkDisabled(c,a.getParentNode(),b,d)}},setChkClass:function(c,a,b){a&&(b.nocheck===!0?a.hide():a.show(),a.attr("class",e.makeChkClass(c,b)))},setParentNodeCheckBox:function(c,a,b,d){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);g.makeChkFlag(c,a);a.nocheck!==!0&&a.chkDisabled!==!0&&(a[i]=b,e.setChkClass(c,l,a),c.check.autoCheckTrigger&&a!=d&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId, | |
| 21 | -a]));if(a.parentTId){l=!0;if(!b)for(var h=a.getParentNode()[h],f=0,k=h.length;f<k;f++)if(h[f].nocheck!==!0&&h[f].chkDisabled!==!0&&h[f][i]||(h[f].nocheck===!0||h[f].chkDisabled===!0)&&h[f].check_Child_State>0){l=!1;break}l&&e.setParentNodeCheckBox(c,a.getParentNode(),b,d)}},setSonNodeCheckBox:function(c,a,b,d){if(a){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);var f=!1;if(a[h])for(var k=0,m=a[h].length;k<m;k++){var o=a[h][k];e.setSonNodeCheckBox(c,o,b,d);o.chkDisabled=== | |
| 22 | -!0&&(f=!0)}if(a!=g.getRoot(c)&&a.chkDisabled!==!0){f&&a.nocheck!==!0&&g.makeChkFlag(c,a);if(a.nocheck!==!0&&a.chkDisabled!==!0){if(a[i]=b,!f)a.check_Child_State=a[h]&&a[h].length>0?b?2:0:-1}else a.check_Child_State=-1;e.setChkClass(c,l,a);c.check.autoCheckTrigger&&a!=d&&a.nocheck!==!0&&a.chkDisabled!==!0&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId,a])}}}},event:{},data:{getRadioCheckedList:function(c){for(var a=g.getRoot(c).radioCheckedList,b=0,d=a.length;b<d;b++)g.getNodeCache(c,a[b].tId)||(a.splice(b, | |
| 23 | -1),b--,d--);return a},getCheckStatus:function(c,a){if(!c.check.enable||a.nocheck||a.chkDisabled)return null;var b=c.data.key.checked;return{checked:a[b],half:a.halfCheck?a.halfCheck:c.check.chkStyle==j.radio.STYLE?a.check_Child_State===2:a[b]?a.check_Child_State>-1&&a.check_Child_State<2:a.check_Child_State>0}},getTreeCheckedNodes:function(c,a,b,d){if(!a)return[];for(var h=c.data.key.children,i=c.data.key.checked,e=b&&c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL,d=!d?[]:d, | |
| 24 | -f=0,k=a.length;f<k;f++){if(a[f].nocheck!==!0&&a[f].chkDisabled!==!0&&a[f][i]==b&&(d.push(a[f]),e))break;g.getTreeCheckedNodes(c,a[f][h],b,d);if(e&&d.length>0)break}return d},getTreeChangeCheckedNodes:function(c,a,b){if(!a)return[];for(var d=c.data.key.children,h=c.data.key.checked,b=!b?[]:b,i=0,e=a.length;i<e;i++)a[i].nocheck!==!0&&a[i].chkDisabled!==!0&&a[i][h]!=a[i].checkedOld&&b.push(a[i]),g.getTreeChangeCheckedNodes(c,a[i][d],b);return b},makeChkFlag:function(c,a){if(a){var b=c.data.key.children, | |
| 25 | -d=c.data.key.checked,h=-1;if(a[b])for(var i=0,e=a[b].length;i<e;i++){var f=a[b][i],g=-1;if(c.check.chkStyle==j.radio.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?2:f[d]?2:f.check_Child_State>0?2:0,g==2){h=2;break}else g==0&&(h=0);else if(c.check.chkStyle==j.checkbox.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?1:f[d]?f.check_Child_State===-1||f.check_Child_State===2?2:1:f.check_Child_State>0?1:0,g===1){h=1;break}else if(g=== | |
| 26 | -2&&h>-1&&i>0&&g!==h){h=1;break}else if(h===2&&g>-1&&g<2){h=1;break}else g>-1&&(h=g)}a.check_Child_State=h}}}});var m=m.fn.zTree,k=m._z.tools,j=m.consts,e=m._z.view,g=m._z.data,n=k.$;g.exSetting(v);g.addInitBind(function(c){c.treeObj.bind(j.event.CHECK,function(a,b,d,h){a.srcEvent=b;k.apply(c.callback.onCheck,[a,d,h])})});g.addInitUnBind(function(c){c.treeObj.unbind(j.event.CHECK)});g.addInitCache(function(){});g.addInitNode(function(c,a,b,d){if(b){a=c.data.key.checked;typeof b[a]=="string"&&(b[a]= | |
| 27 | -k.eqs(b[a],"true"));b[a]=!!b[a];b.checkedOld=b[a];if(typeof b.nocheck=="string")b.nocheck=k.eqs(b.nocheck,"true");b.nocheck=!!b.nocheck||c.check.nocheckInherit&&d&&!!d.nocheck;if(typeof b.chkDisabled=="string")b.chkDisabled=k.eqs(b.chkDisabled,"true");b.chkDisabled=!!b.chkDisabled||c.check.chkDisabledInherit&&d&&!!d.chkDisabled;if(typeof b.halfCheck=="string")b.halfCheck=k.eqs(b.halfCheck,"true");b.halfCheck=!!b.halfCheck;b.check_Child_State=-1;b.check_Focus=!1;b.getCheckStatus=function(){return g.getCheckStatus(c, | |
| 28 | -b)};c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL&&b[a]&&g.getRoot(c).radioCheckedList.push(b)}});g.addInitProxy(function(c){var a=c.target,b=g.getSetting(c.data.treeId),d="",h=null,e="",l=null;if(k.eqs(c.type,"mouseover")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="mouseoverCheck"}else if(k.eqs(c.type,"mouseout")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d= | |
| 29 | -k.getNodeMainDom(a).id,e="mouseoutCheck"}else if(k.eqs(c.type,"click")&&b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="checkNode";if(d.length>0)switch(h=g.getNodeCache(b,d),e){case "checkNode":l=p;break;case "mouseoverCheck":l=q;break;case "mouseoutCheck":l=r}return{stop:e==="checkNode",node:h,nodeEventType:e,nodeEventCallback:l,treeEventType:"",treeEventCallback:null}},!0);g.addInitRoot(function(c){g.getRoot(c).radioCheckedList=[]}); | |
| 30 | -g.addBeforeA(function(c,a,b){c.check.enable&&(g.makeChkFlag(c,a),b.push("<span ID='",a.tId,j.id.CHECK,"' class='",e.makeChkClass(c,a),"' treeNode",j.id.CHECK,a.nocheck===!0?" style='display:none;'":"","></span>"))});g.addZTreeTools(function(c,a){a.checkNode=function(a,b,c,g){var f=this.setting.data.key.checked;if(a.chkDisabled!==!0&&(b!==!0&&b!==!1&&(b=!a[f]),g=!!g,(a[f]!==b||c)&&!(g&&k.apply(this.setting.callback.beforeCheck,[this.setting.treeId,a],!0)==!1)&&k.uCanDo(this.setting)&&this.setting.check.enable&& | |
| 31 | -a.nocheck!==!0))a[f]=b,b=n(a,j.id.CHECK,this.setting),(c||this.setting.check.chkStyle===j.radio.STYLE)&&e.checkNodeRelation(this.setting,a),e.setChkClass(this.setting,b,a),e.repairParentChkClassWithSelf(this.setting,a),g&&this.setting.treeObj.trigger(j.event.CHECK,[null,this.setting.treeId,a])};a.checkAllNodes=function(a){e.repairAllChk(this.setting,!!a)};a.getCheckedNodes=function(a){var b=this.setting.data.key.children;return g.getTreeCheckedNodes(this.setting,g.getRoot(this.setting)[b],a!==!1)}; | |
| 32 | -a.getChangeCheckedNodes=function(){var a=this.setting.data.key.children;return g.getTreeChangeCheckedNodes(this.setting,g.getRoot(this.setting)[a])};a.setChkDisabled=function(a,b,c,g){b=!!b;c=!!c;e.repairSonChkDisabled(this.setting,a,b,!!g);e.repairParentChkDisabled(this.setting,a.getParentNode(),b,c)};var b=a.updateNode;a.updateNode=function(c,g){b&&b.apply(a,arguments);if(c&&this.setting.check.enable&&n(c,this.setting).get(0)&&k.uCanDo(this.setting)){var i=n(c,j.id.CHECK,this.setting);(g==!0||this.setting.check.chkStyle=== | |
| 33 | -j.radio.STYLE)&&e.checkNodeRelation(this.setting,c);e.setChkClass(this.setting,i,c);e.repairParentChkClassWithSelf(this.setting,c)}}});var s=e.createNodes;e.createNodes=function(c,a,b,d,g){s&&s.apply(e,arguments);b&&e.repairParentChkClassWithSelf(c,d)};var t=e.removeNode;e.removeNode=function(c,a){var b=a.getParentNode();t&&t.apply(e,arguments);a&&b&&(e.repairChkClass(c,b),e.repairParentChkClass(c,b))};var u=e.appendNodes;e.appendNodes=function(c,a,b,d,h,i,j){var f="";u&&(f=u.apply(e,arguments)); | |
| 34 | -d&&g.makeChkFlag(c,d);return f}})(jQuery); | |
| 1 | +/* | |
| 2 | + * JQuery zTree excheck v3.5.29 | |
| 3 | + * http://treejs.cn/ | |
| 4 | + * | |
| 5 | + * Copyright (c) 2010 Hunter.z | |
| 6 | + * | |
| 7 | + * Licensed same as jquery - MIT License | |
| 8 | + * http://www.opensource.org/licenses/mit-license.php | |
| 9 | + * | |
| 10 | + * email: hunter.z@263.net | |
| 11 | + * Date: 2017-06-19 | |
| 12 | + */ | |
| 13 | +(function(m){var p,q,r,o={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},v={check:{enable:!1,autoCheckTrigger:!1,chkStyle:o.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:o.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}};p=function(c, | |
| 14 | +a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=b.data.key.checked;if(k.apply(b.callback.beforeCheck,[b.treeId,a],!0)==!1)return!0;a[d]=!a[d];e.checkNodeRelation(b,a);d=n(a,j.id.CHECK,b);e.setChkClass(b,d,a);e.repairParentChkClassWithSelf(b,a);b.treeObj.trigger(j.event.CHECK,[c,b.treeId,a]);return!0};q=function(c,a){if(a.chkDisabled===!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!0;e.setChkClass(b,d,a);return!0};r=function(c,a){if(a.chkDisabled=== | |
| 15 | +!0)return!1;var b=g.getSetting(c.data.treeId),d=n(a,j.id.CHECK,b);a.check_Focus=!1;e.setChkClass(b,d,a);return!0};m.extend(!0,m.fn.zTree.consts,o);m.extend(!0,m.fn.zTree._z,{tools:{},view:{checkNodeRelation:function(c,a){var b,d,h,i=c.data.key.children,l=c.data.key.checked;b=j.radio;if(c.check.chkStyle==b.STYLE){var f=g.getRadioCheckedList(c);if(a[l])if(c.check.radioType==b.TYPE_ALL){for(d=f.length-1;d>=0;d--)b=f[d],b[l]&&b!=a&&(b[l]=!1,f.splice(d,1),e.setChkClass(c,n(b,j.id.CHECK,c),b),b.parentTId!= | |
| 16 | +a.parentTId&&e.repairParentChkClassWithSelf(c,b));f.push(a)}else{f=a.parentTId?a.getParentNode():g.getRoot(c);for(d=0,h=f[i].length;d<h;d++)b=f[i][d],b[l]&&b!=a&&(b[l]=!1,e.setChkClass(c,n(b,j.id.CHECK,c),b))}else if(c.check.radioType==b.TYPE_ALL)for(d=0,h=f.length;d<h;d++)if(a==f[d]){f.splice(d,1);break}}else a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.Y.indexOf("s")>-1)&&e.setSonNodeCheckBox(c,a,!0),!a[l]&&(!a[i]||a[i].length==0||c.check.chkboxType.N.indexOf("s")>-1)&&e.setSonNodeCheckBox(c, | |
| 17 | +a,!1),a[l]&&c.check.chkboxType.Y.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!0),!a[l]&&c.check.chkboxType.N.indexOf("p")>-1&&e.setParentNodeCheckBox(c,a,!1)},makeChkClass:function(c,a){var b=c.data.key.checked,d=j.checkbox,h=j.radio,i="",i=a.chkDisabled===!0?d.DISABLED:a.halfCheck?d.PART:c.check.chkStyle==h.STYLE?a.check_Child_State<1?d.FULL:d.PART:a[b]?a.check_Child_State===2||a.check_Child_State===-1?d.FULL:d.PART:a.check_Child_State<1?d.FULL:d.PART,b=c.check.chkStyle+"_"+(a[b]?d.TRUE:d.FALSE)+ | |
| 18 | +"_"+i,b=a.check_Focus&&a.chkDisabled!==!0?b+"_"+d.FOCUS:b;return j.className.BUTTON+" "+d.DEFAULT+" "+b},repairAllChk:function(c,a){if(c.check.enable&&c.check.chkStyle===j.checkbox.STYLE)for(var b=c.data.key.checked,d=c.data.key.children,h=g.getRoot(c),i=0,l=h[d].length;i<l;i++){var f=h[d][i];f.nocheck!==!0&&f.chkDisabled!==!0&&(f[b]=a);e.setSonNodeCheckBox(c,f,a)}},repairChkClass:function(c,a){if(a&&(g.makeChkFlag(c,a),a.nocheck!==!0)){var b=n(a,j.id.CHECK,c);e.setChkClass(c,b,a)}},repairParentChkClass:function(c, | |
| 19 | +a){if(a&&a.parentTId){var b=a.getParentNode();e.repairChkClass(c,b);e.repairParentChkClass(c,b)}},repairParentChkClassWithSelf:function(c,a){if(a){var b=c.data.key.children;a[b]&&a[b].length>0?e.repairParentChkClass(c,a[b][0]):e.repairParentChkClass(c,a)}},repairSonChkDisabled:function(c,a,b,d){if(a){var h=c.data.key.children;if(a.chkDisabled!=b)a.chkDisabled=b;e.repairChkClass(c,a);if(a[h]&&d)for(var i=0,l=a[h].length;i<l;i++)e.repairSonChkDisabled(c,a[h][i],b,d)}},repairParentChkDisabled:function(c, | |
| 20 | +a,b,d){if(a){if(a.chkDisabled!=b&&d)a.chkDisabled=b;e.repairChkClass(c,a);e.repairParentChkDisabled(c,a.getParentNode(),b,d)}},setChkClass:function(c,a,b){a&&(b.nocheck===!0?a.hide():a.show(),a.attr("class",e.makeChkClass(c,b)))},setParentNodeCheckBox:function(c,a,b,d){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);g.makeChkFlag(c,a);a.nocheck!==!0&&a.chkDisabled!==!0&&(a[i]=b,e.setChkClass(c,l,a),c.check.autoCheckTrigger&&a!=d&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId, | |
| 21 | +a]));if(a.parentTId){l=!0;if(!b)for(var h=a.getParentNode()[h],f=0,k=h.length;f<k;f++)if(h[f].nocheck!==!0&&h[f].chkDisabled!==!0&&h[f][i]||(h[f].nocheck===!0||h[f].chkDisabled===!0)&&h[f].check_Child_State>0){l=!1;break}l&&e.setParentNodeCheckBox(c,a.getParentNode(),b,d)}},setSonNodeCheckBox:function(c,a,b,d){if(a){var h=c.data.key.children,i=c.data.key.checked,l=n(a,j.id.CHECK,c);d||(d=a);var f=!1;if(a[h])for(var k=0,m=a[h].length;k<m;k++){var o=a[h][k];e.setSonNodeCheckBox(c,o,b,d);o.chkDisabled=== | |
| 22 | +!0&&(f=!0)}if(a!=g.getRoot(c)&&a.chkDisabled!==!0){f&&a.nocheck!==!0&&g.makeChkFlag(c,a);if(a.nocheck!==!0&&a.chkDisabled!==!0){if(a[i]=b,!f)a.check_Child_State=a[h]&&a[h].length>0?b?2:0:-1}else a.check_Child_State=-1;e.setChkClass(c,l,a);c.check.autoCheckTrigger&&a!=d&&a.nocheck!==!0&&a.chkDisabled!==!0&&c.treeObj.trigger(j.event.CHECK,[null,c.treeId,a])}}}},event:{},data:{getRadioCheckedList:function(c){for(var a=g.getRoot(c).radioCheckedList,b=0,d=a.length;b<d;b++)g.getNodeCache(c,a[b].tId)||(a.splice(b, | |
| 23 | +1),b--,d--);return a},getCheckStatus:function(c,a){if(!c.check.enable||a.nocheck||a.chkDisabled)return null;var b=c.data.key.checked;return{checked:a[b],half:a.halfCheck?a.halfCheck:c.check.chkStyle==j.radio.STYLE?a.check_Child_State===2:a[b]?a.check_Child_State>-1&&a.check_Child_State<2:a.check_Child_State>0}},getTreeCheckedNodes:function(c,a,b,d){if(!a)return[];for(var h=c.data.key.children,i=c.data.key.checked,e=b&&c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL,d=!d?[]:d, | |
| 24 | +f=0,k=a.length;f<k;f++){if(a[f].nocheck!==!0&&a[f].chkDisabled!==!0&&a[f][i]==b&&(d.push(a[f]),e))break;g.getTreeCheckedNodes(c,a[f][h],b,d);if(e&&d.length>0)break}return d},getTreeChangeCheckedNodes:function(c,a,b){if(!a)return[];for(var d=c.data.key.children,h=c.data.key.checked,b=!b?[]:b,i=0,e=a.length;i<e;i++)a[i].nocheck!==!0&&a[i].chkDisabled!==!0&&a[i][h]!=a[i].checkedOld&&b.push(a[i]),g.getTreeChangeCheckedNodes(c,a[i][d],b);return b},makeChkFlag:function(c,a){if(a){var b=c.data.key.children, | |
| 25 | +d=c.data.key.checked,h=-1;if(a[b])for(var i=0,e=a[b].length;i<e;i++){var f=a[b][i],g=-1;if(c.check.chkStyle==j.radio.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?2:f[d]?2:f.check_Child_State>0?2:0,g==2){h=2;break}else g==0&&(h=0);else if(c.check.chkStyle==j.checkbox.STYLE)if(g=f.nocheck===!0||f.chkDisabled===!0?f.check_Child_State:f.halfCheck===!0?1:f[d]?f.check_Child_State===-1||f.check_Child_State===2?2:1:f.check_Child_State>0?1:0,g===1){h=1;break}else if(g=== | |
| 26 | +2&&h>-1&&i>0&&g!==h){h=1;break}else if(h===2&&g>-1&&g<2){h=1;break}else g>-1&&(h=g)}a.check_Child_State=h}}}});var m=m.fn.zTree,k=m._z.tools,j=m.consts,e=m._z.view,g=m._z.data,n=k.$;g.exSetting(v);g.addInitBind(function(c){c.treeObj.bind(j.event.CHECK,function(a,b,d,h){a.srcEvent=b;k.apply(c.callback.onCheck,[a,d,h])})});g.addInitUnBind(function(c){c.treeObj.unbind(j.event.CHECK)});g.addInitCache(function(){});g.addInitNode(function(c,a,b,d){if(b){a=c.data.key.checked;typeof b[a]=="string"&&(b[a]= | |
| 27 | +k.eqs(b[a],"true"));b[a]=!!b[a];b.checkedOld=b[a];if(typeof b.nocheck=="string")b.nocheck=k.eqs(b.nocheck,"true");b.nocheck=!!b.nocheck||c.check.nocheckInherit&&d&&!!d.nocheck;if(typeof b.chkDisabled=="string")b.chkDisabled=k.eqs(b.chkDisabled,"true");b.chkDisabled=!!b.chkDisabled||c.check.chkDisabledInherit&&d&&!!d.chkDisabled;if(typeof b.halfCheck=="string")b.halfCheck=k.eqs(b.halfCheck,"true");b.halfCheck=!!b.halfCheck;b.check_Child_State=-1;b.check_Focus=!1;b.getCheckStatus=function(){return g.getCheckStatus(c, | |
| 28 | +b)};c.check.chkStyle==j.radio.STYLE&&c.check.radioType==j.radio.TYPE_ALL&&b[a]&&g.getRoot(c).radioCheckedList.push(b)}});g.addInitProxy(function(c){var a=c.target,b=g.getSetting(c.data.treeId),d="",h=null,e="",l=null;if(k.eqs(c.type,"mouseover")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="mouseoverCheck"}else if(k.eqs(c.type,"mouseout")){if(b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d= | |
| 29 | +k.getNodeMainDom(a).id,e="mouseoutCheck"}else if(k.eqs(c.type,"click")&&b.check.enable&&k.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+j.id.CHECK)!==null)d=k.getNodeMainDom(a).id,e="checkNode";if(d.length>0)switch(h=g.getNodeCache(b,d),e){case "checkNode":l=p;break;case "mouseoverCheck":l=q;break;case "mouseoutCheck":l=r}return{stop:e==="checkNode",node:h,nodeEventType:e,nodeEventCallback:l,treeEventType:"",treeEventCallback:null}},!0);g.addInitRoot(function(c){g.getRoot(c).radioCheckedList=[]}); | |
| 30 | +g.addBeforeA(function(c,a,b){c.check.enable&&(g.makeChkFlag(c,a),b.push("<span ID='",a.tId,j.id.CHECK,"' class='",e.makeChkClass(c,a),"' treeNode",j.id.CHECK,a.nocheck===!0?" style='display:none;'":"","></span>"))});g.addZTreeTools(function(c,a){a.checkNode=function(a,b,c,g){var f=this.setting.data.key.checked;if(a.chkDisabled!==!0&&(b!==!0&&b!==!1&&(b=!a[f]),g=!!g,(a[f]!==b||c)&&!(g&&k.apply(this.setting.callback.beforeCheck,[this.setting.treeId,a],!0)==!1)&&k.uCanDo(this.setting)&&this.setting.check.enable&& | |
| 31 | +a.nocheck!==!0))a[f]=b,b=n(a,j.id.CHECK,this.setting),(c||this.setting.check.chkStyle===j.radio.STYLE)&&e.checkNodeRelation(this.setting,a),e.setChkClass(this.setting,b,a),e.repairParentChkClassWithSelf(this.setting,a),g&&this.setting.treeObj.trigger(j.event.CHECK,[null,this.setting.treeId,a])};a.checkAllNodes=function(a){e.repairAllChk(this.setting,!!a)};a.getCheckedNodes=function(a){var b=this.setting.data.key.children;return g.getTreeCheckedNodes(this.setting,g.getRoot(this.setting)[b],a!==!1)}; | |
| 32 | +a.getChangeCheckedNodes=function(){var a=this.setting.data.key.children;return g.getTreeChangeCheckedNodes(this.setting,g.getRoot(this.setting)[a])};a.setChkDisabled=function(a,b,c,g){b=!!b;c=!!c;e.repairSonChkDisabled(this.setting,a,b,!!g);e.repairParentChkDisabled(this.setting,a.getParentNode(),b,c)};var b=a.updateNode;a.updateNode=function(c,g){b&&b.apply(a,arguments);if(c&&this.setting.check.enable&&n(c,this.setting).get(0)&&k.uCanDo(this.setting)){var i=n(c,j.id.CHECK,this.setting);(g==!0||this.setting.check.chkStyle=== | |
| 33 | +j.radio.STYLE)&&e.checkNodeRelation(this.setting,c);e.setChkClass(this.setting,i,c);e.repairParentChkClassWithSelf(this.setting,c)}}});var s=e.createNodes;e.createNodes=function(c,a,b,d,g){s&&s.apply(e,arguments);b&&e.repairParentChkClassWithSelf(c,d)};var t=e.removeNode;e.removeNode=function(c,a){var b=a.getParentNode();t&&t.apply(e,arguments);a&&b&&(e.repairChkClass(c,b),e.repairParentChkClass(c,b))};var u=e.appendNodes;e.appendNodes=function(c,a,b,d,h,i,j){var f="";u&&(f=u.apply(e,arguments)); | |
| 34 | +d&&g.makeChkFlag(c,d);return f}})(jQuery); | ... | ... |
src/main/resources/static/assets/plugins/ztree_v3/js/jquery.ztree.exedit.min.js
| 1 | -/* | |
| 2 | - * JQuery zTree exedit v3.5.29 | |
| 3 | - * http://treejs.cn/ | |
| 4 | - * | |
| 5 | - * Copyright (c) 2010 Hunter.z | |
| 6 | - * | |
| 7 | - * Licensed same as jquery - MIT License | |
| 8 | - * http://www.opensource.org/licenses/mit-license.php | |
| 9 | - * | |
| 10 | - * email: hunter.z@263.net | |
| 11 | - * Date: 2017-06-19 | |
| 12 | - */ | |
| 13 | -(function(v){var J={event:{DRAG:"ztree_drag",DROP:"ztree_drop",RENAME:"ztree_rename",DRAGMOVE:"ztree_dragmove"},id:{EDIT:"_edit",INPUT:"_input",REMOVE:"_remove"},move:{TYPE_INNER:"inner",TYPE_PREV:"prev",TYPE_NEXT:"next"},node:{CURSELECTED_EDIT:"curSelectedNode_Edit",TMPTARGET_TREE:"tmpTargetzTree",TMPTARGET_NODE:"tmpTargetNode"}},x={onHoverOverNode:function(b,a){var c=m.getSetting(b.data.treeId),d=m.getRoot(c);if(d.curHoverNode!=a)x.onHoverOutNode(b);d.curHoverNode=a;f.addHoverDom(c,a)},onHoverOutNode:function(b){var b= | |
| 14 | -m.getSetting(b.data.treeId),a=m.getRoot(b);if(a.curHoverNode&&!m.isSelectedNode(b,a.curHoverNode))f.removeTreeDom(b,a.curHoverNode),a.curHoverNode=null},onMousedownNode:function(b,a){function c(b){if(B.dragFlag==0&&Math.abs(O-b.clientX)<e.edit.drag.minMoveSize&&Math.abs(P-b.clientY)<e.edit.drag.minMoveSize)return!0;var a,c,n,k,i;i=e.data.key.children;M.css("cursor","pointer");if(B.dragFlag==0){if(g.apply(e.callback.beforeDrag,[e.treeId,l],!0)==!1)return r(b),!0;for(a=0,c=l.length;a<c;a++){if(a==0)B.dragNodeShowBefore= | |
| 15 | -[];n=l[a];n.isParent&&n.open?(f.expandCollapseNode(e,n,!n.open),B.dragNodeShowBefore[n.tId]=!0):B.dragNodeShowBefore[n.tId]=!1}B.dragFlag=1;t.showHoverDom=!1;g.showIfameMask(e,!0);n=!0;k=-1;if(l.length>1){var j=l[0].parentTId?l[0].getParentNode()[i]:m.getNodes(e);i=[];for(a=0,c=j.length;a<c;a++)if(B.dragNodeShowBefore[j[a].tId]!==void 0&&(n&&k>-1&&k+1!==a&&(n=!1),i.push(j[a]),k=a),l.length===i.length){l=i;break}}n&&(I=l[0].getPreNode(),R=l[l.length-1].getNextNode());D=o("<ul class='zTreeDragUL'></ul>", | |
| 16 | -e);for(a=0,c=l.length;a<c;a++)n=l[a],n.editNameFlag=!1,f.selectNode(e,n,a>0),f.removeTreeDom(e,n),a>e.edit.drag.maxShowNodeNum-1||(k=o("<li id='"+n.tId+"_tmp'></li>",e),k.append(o(n,d.id.A,e).clone()),k.css("padding","0"),k.children("#"+n.tId+d.id.A).removeClass(d.node.CURSELECTED),D.append(k),a==e.edit.drag.maxShowNodeNum-1&&(k=o("<li id='"+n.tId+"_moretmp'><a> ... </a></li>",e),D.append(k)));D.attr("id",l[0].tId+d.id.UL+"_tmp");D.addClass(e.treeObj.attr("class"));D.appendTo(M);A=o("<span class='tmpzTreeMove_arrow'></span>", | |
| 17 | -e);A.attr("id","zTreeMove_arrow_tmp");A.appendTo(M);e.treeObj.trigger(d.event.DRAG,[b,e.treeId,l])}if(B.dragFlag==1){s&&A.attr("id")==b.target.id&&u&&b.clientX+G.scrollLeft()+2>v("#"+u+d.id.A,s).offset().left?(n=v("#"+u+d.id.A,s),b.target=n.length>0?n.get(0):b.target):s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER)); | |
| 18 | -u=s=null;K=!1;h=e;n=m.getSettings();for(var y in n)if(n[y].treeId&&n[y].edit.enable&&n[y].treeId!=e.treeId&&(b.target.id==n[y].treeId||v(b.target).parents("#"+n[y].treeId).length>0))K=!0,h=n[y];y=G.scrollTop();k=G.scrollLeft();i=h.treeObj.offset();a=h.treeObj.get(0).scrollHeight;n=h.treeObj.get(0).scrollWidth;c=b.clientY+y-i.top;var p=h.treeObj.height()+i.top-b.clientY-y,q=b.clientX+k-i.left,H=h.treeObj.width()+i.left-b.clientX-k;i=c<e.edit.drag.borderMax&&c>e.edit.drag.borderMin;var j=p<e.edit.drag.borderMax&& | |
| 19 | -p>e.edit.drag.borderMin,F=q<e.edit.drag.borderMax&&q>e.edit.drag.borderMin,x=H<e.edit.drag.borderMax&&H>e.edit.drag.borderMin,p=c>e.edit.drag.borderMin&&p>e.edit.drag.borderMin&&q>e.edit.drag.borderMin&&H>e.edit.drag.borderMin,q=i&&h.treeObj.scrollTop()<=0,H=j&&h.treeObj.scrollTop()+h.treeObj.height()+10>=a,N=F&&h.treeObj.scrollLeft()<=0,Q=x&&h.treeObj.scrollLeft()+h.treeObj.width()+10>=n;if(b.target&&g.isChildOrSelf(b.target,h.treeId)){for(var E=b.target;E&&E.tagName&&!g.eqs(E.tagName,"li")&&E.id!= | |
| 20 | -h.treeId;)E=E.parentNode;var S=!0;for(a=0,c=l.length;a<c;a++)if(n=l[a],E.id===n.tId){S=!1;break}else if(o(n,e).find("#"+E.id).length>0){S=!1;break}if(S&&b.target&&g.isChildOrSelf(b.target,E.id+d.id.A))s=v(E),u=E.id}n=l[0];if(p&&g.isChildOrSelf(b.target,h.treeId)){if(!s&&(b.target.id==h.treeId||q||H||N||Q)&&(K||!K&&n.parentTId))s=h.treeObj;i?h.treeObj.scrollTop(h.treeObj.scrollTop()-10):j&&h.treeObj.scrollTop(h.treeObj.scrollTop()+10);F?h.treeObj.scrollLeft(h.treeObj.scrollLeft()-10):x&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+ | |
| 21 | -10);s&&s!=h.treeObj&&s.offset().left<h.treeObj.offset().left&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+s.offset().left-h.treeObj.offset().left)}D.css({top:b.clientY+y+3+"px",left:b.clientX+k+3+"px"});c=a=0;if(s&&s.attr("id")!=h.treeId){var z=u==null?null:m.getNodeCache(h,u);i=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;k=!!(I&&u===I.tId);F=!!(R&&u===R.tId);j=n.parentTId&&n.parentTId==u;n=(i||!F)&&g.apply(h.edit.drag.prev,[h.treeId,l,z], | |
| 22 | -!!h.edit.drag.prev);k=(i||!k)&&g.apply(h.edit.drag.next,[h.treeId,l,z],!!h.edit.drag.next);i=(i||!j)&&!(h.data.keep.leaf&&!z.isParent)&&g.apply(h.edit.drag.inner,[h.treeId,l,z],!!h.edit.drag.inner);j=function(){s=null;u="";w=d.move.TYPE_INNER;A.css({display:"none"});if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null};if(!n&&!k&&!i)j();else if(F=v("#"+u+d.id.A,s),x=z.isLastNode?null:v("#"+z.getNextNode().tId+d.id.A,s.next()),p=F.offset().top,q=F.offset().left, | |
| 23 | -H=n?i?0.25:k?0.5:1:-1,N=k?i?0.75:n?0.5:0:-1,y=(b.clientY+y-p)/F.height(),(H==1||y<=H&&y>=-0.2)&&n?(a=1-A.width(),c=p-A.height()/2,w=d.move.TYPE_PREV):(N==0||y>=N&&y<=1.2)&&k?(a=1-A.width(),c=x==null||z.isParent&&z.open?p+F.height()-A.height()/2:x.offset().top-A.height()/2,w=d.move.TYPE_NEXT):i?(a=5-A.width(),c=p,w=d.move.TYPE_INNER):j(),s){A.css({display:"block",top:c+"px",left:q+a+"px"});F.addClass(d.node.TMPTARGET_NODE+"_"+w);if(T!=u||U!=w)L=(new Date).getTime();if(z&&z.isParent&&w==d.move.TYPE_INNER&& | |
| 24 | -(y=!0,window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId!==z.tId?(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null):window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId===z.tId&&(y=!1),y))window.zTreeMoveTimer=setTimeout(function(){w==d.move.TYPE_INNER&&z&&z.isParent&&!z.open&&(new Date).getTime()-L>h.edit.drag.autoOpenTime&&g.apply(h.callback.beforeDragOpen,[h.treeId,z],!0)&&(f.switchNode(h,z),h.edit.drag.autoExpandTrigger&&h.treeObj.trigger(d.event.EXPAND,[h.treeId,z]))}, | |
| 25 | -h.edit.drag.autoOpenTime+50),window.zTreeMoveTargetNodeTId=z.tId}}else if(w=d.move.TYPE_INNER,s&&g.apply(h.edit.drag.inner,[h.treeId,l,null],!!h.edit.drag.inner)?s.addClass(d.node.TMPTARGET_TREE):s=null,A.css({display:"none"}),window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;T=u;U=w;e.treeObj.trigger(d.event.DRAGMOVE,[b,e.treeId,l])}return!1}function r(b){if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;U=T= | |
| 26 | -null;G.unbind("mousemove",c);G.unbind("mouseup",r);G.unbind("selectstart",k);M.css("cursor","");s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER));g.showIfameMask(e,!1);t.showHoverDom=!0;if(B.dragFlag!=0){B.dragFlag=0;var a,i,j;for(a=0,i=l.length;a<i;a++)j=l[a],j.isParent&&B.dragNodeShowBefore[j.tId]&&!j.open&&(f.expandCollapseNode(e, | |
| 27 | -j,!j.open),delete B.dragNodeShowBefore[j.tId]);D&&D.remove();A&&A.remove();var p=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;!p&&s&&u&&l[0].parentTId&&u==l[0].parentTId&&w==d.move.TYPE_INNER&&(s=null);if(s){var q=u==null?null:m.getNodeCache(h,u);if(g.apply(e.callback.beforeDrop,[h.treeId,l,q,w,p],!0)==!1)f.selectNodes(x,l);else{var C=p?g.clone(l):l;a=function(){if(K){if(!p)for(var a=0,c=l.length;a<c;a++)f.removeNode(e,l[a]);w==d.move.TYPE_INNER? | |
| 28 | -f.addNodes(h,q,-1,C):f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C)}else if(p&&w==d.move.TYPE_INNER)f.addNodes(h,q,-1,C);else if(p)f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C);else if(w!=d.move.TYPE_NEXT)for(a=0,c=C.length;a<c;a++)f.moveNode(h,q,C[a],w,!1);else for(a=-1,c=C.length-1;a<c;c--)f.moveNode(h,q,C[c],w,!1);f.selectNodes(h,C);a=o(C[0],e).get(0);f.scrollIntoView(a);e.treeObj.trigger(d.event.DROP,[b,h.treeId,C,q,w,p])}; | |
| 29 | -w==d.move.TYPE_INNER&&g.canAsync(h,q)?f.asyncNode(h,q,!1,a):a()}}else f.selectNodes(x,l),e.treeObj.trigger(d.event.DROP,[b,e.treeId,l,null,null,null])}}function k(){return!1}var i,j,e=m.getSetting(b.data.treeId),B=m.getRoot(e),t=m.getRoots();if(b.button==2||!e.edit.enable||!e.edit.drag.isCopy&&!e.edit.drag.isMove)return!0;var p=b.target,q=m.getRoot(e).curSelectedList,l=[];if(m.isSelectedNode(e,a))for(i=0,j=q.length;i<j;i++){if(q[i].editNameFlag&&g.eqs(p.tagName,"input")&&p.getAttribute("treeNode"+ | |
| 30 | -d.id.INPUT)!==null)return!0;l.push(q[i]);if(l[0].parentTId!==q[i].parentTId){l=[a];break}}else l=[a];f.editNodeBlur=!0;f.cancelCurEditNode(e);var G=v(e.treeObj.get(0).ownerDocument),M=v(e.treeObj.get(0).ownerDocument.body),D,A,s,K=!1,h=e,x=e,I,R,T=null,U=null,u=null,w=d.move.TYPE_INNER,O=b.clientX,P=b.clientY,L=(new Date).getTime();g.uCanDo(e)&&G.bind("mousemove",c);G.bind("mouseup",r);G.bind("selectstart",k);b.preventDefault&&b.preventDefault();return!0}};v.extend(!0,v.fn.zTree.consts,J);v.extend(!0, | |
| 31 | -v.fn.zTree._z,{tools:{getAbs:function(b){b=b.getBoundingClientRect();return[b.left+(document.body.scrollLeft+document.documentElement.scrollLeft),b.top+(document.body.scrollTop+document.documentElement.scrollTop)]},inputFocus:function(b){b.get(0)&&(b.focus(),g.setCursorPosition(b.get(0),b.val().length))},inputSelect:function(b){b.get(0)&&(b.focus(),b.select())},setCursorPosition:function(b,a){if(b.setSelectionRange)b.focus(),b.setSelectionRange(a,a);else if(b.createTextRange){var c=b.createTextRange(); | |
| 32 | -c.collapse(!0);c.moveEnd("character",a);c.moveStart("character",a);c.select()}},showIfameMask:function(b,a){for(var c=m.getRoot(b);c.dragMaskList.length>0;)c.dragMaskList[0].remove(),c.dragMaskList.shift();if(a)for(var d=o("iframe",b),f=0,i=d.length;f<i;f++){var j=d.get(f),e=g.getAbs(j),j=o("<div id='zTreeMask_"+f+"' class='zTreeMask' style='top:"+e[1]+"px; left:"+e[0]+"px; width:"+j.offsetWidth+"px; height:"+j.offsetHeight+"px;'></div>",b);j.appendTo(o("body",b));c.dragMaskList.push(j)}}},view:{addEditBtn:function(b, | |
| 33 | -a){if(!(a.editNameFlag||o(a,d.id.EDIT,b).length>0)&&g.apply(b.edit.showRenameBtn,[b.treeId,a],b.edit.showRenameBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" edit' id='"+a.tId+d.id.EDIT+"' title='"+g.apply(b.edit.renameTitle,[b.treeId,a],b.edit.renameTitle)+"' treeNode"+d.id.EDIT+" style='display:none;'></span>";c.append(r);o(a,d.id.EDIT,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeEditName,[b.treeId,a],!0)==!1)return!1;f.editNode(b,a);return!1}).show()}}, | |
| 34 | -addRemoveBtn:function(b,a){if(!(a.editNameFlag||o(a,d.id.REMOVE,b).length>0)&&g.apply(b.edit.showRemoveBtn,[b.treeId,a],b.edit.showRemoveBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" remove' id='"+a.tId+d.id.REMOVE+"' title='"+g.apply(b.edit.removeTitle,[b.treeId,a],b.edit.removeTitle)+"' treeNode"+d.id.REMOVE+" style='display:none;'></span>";c.append(r);o(a,d.id.REMOVE,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeRemove,[b.treeId,a],!0)==!1)return!1;f.removeNode(b, | |
| 35 | -a);b.treeObj.trigger(d.event.REMOVE,[b.treeId,a]);return!1}).bind("mousedown",function(){return!0}).show()}},addHoverDom:function(b,a){if(m.getRoots().showHoverDom)a.isHover=!0,b.edit.enable&&(f.addEditBtn(b,a),f.addRemoveBtn(b,a)),g.apply(b.view.addHoverDom,[b.treeId,a])},cancelCurEditNode:function(b,a,c){var r=m.getRoot(b),k=b.data.key.name,i=r.curEditNode;if(i){var j=r.curEditInput,a=a?a:c?i[k]:j.val();if(g.apply(b.callback.beforeRename,[b.treeId,i,a,c],!0)===!1)return!1;i[k]=a;o(i,d.id.A,b).removeClass(d.node.CURSELECTED_EDIT); | |
| 36 | -j.unbind();f.setNodeName(b,i);i.editNameFlag=!1;r.curEditNode=null;r.curEditInput=null;f.selectNode(b,i,!1);b.treeObj.trigger(d.event.RENAME,[b.treeId,i,c])}return r.noSelection=!0},editNode:function(b,a){var c=m.getRoot(b);f.editNodeBlur=!1;if(m.isSelectedNode(b,a)&&c.curEditNode==a&&a.editNameFlag)setTimeout(function(){g.inputFocus(c.curEditInput)},0);else{var r=b.data.key.name;a.editNameFlag=!0;f.removeTreeDom(b,a);f.cancelCurEditNode(b);f.selectNode(b,a,!1);o(a,d.id.SPAN,b).html("<input type=text class='rename' id='"+ | |
| 37 | -a.tId+d.id.INPUT+"' treeNode"+d.id.INPUT+" >");var k=o(a,d.id.INPUT,b);k.attr("value",a[r]);b.edit.editNameSelectAll?g.inputSelect(k):g.inputFocus(k);k.bind("blur",function(){f.editNodeBlur||f.cancelCurEditNode(b)}).bind("keydown",function(a){a.keyCode=="13"?(f.editNodeBlur=!0,f.cancelCurEditNode(b)):a.keyCode=="27"&&f.cancelCurEditNode(b,null,!0)}).bind("click",function(){return!1}).bind("dblclick",function(){return!1});o(a,d.id.A,b).addClass(d.node.CURSELECTED_EDIT);c.curEditInput=k;c.noSelection= | |
| 38 | -!1;c.curEditNode=a}},moveNode:function(b,a,c,r,k,i){var j=m.getRoot(b),e=b.data.key.children;if(a!=c&&(!b.data.keep.leaf||!a||a.isParent||r!=d.move.TYPE_INNER)){var g=c.parentTId?c.getParentNode():j,t=a===null||a==j;t&&a===null&&(a=j);if(t)r=d.move.TYPE_INNER;j=a.parentTId?a.getParentNode():j;if(r!=d.move.TYPE_PREV&&r!=d.move.TYPE_NEXT)r=d.move.TYPE_INNER;if(r==d.move.TYPE_INNER)if(t)c.parentTId=null;else{if(!a.isParent)a.isParent=!0,a.open=!!a.open,f.setNodeLineIcos(b,a);c.parentTId=a.tId}var p; | |
| 39 | -t?p=t=b.treeObj:(!i&&r==d.move.TYPE_INNER?f.expandCollapseNode(b,a,!0,!1):i||f.expandCollapseNode(b,a.getParentNode(),!0,!1),t=o(a,b),p=o(a,d.id.UL,b),t.get(0)&&!p.get(0)&&(p=[],f.makeUlHtml(b,a,p,""),t.append(p.join(""))),p=o(a,d.id.UL,b));var q=o(c,b);q.get(0)?t.get(0)||q.remove():q=f.appendNodes(b,c.level,[c],null,-1,!1,!0).join("");p.get(0)&&r==d.move.TYPE_INNER?p.append(q):t.get(0)&&r==d.move.TYPE_PREV?t.before(q):t.get(0)&&r==d.move.TYPE_NEXT&&t.after(q);var l=-1,v=0,x=null,t=null,D=c.level; | |
| 40 | -if(c.isFirstNode){if(l=0,g[e].length>1)x=g[e][1],x.isFirstNode=!0}else if(c.isLastNode)l=g[e].length-1,x=g[e][l-1],x.isLastNode=!0;else for(p=0,q=g[e].length;p<q;p++)if(g[e][p].tId==c.tId){l=p;break}l>=0&&g[e].splice(l,1);if(r!=d.move.TYPE_INNER)for(p=0,q=j[e].length;p<q;p++)j[e][p].tId==a.tId&&(v=p);if(r==d.move.TYPE_INNER){a[e]||(a[e]=[]);if(a[e].length>0)t=a[e][a[e].length-1],t.isLastNode=!1;a[e].splice(a[e].length,0,c);c.isLastNode=!0;c.isFirstNode=a[e].length==1}else a.isFirstNode&&r==d.move.TYPE_PREV? | |
| 41 | -(j[e].splice(v,0,c),t=a,t.isFirstNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!0,c.isLastNode=!1):a.isLastNode&&r==d.move.TYPE_NEXT?(j[e].splice(v+1,0,c),t=a,t.isLastNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!0):(r==d.move.TYPE_PREV?j[e].splice(v,0,c):j[e].splice(v+1,0,c),c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!1);m.fixPIdKeyValue(b,c);m.setSonNodeLevel(b,c.getParentNode(),c);f.setNodeLineIcos(b,c);f.repairNodeLevelClass(b,c,D);!b.data.keep.parent&&g[e].length< | |
| 42 | -1?(g.isParent=!1,g.open=!1,a=o(g,d.id.UL,b),r=o(g,d.id.SWITCH,b),e=o(g,d.id.ICON,b),f.replaceSwitchClass(g,r,d.folder.DOCU),f.replaceIcoClass(g,e,d.folder.DOCU),a.css("display","none")):x&&f.setNodeLineIcos(b,x);t&&f.setNodeLineIcos(b,t);b.check&&b.check.enable&&f.repairChkClass&&(f.repairChkClass(b,g),f.repairParentChkClassWithSelf(b,g),g!=c.parent&&f.repairParentChkClassWithSelf(b,c));i||f.expandCollapseParentNode(b,c.getParentNode(),!0,k)}},removeEditBtn:function(b,a){o(a,d.id.EDIT,b).unbind().remove()}, | |
| 43 | -removeRemoveBtn:function(b,a){o(a,d.id.REMOVE,b).unbind().remove()},removeTreeDom:function(b,a){a.isHover=!1;f.removeEditBtn(b,a);f.removeRemoveBtn(b,a);g.apply(b.view.removeHoverDom,[b.treeId,a])},repairNodeLevelClass:function(b,a,c){if(c!==a.level){var f=o(a,b),g=o(a,d.id.A,b),b=o(a,d.id.UL,b),c=d.className.LEVEL+c,a=d.className.LEVEL+a.level;f.removeClass(c);f.addClass(a);g.removeClass(c);g.addClass(a);b.removeClass(c);b.addClass(a)}},selectNodes:function(b,a){for(var c=0,d=a.length;c<d;c++)f.selectNode(b, | |
| 44 | -a[c],c>0)}},event:{},data:{setSonNodeLevel:function(b,a,c){if(c){var d=b.data.key.children;c.level=a?a.level+1:0;if(c[d])for(var a=0,f=c[d].length;a<f;a++)c[d][a]&&m.setSonNodeLevel(b,c,c[d][a])}}}});var I=v.fn.zTree,g=I._z.tools,d=I.consts,f=I._z.view,m=I._z.data,o=g.$;m.exSetting({edit:{enable:!1,editNameSelectAll:!1,showRemoveBtn:!0,showRenameBtn:!0,removeTitle:"remove",renameTitle:"rename",drag:{autoExpandTrigger:!1,isCopy:!0,isMove:!0,prev:!0,next:!0,inner:!0,minMoveSize:5,borderMax:10,borderMin:-5, | |
| 45 | -maxShowNodeNum:5,autoOpenTime:500}},view:{addHoverDom:null,removeHoverDom:null},callback:{beforeDrag:null,beforeDragOpen:null,beforeDrop:null,beforeEditName:null,beforeRename:null,onDrag:null,onDragMove:null,onDrop:null,onRename:null}});m.addInitBind(function(b){var a=b.treeObj,c=d.event;a.bind(c.RENAME,function(a,c,d,f){g.apply(b.callback.onRename,[a,c,d,f])});a.bind(c.DRAG,function(a,c,d,f){g.apply(b.callback.onDrag,[c,d,f])});a.bind(c.DRAGMOVE,function(a,c,d,f){g.apply(b.callback.onDragMove,[c, | |
| 46 | -d,f])});a.bind(c.DROP,function(a,c,d,f,e,m,o){g.apply(b.callback.onDrop,[c,d,f,e,m,o])})});m.addInitUnBind(function(b){var b=b.treeObj,a=d.event;b.unbind(a.RENAME);b.unbind(a.DRAG);b.unbind(a.DRAGMOVE);b.unbind(a.DROP)});m.addInitCache(function(){});m.addInitNode(function(b,a,c){if(c)c.isHover=!1,c.editNameFlag=!1});m.addInitProxy(function(b){var a=b.target,c=m.getSetting(b.data.treeId),f=b.relatedTarget,k="",i=null,j="",e=null,o=null;if(g.eqs(b.type,"mouseover")){if(o=g.getMDom(c,a,[{tagName:"a", | |
| 47 | -attrName:"treeNode"+d.id.A}]))k=g.getNodeMainDom(o).id,j="hoverOverNode"}else if(g.eqs(b.type,"mouseout"))o=g.getMDom(c,f,[{tagName:"a",attrName:"treeNode"+d.id.A}]),o||(k="remove",j="hoverOutNode");else if(g.eqs(b.type,"mousedown")&&(o=g.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+d.id.A}])))k=g.getNodeMainDom(o).id,j="mousedownNode";if(k.length>0)switch(i=m.getNodeCache(c,k),j){case "mousedownNode":e=x.onMousedownNode;break;case "hoverOverNode":e=x.onHoverOverNode;break;case "hoverOutNode":e= | |
| 48 | -x.onHoverOutNode}return{stop:!1,node:i,nodeEventType:j,nodeEventCallback:e,treeEventType:"",treeEventCallback:null}});m.addInitRoot(function(b){var b=m.getRoot(b),a=m.getRoots();b.curEditNode=null;b.curEditInput=null;b.curHoverNode=null;b.dragFlag=0;b.dragNodeShowBefore=[];b.dragMaskList=[];a.showHoverDom=!0});m.addZTreeTools(function(b,a){a.cancelEditName=function(a){m.getRoot(this.setting).curEditNode&&f.cancelCurEditNode(this.setting,a?a:null,!0)};a.copyNode=function(a,b,k,i){if(!b)return null; | |
| 49 | -if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;var j=this,e=g.clone(b);if(!a)a=null,k=d.move.TYPE_INNER;k==d.move.TYPE_INNER?(b=function(){f.addNodes(j.setting,a,-1,[e],i)},g.canAsync(this.setting,a)?f.asyncNode(this.setting,a,i,b):b()):(f.addNodes(this.setting,a.parentNode,-1,[e],i),f.moveNode(this.setting,a,e,k,!1,i));return e};a.editName=function(a){a&&a.tId&&a===m.getNodeCache(this.setting,a.tId)&&(a.parentTId&&f.expandCollapseParentNode(this.setting,a.getParentNode(), | |
| 50 | -!0),f.editNode(this.setting,a))};a.moveNode=function(a,b,k,i){function j(){f.moveNode(e.setting,a,b,k,!1,i)}if(!b)return b;if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;else if(a&&(b.parentTId==a.tId&&k==d.move.TYPE_INNER||o(b,this.setting).find("#"+a.tId).length>0))return null;else a||(a=null);var e=this;g.canAsync(this.setting,a)&&k===d.move.TYPE_INNER?f.asyncNode(this.setting,a,i,j):j();return b};a.setEditable=function(a){this.setting.edit.enable=a;return this.refresh()}}); | |
| 51 | -var O=f.cancelPreSelectedNode;f.cancelPreSelectedNode=function(b,a){for(var c=m.getRoot(b).curSelectedList,d=0,g=c.length;d<g;d++)if(!a||a===c[d])if(f.removeTreeDom(b,c[d]),a)break;O&&O.apply(f,arguments)};var P=f.createNodes;f.createNodes=function(b,a,c,d,g){P&&P.apply(f,arguments);c&&f.repairParentChkClassWithSelf&&f.repairParentChkClassWithSelf(b,d)};var W=f.makeNodeUrl;f.makeNodeUrl=function(b,a){return b.edit.enable?null:W.apply(f,arguments)};var L=f.removeNode;f.removeNode=function(b,a){var c= | |
| 52 | -m.getRoot(b);if(c.curEditNode===a)c.curEditNode=null;L&&L.apply(f,arguments)};var Q=f.selectNode;f.selectNode=function(b,a,c){var d=m.getRoot(b);if(m.isSelectedNode(b,a)&&d.curEditNode==a&&a.editNameFlag)return!1;Q&&Q.apply(f,arguments);f.addHoverDom(b,a);return!0};var V=g.uCanDo;g.uCanDo=function(b,a){var c=m.getRoot(b);if(a&&(g.eqs(a.type,"mouseover")||g.eqs(a.type,"mouseout")||g.eqs(a.type,"mousedown")||g.eqs(a.type,"mouseup")))return!0;if(c.curEditNode)f.editNodeBlur=!1,c.curEditInput.focus(); | |
| 53 | -return!c.curEditNode&&(V?V.apply(f,arguments):!0)}})(jQuery); | |
| 1 | +/* | |
| 2 | + * JQuery zTree exedit v3.5.29 | |
| 3 | + * http://treejs.cn/ | |
| 4 | + * | |
| 5 | + * Copyright (c) 2010 Hunter.z | |
| 6 | + * | |
| 7 | + * Licensed same as jquery - MIT License | |
| 8 | + * http://www.opensource.org/licenses/mit-license.php | |
| 9 | + * | |
| 10 | + * email: hunter.z@263.net | |
| 11 | + * Date: 2017-06-19 | |
| 12 | + */ | |
| 13 | +(function(v){var J={event:{DRAG:"ztree_drag",DROP:"ztree_drop",RENAME:"ztree_rename",DRAGMOVE:"ztree_dragmove"},id:{EDIT:"_edit",INPUT:"_input",REMOVE:"_remove"},move:{TYPE_INNER:"inner",TYPE_PREV:"prev",TYPE_NEXT:"next"},node:{CURSELECTED_EDIT:"curSelectedNode_Edit",TMPTARGET_TREE:"tmpTargetzTree",TMPTARGET_NODE:"tmpTargetNode"}},x={onHoverOverNode:function(b,a){var c=m.getSetting(b.data.treeId),d=m.getRoot(c);if(d.curHoverNode!=a)x.onHoverOutNode(b);d.curHoverNode=a;f.addHoverDom(c,a)},onHoverOutNode:function(b){var b= | |
| 14 | +m.getSetting(b.data.treeId),a=m.getRoot(b);if(a.curHoverNode&&!m.isSelectedNode(b,a.curHoverNode))f.removeTreeDom(b,a.curHoverNode),a.curHoverNode=null},onMousedownNode:function(b,a){function c(b){if(B.dragFlag==0&&Math.abs(O-b.clientX)<e.edit.drag.minMoveSize&&Math.abs(P-b.clientY)<e.edit.drag.minMoveSize)return!0;var a,c,n,k,i;i=e.data.key.children;M.css("cursor","pointer");if(B.dragFlag==0){if(g.apply(e.callback.beforeDrag,[e.treeId,l],!0)==!1)return r(b),!0;for(a=0,c=l.length;a<c;a++){if(a==0)B.dragNodeShowBefore= | |
| 15 | +[];n=l[a];n.isParent&&n.open?(f.expandCollapseNode(e,n,!n.open),B.dragNodeShowBefore[n.tId]=!0):B.dragNodeShowBefore[n.tId]=!1}B.dragFlag=1;t.showHoverDom=!1;g.showIfameMask(e,!0);n=!0;k=-1;if(l.length>1){var j=l[0].parentTId?l[0].getParentNode()[i]:m.getNodes(e);i=[];for(a=0,c=j.length;a<c;a++)if(B.dragNodeShowBefore[j[a].tId]!==void 0&&(n&&k>-1&&k+1!==a&&(n=!1),i.push(j[a]),k=a),l.length===i.length){l=i;break}}n&&(I=l[0].getPreNode(),R=l[l.length-1].getNextNode());D=o("<ul class='zTreeDragUL'></ul>", | |
| 16 | +e);for(a=0,c=l.length;a<c;a++)n=l[a],n.editNameFlag=!1,f.selectNode(e,n,a>0),f.removeTreeDom(e,n),a>e.edit.drag.maxShowNodeNum-1||(k=o("<li id='"+n.tId+"_tmp'></li>",e),k.append(o(n,d.id.A,e).clone()),k.css("padding","0"),k.children("#"+n.tId+d.id.A).removeClass(d.node.CURSELECTED),D.append(k),a==e.edit.drag.maxShowNodeNum-1&&(k=o("<li id='"+n.tId+"_moretmp'><a> ... </a></li>",e),D.append(k)));D.attr("id",l[0].tId+d.id.UL+"_tmp");D.addClass(e.treeObj.attr("class"));D.appendTo(M);A=o("<span class='tmpzTreeMove_arrow'></span>", | |
| 17 | +e);A.attr("id","zTreeMove_arrow_tmp");A.appendTo(M);e.treeObj.trigger(d.event.DRAG,[b,e.treeId,l])}if(B.dragFlag==1){s&&A.attr("id")==b.target.id&&u&&b.clientX+G.scrollLeft()+2>v("#"+u+d.id.A,s).offset().left?(n=v("#"+u+d.id.A,s),b.target=n.length>0?n.get(0):b.target):s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER)); | |
| 18 | +u=s=null;K=!1;h=e;n=m.getSettings();for(var y in n)if(n[y].treeId&&n[y].edit.enable&&n[y].treeId!=e.treeId&&(b.target.id==n[y].treeId||v(b.target).parents("#"+n[y].treeId).length>0))K=!0,h=n[y];y=G.scrollTop();k=G.scrollLeft();i=h.treeObj.offset();a=h.treeObj.get(0).scrollHeight;n=h.treeObj.get(0).scrollWidth;c=b.clientY+y-i.top;var p=h.treeObj.height()+i.top-b.clientY-y,q=b.clientX+k-i.left,H=h.treeObj.width()+i.left-b.clientX-k;i=c<e.edit.drag.borderMax&&c>e.edit.drag.borderMin;var j=p<e.edit.drag.borderMax&& | |
| 19 | +p>e.edit.drag.borderMin,F=q<e.edit.drag.borderMax&&q>e.edit.drag.borderMin,x=H<e.edit.drag.borderMax&&H>e.edit.drag.borderMin,p=c>e.edit.drag.borderMin&&p>e.edit.drag.borderMin&&q>e.edit.drag.borderMin&&H>e.edit.drag.borderMin,q=i&&h.treeObj.scrollTop()<=0,H=j&&h.treeObj.scrollTop()+h.treeObj.height()+10>=a,N=F&&h.treeObj.scrollLeft()<=0,Q=x&&h.treeObj.scrollLeft()+h.treeObj.width()+10>=n;if(b.target&&g.isChildOrSelf(b.target,h.treeId)){for(var E=b.target;E&&E.tagName&&!g.eqs(E.tagName,"li")&&E.id!= | |
| 20 | +h.treeId;)E=E.parentNode;var S=!0;for(a=0,c=l.length;a<c;a++)if(n=l[a],E.id===n.tId){S=!1;break}else if(o(n,e).find("#"+E.id).length>0){S=!1;break}if(S&&b.target&&g.isChildOrSelf(b.target,E.id+d.id.A))s=v(E),u=E.id}n=l[0];if(p&&g.isChildOrSelf(b.target,h.treeId)){if(!s&&(b.target.id==h.treeId||q||H||N||Q)&&(K||!K&&n.parentTId))s=h.treeObj;i?h.treeObj.scrollTop(h.treeObj.scrollTop()-10):j&&h.treeObj.scrollTop(h.treeObj.scrollTop()+10);F?h.treeObj.scrollLeft(h.treeObj.scrollLeft()-10):x&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+ | |
| 21 | +10);s&&s!=h.treeObj&&s.offset().left<h.treeObj.offset().left&&h.treeObj.scrollLeft(h.treeObj.scrollLeft()+s.offset().left-h.treeObj.offset().left)}D.css({top:b.clientY+y+3+"px",left:b.clientX+k+3+"px"});c=a=0;if(s&&s.attr("id")!=h.treeId){var z=u==null?null:m.getNodeCache(h,u);i=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;k=!!(I&&u===I.tId);F=!!(R&&u===R.tId);j=n.parentTId&&n.parentTId==u;n=(i||!F)&&g.apply(h.edit.drag.prev,[h.treeId,l,z], | |
| 22 | +!!h.edit.drag.prev);k=(i||!k)&&g.apply(h.edit.drag.next,[h.treeId,l,z],!!h.edit.drag.next);i=(i||!j)&&!(h.data.keep.leaf&&!z.isParent)&&g.apply(h.edit.drag.inner,[h.treeId,l,z],!!h.edit.drag.inner);j=function(){s=null;u="";w=d.move.TYPE_INNER;A.css({display:"none"});if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null};if(!n&&!k&&!i)j();else if(F=v("#"+u+d.id.A,s),x=z.isLastNode?null:v("#"+z.getNextNode().tId+d.id.A,s.next()),p=F.offset().top,q=F.offset().left, | |
| 23 | +H=n?i?0.25:k?0.5:1:-1,N=k?i?0.75:n?0.5:0:-1,y=(b.clientY+y-p)/F.height(),(H==1||y<=H&&y>=-0.2)&&n?(a=1-A.width(),c=p-A.height()/2,w=d.move.TYPE_PREV):(N==0||y>=N&&y<=1.2)&&k?(a=1-A.width(),c=x==null||z.isParent&&z.open?p+F.height()-A.height()/2:x.offset().top-A.height()/2,w=d.move.TYPE_NEXT):i?(a=5-A.width(),c=p,w=d.move.TYPE_INNER):j(),s){A.css({display:"block",top:c+"px",left:q+a+"px"});F.addClass(d.node.TMPTARGET_NODE+"_"+w);if(T!=u||U!=w)L=(new Date).getTime();if(z&&z.isParent&&w==d.move.TYPE_INNER&& | |
| 24 | +(y=!0,window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId!==z.tId?(clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null):window.zTreeMoveTimer&&window.zTreeMoveTargetNodeTId===z.tId&&(y=!1),y))window.zTreeMoveTimer=setTimeout(function(){w==d.move.TYPE_INNER&&z&&z.isParent&&!z.open&&(new Date).getTime()-L>h.edit.drag.autoOpenTime&&g.apply(h.callback.beforeDragOpen,[h.treeId,z],!0)&&(f.switchNode(h,z),h.edit.drag.autoExpandTrigger&&h.treeObj.trigger(d.event.EXPAND,[h.treeId,z]))}, | |
| 25 | +h.edit.drag.autoOpenTime+50),window.zTreeMoveTargetNodeTId=z.tId}}else if(w=d.move.TYPE_INNER,s&&g.apply(h.edit.drag.inner,[h.treeId,l,null],!!h.edit.drag.inner)?s.addClass(d.node.TMPTARGET_TREE):s=null,A.css({display:"none"}),window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;T=u;U=w;e.treeObj.trigger(d.event.DRAGMOVE,[b,e.treeId,l])}return!1}function r(b){if(window.zTreeMoveTimer)clearTimeout(window.zTreeMoveTimer),window.zTreeMoveTargetNodeTId=null;U=T= | |
| 26 | +null;G.unbind("mousemove",c);G.unbind("mouseup",r);G.unbind("selectstart",k);M.css("cursor","");s&&(s.removeClass(d.node.TMPTARGET_TREE),u&&v("#"+u+d.id.A,s).removeClass(d.node.TMPTARGET_NODE+"_"+d.move.TYPE_PREV).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_NEXT).removeClass(d.node.TMPTARGET_NODE+"_"+J.move.TYPE_INNER));g.showIfameMask(e,!1);t.showHoverDom=!0;if(B.dragFlag!=0){B.dragFlag=0;var a,i,j;for(a=0,i=l.length;a<i;a++)j=l[a],j.isParent&&B.dragNodeShowBefore[j.tId]&&!j.open&&(f.expandCollapseNode(e, | |
| 27 | +j,!j.open),delete B.dragNodeShowBefore[j.tId]);D&&D.remove();A&&A.remove();var p=(b.ctrlKey||b.metaKey)&&e.edit.drag.isMove&&e.edit.drag.isCopy||!e.edit.drag.isMove&&e.edit.drag.isCopy;!p&&s&&u&&l[0].parentTId&&u==l[0].parentTId&&w==d.move.TYPE_INNER&&(s=null);if(s){var q=u==null?null:m.getNodeCache(h,u);if(g.apply(e.callback.beforeDrop,[h.treeId,l,q,w,p],!0)==!1)f.selectNodes(x,l);else{var C=p?g.clone(l):l;a=function(){if(K){if(!p)for(var a=0,c=l.length;a<c;a++)f.removeNode(e,l[a]);w==d.move.TYPE_INNER? | |
| 28 | +f.addNodes(h,q,-1,C):f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C)}else if(p&&w==d.move.TYPE_INNER)f.addNodes(h,q,-1,C);else if(p)f.addNodes(h,q.getParentNode(),w==d.move.TYPE_PREV?q.getIndex():q.getIndex()+1,C);else if(w!=d.move.TYPE_NEXT)for(a=0,c=C.length;a<c;a++)f.moveNode(h,q,C[a],w,!1);else for(a=-1,c=C.length-1;a<c;c--)f.moveNode(h,q,C[c],w,!1);f.selectNodes(h,C);a=o(C[0],e).get(0);f.scrollIntoView(a);e.treeObj.trigger(d.event.DROP,[b,h.treeId,C,q,w,p])}; | |
| 29 | +w==d.move.TYPE_INNER&&g.canAsync(h,q)?f.asyncNode(h,q,!1,a):a()}}else f.selectNodes(x,l),e.treeObj.trigger(d.event.DROP,[b,e.treeId,l,null,null,null])}}function k(){return!1}var i,j,e=m.getSetting(b.data.treeId),B=m.getRoot(e),t=m.getRoots();if(b.button==2||!e.edit.enable||!e.edit.drag.isCopy&&!e.edit.drag.isMove)return!0;var p=b.target,q=m.getRoot(e).curSelectedList,l=[];if(m.isSelectedNode(e,a))for(i=0,j=q.length;i<j;i++){if(q[i].editNameFlag&&g.eqs(p.tagName,"input")&&p.getAttribute("treeNode"+ | |
| 30 | +d.id.INPUT)!==null)return!0;l.push(q[i]);if(l[0].parentTId!==q[i].parentTId){l=[a];break}}else l=[a];f.editNodeBlur=!0;f.cancelCurEditNode(e);var G=v(e.treeObj.get(0).ownerDocument),M=v(e.treeObj.get(0).ownerDocument.body),D,A,s,K=!1,h=e,x=e,I,R,T=null,U=null,u=null,w=d.move.TYPE_INNER,O=b.clientX,P=b.clientY,L=(new Date).getTime();g.uCanDo(e)&&G.bind("mousemove",c);G.bind("mouseup",r);G.bind("selectstart",k);b.preventDefault&&b.preventDefault();return!0}};v.extend(!0,v.fn.zTree.consts,J);v.extend(!0, | |
| 31 | +v.fn.zTree._z,{tools:{getAbs:function(b){b=b.getBoundingClientRect();return[b.left+(document.body.scrollLeft+document.documentElement.scrollLeft),b.top+(document.body.scrollTop+document.documentElement.scrollTop)]},inputFocus:function(b){b.get(0)&&(b.focus(),g.setCursorPosition(b.get(0),b.val().length))},inputSelect:function(b){b.get(0)&&(b.focus(),b.select())},setCursorPosition:function(b,a){if(b.setSelectionRange)b.focus(),b.setSelectionRange(a,a);else if(b.createTextRange){var c=b.createTextRange(); | |
| 32 | +c.collapse(!0);c.moveEnd("character",a);c.moveStart("character",a);c.select()}},showIfameMask:function(b,a){for(var c=m.getRoot(b);c.dragMaskList.length>0;)c.dragMaskList[0].remove(),c.dragMaskList.shift();if(a)for(var d=o("iframe",b),f=0,i=d.length;f<i;f++){var j=d.get(f),e=g.getAbs(j),j=o("<div id='zTreeMask_"+f+"' class='zTreeMask' style='top:"+e[1]+"px; left:"+e[0]+"px; width:"+j.offsetWidth+"px; height:"+j.offsetHeight+"px;'></div>",b);j.appendTo(o("body",b));c.dragMaskList.push(j)}}},view:{addEditBtn:function(b, | |
| 33 | +a){if(!(a.editNameFlag||o(a,d.id.EDIT,b).length>0)&&g.apply(b.edit.showRenameBtn,[b.treeId,a],b.edit.showRenameBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" edit' id='"+a.tId+d.id.EDIT+"' title='"+g.apply(b.edit.renameTitle,[b.treeId,a],b.edit.renameTitle)+"' treeNode"+d.id.EDIT+" style='display:none;'></span>";c.append(r);o(a,d.id.EDIT,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeEditName,[b.treeId,a],!0)==!1)return!1;f.editNode(b,a);return!1}).show()}}, | |
| 34 | +addRemoveBtn:function(b,a){if(!(a.editNameFlag||o(a,d.id.REMOVE,b).length>0)&&g.apply(b.edit.showRemoveBtn,[b.treeId,a],b.edit.showRemoveBtn)){var c=o(a,d.id.A,b),r="<span class='"+d.className.BUTTON+" remove' id='"+a.tId+d.id.REMOVE+"' title='"+g.apply(b.edit.removeTitle,[b.treeId,a],b.edit.removeTitle)+"' treeNode"+d.id.REMOVE+" style='display:none;'></span>";c.append(r);o(a,d.id.REMOVE,b).bind("click",function(){if(!g.uCanDo(b)||g.apply(b.callback.beforeRemove,[b.treeId,a],!0)==!1)return!1;f.removeNode(b, | |
| 35 | +a);b.treeObj.trigger(d.event.REMOVE,[b.treeId,a]);return!1}).bind("mousedown",function(){return!0}).show()}},addHoverDom:function(b,a){if(m.getRoots().showHoverDom)a.isHover=!0,b.edit.enable&&(f.addEditBtn(b,a),f.addRemoveBtn(b,a)),g.apply(b.view.addHoverDom,[b.treeId,a])},cancelCurEditNode:function(b,a,c){var r=m.getRoot(b),k=b.data.key.name,i=r.curEditNode;if(i){var j=r.curEditInput,a=a?a:c?i[k]:j.val();if(g.apply(b.callback.beforeRename,[b.treeId,i,a,c],!0)===!1)return!1;i[k]=a;o(i,d.id.A,b).removeClass(d.node.CURSELECTED_EDIT); | |
| 36 | +j.unbind();f.setNodeName(b,i);i.editNameFlag=!1;r.curEditNode=null;r.curEditInput=null;f.selectNode(b,i,!1);b.treeObj.trigger(d.event.RENAME,[b.treeId,i,c])}return r.noSelection=!0},editNode:function(b,a){var c=m.getRoot(b);f.editNodeBlur=!1;if(m.isSelectedNode(b,a)&&c.curEditNode==a&&a.editNameFlag)setTimeout(function(){g.inputFocus(c.curEditInput)},0);else{var r=b.data.key.name;a.editNameFlag=!0;f.removeTreeDom(b,a);f.cancelCurEditNode(b);f.selectNode(b,a,!1);o(a,d.id.SPAN,b).html("<input type=text class='rename' id='"+ | |
| 37 | +a.tId+d.id.INPUT+"' treeNode"+d.id.INPUT+" >");var k=o(a,d.id.INPUT,b);k.attr("value",a[r]);b.edit.editNameSelectAll?g.inputSelect(k):g.inputFocus(k);k.bind("blur",function(){f.editNodeBlur||f.cancelCurEditNode(b)}).bind("keydown",function(a){a.keyCode=="13"?(f.editNodeBlur=!0,f.cancelCurEditNode(b)):a.keyCode=="27"&&f.cancelCurEditNode(b,null,!0)}).bind("click",function(){return!1}).bind("dblclick",function(){return!1});o(a,d.id.A,b).addClass(d.node.CURSELECTED_EDIT);c.curEditInput=k;c.noSelection= | |
| 38 | +!1;c.curEditNode=a}},moveNode:function(b,a,c,r,k,i){var j=m.getRoot(b),e=b.data.key.children;if(a!=c&&(!b.data.keep.leaf||!a||a.isParent||r!=d.move.TYPE_INNER)){var g=c.parentTId?c.getParentNode():j,t=a===null||a==j;t&&a===null&&(a=j);if(t)r=d.move.TYPE_INNER;j=a.parentTId?a.getParentNode():j;if(r!=d.move.TYPE_PREV&&r!=d.move.TYPE_NEXT)r=d.move.TYPE_INNER;if(r==d.move.TYPE_INNER)if(t)c.parentTId=null;else{if(!a.isParent)a.isParent=!0,a.open=!!a.open,f.setNodeLineIcos(b,a);c.parentTId=a.tId}var p; | |
| 39 | +t?p=t=b.treeObj:(!i&&r==d.move.TYPE_INNER?f.expandCollapseNode(b,a,!0,!1):i||f.expandCollapseNode(b,a.getParentNode(),!0,!1),t=o(a,b),p=o(a,d.id.UL,b),t.get(0)&&!p.get(0)&&(p=[],f.makeUlHtml(b,a,p,""),t.append(p.join(""))),p=o(a,d.id.UL,b));var q=o(c,b);q.get(0)?t.get(0)||q.remove():q=f.appendNodes(b,c.level,[c],null,-1,!1,!0).join("");p.get(0)&&r==d.move.TYPE_INNER?p.append(q):t.get(0)&&r==d.move.TYPE_PREV?t.before(q):t.get(0)&&r==d.move.TYPE_NEXT&&t.after(q);var l=-1,v=0,x=null,t=null,D=c.level; | |
| 40 | +if(c.isFirstNode){if(l=0,g[e].length>1)x=g[e][1],x.isFirstNode=!0}else if(c.isLastNode)l=g[e].length-1,x=g[e][l-1],x.isLastNode=!0;else for(p=0,q=g[e].length;p<q;p++)if(g[e][p].tId==c.tId){l=p;break}l>=0&&g[e].splice(l,1);if(r!=d.move.TYPE_INNER)for(p=0,q=j[e].length;p<q;p++)j[e][p].tId==a.tId&&(v=p);if(r==d.move.TYPE_INNER){a[e]||(a[e]=[]);if(a[e].length>0)t=a[e][a[e].length-1],t.isLastNode=!1;a[e].splice(a[e].length,0,c);c.isLastNode=!0;c.isFirstNode=a[e].length==1}else a.isFirstNode&&r==d.move.TYPE_PREV? | |
| 41 | +(j[e].splice(v,0,c),t=a,t.isFirstNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!0,c.isLastNode=!1):a.isLastNode&&r==d.move.TYPE_NEXT?(j[e].splice(v+1,0,c),t=a,t.isLastNode=!1,c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!0):(r==d.move.TYPE_PREV?j[e].splice(v,0,c):j[e].splice(v+1,0,c),c.parentTId=a.parentTId,c.isFirstNode=!1,c.isLastNode=!1);m.fixPIdKeyValue(b,c);m.setSonNodeLevel(b,c.getParentNode(),c);f.setNodeLineIcos(b,c);f.repairNodeLevelClass(b,c,D);!b.data.keep.parent&&g[e].length< | |
| 42 | +1?(g.isParent=!1,g.open=!1,a=o(g,d.id.UL,b),r=o(g,d.id.SWITCH,b),e=o(g,d.id.ICON,b),f.replaceSwitchClass(g,r,d.folder.DOCU),f.replaceIcoClass(g,e,d.folder.DOCU),a.css("display","none")):x&&f.setNodeLineIcos(b,x);t&&f.setNodeLineIcos(b,t);b.check&&b.check.enable&&f.repairChkClass&&(f.repairChkClass(b,g),f.repairParentChkClassWithSelf(b,g),g!=c.parent&&f.repairParentChkClassWithSelf(b,c));i||f.expandCollapseParentNode(b,c.getParentNode(),!0,k)}},removeEditBtn:function(b,a){o(a,d.id.EDIT,b).unbind().remove()}, | |
| 43 | +removeRemoveBtn:function(b,a){o(a,d.id.REMOVE,b).unbind().remove()},removeTreeDom:function(b,a){a.isHover=!1;f.removeEditBtn(b,a);f.removeRemoveBtn(b,a);g.apply(b.view.removeHoverDom,[b.treeId,a])},repairNodeLevelClass:function(b,a,c){if(c!==a.level){var f=o(a,b),g=o(a,d.id.A,b),b=o(a,d.id.UL,b),c=d.className.LEVEL+c,a=d.className.LEVEL+a.level;f.removeClass(c);f.addClass(a);g.removeClass(c);g.addClass(a);b.removeClass(c);b.addClass(a)}},selectNodes:function(b,a){for(var c=0,d=a.length;c<d;c++)f.selectNode(b, | |
| 44 | +a[c],c>0)}},event:{},data:{setSonNodeLevel:function(b,a,c){if(c){var d=b.data.key.children;c.level=a?a.level+1:0;if(c[d])for(var a=0,f=c[d].length;a<f;a++)c[d][a]&&m.setSonNodeLevel(b,c,c[d][a])}}}});var I=v.fn.zTree,g=I._z.tools,d=I.consts,f=I._z.view,m=I._z.data,o=g.$;m.exSetting({edit:{enable:!1,editNameSelectAll:!1,showRemoveBtn:!0,showRenameBtn:!0,removeTitle:"remove",renameTitle:"rename",drag:{autoExpandTrigger:!1,isCopy:!0,isMove:!0,prev:!0,next:!0,inner:!0,minMoveSize:5,borderMax:10,borderMin:-5, | |
| 45 | +maxShowNodeNum:5,autoOpenTime:500}},view:{addHoverDom:null,removeHoverDom:null},callback:{beforeDrag:null,beforeDragOpen:null,beforeDrop:null,beforeEditName:null,beforeRename:null,onDrag:null,onDragMove:null,onDrop:null,onRename:null}});m.addInitBind(function(b){var a=b.treeObj,c=d.event;a.bind(c.RENAME,function(a,c,d,f){g.apply(b.callback.onRename,[a,c,d,f])});a.bind(c.DRAG,function(a,c,d,f){g.apply(b.callback.onDrag,[c,d,f])});a.bind(c.DRAGMOVE,function(a,c,d,f){g.apply(b.callback.onDragMove,[c, | |
| 46 | +d,f])});a.bind(c.DROP,function(a,c,d,f,e,m,o){g.apply(b.callback.onDrop,[c,d,f,e,m,o])})});m.addInitUnBind(function(b){var b=b.treeObj,a=d.event;b.unbind(a.RENAME);b.unbind(a.DRAG);b.unbind(a.DRAGMOVE);b.unbind(a.DROP)});m.addInitCache(function(){});m.addInitNode(function(b,a,c){if(c)c.isHover=!1,c.editNameFlag=!1});m.addInitProxy(function(b){var a=b.target,c=m.getSetting(b.data.treeId),f=b.relatedTarget,k="",i=null,j="",e=null,o=null;if(g.eqs(b.type,"mouseover")){if(o=g.getMDom(c,a,[{tagName:"a", | |
| 47 | +attrName:"treeNode"+d.id.A}]))k=g.getNodeMainDom(o).id,j="hoverOverNode"}else if(g.eqs(b.type,"mouseout"))o=g.getMDom(c,f,[{tagName:"a",attrName:"treeNode"+d.id.A}]),o||(k="remove",j="hoverOutNode");else if(g.eqs(b.type,"mousedown")&&(o=g.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+d.id.A}])))k=g.getNodeMainDom(o).id,j="mousedownNode";if(k.length>0)switch(i=m.getNodeCache(c,k),j){case "mousedownNode":e=x.onMousedownNode;break;case "hoverOverNode":e=x.onHoverOverNode;break;case "hoverOutNode":e= | |
| 48 | +x.onHoverOutNode}return{stop:!1,node:i,nodeEventType:j,nodeEventCallback:e,treeEventType:"",treeEventCallback:null}});m.addInitRoot(function(b){var b=m.getRoot(b),a=m.getRoots();b.curEditNode=null;b.curEditInput=null;b.curHoverNode=null;b.dragFlag=0;b.dragNodeShowBefore=[];b.dragMaskList=[];a.showHoverDom=!0});m.addZTreeTools(function(b,a){a.cancelEditName=function(a){m.getRoot(this.setting).curEditNode&&f.cancelCurEditNode(this.setting,a?a:null,!0)};a.copyNode=function(a,b,k,i){if(!b)return null; | |
| 49 | +if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;var j=this,e=g.clone(b);if(!a)a=null,k=d.move.TYPE_INNER;k==d.move.TYPE_INNER?(b=function(){f.addNodes(j.setting,a,-1,[e],i)},g.canAsync(this.setting,a)?f.asyncNode(this.setting,a,i,b):b()):(f.addNodes(this.setting,a.parentNode,-1,[e],i),f.moveNode(this.setting,a,e,k,!1,i));return e};a.editName=function(a){a&&a.tId&&a===m.getNodeCache(this.setting,a.tId)&&(a.parentTId&&f.expandCollapseParentNode(this.setting,a.getParentNode(), | |
| 50 | +!0),f.editNode(this.setting,a))};a.moveNode=function(a,b,k,i){function j(){f.moveNode(e.setting,a,b,k,!1,i)}if(!b)return b;if(a&&!a.isParent&&this.setting.data.keep.leaf&&k===d.move.TYPE_INNER)return null;else if(a&&(b.parentTId==a.tId&&k==d.move.TYPE_INNER||o(b,this.setting).find("#"+a.tId).length>0))return null;else a||(a=null);var e=this;g.canAsync(this.setting,a)&&k===d.move.TYPE_INNER?f.asyncNode(this.setting,a,i,j):j();return b};a.setEditable=function(a){this.setting.edit.enable=a;return this.refresh()}}); | |
| 51 | +var O=f.cancelPreSelectedNode;f.cancelPreSelectedNode=function(b,a){for(var c=m.getRoot(b).curSelectedList,d=0,g=c.length;d<g;d++)if(!a||a===c[d])if(f.removeTreeDom(b,c[d]),a)break;O&&O.apply(f,arguments)};var P=f.createNodes;f.createNodes=function(b,a,c,d,g){P&&P.apply(f,arguments);c&&f.repairParentChkClassWithSelf&&f.repairParentChkClassWithSelf(b,d)};var W=f.makeNodeUrl;f.makeNodeUrl=function(b,a){return b.edit.enable?null:W.apply(f,arguments)};var L=f.removeNode;f.removeNode=function(b,a){var c= | |
| 52 | +m.getRoot(b);if(c.curEditNode===a)c.curEditNode=null;L&&L.apply(f,arguments)};var Q=f.selectNode;f.selectNode=function(b,a,c){var d=m.getRoot(b);if(m.isSelectedNode(b,a)&&d.curEditNode==a&&a.editNameFlag)return!1;Q&&Q.apply(f,arguments);f.addHoverDom(b,a);return!0};var V=g.uCanDo;g.uCanDo=function(b,a){var c=m.getRoot(b);if(a&&(g.eqs(a.type,"mouseover")||g.eqs(a.type,"mouseout")||g.eqs(a.type,"mousedown")||g.eqs(a.type,"mouseup")))return!0;if(c.curEditNode)f.editNodeBlur=!1,c.curEditInput.focus(); | |
| 53 | +return!c.curEditNode&&(V?V.apply(f,arguments):!0)}})(jQuery); | ... | ... |
src/main/resources/static/assets/plugins/ztree_v3/js/jquery.ztree.exhide.min.js
| 1 | -/* | |
| 2 | - * JQuery zTree exHideNodes v3.5.29 | |
| 3 | - * http://treejs.cn/ | |
| 4 | - * | |
| 5 | - * Copyright (c) 2010 Hunter.z | |
| 6 | - * | |
| 7 | - * Licensed same as jquery - MIT License | |
| 8 | - * http://www.opensource.org/licenses/mit-license.php | |
| 9 | - * | |
| 10 | - * email: hunter.z@263.net | |
| 11 | - * Date: 2017-06-19 | |
| 12 | - */ | |
| 13 | -(function(i){i.extend(!0,i.fn.zTree._z,{view:{clearOldFirstNode:function(c,a){for(var b=a.getNextNode();b;){if(b.isFirstNode){b.isFirstNode=!1;d.setNodeLineIcos(c,b);break}if(b.isLastNode)break;b=b.getNextNode()}},clearOldLastNode:function(c,a,b){for(a=a.getPreNode();a;){if(a.isLastNode){a.isLastNode=!1;b&&d.setNodeLineIcos(c,a);break}if(a.isFirstNode)break;a=a.getPreNode()}},makeDOMNodeMainBefore:function(c,a,b){c.push("<li ",b.isHidden?"style='display:none;' ":"","id='",b.tId,"' class='",l.className.LEVEL, | |
| 14 | -b.level,"' tabindex='0' hidefocus='true' treenode>")},showNode:function(c,a){a.isHidden=!1;f.initShowForExCheck(c,a);j(a,c).show()},showNodes:function(c,a,b){if(a&&a.length!=0){var e={},g,k;for(g=0,k=a.length;g<k;g++){var h=a[g];if(!e[h.parentTId]){var i=h.getParentNode();e[h.parentTId]=i===null?f.getRoot(c):h.getParentNode()}d.showNode(c,h,b)}for(var j in e)a=e[j][c.data.key.children],d.setFirstNodeForShow(c,a),d.setLastNodeForShow(c,a)}},hideNode:function(c,a){a.isHidden=!0;a.isFirstNode=!1;a.isLastNode= | |
| 15 | -!1;f.initHideForExCheck(c,a);d.cancelPreSelectedNode(c,a);j(a,c).hide()},hideNodes:function(c,a,b){if(a&&a.length!=0){var e={},g,k;for(g=0,k=a.length;g<k;g++){var h=a[g];if((h.isFirstNode||h.isLastNode)&&!e[h.parentTId]){var i=h.getParentNode();e[h.parentTId]=i===null?f.getRoot(c):h.getParentNode()}d.hideNode(c,h,b)}for(var j in e)a=e[j][c.data.key.children],d.setFirstNodeForHide(c,a),d.setLastNodeForHide(c,a)}},setFirstNode:function(c,a){var b=c.data.key.children,e=a[b].length;e>0&&!a[b][0].isHidden? | |
| 16 | -a[b][0].isFirstNode=!0:e>0&&d.setFirstNodeForHide(c,a[b])},setLastNode:function(c,a){var b=c.data.key.children,e=a[b].length;e>0&&!a[b][0].isHidden?a[b][e-1].isLastNode=!0:e>0&&d.setLastNodeForHide(c,a[b])},setFirstNodeForHide:function(c,a){var b,e,g;for(e=0,g=a.length;e<g;e++){b=a[e];if(b.isFirstNode)break;if(!b.isHidden&&!b.isFirstNode){b.isFirstNode=!0;d.setNodeLineIcos(c,b);break}else b=null}return b},setFirstNodeForShow:function(c,a){var b,e,g,f,h;for(e=0,g=a.length;e<g;e++)if(b=a[e],!f&&!b.isHidden&& | |
| 17 | -b.isFirstNode){f=b;break}else if(!f&&!b.isHidden&&!b.isFirstNode)b.isFirstNode=!0,f=b,d.setNodeLineIcos(c,b);else if(f&&b.isFirstNode){b.isFirstNode=!1;h=b;d.setNodeLineIcos(c,b);break}return{"new":f,old:h}},setLastNodeForHide:function(c,a){var b,e;for(e=a.length-1;e>=0;e--){b=a[e];if(b.isLastNode)break;if(!b.isHidden&&!b.isLastNode){b.isLastNode=!0;d.setNodeLineIcos(c,b);break}else b=null}return b},setLastNodeForShow:function(c,a){var b,e,g,f;for(e=a.length-1;e>=0;e--)if(b=a[e],!g&&!b.isHidden&& | |
| 18 | -b.isLastNode){g=b;break}else if(!g&&!b.isHidden&&!b.isLastNode)b.isLastNode=!0,g=b,d.setNodeLineIcos(c,b);else if(g&&b.isLastNode){b.isLastNode=!1;f=b;d.setNodeLineIcos(c,b);break}return{"new":g,old:f}}},data:{initHideForExCheck:function(c,a){if(a.isHidden&&c.check&&c.check.enable){if(typeof a._nocheck=="undefined")a._nocheck=!!a.nocheck,a.nocheck=!0;a.check_Child_State=-1;d.repairParentChkClassWithSelf&&d.repairParentChkClassWithSelf(c,a)}},initShowForExCheck:function(c,a){if(!a.isHidden&&c.check&& | |
| 19 | -c.check.enable){if(typeof a._nocheck!="undefined")a.nocheck=a._nocheck,delete a._nocheck;if(d.setChkClass){var b=j(a,l.id.CHECK,c);d.setChkClass(c,b,a)}d.repairParentChkClassWithSelf&&d.repairParentChkClassWithSelf(c,a)}}}});var i=i.fn.zTree,m=i._z.tools,l=i.consts,d=i._z.view,f=i._z.data,j=m.$;f.addInitNode(function(c,a,b){if(typeof b.isHidden=="string")b.isHidden=m.eqs(b.isHidden,"true");b.isHidden=!!b.isHidden;f.initHideForExCheck(c,b)});f.addBeforeA(function(){});f.addZTreeTools(function(c,a){a.showNodes= | |
| 20 | -function(a,b){d.showNodes(c,a,b)};a.showNode=function(a,b){a&&d.showNodes(c,[a],b)};a.hideNodes=function(a,b){d.hideNodes(c,a,b)};a.hideNode=function(a,b){a&&d.hideNodes(c,[a],b)};var b=a.checkNode;if(b)a.checkNode=function(c,d,f,h){(!c||!c.isHidden)&&b.apply(a,arguments)}});var n=f.initNode;f.initNode=function(c,a,b,e,g,i,h){var j=(e?e:f.getRoot(c))[c.data.key.children];f.tmpHideFirstNode=d.setFirstNodeForHide(c,j);f.tmpHideLastNode=d.setLastNodeForHide(c,j);h&&(d.setNodeLineIcos(c,f.tmpHideFirstNode), | |
| 21 | -d.setNodeLineIcos(c,f.tmpHideLastNode));g=f.tmpHideFirstNode===b;i=f.tmpHideLastNode===b;n&&n.apply(f,arguments);h&&i&&d.clearOldLastNode(c,b,h)};var o=f.makeChkFlag;if(o)f.makeChkFlag=function(c,a){(!a||!a.isHidden)&&o.apply(f,arguments)};var p=f.getTreeCheckedNodes;if(p)f.getTreeCheckedNodes=function(c,a,b,e){if(a&&a.length>0){var d=a[0].getParentNode();if(d&&d.isHidden)return[]}return p.apply(f,arguments)};var q=f.getTreeChangeCheckedNodes;if(q)f.getTreeChangeCheckedNodes=function(c,a,b){if(a&& | |
| 22 | -a.length>0){var d=a[0].getParentNode();if(d&&d.isHidden)return[]}return q.apply(f,arguments)};var r=d.expandCollapseSonNode;if(r)d.expandCollapseSonNode=function(c,a,b,e,f){(!a||!a.isHidden)&&r.apply(d,arguments)};var s=d.setSonNodeCheckBox;if(s)d.setSonNodeCheckBox=function(c,a,b,e){(!a||!a.isHidden)&&s.apply(d,arguments)};var t=d.repairParentChkClassWithSelf;if(t)d.repairParentChkClassWithSelf=function(c,a){(!a||!a.isHidden)&&t.apply(d,arguments)}})(jQuery); | |
| 1 | +/* | |
| 2 | + * JQuery zTree exHideNodes v3.5.29 | |
| 3 | + * http://treejs.cn/ | |
| 4 | + * | |
| 5 | + * Copyright (c) 2010 Hunter.z | |
| 6 | + * | |
| 7 | + * Licensed same as jquery - MIT License | |
| 8 | + * http://www.opensource.org/licenses/mit-license.php | |
| 9 | + * | |
| 10 | + * email: hunter.z@263.net | |
| 11 | + * Date: 2017-06-19 | |
| 12 | + */ | |
| 13 | +(function(i){i.extend(!0,i.fn.zTree._z,{view:{clearOldFirstNode:function(c,a){for(var b=a.getNextNode();b;){if(b.isFirstNode){b.isFirstNode=!1;d.setNodeLineIcos(c,b);break}if(b.isLastNode)break;b=b.getNextNode()}},clearOldLastNode:function(c,a,b){for(a=a.getPreNode();a;){if(a.isLastNode){a.isLastNode=!1;b&&d.setNodeLineIcos(c,a);break}if(a.isFirstNode)break;a=a.getPreNode()}},makeDOMNodeMainBefore:function(c,a,b){c.push("<li ",b.isHidden?"style='display:none;' ":"","id='",b.tId,"' class='",l.className.LEVEL, | |
| 14 | +b.level,"' tabindex='0' hidefocus='true' treenode>")},showNode:function(c,a){a.isHidden=!1;f.initShowForExCheck(c,a);j(a,c).show()},showNodes:function(c,a,b){if(a&&a.length!=0){var e={},g,k;for(g=0,k=a.length;g<k;g++){var h=a[g];if(!e[h.parentTId]){var i=h.getParentNode();e[h.parentTId]=i===null?f.getRoot(c):h.getParentNode()}d.showNode(c,h,b)}for(var j in e)a=e[j][c.data.key.children],d.setFirstNodeForShow(c,a),d.setLastNodeForShow(c,a)}},hideNode:function(c,a){a.isHidden=!0;a.isFirstNode=!1;a.isLastNode= | |
| 15 | +!1;f.initHideForExCheck(c,a);d.cancelPreSelectedNode(c,a);j(a,c).hide()},hideNodes:function(c,a,b){if(a&&a.length!=0){var e={},g,k;for(g=0,k=a.length;g<k;g++){var h=a[g];if((h.isFirstNode||h.isLastNode)&&!e[h.parentTId]){var i=h.getParentNode();e[h.parentTId]=i===null?f.getRoot(c):h.getParentNode()}d.hideNode(c,h,b)}for(var j in e)a=e[j][c.data.key.children],d.setFirstNodeForHide(c,a),d.setLastNodeForHide(c,a)}},setFirstNode:function(c,a){var b=c.data.key.children,e=a[b].length;e>0&&!a[b][0].isHidden? | |
| 16 | +a[b][0].isFirstNode=!0:e>0&&d.setFirstNodeForHide(c,a[b])},setLastNode:function(c,a){var b=c.data.key.children,e=a[b].length;e>0&&!a[b][0].isHidden?a[b][e-1].isLastNode=!0:e>0&&d.setLastNodeForHide(c,a[b])},setFirstNodeForHide:function(c,a){var b,e,g;for(e=0,g=a.length;e<g;e++){b=a[e];if(b.isFirstNode)break;if(!b.isHidden&&!b.isFirstNode){b.isFirstNode=!0;d.setNodeLineIcos(c,b);break}else b=null}return b},setFirstNodeForShow:function(c,a){var b,e,g,f,h;for(e=0,g=a.length;e<g;e++)if(b=a[e],!f&&!b.isHidden&& | |
| 17 | +b.isFirstNode){f=b;break}else if(!f&&!b.isHidden&&!b.isFirstNode)b.isFirstNode=!0,f=b,d.setNodeLineIcos(c,b);else if(f&&b.isFirstNode){b.isFirstNode=!1;h=b;d.setNodeLineIcos(c,b);break}return{"new":f,old:h}},setLastNodeForHide:function(c,a){var b,e;for(e=a.length-1;e>=0;e--){b=a[e];if(b.isLastNode)break;if(!b.isHidden&&!b.isLastNode){b.isLastNode=!0;d.setNodeLineIcos(c,b);break}else b=null}return b},setLastNodeForShow:function(c,a){var b,e,g,f;for(e=a.length-1;e>=0;e--)if(b=a[e],!g&&!b.isHidden&& | |
| 18 | +b.isLastNode){g=b;break}else if(!g&&!b.isHidden&&!b.isLastNode)b.isLastNode=!0,g=b,d.setNodeLineIcos(c,b);else if(g&&b.isLastNode){b.isLastNode=!1;f=b;d.setNodeLineIcos(c,b);break}return{"new":g,old:f}}},data:{initHideForExCheck:function(c,a){if(a.isHidden&&c.check&&c.check.enable){if(typeof a._nocheck=="undefined")a._nocheck=!!a.nocheck,a.nocheck=!0;a.check_Child_State=-1;d.repairParentChkClassWithSelf&&d.repairParentChkClassWithSelf(c,a)}},initShowForExCheck:function(c,a){if(!a.isHidden&&c.check&& | |
| 19 | +c.check.enable){if(typeof a._nocheck!="undefined")a.nocheck=a._nocheck,delete a._nocheck;if(d.setChkClass){var b=j(a,l.id.CHECK,c);d.setChkClass(c,b,a)}d.repairParentChkClassWithSelf&&d.repairParentChkClassWithSelf(c,a)}}}});var i=i.fn.zTree,m=i._z.tools,l=i.consts,d=i._z.view,f=i._z.data,j=m.$;f.addInitNode(function(c,a,b){if(typeof b.isHidden=="string")b.isHidden=m.eqs(b.isHidden,"true");b.isHidden=!!b.isHidden;f.initHideForExCheck(c,b)});f.addBeforeA(function(){});f.addZTreeTools(function(c,a){a.showNodes= | |
| 20 | +function(a,b){d.showNodes(c,a,b)};a.showNode=function(a,b){a&&d.showNodes(c,[a],b)};a.hideNodes=function(a,b){d.hideNodes(c,a,b)};a.hideNode=function(a,b){a&&d.hideNodes(c,[a],b)};var b=a.checkNode;if(b)a.checkNode=function(c,d,f,h){(!c||!c.isHidden)&&b.apply(a,arguments)}});var n=f.initNode;f.initNode=function(c,a,b,e,g,i,h){var j=(e?e:f.getRoot(c))[c.data.key.children];f.tmpHideFirstNode=d.setFirstNodeForHide(c,j);f.tmpHideLastNode=d.setLastNodeForHide(c,j);h&&(d.setNodeLineIcos(c,f.tmpHideFirstNode), | |
| 21 | +d.setNodeLineIcos(c,f.tmpHideLastNode));g=f.tmpHideFirstNode===b;i=f.tmpHideLastNode===b;n&&n.apply(f,arguments);h&&i&&d.clearOldLastNode(c,b,h)};var o=f.makeChkFlag;if(o)f.makeChkFlag=function(c,a){(!a||!a.isHidden)&&o.apply(f,arguments)};var p=f.getTreeCheckedNodes;if(p)f.getTreeCheckedNodes=function(c,a,b,e){if(a&&a.length>0){var d=a[0].getParentNode();if(d&&d.isHidden)return[]}return p.apply(f,arguments)};var q=f.getTreeChangeCheckedNodes;if(q)f.getTreeChangeCheckedNodes=function(c,a,b){if(a&& | |
| 22 | +a.length>0){var d=a[0].getParentNode();if(d&&d.isHidden)return[]}return q.apply(f,arguments)};var r=d.expandCollapseSonNode;if(r)d.expandCollapseSonNode=function(c,a,b,e,f){(!a||!a.isHidden)&&r.apply(d,arguments)};var s=d.setSonNodeCheckBox;if(s)d.setSonNodeCheckBox=function(c,a,b,e){(!a||!a.isHidden)&&s.apply(d,arguments)};var t=d.repairParentChkClassWithSelf;if(t)d.repairParentChkClassWithSelf=function(c,a){(!a||!a.isHidden)&&t.apply(d,arguments)}})(jQuery); | ... | ... |
src/main/resources/static/pages/permission/authorize_all/authorize.html
| 1 | -<!DOCTYPE html> | |
| 2 | -<html lang="zh-cn"> | |
| 3 | - | |
| 4 | -<head> | |
| 5 | - <meta charset="UTF-8"> | |
| 6 | - <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/> | |
| 7 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | |
| 8 | - <link rel="stylesheet" href="/assets/plugins/ztree_v3/css/zTreeStyle/zTreeStyle.css" /> | |
| 9 | - <style> | |
| 10 | - html,body{ | |
| 11 | - height: 100%; | |
| 12 | - } | |
| 13 | - .ct_page{ | |
| 14 | - padding: 25px 15px; | |
| 15 | - height: 100%; | |
| 16 | - height: calc(100% - 50px); | |
| 17 | - } | |
| 18 | - | |
| 19 | - .ct_cont{ | |
| 20 | - height: calc(100% - 41px); | |
| 21 | - } | |
| 22 | - | |
| 23 | - .ct_cont>div>div.uk-card{ | |
| 24 | - height: 99%; | |
| 25 | - } | |
| 26 | - | |
| 27 | - form .uk-inline{ | |
| 28 | - width: calc(100% - 4px); | |
| 29 | - margin-left: 2px; | |
| 30 | - } | |
| 31 | - | |
| 32 | - .ct-card-body{ | |
| 33 | - overflow: auto; | |
| 34 | - padding: 1px 1px 0 2px; | |
| 35 | - height: calc(100% - 54px); | |
| 36 | - position: relative; | |
| 37 | - margin-top: -12px; | |
| 38 | - } | |
| 39 | - | |
| 40 | - .ct_li_desc{ | |
| 41 | - color: #a8a8a8; | |
| 42 | - font-size: 13px; | |
| 43 | - } | |
| 44 | - | |
| 45 | - .ct-card-body .uk-list-large{ | |
| 46 | - font-size: 14px; | |
| 47 | - } | |
| 48 | - | |
| 49 | - .ct-card-body .uk-list-large>li{ | |
| 50 | - cursor: default; | |
| 51 | - padding-left: 20px; | |
| 52 | - margin-top: 2px !important; | |
| 53 | - padding-top: 17px !important; | |
| 54 | - position: relative; | |
| 55 | - } | |
| 56 | - | |
| 57 | - .ct-card-body .uk-list-large>li:hover{ | |
| 58 | - background: #edecec; | |
| 59 | - } | |
| 60 | - | |
| 61 | - .ct-card-body .uk-list-large>li.active{ | |
| 62 | - background: #1e87f0 !important; | |
| 63 | - color: white; | |
| 64 | - } | |
| 65 | - | |
| 66 | - .ct-card-body .uk-list-large>li.active>span.role-code{ | |
| 67 | - color: #ffffff; | |
| 68 | - } | |
| 69 | - | |
| 70 | - .ct-card-body .uk-list-large.role-list>li:hover{ | |
| 71 | - background: #fff494; | |
| 72 | - } | |
| 73 | - | |
| 74 | - .ct-card-body .uk-list-large>li.active .ct_li_desc{ | |
| 75 | - color: #e6e6e6; | |
| 76 | - } | |
| 77 | - | |
| 78 | - .ct-card-body .uk-list-large>li>span.uk-badge{ | |
| 79 | - position: absolute; | |
| 80 | - top: 17px; | |
| 81 | - right: 25px; | |
| 82 | - } | |
| 83 | - | |
| 84 | - .ct-card-body .uk-list-large>li>span.role-code{ | |
| 85 | - padding: 4px 6px; | |
| 86 | - color: #a8a8a8; | |
| 87 | - margin-left: 5px; | |
| 88 | - } | |
| 89 | - | |
| 90 | - .top_title{ | |
| 91 | - padding: 9px 0 5px 15px; | |
| 92 | - border-bottom: 1px solid #ededed; | |
| 93 | - border-left: 5px solid #FFC107; | |
| 94 | - } | |
| 95 | - | |
| 96 | - .top_title>.desc{ | |
| 97 | - font-size: 13px; | |
| 98 | - color: grey; | |
| 99 | - margin-top: 3px; | |
| 100 | - } | |
| 101 | - | |
| 102 | - .left_menu_list{ | |
| 103 | - overflow: auto; | |
| 104 | - position: relative; | |
| 105 | - } | |
| 106 | - | |
| 107 | - .left_menu_list .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{ | |
| 108 | - opacity: 0.6 !important; | |
| 109 | - padding: 0 !important; | |
| 110 | - } | |
| 111 | - | |
| 112 | - ._company{ | |
| 113 | - margin: 15px 0px; | |
| 114 | - } | |
| 115 | - ._company>h5{ | |
| 116 | - margin-bottom: 10px; | |
| 117 | - font-size: 15px; | |
| 118 | - color: #6b6b6b; | |
| 119 | - text-indent: 12px; | |
| 120 | - } | |
| 121 | - ._company>._fgs>label{ | |
| 122 | - padding: 3px 12px 3px 10px; | |
| 123 | - display: inline-block; | |
| 124 | - border: 1px solid gainsboro; | |
| 125 | - border-radius: 2px; | |
| 126 | - margin: 5px; | |
| 127 | - font-size: 14px; | |
| 128 | - } | |
| 129 | - ._company>._fgs>label.active{ | |
| 130 | - background: #1e87f0; | |
| 131 | - color: #fff; | |
| 132 | - } | |
| 133 | - ._company .uk-checkbox:checked:focus, | |
| 134 | - .line_checkbox_list .uk-checkbox:checked:focus{ | |
| 135 | - background-color: #1e87f0 !important; | |
| 136 | - } | |
| 137 | - .save_icon{ | |
| 138 | - position: absolute; | |
| 139 | - right: 2px; | |
| 140 | - background: #bec4c9; | |
| 141 | - font-size: 12px; | |
| 142 | - padding: 2px 15px; | |
| 143 | - color: #fff; | |
| 144 | - box-shadow: 0 5px 15px rgba(0,0,0,0.08); | |
| 145 | - cursor: pointer; | |
| 146 | - } | |
| 147 | - .save_icon:hover{ | |
| 148 | - background: #FFC107; | |
| 149 | - } | |
| 150 | - .data_auth_list{ | |
| 151 | - position: relative; | |
| 152 | - } | |
| 153 | - #user_authorize_wrap .top_title{ | |
| 154 | - border-left: 5px solid #cacac8; | |
| 155 | - } | |
| 156 | - .xd_line_list{ | |
| 157 | - height: 37%; | |
| 158 | - padding: 7px; | |
| 159 | - border-bottom: 1px solid #f2f2f2; | |
| 160 | - overflow: auto; | |
| 161 | - position: relative; | |
| 162 | - } | |
| 163 | - .xd_line_list>h5{ | |
| 164 | - color: #858585; | |
| 165 | - margin: 5px 5px 5px 0; | |
| 166 | - font-size: 14px; | |
| 167 | - } | |
| 168 | - .sub_lines{ | |
| 169 | - padding-left: 15px; | |
| 170 | - } | |
| 171 | - .sub_lines>span.line_btn { | |
| 172 | - background: #00BCD4; | |
| 173 | - color: #fff; | |
| 174 | - padding: 4px 9px; | |
| 175 | - display: inline-block; | |
| 176 | - min-width: 68px; | |
| 177 | - text-align: center; | |
| 178 | - margin: 5px 2px; | |
| 179 | - box-shadow: 0 5px 9px rgba(0,0,0,0.08); | |
| 180 | - cursor: pointer; | |
| 181 | - font-size: 14px; | |
| 182 | - font-family: 微软雅黑; | |
| 183 | - } | |
| 184 | - .sub_lines>span.line_btn:hover{ | |
| 185 | - background: #2dd7ed; | |
| 186 | - } | |
| 187 | - .add_line_icon{ | |
| 188 | - cursor: pointer; | |
| 189 | - padding: 2px 5px; | |
| 190 | - border-radius: 5px; | |
| 191 | - display: inline-block; | |
| 192 | - } | |
| 193 | - .add_line_icon>i{ | |
| 194 | - vertical-align: top; | |
| 195 | - margin-top: 3px; | |
| 196 | - } | |
| 197 | - .add_line_icon:hover{ | |
| 198 | - background: #ededed; | |
| 199 | - } | |
| 200 | - .ct_pattern_form{ | |
| 201 | - display: inline-block; | |
| 202 | - } | |
| 203 | - .xd_menu_grid{ | |
| 204 | - padding: 25px 25px 0 25px; | |
| 205 | - height: calc(63% - 91px); | |
| 206 | - } | |
| 207 | - .xd_menu_grid .uk-list{ | |
| 208 | - border: 1px solid #ededed; | |
| 209 | - height: calc(100% - 70px); | |
| 210 | - overflow: auto; | |
| 211 | - position: relative; | |
| 212 | - } | |
| 213 | - | |
| 214 | - .xd_menu_grid .uk-list>li{ | |
| 215 | - margin: 5px 0 !important; | |
| 216 | - padding: 10px 0 0 10px !important; | |
| 217 | - font-size: 14px; | |
| 218 | - } | |
| 219 | - .top_tools{ | |
| 220 | - position: absolute; | |
| 221 | - top: 15px; | |
| 222 | - right: 25px; | |
| 223 | - } | |
| 224 | - .ct_field { | |
| 225 | - display: inline-block; | |
| 226 | - width: 240px; | |
| 227 | - } | |
| 228 | - .ct_field>select,.ct_field>input{ | |
| 229 | - width: calc(100% - 60px); | |
| 230 | - } | |
| 231 | - .line_checkbox_list{ | |
| 232 | - margin-top: 15px; | |
| 233 | - } | |
| 234 | - .line_checkbox_list>.btn{ | |
| 235 | - padding: 5px 7px; | |
| 236 | - border-radius: 2px; | |
| 237 | - display: inline-block; | |
| 238 | - margin: 4px 9px; | |
| 239 | - font-size: 14px; | |
| 240 | - font-family: 微软雅黑; | |
| 241 | - border: 1px solid #d9d9d9; | |
| 242 | - width: 100px; | |
| 243 | - overflow: hidden; | |
| 244 | - text-overflow: ellipsis; | |
| 245 | - white-space: nowrap; | |
| 246 | - } | |
| 247 | - .line_checkbox_list>.btn>input{ | |
| 248 | - margin-right: 5px; | |
| 249 | - } | |
| 250 | - .line_checkbox_list>.btn.active{ | |
| 251 | - background: #1e87f0; | |
| 252 | - color: #fff; | |
| 253 | - } | |
| 254 | - #role_authorize_wrap .ztree *{ | |
| 255 | - font-size: 14px; | |
| 256 | - } | |
| 257 | - #role_authorize_wrap .ztree li{ | |
| 258 | - line-height: 21px; | |
| 259 | - } | |
| 260 | - .loading{ | |
| 261 | - height: 100%; | |
| 262 | - text-align: center; | |
| 263 | - } | |
| 264 | - .loading .uk-spinner{ | |
| 265 | - margin-top: 200px; | |
| 266 | - } | |
| 267 | - .loading circle{ | |
| 268 | - stroke: red; | |
| 269 | - } | |
| 270 | - </style> | |
| 271 | -</head> | |
| 272 | - | |
| 273 | -<body> | |
| 274 | -<div class="loading"> | |
| 275 | - <div uk-spinner></div> | |
| 276 | -</div> | |
| 277 | -<div class="ct_page" style="display: none;"> | |
| 278 | - <h2 class="uk-heading-line uk-heading-bullet"><span>授权管理</span></h2> | |
| 279 | - <div class="ct_cont uk-grid-small uk-child-width-expand" uk-grid> | |
| 280 | - <div class="role_list uk-width-1-4 "> | |
| 281 | - <div class="uk-card uk-card-default"> | |
| 282 | - <form> | |
| 283 | - <div class="uk-margin"> | |
| 284 | - <div class="uk-inline" > | |
| 285 | - <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span> | |
| 286 | - <input class="uk-input role_search_input" type="text" placeholder="搜索角色"> | |
| 287 | - </div> | |
| 288 | - </div> | |
| 289 | - </form> | |
| 290 | - | |
| 291 | - <div class="ct-card-body" > | |
| 292 | - <ul class="uk-list uk-list-large uk-list-divider role-list"> | |
| 293 | - </ul> | |
| 294 | - </div> | |
| 295 | - </div> | |
| 296 | - </div> | |
| 297 | - <div class="user_list uk-width-1-5 "> | |
| 298 | - <div class="uk-card uk-card-default"> | |
| 299 | - <form> | |
| 300 | - <div class="uk-margin"> | |
| 301 | - <div class="uk-inline" > | |
| 302 | - <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span> | |
| 303 | - <input class="uk-input user_search_input" type="text" placeholder="搜索用户"> | |
| 304 | - </div> | |
| 305 | - </div> | |
| 306 | - </form> | |
| 307 | - | |
| 308 | - <div class="ct-card-body"> | |
| 309 | - <ul class="uk-list uk-list-large user-list"> | |
| 310 | - </ul> | |
| 311 | - </div> | |
| 312 | - </div> | |
| 313 | - </div> | |
| 314 | - <div class="auth_cont "> | |
| 315 | - <div class="uk-card uk-card-default authorize_right_cont"> | |
| 316 | - | |
| 317 | - </div> | |
| 318 | - </div> | |
| 319 | - </div> | |
| 320 | -</div> | |
| 321 | - | |
| 322 | -<script id="authorize-role-list-temp" type="text/html"> | |
| 323 | - {{each list as r i}} | |
| 324 | - <li data-id="{{r.id}}" data-name="{{r.roleName}}" data-code="{{r.codeUp}}">{{r.roleName}} | |
| 325 | - <span class="role-code">{{r.codeName}}</span> | |
| 326 | - <div class="ct_li_desc">{{r.createDateStr}}</div> | |
| 327 | - <span class="uk-badge">{{r.count}}</span> | |
| 328 | - </li> | |
| 329 | - {{/each}} | |
| 330 | -</script> | |
| 331 | -<script id="authorize-user-list-temp" type="text/html"> | |
| 332 | - {{each list as u i}} | |
| 333 | - <li class="uk-animation-fade uk-animation-fast" data-name="{{u.name}}" data-code="{{u.userNameUp}}" data-id="{{u.id}}">{{u.name}}<span class="role-code">{{u.userName}}</span></li> | |
| 334 | - {{/each}} | |
| 335 | -</script> | |
| 336 | -<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | |
| 337 | -<script src="/assets/plugins/uk3.0/uikit.min.js"></script> | |
| 338 | -<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script> | |
| 339 | -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | |
| 340 | -<!-- EventProxy --> | |
| 341 | -<script src="/assets/js/eventproxy.js"></script> | |
| 342 | -<!-- art-template 模版引擎 --> | |
| 343 | -<script src="/assets/plugins/template.js"></script> | |
| 344 | -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 345 | -<script src="/assets/plugins/ztree_v3/js/jquery.ztree.core.min.js"></script> | |
| 346 | -<script src="/assets/plugins/ztree_v3/js/jquery.ztree.excheck.min.js"></script> | |
| 347 | -<script> | |
| 348 | - if (typeof String.prototype.startsWith != 'function') { | |
| 349 | - String.prototype.startsWith = function (prefix){ | |
| 350 | - return this.slice(0, prefix.length) === prefix; | |
| 351 | - }; | |
| 352 | - } | |
| 353 | - var roles,users,role_users,modules,companyData,lineArray; | |
| 354 | - | |
| 355 | - var ep = EventProxy.create('query_roles', 'query_users', 'query_modules', 'query_company', 'query_line', function (rs, us, ms, cs, lines) { | |
| 356 | - roles = rs; | |
| 357 | - users = us; | |
| 358 | - modules = ms; | |
| 359 | - companyData = cs; | |
| 360 | - lineArray=lines; | |
| 361 | - role_users = {}; | |
| 362 | - for(var i=0,r;r=roles[i++];){ | |
| 363 | - r.count=0; | |
| 364 | - role_users[r.id]=[]; | |
| 365 | - r.createDateStr=moment(r.createDate).format('YYYY-MM-DD HH:ss'); | |
| 366 | - r.codeUp=r.codeName.toUpperCase(); | |
| 367 | - for(var j=0,u;u=users[j++];){ | |
| 368 | - if(u.roles.indexOf(r.id)!=-1){ | |
| 369 | - r.count++; | |
| 370 | - role_users[r.id].push(u); | |
| 371 | - } | |
| 372 | - } | |
| 373 | - } | |
| 374 | - //渲染角色list | |
| 375 | - render_role_list(roles); | |
| 376 | - //渲染用户list | |
| 377 | - render_user_list(users); | |
| 378 | - | |
| 379 | - $('.loading').remove(); | |
| 380 | - $('.ct_page').show(); | |
| 381 | - }); | |
| 382 | - | |
| 383 | - //角色点击 | |
| 384 | - $('ul.role-list').on('click', 'li', roleClickHanlder); | |
| 385 | - //用户点击 | |
| 386 | - $('ul.user-list').on('click', 'li', userClickHanlder); | |
| 387 | - | |
| 388 | - | |
| 389 | - function roleClickHanlder() { | |
| 390 | - if($(this).hasClass('active') && $('ul.user-list>li.active').length==0) | |
| 391 | - return; | |
| 392 | - | |
| 393 | - reset_dom(); | |
| 394 | - $('ul.role-list>li.active').removeClass('active'); | |
| 395 | - $(this).addClass('active'); | |
| 396 | - //重新渲染用户list | |
| 397 | - var id = $(this).data('id'); | |
| 398 | - render_user_list(role_users[id]); | |
| 399 | - //加载角色授权页面 | |
| 400 | - $('.authorize_right_cont').load('/pages/permission/authorize_all/role_auth.html', function () { | |
| 401 | - $('#role_authorize_wrap', this).trigger('init', {role: get_role(id), modules: modules, companyData: companyData}); | |
| 402 | - }); | |
| 403 | - } | |
| 404 | - | |
| 405 | - function userClickHanlder() { | |
| 406 | - if($(this).hasClass('active')) | |
| 407 | - return; | |
| 408 | - | |
| 409 | - reset_dom(); | |
| 410 | - $('ul.user-list>li.active').removeClass('active'); | |
| 411 | - $(this).addClass('active'); | |
| 412 | - | |
| 413 | - //加载用户授权页面 | |
| 414 | - var id = $(this).data('id'); | |
| 415 | - $('.authorize_right_cont').load('/pages/permission/authorize_all/user_auth.html', function () { | |
| 416 | - $('#user_authorize_wrap', this).trigger('init', {user: get_user(id),lineArray:lineArray, companyData:companyData}); | |
| 417 | - }); | |
| 418 | - } | |
| 419 | - | |
| 420 | - //refresh-user | |
| 421 | - $('.authorize_right_cont').on('refresh-user', function () { | |
| 422 | - $('ul.user-list>li.active').removeClass('active').trigger('click'); | |
| 423 | - }); | |
| 424 | - | |
| 425 | - function reset_dom() { | |
| 426 | - $('#select_line_modal').remove(); | |
| 427 | - } | |
| 428 | - | |
| 429 | - //滚动条 | |
| 430 | - $('.ct_page .uk-card .ct-card-body').perfectScrollbar({suppressScrollX: true}); | |
| 431 | - | |
| 432 | - //query all role | |
| 433 | - $.get('/role/all', function (rs) { | |
| 434 | - ep.emit('query_roles', rs); | |
| 435 | - }); | |
| 436 | - | |
| 437 | - //query all user | |
| 438 | - $.get('/user/all_distinct', function (rs) { | |
| 439 | - for(var i=0,u;u=rs[i++];){ | |
| 440 | - discard_field(u); | |
| 441 | - u.userNameUp=u.userName.toUpperCase(); | |
| 442 | - u.lastLoginDateStr=moment(u.lastLoginDate).format('YYYY-MM-DD HH:ss'); | |
| 443 | - } | |
| 444 | - ep.emit('query_users', rs); | |
| 445 | - }); | |
| 446 | - | |
| 447 | - //query all modules | |
| 448 | - $.get('/module/all_distinct', function (rs) { | |
| 449 | - ep.emit('query_modules', rs); | |
| 450 | - }); | |
| 451 | - | |
| 452 | - //query all company data | |
| 453 | - $.get('/business/all', function (rs) { | |
| 454 | - ep.emit('query_company', rs); | |
| 455 | - }); | |
| 456 | - | |
| 457 | - //query all line | |
| 458 | - $.get('/line/all', {'destroy_eq': 0}, function (rs) { | |
| 459 | - ep.emit('query_line', rs); | |
| 460 | - }); | |
| 461 | - | |
| 462 | - function discard_field(u) { | |
| 463 | - var array = []; | |
| 464 | - $.each(u.roles, function () { | |
| 465 | - array.push(this.id); | |
| 466 | - }); | |
| 467 | - u.roles = array; | |
| 468 | - } | |
| 469 | - | |
| 470 | - function render_role_list(list) { | |
| 471 | - var htmlStr = template('authorize-role-list-temp', {list: list}); | |
| 472 | - $('ul.role-list').html(htmlStr); | |
| 473 | - up_scroll(); | |
| 474 | - } | |
| 475 | - | |
| 476 | - | |
| 477 | - function render_user_list(list) { | |
| 478 | - var htmlStr = template('authorize-user-list-temp', {list: list}); | |
| 479 | - $('ul.user-list').html(htmlStr); | |
| 480 | - up_scroll(); | |
| 481 | - } | |
| 482 | - | |
| 483 | - function reset_role_list(){ | |
| 484 | - var actives = $('ul.role-list>li.active'); | |
| 485 | - if(actives.length > 0){ | |
| 486 | - $('ul.role-list>li.active').removeClass('active'); | |
| 487 | - render_user_list(users); | |
| 488 | - $('.authorize_right_cont').empty(); | |
| 489 | - } | |
| 490 | - } | |
| 491 | - | |
| 492 | - function up_scroll() { | |
| 493 | - $('.ct_page .uk-card .ct-card-body').perfectScrollbar('update'); | |
| 494 | - } | |
| 495 | - | |
| 496 | - /** | |
| 497 | - * 角色搜索 | |
| 498 | - */ | |
| 499 | - var role_search_flag; | |
| 500 | - $('.role_search_input').on('input', function () { | |
| 501 | - if(role_search_flag) | |
| 502 | - return; | |
| 503 | - role_search_flag=true; | |
| 504 | - | |
| 505 | - var that = this; | |
| 506 | - setTimeout(function () { | |
| 507 | - var t = $(that).val().toUpperCase(), name, code; | |
| 508 | - if(!t){ | |
| 509 | - $('ul.role-list>li').show(); | |
| 510 | - role_search_flag=false; | |
| 511 | - return; | |
| 512 | - } | |
| 513 | - | |
| 514 | - $('ul.role-list>li').hide().each(function () { | |
| 515 | - name = $(this).data('name')+''; | |
| 516 | - code = $(this).data('code')+''; | |
| 517 | - if(name.startsWith(t) || code.startsWith(t)){ | |
| 518 | - $(this).show(); | |
| 519 | - } | |
| 520 | - }); | |
| 521 | - up_scroll(); | |
| 522 | - role_search_flag=false; | |
| 523 | - }, 300); | |
| 524 | - }).on('click', reset_role_list); | |
| 525 | - | |
| 526 | - /** | |
| 527 | - * 用户搜索 | |
| 528 | - * | |
| 529 | - */ | |
| 530 | - var user_search_flag; | |
| 531 | - $('.user_search_input').on('input', function () { | |
| 532 | - if(user_search_flag) | |
| 533 | - return; | |
| 534 | - user_search_flag=true; | |
| 535 | - var that = this; | |
| 536 | - setTimeout(function () { | |
| 537 | - var t = $(that).val().toUpperCase(), name, code; | |
| 538 | - if(!t){ | |
| 539 | - $('ul.user-list>li').show(); | |
| 540 | - user_search_flag=false; | |
| 541 | - return; | |
| 542 | - } | |
| 543 | - | |
| 544 | - $('ul.user-list>li').hide().each(function () { | |
| 545 | - name = $(this).data('name')+''; | |
| 546 | - code = $(this).data('code')+''; | |
| 547 | - if(name.startsWith(t) || code.startsWith(t)){ | |
| 548 | - $(this).show(); | |
| 549 | - } | |
| 550 | - }); | |
| 551 | - up_scroll(); | |
| 552 | - user_search_flag=false; | |
| 553 | - }, 300); | |
| 554 | - }).on('click', reset_role_list); | |
| 555 | - | |
| 556 | - function get_role(id) { | |
| 557 | - for(var i=0,r;r=roles[i++];){ | |
| 558 | - if(r.id==id) | |
| 559 | - return r; | |
| 560 | - } | |
| 561 | - return null; | |
| 562 | - } | |
| 563 | - | |
| 564 | - function get_user(id) { | |
| 565 | - for(var i=0,u;u=users[i++];){ | |
| 566 | - if(u.id==id) | |
| 567 | - return u; | |
| 568 | - } | |
| 569 | - return null; | |
| 570 | - } | |
| 571 | - | |
| 572 | - $(document).on('submit', 'form', function () { | |
| 573 | - return false; | |
| 574 | - }); | |
| 575 | - | |
| 576 | - function convert_buss_data(rs) { | |
| 577 | - var baseCode; | |
| 578 | - //找到跟节点 | |
| 579 | - $.each(rs, function () { | |
| 580 | - if(this.upCode == 0){ | |
| 581 | - baseCode=this.businessCode; | |
| 582 | - return false; | |
| 583 | - } | |
| 584 | - }); | |
| 585 | - if(!baseCode){ | |
| 586 | - alert('大爷找不到根节点,数据有问题吧!!!'); | |
| 587 | - return; | |
| 588 | - } | |
| 589 | - //提取二级节点 | |
| 590 | - var secondMap={}; | |
| 591 | - $.each(rs, function () { | |
| 592 | - if(this.upCode==baseCode){ | |
| 593 | - secondMap[this.businessCode] = { | |
| 594 | - name: this.businessName, | |
| 595 | - childs: [] | |
| 596 | - }; | |
| 597 | - } | |
| 598 | - }); | |
| 599 | - //分公司节点 | |
| 600 | - $.each(rs, function () { | |
| 601 | - if(secondMap[this.upCode]) | |
| 602 | - secondMap[this.upCode].childs.push(this); | |
| 603 | - }); | |
| 604 | - | |
| 605 | - //排序 | |
| 606 | - for(var sid in secondMap){ | |
| 607 | - secondMap[sid].childs.sort(naturalSort); | |
| 608 | - } | |
| 609 | - | |
| 610 | - console.log('secondMap', secondMap); | |
| 611 | - return secondMap; | |
| 612 | - } | |
| 613 | - | |
| 614 | - var naturalSort=function (a, b) { | |
| 615 | - return a.businessName.localeCompare(b.businessName); | |
| 616 | - }; | |
| 617 | - | |
| 618 | - var groupBy = function (list, field) { | |
| 619 | - var rs = {}, | |
| 620 | - key; | |
| 621 | - $.each(list, function () { | |
| 622 | - key = this[field]; | |
| 623 | - if (!rs[key]) | |
| 624 | - rs[key] = []; | |
| 625 | - | |
| 626 | - rs[key].push(this); | |
| 627 | - }); | |
| 628 | - | |
| 629 | - return rs; | |
| 630 | - }; | |
| 631 | -</script> | |
| 632 | -</body> | |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/> | |
| 7 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | |
| 8 | + <link rel="stylesheet" href="/assets/plugins/ztree_v3/css/zTreeStyle/zTreeStyle.css" /> | |
| 9 | + <style> | |
| 10 | + html,body{ | |
| 11 | + height: 100%; | |
| 12 | + } | |
| 13 | + .ct_page{ | |
| 14 | + padding: 25px 15px; | |
| 15 | + height: 100%; | |
| 16 | + height: calc(100% - 50px); | |
| 17 | + } | |
| 18 | + | |
| 19 | + .ct_cont{ | |
| 20 | + height: calc(100% - 41px); | |
| 21 | + } | |
| 22 | + | |
| 23 | + .ct_cont>div>div.uk-card{ | |
| 24 | + height: 99%; | |
| 25 | + } | |
| 26 | + | |
| 27 | + form .uk-inline{ | |
| 28 | + width: calc(100% - 4px); | |
| 29 | + margin-left: 2px; | |
| 30 | + } | |
| 31 | + | |
| 32 | + .ct-card-body{ | |
| 33 | + overflow: auto; | |
| 34 | + padding: 1px 1px 0 2px; | |
| 35 | + height: calc(100% - 54px); | |
| 36 | + position: relative; | |
| 37 | + margin-top: -12px; | |
| 38 | + } | |
| 39 | + | |
| 40 | + .ct_li_desc{ | |
| 41 | + color: #a8a8a8; | |
| 42 | + font-size: 13px; | |
| 43 | + } | |
| 44 | + | |
| 45 | + .ct-card-body .uk-list-large{ | |
| 46 | + font-size: 14px; | |
| 47 | + } | |
| 48 | + | |
| 49 | + .ct-card-body .uk-list-large>li{ | |
| 50 | + cursor: default; | |
| 51 | + padding-left: 20px; | |
| 52 | + margin-top: 2px !important; | |
| 53 | + padding-top: 17px !important; | |
| 54 | + position: relative; | |
| 55 | + } | |
| 56 | + | |
| 57 | + .ct-card-body .uk-list-large>li:hover{ | |
| 58 | + background: #edecec; | |
| 59 | + } | |
| 60 | + | |
| 61 | + .ct-card-body .uk-list-large>li.active{ | |
| 62 | + background: #1e87f0 !important; | |
| 63 | + color: white; | |
| 64 | + } | |
| 65 | + | |
| 66 | + .ct-card-body .uk-list-large>li.active>span.role-code{ | |
| 67 | + color: #ffffff; | |
| 68 | + } | |
| 69 | + | |
| 70 | + .ct-card-body .uk-list-large.role-list>li:hover{ | |
| 71 | + background: #fff494; | |
| 72 | + } | |
| 73 | + | |
| 74 | + .ct-card-body .uk-list-large>li.active .ct_li_desc{ | |
| 75 | + color: #e6e6e6; | |
| 76 | + } | |
| 77 | + | |
| 78 | + .ct-card-body .uk-list-large>li>span.uk-badge{ | |
| 79 | + position: absolute; | |
| 80 | + top: 17px; | |
| 81 | + right: 25px; | |
| 82 | + } | |
| 83 | + | |
| 84 | + .ct-card-body .uk-list-large>li>span.role-code{ | |
| 85 | + padding: 4px 6px; | |
| 86 | + color: #a8a8a8; | |
| 87 | + margin-left: 5px; | |
| 88 | + } | |
| 89 | + | |
| 90 | + .top_title{ | |
| 91 | + padding: 9px 0 5px 15px; | |
| 92 | + border-bottom: 1px solid #ededed; | |
| 93 | + border-left: 5px solid #FFC107; | |
| 94 | + } | |
| 95 | + | |
| 96 | + .top_title>.desc{ | |
| 97 | + font-size: 13px; | |
| 98 | + color: grey; | |
| 99 | + margin-top: 3px; | |
| 100 | + } | |
| 101 | + | |
| 102 | + .left_menu_list{ | |
| 103 | + overflow: auto; | |
| 104 | + position: relative; | |
| 105 | + } | |
| 106 | + | |
| 107 | + .left_menu_list .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{ | |
| 108 | + opacity: 0.6 !important; | |
| 109 | + padding: 0 !important; | |
| 110 | + } | |
| 111 | + | |
| 112 | + ._company{ | |
| 113 | + margin: 15px 0px; | |
| 114 | + } | |
| 115 | + ._company>h5{ | |
| 116 | + margin-bottom: 10px; | |
| 117 | + font-size: 15px; | |
| 118 | + color: #6b6b6b; | |
| 119 | + text-indent: 12px; | |
| 120 | + } | |
| 121 | + ._company>._fgs>label{ | |
| 122 | + padding: 3px 12px 3px 10px; | |
| 123 | + display: inline-block; | |
| 124 | + border: 1px solid gainsboro; | |
| 125 | + border-radius: 2px; | |
| 126 | + margin: 5px; | |
| 127 | + font-size: 14px; | |
| 128 | + } | |
| 129 | + ._company>._fgs>label.active{ | |
| 130 | + background: #1e87f0; | |
| 131 | + color: #fff; | |
| 132 | + } | |
| 133 | + ._company .uk-checkbox:checked:focus, | |
| 134 | + .line_checkbox_list .uk-checkbox:checked:focus{ | |
| 135 | + background-color: #1e87f0 !important; | |
| 136 | + } | |
| 137 | + .save_icon{ | |
| 138 | + position: absolute; | |
| 139 | + right: 2px; | |
| 140 | + background: #bec4c9; | |
| 141 | + font-size: 12px; | |
| 142 | + padding: 2px 15px; | |
| 143 | + color: #fff; | |
| 144 | + box-shadow: 0 5px 15px rgba(0,0,0,0.08); | |
| 145 | + cursor: pointer; | |
| 146 | + } | |
| 147 | + .save_icon:hover{ | |
| 148 | + background: #FFC107; | |
| 149 | + } | |
| 150 | + .data_auth_list{ | |
| 151 | + position: relative; | |
| 152 | + } | |
| 153 | + #user_authorize_wrap .top_title{ | |
| 154 | + border-left: 5px solid #cacac8; | |
| 155 | + } | |
| 156 | + .xd_line_list{ | |
| 157 | + height: 37%; | |
| 158 | + padding: 7px; | |
| 159 | + border-bottom: 1px solid #f2f2f2; | |
| 160 | + overflow: auto; | |
| 161 | + position: relative; | |
| 162 | + } | |
| 163 | + .xd_line_list>h5{ | |
| 164 | + color: #858585; | |
| 165 | + margin: 5px 5px 5px 0; | |
| 166 | + font-size: 14px; | |
| 167 | + } | |
| 168 | + .sub_lines{ | |
| 169 | + padding-left: 15px; | |
| 170 | + } | |
| 171 | + .sub_lines>span.line_btn { | |
| 172 | + background: #00BCD4; | |
| 173 | + color: #fff; | |
| 174 | + padding: 4px 9px; | |
| 175 | + display: inline-block; | |
| 176 | + min-width: 68px; | |
| 177 | + text-align: center; | |
| 178 | + margin: 5px 2px; | |
| 179 | + box-shadow: 0 5px 9px rgba(0,0,0,0.08); | |
| 180 | + cursor: pointer; | |
| 181 | + font-size: 14px; | |
| 182 | + font-family: 微软雅黑; | |
| 183 | + } | |
| 184 | + .sub_lines>span.line_btn:hover{ | |
| 185 | + background: #2dd7ed; | |
| 186 | + } | |
| 187 | + .add_line_icon{ | |
| 188 | + cursor: pointer; | |
| 189 | + padding: 2px 5px; | |
| 190 | + border-radius: 5px; | |
| 191 | + display: inline-block; | |
| 192 | + } | |
| 193 | + .add_line_icon>i{ | |
| 194 | + vertical-align: top; | |
| 195 | + margin-top: 3px; | |
| 196 | + } | |
| 197 | + .add_line_icon:hover{ | |
| 198 | + background: #ededed; | |
| 199 | + } | |
| 200 | + .ct_pattern_form{ | |
| 201 | + display: inline-block; | |
| 202 | + } | |
| 203 | + .xd_menu_grid{ | |
| 204 | + padding: 25px 25px 0 25px; | |
| 205 | + height: calc(63% - 91px); | |
| 206 | + } | |
| 207 | + .xd_menu_grid .uk-list{ | |
| 208 | + border: 1px solid #ededed; | |
| 209 | + height: calc(100% - 70px); | |
| 210 | + overflow: auto; | |
| 211 | + position: relative; | |
| 212 | + } | |
| 213 | + | |
| 214 | + .xd_menu_grid .uk-list>li{ | |
| 215 | + margin: 5px 0 !important; | |
| 216 | + padding: 10px 0 0 10px !important; | |
| 217 | + font-size: 14px; | |
| 218 | + } | |
| 219 | + .top_tools{ | |
| 220 | + position: absolute; | |
| 221 | + top: 15px; | |
| 222 | + right: 25px; | |
| 223 | + } | |
| 224 | + .ct_field { | |
| 225 | + display: inline-block; | |
| 226 | + width: 240px; | |
| 227 | + } | |
| 228 | + .ct_field>select,.ct_field>input{ | |
| 229 | + width: calc(100% - 60px); | |
| 230 | + } | |
| 231 | + .line_checkbox_list{ | |
| 232 | + margin-top: 15px; | |
| 233 | + } | |
| 234 | + .line_checkbox_list>.btn{ | |
| 235 | + padding: 5px 7px; | |
| 236 | + border-radius: 2px; | |
| 237 | + display: inline-block; | |
| 238 | + margin: 4px 9px; | |
| 239 | + font-size: 14px; | |
| 240 | + font-family: 微软雅黑; | |
| 241 | + border: 1px solid #d9d9d9; | |
| 242 | + width: 100px; | |
| 243 | + overflow: hidden; | |
| 244 | + text-overflow: ellipsis; | |
| 245 | + white-space: nowrap; | |
| 246 | + } | |
| 247 | + .line_checkbox_list>.btn>input{ | |
| 248 | + margin-right: 5px; | |
| 249 | + } | |
| 250 | + .line_checkbox_list>.btn.active{ | |
| 251 | + background: #1e87f0; | |
| 252 | + color: #fff; | |
| 253 | + } | |
| 254 | + #role_authorize_wrap .ztree *{ | |
| 255 | + font-size: 14px; | |
| 256 | + } | |
| 257 | + #role_authorize_wrap .ztree li{ | |
| 258 | + line-height: 21px; | |
| 259 | + } | |
| 260 | + .loading{ | |
| 261 | + height: 100%; | |
| 262 | + text-align: center; | |
| 263 | + } | |
| 264 | + .loading .uk-spinner{ | |
| 265 | + margin-top: 200px; | |
| 266 | + } | |
| 267 | + .loading circle{ | |
| 268 | + stroke: red; | |
| 269 | + } | |
| 270 | + </style> | |
| 271 | +</head> | |
| 272 | + | |
| 273 | +<body> | |
| 274 | +<div class="loading"> | |
| 275 | + <div uk-spinner></div> | |
| 276 | +</div> | |
| 277 | +<div class="ct_page" style="display: none;"> | |
| 278 | + <h2 class="uk-heading-line uk-heading-bullet"><span>授权管理</span></h2> | |
| 279 | + <div class="ct_cont uk-grid-small uk-child-width-expand" uk-grid> | |
| 280 | + <div class="role_list uk-width-1-4 "> | |
| 281 | + <div class="uk-card uk-card-default"> | |
| 282 | + <form> | |
| 283 | + <div class="uk-margin"> | |
| 284 | + <div class="uk-inline" > | |
| 285 | + <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span> | |
| 286 | + <input class="uk-input role_search_input" type="text" placeholder="搜索角色"> | |
| 287 | + </div> | |
| 288 | + </div> | |
| 289 | + </form> | |
| 290 | + | |
| 291 | + <div class="ct-card-body" > | |
| 292 | + <ul class="uk-list uk-list-large uk-list-divider role-list"> | |
| 293 | + </ul> | |
| 294 | + </div> | |
| 295 | + </div> | |
| 296 | + </div> | |
| 297 | + <div class="user_list uk-width-1-5 "> | |
| 298 | + <div class="uk-card uk-card-default"> | |
| 299 | + <form> | |
| 300 | + <div class="uk-margin"> | |
| 301 | + <div class="uk-inline" > | |
| 302 | + <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span> | |
| 303 | + <input class="uk-input user_search_input" type="text" placeholder="搜索用户"> | |
| 304 | + </div> | |
| 305 | + </div> | |
| 306 | + </form> | |
| 307 | + | |
| 308 | + <div class="ct-card-body"> | |
| 309 | + <ul class="uk-list uk-list-large user-list"> | |
| 310 | + </ul> | |
| 311 | + </div> | |
| 312 | + </div> | |
| 313 | + </div> | |
| 314 | + <div class="auth_cont "> | |
| 315 | + <div class="uk-card uk-card-default authorize_right_cont"> | |
| 316 | + | |
| 317 | + </div> | |
| 318 | + </div> | |
| 319 | + </div> | |
| 320 | +</div> | |
| 321 | + | |
| 322 | +<script id="authorize-role-list-temp" type="text/html"> | |
| 323 | + {{each list as r i}} | |
| 324 | + <li data-id="{{r.id}}" data-name="{{r.roleName}}" data-code="{{r.codeUp}}">{{r.roleName}} | |
| 325 | + <span class="role-code">{{r.codeName}}</span> | |
| 326 | + <div class="ct_li_desc">{{r.createDateStr}}</div> | |
| 327 | + <span class="uk-badge">{{r.count}}</span> | |
| 328 | + </li> | |
| 329 | + {{/each}} | |
| 330 | +</script> | |
| 331 | +<script id="authorize-user-list-temp" type="text/html"> | |
| 332 | + {{each list as u i}} | |
| 333 | + <li class="uk-animation-fade uk-animation-fast" data-name="{{u.name}}" data-code="{{u.userNameUp}}" data-id="{{u.id}}">{{u.name}}<span class="role-code">{{u.userName}}</span></li> | |
| 334 | + {{/each}} | |
| 335 | +</script> | |
| 336 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | |
| 337 | +<script src="/assets/plugins/uk3.0/uikit.min.js"></script> | |
| 338 | +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script> | |
| 339 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | |
| 340 | +<!-- EventProxy --> | |
| 341 | +<script src="/assets/js/eventproxy.js"></script> | |
| 342 | +<!-- art-template 模版引擎 --> | |
| 343 | +<script src="/assets/plugins/template.js"></script> | |
| 344 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 345 | +<script src="/assets/plugins/ztree_v3/js/jquery.ztree.core.min.js"></script> | |
| 346 | +<script src="/assets/plugins/ztree_v3/js/jquery.ztree.excheck.min.js"></script> | |
| 347 | +<script> | |
| 348 | + if (typeof String.prototype.startsWith != 'function') { | |
| 349 | + String.prototype.startsWith = function (prefix){ | |
| 350 | + return this.slice(0, prefix.length) === prefix; | |
| 351 | + }; | |
| 352 | + } | |
| 353 | + var roles,users,role_users,modules,companyData,lineArray; | |
| 354 | + | |
| 355 | + var ep = EventProxy.create('query_roles', 'query_users', 'query_modules', 'query_company', 'query_line', function (rs, us, ms, cs, lines) { | |
| 356 | + roles = rs; | |
| 357 | + users = us; | |
| 358 | + modules = ms; | |
| 359 | + companyData = cs; | |
| 360 | + lineArray=lines; | |
| 361 | + role_users = {}; | |
| 362 | + for(var i=0,r;r=roles[i++];){ | |
| 363 | + r.count=0; | |
| 364 | + role_users[r.id]=[]; | |
| 365 | + r.createDateStr=moment(r.createDate).format('YYYY-MM-DD HH:ss'); | |
| 366 | + r.codeUp=r.codeName.toUpperCase(); | |
| 367 | + for(var j=0,u;u=users[j++];){ | |
| 368 | + if(u.roles.indexOf(r.id)!=-1){ | |
| 369 | + r.count++; | |
| 370 | + role_users[r.id].push(u); | |
| 371 | + } | |
| 372 | + } | |
| 373 | + } | |
| 374 | + //渲染角色list | |
| 375 | + render_role_list(roles); | |
| 376 | + //渲染用户list | |
| 377 | + render_user_list(users); | |
| 378 | + | |
| 379 | + $('.loading').remove(); | |
| 380 | + $('.ct_page').show(); | |
| 381 | + }); | |
| 382 | + | |
| 383 | + //角色点击 | |
| 384 | + $('ul.role-list').on('click', 'li', roleClickHanlder); | |
| 385 | + //用户点击 | |
| 386 | + $('ul.user-list').on('click', 'li', userClickHanlder); | |
| 387 | + | |
| 388 | + | |
| 389 | + function roleClickHanlder() { | |
| 390 | + if($(this).hasClass('active') && $('ul.user-list>li.active').length==0) | |
| 391 | + return; | |
| 392 | + | |
| 393 | + reset_dom(); | |
| 394 | + $('ul.role-list>li.active').removeClass('active'); | |
| 395 | + $(this).addClass('active'); | |
| 396 | + //重新渲染用户list | |
| 397 | + var id = $(this).data('id'); | |
| 398 | + render_user_list(role_users[id]); | |
| 399 | + //加载角色授权页面 | |
| 400 | + $('.authorize_right_cont').load('/pages/permission/authorize_all/role_auth.html', function () { | |
| 401 | + $('#role_authorize_wrap', this).trigger('init', {role: get_role(id), modules: modules, companyData: companyData}); | |
| 402 | + }); | |
| 403 | + } | |
| 404 | + | |
| 405 | + function userClickHanlder() { | |
| 406 | + if($(this).hasClass('active')) | |
| 407 | + return; | |
| 408 | + | |
| 409 | + reset_dom(); | |
| 410 | + $('ul.user-list>li.active').removeClass('active'); | |
| 411 | + $(this).addClass('active'); | |
| 412 | + | |
| 413 | + //加载用户授权页面 | |
| 414 | + var id = $(this).data('id'); | |
| 415 | + $('.authorize_right_cont').load('/pages/permission/authorize_all/user_auth.html', function () { | |
| 416 | + $('#user_authorize_wrap', this).trigger('init', {user: get_user(id),lineArray:lineArray, companyData:companyData}); | |
| 417 | + }); | |
| 418 | + } | |
| 419 | + | |
| 420 | + //refresh-user | |
| 421 | + $('.authorize_right_cont').on('refresh-user', function () { | |
| 422 | + $('ul.user-list>li.active').removeClass('active').trigger('click'); | |
| 423 | + }); | |
| 424 | + | |
| 425 | + function reset_dom() { | |
| 426 | + $('#select_line_modal').remove(); | |
| 427 | + } | |
| 428 | + | |
| 429 | + //滚动条 | |
| 430 | + $('.ct_page .uk-card .ct-card-body').perfectScrollbar({suppressScrollX: true}); | |
| 431 | + | |
| 432 | + //query all role | |
| 433 | + $.get('/role/all', function (rs) { | |
| 434 | + ep.emit('query_roles', rs); | |
| 435 | + }); | |
| 436 | + | |
| 437 | + //query all user | |
| 438 | + $.get('/user/all_distinct', function (rs) { | |
| 439 | + for(var i=0,u;u=rs[i++];){ | |
| 440 | + discard_field(u); | |
| 441 | + u.userNameUp=u.userName.toUpperCase(); | |
| 442 | + u.lastLoginDateStr=moment(u.lastLoginDate).format('YYYY-MM-DD HH:ss'); | |
| 443 | + } | |
| 444 | + ep.emit('query_users', rs); | |
| 445 | + }); | |
| 446 | + | |
| 447 | + //query all modules | |
| 448 | + $.get('/module/all_distinct', function (rs) { | |
| 449 | + ep.emit('query_modules', rs); | |
| 450 | + }); | |
| 451 | + | |
| 452 | + //query all company data | |
| 453 | + $.get('/business/all', function (rs) { | |
| 454 | + ep.emit('query_company', rs); | |
| 455 | + }); | |
| 456 | + | |
| 457 | + //query all line | |
| 458 | + $.get('/line/all', {'destroy_eq': 0}, function (rs) { | |
| 459 | + ep.emit('query_line', rs); | |
| 460 | + }); | |
| 461 | + | |
| 462 | + function discard_field(u) { | |
| 463 | + var array = []; | |
| 464 | + $.each(u.roles, function () { | |
| 465 | + array.push(this.id); | |
| 466 | + }); | |
| 467 | + u.roles = array; | |
| 468 | + } | |
| 469 | + | |
| 470 | + function render_role_list(list) { | |
| 471 | + var htmlStr = template('authorize-role-list-temp', {list: list}); | |
| 472 | + $('ul.role-list').html(htmlStr); | |
| 473 | + up_scroll(); | |
| 474 | + } | |
| 475 | + | |
| 476 | + | |
| 477 | + function render_user_list(list) { | |
| 478 | + var htmlStr = template('authorize-user-list-temp', {list: list}); | |
| 479 | + $('ul.user-list').html(htmlStr); | |
| 480 | + up_scroll(); | |
| 481 | + } | |
| 482 | + | |
| 483 | + function reset_role_list(){ | |
| 484 | + var actives = $('ul.role-list>li.active'); | |
| 485 | + if(actives.length > 0){ | |
| 486 | + $('ul.role-list>li.active').removeClass('active'); | |
| 487 | + render_user_list(users); | |
| 488 | + $('.authorize_right_cont').empty(); | |
| 489 | + } | |
| 490 | + } | |
| 491 | + | |
| 492 | + function up_scroll() { | |
| 493 | + $('.ct_page .uk-card .ct-card-body').perfectScrollbar('update'); | |
| 494 | + } | |
| 495 | + | |
| 496 | + /** | |
| 497 | + * 角色搜索 | |
| 498 | + */ | |
| 499 | + var role_search_flag; | |
| 500 | + $('.role_search_input').on('input', function () { | |
| 501 | + if(role_search_flag) | |
| 502 | + return; | |
| 503 | + role_search_flag=true; | |
| 504 | + | |
| 505 | + var that = this; | |
| 506 | + setTimeout(function () { | |
| 507 | + var t = $(that).val().toUpperCase(), name, code; | |
| 508 | + if(!t){ | |
| 509 | + $('ul.role-list>li').show(); | |
| 510 | + role_search_flag=false; | |
| 511 | + return; | |
| 512 | + } | |
| 513 | + | |
| 514 | + $('ul.role-list>li').hide().each(function () { | |
| 515 | + name = $(this).data('name')+''; | |
| 516 | + code = $(this).data('code')+''; | |
| 517 | + if(name.startsWith(t) || code.startsWith(t)){ | |
| 518 | + $(this).show(); | |
| 519 | + } | |
| 520 | + }); | |
| 521 | + up_scroll(); | |
| 522 | + role_search_flag=false; | |
| 523 | + }, 300); | |
| 524 | + }).on('click', reset_role_list); | |
| 525 | + | |
| 526 | + /** | |
| 527 | + * 用户搜索 | |
| 528 | + * | |
| 529 | + */ | |
| 530 | + var user_search_flag; | |
| 531 | + $('.user_search_input').on('input', function () { | |
| 532 | + if(user_search_flag) | |
| 533 | + return; | |
| 534 | + user_search_flag=true; | |
| 535 | + var that = this; | |
| 536 | + setTimeout(function () { | |
| 537 | + var t = $(that).val().toUpperCase(), name, code; | |
| 538 | + if(!t){ | |
| 539 | + $('ul.user-list>li').show(); | |
| 540 | + user_search_flag=false; | |
| 541 | + return; | |
| 542 | + } | |
| 543 | + | |
| 544 | + $('ul.user-list>li').hide().each(function () { | |
| 545 | + name = $(this).data('name')+''; | |
| 546 | + code = $(this).data('code')+''; | |
| 547 | + if(name.startsWith(t) || code.startsWith(t)){ | |
| 548 | + $(this).show(); | |
| 549 | + } | |
| 550 | + }); | |
| 551 | + up_scroll(); | |
| 552 | + user_search_flag=false; | |
| 553 | + }, 300); | |
| 554 | + }).on('click', reset_role_list); | |
| 555 | + | |
| 556 | + function get_role(id) { | |
| 557 | + for(var i=0,r;r=roles[i++];){ | |
| 558 | + if(r.id==id) | |
| 559 | + return r; | |
| 560 | + } | |
| 561 | + return null; | |
| 562 | + } | |
| 563 | + | |
| 564 | + function get_user(id) { | |
| 565 | + for(var i=0,u;u=users[i++];){ | |
| 566 | + if(u.id==id) | |
| 567 | + return u; | |
| 568 | + } | |
| 569 | + return null; | |
| 570 | + } | |
| 571 | + | |
| 572 | + $(document).on('submit', 'form', function () { | |
| 573 | + return false; | |
| 574 | + }); | |
| 575 | + | |
| 576 | + function convert_buss_data(rs) { | |
| 577 | + var baseCode; | |
| 578 | + //找到跟节点 | |
| 579 | + $.each(rs, function () { | |
| 580 | + if(this.upCode == 0){ | |
| 581 | + baseCode=this.businessCode; | |
| 582 | + return false; | |
| 583 | + } | |
| 584 | + }); | |
| 585 | + if(!baseCode){ | |
| 586 | + alert('大爷找不到根节点,数据有问题吧!!!'); | |
| 587 | + return; | |
| 588 | + } | |
| 589 | + //提取二级节点 | |
| 590 | + var secondMap={}; | |
| 591 | + $.each(rs, function () { | |
| 592 | + if(this.upCode==baseCode){ | |
| 593 | + secondMap[this.businessCode] = { | |
| 594 | + name: this.businessName, | |
| 595 | + childs: [] | |
| 596 | + }; | |
| 597 | + } | |
| 598 | + }); | |
| 599 | + //分公司节点 | |
| 600 | + $.each(rs, function () { | |
| 601 | + if(secondMap[this.upCode]) | |
| 602 | + secondMap[this.upCode].childs.push(this); | |
| 603 | + }); | |
| 604 | + | |
| 605 | + //排序 | |
| 606 | + for(var sid in secondMap){ | |
| 607 | + secondMap[sid].childs.sort(naturalSort); | |
| 608 | + } | |
| 609 | + | |
| 610 | + console.log('secondMap', secondMap); | |
| 611 | + return secondMap; | |
| 612 | + } | |
| 613 | + | |
| 614 | + var naturalSort=function (a, b) { | |
| 615 | + return a.businessName.localeCompare(b.businessName); | |
| 616 | + }; | |
| 617 | + | |
| 618 | + var groupBy = function (list, field) { | |
| 619 | + var rs = {}, | |
| 620 | + key; | |
| 621 | + $.each(list, function () { | |
| 622 | + key = this[field]; | |
| 623 | + if (!rs[key]) | |
| 624 | + rs[key] = []; | |
| 625 | + | |
| 626 | + rs[key].push(this); | |
| 627 | + }); | |
| 628 | + | |
| 629 | + return rs; | |
| 630 | + }; | |
| 631 | +</script> | |
| 632 | +</body> | |
| 633 | 633 | </html> |
| 634 | 634 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/permission/authorize_all/role_auth.html
| 1 | -<!-- 角色授权页面 --> | |
| 2 | -<div id="role_authorize_wrap" style="height: 100%;"> | |
| 3 | - <div class="top_title"></div> | |
| 4 | - <div class="uk-grid-small uk-child-width-expand" uk-grid style="height: calc(100% - 61px);"> | |
| 5 | - <div class="left_menu_list uk-width-2-5"> | |
| 6 | - <div class="save_icon" id="save_menus_btn" > 保存</div> | |
| 7 | - <ul class="ztree" id="treeUlWrap"></ul> | |
| 8 | - </div> | |
| 9 | - <div class="data_auth_list" > | |
| 10 | - <div class="save_icon" id="save_company_data_btn" > 保存</div> | |
| 11 | - <h4 class="uk-heading-bullet" style="margin-top: 15px;">角色数据权限</h4> | |
| 12 | - <div class="cont"> | |
| 13 | - </div> | |
| 14 | - </div> | |
| 15 | - </div> | |
| 16 | - | |
| 17 | - <script id="authorize-role-auth-title-temp" type="text/html"> | |
| 18 | - <div style="font-weight: 600;">{{roleName}}({{codeName}}) <span class="desc_date">-{{createDateStr}}</span> | |
| 19 | - </div> | |
| 20 | - <div class="desc">{{descriptions}}</div> | |
| 21 | - </script> | |
| 22 | - | |
| 23 | - <script id="role-data-authorize-temp" type="text/html"> | |
| 24 | - {{each list as c i}} | |
| 25 | - <div class="_company"> | |
| 26 | - <h5>{{c.name}}</h5> | |
| 27 | - <div class="_fgs"> | |
| 28 | - {{each c.childs as f j}} | |
| 29 | - {{if f.active}} | |
| 30 | - <label class="active" title="{{f.businessName}}" data-company="{{c.name}}" data-id="{{f.upCode}}_{{f.businessCode}}"><input class="uk-checkbox" type="checkbox" checked> {{f.businessName}}</label> | |
| 31 | - {{else}} | |
| 32 | - <label title="{{f.businessName}}" data-company="{{c.name}}" data-id="{{f.upCode}}_{{f.businessCode}}"><input class="uk-checkbox" type="checkbox"> {{f.businessName}}</label> | |
| 33 | - {{/if}} | |
| 34 | - {{/each}} | |
| 35 | - </div> | |
| 36 | - </div> | |
| 37 | - {{/each}} | |
| 38 | - </script> | |
| 39 | - | |
| 40 | - <script> | |
| 41 | - (function () { | |
| 42 | - var wrap = '#role_authorize_wrap', role, modules, companyData; | |
| 43 | - | |
| 44 | - $('.left_menu_list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 45 | - $('.data_auth_list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 46 | - | |
| 47 | - $(wrap).on('init', function (e, data) { | |
| 48 | - e.stopPropagation(); | |
| 49 | - role = data.role; | |
| 50 | - modules = checked_by_role(JSON.parse(JSON.stringify(data.modules))); | |
| 51 | - companyData = JSON.parse(JSON.stringify(data.companyData)); | |
| 52 | - | |
| 53 | - //top title | |
| 54 | - var htmlStr = template('authorize-role-auth-title-temp', role); | |
| 55 | - $('.top_title', wrap).html(htmlStr); | |
| 56 | - | |
| 57 | - //渲染左菜单数 | |
| 58 | - render_modules_tree(); | |
| 59 | - //console.log('modules', modules); | |
| 60 | - //渲染数据权限 | |
| 61 | - render_data_auth_list(); | |
| 62 | - }); | |
| 63 | - | |
| 64 | - | |
| 65 | - var setting = { | |
| 66 | - check: { | |
| 67 | - enable: true | |
| 68 | - }, | |
| 69 | - data: { | |
| 70 | - simpleData: { | |
| 71 | - enable: true | |
| 72 | - } | |
| 73 | - }, | |
| 74 | - view: { | |
| 75 | - showIcon: showIconForTree | |
| 76 | - } | |
| 77 | - }; | |
| 78 | - | |
| 79 | - function render_modules_tree() { | |
| 80 | - var data = [],_show_icon; | |
| 81 | - $.each(modules, function () { | |
| 82 | - _show_icon = true; | |
| 83 | - if(this.path && this.path.length>1){ | |
| 84 | - _show_icon = false; | |
| 85 | - } | |
| 86 | - data.push({ | |
| 87 | - id: this.id, | |
| 88 | - pId: this.pId, | |
| 89 | - name: this.name, | |
| 90 | - open:true, | |
| 91 | - _show_icon: _show_icon, | |
| 92 | - checked: this.checked, | |
| 93 | - _type: this.groupType | |
| 94 | - }); | |
| 95 | - }); | |
| 96 | - var treeObj = $.fn.zTree.init($('#treeUlWrap', wrap), setting, data); | |
| 97 | - | |
| 98 | - setTimeout(function () { | |
| 99 | - $('.left_menu_list', wrap).perfectScrollbar('update'); | |
| 100 | - treeObj.refresh(); | |
| 101 | - }, 400); | |
| 102 | - } | |
| 103 | - | |
| 104 | - function showIconForTree(treeId, treeNode) { | |
| 105 | - return treeNode._show_icon; | |
| 106 | - } | |
| 107 | - | |
| 108 | - $(wrap).on('click', '._company>._fgs>label>input', function () { | |
| 109 | - if(this.checked) | |
| 110 | - $(this).parent().addClass('active'); | |
| 111 | - else | |
| 112 | - $(this).parent().removeClass('active'); | |
| 113 | - | |
| 114 | - }); | |
| 115 | - | |
| 116 | - function render_data_auth_list() { | |
| 117 | - $.get('/companyAuthority/all', {roleId_eq: role.id}, function (rs) { | |
| 118 | - var busData = convert_buss_data(companyData); | |
| 119 | - var authArray = extractId(rs); | |
| 120 | - for(var i=0,c;c=busData[i++];){ | |
| 121 | - for(var j=0,f;f=c.childs[j++];){ | |
| 122 | - if(authArray.indexOf(f.upCode+'_'+f.businessCode) != -1){ | |
| 123 | - f.active=true; | |
| 124 | - } | |
| 125 | - } | |
| 126 | - } | |
| 127 | - | |
| 128 | - var htmlStr = template('role-data-authorize-temp', {list: busData}); | |
| 129 | - $('.data_auth_list>.cont',wrap).html(htmlStr); | |
| 130 | - }); | |
| 131 | - } | |
| 132 | - | |
| 133 | - function convert_buss_data(rs) { | |
| 134 | - var baseCode; | |
| 135 | - //找到跟节点 | |
| 136 | - $.each(rs, function () { | |
| 137 | - if(this.upCode == 0){ | |
| 138 | - baseCode=this.businessCode; | |
| 139 | - return false; | |
| 140 | - } | |
| 141 | - }); | |
| 142 | - if(!baseCode){ | |
| 143 | - alert('大爷找不到根节点,数据有问题吧!!!'); | |
| 144 | - return; | |
| 145 | - } | |
| 146 | - //提取二级节点 | |
| 147 | - var secondMap={}; | |
| 148 | - $.each(rs, function () { | |
| 149 | - if(this.upCode==baseCode){ | |
| 150 | - secondMap[this.businessCode] = { | |
| 151 | - name: this.businessName, | |
| 152 | - childs: [] | |
| 153 | - }; | |
| 154 | - } | |
| 155 | - }); | |
| 156 | - //分公司节点 | |
| 157 | - $.each(rs, function () { | |
| 158 | - if(secondMap[this.upCode]) | |
| 159 | - secondMap[this.upCode].childs.push(this); | |
| 160 | - }); | |
| 161 | - | |
| 162 | - //排序 | |
| 163 | - for(var sid in secondMap){ | |
| 164 | - secondMap[sid].childs.sort(naturalSort); | |
| 165 | - } | |
| 166 | - | |
| 167 | - return get_vals(secondMap); | |
| 168 | - } | |
| 169 | - | |
| 170 | - var naturalSort=function (a, b) { | |
| 171 | - return a.businessCode.localeCompare(b.businessCode); | |
| 172 | - }; | |
| 173 | - | |
| 174 | - var get_vals = function(json) { | |
| 175 | - var array = []; | |
| 176 | - for (var key in json) { | |
| 177 | - array.push(json[key]); | |
| 178 | - } | |
| 179 | - | |
| 180 | - return array; | |
| 181 | - }; | |
| 182 | - | |
| 183 | - function extractId(data) { | |
| 184 | - var idx = []; | |
| 185 | - $.each(data, function () { | |
| 186 | - idx.push(this.companyCode + '_' + this.subCompanyCode); | |
| 187 | - }); | |
| 188 | - return idx; | |
| 189 | - } | |
| 190 | - | |
| 191 | - function checked_by_role(ms) { | |
| 192 | - for(var i = 0,d; d = ms[i++];){ | |
| 193 | - if(!d.roles) | |
| 194 | - continue; | |
| 195 | - | |
| 196 | - for(var j=0,r;r=d.roles[j++];){ | |
| 197 | - if(r.id == role.id){ | |
| 198 | - d.checked=true; | |
| 199 | - break; | |
| 200 | - } | |
| 201 | - } | |
| 202 | - } | |
| 203 | - return ms; | |
| 204 | - } | |
| 205 | - | |
| 206 | - /** | |
| 207 | - * 滚动时, 保存按钮固定 | |
| 208 | - */ | |
| 209 | - $('.left_menu_list', wrap).on('scroll', function () { | |
| 210 | - var top = $(this).scrollTop(); | |
| 211 | - var icon = $(this).find('.save_icon'); | |
| 212 | - icon.css('top', top); | |
| 213 | - }); | |
| 214 | - | |
| 215 | - $('.data_auth_list', wrap).on('scroll', function () { | |
| 216 | - var top = $(this).scrollTop(); | |
| 217 | - var icon = $(this).find('.save_icon'); | |
| 218 | - icon.css('top', top); | |
| 219 | - }); | |
| 220 | - | |
| 221 | - /** | |
| 222 | - * 保存左菜单权限 | |
| 223 | - */ | |
| 224 | - $('#save_menus_btn', wrap).on('click', function () { | |
| 225 | - var treeObj = $.fn.zTree.getZTreeObj("treeUlWrap"); | |
| 226 | - var m_idx = ''; | |
| 227 | - $.each(treeObj.getCheckedNodes(), function () { | |
| 228 | - if(this._type==3) | |
| 229 | - m_idx+=(this.id + ','); | |
| 230 | - }); | |
| 231 | - $.post('/role/settModules', {roleId: role.id,mIds: m_idx}, function(){ | |
| 232 | - UIkit.notification('保存左菜单权限成功!', 'primary'); | |
| 233 | - }); | |
| 234 | - }); | |
| 235 | - | |
| 236 | - /** | |
| 237 | - * 保存分公司数据权限 | |
| 238 | - */ | |
| 239 | - $('#save_company_data_btn', wrap).on('click', function () { | |
| 240 | - var code, data=[]; | |
| 241 | - $('._company>._fgs>label.active').each(function () { | |
| 242 | - code = $(this).data('id').split('_'); | |
| 243 | - data.push({ | |
| 244 | - companyCode: code[0], | |
| 245 | - subCompanyCode: code[1], | |
| 246 | - companyName: $(this).data('company'), | |
| 247 | - subCompanyName: $(this).attr('title') | |
| 248 | - }); | |
| 249 | - }); | |
| 250 | - | |
| 251 | - $.post('/companyAuthority/save', {roleId: role.id, authJsonStr: JSON.stringify(data)}, function (rs) { | |
| 252 | - UIkit.notification('保存数据权限成功!', 'primary'); | |
| 253 | - }) | |
| 254 | - }); | |
| 255 | - })(); | |
| 256 | - </script> | |
| 1 | +<!-- 角色授权页面 --> | |
| 2 | +<div id="role_authorize_wrap" style="height: 100%;"> | |
| 3 | + <div class="top_title"></div> | |
| 4 | + <div class="uk-grid-small uk-child-width-expand" uk-grid style="height: calc(100% - 61px);"> | |
| 5 | + <div class="left_menu_list uk-width-2-5"> | |
| 6 | + <div class="save_icon" id="save_menus_btn" > 保存</div> | |
| 7 | + <ul class="ztree" id="treeUlWrap"></ul> | |
| 8 | + </div> | |
| 9 | + <div class="data_auth_list" > | |
| 10 | + <div class="save_icon" id="save_company_data_btn" > 保存</div> | |
| 11 | + <h4 class="uk-heading-bullet" style="margin-top: 15px;">角色数据权限</h4> | |
| 12 | + <div class="cont"> | |
| 13 | + </div> | |
| 14 | + </div> | |
| 15 | + </div> | |
| 16 | + | |
| 17 | + <script id="authorize-role-auth-title-temp" type="text/html"> | |
| 18 | + <div style="font-weight: 600;">{{roleName}}({{codeName}}) <span class="desc_date">-{{createDateStr}}</span> | |
| 19 | + </div> | |
| 20 | + <div class="desc">{{descriptions}}</div> | |
| 21 | + </script> | |
| 22 | + | |
| 23 | + <script id="role-data-authorize-temp" type="text/html"> | |
| 24 | + {{each list as c i}} | |
| 25 | + <div class="_company"> | |
| 26 | + <h5>{{c.name}}</h5> | |
| 27 | + <div class="_fgs"> | |
| 28 | + {{each c.childs as f j}} | |
| 29 | + {{if f.active}} | |
| 30 | + <label class="active" title="{{f.businessName}}" data-company="{{c.name}}" data-id="{{f.upCode}}_{{f.businessCode}}"><input class="uk-checkbox" type="checkbox" checked> {{f.businessName}}</label> | |
| 31 | + {{else}} | |
| 32 | + <label title="{{f.businessName}}" data-company="{{c.name}}" data-id="{{f.upCode}}_{{f.businessCode}}"><input class="uk-checkbox" type="checkbox"> {{f.businessName}}</label> | |
| 33 | + {{/if}} | |
| 34 | + {{/each}} | |
| 35 | + </div> | |
| 36 | + </div> | |
| 37 | + {{/each}} | |
| 38 | + </script> | |
| 39 | + | |
| 40 | + <script> | |
| 41 | + (function () { | |
| 42 | + var wrap = '#role_authorize_wrap', role, modules, companyData; | |
| 43 | + | |
| 44 | + $('.left_menu_list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 45 | + $('.data_auth_list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 46 | + | |
| 47 | + $(wrap).on('init', function (e, data) { | |
| 48 | + e.stopPropagation(); | |
| 49 | + role = data.role; | |
| 50 | + modules = checked_by_role(JSON.parse(JSON.stringify(data.modules))); | |
| 51 | + companyData = JSON.parse(JSON.stringify(data.companyData)); | |
| 52 | + | |
| 53 | + //top title | |
| 54 | + var htmlStr = template('authorize-role-auth-title-temp', role); | |
| 55 | + $('.top_title', wrap).html(htmlStr); | |
| 56 | + | |
| 57 | + //渲染左菜单数 | |
| 58 | + render_modules_tree(); | |
| 59 | + //console.log('modules', modules); | |
| 60 | + //渲染数据权限 | |
| 61 | + render_data_auth_list(); | |
| 62 | + }); | |
| 63 | + | |
| 64 | + | |
| 65 | + var setting = { | |
| 66 | + check: { | |
| 67 | + enable: true | |
| 68 | + }, | |
| 69 | + data: { | |
| 70 | + simpleData: { | |
| 71 | + enable: true | |
| 72 | + } | |
| 73 | + }, | |
| 74 | + view: { | |
| 75 | + showIcon: showIconForTree | |
| 76 | + } | |
| 77 | + }; | |
| 78 | + | |
| 79 | + function render_modules_tree() { | |
| 80 | + var data = [],_show_icon; | |
| 81 | + $.each(modules, function () { | |
| 82 | + _show_icon = true; | |
| 83 | + if(this.path && this.path.length>1){ | |
| 84 | + _show_icon = false; | |
| 85 | + } | |
| 86 | + data.push({ | |
| 87 | + id: this.id, | |
| 88 | + pId: this.pId, | |
| 89 | + name: this.name, | |
| 90 | + open:true, | |
| 91 | + _show_icon: _show_icon, | |
| 92 | + checked: this.checked, | |
| 93 | + _type: this.groupType | |
| 94 | + }); | |
| 95 | + }); | |
| 96 | + var treeObj = $.fn.zTree.init($('#treeUlWrap', wrap), setting, data); | |
| 97 | + | |
| 98 | + setTimeout(function () { | |
| 99 | + $('.left_menu_list', wrap).perfectScrollbar('update'); | |
| 100 | + treeObj.refresh(); | |
| 101 | + }, 400); | |
| 102 | + } | |
| 103 | + | |
| 104 | + function showIconForTree(treeId, treeNode) { | |
| 105 | + return treeNode._show_icon; | |
| 106 | + } | |
| 107 | + | |
| 108 | + $(wrap).on('click', '._company>._fgs>label>input', function () { | |
| 109 | + if(this.checked) | |
| 110 | + $(this).parent().addClass('active'); | |
| 111 | + else | |
| 112 | + $(this).parent().removeClass('active'); | |
| 113 | + | |
| 114 | + }); | |
| 115 | + | |
| 116 | + function render_data_auth_list() { | |
| 117 | + $.get('/companyAuthority/all', {roleId_eq: role.id}, function (rs) { | |
| 118 | + var busData = convert_buss_data(companyData); | |
| 119 | + var authArray = extractId(rs); | |
| 120 | + for(var i=0,c;c=busData[i++];){ | |
| 121 | + for(var j=0,f;f=c.childs[j++];){ | |
| 122 | + if(authArray.indexOf(f.upCode+'_'+f.businessCode) != -1){ | |
| 123 | + f.active=true; | |
| 124 | + } | |
| 125 | + } | |
| 126 | + } | |
| 127 | + | |
| 128 | + var htmlStr = template('role-data-authorize-temp', {list: busData}); | |
| 129 | + $('.data_auth_list>.cont',wrap).html(htmlStr); | |
| 130 | + }); | |
| 131 | + } | |
| 132 | + | |
| 133 | + function convert_buss_data(rs) { | |
| 134 | + var baseCode; | |
| 135 | + //找到跟节点 | |
| 136 | + $.each(rs, function () { | |
| 137 | + if(this.upCode == 0){ | |
| 138 | + baseCode=this.businessCode; | |
| 139 | + return false; | |
| 140 | + } | |
| 141 | + }); | |
| 142 | + if(!baseCode){ | |
| 143 | + alert('大爷找不到根节点,数据有问题吧!!!'); | |
| 144 | + return; | |
| 145 | + } | |
| 146 | + //提取二级节点 | |
| 147 | + var secondMap={}; | |
| 148 | + $.each(rs, function () { | |
| 149 | + if(this.upCode==baseCode){ | |
| 150 | + secondMap[this.businessCode] = { | |
| 151 | + name: this.businessName, | |
| 152 | + childs: [] | |
| 153 | + }; | |
| 154 | + } | |
| 155 | + }); | |
| 156 | + //分公司节点 | |
| 157 | + $.each(rs, function () { | |
| 158 | + if(secondMap[this.upCode]) | |
| 159 | + secondMap[this.upCode].childs.push(this); | |
| 160 | + }); | |
| 161 | + | |
| 162 | + //排序 | |
| 163 | + for(var sid in secondMap){ | |
| 164 | + secondMap[sid].childs.sort(naturalSort); | |
| 165 | + } | |
| 166 | + | |
| 167 | + return get_vals(secondMap); | |
| 168 | + } | |
| 169 | + | |
| 170 | + var naturalSort=function (a, b) { | |
| 171 | + return a.businessCode.localeCompare(b.businessCode); | |
| 172 | + }; | |
| 173 | + | |
| 174 | + var get_vals = function(json) { | |
| 175 | + var array = []; | |
| 176 | + for (var key in json) { | |
| 177 | + array.push(json[key]); | |
| 178 | + } | |
| 179 | + | |
| 180 | + return array; | |
| 181 | + }; | |
| 182 | + | |
| 183 | + function extractId(data) { | |
| 184 | + var idx = []; | |
| 185 | + $.each(data, function () { | |
| 186 | + idx.push(this.companyCode + '_' + this.subCompanyCode); | |
| 187 | + }); | |
| 188 | + return idx; | |
| 189 | + } | |
| 190 | + | |
| 191 | + function checked_by_role(ms) { | |
| 192 | + for(var i = 0,d; d = ms[i++];){ | |
| 193 | + if(!d.roles) | |
| 194 | + continue; | |
| 195 | + | |
| 196 | + for(var j=0,r;r=d.roles[j++];){ | |
| 197 | + if(r.id == role.id){ | |
| 198 | + d.checked=true; | |
| 199 | + break; | |
| 200 | + } | |
| 201 | + } | |
| 202 | + } | |
| 203 | + return ms; | |
| 204 | + } | |
| 205 | + | |
| 206 | + /** | |
| 207 | + * 滚动时, 保存按钮固定 | |
| 208 | + */ | |
| 209 | + $('.left_menu_list', wrap).on('scroll', function () { | |
| 210 | + var top = $(this).scrollTop(); | |
| 211 | + var icon = $(this).find('.save_icon'); | |
| 212 | + icon.css('top', top); | |
| 213 | + }); | |
| 214 | + | |
| 215 | + $('.data_auth_list', wrap).on('scroll', function () { | |
| 216 | + var top = $(this).scrollTop(); | |
| 217 | + var icon = $(this).find('.save_icon'); | |
| 218 | + icon.css('top', top); | |
| 219 | + }); | |
| 220 | + | |
| 221 | + /** | |
| 222 | + * 保存左菜单权限 | |
| 223 | + */ | |
| 224 | + $('#save_menus_btn', wrap).on('click', function () { | |
| 225 | + var treeObj = $.fn.zTree.getZTreeObj("treeUlWrap"); | |
| 226 | + var m_idx = ''; | |
| 227 | + $.each(treeObj.getCheckedNodes(), function () { | |
| 228 | + if(this._type==3) | |
| 229 | + m_idx+=(this.id + ','); | |
| 230 | + }); | |
| 231 | + $.post('/role/settModules', {roleId: role.id,mIds: m_idx}, function(){ | |
| 232 | + UIkit.notification('保存左菜单权限成功!', 'primary'); | |
| 233 | + }); | |
| 234 | + }); | |
| 235 | + | |
| 236 | + /** | |
| 237 | + * 保存分公司数据权限 | |
| 238 | + */ | |
| 239 | + $('#save_company_data_btn', wrap).on('click', function () { | |
| 240 | + var code, data=[]; | |
| 241 | + $('._company>._fgs>label.active').each(function () { | |
| 242 | + code = $(this).data('id').split('_'); | |
| 243 | + data.push({ | |
| 244 | + companyCode: code[0], | |
| 245 | + subCompanyCode: code[1], | |
| 246 | + companyName: $(this).data('company'), | |
| 247 | + subCompanyName: $(this).attr('title') | |
| 248 | + }); | |
| 249 | + }); | |
| 250 | + | |
| 251 | + $.post('/companyAuthority/save', {roleId: role.id, authJsonStr: JSON.stringify(data)}, function (rs) { | |
| 252 | + UIkit.notification('保存数据权限成功!', 'primary'); | |
| 253 | + }) | |
| 254 | + }); | |
| 255 | + })(); | |
| 256 | + </script> | |
| 257 | 257 | </div> |
| 258 | 258 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/permission/authorize_all/user_auth.html
| 1 | -<!-- 用户线调授权页面 --> | |
| 2 | -<div id="user_authorize_wrap" style="height: 100%;"> | |
| 3 | - <div class="top_title"></div> | |
| 4 | - | |
| 5 | - <div class="xd_line_list"> | |
| 6 | - </div> | |
| 7 | - <div class="top_tools"> | |
| 8 | - <form class="ct_pattern_form"> | |
| 9 | - <div class="uk-margin"> | |
| 10 | - <div uk-form-custom="target: > * > span:first" style="display: none"> | |
| 11 | - <select id="pattern_select" > | |
| 12 | - <option value="0">监控模式</option> | |
| 13 | - <option value="1">主调模式</option> | |
| 14 | - </select> | |
| 15 | - <button class="uk-button uk-button-default" type="button" tabindex="-1"> | |
| 16 | - <span></span> | |
| 17 | - <span uk-icon="icon: chevron-down"></span> | |
| 18 | - </button> | |
| 19 | - </div> | |
| 20 | - </div> | |
| 21 | - </form> | |
| 22 | - <div class="add_line_icon" uk-toggle="target: #select_line_modal"> | |
| 23 | - <i uk-icon="icon: plus"></i> 添加线路 | |
| 24 | - </div> | |
| 25 | - | |
| 26 | - <button class="uk-button uk-button-primary uk-button-small" id="global_save_btn">保存哇!</button> | |
| 27 | - </div> | |
| 28 | - | |
| 29 | - <div class="uk-child-width-expand uk-grid-small xd_menu_grid" uk-grid style="display: none;"> | |
| 30 | - | |
| 31 | - <div> | |
| 32 | - <h4>数据&统计</h4> | |
| 33 | - <ul class="uk-list uk-list-large uk-list-divider"> | |
| 34 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="curr_date_schedule"> 当日计划排班</label></li> | |
| 35 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="cache_data_manage"> 缓存数据管理</label></li> | |
| 36 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="history_sch_maintain"> 历史路单维护</label></li> | |
| 37 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="sch_edit_info"> 班次修正日志</label></li> | |
| 38 | - </ul> | |
| 39 | - </div> | |
| 40 | - | |
| 41 | - <div> | |
| 42 | - <h4>报表管理</h4> | |
| 43 | - <ul class="uk-list uk-list-large uk-list-divider"> | |
| 44 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_waybill"> 行车路单</label></li> | |
| 45 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_history_message"> 调度历史消息</label></li> | |
| 46 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_account"> 驾驶员请求台账</label></li> | |
| 47 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_correctForm"> 修正报表</label></li> | |
| 48 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_statisticsDaily"> 统计日报</label></li> | |
| 49 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleDaily"> 调度日报</label></li> | |
| 50 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_jobSummary"> 工作汇总</label></li> | |
| 51 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_daily"> 班次日报表</label></li> | |
| 52 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_inoutstation"> 班次到离站</label></li> | |
| 53 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_oilListMonth"> 月存油报表</label></li> | |
| 54 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleAnaly"> 时刻表分析</label></li> | |
| 55 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_message"> 调度消息分析</label></li> | |
| 56 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="form_changetochange"> 换人换车情况统计表</label></li> | |
| 57 | - </ul> | |
| 58 | - </div> | |
| 59 | - | |
| 60 | - <div> | |
| 61 | - <h4>车载设备</h4> | |
| 62 | - <ul class="uk-list uk-list-large uk-list-divider"> | |
| 63 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="all_devices"> 设备管理</label></li> | |
| 64 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="directive_history"> 指令下发记录</label></li> | |
| 65 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="device_report"> 设备上报记录</label></li> | |
| 66 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="gps_play_back"> 轨迹回放</label></li> | |
| 67 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="safe_driving"> 安全驾驶(图像)</label></li> | |
| 68 | - </ul> | |
| 69 | - </div> | |
| 70 | - | |
| 71 | - <div> | |
| 72 | - <h4>系统设置</h4> | |
| 73 | - <ul class="uk-list uk-list-large uk-list-divider"> | |
| 74 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="line_config"> 线路配置</label></li> | |
| 75 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="tts_config"> TTS</label></li> | |
| 76 | - <li><label><input class="uk-checkbox" type="checkbox" data-event="signal_state"> 信号标记</label></li> | |
| 77 | - </ul> | |
| 78 | - </div> | |
| 79 | - | |
| 80 | - </div> | |
| 81 | - | |
| 82 | - <!-- This is the modal --> | |
| 83 | - <div id="select_line_modal" class="uk-modal-container" uk-modal="bg-close:false;"> | |
| 84 | - <div class="uk-modal-dialog uk-modal-body"> | |
| 85 | - <button class="uk-modal-close-outside" type="button" uk-close></button> | |
| 86 | - <h2 class="uk-modal-title">添加线路权限</h2> | |
| 87 | - <div> | |
| 88 | - <form> | |
| 89 | - <div class="ct_field"> | |
| 90 | - <label>公司</label> | |
| 91 | - <select class="uk-select" id="modal_company_select"></select> | |
| 92 | - </div> | |
| 93 | - <div class="ct_field"> | |
| 94 | - <label>分公司</label> | |
| 95 | - <select class="uk-select" id="modal_sub_company_select" disabled></select> | |
| 96 | - </div> | |
| 97 | - <div class="ct_field"> | |
| 98 | - <label>线路</label> | |
| 99 | - <input class="uk-input" id="modal_line_input" placeholder="没做拼音映射!!"/> | |
| 100 | - </div> | |
| 101 | - <label><input class="uk-checkbox" type="checkbox" id="globalCheckbox"> 全选</label> | |
| 102 | - </form> | |
| 103 | - <div class="uk-modal-body line_checkbox_list" style="padding: 0 !important;" uk-overflow-auto> | |
| 104 | - </div> | |
| 105 | - </div> | |
| 106 | - <p class="uk-text-right"> | |
| 107 | - <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button> | |
| 108 | - <button class="uk-button uk-button-primary" id="confirmBtn" type="button">确定</button> | |
| 109 | - </p> | |
| 110 | - </div> | |
| 111 | - </div> | |
| 112 | - | |
| 113 | - <script id="authorize-user-auth-lines-temp" type="text/html"> | |
| 114 | - {{each list as t i}} | |
| 115 | - <h5>{{t.fgsName}}</h5> | |
| 116 | - <div class="sub_lines"> | |
| 117 | - {{each t.list as obj j}} | |
| 118 | - <span class="line_btn">{{obj.name}}</span> | |
| 119 | - {{/each}} | |
| 120 | - </div> | |
| 121 | - {{/each}} | |
| 122 | - </script> | |
| 123 | - <script id="authorize-user-auth-title-temp" type="text/html"> | |
| 124 | - <div style="font-weight: 600;">{{name}}({{userName}}) | |
| 125 | - </div> | |
| 126 | - <div class="desc">最近登录 {{lastLoginDateStr}}</div> | |
| 127 | - </script> | |
| 128 | - | |
| 129 | - <script id="authorize-modal-lines-temp" type="text/html"> | |
| 130 | - {{each list as obj i}} | |
| 131 | - <label class="btn" data-gs="{{obj.company}}" data-fgs="{{obj.brancheCompany}}" title="{{obj.name}}" data-code="{{obj.lineCode}}"> | |
| 132 | - <input class="uk-checkbox" type="checkbox" >{{obj.name}} | |
| 133 | - </label> | |
| 134 | - {{/each}} | |
| 135 | - </script> | |
| 136 | - <script> | |
| 137 | - (function () { | |
| 138 | - var wrap = '#user_authorize_wrap', user, xd_auth, all_lines,companyData; | |
| 139 | - //分公司名称映射(只用于分组展示,就写死浦东的,其他区域不用分公司) | |
| 140 | - var fgs_name_mapp={ | |
| 141 | - '55_3': '上南公司(六分公司)', '55_1': '上南公司(二分公司)', '55_2': '上南公司(三分公司)', '55_4': '上南公司(一分公司)', '55_5': '上南公司(培训部)', | |
| 142 | - '22_2': '金高公司(二分公司)', '22_1': '金高公司(四分公司)', '22_3': '金高公司(三分公司)', '22_5': '金高公司(一分公司)', | |
| 143 | - '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_6': '南汇公司(航头枢纽站)', | |
| 144 | - '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)' | |
| 145 | - }; | |
| 146 | - | |
| 147 | - var defauleConfig; | |
| 148 | - | |
| 149 | - $(wrap).on('init', function (e, data) { | |
| 150 | - e.stopPropagation(); | |
| 151 | - user = data.user; | |
| 152 | - all_lines = data.lineArray; | |
| 153 | - companyData = data.companyData; | |
| 154 | - | |
| 155 | - all_lines.sort(function (a, b) { | |
| 156 | - return a.name.localeCompare(b.name); | |
| 157 | - }); | |
| 158 | - //top title | |
| 159 | - var htmlStr = template('authorize-user-auth-title-temp', user); | |
| 160 | - $('.top_title', wrap).html(htmlStr); | |
| 161 | - | |
| 162 | - //用户线调权限 | |
| 163 | - defauleConfig = {userId: user.id, pattern: 0, excludeMenus: 'history_sch_maintain'}; | |
| 164 | - $.get('/realControAuthority/findByUserId', {userId: user.id}, function (rs) { | |
| 165 | - //console.log('rsrs',rs); | |
| 166 | - xd_auth = rs; | |
| 167 | - if(!xd_auth) | |
| 168 | - xd_auth=defauleConfig; | |
| 169 | - //渲染线路权限 | |
| 170 | - render_auth_lines(); | |
| 171 | - //渲染菜单权限 | |
| 172 | - render_auth_menus(); | |
| 173 | - //渲染线路选择modal | |
| 174 | - //render_line_select_modal(); | |
| 175 | - $('#pattern_select',wrap).val(xd_auth.pattern).trigger('change').parent().show(); | |
| 176 | - }); | |
| 177 | - }); | |
| 178 | - | |
| 179 | - function render_auth_lines() { | |
| 180 | - var data = [], codeArray=[]; | |
| 181 | - if(xd_auth && xd_auth.lineCodeStr) | |
| 182 | - codeArray = xd_auth.lineCodeStr.split(','); | |
| 183 | - | |
| 184 | - $.each(all_lines, function () { | |
| 185 | - if(codeArray.indexOf(this.lineCode)!=-1) | |
| 186 | - data.push(this); | |
| 187 | - }); | |
| 188 | - | |
| 189 | - data.sort(function (a, b) { | |
| 190 | - return a.name.localeCompare(b.name); | |
| 191 | - }); | |
| 192 | - //按分公司分组 | |
| 193 | - var gd = groupBy(data, 'cgsbm'); | |
| 194 | - data = []; | |
| 195 | - for(var code in gd){ | |
| 196 | - data.push({ | |
| 197 | - code: code, | |
| 198 | - fgsName: fgs_name_mapp[code], | |
| 199 | - list: gd[code] | |
| 200 | - }) | |
| 201 | - } | |
| 202 | - | |
| 203 | - data.sort(function (a, b) { | |
| 204 | - return a.fgsName.localeCompare(b.fgsName); | |
| 205 | - }); | |
| 206 | - | |
| 207 | - var htmlStr = template('authorize-user-auth-lines-temp', {list: data}); | |
| 208 | - $('.xd_line_list', wrap).html(htmlStr); | |
| 209 | - | |
| 210 | - //滚动条 | |
| 211 | - $('.xd_line_list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 212 | - } | |
| 213 | - | |
| 214 | - function render_auth_menus() { | |
| 215 | - var excludeArray = [],event; | |
| 216 | - if(xd_auth && xd_auth.excludeMenus) | |
| 217 | - excludeArray = xd_auth.excludeMenus.split(','); | |
| 218 | - | |
| 219 | - $('.xd_menu_grid li>label>input').each(function () { | |
| 220 | - event=$(this).data('event'); | |
| 221 | - if(excludeArray.indexOf(event)==-1) | |
| 222 | - this.checked=true; | |
| 223 | - }); | |
| 224 | - $('.xd_menu_grid').show(); | |
| 225 | - $('.xd_menu_grid .uk-list', wrap).perfectScrollbar('update'); | |
| 226 | - } | |
| 227 | - | |
| 228 | - $('.xd_menu_grid .uk-list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 229 | - | |
| 230 | - /** | |
| 231 | - * 线路选择modal | |
| 232 | - */ | |
| 233 | - var compSelectData, modal='#select_line_modal',modalRender; | |
| 234 | - $(modal).on('show', function () { | |
| 235 | - if(!modalRender){ | |
| 236 | - render_line_select_modal(); | |
| 237 | - modalRender = true; | |
| 238 | - } | |
| 239 | - $('#modal_line_input', modal).focus(); | |
| 240 | - }); | |
| 241 | - function render_line_select_modal() { | |
| 242 | - var htmlStr = template('authorize-modal-lines-temp', {list: all_lines}); | |
| 243 | - $('.line_checkbox_list').html(htmlStr); | |
| 244 | - //选中线路 | |
| 245 | - var codeArray=[]; | |
| 246 | - if(xd_auth && xd_auth.lineCodeStr) | |
| 247 | - codeArray = xd_auth.lineCodeStr.split(','); | |
| 248 | - | |
| 249 | - $('.line_checkbox_list>label.btn').each(function () { | |
| 250 | - if(codeArray.indexOf($(this).data('code')+'')!=-1){ | |
| 251 | - $(this).addClass('active').find('>input')[0].checked=true; | |
| 252 | - } | |
| 253 | - }); | |
| 254 | - | |
| 255 | - //构建公司级联下拉框 | |
| 256 | - compSelectData=convert_buss_data(companyData); | |
| 257 | - var companyStr = '<option value="">请选择...</option>'; | |
| 258 | - for(var code in compSelectData){ | |
| 259 | - companyStr+='<option value="'+code+'">'+compSelectData[code].name+'</option>'; | |
| 260 | - } | |
| 261 | - $('#modal_company_select', modal).html(companyStr).on('change', function () { | |
| 262 | - var code = $(this).val(), subSelect=$('#modal_sub_company_select', modal); | |
| 263 | - if(!code) | |
| 264 | - subSelect.empty().attr('disabled', 'disabled'); | |
| 265 | - else{ | |
| 266 | - var subCompStr = '<option value="">请选择...</option>'; | |
| 267 | - $.each(compSelectData[code].childs, function () { | |
| 268 | - subCompStr+='<option value="'+this.businessCode+'">'+this.businessName+'</option>'; | |
| 269 | - }); | |
| 270 | - subSelect.html(subCompStr).removeAttr('disabled'); | |
| 271 | - } | |
| 272 | - //过滤线路 | |
| 273 | - filter_modal_lines(); | |
| 274 | - }); | |
| 275 | - $('#modal_sub_company_select', modal).on('change', filter_modal_lines); | |
| 276 | - } | |
| 277 | - | |
| 278 | - $('#modal_line_input', modal).on('input', function () { | |
| 279 | - var t = $(this).val()+''; | |
| 280 | - if(!t){ | |
| 281 | - filter_modal_lines(); | |
| 282 | - return; | |
| 283 | - } | |
| 284 | - var codes=[]; | |
| 285 | - $.each(all_lines, function () { | |
| 286 | - if(this.name.indexOf(t)!=-1) | |
| 287 | - codes.push(this.lineCode); | |
| 288 | - }); | |
| 289 | - | |
| 290 | - var array = $('.line_checkbox_list>label.btn').css('display', 'none'); | |
| 291 | - array.each(function () { | |
| 292 | - if(codes.indexOf($(this).data('code')+'')!=-1) | |
| 293 | - $(this).css('display', 'inline-block'); | |
| 294 | - }); | |
| 295 | - }); | |
| 296 | - | |
| 297 | - function filter_modal_lines() { | |
| 298 | - var company=$('#modal_company_select', modal).val(),//公司代码 | |
| 299 | - sub_company=$('#modal_sub_company_select', modal).val();//分公司代码 | |
| 300 | - | |
| 301 | - var array = $('.line_checkbox_list>label.btn').css('display', 'none'),s_dom=[]; | |
| 302 | - | |
| 303 | - if(!company && !sub_company){ | |
| 304 | - array.css('display', 'inline-block'); | |
| 305 | - return; | |
| 306 | - } | |
| 307 | - | |
| 308 | - array.each(function () { | |
| 309 | - if(company && $(this).data('gs')!=company) | |
| 310 | - return true; | |
| 311 | - if(sub_company && $(this).data('fgs')!=sub_company) | |
| 312 | - return true; | |
| 313 | - | |
| 314 | - s_dom.push(this); | |
| 315 | - }); | |
| 316 | - for(var i=0,dom;dom=s_dom[i++];) | |
| 317 | - $(dom).css('display', 'inline-block'); | |
| 318 | - } | |
| 319 | - | |
| 320 | - $('.line_checkbox_list').on('click', 'label.btn', function () { | |
| 321 | - if($('input',this)[0].checked) | |
| 322 | - $(this).addClass('active'); | |
| 323 | - else | |
| 324 | - $(this).removeClass('active'); | |
| 325 | - }); | |
| 326 | - | |
| 327 | - //全选 | |
| 328 | - $('#globalCheckbox', modal).on('click', function () { | |
| 329 | - var state=this.checked; | |
| 330 | - $('.line_checkbox_list>label.btn:visible>input').each(function () { | |
| 331 | - this.checked=state; | |
| 332 | - }); | |
| 333 | - | |
| 334 | - $('.line_checkbox_list>label.btn:visible').each(function () { | |
| 335 | - if(state) | |
| 336 | - $(this).addClass('active'); | |
| 337 | - else | |
| 338 | - $(this).removeClass('active'); | |
| 339 | - }); | |
| 340 | - }); | |
| 341 | - | |
| 342 | - //确定 | |
| 343 | - $('#confirmBtn', modal).on('click', function () { | |
| 344 | - var lines=''; | |
| 345 | - $('.line_checkbox_list>label.btn.active').each(function () { | |
| 346 | - lines+=($(this).data('code') + ','); | |
| 347 | - }); | |
| 348 | - xd_auth.lineCodeStr = lines; | |
| 349 | - render_auth_lines(); | |
| 350 | - UIkit.modal(modal).hide(); | |
| 351 | - }); | |
| 352 | - | |
| 353 | - | |
| 354 | - //保存 | |
| 355 | - $('#global_save_btn', wrap).on('click', function () { | |
| 356 | - $(this).attr('disabled', 'disabled'); | |
| 357 | - //调度模式 | |
| 358 | - xd_auth.pattern=$('#pattern_select',wrap).val(); | |
| 359 | - //要排除的线调菜单 | |
| 360 | - var excludeMenus=''; | |
| 361 | - $('.xd_menu_grid ul input[type=checkbox]').each(function () { | |
| 362 | - if(!this.checked) | |
| 363 | - excludeMenus+=$(this).data('event')+','; | |
| 364 | - }); | |
| 365 | - xd_auth.excludeMenus=excludeMenus; | |
| 366 | - $.post('/realControAuthority', xd_auth, function (rs) { | |
| 367 | - UIkit.notification('保存成功!', 'primary'); | |
| 368 | - $('.authorize_right_cont').trigger('refresh-user'); | |
| 369 | - }); | |
| 370 | - }); | |
| 371 | - })(); | |
| 372 | - </script> | |
| 1 | +<!-- 用户线调授权页面 --> | |
| 2 | +<div id="user_authorize_wrap" style="height: 100%;"> | |
| 3 | + <div class="top_title"></div> | |
| 4 | + | |
| 5 | + <div class="xd_line_list"> | |
| 6 | + </div> | |
| 7 | + <div class="top_tools"> | |
| 8 | + <form class="ct_pattern_form"> | |
| 9 | + <div class="uk-margin"> | |
| 10 | + <div uk-form-custom="target: > * > span:first" style="display: none"> | |
| 11 | + <select id="pattern_select" > | |
| 12 | + <option value="0">监控模式</option> | |
| 13 | + <option value="1">主调模式</option> | |
| 14 | + </select> | |
| 15 | + <button class="uk-button uk-button-default" type="button" tabindex="-1"> | |
| 16 | + <span></span> | |
| 17 | + <span uk-icon="icon: chevron-down"></span> | |
| 18 | + </button> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </form> | |
| 22 | + <div class="add_line_icon" uk-toggle="target: #select_line_modal"> | |
| 23 | + <i uk-icon="icon: plus"></i> 添加线路 | |
| 24 | + </div> | |
| 25 | + | |
| 26 | + <button class="uk-button uk-button-primary uk-button-small" id="global_save_btn">保存哇!</button> | |
| 27 | + </div> | |
| 28 | + | |
| 29 | + <div class="uk-child-width-expand uk-grid-small xd_menu_grid" uk-grid style="display: none;"> | |
| 30 | + | |
| 31 | + <div> | |
| 32 | + <h4>数据&统计</h4> | |
| 33 | + <ul class="uk-list uk-list-large uk-list-divider"> | |
| 34 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="curr_date_schedule"> 当日计划排班</label></li> | |
| 35 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="cache_data_manage"> 缓存数据管理</label></li> | |
| 36 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="history_sch_maintain"> 历史路单维护</label></li> | |
| 37 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="sch_edit_info"> 班次修正日志</label></li> | |
| 38 | + </ul> | |
| 39 | + </div> | |
| 40 | + | |
| 41 | + <div> | |
| 42 | + <h4>报表管理</h4> | |
| 43 | + <ul class="uk-list uk-list-large uk-list-divider"> | |
| 44 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_waybill"> 行车路单</label></li> | |
| 45 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_history_message"> 调度历史消息</label></li> | |
| 46 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_account"> 驾驶员请求台账</label></li> | |
| 47 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_correctForm"> 修正报表</label></li> | |
| 48 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_statisticsDaily"> 统计日报</label></li> | |
| 49 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleDaily"> 调度日报</label></li> | |
| 50 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_jobSummary"> 工作汇总</label></li> | |
| 51 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_daily"> 班次日报表</label></li> | |
| 52 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_inoutstation"> 班次到离站</label></li> | |
| 53 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_oilListMonth"> 月存油报表</label></li> | |
| 54 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_scheduleAnaly"> 时刻表分析</label></li> | |
| 55 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_message"> 调度消息分析</label></li> | |
| 56 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="form_changetochange"> 换人换车情况统计表</label></li> | |
| 57 | + </ul> | |
| 58 | + </div> | |
| 59 | + | |
| 60 | + <div> | |
| 61 | + <h4>车载设备</h4> | |
| 62 | + <ul class="uk-list uk-list-large uk-list-divider"> | |
| 63 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="all_devices"> 设备管理</label></li> | |
| 64 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="directive_history"> 指令下发记录</label></li> | |
| 65 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="device_report"> 设备上报记录</label></li> | |
| 66 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="gps_play_back"> 轨迹回放</label></li> | |
| 67 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="safe_driving"> 安全驾驶(图像)</label></li> | |
| 68 | + </ul> | |
| 69 | + </div> | |
| 70 | + | |
| 71 | + <div> | |
| 72 | + <h4>系统设置</h4> | |
| 73 | + <ul class="uk-list uk-list-large uk-list-divider"> | |
| 74 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="line_config"> 线路配置</label></li> | |
| 75 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="tts_config"> TTS</label></li> | |
| 76 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="signal_state"> 信号标记</label></li> | |
| 77 | + </ul> | |
| 78 | + </div> | |
| 79 | + | |
| 80 | + </div> | |
| 81 | + | |
| 82 | + <!-- This is the modal --> | |
| 83 | + <div id="select_line_modal" class="uk-modal-container" uk-modal="bg-close:false;"> | |
| 84 | + <div class="uk-modal-dialog uk-modal-body"> | |
| 85 | + <button class="uk-modal-close-outside" type="button" uk-close></button> | |
| 86 | + <h2 class="uk-modal-title">添加线路权限</h2> | |
| 87 | + <div> | |
| 88 | + <form> | |
| 89 | + <div class="ct_field"> | |
| 90 | + <label>公司</label> | |
| 91 | + <select class="uk-select" id="modal_company_select"></select> | |
| 92 | + </div> | |
| 93 | + <div class="ct_field"> | |
| 94 | + <label>分公司</label> | |
| 95 | + <select class="uk-select" id="modal_sub_company_select" disabled></select> | |
| 96 | + </div> | |
| 97 | + <div class="ct_field"> | |
| 98 | + <label>线路</label> | |
| 99 | + <input class="uk-input" id="modal_line_input" placeholder="没做拼音映射!!"/> | |
| 100 | + </div> | |
| 101 | + <label><input class="uk-checkbox" type="checkbox" id="globalCheckbox"> 全选</label> | |
| 102 | + </form> | |
| 103 | + <div class="uk-modal-body line_checkbox_list" style="padding: 0 !important;" uk-overflow-auto> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + <p class="uk-text-right"> | |
| 107 | + <button class="uk-button uk-button-default uk-modal-close" type="button">取消</button> | |
| 108 | + <button class="uk-button uk-button-primary" id="confirmBtn" type="button">确定</button> | |
| 109 | + </p> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + | |
| 113 | + <script id="authorize-user-auth-lines-temp" type="text/html"> | |
| 114 | + {{each list as t i}} | |
| 115 | + <h5>{{t.fgsName}}</h5> | |
| 116 | + <div class="sub_lines"> | |
| 117 | + {{each t.list as obj j}} | |
| 118 | + <span class="line_btn">{{obj.name}}</span> | |
| 119 | + {{/each}} | |
| 120 | + </div> | |
| 121 | + {{/each}} | |
| 122 | + </script> | |
| 123 | + <script id="authorize-user-auth-title-temp" type="text/html"> | |
| 124 | + <div style="font-weight: 600;">{{name}}({{userName}}) | |
| 125 | + </div> | |
| 126 | + <div class="desc">最近登录 {{lastLoginDateStr}}</div> | |
| 127 | + </script> | |
| 128 | + | |
| 129 | + <script id="authorize-modal-lines-temp" type="text/html"> | |
| 130 | + {{each list as obj i}} | |
| 131 | + <label class="btn" data-gs="{{obj.company}}" data-fgs="{{obj.brancheCompany}}" title="{{obj.name}}" data-code="{{obj.lineCode}}"> | |
| 132 | + <input class="uk-checkbox" type="checkbox" >{{obj.name}} | |
| 133 | + </label> | |
| 134 | + {{/each}} | |
| 135 | + </script> | |
| 136 | + <script> | |
| 137 | + (function () { | |
| 138 | + var wrap = '#user_authorize_wrap', user, xd_auth, all_lines,companyData; | |
| 139 | + //分公司名称映射(只用于分组展示,就写死浦东的,其他区域不用分公司) | |
| 140 | + var fgs_name_mapp={ | |
| 141 | + '55_3': '上南公司(六分公司)', '55_1': '上南公司(二分公司)', '55_2': '上南公司(三分公司)', '55_4': '上南公司(一分公司)', '55_5': '上南公司(培训部)', | |
| 142 | + '22_2': '金高公司(二分公司)', '22_1': '金高公司(四分公司)', '22_3': '金高公司(三分公司)', '22_5': '金高公司(一分公司)', | |
| 143 | + '26_3': '南汇公司(三分公司)', '26_2': '南汇公司(南汇二分)', '26_1': '南汇公司(南汇一分)', '26_4': '南汇公司(南汇维修公司)', '26_6': '南汇公司(航头枢纽站)', | |
| 144 | + '05_5': '杨高公司(杨高分公司)', '05_6': '杨高公司(周浦分公司)', '05_3': '杨高公司(芦潮港分公司)', '05_1': '杨高公司(川沙分公司)', '05_2': '杨高公司(金桥分公司)' | |
| 145 | + }; | |
| 146 | + | |
| 147 | + var defauleConfig; | |
| 148 | + | |
| 149 | + $(wrap).on('init', function (e, data) { | |
| 150 | + e.stopPropagation(); | |
| 151 | + user = data.user; | |
| 152 | + all_lines = data.lineArray; | |
| 153 | + companyData = data.companyData; | |
| 154 | + | |
| 155 | + all_lines.sort(function (a, b) { | |
| 156 | + return a.name.localeCompare(b.name); | |
| 157 | + }); | |
| 158 | + //top title | |
| 159 | + var htmlStr = template('authorize-user-auth-title-temp', user); | |
| 160 | + $('.top_title', wrap).html(htmlStr); | |
| 161 | + | |
| 162 | + //用户线调权限 | |
| 163 | + defauleConfig = {userId: user.id, pattern: 0, excludeMenus: 'history_sch_maintain'}; | |
| 164 | + $.get('/realControAuthority/findByUserId', {userId: user.id}, function (rs) { | |
| 165 | + //console.log('rsrs',rs); | |
| 166 | + xd_auth = rs; | |
| 167 | + if(!xd_auth) | |
| 168 | + xd_auth=defauleConfig; | |
| 169 | + //渲染线路权限 | |
| 170 | + render_auth_lines(); | |
| 171 | + //渲染菜单权限 | |
| 172 | + render_auth_menus(); | |
| 173 | + //渲染线路选择modal | |
| 174 | + //render_line_select_modal(); | |
| 175 | + $('#pattern_select',wrap).val(xd_auth.pattern).trigger('change').parent().show(); | |
| 176 | + }); | |
| 177 | + }); | |
| 178 | + | |
| 179 | + function render_auth_lines() { | |
| 180 | + var data = [], codeArray=[]; | |
| 181 | + if(xd_auth && xd_auth.lineCodeStr) | |
| 182 | + codeArray = xd_auth.lineCodeStr.split(','); | |
| 183 | + | |
| 184 | + $.each(all_lines, function () { | |
| 185 | + if(codeArray.indexOf(this.lineCode)!=-1) | |
| 186 | + data.push(this); | |
| 187 | + }); | |
| 188 | + | |
| 189 | + data.sort(function (a, b) { | |
| 190 | + return a.name.localeCompare(b.name); | |
| 191 | + }); | |
| 192 | + //按分公司分组 | |
| 193 | + var gd = groupBy(data, 'cgsbm'); | |
| 194 | + data = []; | |
| 195 | + for(var code in gd){ | |
| 196 | + data.push({ | |
| 197 | + code: code, | |
| 198 | + fgsName: fgs_name_mapp[code], | |
| 199 | + list: gd[code] | |
| 200 | + }) | |
| 201 | + } | |
| 202 | + | |
| 203 | + data.sort(function (a, b) { | |
| 204 | + return a.fgsName.localeCompare(b.fgsName); | |
| 205 | + }); | |
| 206 | + | |
| 207 | + var htmlStr = template('authorize-user-auth-lines-temp', {list: data}); | |
| 208 | + $('.xd_line_list', wrap).html(htmlStr); | |
| 209 | + | |
| 210 | + //滚动条 | |
| 211 | + $('.xd_line_list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 212 | + } | |
| 213 | + | |
| 214 | + function render_auth_menus() { | |
| 215 | + var excludeArray = [],event; | |
| 216 | + if(xd_auth && xd_auth.excludeMenus) | |
| 217 | + excludeArray = xd_auth.excludeMenus.split(','); | |
| 218 | + | |
| 219 | + $('.xd_menu_grid li>label>input').each(function () { | |
| 220 | + event=$(this).data('event'); | |
| 221 | + if(excludeArray.indexOf(event)==-1) | |
| 222 | + this.checked=true; | |
| 223 | + }); | |
| 224 | + $('.xd_menu_grid').show(); | |
| 225 | + $('.xd_menu_grid .uk-list', wrap).perfectScrollbar('update'); | |
| 226 | + } | |
| 227 | + | |
| 228 | + $('.xd_menu_grid .uk-list', wrap).perfectScrollbar({suppressScrollX: true}); | |
| 229 | + | |
| 230 | + /** | |
| 231 | + * 线路选择modal | |
| 232 | + */ | |
| 233 | + var compSelectData, modal='#select_line_modal',modalRender; | |
| 234 | + $(modal).on('show', function () { | |
| 235 | + if(!modalRender){ | |
| 236 | + render_line_select_modal(); | |
| 237 | + modalRender = true; | |
| 238 | + } | |
| 239 | + $('#modal_line_input', modal).focus(); | |
| 240 | + }); | |
| 241 | + function render_line_select_modal() { | |
| 242 | + var htmlStr = template('authorize-modal-lines-temp', {list: all_lines}); | |
| 243 | + $('.line_checkbox_list').html(htmlStr); | |
| 244 | + //选中线路 | |
| 245 | + var codeArray=[]; | |
| 246 | + if(xd_auth && xd_auth.lineCodeStr) | |
| 247 | + codeArray = xd_auth.lineCodeStr.split(','); | |
| 248 | + | |
| 249 | + $('.line_checkbox_list>label.btn').each(function () { | |
| 250 | + if(codeArray.indexOf($(this).data('code')+'')!=-1){ | |
| 251 | + $(this).addClass('active').find('>input')[0].checked=true; | |
| 252 | + } | |
| 253 | + }); | |
| 254 | + | |
| 255 | + //构建公司级联下拉框 | |
| 256 | + compSelectData=convert_buss_data(companyData); | |
| 257 | + var companyStr = '<option value="">请选择...</option>'; | |
| 258 | + for(var code in compSelectData){ | |
| 259 | + companyStr+='<option value="'+code+'">'+compSelectData[code].name+'</option>'; | |
| 260 | + } | |
| 261 | + $('#modal_company_select', modal).html(companyStr).on('change', function () { | |
| 262 | + var code = $(this).val(), subSelect=$('#modal_sub_company_select', modal); | |
| 263 | + if(!code) | |
| 264 | + subSelect.empty().attr('disabled', 'disabled'); | |
| 265 | + else{ | |
| 266 | + var subCompStr = '<option value="">请选择...</option>'; | |
| 267 | + $.each(compSelectData[code].childs, function () { | |
| 268 | + subCompStr+='<option value="'+this.businessCode+'">'+this.businessName+'</option>'; | |
| 269 | + }); | |
| 270 | + subSelect.html(subCompStr).removeAttr('disabled'); | |
| 271 | + } | |
| 272 | + //过滤线路 | |
| 273 | + filter_modal_lines(); | |
| 274 | + }); | |
| 275 | + $('#modal_sub_company_select', modal).on('change', filter_modal_lines); | |
| 276 | + } | |
| 277 | + | |
| 278 | + $('#modal_line_input', modal).on('input', function () { | |
| 279 | + var t = $(this).val()+''; | |
| 280 | + if(!t){ | |
| 281 | + filter_modal_lines(); | |
| 282 | + return; | |
| 283 | + } | |
| 284 | + var codes=[]; | |
| 285 | + $.each(all_lines, function () { | |
| 286 | + if(this.name.indexOf(t)!=-1) | |
| 287 | + codes.push(this.lineCode); | |
| 288 | + }); | |
| 289 | + | |
| 290 | + var array = $('.line_checkbox_list>label.btn').css('display', 'none'); | |
| 291 | + array.each(function () { | |
| 292 | + if(codes.indexOf($(this).data('code')+'')!=-1) | |
| 293 | + $(this).css('display', 'inline-block'); | |
| 294 | + }); | |
| 295 | + }); | |
| 296 | + | |
| 297 | + function filter_modal_lines() { | |
| 298 | + var company=$('#modal_company_select', modal).val(),//公司代码 | |
| 299 | + sub_company=$('#modal_sub_company_select', modal).val();//分公司代码 | |
| 300 | + | |
| 301 | + var array = $('.line_checkbox_list>label.btn').css('display', 'none'),s_dom=[]; | |
| 302 | + | |
| 303 | + if(!company && !sub_company){ | |
| 304 | + array.css('display', 'inline-block'); | |
| 305 | + return; | |
| 306 | + } | |
| 307 | + | |
| 308 | + array.each(function () { | |
| 309 | + if(company && $(this).data('gs')!=company) | |
| 310 | + return true; | |
| 311 | + if(sub_company && $(this).data('fgs')!=sub_company) | |
| 312 | + return true; | |
| 313 | + | |
| 314 | + s_dom.push(this); | |
| 315 | + }); | |
| 316 | + for(var i=0,dom;dom=s_dom[i++];) | |
| 317 | + $(dom).css('display', 'inline-block'); | |
| 318 | + } | |
| 319 | + | |
| 320 | + $('.line_checkbox_list').on('click', 'label.btn', function () { | |
| 321 | + if($('input',this)[0].checked) | |
| 322 | + $(this).addClass('active'); | |
| 323 | + else | |
| 324 | + $(this).removeClass('active'); | |
| 325 | + }); | |
| 326 | + | |
| 327 | + //全选 | |
| 328 | + $('#globalCheckbox', modal).on('click', function () { | |
| 329 | + var state=this.checked; | |
| 330 | + $('.line_checkbox_list>label.btn:visible>input').each(function () { | |
| 331 | + this.checked=state; | |
| 332 | + }); | |
| 333 | + | |
| 334 | + $('.line_checkbox_list>label.btn:visible').each(function () { | |
| 335 | + if(state) | |
| 336 | + $(this).addClass('active'); | |
| 337 | + else | |
| 338 | + $(this).removeClass('active'); | |
| 339 | + }); | |
| 340 | + }); | |
| 341 | + | |
| 342 | + //确定 | |
| 343 | + $('#confirmBtn', modal).on('click', function () { | |
| 344 | + var lines=''; | |
| 345 | + $('.line_checkbox_list>label.btn.active').each(function () { | |
| 346 | + lines+=($(this).data('code') + ','); | |
| 347 | + }); | |
| 348 | + xd_auth.lineCodeStr = lines; | |
| 349 | + render_auth_lines(); | |
| 350 | + UIkit.modal(modal).hide(); | |
| 351 | + }); | |
| 352 | + | |
| 353 | + | |
| 354 | + //保存 | |
| 355 | + $('#global_save_btn', wrap).on('click', function () { | |
| 356 | + $(this).attr('disabled', 'disabled'); | |
| 357 | + //调度模式 | |
| 358 | + xd_auth.pattern=$('#pattern_select',wrap).val(); | |
| 359 | + //要排除的线调菜单 | |
| 360 | + var excludeMenus=''; | |
| 361 | + $('.xd_menu_grid ul input[type=checkbox]').each(function () { | |
| 362 | + if(!this.checked) | |
| 363 | + excludeMenus+=$(this).data('event')+','; | |
| 364 | + }); | |
| 365 | + xd_auth.excludeMenus=excludeMenus; | |
| 366 | + $.post('/realControAuthority', xd_auth, function (rs) { | |
| 367 | + UIkit.notification('保存成功!', 'primary'); | |
| 368 | + $('.authorize_right_cont').trigger('refresh-user'); | |
| 369 | + }); | |
| 370 | + }); | |
| 371 | + })(); | |
| 372 | + </script> | |
| 373 | 373 | </div> |
| 374 | 374 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/common.js
| ... | ... | @@ -232,8 +232,8 @@ var gb_common = (function () { |
| 232 | 232 | data.push({ |
| 233 | 233 | value: name, |
| 234 | 234 | code: code, |
| 235 | - fullChars: pinyin.getFullChars(name).toLocaleLowerCase(), | |
| 236 | - camelChars: pinyin.getCamelChars(name).toLocaleLowerCase() | |
| 235 | + fullChars: pinyin.getFullChars(name), | |
| 236 | + camelChars: pinyin.getCamelChars(name) | |
| 237 | 237 | }); |
| 238 | 238 | } |
| 239 | 239 | init_autocom_pinyin(element, data); |
| ... | ... | @@ -271,7 +271,7 @@ var gb_common = (function () { |
| 271 | 271 | minLength: 1, |
| 272 | 272 | delay: 50, |
| 273 | 273 | source: function (release) { |
| 274 | - var q = $('input', element).val().toLocaleLowerCase(), | |
| 274 | + var q = $('input', element).val().toUpperCase(), | |
| 275 | 275 | rs = [], |
| 276 | 276 | count = 0; |
| 277 | 277 | |
| ... | ... | @@ -295,7 +295,7 @@ var gb_common = (function () { |
| 295 | 295 | minLength: 1, |
| 296 | 296 | delay: 50, |
| 297 | 297 | source: function (release) { |
| 298 | - var q = $('input', element).val().toLocaleLowerCase(), | |
| 298 | + var q = $('input', element).val().toUpperCase(), | |
| 299 | 299 | rs = [], |
| 300 | 300 | count = 0; |
| 301 | 301 | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_basic.js
| ... | ... | @@ -63,8 +63,8 @@ var gb_data_basic = (function () { |
| 63 | 63 | code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; |
| 64 | 64 | data.push({ |
| 65 | 65 | value: code + '/' + p.name, |
| 66 | - fullChars: p.fullChars, | |
| 67 | - camelChars: p.camelChars | |
| 66 | + fullChars: p.fullChars.toUpperCase(), | |
| 67 | + camelChars: p.camelChars.toUpperCase() | |
| 68 | 68 | }); |
| 69 | 69 | } |
| 70 | 70 | cb && cb(data); | ... | ... |
src/main/resources/static/real_control_v2/js/main.js
| ... | ... | @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) { |
| 169 | 169 | function showUpdateDescription() { |
| 170 | 170 | //更新说明 |
| 171 | 171 | var updateDescription = { |
| 172 | - date: '2017-07-21', | |
| 173 | - text: '<h5>1、修复一个蛮严肃的问题,这个问题有极低的概率导致个别班次的操作不会同步到路单!!!</h5>' | |
| 172 | + date: '2017-07-26', | |
| 173 | + text: '<h5>1、修复一个临时性的小问题,这个问题导致26号上午,起点站和第2站缓冲区重叠的几条线路发不出去!</h5>' | |
| 174 | 174 | }; |
| 175 | 175 | |
| 176 | 176 | var storage = window.localStorage | ... | ... |