├── jekyll-search.jpg ├── .gitignore ├── search ├── img │ ├── cb-close.png │ └── cb-search.png ├── cb-search.json ├── cb-footer-add.html ├── css │ └── cb-search.css └── js │ ├── cb-search.js │ └── bootstrap3-typeahead.min.js ├── README.md └── LICENSE /jekyll-search.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/androiddevelop/jekyll-search/HEAD/jekyll-search.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .idea/jekyll-search.iml 3 | .idea/markdown-navigator.xml 4 | .idea/markdown-navigator/ 5 | -------------------------------------------------------------------------------- /search/img/cb-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/androiddevelop/jekyll-search/HEAD/search/img/cb-close.png -------------------------------------------------------------------------------- /search/img/cb-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/androiddevelop/jekyll-search/HEAD/search/img/cb-search.png -------------------------------------------------------------------------------- /search/cb-search.json: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | { 5 | "code" : 0 , 6 | "data" : [ 7 | {% for post in site.posts %} 8 | { 9 | "title" : "{{ post.title | remove: '"' }} - {% for tag in post.tags %}{% if forloop.rindex != 1 %}{{ tag }}_{% else %}{{ tag }}{% endif %}{% endfor %}", 10 | "url" : "{{ post.url }}" 11 | } 12 | {% if forloop.rindex != 1 %} 13 | , 14 | {% endif %} 15 | {% endfor %} 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /search/cb-footer-add.html: -------------------------------------------------------------------------------- 1 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /search/css/cb-search.css: -------------------------------------------------------------------------------- 1 | @media screen and (min-width: 768px) { 2 | .dropdown-menu { 3 | position:relative; 4 | float: none; 5 | font-size: 20px; 6 | width: 70%; 7 | margin: 0 15%; 8 | } 9 | 10 | .cb-search-tool ul{ 11 | width: 70% ; 12 | white-space:nowrap; 13 | overflow:hidden; 14 | text-overflow: ellipsis; 15 | } 16 | 17 | 18 | .cb-search-content { 19 | width: 70%; 20 | margin: 0 15%; 21 | position: absolute; 22 | top: 13%; 23 | left: auto; 24 | right: auto; 25 | font-size: 22px; 26 | height: 50px; 27 | background-color: #eee; 28 | color: black; 29 | opacity: 1.0; 30 | } 31 | } 32 | 33 | @media screen and (max-width: 767px) { 34 | .dropdown-menu { 35 | position:relative; 36 | float: none; 37 | font-size: 20px; 38 | width: 96%; 39 | margin: 0 2%; 40 | } 41 | .cb-search-tool ul{ 42 | width: 96% ; 43 | white-space:nowrap; 44 | overflow:hidden; 45 | text-overflow: ellipsis; 46 | } 47 | 48 | .cb-search-content { 49 | width: 96%; 50 | margin: 0 2%; 51 | position: absolute; 52 | top: 10%; 53 | left: auto; 54 | right: auto; 55 | font-size: 22px; 56 | height: 50px; 57 | background-color: #eee; 58 | color: black; 59 | opacity: 1.0; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jekyll-Search 2 | 3 | 4 | #### **jekyll博客搜索插件** 5 | 6 | hexo博客搜索插件请前往 [Hexo-Search](https://github.com/androiddevelop/hexo-search) 7 | 8 | ### 截图 9 | 10 | ![jekyll-search.jpg](jekyll-search.jpg) 11 | 12 | 也可以打开[https://www.codeboy.me](https://www.codeboy.me)查看效果 13 | 14 | ### 操作 15 | 16 | 1. 点击右下角图标进行搜索 17 | 2. 双击ctrl键进行搜索或关闭 18 | 3. 搜索页面点击右上角关闭按钮关闭搜索试图 19 | 20 | ### 加入步骤 21 | 22 | 1. 将search目录放至于博客根目录下,其中search目录结构如下: 23 | 24 | search 25 | ├── cb-footer-add.html 26 | ├── cb-search.json 27 | ├── css 28 | │   └── cb-search.css 29 | ├── img 30 | │   ├── cb-close.png 31 | │   └── cb-search.png 32 | └── js 33 | ├── bootstrap3-typeahead.min.js 34 | └── cb-search.js 35 | 36 | 37 | 2. 在 `_include/footer.html` 中的 `` 后加入 `cb-footer-add.html` 中的内容即可。 38 | 39 | 40 | ### 注意事项 41 | 42 | 1.需要事先引入 **jquery** 与 **bootstrap3(js与css文件)** 框架,如果没有的话,操作如下: 43 | 44 | 在`_include/head.html` 中引入以下代码: 45 | 46 | ``` 47 | 48 | ``` 49 | 在`_include/footer.html` 中引入以下代码: 50 | 51 | ``` 52 | 53 | 54 | 55 | 56 | 57 | ``` 58 | **`bootstrap3-typeahead.min.js` 的引入必须在`jquery.min.js`引入之后,即在`footer.html`中的行数更靠后!** 59 | 60 | 2.默认联想8个,如果需要更多的话,请检索 `bootstrap3-typeahead.min.js` 中的 **items:8** , 将 **8** 替换成自己需要的数值。 61 | 62 | 3. 文章标题请不要使用回车等符号,回车等符号会造成json解析错误。 63 | 64 | ### 更新历史 65 | 66 | #### v1.0.4 67 | 68 | - 关闭chrome自动补全。 69 | 70 | #### v1.0.3 71 | 72 | - 支持标题中含有双引号。 73 | 74 | #### v1.0.2 75 | 76 | - 添加错误console输出。 77 | 78 | #### v1.0.1 79 | 80 | - 增加firefox支持。 81 | 82 | #### v1.0.0 83 | 84 | - 支持jekyll中进行文章搜索。 85 | 86 | 87 | ## License 88 | 89 | ``` 90 | Copyright 2016 Yuedong.li 91 | 92 | Licensed under the Apache License, Version 2.0 (the "License"); 93 | you may not use this file except in compliance with the License. 94 | You may obtain a copy of the License at 95 | 96 | http://www.apache.org/licenses/LICENSE-2.0 97 | 98 | Unless required by applicable law or agreed to in writing, software 99 | distributed under the License is distributed on an "AS IS" BASIS, 100 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 101 | See the License for the specific language governing permissions and 102 | limitations under the License. 103 | ``` 104 | 105 | > 有任何问题,欢迎发送邮件到app@codeboy.me交流. 106 | 107 | 108 | -------------------------------------------------------------------------------- /search/js/cb-search.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | var time1 = 0; 3 | var show = false; 4 | var names = new Array(); //文章名字等 5 | var urls = new Array(); //文章地址 6 | $(document).keyup(function (e) { 7 | var time2 = new Date().getTime(); 8 | if (e.keyCode == 17) { 9 | var gap = time2 - time1; 10 | time1 = time2; 11 | if (gap < 500) { 12 | if (show) { 13 | $(".cb-search-tool").css("display", "none"); 14 | show = false; 15 | } else { 16 | $(".cb-search-tool").css("display", "block"); 17 | show = true; 18 | $("#cb-search-content").val(""); 19 | $("#cb-search-content").focus(); 20 | } 21 | time1 = 0; 22 | } 23 | } else if (e.keyCode == 27) { 24 | $(".cb-search-tool").css("display", "none"); 25 | show = false; 26 | time1 = 0; 27 | } 28 | }); 29 | 30 | $("#cb-search-content").keyup(function (e) { 31 | var time2 = new Date().getTime(); 32 | if (e.keyCode == 17) { 33 | var gap = time2 - time1; 34 | time1 = time2; 35 | if (gap < 500) { 36 | if (show) { 37 | $(".cb-search-tool").css("display", "none"); 38 | show = false; 39 | } else { 40 | $(".cb-search-tool").css("display", "block"); 41 | show = true; 42 | $("#cb-search-content").val(""); 43 | $("#cb-search-content").focus(); 44 | } 45 | time1 = 0; 46 | } 47 | } 48 | }); 49 | 50 | $("#cb-close-btn").click(function () { 51 | $(".cb-search-tool").css("display", "none"); 52 | show = false; 53 | time1 = 0; 54 | }); 55 | 56 | $("#cb-search-btn").click(function () { 57 | $(".cb-search-tool").css("display", "block"); 58 | show = true; 59 | $("#cb-search-content").val(""); 60 | $("#cb-search-content").focus(); 61 | time1 = 0; 62 | }); 63 | 64 | $.getJSON("/search/cb-search.json").done(function (data) { 65 | if (data.code == 0) { 66 | for (var index in data.data) { 67 | var item = data.data[index]; 68 | names.push(item.title); 69 | urls.push(item.url); 70 | } 71 | 72 | $("#cb-search-content").typeahead({ 73 | source: names, 74 | 75 | afterSelect: function (item) { 76 | $(".cb-search-tool").css("display", "none"); 77 | show = false; 78 | window.location.href = (urls[names.indexOf(item)]); 79 | return item; 80 | } 81 | }); 82 | } 83 | }).error(function (data, b) { 84 | console.log("json解析错误,搜索功能暂不可用,请检查文章title,确保不含有换行等特殊符号"); 85 | }); 86 | 87 | }); 88 | -------------------------------------------------------------------------------- /search/js/bootstrap3-typeahead.min.js: -------------------------------------------------------------------------------- 1 | !function(a,b){"use strict";"undefined"!=typeof module&&module.exports?module.exports=b(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):b(a.jQuery)}(this,function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.select=this.options.select||this.select,this.autoSelect="boolean"==typeof this.options.autoSelect?this.options.autoSelect:!0,this.highlighter=this.options.highlighter||this.highlighter,this.render=this.options.render||this.render,this.updater=this.options.updater||this.updater,this.displayText=this.options.displayText||this.displayText,this.source=this.options.source,this.delay=this.options.delay,this.$menu=a(this.options.menu),this.$appendTo=this.options.appendTo?a(this.options.appendTo):null,this.shown=!1,this.listen(),this.showHintOnFocus="boolean"==typeof this.options.showHintOnFocus?this.options.showHintOnFocus:!1,this.afterSelect=this.options.afterSelect,this.addItem=!1};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").data("value");if(this.$element.data("active",a),this.autoSelect||a){var b=this.updater(a);this.$element.val(this.displayText(b)||b).change(),this.afterSelect(b)}return this.hide()},updater:function(a){return a},setSource:function(a){this.source=a},show:function(){var b,c=a.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return b="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight,(this.$appendTo?this.$menu.appendTo(this.$appendTo):this.$menu.insertAfter(this.$element)).css({top:c.top+c.height+b,left:c.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){if(this.query="undefined"!=typeof b&&null!==b?b:this.$element.val()||"",this.query.length0?this.$element.data("active",b[0]):this.$element.data("active",null),this.options.addItem&&b.push(this.options.addItem),"all"==this.options.items?this.render(b).show():this.render(b.slice(0,this.options.items)).show()):this.shown?this.hide():this},matcher:function(a){var b=this.displayText(a);return~b.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){for(var b,c=[],d=[],e=[];b=a.shift();){var f=this.displayText(b);f.toLowerCase().indexOf(this.query.toLowerCase())?~f.indexOf(this.query)?d.push(b):e.push(b):c.push(b)}return c.concat(d,e)},highlighter:function(b){var c,d,e,f,g,h=a("
"),i=this.query,j=b.toLowerCase().indexOf(i.toLowerCase());if(c=i.length,0===c)return h.text(b).html();for(;j>-1;)d=b.substr(0,j),e=b.substr(j,c),f=b.substr(j+c),g=a("").text(e),h.append(document.createTextNode(d)).append(g),b=f,j=b.toLowerCase().indexOf(i.toLowerCase());return h.append(document.createTextNode(b)).html()},render:function(b){var c=this,d=this,e=!1;return b=a(b).map(function(b,f){var g=d.displayText(f);return b=a(c.options.item).data("value",f),b.find("a").html(c.highlighter(g)),g==d.$element.val()&&(b.addClass("active"),d.$element.data("active",f),e=!0),b[0]}),this.autoSelect&&!e&&(b.first().addClass("active"),this.$element.data("active",b.first().data("value"))),this.$menu.html(b),this},displayText:function(a){return a.name||a},next:function(){var b=this.$menu.find(".active").removeClass("active"),c=b.next();c.length||(c=a(this.$menu.find("li")[0])),c.addClass("active")},prev:function(){var a=this.$menu.find(".active").removeClass("active"),b=a.prev();b.length||(b=this.$menu.find("li").last()),b.addClass("active")},listen:function(){this.$element.on("focus",a.proxy(this.focus,this)).on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",a.proxy(this.keydown,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this)).on("mouseleave","li",a.proxy(this.mouseleave,this))},destroy:function(){this.$element.data("typeahead",null),this.$element.data("active",null),this.$element.off("focus").off("blur").off("keypress").off("keyup"),this.eventSupported("keydown")&&this.$element.off("keydown"),this.$menu.remove()},eventSupported:function(a){var b=a in this.$element;return b||(this.$element.setAttribute(a,"return;"),b="function"==typeof this.$element[a]),b},move:function(a){if(this.shown){switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:if(a.shiftKey)return;a.preventDefault(),this.prev();break;case 40:if(a.shiftKey)return;a.preventDefault(),this.next()}a.stopPropagation()}},keydown:function(b){this.suppressKeyPressRepeat=~a.inArray(b.keyCode,[40,38,9,13,27]),this.shown||40!=b.keyCode?this.move(b):this.lookup()},keypress:function(a){this.suppressKeyPressRepeat||this.move(a)},keyup:function(a){switch(a.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},focus:function(){this.focused||(this.focused=!0,this.options.showHintOnFocus&&this.lookup(""))},blur:function(){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(a){a.stopPropagation(),a.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(b){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")},mouseleave:function(){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var c=a.fn.typeahead;a.fn.typeahead=function(c){var d=arguments;return"string"==typeof c&&"getActive"==c?this.data("active"):this.each(function(){var e=a(this),f=e.data("typeahead"),g="object"==typeof c&&c;f||e.data("typeahead",f=new b(this,g)),"string"==typeof c&&(d.length>1?f[c].apply(f,Array.prototype.slice.call(d,1)):f[c]())})},a.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
  • ',minLength:1,scrollHeight:0,autoSelect:!0,afterSelect:a.noop,delay:0,addItem:!1},a.fn.typeahead.Constructor=b,a.fn.typeahead.noConflict=function(){return a.fn.typeahead=c,this},a(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(){var b=a(this);b.data("typeahead")||b.typeahead(b.data())})}); -------------------------------------------------------------------------------- /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, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------