From 6c877fecb5374905d3f49663c68c20416a847e0e Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 12 Apr 2022 13:47:55 +0200 Subject: Commit --- .gitignore | 9 +- .idea/vcs.xml | 5 + .idea/workspace.xml | 210 +- app/genealogy/.gitignore | 1 - app/genealogy/.gitlab-ci.yml | 15 - app/genealogy/LICENSE | 21 - app/genealogy/README.md | 8 - app/genealogy/SatteliteGiteaData.txt | 1 - app/genealogy/dllib/.gitignore | 2 - app/genealogy/dllib/LICENSE | 20 - app/genealogy/dllib/README.md | 20 - app/genealogy/dllib/bower.json | 8 - app/genealogy/dllib/jquery.flexdatalist.css | 134 -- app/genealogy/dllib/jquery.flexdatalist.js | 2083 -------------------- app/genealogy/dllib/jquery.flexdatalist.min.css | 1 - app/genealogy/dllib/jquery.flexdatalist.min.js | 2 - app/genealogy/dllib/jquery.flexdatalist.min.js.map | 1 - app/genealogy/dllib/jquery.js | 2 - app/genealogy/dllib/org.js | 1 - app/genealogy/dllib/package.json | 30 - .../fonts/Nunito-Italic-VariableFont_wght.ttf | Bin 279936 -> 0 bytes app/genealogy/fonts/Nunito-VariableFont_wght.ttf | Bin 275436 -> 0 bytes app/genealogy/index.php | 188 -- app/genealogy/lib/LICENSE | 21 - app/genealogy/lib/tree_maker-min.css | 1 - app/genealogy/lib/tree_maker-min.js | 1 - app/genealogy/me/index.php | 38 - app/genealogy/person/index.php | 360 ---- app/genealogy/private/footer.php | 16 - app/genealogy/private/header.php | 125 -- app/genealogy/search/birth/data.json/index.php | 39 - app/genealogy/search/birth/index.php | 73 - app/genealogy/search/birth/results/index.php | 38 - app/genealogy/search/city/data.json/index.php | 39 - app/genealogy/search/city/index.php | 73 - app/genealogy/search/city/results/index.php | 38 - app/genealogy/search/death/data.json/index.php | 39 - app/genealogy/search/death/index.php | 73 - app/genealogy/search/death/results/index.php | 38 - app/genealogy/search/dept/data.json/index.php | 39 - app/genealogy/search/dept/index.php | 73 - app/genealogy/search/dept/results/index.php | 38 - app/genealogy/search/index.php | 1 - app/genealogy/search/lastname/data.json/index.php | 39 - app/genealogy/search/lastname/index.php | 73 - app/genealogy/search/lastname/results/index.php | 36 - app/genealogy/search/marriage/data.json/index.php | 39 - app/genealogy/search/marriage/index.php | 73 - app/genealogy/search/marriage/results/index.php | 38 - app/genealogy/search/name/data.json/index.php | 39 - app/genealogy/search/name/index.php | 73 - app/genealogy/search/name/results/index.php | 36 - app/genealogy/search/state/data.json/index.php | 39 - app/genealogy/search/state/index.php | 73 - app/genealogy/search/state/results/index.php | 38 - app/genealogy/style/LICENSE | 21 - app/genealogy/style/tree_maker.css | 40 - app/genealogy/styles/common.css | 49 - app/genealogy/styles/dark.css | 54 - app/genealogy/tree/index.php | 49 - app/genealogy/tree/mktree.php | 165 -- 61 files changed, 37 insertions(+), 4862 deletions(-) delete mode 100644 app/genealogy/.gitignore delete mode 100644 app/genealogy/.gitlab-ci.yml delete mode 100644 app/genealogy/LICENSE delete mode 100644 app/genealogy/README.md delete mode 100644 app/genealogy/SatteliteGiteaData.txt delete mode 100644 app/genealogy/dllib/.gitignore delete mode 100644 app/genealogy/dllib/LICENSE delete mode 100644 app/genealogy/dllib/README.md delete mode 100644 app/genealogy/dllib/bower.json delete mode 100644 app/genealogy/dllib/jquery.flexdatalist.css delete mode 100644 app/genealogy/dllib/jquery.flexdatalist.js delete mode 100644 app/genealogy/dllib/jquery.flexdatalist.min.css delete mode 100644 app/genealogy/dllib/jquery.flexdatalist.min.js delete mode 100644 app/genealogy/dllib/jquery.flexdatalist.min.js.map delete mode 100644 app/genealogy/dllib/jquery.js delete mode 100644 app/genealogy/dllib/org.js delete mode 100644 app/genealogy/dllib/package.json delete mode 100644 app/genealogy/fonts/Nunito-Italic-VariableFont_wght.ttf delete mode 100644 app/genealogy/fonts/Nunito-VariableFont_wght.ttf delete mode 100644 app/genealogy/index.php delete mode 100644 app/genealogy/lib/LICENSE delete mode 100644 app/genealogy/lib/tree_maker-min.css delete mode 100644 app/genealogy/lib/tree_maker-min.js delete mode 100644 app/genealogy/me/index.php delete mode 100644 app/genealogy/person/index.php delete mode 100644 app/genealogy/private/footer.php delete mode 100644 app/genealogy/private/header.php delete mode 100644 app/genealogy/search/birth/data.json/index.php delete mode 100644 app/genealogy/search/birth/index.php delete mode 100644 app/genealogy/search/birth/results/index.php delete mode 100644 app/genealogy/search/city/data.json/index.php delete mode 100644 app/genealogy/search/city/index.php delete mode 100644 app/genealogy/search/city/results/index.php delete mode 100644 app/genealogy/search/death/data.json/index.php delete mode 100644 app/genealogy/search/death/index.php delete mode 100644 app/genealogy/search/death/results/index.php delete mode 100644 app/genealogy/search/dept/data.json/index.php delete mode 100644 app/genealogy/search/dept/index.php delete mode 100644 app/genealogy/search/dept/results/index.php delete mode 100644 app/genealogy/search/index.php delete mode 100644 app/genealogy/search/lastname/data.json/index.php delete mode 100644 app/genealogy/search/lastname/index.php delete mode 100644 app/genealogy/search/lastname/results/index.php delete mode 100644 app/genealogy/search/marriage/data.json/index.php delete mode 100644 app/genealogy/search/marriage/index.php delete mode 100644 app/genealogy/search/marriage/results/index.php delete mode 100644 app/genealogy/search/name/data.json/index.php delete mode 100644 app/genealogy/search/name/index.php delete mode 100644 app/genealogy/search/name/results/index.php delete mode 100644 app/genealogy/search/state/data.json/index.php delete mode 100644 app/genealogy/search/state/index.php delete mode 100644 app/genealogy/search/state/results/index.php delete mode 100644 app/genealogy/style/LICENSE delete mode 100644 app/genealogy/style/tree_maker.css delete mode 100644 app/genealogy/styles/common.css delete mode 100644 app/genealogy/styles/dark.css delete mode 100644 app/genealogy/tree/index.php delete mode 100644 app/genealogy/tree/mktree.php diff --git a/.gitignore b/.gitignore index e546c32..94740f0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,13 @@ private/app.json app/console app/help app/money +app/cdn +app/genealogy +app/media +app/planning +app/session +app/intro private/FamilineConfig.json private/userpics -private/news/20* \ No newline at end of file +private/news/20* +ukraine diff --git a/.idea/vcs.xml b/.idea/vcs.xml index fa2ad59..c8686e3 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,8 +2,13 @@ + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 67b9fc4..3b73656 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,69 +2,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -81,6 +44,7 @@ + @@ -93,139 +57,12 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/genealogy/.gitignore b/app/genealogy/.gitignore deleted file mode 100644 index 33b5b0a..0000000 --- a/app/genealogy/.gitignore +++ /dev/null @@ -1 +0,0 @@ -private/data \ No newline at end of file diff --git a/app/genealogy/.gitlab-ci.yml b/app/genealogy/.gitlab-ci.yml deleted file mode 100644 index e2c9e0e..0000000 --- a/app/genealogy/.gitlab-ci.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Generic Minteck GitLab CI/CD Checks -# PHP applications -image: php:zts-buster - -cache: - paths: - - vendor/ - -before_script: - - apt-get update - - apt-get install -y git - -test: - script: - - bash -c '[[ $(find . -name \*.php -exec php -l {} \; | grep -v "No syntax errors") ]] && exit 2 || exit 0' diff --git a/app/genealogy/LICENSE b/app/genealogy/LICENSE deleted file mode 100644 index 41b02f6..0000000 --- a/app/genealogy/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021- Minteck - -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/app/genealogy/README.md b/app/genealogy/README.md deleted file mode 100644 index 59421c2..0000000 --- a/app/genealogy/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Familine Recall - -* Chemin d'installation attendu : `/mnt/familine/app/genealogy` - -## Installation -1. Copiez les fichiers dans le dossier `/mnt/familine/app/genealogy` -3. Configurez votre serveur Web pour pointer le sous-domaine `genealogy.` vers Familine Recall -4. C'est prêt ! \ No newline at end of file diff --git a/app/genealogy/SatteliteGiteaData.txt b/app/genealogy/SatteliteGiteaData.txt deleted file mode 100644 index b83cb45..0000000 --- a/app/genealogy/SatteliteGiteaData.txt +++ /dev/null @@ -1 +0,0 @@ -Familine Recall \ No newline at end of file diff --git a/app/genealogy/dllib/.gitignore b/app/genealogy/dllib/.gitignore deleted file mode 100644 index dacf83a..0000000 --- a/app/genealogy/dllib/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.code-workspace -prepros.config diff --git a/app/genealogy/dllib/LICENSE b/app/genealogy/dllib/LICENSE deleted file mode 100644 index 4c1e58f..0000000 --- a/app/genealogy/dllib/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sérgio Dinis Lopes - -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/app/genealogy/dllib/README.md b/app/genealogy/dllib/README.md deleted file mode 100644 index 2700445..0000000 --- a/app/genealogy/dllib/README.md +++ /dev/null @@ -1,20 +0,0 @@ -jQuery.Flexdatalist -====== - -Flexdatalist is (another) jQuery autocomplete plugin with support for <datalist>. Check the documentation page to see the plugin in action. - -## Demo & Documentation ## - -Check out the [examples and documentation](http://projects.sergiodinislopes.pt/flexdatalist/) page. - -## Roadmap - -- Improve accessibility -- Allow the search to be disabled on flexdatalist and just use the given list (from server-side) -- Use CSS grid to list multiple selected values -- Regex in JS has bad support for special and accented characters, I'll try to make some improvements __(it works since v2.3.0, but it won't highlight the word, though)__ -- Make it jQuery independent (this will take a while to make it to a release) - -### License -Flexdatalist is licensed under the [MIT license](http://opensource.org/licenses/MIT). -Copyright (c) 2016 - 2021 [Sérgio Dinis Lopes](http://github.com/sergiodlopes) \ No newline at end of file diff --git a/app/genealogy/dllib/bower.json b/app/genealogy/dllib/bower.json deleted file mode 100644 index 69ff491..0000000 --- a/app/genealogy/dllib/bower.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "jquery-flexdatalist", - "version": "2.3.0", - "main": ["jquery.flexdatalist.js"], - "dependencies": { - "jquery": ">=1.8" - } -} diff --git a/app/genealogy/dllib/jquery.flexdatalist.css b/app/genealogy/dllib/jquery.flexdatalist.css deleted file mode 100644 index 03e1b9c..0000000 --- a/app/genealogy/dllib/jquery.flexdatalist.css +++ /dev/null @@ -1,134 +0,0 @@ -/** - * jQuery Flexdatalist basic stylesheet. - * - * Version: - * 2.2.1 - * - * Github: - * https://github.com/sergiodlopes/jquery-flexdatalist/ - * - */ -.flexdatalist-results { - position: absolute; - top: 0; - left: 0; - border: 1px solid #444; - border-top: none; - background: #fff; - z-index: 100000; - max-height: 300px; - overflow-y: auto; - box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15); - color: #333; - list-style: none; - margin: 0; - padding: 0; -} -.flexdatalist-results li { - border-bottom: 1px solid #ccc; - padding: 8px 15px; - font-size: 14px; - line-height: 20px; -} -.flexdatalist-results li span.highlight { - font-weight: 700; - text-decoration: underline; -} -.flexdatalist-results li.active { - background: #2B82C9; - color: #fff; - cursor: pointer; -} -.flexdatalist-results li.no-results { - font-style: italic; - color: #888; -} - -/** - * Grouped items - */ -.flexdatalist-results li.group { - background: #F3F3F4; - color: #666; - padding: 8px 8px; -} -.flexdatalist-results li .group-name { - font-weight: 700; -} -.flexdatalist-results li .group-item-count { - font-size: 85%; - color: #777; - display: inline-block; - padding-left: 10px; -} - -/** - * Multiple items - */ -.flexdatalist-multiple:before { - content: ''; - display: block; - clear: both; -} -.flexdatalist-multiple { - width: 100%; - margin: 0; - padding: 0; - list-style: none; - text-align: left; - cursor: text; -} -.flexdatalist-multiple.disabled { - background-color: #eee; - cursor: default; -} -.flexdatalist-multiple:after { - content: ''; - display: block; - clear: both; -} -.flexdatalist-multiple li { - display: inline-block; - position: relative; - margin: 5px; -} -.flexdatalist-multiple li.input-container, -.flexdatalist-multiple li.input-container input { - border: none; - height: auto; - padding: 0 0 0 4px; - line-height: 24px; -} - -.flexdatalist-multiple li.value { - display: inline-block; - padding: 2px 25px 2px 7px; - background: #efefef; - border-radius: 3px; - color: #444; - line-height: 20px; - float: left; -} -.flexdatalist-multiple li.toggle { - cursor: pointer; - transition: opacity ease-in-out 300ms; -} -.flexdatalist-multiple li.toggle.disabled { - text-decoration: line-through; - opacity: 0.80; -} - -.flexdatalist-multiple li.value span.fdl-remove { - font-weight: 700; - padding: 2px 5px; - font-size: 20px; - line-height: 20px; - cursor: pointer; - position: absolute; - top: 0; - right: 0; - opacity: 0.70; -} -.flexdatalist-multiple li.value span.fdl-remove:hover { - opacity: 1; -} diff --git a/app/genealogy/dllib/jquery.flexdatalist.js b/app/genealogy/dllib/jquery.flexdatalist.js deleted file mode 100644 index 6fef98b..0000000 --- a/app/genealogy/dllib/jquery.flexdatalist.js +++ /dev/null @@ -1,2083 +0,0 @@ -/** - * jQuery Flexdatalist. - * Autocomplete input fields, with support for datalists. - * - * Version: - * 2.3.0 - * - * Depends: - * jquery.js > 1.8.3 - * - * Demo and Documentation: - * http://projects.sergiodinislopes.pt/flexdatalist/ - * - * Github: - * https://github.com/sergiodlopes/jquery-flexdatalist/ - * - */ - -jQuery.fn.flexdatalist = function (_option, _value) { - 'use strict'; - - var destroy = function ($flex, clear) { - $flex.each(function () { - var $this = $(this), - data = $this.data(), - options = data.flexdatalist, - $aliascontainer = data.aliascontainer; - - if ($aliascontainer) { - $this.removeClass('flexdatalist-set') - .attr({'style': null, 'tabindex': null}) - .val((options && options.originalValue && !clear ? options.originalValue : '')) - .removeData('flexdatalist') - .removeData('aliascontainer') - .off(); - $aliascontainer.remove(); - } - }); - } - - // Callable stuff - if (typeof _option === 'string' && _option !== 'reset') { - if (typeof this[0] === 'object' && typeof this[0].fvalue !== 'undefined') { - var target = this[0]; - if (_option === 'destroy') { - destroy(this, _value); - // Get/Set value - } else if (_option === 'value') { - if (typeof _value === 'undefined') { - return target.fvalue.get(); - } - target.fvalue.set(_value); - // Add value - } else if (_option === 'add') { - if (typeof _value === 'undefined') { - return target.debug('Missing value to add!'); - } - target.fvalue.add(_value); - // Toggle value - } else if (_option === 'toggle') { - if (typeof _value === 'undefined') { - return target.debug('Missing value to toggle!'); - } - target.fvalue.toggle(_value); - // Remove value - } else if (_option === 'remove') { - if (typeof _value === 'undefined') { - return target.debug('Missing value to remove!'); - } - target.fvalue.remove(_value); - // Disabled/enabled - } else if (_option === 'disabled') { - if (typeof _value === 'undefined') { - return target.fdisabled(); - } - target.fdisabled(_value); - // Option(s) - } else if (typeof _option === 'string') { - if (typeof _value === 'undefined') { - return target.options.get(_option); - } - target.options.set(_option, _value); - } - return this; - } - _option = {_option: _value}; - } - - // Destroy if already set - if (this.length > 0 && typeof this[0].fvalue !== 'undefined') { - destroy(this); - } - - var _options = $.extend({ - url: null, - data: [], - params: {}, - relatives: null, - chainedRelatives: false, - cache: true, - cacheLifetime: 60, - minLength: 3, - groupBy: false, - selectionRequired: false, - focusFirstResult: false, - textProperty: null, - valueProperty: null, - visibleProperties: [], - iconProperty: 'thumb', - searchIn: ['label'], - searchContain: false, - searchEqual: false, - searchByWord: false, - searchDisabled: false, - searchDelay: 400, - normalizeString: null, - multiple: null, - disabled: null, - maxShownResults: 100, - removeOnBackspace: true, - noResultsText: 'No results found for "{keyword}"', - toggleSelected: false, - allowDuplicateValues: false, - redoSearchOnFocus: true, - requestType: 'get', - requestContentType: 'x-www-form-urlencoded', - requestHeaders: null, - resultsProperty: 'results', - keywordParamName: 'keyword', - searchContainParamName: 'contain', - limitOfValues: 0, - valuesSeparator: ',', - debug: true - }, _option); - - return this.each(function (id) { - var $this = $(this), - _this = this, - _searchTimeout = null, - _values = [], - fid = 'flex' + id, - $alias = null, - $multiple = null; - - /** - * Initialization - */ - this.init = function () { - var options = this.options.init(); - this.set.up(); - - $alias - // Focusin - .on('focusin', function (event) { - _this.action.redoSearchFocus(event); - _this.action.showAllResults(event); - if ($multiple) { - $multiple.addClass('focus'); - } - }) - // Keydown - .on('input keydown', function (event) { - if (_this.keyNum(event) === 9) { - _this.results.remove(); - } - _this.action.keypressValue(event, 188); - _this.action.backSpaceKeyRemove(event); - }) - // Keyup - .on('input keyup', function (event) { - _this.action.keypressValue(event, 13); - _this.action.keypressSearch(event); - _this.action.copyValue(event); - _this.action.backSpaceKeyRemove(event); - _this.action.showAllResults(event); - _this.action.clearValue(event); - _this.action.removeResults(event); - _this.action.inputWidth(event); - }) - // Focusout - .on('focusout', function (event) { - if ($multiple) { - $multiple.removeClass('focus'); - } - _this.action.clearText(event); - _this.action.clearValue(event); - }); - - window.onresize = function (event) { - _this.position(); - }; - - // Run garbage collector - this.cache.gc(); - - if (options.selectionRequired) { - _this.fvalue.clear(true, true); - } - this.fvalue._load(options.originalValue, function (values, matches) { - _this.fdisabled(options.disabled); - $this.trigger('init:flexdatalist', [options]); - }, true); - } - - /** - * Handle user actions. - */ - this.action = { - /** - * Add value on comma or enter keypress. - */ - keypressValue: function (event, keyCode) { - var key = _this.keyNum(event), - val = $alias[0].value, - options = _this.options.get(); - - if (val.length > 0 - && key === keyCode - && !options.selectionRequired - && options.multiple) { - var val = $alias[0].value; - event.preventDefault(); - event.stopPropagation(); - _this.fvalue.extract(val); - _this.results.remove(); - } - }, - /** - * Check if keypress is valid. - */ - keypressSearch: function (event) { - var key = _this.keyNum(event), - keyword = $alias.val(), - length = keyword.length, - options = _this.options.get(); - - clearTimeout(_searchTimeout); - if (!key || (key !== 13 && (key < 37 || key > 40))) { - _searchTimeout = setTimeout(function () { - if ((options.minLength === 0 && length > 0) || (options.minLength > 0 && length >= options.minLength)) { - _this.data.load(function (data) { - _this.search.get(keyword, data, function (matches) { - _this.results.show(matches); - }); - }); - } - }, options.searchDelay); - } - }, - /** - * Redo search if input get's back on focus and no value selected. - */ - redoSearchFocus: function (event) { - var val = _this.fvalue.get(), - options = _this.options.get(), - alias = $alias.val(); - if (options.redoSearchOnFocus && ((alias.length > 0 && options.multiple) || (alias.length > 0 && val.length === 0))) { - this.keypressSearch(event); - } - }, - /** - * Copy value from alias to target input. - */ - copyValue: function (event) { - if (_this.keyNum(event) !== 13) { - var keyword = $alias.val(), - val = _this.fvalue.get(true), - options = _this.options.get(); - if (!options.multiple && !options.selectionRequired && keyword.length !== val.length) { - _this.fvalue.extract(keyword); - } - } - }, - /** - * Remove value on backspace key (multiple input only). - */ - backSpaceKeyRemove: function (event) { - var options = _this.options.get(); - if (options.removeOnBackspace && options.multiple) { - var val = $alias.val(), - $remove = $alias.data('_remove'); - if (_this.keyNum(event) === 8) { - if (val.length === 0) { - if ($remove) { - _this.fvalue.remove($remove); - $alias.data('_remove', null); - } else { - $alias.data('_remove', $alias.parents('li:eq(0)').prev()); - } - } else { - $alias.data('_remove', null); - } - } - } - }, - /** - * Show all results if minLength option is 0. - */ - showAllResults: function (event) { - var val = $alias.val(); - val = $.trim(val); - if (val === '' && _this.options.get('minLength') === 0) { - _this.data.load(function (data) { - _this.results.show(data); - }); - } - }, - /** - * Calculate input width by number of characters. - */ - inputWidth: function (event) { - var options = _this.options.get(); - if (options.multiple) { - var keyword = $alias.val(), - fontSize = parseInt($alias.css('fontSize').replace('px', '')), - minWidth = 40, - maxWidth = $this.innerWidth(), - width = ((keyword.length + 1) * fontSize); - - if (width >= minWidth && width <= maxWidth) { - $alias[0].style.width = width + 'px'; - } - } - }, - /** - * Clear text/alias input when criteria is met. - */ - clearText: function (event) { - var val = _this.fvalue.get(), - options = _this.options.get(); - - if (!options.multiple && options.selectionRequired && val.length === 0) { - $alias[0].value = ''; - } - }, - /** - * Clear value when criteria is met. - */ - clearValue: function (event) { - var val = _this.fvalue.get(), - keyword = $alias.val(), - options = _this.options.get(); - - if (!options.multiple && options.selectionRequired && keyword.length <= options.minLength) { - _this.fvalue.clear(); - } - }, - /** - * Remove results when criteria is met. - */ - removeResults: function (event) { - var keyword = $alias.val(), - options = _this.options.get(); - if (options.minLength > 0 && keyword.length < options.minLength) { - _this.results.remove(); - } - } - } - - /** - * Setup flex. - */ - this.set = { - /** - * Prepare input replacement. - */ - up: function () { - $alias = this.getAlias(); - if (_this.options.get('multiple')) { - $multiple = this.multipleInput($alias); - } else { - $alias.insertAfter($this); - } - - this.accessibility($alias); - - // Respect autofocus attribute - if ($this.attr('autofocus')) { - $alias.trigger('focus'); - } - - $this.data('aliascontainer', ($multiple ? $multiple : $alias)).addClass('flexdatalist flexdatalist-set').css({ - 'position': 'absolute', - 'top': -14000, - 'left': -14000 - }).attr('tabindex', -1); - - // update input label with alias id - var inputId = $this.attr('id'), - aliasId = $alias.attr('id'); - $('label[for="' + inputId + '"]').attr('for', aliasId); - - this.chained(); - }, - /** - * Create and return the alias input field for single value input. - */ - getAlias: function () { - var aliasid = ($this.attr('id') ? $this.attr('id') + '-flexdatalist' : fid); - var $alias = $('') - .attr({ - 'class': $this.attr('class'), - 'name': ($this.attr('name') ? 'flexdatalist-' + $this.attr('name') : null), - 'id': aliasid, - 'placeholder': $this.attr('placeholder') - }) - .addClass('flexdatalist-alias ' + aliasid) - .removeClass('flexdatalist') - .attr('autocomplete', 'off'); - return $alias; - }, - /** - * Multiple values input/list - */ - multipleInput: function ($alias) { - $multiple = $('