├── .gitignore ├── LICENSE ├── README.md ├── background.html ├── css ├── options.css ├── shanbay.css └── style.css ├── icon_128.png ├── icon_48.png ├── icon_72.png ├── images └── bg-pattern.png ├── js ├── addBook.js ├── background.js ├── common.js ├── dictionaries │ ├── README.md │ ├── dict.js │ └── etymology.js ├── howler.min.js ├── jquery.min.js ├── main.js ├── options.js ├── popup.js ├── shanbay.js └── vocabulary.js ├── manifest.json ├── options.html └── popup.html /.gitignore: -------------------------------------------------------------------------------- 1 | **/*~ 2 | *.zip 3 | *.iml 4 | .idea 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and 10 | distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by the copyright 13 | owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all other entities 16 | that control, are controlled by, or are under common control with that entity. 17 | For the purposes of this definition, "control" means (i) the power, direct or 18 | indirect, to cause the direction or management of such entity, whether by 19 | contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the 20 | outstanding shares, or (iii) beneficial ownership of such entity. 21 | 22 | "You" (or "Your") shall mean an individual or Legal Entity exercising 23 | permissions granted by this License. 24 | 25 | "Source" form shall mean the preferred form for making modifications, including 26 | but not limited to software source code, documentation source, and configuration 27 | files. 28 | 29 | "Object" form shall mean any form resulting from mechanical transformation or 30 | translation of a Source form, including but not limited to compiled object code, 31 | generated documentation, and conversions to other media types. 32 | 33 | "Work" shall mean the work of authorship, whether in Source or Object form, made 34 | available under the License, as indicated by a copyright notice that is included 35 | in or attached to the work (an example is provided in the Appendix below). 36 | 37 | "Derivative Works" shall mean any work, whether in Source or Object form, that 38 | is based on (or derived from) the Work and for which the editorial revisions, 39 | annotations, elaborations, or other modifications represent, as a whole, an 40 | original work of authorship. For the purposes of this License, Derivative Works 41 | shall not include works that remain separable from, or merely link (or bind by 42 | name) to the interfaces of, the Work and Derivative Works thereof. 43 | 44 | "Contribution" shall mean any work of authorship, including the original version 45 | of the Work and any modifications or additions to that Work or Derivative Works 46 | thereof, that is intentionally submitted to Licensor for inclusion in the Work 47 | by the copyright owner or by an individual or Legal Entity authorized to submit 48 | on behalf of the copyright owner. For the purposes of this definition, 49 | "submitted" means any form of electronic, verbal, or written communication sent 50 | to the Licensor or its representatives, including but not limited to 51 | communication on electronic mailing lists, source code control systems, and 52 | issue tracking systems that are managed by, or on behalf of, the Licensor for 53 | the purpose of discussing and improving the Work, but excluding communication 54 | that is conspicuously marked or otherwise designated in writing by the copyright 55 | owner as "Not a Contribution." 56 | 57 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf 58 | of whom a Contribution has been received by Licensor and subsequently 59 | incorporated within the Work. 60 | 61 | 2. Grant of Copyright License. 62 | 63 | Subject to the terms and conditions of this License, each Contributor hereby 64 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, 65 | irrevocable copyright license to reproduce, prepare Derivative Works of, 66 | publicly display, publicly perform, sublicense, and distribute the Work and such 67 | Derivative Works in Source or Object form. 68 | 69 | 3. Grant of Patent License. 70 | 71 | Subject to the terms and conditions of this License, each Contributor hereby 72 | grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, 73 | irrevocable (except as stated in this section) patent license to make, have 74 | made, use, offer to sell, sell, import, and otherwise transfer the Work, where 75 | such license applies only to those patent claims licensable by such Contributor 76 | that are necessarily infringed by their Contribution(s) alone or by combination 77 | of their Contribution(s) with the Work to which such Contribution(s) was 78 | submitted. If You institute patent litigation against any entity (including a 79 | cross-claim or counterclaim in a lawsuit) alleging that the Work or a 80 | Contribution incorporated within the Work constitutes direct or contributory 81 | patent infringement, then any patent licenses granted to You under this License 82 | for that Work shall terminate as of the date such litigation is filed. 83 | 84 | 4. Redistribution. 85 | 86 | You may reproduce and distribute copies of the Work or Derivative Works thereof 87 | in any medium, with or without modifications, and in Source or Object form, 88 | provided that You meet the following conditions: 89 | 90 | You must give any other recipients of the Work or Derivative Works a copy of 91 | this License; and 92 | You must cause any modified files to carry prominent notices stating that You 93 | changed the files; and 94 | You must retain, in the Source form of any Derivative Works that You distribute, 95 | all copyright, patent, trademark, and attribution notices from the Source form 96 | of the Work, excluding those notices that do not pertain to any part of the 97 | Derivative Works; and 98 | If the Work includes a "NOTICE" text file as part of its distribution, then any 99 | Derivative Works that You distribute must include a readable copy of the 100 | attribution notices contained within such NOTICE file, excluding those notices 101 | that do not pertain to any part of the Derivative Works, in at least one of the 102 | following places: within a NOTICE text file distributed as part of the 103 | Derivative Works; within the Source form or documentation, if provided along 104 | with the Derivative Works; or, within a display generated by the Derivative 105 | Works, if and wherever such third-party notices normally appear. The contents of 106 | the NOTICE file are for informational purposes only and do not modify the 107 | License. You may add Your own attribution notices within Derivative Works that 108 | You distribute, alongside or as an addendum to the NOTICE text from the Work, 109 | provided that such additional attribution notices cannot be construed as 110 | modifying the License. 111 | You may add Your own copyright statement to Your modifications and may provide 112 | additional or different license terms and conditions for use, reproduction, or 113 | distribution of Your modifications, or for any such Derivative Works as a whole, 114 | provided Your use, reproduction, and distribution of the Work otherwise complies 115 | with the conditions stated in this License. 116 | 117 | 5. Submission of Contributions. 118 | 119 | Unless You explicitly state otherwise, any Contribution intentionally submitted 120 | for inclusion in the Work by You to the Licensor shall be under the terms and 121 | conditions of this License, without any additional terms or conditions. 122 | Notwithstanding the above, nothing herein shall supersede or modify the terms of 123 | any separate license agreement you may have executed with Licensor regarding 124 | such Contributions. 125 | 126 | 6. Trademarks. 127 | 128 | This License does not grant permission to use the trade names, trademarks, 129 | service marks, or product names of the Licensor, except as required for 130 | reasonable and customary use in describing the origin of the Work and 131 | reproducing the content of the NOTICE file. 132 | 133 | 7. Disclaimer of Warranty. 134 | 135 | Unless required by applicable law or agreed to in writing, Licensor provides the 136 | Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, 137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, 138 | including, without limitation, any warranties or conditions of TITLE, 139 | NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are 140 | solely responsible for determining the appropriateness of using or 141 | redistributing the Work and assume any risks associated with Your exercise of 142 | permissions under this License. 143 | 144 | 8. Limitation of Liability. 145 | 146 | In no event and under no legal theory, whether in tort (including negligence), 147 | contract, or otherwise, unless required by applicable law (such as deliberate 148 | and grossly negligent acts) or agreed to in writing, shall any Contributor be 149 | liable to You for damages, including any direct, indirect, special, incidental, 150 | or consequential damages of any character arising as a result of this License or 151 | out of the use or inability to use the Work (including but not limited to 152 | damages for loss of goodwill, work stoppage, computer failure or malfunction, or 153 | any and all other commercial damages or losses), even if such Contributor has 154 | been advised of the possibility of such damages. 155 | 156 | 9. Accepting Warranty or Additional Liability. 157 | 158 | While redistributing the Work or Derivative Works thereof, You may choose to 159 | offer, and charge a fee for, acceptance of support, warranty, indemnity, or 160 | other liability obligations and/or rights consistent with this License. However, 161 | in accepting such obligations, You may act only on Your own behalf and on Your 162 | sole responsibility, not on behalf of any other Contributor, and only if You 163 | agree to indemnify, defend, and hold each Contributor harmless for any liability 164 | incurred by, or claims asserted against, such Contributor by reason of your 165 | accepting any such warranty or additional liability. 166 | 167 | END OF TERMS AND CONDITIONS 168 | 169 | APPENDIX: How to apply the Apache License to your work 170 | 171 | To apply the Apache License to your work, attach the following boilerplate 172 | notice, with the fields enclosed by brackets "[]" replaced with your own 173 | identifying information. (Don't include the brackets!) The text should be 174 | enclosed in the appropriate comment syntax for the file format. We also 175 | recommend that a file or class name and description of purpose be included on 176 | the same "printed page" as the copyright notice for easier identification within 177 | third-party archives. 178 | 179 | Copyright 2013, Joseph Jin-Chuan Tang 180 | 181 | Licensed under the Apache License, Version 2.0 (the "License"); 182 | you may not use this file except in compliance with the License. 183 | You may obtain a copy of the License at 184 | 185 | http://www.apache.org/licenses/LICENSE-2.0 186 | 187 | Unless required by applicable law or agreed to in writing, software 188 | distributed under the License is distributed on an "AS IS" BASIS, 189 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 190 | See the License for the specific language governing permissions and 191 | limitations under the License. 192 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | shanbay-crx 2 | =========== 3 | This is a Chrome extension for www.shanbay.com , which helps users learn English much more conveniently and more efficiently. 4 | 5 | Basic features include: 6 | 7 | - Definition and etymology. 8 | - Shortcuts on shanbay.com. 9 | - Wordlist collection on any websites. 10 | 11 | =========== 12 | 13 | 扇贝助手增强版 14 | ======= 15 | 16 | [扇贝网](http://www.shanbay.com)的Chrome扩展: 17 | 18 | - 扇贝单词详细页面添加词根词缀([Online Etymology](http://www.etymonline.com) 或[Merriam Webster](http://www.dictionaryapi.com/) ),帮助记忆; 19 | - 扇贝网记单词时添加键盘[快捷键](#shortcuts); 20 | - 任意网页查词并收藏到扇贝账户。 21 | 22 | # 安装 23 | 24 | ### Chrome Web Store 25 | 访问 [扇贝助手增强版](https://chrome.google.com/webstore/detail/aibonellgbdkldghjgbnapgjblebfkbl/) 即可安装。 26 | 27 | ### 手动安装 28 | 如果你因为众所周知的某种原因无法访问*Chrome Web Store* ,可以按照如下方式安装和更新扩展。 29 | 30 | 1. 下载扩展压缩包 [zip](https://codeload.github.com/jinntrance/shanbay-crx/zip/master),解压到某个文件夹,比如文件夹叫`shanbay-crx-master`; 31 | 2. 在Google Chrome 地址栏输入并访问 `chrome://extensions/`,确认选中了 "Developer Mode/开发者模式" 。 32 | 3. 选择 "Load Unpacked Extension",并找到先前叫`shanbay-crx-master` 的文件夹。 33 | 34 | # 功能 35 | 36 | 扇贝网用户使用: 37 | 38 | 1. 可以查找扇贝未提供的词源、简单派生、同义,若扇贝已有的词根和派生则不再额外显示。 39 | 2. 如果该词汇没有词源、派生,则默认不显示,节省空间。 40 | 3. 添加全屏的快捷键W,背单词时空间更大。 41 | 4. 可以通过设置“选项”隐藏、显示中文释义C、英文G、词根E、派生X、例句M、笔记N区域。快捷键不区分大小写。 42 | 5. 词根可选择使用Etymology或是Webster Collegiate的。 43 | 6. 可方便设置,默认将词根收藏为笔记(快捷鍵T)、默认不显示中文释义。 44 | 7. 任意页面(非扇贝网站)查词、加入生词本,双击选词即可,查词组请划词选择右键选择“在扇贝网查找”。 45 | 8. 可选加入Webster全英文释义。 46 | 47 | ## Shortcuts 48 | 49 | 快捷键不区分大小写。 50 | 51 | - 全局快捷键 52 | - W 全屏切换(Window) 53 | - 背单词快捷键 54 | - T 添加词根到笔记noTes 55 | - Y 打开用Y户分享笔记, Z 作笔记、码字Z, 56 | - 发音: A美音/B英音(拼写单词时请使用Alt+A/B) 57 | - 显示隐藏: C中文释义Chinese、G英文释义enGlish、M例句exaMple、N笔记Notes、E词根(Etymology)、X派生affiX 58 | - U,J,K,L分別可选1,2,3,4 59 | - I太简单(Ignore)、O/o不认识(No),U,J选择“认识”/“不认识” 60 | - 若觉着扇贝自带词根不全,可按Ctrl+q 再网上查词源、派生 61 | 62 | ## Webster App Key 注册 63 | 64 | 非常感谢之前用户的贡献,本Chrome 扩展有几个公用的keys,但每个key 在Webster 上有每天1000次查询的限制。 65 | 超过限制通常数天之后,Webster 官方会勒令封key,而且无法保证用公有keys 的用户仍然能够使用英文释义、词根等功能。 66 | 67 | 所以建议,特别是使用扇贝背单词的用户自己申请key,并在扩展设置中填写自己申请的key 。具体步骤如下: 68 | 69 | - 选择官方注册链接[www.dictionaryapi.com](http://www.dictionaryapi.com/register/index.htm) 70 | - 以个人名义申请App Key ,所以需要填写个人相关注册信息。 71 | - Unique Users 可以尽量写大一些比如100000 72 | - Request API Key 写 `Collegiate Dictionary` 73 | - Company Name 写自己学校或公司即可 74 | - Application Name 任意写,比如`My app for English Learning` 75 | - Launch Date 随意写一个未来的时间,格式为月日年如 `02/12/2016` 76 | - Role/Occupation 填职业,根据自己情况填Student, Engineer etc. 77 | - 选择最后的“同意协议”,并提交注册。 78 | - 注册成功后,登录可在左面Account Info 中的"[My Keys](http://www.dictionaryapi.com/account/my-keys.htm)" 查看到自己的 `Key (Dictionary)` (这里实际上是用Collegiate Dictionary,其他key 暂不可用)。 79 | 80 | ## 添加新的字典 81 | 82 | 请开发者阅读此[说明](./js/dictionaries/README.md) 。 83 | 84 | 热忱欢迎有兴趣者一起完善。 85 | 86 | 87 | ## 捐赠 88 | 89 | 不少朋友之前提到捐赠以支持我持续开发及更新这个扩展。但是后来考虑到: 90 | 91 | - 实际上用这个扩展的很多都是学生党。 92 | - 通过支付宝或微信捐赠账户管理麻烦,及针对这个应用实际用户多少及捐赠不好统计。 93 | 94 | 于是乎,决定让大家把当前页面最下端的位置捐赠出来当作广告位:一者捐赠门槛也低,二者真正感兴趣才会点击(于本扩展用户及广告主双赢)。 95 | 96 | 97 | 98 | 99 | 100 | 101 | 106 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /background.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /css/options.css: -------------------------------------------------------------------------------- 1 | * { margin:0; padding:0; } 2 | body { 3 | overflow-y:scroll !important; 4 | font:15px/1.5 Helvetica,arial,sans-serif; 5 | background:#ccc url(../images/bg-pattern.png); 6 | } 7 | a { text-decoration:none; } 8 | 9 | #wrapper { 10 | width:650px; margin:40px auto 80px auto; 11 | border: 1px solid #fff; -webkit-box-shadow: #404040 0 5px 10px; 12 | background-color:#FFF; 13 | -webkit-border-radius:5px; 14 | } 15 | 16 | #header { 17 | position:relative; /* for logo position */ 18 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#eceff5)); 19 | -webkit-border-top-left-radius:5px; 20 | -webkit-border-top-right-radius:5px; 21 | border-bottom: 1px solid #ddd; 22 | } 23 | #header h1 { 24 | /*background: url(../images/logo-half.png) 7px 14px no-repeat;*/ 25 | margin:0; 26 | line-height: 40px; 27 | text-indent: 10px; 28 | font-size: 16px; 29 | font-weight: 400; 30 | color: #5d758a; 31 | text-shadow: 0 1px 0 #fff; 32 | font-weight: bold; 33 | } 34 | #header h1::before { 35 | content:''; 36 | position:absolute; bottom:0; right:10px; 37 | width:48px; height:24px; 38 | } 39 | 40 | #options { 41 | padding: 30px 10px 10px 10px; 42 | position:relative; 43 | } 44 | #options fieldset { 45 | border: 1px solid #eee; 46 | border-radius: 5px; 47 | margin-bottom:20px; padding: 10px; 48 | } 49 | #options fieldset legend{ 50 | color: #999; 51 | font-size: 15px; 52 | padding: 0 5px; 53 | } 54 | #options fieldset input[type=checkbox]{ 55 | margin-right:5px; 56 | margin-left:5px; 57 | margin-top: 3px; 58 | } 59 | 60 | #options fieldset#format input[type=radio] { 61 | margin-left:5px; 62 | margin-right:5px; 63 | } 64 | 65 | 66 | #tip { 67 | display:none; 68 | position:absolute; top:0; left: 0; 69 | font-size: 12px; 70 | padding: 5px 0; 71 | width:100%; text-align:center; 72 | background-color: green; 73 | font-weight: bold; 74 | color: #fff; 75 | } 76 | #tip.error { 77 | background-color: red; 78 | color: #fff; 79 | } 80 | 81 | #action_panel { 82 | background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f5f5f5), to(#eceff5)); 83 | border-top: 1px solid #ddd; 84 | border-bottom-left-radius: 5px; 85 | border-bottom-right-radius: 5px; 86 | text-align: right; 87 | padding: 6px 10px; 88 | } 89 | #action_panel input{ 90 | padding: 5px 10px; 91 | } 92 | #action_panel input[value=Reset] { float:left; } 93 | #action_panel input[value=Save] { 94 | font-weight: 700; 95 | padding: 5px 10px; 96 | margin-right: 5px; 97 | } 98 | 99 | #shortcuts_table { 100 | margin-left: 5px; 101 | text-align: left; 102 | } 103 | 104 | #shortcuts_table tr{ 105 | } 106 | 107 | #shortcuts_table .td{ 108 | padding-right: 40px; 109 | padding-bottom: 10px; 110 | } 111 | 112 | #shortcuts_table select { 113 | margin-left: 5px; 114 | } 115 | #shortcuts_table select[disabled] { 116 | color:#BBB; 117 | } 118 | 119 | -------------------------------------------------------------------------------- /css/shanbay.css: -------------------------------------------------------------------------------- 1 | #shanbay_popover{ 2 | z-index: 2147483647; 3 | } 4 | #shanbay_popover::before{ 5 | content: ''; 6 | position: absolute; 7 | left: 50px; 8 | top: -14px; 9 | border-top: 8px solid transparent; 10 | border-left: 8px solid transparent; 11 | border-right: 8px solid transparent; 12 | border-bottom: 8px solid rgba(0, 0, 0, 0.2); 13 | } 14 | .web_type{ 15 | font-weight:bold ; 16 | } 17 | #shanbay_popover::after{ 18 | content: ''; 19 | position: absolute; 20 | left: 51px; 21 | top: -12px; 22 | border-top: 7px solid transparent; 23 | border-left: 7px solid transparent; 24 | border-right: 7px solid transparent; 25 | border-bottom: 7px solid #f5f5f5; 26 | } 27 | #shanbay_popover *{ 28 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif!important; 29 | font-size: 15px!important; 30 | line-height: 18px!important; 31 | color: #333!important; 32 | text-align: left!important; 33 | padding: 0!important; 34 | margin: 0!important; 35 | text-decoration: none!important; 36 | } 37 | #shanbay_popover .hide{ 38 | display: none!important; 39 | } 40 | #shanbay_popover .popover-inner { 41 | width: 280px; 42 | padding: 1px!important; 43 | background-color: white; 44 | overflow: hidden; 45 | border-radius: 6px; 46 | box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); 47 | } 48 | #shanbay_popover .popover-title { 49 | padding: 9px 15px!important; 50 | background-color: #f5f5f5; 51 | border-bottom: 1px solid #eee; 52 | border-radius: 3px 3px 0 0; 53 | } 54 | #shanbay_popover .popover-title span{ 55 | font-size: 16px!important; 56 | line-height: 26px!important; 57 | font-weight: normal!important; 58 | color: #000!important; 59 | } 60 | #shanbay_popover .popover-content { 61 | padding: 14px!important; 62 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAACXBIWXMAAC4jAAAuIwF4pT92AAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAA4SURBVHjaYrxz69Z/BgYGRgYcgAkq+R+fAgZ8ipiQ2FgVMaHxMRQxYTEVRRETDrfBFeFSAFcEGAC9HAqglH6g/AAAAABJRU5ErkJggg==); 63 | border-radius: 0 0 3px 3px; 64 | } 65 | #shanbay_popover .add-btn{ 66 | margin-top: 10px!important; 67 | } 68 | #shanbay_popover .btn{ 69 | display: inline-block; 70 | color: #fff!important; 71 | line-height: 18px; 72 | text-align: center; 73 | vertical-align: middle; 74 | padding: 4px 10px!important; 75 | cursor: pointer; 76 | border: 1px solid #ccc; 77 | border-radius: 4px; 78 | box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); 79 | background-color: #29c0a9; 80 | background-image: -webkit-linear-gradient(top, #2fd0bb, #21a98d); 81 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 82 | background-repeat: repeat-x; 83 | text-decoration: none; 84 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 85 | } 86 | #shanbay_popover .btn:hover, 87 | #shanbay_popover .btn:active, 88 | #shanbay_popover .btn.active, 89 | #shanbay_popover .btn.disabled, 90 | #shanbay_popover .btn[disabled] { 91 | background-image: none; 92 | background-color: #21a98d; 93 | } 94 | 95 | #shanbay_popover #shanbay-close-btn { 96 | background-color: red; 97 | background-image: none; 98 | float: right; 99 | } 100 | 101 | #shanbay_popover .success{ 102 | color: #29c0a9!important; 103 | margin-top: 10px!important; 104 | } 105 | #shanbay_popover .failed{ 106 | color: #d14836!important; 107 | margin-top: 10px!important; 108 | } 109 | #shanbay_popover .speak{ 110 | cursor: pointer; 111 | display: inline-block; 112 | margin-right: 15px!important; 113 | } 114 | #shanbay_popover .icon-speak{ 115 | display: inline-block; 116 | width: 16px; 117 | height: 16px; 118 | position: relative; 119 | top: 3px; 120 | left: 3px; 121 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAABU0lEQVQoU6WSMU7DQBBFGbugDSdAcAG0FjUiErUDEjVQUAckWkQB6SIKuAARBwCJmiQNJdgWCgUUBE6ARUVjmzfWrmSCQ8NKq13/nT9/PPNlZsoyxmyJSJjnecf3/TDLsvMkSVIXLnU8S7rgbWiJw6IoPtg7cRzfKOcX0ZFQ8wjsQ9z0PG+P2H2wBt/bkC+FwBDAWOUGZ5v9CaYKr1EUrekbcUskGIAJ5EUJguCLoFlXMg8pexXsVDEtFcIV2AbnCtAx+8gRn/j5g7J2kTGlvJPw1hJ3ac6DVQq4v3B/LIkE3LmSnLIjKk6Zh6idkLzJ2SX58r+JI+TLUllvNaXe8+7zvwbFZxRHdc3RbjYnmnMNtv6jOXYcwcQ4UjuOsc7RNm0eYt8qL0wzQA+iOAPQyTZ3NcAciVrqnr8s10NpULGczlddU285N46qySmxRYKzqsm/AZFC83O8KzkXAAAAAElFTkSuQmCC) center no-repeat!important; 122 | } 123 | #shanbay_popover .speak:hover .icon-speak{ 124 | opacity: 0.8; 125 | } 126 | #shanbay_popover .speak:active .icon-speak{ 127 | top: 4px; 128 | } 129 | -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | span.foreign, span.crossreference, #affix .due_msg, #affix .word { 2 | font-style: italic; 3 | font-weight: bold; 4 | } 5 | .options{ 6 | text-align: center; 7 | } 8 | .option-set{ 9 | margin-top: 20px; 10 | margin-bottom: 20px; 11 | } 12 | #save{ 13 | margin: 20px; 14 | } 15 | .shortcut{ 16 | line-height: 150%; 17 | } 18 | a.note-button{ 19 | margin-right: 15px; 20 | } 21 | a.note-button,a#show_cn_df{ 22 | text-decoration: underline; 23 | margin-left: 6px; 24 | } 25 | #status{ 26 | float:left; 27 | color: green; 28 | font-size: 25pt; 29 | } 30 | #add-status{ 31 | color: green; 32 | font-size: 16pt; 33 | } 34 | .shortcut ol{ 35 | text-align: left; 36 | margin-left: 20px; 37 | 38 | } 39 | 40 | #add-new-book{ 41 | width:95%; 42 | margin:6px 43 | } 44 | a#btn-delete-all-book{ 45 | float: right; 46 | } 47 | 48 | textarea#words{ 49 | background-color: #ffffff; 50 | border: 1px solid #cccccc; 51 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 52 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 53 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); 54 | -webkit-transition: border linear .2s, box-shadow linear .2s; 55 | -moz-transition: border linear .2s, box-shadow linear .2s; 56 | -o-transition: border linear .2s, box-shadow linear .2s; 57 | transition: border linear .2s, box-shadow linear .2s; 58 | } 59 | 60 | 61 | input[type="text"], textarea { 62 | border: 2px solid white; 63 | -webkit-box-shadow: 64 | inset 0 0 8px rgba(0,0,0,0.1), 65 | 0 0 16px rgba(0,0,0,0.1); 66 | -moz-box-shadow: 67 | inset 0 0 8px rgba(0,0,0,0.1), 68 | 0 0 16px rgba(0,0,0,0.1); 69 | box-shadow: 70 | inset 0 0 8px rgba(0,0,0,0.1), 71 | 0 0 16px rgba(0,0,0,0.1); 72 | padding: 15px; 73 | background: rgba(255,255,255,0.5); 74 | margin: 0 0 10px 0; 75 | } 76 | input[type="text"]:focus, textarea:focus, 77 | input[type="text"].focus, textarea:focus { 78 | border: solid 1px #707070; 79 | box-shadow: 0 0 5px 1px #969696; 80 | } 81 | 82 | .roots-wrapper a p { 83 | font-weight: bolder; 84 | font-size: 120%; 85 | } 86 | 87 | .roots-wrapper a section { 88 | color: #333; 89 | } 90 | -------------------------------------------------------------------------------- /icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinntrance/shanbay-crx/700970e93a64569d7753e16cdd17b6c00be37017/icon_128.png -------------------------------------------------------------------------------- /icon_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinntrance/shanbay-crx/700970e93a64569d7753e16cdd17b6c00be37017/icon_48.png -------------------------------------------------------------------------------- /icon_72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinntrance/shanbay-crx/700970e93a64569d7753e16cdd17b6c00be37017/icon_72.png -------------------------------------------------------------------------------- /images/bg-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jinntrance/shanbay-crx/700970e93a64569d7753e16cdd17b6c00be37017/images/bg-pattern.png -------------------------------------------------------------------------------- /js/addBook.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 添加单词书 3 | * @user Joseph 4 | */ 5 | 6 | $(function () { 7 | if ($('a.btn-add-new-unit').length > 0) { 8 | $('.btn-add-new-unit-container').append('添加全书'). 9 | append('删除全部单元'). 10 | append('') 11 | } 12 | $(document).on('click', "a.btn-add-new-book", function () { 13 | $('#add-new-book-container').toggle() 14 | }).on('click', 'a#btn-delete-all-book', function () { 15 | $('a.btn-delete-unit').each(function () { 16 | $.ajax({ 17 | type: "DELETE", 18 | url: "http://www.shanbay.com/api/v1/wordbook/wordlist/" + $(this).attr('unit-id') 19 | }); 20 | $(this).parents('.wordbook-containing-wordlist').remove(); 21 | }) 22 | }).on('click', 'a.cfm-add-new-book', function () { 23 | let $add = $('#add-new-book'); 24 | let lines = $add.val().trim().split('\n'); 25 | $add.val(''); 26 | if (lines.length > 0) { 27 | let defs = {}; 28 | let words = []; 29 | lines.map(function (line) { 30 | let index = line.trim().indexOf(','); 31 | let word = ''; 32 | if (-1 == index) { 33 | word = line; 34 | } 35 | else { 36 | word = line.substr(0, index).trim(); 37 | let meaning = line.substr(index + 1).trim(); 38 | defs[word] = meaning; 39 | } 40 | words.push(word) 41 | }); 42 | let s = words; 43 | let all = s.length; 44 | let len = Math.ceil(s.length / 200); 45 | let book_id = location.href.split('/')[4]; 46 | let size = $('td.wordbook-wordlist-name a').size(); 47 | let init = 0; 48 | if (size > 0) { 49 | let list = $('td.wordbook-wordlist-name a')[size - 1].innerHTML; 50 | if (-1 < list.search("list ")) { 51 | let num = list.substr(5); 52 | init = num++ 53 | } 54 | } 55 | $('#add-status').html("添加中..."); 56 | for (let i = init + 1; i <= init + len; i++) { 57 | let li = "http://www.shanbay.com/api/v1/wordbook/wordlist/"; 58 | let word_num = all < i * 200 ? all - (i - 1) * 200 : 200; 59 | $.ajax({ 60 | type: "POST", 61 | url: li, 62 | dataType: "json", 63 | async: false, 64 | data: { 65 | name: "list " + i, 66 | description: word_num + " words", 67 | wordbook_id: book_id 68 | }, 69 | success: function (resp) { 70 | data = resp.data; 71 | let li_id = data.wordlist.id; 72 | let index = data.wordlist.name.split(' ')[1]++; 73 | let words = s.slice((index - 1) * 200, index * 200); 74 | words.forEach(function (e) { 75 | $.ajax({ 76 | type: "POST", 77 | async: false, 78 | url: 'http://www.shanbay.com/api/v1/wordlist/vocabulary/', 79 | dataType: "json", 80 | data: {id: li_id, word: e}, 81 | success: function (data) { 82 | if (404 == data.status_code) { 83 | console.log(e); 84 | if (defs[e]) 85 | $add.val($add.val() + e + "," + defs[e] + '\n'); 86 | else $add.val($add.val() + e + '\n') 87 | } else { 88 | if (defs[e] && data.data.vocabulary.definition.search(defs[e]) == -1) { 89 | let id = e.id; 90 | $.ajax({ 91 | url: "http://www.shanbay.com/wordlist/vocabulary/definition/edit/", 92 | type: 'POST', 93 | data: { 94 | vocabulary_id: data.data.vocabulary.id, 95 | wordlist_id: li_id, 96 | definition: defs[e] + "\n" + data.data.vocabulary.definition 97 | }, 98 | dataType: 'JSON' 99 | }) 100 | } 101 | } 102 | } 103 | }); 104 | }) 105 | } 106 | }); 107 | } 108 | $('#add-status').html("添加完成") 109 | } 110 | }) 111 | }); 112 | -------------------------------------------------------------------------------- /js/background.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Joseph 3 | */ 4 | 5 | checked = false; 6 | 7 | $(function () { 8 | check_in(); 9 | setTimeout(function () { 10 | checked = false; 11 | check_in(); 12 | }, 3 * 60 * 60 * 1000);//每3h提醒一次 13 | 14 | chrome.contextMenus.removeAll(function () { 15 | if (localStorage['ctx_menu'] != 'no') { 16 | chrome.contextMenus.create({ 17 | "title": '在扇贝网中查找"%s"', 18 | "contexts": ["selection"], 19 | "onclick": function (info, tab) { 20 | isUserSignedOn(function () { 21 | getClickHandler(info.selectionText, tab); 22 | }); 23 | } 24 | }); 25 | } 26 | }); 27 | }); 28 | 29 | var notified = false; 30 | 31 | function notify(title, message, url) { 32 | if (!title) { 33 | title = "背单词读文章练句子" 34 | } 35 | if (!message) { 36 | message = localStorage['pop_msg']; 37 | if(!message || message.trim().length == 0) { 38 | message = "少壮不努力,老大背单词!"; 39 | } 40 | } 41 | if (!url) { 42 | url = "http://www.shanbay.com/"; 43 | } 44 | let opt = { 45 | type: "basic", 46 | title: title, 47 | message: message, 48 | iconUrl: "icon_48.png" 49 | }; 50 | let notId = Math.random().toString(36); 51 | if (!notified && ls()['not_pop'] != 'no') { 52 | notification = chrome.notifications.create(notId, opt, function (notifyId) { 53 | debugLog('info', notifyId + " was created."); 54 | notified = true 55 | }); 56 | } 57 | chrome.notifications.onClicked.addListener(function (notifyId) { 58 | debugLog('info', "notification was clicked"); 59 | chrome.notifications.clear(notifyId, function () { 60 | }); 61 | if (notId == notifyId) { 62 | chrome.tabs.create({ 63 | url: url 64 | }) 65 | } 66 | notified = false 67 | }); 68 | setTimeout(function () { 69 | chrome.notifications.clear(url, function () { 70 | }); 71 | }, 5000); 72 | } 73 | 74 | function notify_login() { 75 | notify("", "请登录……", "http://shanbay.com/accounts/login/"); 76 | } 77 | 78 | 79 | function check_in() { 80 | let check_in_url = "http://www.shanbay.com/api/v1/checkin/"; 81 | $.getJSON(check_in_url, function (json) { 82 | let arry = json.data.tasks.map(function (task) { 83 | return task.meta.num_left; 84 | }); 85 | let m = max(arry); 86 | localStorage['checkin'] = m; 87 | if (0 == m) { 88 | chrome.browserAction.setBadgeText({text: ''}); 89 | } 90 | else if (m > 0) { 91 | chrome.browserAction.setBadgeText({text: m + ''}); 92 | //notified = false; 93 | notify(); 94 | } 95 | }).fail(function () { 96 | //notified = false; 97 | notify(); 98 | }); 99 | checked = true; 100 | } 101 | 102 | function max(array) { 103 | if (undefined == array || array.length == 0) return 0; 104 | let max = array[0]; 105 | array.forEach(function (e) { 106 | if (e > max) max = e; 107 | }); 108 | return max; 109 | } 110 | 111 | function saveToStorage() { 112 | // Save it using the Chrome extension storage API. 113 | chrome.storage.sync.set({ls:JSON.stringify(localStorage)}, function() { 114 | // Notify that we saved. 115 | debugLog('log', 'localStorage saved in chrome.storage.sync'); 116 | }); 117 | } 118 | 119 | chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { 120 | if(request.method != 'getLocalStorage') { 121 | debugLog('log', "received method: " + request.method); 122 | debugLog('log', request); 123 | } 124 | switch (request.method) { 125 | case "getLocalStorage": 126 | chrome.storage.sync.get("ls", function(value) { 127 | // Notify that we saved. 128 | try { 129 | let valueString = value.ls; 130 | let items = JSON.parse(valueString); 131 | for (let k in items) { 132 | if (undefined != items[k]) 133 | localStorage[k] = items[k]; 134 | } 135 | debugLog('log', "fetched local storage from chrome.storage.sync"); 136 | } catch (e) { 137 | saveToStorage(); 138 | console.warn(e); 139 | } 140 | }); 141 | sendResponse({data: localStorage}); 142 | break; 143 | case "setLocalStorage": 144 | window.localStorage = request.data; 145 | saveToStorage(); 146 | sendResponse({data: localStorage}); 147 | break; 148 | case 'is_user_signed_on': 149 | isUserSignedOn(); 150 | break; 151 | case 'lookup': 152 | isUserSignedOn(function () { 153 | getClickHandler(request.data, sender.tab, request.position); 154 | }); 155 | break; 156 | case 'addWord': 157 | addNewWordInBrgd(request.data, sender.tab); 158 | break; 159 | case 'forgetWord': 160 | forgetWordInBrgd(request.data, sender.tab); 161 | break; 162 | case 'openSettings': 163 | chrome.tabs.create({url: chrome.runtime.getURL("options.html") + '#' + request.anchor}); 164 | break; 165 | case 'playAudio': 166 | playAudio(request.data['audio_url']); 167 | break; 168 | case 'getEtymology': 169 | getOnlineEtymology(request.data.term, function (term, obj) { 170 | sendResponse(); 171 | chrome.tabs.sendMessage(sender.tab.id, { 172 | callback: 'showEtymology', 173 | data:{term:term, json:obj} 174 | }); 175 | }); 176 | break; 177 | case 'findDerivatives': 178 | function showDerivatiresCallback(data) { 179 | chrome.tabs.sendMessage(sender.tab.id, { 180 | callback: 'showDerivatives', 181 | data: data 182 | }); 183 | } 184 | findDerivatives(request.data.term, showDerivatiresCallback); 185 | break; 186 | case 'popupEtymology': 187 | let xhr = new XMLHttpRequest(); 188 | xhr.open("GET", request.data.url, true); 189 | xhr.onreadystatechange = function () { 190 | if (xhr.readyState == 4) { 191 | let roots = parseEtymology(xhr.responseText, request.data.term); 192 | chrome.tabs.sendMessage(sender.tab.id, { 193 | callback: 'popupEtymology', 194 | data: { 195 | originAnchor: request.data.originAnchor, 196 | term: request.data.term, 197 | roots: roots 198 | } 199 | }); 200 | } 201 | }; 202 | xhr.send(); 203 | default : 204 | sendResponse({data: []}); // snub them. 205 | } 206 | }); 207 | 208 | 209 | function addNewWordInBrgd(word_id, tab) { 210 | chrome.cookies.getAll({"url": 'http://www.shanbay.com'}, function (cookies) { 211 | $.ajax({ 212 | url: 'http://www.shanbay.com/api/v1/bdc/learning/', 213 | type: 'POST', 214 | dataType: 'JSON', 215 | contentType: "application/json; charset=utf-8", 216 | data: JSON.stringify({ 217 | content_type: "vocabulary", 218 | id: word_id 219 | }), 220 | success: function (data) { 221 | chrome.tabs.sendMessage(tab.id, { 222 | callback: 'addWord', 223 | data: {msg: 'success', rsp: data.data} 224 | }); 225 | debugLog('log', 'success'); 226 | }, 227 | error: function () { 228 | chrome.tabs.sendMessage(tab.id, { 229 | callback: 'addWord', 230 | data: {msg: 'error', rsp: {}} 231 | }); 232 | debugLog('log', 'error'); 233 | }, 234 | complete: function () { 235 | debugLog('log', 'complete'); 236 | } 237 | }); 238 | }); 239 | } 240 | 241 | function forgetWordInBrgd(learning_id, tab) { 242 | chrome.cookies.getAll({"url": 'http://www.shanbay.com'}, function (cookies) { 243 | $.ajax({ 244 | url: 'http://www.shanbay.com/api/v1/bdc/learning/' + learning_id, 245 | type: 'PUT', 246 | dataType: 'JSON', 247 | contentType: "application/json; charset=utf-8", 248 | data: JSON.stringify({ 249 | retention: 1 250 | }), 251 | success: function (data) { 252 | chrome.tabs.sendMessage(tab.id, { 253 | callback: 'forgetWord', 254 | data: {msg: 'success', rsp: data.data} 255 | }); 256 | debugLog('log', 'success'); 257 | }, 258 | error: function () { 259 | chrome.tabs.sendMessage(tab.id, { 260 | callback: 'forgetWord', 261 | data: {msg: 'error', rsp: {}} 262 | }); 263 | debugLog('log', 'error'); 264 | }, 265 | complete: function () { 266 | debugLog('log', 'complete'); 267 | } 268 | }); 269 | }); 270 | } 271 | 272 | function normalize(word) { 273 | return word.replace(/·/g, ''); 274 | } 275 | 276 | var getLocaleMessage = chrome.i18n.getMessage; 277 | var API = 'http://www.shanbay.com/api/v1/bdc/search/?word='; 278 | 279 | 280 | function isUserSignedOn(callback) { 281 | chrome.cookies.get({"url": 'http://www.shanbay.com', "name": 'auth_token'}, function (cookie) { 282 | if (cookie) { 283 | localStorage.setItem('shanbay_cookies', 'has_cookie'); 284 | callback(); 285 | } else { 286 | localStorage.removeItem('shanbay_cookies'); 287 | notified = false; 288 | notify_login(); 289 | } 290 | }); 291 | } 292 | 293 | function getClickHandler(term, tab, position = {}) { 294 | debugLog('log', 'signon'); 295 | let url = API + normalize(term);//normalize it only 296 | 297 | if (tab.id <= 0) { 298 | chrome.tabs.query({ 299 | active: true, 300 | url: '*://*/*.pdf' 301 | }, 302 | function (tabs) { 303 | if (tabs) { 304 | tab = tabs[0]; 305 | } 306 | }); 307 | } 308 | 309 | $.ajax({ 310 | url: url, 311 | type: 'GET', 312 | dataType: 'JSON', 313 | contentType: "application/json; charset=utf-8", 314 | success: function (data) { 315 | debugLog('log', 'success'); 316 | if ((1 == data.status_code) || localStorage['search_webster'] == 'yes') 317 | getOnlineWebsterCollegiate(term, function (term, json) { 318 | let defs = json.fls.map(function (i) { 319 | return "" + json.fls[i].textContent + ', ' + json.defs[i].textContent 320 | }).toArray().join('
'); 321 | let tm = json.hw[0] ? json.hw[0].textContent.replace(/\*/g, '·') : ''; 322 | chrome.tabs.sendMessage(tab.id, { 323 | callback: 'popover', 324 | data: { 325 | shanbay: data, 326 | webster: {term: tm, defs: defs}, 327 | position: position 328 | } 329 | }); 330 | }); 331 | else chrome.tabs.sendMessage(tab.id, { 332 | callback: 'popover', 333 | data: {shanbay: data, position: position} 334 | }); 335 | }, 336 | error: function () { 337 | debugLog('log', 'error'); 338 | }, 339 | complete: function () { 340 | debugLog('log', 'complete'); 341 | } 342 | }); 343 | } 344 | 345 | function singularize(word) { 346 | let specailPluralDic = { 347 | 'men': 'man', 348 | 'women': 'woman', 349 | 'children': 'child' 350 | }; 351 | let result = specailPluralDic[word]; 352 | if (result) { 353 | return result; 354 | } 355 | 356 | let pluralRule = [{ 357 | 'match': /s$/, 358 | 'replace': '' 359 | }]; 360 | 361 | for (let j = 0; j < pluralRule.length; j++) { 362 | if (word.match(pluralRule[j].match)) { 363 | return word.replace(pluralRule[j].match, pluralRule[j].replace); 364 | } 365 | } 366 | 367 | return word; 368 | } 369 | 370 | function playAudio(audio_url) { 371 | if (audio_url) { 372 | new Howl({ 373 | src: [audio_url], 374 | volume: 1.0 375 | }).play(); 376 | } 377 | } 378 | -------------------------------------------------------------------------------- /js/common.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 基本的函数,包括Webster 及 在线词源的获取 3 | * @user Joseph 4 | */ 5 | 6 | const etym_url = 'https://www.etymonline.com'; 7 | const etho_pre_url = etym_url + '/search?q='; 8 | 9 | const keys = [ 10 | '62f54ac9-4791-4131-bfdd-1146af327107', 11 | 'c0b8de2c-834c-4d08-818d-c7a5ee1cf1a9', 12 | 'e8e77e77-6c9d-4ce7-903a-9b9ad3246fd8', 13 | 'd283a343-d2ba-45fb-b3b7-fd542a0c25c8', 14 | 'a232cef0-720f-414c-a27e-a32648bbc977', 15 | 'b0d3d18c-cd69-46ca-bb62-bd5280ae87a7', 16 | '3d539f77-ab91-4839-8ba4-120776fc566e', 17 | '9ce488d2-5924-437a-a718-29f0749bd8c6', 18 | '5fa8f2c0-0fa5-44a8-a1f2-7d37a0f8e987', 19 | '762c2f8c-87ac-481e-ba21-5ae6ebd85b21', 20 | '30de8a01-22b1-446b-b51a-2b0c62fdefdc', 21 | '0627fb80-2ae7-4ce1-82e1-c2a0bcdf3317', 22 | 'd9b1eeac-4a10-42b3-8683-70a17bbe04af', 23 | 'e855f926-44f0-4be4-91bb-5c5f7d685eca', 24 | '45b94f06-9d11-4049-9a23-ab80f95dd57e', 25 | 'cc49f0d8-5299-410c-9661-e88c9e2ca516', 26 | '74e6ab1d-8977-40ac-a56a-ece724d9851c', 27 | 'e81cc7d7-a2c5-41da-b452-3325b66defc2' 28 | ]; 29 | 30 | const devMode = !('update_url' in chrome.runtime.getManifest()); 31 | 32 | function ls(callback) { 33 | chrome.runtime.sendMessage({method: "getLocalStorage"}, function (response) { 34 | if(response) { 35 | for (let k in response.data) 36 | localStorage[k] = response.data[k]; 37 | } 38 | if(callback){ 39 | callback(); 40 | } 41 | }); 42 | return localStorage; 43 | } 44 | 45 | const debugLog = (level = 'log', ...msg) => { 46 | /** 47 | * 在开发模式下打印日志 48 | * @param msg 可以为任何值 49 | * @param level console之下的任何函数名称 50 | * */ 51 | if (devMode) { 52 | console[level](...msg) 53 | } 54 | }; 55 | 56 | /** 57 | * 获取在线词源 58 | */ 59 | function getOnlineEtymology(term, callback) { 60 | let url = etho_pre_url + term.toLowerCase(); 61 | let xhr = new XMLHttpRequest(); 62 | xhr.open("GET", url, true); 63 | xhr.onreadystatechange = function () { 64 | if (xhr.readyState == 4) { 65 | let roots = parseEtymology(xhr.responseText, term); 66 | callback(term, {roots: roots, ew: term}) 67 | } 68 | }; 69 | xhr.send(); 70 | } 71 | 72 | function parseEtymology(text, term) { 73 | let wordSelector = 'a.word--C9UPa'; 74 | let data = $(text.replace(/]*>/g, "")).find(`div:has(>${wordSelector})`); 75 | data.find(wordSelector).attr('target', '_blank').replaceWith(function (i, e) { 76 | //let anchor = '' + $(this).text() + '' 77 | return $(this).attr('href', etym_url + $(this).attr('href')); 78 | }); 79 | data.find('>div').remove(); 80 | data.find('>ul').remove(); 81 | if (term) { 82 | data.find('a').filter(function (index) { 83 | return $(this).find('p').text().indexOf(term) < 0; 84 | }).remove(); 85 | } 86 | return data.html() 87 | } 88 | 89 | function getKey() { 90 | let personal_keys = ls()['web_key']; 91 | if (undefined != personal_keys && '' != personal_keys.trim()) { 92 | let p_keys = personal_keys.split(','); 93 | return p_keys[Math.floor(Math.random() * p_keys.length)]; 94 | } 95 | return keys[Math.floor(Math.random() * keys.length)]; 96 | } 97 | function websterUrl(term) { 98 | return 'http://www.dictionaryapi.com/api/v1/references/collegiate/xml/' + term + '?key=' + getKey() 99 | } 100 | function thesaurusUrl(term) { 101 | return 'http://www.dictionaryapi.com/api/v1/references/thesaurus/xml/' + term + '?key=7269ef5b-4d9f-4d38-ac7e-f1ed6e5568f7' 102 | } 103 | 104 | function getOnlineWebsterCollegiate(term, callback) { 105 | getOnlineWebster(term, websterUrl(term.toLowerCase()), callback); 106 | } 107 | 108 | function getOnlineWebsterThesaurus(term, callback) { 109 | getOnlineWebster(term, thesaurusUrl(term.toLowerCase()), callback); 110 | } 111 | 112 | /** 113 | * 获取在线Webster 解释 114 | */ 115 | function getOnlineWebster(term, url, callback) { 116 | let xhr = new XMLHttpRequest(); 117 | xhr.open("GET", url, true); 118 | xhr.onreadystatechange = function () { 119 | if (xhr.readyState == 4) { 120 | let word = $($.parseXML(xhr.responseText)).find('entry').filter(function () { 121 | return $(this).find('ew').text().trim().length <= term.length + 2 122 | }); 123 | let derivatives = word.find('ure').map(function (i, e) { 124 | return e.textContent.replace(/\*/g, '·') 125 | }); 126 | if (undefined != derivatives) derivatives = derivatives.toArray().toString().replace(/,/g, ", "); 127 | let syns = word.find('sx').map(function (i, e) { 128 | return e.textContent.replace(/\*/g, '·') 129 | }); 130 | if (undefined != syns) syns = syns.toArray().toString().replace(/,/g, ", "); 131 | let roots = word.children('et'); 132 | let resp_word = word.children('ew'); 133 | let hw = word.children('hw'); // 音节划分 134 | let fls = word.children('fl'); //lexical class 词性 135 | let defs = word.children('def'); 136 | callback(term, { 137 | derivatives: derivatives, 138 | syns: syns, 139 | roots: roots, 140 | fls: fls, 141 | defs: defs, 142 | hw: hw, 143 | ew: resp_word, 144 | responseText: xhr.responseText 145 | }); 146 | } 147 | }; 148 | xhr.send(); 149 | } 150 | 151 | /** 152 | * have a look at http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.67.9369&rep=rep1&type=pdf 153 | * @param n number of grams 154 | * @param str1 155 | * @param str2 156 | * @returns {number} between 0 and 1, as the similarity of str1 and str2 157 | */ 158 | function n_gram_similarity(n, str1, str2) { 159 | if (str1 && str2) { 160 | str1 = str1.replace(/\s+/g, " "); 161 | str2 = str2.replace(/\s+/g, " "); 162 | 163 | let common_count = 0; 164 | let sets={}; 165 | for (let i = 0; i < str1.length - n; i++) { 166 | sets[str1.substr(i, n)]=1; 167 | } 168 | for (let j = 0; j < str2.length - n; j++) { 169 | let this_str = str2.substr(j, n); 170 | if (1 == sets[this_str]) { 171 | common_count += 1; 172 | sets[this_str] +=1; 173 | } 174 | } 175 | return 2.0*common_count / (str1.length + str2.length - 2*(n-1)) 176 | } 177 | return 0; 178 | } 179 | -------------------------------------------------------------------------------- /js/dictionaries/README.md: -------------------------------------------------------------------------------- 1 | ## 单词来源接口 2 | 3 | 包含: 4 | 5 | - 音标 6 | - 英文释义 7 | - 词根、词缀 8 | 9 | 解析后单个单词对应的数据格式WORD 如后: 10 | 11 | ```json 12 | { 13 | derivatives: 派生词, 14 | syns: 近义词, 15 | roots: 词根词源, 16 | fls: 词性, 17 | defs: 单词定义, 18 | hw: 带音节划分的词如list*less, 19 | ew: 单词 20 | } 21 | ``` 22 | 23 | ## 解析单词的函数 24 | 25 | [common.js] 中,获取及解析Webster 及Etymology 词源的两个函数。 26 | 27 | ```javascript 28 | function getOnlineWebsterCollegiate(term, callback) 29 | function getOnlineEtymology(term, callback) 30 | ``` 31 | 32 | 其中回调函数格式:callback(term, json),term 为查询单词,json 为解析后如上面格式WORD 的数据对象。 33 | 34 | # 添加新的字典 35 | 36 | - 在[common.js] 中添加如上格式的的解析函数F ,并将数据存在格式为WORD 的对象中。 37 | - 在设置页面 [options.html](../options.html) 的“Web Dictionary 使用” 处,添加对应的词典设置 38 | - 在[dict.js](./dict.js) 中添加对应设置后F 函数的调用。 39 | 40 | [common.js]: ../common.js 41 | -------------------------------------------------------------------------------- /js/dictionaries/dict.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 词典添加和配置 3 | * @user Joseph 4 | */ 5 | 6 | 7 | 8 | function findDerivatives(originalTerm, callback) { 9 | if(localStorage['dict'] == 'webster') { 10 | // 设置使用Webster 字典 11 | getOnlineWebsterCollegiate(originalTerm, function (term, json) { 12 | callback({ 13 | term: term, 14 | json: json 15 | }); 16 | }); 17 | } else if (localStorage['dict'] == 'oxford'){ 18 | // 设置使用Oxford 字典 19 | //TODO add oxford dictionary here 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /js/dictionaries/etymology.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Joseph 3 | */ 4 | var originAnchor = undefined; 5 | 6 | function getEtymology() { 7 | originAnchor = undefined; 8 | chrome.runtime.sendMessage({ 9 | method: 'getEtymology', 10 | data: {term: getCurrentTerm()} 11 | }); 12 | } 13 | 14 | function findDerivativesInContentPage(){ 15 | chrome.runtime.sendMessage({ 16 | method: 'findDerivatives', 17 | data: {term: getCurrentTerm()} 18 | }); 19 | } 20 | 21 | chrome.runtime.onMessage.addListener(function (resp, sender, sendResponse) { 22 | debugLog('log', "received\n"); 23 | debugLog('log', resp.data); 24 | switch (resp.callback) { 25 | case 'showEtymology': 26 | showEtymology(resp.data.term, resp.data.json); 27 | break; 28 | case 'showDerivatives': 29 | showDerivatives(resp.data.term, resp.data.json); 30 | break; 31 | case 'popupEtymology': 32 | popup(resp.data.originAnchor, resp.data.term, resp.data.roots); 33 | break; 34 | } 35 | }); 36 | 37 | function popup(anchor, term, text) { 38 | $('.popover-crx').remove(); 39 | $('.popover').remove(); 40 | $('body').append('

' + noteString + '
'); 41 | $('.popover-title').html('' + term + ''); 42 | $('.popover-content').html('

' + text + '

'); 43 | let offset = $(anchor).offset(); 44 | if (undefined != offset) $('.popover-crx').slideDown().offset({ 45 | top: offset.top + 23, 46 | left: offset.left - 130 47 | }); 48 | if (ls()['root2note'] == 'yes') addToNote(".popover-crx a.note-button"); 49 | } 50 | 51 | function popupEtymology(anchor) { 52 | let pre_url = etho_pre_url; 53 | if (undefined == originAnchor || originAnchor.text() != $(anchor).text()) { 54 | if ($(anchor).parents("#roots").length > 0) originAnchor = $(anchor); 55 | //let url = pre_url + $(anchor).text() 56 | let url = $(anchor).attr('href'); 57 | chrome.runtime.sendMessage({ 58 | method: 'popupEtymology', 59 | data: { 60 | originAnchor: originAnchor, 61 | term: $(anchor).text(), 62 | url: url 63 | } 64 | }); 65 | } 66 | } 67 | 68 | function showEtymology(term, json){ 69 | if (getCurrentTerm() == term) { 70 | let roots=json.roots; 71 | addButtons(); 72 | if (undefined != roots && roots.trim() != "" && $('#roots .exist').length == 0) 73 | $("#roots .alert").addClass("well exist").removeClass("alert").html($(roots.trim())); 74 | else if ($('#roots .well').length == 0) $("#roots").hide(); 75 | if (!$("#roots .alert").hasClass("alert") && ls()['root2note'] == 'YES') addToNote("#roots a.note-button"); 76 | } 77 | } 78 | 79 | /** 80 | * 通过在线词典查询,替换同义词、词根、词性、解释等。 81 | */ 82 | function showDerivatives(originalTerm, json) { 83 | if (getCurrentTerm() != originalTerm) { 84 | return; 85 | } 86 | 87 | let word = $($.parseXML(json.responseText)).find('entry').filter(function () { 88 | return $(this).find('ew').text().trim().length <= originalTerm.length 89 | }); 90 | let derivatives = word.find('ure').map(function (i, e) { 91 | return e.textContent.replace(/\*/g, '·') 92 | }); 93 | if (undefined != derivatives) derivatives = derivatives.toArray().toString().replace(/,/g, ", "); 94 | let syns = word.find('sx').map(function (i, e) { 95 | return e.textContent.replace(/\*/g, '·') 96 | }); 97 | if (undefined != syns) syns = syns.toArray().toString().replace(/,/g, ", "); 98 | 99 | let roots = word.children('et'); 100 | let resp_word = word.children('ew'); 101 | let hw = word.children('hw'); // 音节划分 102 | let fls = word.children('fl'); //lexical class 词性 103 | let defs = word.children('def'); 104 | 105 | let term = $('#learning_word .word .content.pull-left'); 106 | let small = term.find('small')[0].outerHTML; 107 | 108 | let responseWord = word.find('ew').text(); 109 | if (getCurrentTerm().length <= 4 + responseWord.length) { 110 | addButtons(); 111 | if (hw.length > 0 && ls()['show_syllabe'] != 'no' && hw[0].textContent.replace(/\*/g, '') == originalTerm) term.html((hw[0].textContent.replace(/\*/g, '·') + small)); 112 | if (undefined != roots && 0 < roots.length && ls()['etym'] == 'webster' && $('#roots .exist').length == 0) { 113 | let r = $("#roots .alert").addClass("well exist").html(roots); 114 | if (0 < r.length) r.html(r.html().replace(/<\/it>/g, "").replace(//g, "")); 115 | r.removeClass("alert"); 116 | if (!$("#roots .alert").length > 0 && ls()['root2note'] == 'YES') addToNote("#roots a.note-button"); 117 | } else if (ls()['etym'] == 'webster') getEtymology(); 118 | if (undefined != derivatives && "" != derivatives.trim() && $('#affix .exist').length == 0) 119 | $("#affix .alert").addClass("well exist").removeClass("alert").html(derivatives + ";
" + derivatives.replace(/·/g, '') + ";
" + syns); 120 | else if ($('#affix .word').length == 0)$("#affix").hide(); 121 | if (!$("#affix .alert").hasClass("alert") && ls()['afx2note'] == 'YES') addToNote("#affix a.note-button"); 122 | if (ls()['web_en'] == 'yes') { 123 | let endef = $("#review-definitions .endf"); 124 | endef.html(''); 125 | if (fls.length == defs.length) fls.each(function (i) { 126 | endef.append($('
').find('span').html($(fls[i]).text().substr(0, 4)).parent()); 127 | let def = $('
    '); 128 | $(defs[i]).find('dt').each(function () { 129 | def.append($('
  1. ').find('span').html($(this).text()).parent()) 130 | }); 131 | endef.append(def) 132 | }) 133 | } 134 | } else if (ls()['etym'] == 'webster') getEtymology() 135 | } 136 | 137 | -------------------------------------------------------------------------------- /js/howler.min.js: -------------------------------------------------------------------------------- 1 | /*! howler.js v2.1.1 | (c) 2013-2018, James Simpson of GoldFire Studios | MIT License | howlerjs.com */ 2 | !function(){"use strict";var e=function(){this.init()};e.prototype={init:function(){var e=this||n;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var o=this||n;if(e=parseFloat(e),o.ctx||_(),void 0!==e&&e>=0&&e<=1){if(o._volume=e,o._muted)return o;o.usingWebAudio&&o.masterGain.gain.setValueAtTime(e,n.ctx.currentTime);for(var t=0;t=0;o--)e._howls[o].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,_()),e},codecs:function(e){return(this||n)._codecs[e.replace(/^x-/,"")]},_setup:function(){var e=this||n;if(e.state=e.ctx?e.ctx.state||"suspended":"suspended",e._autoSuspend(),!e.usingWebAudio)if("undefined"!=typeof Audio)try{var o=new Audio;void 0===o.oncanplaythrough&&(e._canPlayEvent="canplay")}catch(n){e.noAudio=!0}else e.noAudio=!0;try{var o=new Audio;o.muted&&(e.noAudio=!0)}catch(e){}return e.noAudio||e._setupCodecs(),e},_setupCodecs:function(){var e=this||n,o=null;try{o="undefined"!=typeof Audio?new Audio:null}catch(n){return e}if(!o||"function"!=typeof o.canPlayType)return e;var t=o.canPlayType("audio/mpeg;").replace(/^no$/,""),r=e._navigator&&e._navigator.userAgent.match(/OPR\/([0-6].)/g),a=r&&parseInt(r[0].split("/")[1],10)<33;return e._codecs={mp3:!(a||!t&&!o.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!t,opus:!!o.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!o.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!o.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),aac:!!o.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!o.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(o.canPlayType("audio/x-m4a;")||o.canPlayType("audio/m4a;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(o.canPlayType("audio/x-mp4;")||o.canPlayType("audio/mp4;")||o.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),webm:!!o.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),dolby:!!o.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(o.canPlayType("audio/x-flac;")||o.canPlayType("audio/flac;")).replace(/^no$/,"")},e},_unlockAudio:function(){var e=this||n,o=/iPhone|iPad|iPod|Android|BlackBerry|BB10|Silk|Mobi|Chrome|Safari/i.test(e._navigator&&e._navigator.userAgent);if(!e._audioUnlocked&&e.ctx&&o){e._audioUnlocked=!1,e.autoUnlock=!1,e._mobileUnloaded||44100===e.ctx.sampleRate||(e._mobileUnloaded=!0,e.unload()),e._scratchBuffer=e.ctx.createBuffer(1,1,22050);var t=function(n){for(var o=0;o0?i._seek:t._sprite[e][0]/1e3),s=Math.max(0,(t._sprite[e][0]+t._sprite[e][1])/1e3-_),l=1e3*s/Math.abs(i._rate),c=t._sprite[e][0]/1e3,f=(t._sprite[e][0]+t._sprite[e][1])/1e3,p=!(!i._loop&&!t._sprite[e][2]);i._sprite=e,i._ended=!1;var m=function(){i._paused=!1,i._seek=_,i._start=c,i._stop=f,i._loop=p};if(_>=f)return void t._ended(i);var v=i._node;if(t._webAudio){var h=function(){t._playLock=!1,m(),t._refreshBuffer(i);var e=i._muted||t._muted?0:i._volume;v.gain.setValueAtTime(e,n.ctx.currentTime),i._playStart=n.ctx.currentTime,void 0===v.bufferSource.start?i._loop?v.bufferSource.noteGrainOn(0,_,86400):v.bufferSource.noteGrainOn(0,_,s):i._loop?v.bufferSource.start(0,_,86400):v.bufferSource.start(0,_,s),l!==1/0&&(t._endTimers[i._id]=setTimeout(t._ended.bind(t,i),l)),o||setTimeout(function(){t._emit("play",i._id),t._loadQueue()},0)};"running"===n.state?h():(t._playLock=!0,t.once("resume",h),t._clearTimer(i._id))}else{var y=function(){v.currentTime=_,v.muted=i._muted||t._muted||n._muted||v.muted,v.volume=i._volume*n.volume(),v.playbackRate=i._rate;try{var r=v.play();if(r&&"undefined"!=typeof Promise&&(r instanceof Promise||"function"==typeof r.then)?(t._playLock=!0,m(),r.then(function(){t._playLock=!1,v._unlocked=!0,o||(t._emit("play",i._id),t._loadQueue())}).catch(function(){t._playLock=!1,t._emit("playerror",i._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),i._ended=!0,i._paused=!0})):o||(t._playLock=!1,m(),t._emit("play",i._id),t._loadQueue()),v.playbackRate=i._rate,v.paused)return void t._emit("playerror",i._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==e||i._loop?t._endTimers[i._id]=setTimeout(t._ended.bind(t,i),l):(t._endTimers[i._id]=function(){t._ended(i),v.removeEventListener("ended",t._endTimers[i._id],!1)},v.addEventListener("ended",t._endTimers[i._id],!1))}catch(e){t._emit("playerror",i._id,e)}},g=window&&window.ejecta||!v.readyState&&n._navigator.isCocoonJS;if(v.readyState>=3||g)y();else{t._playLock=!0;var b=function(){y(),v.removeEventListener(n._canPlayEvent,b,!1)};v.addEventListener(n._canPlayEvent,b,!1),t._clearTimer(i._id)}}return i._id},pause:function(e){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"pause",action:function(){n.pause(e)}}),n;for(var o=n._getSoundIds(e),t=0;t=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else r.length>=2&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var a;if(!(void 0!==e&&e>=0&&e<=1))return a=o?t._soundById(o):t._sounds[0],a?a._volume:0;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"volume",action:function(){t.volume.apply(t,r)}}),t;void 0===o&&(t._volume=e),o=t._getSoundIds(o);for(var u=0;u0?t/_:t),l=Date.now();e._fadeTo=o,e._interval=setInterval(function(){var r=(Date.now()-l)/t;l=Date.now(),i+=d*r,i=Math.max(0,i),i=Math.min(1,i),i=Math.round(100*i)/100,u._webAudio?e._volume=i:u.volume(i,e._id,!0),a&&(u._volume=i),(on&&i>=o)&&(clearInterval(e._interval),e._interval=null,e._fadeTo=null,u.volume(o,e._id),u._emit("fade",e._id))},s)},_stopFade:function(e){var o=this,t=o._soundById(e);return t&&t._interval&&(o._webAudio&&t._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(t._interval),t._interval=null,o.volume(t._fadeTo,e),t._fadeTo=null,o._emit("fade",e)),o},loop:function(){var e,n,o,t=this,r=arguments;if(0===r.length)return t._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(o=t._soundById(parseInt(r[0],10)))&&o._loop;e=r[0],t._loop=e}else 2===r.length&&(e=r[0],n=parseInt(r[1],10));for(var a=t._getSoundIds(n),u=0;u=0?o=parseInt(r[0],10):e=parseFloat(r[0])}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));var i;if("number"!=typeof e)return i=t._soundById(o),i?i._rate:t._rate;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"rate",action:function(){t.rate.apply(t,r)}}),t;void 0===o&&(t._rate=e),o=t._getSoundIds(o);for(var d=0;d=0?o=parseInt(r[0],10):t._sounds.length&&(o=t._sounds[0]._id,e=parseFloat(r[0]))}else 2===r.length&&(e=parseFloat(r[0]),o=parseInt(r[1],10));if(void 0===o)return t;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"seek",action:function(){t.seek.apply(t,r)}}),t;var i=t._soundById(o);if(i){if(!("number"==typeof e&&e>=0)){if(t._webAudio){var d=t.playing(o)?n.ctx.currentTime-i._playStart:0,_=i._rateSeek?i._rateSeek-i._seek:0;return i._seek+(_+d*Math.abs(i._rate))}return i._node.currentTime}var s=t.playing(o);s&&t.pause(o,!0),i._seek=e,i._ended=!1,t._clearTimer(o),t._webAudio||!i._node||isNaN(i._node.duration)||(i._node.currentTime=e);var l=function(){t._emit("seek",o),s&&t.play(o,!0)};if(s&&!t._webAudio){var c=function(){t._playLock?setTimeout(c,0):l()};setTimeout(c,0)}else l()}return t},playing:function(e){var n=this;if("number"==typeof e){var o=n._soundById(e);return!!o&&!o._paused}for(var t=0;t=0&&n._howls.splice(a,1);var u=!0;for(t=0;t=0){u=!1;break}return r&&u&&delete r[e._src],n.noAudio=!1,e._state="unloaded",e._sounds=[],e=null,null},on:function(e,n,o,t){var r=this,a=r["_on"+e];return"function"==typeof n&&a.push(t?{id:o,fn:n,once:t}:{id:o,fn:n}),r},off:function(e,n,o){var t=this,r=t["_on"+e],a=0;if("number"==typeof n&&(o=n,n=null),n||o)for(a=0;a=0;a--)r[a].id&&r[a].id!==n&&"load"!==e||(setTimeout(function(e){e.call(this,n,o)}.bind(t,r[a].fn),0),r[a].once&&t.off(e,r[a].fn,r[a].id));return t._loadQueue(e),t},_loadQueue:function(e){var n=this;if(n._queue.length>0){var o=n._queue[0];o.event===e&&(n._queue.shift(),n._loadQueue()),e||o.action()}return n},_ended:function(e){var o=this,t=e._sprite;if(!o._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime=0;t--){if(o<=n)return;e._sounds[t]._ended&&(e._webAudio&&e._sounds[t]._node&&e._sounds[t]._node.disconnect(0),e._sounds.splice(t,1),o--)}}},_getSoundIds:function(e){var n=this;if(void 0===e){for(var o=[],t=0;t=0;if(n._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=n._scratchBuffer}catch(e){}return e.bufferSource=null,o}};var t=function(e){this._parent=e,this.init()};t.prototype={init:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,o._sounds.push(e),e.create(),e},create:function(){var e=this,o=e._parent,t=n._muted||e._muted||e._parent._muted?0:e._volume;return o._webAudio?(e._node=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),e._node.gain.setValueAtTime(t,n.ctx.currentTime),e._node.paused=!0,e._node.connect(n.masterGain)):(e._node=n._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(n._canPlayEvent,e._loadFn,!1),e._node.src=o._src,e._node.preload="auto",e._node.volume=t*n.volume(),e._node.load()),e},reset:function(){var e=this,o=e._parent;return e._muted=o._muted,e._loop=o._loop,e._volume=o._volume,e._rate=o._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++n._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this,o=e._parent;o._duration=Math.ceil(10*e._node.duration)/10,0===Object.keys(o._sprite).length&&(o._sprite={__default:[0,1e3*o._duration]}),"loaded"!==o._state&&(o._state="loaded",o._emit("load"),o._loadQueue()),e._node.removeEventListener(n._canPlayEvent,e._loadFn,!1)}};var r={},a=function(e){var n=e._src;if(r[n])return e._duration=r[n].duration,void d(e);if(/^data:[^;]+;base64,/.test(n)){for(var o=atob(n.split(",")[1]),t=new Uint8Array(o.length),a=0;a0?(r[o._src]=e,d(o,e)):t()};"undefined"!=typeof Promise&&1===n.ctx.decodeAudioData.length?n.ctx.decodeAudioData(e).then(a).catch(t):n.ctx.decodeAudioData(e,a,t)},d=function(e,n){n&&!e._duration&&(e._duration=n.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},_=function(){if(n.usingWebAudio){try{"undefined"!=typeof AudioContext?n.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch(e){n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),o=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=o?parseInt(o[1],10):null;if(e&&t&&t<9){var r=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());(n._navigator&&n._navigator.standalone&&!r||n._navigator&&!n._navigator.standalone&&!r)&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=void 0===n.ctx.createGain?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:1,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:n,Howl:o}}),"undefined"!=typeof exports&&(exports.Howler=n,exports.Howl=o),"undefined"!=typeof window?(window.HowlerGlobal=e,window.Howler=n,window.Howl=o,window.Sound=t):"undefined"!=typeof global&&(global.HowlerGlobal=e,global.Howler=n,global.Howl=o,global.Sound=t)}(); -------------------------------------------------------------------------------- /js/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */ 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,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":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w(" 237 | 238 | 239 | 240 | -------------------------------------------------------------------------------- /popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 33 | 34 | 35 |
    36 | 41 |
    42 | 44 | 45 | 46 | 47 | 48 | --------------------------------------------------------------------------------