├── .DS_Store ├── README.md ├── __init__.py ├── createDB.py ├── myapp.py ├── static ├── .DS_Store ├── css │ ├── .DS_Store │ ├── bootstrap.css │ ├── datepicker.css │ ├── font-awesome.min.css │ ├── main.78d1255134d0efa598029735c5dfb275.css │ ├── style.5c97a3af.css │ ├── style.ccde8427.css │ └── yestrap-light.8e2a1ea4.css ├── fonts │ ├── .DS_Store │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont.woff2 └── js │ ├── .DS_Store │ ├── MathJax.js │ ├── bootstrap-datepicker.js │ ├── bootstrap.min.js │ ├── extensions │ ├── .DS_Store │ ├── MathMenu.js │ └── MathZoom.js │ ├── highstock.js │ ├── jquery.min.js │ └── sorttable.js ├── templates ├── .DS_Store ├── index.html ├── strategy.html └── test.html └── test.py /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/.DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quant 2 | 给亘沣做的量化交易系统,生产环境 3 | 4 | ## 环境 5 | CentOS 6.4 Nginx Python3.5 Uwsgi Flask SQLAlchemy 6 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | from .myapp import * -------------------------------------------------------------------------------- /createDB.py: -------------------------------------------------------------------------------- 1 | import myapp as ma 2 | import datetime 3 | 4 | ma.db.drop_all() 5 | ma.db.create_all() 6 | 7 | sttg1 = ma.Strategy(name='恶魔最摇摆', status='正常', start=datetime.date(2016,1,27)) 8 | sttg2 = ma.Strategy(name='音浪太强', status='正常', start=datetime.date(2016,1,28)) 9 | 10 | ma.db.session.add(sttg1) 11 | ma.db.session.add(sttg2) 12 | ma.db.session.commit() 13 | 14 | sv1_0127 = ma.Survey(date=datetime.date(2016,1,27), daily=-1.3, profit=-1.3, sharp=1.1, marketValue=9233403, enable=2300, pullback=1.3, alpha=-1.3, beta=1.2, information=1.4, fluctuation=1.5, strategy_id=1) 15 | sv1_0128 = ma.Survey(date=datetime.date(2016,1,28), daily=2.3, profit=2.01, sharp=2.1, marketValue=9800001, enable=2300, pullback=0, alpha=2.01, beta=2.2, information=2.4, fluctuation=2.5, strategy_id=1) 16 | sv1_0129 = ma.Survey(date=datetime.date(2016,1,29), daily=3.3, profit=3.2, sharp=3.1, marketValue=9999403, enable=2300, pullback=0, alpha=3.4, beta=3.5, information=3.6, fluctuation=3.7, strategy_id=1) 17 | sv2_0128 = ma.Survey(date=datetime.date(2016,1,28), daily=-1.4, profit=-1.4, sharp=1.2, marketValue=233403, enable=300, pullback=1.4, alpha=-1.4, beta=1.2, information=1.05, fluctuation=1.05, strategy_id=2) 18 | sv2_0129 = ma.Survey(date=datetime.date(2016,1,29), daily=2.04, profit=2.14, sharp=2.2, marketValue=333403, enable=300, pullback=0, alpha=2.04, beta=2.2, information=2.05, fluctuation=2.05, strategy_id=2) 19 | 20 | ma.db.session.add(sv1_0127) 21 | ma.db.session.add(sv1_0128) 22 | ma.db.session.add(sv1_0129) 23 | ma.db.session.add(sv2_0128) 24 | ma.db.session.add(sv2_0129) 25 | ma.db.session.commit() 26 | 27 | ps1_0127_1 = ma.Position(ticker='000632', name='三木集团', amount=1900, cost=6.82, price=6.96, value=13224, increase=1.97, weight=13.48,strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,27)).first().id) 28 | ps1_0127_2 = ma.Position(ticker='002388', name='新亚制程', amount=1900, cost=7.11, price=7.28, value=13832, increase=2.39, weight=14.10,strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,27)).first().id) 29 | ps1_0128_1 = ma.Position(ticker='600287', name='江苏舜天', amount=1800, cost=7.32, price=7.55, value=13590, increase=3.14, weight=13.85,strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 30 | ps1_0128_2 = ma.Position(ticker='600731', name='湖南海利', amount=1800, cost=7.27, price=7.51, value=13518, increase=3.30, weight=13.78,strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 31 | ps1_0129_1 = ma.Position(ticker='000890', name='法尔胜', amount=1600, cost=8.1, price=8.37, value=13392, increase=3.33, weight=13.65,strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 32 | ps1_0129_2 = ma.Position(ticker='300084', name='海默科技', amount=1700, cost=7.8, price=8.17, value=13889, increase=4.74, weight=14.16,strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 33 | 34 | ps2_0128_1 = ma.Position(ticker='002578', name='闽发铝业', amount=1700, cost=7.48, price=7.87, value=13379, increase=5.21, weight=13.64,strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 35 | ps2_0128_2 = ma.Position(ticker='600731', name='湖南海利', amount=1800, cost=7.27, price=7.51, value=13518, increase=3.30, weight=13.78,strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 36 | ps2_0129_1 = ma.Position(ticker='300237', name='美晨科技', amount=58700, cost=7.88, price=8.25, value=484275, increase=7.56, weight=48.88,strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 37 | ps2_0129_2 = ma.Position(ticker='300084', name='海默科技', amount=1700, cost=7.8, price=8.17, value=13889, increase=4.74, weight=14.16,strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 38 | 39 | ma.db.session.add(ps1_0127_1) 40 | ma.db.session.add(ps1_0127_2) 41 | ma.db.session.add(ps1_0128_1) 42 | ma.db.session.add(ps1_0128_2) 43 | ma.db.session.add(ps1_0129_1) 44 | ma.db.session.add(ps1_0129_2) 45 | ma.db.session.add(ps2_0128_1) 46 | ma.db.session.add(ps2_0128_2) 47 | ma.db.session.add(ps2_0129_1) 48 | ma.db.session.add(ps2_0129_2) 49 | ma.db.session.commit() 50 | 51 | bm0127 = ma.Benchmark(date=datetime.date(2016,1,27), index=2735.558) 52 | bm0128 = ma.Benchmark(date=datetime.date(2016,1,28), index=2655.661) 53 | bm0129 = ma.Benchmark(date=datetime.date(2016,1,29), index=2737.6) 54 | 55 | ma.db.session.add(bm0127) 56 | ma.db.session.add(bm0128) 57 | ma.db.session.add(bm0129) 58 | ma.db.session.commit() 59 | 60 | tsf1_0127_1 = ma.Transfer(ticker='000632', name='三木集团', direction='买入', orderAmount=100, dealAmount=100, orderTime=datetime.time(9,31,56), dealTime=datetime.time(9,31,56), cost=6.89, status='全部成交', strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,27)).first().id) 61 | tsf1_0127_2 = ma.Transfer(ticker='000890', name='法尔胜', direction='卖出', orderAmount=0, orderTime=datetime.time(9,7,5), status='订单丢弃', strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,27)).first().id) 62 | tsf1_0128_1 = ma.Transfer(ticker='002388', name='新亚制程', direction='卖出', orderAmount=0, orderTime=datetime.time(9,7,5), status='订单丢弃', strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 63 | tsf1_0128_2 = ma.Transfer(ticker='002578', name='闽发铝业', direction='卖出', orderAmount=0, orderTime=datetime.time(9,7,5), status='订单丢弃', strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 64 | tsf1_0129_1 = ma.Transfer(ticker='300084', name='海默科技', direction='卖出', orderAmount=0, orderTime=datetime.time(9,7,5), status='订单丢弃', strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 65 | tsf1_0129_2 = ma.Transfer(ticker='600287', name='江苏舜天', direction='卖出', orderAmount=0, orderTime=datetime.time(9,7,5), status='订单丢弃', strategy_id=1, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 66 | 67 | tsf2_0128_1 = ma.Transfer(ticker='600731', name='湖南海利', direction='卖出', orderAmount=0, orderTime=datetime.time(9,7,5), status='订单丢弃', strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 68 | tsf2_0128_2 = ma.Transfer(ticker='000632', name='三木集团', direction='买入', orderAmount=1900, dealAmount=1900, orderTime=datetime.time(9,33,34), dealTime=datetime.time(9,33,34), cost=6.83, status='全部成交', strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,28)).first().id) 69 | tsf2_0129_1 = ma.Transfer(ticker='000890', name='法尔胜', direction='买入', orderAmount=1600, dealAmount=1600, orderTime=datetime.time(9,33,34), dealTime=datetime.time(9,33,34), cost=8.10, status='全部成交', strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 70 | tsf2_0129_2 = ma.Transfer(ticker='002388', name='新亚制程', direction='买入', orderAmount=1900, dealAmount=1900, orderTime=datetime.time(9,33,34), dealTime=datetime.time(9,33,34), cost=7.11, status='全部成交', strategy_id=2, date_id=ma.Survey.query.filter_by(date=datetime.date(2016,1,29)).first().id) 71 | 72 | ma.db.session.add(tsf1_0127_1) 73 | ma.db.session.add(tsf1_0127_2) 74 | ma.db.session.add(tsf1_0128_1) 75 | ma.db.session.add(tsf1_0128_2) 76 | ma.db.session.add(tsf1_0129_1) 77 | ma.db.session.add(tsf1_0129_2) 78 | ma.db.session.add(tsf2_0128_1) 79 | ma.db.session.add(tsf2_0128_2) 80 | ma.db.session.add(tsf2_0129_1) 81 | ma.db.session.add(tsf2_0129_2) 82 | ma.db.session.commit() -------------------------------------------------------------------------------- /myapp.py: -------------------------------------------------------------------------------- 1 | #encoding:utf-8 2 | import os 3 | from flask import (Flask, render_template, request, jsonify) 4 | from flask.ext.sqlalchemy import SQLAlchemy 5 | import datetime 6 | 7 | basedir = os.path.abspath(os.path.dirname(__file__)) 8 | 9 | app = Flask(__name__) 10 | app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'data.sqlite') 11 | app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True 12 | app.secret_key = 'SHH!' 13 | 14 | db = SQLAlchemy(app) 15 | 16 | #策略 17 | class Strategy(db.Model): 18 | __tablename__ = 'strategies' 19 | id = db.Column(db.Integer, primary_key=True) 20 | name = db.Column(db.String(64), unique=True, index=True) #策略名称 21 | status = db.Column(db.String(64)) #策略状态 22 | start = db.Column(db.Date) #策略开始时间 23 | end = db.Column(db.Date) #策略结束时间 24 | surveys = db.relationship('Survey', backref='strategy', lazy='dynamic') 25 | positions = db.relationship('Position', backref='strategy', lazy='dynamic') 26 | transfers = db.relationship('Position', backref='strategy_', lazy='dynamic') 27 | 28 | def __repr__(self): 29 | return '' % self.name 30 | 31 | #每日概况 32 | class Survey(db.Model): 33 | __tablename__ = 'surveys' 34 | id = db.Column(db.Integer, primary_key=True) 35 | date = db.Column(db.Date, index=True) #日期 36 | daily = db.Column(db.Float) #当日收益 37 | profit = db.Column(db.Float) #累计收益 38 | sharp = db.Column(db.Float) #夏普比率 39 | marketValue = db.Column(db.Float) #持仓市值 40 | enable = db.Column(db.Float) #可用金额 41 | pullback = db.Column(db.Float) #回撤 42 | alpha = db.Column(db.Float) #阿尔法 43 | beta = db.Column(db.Float) #贝塔 44 | information = db.Column(db.Float) #信息比率 45 | fluctuation = db.Column(db.Float) #收益波动率 46 | strategy_id = db.Column(db.Integer, db.ForeignKey('strategies.id')) #所属策略ID 47 | positions = db.relationship('Position', backref='date', lazy='dynamic') 48 | transfers = db.relationship('Transfer', backref='date_', lazy='dynamic') 49 | 50 | def __repr__(self): 51 | return '' % self.date 52 | 53 | #当日持仓 54 | class Position(db.Model): 55 | __tablename__ = 'positions' 56 | id = db.Column(db.Integer, primary_key=True) 57 | ticker = db.Column(db.String(64), index=True) #证券代码 58 | name = db.Column(db.String(64)) #证券名称 59 | amount = db.Column(db.Integer) #持仓数量 60 | cost = db.Column(db.Float) #持仓成本 61 | price = db.Column(db.Float) #市价 62 | value = db.Column(db.Float) #市值 63 | increase = db.Column(db.Float) #当日涨幅 64 | weight = db.Column(db.Float) #权重 65 | strategy_id = db.Column(db.Integer, db.ForeignKey('strategies.id')) #所属策略ID 66 | date_id = db.Column(db.Integer, db.ForeignKey('surveys.id')) #所属日期ID 67 | 68 | def __repr__(self): 69 | return '' % self.ticker 70 | 71 | #当日调仓 72 | class Transfer(db.Model): 73 | __tablename__ = 'transfers' 74 | id = db.Column(db.Integer, primary_key=True) 75 | ticker = db.Column(db.String(64), index=True) #证券代码 76 | name = db.Column(db.String(64)) #证券名称 77 | direction = db.Column(db.String(64)) #买/卖 78 | orderAmount = db.Column(db.Integer) #下单数量 79 | dealAmount = db.Column(db.Integer) #成交数量 80 | orderTime = db.Column(db.Time) #下单时间 81 | dealTime = db.Column(db.Time) #成交时间 82 | cost = db.Column(db.Float) #成交均价 83 | status = db.Column(db.String(64)) #状态 84 | strategy_id = db.Column(db.Integer, db.ForeignKey('strategies.id')) #所属策略ID 85 | date_id = db.Column(db.Integer, db.ForeignKey('surveys.id')) #所属日期ID 86 | 87 | def __repr__(self): 88 | return '' % self.ticker 89 | 90 | #基准 91 | class Benchmark(db.Model): 92 | __tablename__ = 'benchmarks' 93 | id = db.Column(db.Integer, primary_key=True) 94 | date = db.Column(db.Date, unique=True, index=True) #日期 95 | index = db.Column(db.Float) #上证指数 96 | 97 | def __repr__(self): 98 | return '' % self.date 99 | 100 | 101 | #app.debug = True 102 | 103 | @app.route('/') 104 | def index(): 105 | today = datetime.date(2016,1,29) 106 | 107 | strategies_ = Strategy.query.all() 108 | strategies = list(range(len(strategies_))) 109 | 110 | for i in range(len(strategies_)): 111 | start = '_' 112 | end = '_' 113 | if strategies_[i].start == None: 114 | start = start 115 | else: 116 | start = strategies_[i].start.strftime('%Y-%m-%d') 117 | 118 | if strategies_[i].end == None: 119 | end = end 120 | else: 121 | end = strategies_[i].end.strftime('%Y-%m-%d') 122 | 123 | id = strategies_[i].id 124 | 125 | survey = Survey.query.filter_by(strategy_id=id,date=today).first() 126 | 127 | strategies[i] = {'name':strategies_[i].name,'status':strategies_[i].status,'daily':survey.daily,'profit':survey.profit,'start':start,'end':end} 128 | 129 | return render_template('index.html', strategies = strategies) 130 | 131 | 132 | @app.route('/strategy/') 133 | def strategy(name): 134 | today = datetime.date(2016,1,29) 135 | date1 = today 136 | 137 | strategy_ = Strategy.query.filter_by(name=name).first() 138 | 139 | if strategy_ == None: 140 | return '

没有这个策略

' 141 | else: 142 | sttg_id = strategy_.id 143 | 144 | survey_ = Survey.query.filter_by(strategy_id=sttg_id).all() 145 | 146 | survey = {'date':list(range(len(survey_))),'daily':list(range(len(survey_))),'profit':list(range(len(survey_))),'sharp':list(range(len(survey_))),'marketValue':list(range(len(survey_))),'enable':list(range(len(survey_))),'benchmark':list(range(len(survey_))),'pullback':list(range(len(survey_))),'alpha':list(range(len(survey_))),'beta':list(range(len(survey_))),'information':list(range(len(survey_))),'fluctuation':list(range(len(survey_)))} 147 | 148 | for i in range(len(survey_)): 149 | survey['date'][i] = int(survey_[i].date.strftime('%s')+'000') 150 | survey['daily'][i] = survey_[i].daily 151 | survey['profit'][i] = survey_[i].profit 152 | survey['sharp'][i] = survey_[i].sharp 153 | survey['marketValue'][i] = survey_[i].marketValue 154 | survey['enable'][i] = survey_[i].enable 155 | survey['benchmark'][i] = Benchmark.query.filter_by(date=survey_[i].date).first().index 156 | survey['pullback'][i] = survey_[i].pullback 157 | survey['alpha'][i] = survey_[i].alpha 158 | survey['beta'][i] = survey_[i].beta 159 | survey['information'][i] = survey_[i].information 160 | survey['fluctuation'][i] = survey_[i].fluctuation 161 | 162 | transfer_ = Transfer.query.filter_by(strategy_id=sttg_id,date_id=Survey.query.filter_by(strategy_id=sttg_id,date=today).first().id).all() 163 | transfer = list(range(len(transfer_))) 164 | 165 | for i in range(len(transfer_)): 166 | deal_amount = '--' 167 | deal_time = '--' 168 | cost = '--' 169 | if transfer_[i].dealAmount != None: 170 | deal_amount = transfer_[i].dealAmount 171 | 172 | if transfer_[i].dealTime != None: 173 | deal_time = transfer_[i].dealTime.strftime('%H:%M:%S') 174 | 175 | if transfer_[i].cost != None: 176 | cost = transfer_[i].cost 177 | 178 | transfer[i] = {'ticker':transfer_[i].ticker,'name':transfer_[i].name,'direction':transfer_[i].direction,'orderAmount':transfer_[i].orderAmount,'dealAmount':deal_amount,'orderTime':transfer_[i].orderTime.strftime('%H:%M:%S'),'dealTime':deal_time,'cost':cost,'status':transfer_[i].status} 179 | 180 | positions_ = Position.query.filter_by(strategy_id=sttg_id,date_id=Survey.query.filter_by(strategy_id=sttg_id,date=date1).first().id).all() 181 | positions = list(range(len(positions_))) 182 | 183 | for i in range(len(positions_)): 184 | positions[i] = {'ticker':positions_[i].ticker,'name':positions_[i].name,'amount':positions_[i].amount,'cost':positions_[i].cost,'price':positions_[i].price,'value':positions_[i].value,'increase':positions_[i].increase,'weight':positions_[i].weight} 185 | 186 | today = today.strftime('%Y-%m-%d') 187 | 188 | return render_template('strategy.html',name = name,survey = survey,positions = positions,transfer = transfer,today = today,strategyID = sttg_id) 189 | 190 | 191 | @app.route('/positions', methods = ['POST']) 192 | def positions_ajax_request(): 193 | date = request.form['date'] 194 | strategyID = int(request.form['strategyID']) 195 | formatDate = datetime.date(int(date[0:4]),int(date[5:7]),int(date[8:10])) 196 | dateID = Survey.query.filter_by(strategy_id=strategyID,date=formatDate).first() 197 | if dateID != None: 198 | pt_ = Position.query.filter_by(strategy_id=strategyID, date_id=dateID.id).all() 199 | if pt_ == None or len(pt_) == 0: 200 | return jsonify({'name':"该日没数据"}) 201 | else: 202 | pt = list(range(len(pt_))) 203 | 204 | for i in range(len(pt_)): 205 | pt[i] = {'ticker':pt_[i].ticker, 'name':pt_[i].name, 'amount':pt_[i].amount, 'cost':pt_[i].cost, 'price':pt_[i].price, 'value':pt_[i].value, 'increase':pt_[i].increase, 'weight':pt_[i].weight} 206 | 207 | return jsonify(results=pt) 208 | else: 209 | return jsonify({'name':"该日没数据"}) 210 | 211 | 212 | 213 | @app.route('/transfers', methods = ['POST']) 214 | def transfers_ajax_request(): 215 | date = request.form['date'] 216 | strategyID = int(request.form['strategyID']) 217 | formatDate = datetime.date(int(date[0:4]),int(date[5:7]),int(date[8:10])) 218 | dateID = Survey.query.filter_by(strategy_id=strategyID,date=formatDate).first() 219 | if dateID != None: 220 | ts_ = Transfer.query.filter_by(strategy_id=strategyID, date_id=dateID.id).all() 221 | if ts_ == None or len(ts_) == 0: 222 | return jsonify({'name':"该日没数据"}) 223 | else: 224 | ts = list(range(len(ts_))) 225 | 226 | for i in range(len(ts_)): 227 | deal_amount = '--' 228 | deal_time = '--' 229 | cost = '--' 230 | if ts_[i].dealAmount != None: 231 | deal_amount = ts_[i].dealAmount 232 | 233 | if ts_[i].dealTime != None: 234 | deal_time = ts_[i].dealTime.strftime('%H:%M:%S') 235 | 236 | if ts_[i].cost != None: 237 | cost = ts_[i].cost 238 | 239 | ts[i] = {'ticker':ts_[i].ticker, 'name':ts_[i].name, 'direction':ts_[i].direction, 'orderAmount':ts_[i].orderAmount, 'dealAmount':deal_amount, 'orderTime':ts_[i].orderTime.strftime('%H:%M:%S'), 'dealTime':deal_time, 'cost':cost, 'status':ts_[i].status} 240 | 241 | return jsonify(results=ts) 242 | else: 243 | return jsonify({'name':"该日没数据"}) 244 | 245 | -------------------------------------------------------------------------------- /static/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/.DS_Store -------------------------------------------------------------------------------- /static/css/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/css/.DS_Store -------------------------------------------------------------------------------- /static/css/datepicker.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Datepicker for Bootstrap 3 | * 4 | * Copyright 2012 Stefan Petre 5 | * Improvements by Andrew Rowls 6 | * Licensed under the Apache License v2.0 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | */ 10 | .datepicker { 11 | padding: 4px; 12 | -webkit-border-radius: 4px; 13 | -moz-border-radius: 4px; 14 | border-radius: 4px; 15 | direction: ltr; 16 | /*.dow { 17 | border-top: 1px solid #ddd !important; 18 | }*/ 19 | 20 | } 21 | .datepicker-inline { 22 | width: 220px; 23 | } 24 | .datepicker.datepicker-rtl { 25 | direction: rtl; 26 | } 27 | .datepicker.datepicker-rtl table tr td span { 28 | float: right; 29 | } 30 | .datepicker-dropdown { 31 | top: 0; 32 | left: 0; 33 | } 34 | .datepicker-dropdown:before { 35 | content: ''; 36 | display: inline-block; 37 | border-left: 7px solid transparent; 38 | border-right: 7px solid transparent; 39 | border-bottom: 7px solid #ccc; 40 | border-top: 0; 41 | border-bottom-color: rgba(0, 0, 0, 0.2); 42 | position: absolute; 43 | } 44 | .datepicker-dropdown:after { 45 | content: ''; 46 | display: inline-block; 47 | border-left: 6px solid transparent; 48 | border-right: 6px solid transparent; 49 | border-bottom: 6px solid #ffffff; 50 | border-top: 0; 51 | position: absolute; 52 | } 53 | .datepicker-dropdown.datepicker-orient-left:before { 54 | left: 6px; 55 | } 56 | .datepicker-dropdown.datepicker-orient-left:after { 57 | left: 7px; 58 | } 59 | .datepicker-dropdown.datepicker-orient-right:before { 60 | right: 6px; 61 | } 62 | .datepicker-dropdown.datepicker-orient-right:after { 63 | right: 7px; 64 | } 65 | .datepicker-dropdown.datepicker-orient-top:before { 66 | top: -7px; 67 | } 68 | .datepicker-dropdown.datepicker-orient-top:after { 69 | top: -6px; 70 | } 71 | .datepicker-dropdown.datepicker-orient-bottom:before { 72 | bottom: -7px; 73 | border-bottom: 0; 74 | border-top: 7px solid #999; 75 | } 76 | .datepicker-dropdown.datepicker-orient-bottom:after { 77 | bottom: -6px; 78 | border-bottom: 0; 79 | border-top: 6px solid #ffffff; 80 | } 81 | .datepicker > div { 82 | display: none; 83 | } 84 | .datepicker.days div.datepicker-days { 85 | display: block; 86 | } 87 | .datepicker.months div.datepicker-months { 88 | display: block; 89 | } 90 | .datepicker.years div.datepicker-years { 91 | display: block; 92 | } 93 | .datepicker table { 94 | margin: 0; 95 | -webkit-touch-callout: none; 96 | -webkit-user-select: none; 97 | -khtml-user-select: none; 98 | -moz-user-select: none; 99 | -ms-user-select: none; 100 | user-select: none; 101 | } 102 | .datepicker td, 103 | .datepicker th { 104 | text-align: center; 105 | width: 20px; 106 | height: 20px; 107 | -webkit-border-radius: 4px; 108 | -moz-border-radius: 4px; 109 | border-radius: 4px; 110 | border: none; 111 | } 112 | .table-striped .datepicker table tr td, 113 | .table-striped .datepicker table tr th { 114 | background-color: transparent; 115 | } 116 | .datepicker table tr td.day:hover { 117 | background: #eeeeee; 118 | cursor: pointer; 119 | } 120 | .datepicker table tr td.old, 121 | .datepicker table tr td.new { 122 | color: #999999; 123 | } 124 | .datepicker table tr td.disabled, 125 | .datepicker table tr td.disabled:hover { 126 | background: none; 127 | color: #999999; 128 | cursor: default; 129 | } 130 | .datepicker table tr td.today, 131 | .datepicker table tr td.today:hover, 132 | .datepicker table tr td.today.disabled, 133 | .datepicker table tr td.today.disabled:hover { 134 | background-color: #fde19a; 135 | background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a); 136 | background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a); 137 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a)); 138 | background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a); 139 | background-image: -o-linear-gradient(top, #fdd49a, #fdf59a); 140 | background-image: linear-gradient(top, #fdd49a, #fdf59a); 141 | background-repeat: repeat-x; 142 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0); 143 | border-color: #fdf59a #fdf59a #fbed50; 144 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 145 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 146 | color: #000; 147 | } 148 | .datepicker table tr td.today:hover, 149 | .datepicker table tr td.today:hover:hover, 150 | .datepicker table tr td.today.disabled:hover, 151 | .datepicker table tr td.today.disabled:hover:hover, 152 | .datepicker table tr td.today:active, 153 | .datepicker table tr td.today:hover:active, 154 | .datepicker table tr td.today.disabled:active, 155 | .datepicker table tr td.today.disabled:hover:active, 156 | .datepicker table tr td.today.active, 157 | .datepicker table tr td.today:hover.active, 158 | .datepicker table tr td.today.disabled.active, 159 | .datepicker table tr td.today.disabled:hover.active, 160 | .datepicker table tr td.today.disabled, 161 | .datepicker table tr td.today:hover.disabled, 162 | .datepicker table tr td.today.disabled.disabled, 163 | .datepicker table tr td.today.disabled:hover.disabled, 164 | .datepicker table tr td.today[disabled], 165 | .datepicker table tr td.today:hover[disabled], 166 | .datepicker table tr td.today.disabled[disabled], 167 | .datepicker table tr td.today.disabled:hover[disabled] { 168 | background-color: #fdf59a; 169 | } 170 | .datepicker table tr td.today:active, 171 | .datepicker table tr td.today:hover:active, 172 | .datepicker table tr td.today.disabled:active, 173 | .datepicker table tr td.today.disabled:hover:active, 174 | .datepicker table tr td.today.active, 175 | .datepicker table tr td.today:hover.active, 176 | .datepicker table tr td.today.disabled.active, 177 | .datepicker table tr td.today.disabled:hover.active { 178 | background-color: #fbf069 \9; 179 | } 180 | .datepicker table tr td.today:hover:hover { 181 | color: #000; 182 | } 183 | .datepicker table tr td.today.active:hover { 184 | color: #fff; 185 | } 186 | .datepicker table tr td.range, 187 | .datepicker table tr td.range:hover, 188 | .datepicker table tr td.range.disabled, 189 | .datepicker table tr td.range.disabled:hover { 190 | background: #eeeeee; 191 | -webkit-border-radius: 0; 192 | -moz-border-radius: 0; 193 | border-radius: 0; 194 | } 195 | .datepicker table tr td.range.today, 196 | .datepicker table tr td.range.today:hover, 197 | .datepicker table tr td.range.today.disabled, 198 | .datepicker table tr td.range.today.disabled:hover { 199 | background-color: #f3d17a; 200 | background-image: -moz-linear-gradient(top, #f3c17a, #f3e97a); 201 | background-image: -ms-linear-gradient(top, #f3c17a, #f3e97a); 202 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f3c17a), to(#f3e97a)); 203 | background-image: -webkit-linear-gradient(top, #f3c17a, #f3e97a); 204 | background-image: -o-linear-gradient(top, #f3c17a, #f3e97a); 205 | background-image: linear-gradient(top, #f3c17a, #f3e97a); 206 | background-repeat: repeat-x; 207 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3c17a', endColorstr='#f3e97a', GradientType=0); 208 | border-color: #f3e97a #f3e97a #edde34; 209 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 210 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 211 | -webkit-border-radius: 0; 212 | -moz-border-radius: 0; 213 | border-radius: 0; 214 | } 215 | .datepicker table tr td.range.today:hover, 216 | .datepicker table tr td.range.today:hover:hover, 217 | .datepicker table tr td.range.today.disabled:hover, 218 | .datepicker table tr td.range.today.disabled:hover:hover, 219 | .datepicker table tr td.range.today:active, 220 | .datepicker table tr td.range.today:hover:active, 221 | .datepicker table tr td.range.today.disabled:active, 222 | .datepicker table tr td.range.today.disabled:hover:active, 223 | .datepicker table tr td.range.today.active, 224 | .datepicker table tr td.range.today:hover.active, 225 | .datepicker table tr td.range.today.disabled.active, 226 | .datepicker table tr td.range.today.disabled:hover.active, 227 | .datepicker table tr td.range.today.disabled, 228 | .datepicker table tr td.range.today:hover.disabled, 229 | .datepicker table tr td.range.today.disabled.disabled, 230 | .datepicker table tr td.range.today.disabled:hover.disabled, 231 | .datepicker table tr td.range.today[disabled], 232 | .datepicker table tr td.range.today:hover[disabled], 233 | .datepicker table tr td.range.today.disabled[disabled], 234 | .datepicker table tr td.range.today.disabled:hover[disabled] { 235 | background-color: #f3e97a; 236 | } 237 | .datepicker table tr td.range.today:active, 238 | .datepicker table tr td.range.today:hover:active, 239 | .datepicker table tr td.range.today.disabled:active, 240 | .datepicker table tr td.range.today.disabled:hover:active, 241 | .datepicker table tr td.range.today.active, 242 | .datepicker table tr td.range.today:hover.active, 243 | .datepicker table tr td.range.today.disabled.active, 244 | .datepicker table tr td.range.today.disabled:hover.active { 245 | background-color: #efe24b \9; 246 | } 247 | .datepicker table tr td.selected, 248 | .datepicker table tr td.selected:hover, 249 | .datepicker table tr td.selected.disabled, 250 | .datepicker table tr td.selected.disabled:hover { 251 | background-color: #9e9e9e; 252 | background-image: -moz-linear-gradient(top, #b3b3b3, #808080); 253 | background-image: -ms-linear-gradient(top, #b3b3b3, #808080); 254 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#b3b3b3), to(#808080)); 255 | background-image: -webkit-linear-gradient(top, #b3b3b3, #808080); 256 | background-image: -o-linear-gradient(top, #b3b3b3, #808080); 257 | background-image: linear-gradient(top, #b3b3b3, #808080); 258 | background-repeat: repeat-x; 259 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#808080', GradientType=0); 260 | border-color: #808080 #808080 #595959; 261 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 262 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 263 | color: #fff; 264 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 265 | } 266 | .datepicker table tr td.selected:hover, 267 | .datepicker table tr td.selected:hover:hover, 268 | .datepicker table tr td.selected.disabled:hover, 269 | .datepicker table tr td.selected.disabled:hover:hover, 270 | .datepicker table tr td.selected:active, 271 | .datepicker table tr td.selected:hover:active, 272 | .datepicker table tr td.selected.disabled:active, 273 | .datepicker table tr td.selected.disabled:hover:active, 274 | .datepicker table tr td.selected.active, 275 | .datepicker table tr td.selected:hover.active, 276 | .datepicker table tr td.selected.disabled.active, 277 | .datepicker table tr td.selected.disabled:hover.active, 278 | .datepicker table tr td.selected.disabled, 279 | .datepicker table tr td.selected:hover.disabled, 280 | .datepicker table tr td.selected.disabled.disabled, 281 | .datepicker table tr td.selected.disabled:hover.disabled, 282 | .datepicker table tr td.selected[disabled], 283 | .datepicker table tr td.selected:hover[disabled], 284 | .datepicker table tr td.selected.disabled[disabled], 285 | .datepicker table tr td.selected.disabled:hover[disabled] { 286 | background-color: #808080; 287 | } 288 | .datepicker table tr td.selected:active, 289 | .datepicker table tr td.selected:hover:active, 290 | .datepicker table tr td.selected.disabled:active, 291 | .datepicker table tr td.selected.disabled:hover:active, 292 | .datepicker table tr td.selected.active, 293 | .datepicker table tr td.selected:hover.active, 294 | .datepicker table tr td.selected.disabled.active, 295 | .datepicker table tr td.selected.disabled:hover.active { 296 | background-color: #666666 \9; 297 | } 298 | .datepicker table tr td.active, 299 | .datepicker table tr td.active:hover, 300 | .datepicker table tr td.active.disabled, 301 | .datepicker table tr td.active.disabled:hover { 302 | background-color: #006dcc; 303 | background-image: -moz-linear-gradient(top, #0088cc, #0044cc); 304 | background-image: -ms-linear-gradient(top, #0088cc, #0044cc); 305 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); 306 | background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); 307 | background-image: -o-linear-gradient(top, #0088cc, #0044cc); 308 | background-image: linear-gradient(top, #0088cc, #0044cc); 309 | background-repeat: repeat-x; 310 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); 311 | border-color: #0044cc #0044cc #002a80; 312 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 313 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 314 | color: #fff; 315 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 316 | } 317 | .datepicker table tr td.active:hover, 318 | .datepicker table tr td.active:hover:hover, 319 | .datepicker table tr td.active.disabled:hover, 320 | .datepicker table tr td.active.disabled:hover:hover, 321 | .datepicker table tr td.active:active, 322 | .datepicker table tr td.active:hover:active, 323 | .datepicker table tr td.active.disabled:active, 324 | .datepicker table tr td.active.disabled:hover:active, 325 | .datepicker table tr td.active.active, 326 | .datepicker table tr td.active:hover.active, 327 | .datepicker table tr td.active.disabled.active, 328 | .datepicker table tr td.active.disabled:hover.active, 329 | .datepicker table tr td.active.disabled, 330 | .datepicker table tr td.active:hover.disabled, 331 | .datepicker table tr td.active.disabled.disabled, 332 | .datepicker table tr td.active.disabled:hover.disabled, 333 | .datepicker table tr td.active[disabled], 334 | .datepicker table tr td.active:hover[disabled], 335 | .datepicker table tr td.active.disabled[disabled], 336 | .datepicker table tr td.active.disabled:hover[disabled] { 337 | background-color: #0044cc; 338 | } 339 | .datepicker table tr td.active:active, 340 | .datepicker table tr td.active:hover:active, 341 | .datepicker table tr td.active.disabled:active, 342 | .datepicker table tr td.active.disabled:hover:active, 343 | .datepicker table tr td.active.active, 344 | .datepicker table tr td.active:hover.active, 345 | .datepicker table tr td.active.disabled.active, 346 | .datepicker table tr td.active.disabled:hover.active { 347 | background-color: #003399 \9; 348 | } 349 | .datepicker table tr td span { 350 | display: block; 351 | width: 23%; 352 | height: 54px; 353 | line-height: 54px; 354 | float: left; 355 | margin: 1%; 356 | cursor: pointer; 357 | -webkit-border-radius: 4px; 358 | -moz-border-radius: 4px; 359 | border-radius: 4px; 360 | } 361 | .datepicker table tr td span:hover { 362 | background: #eeeeee; 363 | } 364 | .datepicker table tr td span.disabled, 365 | .datepicker table tr td span.disabled:hover { 366 | background: none; 367 | color: #999999; 368 | cursor: default; 369 | } 370 | .datepicker table tr td span.active, 371 | .datepicker table tr td span.active:hover, 372 | .datepicker table tr td span.active.disabled, 373 | .datepicker table tr td span.active.disabled:hover { 374 | background-color: #006dcc; 375 | background-image: -moz-linear-gradient(top, #0088cc, #0044cc); 376 | background-image: -ms-linear-gradient(top, #0088cc, #0044cc); 377 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); 378 | background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); 379 | background-image: -o-linear-gradient(top, #0088cc, #0044cc); 380 | background-image: linear-gradient(top, #0088cc, #0044cc); 381 | background-repeat: repeat-x; 382 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); 383 | border-color: #0044cc #0044cc #002a80; 384 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 385 | filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); 386 | color: #fff; 387 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 388 | } 389 | .datepicker table tr td span.active:hover, 390 | .datepicker table tr td span.active:hover:hover, 391 | .datepicker table tr td span.active.disabled:hover, 392 | .datepicker table tr td span.active.disabled:hover:hover, 393 | .datepicker table tr td span.active:active, 394 | .datepicker table tr td span.active:hover:active, 395 | .datepicker table tr td span.active.disabled:active, 396 | .datepicker table tr td span.active.disabled:hover:active, 397 | .datepicker table tr td span.active.active, 398 | .datepicker table tr td span.active:hover.active, 399 | .datepicker table tr td span.active.disabled.active, 400 | .datepicker table tr td span.active.disabled:hover.active, 401 | .datepicker table tr td span.active.disabled, 402 | .datepicker table tr td span.active:hover.disabled, 403 | .datepicker table tr td span.active.disabled.disabled, 404 | .datepicker table tr td span.active.disabled:hover.disabled, 405 | .datepicker table tr td span.active[disabled], 406 | .datepicker table tr td span.active:hover[disabled], 407 | .datepicker table tr td span.active.disabled[disabled], 408 | .datepicker table tr td span.active.disabled:hover[disabled] { 409 | background-color: #0044cc; 410 | } 411 | .datepicker table tr td span.active:active, 412 | .datepicker table tr td span.active:hover:active, 413 | .datepicker table tr td span.active.disabled:active, 414 | .datepicker table tr td span.active.disabled:hover:active, 415 | .datepicker table tr td span.active.active, 416 | .datepicker table tr td span.active:hover.active, 417 | .datepicker table tr td span.active.disabled.active, 418 | .datepicker table tr td span.active.disabled:hover.active { 419 | background-color: #003399 \9; 420 | } 421 | .datepicker table tr td span.old, 422 | .datepicker table tr td span.new { 423 | color: #999999; 424 | } 425 | .datepicker th.datepicker-switch { 426 | width: 145px; 427 | } 428 | .datepicker thead tr:first-child th, 429 | .datepicker tfoot tr th { 430 | cursor: pointer; 431 | } 432 | .datepicker thead tr:first-child th:hover, 433 | .datepicker tfoot tr th:hover { 434 | background: #eeeeee; 435 | } 436 | .datepicker .cw { 437 | font-size: 10px; 438 | width: 12px; 439 | padding: 0 2px 0 5px; 440 | vertical-align: middle; 441 | } 442 | .datepicker thead tr:first-child th.cw { 443 | cursor: default; 444 | background-color: transparent; 445 | } 446 | .input-append.date .add-on i, 447 | .input-prepend.date .add-on i { 448 | display: block; 449 | cursor: pointer; 450 | width: 16px; 451 | height: 16px; 452 | } 453 | .input-daterange input { 454 | text-align: center; 455 | } 456 | .input-daterange input:first-child { 457 | -webkit-border-radius: 3px 0 0 3px; 458 | -moz-border-radius: 3px 0 0 3px; 459 | border-radius: 3px 0 0 3px; 460 | } 461 | .input-daterange input:last-child { 462 | -webkit-border-radius: 0 3px 3px 0; 463 | -moz-border-radius: 0 3px 3px 0; 464 | border-radius: 0 3px 3px 0; 465 | } 466 | .input-daterange .add-on { 467 | display: inline-block; 468 | width: auto; 469 | min-width: 16px; 470 | height: 18px; 471 | padding: 4px 5px; 472 | font-weight: normal; 473 | line-height: 18px; 474 | text-align: center; 475 | text-shadow: 0 1px 0 #ffffff; 476 | vertical-align: middle; 477 | background-color: #eeeeee; 478 | border: 1px solid #ccc; 479 | margin-left: -5px; 480 | margin-right: -5px; 481 | } 482 | -------------------------------------------------------------------------------- /static/css/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.4.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.4.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.4.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.4.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.4.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"} 5 | -------------------------------------------------------------------------------- /static/css/style.5c97a3af.css: -------------------------------------------------------------------------------- 1 | .login-modal{color:#848484}.login-modal .modal-dialog{max-width:560px}.login-modal .login-title{text-align:center;font-size:20px;margin:5px 0 20px}.login-form{max-width:400px;margin:10px auto 0}.login-form ::-webkit-input-placeholder{color:#ccc}.login-form ::-moz-placeholder{color:#ccc}.login-form :-ms-input-placeholder{color:#ccc}.login-form ::placeholder{color:#ccc}.login-form .form-group{position:relative;margin:0}.login-form .control-label{display:none}.login-form .form-control{box-shadow:none;border:none;font-size:16px;padding-left:0}.login-form .form-control:focus,.login-form .form-control:active{border-color:#eee}.login-form .input-group{padding:3px 0}.login-form .input-group-addon{background-color:#fff;color:#ccc;border:none;text-align:center}.login-form .input-group-addon .fa{font-size:20px;line-height:20px}.login-form .input-group{border:1px solid #eee}.login-form .login-username{border-radius:4px 4px 0 0}.login-form .login-password{border-radius:0 0 4px 4px;border-top:none}.login-form .login-password input{padding-left:3px}.login-form .login-captcha{border-top:none;border-radius:0 0 4px 4px}.login-form .captcha-group{display:none;position:relative}.login-form .login-captcha{padding:6px 0 7px}.login-form .captcha-img{cursor:pointer;position:absolute;top:0;right:0;z-index:3}.login-form .captcha-img .fa{background-color:#fff;position:absolute;bottom:1px;right:1px;padding:1px;visibility:hidden}.login-form .captcha-img:hover .fa{visibility:visible}.login-form .error-msg{color:#e9433a;margin:8px 0 -5px}.login-form .login-btn{margin:15px 0 0}.login-form .links{margin:15px 0 0}.login-form .links a{color:#848484}.login-form .register-btn{margin:15px 0 10px;border-color:#eee}.login-form .register-btn:hover{color:#848484;border-color:#ccc}.login-form.need-captcha .captcha-group{display:block}.login-form.need-captcha .login-password{border-radius:0} -------------------------------------------------------------------------------- /static/css/style.ccde8427.css: -------------------------------------------------------------------------------- 1 | .global-bar2{position:absolute;background:#0a0a0a;box-shadow:0 0 10px #333;top:0;left:0;width:100%;height:50px;font-size:12px;z-index:1001;font-family:'Microsoft Yahei',simsun,sans-serif}.global-bar2 *{box-sizing:border-box}.global-bar2 .container{position:relative}.global-bar2 .logo{float:left;margin-top:10px;margin-left:10px}.global-bar2 .global-nav{float:left;margin-left:15px;height:50px}.global-bar2 .global-nav li{list-style:none;float:left;line-height:50px;margin-right:15px;font-size:16px}.global-bar2 .global-nav li a{color:#ccc;margin:0 10px;text-decoration:none}.global-bar2 .global-nav li a:hover,.global-bar2 .global-nav li a:active{color:#fff;text-decoration:none}.global-bar2 .global-nav li.active a{color:#ffcb2f}.global-bar2 .split{width:0;display:inline-block;color:#ffcb2f;height:16px;border-right:1px solid;vertical-align:middle}.global-bar2 .dropdown{display:inline-block;position:relative}.global-bar2 .dropdown.open{background-color:#717171}.global-bar2 .dropdown.open .dropdown-menu{display:block}.global-bar2 .dropdown.open .dropdown-toggle{background-color:#000;color:#fff}.global-bar2 .dropdown-menu{background-color:#717171;display:none;position:absolute;border-radius:0;border:none;top:100%;right:0;margin:0;padding:0;min-width:100px;list-style:none}.global-bar2 .dropdown-menu a,.global-bar2 .dropdown-menu a:hover{background-color:#717171}.global-bar2 .dropdown-toggle{color:#7a7879;display:inline-block}.global-bar2 .dropdown-toggle:hover{color:#939293}.global-bar2 .pull-right{float:right;padding-right:30px}.global-bar2 .search,.global-bar2 .profile,.global-bar2 .message-center,.global-bar2 .feedback,.global-bar2 .btn-login,.global-bar2 .btn-register,.global-bar2 .apps{display:inline-block;vertical-align:middle;margin:0 3px}.global-bar2 .search .dropdown-menu,.global-bar2 .profile .dropdown-menu,.global-bar2 .message-center .dropdown-menu,.global-bar2 .feedback .dropdown-menu,.global-bar2 .btn-login .dropdown-menu,.global-bar2 .btn-register .dropdown-menu,.global-bar2 .apps .dropdown-menu{background-color:#717171}.global-bar2 .nlogin{display:none}.global-bar2 .feedback{color:#ccc;margin:0 9px 0 0}.global-bar2 .feedback:hover{color:#fff;text-decoration:none}.global-bar2 .search{background-color:#373737}.global-bar2 .search span{padding-right:6px;padding-left:12px}.global-bar2 .search input{color:#686868;border-width:0;padding:1px 0 1px 0;background-color:#373737;height:26px;width:175px;outline:none}.global-bar2 .t-link{display:inline-block;line-height:24px;vertical-align:middle;padding:0 5px 0 0}.global-bar2 .chatIcon{width:24px;height:24px;vertical-align:middle;display:inline-block;background-image:url(chat.png);background-size:24px;background-repeat:no-repeat;margin-left:3px}.global-bar2 .profile .open .dropdown-toggle,.global-bar2 .apps .open .dropdown-toggle{color:#ffcb2f}.global-bar2 .profile .dropdown,.global-bar2 .apps .dropdown{height:28px;padding:4px 3px 3px;vertical-align:middle;line-height:1}.global-bar2 .profile .dropdown-menu,.global-bar2 .apps .dropdown-menu{border:none;border-radius:0}.global-bar2 .profile .dropdown-menu a,.global-bar2 .apps .dropdown-menu a{color:#fff;text-decoration:none;font-size:12px;white-space:nowrap}.global-bar2 .profile .dropdown-menu a:hover,.global-bar2 .apps .dropdown-menu a:hover{color:#ffcb2f}.global-bar2 .apps.open .dropdown-toggle{background-color:#000}.global-bar2 .apps .dropdown-toggle{height:49px;cursor:pointer;padding:4px 9px 0;line-height:49px}.global-bar2 .apps .dropdown-toggle .glyphicon{font-size:20px}.global-bar2 .apps .dropdown-menu{width:630px;left:auto}.global-bar2 .apps .appDock{padding:10px 20px;list-style:none;overflow:hidden;margin:0}.global-bar2 .apps .appDock li{width:147px;height:32px;margin:10px 0;float:left}.global-bar2 .apps .appDock a{display:block;padding:0;line-height:32px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.global-bar2 .apps .appDock a:hover{background-color:#717171}.global-bar2 .apps .appDock .appIcon{width:32px;height:32px;display:inline-block;vertical-align:middle}.global-bar2 .apps .appDock .appName{margin-left:10px;display:inline-block;width:7em;overflow:hidden;vertical-align:middle;text-overflow:ellipsis}.global-bar2 .apps .more-app{background-color:#696969;border-top:1px dashed #888;overflow:hidden}.global-bar2 .apps .more-app .links{float:right;padding:8px 0}.global-bar2 .apps .more-app a{color:#ffcb2f;background-color:#696969;display:inline-block;margin:0 16px}.global-bar2 .apps .account-icon,.global-bar2 .apps .rocket-icon{background:url(account.png) no-repeat center center;display:inline-block;height:19px;width:15px;vertical-align:middle;margin-right:6px}.global-bar2 .apps .rocket-icon{background-image:url(rocket.png)}.global-bar2 .profile{height:50px}.global-bar2 .profile .detail,.global-bar2 .profile .dropdown{float:left}.global-bar2 .profile .detail{padding:6px 0 0}.global-bar2 .profile .username,.global-bar2 .profile .owner{color:#ffcb2f;display:block}.global-bar2 .profile .owner{font-size:14px}.global-bar2 .profile .username{color:#fff;text-align:right}.global-bar2 .profile .dropdown{cursor:pointer;vertical-align:middle;padding:9px 5px;height:50px;margin:0 0 0 4px}.global-bar2 .profile .dropdown a{color:#fff;padding:3px 10px}.global-bar2 .profile .dropdown a:hover{color:#ffcb2f}.global-bar2 .profile .dropdown .dropdown-menu{left:auto;padding:5px}.global-bar2 .default-avatar{background-color:#c8c8c8;padding:6px}.global-bar2 .message-center .fa-bell{font-size:18px}.global-bar2 .message-center .dropdown-toggle{position:relative}.global-bar2 .message-center .dropdown-toggle .count{color:#fff;background-color:#ea4b4b;display:none;position:absolute;right:-7px;top:-7px;border-radius:10px;width:18px;height:18px;font-size:12px;line-height:16px;text-align:center;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}.global-bar2 .message-center .dropdown-toggle .fa{cursor:pointer}.global-bar2 .message-center .dropdown-menu{box-shadow:0 0 5px 1px #000;border-radius:0 0 5px 5px;right:0;left:auto;top:35px}.global-bar2 .message-list{width:280px;background-color:#5d5d5d;color:#b6b6b6;font-size:12px;border-radius:0 0 5px 5px}.global-bar2 .message-list .disabled{color:#838383 !important;cursor:default !important}.global-bar2 .message-list .spinner{text-align:center}.global-bar2 .message-list .title{background-color:#434343;color:#fff;position:relative;font-size:14px;line-height:14px;padding:8px 12px}.global-bar2 .message-list .title .read-all{cursor:pointer;color:#b6b6b6;font-size:12px;position:absolute;right:12px;top:8px}.global-bar2 .message-list .nav-pills{text-align:center;padding:8px 14px}.global-bar2 .message-list .nav-pills>li>a{background-color:#5d5d5d;border-color:#999;color:#fff;padding:3px 50px;font-size:12px}.global-bar2 .message-list .nav-pills>li.active>a{background-color:#999;color:#000}.global-bar2 .message-list ::-webkit-scrollbar{background-color:#5d5d5d;width:8px;border-radius:5px}.global-bar2 .message-list ::-webkit-scrollbar-track{background-color:#5d5d5d;border-radius:5px}.global-bar2 .message-list ::-webkit-scrollbar-thumb{background-color:#909090;width:8px;border-radius:5px}.global-bar2 .message-list .letters{border-top:1px solid #b6b6b6;list-style:none;padding:0;margin:0;max-height:370px;overflow:auto}.global-bar2 .message-list .letters .header{background-color:#434343;color:#9d9d9d;padding:3px 0 3px 14px}.global-bar2 .message-list .empty{text-align:center;padding:10px 0}.global-bar2 .message-list .header+.letter{border-top:none}.global-bar2 .message-list .letter{margin:0 15px;border-top:1px dashed #838383;font-size:12px;padding:10px 0;position:relative}.global-bar2 .message-list .letter a{color:#fff;background-color:#5d5d5d;text-decoration:none;display:block}.global-bar2 .message-list .letter a:hover{opacity:.9}.global-bar2 .message-list .letter h5,.global-bar2 .message-list .letter .date{display:inline-block}.global-bar2 .message-list .letter h5{color:#fff;font-weight:normal;font-size:12px;margin:0 30px 0 0;max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.3}.global-bar2 .message-list .letter .date{color:#b6b6b6}.global-bar2 .message-list .letter .desc{display:block;color:#b6b6b6}.global-bar2 .message-list .letter .read{color:#909090;cursor:pointer;position:absolute;right:0;top:10px;font-size:16px;line-height:16px}.global-bar2 .message-list .letter .read:hover{color:#cacaca}.global-bar2 .default-avatar{background-color:#c8c8c8;padding:6px}.global-bar2 .avatar{width:32px;height:32px}.global-bar2 .help{background-color:#5389d2;color:#010101;border-radius:10px;width:18px;height:18px;text-align:center;line-height:20px;font-size:14px;margin:1px 0 0}.global-bar2 .btn-login,.global-bar2 .btn-register{color:#fff;border:1px solid #fff;border-radius:3px;padding:5px 15px;margin:9px 5px 1px}.global-bar2 .btn-login:hover,.global-bar2 .btn-register:hover{border-color:#ffcb2f;color:#ffcb2f}.sso-message-iframe{display:none}.message-center-notifies{position:fixed;top:60px;right:20px;z-index:1000}.message-center-notifies .notify-item{background-color:#5d5d5d;color:#fff;position:relative;width:270px;padding:10px 10px 10px 55px;box-shadow:0 0 5px #000;margin:0 0 15px;overflow:hidden}.message-center-notifies .fa-comment{color:#ffcb2f;position:absolute;left:14px;top:13px;font-size:28px;line-height:28px}.message-center-notifies .summary{color:#fff;border-left:1px dashed #909090;display:block;padding:0 0 0 12px;line-height:36px;width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none}.message-center-notifies .summary:hover{opacity:.9}.message-center-notifies .read{cursor:pointer;color:#434343;position:absolute;right:7px;top:4px;font-size:16px;line-height:16px}.message-center-notifies .read:hover{color:#373737}.feedback-modal .form,.feedback-modal .form-group{margin:0}.feedback-modal .feedback-content{width:100%;height:5em;padding:5px 7px}.feedback-modal .feedback-content:focus{outline:none}.feedback-modal .more-info{margin:6px 0 0}.feedback-modal .error-msg{display:inline-block;margin:0 10px 0 0;color:#ea433b} -------------------------------------------------------------------------------- /static/fonts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/fonts/.DS_Store -------------------------------------------------------------------------------- /static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /static/js/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/js/.DS_Store -------------------------------------------------------------------------------- /static/js/bootstrap-datepicker.js: -------------------------------------------------------------------------------- 1 | /* ========================================================= 2 | * bootstrap-datepicker.js 3 | * http://www.eyecon.ro/bootstrap-datepicker 4 | * ========================================================= 5 | * Copyright 2012 Stefan Petre 6 | * Improvements by Andrew Rowls 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * ========================================================= */ 20 | 21 | (function( $ ) { 22 | 23 | var $window = $(window); 24 | 25 | function UTCDate(){ 26 | return new Date(Date.UTC.apply(Date, arguments)); 27 | } 28 | function UTCToday(){ 29 | var today = new Date(); 30 | return UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()); 31 | } 32 | 33 | 34 | // Picker object 35 | 36 | var Datepicker = function(element, options) { 37 | var that = this; 38 | 39 | this._process_options(options); 40 | 41 | this.element = $(element); 42 | this.isInline = false; 43 | this.isInput = this.element.is('input'); 44 | this.component = this.element.is('.date') ? this.element.find('.add-on, .btn') : false; 45 | this.hasInput = this.component && this.element.find('input').length; 46 | if(this.component && this.component.length === 0) 47 | this.component = false; 48 | 49 | this.picker = $(DPGlobal.template); 50 | this._buildEvents(); 51 | this._attachEvents(); 52 | 53 | if(this.isInline) { 54 | this.picker.addClass('datepicker-inline').appendTo(this.element); 55 | } else { 56 | this.picker.addClass('datepicker-dropdown dropdown-menu'); 57 | } 58 | 59 | if (this.o.rtl){ 60 | this.picker.addClass('datepicker-rtl'); 61 | this.picker.find('.prev i, .next i') 62 | .toggleClass('icon-arrow-left icon-arrow-right'); 63 | } 64 | 65 | 66 | this.viewMode = this.o.startView; 67 | 68 | if (this.o.calendarWeeks) 69 | this.picker.find('tfoot th.today') 70 | .attr('colspan', function(i, val){ 71 | return parseInt(val) + 1; 72 | }); 73 | 74 | this._allow_update = false; 75 | 76 | this.setStartDate(this._o.startDate); 77 | this.setEndDate(this._o.endDate); 78 | this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled); 79 | 80 | this.fillDow(); 81 | this.fillMonths(); 82 | 83 | this._allow_update = true; 84 | 85 | this.update(); 86 | this.showMode(); 87 | 88 | if(this.isInline) { 89 | this.show(); 90 | } 91 | }; 92 | 93 | Datepicker.prototype = { 94 | constructor: Datepicker, 95 | 96 | _process_options: function(opts){ 97 | // Store raw options for reference 98 | this._o = $.extend({}, this._o, opts); 99 | // Processed options 100 | var o = this.o = $.extend({}, this._o); 101 | 102 | // Check if "de-DE" style date is available, if not language should 103 | // fallback to 2 letter code eg "de" 104 | var lang = o.language; 105 | if (!dates[lang]) { 106 | lang = lang.split('-')[0]; 107 | if (!dates[lang]) 108 | lang = defaults.language; 109 | } 110 | o.language = lang; 111 | 112 | switch(o.startView){ 113 | case 2: 114 | case 'decade': 115 | o.startView = 2; 116 | break; 117 | case 1: 118 | case 'year': 119 | o.startView = 1; 120 | break; 121 | default: 122 | o.startView = 0; 123 | } 124 | 125 | switch (o.minViewMode) { 126 | case 1: 127 | case 'months': 128 | o.minViewMode = 1; 129 | break; 130 | case 2: 131 | case 'years': 132 | o.minViewMode = 2; 133 | break; 134 | default: 135 | o.minViewMode = 0; 136 | } 137 | 138 | o.startView = Math.max(o.startView, o.minViewMode); 139 | 140 | o.weekStart %= 7; 141 | o.weekEnd = ((o.weekStart + 6) % 7); 142 | 143 | var format = DPGlobal.parseFormat(o.format); 144 | if (o.startDate !== -Infinity) { 145 | if (!!o.startDate) { 146 | if (o.startDate instanceof Date) 147 | o.startDate = this._local_to_utc(this._zero_time(o.startDate)); 148 | else 149 | o.startDate = DPGlobal.parseDate(o.startDate, format, o.language); 150 | } else { 151 | o.startDate = -Infinity; 152 | } 153 | } 154 | if (o.endDate !== Infinity) { 155 | if (!!o.endDate) { 156 | if (o.endDate instanceof Date) 157 | o.endDate = this._local_to_utc(this._zero_time(o.endDate)); 158 | else 159 | o.endDate = DPGlobal.parseDate(o.endDate, format, o.language); 160 | } else { 161 | o.endDate = Infinity; 162 | } 163 | } 164 | 165 | o.daysOfWeekDisabled = o.daysOfWeekDisabled||[]; 166 | if (!$.isArray(o.daysOfWeekDisabled)) 167 | o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/); 168 | o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function (d) { 169 | return parseInt(d, 10); 170 | }); 171 | 172 | var plc = String(o.orientation).toLowerCase().split(/\s+/g), 173 | _plc = o.orientation.toLowerCase(); 174 | plc = $.grep(plc, function(word){ 175 | return (/^auto|left|right|top|bottom$/).test(word); 176 | }); 177 | o.orientation = {x: 'auto', y: 'auto'}; 178 | if (!_plc || _plc === 'auto') 179 | ; // no action 180 | else if (plc.length === 1){ 181 | switch(plc[0]){ 182 | case 'top': 183 | case 'bottom': 184 | o.orientation.y = plc[0]; 185 | break; 186 | case 'left': 187 | case 'right': 188 | o.orientation.x = plc[0]; 189 | break; 190 | } 191 | } 192 | else { 193 | _plc = $.grep(plc, function(word){ 194 | return (/^left|right$/).test(word); 195 | }); 196 | o.orientation.x = _plc[0] || 'auto'; 197 | 198 | _plc = $.grep(plc, function(word){ 199 | return (/^top|bottom$/).test(word); 200 | }); 201 | o.orientation.y = _plc[0] || 'auto'; 202 | } 203 | }, 204 | _events: [], 205 | _secondaryEvents: [], 206 | _applyEvents: function(evs){ 207 | for (var i=0, el, ev; i windowWidth) 448 | left = windowWidth - calendarWidth - visualPadding; 449 | } 450 | 451 | // auto y orientation is best-situation: top or bottom, no fudging, 452 | // decision based on which shows more of the calendar 453 | var yorient = this.o.orientation.y, 454 | top_overflow, bottom_overflow; 455 | if (yorient === 'auto') { 456 | top_overflow = -scrollTop + offset.top - calendarHeight; 457 | bottom_overflow = scrollTop + windowHeight - (offset.top + height + calendarHeight); 458 | if (Math.max(top_overflow, bottom_overflow) === bottom_overflow) 459 | yorient = 'top'; 460 | else 461 | yorient = 'bottom'; 462 | } 463 | this.picker.addClass('datepicker-orient-' + yorient); 464 | if (yorient === 'top') 465 | top += height; 466 | else 467 | top -= calendarHeight + parseInt(this.picker.css('padding-top')); 468 | 469 | this.picker.css({ 470 | top: top, 471 | left: left, 472 | zIndex: zIndex 473 | }); 474 | }, 475 | 476 | _allow_update: true, 477 | update: function(){ 478 | if (!this._allow_update) return; 479 | 480 | var oldDate = new Date(this.date), 481 | date, fromArgs = false; 482 | if(arguments && arguments.length && (typeof arguments[0] === 'string' || arguments[0] instanceof Date)) { 483 | date = arguments[0]; 484 | if (date instanceof Date) 485 | date = this._local_to_utc(date); 486 | fromArgs = true; 487 | } else { 488 | date = this.isInput ? this.element.val() : this.element.data('date') || this.element.find('input').val(); 489 | delete this.element.data().date; 490 | } 491 | 492 | this.date = DPGlobal.parseDate(date, this.o.format, this.o.language); 493 | 494 | if (fromArgs) { 495 | // setting date by clicking 496 | this.setValue(); 497 | } else if (date) { 498 | // setting date by typing 499 | if (oldDate.getTime() !== this.date.getTime()) 500 | this._trigger('changeDate'); 501 | } else { 502 | // clearing date 503 | this._trigger('clearDate'); 504 | } 505 | 506 | if (this.date < this.o.startDate) { 507 | this.viewDate = new Date(this.o.startDate); 508 | this.date = new Date(this.o.startDate); 509 | } else if (this.date > this.o.endDate) { 510 | this.viewDate = new Date(this.o.endDate); 511 | this.date = new Date(this.o.endDate); 512 | } else { 513 | this.viewDate = new Date(this.date); 514 | this.date = new Date(this.date); 515 | } 516 | this.fill(); 517 | }, 518 | 519 | fillDow: function(){ 520 | var dowCnt = this.o.weekStart, 521 | html = ''; 522 | if(this.o.calendarWeeks){ 523 | var cell = ' '; 524 | html += cell; 525 | this.picker.find('.datepicker-days thead tr:first-child').prepend(cell); 526 | } 527 | while (dowCnt < this.o.weekStart + 7) { 528 | html += ''+dates[this.o.language].daysMin[(dowCnt++)%7]+''; 529 | } 530 | html += ''; 531 | this.picker.find('.datepicker-days thead').append(html); 532 | }, 533 | 534 | fillMonths: function(){ 535 | var html = '', 536 | i = 0; 537 | while (i < 12) { 538 | html += ''+dates[this.o.language].monthsShort[i++]+''; 539 | } 540 | this.picker.find('.datepicker-months td').html(html); 541 | }, 542 | 543 | setRange: function(range){ 544 | if (!range || !range.length) 545 | delete this.range; 546 | else 547 | this.range = $.map(range, function(d){ return d.valueOf(); }); 548 | this.fill(); 549 | }, 550 | 551 | getClassNames: function(date){ 552 | var cls = [], 553 | year = this.viewDate.getUTCFullYear(), 554 | month = this.viewDate.getUTCMonth(), 555 | currentDate = this.date.valueOf(), 556 | today = new Date(); 557 | if (date.getUTCFullYear() < year || (date.getUTCFullYear() == year && date.getUTCMonth() < month)) { 558 | cls.push('old'); 559 | } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() == year && date.getUTCMonth() > month)) { 560 | cls.push('new'); 561 | } 562 | // Compare internal UTC date with local today, not UTC today 563 | if (this.o.todayHighlight && 564 | date.getUTCFullYear() == today.getFullYear() && 565 | date.getUTCMonth() == today.getMonth() && 566 | date.getUTCDate() == today.getDate()) { 567 | cls.push('today'); 568 | } 569 | if (currentDate && date.valueOf() == currentDate) { 570 | cls.push('active'); 571 | } 572 | if (date.valueOf() < this.o.startDate || date.valueOf() > this.o.endDate || 573 | $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1) { 574 | cls.push('disabled'); 575 | } 576 | if (this.range){ 577 | if (date > this.range[0] && date < this.range[this.range.length-1]){ 578 | cls.push('range'); 579 | } 580 | if ($.inArray(date.valueOf(), this.range) != -1){ 581 | cls.push('selected'); 582 | } 583 | } 584 | return cls; 585 | }, 586 | 587 | fill: function() { 588 | var d = new Date(this.viewDate), 589 | year = d.getUTCFullYear(), 590 | month = d.getUTCMonth(), 591 | startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity, 592 | startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, 593 | endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, 594 | endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, 595 | currentDate = this.date && this.date.valueOf(), 596 | tooltip; 597 | this.picker.find('.datepicker-days thead th.datepicker-switch') 598 | .text(dates[this.o.language].months[month]+' '+year); 599 | this.picker.find('tfoot th.today') 600 | .text(dates[this.o.language].today) 601 | .toggle(this.o.todayBtn !== false); 602 | this.picker.find('tfoot th.clear') 603 | .text(dates[this.o.language].clear) 604 | .toggle(this.o.clearBtn !== false); 605 | this.updateNavArrows(); 606 | this.fillMonths(); 607 | var prevMonth = UTCDate(year, month-1, 28,0,0,0,0), 608 | day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth()); 609 | prevMonth.setUTCDate(day); 610 | prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7); 611 | var nextMonth = new Date(prevMonth); 612 | nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); 613 | nextMonth = nextMonth.valueOf(); 614 | var html = []; 615 | var clsName; 616 | while(prevMonth.valueOf() < nextMonth) { 617 | if (prevMonth.getUTCDay() == this.o.weekStart) { 618 | html.push(''); 619 | if(this.o.calendarWeeks){ 620 | // ISO 8601: First week contains first thursday. 621 | // ISO also states week starts on Monday, but we can be more abstract here. 622 | var 623 | // Start of current week: based on weekstart/current date 624 | ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5), 625 | // Thursday of this week 626 | th = new Date(+ws + (7 + 4 - ws.getUTCDay()) % 7 * 864e5), 627 | // First Thursday of year, year from thursday 628 | yth = new Date(+(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5), 629 | // Calendar week: ms between thursdays, div ms per day, div 7 days 630 | calWeek = (th - yth) / 864e5 / 7 + 1; 631 | html.push(''+ calWeek +''); 632 | 633 | } 634 | } 635 | clsName = this.getClassNames(prevMonth); 636 | clsName.push('day'); 637 | 638 | if (this.o.beforeShowDay !== $.noop){ 639 | var before = this.o.beforeShowDay(this._utc_to_local(prevMonth)); 640 | if (before === undefined) 641 | before = {}; 642 | else if (typeof(before) === 'boolean') 643 | before = {enabled: before}; 644 | else if (typeof(before) === 'string') 645 | before = {classes: before}; 646 | if (before.enabled === false) 647 | clsName.push('disabled'); 648 | if (before.classes) 649 | clsName = clsName.concat(before.classes.split(/\s+/)); 650 | if (before.tooltip) 651 | tooltip = before.tooltip; 652 | } 653 | 654 | clsName = $.unique(clsName); 655 | html.push(''+prevMonth.getUTCDate() + ''); 656 | if (prevMonth.getUTCDay() == this.o.weekEnd) { 657 | html.push(''); 658 | } 659 | prevMonth.setUTCDate(prevMonth.getUTCDate()+1); 660 | } 661 | this.picker.find('.datepicker-days tbody').empty().append(html.join('')); 662 | var currentYear = this.date && this.date.getUTCFullYear(); 663 | 664 | var months = this.picker.find('.datepicker-months') 665 | .find('th:eq(1)') 666 | .text(year) 667 | .end() 668 | .find('span').removeClass('active'); 669 | if (currentYear && currentYear == year) { 670 | months.eq(this.date.getUTCMonth()).addClass('active'); 671 | } 672 | if (year < startYear || year > endYear) { 673 | months.addClass('disabled'); 674 | } 675 | if (year == startYear) { 676 | months.slice(0, startMonth).addClass('disabled'); 677 | } 678 | if (year == endYear) { 679 | months.slice(endMonth+1).addClass('disabled'); 680 | } 681 | 682 | html = ''; 683 | year = parseInt(year/10, 10) * 10; 684 | var yearCont = this.picker.find('.datepicker-years') 685 | .find('th:eq(1)') 686 | .text(year + '-' + (year + 9)) 687 | .end() 688 | .find('td'); 689 | year -= 1; 690 | for (var i = -1; i < 11; i++) { 691 | html += ''+year+''; 692 | year += 1; 693 | } 694 | yearCont.html(html); 695 | }, 696 | 697 | updateNavArrows: function() { 698 | if (!this._allow_update) return; 699 | 700 | var d = new Date(this.viewDate), 701 | year = d.getUTCFullYear(), 702 | month = d.getUTCMonth(); 703 | switch (this.viewMode) { 704 | case 0: 705 | if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()) { 706 | this.picker.find('.prev').css({visibility: 'hidden'}); 707 | } else { 708 | this.picker.find('.prev').css({visibility: 'visible'}); 709 | } 710 | if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()) { 711 | this.picker.find('.next').css({visibility: 'hidden'}); 712 | } else { 713 | this.picker.find('.next').css({visibility: 'visible'}); 714 | } 715 | break; 716 | case 1: 717 | case 2: 718 | if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear()) { 719 | this.picker.find('.prev').css({visibility: 'hidden'}); 720 | } else { 721 | this.picker.find('.prev').css({visibility: 'visible'}); 722 | } 723 | if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear()) { 724 | this.picker.find('.next').css({visibility: 'hidden'}); 725 | } else { 726 | this.picker.find('.next').css({visibility: 'visible'}); 727 | } 728 | break; 729 | } 730 | }, 731 | 732 | click: function(e) { 733 | e.preventDefault(); 734 | var target = $(e.target).closest('span, td, th'); 735 | if (target.length == 1) { 736 | switch(target[0].nodeName.toLowerCase()) { 737 | case 'th': 738 | switch(target[0].className) { 739 | case 'datepicker-switch': 740 | this.showMode(1); 741 | break; 742 | case 'prev': 743 | case 'next': 744 | var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className == 'prev' ? -1 : 1); 745 | switch(this.viewMode){ 746 | case 0: 747 | this.viewDate = this.moveMonth(this.viewDate, dir); 748 | this._trigger('changeMonth', this.viewDate); 749 | break; 750 | case 1: 751 | case 2: 752 | this.viewDate = this.moveYear(this.viewDate, dir); 753 | if (this.viewMode === 1) 754 | this._trigger('changeYear', this.viewDate); 755 | break; 756 | } 757 | this.fill(); 758 | break; 759 | case 'today': 760 | var date = new Date(); 761 | date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); 762 | 763 | this.showMode(-2); 764 | var which = this.o.todayBtn == 'linked' ? null : 'view'; 765 | this._setDate(date, which); 766 | break; 767 | case 'clear': 768 | var element; 769 | if (this.isInput) 770 | element = this.element; 771 | else if (this.component) 772 | element = this.element.find('input'); 773 | if (element) 774 | element.val("").change(); 775 | this._trigger('changeDate'); 776 | this.update(); 777 | if (this.o.autoclose) 778 | this.hide(); 779 | break; 780 | } 781 | break; 782 | case 'span': 783 | if (!target.is('.disabled')) { 784 | this.viewDate.setUTCDate(1); 785 | if (target.is('.month')) { 786 | var day = 1; 787 | var month = target.parent().find('span').index(target); 788 | var year = this.viewDate.getUTCFullYear(); 789 | this.viewDate.setUTCMonth(month); 790 | this._trigger('changeMonth', this.viewDate); 791 | if (this.o.minViewMode === 1) { 792 | this._setDate(UTCDate(year, month, day,0,0,0,0)); 793 | } 794 | } else { 795 | var year = parseInt(target.text(), 10)||0; 796 | var day = 1; 797 | var month = 0; 798 | this.viewDate.setUTCFullYear(year); 799 | this._trigger('changeYear', this.viewDate); 800 | if (this.o.minViewMode === 2) { 801 | this._setDate(UTCDate(year, month, day,0,0,0,0)); 802 | } 803 | } 804 | this.showMode(-1); 805 | this.fill(); 806 | } 807 | break; 808 | case 'td': 809 | if (target.is('.day') && !target.is('.disabled')){ 810 | var day = parseInt(target.text(), 10)||1; 811 | var year = this.viewDate.getUTCFullYear(), 812 | month = this.viewDate.getUTCMonth(); 813 | if (target.is('.old')) { 814 | if (month === 0) { 815 | month = 11; 816 | year -= 1; 817 | } else { 818 | month -= 1; 819 | } 820 | } else if (target.is('.new')) { 821 | if (month == 11) { 822 | month = 0; 823 | year += 1; 824 | } else { 825 | month += 1; 826 | } 827 | } 828 | this._setDate(UTCDate(year, month, day,0,0,0,0)); 829 | } 830 | break; 831 | } 832 | } 833 | }, 834 | 835 | _setDate: function(date, which){ 836 | if (!which || which == 'date') 837 | this.date = new Date(date); 838 | if (!which || which == 'view') 839 | this.viewDate = new Date(date); 840 | this.fill(); 841 | this.setValue(); 842 | this._trigger('changeDate'); 843 | var element; 844 | if (this.isInput) { 845 | element = this.element; 846 | } else if (this.component){ 847 | element = this.element.find('input'); 848 | } 849 | if (element) { 850 | element.change(); 851 | } 852 | if (this.o.autoclose && (!which || which == 'date')) { 853 | this.hide(); 854 | } 855 | }, 856 | 857 | moveMonth: function(date, dir){ 858 | if (!dir) return date; 859 | var new_date = new Date(date.valueOf()), 860 | day = new_date.getUTCDate(), 861 | month = new_date.getUTCMonth(), 862 | mag = Math.abs(dir), 863 | new_month, test; 864 | dir = dir > 0 ? 1 : -1; 865 | if (mag == 1){ 866 | test = dir == -1 867 | // If going back one month, make sure month is not current month 868 | // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02) 869 | ? function(){ return new_date.getUTCMonth() == month; } 870 | // If going forward one month, make sure month is as expected 871 | // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02) 872 | : function(){ return new_date.getUTCMonth() != new_month; }; 873 | new_month = month + dir; 874 | new_date.setUTCMonth(new_month); 875 | // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 876 | if (new_month < 0 || new_month > 11) 877 | new_month = (new_month + 12) % 12; 878 | } else { 879 | // For magnitudes >1, move one month at a time... 880 | for (var i=0; i= this.o.startDate && date <= this.o.endDate; 903 | }, 904 | 905 | keydown: function(e){ 906 | if (this.picker.is(':not(:visible)')){ 907 | if (e.keyCode == 27) // allow escape to hide and re-show picker 908 | this.show(); 909 | return; 910 | } 911 | var dateChanged = false, 912 | dir, day, month, 913 | newDate, newViewDate; 914 | switch(e.keyCode){ 915 | case 27: // escape 916 | this.hide(); 917 | e.preventDefault(); 918 | break; 919 | case 37: // left 920 | case 39: // right 921 | if (!this.o.keyboardNavigation) break; 922 | dir = e.keyCode == 37 ? -1 : 1; 923 | if (e.ctrlKey){ 924 | newDate = this.moveYear(this.date, dir); 925 | newViewDate = this.moveYear(this.viewDate, dir); 926 | this._trigger('changeYear', this.viewDate); 927 | } else if (e.shiftKey){ 928 | newDate = this.moveMonth(this.date, dir); 929 | newViewDate = this.moveMonth(this.viewDate, dir); 930 | this._trigger('changeMonth', this.viewDate); 931 | } else { 932 | newDate = new Date(this.date); 933 | newDate.setUTCDate(this.date.getUTCDate() + dir); 934 | newViewDate = new Date(this.viewDate); 935 | newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir); 936 | } 937 | if (this.dateWithinRange(newDate)){ 938 | this.date = newDate; 939 | this.viewDate = newViewDate; 940 | this.setValue(); 941 | this.update(); 942 | e.preventDefault(); 943 | dateChanged = true; 944 | } 945 | break; 946 | case 38: // up 947 | case 40: // down 948 | if (!this.o.keyboardNavigation) break; 949 | dir = e.keyCode == 38 ? -1 : 1; 950 | if (e.ctrlKey){ 951 | newDate = this.moveYear(this.date, dir); 952 | newViewDate = this.moveYear(this.viewDate, dir); 953 | this._trigger('changeYear', this.viewDate); 954 | } else if (e.shiftKey){ 955 | newDate = this.moveMonth(this.date, dir); 956 | newViewDate = this.moveMonth(this.viewDate, dir); 957 | this._trigger('changeMonth', this.viewDate); 958 | } else { 959 | newDate = new Date(this.date); 960 | newDate.setUTCDate(this.date.getUTCDate() + dir * 7); 961 | newViewDate = new Date(this.viewDate); 962 | newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir * 7); 963 | } 964 | if (this.dateWithinRange(newDate)){ 965 | this.date = newDate; 966 | this.viewDate = newViewDate; 967 | this.setValue(); 968 | this.update(); 969 | e.preventDefault(); 970 | dateChanged = true; 971 | } 972 | break; 973 | case 13: // enter 974 | this.hide(); 975 | e.preventDefault(); 976 | break; 977 | case 9: // tab 978 | this.hide(); 979 | break; 980 | } 981 | if (dateChanged){ 982 | this._trigger('changeDate'); 983 | var element; 984 | if (this.isInput) { 985 | element = this.element; 986 | } else if (this.component){ 987 | element = this.element.find('input'); 988 | } 989 | if (element) { 990 | element.change(); 991 | } 992 | } 993 | }, 994 | 995 | showMode: function(dir) { 996 | if (dir) { 997 | this.viewMode = Math.max(this.o.minViewMode, Math.min(2, this.viewMode + dir)); 998 | } 999 | /* 1000 | vitalets: fixing bug of very special conditions: 1001 | jquery 1.7.1 + webkit + show inline datepicker in bootstrap popover. 1002 | Method show() does not set display css correctly and datepicker is not shown. 1003 | Changed to .css('display', 'block') solve the problem. 1004 | See https://github.com/vitalets/x-editable/issues/37 1005 | 1006 | In jquery 1.7.2+ everything works fine. 1007 | */ 1008 | //this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); 1009 | this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).css('display', 'block'); 1010 | this.updateNavArrows(); 1011 | } 1012 | }; 1013 | 1014 | var DateRangePicker = function(element, options){ 1015 | this.element = $(element); 1016 | this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); 1017 | delete options.inputs; 1018 | 1019 | $(this.inputs) 1020 | .datepicker(options) 1021 | .bind('changeDate', $.proxy(this.dateUpdated, this)); 1022 | 1023 | this.pickers = $.map(this.inputs, function(i){ return $(i).data('datepicker'); }); 1024 | this.updateDates(); 1025 | }; 1026 | DateRangePicker.prototype = { 1027 | updateDates: function(){ 1028 | this.dates = $.map(this.pickers, function(i){ return i.date; }); 1029 | this.updateRanges(); 1030 | }, 1031 | updateRanges: function(){ 1032 | var range = $.map(this.dates, function(d){ return d.valueOf(); }); 1033 | $.each(this.pickers, function(i, p){ 1034 | p.setRange(range); 1035 | }); 1036 | }, 1037 | dateUpdated: function(e){ 1038 | var dp = $(e.target).data('datepicker'), 1039 | new_date = dp.getUTCDate(), 1040 | i = $.inArray(e.target, this.inputs), 1041 | l = this.inputs.length; 1042 | if (i == -1) return; 1043 | 1044 | if (new_date < this.dates[i]){ 1045 | // Date being moved earlier/left 1046 | while (i>=0 && new_date < this.dates[i]){ 1047 | this.pickers[i--].setUTCDate(new_date); 1048 | } 1049 | } 1050 | else if (new_date > this.dates[i]){ 1051 | // Date being moved later/right 1052 | while (i this.dates[i]){ 1053 | this.pickers[i++].setUTCDate(new_date); 1054 | } 1055 | } 1056 | this.updateDates(); 1057 | }, 1058 | remove: function(){ 1059 | $.map(this.pickers, function(p){ p.remove(); }); 1060 | delete this.element.data().datepicker; 1061 | } 1062 | }; 1063 | 1064 | function opts_from_el(el, prefix){ 1065 | // Derive options from element data-attrs 1066 | var data = $(el).data(), 1067 | out = {}, inkey, 1068 | replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'), 1069 | prefix = new RegExp('^' + prefix.toLowerCase()); 1070 | for (var key in data) 1071 | if (prefix.test(key)){ 1072 | inkey = key.replace(replace, function(_,a){ return a.toLowerCase(); }); 1073 | out[inkey] = data[key]; 1074 | } 1075 | return out; 1076 | } 1077 | 1078 | function opts_from_locale(lang){ 1079 | // Derive options from locale plugins 1080 | var out = {}; 1081 | // Check if "de-DE" style date is available, if not language should 1082 | // fallback to 2 letter code eg "de" 1083 | if (!dates[lang]) { 1084 | lang = lang.split('-')[0] 1085 | if (!dates[lang]) 1086 | return; 1087 | } 1088 | var d = dates[lang]; 1089 | $.each(locale_opts, function(i,k){ 1090 | if (k in d) 1091 | out[k] = d[k]; 1092 | }); 1093 | return out; 1094 | } 1095 | 1096 | var old = $.fn.datepicker; 1097 | $.fn.datepicker = function ( option ) { 1098 | var args = Array.apply(null, arguments); 1099 | args.shift(); 1100 | var internal_return, 1101 | this_return; 1102 | this.each(function () { 1103 | var $this = $(this), 1104 | data = $this.data('datepicker'), 1105 | options = typeof option == 'object' && option; 1106 | if (!data) { 1107 | var elopts = opts_from_el(this, 'date'), 1108 | // Preliminary otions 1109 | xopts = $.extend({}, defaults, elopts, options), 1110 | locopts = opts_from_locale(xopts.language), 1111 | // Options priority: js args, data-attrs, locales, defaults 1112 | opts = $.extend({}, defaults, locopts, elopts, options); 1113 | if ($this.is('.input-daterange') || opts.inputs){ 1114 | var ropts = { 1115 | inputs: opts.inputs || $this.find('input').toArray() 1116 | }; 1117 | $this.data('datepicker', (data = new DateRangePicker(this, $.extend(opts, ropts)))); 1118 | } 1119 | else{ 1120 | $this.data('datepicker', (data = new Datepicker(this, opts))); 1121 | } 1122 | } 1123 | if (typeof option == 'string' && typeof data[option] == 'function') { 1124 | internal_return = data[option].apply(data, args); 1125 | if (internal_return !== undefined) 1126 | return false; 1127 | } 1128 | }); 1129 | if (internal_return !== undefined) 1130 | return internal_return; 1131 | else 1132 | return this; 1133 | }; 1134 | 1135 | var defaults = $.fn.datepicker.defaults = { 1136 | autoclose: false, 1137 | beforeShowDay: $.noop, 1138 | calendarWeeks: false, 1139 | clearBtn: false, 1140 | daysOfWeekDisabled: [], 1141 | endDate: Infinity, 1142 | forceParse: true, 1143 | format: 'mm/dd/yyyy', 1144 | keyboardNavigation: true, 1145 | language: 'en', 1146 | minViewMode: 0, 1147 | orientation: "auto", 1148 | rtl: false, 1149 | startDate: -Infinity, 1150 | startView: 0, 1151 | todayBtn: false, 1152 | todayHighlight: false, 1153 | weekStart: 0 1154 | }; 1155 | var locale_opts = $.fn.datepicker.locale_opts = [ 1156 | 'format', 1157 | 'rtl', 1158 | 'weekStart' 1159 | ]; 1160 | $.fn.datepicker.Constructor = Datepicker; 1161 | var dates = $.fn.datepicker.dates = { 1162 | en: { 1163 | days: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], 1164 | daysShort: ["日", "一", "二", "三", "四", "五", "六", "日"], 1165 | daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], 1166 | months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 1167 | monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], 1168 | today: "今日", 1169 | clear: "清除" 1170 | } 1171 | }; 1172 | 1173 | var DPGlobal = { 1174 | modes: [ 1175 | { 1176 | clsName: 'days', 1177 | navFnc: 'Month', 1178 | navStep: 1 1179 | }, 1180 | { 1181 | clsName: 'months', 1182 | navFnc: 'FullYear', 1183 | navStep: 1 1184 | }, 1185 | { 1186 | clsName: 'years', 1187 | navFnc: 'FullYear', 1188 | navStep: 10 1189 | }], 1190 | isLeapYear: function (year) { 1191 | return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); 1192 | }, 1193 | getDaysInMonth: function (year, month) { 1194 | return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; 1195 | }, 1196 | validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, 1197 | nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, 1198 | parseFormat: function(format){ 1199 | // IE treats \0 as a string end in inputs (truncating the value), 1200 | // so it's a bad format delimiter, anyway 1201 | var separators = format.replace(this.validParts, '\0').split('\0'), 1202 | parts = format.match(this.validParts); 1203 | if (!separators || !separators.length || !parts || parts.length === 0){ 1204 | throw new Error("Invalid date format."); 1205 | } 1206 | return {separators: separators, parts: parts}; 1207 | }, 1208 | parseDate: function(date, format, language) { 1209 | if (date instanceof Date) return date; 1210 | if (typeof format === 'string') 1211 | format = DPGlobal.parseFormat(format); 1212 | if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) { 1213 | var part_re = /([\-+]\d+)([dmwy])/, 1214 | parts = date.match(/([\-+]\d+)([dmwy])/g), 1215 | part, dir; 1216 | date = new Date(); 1217 | for (var i=0; i'+ 1332 | ''+ 1333 | '«'+ 1334 | ''+ 1335 | '»'+ 1336 | ''+ 1337 | '', 1338 | contTemplate: '', 1339 | footTemplate: '' 1340 | }; 1341 | DPGlobal.template = '
'+ 1342 | '
'+ 1343 | ''+ 1344 | DPGlobal.headTemplate+ 1345 | ''+ 1346 | DPGlobal.footTemplate+ 1347 | '
'+ 1348 | '
'+ 1349 | '
'+ 1350 | ''+ 1351 | DPGlobal.headTemplate+ 1352 | DPGlobal.contTemplate+ 1353 | DPGlobal.footTemplate+ 1354 | '
'+ 1355 | '
'+ 1356 | '
'+ 1357 | ''+ 1358 | DPGlobal.headTemplate+ 1359 | DPGlobal.contTemplate+ 1360 | DPGlobal.footTemplate+ 1361 | '
'+ 1362 | '
'+ 1363 | '
'; 1364 | 1365 | $.fn.datepicker.DPGlobal = DPGlobal; 1366 | 1367 | 1368 | /* DATEPICKER NO CONFLICT 1369 | * =================== */ 1370 | 1371 | $.fn.datepicker.noConflict = function(){ 1372 | $.fn.datepicker = old; 1373 | return this; 1374 | }; 1375 | 1376 | 1377 | /* DATEPICKER DATA-API 1378 | * ================== */ 1379 | 1380 | $(document).on( 1381 | 'focus.datepicker.data-api click.datepicker.data-api', 1382 | '[data-provide="datepicker"]', 1383 | function(e){ 1384 | var $this = $(this); 1385 | if ($this.data('datepicker')) return; 1386 | e.preventDefault(); 1387 | // component click requires us to explicitly show it 1388 | $this.datepicker('show'); 1389 | } 1390 | ); 1391 | $(function(){ 1392 | $('[data-provide="datepicker-inline"]').datepicker(); 1393 | }); 1394 | 1395 | }( window.jQuery )); 1396 | -------------------------------------------------------------------------------- /static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.6 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /static/js/extensions/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/haydengao/quant/b9029424f6f788430c28dbafd77a513b1aaffbc1/static/js/extensions/.DS_Store -------------------------------------------------------------------------------- /static/js/extensions/MathMenu.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/extensions/MathMenu.js 3 | * 4 | * Copyright (c) 2009-2015 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(f,n,p,e,q){var o="2.6.0";var d=MathJax.Callback.Signal("menu");MathJax.Extension.MathMenu={version:o,signal:d};var s=function(t){return MathJax.Localization._.apply(MathJax.Localization,[["MathMenu",t]].concat([].slice.call(arguments,1)))};var a=f.Browser.isPC,k=f.Browser.isMSIE,l=((document.documentMode||0)>8);var i=(a?null:"5px");var r=f.CombineConfig("MathMenu",{delay:150,showRenderer:true,showMathPlayer:true,showFontMenu:false,showContext:false,showDiscoverable:false,showLocale:true,showLocaleURL:false,semanticsAnnotations:{TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]},windowSettings:{status:"no",toolbar:"no",locationbar:"no",menubar:"no",directories:"no",personalbar:"no",resizable:"yes",scrollbars:"yes",width:400,height:300,left:Math.round((screen.width-400)/2),top:Math.round((screen.height-300)/3)},styles:{"#MathJax_About":{position:"fixed",left:"50%",width:"auto","text-align":"center",border:"3px outset",padding:"1em 2em","background-color":"#DDDDDD",color:"black",cursor:"default","font-family":"message-box","font-size":"120%","font-style":"normal","text-indent":0,"text-transform":"none","line-height":"normal","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal","white-space":"nowrap","float":"none","z-index":201,"border-radius":"15px","-webkit-border-radius":"15px","-moz-border-radius":"15px","-khtml-border-radius":"15px","box-shadow":"0px 10px 20px #808080","-webkit-box-shadow":"0px 10px 20px #808080","-moz-box-shadow":"0px 10px 20px #808080","-khtml-box-shadow":"0px 10px 20px #808080",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')"},"#MathJax_About.MathJax_MousePost":{outline:"none"},".MathJax_Menu":{position:"absolute","background-color":"white",color:"black",width:"auto",padding:(a?"2px":"5px 0px"),border:"1px solid #CCCCCC",margin:0,cursor:"default",font:"menu","text-align":"left","text-indent":0,"text-transform":"none","line-height":"normal","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal","white-space":"nowrap","float":"none","z-index":201,"border-radius":i,"-webkit-border-radius":i,"-moz-border-radius":i,"-khtml-border-radius":i,"box-shadow":"0px 10px 20px #808080","-webkit-box-shadow":"0px 10px 20px #808080","-moz-box-shadow":"0px 10px 20px #808080","-khtml-box-shadow":"0px 10px 20px #808080",filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')"},".MathJax_MenuItem":{padding:(a?"2px 2em":"1px 2em"),background:"transparent"},".MathJax_MenuArrow":{position:"absolute",right:".5em","padding-top":".25em",color:"#666666","font-family":(k?"'Arial unicode MS'":null),"font-size":".75em"},".MathJax_MenuActive .MathJax_MenuArrow":{color:"white"},".MathJax_MenuArrow.RTL":{left:".5em",right:"auto"},".MathJax_MenuCheck":{position:"absolute",left:".7em","font-family":(k?"'Arial unicode MS'":null)},".MathJax_MenuCheck.RTL":{right:".7em",left:"auto"},".MathJax_MenuRadioCheck":{position:"absolute",left:(a?"1em":".7em")},".MathJax_MenuRadioCheck.RTL":{right:(a?"1em":".7em"),left:"auto"},".MathJax_MenuLabel":{padding:(a?"2px 2em 4px 1.33em":"1px 2em 3px 1.33em"),"font-style":"italic"},".MathJax_MenuRule":{"border-top":(a?"1px solid #CCCCCC":"1px solid #DDDDDD"),margin:(a?"4px 1px 0px":"4px 3px")},".MathJax_MenuDisabled":{color:"GrayText"},".MathJax_MenuActive":{"background-color":(a?"Highlight":"#606872"),color:(a?"HighlightText":"white")},".MathJax_MenuDisabled:focus, .MathJax_MenuLabel:focus":{"background-color":"#E8E8E8"},".MathJax_ContextMenu:focus":{outline:"none"},".MathJax_ContextMenu .MathJax_MenuItem:focus":{outline:"none"},"#MathJax_AboutClose":{top:".2em",right:".2em"},".MathJax_Menu .MathJax_MenuClose":{top:"-10px",left:"-10px"},".MathJax_MenuClose":{position:"absolute",cursor:"pointer",display:"inline-block",border:"2px solid #AAA","border-radius":"18px","-webkit-border-radius":"18px","-moz-border-radius":"18px","-khtml-border-radius":"18px","font-family":"'Courier New',Courier","font-size":"24px",color:"#F0F0F0"},".MathJax_MenuClose span":{display:"block","background-color":"#AAA",border:"1.5px solid","border-radius":"18px","-webkit-border-radius":"18px","-moz-border-radius":"18px","-khtml-border-radius":"18px","line-height":0,padding:"8px 0 6px"},".MathJax_MenuClose:hover":{color:"white!important",border:"2px solid #CCC!important"},".MathJax_MenuClose:hover span":{"background-color":"#CCC!important"},".MathJax_MenuClose:hover:focus":{outline:"none"}}});var m,j,b;f.Register.StartupHook("MathEvents Ready",function(){m=MathJax.Extension.MathEvents.Event.False;j=MathJax.Extension.MathEvents.Hover;b=MathJax.Extension.MathEvents.Event.KEY});var h=MathJax.Object.Subclass({Keydown:function(t,u){switch(t.keyCode){case b.ESCAPE:this.Remove(t,u);break;case b.RIGHT:this.Right(t,u);break;case b.LEFT:this.Left(t,u);break;case b.UP:this.Up(t,u);break;case b.DOWN:this.Down(t,u);break;case b.RETURN:case b.SPACE:this.Space(t,u);break;default:return;break}return m(t)},Escape:function(t,u){},Right:function(t,u){},Left:function(t,u){},Up:function(t,u){},Down:function(t,u){},Space:function(t,u){}},{});var g=MathJax.Menu=h.Subclass({version:o,items:[],posted:false,title:null,margin:5,Init:function(t){this.items=[].slice.call(arguments,0)},With:function(t){if(t){f.Insert(this,t)}return this},Post:function(u,I,G){if(!u){u=window.event||{}}var t=document.getElementById("MathJax_MenuFrame");if(!t){t=g.Background(this);delete c.lastItem;delete c.lastMenu;delete g.skipUp;d.Post(["post",g.jax]);g.isRTL=(MathJax.Localization.fontDirection()==="rtl")}var v=n.Element("div",{onmouseup:g.Mouseup,ondblclick:m,ondragstart:m,onselectstart:m,oncontextmenu:m,menuItem:this,className:"MathJax_Menu",onkeydown:g.Keydown,role:"menu"});if(u.type==="contextmenu"||u.type==="mouseover"){v.className+=" MathJax_ContextMenu"}if(!G){MathJax.Localization.setCSS(v)}for(var B=0,z=this.items.length;Bdocument.body.offsetWidth-this.margin){H=document.body.offsetWidth-v.offsetWidth-this.margin}if(g.isMobile){H=Math.max(5,H-Math.floor(v.offsetWidth/2));F-=20}g.skipUp=u.isContextMenu}else{var D="left",L=I.offsetWidth;H=(g.isMobile?30:L-2);F=0;while(I&&I!==t){H+=I.offsetLeft;F+=I.offsetTop;I=I.parentNode}if(!g.isMobile){if((g.isRTL&&H-L-v.offsetWidth>this.margin)||(!g.isRTL&&H+v.offsetWidth>document.body.offsetWidth-this.margin)){D="right";H=Math.max(this.margin,H-L-v.offsetWidth+6)}}if(!a){v.style["borderRadiusTop"+D]=0;v.style["WebkitBorderRadiusTop"+D]=0;v.style["MozBorderRadiusTop"+D]=0;v.style["KhtmlBorderRadiusTop"+D]=0}}v.style.left=H+"px";v.style.top=F+"px";if(document.selection&&document.selection.empty){document.selection.empty()}var K=window.pageXOffset||document.documentElement.scrollLeft;var J=window.pageYOffset||document.documentElement.scrollTop;g.Focus(v);if(u.type==="keydown"){g.skipMouseoverFromKey=true;setTimeout(function(){delete g.skipMouseoverFromKey},r.delay)}window.scrollTo(K,J);return m(u)},Remove:function(t,u){d.Post(["unpost",g.jax]);var v=document.getElementById("MathJax_MenuFrame");if(v){v.parentNode.removeChild(v);if(this.msieFixedPositionBug){detachEvent("onresize",g.Resize)}}if(g.jax.hover){delete g.jax.hover.nofade;j.UnHover(g.jax)}g.Unfocus(u);if(t.type==="mousedown"){g.CurrentNode().blur()}return m(t)},Find:function(t){return this.FindN(1,t,[].slice.call(arguments,1))},FindId:function(t){return this.FindN(0,t,[].slice.call(arguments,1))},FindN:function(x,u,w){for(var v=0,t=this.items.length;v=0&&c.GetMenuNode(v).menuItem!==u[t].menuItem){u[t].menuItem.posted=false;u[t].parentNode.removeChild(u[t]);t--}},Touchstart:function(t,u){return this.TouchEvent(t,u,"Mousedown")},Touchend:function(t,u){return this.TouchEvent(t,u,"Mouseup")},TouchEvent:function(u,v,t){if(this!==c.lastItem){if(c.lastMenu){g.Event(u,c.lastMenu,"Mouseout")}g.Event(u,v,"Mouseover",true);c.lastItem=this;c.lastMenu=v}if(this.nativeTouch){return null}g.Event(u,v,t);return false},Remove:function(t,u){u=u.parentNode.menuItem;return u.Remove(t,u)},With:function(t){if(t){f.Insert(this,t)}return this},isRTL:function(){return g.isRTL},rtlClass:function(){return(this.isRTL()?" RTL":"")}},{GetMenuNode:function(t){return t.parentNode}});g.ENTRY=g.ITEM.Subclass({role:"menuitem",Attributes:function(t){t=f.Insert({onmouseover:g.Mouseover,onmouseout:g.Mouseout,onmousedown:g.Mousedown,onkeydown:g.Keydown,"aria-disabled":!!this.disabled},t);t=this.SUPER(arguments).Attributes.call(this,t);if(this.disabled){t.className+=" MathJax_MenuDisabled"}return t},MoveVertical:function(t,D,v){var w=c.GetMenuNode(D);var C=[];for(var y=0,B=w.menuItem.items,x;x=B[y];y++){if(!x.hidden){C.push(x)}}var A=g.IndexOf(C,this);if(A===-1){return}var z=C.length;var u=w.childNodes;do{A=g.Mod(v(A),z)}while(C[A].hidden||!u[A].role||u[A].role==="separator");this.Deactivate(D);C[A].Activate(t,u[A])},Up:function(u,t){this.MoveVertical(u,t,function(v){return v-1})},Down:function(u,t){this.MoveVertical(u,t,function(v){return v+1})},Right:function(u,t){this.MoveHorizontal(u,t,g.Right,!this.isRTL())},Left:function(u,t){this.MoveHorizontal(u,t,g.Left,this.isRTL())},MoveHorizontal:function(z,y,t,A){var w=c.GetMenuNode(y);if(w.menuItem===g.menu&&z.shiftKey){t(z,y)}if(A){return}if(w.menuItem!==g.menu){this.Deactivate(y)}var u=w.previousSibling.childNodes;var x=u.length;while(x--){var v=u[x];if(v.menuItem.submenu&&v.menuItem.submenu===w.menuItem){g.Focus(v);break}}this.RemoveSubmenus(y)},Space:function(t,u){this.Mouseup(t,u)},Activate:function(t,u){this.Deactivate(u);if(!this.disabled){u.className+=" MathJax_MenuActive"}this.DeactivateSubmenus(u);g.Focus(u)},Deactivate:function(t){t.className=t.className.replace(/ MathJax_MenuActive/,"")}});g.ITEM.COMMAND=g.ENTRY.Subclass({action:function(){},Init:function(t,v,u){if(!(t instanceof Array)){t=[t,t]}this.name=t;this.action=v;this.With(u)},Label:function(t,u){return[this.Name()]},Mouseup:function(t,u){if(!this.disabled){this.Remove(t,u);d.Post(["command",this]);this.action.call(this,t)}return m(t)}});g.ITEM.SUBMENU=g.ENTRY.Subclass({submenu:null,marker:"\u25BA",markerRTL:"\u25C4",Attributes:function(t){t=f.Insert({"aria-haspopup":"true"},t);t=this.SUPER(arguments).Attributes.call(this,t);return t},Init:function(t,v){if(!(t instanceof Array)){t=[t,t]}this.name=t;var u=1;if(!(v instanceof g.ITEM)){this.With(v),u++}this.submenu=g.apply(g,[].slice.call(arguments,u))},Label:function(t,u){this.submenu.posted=false;return[this.Name()+" ",["span",{className:"MathJax_MenuArrow"+this.rtlClass()},[this.isRTL()?this.markerRTL:this.marker]]]},Timer:function(t,u){this.ClearTimer();t={type:t.type,clientX:t.clientX,clientY:t.clientY};this.timer=setTimeout(e(["Mouseup",this,t,u]),r.delay)},ClearTimer:function(){if(this.timer){clearTimeout(this.timer)}},Touchend:function(u,w){var v=this.submenu.posted;var t=this.SUPER(arguments).Touchend.apply(this,arguments);if(v){this.Deactivate(w);delete c.lastItem;delete c.lastMenu}return t},Mouseout:function(t,u){if(!this.submenu.posted){this.Deactivate(u)}this.ClearTimer()},Mouseover:function(t,u){this.Activate(t,u)},Mouseup:function(t,u){if(!this.disabled){if(!this.submenu.posted){this.ClearTimer();this.submenu.Post(t,u,this.ltr);g.Focus(u)}else{this.DeactivateSubmenus(u)}}return m(t)},Activate:function(t,u){if(!this.disabled){this.Deactivate(u);u.className+=" MathJax_MenuActive"}if(!this.submenu.posted){this.DeactivateSubmenus(u);if(!g.isMobile){this.Timer(t,u)}}g.Focus(u)},MoveVertical:function(v,u,t){this.ClearTimer();this.SUPER(arguments).MoveVertical.apply(this,arguments)},MoveHorizontal:function(v,x,u,w){if(!w){this.SUPER(arguments).MoveHorizontal.apply(this,arguments);return}if(this.disabled){return}if(!this.submenu.posted){this.Activate(v,x);return}var t=c.GetMenuNode(x).nextSibling.childNodes;if(t.length>0){this.submenu.items[0].Activate(v,t[0])}}});g.ITEM.RADIO=g.ENTRY.Subclass({variable:null,marker:(a?"\u25CF":"\u2713"),role:"menuitemradio",Attributes:function(u){var t=r.settings[this.variable]===this.value?"true":"false";u=f.Insert({"aria-checked":t},u);u=this.SUPER(arguments).Attributes.call(this,u);return u},Init:function(u,t,v){if(!(u instanceof Array)){u=[u,u]}this.name=u;this.variable=t;this.With(v);if(this.value==null){this.value=this.name[0]}},Label:function(u,v){var t={className:"MathJax_MenuRadioCheck"+this.rtlClass()};if(r.settings[this.variable]!==this.value){t={style:{display:"none"}}}return[["span",t,[this.marker]]," "+this.Name()]},Mouseup:function(w,x){if(!this.disabled){var y=x.parentNode.childNodes;for(var u=0,t=y.length;u/g,">");var x=s("EqSource","MathJax Equation Source");if(g.isMobile){t.document.open();t.document.write(""+x+"");t.document.write("
"+y+"
");t.document.write("
");t.document.write("");t.document.close()}else{t.document.open();t.document.write(""+x+"");t.document.write("
"+y+"
");t.document.write("");t.document.close();var u=t.document.body.firstChild;setTimeout(function(){var A=(t.outerHeight-t.innerHeight)||30,z=(t.outerWidth-t.innerWidth)||30,w,D;z=Math.max(140,Math.min(Math.floor(0.5*screen.width),u.offsetWidth+z+25));A=Math.max(40,Math.min(Math.floor(0.5*screen.height),u.offsetHeight+A+25));if(g.prototype.msieHeightBug){A+=35}t.resizeTo(z,A);var C;try{C=v.screenX}catch(B){}if(v&&C!=null){w=Math.max(0,Math.min(v.screenX-Math.floor(z/2),screen.width-z-20));D=Math.max(0,Math.min(v.screenY-Math.floor(A/2),screen.height-A-20));t.moveTo(w,D)}},50)}};g.Scale=function(){var y=["CommonHTML","HTML-CSS","SVG","NativeMML","PreviewHTML"],t=y.length,x=100,v,u;for(v=0;v7;g.Augment({margin:20,msieBackgroundBug:((document.documentMode||0)<9),msieFixedPositionBug:(u||!v),msieAboutBug:u,msieHeightBug:((document.documentMode||0)<9)});if(l){delete r.styles["#MathJax_About"].filter;delete r.styles[".MathJax_Menu"].filter}},Firefox:function(t){g.skipMouseover=t.isMobile&&t.versionAtLeast("6.0");g.skipMousedown=t.isMobile}});g.isMobile=f.Browser.isMobile;g.noContextMenu=f.Browser.noContextMenu;g.CreateLocaleMenu=function(){if(!g.menu){return}var y=g.menu.Find("Language").submenu,v=y.items;var u=[],A=MathJax.Localization.strings;for(var z in A){if(A.hasOwnProperty(z)){u.push(z)}}u=u.sort();y.items=[];for(var w=0,t=u.length;wt){z.style.height=t+"px";z.style.width=(x.zW+this.scrollSize)+"px"}if(z.offsetWidth>l){z.style.width=l+"px";z.style.height=(x.zH+this.scrollSize)+"px"}}if(this.operaPositionBug){z.style.width=Math.min(l,x.zW)+"px"}if(z.offsetWidth>m&&z.offsetWidth-m=9);h.msiePositionBug=!m;h.msieSizeBug=l.versionAtLeast("7.0")&&(!document.documentMode||n===7||n===8);h.msieZIndexBug=(n<=7);h.msieInlineBlockAlignBug=(n<=7);h.msieTrapEventBug=!window.addEventListener;if(document.compatMode==="BackCompat"){h.scrollSize=52}if(m){delete i.styles["#MathJax_Zoom"].filter}},Opera:function(l){h.operaPositionBug=true;h.operaRefreshBug=true}});h.topImg=(h.msieInlineBlockAlignBug?d.Element("img",{style:{width:0,height:0,position:"relative"},src:"about:blank"}):d.Element("span",{style:{width:0,height:0,display:"inline-block"}}));if(h.operaPositionBug||h.msieTopBug){h.topImg.style.border="1px solid"}MathJax.Callback.Queue(["StartupHook",MathJax.Hub.Register,"Begin Styles",{}],["Styles",f,i.styles],["Post",a.Startup.signal,"MathZoom Ready"],["loadComplete",f,"[MathJax]/extensions/MathZoom.js"])})(MathJax.Hub,MathJax.HTML,MathJax.Ajax,MathJax.OutputJax["HTML-CSS"],MathJax.OutputJax.NativeMML); 20 | -------------------------------------------------------------------------------- /static/js/sorttable.js: -------------------------------------------------------------------------------- 1 | (function(){'use strict'; 2 | /*jshint -W069, bitwise: false*/ 3 | /* 4 | SortTable 5 | version 2e3 (enhanced) 6 | 7th April 2007 (17th April 2015) 7 | https://github.com/White-Tiger/sorttable.js 8 | 9 | Instructions: 10 | Download this file 11 | Add to your HTML 12 | Add class="sortable" to any table you'd like to make sortable 13 | Click on the headers to sort 14 | 15 | Thanks to many, many people for contributions and suggestions. 16 | Licenced as X11: http://www.kryogenix.org/code/browser/licence.html 17 | This basically means: do what you want with it. 18 | */ 19 | var sorttable = { 20 | RE_NUMERIC: /^[+\-£$¤¥]{0,2}\s*(?:\d+(?:([ ',\.])(?:\d{3}([ ',\.]))*(\d*))?|([,\.])\d+)\s*[€₽%]?$/, 21 | RE_DATE: /^(\d\d?)[\/\.\-](\d\d?)[\/\.\-](\d{4})$/, 22 | CLASS_SORT: ['sorttable_sorted','sorttable_sorted_reverse'], 23 | CLASS_ARROW: ['sorttable_sortfwdind','sorttable_sortrevind'], 24 | ARROWS: /MSIE [5-8]\.\d/.test(navigator.userAgent) ? [' 5',' 6'] : [' ▴',' ▾'], 25 | _isi: false, 26 | _timer: null, 27 | init: function() { 28 | // quit if this function has already been called 29 | if (sorttable._isi) return; 30 | sorttable._isi = true; 31 | // kill the init timer for Safari 32 | if (sorttable._timer) clearInterval(sorttable._timer); 33 | 34 | if (!document.createElement || !document.getElementsByTagName) return; 35 | 36 | var tables = document.getElementsByTagName('table'); 37 | for (var i=0,ie=tables.length; i 12) { 131 | guess&=~DATE_MMDD; 132 | } else if (mtch[2]<<0 > 12) { 133 | guess&=~DATE_DDMM; 134 | } 135 | } else { 136 | guess&=~DATE; 137 | } 138 | } else { 139 | guess = 0; 140 | } 141 | } 142 | } 143 | } 144 | switch(guess){ 145 | case NUMERIC_COMMA: 146 | return sorttable.sort_numeric_comma; 147 | case NUMERIC_POINT: 148 | case NUMERIC: 149 | return sorttable.sort_numeric; 150 | case DATE_MMDD: 151 | return sorttable.sort_mmdd; 152 | case DATE_DDMM: 153 | case DATE: 154 | return sorttable.sort_ddmm; 155 | } 156 | return sorttable.sort_alpha; // fallback as we couldn't decide 157 | }, 158 | 159 | getInnerText: function(node) { 160 | // gets the text we want to use for sorting for a cell. 161 | // strips leading and trailing whitespace. 162 | // this is *not* a generic getInnerText function; it's special to sorttable. 163 | // for example, you can override the cell text with a customkey attribute. 164 | // it also gets .value for fields. 165 | 166 | var attrib=node.getAttribute('data-st-key'); 167 | if (attrib) 168 | return attrib; 169 | 170 | var hasInputs = (typeof node.getElementsByTagName == 'function') && 171 | node.getElementsByTagName('input').length; 172 | if (!hasInputs){ 173 | if (typeof node.textContent != 'undefined') 174 | return node.textContent.replace(/^\s+|\s+$/g, ''); 175 | if (typeof node.innerText != 'undefined') 176 | return node.innerText.replace(/^\s+|\s+$/g, ''); 177 | if (typeof node.text != 'undefined') 178 | return node.text.replace(/^\s+|\s+$/g, ''); 179 | } 180 | switch (node.nodeType) { 181 | case 3: // TEXT_NODE 182 | if (node.nodeName.toLowerCase() == 'input') 183 | return node.value.replace(/^\s+|\s+$/g, ''); 184 | /* falls through */ 185 | case 4: // CDATA_SECTION_NODE 186 | return node.nodeValue.replace(/^\s+|\s+$/g, ''); 187 | case 1: // ELEMENT_NODE 188 | case 11: // DOCUMENT_FRAGMENT_NODE 189 | var innerText = ''; 190 | var nodes = node.childNodes.length; 191 | for (var i = 0; i < nodes; ++i) { 192 | innerText += sorttable.getInnerText(node.childNodes[i]); 193 | } 194 | return innerText.replace(/^\s+|\s+$/g, ''); 195 | } 196 | return ''; 197 | }, 198 | 199 | reverseSort: function(table) { 200 | // reverse the rows in a table 201 | var tb,tb2,rows; 202 | var len = [], remain = []; 203 | for (tb=0,tb2=table.tBodies.length; tb 0) { 310 | tmp = list[i]; 311 | list[i] = list[i+1]; 312 | list[i+1] = tmp; 313 | swap = true; 314 | } 315 | } // for 316 | --end; 317 | 318 | if (!swap) break; 319 | 320 | for(i=end; i>start; --i) { 321 | if(comp_func(list[i], list[i-1]) < 0) { 322 | tmp = list[i]; 323 | list[i] = list[i-1]; 324 | list[i-1] = tmp; 325 | swap = true; 326 | } 327 | } // for 328 | ++start; 329 | 330 | }while(swap); 331 | }, 332 | 333 | /* sort functions 334 | each sort function takes two parameters, a and b 335 | you are comparing a[0] and b[0] */ 336 | sort_numeric: function(a,b) { 337 | var aa = parseFloat(a[0].replace(/[^\-\d.]/g,'')) || 0; 338 | var bb = parseFloat(b[0].replace(/[^\-\d.]/g,'')) || 0; 339 | return aa - bb; 340 | }, 341 | sort_numeric_comma: function(a,b) { 342 | var aa = parseFloat(a[0].replace(/[^\-\d,]/g,'').replace(/,/,'.')) || 0; 343 | var bb = parseFloat(b[0].replace(/[^\-\d,]/g,'').replace(/,/,'.')) || 0; 344 | return aa - bb; 345 | }, 346 | sort_alpha: function(a,b) { 347 | if (a[0] == b[0]) return 0; 348 | if (a[0] < b[0]) return -1; 349 | return 1; 350 | }, 351 | dateToNumber: function(d,m,y){ 352 | return d | m<<5 | y<<9; 353 | }, 354 | sort_ddmm: function(a,b) { 355 | var mtch = sorttable.RE_DATE.exec(a[0]); 356 | var aa = sorttable.dateToNumber(mtch[1],mtch[2],mtch[3]); 357 | mtch = sorttable.RE_DATE.exec(b[0]); 358 | return aa - sorttable.dateToNumber(mtch[1],mtch[2],mtch[3]); 359 | }, 360 | sort_mmdd: function(a,b) { 361 | var mtch = sorttable.RE_DATE.exec(a[0]); 362 | var aa = sorttable.dateToNumber(mtch[2],mtch[1],mtch[3]); 363 | mtch = sorttable.RE_DATE.exec(b[0]); 364 | return aa - sorttable.dateToNumber(mtch[2],mtch[1],mtch[3]); 365 | } 366 | }; 367 | 368 | /* sorttable initialization */ 369 | if (document.addEventListener) { // modern browser 370 | document.addEventListener("DOMContentLoaded", sorttable.init, false); 371 | } else if (/MSIE [5-8]\.\d/.test(navigator.userAgent)){ // for Internet Explorer 372 | document.write(" 11 | 12 | 18 | 19 | 20 | 21 | 22 | 23 |
24 |
25 |
26 |
27 |
28 |

29 | 交易策略 30 |
31 |
32 | 85 |
86 |
87 |

88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | {% for i in strategies %} 102 | 103 | 104 | 105 | 106 | {% if i.daily > 0 %} 107 | 108 | {% else %} 109 | 110 | {% endif %} 111 | 112 | {% if i.profit > 0 %} 113 | 114 | {% else %} 115 | 116 | {% endif %} 117 | 118 | 119 | 120 | 121 | {% endfor %} 122 | 123 | 124 |
名称状态当日收益率累计收益率开始日期停止日期
{{i.name}}{{i.status}}{{i.daily}}%{{i.daily}}%{{i.profit}}%{{i.profit}}%{{i.start}}{{i.end}}
125 |
-------------------------------------------------------------------------------- /templates/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    {{survey|length}}
11 | 12 | 13 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | #encoding:utf-8 2 | from flask import (Flask, render_template, request, jsonify) 3 | import myapp as ma 4 | 5 | app = Flask(__name__) 6 | 7 | @app.route('/') 8 | def index(): 9 | sttg_id = 1 10 | 11 | survey_ = ma.Survey.query.filter_by(strategy_id=sttg_id).all() 12 | survey = list(range(len(survey_))) 13 | 14 | for i in range(len(survey_)): 15 | survey[i] = {'date':survey_[i].date.strftime('%s')+'000','daily':survey_[i].daily,'profit':survey_[i].profit,'sharp':survey_[i].sharp,'marketValue':survey_[i].marketValue,'enable':survey_[i].enable,'benchmark':ma.Benchmark.query.filter_by(date=survey_[i].date).first().index,'pullback':survey_[i].pullback,'alpha':survey_[i].alpha,'beta':survey_[i].beta,'information':survey_[i].information,'fluctuation':survey_[i].fluctuation} 16 | 17 | return render_template('test.html',survey=survey) 18 | --------------------------------------------------------------------------------