drop.that 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/lib.js +5 -3
  2. package/package.json +8 -1
package/dist/lib.js CHANGED
@@ -127,6 +127,8 @@ export const dropIn = async (opts = {}) =>
127
127
 
128
128
  const config = { ...optionsIn, ...opts }
129
129
 
130
+ let fileInput, inputarea, startButton
131
+
130
132
  const debounce = (func, timeout = 250) => {
131
133
  let timer
132
134
  return (...args) => {
@@ -158,14 +160,14 @@ export const dropIn = async (opts = {}) =>
158
160
  <button id="start" class="action" ${config.valid('') ? '' : 'disabled'}>${config.startButtonText}</button>
159
161
  </span>
160
162
  </div>`
161
- const inputarea = document.getElementById('inputarea')
163
+ inputarea = document.getElementById('inputarea')
162
164
  inputarea.focus()
163
165
  inputarea.addEventListener('input', (evt) => processText(evt.target.value))
164
- const fileInput = document.querySelector('input[type=file]')
166
+ fileInput = document.querySelector('input[type=file]')
165
167
  fileInput.addEventListener('change', (evt) => readFile(evt.target.files))
166
168
  document.getElementById('paste').addEventListener('click', () => paste())
167
169
  document.getElementById('clear').addEventListener('click', () => setInput(''))
168
- const startButton = document.getElementById('start')
170
+ startButton = document.getElementById('start')
169
171
  startButton.addEventListener('click', () => {
170
172
  config.parent.removeChild(overlay)
171
173
  resolve(inputarea.value)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drop.that",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Generic drop/paste input and download/copy output component for web applications.",
5
5
  "author": "Martin Rohrmeier <roryphant@gmail.com> (oyo)",
6
6
  "license": "MIT",
@@ -11,6 +11,13 @@
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/oyo/drop.that.git"
13
13
  },
14
+ "keywords": [
15
+ "drag",
16
+ "drop",
17
+ "paste",
18
+ "download",
19
+ "zero-dependency"
20
+ ],
14
21
  "scripts": {
15
22
  "build": "mkdir -p dist && cp src/lib* dist",
16
23
  "clear": "rm -rf dist"