├── tests ├── __init__.py ├── test_form.py └── test_model.py ├── v2de ├── static │ ├── js │ │ ├── base.js │ │ └── jquery-3.2.1.min.js │ ├── img │ │ ├── air.png │ │ ├── rss.png │ │ ├── 程序员.jpg │ │ ├── reply.png │ │ ├── do_logo.png │ │ ├── node │ │ │ ├── MBP.jpg │ │ │ ├── 云计算.jpg │ │ │ ├── 剧集.jpg │ │ │ ├── 旅游.jpg │ │ │ ├── 求职.jpg │ │ │ ├── 电影.jpg │ │ │ ├── 程序员.jpg │ │ │ ├── 设计.jpg │ │ │ ├── 酷工作.jpg │ │ │ ├── 音乐.jpg │ │ │ ├── Apple.jpg │ │ │ ├── Linux.jpg │ │ │ ├── WATCH.jpg │ │ │ ├── iDev.jpg │ │ │ ├── iMac.jpg │ │ │ ├── iPad.jpg │ │ │ ├── macOS.jpg │ │ │ ├── 分享创造.jpg │ │ │ ├── 分享发现.jpg │ │ │ ├── 午夜俱乐部.jpg │ │ │ ├── 奇思妙想.jpg │ │ │ ├── 宽带症候群.jpg │ │ │ ├── 电子游戏.jpg │ │ │ ├── 职场话题.jpg │ │ │ ├── Android.jpg │ │ │ ├── Python.jpg │ │ │ ├── iPhone.jpg │ │ │ └── node.js.jpg │ │ ├── v2ex@2x.png │ │ ├── 90_xxlarge.png │ │ ├── bronze@2x.png │ │ ├── silver@2x.png │ │ ├── flat_compose.png │ │ ├── lang_zhcn_32.png │ │ ├── qbar_light@2x.png │ │ └── shadow_light.png │ └── css │ │ ├── base.css │ │ └── markdown.css ├── main │ ├── __init__.py │ ├── forms.py │ └── views.py ├── templates │ ├── right_hot_post.html │ ├── star_node.html │ ├── user.html │ ├── collect_nodes.html │ ├── collect_posts.html │ ├── user_login.html │ ├── index.html │ ├── user_register.html │ ├── right_user_card.html │ ├── base.html │ ├── post.html │ ├── new_post.html │ └── node.html ├── __init__.py └── models.py ├── Screenshots ├── new.png ├── node.png ├── post.png ├── index.png ├── login.png └── register.png ├── .gitattributes ├── config.py ├── README.md ├── V2DE.py ├── .gitignore └── populate.py /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_form.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /v2de/static/js/base.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Screenshots/new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/Screenshots/new.png -------------------------------------------------------------------------------- /Screenshots/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/Screenshots/node.png -------------------------------------------------------------------------------- /Screenshots/post.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/Screenshots/post.png -------------------------------------------------------------------------------- /Screenshots/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/Screenshots/index.png -------------------------------------------------------------------------------- /Screenshots/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/Screenshots/login.png -------------------------------------------------------------------------------- /v2de/static/img/air.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/air.png -------------------------------------------------------------------------------- /v2de/static/img/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/rss.png -------------------------------------------------------------------------------- /v2de/static/img/程序员.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/程序员.jpg -------------------------------------------------------------------------------- /Screenshots/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/Screenshots/register.png -------------------------------------------------------------------------------- /v2de/static/img/reply.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/reply.png -------------------------------------------------------------------------------- /v2de/static/img/do_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/do_logo.png -------------------------------------------------------------------------------- /v2de/static/img/node/MBP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/MBP.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/云计算.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/云计算.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/剧集.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/剧集.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/旅游.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/旅游.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/求职.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/求职.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/电影.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/电影.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/程序员.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/程序员.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/设计.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/设计.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/酷工作.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/酷工作.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/音乐.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/音乐.jpg -------------------------------------------------------------------------------- /v2de/static/img/v2ex@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/v2ex@2x.png -------------------------------------------------------------------------------- /v2de/static/img/90_xxlarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/90_xxlarge.png -------------------------------------------------------------------------------- /v2de/static/img/bronze@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/bronze@2x.png -------------------------------------------------------------------------------- /v2de/static/img/node/Apple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/Apple.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/Linux.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/Linux.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/WATCH.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/WATCH.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/iDev.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/iDev.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/iMac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/iMac.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/iPad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/iPad.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/macOS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/macOS.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/分享创造.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/分享创造.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/分享发现.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/分享发现.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/午夜俱乐部.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/午夜俱乐部.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/奇思妙想.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/奇思妙想.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/宽带症候群.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/宽带症候群.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/电子游戏.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/电子游戏.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/职场话题.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/职场话题.jpg -------------------------------------------------------------------------------- /v2de/static/img/silver@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/silver@2x.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=python 2 | *.css linguist-language=python 3 | *.html linguist-language=python 4 | -------------------------------------------------------------------------------- /v2de/main/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import Blueprint 2 | 3 | main = Blueprint('main',__name__) 4 | 5 | from . import views -------------------------------------------------------------------------------- /v2de/static/img/flat_compose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/flat_compose.png -------------------------------------------------------------------------------- /v2de/static/img/lang_zhcn_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/lang_zhcn_32.png -------------------------------------------------------------------------------- /v2de/static/img/node/Android.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/Android.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/Python.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/Python.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/iPhone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/iPhone.jpg -------------------------------------------------------------------------------- /v2de/static/img/node/node.js.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/node/node.js.jpg -------------------------------------------------------------------------------- /v2de/static/img/qbar_light@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/qbar_light@2x.png -------------------------------------------------------------------------------- /v2de/static/img/shadow_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonzhoup/flask-v2ex/HEAD/v2de/static/img/shadow_light.png -------------------------------------------------------------------------------- /v2de/templates/right_hot_post.html: -------------------------------------------------------------------------------- 1 |
2 | 13 |
-------------------------------------------------------------------------------- /v2de/templates/star_node.html: -------------------------------------------------------------------------------- 1 |
2 | 17 |
-------------------------------------------------------------------------------- /v2de/templates/user.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block title %} 5 | —— {{ user.username }} 6 | {% endblock %} 7 | 8 | {% block left_main %} 9 |
10 |
11 |
12 |
13 | 14 |
15 |
16 |

{{ user.username }}

17 |

V2EX第{{ user.id }}号会员

18 |
19 |
20 |
21 |
22 | {% endblock %} 23 | 24 | {% block right_main %} 25 |
26 |
27 |

{{ user.username }}最近的时间轴更新

28 |
29 |
30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /v2de/templates/collect_nodes.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | › 我收藏的节点 5 | {% endblock %} 6 | 7 | {% block left_main %} 8 |
9 |
10 |

V2EX › 我收藏的节点

11 |
12 | 26 |
27 | {% endblock %} 28 | 29 | {% block right_main %} 30 | {% include 'right_user_card.html' %} 31 | {% endblock %} -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | import os 2 | basedir = os.path.abspath(os.path.dirname(__file__)) 3 | 4 | 5 | class Config: 6 | SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string' 7 | SQLALCHEMY_COMMIT_ON_TEARDOWN = True 8 | SQLALCHEMY_TRACK_MODIFICATIONS = True 9 | RECAPTCHA_USE_SSL = True 10 | 11 | @staticmethod 12 | def init_app(app): 13 | pass 14 | 15 | class DevelopmentConfig(Config): 16 | DEBUG = True 17 | SQLALCHEMY_DATABASE_URI = 'mysql://root:1234@localhost:3306/v2de' 18 | CACHE_TYPE = 'redis' 19 | CACHE_REDIS_HOST = '127.0.0.1' 20 | CACHE_REDIS_PORT = 6379 21 | CACHE_REDIS_DB = '' 22 | CACHE_REDIS_PASSWORD = '' 23 | # SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \ 24 | # 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite') 25 | 26 | class TestingConfig(Config): 27 | TESTING = True 28 | SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or \ 29 | 'sqlite:///' + os.path.join(basedir, 'data-test.sqlite') 30 | 31 | config = { 32 | 'development': DevelopmentConfig, 33 | 'testing': TestingConfig, 34 | } -------------------------------------------------------------------------------- /v2de/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from flask import Flask 3 | from flask_sqlalchemy import SQLAlchemy 4 | from flask_login import LoginManager 5 | from flask_bootstrap import Bootstrap 6 | from flask_pagedown import PageDown 7 | from flask_cache import Cache 8 | from config import config 9 | try: 10 | import pymysql 11 | pymysql.install_as_MySQLdb() 12 | except ImportError: 13 | pass 14 | 15 | basedir = os.path.abspath(os.path.dirname(__file__)) 16 | 17 | db = SQLAlchemy() 18 | login_manager = LoginManager() 19 | bootstrap = Bootstrap() 20 | pagedown = PageDown() 21 | cache = Cache() 22 | login_manager.session_protection = 'strong' 23 | login_manager.login_view = 'main.login' 24 | 25 | 26 | def create_app(config_name): 27 | app = Flask(__name__) 28 | app.config.from_object(config[config_name]) 29 | config[config_name].init_app(app) 30 | 31 | db.init_app(app) 32 | login_manager.init_app(app) 33 | bootstrap.init_app(app) 34 | pagedown.init_app(app) 35 | cache.init_app(app) 36 | 37 | 38 | from .main import main as main_blueprint 39 | app.register_blueprint(main_blueprint) 40 | 41 | 42 | return app -------------------------------------------------------------------------------- /v2de/main/forms.py: -------------------------------------------------------------------------------- 1 | from flask_wtf import FlaskForm 2 | from wtforms import StringField,PasswordField,BooleanField,SelectField,SubmitField,ValidationError 3 | from wtforms.validators import Email,Length,Regexp,EqualTo,DataRequired 4 | from ..models import User 5 | 6 | class RegisterForm(FlaskForm): 7 | username = StringField('用户名',validators=[DataRequired(),Length(1,64),Regexp('^[A-Za-z][A-Za-z0-9_.]*$', 0,'用户名只能由字母、数字、点和下划线组成')]) 8 | email = StringField('邮箱',validators=[DataRequired(message='邮箱未填写'),Length(1,64),Email()]) 9 | password = PasswordField('密码',validators=[DataRequired(message='密码未填写'),EqualTo('password2',message='密码不一致')]) 10 | password2 = PasswordField('重复密码') 11 | submit = SubmitField('提交') 12 | 13 | def validate_email(self,field): 14 | if User.query.filter_by(email=field.data).first(): 15 | raise ValidationError('此邮箱已被使用') 16 | 17 | def validate_username(self,filed): 18 | if User.query.filter_by(username=filed.data).first(): 19 | raise ValidationError('重复用户名') 20 | 21 | class LoginForm(FlaskForm): 22 | username = StringField('用户名',validators=[DataRequired('用户名未填写'),Length(1,64)]) 23 | password = PasswordField('密码',validators=[DataRequired('密码未填写')]) 24 | submit = SubmitField('登录') 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # V2EX 2 | 3 | 这是一个仿写[V2EX](https://www.v2ex.com/)的网站,使用python的flask框架编写. 4 | 5 | **** 6 | |Author|simonzhoup| 7 | |---|--- 8 | |E-mail|simonzhoup@gmail.com 9 | 10 | ## 特点 11 | 完全仿写[V2EX](https://www.v2ex.com/), 虽然不太熟悉前段语言, 但力求一致, 算是一个很好的学习机会. 12 | 13 | 后端使用 `Flask` 框架编写 14 | 15 | 有用到 `MySQL` `JavaScript` `CSS` `Bootstrap` `AJAX` 16 | 17 | 18 | ## 截图 19 | 20 | ### 主页 21 | ![](/Screenshots/index.png) 22 | ### 节点页 23 | ![](/Screenshots/node.png) 24 | ### 帖子&回复 25 | ![](/Screenshots/post.png) 26 | ### 编辑帖子 27 | ![](/Screenshots/new.png) 28 | ### 注册&登录 29 | ![](/Screenshots/register.png) 30 | ![](/Screenshots/login.png) 31 | 32 | 33 | ## 如何使用 34 | * 创建数据库 35 | ```python 36 | #项目使用Flask-Migrate扩展, 用来管理数据库 37 | #创建迁移仓库 38 | $ python V2DE.py db init 39 | 40 | #自动创建迁移脚本 41 | $ python V2DE.py db migrate -m "initial migration" 42 | 43 | * 更新数据库 44 | $ python V2DE.py db upgrade 45 | ``` 46 | 47 | * 填充数据 48 | ```python 49 | #进入shell环境 50 | $ python V2DE.py shell 51 | 52 | #导入数据填充脚本 53 | >>> import populate as p 54 | 55 | #填充主题 56 | >>> p.populate_tag() 57 | 'Done' 58 | #填充节点 59 | >>> p.populate_node() 60 | 'Done' 61 | #填充虚拟用户 62 | >>> p.populate_user() 63 | 'Done' 64 | #填充帖子 65 | >>> p.populate_post() 66 | 'Done' 67 | #帖子关联用户 68 | >>> p.user_post() 69 | 'Done' 70 | ``` 71 | > 其实这里的步骤不需要这么复杂,一个命令就能完成。 72 | 73 | 74 | ## 启动程序 75 | ```python 76 | $ python V2DE.py runserver 77 | ``` 78 | 79 | 80 | ## 访问 81 | 浏览器打开 http://127.0.0.1:5000 82 | 83 | -------------------------------------------------------------------------------- /V2DE.py: -------------------------------------------------------------------------------- 1 | from v2de import create_app,db 2 | from flask_script import Manager,Shell 3 | from flask_migrate import Migrate,MigrateCommand 4 | from v2de.models import Tag,User,Post,Node 5 | 6 | #!/usr/bin/env python 7 | import os 8 | COV = None 9 | if os.environ.get('FLASK_COVERAGE'): 10 | import coverage 11 | COV = coverage.coverage(branch=True, include='v2de/*') 12 | COV.start() 13 | 14 | app = create_app('development') 15 | 16 | manager = Manager(app) 17 | 18 | migrate = Migrate(app,db) 19 | 20 | 21 | 22 | # def make_shell_context(): 23 | # return dict(app=app, db=db, Tag=Tag, Node=Node) 24 | # manager.add_command("shell", Shell(make_context=make_shell_context)) 25 | 26 | manager.add_command('db',MigrateCommand) 27 | 28 | @manager.command 29 | def test(coverage=False): 30 | """Run the unit tests.""" 31 | if coverage and not os.environ.get('FLASK_COVERAGE'): 32 | import sys 33 | os.environ['FLASK_COVERAGE'] = '1' 34 | os.execvp(sys.executable, [sys.executable] + sys.argv) 35 | import unittest 36 | tests = unittest.TestLoader().discover('tests') 37 | unittest.TextTestRunner(verbosity=2).run(tests) 38 | if COV: 39 | COV.stop() 40 | COV.save() 41 | print('Coverage Summary:') 42 | COV.report() 43 | basedir = os.path.abspath(os.path.dirname(__file__)) 44 | covdir = os.path.join(basedir, 'tmp/coverage') 45 | COV.html_report(directory=covdir) 46 | print('HTML version: file://%s/index.html' % covdir) 47 | COV.erase() 48 | 49 | 50 | if __name__ == '__main__': 51 | manager.run() -------------------------------------------------------------------------------- /v2de/templates/collect_posts.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} 4 | › 我收藏的主题 5 | {% endblock %} 6 | 7 | {% block left_main %} 8 |
9 |
10 |

V2EX › 我收藏的主题

11 |
12 | 32 |
33 | {% endblock %} 34 | 35 | {% block right_main %} 36 | {% include 'right_user_card.html' %} 37 | {% endblock %} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *.cover 48 | .hypothesis/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | .static_storage/ 57 | .media/ 58 | local_settings.py 59 | 60 | # Flask stuff: 61 | instance/ 62 | .webassets-cache 63 | 64 | # Scrapy stuff: 65 | .scrapy 66 | 67 | # Sphinx documentation 68 | docs/_build/ 69 | 70 | # PyBuilder 71 | target/ 72 | 73 | # Jupyter Notebook 74 | .ipynb_checkpoints 75 | 76 | # pyenv 77 | .python-version 78 | 79 | # celery beat schedule file 80 | celerybeat-schedule 81 | 82 | # SageMath parsed files 83 | *.sage.py 84 | 85 | # Environments 86 | .env 87 | .venv 88 | env/ 89 | venv/ 90 | ENV/ 91 | env.bak/ 92 | venv.bak/ 93 | 94 | # Spyder project settings 95 | .spyderproject 96 | .spyproject 97 | 98 | # Rope project settings 99 | .ropeproject 100 | 101 | # mkdocs documentation 102 | /site 103 | 104 | # mypy 105 | .mypy_cache/ 106 | .idea/ 107 | 108 | *.sqlite 109 | migrations/ 110 | tmp/ -------------------------------------------------------------------------------- /tests/test_model.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from v2de.models import User,Tag,CollecTag 3 | from v2de import create_app, db 4 | from flask import current_app 5 | 6 | class UserModelTestCase(unittest.TestCase): 7 | def setUp(self): 8 | self.app = create_app('testing') 9 | self.app_context = self.app.app_context() 10 | self.app_context.push() 11 | db.create_all() 12 | 13 | def tearDown(self): 14 | db.session.remove() 15 | db.drop_all() 16 | self.app_context.pop() 17 | 18 | def test_password_setter(self): 19 | u = User(password = 'cat') 20 | self.assertTrue(u.password_hash is not None) 21 | 22 | def test_no_password_getter(self): 23 | u = User(password = 'cat') 24 | with self.assertRaises(AttributeError): 25 | u.password 26 | 27 | def test_password_verification(self): 28 | u = User(password = 'cat') 29 | self.assertTrue(u.verify_password('cat')) 30 | self.assertFalse(u.verify_password('dog')) 31 | 32 | def test_password_salts_are_random(self): 33 | u = User(password='cat') 34 | u2 = User(password='cat') 35 | self.assertTrue(u.password_hash != u2.password_hash) 36 | 37 | class TagModelTestCase(unittest.TestCase): 38 | def setUp(self): 39 | self.app = create_app('testing') 40 | self.app_context = self.app.app_context() 41 | self.app_context.push() 42 | db.create_all() 43 | 44 | def tearDown(self): 45 | db.session.remove() 46 | db.drop_all() 47 | self.app_context.pop() 48 | 49 | def test_tag_create(self): 50 | name='tag' 51 | name2='tag2' 52 | t = Tag(name=name) 53 | db.session.add(t) 54 | db.session.commit() 55 | self.assertTrue(Tag.query.filter_by(name=name).first()) 56 | self.assertIsNone(Tag.query.filter_by(name=name2).first()) 57 | 58 | def test_collection(self): 59 | name = ' tag' 60 | t = Tag(name=name) 61 | user = User(username='user') 62 | db.session.add(t) 63 | db.session.add(user) 64 | db.session.commit() 65 | c = CollecTag(tag_id=t.id,user_id=user.id) 66 | db.session.add(c) 67 | db.session.commit() 68 | self.assertTrue(t.collection(user)) 69 | self.assertTrue(t.__repr__()=='' % t.name) 70 | -------------------------------------------------------------------------------- /v2de/templates/user_login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block title %} 5 | —— 登录 6 | {% endblock %} 7 | 8 | {% block left_main %} 9 |
10 | 57 |
58 | {% endblock %} 59 | 60 | {% block right_main %} 61 | {% include 'right_user_card.html' %} 62 | {% endblock %} 63 | -------------------------------------------------------------------------------- /v2de/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block left_main %} 4 |
5 | 46 | 49 |
50 | {% endblock %} 51 | 52 | {% block right_main %} 53 | {% include 'right_user_card.html' %} 54 | {% include 'star_node.html' %} 55 | {% include 'right_hot_post.html' %} 56 | {% endblock %} -------------------------------------------------------------------------------- /populate.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | from V2DE import db,Tag,Node,Post 4 | import requests 5 | import json 6 | from time import sleep 7 | from v2de.models import User 8 | 9 | 10 | def populate_tag(): 11 | '''填充tag''' 12 | tags = ['技术','创意','好玩','Apple','酷工作','交易','城市','问与答','最热','全部','节点关注'] 13 | for t in tags: 14 | tag = Tag(name=t) 15 | db.session.add(tag) 16 | db.session.commit() 17 | return 'Done' 18 | 19 | def populate_node(): 20 | '''填充节点''' 21 | data = { 22 | '技术':['程序员','Python','iDev','Android','Linux','node.js','云计算','宽带症候群'], 23 | '创意':['分享创造','设计','奇思妙想'], 24 | '好玩':['分享发现','电子游戏','电影','剧集','音乐','旅游','午夜俱乐部'], 25 | 'Apple':['macOS','iPhone','iPad','MBP','iMac','WATCH','Apple'], 26 | '酷工作':['酷工作','求职','职场话题','外包'], 27 | '交易':['二手交易','物物交换','免费赠送','域名','团购','安全提示'], 28 | '城市':['北京','上海','深圳','广州','杭州','成都','昆明','纽约','杉矶'], 29 | '问与答':['问与答'], 30 | # '全部':['分享发现','分享创造','问与答','酷工作','程序员','职场话题','奇思妙想','优惠信息'] 31 | } 32 | for t in data.keys(): 33 | tag = Tag.query.filter_by(name=t).first() 34 | if tag: 35 | for n in data[t]: 36 | if not Node.query.filter_by(name=n).first(): 37 | node = Node(name=n,tag_id=tag.id) 38 | db.session.add(node) 39 | db.session.commit() 40 | return 'Done' 41 | 42 | def populate_users(num=20): 43 | '''填充用户''' 44 | for i in range(num): 45 | url = 'https://randomuser.me/api/' 46 | r = requests.get(url).text 47 | data = json.loads(r) 48 | username = data['results'][0]['login']['username'] 49 | password = data['results'][0]['login']['password'] 50 | email = data['results'][0]['email'] 51 | # avatar = data['results'][0]['picture']['large'] 52 | user = User(username=username,password=password,email=email) 53 | db.session.add(user) 54 | db.session.commit() 55 | sleep(1) 56 | return 'Done' 57 | 58 | def populate_post(): 59 | '''填充帖子''' 60 | url = "https://www.v2ex.com/api/topics/latest.json" 61 | r = requests.get(url).text 62 | datas = json.loads(r) 63 | for data in datas: 64 | title = data['title'] 65 | content = data['content_rendered'] 66 | node_name = data['node']['title'] 67 | node = Node.query.filter_by(name=node_name).first() 68 | if node: 69 | p = Post(title=title,content=content,node=node,author=random.choice(User.query.all())) 70 | db.session.add(p) 71 | db.session.commit() 72 | return 'Done' 73 | 74 | 75 | # 76 | # def user_post(): 77 | # '''帖子关联用户''' 78 | # posts = Post.query.all() 79 | # for p in posts: 80 | # if not p.author_id: 81 | # p.author = random.choice(User.query.all()) 82 | # db.session.add(p) 83 | # db.session.commit() 84 | # return 'Done' 85 | 86 | def populate_data(): 87 | print('开始填充Tag') 88 | populate_tag() 89 | print('开始填充节点') 90 | populate_node() 91 | print('开始填充用户') 92 | populate_users() 93 | print('开始填充帖子') 94 | populate_post() 95 | # print('用户关联帖子') 96 | # user_post() -------------------------------------------------------------------------------- /v2de/templates/user_register.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block title %} 5 | —— 注册 6 | {% endblock %} 7 | 8 | {% block left_main %} 9 |
10 | 65 |
66 | {% endblock %} 67 | 68 | {% block right_main %} 69 | {% include 'right_user_card.html' %} 70 | {% endblock %} 71 | -------------------------------------------------------------------------------- /v2de/templates/right_user_card.html: -------------------------------------------------------------------------------- 1 | {% if current_user.is_authenticated %} 2 |
3 | 47 |
48 | 49 | {% else %} 50 |
51 | 63 |
64 | {% endif %} -------------------------------------------------------------------------------- /v2de/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% block head %} 5 | 6 | 7 | {# #} 9 | 10 | 11 | 12 | {# #} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | V2EX{% block title %}{% endblock %} 22 | 23 | {% endblock %} 24 | 25 | 26 | 67 | 68 |
69 |
70 |
71 | {% block left_main %} 72 | {% endblock %} 73 |
74 |
75 | {% block right_main %} 76 | {% endblock %} 77 |
78 |
79 |
80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /v2de/templates/post.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block left_main %} 4 |
5 | 33 |
34 | 35 | {% if post.comments.count() != 0 %} 36 |
37 | 60 |
61 | {% else %} 62 |
63 |

目前尚无回复

64 |
65 | {% endif %} 66 | 67 |
68 | 85 |
86 | 95 | 96 | 97 | {% endblock %} 98 | 99 | {% block right_main %} 100 | {% include 'right_user_card.html' %} 101 | {% endblock %} -------------------------------------------------------------------------------- /v2de/models.py: -------------------------------------------------------------------------------- 1 | import hashlib 2 | from . import db,login_manager 3 | from datetime import datetime 4 | from werkzeug.security import generate_password_hash, check_password_hash 5 | from flask import request 6 | from flask_login import UserMixin 7 | 8 | @login_manager.user_loader 9 | def load_user(user_id): 10 | return User.query.get(int(user_id)) 11 | 12 | class Tag(db.Model): 13 | __tablename__ = 'tags' 14 | id = db.Column(db.Integer,primary_key=True) 15 | name = db.Column(db.String(64),unique=True) 16 | nodes = db.relationship('Node',backref='tag',lazy='dynamic') 17 | 18 | def __repr__(self): 19 | return '' % self.name 20 | def collection(self,user): 21 | return CollecTag.query.filter_by(tag_id=self.id,user_id=user.id).first() 22 | class Node(db.Model): 23 | __tablename__ = 'nodes' 24 | id = db.Column(db.Integer,primary_key=True) 25 | name = db.Column(db.String(64),unique=True) 26 | tag_id = db.Column(db.Integer,db.ForeignKey('tags.id')) 27 | posts = db.relationship('Post',backref='node',lazy='dynamic') 28 | header = db.Column(db.String(128)) 29 | avatar = db.Column(db.String(64)) 30 | users = db.relationship('CollectNode',backref='node',lazy='dynamic') 31 | 32 | def __repr__(self): 33 | return '' % self.name 34 | def collection(self,user): 35 | if not user.is_authenticated: 36 | return False 37 | return CollectNode.query.filter_by(node_id=self.id,user_id=user.id).first() 38 | 39 | class Post(db.Model): 40 | __tablename__ = 'posts' 41 | id = db.Column(db.Integer,primary_key=True) 42 | title = db.Column(db.Text) 43 | content = db.Column(db.Text) 44 | repies = db.Column(db.Integer,default=0) 45 | chick = db.Column(db.Integer,default=0) 46 | node_id = db.Column(db.Integer,db.ForeignKey('nodes.id')) 47 | publish_time = db.Column(db.DateTime,default=datetime.now()) 48 | author_id = db.Column(db.Integer,db.ForeignKey('users.id')) 49 | comments = db.relationship('Comment',backref='posts',lazy='dynamic') 50 | 51 | def chicking(self): 52 | self.chick = self.chick + 1 53 | db.session.add(self) 54 | db.session.commit() 55 | 56 | def collection(self,user): 57 | if not user.is_authenticated: 58 | return False 59 | return CollectPost.query.filter_by(post_id=self.id,user_id=user.id).first() 60 | 61 | class Comment(db.Model): 62 | __tablename__ = 'comments' 63 | id = db.Column(db.Integer,primary_key=True) 64 | content = db.Column(db.Text) 65 | publish_time = db.Column(db.DateTime,default=datetime.now()) 66 | post_id = db.Column(db.Integer,db.ForeignKey('posts.id')) 67 | user_id = db.Column(db.Integer,db.ForeignKey('users.id')) 68 | 69 | class User(UserMixin, db.Model): 70 | __tablename__ = 'users' 71 | id = db.Column(db.Integer,primary_key=True) 72 | username = db.Column(db.String(64),unique=True,index=True) 73 | password_hash = db.Column(db.String(128)) 74 | email = db.Column(db.String(64),unique=True,index=True) 75 | avatar = db.Column(db.String(64)) 76 | posts = db.relationship('Post',backref='author',lazy='dynamic') 77 | avatar_hash = db.Column(db.String(64)) 78 | comments = db.relationship('Comment',backref='author',lazy='dynamic') 79 | collectnodes = db.relationship('CollectNode',backref='users',lazy='dynamic') 80 | collectags = db.relationship('CollecTag',backref='users',lazy='dynamic') 81 | collectposts = db.relationship('CollectPost',backref='users',lazy='dynamic') 82 | 83 | 84 | @property 85 | def password(self): 86 | raise AttributeError('password is not a readable attribute') 87 | 88 | @password.setter 89 | def password(self,password): 90 | self.password_hash=generate_password_hash(password) 91 | 92 | def verify_password(self,password): 93 | return check_password_hash(self.password_hash,password) 94 | 95 | def gravatar(self, size=100, default='monsterid', rating='g'): 96 | if request.is_secure: 97 | url = 'https://secure.gravatar.com/avatar' 98 | else: 99 | url = 'http://www.gravatar.com/avatar' 100 | if self.avatar_hash: 101 | hash = self.avatar_hash 102 | else: 103 | hash = hashlib.md5(self.email.encode('utf-8')).hexdigest() 104 | self.avatar_hash = hash 105 | db.session.add(self) 106 | db.session.commit() 107 | return '{url}/{hash}?s={size}&d={default}&r={rating}'.format(url=url, hash=hash, size=size, default=default, rating=rating) 108 | 109 | class CollectNode(db.Model): 110 | __tablename__ = 'collactnode' 111 | id = db.Column(db.Integer,primary_key=True) 112 | node_id = db.Column(db.Integer,db.ForeignKey('nodes.id')) 113 | user_id = db.Column(db.Integer,db.ForeignKey('users.id')) 114 | time = db.Column(db.DateTime,default=datetime.now()) 115 | 116 | 117 | class CollecTag(db.Model): 118 | __tablename__ = 'collactag' 119 | id = db.Column(db.Integer,primary_key=True) 120 | tag_id = db.Column(db.Integer,db.ForeignKey('tags.id')) 121 | user_id = db.Column(db.Integer,db.ForeignKey('users.id')) 122 | time = db.Column(db.DateTime,default=datetime.now()) 123 | 124 | class CollectPost(db.Model): 125 | __tablename__ = 'collectpost' 126 | user_id = db.Column(db.Integer,db.ForeignKey('users.id'), primary_key=True) 127 | post_id = db.Column(db.Integer, db.ForeignKey('posts.id'), primary_key=True) 128 | time = db.Column(db.DateTime, default=datetime.now()) 129 | 130 | 131 | -------------------------------------------------------------------------------- /v2de/templates/new_post.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block head %} 4 | {{ super() }} 5 | 10 | {% endblock %} 11 | 12 | {% block left_main %} 13 |
14 |
    15 |
  • 16 |

    V2EX › 创建新主题

    17 |
  • 18 |
  • 19 |

    主题标题

    20 |
  • 21 |
  • 22 | 23 |
  • 24 |
  • 25 |

    正文

    26 |
  • 27 |
  • 28 | 29 |
  • 30 |
  • 31 |
    32 | 37 |
    38 |
  • 39 |
  • 40 | 最热节点 41 | {% for h_n in hot_nodes %} 42 | {{ h_n.name }} 43 | {% endfor %} 44 |
  • 45 |
  • 46 | 47 | 48 |
  • 49 |
  • 50 |
    51 |
    52 |
  • 53 |
54 |
55 | 87 | {% endblock %} 88 | 89 | {% block right_main %} 90 |
91 |
    92 |
  • 93 | 发帖提示 94 |
  • 95 |
  • 96 |
      97 |
    • 98 | 主题标题
      99 | 请在标题中描述内容要点。如果一件事情在标题的长度内就已经可以说清楚,那就没有必要写正文了。 100 |
    • 101 |
    • 102 | 正文
      103 | 可以在正文中为你要发布的主题添加更多细节。V2EX 支持 GitHub Flavored Markdown 文本标记语法。
      104 | 在正式提交之前,你可以点击本页面左下角的“预览主题”来查看 Markdown 正文的实际渲染效果。 105 |
    • 106 |
    • 107 | 选择节点
      108 | 在最后,请为你的主题选择一个节点。恰当的归类会让你发布的信息更加有用。
      109 | 你可以在主题发布后 300 秒内,对标题或者正文进行编辑。同时,在 300 秒内,你可以重新为主题选择节点。 110 |
    • 111 |
    112 |
  • 113 |
114 |
115 | 116 |
117 |
    118 |
  • 119 | 社区指导原则 120 |
  • 121 |
  • 122 |
      123 |
    • 124 | 尊重原创
      125 | 请不要在 V2EX 发布任何盗版下载链接,包括软件、音乐、电影等等。V2EX 是创意工作者的社区,我们尊重原创。 126 |
    • 127 |
    • 128 | 友好互助
      129 | 保持对陌生人的友善。用知识去帮助别人。 130 |
    • 131 |
    132 |
  • 133 |
134 |
135 | {% endblock %} -------------------------------------------------------------------------------- /v2de/static/css/base.css: -------------------------------------------------------------------------------- 1 | body { 2 | /*background-image: url('../img/air.png');*/ 3 | background-color: #e2e2e2; 4 | } 5 | nav.navbar { 6 | padding-top: 4px; 7 | padding-bottom: 4px; 8 | } 9 | #nav-search { 10 | margin-top: 0px !important; 11 | } 12 | #nav-search-input { 13 | height: 28px; 14 | } 15 | a { 16 | color: #778087 !important; 17 | } 18 | a:hover { 19 | color: #4d5256 !important; 20 | } 21 | nav.navbar { 22 | background-color: #ffffff; 23 | box-shadow: 0px 0px 30px #5a5a5a; 24 | min-width: 1080px; 25 | } 26 | div.left_main { 27 | padding: 0px 0px 0px 0px; 28 | } 29 | div.right-main { 30 | width: 270px; 31 | padding: 0px 0px 0px 0px; 32 | } 33 | #container { 34 | width: 1080px !important; 35 | max-width: none !important; 36 | /*background-color: #e2e2e2;*/ 37 | } 38 | .left-main { 39 | width: 86% !important; 40 | } 41 | #post-type { 42 | font-size: 14px; 43 | border: none; 44 | } 45 | #post-type:hover { 46 | border: none; 47 | } 48 | 49 | #type-link { 50 | color: #000000; 51 | padding: 5px 8px 5px 8px; 52 | margin-right: 7px; 53 | } 54 | #type-link:hover { 55 | background-color: #f5f5f5; 56 | border-radius: 3px; 57 | } 58 | #type-link:active { 59 | background-color: #001d25; 60 | border-radius: 3px; 61 | color: #fff; 62 | } 63 | 64 | #node-nav { 65 | background-color: #f9f9f9; 66 | border: none; 67 | font-size: 14px; 68 | padding: 4px; 69 | padding-left: 18px; 70 | } 71 | #node-link { 72 | color: #000000; 73 | padding: 5px 8px 5px 8px; 74 | margin-right: 7px; 75 | } 76 | #node-link:hover { 77 | text-decoration: underline; 78 | } 79 | 80 | .list-group-item:hover { 81 | z-index: 0; 82 | } 83 | #post-title { 84 | color: #4d5256; 85 | text-decoration: none; 86 | } 87 | #post-title:hover { 88 | text-decoration: underline; 89 | } 90 | #index-post-node { 91 | /*font-size: 12px;*/ 92 | color: #999; 93 | background-color: #f5f5f5; 94 | border-radius: 2px; 95 | padding: 4px 4px 4px 4px; 96 | text-decoration: none; 97 | line-height: 12px; 98 | } 99 | #index-post-node:hover { 100 | text-decoration: none; 101 | background-color: #e2e2e2; 102 | color: #777; 103 | } 104 | .post-node { 105 | display: inline-block; 106 | } 107 | .post-info { 108 | font-size: 12px; 109 | color: #ccc; 110 | line-height: 200%; 111 | } 112 | .card { 113 | margin-top: 20px; 114 | background-color: #fff; 115 | border-radius: 3px; 116 | box-shadow: 0 2px 3px rgba(0,0,0,.1); 117 | border-bottom: 1px solid #e2e2e2; 118 | } 119 | .card-body { 120 | padding: 10px 10px 10px 10px; 121 | } 122 | #hot-post { 123 | margin-top: 20px; 124 | } 125 | #card-nav { 126 | 127 | } 128 | ol.breadcrumb { 129 | padding: 0 0 0 0; 130 | margin: 0 0 0 0 ; 131 | background-color: #fff; 132 | font-size: 16px; 133 | } 134 | #register-form { 135 | padding-top: 10px; 136 | padding-left: 30px; 137 | width: 550px; 138 | } 139 | #register-form input { 140 | border-radius: 3px; 141 | border: 1px solid #ccc; 142 | width: 240px; 143 | font-family: "Helvetica Neue","Luxi Sans","DejaVu Sans",Tahoma,"Hiragino Sans GB","Microsoft Yahei"; 144 | } 145 | #register-form label { 146 | padding-top: 1px; 147 | padding-right: 0px; 148 | padding-bottom: 5px; 149 | margin-bottom: 0px; 150 | } 151 | #user-card .list-group-item { 152 | font-size: 14px; 153 | padding: 10px 10px 10px 10px; 154 | } 155 | #user-card p { 156 | margin-bottom: 0px; 157 | } 158 | #money { 159 | font-size: 11px; 160 | padding: 5px 10px 5px 10px; 161 | border-radius: 20px; 162 | text-decoration: none; 163 | color: #666; 164 | text-shadow: 0 1px 0 #fff; 165 | display: inline-block; 166 | vertical-align: top; 167 | background: -webkit-linear-gradient(top,#f5f5f5 0,#e2e2e2 100%); 168 | } 169 | .node_header { 170 | font-size: 13px; 171 | color: #fff; 172 | padding: 10px 10px 10px 10px; 173 | background-color: #001d25; 174 | } 175 | .node_info { 176 | padding-left: 30px; 177 | padding-right: 0px; 178 | } 179 | .node_info div { 180 | padding-right: 0px; 181 | /*padding-left: 0px;*/ 182 | } 183 | ul.pagination { 184 | margin-bottom: 0px; 185 | } 186 | #post-content { 187 | font-size: 14px; 188 | line-height: 1.6; 189 | color: #000; 190 | word-wrap: break-word; 191 | } 192 | #post-content img { 193 | max-width: 100%; 194 | /*color: #000011;!important;*/ 195 | } 196 | #no-comment { 197 | background-color: transparent; 198 | border: 2px dashed rgba(0,0,0,.1); 199 | border-radius: 3px; 200 | box-shadow: none; 201 | color: rgba(0,0,0,.1); 202 | } 203 | .list-group-item { 204 | padding: 12px 12px 12px 12px; 205 | } 206 | p { 207 | margin-bottom: 0px; 208 | /*color: #999;*/ 209 | } 210 | #star-node { 211 | background-color: #f9f9f9; 212 | margin: 0px; 213 | padding: 4px; 214 | } 215 | #star-node:hover { 216 | box-shadow: 0 1px 2px rgba(0,0,0,.1) inset; 217 | } 218 | #node-info p{ 219 | color: #fff; 220 | } 221 | #new-post .list-group-item { 222 | padding: 10px; 223 | } 224 | #new-post p{ 225 | font-size: 14px; 226 | } 227 | #new-post-title { 228 | width: 100%; 229 | height: 100%; 230 | border: none; 231 | resize: none; 232 | background-color: #f9f9f9; 233 | outline: 0; 234 | font-size: 14px; 235 | line-height: 20px; 236 | padding: 10px; 237 | font-family: 'Helvetica Neue','Hiragino Sans GB','Microsoft Yahei',sans-serif; 238 | margin: 0; 239 | box-sizing: border-box; 240 | } 241 | #new-post-content { 242 | width: 100%; 243 | height: 100%; 244 | border: none; 245 | resize: none; 246 | outline: 0; 247 | font-size: 14px; 248 | padding: 10px; 249 | font-family: 'Helvetica Neue','Hiragino Sans GB','Microsoft Yahei',sans-serif; 250 | margin: 0; 251 | box-sizing: border-box; 252 | } 253 | #choice-node { 254 | background-color: #f5f5f5; 255 | font-size: 12px; 256 | line-height: 12px; 257 | display: inline-block; 258 | padding: 4px 4px 4px 4px; 259 | -moz-border-radius: 2px; 260 | -webkit-border-radius: 2px; 261 | border-radius: 2px; 262 | text-decoration: none; 263 | color: #999; 264 | } 265 | #choice-node:hover { 266 | background-color: #e2e2e2; 267 | } 268 | #view-post p{ 269 | color: #000011; 270 | } 271 | #post-foot { 272 | padding: 5px; 273 | border: 1px rgba(0,0,0,.125); 274 | border-top-style:solid; 275 | } 276 | #post-foot button{ 277 | font-size: 12px; 278 | border: none; 279 | } -------------------------------------------------------------------------------- /v2de/main/views.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | from . import main 4 | from flask import render_template,request,url_for,redirect,flash,make_response,jsonify 5 | from ..models import Tag,Node, Post,User,Comment,CollecTag,CollectNode, CollectPost 6 | from .forms import RegisterForm,LoginForm 7 | from .. import db, cache 8 | from flask_login import login_user,login_required,logout_user,current_user 9 | from datetime import datetime 10 | from markdown import markdown 11 | import bleach 12 | import json 13 | 14 | def sort_post(post): 15 | for p in post: 16 | return p.comments.count() 17 | 18 | @main.route('/') 19 | # @cache.cached(timeout=60*2) 20 | def index(): 21 | tag_list = [t.name for t in Tag.query.order_by(Tag.id)] 22 | tag = request.args.get('tag','') 23 | t = Tag.query.filter_by(name=tag).first() 24 | if tag and tag != request.cookies.get('tag',''): 25 | return index_cookie(tag) 26 | else: 27 | tag = request.cookies.get('tag','技术') 28 | t = Tag.query.filter_by(name=tag).first() 29 | hot_posts = [p for p in Post.query.all() if (datetime.now() - p.publish_time).days == 0] 30 | hot_posts.sort(key=lambda x: x.comments.count(), reverse=True) 31 | if tag == '最热': 32 | posts = hot_posts 33 | elif tag == '全部': 34 | posts = Post.query.all()[::-1] 35 | # hot_posts = [p for p in Post.query.all() if (datetime.now()-p.publish_time).days == 0] 36 | posts.sort(key=lambda x: x.comments.count()) 37 | else: 38 | posts = Post.query.join(Node,Node.id==Post.node_id).filter(Node.tag_id==t.id).order_by(Post.publish_time.desc()).all() 39 | posts.sort(key=lambda x: x.comments.count()) 40 | return render_template('index.html',tag_list=tag_list,node_list=t.nodes,tag=tag,posts=posts[:10],hot_posts=hot_posts) 41 | 42 | def index_cookie(tag): 43 | resp = make_response(redirect(url_for('main.index',tag=tag))) 44 | resp.set_cookie('tag',tag,max_age=24*60*60) 45 | return resp 46 | 47 | @main.route('/register',methods=['POST','GET']) 48 | def register(): 49 | form = RegisterForm() 50 | if request.method == 'POST' and form.validate_on_submit(): 51 | user = User(username=form.username.data,email=form.email.data,password=form.password.data) 52 | db.session.add(user) 53 | db.session.commit() 54 | return redirect(url_for('main.index')) 55 | return render_template('user_register.html',form=form) 56 | 57 | @main.route('/login',methods=['POST','GET']) 58 | def login(): 59 | form = LoginForm() 60 | if form.validate_on_submit(): 61 | user = User.query.filter_by(username=form.username.data).first() 62 | if user and user.verify_password(form.password.data): 63 | login_user(user) 64 | return redirect(request.args.get('next') or url_for('main.index')) 65 | flash('用户名/密码错误') 66 | return render_template('user_login.html',form=form) 67 | 68 | @main.route('/logout') 69 | @login_required 70 | def logout(): 71 | logout_user() 72 | return redirect(url_for('main.index')) 73 | 74 | @main.route('/member/') 75 | def user(username): 76 | user = User.query.filter_by(username=username).first() 77 | return render_template('user.html',user=user) 78 | 79 | @main.route('/go/',methods=['POST','GET']) 80 | def node(name): 81 | node = Node.query.filter_by(name=name).first() 82 | if request.method == 'POST': 83 | file = request.files.get('avatar','') 84 | if file: 85 | file.save('v2de/static/img/node/%s.jpg' % node.name) 86 | node.avatar = '%s.jpg' %node.name 87 | header = request.form.get('header','') 88 | if header: 89 | node.header = header 90 | db.session.add(node) 91 | db.session.commit() 92 | return redirect(url_for('main.node',name=node.name)) 93 | page = request.args.get('page', 1, type=int) 94 | pageination =Post.query.filter_by(node_id=node.id).order_by(Post.publish_time.desc()).paginate(page, per_page=10,error_out=False) 95 | posts = pageination.items 96 | endpoint = 'main.node' 97 | return render_template('node.html',node=node,posts=posts,pageination=pageination,endpoint=endpoint) 98 | 99 | def content_clean(c): 100 | exts = ['markdown.extensions.extra', 'markdown.extensions.codehilite', 'markdown.extensions.tables', 101 | 'markdown.extensions.toc'] 102 | allowed_tags = ['a', 'abbr', 'acronym', 'b', 'blockquote', 'code', 103 | 'em', 'i', 'li', 'ol', 'pre', 'strong', 'ul', 104 | 'h1', 'h2', 'h3', 'p','img','figure'] 105 | content = bleach.linkify(bleach.clean( 106 | markdown(c, output_format='html5',extensions=exts), 107 | tags=allowed_tags, strip=True)) 108 | return content 109 | 110 | def title_clean(t): 111 | allowed_tags = [] 112 | title = bleach.linkify(bleach.clean( 113 | markdown(t, output_format='html'), 114 | tags=allowed_tags, strip=True)) 115 | return title 116 | 117 | 118 | @main.route('/p/',methods=['GET','POST']) 119 | def post(id): 120 | post = Post.query.get_or_404(id) 121 | if request.method == 'POST': 122 | content = request.form.get('comment-content','') 123 | if not content: 124 | return redirect(url_for('main.post', id=post.id)) 125 | username = re.match('@\s(.*)\s',content) 126 | if username: 127 | username = username.group(1) 128 | user = User.query.filter_by(username=username).first() 129 | if user: 130 | content = content.replace(username,'%s' %(username,username)) 131 | comment = Comment(user_id=current_user.id,post_id=post.id,content=content_clean(content)) 132 | db.session.add(comment) 133 | db.session.commit() 134 | # print(datetime.now()) 135 | return redirect(url_for('main.post',id=post.id)) 136 | post.chicking() 137 | comments = post.comments.all() 138 | last_comment = post.comments.order_by(Comment.publish_time.desc()).first() 139 | return render_template('post.html',post=post,comments=comments,last_comment=last_comment) 140 | 141 | 142 | @main.route('/collect/node/') 143 | @login_required 144 | def collect_node(): 145 | node_id = request.args.get('node_id','') 146 | if node_id: 147 | node = Node.query.filter_by(id=node_id).first() 148 | if node: 149 | c = CollectNode.query.filter_by(node_id=node_id,user_id=current_user.id).first() 150 | if c: 151 | db.session.delete(c) 152 | db.session.commit() 153 | return '加入收藏' 154 | else: 155 | c =CollectNode(node_id=node.id,user_id=current_user.id) 156 | db.session.add(c) 157 | db.session.commit() 158 | return '取消收藏' 159 | return '加入收藏' 160 | 161 | 162 | @main.route('/new',methods=['GET','POST']) 163 | @cache.cached(timeout=60*2) 164 | @login_required 165 | def new_post(): 166 | nodes = Node.query.all() 167 | hot_nodes = sorted(nodes,key=lambda x: x.posts.count(),reverse=True)[:15] 168 | if request.method == 'POST': 169 | title =request.form.get('title') 170 | content = request.form.get('content') 171 | node_id = request.form.get('node_id') 172 | p = Post(title=title_clean(title),content=content_clean(content),node_id=int(node_id),author_id=current_user.id) 173 | db.session.add(p) 174 | db.session.commit() 175 | return jsonify({'result':'ok'}) 176 | return render_template('new_post.html',nodes=nodes,hot_nodes=hot_nodes) 177 | 178 | @main.route('/view/post') 179 | @login_required 180 | def view_post(): 181 | content = request.args.get('content','') 182 | return content_clean(content) 183 | 184 | @main.route('/collect/post') 185 | def collect_post(): 186 | post_id = request.args.get('post_id') 187 | post = Post.query.filter_by(id=post_id).first() 188 | if post: 189 | c = CollectPost.query.filter_by(post_id=post_id,user_id=current_user.id).first() 190 | if c: 191 | db.session.delete(c) 192 | db.session.commit() 193 | return '加入收藏' 194 | else: 195 | c = CollectPost(post_id=post_id, user_id=current_user.id) 196 | db.session.add(c) 197 | db.session.commit() 198 | return '取消收藏' 199 | return '加入收藏' 200 | 201 | @main.route('/collect/posts') 202 | @login_required 203 | def collect_posts(): 204 | posts = Post.query.join(CollectPost, CollectPost.post_id == Post.id).filter(CollectPost.user_id==current_user.id).all() 205 | return render_template('collect_posts.html',posts=posts) 206 | 207 | @main.route('/collect/nodes') 208 | @login_required 209 | def collect_nodes(): 210 | nodes = Node.query.join(CollectNode, CollectNode.node_id == Node.id).filter(CollectNode.user_id == current_user.id).all() 211 | return render_template('collect_nodes.html',nodes=nodes) -------------------------------------------------------------------------------- /v2de/templates/node.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block left_main %} 4 |
5 |
6 |
7 |
8 | 9 |
10 |
11 |
12 |

V2EX › {{ node.name }}

13 |
14 |
15 | 16 |
17 |
18 |

主题总数 {{ node.posts.count() }} • 19 | {% if current_user.is_authenticated %} 20 | {% if node.collection(current_user) %}取消收藏{% else %}加入收藏{% endif %} 21 | {% else %} 22 | 加入收藏 23 | {% endif %} 24 |

25 |
26 |
27 |

{{ node.header }}

28 |
29 | 34 |
35 |
36 |
37 |
38 | 70 |
71 |
    72 | {% for p in posts %} 73 |
  • 74 |
    75 | 76 |
    77 | {{ p.title }}
    78 | 85 |
    86 |
    {{ p.comments.count() }}
    87 |
    88 |
  • 89 | {% endfor %} 90 |
  • 91 | 123 |
  • 124 |
  • 125 |

    第 {{ (pageination.page-1)*2+1 }}到 {{ pageination.page*2 }} / 共 {{ node.posts.count() }} 个主题

    126 |
  • 127 |
128 |
129 | 130 | 163 | 172 | {% endblock %} 173 | 174 | {% block right_main %} 175 | {% include 'right_user_card.html' %} 176 | {% endblock %} -------------------------------------------------------------------------------- /v2de/static/css/markdown.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: octicons-link; 3 | src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format('woff'); 4 | } 5 | 6 | .markdown-body { 7 | -ms-text-size-adjust: 100%; 8 | -webkit-text-size-adjust: 100%; 9 | line-height: 1.5; 10 | color: #24292e; 11 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 12 | font-size: 16px; 13 | line-height: 1.5; 14 | word-wrap: break-word; 15 | } 16 | 17 | .markdown-body .pl-c { 18 | color: #6a737d; 19 | } 20 | 21 | .markdown-body .pl-c1, 22 | .markdown-body .pl-s .pl-v { 23 | color: #005cc5; 24 | } 25 | 26 | .markdown-body .pl-e, 27 | .markdown-body .pl-en { 28 | color: #6f42c1; 29 | } 30 | 31 | .markdown-body .pl-smi, 32 | .markdown-body .pl-s .pl-s1 { 33 | color: #24292e; 34 | } 35 | 36 | .markdown-body .pl-ent { 37 | color: #22863a; 38 | } 39 | 40 | .markdown-body .pl-k { 41 | color: #d73a49; 42 | } 43 | 44 | .markdown-body .pl-s, 45 | .markdown-body .pl-pds, 46 | .markdown-body .pl-s .pl-pse .pl-s1, 47 | .markdown-body .pl-sr, 48 | .markdown-body .pl-sr .pl-cce, 49 | .markdown-body .pl-sr .pl-sre, 50 | .markdown-body .pl-sr .pl-sra { 51 | color: #032f62; 52 | } 53 | 54 | .markdown-body .pl-v, 55 | .markdown-body .pl-smw { 56 | color: #e36209; 57 | } 58 | 59 | .markdown-body .pl-bu { 60 | color: #b31d28; 61 | } 62 | 63 | .markdown-body .pl-ii { 64 | color: #fafbfc; 65 | background-color: #b31d28; 66 | } 67 | 68 | .markdown-body .pl-c2 { 69 | color: #fafbfc; 70 | background-color: #d73a49; 71 | } 72 | 73 | .markdown-body .pl-c2::before { 74 | content: "^M"; 75 | } 76 | 77 | .markdown-body .pl-sr .pl-cce { 78 | font-weight: bold; 79 | color: #22863a; 80 | } 81 | 82 | .markdown-body .pl-ml { 83 | color: #735c0f; 84 | } 85 | 86 | .markdown-body .pl-mh, 87 | .markdown-body .pl-mh .pl-en, 88 | .markdown-body .pl-ms { 89 | font-weight: bold; 90 | color: #005cc5; 91 | } 92 | 93 | .markdown-body .pl-mi { 94 | font-style: italic; 95 | color: #24292e; 96 | } 97 | 98 | .markdown-body .pl-mb { 99 | font-weight: bold; 100 | color: #24292e; 101 | } 102 | 103 | .markdown-body .pl-md { 104 | color: #b31d28; 105 | background-color: #ffeef0; 106 | } 107 | 108 | .markdown-body .pl-mi1 { 109 | color: #22863a; 110 | background-color: #f0fff4; 111 | } 112 | 113 | .markdown-body .pl-mc { 114 | color: #e36209; 115 | background-color: #ffebda; 116 | } 117 | 118 | .markdown-body .pl-mi2 { 119 | color: #f6f8fa; 120 | background-color: #005cc5; 121 | } 122 | 123 | .markdown-body .pl-mdr { 124 | font-weight: bold; 125 | color: #6f42c1; 126 | } 127 | 128 | .markdown-body .pl-ba { 129 | color: #586069; 130 | } 131 | 132 | .markdown-body .pl-sg { 133 | color: #959da5; 134 | } 135 | 136 | .markdown-body .pl-corl { 137 | text-decoration: underline; 138 | color: #032f62; 139 | } 140 | 141 | .markdown-body .octicon { 142 | display: inline-block; 143 | vertical-align: text-top; 144 | fill: currentColor; 145 | } 146 | 147 | .markdown-body a { 148 | background-color: transparent; 149 | } 150 | 151 | .markdown-body a:active, 152 | .markdown-body a:hover { 153 | outline-width: 0; 154 | } 155 | 156 | .markdown-body strong { 157 | font-weight: inherit; 158 | } 159 | 160 | .markdown-body strong { 161 | font-weight: bolder; 162 | } 163 | 164 | .markdown-body h1 { 165 | font-size: 2em; 166 | margin: 0.67em 0; 167 | } 168 | 169 | .markdown-body img { 170 | border-style: none; 171 | } 172 | 173 | .markdown-body code, 174 | .markdown-body kbd, 175 | .markdown-body pre { 176 | font-family: monospace, monospace; 177 | font-size: 1em; 178 | } 179 | 180 | .markdown-body hr { 181 | box-sizing: content-box; 182 | height: 0; 183 | overflow: visible; 184 | } 185 | 186 | .markdown-body input { 187 | font: inherit; 188 | margin: 0; 189 | } 190 | 191 | .markdown-body input { 192 | overflow: visible; 193 | } 194 | 195 | .markdown-body [type="checkbox"] { 196 | box-sizing: border-box; 197 | padding: 0; 198 | } 199 | 200 | .markdown-body * { 201 | box-sizing: border-box; 202 | } 203 | 204 | .markdown-body input { 205 | font-family: inherit; 206 | font-size: inherit; 207 | line-height: inherit; 208 | } 209 | 210 | .markdown-body a { 211 | color: #0366d6; 212 | text-decoration: none; 213 | } 214 | 215 | .markdown-body a:hover { 216 | text-decoration: underline; 217 | } 218 | 219 | .markdown-body strong { 220 | font-weight: 600; 221 | } 222 | 223 | .markdown-body hr { 224 | height: 0; 225 | margin: 15px 0; 226 | overflow: hidden; 227 | background: transparent; 228 | border: 0; 229 | border-bottom: 1px solid #dfe2e5; 230 | } 231 | 232 | .markdown-body hr::before { 233 | display: table; 234 | content: ""; 235 | } 236 | 237 | .markdown-body hr::after { 238 | display: table; 239 | clear: both; 240 | content: ""; 241 | } 242 | 243 | .markdown-body table { 244 | border-spacing: 0; 245 | border-collapse: collapse; 246 | } 247 | 248 | .markdown-body td, 249 | .markdown-body th { 250 | padding: 0; 251 | } 252 | 253 | .markdown-body h1, 254 | .markdown-body h2, 255 | .markdown-body h3, 256 | .markdown-body h4, 257 | .markdown-body h5, 258 | .markdown-body h6 { 259 | margin-top: 0; 260 | margin-bottom: 0; 261 | } 262 | 263 | .markdown-body h1 { 264 | font-size: 32px; 265 | font-weight: 600; 266 | } 267 | 268 | .markdown-body h2 { 269 | font-size: 24px; 270 | font-weight: 600; 271 | } 272 | 273 | .markdown-body h3 { 274 | font-size: 20px; 275 | font-weight: 600; 276 | } 277 | 278 | .markdown-body h4 { 279 | font-size: 16px; 280 | font-weight: 600; 281 | } 282 | 283 | .markdown-body h5 { 284 | font-size: 14px; 285 | font-weight: 600; 286 | } 287 | 288 | .markdown-body h6 { 289 | font-size: 12px; 290 | font-weight: 600; 291 | } 292 | 293 | .markdown-body p { 294 | margin-top: 0; 295 | margin-bottom: 10px; 296 | } 297 | 298 | .markdown-body blockquote { 299 | margin: 0; 300 | } 301 | 302 | .markdown-body ul, 303 | .markdown-body ol { 304 | padding-left: 0; 305 | margin-top: 0; 306 | margin-bottom: 0; 307 | } 308 | 309 | .markdown-body ol ol, 310 | .markdown-body ul ol { 311 | list-style-type: lower-roman; 312 | } 313 | 314 | .markdown-body ul ul ol, 315 | .markdown-body ul ol ol, 316 | .markdown-body ol ul ol, 317 | .markdown-body ol ol ol { 318 | list-style-type: lower-alpha; 319 | } 320 | 321 | .markdown-body dd { 322 | margin-left: 0; 323 | } 324 | 325 | .markdown-body code { 326 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 327 | font-size: 12px; 328 | } 329 | 330 | .markdown-body pre { 331 | margin-top: 0; 332 | margin-bottom: 0; 333 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 334 | font-size: 12px; 335 | } 336 | 337 | .markdown-body .octicon { 338 | vertical-align: text-bottom; 339 | } 340 | 341 | .markdown-body .pl-0 { 342 | padding-left: 0 !important; 343 | } 344 | 345 | .markdown-body .pl-1 { 346 | padding-left: 4px !important; 347 | } 348 | 349 | .markdown-body .pl-2 { 350 | padding-left: 8px !important; 351 | } 352 | 353 | .markdown-body .pl-3 { 354 | padding-left: 16px !important; 355 | } 356 | 357 | .markdown-body .pl-4 { 358 | padding-left: 24px !important; 359 | } 360 | 361 | .markdown-body .pl-5 { 362 | padding-left: 32px !important; 363 | } 364 | 365 | .markdown-body .pl-6 { 366 | padding-left: 40px !important; 367 | } 368 | 369 | .markdown-body::before { 370 | display: table; 371 | content: ""; 372 | } 373 | 374 | .markdown-body::after { 375 | display: table; 376 | clear: both; 377 | content: ""; 378 | } 379 | 380 | .markdown-body>*:first-child { 381 | margin-top: 0 !important; 382 | } 383 | 384 | .markdown-body>*:last-child { 385 | margin-bottom: 0 !important; 386 | } 387 | 388 | .markdown-body a:not([href]) { 389 | color: inherit; 390 | text-decoration: none; 391 | } 392 | 393 | .markdown-body .anchor { 394 | float: left; 395 | padding-right: 4px; 396 | margin-left: -20px; 397 | line-height: 1; 398 | } 399 | 400 | .markdown-body .anchor:focus { 401 | outline: none; 402 | } 403 | 404 | .markdown-body p, 405 | .markdown-body blockquote, 406 | .markdown-body ul, 407 | .markdown-body ol, 408 | .markdown-body dl, 409 | .markdown-body table, 410 | .markdown-body pre { 411 | margin-top: 0; 412 | margin-bottom: 16px; 413 | } 414 | 415 | .markdown-body hr { 416 | height: 0.25em; 417 | padding: 0; 418 | margin: 24px 0; 419 | background-color: #e1e4e8; 420 | border: 0; 421 | } 422 | 423 | .markdown-body blockquote { 424 | padding: 0 1em; 425 | color: #6a737d; 426 | border-left: 0.25em solid #dfe2e5; 427 | } 428 | 429 | .markdown-body blockquote>:first-child { 430 | margin-top: 0; 431 | } 432 | 433 | .markdown-body blockquote>:last-child { 434 | margin-bottom: 0; 435 | } 436 | 437 | .markdown-body kbd { 438 | display: inline-block; 439 | padding: 3px 5px; 440 | font-size: 11px; 441 | line-height: 10px; 442 | color: #444d56; 443 | vertical-align: middle; 444 | background-color: #fafbfc; 445 | border: solid 1px #c6cbd1; 446 | border-bottom-color: #959da5; 447 | border-radius: 3px; 448 | box-shadow: inset 0 -1px 0 #959da5; 449 | } 450 | 451 | .markdown-body h1, 452 | .markdown-body h2, 453 | .markdown-body h3, 454 | .markdown-body h4, 455 | .markdown-body h5, 456 | .markdown-body h6 { 457 | margin-top: 24px; 458 | margin-bottom: 16px; 459 | font-weight: 600; 460 | line-height: 1.25; 461 | } 462 | 463 | .markdown-body h1 .octicon-link, 464 | .markdown-body h2 .octicon-link, 465 | .markdown-body h3 .octicon-link, 466 | .markdown-body h4 .octicon-link, 467 | .markdown-body h5 .octicon-link, 468 | .markdown-body h6 .octicon-link { 469 | color: #1b1f23; 470 | vertical-align: middle; 471 | visibility: hidden; 472 | } 473 | 474 | .markdown-body h1:hover .anchor, 475 | .markdown-body h2:hover .anchor, 476 | .markdown-body h3:hover .anchor, 477 | .markdown-body h4:hover .anchor, 478 | .markdown-body h5:hover .anchor, 479 | .markdown-body h6:hover .anchor { 480 | text-decoration: none; 481 | } 482 | 483 | .markdown-body h1:hover .anchor .octicon-link, 484 | .markdown-body h2:hover .anchor .octicon-link, 485 | .markdown-body h3:hover .anchor .octicon-link, 486 | .markdown-body h4:hover .anchor .octicon-link, 487 | .markdown-body h5:hover .anchor .octicon-link, 488 | .markdown-body h6:hover .anchor .octicon-link { 489 | visibility: visible; 490 | } 491 | 492 | .markdown-body h1 { 493 | padding-bottom: 0.3em; 494 | font-size: 2em; 495 | border-bottom: 1px solid #eaecef; 496 | } 497 | 498 | .markdown-body h2 { 499 | padding-bottom: 0.3em; 500 | font-size: 1.5em; 501 | border-bottom: 1px solid #eaecef; 502 | } 503 | 504 | .markdown-body h3 { 505 | font-size: 1.25em; 506 | } 507 | 508 | .markdown-body h4 { 509 | font-size: 1em; 510 | } 511 | 512 | .markdown-body h5 { 513 | font-size: 0.875em; 514 | } 515 | 516 | .markdown-body h6 { 517 | font-size: 0.85em; 518 | color: #6a737d; 519 | } 520 | 521 | .markdown-body ul, 522 | .markdown-body ol { 523 | padding-left: 2em; 524 | } 525 | 526 | .markdown-body ul ul, 527 | .markdown-body ul ol, 528 | .markdown-body ol ol, 529 | .markdown-body ol ul { 530 | margin-top: 0; 531 | margin-bottom: 0; 532 | } 533 | 534 | .markdown-body li { 535 | word-wrap: break-all; 536 | } 537 | 538 | .markdown-body li>p { 539 | margin-top: 16px; 540 | } 541 | 542 | .markdown-body li+li { 543 | margin-top: 0.25em; 544 | } 545 | 546 | .markdown-body dl { 547 | padding: 0; 548 | } 549 | 550 | .markdown-body dl dt { 551 | padding: 0; 552 | margin-top: 16px; 553 | font-size: 1em; 554 | font-style: italic; 555 | font-weight: 600; 556 | } 557 | 558 | .markdown-body dl dd { 559 | padding: 0 16px; 560 | margin-bottom: 16px; 561 | } 562 | 563 | .markdown-body table { 564 | display: block; 565 | width: 100%; 566 | overflow: auto; 567 | } 568 | 569 | .markdown-body table th { 570 | font-weight: 600; 571 | } 572 | 573 | .markdown-body table th, 574 | .markdown-body table td { 575 | padding: 6px 13px; 576 | border: 1px solid #dfe2e5; 577 | } 578 | 579 | .markdown-body table tr { 580 | background-color: #fff; 581 | border-top: 1px solid #c6cbd1; 582 | } 583 | 584 | .markdown-body table tr:nth-child(2n) { 585 | background-color: #f6f8fa; 586 | } 587 | 588 | .markdown-body img { 589 | max-width: 100%; 590 | box-sizing: content-box; 591 | background-color: #fff; 592 | } 593 | 594 | .markdown-body img[align=right] { 595 | padding-left: 20px; 596 | } 597 | 598 | .markdown-body img[align=left] { 599 | padding-right: 20px; 600 | } 601 | 602 | .markdown-body code { 603 | padding: 0.2em 0.4em; 604 | margin: 0; 605 | font-size: 85%; 606 | background-color: rgba(27,31,35,0.05); 607 | border-radius: 3px; 608 | } 609 | 610 | .markdown-body pre { 611 | word-wrap: normal; 612 | } 613 | 614 | .markdown-body pre>code { 615 | padding: 0; 616 | margin: 0; 617 | font-size: 100%; 618 | word-break: normal; 619 | white-space: pre; 620 | background: transparent; 621 | border: 0; 622 | } 623 | 624 | .markdown-body .highlight { 625 | margin-bottom: 16px; 626 | } 627 | 628 | .markdown-body .highlight pre { 629 | margin-bottom: 0; 630 | word-break: normal; 631 | } 632 | 633 | .markdown-body .highlight pre, 634 | .markdown-body pre { 635 | padding: 16px; 636 | overflow: auto; 637 | font-size: 85%; 638 | line-height: 1.45; 639 | background-color: #f6f8fa; 640 | border-radius: 3px; 641 | } 642 | 643 | .markdown-body pre code { 644 | display: inline; 645 | max-width: auto; 646 | padding: 0; 647 | margin: 0; 648 | overflow: visible; 649 | line-height: inherit; 650 | word-wrap: normal; 651 | background-color: transparent; 652 | border: 0; 653 | } 654 | 655 | .markdown-body .full-commit .btn-outline:not(:disabled):hover { 656 | color: #005cc5; 657 | border-color: #005cc5; 658 | } 659 | 660 | .markdown-body kbd { 661 | display: inline-block; 662 | padding: 3px 5px; 663 | font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 664 | line-height: 10px; 665 | color: #444d56; 666 | vertical-align: middle; 667 | background-color: #fafbfc; 668 | border: solid 1px #d1d5da; 669 | border-bottom-color: #c6cbd1; 670 | border-radius: 3px; 671 | box-shadow: inset 0 -1px 0 #c6cbd1; 672 | } 673 | 674 | .markdown-body :checked+.radio-label { 675 | position: relative; 676 | z-index: 1; 677 | border-color: #0366d6; 678 | } 679 | 680 | .markdown-body .task-list-item { 681 | list-style-type: none; 682 | } 683 | 684 | .markdown-body .task-list-item+.task-list-item { 685 | margin-top: 3px; 686 | } 687 | 688 | .markdown-body .task-list-item input { 689 | margin: 0 0.2em 0.25em -1.6em; 690 | vertical-align: middle; 691 | } 692 | 693 | .markdown-body hr { 694 | border-bottom-color: #eee; 695 | } 696 | -------------------------------------------------------------------------------- /v2de/static/js/jquery-3.2.1.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */ 2 | !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), 3 | a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), 4 | null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("