diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ca22b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +### Example user template template +### Example user template + +# IntelliJ project files +.idea +*.iml +out +gen +# Created by .ignore support plugin (hsz.mobi) diff --git a/readme.md b/README.md similarity index 59% rename from readme.md rename to README.md index 8990f89..71fcd87 100644 --- a/readme.md +++ b/README.md @@ -1,7 +1,50 @@ +jQuery JSON Tag Editor +====================== + +*jQuery JSON Tag Editor* is a fork of [jQuery-tagEditor](https://goodies.pixabay.com/jquery/tag-editor/demo.html), originally developed by Simon Steinberger for +[Pixabay.com](https://pixabay.com) and licensed under the [MIT license](https://opensource.org/licenses/MIT). This fork maintains the same license and adds the +[Apache License, 2.0](http://www.apache.org/licenses/LICENSE-2.0). + +*jQuery JSON Tag Editor* adds a separation between the visual representation of a tag and the tag itself. Tags are plain JavaScript objects with a `value` attribute +that is its visual representation in the tag editor. `value` plus any other properties that the tag object may have are all stored as +[data attributes](https://developer.mozilla.org/en/docs/Web/Guide/HTML/Using_data_attributes) in each `
Released under the MIT License. - Source on Github (changelog). - Compatible with jQuery 1.7.0+ in Firefox, Safari, Chrome, Opera, Internet Explorer 8+. IE7 technically works, but no care has gone into CSS/layout bugs. - tagEditor depends on accursoft's caret plugin (1.1 kB minified). + Relicensed under the Apache License, 2.0. + Source on Github. + Compatible with jQuery 1.7.0+ in Firefox, Safari, Chrome, Edge, and Internet Explorer 11+. Other or earlier versions of these browsers might work but it hasn’t been tested at all. Use at your own risk! + JSON Tag Editor, as its predecessor, depends on accursoft's caret plugin (1.1 kB minified).
+ New features: +- This plugin was developed by and for Pixabay.com - an international repository for free Public Domain images. - We have implemented this piece of software in production and we share it - in the spirit of Pixabay - freely with others. + This plugin was forked by Alfonso Muñoz-Pomer Fuentes (GitHub repository, blog) + as part of Expression Atlas (GitHub repository). + The original plugin was developed by Pixabay.com - an international repository for free Public Domain images.
- Include the stylesheet jquery.tag-editor.css in the <head> section of your HTML document - and the JavaScript file jquery.tag-editor.min.js after loading jQuery and optional jQuery UI sortable/autocomplete. + Include the stylesheet jquery.json-tag-editor.css in the <head> section of your HTML document - and the JavaScript file jquery.json-tag-editor.min.js after loading jQuery and optional jQuery UI sortable/autocomplete. Make sure to also load accursoft's caret plugin (1.1 kB minified). - tagEditor accepts settings from an object of key/value pairs, and can be assigned to any text input field or textarea. + JSON Tag Editor accepts settings from an object of key/value pairs, and can be assigned to any text input field or textarea.
-$(selector).tagEditor({key1: value1, key2: value2});
+$(selector).jsonTagEditor({key1: value1, key2: value2});
// examples
// assign tag editor to textarea - existing text will be used as initial tags
-$('textarea').tagEditor();
+$('textarea').jsonTagEditor();
// assign tag editor to text input with initial tags
-$('input[type="text"]').tagEditor({ initialTags: ['tag1', 'tag2', 'tag3'] });
+$('input[type="text"]').jsonTagEditor({ initialTags: ['tag1', 'tag2', 'tag3'] });
// use jQuery UI autocomplete
-$('#my_textarea').tagEditor({ autocomplete: { 'source': '/url/', minLength: 3 } });
+$('#my_textarea').jsonTagEditor({ autocomplete: { 'source': '/url/', minLength: 3 } });
| initialTags | [] | Initial tags as an array of strings. |
| maxTags | null | Maximum number of allowed tags. |
| maxLength | 50 | maxlength attribute of the tag input field. |
| delimiter | ',;' | -
- - Required string of delimiters - characters for separating tags. - The first character is used as default delimiter in the (hidden) original field. - - |
-
| maxTagLength | -1 | Maximum length of the displayed tag text. Longer tags are ellipsified. Any negative will have the whole tag value displayed. |
| noSelect | false | Disable selection on the tag editor. |
| placeholder | '' | Placeholder text for empty tag editor. |
| forceLowercase | true | Lowercase all tags. |
| removeDuplicates | true | Automatically remove duplicate tags. |
| clickDelete | false | Delete tags on right click and on Ctrl+click. |
| animateDelete | 175 | Animate duration for deletion of tags in milliseconds. Set to 0 for non-animated removal. |
| sortable | true | If jQuery UI sortable is available and this option is set to true, tags are sortable by drag and drop. |