remotestorage-widget
Advanced tools
Comparing version
{ | ||
"name": "remotestorage-widget", | ||
"version": "1.0.0-rc2", | ||
"version": "1.0.0-rc3", | ||
"description": "remoteStorage.js connect widget", | ||
@@ -5,0 +5,0 @@ "main": "build/widget.js", |
@@ -32,6 +32,9 @@ # remotestorage-widget | ||
| `autoCloseAfter` | Timeout after which the widget closes automatically (in milliseconds). The widget only closes when a storage is connected. | Number | 1500 | | ||
| `logging` | Enable logging for debugging purposes | Boolean | false | | ||
Example: | ||
const widget = new Widget(remoteStorage, { autoCloseAfter: 2000 }); | ||
```js | ||
const widget = new Widget(remoteStorage, { autoCloseAfter: 2000 }); | ||
``` | ||
@@ -38,0 +41,0 @@ ## Available Functions |
@@ -11,2 +11,3 @@ /** | ||
* automatically in ms (default: 1500) | ||
* @param {boolean} options.logging - Enable logging (default: false) | ||
*/ | ||
@@ -29,2 +30,4 @@ let Widget = function(remoteStorage, options={}) { | ||
this.logging = typeof options.logging === 'boolean' ? options.logging : false; | ||
this.autoCloseAfter = options.autoCloseAfter ? options.autoCloseAfter : 1500; | ||
@@ -40,3 +43,5 @@ | ||
log (...msg) { | ||
console.debug('[RS-WIDGET] ', ...msg); | ||
if (this.logging) { | ||
console.debug('[RS-WIDGET] ', ...msg); | ||
} | ||
}, | ||
@@ -43,0 +48,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
346271
0.27%979
0.51%67
4.69%1
Infinity%