@mongoosejs/studio 0.0.13 → 0.0.14

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.
@@ -1,4 +1,7 @@
1
- <div class="list-mixed">
2
- <pre><code ref="MixedCode" class="language-javascript">{{shortenValue}}</code></pre>
3
- </div>
1
+ <div class="list-mixed tooltip">
2
+ <pre>
3
+ <code ref="MixedCode" class="language-javascript">{{shortenValue}}</code>
4
+ <span class="tooltiptext" @click.stop="copyText(value)">copy &#x1F4CB;</span>
5
+ </pre>
6
+ </div>
4
7
 
@@ -3,6 +3,8 @@
3
3
  const api = require('../api');
4
4
  const template = require('./list-mixed.html');
5
5
 
6
+ const vanillatoast = require('vanillatoasts');
7
+
6
8
  require('../appendCSS')(require('./list-mixed.css'));
7
9
 
8
10
  module.exports = app => app.component('list-mixed', {
@@ -13,7 +15,27 @@ module.exports = app => app.component('list-mixed', {
13
15
  return this.value;
14
16
  }
15
17
  },
18
+ methods: {
19
+ copyText(value) {
20
+ const storage = document.createElement('textarea');
21
+ storage.value = JSON.stringify(value);
22
+ const elem = this.$refs.MixedCode;
23
+ elem.appendChild(storage);
24
+ storage.select();
25
+ storage.setSelectionRange(0, 99999);
26
+ document.execCommand('copy');
27
+ elem.removeChild(storage);
28
+ vanillatoast.create({
29
+ title: 'Text copied!',
30
+ type: 'success',
31
+ timeout: 3000,
32
+ icon: 'images/success.png',
33
+ positionClass: 'bottomRight'
34
+ });
35
+ }
36
+ },
16
37
  mounted: function() {
17
38
  Prism.highlightElement(this.$refs.MixedCode);
18
39
  }
19
40
  });
41
+
@@ -1,3 +1,6 @@
1
- <div class="list-subdocument">
2
- <pre><code ref="SubDocCode" class="language-javascript">{{shortenValue}}</code></pre>
1
+ <div class="list-subdocument tooltip">
2
+ <pre>
3
+ <code ref="SubDocCode" class="language-javascript">{{shortenValue}}</code>
4
+ <span class="tooltiptext" @click.stop="copyText(value)">copy &#x1F4CB;</span>
5
+ </pre>
3
6
  </div>
@@ -2,6 +2,7 @@
2
2
 
3
3
  const api = require('../api');
4
4
  const template = require('./list-subdocument.html');
5
+ const vanillatoast = require('vanillatoasts');
5
6
 
6
7
  require('../appendCSS')(require('./list-subdocument.css'));
7
8
 
@@ -13,7 +14,26 @@ module.exports = app => app.component('list-subdocument', {
13
14
  return this.value;
14
15
  }
15
16
  },
17
+ methods: {
18
+ copyText(value) {
19
+ const storage = document.createElement('textarea');
20
+ storage.value = JSON.stringify(value);
21
+ const elem = this.$refs.SubDocCode;
22
+ elem.appendChild(storage);
23
+ storage.select();
24
+ storage.setSelectionRange(0, 99999);
25
+ document.execCommand('copy');
26
+ elem.removeChild(storage);
27
+ vanillatoast.create({
28
+ title: 'Text copied!',
29
+ type: 'success',
30
+ timeout: 3000,
31
+ icon: 'images/success.png',
32
+ positionClass: 'bottomRight'
33
+ });
34
+ }
35
+ },
16
36
  mounted: function() {
17
37
  Prism.highlightElement(this.$refs.SubDocCode);
18
38
  }
19
- });
39
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongoosejs/studio",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "dependencies": {
5
5
  "archetype": "0.13.0",
6
6
  "csv-stringify": "6.3.0",
package/osogolf.js DELETED
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- const db = require('../../voltmobile/core-api/backend/db');
4
- const express = require('express');
5
- const studio = require('./express');
6
-
7
- run().catch(err => {
8
- console.error(err);
9
- process.exit(-1);
10
- });
11
-
12
- async function run() {
13
- const app = express();
14
- const conn = await db();
15
-
16
- app.use('/studio', studio('/studio/api', conn));
17
-
18
- await app.listen(3002);
19
- console.log('Listening on port 3002');
20
- }