From e19c19dfa6d47d7c99d973e2d4d62919c5845242 Mon Sep 17 00:00:00 2001 From: Yogesh Ojha Date: Sun, 7 Mar 2021 18:45:27 +0530 Subject: [PATCH] Removed tag input plugin --- static/plugins/taginput/tags-input.css | 51 ------- static/plugins/taginput/tags-input.js | 195 ------------------------- 2 files changed, 246 deletions(-) delete mode 100644 static/plugins/taginput/tags-input.css delete mode 100644 static/plugins/taginput/tags-input.js diff --git a/static/plugins/taginput/tags-input.css b/static/plugins/taginput/tags-input.css deleted file mode 100644 index dacdd7ad..00000000 --- a/static/plugins/taginput/tags-input.css +++ /dev/null @@ -1,51 +0,0 @@ -/* - =============================== - @Import Function - =============================== -*/ -/* - =============================== - @Import Mixins - =============================== -*/ -.tags-input-wrapper { - background: transparent; - padding: 10px; - border-radius: 4px; -} - -.tags-input-wrapper input { - height: auto; - width: 100%; - border: 1px solid #bfc9d4; - color: #3b3f5c; - display: block; - font-weight: 400; - line-height: 1.5; - background-clip: padding-box; - border-radius: .25rem; - transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out; - height: auto; - font-size: 15px; - padding: 8px 10px; - letter-spacing: 1px; -} -.tags-input-wrapper input:focus { - box-shadow: 0 0 5px 2px rgba(194, 213, 255, 0.619608); - border-color: #1b55e2; - color: #3b3f5c; } -.tags-input-wrapper .tag { - display: inline-block; - background-color: #2196f3; - color: #fff; - font-size: 16px; - border-radius: 4px; - padding: 4px 3px 3px 7px; - margin-right: 15px; - margin-bottom: 7px; - box-shadow: 0 5px 15px -2px rgba(43, 80, 237, 0.35); -} -.tags-input-wrapper .tag a { - margin: 0 7px 3px; - display: inline-block; - cursor: pointer; } diff --git a/static/plugins/taginput/tags-input.js b/static/plugins/taginput/tags-input.js deleted file mode 100644 index c3530523..00000000 --- a/static/plugins/taginput/tags-input.js +++ /dev/null @@ -1,195 +0,0 @@ -/* - ================== - Pollyfills - ================== -*/ - -/* Object.assign() Pollyfill */ -"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),r=1;r= this.options.max ){ - console.log('max tags limit reached'); - return true; - } - - if(!this.options.duplicate && this.arr.indexOf(string) != -1 ){ - console.log('duplicate found " '+string+' " ') - return true; - } - - return false; - } - - // Add tags programmatically - TagsInput.prototype.addData = function(array){ - var plugin = this; - - array.forEach(function(string){ - plugin.addTag(string); - }) - return this; - } - - // Get the Input String - TagsInput.prototype.getInputString = function(){ - return this.arr.join(','); - } - - - // destroy the plugin - TagsInput.prototype.destroy = function(){ - this.orignal_input.removeAttribute('hidden'); - - delete this.orignal_input; - var self = this; - - Object.keys(this).forEach(function(key){ - if(self[key] instanceof HTMLElement) - self[key].remove(); - - if(key != 'options') - delete self[key]; - }); - - initialized = false; - } - - // Private function to initialize the tag input plugin - function init(tags){ - tags.wrapper.append(tags.input); - tags.wrapper.classList.add(tags.options.wrapperClass); - tags.orignal_input.setAttribute('hidden' , 'true'); - tags.orignal_input.parentNode.insertBefore(tags.wrapper , tags.orignal_input); - } - - // initialize the Events - function initEvents(tags){ - tags.wrapper.addEventListener('click' ,function(){ - tags.input.focus(); - }); - - - tags.input.addEventListener('keydown' , function(e){ - - var str = tags.input.value.trim(); - - if( !!(~[9 , 13 , 188].indexOf( e.keyCode )) ) - { - tags.input.value = ""; - if(str != "") - tags.addTag(str); - } - - }); - } - - - // Set All the Default Values - TagsInput.defaults = { - selector : '', - wrapperClass : 'tags-input-wrapper', - tagClass : 'tag', - max : null, - duplicate: false - } - - return TagsInput; -});