From f77e472afe8634dc8852c911c71b79378ad6180f Mon Sep 17 00:00:00 2001 From: jarryliu Date: Sat, 14 May 2016 21:55:20 +0800 Subject: [PATCH 1/5] commit --- go2o-server.go | 22 +++------------------- go2o-tcpserve.go | 2 ++ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/go2o-server.go b/go2o-server.go index 180c5138b..5e87b6e2c 100644 --- a/go2o-server.go +++ b/go2o-server.go @@ -23,9 +23,8 @@ import ( "go2o/src/core/service/dps" "log" "os" - "os/signal" "runtime" - "syscall" + "go2o/src/fix" ) func main() { @@ -63,8 +62,8 @@ func main() { if !newApp.Init(debug, trace) { os.Exit(1) } - - go handleSignal(ch) + fix.CustomFix() + go fix.SignalNotify(ch) if v := newApp.Config().GetInt("server_port"); v != 0 { httpPort = v @@ -95,18 +94,3 @@ func main() { os.Exit(1) // 退出 } - -func handleSignal(srcCh chan bool) { - ch := make(chan os.Signal) - signal.Notify(ch, syscall.SIGHUP, syscall.SIGTERM) - for { - sig := <-ch - switch sig { - case syscall.SIGHUP: - //log.Println("[ OS][ TERM] - go2o sighup ...") - case syscall.SIGTERM: // 退出时 - log.Println("[ OS][ TERM] - go2o server has exit !") - close(srcCh) - } - } -} diff --git a/go2o-tcpserve.go b/go2o-tcpserve.go index fed353b4a..bbc8f9127 100644 --- a/go2o-tcpserve.go +++ b/go2o-tcpserve.go @@ -20,6 +20,7 @@ import ( "os" "os/signal" "syscall" + "go2o/src/fix" ) func main() { @@ -41,6 +42,7 @@ func main() { gof.CurrentApp = core.NewMainApp(conf) dps.Init(gof.CurrentApp) cache.Initialize(gof.CurrentApp.Storage()) + fix.CustomFix() ts := tcpserve.NewServe(logOutput) ts.RegisterJob(tcpserve.MemberSummaryNotifyJob) //注册会员信息通知 From a6058a5d0901b625d90de14a122bb2a8369a9310 Mon Sep 17 00:00:00 2001 From: jarryliu Date: Sun, 15 May 2016 00:34:54 +0800 Subject: [PATCH 2/5] partner views --- README.md | 5 + public/static/assets/js/autoCompletion.js | 174 - public/static/assets/js/buy/buy_confirm.js | 247 - public/static/assets/js/core.js | 20 +- public/static/assets/js/core_full.js | 52 +- public/static/assets/js/global.js | 6 - public/static/assets/js/html5shiv.min.js | 4 - public/static/assets/js/images/menu.gif | Bin 834 -> 0 bytes public/static/assets/js/j6/core.js | 64 - public/static/assets/js/j6/scroller.js | 1 - public/static/assets/js/j6/ui.min.js | 16 - public/static/assets/js/lib/animation.js | 169 - public/static/assets/js/lib/form.js | 2 - public/static/assets/js/member/register.js | 239 - public/static/assets/js/mobi/dg.js | 6 +- public/static/assets/js/modernizr.js | 3 - public/static/assets/js/ppc.js | 29 - public/static/assets/js/ppc_source.js | 0 public/static/assets/js/shopping_cart.js | 333 - public/static/assets/js/shopping_cart.min.js | 333 - .../static/assets/js/shopping_client_cart.js | 174 - public/static/assets/js/tree/tree.js | 4 +- .../bootstrap-3.3.5/css/bootstrap-theme.css | 587 -- .../css/bootstrap-theme.css.map | 1 - .../css/bootstrap-theme.min.css | 5 - .../libs/bootstrap-3.3.5/css/bootstrap.css | 6800 ----------------- .../bootstrap-3.3.5/css/bootstrap.css.map | 1 - .../bootstrap-3.3.5/css/bootstrap.min.css | 5 - .../fonts/glyphicons-halflings-regular.eot | Bin 20127 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 288 - .../fonts/glyphicons-halflings-regular.ttf | Bin 45404 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23424 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff2 | Bin 18028 -> 0 bytes .../libs/bootstrap-3.3.5/js/bootstrap.js | 2363 ------ .../libs/bootstrap-3.3.5/js/bootstrap.min.js | 7 - .../assets/libs/bootstrap-3.3.5/js/npm.js | 13 - .../assets/libs/conflict/bootstrap_jquery.css | 13 - public/static/assets/libs/html5shiv.js | 8 - public/static/assets/libs/respond.min.js | 5 - public/static/assets/mui/css/login.css | 41 +- public/static/assets/mui/js/component.js | 61 +- public/views/master/dashboard.html | 4 +- public/views/master/login.html | 6 +- public/views/master/partner.conf.html | 2 +- public/views/master/partner.create.html | 8 +- public/views/master/partner.edit.html | 2 +- public/views/master/partner.list.html | 6 +- public/views/partner/ad.data3.html | 6 +- public/views/partner/ad.edit.html | 2 +- public/views/partner/ad.image.html | 8 +- public/views/partner/ad.list.html | 6 +- public/views/partner/category.create.html | 55 +- public/views/partner/category.edit.html | 30 +- public/views/partner/category.index.html | 16 +- public/views/partner/category.select.html | 4 +- public/views/partner/conf.profile.html | 8 +- public/views/partner/conf.sale_conf.html | 2 +- public/views/partner/conf.site_conf.html | 13 +- .../views/partner/content.archive_update.html | 18 +- public/views/partner/content.page_edit.html | 6 +- public/views/partner/content.page_list.html | 6 +- public/views/partner/dashboard.html | 79 +- .../partner/delivery.coverage_area_list.html | 4 +- .../views/partner/delivery.create_area.html | 2 +- .../views/partner/finance.balance_info.html | 8 +- .../partner/finance.member_newticket.html | 6 +- public/views/partner/goods.create_goods.html | 24 +- public/views/partner/goods.item_list.html | 6 +- public/views/partner/goods.level_price.html | 2 +- public/views/partner/goods.select.html | 4 +- public/views/partner/goods.set_sale_tag.html | 2 +- public/views/partner/goods.update_goods.html | 18 +- public/views/partner/login.html | 47 +- .../partner/member.apply_request_list.html | 4 +- .../views/partner/member.back_apply_req.html | 2 +- public/views/partner/member.bank_info.html | 2 +- public/views/partner/member.charge.html | 8 +- public/views/partner/member.create_level.html | 2 +- public/views/partner/member.details.html | 14 +- public/views/partner/member.edit_level.html | 2 +- .../partner/member.handle_apply_req.html | 10 +- .../views/partner/member.invi_relation.html | 4 +- public/views/partner/member.level_list.html | 4 +- public/views/partner/member.list.html | 4 +- public/views/partner/member.team_rank.html | 8 +- public/views/partner/mss.edit_mail_tpl.html | 4 +- public/views/partner/mss.mail_tpl_list.html | 6 +- public/views/partner/mss.setting.html | 2 +- public/views/partner/order.cancel.html | 4 +- public/views/partner/order.list.html | 2 +- public/views/partner/order.payment.html | 2 +- public/views/partner/order.waitpay_list.html | 2 +- public/views/partner/pf.earnings_account.html | 4 +- public/views/partner/pf.earnings_log.html | 6 +- .../partner/pf.earnings_transferlog.html | 6 +- public/views/partner/prom.bind_coupon.html | 4 +- public/views/partner/prom.cash_back.html | 6 +- public/views/partner/prom.coupon.html | 6 +- public/views/partner/prom.p1_list.html | 6 +- public/views/partner/prom.p2_list.html | 6 +- public/views/partner/sale.tag_form.html | 4 +- public/views/partner/sale.tag_list.html | 4 +- public/views/partner/shop.create.html | 2 +- public/views/partner/shop.list.html | 4 +- public/views/partner/shop.modify.html | 2 +- public/views/partner/summary.html | 5 +- public/views/shop/ols/app_embed/cart.html | 4 +- .../shop/ols/app_embed/deliver_address.html | 10 +- public/views/shop/ols/app_embed/goods.html | 8 +- public/views/shop/ols/app_embed/list.html | 2 +- public/views/shop/ols/app_embed/login.html | 6 +- .../shop/ols/app_embed/order_confirm.html | 6 +- public/views/shop/ols/app_embed/register.html | 4 +- public/views/shop/ols/mobi/cart.html | 4 +- .../views/shop/ols/mobi/deliver_address.html | 10 +- public/views/shop/ols/mobi/goods.html | 8 +- public/views/shop/ols/mobi/list.html | 2 +- public/views/shop/ols/mobi/login.html | 6 +- public/views/shop/ols/mobi/order_confirm.html | 6 +- public/views/shop/ols/mobi/register.html | 4 +- public/views/shop/ols/pc/deliver_address.html | 10 +- public/views/shop/ols/pc/list.html | 12 +- public/views/shop/ols/pc/login.html | 6 +- public/views/shop/ols/pc/order_confirm.html | 4 +- .../ucenter/app_embed/account.apply_cash.html | 16 +- .../ucenter/app_embed/account.bank_info.html | 2 +- .../app_embed/account.convert_f2p.html | 16 +- .../ucenter/app_embed/account.income_log.html | 6 +- .../app_embed/account.transfer_f2m.html | 20 +- public/views/ucenter/app_embed/delivery.html | 10 +- public/views/ucenter/app_embed/login.html | 8 +- .../views/ucenter/app_embed/order.list.html | 4 +- .../app_embed/order.wait_delivery.html | 6 +- .../ucenter/app_embed/order.wait_payment.html | 6 +- public/views/ucenter/app_embed/profile.html | 2 +- public/views/ucenter/app_embed/pwd.html | 2 +- public/views/ucenter/app_embed/trade_pwd.html | 2 +- .../ucenter/mobi/account.apply_cash.html | 16 +- .../views/ucenter/mobi/account.bank_info.html | 2 +- .../ucenter/mobi/account.convert_f2p.html | 16 +- .../ucenter/mobi/account.income_log.html | 6 +- .../ucenter/mobi/account.transfer_f2m.html | 20 +- public/views/ucenter/mobi/delivery.html | 10 +- public/views/ucenter/mobi/login.html | 8 +- public/views/ucenter/mobi/order.list.html | 4 +- .../ucenter/mobi/order.wait_delivery.html | 6 +- .../ucenter/mobi/order.wait_payment.html | 6 +- public/views/ucenter/mobi/profile.html | 2 +- public/views/ucenter/mobi/pwd.html | 2 +- public/views/ucenter/mobi/trade_pwd.html | 2 +- .../views/ucenter/pc/account.apply_cash.html | 2 +- public/views/ucenter/pc/delivery.html | 6 +- public/views/ucenter/pc/footer.html | 2 +- public/views/ucenter/pc/login.html | 8 +- public/views/ucenter/pc/profile.html | 2 +- public/views/ucenter/pc/pwd.html | 2 +- src/app/front/partner/serve.go | 34 + 157 files changed, 603 insertions(+), 12405 deletions(-) delete mode 100644 public/static/assets/js/autoCompletion.js delete mode 100644 public/static/assets/js/buy/buy_confirm.js delete mode 100644 public/static/assets/js/global.js delete mode 100755 public/static/assets/js/html5shiv.min.js delete mode 100644 public/static/assets/js/images/menu.gif delete mode 100644 public/static/assets/js/j6/core.js delete mode 100644 public/static/assets/js/j6/scroller.js delete mode 100644 public/static/assets/js/j6/ui.min.js delete mode 100755 public/static/assets/js/lib/animation.js delete mode 100755 public/static/assets/js/lib/form.js delete mode 100644 public/static/assets/js/member/register.js delete mode 100644 public/static/assets/js/modernizr.js delete mode 100644 public/static/assets/js/ppc.js delete mode 100644 public/static/assets/js/ppc_source.js delete mode 100644 public/static/assets/js/shopping_cart.js delete mode 100644 public/static/assets/js/shopping_cart.min.js delete mode 100644 public/static/assets/js/shopping_client_cart.js delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/css/bootstrap-theme.css delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/css/bootstrap-theme.css.map delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/css/bootstrap-theme.min.css delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/css/bootstrap.css delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/css/bootstrap.css.map delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/css/bootstrap.min.css delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.eot delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.svg delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.ttf delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/fonts/glyphicons-halflings-regular.woff2 delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/js/bootstrap.js delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/js/bootstrap.min.js delete mode 100644 public/static/assets/libs/bootstrap-3.3.5/js/npm.js delete mode 100644 public/static/assets/libs/conflict/bootstrap_jquery.css delete mode 100644 public/static/assets/libs/html5shiv.js delete mode 100644 public/static/assets/libs/respond.min.js diff --git a/README.md b/README.md index 0547ce202..df62b5cd3 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,11 @@ zhu***@126.com +pub-serve --- 14199 +partner-serve ---- 14192 + + + ## Deploy ## ### 1. Import database ### > Create new mysql db instance named "go2o" diff --git a/public/static/assets/js/autoCompletion.js b/public/static/assets/js/autoCompletion.js deleted file mode 100644 index b62b98a66..000000000 --- a/public/static/assets/js/autoCompletion.js +++ /dev/null @@ -1,174 +0,0 @@ -//自动完成插件 - -function autoCompletion(ele, url, loadCallback, selectCallback,errCallback, charMinLen) { - var panel; - var panelInner; - this.charMinLen = charMinLen || 1; - this.lastChar = ''; - this.isOnFocus = false; - this.timer = null; - this.url = url; - - if (!ele.nodeName) { - ele = j6.$(ele); - } - - - var attachBox = function () { - panel = ele.previousNode; - if (!panel || panel.nodeName != 'DIV' || panel.className != 'ui-autocompletion-panel') { - - //为父元素设为绝对定位 - if (ele.parentNode.offsetLeft > ele.offsetLeft) { - ele.parentNode.style.cssText += 'position:relative'; - } - - - panel = document.createElement('DIV'); - panel.className = 'ui-autocompletion-panel'; - panel.style.cssText = 'curcor:default;z-index:102;position:absolute;left:' + ele.offsetLeft + 'px;top:' - + (ele.offsetTop + ele.offsetHeight) + 'px;width:' + ele.offsetWidth + 'px;overflow:hidden;display:none'; - ele.parentNode.insertBefore(panel, ele); - - - panelInner = document.createElement('DIV'); - panelInner.className = 'inner'; - panelInner.style.cssText = 'background-color:#fff;'; - - panel.appendChild(panelInner); - } else { - panelInner = panel.getElementsByTagName('DIV')[0]; - } - }; - - attachBox(); - - //筛选框 - var handler = (function (e, p, pi, lc, sc,ec, t) { - return function (event, isOnfocus) { - - if (isOnfocus) t.isOnFocus = true; - - //排除alt和ctrl键,空格键 - var _event = window.event || event; - if (_event.altKey || _event.keyCode == 17) return; - //截取中间的字符,移除前后的字符 - var keyStr = e.value; - - //达不到默认长度 - if (/^\s*$/.test(keyStr) && t.charMinLen != 0) return; - keyStr = keyStr.replace(/^(\s*)(.+?)(\s*)$/, '$2'); - - if (keyStr.length < t.charMinLen) return; - - //document.getElementById('t1').innerHTML = t.lastChar + '/' + keyStr + ((t.lastChar != '' && t.lastChar == keyStr)); - //判断是否和上次一样 - if (t.lastChar != '' && t.lastChar == keyStr) { - return; - } else { - t.lastChar = keyStr; - } - - j6.xhr.request({ - uri: t.url + (t.url.indexOf('?') == -1 ? "?" : '&') + 'key=' + encodeURIComponent(keyStr), - params: {}, method: 'GET', data: 'json' - }, { - success: function (json) { - if (lc) lc(json); - if (json.length != 0) { - p.style.display = ''; - - var reg = new RegExp(keyStr, 'i'); - var replaceWord = '' + keyStr + ''; - var html = ''; - - pi.innerHTML = html; - - var lis = pi.getElementsByTagName('LI'); - j6.each(lis, function (i, li) { - li.onmouseover = (function (_p, _lis) { - return function () { - for (var j = 0; j < _lis.length; j++) { - _lis[j].className = j == 0 ? 'first' : ''; - } - this.className = this == lis[0] ? 'first selected' : 'selected'; - }; - })(p, lis); - - li.onclick = (function (j, _p) { - return function () { - e.value = j.text; - _p.style.display = 'none'; - if (e.onblur) e.onblur(); - if (sc) sc(j); - }; - })(json[i], p); - }); - } else { - //隐藏输入框 - p.style.display = 'none'; - } - - //temp - setTimeout(function () { - t.isOnFocus = false; - }, 500); - }, - error:function() { - if (ec && ec instanceof Function)ec(); - } - }); - }; - - })(ele, panel, panelInner, loadCallback, selectCallback, errCallback,this); - - var closeHandler = (function (p, t) { - return function (event) { - if (!t.isOnFocus) { - p.style.display = 'none'; - } - }; - })(panel, this); - - - j6.event.add(ele, 'focus', (function (t) { - return function (event) { - handler(event, true); - //t.timer = setInterval(function() { - // handler(event); - //}, 10); - }; - })(this)); - - j6.event.add(ele, 'keyup', handler); - - //j6.event.add(ele, 'blur', (function(t) { - // return function() { - // clearInterval(t.timer); - // }; - //})(this)); - - //绑定事件 - j6.event.add(document, 'click', closeHandler); - - return this; -} - - -j6.extend({ - autoCompletion: function (ele, url, loadCallback, selectCallback,errCallback, charMinLen) { - return new autoCompletion(ele, url, loadCallback, selectCallback, errCallback,charMinLen); - } -}); \ No newline at end of file diff --git a/public/static/assets/js/buy/buy_confirm.js b/public/static/assets/js/buy/buy_confirm.js deleted file mode 100644 index 563f01d82..000000000 --- a/public/static/assets/js/buy/buy_confirm.js +++ /dev/null @@ -1,247 +0,0 @@ -var pl = j6.$('order-confirm-panel'); -var cashPl = j6.$('cash-panel'); -var couDes = j6.$('coupon_describe'); -var lbBalance = j6.$('lb_balance'); -var ckBalance = j6.$('ck_useBalance'); -var tbCouponCode = j6.$('coupon_code'); -var coupon_fee = 0; - -function setHtm(id, h) { - if (h.length != 0) { - j6.$(id).innerHTML = h; - } -} - -function initEvents() { - var items = j6.dom.getsByClass(pl, 'item'); - var editLinks = j6.dom.getsByClass(pl, 'edit_link'); - var confirmBtns = j6.dom.getsByClass(pl, 'confirm-button'); - - j6.each(editLinks, - function(i, e) { - j6.event.add(e.getElementsByTagName('A')[0], 'click', (function(items, i, e) { - return function() { - j6.each(items, - function(i2, e2) { - if (i2 == i) { - e2.className += ' active_item'; - //e2.style.display='none'; - //j6.animation.toggleHeight(e2,null,15); - } else { - e2.className = e2.className.replace(' active_item', ''); - } - }); - }; - })(items, i, e)); - }); - - j6.each(confirmBtns, - function(i, e) { - j6.event.add(e, 'click', (function(item) { - return function() { - item.className = item.className.replace(' active_item', ''); - }; - })(items[i])); - }); - - j6.$('cb1').onclick = function() {}; - j6.$('el2').onclick = function() { - j6.json.bind('ctl2', { - deliver_opt: window.sctJson.deliver_opt - }); - }; - j6.$('cb2').onclick = function() { - var data = j6.json.toObject('ctl2'); - window.sctJson.deliver_opt = parseInt(data.deliver_opt); - dynamicContent('deliver'); - persistData(); - }; - - j6.$('el3').onclick = function() { - j6.json.bind('ctl3', { - pay_opt: window.sctJson.pay_opt - }); - }; - - j6.$('cb3').onclick = function() { - var data = j6.json.toObject('ctl3'); - window.sctJson.pay_opt = parseInt(data.pay_opt); - dynamicContent('payment'); - persistData(); - }; - -} - -// 页面初始化 -function pageInit(){ - initEvents(); - - if(tbCouponCode){ - j6.event.add(tbCouponCode,'blur',applyCouponCode); - if(tbCouponCode.value.replace(/\\s+/ig,'').length > 0 ){ - applyCouponCode.apply(tbCouponCode); - } - } - - if(lbBalance){ - lbBalance.innerHTML = acc_balance; - } - j6.event.add(ckBalance,'click',reloadFee); - - if(acc_balance>0){ - ckBalance.checked= true; - ckBalance.disabled = false; - }else{ - ckBalance.checked = false; - ckBalance.disabled = true; - } -} - -// 显示动态信息 -function dynamicContent(t) { - var showAll = t == "" || t == null; - // 显示动态支付信息 - if (showAll || t == 'payment') { - var payOpt = parseInt(window.sctJson.pay_opt); - var payOptEle = j6.$('payment_opt_name'); - - if (payOpt == 1) { - payOptEle.innerHTML = '在线支付'; - } else if (payOpt == 2) { - payOptEle.innerHTML = '货到付款'; - }else if(payOpt == 3){ - payOptEle.innerHTML = '转账汇款'; - } - } - - // 显示动态配送信息 - if (showAll || t == 'deliver') { - var dlOpt = parseInt(window.sctJson.deliver_opt); - var dlOptEle = j6.$('deliver_opt_name'); - - if (dlOpt == 1) { - dlOptEle.innerHTML = '智能配送'; - } else if (dlOpt == 2) { - dlOptEle.innerHTML = '上门自提'; - } - - setHtm('deliver_rn', sctJson.deliver_person); - setHtm('deliver_ph', sctJson.deliver_phone); - setHtm('deliver_addr', sctJson.deliver_address); - } -} - -// 更新数据到服务器端 -function persistData() { - j6.xhr.jsonPost('/buy/buyingPersist', window.sctJson, function (d) { - if (d.message) { - window.cli.alert(d.message); - } - }); -} - -// 选择配送地址 -function selectDeliver() { - j6.load('deliver-panel', '/buy/getDeliverAddress?sel=' + window.sctJson.deliver_id); -} - -// 从表单中恢复数据 -function recoverFrom(id) { - window.sctJson = j6.json.toObject(id); - if (window.sctJson.deliver_id <= 0) { - j6.$('item1').className += ' active_item'; - selectDeliver(); - } -} - -function applyCouponCode() { - if (this.value == '') { - j6.validator.removeTip(this); - couDes.innerHTML = ''; - if (couDes.className.indexOf(' hidden') == -1) { - couDes.className += ' hidden'; - } - coupon_fee = 0; - } else { - var t = this; - j6.xhr.jsonPost('/buy/apply?type=coupon', { - code: this.value - }, - function(json) { - if (json.result == false) { - j6.validator.setTip(t, false, null, json.message); - couDes.className = 'coupon_desc hidden'; - coupon_fee = 0; - reloadFee(); - } else { - j6.validator.removeTip(t); - if (json.couponFee) { - couDes.className = 'coupon_desc'; - couDes.innerHTML = '优惠内容:' + json.couponDescribe + - '
使用该优惠券总节省:¥' + json.couponFee + '元'; - } - coupon_fee = json.couponFee; - reloadFee(); - } - }); - } -} - -function submitOrder() { - var ele = this; - - var unDis =function(){ - ele.disabled = false; - ele.className +=' btn-m'; - } - - if (j6.validator.validate('form_coupon')) { - - var data = window.sctJson; - var cp = j6.json.toObject(form_coupon); - if (data.deliver_id <= 0) { - var e = j6.$('item1'); - e.className += ' active_item'; - window.cli.alert("请选择配送地址"); - return false; - } - - ele.disabled = true; - ele.className = ele.className.replace(' btn-m','') - - data.coupon_code = cp.CouponCode; - - data.balance_discount = ckBalance.checked?'1':'0'; - - j6.xhr.jsonPost('submit_0', data, function (j) { - if (j.result) { - var orderNo = j.data; - location.replace("payment?order_no=" + orderNo) - } else { - unDis(); - window.cli.alert(j.message); - } - }, function (x) { - unDis(); - window.cli.alert('订单提交失败'); - }); - } -} - -function reloadFee(promFee,payFee) { - var balancePay = 0; - var _payFee = payFee || order_fee - coupon_fee; - var _promFee = promFee || prom_fee + coupon_fee; - - if(ckBalance.checked && acc_balance > 0 ){ - balancePay = acc_balance > _payFee ?_payFee:acc_balance; - _payFee -= balancePay; - } - j6.json.bind(cashPl, { - PromFee: _promFee, - BalanceFee :balancePay, - OrderFee: _payFee, - }); - _payFee= _payFee.toFixed(2)*100/100 - j6.$('final_fee').innerHTML = _payFee; -} \ No newline at end of file diff --git a/public/static/assets/js/core.js b/public/static/assets/js/core.js index b04568e7f..36397c01c 100644 --- a/public/static/assets/js/core.js +++ b/public/static/assets/js/core.js @@ -3,17 +3,17 @@ function j6l() { this.__VERSION__ = '3.1'; this.__WORKPATH__ = ''; this.__Extend j6.extend({ json: { prefix: 'field', _objReg: /(.+)\[([^\]]+)\]/, _dtReg: /^(\d{4}((\/|-)\d{2}){2})T(\d{2}(:\d{2}){2})((\.\d+)*)$/i, _each: function (a, b) { for (var i = 0; i < a.length; i++) { if (b) b(i, a[i]) } }, _getFields: function (b) { var c = this.prefix; var d = {}; var f; var g, subProName, proValue; if (!b.nodeName) b = document.getElementById(b); var h = this._objReg; this._each(b.getElementsByTagName('*'), function (i, e) { if (e.nodeName != '#text' && e.nodeName != '#comment') { g = e.getAttribute(c); if (g) { if (h.test(g)) { var a = h.exec(g); g = a[1]; subProName = a[2]; if (d[g] == null) { d[g] = {} } d[g][subProName] = e } else { d[g] = e } if (!e.name) e.setAttribute('name', c + '_' + g) } } }); return d }, _bindField: function (a, b) { if (this._dtReg.test(b)) { var c = this._dtReg.exec(b); if (c[4] == '00:00:00') { b = b.replace(this._dtReg, '$1') } else { b = b.replace(this._dtReg, '$1 $4') } } switch (a.nodeName) { case 'TEXTAREA': case 'INPUT': switch (a.type) { default: a.value = b; break; case "radio": var d = document.getElementsByName(a.name); for (var i = 0; i < d.length; i++) { if (d[i].value == b) { d[i].setAttribute('checked', 'checked'); break } } break; case 'checkbox': var e = false; if ((b == true && b.toString() != '1') || b == a.value) { e = true } else if (b.length) { for (var i in b) { if (b[i] == a.value) { e = true; break } } } if (e) { a.setAttribute('checked', 'checked') } else { a.removeAttribute('checked') } break } break; case 'IMG': a.src = b; break; case 'SELECT': a.value = b; break; default: a.innerHTML = b; break } }, _getFieldVal: function (a) { var b = ''; switch (a.nodeName) { case 'TEXTAREA': case 'INPUT': switch (a.type) { default: b = a.value; break; case 'radio': var c = document.getElementsByName(a.name); for (var i = 0; i < c.length; i++) { if (c[i].checked) { b = c[i].value; break } } break; case 'checkbox': b = a.checked ? a.value : ''; break } break; case 'IMG': b = a.src; break; case 'SELECT': b = a.selectedIndex == -1 ? '' : a.options[a.selectedIndex].value; break; default: b = a.innerHTML; break } return b }, bind: function (a, b, c) { var d; var e; var f; d = this._getFields(a); for (var g in d) { e = d[g]; if (c && c instanceof Function) { f = c(g, b[g]) } else { f = b[g] } if (f != null) { if (f instanceof Object) { if (f.length) { for (var i in e) { this._bindField(e[i], f) } } else { for (var i in f) { if (e[i]) { this._bindField(e[i], f[i]) } } } continue } this._bindField(e, f) } } }, __convert: function (a, b, c) { var d; var e; var f; var g = {}; var h = ''; d = this._getFields(a); for (var k in d) { e = d[k]; if (e.nodeName) { f = this._getFieldVal(e); if (c && c instanceof Function) { f = c(k, f) } g[k] = f; h += k + '=' + f + '&' } else { g[k] = {}; var j = 0; var l = false; for (var i in e) { if (j++ == 0 && /^\d+$/.test(i)) { g[k] = []; l = true } if (e[i]) { f = this._getFieldVal(e[i]); if (c && c instanceof Function) { f = c(k, f) } if (f && f != '') { if (l) { g[k].push(f) } else { g[k][i] = f } } h += k + '[' + i + ']=' + f + '&' } } } } return b == "object" ? g : h.replace(/&$/g, '') }, toObject: function (a) { return this.__convert(a, 'object') }, toQueryString: function (a) { return this.__convert(a, 'string') }, toString: function (a) { return this.__convert(a, 'string').replace(/&/g, ';').replace(/=/g, ':') }, string: function (o) { var a = this; var b = []; var c = function (s) { if (typeof s == 'object' && s != null) a.string(s); return /^(string|number)$/.test(typeof s) ? "'" + s + "'" : s }; for (var i in o) { if (o.hasOwnProperty(i)) { var d = c(o[i]); if (d.pop) { b.push("'" + i + "':[\'" + escape(d.join('\',\'')) + '\']') } else { b.push("'" + i + "':" + escape(d)) } } } return '{' + escape(b.join(',')) + '}' } } }); window.j6 = window.j6; -function HS_DateAdd(a, b, c) { b = parseInt(b); if (typeof (c) == "string") { var c = new Date(c.split("-")[0], c.split("-")[1], c.split("-")[2]) } if (typeof (c) == "object") { var c = c } switch (a) { case "y": return new Date(c.getFullYear() + b, c.getMonth(), c.getDate()); break; case "m": return new Date(c.getFullYear(), c.getMonth() + b, checkDate(c.getFullYear(), c.getMonth() + b, c.getDate())); break; case "d": return new Date(c.getFullYear(), c.getMonth(), c.getDate() + b); break; case "w": return new Date(c.getFullYear(), c.getMonth(), 7 * b + c.getDate()); break } } function checkDate(a, b, c) { var d = ["31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31"]; var e = ""; if (a % 4 == 0) { d[1] = "29" } if (c > d[b]) { e = d[b] } else { e = c } return e } function WeekDay(a) { var b; if (typeof (a) == "string") { b = new Date(a.split("-")[0], a.split("-")[1], a.split("-")[2]) } if (typeof (a) == "object") { b = a } return b.getDay() } function HS_calender() { var a = ""; var b = ""; b += ""; var c; if (typeof (arguments[0]) == "string") { selectDate = arguments[0].split("-"); var d = selectDate[0]; var e = parseInt(selectDate[1]) - 1 + ""; var f = selectDate[2]; c = new Date(d, e, f) } else if (typeof (arguments[0]) == "object") { c = arguments[0] } var g = HS_DateAdd("d", "-1", c.getFullYear() + "-" + c.getMonth() + "-01").getDate(); var h = WeekDay(c.getFullYear() + "-" + c.getMonth() + "-01"); var k = HS_DateAdd("d", "-1", c.getFullYear() + "-" + (parseInt(c.getMonth()) + 1).toString() + "-01"); var l = k.getDate(); var n = k.getDay(); var o = c; today = o.getFullYear() + "-" + o.getMonth() + "-" + o.getDate(); var p = ''; for (i = 0; i < h; i++) { a = "
  • " + g + "
  • " + a; g-- } for (i = 1; i <= l; i++) { var m = parseInt(c.getMonth()) + 1; var q = c.getFullYear() + "-" + (m > 10 ? m : '0' + m) + "-" + (i < 10 ? '0' + i : i); if (today == c.getFullYear() + "-" + c.getMonth() + "-" + i) { p = c.getFullYear() + "-" + (parseInt(c.getMonth()) + 1).toString() + "-" + i; a += "
  • " + i + "
  • " } else { a += "
  • " + i + "
  • " } } var j = 1; for (i = n; i < 6; i++) { a += "
  • " + j + "
  • "; j++ } a += b; var r = "»"; r += "«"; r += "" + c.getFullYear() + "" + (parseInt(c.getMonth()) + 1).toString() + "月"; if (arguments.length > 1) { arguments[1].parentNode.parentNode.getElementsByTagName("ul")[1].innerHTML = a; arguments[1].parentNode.innerHTML = r } else { var s = b + "
    " + r + "
      " + a + "
    "; return s } } function _selectThisDay(d) { var a = d.parentNode.parentNode.parentNode.parentNode.parentNode; a.targetObj.value = d.title; a.parentNode.removeChild(a) } function closeCalender(d) { var a = d.parentNode.parentNode.parentNode; a.parentNode.removeChild(a) } function CalenderselectYear(a) { var b = ""; var c = a.innerHTML; for (i = 1970; i <= 2020; i++) { if (i == c) { b += "" } else { b += "" } } b = ""; a.parentNode.innerHTML = b } function selectThisYear(a) { HS_calender(a.value + "-" + a.parentNode.parentNode.getElementsByTagName("span")[1].getElementsByTagName("a")[0].innerHTML + "-1", a.parentNode) } function CalenderselectMonth(a) { var b = ""; var c = a.innerHTML; for (i = 1; i <= 12; i++) { if (i == c) { b += "" } else { b += "" } } b = ""; a.parentNode.innerHTML = b } function selectThisMonth(a) { HS_calender(a.parentNode.parentNode.getElementsByTagName("span")[0].getElementsByTagName("a")[0].innerHTML + "-" + a.value + "-1", a.parentNode) } function setDate(a) { var b = new Date(); if (a.value != '') { b = new Date(a.value) } var c = document.createElement("span"); c.innerHTML = HS_calender(b); c.style.cssText += "position:absolute;z-index:996;"; c.targetObj = a; a.parentNode.insertBefore(c, a.nextSibling) } j6.extend({ calender: function (a) { if (!a.nodeName) a = document.getElementById(a); j6.event.add(a, 'focus', function () { setDate(this) }) }, setDate: function (a) { setDate(a) } }); -function simpleDialog(e) { this._simgpleDialog = true; this.window = window; this.win = window; this.doc = null; this.id = new Date().getMilliseconds() + parseInt(Math.random() * 100); this.title = e.title; this.usedrag = e.usedrag; this.style = e.style || 'ui-dialog'; this.setupFade = !e.setupFade ? e.setupFade : true; this.onclose = e.onclose; if (e.cross != false) { while (this.win.parent != this.win) { this.win = this.win.parent } } this.doc = this.win.document; this._inited = false; this.canvas = { width: this.doc.documentElement.clientWidth, height: Math.min(this.doc.documentElement.clientHeight, this.doc.body.clientHeight), maxHeight: Math.max(this.doc.documentElement.clientHeight, this.doc.body.clientHeight) }; this.point = { x: parseInt((this.canvas.width) / 2) + this.doc.documentElement.scrollLeft, y: parseInt((this.canvas.height) / 2) + this.doc.documentElement.scrollTop }; this.fixBoxPosition = function (a) { var b = this.getPanel().getElementsByTagName('DIV')[1]; if (!a) { this.point.x = (this.canvas.width - b.offsetWidth) / 2 + document.documentElement.scrollLeft; this.point.y = (this.canvas.height - b.offsetHeight) / 2 + document.documentElement.scrollTop; b.style.left = this.point.x + 'px'; b.style.top = this.point.y + 'px'; if (this.title && this.usedrag) { new drag(b.getElementsByTagName('div')[0], this.win).start(b) } } else { var c = this; var i = b.offsetWidth; var d = setInterval(function () { c.point.x = (c.canvas.width - b.offsetWidth) / 2 + document.documentElement.scrollLeft; c.point.y = (c.canvas.height - b.offsetHeight) / 2 + document.documentElement.scrollTop; b.style.left = c.point.x + 'px'; b.style.top = c.point.y + 'px'; if (i != b.offsetWidth) { clearInterval(d); if (c.title && c.usedrag) { new drag(b.getElementsByTagName('div')[0], c.win).start(b) } } }, 1) } } } simpleDialog.prototype._initialize = function () { if (this._inited) { return false } var a = this; var b = this.doc; var c = b.createElement('div'); c.id = 'panel_' + a.id; c.className = a.style; b.body.appendChild(c); var d = b.createElement('div'); d.className = 'bglayer'; d.style.cssText = 'z-index:999;position:absolute;top:0;left:0;width:' + a.canvas.width + 'px;height:' + a.canvas.maxHeight + 'px;'; c.appendChild(d); d = b.createElement("DIV"); d.className = 'box'; d.style.cssText = 'z-index:1000;position:absolute;left:' + (a.point.x) + "px;top:" + (a.point.y) + 'px;'; c.appendChild(d); if (a.title) { var e = b.createElement("div"); e.className = 'title'; e.innerHTML = ' ' + a.title + 'X '; d.appendChild(e); this.win['dialog_' + this.id] = this } var f = b.createElement("DIV"); f.className = 'content boxcontent'; f.id = 'boxcontent_' + this.id; d.appendChild(f); if (a.title) { var g = b.createElement("div"); g.className = 'bottom'; g.style.cssText = "position:relative;"; g.innerHTML = '   '; d.appendChild(g) } this._inited = true }; simpleDialog.prototype.getPanel = function () { return this.doc.getElementById('panel_' + this.id) }; simpleDialog.prototype.async = function (a, b, c, d, e) { this._initialize(); var f = this.doc.getElementById('boxcontent_' + this.id); if (d) { d(f) } var g = j6.xhr; var h = this; if (!b || b.toLowerCase() == "get") { g.get(a, function (x) { j6.loadHTML(f, x); h.fixBoxPosition(true); if (e) e(x) }) } else { g.post(a, c, function (x) { j6.loadHTML(f, x); h.fixBoxPosition(true); if (e) e(x) }) } }; simpleDialog.prototype.open = function (a, b, c, d) { this._initialize(); var e = this.doc.getElementById('boxcontent_' + this.id); e.innerHTML += ""; e.style.width = Math.max(e.scrollWidth, b) + 'px'; e.style.height = Math.max(e.scrollHeight, c) + 'px'; this.fixBoxPosition() }; simpleDialog.prototype.write = function (a) { this._initialize(); var b = this.doc.getElementById('boxcontent_' + this.id); if (!this.title) { b.innerHTML = a } else { var c = b.getElementsByTagName('DIV'); for (var i = 1; i < c.length; i++) { b.removeChild(c[i]) } b.innerHTML += a } this.fixBoxPosition() }; simpleDialog.prototype.getFrameWindow = function () { var a = this.getPanel().getElementsByTagName('IFRAME'); if (a.length > 0) { return a[0].contentWindow } return null }; simpleDialog.prototype.close = function (b) { if (this.onclose != null && this.onclose() == false) { return false } var c = 0; var d = this.getPanel(); var e = (function (a) { return function () { a.document.body.removeChild(d); if (b) b() } }(this.win)); try { delete this.win['dialog_' + this.id] } catch (ex) { this.win['dialog_' + this.id] = null } e(); this._inited = false }; function drag(a, b) { this.elem = a; this.win = b } drag.prototype.regist = function (a, b, c, d) { var o = this.elem; a = a ? a : o; var f, sy; var g = this.win == null ? g : this.win.document; o.style.cursor = b || "move"; var h = c || function (e) { e = e || event; window.getSelection ? window.getSelection().removeAllRanges() : g.selection.empty(); if (e.preventDefault) e.preventDefault(); with (a.style) { position = "absolute"; left = e.clientX - f + "px"; top = e.clientY - sy + "px" } }; j6.event.add(o, "mousedown", function (e) { e = e || event; if (e.button == 1 || e.button == 0) { f = e.clientX - a.offsetLeft; sy = e.clientY - a.offsetTop; j6.event.add(g, 'mousemove', h, false); j6.event.add(g, 'mouseup', i, false) } }, false); var i = function () { j6.event.remove(g, 'mousemove', h, false); j6.event.remove(g, 'mouseup', i, false); if (d && d instanceof Function) d() } }; drag.prototype.custom = function (a, b, c, d) { return this.regist(a, b, c, d) }; drag.prototype.start = function (a) { this.regist(a, null, null, null) }; var SimpleDialog = { create: function (a) { return new simpleDialog(a) }, create2: function (a, b, c, d, e) { return new simpleDialog({ title: a, usedrag: b || false, cross: c || false, style: e, onclose: d }) }, getDialog: function () { var b = null; var c = /^dialog_/i; var e = window; var f = function (a) { var d = null; for (var i in a) { if (c.test(i) && a[i] != null) { d = a[i]; break } } return d }; do { b = f(e); if (b == null) { e = e.parent; b = f(e) } if (b) { break } } while (e.parent != e); return b }, close: function () { var d = this.getDialog(); if (d) d.close() } }; (function (j) { j.extend({ dialog: window.SimpleDialog, drag: function (a, b) { return new drag(a, b) } }) }(j6)); -function datagrid(h, k) { this.panel = h.nodeName ? h : j6.$(h); this.columns = k.columns; this.idField = k.idField || "id"; this.data_url = k.url; this.data = k.data; this.onLoaded = k.loaded; this.loadbox = null; this.gridView = null; this.loading = function () { if (this.gridView.offsetHeight == 0) { var a = this.gridView.previousSibling.offsetHeight; var b = this.panel.offsetHeight - this.gridView.previousSibling.offsetHeight; this.gridView.style.cssText = this.gridView.style.cssText.replace(/(\s*)height:[^;]+;/ig, ' height:' + (b > a ? b + 'px;' : 'auto')); var c = Math.ceil((this.gridView.clientWidth - this.loadbox.offsetWidth) / 2); var d = Math.ceil((this.gridView.clientHeight - this.loadbox.offsetHeight) / 2); this.loadbox.style.cssText = this.loadbox.style.cssText.replace(/(;\s*)*left:[^;]+;([\s\S]*)(\s)top:([^;]+)/ig, '$1left:' + c + 'px;$2 top:' + (d < 0 ? -d : d) + 'px') } this.loadbox.style.display = '' }; this._initLayout = function () { var a = ''; if (this.columns && this.columns.length != 0) { a += '
    '; for (var i in this.columns) { a += '
    ' + this.columns[i].title + '
    ' } a += '
    '; a += '
    ' + '
    加载中...
    ' + '
    ' + '
    ' } this.panel.innerHTML = a; this.gridView = (this.panel.getElementsByClassName ? this.panel.getElementsByClassName('ui-datagrid-view') : j6.dom.getsByClass(this.panel, 'ui-datagrid-view'))[0]; this.loadbox = this.gridView.getElementsByTagName('DIV')[0] }; this._fill_data = function (a) { if (!a) return; var b; var c; var d; var e = ''; var f = a['rows'] || a; e += ''; for (var i = 0; i < f.length; i++) { b = f[i]; e += ''; for (var j in this.columns) { c = this.columns[j]; d = b[c.field]; e += '
    ' + (c.formatter && c.formatter instanceof Function ? c.formatter(d, b, i) : d) + '
    ' } e += '' } e += '
    '; var g = this.gridView.getElementsByTagName('DIV')[1]; g.innerHTML = e; g.srcollTop = 0; this.loadbox.style.display = 'none'; if (this.onLoaded && this.onLoaded instanceof Function) this.onLoaded(a) }; this._fixPosition = function () { }; this._load_data = function (b) { if (!this.data_url) return; var t = this; if (b) { if (!(b instanceof Function)) { b = null } } j6.xhr.request({ uri: this.data_url, data: 'json', params: this.data, method: 'POST' }, { success: function (a) { t._fill_data(a) }, error: function () { } }) }; this._initLayout(); this.load() } datagrid.prototype.resize = function () { this._fixPosition() }; datagrid.prototype.load = function (a) { this.loading(); if (a && a instanceof Object) { this._fill_data(a); return } this._load_data() }; datagrid.prototype.reload = function (a, b) { if (a) { this.data = a } this.load(b) }; j6.extend({ grid: function (a, b) { return new datagrid(a, b) }, datagrid: function (a, b) { return new datagrid(a, b) } }); +function HS_DateAdd(a, b, c) { b = parseInt(b); if (typeof (c) == "string") { var c = new Date(c.split("-")[0], c.split("-")[1], c.split("-")[2]) } if (typeof (c) == "object") { var c = c } switch (a) { case "y": return new Date(c.getFullYear() + b, c.getMonth(), c.getDate()); break; case "m": return new Date(c.getFullYear(), c.getMonth() + b, checkDate(c.getFullYear(), c.getMonth() + b, c.getDate())); break; case "d": return new Date(c.getFullYear(), c.getMonth(), c.getDate() + b); break; case "w": return new Date(c.getFullYear(), c.getMonth(), 7 * b + c.getDate()); break } } function checkDate(a, b, c) { var d = ["31", "28", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31"]; var e = ""; if (a % 4 == 0) { d[1] = "29" } if (c > d[b]) { e = d[b] } else { e = c } return e } function WeekDay(a) { var b; if (typeof (a) == "string") { b = new Date(a.split("-")[0], a.split("-")[1], a.split("-")[2]) } if (typeof (a) == "object") { b = a } return b.getDay() } function HS_calender() { var a = ""; var b = ""; b += ""; var c; if (typeof (arguments[0]) == "string") { selectDate = arguments[0].split("-"); var d = selectDate[0]; var e = parseInt(selectDate[1]) - 1 + ""; var f = selectDate[2]; c = new Date(d, e, f) } else if (typeof (arguments[0]) == "object") { c = arguments[0] } var g = HS_DateAdd("d", "-1", c.getFullYear() + "-" + c.getMonth() + "-01").getDate(); var h = WeekDay(c.getFullYear() + "-" + c.getMonth() + "-01"); var k = HS_DateAdd("d", "-1", c.getFullYear() + "-" + (parseInt(c.getMonth()) + 1).toString() + "-01"); var l = k.getDate(); var n = k.getDay(); var o = c; today = o.getFullYear() + "-" + o.getMonth() + "-" + o.getDate(); var p = ''; for (i = 0; i < h; i++) { a = "
  • " + g + "
  • " + a; g-- } for (i = 1; i <= l; i++) { var m = parseInt(c.getMonth()) + 1; var q = c.getFullYear() + "-" + (m > 10 ? m : '0' + m) + "-" + (i < 10 ? '0' + i : i); if (today == c.getFullYear() + "-" + c.getMonth() + "-" + i) { p = c.getFullYear() + "-" + (parseInt(c.getMonth()) + 1).toString() + "-" + i; a += "
  • " + i + "
  • " } else { a += "
  • " + i + "
  • " } } var j = 1; for (i = n; i < 6; i++) { a += "
  • " + j + "
  • "; j++ } a += b; var r = "»"; r += "«"; r += "" + c.getFullYear() + "" + (parseInt(c.getMonth()) + 1).toString() + "月"; if (arguments.length > 1) { arguments[1].parentNode.parentNode.getElementsByTagName("ul")[1].innerHTML = a; arguments[1].parentNode.innerHTML = r } else { var s = b + "
    " + r + "
      " + a + "
    "; return s } } function _selectThisDay(d) { var a = d.parentNode.parentNode.parentNode.parentNode.parentNode; a.targetObj.value = d.title; a.parentNode.removeChild(a) } function closeCalender(d) { var a = d.parentNode.parentNode.parentNode; a.parentNode.removeChild(a) } function CalenderselectYear(a) { var b = ""; var c = a.innerHTML; for (i = 1970; i <= 2020; i++) { if (i == c) { b += "" } else { b += "" } } b = ""; a.parentNode.innerHTML = b } function selectThisYear(a) { HS_calender(a.value + "-" + a.parentNode.parentNode.getElementsByTagName("span")[1].getElementsByTagName("a")[0].innerHTML + "-1", a.parentNode) } function CalenderselectMonth(a) { var b = ""; var c = a.innerHTML; for (i = 1; i <= 12; i++) { if (i == c) { b += "" } else { b += "" } } b = ""; a.parentNode.innerHTML = b } function selectThisMonth(a) { HS_calender(a.parentNode.parentNode.getElementsByTagName("span")[0].getElementsByTagName("a")[0].innerHTML + "-" + a.value + "-1", a.parentNode) } function setDate(a) { var b = new Date(); if (a.value != '') { b = new Date(a.value) } var c = document.createElement("span"); c.innerHTML = HS_calender(b); c.style.cssText += "position:absolute;z-index:996;"; c.targetObj = a; a.parentNode.insertBefore(c, a.nextSibling) } j6.extend({ calender: function (a) { if (!a.nodeName) a = document.getElementById(a); jr.event.add(a, 'focus', function () { setDate(this) }) }, setDate: function (a) { setDate(a) } }); +function simpleDialog(e) { this._simgpleDialog = true; this.window = window; this.win = window; this.doc = null; this.id = new Date().getMilliseconds() + parseInt(Math.random() * 100); this.title = e.title; this.usedrag = e.usedrag; this.style = e.style || 'ui-dialog'; this.setupFade = !e.setupFade ? e.setupFade : true; this.onclose = e.onclose; if (e.cross != false) { while (this.win.parent != this.win) { this.win = this.win.parent } } this.doc = this.win.document; this._inited = false; this.canvas = { width: this.doc.documentElement.clientWidth, height: Math.min(this.doc.documentElement.clientHeight, this.doc.body.clientHeight), maxHeight: Math.max(this.doc.documentElement.clientHeight, this.doc.body.clientHeight) }; this.point = { x: parseInt((this.canvas.width) / 2) + this.doc.documentElement.scrollLeft, y: parseInt((this.canvas.height) / 2) + this.doc.documentElement.scrollTop }; this.fixBoxPosition = function (a) { var b = this.getPanel().getElementsByTagName('DIV')[1]; if (!a) { this.point.x = (this.canvas.width - b.offsetWidth) / 2 + document.documentElement.scrollLeft; this.point.y = (this.canvas.height - b.offsetHeight) / 2 + document.documentElement.scrollTop; b.style.left = this.point.x + 'px'; b.style.top = this.point.y + 'px'; if (this.title && this.usedrag) { new drag(b.getElementsByTagName('div')[0], this.win).start(b) } } else { var c = this; var i = b.offsetWidth; var d = setInterval(function () { c.point.x = (c.canvas.width - b.offsetWidth) / 2 + document.documentElement.scrollLeft; c.point.y = (c.canvas.height - b.offsetHeight) / 2 + document.documentElement.scrollTop; b.style.left = c.point.x + 'px'; b.style.top = c.point.y + 'px'; if (i != b.offsetWidth) { clearInterval(d); if (c.title && c.usedrag) { new drag(b.getElementsByTagName('div')[0], c.win).start(b) } } }, 1) } } } simpleDialog.prototype._initialize = function () { if (this._inited) { return false } var a = this; var b = this.doc; var c = b.createElement('div'); c.id = 'panel_' + a.id; c.className = a.style; b.body.appendChild(c); var d = b.createElement('div'); d.className = 'bglayer'; d.style.cssText = 'z-index:999;position:absolute;top:0;left:0;width:' + a.canvas.width + 'px;height:' + a.canvas.maxHeight + 'px;'; c.appendChild(d); d = b.createElement("DIV"); d.className = 'box'; d.style.cssText = 'z-index:1000;position:absolute;left:' + (a.point.x) + "px;top:" + (a.point.y) + 'px;'; c.appendChild(d); if (a.title) { var e = b.createElement("div"); e.className = 'title'; e.innerHTML = ' ' + a.title + 'X '; d.appendChild(e); this.win['dialog_' + this.id] = this } var f = b.createElement("DIV"); f.className = 'content boxcontent'; f.id = 'boxcontent_' + this.id; d.appendChild(f); if (a.title) { var g = b.createElement("div"); g.className = 'bottom'; g.style.cssText = "position:relative;"; g.innerHTML = '   '; d.appendChild(g) } this._inited = true }; simpleDialog.prototype.getPanel = function () { return this.doc.getElementById('panel_' + this.id) }; simpleDialog.prototype.async = function (a, b, c, d, e) { this._initialize(); var f = this.doc.getElementById('boxcontent_' + this.id); if (d) { d(f) } var g = j6.xhr; var h = this; if (!b || b.toLowerCase() == "get") { g.get(a, function (x) { j6.loadHTML(f, x); h.fixBoxPosition(true); if (e) e(x) }) } else { g.post(a, c, function (x) { j6.loadHTML(f, x); h.fixBoxPosition(true); if (e) e(x) }) } }; simpleDialog.prototype.open = function (a, b, c, d) { this._initialize(); var e = this.doc.getElementById('boxcontent_' + this.id); e.innerHTML += ""; e.style.width = Math.max(e.scrollWidth, b) + 'px'; e.style.height = Math.max(e.scrollHeight, c) + 'px'; this.fixBoxPosition() }; simpleDialog.prototype.write = function (a) { this._initialize(); var b = this.doc.getElementById('boxcontent_' + this.id); if (!this.title) { b.innerHTML = a } else { var c = b.getElementsByTagName('DIV'); for (var i = 1; i < c.length; i++) { b.removeChild(c[i]) } b.innerHTML += a } this.fixBoxPosition() }; simpleDialog.prototype.getFrameWindow = function () { var a = this.getPanel().getElementsByTagName('IFRAME'); if (a.length > 0) { return a[0].contentWindow } return null }; simpleDialog.prototype.close = function (b) { if (this.onclose != null && this.onclose() == false) { return false } var c = 0; var d = this.getPanel(); var e = (function (a) { return function () { a.document.body.removeChild(d); if (b) b() } }(this.win)); try { delete this.win['dialog_' + this.id] } catch (ex) { this.win['dialog_' + this.id] = null } e(); this._inited = false }; function drag(a, b) { this.elem = a; this.win = b } drag.prototype.regist = function (a, b, c, d) { var o = this.elem; a = a ? a : o; var f, sy; var g = this.win == null ? g : this.win.document; o.style.cursor = b || "move"; var h = c || function (e) { e = e || event; window.getSelection ? window.getSelection().removeAllRanges() : g.selection.empty(); if (e.preventDefault) e.preventDefault(); with (a.style) { position = "absolute"; left = e.clientX - f + "px"; top = e.clientY - sy + "px" } }; jr.event.add(o, "mousedown", function (e) { e = e || event; if (e.button == 1 || e.button == 0) { f = e.clientX - a.offsetLeft; sy = e.clientY - a.offsetTop; jr.event.add(g, 'mousemove', h, false); jr.event.add(g, 'mouseup', i, false) } }, false); var i = function () { jr.event.remove(g, 'mousemove', h, false); jr.event.remove(g, 'mouseup', i, false); if (d && d instanceof Function) d() } }; drag.prototype.custom = function (a, b, c, d) { return this.regist(a, b, c, d) }; drag.prototype.start = function (a) { this.regist(a, null, null, null) }; var SimpleDialog = { create: function (a) { return new simpleDialog(a) }, create2: function (a, b, c, d, e) { return new simpleDialog({ title: a, usedrag: b || false, cross: c || false, style: e, onclose: d }) }, getDialog: function () { var b = null; var c = /^dialog_/i; var e = window; var f = function (a) { var d = null; for (var i in a) { if (c.test(i) && a[i] != null) { d = a[i]; break } } return d }; do { b = f(e); if (b == null) { e = e.parent; b = f(e) } if (b) { break } } while (e.parent != e); return b }, close: function () { var d = this.getDialog(); if (d) d.close() } }; (function (j) { j.extend({ dialog: window.SimpleDialog, drag: function (a, b) { return new drag(a, b) } }) }(j6)); +function datagrid(h, k) { this.panel = h.nodeName ? h : jr.$(h); this.columns = k.columns; this.idField = k.idField || "id"; this.data_url = k.url; this.data = k.data; this.onLoaded = k.loaded; this.loadbox = null; this.gridView = null; this.loading = function () { if (this.gridView.offsetHeight == 0) { var a = this.gridView.previousSibling.offsetHeight; var b = this.panel.offsetHeight - this.gridView.previousSibling.offsetHeight; this.gridView.style.cssText = this.gridView.style.cssText.replace(/(\s*)height:[^;]+;/ig, ' height:' + (b > a ? b + 'px;' : 'auto')); var c = Math.ceil((this.gridView.clientWidth - this.loadbox.offsetWidth) / 2); var d = Math.ceil((this.gridView.clientHeight - this.loadbox.offsetHeight) / 2); this.loadbox.style.cssText = this.loadbox.style.cssText.replace(/(;\s*)*left:[^;]+;([\s\S]*)(\s)top:([^;]+)/ig, '$1left:' + c + 'px;$2 top:' + (d < 0 ? -d : d) + 'px') } this.loadbox.style.display = '' }; this._initLayout = function () { var a = ''; if (this.columns && this.columns.length != 0) { a += '
    '; for (var i in this.columns) { a += '
    ' + this.columns[i].title + '
    ' } a += '
    '; a += '
    ' + '
    加载中...
    ' + '
    ' + '
    ' } this.panel.innerHTML = a; this.gridView = (this.panel.getElementsByClassName ? this.panel.getElementsByClassName('ui-datagrid-view') : j6.dom.getsByClass(this.panel, 'ui-datagrid-view'))[0]; this.loadbox = this.gridView.getElementsByTagName('DIV')[0] }; this._fill_data = function (a) { if (!a) return; var b; var c; var d; var e = ''; var f = a['rows'] || a; e += ''; for (var i = 0; i < f.length; i++) { b = f[i]; e += ''; for (var j in this.columns) { c = this.columns[j]; d = b[c.field]; e += '
    ' + (c.formatter && c.formatter instanceof Function ? c.formatter(d, b, i) : d) + '
    ' } e += '' } e += '
    '; var g = this.gridView.getElementsByTagName('DIV')[1]; g.innerHTML = e; g.srcollTop = 0; this.loadbox.style.display = 'none'; if (this.onLoaded && this.onLoaded instanceof Function) this.onLoaded(a) }; this._fixPosition = function () { }; this._load_data = function (b) { if (!this.data_url) return; var t = this; if (b) { if (!(b instanceof Function)) { b = null } } j6.xhr.request({ uri: this.data_url, data: 'json', params: this.data, method: 'POST' }, { success: function (a) { t._fill_data(a) }, error: function () { } }) }; this._initLayout(); this.load() } datagrid.prototype.resize = function () { this._fixPosition() }; datagrid.prototype.load = function (a) { this.loading(); if (a && a instanceof Object) { this._fill_data(a); return } this._load_data() }; datagrid.prototype.reload = function (a, b) { if (a) { this.data = a } this.load(b) }; j6.extend({ grid: function (a, b) { return new datagrid(a, b) }, datagrid: function (a, b) { return new datagrid(a, b) } }); j6.extend({ form: { getData: function (a) { var b = ''; var c = document.forms[a || 0]; return j6.json.toQueryString(c) }, asyncSubmit: function (a, b) { var c = document.forms[a || 0]; var d = document.getElementById('$async_ifr'); if (!d) { try { d = document.createElement('"; e.style.width = Math.max(e.scrollWidth, b) + 'px'; e.style.height = Math.max(e.scrollHeight, c) + 'px'; this.fixBoxPosition() }; simpleDialog.prototype.write = function (a) { this._initialize(); var b = this.doc.getElementById('boxcontent_' + this.id); if (!this.title) { b.innerHTML = a } else { var c = b.getElementsByTagName('DIV'); for (var i = 1; i < c.length; i++) { b.removeChild(c[i]) } b.innerHTML += a } this.fixBoxPosition() }; simpleDialog.prototype.getFrameWindow = function () { var a = this.getPanel().getElementsByTagName('IFRAME'); if (a.length > 0) { return a[0].contentWindow } return null }; simpleDialog.prototype.close = function (b) { if (this.onclose != null && this.onclose() == false) { return false } var c = 0; var d = this.getPanel(); var e = (function (a) { return function () { a.document.body.removeChild(d); if (b) b() } }(this.win)); try { delete this.win['dialog_' + this.id] } catch (ex) { this.win['dialog_' + this.id] = null } e(); this._inited = false }; function drag(a, b) { this.elem = a; this.win = b } drag.prototype.regist = function (a, b, c, d) { var o = this.elem; a = a ? a : o; var f, sy; var g = this.win == null ? g : this.win.document; o.style.cursor = b || "move"; var h = c || function (e) { e = e || event; window.getSelection ? window.getSelection().removeAllRanges() : g.selection.empty(); if (e.preventDefault) e.preventDefault(); with (a.style) { position = "absolute"; left = e.clientX - f + "px"; top = e.clientY - sy + "px" } }; j6.event.add(o, "mousedown", function (e) { e = e || event; if (e.button == 1 || e.button == 0) { f = e.clientX - a.offsetLeft; sy = e.clientY - a.offsetTop; j6.event.add(g, 'mousemove', h, false); j6.event.add(g, 'mouseup', i, false) } }, false); var i = function () { j6.event.remove(g, 'mousemove', h, false); j6.event.remove(g, 'mouseup', i, false); if (d && d instanceof Function) d() } }; drag.prototype.custom = function (a, b, c, d) { return this.regist(a, b, c, d) }; drag.prototype.start = function (a) { this.regist(a, null, null, null) }; var SimpleDialog = { create: function (a) { return new simpleDialog(a) }, create2: function (a, b, c, d, e) { return new simpleDialog({ title: a, usedrag: b || false, cross: c || false, style: e, onclose: d }) }, getDialog: function () { var b = null; var c = /^dialog_/i; var e = window; var f = function (a) { var d = null; for (var i in a) { if (c.test(i) && a[i] != null) { d = a[i]; break } } return d }; do { b = f(e); if (b == null) { e = e.parent; b = f(e) } if (b) { break } } while (e.parent != e); return b }, close: function () { var d = this.getDialog(); if (d) d.close() } }; (function (j) { j.extend({ dialog: window.SimpleDialog, drag: function (a, b) { return new drag(a, b) } }) }(j6)); -function datagrid(h, k) { this.panel = h.nodeName ? h : j6.$(h); this.columns = k.columns; this.idField = k.idField || "id"; this.data_url = k.url; this.data = k.data; this.onLoaded = k.loaded; this.loadbox = null; this.gridView = null; this.loading = function () { if (this.gridView.offsetHeight == 0) { var a = this.gridView.previousSibling.offsetHeight; var b = this.panel.offsetHeight - this.gridView.previousSibling.offsetHeight; this.gridView.style.cssText = this.gridView.style.cssText.replace(/(\s*)height:[^;]+;/ig, ' height:' + (b > a ? b + 'px;' : 'auto')); var c = Math.ceil((this.gridView.clientWidth - this.loadbox.offsetWidth) / 2); var d = Math.ceil((this.gridView.clientHeight - this.loadbox.offsetHeight) / 2); this.loadbox.style.cssText = this.loadbox.style.cssText.replace(/(;\s*)*left:[^;]+;([\s\S]*)(\s)top:([^;]+)/ig, '$1left:' + c + 'px;$2 top:' + (d < 0 ? -d : d) + 'px') } this.loadbox.style.display = '' }; this._initLayout = function () { var a = ''; if (this.columns && this.columns.length != 0) { a += '
    '; for (var i in this.columns) { a += '
    ' + this.columns[i].title + '
    ' } a += '
    '; a += '
    ' + '
    加载中...
    ' + '
    ' + '
    ' } this.panel.innerHTML = a; this.gridView = (this.panel.getElementsByClassName ? this.panel.getElementsByClassName('ui-datagrid-view') : j6.dom.getsByClass(this.panel, 'ui-datagrid-view'))[0]; this.loadbox = this.gridView.getElementsByTagName('DIV')[0] }; this._fill_data = function (a) { if (!a) return; var b; var c; var d; var e = ''; var f = a['rows'] || a; e += ''; for (var i = 0; i < f.length; i++) { b = f[i]; e += ''; for (var j in this.columns) { c = this.columns[j]; d = b[c.field]; e += '
    ' + (c.formatter && c.formatter instanceof Function ? c.formatter(d, b, i) : d) + '
    ' } e += '' } e += '
    '; var g = this.gridView.getElementsByTagName('DIV')[1]; g.innerHTML = e; g.srcollTop = 0; this.loadbox.style.display = 'none'; if (this.onLoaded && this.onLoaded instanceof Function) this.onLoaded(a) }; this._fixPosition = function () { }; this._load_data = function (b) { if (!this.data_url) return; var t = this; if (b) { if (!(b instanceof Function)) { b = null } } j6.xhr.request({ uri: this.data_url, data: 'json', params: this.data, method: 'POST' }, { success: function (a) { t._fill_data(a) }, error: function () { } }) }; this._initLayout(); this.load() } datagrid.prototype.resize = function () { this._fixPosition() }; datagrid.prototype.load = function (a) { this.loading(); if (a && a instanceof Object) { this._fill_data(a); return } this._load_data() }; datagrid.prototype.reload = function (a, b) { if (a) { this.data = a } this.load(b) }; j6.extend({ grid: function (a, b) { return new datagrid(a, b) }, datagrid: function (a, b) { return new datagrid(a, b) } }); -j6.extend({ form: { getData: function (a) { var b = ''; var c = document.forms[a || 0]; return j6.json.toQueryString(c) }, asyncSubmit: function (a, b) { var c = document.forms[a || 0]; var d = document.getElementById('$async_ifr'); if (!d) { try { d = document.createElement('"; e.style.width = Math.max(e.scrollWidth, b) + 'px'; e.style.height = Math.max(e.scrollHeight, c) + 'px'; this.fixBoxPosition() }; simpleDialog.prototype.write = function (a) { this._initialize(); var b = this.doc.getElementById('boxcontent_' + this.id); if (!this.title) { b.innerHTML = a } else { var c = b.getElementsByTagName('DIV'); for (var i = 1; i < c.length; i++) { b.removeChild(c[i]) } b.innerHTML += a } this.fixBoxPosition() }; simpleDialog.prototype.getFrameWindow = function () { var a = this.getPanel().getElementsByTagName('IFRAME'); if (a.length > 0) { return a[0].contentWindow } return null }; simpleDialog.prototype.getWindow = function () { return this.win }; simpleDialog.prototype.close = function (b) { if (this.onclose != null && this.onclose() == false) { return false } var c = 0; var d = this.getPanel(); var e = (function (a) { return function () { a.document.body.removeChild(d); if (b) b() } }(this.win)); try { delete this.win['dialog_' + this.id] } catch (ex) { this.win['dialog_' + this.id] = null } e(); this._inited = false }; function drag(a, b) { this.elem = a; this.win = b } drag.prototype.regist = function (a, b, c, d) { var o = this.elem; a = a ? a : o; var f, sy; var g = this.win == null ? g : this.win.document; o.style.cursor = b || "move"; var h = c || function (e) { e = e || event; window.getSelection ? window.getSelection().removeAllRanges() : g.selection.empty(); if (e.preventDefault) e.preventDefault(); with (a.style) { position = "absolute"; left = e.clientX - f + "px"; top = e.clientY - sy + "px" } }; jr.event.add(o, "mousedown", function (e) { e = e || event; if (e.button == 1 || e.button == 0) { f = e.clientX - a.offsetLeft; sy = e.clientY - a.offsetTop; jr.event.add(g, 'mousemove', h, false); jr.event.add(g, 'mouseup', i, false) } }, false); var i = function () { jr.event.remove(g, 'mousemove', h, false); jr.event.remove(g, 'mouseup', i, false); if (d && d instanceof Function) d() } }; drag.prototype.custom = function (a, b, c, d) { return this.regist(a, b, c, d) }; drag.prototype.start = function (a) { this.regist(a, null, null, null) }; var SimpleDialog = { create: function (a) { return new simpleDialog(a) }, create2: function (a, b, c, d, e) { return new simpleDialog({ title: a, drag: b || false, cross: c || false, style: e, onclose: d }) }, getDialog: function () { var b = null; var c = /^dialog_/i; var e = window; var f = function (a) { var d = null; for (var i in a) { if (c.test(i) && a[i] != null) { d = a[i]; break } } return d }; do { b = f(e); if (b == null) { e = e.parent; b = f(e) } if (b) { break } } while (e.parent != e); return b }, close: function () { var d = this.getDialog(); if (d) d.close() }, ALERT_MSG_TPL: '
    {msg}
    ', ALERT_BTN_TPL: '', ALERT_ALL_TITLE: '提示', ALERT_BTN_OK_TEXT: '确定', ALERT_BTN_CANCEL_TEXT: '取消', customAlert: function (p) { var b = this.ALERT_ALL_TITLE + '-' + (p.title || ''); b = b.replace(/^-|-$/g, ''); var d = this.create({ title: b, drag: p.drag || true, cross: p.cross || true, canClose: false }); d.write(jr.template(this.ALERT_MSG_TPL, { msg: p.message, icon: p.icon })); var c = ''; for (var i = 0; i < p.buttons.length; i++) { var e = p.buttons[i]; if (e && e.tag) { c += jr.template(this.ALERT_BTN_TPL, { tag: e.tag, text: e.text }) } } var f = Math.floor(Math.random() * 10000); d.write('
    ' + c + '
    '); var g = d.getWindow().document.getElementById('ui-alert-control-' + f); var h = g.getElementsByTagName('INPUT'); for (var i = 0; i < h.length; i++) { if (i === 0) { h[i].focus() } h[i].onclick = (function (d, p) { return function () { var a = this.getAttribute('tag'); if (p.click && p.click instanceof Function) { if (p.click(a, d)) { d.close() } } else { d.close() } } })(d, p) } return d }, alert: function (a, b, c, d) { return this.customAlert({ icon: c, message: a, buttons: [{ tag: 'ok', text: d || this.ALERT_BTN_OK_TEXT }], click: function () { if (b instanceof Function) b(); return true } }) }, confirm: function (b, c, d) { var e = this.ALERT_BTN_OK_TEXT; var f = this.ALERT_BTN_CANCEL_TEXT; if (d instanceof Array && d.length === 2) { e = d[0]; f = d[1] } return this.customAlert({ icon: 'confirm', message: b, buttons: [{ tag: 'ok', text: e }, { tag: 'cancel', text: f }], click: function (a) { if (c instanceof Function) { c(a != 'cancel') } return true } }) } }; (function (j) { j.extend({ dialog: window.SimpleDialog, drag: function (a, b) { return new drag(a, b) } }) }(j6)); +function datagrid(g, h) { this.panel = g.nodeName ? g : jr.$(g); this.columns = h.columns; this.idField = h.idField || "id"; this.data_url = h.url; this.data = h.data; this.onLoaded = h.loaded; this.loadbox = null; this.gridView = null; this.loading = function () { if (this.gridView.offsetHeight === 0) { var a = this.gridView.previousSibling.offsetHeight; var b = this.panel.offsetHeight - a; this.gridView.style.cssText = this.gridView.style.cssText.replace(/(\s*)height:[^;]+;/ig, ' height:' + (b > a ? b + 'px;' : 'auto')); var c = Math.ceil((this.gridView.clientWidth - this.loadbox.offsetWidth) / 2); var d = Math.ceil((this.gridView.clientHeight - this.loadbox.offsetHeight) / 2); this.loadbox.style.cssText = this.loadbox.style.cssText.replace(/(;\s*)*left:[^;]+;([\s\S]*)(\s)top:([^;]+)/ig, '$1left:' + c + 'px;$2 top:' + (d < 0 ? -d : d) + 'px') } this.loadbox.style.display = '' }; this._initLayout = function () { var a = ''; if (this.columns && this.columns.length != 0) { a += '
    '; for (var i in this.columns) { a += '
    ' + this.columns[i].title + '
    ' } a += '
    '; a += '
    加载中...
    ' + '
    ' } this.panel.innerHTML = a; this.gridView = (this.panel.getElementsByClassName ? this.panel.getElementsByClassName('ui-datagrid-view') : jr.dom.getsByClass(this.panel, 'ui-datagrid-view'))[0]; this.loadbox = this.gridView.previousSibling }; this._fill_data = function (a) { if (!a) return; var b; var c; var d; var e = ''; var f = a['rows'] || a; e += ''; for (var i = 0; i < f.length; i++) { b = f[i]; e += ''; for (var j in this.columns) { c = this.columns[j]; d = b[c.field]; e += '
    ' + (c.formatter && c.formatter instanceof Function ? c.formatter(d, b, i) : d) + '
    ' } e += '' } e += '
    '; this.gridView.innerHTML = e; this.gridView.srcollTop = 0; this.loadbox.style.display = 'none'; if (this.onLoaded && this.onLoaded instanceof Function) this.onLoaded(a) }; this._fixPosition = function () { }; this._load_data = function (b) { if (!this.data_url) return; var t = this; if (b) { if (!(b instanceof Function)) { b = null } } jr.xhr.request({ uri: this.data_url, data: 'json', params: this.data, method: 'POST' }, { success: function (a) { t._fill_data(a) }, error: function () { } }) }; this._initLayout(); this.load() } datagrid.prototype.resize = function () { this._fixPosition() }; datagrid.prototype.load = function (a) { this.loading(); if (a && a instanceof Object) { this._fill_data(a); return } this._load_data() }; datagrid.prototype.reload = function (a, b) { if (a) { this.data = a } this.load(b) }; jr.extend({ grid: function (a, b) { return new datagrid(a, b) }, datagrid: function (a, b) { return new datagrid(a, b) } }); +jr.extend({ form: { getData: function (a) { var b = ''; var c = document.forms[a || 0]; return jr.json.toQueryString(c) }, asyncSubmit: function (a, b) { var c = document.forms[a || 0]; var d = document.getElementById('$async_ifr'); if (!d) { try { d = document.createElement('";e.style.width=Math.max(e.scrollWidth,b)+'px';e.style.height=Math.max(e.scrollHeight,c)+'px';this.fixBoxPosition()};simpleDialog.prototype.write=function(a){this._initialize();var b=this.doc.getElementById('boxcontent_'+this.id);if(!this.title){b.innerHTML=a}else{var c=b.getElementsByTagName('DIV');for(var i=1;i0){return a[0].contentWindow}return null};simpleDialog.prototype.close=function(b){if(this.onclose!=null&&this.onclose()==false){return false}var c=0;var d=this.getPanel();var e=(function(a){return function(){a.document.body.removeChild(d);if(b)b()}}(this.win));try{delete this.win['dialog_'+this.id]}catch(ex){this.win['dialog_'+this.id]=null}e();this._inited=false};function drag(a,b){this.elem=a;this.win=b}drag.prototype.regist=function(a,b,c,d){var o=this.elem;a=a?a:o;var f,sy;var g=this.win==null?g:this.win.document;o.style.cursor=b||"move";var h=c||function(e){e=e||event;window.getSelection?window.getSelection().removeAllRanges():g.selection.empty();if(e.preventDefault)e.preventDefault();with(a.style){position="absolute";left=e.clientX-f+"px";top=e.clientY-sy+"px"}};j6.event.add(o,"mousedown",function(e){e=e||event;if(e.button==1||e.button==0){f=e.clientX-a.offsetLeft;sy=e.clientY-a.offsetTop;j6.event.add(g,'mousemove',h,false);j6.event.add(g,'mouseup',i,false)}},false);var i=function(){j6.event.remove(g,'mousemove',h,false);j6.event.remove(g,'mouseup',i,false);if(d&&d instanceof Function)d()}};drag.prototype.custom=function(a,b,c,d){return this.regist(a,b,c,d)};drag.prototype.start=function(a){this.regist(a,null,null,null)};var SimpleDialog={create:function(a){return new simpleDialog(a)},create2:function(a,b,c,d,e){return new simpleDialog({title:a,drag:b||false,cross:c||false,style:e,onclose:d})},getDialog:function(){var b=null;var c=/^dialog_/i;var e=window;var f=function(a){var d=null;for(var i in a){if(c.test(i)&&a[i]!=null){d=a[i];break}}return d};do{b=f(e);if(b==null){e=e.parent;b=f(e)}if(b){break}}while(e.parent!=e);return b},close:function(){var d=this.getDialog();if(d)d.close()},ALERT_MSG_TPL:'
    {msg}
    ',ALERT_BTN_TPL:'',ALERT_ALL_TITLE:'提示',ALERT_BTN_OK_TEXT:'确定',ALERT_BTN_CANCEL_TEXT:'取消',customAlert:function(p){var b=this.ALERT_ALL_TITLE+'-'+(p.title||'');b=b.replace(/^-|-$/g,'');var d=this.create({title:b,drag:p.drag||true,cross:p.cross||true,canClose:false});d.write(j6.template(this.ALERT_MSG_TPL,{msg:p.message,icon:p.icon}));var c='';for(var i=0;i'+c+'');var g=j6.$('ui-alert-control-'+f).getElementsByTagName('INPUT');for(var i=0;i>5]|=0x80<<(24-f%32);x[((f+64>>9)<<4)+15]=f;var w=Array(80);var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;var e=-1009589776;for(var i=0;i16)c=core_sha1(c,a.length*chrsz);var d=Array(16),opad=Array(16);for(var i=0;i<16;i++){d[i]=c[i]^0x36363636;opad[i]=c[i]^0x5C5C5C5C}var e=core_sha1(d.concat(str2binb(b)),512+b.length*chrsz);return core_sha1(opad.concat(e),512+160)}function safe_add(x,y){var a=(x&0xFFFF)+(y&0xFFFF);var b=(x>>16)+(y>>16)+(a>>16);return(b<<16)|(a&0xFFFF)}function rol(a,b){return(a<>>(32-b))}function str2binb(a){var b=Array();var c=(1<>5]|=(a.charCodeAt(i/chrsz)&c)<<(24-i%32);return b}function binb2str(a){var b="";var c=(1<>5]>>>(24-i%32))&c);return b}function binb2hex(a){var b=hexcase?"0123456789ABCDEF":"0123456789abcdef";var c="";for(var i=0;i>2]>>((3-i%4)*8+4))&0xF)+b.charAt((a[i>>2]>>((3-i%4)*8))&0xF)}return c}function binb2b64(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var c="";for(var i=0;i>2]>>8*(3-i%4))&0xFF)<<16)|(((a[i+1>>2]>>8*(3-(i+1)%4))&0xFF)<<8)|((a[i+2>>2]>>8*(3-(i+2)%4))&0xFF);for(var j=0;j<4;j++){if(i*8+j*6>a.length*32)c+=b64pad;else c+=b.charAt((d>>6*(3-j))&0x3F)}}return c} - -function unix2str(v){ - if(typeof(v)=='string'){ - v = parseInt(v); - } - return new Date(v*1000).format("yyyy-MM-dd HH:mm:ss"); -} -function sha1(s){ - return hex_sha1(hex_sha1(s+"@h3f.net")); -} \ No newline at end of file diff --git a/public/static/assets/js/lib/animation.js b/public/static/assets/js/lib/animation.js deleted file mode 100755 index 6a33520e0..000000000 --- a/public/static/assets/js/lib/animation.js +++ /dev/null @@ -1,169 +0,0 @@ -j6.extend({ - animation: { - timer: function (call, overCall, start, end, speed) { - if (!call) return; - var _start = start != null ? start : 0; - var _end = end != null ? end : 100; - - var _setup = 0; - var _interval = 0; - - //速度:1-5倍 - if (speed < 1 || speed > 5) { - _setup = (end - start) < 0 ? -speed : speed; - _interval = 20; - } else { - //(end-start)/20,假定interval = 50 - _setup = (_end - _start) / (4 * (6 - speed)); - //参照100次的时间来计算步长 - _setup *= (Math.abs(_end - _start) / 100); - - //修正interval - _interval = 1000 / _setup; - _interval = _interval < 0 ? -Math.ceil(_interval) : Math.floor(_interval); - if (_interval < 30) _interval = 30; - } - // alert("start:"+_start+"/ end:"+_end+" / setup:"+_setup+'/ interval: '+_interval) - - var t = setInterval(function () { - _start = _start + _setup; - if (Math.abs(_start) >= Math.abs(_end)) { - _start = _end; - if (overCall instanceof Function) overCall(); - clearInterval(t); - } - call(_start, _setup); - }, _interval); - }, - opacity: function (e, call, end, speed) { - var ele = j6.$(e); - var s = j6.style(ele); - var start = s["opacity"]; - - //获取ie的透明度 - if (start == undefined) { - if (ele.filters.alpha) { - start = ele.filters.alpha.opacity / 100; - } else { - start = 0; - } - } - - this.timer((function (e) { - return function (t, setup) { - var isRev = setup < 0; - var _opacity = isRev ? (100 + t) / 100 : t / 100; - e.style.opacity = _opacity; - e.style.filter = 'alpha(opacity=' + (_opacity * 100) + ')'; - if (t == -100 && isRev) { - e.style.display = 'none'; - } else if (!isRev && t == setup) { - e.style.display = ''; - } - } - })(ele), call, parseInt(start), end, speed); - }, - fade: function (e, call, speed) { - var _speed = speed != null ? speed : 3; - var _end = -100; - this.opacity(e, call, _end, _speed); - }, - show: function (e, call, speed) { - var _speed = speed != null ? speed : 3; - var _end = 100; - this.opacity(e, call, _end, _speed); - }, - toggle: function (e, call, speed) { - this._toggle(e, 'wh', call, speed); - }, - toggleWidth: function (e, call, speed) { - this._toggle(e, 'w', call, speed); - }, - toggleHeight: function (e, call, speed) { - this._toggle(e, 'h', call, speed); - }, - _toggle: function (e,direction, call, speed) { - e = j6.$(e); - var style = j6.style(e); - var w = e.offsetWidth; - var h = e.offsetHeight; - var tw = parseInt(e.getAttribute("toggle-w") || 0); - var th = parseInt(e.getAttribute("toggle-h") || 0); - - //init - if (tw == 0 || th == 0) { - tw = j6.clientWidth(e); - th = j6.clientHeight(e); - if (w == 0 || h == 0) { - w = tw; - h = th; - } - e.setAttribute('toggle-w', w); - e.setAttribute('toggle-h', h); - } - - var speedX = speed == null ? 2 : speed; - var speedY = speedX * (th / tw); - - - if (style["display"] == 'none') { - var css = { overflow: 'hidden', display: 'inherit'}; - if (direction.indexOf('w') != -1) { - css.width = '0px'; - } - if (direction.indexOf('h') != -1) { - css.height = '0px'; - } - j6.style(e,css); - this._toggleShow(e, direction,call, w, tw, h, th, speedX, speedY); - } else { - e.style.overflow = 'hidden'; - this._toggleClose(e, direction,call, w, tw, h, th, speedX, speedY); - } - }, - _toggleShow: function (e, direction, call, w, tw, h, th, speedX, speedY) { - if (direction.indexOf('w') != -1) { - this.timer((function (e, w) { - return function (t, setup) { - e.style.width = (setup > 0 ? t : (w + t)) + 'px'; - }; - })(e, w), call, 0, tw, speedX); - } - if (direction.indexOf('h') != -1) { - this.timer((function (e, h) { - return function (t, setup) { - e.style.height = (setup > 0 ? t : (h + t)) + 'px'; - }; - })(e, h), call, 0, th, speedY); - } - }, - _toggleClose: function (e, direction,call, w, tw, h, tw, speedX, speedY) { - if (direction.indexOf('w') != -1) { - this.timer((function (e, w) { - return function (t, setup) { - var _w = (setup > 0 ? t : (w + t)); - if (_w < 0) _w = 0; - e.style.width = _w + 'px'; - if (_w == 0) { - e.style.display = 'none'; - } - }; - })(e, w), call, 0, -w, speedX); - } - if (direction.indexOf('h') != -1) { - this.timer((function (e, h) { - return function (t, setup) { - var _h = setup > 0 ? t : h + t; - if (_h < 0) _h = 0; - e.style.height = _h + 'px'; - if (_h == 0) { - e.style.display = 'none'; - } - }; - })(e, h), call, 0, -h, speedY); - } - } - } -}); - - diff --git a/public/static/assets/js/lib/form.js b/public/static/assets/js/lib/form.js deleted file mode 100755 index e51f654c8..000000000 --- a/public/static/assets/js/lib/form.js +++ /dev/null @@ -1,2 +0,0 @@ -j6.extend({ form: { getData: function (a) { var b = ''; var c = document.forms[a || 0]; return j6.json.toQueryString(c) }, asyncSubmit: function (a, b) { var c = document.forms[a || 0]; var d = document.getElementById('$async_ifr'); if (!d) { try { d = document.createElement('";e.style.width=Math.max(e.scrollWidth,b)+'px';e.style.height=Math.max(e.scrollHeight,c)+'px';this.fixBoxPosition()};simpleDialog.prototype.write=function(a){this._initialize();var b=this.doc.getElementById('boxcontent_'+this.id);if(!this.title){b.innerHTML=a}else{var c=b.getElementsByTagName('DIV');for(var i=1;i0){return a[0].contentWindow}return null};simpleDialog.prototype.close=function(b){if(this.onclose!=null&&this.onclose()==false){return false}var c=0;var d=this.getPanel();var e=(function(a){return function(){a.document.body.removeChild(d);if(b)b()}}(this.win));try{delete this.win['dialog_'+this.id]}catch(ex){this.win['dialog_'+this.id]=null}e();this._inited=false};function drag(a,b){this.elem=a;this.win=b}drag.prototype.regist=function(a,b,c,d){var o=this.elem;a=a?a:o;var f,sy;var g=this.win==null?g:this.win.document;o.style.cursor=b||"move";var h=c||function(e){e=e||event;window.getSelection?window.getSelection().removeAllRanges():g.selection.empty();if(e.preventDefault)e.preventDefault();with(a.style){position="absolute";left=e.clientX-f+"px";top=e.clientY-sy+"px"}};jr.event.add(o,"mousedown",function(e){e=e||event;if(e.button==1||e.button==0){f=e.clientX-a.offsetLeft;sy=e.clientY-a.offsetTop;jr.event.add(g,'mousemove',h,false);jr.event.add(g,'mouseup',i,false)}},false);var i=function(){jr.event.remove(g,'mousemove',h,false);jr.event.remove(g,'mouseup',i,false);if(d&&d instanceof Function)d()}};drag.prototype.custom=function(a,b,c,d){return this.regist(a,b,c,d)};drag.prototype.start=function(a){this.regist(a,null,null,null)};var SimpleDialog={create:function(a){return new simpleDialog(a)},create2:function(a,b,c,d,e){return new simpleDialog({title:a,drag:b||false,cross:c||false,style:e,onclose:d})},getDialog:function(){var b=null;var c=/^dialog_/i;var e=window;var f=function(a){var d=null;for(var i in a){if(c.test(i)&&a[i]!=null){d=a[i];break}}return d};do{b=f(e);if(b==null){e=e.parent;b=f(e)}if(b){break}}while(e.parent!=e);return b},close:function(){var d=this.getDialog();if(d)d.close()},ALERT_MSG_TPL:'
    {msg}
    ',ALERT_BTN_TPL:'',ALERT_ALL_TITLE:'提示',ALERT_BTN_OK_TEXT:'确定',ALERT_BTN_CANCEL_TEXT:'取消',customAlert:function(p){var b=this.ALERT_ALL_TITLE+'-'+(p.title||'');b=b.replace(/^-|-$/g,'');var d=this.create({title:b,drag:p.drag||true,cross:p.cross||true,canClose:false});d.write(j6.template(this.ALERT_MSG_TPL,{msg:p.message,icon:p.icon}));var c='';for(var i=0;i'+c+'');var g=jr.$('ui-alert-control-'+f).getElementsByTagName('INPUT');for(var i=0;i>5]|=0x80<<(24-f%32);x[((f+64>>9)<<4)+15]=f;var w=Array(80);var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;var e=-1009589776;for(var i=0;i16)c=core_sha1(c,a.length*chrsz);var d=Array(16),opad=Array(16);for(var i=0;i<16;i++){d[i]=c[i]^0x36363636;opad[i]=c[i]^0x5C5C5C5C}var e=core_sha1(d.concat(str2binb(b)),512+b.length*chrsz);return core_sha1(opad.concat(e),512+160)}function safe_add(x,y){var a=(x&0xFFFF)+(y&0xFFFF);var b=(x>>16)+(y>>16)+(a>>16);return(b<<16)|(a&0xFFFF)}function rol(a,b){return(a<>>(32-b))}function str2binb(a){var b=Array();var c=(1<>5]|=(a.charCodeAt(i/chrsz)&c)<<(24-i%32);return b}function binb2str(a){var b="";var c=(1<>5]>>>(24-i%32))&c);return b}function binb2hex(a){var b=hexcase?"0123456789ABCDEF":"0123456789abcdef";var c="";for(var i=0;i>2]>>((3-i%4)*8+4))&0xF)+b.charAt((a[i>>2]>>((3-i%4)*8))&0xF)}return c}function binb2b64(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var c="";for(var i=0;i>2]>>8*(3-i%4))&0xFF)<<16)|(((a[i+1>>2]>>8*(3-(i+1)%4))&0xFF)<<8)|((a[i+2>>2]>>8*(3-(i+2)%4))&0xFF);for(var j=0;j<4;j++){if(i*8+j*6>a.length*32)c+=b64pad;else c+=b.charAt((d>>6*(3-j))&0x3F)}}return c} + +function unix2str(v){ + if(typeof(v)=='string'){ + v = parseInt(v); + } + return new Date(v*1000).format("yyyy-MM-dd HH:mm:ss"); +} +function sha1(s){ + return hex_sha1(hex_sha1(s+"@h3f.net")); +} \ No newline at end of file diff --git a/public/static/assets/js/lib/auto_completion.js b/public/static/assets/js/lib/auto_completion.js new file mode 100644 index 000000000..eeedfa2b3 --- /dev/null +++ b/public/static/assets/js/lib/auto_completion.js @@ -0,0 +1,174 @@ +//自动完成插件 + +function autoCompletion(ele, url, loadCallback, selectCallback,errCallback, charMinLen) { + var panel; + var panelInner; + this.charMinLen = charMinLen || 1; + this.lastChar = ''; + this.isOnFocus = false; + this.timer = null; + this.url = url; + + if (!ele.nodeName) { + ele = jr.$(ele); + } + + + var attachBox = function () { + panel = ele.previousNode; + if (!panel || panel.nodeName != 'DIV' || panel.className != 'ui-autocompletion-panel') { + + //为父元素设为绝对定位 + if (ele.parentNode.offsetLeft > ele.offsetLeft) { + ele.parentNode.style.cssText += 'position:relative'; + } + + + panel = document.createElement('DIV'); + panel.className = 'ui-autocompletion-panel'; + panel.style.cssText = 'curcor:default;z-index:102;position:absolute;left:' + ele.offsetLeft + 'px;top:' + + (ele.offsetTop + ele.offsetHeight) + 'px;width:' + ele.offsetWidth + 'px;overflow:hidden;display:none'; + ele.parentNode.insertBefore(panel, ele); + + + panelInner = document.createElement('DIV'); + panelInner.className = 'inner'; + panelInner.style.cssText = 'background-color:#fff;'; + + panel.appendChild(panelInner); + } else { + panelInner = panel.getElementsByTagName('DIV')[0]; + } + }; + + attachBox(); + + //筛选框 + var handler = (function (e, p, pi, lc, sc,ec, t) { + return function (event, isOnfocus) { + + if (isOnfocus) t.isOnFocus = true; + + //排除alt和ctrl键,空格键 + var _event = window.event || event; + if (_event.altKey || _event.keyCode == 17) return; + //截取中间的字符,移除前后的字符 + var keyStr = e.value; + + //达不到默认长度 + if (/^\s*$/.test(keyStr) && t.charMinLen != 0) return; + keyStr = keyStr.replace(/^(\s*)(.+?)(\s*)$/, '$2'); + + if (keyStr.length < t.charMinLen) return; + + //document.getElementById('t1').innerHTML = t.lastChar + '/' + keyStr + ((t.lastChar != '' && t.lastChar == keyStr)); + //判断是否和上次一样 + if (t.lastChar != '' && t.lastChar == keyStr) { + return; + } else { + t.lastChar = keyStr; + } + + j6.xhr.request({ + uri: t.url + (t.url.indexOf('?') == -1 ? "?" : '&') + 'key=' + encodeURIComponent(keyStr), + params: {}, method: 'GET', data: 'json' + }, { + success: function (json) { + if (lc) lc(json); + if (json.length != 0) { + p.style.display = ''; + + var reg = new RegExp(keyStr, 'i'); + var replaceWord = '' + keyStr + ''; + var html = '
      '; + for (var i = 0; i < json.length; i++) { + html += '' + json[i].text.replace(reg, replaceWord) + ''; + + //如果和结果相同则默认选择 + if (json[i].text == keyStr && sc) { + if (e.onblur) e.onblur(); + sc(json[i]); + } + } + html += '
    '; + + pi.innerHTML = html; + + var lis = pi.getElementsByTagName('LI'); + j6.each(lis, function (i, li) { + li.onmouseover = (function (_p, _lis) { + return function () { + for (var j = 0; j < _lis.length; j++) { + _lis[j].className = j == 0 ? 'first' : ''; + } + this.className = this == lis[0] ? 'first selected' : 'selected'; + }; + })(p, lis); + + li.onclick = (function (j, _p) { + return function () { + e.value = j.text; + _p.style.display = 'none'; + if (e.onblur) e.onblur(); + if (sc) sc(j); + }; + })(json[i], p); + }); + } else { + //隐藏输入框 + p.style.display = 'none'; + } + + //temp + setTimeout(function () { + t.isOnFocus = false; + }, 500); + }, + error:function() { + if (ec && ec instanceof Function)ec(); + } + }); + }; + + })(ele, panel, panelInner, loadCallback, selectCallback, errCallback,this); + + var closeHandler = (function (p, t) { + return function (event) { + if (!t.isOnFocus) { + p.style.display = 'none'; + } + }; + })(panel, this); + + + jr.event.add(ele, 'focus', (function (t) { + return function (event) { + handler(event, true); + //t.timer = setInterval(function() { + // handler(event); + //}, 10); + }; + })(this)); + + jr.event.add(ele, 'keyup', handler); + + //jr.event.add(ele, 'blur', (function(t) { + // return function() { + // clearInterval(t.timer); + // }; + //})(this)); + + //绑定事件 + jr.event.add(document, 'click', closeHandler); + + return this; +} + + +j6.extend({ + autoCompletion: function (ele, url, loadCallback, selectCallback,errCallback, charMinLen) { + return new autoCompletion(ele, url, loadCallback, selectCallback, errCallback,charMinLen); + } +}); \ No newline at end of file diff --git a/public/static/assets/js/lib/device_adapter.js b/public/static/assets/js/lib/device_adapter.js new file mode 100644 index 000000000..4a1e9f5d0 --- /dev/null +++ b/public/static/assets/js/lib/device_adapter.js @@ -0,0 +1,44 @@ +/** + * Created by sonven on 15/7/4. + */ + +function deviceCallProvider(providerName) { + this.providerName = providerName; + this.joinStr = function(){ + return !this.providerName || this.providerName.length == 0 ?'':"."+this.providerName; + }; + + this.defined = function(funcName){ + return eval('window'+this.joinStr()+' && window'+this.joinStr()+'.'+funcName+'!= undefined'); + } + this.call = function (funcName,arg) { + return eval('window' +this.joinStr()+"." + funcName + '(arg)'); + }; +} + +window.pc = window; +var dpList= [new deviceCallProvider("android"), + new deviceCallProvider("ios"), + new deviceCallProvider("pc")]; + +function loopCall(func,arg){ + for(var i=0;i< dpList.length;i++) { + var p = dpList[i]; + if (p.providerName && p.defined(func)) { + p.call(func,arg); + break; + } + } +} + +window.cli = { + alert:function(arg){ + loopCall('alert',arg); + }, + login:function(arg){ + loopCall('login',arg); + }, + close:function(arg){ + loopCall('close',arg); + }, +}; \ No newline at end of file diff --git a/public/static/assets/js/lib/html5shiv.min.js b/public/static/assets/js/lib/html5shiv.min.js new file mode 100755 index 000000000..d4c731ad5 --- /dev/null +++ b/public/static/assets/js/lib/html5shiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document); \ No newline at end of file diff --git a/public/static/assets/js/lib/iscroll-lite.js b/public/static/assets/js/lib/iscroll-lite.js new file mode 100755 index 000000000..845b73f2b --- /dev/null +++ b/public/static/assets/js/lib/iscroll-lite.js @@ -0,0 +1,994 @@ +/*! iScroll v5.2.0 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */ +(function (window, document, Math) { +var rAF = window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function (callback) { window.setTimeout(callback, 1000 / 60); }; + +var utils = (function () { + var me = {}; + + var _elementStyle = document.createElement('div').style; + var _vendor = (function () { + var vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'], + transform, + i = 0, + l = vendors.length; + + for ( ; i < l; i++ ) { + transform = vendors[i] + 'ransform'; + if ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1); + } + + return false; + })(); + + function _prefixStyle (style) { + if ( _vendor === false ) return false; + if ( _vendor === '' ) return style; + return _vendor + style.charAt(0).toUpperCase() + style.substr(1); + } + + me.getTime = Date.now || function getTime () { return new Date().getTime(); }; + + me.extend = function (target, obj) { + for ( var i in obj ) { + target[i] = obj[i]; + } + }; + + me.addEvent = function (el, type, fn, capture) { + el.addEventListener(type, fn, !!capture); + }; + + me.removeEvent = function (el, type, fn, capture) { + el.removeEventListener(type, fn, !!capture); + }; + + me.prefixPointerEvent = function (pointerEvent) { + return window.MSPointerEvent ? + 'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8): + pointerEvent; + }; + + me.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) { + var distance = current - start, + speed = Math.abs(distance) / time, + destination, + duration; + + deceleration = deceleration === undefined ? 0.0006 : deceleration; + + destination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 ); + duration = speed / deceleration; + + if ( destination < lowerMargin ) { + destination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin; + distance = Math.abs(destination - current); + duration = distance / speed; + } else if ( destination > 0 ) { + destination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0; + distance = Math.abs(current) + destination; + duration = distance / speed; + } + + return { + destination: Math.round(destination), + duration: duration + }; + }; + + var _transform = _prefixStyle('transform'); + + me.extend(me, { + hasTransform: _transform !== false, + hasPerspective: _prefixStyle('perspective') in _elementStyle, + hasTouch: 'ontouchstart' in window, + hasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed + hasTransition: _prefixStyle('transition') in _elementStyle + }); + + /* + This should find all Android browsers lower than build 535.19 (both stock browser and webview) + - galaxy S2 is ok + - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1` + - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30` + - galaxy S3 is badAndroid (stock brower, webview) + `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30` + - galaxy S4 is badAndroid (stock brower, webview) + `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30` + - galaxy S5 is OK + `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)` + - galaxy S6 is OK + `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)` + */ + me.isBadAndroid = (function() { + var appVersion = window.navigator.appVersion; + // Android browser is not a chrome browser. + if (/Android/.test(appVersion) && !(/Chrome\/\d/.test(appVersion))) { + var safariVersion = appVersion.match(/Safari\/(\d+.\d)/); + if(safariVersion && typeof safariVersion === "object" && safariVersion.length >= 2) { + return parseFloat(safariVersion[1]) < 535.19; + } else { + return true; + } + } else { + return false; + } + })(); + + me.extend(me.style = {}, { + transform: _transform, + transitionTimingFunction: _prefixStyle('transitionTimingFunction'), + transitionDuration: _prefixStyle('transitionDuration'), + transitionDelay: _prefixStyle('transitionDelay'), + transformOrigin: _prefixStyle('transformOrigin') + }); + + me.hasClass = function (e, c) { + var re = new RegExp("(^|\\s)" + c + "(\\s|$)"); + return re.test(e.className); + }; + + me.addClass = function (e, c) { + if ( me.hasClass(e, c) ) { + return; + } + + var newclass = e.className.split(' '); + newclass.push(c); + e.className = newclass.join(' '); + }; + + me.removeClass = function (e, c) { + if ( !me.hasClass(e, c) ) { + return; + } + + var re = new RegExp("(^|\\s)" + c + "(\\s|$)", 'g'); + e.className = e.className.replace(re, ' '); + }; + + me.offset = function (el) { + var left = -el.offsetLeft, + top = -el.offsetTop; + + // jshint -W084 + while (el = el.offsetParent) { + left -= el.offsetLeft; + top -= el.offsetTop; + } + // jshint +W084 + + return { + left: left, + top: top + }; + }; + + me.preventDefaultException = function (el, exceptions) { + for ( var i in exceptions ) { + if ( exceptions[i].test(el[i]) ) { + return true; + } + } + + return false; + }; + + me.extend(me.eventType = {}, { + touchstart: 1, + touchmove: 1, + touchend: 1, + + mousedown: 2, + mousemove: 2, + mouseup: 2, + + pointerdown: 3, + pointermove: 3, + pointerup: 3, + + MSPointerDown: 3, + MSPointerMove: 3, + MSPointerUp: 3 + }); + + me.extend(me.ease = {}, { + quadratic: { + style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)', + fn: function (k) { + return k * ( 2 - k ); + } + }, + circular: { + style: 'cubic-bezier(0.1, 0.57, 0.1, 1)', // Not properly "circular" but this looks better, it should be (0.075, 0.82, 0.165, 1) + fn: function (k) { + return Math.sqrt( 1 - ( --k * k ) ); + } + }, + back: { + style: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)', + fn: function (k) { + var b = 4; + return ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1; + } + }, + bounce: { + style: '', + fn: function (k) { + if ( ( k /= 1 ) < ( 1 / 2.75 ) ) { + return 7.5625 * k * k; + } else if ( k < ( 2 / 2.75 ) ) { + return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75; + } else if ( k < ( 2.5 / 2.75 ) ) { + return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375; + } else { + return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375; + } + } + }, + elastic: { + style: '', + fn: function (k) { + var f = 0.22, + e = 0.4; + + if ( k === 0 ) { return 0; } + if ( k == 1 ) { return 1; } + + return ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 ); + } + } + }); + + me.tap = function (e, eventName) { + var ev = document.createEvent('Event'); + ev.initEvent(eventName, true, true); + ev.pageX = e.pageX; + ev.pageY = e.pageY; + e.target.dispatchEvent(ev); + }; + + me.click = function (e) { + var target = e.target, + ev; + + if ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) { + ev = document.createEvent('MouseEvents'); + ev.initMouseEvent('click', true, true, e.view, 1, + target.screenX, target.screenY, target.clientX, target.clientY, + e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, + 0, null); + + ev._constructed = true; + target.dispatchEvent(ev); + } + }; + + return me; +})(); +function IScroll (el, options) { + this.wrapper = typeof el == 'string' ? document.querySelector(el) : el; + this.scroller = this.wrapper.children[0]; + this.scrollerStyle = this.scroller.style; // cache style for better performance + + this.options = { + +// INSERT POINT: OPTIONS + disablePointer : !utils.hasPointer, + disableTouch : utils.hasPointer || !utils.hasTouch, + disableMouse : utils.hasPointer || utils.hasTouch, + startX: 0, + startY: 0, + scrollY: true, + directionLockThreshold: 5, + momentum: true, + + bounce: true, + bounceTime: 600, + bounceEasing: '', + + preventDefault: true, + preventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ }, + + HWCompositing: true, + useTransition: true, + useTransform: true, + bindToWrapper: typeof window.onmousedown === "undefined" + }; + + for ( var i in options ) { + this.options[i] = options[i]; + } + + // Normalize options + this.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : ''; + + this.options.useTransition = utils.hasTransition && this.options.useTransition; + this.options.useTransform = utils.hasTransform && this.options.useTransform; + + this.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough; + this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault; + + // If you want eventPassthrough I have to lock one of the axes + this.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY; + this.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX; + + // With eventPassthrough we also need lockDirection mechanism + this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough; + this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold; + + this.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing; + + this.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling; + + if ( this.options.tap === true ) { + this.options.tap = 'tap'; + } + +// INSERT POINT: NORMALIZATION + + // Some defaults + this.x = 0; + this.y = 0; + this.directionX = 0; + this.directionY = 0; + this._events = {}; + +// INSERT POINT: DEFAULTS + + this._init(); + this.refresh(); + + this.scrollTo(this.options.startX, this.options.startY); + this.enable(); +} + +IScroll.prototype = { + version: '5.2.0', + + _init: function () { + this._initEvents(); + +// INSERT POINT: _init + + }, + + destroy: function () { + this._initEvents(true); + clearTimeout(this.resizeTimeout); + this.resizeTimeout = null; + this._execEvent('destroy'); + }, + + _transitionEnd: function (e) { + if ( e.target != this.scroller || !this.isInTransition ) { + return; + } + + this._transitionTime(); + if ( !this.resetPosition(this.options.bounceTime) ) { + this.isInTransition = false; + this._execEvent('scrollEnd'); + } + }, + + _start: function (e) { + // React to left mouse button only + if ( utils.eventType[e.type] != 1 ) { + // for button property + // http://unixpapa.com/js/mouse.html + var button; + if (!e.which) { + /* IE case */ + button = (e.button < 2) ? 0 : + ((e.button == 4) ? 1 : 2); + } else { + /* All others */ + button = e.button; + } + if ( button !== 0 ) { + return; + } + } + + if ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) { + return; + } + + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { + e.preventDefault(); + } + + var point = e.touches ? e.touches[0] : e, + pos; + + this.initiated = utils.eventType[e.type]; + this.moved = false; + this.distX = 0; + this.distY = 0; + this.directionX = 0; + this.directionY = 0; + this.directionLocked = 0; + + this.startTime = utils.getTime(); + + if ( this.options.useTransition && this.isInTransition ) { + this._transitionTime(); + this.isInTransition = false; + pos = this.getComputedPosition(); + this._translate(Math.round(pos.x), Math.round(pos.y)); + this._execEvent('scrollEnd'); + } else if ( !this.options.useTransition && this.isAnimating ) { + this.isAnimating = false; + this._execEvent('scrollEnd'); + } + + this.startX = this.x; + this.startY = this.y; + this.absStartX = this.x; + this.absStartY = this.y; + this.pointX = point.pageX; + this.pointY = point.pageY; + + this._execEvent('beforeScrollStart'); + }, + + _move: function (e) { + if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) { + return; + } + + if ( this.options.preventDefault ) { // increases performance on Android? TODO: check! + e.preventDefault(); + } + + var point = e.touches ? e.touches[0] : e, + deltaX = point.pageX - this.pointX, + deltaY = point.pageY - this.pointY, + timestamp = utils.getTime(), + newX, newY, + absDistX, absDistY; + + this.pointX = point.pageX; + this.pointY = point.pageY; + + this.distX += deltaX; + this.distY += deltaY; + absDistX = Math.abs(this.distX); + absDistY = Math.abs(this.distY); + + // We need to move at least 10 pixels for the scrolling to initiate + if ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) { + return; + } + + // If you are scrolling in one direction lock the other + if ( !this.directionLocked && !this.options.freeScroll ) { + if ( absDistX > absDistY + this.options.directionLockThreshold ) { + this.directionLocked = 'h'; // lock horizontally + } else if ( absDistY >= absDistX + this.options.directionLockThreshold ) { + this.directionLocked = 'v'; // lock vertically + } else { + this.directionLocked = 'n'; // no lock + } + } + + if ( this.directionLocked == 'h' ) { + if ( this.options.eventPassthrough == 'vertical' ) { + e.preventDefault(); + } else if ( this.options.eventPassthrough == 'horizontal' ) { + this.initiated = false; + return; + } + + deltaY = 0; + } else if ( this.directionLocked == 'v' ) { + if ( this.options.eventPassthrough == 'horizontal' ) { + e.preventDefault(); + } else if ( this.options.eventPassthrough == 'vertical' ) { + this.initiated = false; + return; + } + + deltaX = 0; + } + + deltaX = this.hasHorizontalScroll ? deltaX : 0; + deltaY = this.hasVerticalScroll ? deltaY : 0; + + newX = this.x + deltaX; + newY = this.y + deltaY; + + // Slow down if outside of the boundaries + if ( newX > 0 || newX < this.maxScrollX ) { + newX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX; + } + if ( newY > 0 || newY < this.maxScrollY ) { + newY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY; + } + + this.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0; + this.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0; + + if ( !this.moved ) { + this._execEvent('scrollStart'); + } + + this.moved = true; + + this._translate(newX, newY); + +/* REPLACE START: _move */ + + if ( timestamp - this.startTime > 300 ) { + this.startTime = timestamp; + this.startX = this.x; + this.startY = this.y; + } + +/* REPLACE END: _move */ + + }, + + _end: function (e) { + if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) { + return; + } + + if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { + e.preventDefault(); + } + + var point = e.changedTouches ? e.changedTouches[0] : e, + momentumX, + momentumY, + duration = utils.getTime() - this.startTime, + newX = Math.round(this.x), + newY = Math.round(this.y), + distanceX = Math.abs(newX - this.startX), + distanceY = Math.abs(newY - this.startY), + time = 0, + easing = ''; + + this.isInTransition = 0; + this.initiated = 0; + this.endTime = utils.getTime(); + + // reset if we are outside of the boundaries + if ( this.resetPosition(this.options.bounceTime) ) { + return; + } + + this.scrollTo(newX, newY); // ensures that the last position is rounded + + // we scrolled less than 10 pixels + if ( !this.moved ) { + if ( this.options.tap ) { + utils.tap(e, this.options.tap); + } + + if ( this.options.click ) { + utils.click(e); + } + + this._execEvent('scrollCancel'); + return; + } + + if ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) { + this._execEvent('flick'); + return; + } + + // start momentum animation if needed + if ( this.options.momentum && duration < 300 ) { + momentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 }; + momentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 }; + newX = momentumX.destination; + newY = momentumY.destination; + time = Math.max(momentumX.duration, momentumY.duration); + this.isInTransition = 1; + } + +// INSERT POINT: _end + + if ( newX != this.x || newY != this.y ) { + // change easing function when scroller goes out of the boundaries + if ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) { + easing = utils.ease.quadratic; + } + + this.scrollTo(newX, newY, time, easing); + return; + } + + this._execEvent('scrollEnd'); + }, + + _resize: function () { + var that = this; + + clearTimeout(this.resizeTimeout); + + this.resizeTimeout = setTimeout(function () { + that.refresh(); + }, this.options.resizePolling); + }, + + resetPosition: function (time) { + var x = this.x, + y = this.y; + + time = time || 0; + + if ( !this.hasHorizontalScroll || this.x > 0 ) { + x = 0; + } else if ( this.x < this.maxScrollX ) { + x = this.maxScrollX; + } + + if ( !this.hasVerticalScroll || this.y > 0 ) { + y = 0; + } else if ( this.y < this.maxScrollY ) { + y = this.maxScrollY; + } + + if ( x == this.x && y == this.y ) { + return false; + } + + this.scrollTo(x, y, time, this.options.bounceEasing); + + return true; + }, + + disable: function () { + this.enabled = false; + }, + + enable: function () { + this.enabled = true; + }, + + refresh: function () { + var rf = this.wrapper.offsetHeight; // Force reflow + + this.wrapperWidth = this.wrapper.clientWidth; + this.wrapperHeight = this.wrapper.clientHeight; + +/* REPLACE START: refresh */ + + this.scrollerWidth = this.scroller.offsetWidth; + this.scrollerHeight = this.scroller.offsetHeight; + + this.maxScrollX = this.wrapperWidth - this.scrollerWidth; + this.maxScrollY = this.wrapperHeight - this.scrollerHeight; + +/* REPLACE END: refresh */ + + this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0; + this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0; + + if ( !this.hasHorizontalScroll ) { + this.maxScrollX = 0; + this.scrollerWidth = this.wrapperWidth; + } + + if ( !this.hasVerticalScroll ) { + this.maxScrollY = 0; + this.scrollerHeight = this.wrapperHeight; + } + + this.endTime = 0; + this.directionX = 0; + this.directionY = 0; + + this.wrapperOffset = utils.offset(this.wrapper); + + this._execEvent('refresh'); + + this.resetPosition(); + +// INSERT POINT: _refresh + + }, + + on: function (type, fn) { + if ( !this._events[type] ) { + this._events[type] = []; + } + + this._events[type].push(fn); + }, + + off: function (type, fn) { + if ( !this._events[type] ) { + return; + } + + var index = this._events[type].indexOf(fn); + + if ( index > -1 ) { + this._events[type].splice(index, 1); + } + }, + + _execEvent: function (type) { + if ( !this._events[type] ) { + return; + } + + var i = 0, + l = this._events[type].length; + + if ( !l ) { + return; + } + + for ( ; i < l; i++ ) { + this._events[type][i].apply(this, [].slice.call(arguments, 1)); + } + }, + + scrollBy: function (x, y, time, easing) { + x = this.x + x; + y = this.y + y; + time = time || 0; + + this.scrollTo(x, y, time, easing); + }, + + scrollTo: function (x, y, time, easing) { + easing = easing || utils.ease.circular; + + this.isInTransition = this.options.useTransition && time > 0; + var transitionType = this.options.useTransition && easing.style; + if ( !time || transitionType ) { + if(transitionType) { + this._transitionTimingFunction(easing.style); + this._transitionTime(time); + } + this._translate(x, y); + } else { + this._animate(x, y, time, easing.fn); + } + }, + + scrollToElement: function (el, time, offsetX, offsetY, easing) { + el = el.nodeType ? el : this.scroller.querySelector(el); + + if ( !el ) { + return; + } + + var pos = utils.offset(el); + + pos.left -= this.wrapperOffset.left; + pos.top -= this.wrapperOffset.top; + + // if offsetX/Y are true we center the element to the screen + if ( offsetX === true ) { + offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2); + } + if ( offsetY === true ) { + offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2); + } + + pos.left -= offsetX || 0; + pos.top -= offsetY || 0; + + pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left; + pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top; + + time = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time; + + this.scrollTo(pos.left, pos.top, time, easing); + }, + + _transitionTime: function (time) { + time = time || 0; + + var durationProp = utils.style.transitionDuration; + this.scrollerStyle[durationProp] = time + 'ms'; + + if ( !time && utils.isBadAndroid ) { + this.scrollerStyle[durationProp] = '0.0001ms'; + // remove 0.0001ms + var self = this; + rAF(function() { + if(self.scrollerStyle[durationProp] === '0.0001ms') { + self.scrollerStyle[durationProp] = '0s'; + } + }); + } + +// INSERT POINT: _transitionTime + + }, + + _transitionTimingFunction: function (easing) { + this.scrollerStyle[utils.style.transitionTimingFunction] = easing; + +// INSERT POINT: _transitionTimingFunction + + }, + + _translate: function (x, y) { + if ( this.options.useTransform ) { + +/* REPLACE START: _translate */ + + this.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ; + +/* REPLACE END: _translate */ + + } else { + x = Math.round(x); + y = Math.round(y); + this.scrollerStyle.left = x + 'px'; + this.scrollerStyle.top = y + 'px'; + } + + this.x = x; + this.y = y; + +// INSERT POINT: _translate + + }, + + _initEvents: function (remove) { + var eventType = remove ? utils.removeEvent : utils.addEvent, + target = this.options.bindToWrapper ? this.wrapper : window; + + eventType(window, 'orientationchange', this); + eventType(window, 'resize', this); + + if ( this.options.click ) { + eventType(this.wrapper, 'click', this, true); + } + + if ( !this.options.disableMouse ) { + eventType(this.wrapper, 'mousedown', this); + eventType(target, 'mousemove', this); + eventType(target, 'mousecancel', this); + eventType(target, 'mouseup', this); + } + + if ( utils.hasPointer && !this.options.disablePointer ) { + eventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this); + eventType(target, utils.prefixPointerEvent('pointermove'), this); + eventType(target, utils.prefixPointerEvent('pointercancel'), this); + eventType(target, utils.prefixPointerEvent('pointerup'), this); + } + + if ( utils.hasTouch && !this.options.disableTouch ) { + eventType(this.wrapper, 'touchstart', this); + eventType(target, 'touchmove', this); + eventType(target, 'touchcancel', this); + eventType(target, 'touchend', this); + } + + eventType(this.scroller, 'transitionend', this); + eventType(this.scroller, 'webkitTransitionEnd', this); + eventType(this.scroller, 'oTransitionEnd', this); + eventType(this.scroller, 'MSTransitionEnd', this); + }, + + getComputedPosition: function () { + var matrix = window.getComputedStyle(this.scroller, null), + x, y; + + if ( this.options.useTransform ) { + matrix = matrix[utils.style.transform].split(')')[0].split(', '); + x = +(matrix[12] || matrix[4]); + y = +(matrix[13] || matrix[5]); + } else { + x = +matrix.left.replace(/[^-\d.]/g, ''); + y = +matrix.top.replace(/[^-\d.]/g, ''); + } + + return { x: x, y: y }; + }, + _animate: function (destX, destY, duration, easingFn) { + var that = this, + startX = this.x, + startY = this.y, + startTime = utils.getTime(), + destTime = startTime + duration; + + function step () { + var now = utils.getTime(), + newX, newY, + easing; + + if ( now >= destTime ) { + that.isAnimating = false; + that._translate(destX, destY); + + if ( !that.resetPosition(that.options.bounceTime) ) { + that._execEvent('scrollEnd'); + } + + return; + } + + now = ( now - startTime ) / duration; + easing = easingFn(now); + newX = ( destX - startX ) * easing + startX; + newY = ( destY - startY ) * easing + startY; + that._translate(newX, newY); + + if ( that.isAnimating ) { + rAF(step); + } + } + + this.isAnimating = true; + step(); + }, + handleEvent: function (e) { + switch ( e.type ) { + case 'touchstart': + case 'pointerdown': + case 'MSPointerDown': + case 'mousedown': + this._start(e); + break; + case 'touchmove': + case 'pointermove': + case 'MSPointerMove': + case 'mousemove': + this._move(e); + break; + case 'touchend': + case 'pointerup': + case 'MSPointerUp': + case 'mouseup': + case 'touchcancel': + case 'pointercancel': + case 'MSPointerCancel': + case 'mousecancel': + this._end(e); + break; + case 'orientationchange': + case 'resize': + this._resize(); + break; + case 'transitionend': + case 'webkitTransitionEnd': + case 'oTransitionEnd': + case 'MSTransitionEnd': + this._transitionEnd(e); + break; + case 'wheel': + case 'DOMMouseScroll': + case 'mousewheel': + this._wheel(e); + break; + case 'keydown': + this._key(e); + break; + case 'click': + if ( this.enabled && !e._constructed ) { + e.preventDefault(); + e.stopPropagation(); + } + break; + } + } +}; +IScroll.utils = utils; + +if ( typeof module != 'undefined' && module.exports ) { + module.exports = IScroll; +} else if ( typeof define == 'function' && define.amd ) { + define( function () { return IScroll; } ); +} else { + window.IScroll = IScroll; +} + +})(window, document, Math); diff --git a/public/static/assets/js/lib/jquery.2x.js b/public/static/assets/js/lib/jquery.2x.js new file mode 100644 index 000000000..b8c4187de --- /dev/null +++ b/public/static/assets/js/lib/jquery.2x.js @@ -0,0 +1,4 @@ +/*! jQuery v2.2.3 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c; +}catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length",""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,la=/\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("