└── LPLDataShow ├── static ├── images │ ├── bg.png │ ├── lol.ico │ ├── head_bg.png │ └── loading.gif ├── js │ ├── jquery.cxselect.min.js │ ├── test.js │ ├── js.js │ ├── jquery.liMarquee.js │ └── jquery.js └── css │ └── comon0.css ├── __pycache__ ├── app.cpython-38.pyc └── lpldata.cpython-38.pyc ├── .idea ├── .gitignore ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── modules.xml ├── misc.xml └── LPLDataShow.iml ├── app.py ├── lpldata.py ├── templates └── index.html ├── spider_api.py └── spider.py /LPLDataShow/static/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-S12138/LPLDataShow/HEAD/LPLDataShow/static/images/bg.png -------------------------------------------------------------------------------- /LPLDataShow/static/images/lol.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-S12138/LPLDataShow/HEAD/LPLDataShow/static/images/lol.ico -------------------------------------------------------------------------------- /LPLDataShow/static/images/head_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-S12138/LPLDataShow/HEAD/LPLDataShow/static/images/head_bg.png -------------------------------------------------------------------------------- /LPLDataShow/static/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-S12138/LPLDataShow/HEAD/LPLDataShow/static/images/loading.gif -------------------------------------------------------------------------------- /LPLDataShow/__pycache__/app.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-S12138/LPLDataShow/HEAD/LPLDataShow/__pycache__/app.cpython-38.pyc -------------------------------------------------------------------------------- /LPLDataShow/__pycache__/lpldata.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-S12138/LPLDataShow/HEAD/LPLDataShow/__pycache__/lpldata.cpython-38.pyc -------------------------------------------------------------------------------- /LPLDataShow/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /LPLDataShow/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /LPLDataShow/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /LPLDataShow/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /LPLDataShow/.idea/LPLDataShow.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /LPLDataShow/app.py: -------------------------------------------------------------------------------- 1 | import lpldata 2 | from flask import Flask,render_template 3 | 4 | app = Flask(__name__) 5 | LPL = lpldata.Lpl_Data() 6 | 7 | @app.route('/') 8 | def hello_world(): 9 | return render_template("index.html") 10 | 11 | @app.route('/wingsvd',methods=['GET','POST']) 12 | def wings_vd(): 13 | return LPL.get_wings_vd() 14 | 15 | @app.route('/memberdata',methods=['GET','POST']) 16 | def memberdata(): 17 | return LPL.get_member_top12() 18 | 19 | @app.route('/wingstop5',methods=['GET','POST']) 20 | def wings_top5(): 21 | return LPL.get_wings_top5() 22 | 23 | @app.route('/heropick',methods=['GET','POST']) 24 | def hero_pick(): 25 | return LPL.get_hero_top60() 26 | 27 | @app.route('/homeround',methods=['GET','POST']) 28 | def home_round(): 29 | return LPL.get_home_data() 30 | if __name__ == '__main__': 31 | app.run(debug=True) -------------------------------------------------------------------------------- /LPLDataShow/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 24 | -------------------------------------------------------------------------------- /LPLDataShow/static/js/jquery.cxselect.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * JQuery cxSelect 3 | * @name jquery.cxselect.js 4 | * @version 1.3.4 5 | * #date 2013-12-18 6 | * @author ciaoca 7 | * @email ciaoca@gmail.com 8 | * @site https://github.com/ciaoca/cxSelect 9 | * @license Released under the MIT license 10 | */ 11 | !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.cxSelect=function(b){var c,h,i,d={dom:{},api:{}},e=function(a){return a&&("function"==typeof HTMLElement||"object"==typeof HTMLElement)&&a instanceof HTMLElement?!0:a&&a.nodeType&&1===a.nodeType?!0:!1},f=function(a){return a&&a.length&&("function"==typeof jQuery||"object"==typeof jQuery)&&a instanceof jQuery?!0:!1},g=function(a){return Array.isArray?Array.isArray(a):"[object Array]"===Object.prototype.toString.call(a)};for(h=0,i=arguments.length;i>h;h++)f(arguments[h])?c=arguments[h]:e(arguments[h])?c=a(arguments[h]):"object"==typeof arguments[h]&&(b=arguments[h]);if(!(c.length<1))return d.init=function(){var e,d=this;if(d.dom.box=c,d.settings=a.extend({},a.cxSelect.defaults,b,{url:d.dom.box.data("url"),nodata:d.dom.box.data("nodata"),required:d.dom.box.data("required"),firstTitle:d.dom.box.data("firstTitle"),firstValue:d.dom.box.data("firstValue")}),d.settings.selects.length){for(d.selectArray=[],d.selectSum=d.settings.selects.length,e=0;e'+d+""),a.each(c,function(a,b){h+="string"==typeof b.v||"number"==typeof b.v||"boolean"==typeof b.v?'":'"}),h},d.buildContent=function(){var b,a=this;a.dom.box.on("change","select",function(){a.selectChange(this.className)}),b=a.getNewOptions(a.selectArray[0],a.dataJson),a.selectArray[0].html(b).prop("disabled",!1).trigger("change"),a.setDefaultValue()},d.setDefaultValue=function(a){var b,c;a=a||0,b=this,a>=b.selectSum||!b.selectArray[a]||(c=b.selectArray[a].data("value"),("string"==typeof c||"number"==typeof c||"boolean"==typeof c)&&(c=c.toString(),setTimeout(function(){b.selectArray[a].val(c).trigger("change"),a++,b.setDefaultValue(a)},1)))},d.selectChange=function(a){var b,c,d,e,f,h;for(a=a.replace(/ /g,","),a=","+a+",",b=[],h=0;hc&&(this.selectArray[h].empty().prop("disabled",!0),"none"===this.settings.nodata?this.selectArray[h].css("display","none"):"hidden"===this.settings.nodata&&this.selectArray[h].css("visibility","hidden")),a.indexOf(","+this.settings.selects[h]+",")>-1&&(c=h);for(d=c+1,e=this.dataJson,h=0;d>h;h++){if("undefined"==typeof e[b[h]]||g(e[b[h]].s)===!1||!e[b[h]].s.length)return;e=e[b[h]].s}this.selectArray[d]&&(f=this.getNewOptions(this.selectArray[d],e),this.selectArray[d].html(f).prop("disabled",!1).css({display:"",visibility:""}).trigger("change"))},d.init(),this},a.cxSelect.defaults={selects:[],url:null,nodata:null,required:!1,firstTitle:"请选择",firstValue:"0"},a.fn.cxSelect=function(b,c){return this.each(function(){a.cxSelect(this,b,c)}),this}}); -------------------------------------------------------------------------------- /LPLDataShow/lpldata.py: -------------------------------------------------------------------------------- 1 | # @BY :Java_S 2 | # @Time :2020/8/4 15:41 3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高 4 | 5 | import pymysql 6 | import json 7 | 8 | class Lpl_Data: 9 | def __init__(self): 10 | self.db = pymysql.connect(host='localhost', user='root', password='123456', port=3306, db='lpl') 11 | self.cur = self.db.cursor() 12 | 13 | def close(self): 14 | self.cur.close() 15 | self.db.close() 16 | 17 | def query(self,sql,*args): 18 | self.cur.execute(sql,args) 19 | res =self.cur.fetchall() 20 | #self.close() 21 | return res 22 | 23 | def get_wings_vd(self): 24 | sql = 'SELECT 战队名称,胜场次数,败场次数,胜率 FROM 战队胜负数据' 25 | infos = self.query(sql) 26 | name = [info[0] for info in infos] 27 | victory = [info[1] for info in infos] 28 | defeat = [info[2] for info in infos] 29 | win_rate = [info[3][:2] for info in infos] 30 | 31 | infos_list = [('name',name),('victory',victory),('defeat',defeat),('winRate',win_rate)] 32 | infos_dict = {key:value for key,value in infos_list} 33 | return json.dumps(infos_dict) 34 | 35 | def get_member_top12(self): 36 | sql = 'SELECT 队员名称,出场次数,总击杀,总助攻,总死亡 FROM 个人mvp前十二' 37 | infos = self.query(sql) 38 | name = [info[0] for info in infos] 39 | out_count = [info[1] for info in infos] 40 | kill_sum = [info[2] for info in infos] 41 | assist_sum= [info[3] for info in infos] 42 | die_sum= [info[4] for info in infos] 43 | 44 | infos_list = [('name', name), ('outcount', out_count), ('killsum', kill_sum), ('assistsum', assist_sum),('diesum',die_sum)] 45 | infos_dict = {key: value for key, value in infos_list} 46 | return json.dumps(infos_dict) 47 | 48 | def get_wings_top5(self): 49 | sql_wings = 'SELECT 战队名称,出场次数,胜率 FROM 战队排行榜前五' 50 | sql_member = 'SELECT 队员名称,位置,总击杀 FROM 个人排行榜前五' 51 | infos_wings = self.query(sql_wings) 52 | infos_member = self.query(sql_member) 53 | name = [info[0] for info in infos_wings] 54 | out_count = [info[1] for info in infos_wings] 55 | win_rate = [info[2] for info in infos_wings] 56 | member_name = [info[0] for info in infos_member] 57 | member_post = [info[1] for info in infos_member] 58 | member_kill_sum = [info[2] for info in infos_member] 59 | infos_list = [('name', name), ('outcount', out_count), ('winRate', win_rate), 60 | ('membername', member_name),('memberpost', member_post),('memberkillsum', member_kill_sum)] 61 | infos_dict = {key: value for key, value in infos_list} 62 | return json.dumps(infos_dict) 63 | 64 | def get_hero_top60(self): 65 | sql = 'SELECT 英雄名称,出场次数,pick比率,胜率 FROM 英雄pick率前六十' 66 | infos = self.query(sql) 67 | name = [info[0] for info in infos] 68 | out_count = [info[1] for info in infos] 69 | pick = [info[2] for info in infos] 70 | winrate = [info[3] for info in infos] 71 | infos_list = [('name', name), ('outcount', out_count), ('picknum', pick),('winrate',winrate)] 72 | infos_dict = {key: value for key, value in infos_list} 73 | return json.dumps(infos_dict) 74 | def get_home_data(self): 75 | sql = 'SELECT name,data1,data2 FROM 首页圆圈数据' 76 | infos = self.query(sql) 77 | name = [info[0] for info in infos] 78 | data1 = [info[1] for info in infos] 79 | data2 = [info[2] for info in infos] 80 | infos_list = [('name', name), ('data1', data1), ('data2', data2)] 81 | infos_dict = {key: value for key, value in infos_list} 82 | return json.dumps(infos_dict) 83 | 84 | 85 | # lpl = Lpl_Data() 86 | # lpl.home_data() 87 | -------------------------------------------------------------------------------- /LPLDataShow/static/js/test.js: -------------------------------------------------------------------------------- 1 | function echarts_4() { 2 | // 基于准备好的dom,初始化echarts实例 3 | var myChart = echarts.init(document.getElementById('echart4')); 4 | var lpl = {}; 5 | $.ajax({ 6 | url:'/wingsvd', 7 | data: {}, 8 | type: 'POST', 9 | async: false, 10 | dataType:'json', 11 | success: function (data) { 12 | lpl.name = data.name; 13 | lpl.victory = data.victory; 14 | lpl.defeat = data.defeat; 15 | lpl.winRate = data.winRate; 16 | myChart.setOption({ 17 | tooltip: { 18 | trigger: 'axis', 19 | axisPointer: { 20 | lineStyle: { 21 | color: '#57617B' 22 | } 23 | } 24 | }, 25 | legend: { 26 | 27 | "data": [ 28 | {"name": "Victory"}, 29 | {"name": "Defeat"}, 30 | {"name": "胜率"} 31 | ], 32 | "top": "0%", 33 | "textStyle": { 34 | "color": "rgba(255,255,255,1)",//图例文字 35 | "fontsize":"16" 36 | } 37 | }, 38 | 39 | xAxis: [ 40 | { 41 | "type": "category", 42 | 43 | data: lpl.name, 44 | axisLine: { lineStyle: {color: "rgba(255,255,255,.1)"}}, 45 | axisLabel: { textStyle: {color: "rgb(255,255,255)", fontSize: '16', }, 46 | }, 47 | 48 | }, 49 | ], 50 | yAxis: [ 51 | { 52 | "type": "value", 53 | "name": "次数", 54 | "min": 0, 55 | "max": 30, 56 | "interval": 10, 57 | "axisLabel": { 58 | "show": true, 59 | 60 | }, 61 | axisLine: {lineStyle: {color: 'rgba(255,255,255,1)'}},//左线色 62 | splitLine: {show:true,lineStyle: {color:"rgba(255,255,255,1)"}},//x轴线 63 | }, 64 | { 65 | "type": "value", 66 | "name": "胜率", 67 | "show": true, 68 | "axisLabel": { 69 | "show": true, 70 | 71 | }, 72 | axisLine: {lineStyle: {color: 'rgba(255,255,255,1 )'}},//右线色 73 | splitLine: {show:true,lineStyle: {color:"rgba(255,255,255,0.2)"}},//x轴线 74 | }, 75 | ], 76 | grid: { 77 | "top": "10%", 78 | "right":"30", 79 | "bottom":"30", 80 | "left":"30", 81 | }, 82 | series: [ 83 | { 84 | "name": "Victory", 85 | 86 | "type": "bar", 87 | "data": lpl.victory, 88 | "barWidth": "auto", 89 | "itemStyle": { 90 | "normal": { 91 | "color": { 92 | "type": "linear", 93 | "x": 0, 94 | "y": 0, 95 | "x2": 0, 96 | "y2": 1, 97 | "colorStops": [ 98 | { 99 | "offset": 0, 100 | "color": "#67E0E3" 101 | }, 102 | 103 | { 104 | "offset": 1, 105 | "color": "#67E0E3" 106 | } 107 | ], 108 | "globalCoord": false 109 | } 110 | } 111 | } 112 | }, 113 | { 114 | "name": "Defeat", 115 | "type": "bar", 116 | "data": lpl.defeat, 117 | "barWidth": "auto", 118 | 119 | "itemStyle": { 120 | "normal": { 121 | "color": { 122 | "type": "linear", 123 | "x": 0, 124 | "y": 0, 125 | "x2": 0, 126 | "y2": 1, 127 | "colorStops": [ 128 | { 129 | "offset": 0, 130 | "color": "#FFDB5C" 131 | }, 132 | { 133 | "offset": 1, 134 | "color": "#FFDB5C" 135 | } 136 | ], 137 | "globalCoord": false 138 | } 139 | } 140 | }, 141 | "barGap": "0" 142 | }, 143 | { 144 | "name": "胜率", 145 | "type": "line", 146 | "yAxisIndex": 1, 147 | 148 | "data": lpl.winRate, 149 | lineStyle: { 150 | normal: { 151 | width: 2 152 | }, 153 | }, 154 | "itemStyle": { 155 | "normal": { 156 | "color": "#48f593", 157 | 158 | } 159 | }, 160 | "smooth": true 161 | } 162 | ] 163 | }) 164 | }, 165 | error:function (msg) { 166 | console.log(msg); 167 | alert('系统发生错误!'); 168 | } 169 | }); 170 | window.addEventListener("resize",function(){ 171 | myChart.resize(); 172 | }); 173 | } -------------------------------------------------------------------------------- /LPLDataShow/static/css/comon0.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | *{ 3 | -webkit-box-sizing: border-box; 4 | -moz-box-sizing: border-box; 5 | box-sizing: border-box} 6 | *,body{padding:0px; margin:0px;color: #222;font-family: "微软雅黑";} 7 | body{color:#666;font-size: 16px;} 8 | li{ list-style-type:none;} 9 | table{} 10 | i{ margin:0px; padding:0px; text-indent:0px;} 11 | img{ border:none; max-width: 100%;} 12 | a{ text-decoration:none; color:#399bff;} 13 | a.active,a:focus{ outline:none!important; text-decoration:none;} 14 | ol,ul,p,h1,h2,h3,h4,h5,h6{ padding:0; margin:0} 15 | a:hover{ color:#06c; text-decoration: none!important} 16 | 17 | 18 | .clearfix:after, .clearfix:before { 19 | display: table; 20 | content: " " 21 | } 22 | .clearfix:after { 23 | clear: both 24 | } 25 | .pulll_left{float:left;} 26 | .pulll_right{float:right;} 27 | 28 | 29 | .loading{position:fixed; left:0; top:0; font-size:16px; z-index:100000000;width:100%; height:100%; background:#1a1a1c; text-align:center;} 30 | .loadbox{position:absolute; width:160px;height:150px; color: rgba(255,255,255,.6); left:50%; top:50%; margin-top:-100px; margin-left:-75px;} 31 | .loadbox img{ margin:10px auto; display:block; width:40px;} 32 | 33 | .head{ height:105px; background: url(../images/head_bg.png) no-repeat center center; position: relative} 34 | .head h1{ color:#ffc800; font-size:42px; line-height:90px; font-family: 汉仪趣黑W; font-weight:500; 35 | position: absolute; left: 50%;margin-left: -265px} 36 | .head h1 img{ width:1.5rem; display: inline-block; vertical-align: middle; margin-right: .2rem} 37 | .weather{ position:absolute; right:20px; top:0; line-height: 85px;} 38 | .weather span{color:rgba(255,255,255,.9)!important; font-size: 24px; font-family:DS-Digital } 39 | 40 | .mainbox{ padding:10px 20px 0 20px;} 41 | .mainbox>ul{ margin-left:-.4rem; margin-right:-.4rem;} 42 | .mainbox>ul>li{ float: left; padding: 0 .4rem} 43 | .mainbox>ul>li{ width: 24%} 44 | .mainbox>ul>li:nth-child(2){ width: 52%} 45 | 46 | .boxall{ padding:15px; background: rgba(186,125,81,.2); position: relative; margin-bottom:15px;; z-index: 10;} 47 | .alltitle{ font-size:18px; color:#fff; position: relative; padding-left: 12px;margin-bottom: 10px;} 48 | .alltitle:before{ width: 5px; height: 20px; top:2px; position: absolute; content: ""; background: #49bcf7; border-radius:20px; left: 0; } 49 | 50 | .navboxall{height: calc(100% - 30px);} 51 | .num,.zhibiao{height: 100%; width: 50%;} 52 | .zb1,.zb2,.zb3{float: left; width: 33.3333%; height: 100%;} 53 | #zb1,#zb2,#zb3{height: calc(100% - 30px); } 54 | .zb4,.zb5,.zb6{float: right; width: 33.3333%; height: 100%;} 55 | #zb4,#zb5,#zb6{height: calc(100% - 30px); } 56 | .zhibiao span{ padding-top: 0px; display: block; text-align: center; color: #fff; font-size: 16px;font-weight: 700} 57 | .num{padding-right: 20px;} 58 | .numbt{ font-size: 24px; color: #fff; padding-top:14px;} 59 | .numbt span{font-size: 18px; padding-left: 10px;color: #fff; } 60 | .numtxt{ color: #fef000; font-size: 80px; font-family: arial; border-top: 1px solid rgba(255,255,255,.1);border-bottom: 1px solid rgba(255,255,255,.1); padding: 10px 0; margin: 18px 0; font-weight: bold; letter-spacing: 2px;} 61 | 62 | .table1 th{border-bottom: 1px solid rgba(255,255,255,1); font-size: 16px; color:rgba(255,255,255,1); font-weight: normal; padding:0 0 10px 0; text-align: center} 63 | .table1 td{ font-size: 16px; color: rgba(255, 255, 255, 1); padding: 15px 0 0 0; text-align: center } 64 | .table1 span{ width: 24px; height: 24px; border-radius: 3px; display: block; background: #878787; color: #fff; line-height: 24px; text-align: center;} 65 | 66 | .table1 tr:nth-child(2) span{ background: #ed405d} 67 | .table1 tr:nth-child(3) span{ background: #f78c44} 68 | .table1 tr:nth-child(4) span{ background: #49bcf7} 69 | .iconchart li{height: 30px;} 70 | .iconchart label{ color: #fff; line-height: 30px; height: 30px; display: inline-block; opacity: .8;} 71 | .iconchart label img{ display: inline-block; vertical-align: middle; opacity: .4;} 72 | .iconchart .bar{ display: inline-block; background: rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.2);width: 78%;height:20px; padding: 2px; position: relative;top: 5px;} 73 | .iconchart .bar span{ background: linear-gradient(to right, #588fab , #5ea99c); display: block; width: 60%; height: 100%;animation: myfirst2 1s ease;} 74 | .iconchart .bar i{position: absolute; opacity: .5; right:-36px; color: #fff; line-height: 20px; top: 0;} 75 | /*Plugin CSS*/ 76 | .wrap{ height:82%; overflow: hidden;} 77 | .wrap li{ line-height:40px; height:40px;} 78 | .wrap li p,.wraptit{ font-size: 0; } 79 | .wrap li span{ display: inline-block; font-size: 16px;color: rgba(255,255,255,1);} 80 | .wraptit span{ display: inline-block; font-size: 15px;color: rgba(255,255,255,.6);} 81 | .wraptit { border-bottom: 1px solid rgba(255,255,255,.2); padding:0 0 10px 0; margin-bottom: 10px;} 82 | .wrap li span:nth-child(1),.wraptit span:nth-child(1){ width: 30%} 83 | .wrap li span:nth-child(2),.wraptit span:nth-child(2){ width: 20%} 84 | .wrap li span:nth-child(3),.wraptit span:nth-child(3){ width: 20%} 85 | .wrap li span:nth-child(4),.wraptit span:nth-child(4){ width: 30%} 86 | 87 | .str_wrap { 88 | overflow:hidden; 89 | width:100%; 90 | position:relative; 91 | -moz-user-select: none; 92 | -khtml-user-select: none; 93 | user-select: none; 94 | white-space:nowrap; 95 | } 96 | 97 | 98 | .str_move { 99 | white-space:nowrap; 100 | position:absolute; 101 | top:0; 102 | left:0; 103 | cursor:move; 104 | } 105 | .str_move_clone { 106 | display:inline-block; 107 | vertical-align:top; 108 | position:absolute; 109 | left:100%; 110 | top:0; 111 | } 112 | .str_vertical .str_move_clone { 113 | left:0; 114 | top:100%; 115 | } 116 | .str_down .str_move_clone { 117 | left:0; 118 | bottom:100%; 119 | } 120 | .str_vertical .str_move, 121 | .str_down .str_move { 122 | white-space:normal; 123 | width:100%; 124 | } 125 | .str_static .str_move, 126 | .no_drag .str_move, 127 | .noStop .str_move{ 128 | cursor:inherit; 129 | } 130 | .str_wrap img { 131 | max-width:none !important; 132 | } 133 | 134 | @keyframes myfirst2 135 | { 136 | from {width: 0} 137 | to {} 138 | } 139 | 140 | .toptop { 141 | float: left; 142 | } 143 | .JavaS { 144 | position: absolute; 145 | left: 22px; 146 | top: 3px; 147 | color: white; 148 | font-size: 36px; 149 | font-family: Meddon; 150 | } 151 | -------------------------------------------------------------------------------- /LPLDataShow/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 英雄联盟LPL比赛数据可视化 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 |
页面加载中...
18 |
19 |
20 |
21 |
Java_S
22 |
23 |

英雄联盟LPL比赛数据可视化

24 | 25 |
26 | 43 |
44 |
    45 |
  • 46 |
    47 |
    个人数据堆叠图
    48 | 49 |
    50 |
    51 |
    英雄数据轮播图
    52 | 63 |
    64 |
    65 |
    夺冠种子战队
    66 | 67 | 68 |
    69 |
  • 70 |
  • 71 | 72 |
    73 | 89 |
    90 |
    91 |
    战队胜负数据
    92 | 93 | 94 |
    95 |
    96 |
    个人击杀数据
    97 | 98 |
    99 |
  • 100 |
  • 101 |
    102 |
    战队排行榜
    103 | 146 |
    147 | 148 |
    149 |
    个人排行榜
    150 | 194 | 195 |
    196 | 197 |
    198 |
    MVP种子选手
    199 | 200 |
    201 | 202 | 203 |
  • 204 |
205 | 206 |
207 |
208 | 209 | 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /LPLDataShow/spider_api.py: -------------------------------------------------------------------------------- 1 | # @BY :Java_S 2 | # @Time :2020/8/14 14:53 3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高 4 | import numpy as np 5 | import pymysql 6 | import requests 7 | import json 8 | 9 | 10 | hero_api = 'https://lpl.qq.com/web201612/data/LOL_MATCH2_MATCH_HERORANK_LIST_134_7_8.js' 11 | 12 | def mysql(): 13 | db = pymysql.connect( 14 | host='localhost', user='root', 15 | passwd='123456', db='lpl', charset='utf8') 16 | cur = db.cursor() 17 | return db,cur 18 | 19 | def get_info(url): 20 | headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36 LBBROWSER'} 21 | response = requests.get(url=url,headers=headers) 22 | return response.text 23 | 24 | def teamrank(): 25 | teamrank_api = 'https://lpl.qq.com/web201612/data/LOL_MATCH2_MATCH_TEAMRANK_LIST_134_7_8.js' 26 | info = get_info(teamrank_api) 27 | info = json.loads(info) 28 | info_msg = info['msg'] 29 | 30 | teamName = [data['sTeamName'] for data in info_msg] 31 | out_count = [data['iAppearancesFrequency'] for data in info_msg] 32 | win = [data['iWin'] for data in info_msg] 33 | loss = [data['iLoss'] for data in info_msg] 34 | win_rate = [int(str((int(data['iWin'])/(int(data['iWin'])+int(data['iLoss'])))*100)[:2]) for data in info_msg] 35 | kill_sum = [data['iKill'] for data in info_msg] 36 | death_sum = [data['iDeath'] for data in info_msg] 37 | placed_eye = [int(float(data['sAveragingWardPlaced']))for data in info_msg] 38 | killed_eye = [int(float(data['sAveragingWardKilled']))for data in info_msg] 39 | infos_list = [('队名',teamName),('出场次数',out_count),('胜场',win), 40 | ('败场',loss),('胜率',win_rate),('总击杀',kill_sum), 41 | ('总死亡',death_sum),('插眼',placed_eye),('排眼',killed_eye)] 42 | info_dict = {key:value for key,value in infos_list} 43 | return info_dict 44 | 45 | def team_top5(): 46 | info_dict = teamrank() 47 | win_rate_array = np.array(info_dict['胜率']) # 转换为数组对象 48 | win_rate_past_count = np.argsort(-win_rate_array) # argsort(-x)函数返回的是数组值从大到小的索引值 49 | team_top5_name = [info_dict['队名'][win_rate_past_count[i]] for i in range(5)] 50 | team_top5_out_count = [info_dict['出场次数'][win_rate_past_count[i]] for i in range(5)] 51 | team_top5_win_rate = [info_dict['胜率'][win_rate_past_count[i]] for i in range(5)] 52 | info_list = [(team_top5_name[i],team_top5_out_count[i],str(team_top5_win_rate[i])+'%') for i in range(5)] 53 | 54 | db, cur = mysql() 55 | try: 56 | 57 | # 是否存在这个表,若存在就删除 58 | cur.execute("DROP TABLE IF EXISTS 战队排行榜前五") 59 | # 创建表sql语句 60 | set_sql_top5 = """ 61 | create table 战队排行榜前五( 62 | 战队名称 varchar(20), 63 | 出场次数 varchar(10), 64 | 胜率 varchar(10)) 65 | """ 66 | # 执行sql语句 67 | cur.execute(set_sql_top5) 68 | db.commit() # 保存 69 | 70 | # 准备写入数据的sql语句 71 | save_sql_top5 = "INSERT INTO 战队排行榜前五 values(%s,%s,%s);" 72 | # 写入数据库,参数一:写入的sql语句 参数二:数据,类型为列表,里面的元素类型是元组 73 | cur.executemany(save_sql_top5,info_list) 74 | db.commit() 75 | 76 | print("写入数据库成功") 77 | except Exception as e: 78 | print("创建数据库失败:case%s" % e) 79 | 80 | def team_rate_top12(): 81 | info_dict = teamrank() 82 | win_rate_array = np.array(info_dict['胜率']) # 转换为数组对象 83 | win_rate_past_count = np.argsort(-win_rate_array) # argsort(-x)函数返回的是数组值从大到小的索引值 84 | team_rate_top12_name = [info_dict['队名'][win_rate_past_count[i]] for i in range(12)] 85 | team_rate_top12_win = [info_dict['胜场'][win_rate_past_count[i]] for i in range(12)] 86 | team_rate_top12_loss = [info_dict['败场'][win_rate_past_count[i]] for i in range(12)] 87 | team_rate_top12_win_rete = [info_dict['胜率'][win_rate_past_count[i]] for i in range(12)] 88 | info_list = [(team_rate_top12_name[i], team_rate_top12_win[i], 89 | team_rate_top12_loss[i],team_rate_top12_win_rete[i]) for i in range(12)][::-1] 90 | 91 | try: 92 | 93 | db,cur = mysql() 94 | 95 | cur.execute("DROP TABLE IF EXISTS 战队胜负数据") 96 | set_sql_wings_wd = """ 97 | create table 战队胜负数据( 98 | 战队名称 varchar(20), 99 | 胜场次数 varchar(10), 100 | 败场次数 varchar(10), 101 | 胜率 varchar(10)) 102 | """ 103 | cur.execute(set_sql_wings_wd) 104 | db.commit() 105 | 106 | save_sql_wings_vd = "INSERT INTO 战队胜负数据 values(%s,%s,%s,%s);" 107 | cur.executemany(save_sql_wings_vd,info_list) 108 | 109 | db.commit() 110 | print("写入数据库成功") 111 | except Exception as e: 112 | print("创建数据库失败:case%s" % e) 113 | 114 | def member(): 115 | member_api = 'https://lpl.qq.com/web201612/data/LOL_MATCH2_MATCH_PERSONALRANK_LIST_134_7_8.js' 116 | info = get_info(member_api) 117 | info = json.loads(info) 118 | info_msg = info['msg'] 119 | # member_name = [data['sMemberName'] for data in info_msg] 120 | # member_position = [data['iPosition'] for data in info_msg] 121 | # member_kill_sum = [data['iKill'] for data in info_msg] 122 | # member_assists = [data['iAssists'] for data in info_msg] 123 | # member_death = [data['iDeath'] for data in info_msg] 124 | # member_mvp_count = [data['iMVPFrequency'] for data in info_msg] 125 | 126 | key_list = ['sMemberName','iPosition','iKill','iAssists','iDeath','iMVPFrequency','iAppearancesFrequency','iKDA'] 127 | info_list = list(map(lambda key:[data[f'{key}'] for data in info_msg],key_list)) 128 | data_list = [('队员名称',info_list[0]),('位置',info_list[1]),('总击杀',info_list[2]), 129 | ('总辅助',info_list[3]),('总死亡',info_list[4]),('mvp次数',info_list[5]), 130 | ('出场次数',info_list[6]),('kda',info_list[7])] 131 | info_dict = {key:value for key,value in data_list} 132 | return info_dict 133 | 134 | def member_top5(): 135 | info_dict = member() 136 | kill_sum_int = [int(kill) for kill in info_dict['总击杀']] 137 | member_kill_sum = np.array(kill_sum_int) # 转换为数组对象 138 | member_kill_sum_count = (np.argsort(-member_kill_sum))[:5] # argsort(-x)函数返回的是数组值从大到小的索引值 139 | 140 | member_top5_name = [info_dict['队员名称'][member_kill_sum_count[i]] for i in range(5)] 141 | member_top5_position = [info_dict['位置'][member_kill_sum_count[i]] for i in range(5)] 142 | member_top5_kill_sum = [info_dict['总击杀'][member_kill_sum_count[i]] for i in range(5)] 143 | 144 | info_list = [(member_top5_name[i], member_top5_position[i],member_top5_kill_sum[i]) for i in range(5)] 145 | 146 | db,cur = mysql() 147 | try: 148 | 149 | cur.execute("DROP TABLE IF EXISTS 个人排行榜前五") 150 | set_sql_member_top5 = """ 151 | create table 个人排行榜前五( 152 | 队员名称 varchar(20), 153 | 位置 varchar(10), 154 | 总击杀 varchar(10)) 155 | """ 156 | cur.execute(set_sql_member_top5) 157 | db.commit() 158 | 159 | save_sql_member5 = "INSERT INTO 个人排行榜前五 values(%s,%s,%s);" 160 | cur.executemany(save_sql_member5,info_list) 161 | db.commit() 162 | print("写入数据库成功") 163 | except Exception as e: 164 | print("创建数据库失败:case%s" % e) 165 | 166 | def member_mvp_top12(): 167 | info_dict = member() 168 | mvp_int = [int(kill) for kill in info_dict['mvp次数']] 169 | member_mvp = np.array(mvp_int) # 转换为数组对象 170 | member_mvp_count = (np.argsort(-member_mvp))[:12] # argsort(-x)函数返回的是数组值从大到小的索引值 171 | 172 | member_mvp_top12_name = [info_dict['队员名称'][member_mvp_count[i]] for i in range(12)] 173 | member_mvp_top12_out_count = [info_dict['出场次数'][member_mvp_count[i]] for i in range(12)] 174 | member_mvp_top12_kill_sum = [info_dict['总击杀'][member_mvp_count[i]] for i in range(12)] 175 | member_mvp_top12_as_sum = [info_dict['总辅助'][member_mvp_count[i]] for i in range(12)] 176 | member_mvp_top12_die_sum = [info_dict['总死亡'][member_mvp_count[i]] for i in range(12)] 177 | 178 | info_list = [(member_mvp_top12_name[i], member_mvp_top12_out_count[i], member_mvp_top12_kill_sum[i], 179 | member_mvp_top12_as_sum[i],member_mvp_top12_die_sum[i],) for i in range(12)] 180 | 181 | db,cur = mysql() 182 | try: 183 | 184 | cur.execute("DROP TABLE IF EXISTS 个人MVP前十二") 185 | set_sql_member_mvp = """ 186 | create table 个人MVP前十二( 187 | 队员名称 varchar(20), 188 | 出场次数 varchar(10), 189 | 总击杀 varchar(10), 190 | 总助攻 varchar(10), 191 | 总死亡 varchar(10)) 192 | """ 193 | cur.execute(set_sql_member_mvp) 194 | db.commit() 195 | 196 | save_sql_member_top12 = "INSERT INTO 个人MVP前十二 values(%s,%s,%s,%s,%s);" 197 | cur.executemany(save_sql_member_top12,info_list) 198 | db.commit() 199 | print("写入数据库成功") 200 | except Exception as e: 201 | print("创建数据库失败:case%s" % e) 202 | 203 | def home_round(): 204 | tema_info_dict = teamrank() 205 | member_info_dict = member() 206 | 207 | # 首页圆圈一 208 | win_rate_array = np.array(tema_info_dict['胜率']) # 转换为数组对象 209 | win_rate_past_count = np.argsort(-win_rate_array) # argsort(-x)函数返回的是数组值从大到小的索引值 210 | team_rate_top1_name = tema_info_dict['队名'][win_rate_past_count[0]] 211 | team_rate_top1_win = tema_info_dict['胜场'][win_rate_past_count[0]] 212 | team_rate_top1_loss = tema_info_dict['败场'][win_rate_past_count[0]] 213 | 214 | # 首页圆圈二 215 | kill_top1_array = [int(i) for i in tema_info_dict['总击杀']] 216 | kill_top1_array = np.array(kill_top1_array) 217 | kill_top1_array_count = np.argsort(-kill_top1_array) 218 | kill_top1_name = tema_info_dict['队名'][kill_top1_array_count[0]] 219 | kill_top1_kill = tema_info_dict['总击杀'][kill_top1_array_count[0]] 220 | kill_top1_die = tema_info_dict['总死亡'][kill_top1_array_count[0]] 221 | 222 | #首页圆圈三 223 | eye_top1_array = np.array(tema_info_dict['插眼']) 224 | eye_top1_array_count = np.argsort(-eye_top1_array) 225 | eye_top_name = tema_info_dict['队名'][eye_top1_array_count[0]] 226 | eye_top_pl = tema_info_dict['插眼'][eye_top1_array_count[0]] 227 | eye_top_ki = tema_info_dict['排眼'][eye_top1_array_count[0]] 228 | 229 | #首页圆圈四 230 | kda_top1_index = member_info_dict['队员名称'].index('V5y4') 231 | kda_top1_kill = member_info_dict['总击杀'][kda_top1_index] 232 | kda_top1_as = member_info_dict['总辅助'][kda_top1_index] 233 | kda_top1_die = member_info_dict['总死亡'][kda_top1_index] 234 | kda_ka = int(kda_top1_kill)+int(kda_top1_as) 235 | 236 | #首页圆圈五 237 | die_top1 = [int(i) for i in member_info_dict['总死亡']] 238 | die_top1_array = np.array(die_top1) 239 | die_top1_array_index = np.argsort(-die_top1_array) 240 | die_top1_name = member_info_dict['队员名称'][die_top1_array_index[0]] 241 | die_top1_as = member_info_dict['总辅助'][die_top1_array_index[0]] 242 | die_top1_kill= member_info_dict['总击杀'][die_top1_array_index[0]] 243 | die_top1_die= member_info_dict['总死亡'][die_top1_array_index[0]] 244 | die_ka = int(die_top1_as)+int(die_top1_kill) 245 | 246 | #首页圆圈六 247 | member_kill_top1 = [int(i) for i in member_info_dict['总击杀']] 248 | member_kill_top1_array = np.array(member_kill_top1) 249 | member_kill_top1_array_index = np.argsort(-member_kill_top1_array) 250 | member_kill_top1_name = member_info_dict['队员名称'][member_kill_top1_array_index[0]] 251 | member_kill_top1_kill = member_info_dict['总击杀'][member_kill_top1_array_index[0]] 252 | member_kill_top1_as = member_info_dict['总辅助'][member_kill_top1_array_index[0]] 253 | member_kill_top1_die = member_info_dict['总死亡'][member_kill_top1_array_index[0]] 254 | member_kill_top1_da = int(member_kill_top1_die)+int(member_kill_top1_as) 255 | 256 | info_list = [(team_rate_top1_name,team_rate_top1_win,team_rate_top1_loss), 257 | (kill_top1_name,kill_top1_kill,kill_top1_die), 258 | (eye_top_name,eye_top_pl,eye_top_ki), 259 | ('V5y4',kda_ka,kda_top1_die), 260 | (die_top1_name,die_top1_die,die_ka), 261 | (member_kill_top1_name,member_kill_top1_kill,member_kill_top1_da)] 262 | 263 | db,cur = mysql() 264 | try: 265 | 266 | cur.execute("DROP TABLE IF EXISTS 首页圆圈数据") 267 | set_sql_home_data = """ 268 | create table 首页圆圈数据( 269 | name varchar(20), 270 | data1 varchar(10), 271 | data2 varchar(10)) 272 | """ 273 | cur.execute(set_sql_home_data) 274 | db.commit() 275 | 276 | save_sql_home_data = "INSERT INTO 首页圆圈数据 values(%s,%s,%s);" 277 | 278 | db.commit() 279 | cur.executemany(save_sql_home_data,info_list) 280 | db.commit() 281 | print("写入数据库成功") 282 | except Exception as e: 283 | print("创建数据库失败:case%s" % e) 284 | 285 | def hero(): 286 | hero_api = 'https://lpl.qq.com/web201612/data/LOL_MATCH2_MATCH_HERORANK_LIST_134_7_8.js' 287 | hero_name_api = 'https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js' 288 | info = get_info(hero_api) 289 | get_info_name = get_info(hero_name_api) 290 | info = json.loads(info) 291 | info_msg = info['msg']#英雄详细数据 292 | hero_key_id = [data['iChampionId'] for data in info_msg]#英雄对应的ID 293 | hero_out_count = [data['iAppearancesFrequency'] for data in info_msg]#英雄出场次数 294 | hero_pick = [int(float(data['sAveragingPick'])*100) for data in info_msg]#英雄pick率 295 | hero_win_rate = [int(float(data['sAveragingWin'])*100) for data in info_msg]#英雄胜率 296 | 297 | hero_pick_array = np.array(hero_pick) 298 | hero_pick_array_index = np.argsort(-hero_pick_array)[:60]#pick率top60对应的索引值 299 | hero_key_id_top60 = [hero_key_id[i] for i in hero_pick_array_index]#英雄id前60 300 | hero_out_count_top60 = [hero_out_count[i] for i in hero_pick_array_index]#英雄出场次数前60 301 | hero_pick_top60 = [hero_pick[i] for i in hero_pick_array_index]#英雄pick率前60 302 | hero_win_rate_top60 = [hero_win_rate[i] for i in hero_pick_array_index]#英雄胜率前60 303 | 304 | get_hero_name_dict = json.loads(get_info_name) 305 | hero_name_id_list = [i['heroId'] for i in get_hero_name_dict['hero']]#所有英雄对应的id 306 | hero_name_list = [i['name'] for i in get_hero_name_dict['hero']]#所有英雄名字 307 | name = [] 308 | for i in hero_key_id_top60: 309 | for j in hero_name_id_list: 310 | if i == j : 311 | #由于从lpl数据页面无法获取到英雄名称,只能获取到对应的id 312 | #一层循环是pick率前60的英雄id,二层是所有英雄的的id 313 | #通过if判断,将pick率前60的英雄写入到指定列表中 314 | name.append(hero_name_list[hero_name_id_list.index(j)]) 315 | 316 | info_list = [(name[i],hero_out_count_top60[i],str(hero_pick_top60[i])+'%',str(hero_win_rate_top60[i])+'%') 317 | for i in range(60)] 318 | 319 | db,cur = mysql() 320 | try: 321 | 322 | cur.execute("DROP TABLE IF EXISTS 英雄pick率前六十") 323 | set_sql_hero_top60 = """ 324 | create table 英雄pick率前六十( 325 | 英雄名称 varchar(20), 326 | 出场次数 varchar(10), 327 | pick比率 varchar(10), 328 | 胜率 varchar(10)) 329 | """ 330 | cur.execute(set_sql_hero_top60) 331 | db.commit() 332 | 333 | save_sql_hero_top60 = "INSERT INTO 英雄pick率前六十 values(%s,%s,%s,%s);" 334 | cur.executemany(save_sql_hero_top60,info_list) 335 | db.commit() 336 | print("写入数据库成功") 337 | except Exception as e: 338 | print("创建数据库失败:case%s" % e) 339 | 340 | 341 | if __name__ == '__main__': 342 | team_top5() 343 | team_rate_top12() 344 | member_top5() 345 | member_mvp_top12() 346 | home_round() 347 | hero() 348 | -------------------------------------------------------------------------------- /LPLDataShow/spider.py: -------------------------------------------------------------------------------- 1 | # @BY :Java_S 2 | # @Time :2020/8/4 9:04 3 | # @Slogan :够坚定够努力大门自然会有人敲,别怕没人赏识就像三十岁的梵高 4 | 5 | import time 6 | import pymysql 7 | from lxml import etree 8 | from selenium import webdriver 9 | 10 | class LPL_Data: 11 | def __init__(self): 12 | self.browser = webdriver.Chrome() 13 | self.headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.137 Safari/537.36 LBBROWSER'} 14 | self.url = 'https://lpl.qq.com/es/data/rank.shtml?iGameId=134&sGameType=7,8' 15 | self.db = pymysql.connect( 16 | host = 'localhost',user = 'root', 17 | passwd = '123456',db = 'lpl',charset = 'utf8') 18 | self.cur = self.db.cursor() 19 | 20 | def click(self,xp): 21 | self.browser.find_element_by_xpath(xp).click() 22 | 23 | def get_html(self,rule): 24 | info = self.browser.find_element_by_xpath(rule) 25 | html = info.get_attribute("innerHTML") 26 | return html 27 | 28 | def all_html(self): 29 | self.browser.get(self.url) 30 | 31 | #战队胜率前五 32 | wings_top5_html = self.get_html('//*[@id="data-page"]/div[4]/div[1]/div[2]/div/div[1]') 33 | 34 | #战队金钱前十二 35 | self.click('//*[@id="data-page"]/div[4]/div[1]/div[2]/div/ul/li[6]') 36 | time.sleep(1) 37 | wings_money12_html = self.get_html('//*[@id="data-page"]/div[4]/div[1]/div[2]/div/div[1]') 38 | 39 | #个人击杀前五 40 | self.click('//*[@id="data-page"]/ul/li[2]/a') 41 | time.sleep(1) 42 | member_kill_top5 = self.get_html('//*[@id="data-page"]/div[4]/div[2]/div[2]/div/div[1]') 43 | 44 | #个人MVP前十二 45 | self.click('//*[@id="data-page"]/div[4]/div[2]/div[2]/div/ul/li[10]/a') 46 | time.sleep(1) 47 | member_mvp_top12 = self.get_html('//*[@id="data-page"]/div[4]/div[2]/div[2]/div/div[1]') 48 | 49 | #英雄pick率前六十 50 | self.click('//*[@id="data-page"]/ul/li[3]/a') 51 | time.sleep(1) 52 | hero_top_1_12 = self.get_html('//*[@id="data-page"]/div[4]/div[3]/div[2]/div/div[1]') 53 | hero_top60 = [etree.HTML(hero_top_1_12)] 54 | for i in range(4): 55 | count = i+5 56 | if count < 7: 57 | self.click(f'//*[@id="heroPageContent"]/a[{count}]') 58 | else: 59 | self.click('//*[@id="heroPageContent"]/a[7]') 60 | time.sleep(1) 61 | hero_top = self.get_html('//*[@id="data-page"]/div[4]/div[3]/div[2]/div/div[1]') 62 | hero_top60.append(etree.HTML(hero_top)) 63 | 64 | #首页圆圈数据 65 | self.click('//*[@id="data-page"]/ul/li[1]/a') 66 | self.click('//*[@id="data-page"]/div[4]/div[1]/div[2]/div/ul/li[1]/a') 67 | time.sleep(1) 68 | win_rate_name = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[2]').text 69 | win_rate_v_d = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[4]/b').text.split('/') 70 | win_rate_v = win_rate_v_d[0] 71 | win_rate_d = win_rate_v_d[1] 72 | 73 | self.click('//*[@id="data-page"]/div[4]/div[1]/div[2]/div/ul/li[2]/a') 74 | time.sleep(1) 75 | wings_kill_name = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[2]').text 76 | wings_kill_kill = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[6]').text.split("(")[0] 77 | wings_kill_die = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[7]').text.split("(")[0] 78 | 79 | self.click('//*[@id="data-page"]/div[4]/div[1]/div[2]/div/ul/li[4]/a') 80 | time.sleep(1) 81 | play_eye_name = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[2]').text 82 | in_eye = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[8]/b').text 83 | out_eye = self.browser.find_element_by_xpath('//*[@id="teamRank"]/tr[1]/td[9]/b').text 84 | 85 | self.click('//*[@id="data-page"]/ul/li[2]/a') 86 | self.click('//*[@id="data-page"]/div[4]/div[2]/div[2]/div/ul/li[4]/a') 87 | time.sleep(1) 88 | kda_name = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[2]').text 89 | kda_kill = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[5]/b').text.split("(")[0] 90 | kda_a = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[6]/b').text.split("(")[0] 91 | kda_d = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[7]/b').text.split("(")[0] 92 | kda_ka = str(int(kda_a)+int(kda_kill)) 93 | 94 | self.click('//*[@id="data-page"]/div[4]/div[2]/div[2]/div/ul/li[3]/a') 95 | time.sleep(1) 96 | die_name = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[2]').text 97 | die_kill = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[5]/b').text.split("(")[0] 98 | die_a = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[6]/b').text.split("(")[0] 99 | die_d = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[7]/b').text.split("(")[0] 100 | die_ka = str(int(die_kill) + int(die_a)) 101 | 102 | self.click('//*[@id="data-page"]/div[4]/div[2]/div[2]/div/ul/li[1]/a') 103 | time.sleep(1) 104 | kill_name = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[2]').text 105 | kill_kill = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[5]/b').text.split("(")[0] 106 | kill_a = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[6]/b').text.split("(")[0] 107 | kill_d = self.browser.find_element_by_xpath('//*[@id="personalRank"]/tr[1]/td[7]/b').text.split("(")[0] 108 | kill_ad = str(int(kill_a) + int(kill_d)) 109 | 110 | self.browser.quit() 111 | 112 | name = [win_rate_name,wings_kill_name,play_eye_name,kda_name,die_name,kill_name] 113 | data1 = [win_rate_v,wings_kill_kill,in_eye,kda_ka,die_d,kill_kill] 114 | data2 = [win_rate_d,wings_kill_die,out_eye,kda_d,die_ka,kill_ad] 115 | round_list = [('name',name),('data1',data1),('data2',data2)] 116 | round_dict = {key:value for key,value in round_list} 117 | 118 | html_list = [('战队胜率前五', wings_top5_html), ('战队金钱前十二', wings_money12_html), ('个人击杀前五', member_kill_top5), 119 | ('个人MVP前十二', member_mvp_top12)] 120 | html_dict = {key: etree.HTML(value) for key, value in html_list} 121 | html_dict['英雄pick率前六十'] = hero_top60 122 | html_dict['首页圆圈数据'] = round_dict 123 | 124 | return html_dict 125 | 126 | def data(self): 127 | html_dict = self.all_html() 128 | 129 | # 战队排行榜前五 130 | wings_top_rule = ["//tbody[@id = 'teamRank']/tr/td[2]/text()","//tbody[@id = 'teamRank']/tr/td[3]/b/text()","//tbody[@id = 'teamRank']/tr/td[5]/b/text()"] 131 | wings_top_xpath = [html_dict['战队胜率前五'] for i in range(3)] 132 | wings_top5 = list(map(lambda xpath,rule :xpath.xpath(rule)[:5],wings_top_xpath,wings_top_rule)) 133 | 134 | # 战队胜负数据表 135 | wings_money12_rule = ["//tbody[@id = 'teamRank']/tr/td[2]/text()","//tbody[@id = 'teamRank']/tr/td[4]/b/strong/text()","//tbody[@id = 'teamRank']/tr/td[4]/b/em/text()","//tbody[@id = 'teamRank']/tr/td[5]/b/text()"] 136 | wings_money12_xpath = [html_dict['战队金钱前十二'] for i in range(4)] 137 | wings_money12 = list(map(lambda xpath,rule :xpath.xpath(rule),wings_money12_xpath,wings_money12_rule)) 138 | 139 | # 个人排行榜前五 140 | member_kill_name = html_dict['个人击杀前五'].xpath('//tbody[@id="personalRank"]/tr/td[2]/text()')[:5] 141 | member_kill_seat = html_dict['个人击杀前五'].xpath('//tbody[@id="personalRank"]/tr/td[3]/text()')[:5] 142 | member_kill_sum = [i[:3] for i in html_dict['个人击杀前五'].xpath('//tbody[@id="personalRank"]/tr/td[5]/b/text()')[:5]] 143 | member_kill_top5 = [member_kill_name,member_kill_seat,member_kill_sum] 144 | 145 | # 个人MVP前十二 146 | member_mvp_top12_name = html_dict['个人MVP前十二'].xpath('//tbody[@id="personalRank"]/tr/td[2]/text()') 147 | member_mvp_top12_out_count = html_dict['个人MVP前十二'].xpath('//tbody[@id="personalRank"]/tr/td[4]/b/text()') 148 | member_mvp_top12_kill_sum = [i[:3] for i in html_dict['个人MVP前十二'].xpath('//tbody[@id="personalRank"]/tr/td[5]/b/text()')] 149 | member_mvp_top12_assist_sum = [i[:3] for i in html_dict['个人MVP前十二'].xpath('//tbody[@id="personalRank"]/tr/td[6]/b/text()')] 150 | member_mvp_top12_die_sum = [i[:3] for i in html_dict['个人MVP前十二'].xpath('//tbody[@id="personalRank"]/tr/td[7]/b/text()')] 151 | member_mvp_top12 = [member_mvp_top12_name,member_mvp_top12_out_count,member_mvp_top12_kill_sum,member_mvp_top12_assist_sum,member_mvp_top12_die_sum] 152 | 153 | #英雄pick率前六十 154 | hero_name = [j for i in html_dict['英雄pick率前六十'] for j in i.xpath('//*[@id="heroRank"]/tr/td[2]/text()')] 155 | hero_out_count = [j for i in html_dict['英雄pick率前六十'] for j in i.xpath('//*[@id="heroRank"]/tr/td[3]/b/text()')] 156 | hero_pick = [j for i in html_dict['英雄pick率前六十'] for j in i.xpath('//*[@id="heroRank"]/tr/td[4]/b/text()')] 157 | hero_win_rete = [j for i in html_dict['英雄pick率前六十'] for j in i.xpath('//*[@id="heroRank"]/tr/td[6]/b/text()')] 158 | hero_top60 = [hero_name,hero_out_count,hero_pick,hero_win_rete] 159 | 160 | data_list = [('战队排行榜前五',wings_top5),('战队胜负数据表',wings_money12),('个人排行榜前五',member_kill_top5), 161 | ('个人MVP前十二',member_mvp_top12),('英雄pick率前六十',hero_top60)] 162 | data_dict = {key:value for key,value in data_list} 163 | data_dict['首页圆圈数据'] = html_dict['首页圆圈数据'] 164 | print("数据爬取成功!") 165 | return data_dict 166 | 167 | def save_mysql(self): 168 | data_dict = self.data() 169 | 170 | try: 171 | 172 | self.cur.execute("DROP TABLE IF EXISTS 战队排行榜前五") 173 | set_sql_top5 = """ 174 | create table 战队排行榜前五( 175 | 战队名称 varchar(20), 176 | 出场次数 varchar(10), 177 | 胜率 varchar(10)) 178 | """ 179 | self.cur.execute(set_sql_top5) 180 | self.db.commit() 181 | 182 | save_sql_top5 = "INSERT INTO 战队排行榜前五 values(%s,%s,%s);" 183 | for i in range(5): 184 | self.cur.execute(save_sql_top5, 185 | (data_dict['战队排行榜前五'][0][i], 186 | data_dict['战队排行榜前五'][1][i], 187 | data_dict['战队排行榜前五'][2][i])) 188 | self.db.commit() 189 | print("写入数据库成功") 190 | except Exception as e: 191 | print("创建数据库失败:case%s" % e) 192 | 193 | try: 194 | 195 | self.cur.execute("DROP TABLE IF EXISTS 战队胜负数据") 196 | set_sql_wings_wd = """ 197 | create table 战队胜负数据( 198 | 战队名称 varchar(20), 199 | 胜场次数 varchar(10), 200 | 败场次数 varchar(10), 201 | 胜率 varchar(10)) 202 | """ 203 | self.cur.execute(set_sql_wings_wd) 204 | self.db.commit() 205 | 206 | save_sql_wings_vd = "INSERT INTO 战队胜负数据 values(%s,%s,%s,%s);" 207 | for i in range(12): 208 | self.cur.execute(save_sql_wings_vd, 209 | (data_dict['战队胜负数据表'][0][i], 210 | data_dict['战队胜负数据表'][1][i], 211 | data_dict['战队胜负数据表'][2][i], 212 | data_dict['战队胜负数据表'][3][i])) 213 | self.db.commit() 214 | print("写入数据库成功") 215 | except Exception as e: 216 | print("创建数据库失败:case%s" % e) 217 | 218 | try: 219 | 220 | self.cur.execute("DROP TABLE IF EXISTS 个人排行榜前五") 221 | set_sql_member_top5 = """ 222 | create table 个人排行榜前五( 223 | 队员名称 varchar(20), 224 | 位置 varchar(10), 225 | 总击杀 varchar(10)) 226 | """ 227 | self.cur.execute(set_sql_member_top5) 228 | self.db.commit() 229 | 230 | save_sql_member5 = "INSERT INTO 个人排行榜前五 values(%s,%s,%s);" 231 | for i in range(5): 232 | self.cur.execute(save_sql_member5, 233 | (data_dict['个人排行榜前五'][0][i], 234 | data_dict['个人排行榜前五'][1][i], 235 | data_dict['个人排行榜前五'][2][i])) 236 | self.db.commit() 237 | print("写入数据库成功") 238 | except Exception as e: 239 | print("创建数据库失败:case%s" % e) 240 | 241 | try: 242 | 243 | self.cur.execute("DROP TABLE IF EXISTS 个人MVP前十二") 244 | set_sql_member_mvp = """ 245 | create table 个人MVP前十二( 246 | 队员名称 varchar(20), 247 | 出场次数 varchar(10), 248 | 总击杀 varchar(10), 249 | 总助攻 varchar(10), 250 | 总死亡 varchar(10)) 251 | """ 252 | self.cur.execute(set_sql_member_mvp) 253 | self.db.commit() 254 | 255 | save_sql_member_top12 = "INSERT INTO 个人MVP前十二 values(%s,%s,%s,%s,%s);" 256 | for i in range(12): 257 | self.cur.execute(save_sql_member_top12, 258 | (data_dict['个人MVP前十二'][0][i], 259 | data_dict['个人MVP前十二'][1][i], 260 | data_dict['个人MVP前十二'][2][i], 261 | data_dict['个人MVP前十二'][3][i], 262 | data_dict['个人MVP前十二'][4][i])) 263 | self.db.commit() 264 | print("写入数据库成功") 265 | except Exception as e: 266 | print("创建数据库失败:case%s" % e) 267 | 268 | try: 269 | 270 | self.cur.execute("DROP TABLE IF EXISTS 英雄pick率前六十") 271 | set_sql_hero_top60 = """ 272 | create table 英雄pick率前六十( 273 | 英雄名称 varchar(20), 274 | 出场次数 varchar(10), 275 | pick比率 varchar(10), 276 | 胜率 varchar(10)) 277 | """ 278 | self.cur.execute(set_sql_hero_top60) 279 | self.db.commit() 280 | 281 | save_sql_hero_top60 = "INSERT INTO 英雄pick率前六十 values(%s,%s,%s,%s);" 282 | for i in range(len(data_dict['英雄pick率前六十'][0])): 283 | self.cur.execute(save_sql_hero_top60, 284 | (data_dict['英雄pick率前六十'][0][i], 285 | data_dict['英雄pick率前六十'][1][i], 286 | data_dict['英雄pick率前六十'][2][i], 287 | data_dict['英雄pick率前六十'][3][i])) 288 | self.db.commit() 289 | print("写入数据库成功") 290 | except Exception as e: 291 | print("创建数据库失败:case%s" % e) 292 | 293 | try: 294 | 295 | self.cur.execute("DROP TABLE IF EXISTS 首页圆圈数据") 296 | set_sql_home_data = """ 297 | create table 首页圆圈数据( 298 | name varchar(20), 299 | data1 varchar(10), 300 | data2 varchar(10)) 301 | """ 302 | self.cur.execute(set_sql_home_data) 303 | self.db.commit() 304 | 305 | save_sql_home_data = "INSERT INTO 首页圆圈数据 values(%s,%s,%s);" 306 | 307 | self.db.commit() 308 | for i in range(len(data_dict['首页圆圈数据']['name'])): 309 | self.cur.execute(save_sql_home_data, 310 | (data_dict['首页圆圈数据']['name'][i], 311 | data_dict['首页圆圈数据']['data1'][i], 312 | data_dict['首页圆圈数据']['data2'][i])) 313 | self.db.commit() 314 | print("写入数据库成功") 315 | except Exception as e: 316 | print("创建数据库失败:case%s" % e) 317 | 318 | # lpl = LPL_Data() 319 | # lpl.save_mysql() -------------------------------------------------------------------------------- /LPLDataShow/static/js/js.js: -------------------------------------------------------------------------------- 1 | $(window).load(function(){ 2 | $(".loading").fadeOut() 3 | }) 4 | $(function () { 5 | echarts_1(); 6 | echarts_2(); 7 | echarts_3(); 8 | echarts_4(); 9 | echarts_5(); 10 | homedata(); 11 | wingstop5(); 12 | heropick60(); 13 | function echarts_1() { 14 | // 基于准备好的dom,初始化echarts实例 15 | var myChart = echarts.init(document.getElementById('echart1')); 16 | option = { 17 | tooltip : { 18 | trigger: 'item', 19 | formatter: "{b} : {c} ({d}%)" 20 | }, 21 | legend: { 22 | right:0, 23 | top:30, 24 | height:160, 25 | itemWidth:10, 26 | itemHeight:10, 27 | itemGap:10, 28 | textStyle:{ 29 | color: 'rgba(255,255,255,.6)', 30 | fontSize:12 31 | }, 32 | orient:'vertical', 33 | data:['RNG','DOM','WE','JDG','FPX'] 34 | }, 35 | calculable : true, 36 | series : [ 37 | { 38 | name:' ', 39 | color: ['#62c98d', '#2f89cf', '#4cb9cf', '#53b666', '#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9', '#7562c9','#c96262','#c25775','#00b7be'], 40 | type:'pie', 41 | radius : [30, 70], 42 | center : ['35%', '50%'], 43 | roseType : 'radius', 44 | label: { 45 | normal: { 46 | show: true 47 | }, 48 | emphasis: { 49 | show: true 50 | } 51 | }, 52 | 53 | lableLine: { 54 | normal: { 55 | show: true 56 | }, 57 | emphasis: { 58 | show: true 59 | } 60 | }, 61 | 62 | data:[ 63 | {value:10, name:'RNG'}, 64 | {value:5, name:'DOM'}, 65 | {value:15, name:'WE'}, 66 | {value:25, name:'JDG'}, 67 | {value:20, name:'FPX'}, 68 | 69 | ] 70 | }, 71 | ] 72 | }; 73 | 74 | // 使用刚指定的配置项和数据显示图表。 75 | myChart.setOption(option); 76 | window.addEventListener("resize",function(){ 77 | myChart.resize(); 78 | }); 79 | } 80 | function echarts_2() { 81 | // 基于准备好的dom,初始化echarts实例 82 | var myChart = echarts.init(document.getElementById('echart2')); 83 | 84 | option = { 85 | tooltip: { 86 | trigger: 'item', 87 | formatter: "{b} : {c} ({d}%)" 88 | }, 89 | legend: { 90 | 91 | top:'15%', 92 | data: ['LNG\nLight', 'RNG\nXLB', 'FPX\nDoinb', 'IG\nTheShy', 'TES\nknight'], 93 | icon: 'circle', 94 | textStyle: { 95 | color: 'rgba(255,255,255,.6)', 96 | } 97 | }, 98 | calculable: true, 99 | series: [{ 100 | name: '', 101 | color: ['#62c98d', '#2f89cf', '#4cb9cf', '#53b666', '#62c98d', '#205acf', '#c9c862', '#c98b62', '#c962b9','#c96262'], 102 | type: 'pie', 103 | //起始角度,支持范围[0, 360] 104 | startAngle: 0, 105 | //饼图的半径,数组的第一项是内半径,第二项是外半径 106 | radius: [51, 100], 107 | //支持设置成百分比,设置成百分比时第一项是相对于容器宽度,第二项是相对于容器高度 108 | center: ['50%', '45%'], 109 | 110 | //是否展示成南丁格尔图,通过半径区分数据大小。可选择两种模式: 111 | // 'radius' 面积展现数据的百分比,半径展现数据的大小。 112 | // 'area' 所有扇区面积相同,仅通过半径展现数据大小 113 | roseType: 'area', 114 | //是否启用防止标签重叠策略,默认开启,圆环图这个例子中需要强制所有标签放在中心位置,可以将该值设为 false。 115 | avoidLabelOverlap: false, 116 | label: { 117 | normal: { 118 | show: true, 119 | // formatter: '{c}辆' 120 | }, 121 | emphasis: { 122 | show: true 123 | } 124 | }, 125 | labelLine: { 126 | normal: { 127 | show: true, 128 | length2: 1, 129 | }, 130 | emphasis: { 131 | show: true 132 | } 133 | }, 134 | data: [ 135 | {value: 1,name: 'LNG\nLight',}, 136 | {value: 4,name: 'RNG\nXLB',}, 137 | {value: 5,name: 'FPX\nDoinb',}, 138 | {value: 6,name: 'IG\nTheShy',}, 139 | {value: 9,name: 'TES\nknight',}, 140 | 141 | 142 | 143 | {value: 0, name: "",label: {show: false},labelLine: {show: false}}, 144 | {value: 0, name: "",label: {show: false},labelLine: {show: false}}, 145 | {value: 0, name: "",label: {show: false},labelLine: {show: false}}, 146 | {value: 0, name: "",label: {show: false},labelLine: {show: false}}, 147 | {value: 0, name: "",label: {show: false},labelLine: {show: false}}, 148 | 149 | 150 | ] 151 | }] 152 | }; 153 | 154 | // 使用刚指定的配置项和数据显示图表。 155 | myChart.setOption(option); 156 | window.addEventListener("resize",function(){ 157 | myChart.resize(); 158 | }); 159 | } 160 | function echarts_3() { 161 | // 基于准备好的dom,初始化echarts实例 162 | var myChart = echarts.init(document.getElementById('echart3')); 163 | var lpl = {}; 164 | $.ajax({ 165 | url:'/memberdata', 166 | data: {}, 167 | type: 'POST', 168 | async: false, 169 | dataType:'json', 170 | success:function (data) { 171 | lpl.name = data.name; 172 | lpl.killsum = data.killsum; 173 | lpl.assistsum = data.assistsum; 174 | lpl.diesum = data.diesum; 175 | myChart.setOption({ 176 | tooltip: { 177 | trigger: 'axis', 178 | axisPointer: { 179 | lineStyle: { 180 | color: '#57617B' 181 | } 182 | } 183 | }, 184 | legend: { 185 | 186 | //icon: 'vertical', 187 | data: ['总击杀', '总助攻','总死亡'], 188 | //align: 'center', 189 | // right: '35%', 190 | top:'0', 191 | textStyle: { 192 | color: "#fff" 193 | }, 194 | // itemWidth: 15, 195 | // itemHeight: 15, 196 | itemGap: 20, 197 | }, 198 | grid: { 199 | left: '0', 200 | right: '20', 201 | top:'10', 202 | bottom: '20', 203 | containLabel: true 204 | }, 205 | xAxis: [{ 206 | type: 'category', 207 | boundaryGap: false, 208 | axisLabel: { 209 | show: true, 210 | textStyle: { 211 | color: 'rgba(255,255,255,1)', 212 | fontSize:8 213 | } 214 | }, 215 | axisLine: { 216 | lineStyle: { 217 | color: 'rgba(255,255,255,.1)' 218 | } 219 | }, 220 | data: lpl.name 221 | },], 222 | yAxis: [{ 223 | axisLabel: { 224 | show: true, 225 | textStyle: { 226 | color: 'rgba(255,255,255,.6)' 227 | } 228 | }, 229 | axisLine: { 230 | lineStyle: { 231 | color: 'rgba(255,255,255,.1)' 232 | } 233 | }, 234 | splitLine: { 235 | lineStyle: { 236 | color: 'rgba(255,255,255,.1)' 237 | } 238 | } 239 | }], 240 | series: [{ 241 | name: '总击杀', 242 | type: 'line', 243 | smooth: true, 244 | symbol: 'circle', 245 | symbolSize: 5, 246 | showSymbol: false, 247 | lineStyle: { 248 | normal: { 249 | width: 2 250 | } 251 | }, 252 | areaStyle: { 253 | normal: { 254 | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ 255 | offset: 0, 256 | color: 'rgba(24, 163, 64, 0.3)' 257 | }, { 258 | offset: 0.8, 259 | color: 'rgba(24, 163, 64, 0)' 260 | }], false), 261 | shadowColor: 'rgba(0, 0, 0, 0.1)', 262 | shadowBlur: 10 263 | } 264 | }, 265 | itemStyle: { 266 | normal: { 267 | color: '#cdba00', 268 | borderColor: 'rgba(137,189,2,0.27)', 269 | borderWidth: 12 270 | } 271 | }, 272 | data: lpl.killsum 273 | }, { 274 | name: '总助攻', 275 | type: 'line', 276 | smooth: true, 277 | symbol: 'circle', 278 | symbolSize: 5, 279 | showSymbol: false, 280 | lineStyle: { 281 | normal: { 282 | width: 2 283 | } 284 | }, 285 | areaStyle: { 286 | normal: { 287 | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ 288 | offset: 0, 289 | color: 'rgba(39, 122,206, 0.3)' 290 | }, { 291 | offset: 0.8, 292 | color: 'rgba(39, 122,206, 0)' 293 | }], false), 294 | shadowColor: 'rgba(0, 0, 0, 0.1)', 295 | shadowBlur: 10 296 | } 297 | }, 298 | itemStyle: { 299 | normal: { 300 | color: '#277ace', 301 | borderColor: 'rgba(0,136,212,0.2)', 302 | borderWidth: 12 303 | } 304 | }, 305 | data: lpl.assistsum 306 | }, { 307 | name: '总死亡', 308 | type: 'line', 309 | smooth: true, 310 | symbol: 'circle', 311 | symbolSize: 5, 312 | showSymbol: false, 313 | lineStyle: { 314 | normal: { 315 | width: 2 316 | } 317 | }, 318 | areaStyle: { 319 | normal: { 320 | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ 321 | offset: 0, 322 | color: 'rgba(39, 122,206, 0.3)' 323 | }, { 324 | offset: 0.8, 325 | color: 'rgba(39, 122,206, 0)' 326 | }], false), 327 | shadowColor: 'rgba(0, 0, 0, 0.1)', 328 | shadowBlur: 10 329 | } 330 | }, 331 | itemStyle: { 332 | normal: { 333 | color: '#67E0E3', 334 | borderColor: 'rgba(10,148,236,0.5)', 335 | borderWidth: 12 336 | } 337 | }, 338 | data: lpl.diesum 339 | }] 340 | }) 341 | }, 342 | error:function (msg) { 343 | console.log(msg); 344 | alert('系统发生错误!个人击杀数据'); 345 | } 346 | }); 347 | window.addEventListener("resize",function(){ 348 | myChart.resize(); 349 | }); 350 | } 351 | function echarts_4() { 352 | // 基于准备好的dom,初始化echarts实例 353 | var myChart = echarts.init(document.getElementById('echart4')); 354 | var lpl = {}; 355 | $.ajax({ 356 | url:'/wingsvd', 357 | data: {}, 358 | type: 'POST', 359 | async: false, 360 | dataType:'json', 361 | success: function (data) { 362 | lpl.name = data.name; 363 | lpl.victory = data.victory; 364 | lpl.defeat = data.defeat; 365 | lpl.winRate = data.winRate; 366 | myChart.setOption({ 367 | tooltip: { 368 | trigger: 'axis', 369 | axisPointer: { 370 | lineStyle: { 371 | color: '#ffffff' 372 | } 373 | } 374 | }, 375 | legend: { 376 | 377 | "data": [ 378 | {"name": "Victory"}, 379 | {"name": "Defeat"}, 380 | {"name": "胜率"} 381 | ], 382 | "top": "0%", 383 | "textStyle": { 384 | "color": "rgba(255,255,255,1)",//图例文字 385 | "fontSize":"16" 386 | } 387 | }, 388 | 389 | xAxis: [ 390 | { 391 | "type": "category", 392 | 393 | data: lpl.name, 394 | axisLine: { lineStyle: {color: "rgba(255,255,255,.1)"}}, 395 | axisLabel: { textStyle: {color: "rgb(255,255,255)", fontSize: '16', }, 396 | }, 397 | 398 | }, 399 | ], 400 | yAxis: [ 401 | { 402 | "type": "value", 403 | "name": "次数", 404 | "min": 0, 405 | "max": 30, 406 | "interval": 10, 407 | "axisLabel": { 408 | "show": true, 409 | 410 | }, 411 | axisLine: {lineStyle: {color: 'rgba(255,255,255,1)'}},//左线色 412 | splitLine: {show:true,lineStyle: {color:"rgba(255,255,255,1)"}},//x轴线 413 | }, 414 | { 415 | "type": "value", 416 | "name": "胜率", 417 | "show": true, 418 | "axisLabel": { 419 | "show": true, 420 | 421 | }, 422 | axisLine: {lineStyle: {color: 'rgba(255,255,255,1 )'}},//右线色 423 | splitLine: {show:true,lineStyle: {color:"rgba(255,255,255,0.2)"}},//x轴线 424 | }, 425 | ], 426 | grid: { 427 | "top": "10%", 428 | "right":"30", 429 | "bottom":"30", 430 | "left":"30", 431 | }, 432 | series: [ 433 | { 434 | "name": "Victory", 435 | 436 | "type": "bar", 437 | "data": lpl.victory, 438 | "barWidth": "auto", 439 | "itemStyle": { 440 | "normal": { 441 | "color": { 442 | "type": "linear", 443 | "x": 0, 444 | "y": 0, 445 | "x2": 0, 446 | "y2": 1, 447 | "colorStops": [ 448 | { 449 | "offset": 0, 450 | "color": "#67E0E3" 451 | }, 452 | 453 | { 454 | "offset": 1, 455 | "color": "#67E0E3" 456 | } 457 | ], 458 | "globalCoord": false 459 | } 460 | } 461 | } 462 | }, 463 | { 464 | "name": "Defeat", 465 | "type": "bar", 466 | "data": lpl.defeat, 467 | "barWidth": "auto", 468 | 469 | "itemStyle": { 470 | "normal": { 471 | "color": { 472 | "type": "linear", 473 | "x": 0, 474 | "y": 0, 475 | "x2": 0, 476 | "y2": 1, 477 | "colorStops": [ 478 | { 479 | "offset": 0, 480 | "color": "#FFDB5C" 481 | }, 482 | { 483 | "offset": 1, 484 | "color": "#FFDB5C" 485 | } 486 | ], 487 | "globalCoord": false 488 | } 489 | } 490 | }, 491 | "barGap": "0" 492 | }, 493 | { 494 | "name": "胜率", 495 | "type": "line", 496 | "yAxisIndex": 1, 497 | 498 | "data": lpl.winRate, 499 | lineStyle: { 500 | normal: { 501 | width: 2 502 | }, 503 | }, 504 | "itemStyle": { 505 | "normal": { 506 | "color": "#48f593", 507 | 508 | } 509 | }, 510 | "smooth": true 511 | } 512 | ] 513 | }) 514 | }, 515 | error:function (msg) { 516 | console.log(msg); 517 | alert('系统发生错误!'); 518 | } 519 | }); 520 | window.addEventListener("resize",function(){ 521 | myChart.resize(); 522 | }); 523 | } 524 | function echarts_5() { 525 | // 基于准备好的dom,初始化echarts实例 526 | var myChart = echarts.init(document.getElementById('echart5')); 527 | var lpl = {}; 528 | $.ajax({ 529 | url:'/memberdata', 530 | data: {}, 531 | type: 'POST', 532 | async: false, 533 | dataType:'json', 534 | success:function (data) { 535 | lpl.name = data.name; 536 | lpl.outcount = data.outcount; 537 | lpl.killsum = data.killsum; 538 | lpl.assistsum = data.assistsum; 539 | lpl.diesum = data.diesum; 540 | myChart.setOption({ 541 | tooltip: { 542 | trigger: 'axis', 543 | axisPointer: { // 坐标轴指示器,坐标轴触发有效 544 | type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' 545 | } 546 | }, 547 | legend: { 548 | data: ['出场次数', '总击杀', '总助攻', '总死亡',], 549 | textStyle: { 550 | color: 'skyblue' 551 | } 552 | }, 553 | grid: { 554 | left: '0%', 555 | right: '4%', 556 | bottom: '1%', 557 | containLabel: true 558 | }, 559 | xAxis: { 560 | type: 'value', 561 | axisLine: {lineStyle: {color: 'rgba(255,255,255,1)'}},//左线色 562 | }, 563 | yAxis: { 564 | type: 'category', 565 | axisLine: {lineStyle: {color: 'rgba(255,255,255,1)'}},//左线色 566 | splitLine: {show:true,lineStyle: {color:"rgba(255,255,255,.1)"}},//x轴线 567 | data: lpl.name 568 | }, 569 | series: [ 570 | { 571 | name: '出场次数', 572 | type: 'bar', 573 | stack: '总量', 574 | itemStyle: { 575 | color: '#37A2DA' 576 | }, 577 | label: { 578 | show: false, 579 | position: 'insideRight' 580 | }, 581 | data: lpl.outcount 582 | }, 583 | { 584 | name: '总击杀', 585 | type: 'bar', 586 | stack: '总量', 587 | itemStyle: { 588 | color: '#67E0E3' 589 | }, 590 | label: { 591 | show: false, 592 | position: 'insideRight' 593 | }, 594 | data: lpl.killsum 595 | }, 596 | { 597 | name: '总助攻', 598 | type: 'bar', 599 | stack: '总量', 600 | itemStyle: { 601 | color: '#FFDB5C' 602 | }, 603 | label: { 604 | show: false, 605 | position: 'insideRight' 606 | }, 607 | data: lpl.assistsum 608 | }, 609 | { 610 | name: '总死亡', 611 | type: 'bar', 612 | stack: '总量', 613 | itemStyle: { 614 | color: '#FF9F7F' 615 | }, 616 | label: { 617 | show: false, 618 | position: 'insideRight' 619 | }, 620 | data: lpl.diesum 621 | }, 622 | 623 | ] 624 | }) 625 | }, 626 | error:function (msg) { 627 | console.log(msg); 628 | alert('系统发生错误!个人数据堆叠图'); 629 | } 630 | }); 631 | // 使用刚指定的配置项和数据显示图表。 632 | window.addEventListener("resize",function(){ 633 | myChart.resize(); 634 | }); 635 | } 636 | function round(elm,data1,data2,clolr,str1,str2,str3) { 637 | // 基于准备好的dom,初始化echarts实例 638 | var myChart = echarts.init(document.getElementById(elm)); 639 | var v2=data2//胜利 640 | var v1=data1//战败 641 | var v3=v1+v2//总消费 642 | option = { 643 | tooltip: { 644 | trigger: 'item', 645 | }, 646 | series: [{ 647 | 648 | type: 'pie', 649 | radius: ['60%', '70%'], 650 | color:clolr, 651 | label: { 652 | normal: { 653 | position: 'center' 654 | } 655 | }, 656 | data: [{ 657 | value: v2, 658 | name: str1, 659 | label: { 660 | normal: { 661 | formatter: v2 +'', 662 | textStyle: { 663 | fontSize: 20, 664 | color:'#fff', 665 | } 666 | } 667 | } 668 | }, { 669 | value: v1, 670 | name: str2, 671 | label: { 672 | normal: { 673 | formatter : function (params){ 674 | return str3 675 | }, 676 | textStyle: { 677 | color: '#aaa', 678 | fontSize: 12 679 | } 680 | } 681 | }, 682 | itemStyle: { 683 | normal: { 684 | color: 'rgba(255,255,255,.2)' 685 | }, 686 | emphasis: { 687 | color: '#fff' 688 | } 689 | }, 690 | }] 691 | }] 692 | }; 693 | myChart.setOption(option); 694 | window.addEventListener("resize",function(){ 695 | myChart.resize(); 696 | }); 697 | } 698 | function KDA(ka,d) { 699 | // 基于准备好的dom,初始化echarts实例 700 | var myChart = echarts.init(document.getElementById('zb6')); 701 | var v1=d//死亡 702 | var v2=ka//击杀和助攻 703 | option = { 704 | tooltip: { 705 | trigger: 'item', 706 | }, 707 | series: [{ 708 | 709 | type: 'pie', 710 | radius: ['60%', '70%'], 711 | color:'#FB7293', 712 | label: { 713 | normal: { 714 | position: 'center' 715 | } 716 | }, 717 | data: [{ 718 | value: v2, 719 | name: '击杀和助攻', 720 | label: { 721 | normal: { 722 | formatter: v2 +'', 723 | textStyle: { 724 | fontSize: 20, 725 | color:'#fff', 726 | } 727 | } 728 | } 729 | }, { 730 | value: v1, 731 | name: '死亡', 732 | label: { 733 | normal: { 734 | formatter : function (params){ 735 | return 'KDA:'+Math.round( (ka)/d) 736 | }, 737 | textStyle: { 738 | color: '#aaa', 739 | fontSize: 12 740 | } 741 | } 742 | }, 743 | itemStyle: { 744 | normal: { 745 | color: 'rgba(255,255,255,.2)' 746 | }, 747 | emphasis: { 748 | color: '#fff' 749 | } 750 | }, 751 | }] 752 | }] 753 | }; 754 | myChart.setOption(option); 755 | window.addEventListener("resize",function(){ 756 | myChart.resize(); 757 | }); 758 | } 759 | 760 | function wingstop5() { 761 | $.ajax({ 762 | url:'/wingstop5', 763 | data: {}, 764 | type: 'POST', 765 | async: false, 766 | dataType:'json', 767 | success:function (data) { 768 | $("#wingstop5").children('tr').each(function (index,dom) { 769 | if (index != 0){ 770 | $(dom).children('td').eq(1).text(data.name[index-1]); 771 | $(dom).children('td').eq(2).text(data.outcount[index-1]); 772 | $(dom).children('td').eq(3).text(data.winRate[index-1]); 773 | } 774 | }); 775 | $("#membertop5").children('tr').each(function (index,dom) { 776 | if (index != 0){ 777 | $(dom).children('td').eq(1).text(data.membername[index-1]); 778 | $(dom).children('td').eq(2).text(data.memberpost[index-1]); 779 | $(dom).children('td').eq(3).text(data.memberkillsum[index-1]); 780 | } 781 | }) 782 | }, 783 | error:function (msg) { 784 | console.log(msg); 785 | alert('系统发生错误!战队排行榜'); 786 | } 787 | }) 788 | 789 | 790 | } 791 | function heropick60() { 792 | $.ajax({ 793 | url:'/heropick', 794 | data: {}, 795 | type: 'POST', 796 | async: false, 797 | dataType:'json', 798 | success:function (data) { 799 | var name = data.name; 800 | var outcount = data.outcount; 801 | var winrate = data.winrate; 802 | var picknum = data.picknum; 803 | 804 | $.each(name,function (i,item) { 805 | $("#heropick").append("
  • "+ item +""+outcount[i]+""+picknum[i]+""+winrate[i]+"

  • "); 806 | }); 807 | $('.wrap,.adduser').liMarquee({ 808 | direction: 'up',/*身上滚动*/ 809 | runshort: false,/*内容不足时不滚动*/ 810 | scrollamount: 20/*速度*/ 811 | }); 812 | }, 813 | error:function (msg) { 814 | console.log(msg); 815 | alert('系统发生错误!战队排行榜'); 816 | } 817 | }) 818 | } 819 | function homedata() { 820 | $.ajax({ 821 | url:'/homeround', 822 | data: {}, 823 | type: 'POST', 824 | async: false, 825 | dataType:'json', 826 | success:function (data) { 827 | var homename = data.name 828 | var data1 = data.data1 829 | var data2 = data.data2 830 | 831 | $("#winratetop").append(homename[0]+"
    胜率最高"); 832 | $("#killtop").append(homename[1]+"
    击杀最高"); 833 | $("#ineyetop").append(homename[2]+"
    插眼最多"); 834 | $("#memberkdatop").append(homename[3]+"
    KDA最高"); 835 | $("#memberdietop").append(homename[4]+"
    死亡最多"); 836 | $("#memberkilltop").append(homename[5]+"
    击杀最多"); 837 | 838 | round('zb1',data2[0],data1[0],'#37A2DA','胜利','战败','胜利场数'); 839 | round('zb2',data2[1],data1[1],'#32C5E9','总击杀','总死亡','总击杀'); 840 | round('zb3',data2[2],data1[2],'#67E0E3','插眼','排眼','总插眼'); 841 | round('zb5',data2[4],data1[4],'#FFDB5C','助攻','击杀和助攻','总死亡'); 842 | round('zb4',data2[5],data1[5],'#9FE6B8','击杀','死亡和助攻','总击杀'); 843 | KDA(data1[3],data2[3]); 844 | }, 845 | error:function (msg) { 846 | console.log(msg); 847 | alert('系统发生错误!战队排行榜'); 848 | } 849 | }); 850 | 851 | 852 | } 853 | }) 854 | 855 | 856 | 857 | 858 | -------------------------------------------------------------------------------- /LPLDataShow/static/js/jquery.liMarquee.js: -------------------------------------------------------------------------------- 1 | /* 2 | * JQuery liMarquee v 4.6 3 | * 4 | * Copyright 2013, Linnik Yura | LI MASS CODE | http://masscode.ru 5 | * http://masscode.ru/index.php/k2/item/44-limarquee 6 | * Free to use 7 | * 8 | * Last Update 20.11.2014 9 | */ 10 | (function ($) { 11 | var methods = { 12 | init: function (options) { 13 | var p = { 14 | direction: 'left', //Указывает направление движения содержимого контейнера (left | right | up | down) 15 | loop: -1, //Задает, сколько раз будет прокручиваться содержимое. "-1" для бесконечного воспроизведения движения 16 | scrolldelay: 0, //Величина задержки в миллисекундах между движениями 17 | scrollamount: 50, //Скорость движения контента (px/sec) 18 | circular: true, //Если "true" - строка непрерывная 19 | drag: true, //Если "true" - включено перетаскивание строки 20 | runshort: true, //Если "true" - короткая строка тоже "бегает", "false" - стоит на месте 21 | hoverstop: true, //true - строка останавливается при наведении курсора мыши, false - строка не останавливается 22 | inverthover: false, //false - стандартное поведение. Если "true" - строка начинает движение только при наведении курсора 23 | xml: false //Путь к xml файлу с нужным текстом 24 | }; 25 | if (options) { 26 | $.extend(p, options); 27 | } 28 | 29 | return this.each(function () { 30 | var enterEvent = 'mouseenter'; 31 | var leaveEvent = 'mouseleave'; 32 | if(p.inverthover){ 33 | enterEvent = 'mouseleave'; 34 | leaveEvent = 'mouseenter'; 35 | } 36 | 37 | 38 | var 39 | loop = p.loop, 40 | strWrap = $(this).addClass('str_wrap').data({scrollamount:p.scrollamount}), 41 | fMove = false; 42 | 43 | 44 | 45 | var strWrapStyle = strWrap.attr('style'); 46 | 47 | if(strWrapStyle){ 48 | var wrapStyleArr = strWrapStyle.split(';'); 49 | var startHeight = false; 50 | for(var i=0; i < wrapStyleArr.length; i++){ 51 | var str = $.trim(wrapStyleArr[i]); 52 | var tested = str.search(/^height/g); 53 | if(tested != -1){ 54 | startHeight = parseFloat(strWrap.css('height')); 55 | } 56 | } 57 | } 58 | 59 | var code = function () { 60 | 61 | strWrap.off('mouseleave'); 62 | strWrap.off('mouseenter'); 63 | strWrap.off('mousemove'); 64 | strWrap.off('mousedown'); 65 | strWrap.off('mouseup'); 66 | 67 | 68 | if(!$('.str_move',strWrap).length){ 69 | strWrap.wrapInner($('
    ').addClass('str_move')); 70 | } 71 | 72 | var 73 | strMove = $('.str_move', strWrap).addClass('str_origin'), 74 | strMoveClone = strMove.clone().removeClass('str_origin').addClass('str_move_clone'), 75 | time = 0; 76 | 77 | if (!p.hoverstop) { 78 | strWrap.addClass('noStop'); 79 | } 80 | 81 | var circCloneHor = function(){ 82 | strMoveClone.clone().css({ 83 | left:'100%', 84 | right:'auto', 85 | width: strMove.width() 86 | }).appendTo(strMove); 87 | strMoveClone.css({ 88 | right: '100%', 89 | left:'auto', 90 | width: strMove.width() 91 | }).appendTo(strMove); 92 | } 93 | 94 | var circCloneVert = function(){ 95 | strMoveClone.clone().css({ 96 | top: '100%', 97 | bottom:'auto', 98 | height: strMove.height() 99 | }).appendTo(strMove); 100 | strMoveClone.css({ 101 | bottom: '100%', 102 | top:'auto', 103 | height:strMove.height() 104 | }).appendTo(strMove); 105 | } 106 | 107 | 108 | 109 | if (p.direction == 'left') { 110 | strWrap.height(strMove.outerHeight()) 111 | if (strMove.width() > strWrap.width()) { 112 | var leftPos = -strMove.width(); 113 | 114 | if (p.circular) { 115 | 116 | if (!p.xml) { 117 | circCloneHor() 118 | leftPos = -(strMove.width() + (strMove.width() - strWrap.width())); 119 | } 120 | } 121 | if (p.xml) { 122 | strMove.css({ 123 | left:strWrap.width() 124 | }) 125 | } 126 | var 127 | strMoveLeft = strWrap.width(), 128 | k1 = 0, 129 | timeFunc1 = function () { 130 | var 131 | fullS = Math.abs(leftPos), 132 | time = (fullS / strWrap.data('scrollamount')) * 1000; 133 | if (parseFloat(strMove.css('left')) != 0) { 134 | fullS = (fullS + strWrap.width()); 135 | time = (fullS - (strWrap.width() - parseFloat(strMove.css('left')))) / strWrap.data('scrollamount') * 1000; 136 | } 137 | return time; 138 | }, 139 | moveFuncId1 = false, 140 | moveFunc1 = function () { 141 | if (loop != 0) { 142 | strMove.stop(true).animate({ 143 | left: leftPos 144 | }, timeFunc1(), 'linear', function () { 145 | $(this).css({ 146 | left: strWrap.width() 147 | }); 148 | if (loop == -1) { 149 | moveFuncId1 = setTimeout(moveFunc1, p.scrolldelay); 150 | } else { 151 | loop--; 152 | moveFuncId1 = setTimeout(moveFunc1, p.scrolldelay); 153 | } 154 | }); 155 | } 156 | }; 157 | strWrap.data({ 158 | moveId: moveFuncId1 , 159 | moveF : moveFunc1 160 | }) 161 | if(!p.inverthover){ 162 | moveFunc1(); 163 | } 164 | 165 | if (p.hoverstop) { 166 | strWrap.on(enterEvent, function () { 167 | $(this).addClass('str_active'); 168 | clearTimeout(moveFuncId1); 169 | strMove.stop(true); 170 | }).on(leaveEvent, function () { 171 | $(this).removeClass('str_active'); 172 | $(this).off('mousemove'); 173 | moveFunc1(); 174 | }); 175 | 176 | if (p.drag) { 177 | strWrap.on('mousedown', function (e) { 178 | if(p.inverthover){ 179 | strMove.stop(true); 180 | } 181 | //drag 182 | var dragLeft; 183 | var dir = 1; 184 | var newX; 185 | var oldX = e.clientX; 186 | //drag 187 | 188 | strMoveLeft = strMove.position().left; 189 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 190 | 191 | 192 | 193 | $(this).on('mousemove', function (e) { 194 | fMove = true; 195 | 196 | //drag 197 | newX = e.clientX; 198 | if(newX > oldX){ 199 | dir = 1 200 | }else{ 201 | dir = -1 202 | } 203 | oldX = newX 204 | dragLeft = k1 + (e.clientX - strWrap.offset().left); 205 | 206 | if (!p.circular) { 207 | if(dragLeft < -strMove.width() && dir < 0){ 208 | dragLeft = strWrap.width(); 209 | strMoveLeft = strMove.position().left; 210 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 211 | } 212 | if(dragLeft > strWrap.width() && dir > 0){ 213 | dragLeft = -strMove.width(); 214 | strMoveLeft = strMove.position().left; 215 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 216 | } 217 | }else{ 218 | if(dragLeft < -strMove.width() && dir < 0){ 219 | dragLeft = 0; 220 | strMoveLeft = strMove.position().left; 221 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 222 | } 223 | if(dragLeft > 0 && dir > 0){ 224 | dragLeft = -strMove.width(); 225 | strMoveLeft = strMove.position().left; 226 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 227 | } 228 | 229 | } 230 | 231 | 232 | strMove.stop(true).css({ 233 | left: dragLeft 234 | }); 235 | //drag 236 | 237 | 238 | 239 | }).on('mouseup', function () { 240 | $(this).off('mousemove'); 241 | if(p.inverthover){ 242 | strMove.trigger('mouseenter') 243 | } 244 | setTimeout(function () { 245 | fMove = false 246 | }, 50) 247 | 248 | }); 249 | return false; 250 | }) 251 | .on('click', function () { 252 | if (fMove) { 253 | return false 254 | } 255 | }); 256 | } else { 257 | strWrap.addClass('no_drag'); 258 | }; 259 | } 260 | } else { 261 | if (p.runshort) { 262 | strMove.css({ 263 | left: strWrap.width() 264 | }); 265 | var 266 | strMoveLeft = strWrap.width(), 267 | k1 = 0, 268 | timeFunc = function () { 269 | time = (strMove.width() + strMove.position().left) / strWrap.data('scrollamount') * 1000; 270 | return time; 271 | }; 272 | var moveFunc = function () { 273 | var leftPos = -strMove.width(); 274 | strMove.animate({ 275 | left: leftPos 276 | }, timeFunc(), 'linear', function () { 277 | $(this).css({ 278 | left: strWrap.width() 279 | }); 280 | if (loop == -1) { 281 | setTimeout(moveFunc, p.scrolldelay); 282 | } else { 283 | loop--; 284 | setTimeout(moveFunc, p.scrolldelay); 285 | } 286 | }); 287 | }; 288 | strWrap.data({ 289 | moveF : moveFunc 290 | }) 291 | if(!p.inverthover){ 292 | moveFunc(); 293 | } 294 | if (p.hoverstop) { 295 | strWrap.on(enterEvent, function () { 296 | $(this).addClass('str_active'); 297 | strMove.stop(true); 298 | }).on(leaveEvent, function () { 299 | $(this).removeClass('str_active'); 300 | $(this).off('mousemove'); 301 | moveFunc(); 302 | }); 303 | 304 | if (p.drag) { 305 | strWrap.on('mousedown', function (e) { 306 | if(p.inverthover){ 307 | strMove.stop(true); 308 | } 309 | 310 | //drag 311 | var dragLeft; 312 | var dir = 1; 313 | var newX; 314 | var oldX = e.clientX; 315 | //drag 316 | 317 | strMoveLeft = strMove.position().left; 318 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 319 | $(this).on('mousemove', function (e) { 320 | fMove = true; 321 | 322 | 323 | //drag 324 | newX = e.clientX; 325 | if(newX > oldX){ 326 | dir = 1 327 | }else{ 328 | dir = -1 329 | } 330 | oldX = newX 331 | dragLeft = k1 + (e.clientX - strWrap.offset().left); 332 | 333 | if(dragLeft < -strMove.width() && dir < 0){ 334 | dragLeft = strWrap.width(); 335 | strMoveLeft = strMove.position().left; 336 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 337 | } 338 | if(dragLeft > strWrap.width() && dir > 0){ 339 | dragLeft = -strMove.width(); 340 | strMoveLeft = strMove.position().left; 341 | k1 = strMoveLeft - (e.clientX - strWrap.offset().left); 342 | } 343 | 344 | 345 | strMove.stop(true).css({ 346 | left: dragLeft 347 | }); 348 | 349 | 350 | 351 | }).on('mouseup', function () { 352 | if(p.inverthover){ 353 | strMove.trigger('mouseenter') 354 | } 355 | $(this).off('mousemove'); 356 | setTimeout(function () { 357 | fMove = false 358 | }, 50) 359 | }); 360 | return false; 361 | }) 362 | .on('click', function () { 363 | if (fMove) { 364 | return false 365 | } 366 | }); 367 | } else { 368 | strWrap.addClass('no_drag'); 369 | }; 370 | } 371 | } else { 372 | strWrap.addClass('str_static'); 373 | } 374 | }; 375 | }; 376 | if (p.direction == 'right') { 377 | strWrap.height(strMove.outerHeight()) 378 | strWrap.addClass('str_right'); 379 | strMove.css({ 380 | left: -strMove.width(), 381 | right: 'auto' 382 | }) 383 | 384 | if (strMove.width() > strWrap.width()) { 385 | var leftPos = strWrap.width(); 386 | strMove.css({ 387 | left: 0 388 | }) 389 | if (p.circular) { 390 | if (!p.xml) { 391 | circCloneHor() 392 | //Определяем крайнюю точку 393 | leftPos = strMove.width(); 394 | } 395 | } 396 | 397 | var 398 | k2 = 0; 399 | timeFunc = function () { 400 | var 401 | fullS = strWrap.width(), //крайняя точка 402 | time = (fullS / strWrap.data('scrollamount')) * 1000; //время 403 | if (parseFloat(strMove.css('left')) != 0) { 404 | fullS = (strMove.width() + strWrap.width()); 405 | time = (fullS - (strMove.width() + parseFloat(strMove.css('left')))) / strWrap.data('scrollamount') * 1000; 406 | } 407 | return time; 408 | }; 409 | var moveFunc = function () { 410 | 411 | if (loop != 0) { 412 | strMove.animate({ 413 | left: leftPos 414 | }, timeFunc(), 'linear', function () { 415 | $(this).css({ 416 | left: -strMove.width() 417 | }); 418 | if (loop == -1) { 419 | setTimeout(moveFunc, p.scrolldelay); 420 | } else { 421 | loop--; 422 | setTimeout(moveFunc, p.scrolldelay); 423 | }; 424 | }); 425 | }; 426 | }; 427 | strWrap.data({ 428 | moveF : moveFunc 429 | }) 430 | 431 | if(!p.inverthover){ 432 | moveFunc(); 433 | } 434 | if (p.hoverstop) { 435 | strWrap.on(enterEvent, function () { 436 | $(this).addClass('str_active'); 437 | strMove.stop(true); 438 | }).on(leaveEvent, function () { 439 | $(this).removeClass('str_active'); 440 | $(this).off('mousemove'); 441 | moveFunc(); 442 | }); 443 | 444 | if (p.drag) { 445 | 446 | strWrap.on('mousedown', function (e) { 447 | if(p.inverthover){ 448 | strMove.stop(true); 449 | } 450 | 451 | 452 | //drag 453 | var dragLeft; 454 | var dir = 1; 455 | var newX; 456 | var oldX = e.clientX; 457 | //drag 458 | 459 | strMoveLeft = strMove.position().left; 460 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 461 | $(this).on('mousemove', function (e) { 462 | 463 | fMove = true; 464 | 465 | //drag 466 | newX = e.clientX; 467 | if(newX > oldX){ 468 | dir = 1 469 | }else{ 470 | dir = -1 471 | } 472 | oldX = newX 473 | dragLeft = k2 + (e.clientX - strWrap.offset().left); 474 | 475 | 476 | if (!p.circular) { 477 | 478 | if(dragLeft < -strMove.width() && dir < 0){ 479 | dragLeft = strWrap.width(); 480 | strMoveLeft = strMove.position().left; 481 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 482 | } 483 | if(dragLeft > strWrap.width() && dir > 0){ 484 | dragLeft = -strMove.width(); 485 | strMoveLeft = strMove.position().left; 486 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 487 | } 488 | }else{ 489 | if(dragLeft < -strMove.width() && dir < 0){ 490 | dragLeft = 0; 491 | strMoveLeft = strMove.position().left; 492 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 493 | } 494 | if(dragLeft > 0 && dir > 0){ 495 | dragLeft = -strMove.width(); 496 | strMoveLeft = strMove.position().left; 497 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 498 | } 499 | 500 | } 501 | 502 | strMove.stop(true).css({ 503 | left: dragLeft 504 | }); 505 | 506 | 507 | }).on('mouseup', function () { 508 | if(p.inverthover){ 509 | strMove.trigger('mouseenter') 510 | } 511 | $(this).off('mousemove'); 512 | setTimeout(function () { 513 | fMove = false 514 | }, 50) 515 | }); 516 | return false; 517 | }) 518 | .on('click', function () { 519 | if (fMove) { 520 | return false 521 | } 522 | }); 523 | } else { 524 | strWrap.addClass('no_drag'); 525 | }; 526 | } 527 | } else { 528 | 529 | if (p.runshort) { 530 | 531 | var k2 = 0; 532 | var timeFunc = function () { 533 | time = (strWrap.width() - strMove.position().left) / strWrap.data('scrollamount') * 1000; 534 | return time; 535 | }; 536 | var moveFunc = function () { 537 | var leftPos = strWrap.width(); 538 | strMove.animate({ 539 | left: leftPos 540 | }, timeFunc(), 'linear', function () { 541 | $(this).css({ 542 | left: -strMove.width() 543 | }); 544 | if (loop == -1) { 545 | setTimeout(moveFunc, p.scrolldelay); 546 | } else { 547 | loop--; 548 | setTimeout(moveFunc, p.scrolldelay); 549 | }; 550 | }); 551 | }; 552 | 553 | strWrap.data({ 554 | moveF : moveFunc 555 | }) 556 | 557 | if(!p.inverthover){ 558 | moveFunc(); 559 | } 560 | if (p.hoverstop) { 561 | strWrap.on(enterEvent, function () { 562 | $(this).addClass('str_active'); 563 | strMove.stop(true); 564 | }).on(leaveEvent, function () { 565 | $(this).removeClass('str_active'); 566 | $(this).off('mousemove'); 567 | moveFunc(); 568 | }); 569 | 570 | if (p.drag) { 571 | strWrap.on('mousedown', function (e) { 572 | if(p.inverthover){ 573 | strMove.stop(true); 574 | } 575 | 576 | //drag 577 | var dragLeft; 578 | var dir = 1; 579 | var newX; 580 | var oldX = e.clientX; 581 | //drag 582 | 583 | strMoveLeft = strMove.position().left; 584 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 585 | $(this).on('mousemove', function (e) { 586 | fMove = true; 587 | 588 | 589 | 590 | //drag 591 | newX = e.clientX; 592 | if(newX > oldX){ 593 | dir = 1 594 | }else{ 595 | dir = -1 596 | } 597 | oldX = newX 598 | dragLeft = k2 + (e.clientX - strWrap.offset().left); 599 | 600 | if(dragLeft < -strMove.width() && dir < 0){ 601 | dragLeft = strWrap.width(); 602 | strMoveLeft = strMove.position().left; 603 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 604 | } 605 | if(dragLeft > strWrap.width() && dir > 0){ 606 | dragLeft = -strMove.width(); 607 | strMoveLeft = strMove.position().left; 608 | k2 = strMoveLeft - (e.clientX - strWrap.offset().left); 609 | } 610 | 611 | strMove.stop(true).css({ 612 | left:dragLeft 613 | }); 614 | 615 | }).on('mouseup', function () { 616 | if(p.inverthover){ 617 | strMove.trigger('mouseenter') 618 | } 619 | $(this).off('mousemove'); 620 | setTimeout(function () { 621 | fMove = false 622 | }, 50) 623 | }); 624 | return false; 625 | }) 626 | .on('click', function () { 627 | if (fMove) { 628 | return false 629 | } 630 | }); 631 | } else { 632 | strWrap.addClass('no_drag'); 633 | }; 634 | } 635 | } else { 636 | strWrap.addClass('str_static'); 637 | } 638 | }; 639 | }; 640 | if (p.direction == 'up') { 641 | strWrap.addClass('str_vertical'); 642 | 643 | if (strMove.height() > strWrap.height()) { 644 | var topPos = -strMove.height(); 645 | if (p.circular) { 646 | if (!p.xml) { 647 | circCloneVert(); 648 | topPos = -(strMove.height() + (strMove.height() - strWrap.height())); 649 | } 650 | } 651 | if (p.xml) { 652 | strMove.css({ 653 | top:strWrap.height() 654 | }) 655 | } 656 | var 657 | k2 = 0; 658 | timeFunc = function () { 659 | var 660 | fullS = Math.abs(topPos), 661 | time = (fullS / strWrap.data('scrollamount')) * 1000; 662 | if (parseFloat(strMove.css('top')) != 0) { 663 | fullS = (fullS + strWrap.height()); 664 | time = (fullS - (strWrap.height() - parseFloat(strMove.css('top')))) / strWrap.data('scrollamount') * 1000; 665 | } 666 | 667 | return time; 668 | }; 669 | var moveFunc = function () { 670 | if (loop != 0) { 671 | strMove.animate({ 672 | top: topPos 673 | }, timeFunc(), 'linear', function () { 674 | $(this).css({ 675 | top: strWrap.height() 676 | }); 677 | if (loop == -1) { 678 | setTimeout(moveFunc, p.scrolldelay); 679 | } else { 680 | loop--; 681 | setTimeout(moveFunc, p.scrolldelay); 682 | }; 683 | }); 684 | }; 685 | }; 686 | 687 | strWrap.data({ 688 | moveF : moveFunc 689 | }) 690 | 691 | if(!p.inverthover){ 692 | moveFunc(); 693 | } 694 | if (p.hoverstop) { 695 | strWrap.on(enterEvent, function () { 696 | $(this).addClass('str_active'); 697 | strMove.stop(true); 698 | }).on(leaveEvent, function () { 699 | $(this).removeClass('str_active'); 700 | $(this).off('mousemove'); 701 | moveFunc(); 702 | }); 703 | 704 | if (p.drag) { 705 | strWrap.on('mousedown', function (e) { 706 | if(p.inverthover){ 707 | strMove.stop(true); 708 | } 709 | 710 | //drag 711 | var dragTop; 712 | var dir = 1; 713 | var newY; 714 | var oldY = e.clientY; 715 | //drag 716 | 717 | 718 | strMoveTop = strMove.position().top; 719 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 720 | $(this).on('mousemove', function (e) { 721 | 722 | fMove = true; 723 | 724 | //drag 725 | newY = e.clientY; 726 | if(newY > oldY){ 727 | dir = 1 728 | }else{ 729 | if(newY < oldY){ 730 | dir = -1 731 | } 732 | } 733 | oldY = newY 734 | dragTop = k2 + e.clientY - strWrap.offset().top; 735 | 736 | 737 | if (!p.circular){ 738 | if(dragTop < -strMove.height() && dir < 0){ 739 | dragTop = strWrap.height(); 740 | strMoveTop = strMove.position().top; 741 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 742 | } 743 | if(dragTop > strWrap.height() && dir > 0){ 744 | dragTop = -strMove.height(); 745 | strMoveTop = strMove.position().top; 746 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 747 | } 748 | }else{ 749 | if(dragTop < -strMove.height() && dir < 0){ 750 | dragTop = 0; 751 | strMoveTop = strMove.position().top; 752 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 753 | } 754 | if(dragTop > 0 && dir > 0){ 755 | dragTop = -strMove.height(); 756 | strMoveTop = strMove.position().top; 757 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 758 | } 759 | } 760 | 761 | 762 | strMove.stop(true).css({ 763 | top: dragTop 764 | }); 765 | //drag 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | }).on('mouseup', function () { 779 | if(p.inverthover){ 780 | strMove.trigger('mouseenter') 781 | } 782 | $(this).off('mousemove'); 783 | setTimeout(function () { 784 | fMove = false 785 | }, 50) 786 | }); 787 | return false; 788 | }) 789 | .on('click', function () { 790 | if (fMove) { 791 | return false 792 | } 793 | }); 794 | } else { 795 | strWrap.addClass('no_drag'); 796 | }; 797 | } 798 | } else { 799 | if (p.runshort) { 800 | strMove.css({ 801 | top: strWrap.height() 802 | }); 803 | var k2 = 0; 804 | var timeFunc = function () { 805 | 806 | time = (strMove.height() + strMove.position().top) / strWrap.data('scrollamount') * 1000; 807 | 808 | return time; 809 | }; 810 | var moveFunc = function () { 811 | var topPos = -strMove.height(); 812 | strMove.animate({ 813 | top: topPos 814 | }, timeFunc(), 'linear', function () { 815 | $(this).css({ 816 | top: strWrap.height() 817 | }); 818 | if (loop == -1) { 819 | setTimeout(moveFunc, p.scrolldelay); 820 | } else { 821 | loop--; 822 | setTimeout(moveFunc, p.scrolldelay); 823 | }; 824 | }); 825 | }; 826 | strWrap.data({ 827 | moveF : moveFunc 828 | }) 829 | if(!p.inverthover){ 830 | moveFunc(); 831 | } 832 | if (p.hoverstop) { 833 | strWrap.on(enterEvent, function () { 834 | $(this).addClass('str_active'); 835 | strMove.stop(true); 836 | }).on(leaveEvent, function () { 837 | $(this).removeClass('str_active'); 838 | $(this).off('mousemove'); 839 | moveFunc(); 840 | }); 841 | 842 | if (p.drag) { 843 | strWrap.on('mousedown', function (e) { 844 | if(p.inverthover){ 845 | strMove.stop(true); 846 | } 847 | 848 | //drag 849 | var dragTop; 850 | var dir = 1; 851 | var newY; 852 | var oldY = e.clientY; 853 | //drag 854 | 855 | strMoveTop = strMove.position().top; 856 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 857 | $(this).on('mousemove', function (e) { 858 | 859 | 860 | fMove = true; 861 | 862 | //drag 863 | newY = e.clientY; 864 | if(newY > oldY){ 865 | dir = 1 866 | }else{ 867 | if(newY < oldY){ 868 | dir = -1 869 | } 870 | } 871 | oldY = newY 872 | dragTop = k2 + e.clientY - strWrap.offset().top; 873 | 874 | if(dragTop < -strMove.height() && dir < 0){ 875 | dragTop = strWrap.height(); 876 | strMoveTop = strMove.position().top; 877 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 878 | } 879 | if(dragTop > strWrap.height() && dir > 0){ 880 | dragTop = -strMove.height(); 881 | strMoveTop = strMove.position().top; 882 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 883 | } 884 | //*drag 885 | 886 | strMove.stop(true).css({ 887 | top: dragTop 888 | }); 889 | 890 | 891 | }).on('mouseup', function () { 892 | if(p.inverthover){ 893 | strMove.trigger('mouseenter') 894 | } 895 | $(this).off('mousemove'); 896 | setTimeout(function () { 897 | fMove = false 898 | }, 50) 899 | }); 900 | return false; 901 | }) 902 | .on('click', function () { 903 | if (fMove) { 904 | return false 905 | } 906 | }); 907 | } else { 908 | strWrap.addClass('no_drag'); 909 | }; 910 | } 911 | } else { 912 | strWrap.addClass('str_static'); 913 | } 914 | }; 915 | }; 916 | if (p.direction == 'down') { 917 | 918 | strWrap.addClass('str_vertical').addClass('str_down'); 919 | strMove.css({ 920 | top: -strMove.height(), 921 | bottom: 'auto' 922 | }) 923 | if (strMove.height() > strWrap.height()) { 924 | var topPos = strWrap.height(); 925 | if (p.circular) { 926 | if (!p.xml) { 927 | circCloneVert(); 928 | topPos = strMove.height(); 929 | } 930 | } 931 | if (p.xml) { 932 | strMove.css({ 933 | top:-strMove.height() 934 | }) 935 | } 936 | var 937 | k2 = 0; 938 | timeFunc = function () { 939 | var 940 | fullS = strWrap.height(), //крайняя точка 941 | time = (fullS / strWrap.data('scrollamount')) * 1000; //время 942 | 943 | if (parseFloat(strMove.css('top')) != 0) { 944 | fullS = (strMove.height() + strWrap.height()); 945 | time = (fullS - (strMove.height() + parseFloat(strMove.css('top')))) / strWrap.data('scrollamount') * 1000; 946 | } 947 | return time; 948 | }; 949 | var moveFunc = function () { 950 | 951 | if (loop != 0) { 952 | strMove.animate({ 953 | top: topPos 954 | }, timeFunc(), 'linear', function () { 955 | $(this).css({ 956 | top: -strMove.height() 957 | }); 958 | if (loop == -1) { 959 | 960 | setTimeout(moveFunc, p.scrolldelay); 961 | } else { 962 | loop--; 963 | setTimeout(moveFunc, p.scrolldelay); 964 | }; 965 | }); 966 | }; 967 | }; 968 | strWrap.data({ 969 | moveF : moveFunc 970 | }) 971 | if(!p.inverthover){ 972 | moveFunc(); 973 | } 974 | if (p.hoverstop) { 975 | strWrap.on(enterEvent, function () { 976 | $(this).addClass('str_active'); 977 | strMove.stop(true); 978 | }).on(leaveEvent, function () { 979 | $(this).removeClass('str_active'); 980 | $(this).off('mousemove'); 981 | moveFunc(); 982 | }); 983 | 984 | if (p.drag) { 985 | strWrap.on('mousedown', function (e) { 986 | if(p.inverthover){ 987 | strMove.stop(true); 988 | } 989 | 990 | //drag 991 | var dragTop; 992 | var dir = 1; 993 | var newY; 994 | var oldY = e.clientY; 995 | //drag 996 | 997 | 998 | strMoveTop = strMove.position().top; 999 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1000 | $(this).on('mousemove', function (e) { 1001 | 1002 | fMove = true; 1003 | 1004 | //drag 1005 | newY = e.clientY; 1006 | if(newY > oldY){ 1007 | dir = 1 1008 | }else{ 1009 | if(newY < oldY){ 1010 | dir = -1 1011 | } 1012 | } 1013 | oldY = newY 1014 | dragTop = k2 + e.clientY - strWrap.offset().top; 1015 | 1016 | 1017 | if (!p.circular){ 1018 | if(dragTop < -strMove.height() && dir < 0){ 1019 | dragTop = strWrap.height(); 1020 | strMoveTop = strMove.position().top; 1021 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1022 | } 1023 | if(dragTop > strWrap.height() && dir > 0){ 1024 | dragTop = -strMove.height(); 1025 | strMoveTop = strMove.position().top; 1026 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1027 | } 1028 | }else{ 1029 | if(dragTop < -strMove.height() && dir < 0){ 1030 | dragTop = 0; 1031 | strMoveTop = strMove.position().top; 1032 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1033 | } 1034 | if(dragTop > 0 && dir > 0){ 1035 | dragTop = -strMove.height(); 1036 | strMoveTop = strMove.position().top; 1037 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1038 | } 1039 | } 1040 | 1041 | 1042 | strMove.stop(true).css({ 1043 | top: dragTop 1044 | }); 1045 | //drag 1046 | 1047 | 1048 | 1049 | }).on('mouseup', function () { 1050 | if(p.inverthover){ 1051 | strMove.trigger('mouseenter') 1052 | } 1053 | $(this).off('mousemove'); 1054 | setTimeout(function () { 1055 | fMove = false 1056 | }, 50) 1057 | }); 1058 | return false; 1059 | }) 1060 | .on('click', function () { 1061 | if (fMove) { 1062 | return false 1063 | } 1064 | }); 1065 | } else { 1066 | strWrap.addClass('no_drag'); 1067 | }; 1068 | } 1069 | } else { 1070 | if (p.runshort) { 1071 | var k2 = 0; 1072 | var timeFunc = function () { 1073 | time = (strWrap.height() - strMove.position().top) / strWrap.data('scrollamount') * 1000; 1074 | return time; 1075 | }; 1076 | var moveFunc = function () { 1077 | var topPos = strWrap.height(); 1078 | strMove.animate({ 1079 | top: topPos 1080 | }, timeFunc(), 'linear', function () { 1081 | $(this).css({ 1082 | top: -strMove.height() 1083 | }); 1084 | if (loop == -1) { 1085 | setTimeout(moveFunc, p.scrolldelay); 1086 | } else { 1087 | loop--; 1088 | setTimeout(moveFunc, p.scrolldelay); 1089 | }; 1090 | }); 1091 | }; 1092 | strWrap.data({ 1093 | moveF : moveFunc 1094 | }) 1095 | if(!p.inverthover){ 1096 | moveFunc(); 1097 | } 1098 | if (p.hoverstop) { 1099 | strWrap.on(enterEvent, function () { 1100 | $(this).addClass('str_active'); 1101 | strMove.stop(true); 1102 | }).on(leaveEvent, function () { 1103 | $(this).removeClass('str_active'); 1104 | $(this).off('mousemove'); 1105 | moveFunc(); 1106 | }); 1107 | 1108 | if (p.drag) { 1109 | strWrap.on('mousedown', function (e) { 1110 | if(p.inverthover){ 1111 | strMove.stop(true); 1112 | } 1113 | 1114 | //drag 1115 | var dragTop; 1116 | var dir = 1; 1117 | var newY; 1118 | var oldY = e.clientY; 1119 | //drag 1120 | 1121 | strMoveTop = strMove.position().top; 1122 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1123 | $(this).on('mousemove', function (e) { 1124 | fMove = true; 1125 | 1126 | //drag 1127 | newY = e.clientY; 1128 | if(newY > oldY){ 1129 | dir = 1 1130 | }else{ 1131 | if(newY < oldY){ 1132 | dir = -1 1133 | } 1134 | } 1135 | oldY = newY 1136 | dragTop = k2 + e.clientY - strWrap.offset().top; 1137 | 1138 | 1139 | if(dragTop < -strMove.height() && dir < 0){ 1140 | dragTop = strWrap.height(); 1141 | strMoveTop = strMove.position().top; 1142 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1143 | } 1144 | if(dragTop > strWrap.height() && dir > 0){ 1145 | dragTop = -strMove.height(); 1146 | strMoveTop = strMove.position().top; 1147 | k2 = strMoveTop - (e.clientY - strWrap.offset().top); 1148 | } 1149 | //*drag 1150 | 1151 | strMove.stop(true).css({ 1152 | top: dragTop 1153 | }); 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | }).on('mouseup', function () { 1163 | if(p.inverthover){ 1164 | strMove.trigger('mouseenter') 1165 | } 1166 | $(this).off('mousemove'); 1167 | setTimeout(function () { 1168 | fMove = false 1169 | }, 50) 1170 | }) 1171 | return false; 1172 | }) 1173 | .on('click', function () { 1174 | if (fMove) { 1175 | return false 1176 | } 1177 | }); 1178 | } else { 1179 | strWrap.addClass('no_drag'); 1180 | }; 1181 | } 1182 | } else { 1183 | strWrap.addClass('str_static'); 1184 | } 1185 | }; 1186 | }; 1187 | 1188 | 1189 | 1190 | 1191 | } 1192 | if (p.xml) { 1193 | $.ajax({ 1194 | url: p.xml, 1195 | dataType: "xml", 1196 | success: function (xml) { 1197 | var xmlTextEl = $(xml).find('text'); 1198 | var xmlTextLength = xmlTextEl.length; 1199 | for(var i = 0; i < xmlTextLength; i++){ 1200 | var xmlElActive = xmlTextEl.eq(i); 1201 | var xmlElContent = xmlElActive.text(); 1202 | var xmlItemEl = $('').text(xmlElContent).appendTo(strWrap); 1203 | 1204 | if(p.direction == 'left' || p.direction == 'right'){ 1205 | xmlItemEl.css({display:'inline-block',textAlign:'right'}); 1206 | if(i > 0){ 1207 | xmlItemEl.css({width:strWrap.width()+xmlItemEl.width()}); 1208 | } 1209 | } 1210 | if(p.direction == 'down' || p.direction == 'up'){ 1211 | xmlItemEl.css({display:'block',textAlign:'left'}); 1212 | if(i > 0){ 1213 | xmlItemEl.css({paddingTop:strWrap.height()}); 1214 | } 1215 | } 1216 | 1217 | } 1218 | code(); 1219 | } 1220 | }); 1221 | } else { 1222 | code(); 1223 | } 1224 | strWrap.data({ 1225 | ini:code, 1226 | startheight: startHeight 1227 | }) 1228 | 1229 | 1230 | 1231 | 1232 | }); 1233 | }, 1234 | update: function () { 1235 | var el = $(this); 1236 | var str_origin = $('.str_origin',el); 1237 | var str_move_clone = $('.str_move_clone',el); 1238 | str_origin.stop(true); 1239 | str_move_clone.remove(); 1240 | el.data('ini')(); 1241 | }, 1242 | destroy: function () { 1243 | 1244 | var el = $(this); 1245 | var elMove = $('.str_move',el); 1246 | var startHeight = el.data('startheight'); 1247 | 1248 | $('.str_move_clone',el).remove(); 1249 | el.off('mouseenter'); 1250 | el.off('mousedown'); 1251 | el.off('mouseup'); 1252 | el.off('mouseleave'); 1253 | el.off('mousemove'); 1254 | el.removeClass('noStop').removeClass('str_vertical').removeClass('str_active').removeClass('no_drag').removeClass('str_static').removeClass('str_right').removeClass('str_down'); 1255 | 1256 | var elStyle = el.attr('style'); 1257 | if(elStyle){ 1258 | var styleArr = elStyle.split(';'); 1259 | for(var i=0; i < styleArr.length; i++){ 1260 | var str = $.trim(styleArr[i]); 1261 | var tested = str.search(/^height/g); 1262 | if(tested != -1){ 1263 | styleArr[i] = ''; 1264 | } 1265 | } 1266 | var newArr = styleArr.join(';'); 1267 | var newStyle = newArr.replace(/;+/g,';') 1268 | 1269 | if(newStyle == ';'){ 1270 | el.removeAttr('style'); 1271 | }else{ 1272 | el.attr('style',newStyle); 1273 | } 1274 | 1275 | if(startHeight){ 1276 | el.css({height:startHeight}) 1277 | } 1278 | } 1279 | elMove.stop(true); 1280 | 1281 | if(elMove.length){ 1282 | var context = elMove.html(); 1283 | elMove.remove(); 1284 | el.html(context); 1285 | } 1286 | 1287 | }, 1288 | pause: function(){ 1289 | var el = $(this); 1290 | var elMove = $('.str_move',el); 1291 | elMove.stop(true); 1292 | }, 1293 | play: function(){ 1294 | var el = $(this); 1295 | $(this).off('mousemove'); 1296 | el.data('moveF')(); 1297 | } 1298 | 1299 | }; 1300 | $.fn.liMarquee = function (method) { 1301 | if (methods[method]) { 1302 | return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 1303 | } else if (typeof method === 'object' || !method) { 1304 | return methods.init.apply(this, arguments); 1305 | } else { 1306 | $.error('Метод ' + method + ' в JQuery.liMarquee не существует'); 1307 | } 1308 | }; 1309 | })(jQuery); -------------------------------------------------------------------------------- /LPLDataShow/static/js/jquery.js: -------------------------------------------------------------------------------- 1 | /*! JQuery v2.1.4 | (c) 2005, 2015 JQuery Foundation, Inc. | jquery.org/license */ 2 | !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=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",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 d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.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(null)},push:f,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){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},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?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.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,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),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):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.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,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"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=ha(),z=ha(),A=ha(),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=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),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")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=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)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){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 ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(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 ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(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 pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.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.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);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 p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(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(".#.+[+~]")}),ja(function(a){var b=g.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=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.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===g||a.ownerDocument===v&&t(v,a)?-1:b===g||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,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||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 ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.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},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.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=ga.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=ga.selectors={cacheLength:50,createPseudo:ia,match:X,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(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===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]||ga.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]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.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(ca,da).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=ga.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(Q," ")+" ").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;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(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:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(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:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).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 Z.test(a.nodeName)},input:function(a){return Y.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:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(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=[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(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(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 ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(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 wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(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=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(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=[sa(ta(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 wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.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(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.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(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(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}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(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(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==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(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir: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},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),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=u.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.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.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.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(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 n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(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&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},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().done(c.resolve).fail(c.reject).progress(c.notify):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=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;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||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=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)n.access(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};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[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=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ 3 | return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.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=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.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 L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.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.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.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 typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.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,!1)),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=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.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)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.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.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!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&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(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)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(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 ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.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])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(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 this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(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 J(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&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),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),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("