diff --git a/e107_web/lib/bootstrap-suggest/LICENSE b/e107_web/lib/bootstrap-suggest/LICENSE new file mode 100644 index 000000000..b49373e51 --- /dev/null +++ b/e107_web/lib/bootstrap-suggest/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 Jovanni Lo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/e107_web/lib/bootstrap-suggest/README.md b/e107_web/lib/bootstrap-suggest/README.md new file mode 100644 index 000000000..7f7e28015 --- /dev/null +++ b/e107_web/lib/bootstrap-suggest/README.md @@ -0,0 +1,69 @@ +bootstrap-suggest +============================ +A bootstrap plugin for your mention needs. + +![demo](demo.png "demo") + +## V2 +The version 2 of this plugin now supports bootstrap 4 and `contenteditable` that uses `jquery.caret` (optional). + +## Install +Several quick start options are available: + +- [download](https://github.com/lodev09/bootstrap-suggest/archive/v2.0.2.zip) latest release +- [npm](https://www.npmjs.com/package/bootstrap-suggest): `npm install --save bootstrap-suggest` +- [bower](https://bower.io): `bower install bootstrap-suggest` + +** Make sure to link `bootstrap-suggest.js` and `bootstrap-suggest.css` to your project + +## Usage + +### Markup +```html +
+ + +
+``` + +### Data +``` +var users = [ + {username: 'lodev09', fullname: 'Jovanni Lo'}, + {username: 'foo', fullname: 'Foo User'}, + {username: 'bar', fullname: 'Bar User'}, + {username: 'twbs', fullname: 'Twitter Bootstrap'}, + {username: 'john', fullname: 'John Doe'}, + {username: 'jane', fullname: 'Jane Doe'}, +]; +``` + +### Init +```javascript +$('#comment').suggest('@', { + data: users, + map: function(user) { + return { + value: user.username, + text: ''+user.username+' '+user.fullname+'' + } + } +}) +``` + +## API +http://lodev09.github.io/bootstrap-suggest/#api + +## Feedback +All bugs, feature requests, pull requests, feedback, etc., are welcome. Visit my site at [www.lodev09.com](http://www.lodev09.com "www.lodev09.com"). + +[![LICENSE MIT](https://img.shields.io/badge/Mail%20me%20at-lodev09%40gmail.com-green.svg)](mailto:lodev09@gmail.com) + +## Credits +© 2018 - Coded by Jovanni Lo / [@lodev09](http://twitter.com/lodev09) + +## License + +Released under the MIT license. See [LICENSE](LICENSE) file. + +[![LICENSE MIT](https://img.shields.io/badge/license-MIT-red.svg)](http://opensource.org/licenses/MIT) diff --git a/e107_web/lib/bootstrap-suggest/dist/bootstrap-suggest.css b/e107_web/lib/bootstrap-suggest/dist/bootstrap-suggest.css new file mode 100644 index 000000000..09e9c3e69 --- /dev/null +++ b/e107_web/lib/bootstrap-suggest/dist/bootstrap-suggest.css @@ -0,0 +1,29 @@ +/*! + * bootstra-suggest - v2.0.3 (https://github.com/lodev09/bootstrap-suggest#readme) + * Copyright 2013-2019 Jovanni Lo (lodev09@gmail.com) + * Licensed under MIT (https://github.com/lodev09/bootstrap-suggest/blob/master/LICENSE) + */ + +.suggest { + /* position: relative; */ + top: 7px; + z-index: 30; + text-align: left; +} + +.suggest > .dropdown-menu { + margin-top: 15px; + position: absolute; + height: 200px; + overflow-y: scroll +} + +.suggest > .dropdown-menu > a.dropdown-item { + border-top: 1px solid #eeeeee; + padding: 5px 10px; +} + +.suggest > .dropdown-menu > a.dropdown-item:first-child { + border-top: 0; +} + diff --git a/e107_web/lib/bootstrap-suggest/dist/bootstrap-suggest.js b/e107_web/lib/bootstrap-suggest/dist/bootstrap-suggest.js new file mode 100644 index 000000000..fb277aa4c --- /dev/null +++ b/e107_web/lib/bootstrap-suggest/dist/bootstrap-suggest.js @@ -0,0 +1,592 @@ +/* =================================================== +* bootstrap-suggest.js v2.0.3 +* http://github.com/lodev09/bootstrap-suggest +* =================================================== +* Copyright 2019 Jovanni Lo @lodev09 +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://opensource.org/licenses/MIT +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ========================================================== */ + +(function ($) { + + "use strict"; // jshint ;_; + + var Suggest = function(el, key, options) { + var that = this; + + this.$element = $(el); + this.$items = undefined; + this.options = $.extend(true, {}, $.fn.suggest.defaults, options, this.$element.data(), this.$element.data('options')); + this.key = key; + this.isShown = false; + this.query = ''; + this._queryPos = []; + this._keyPos = -1; + + this.$dropdown = $('
', { + 'class': 'dropdown suggest ' + this.options.dropdownClass, + 'html': $('