How to use the clipboard.writeText function in clipboard

To help you get started, we’ve selected a few clipboard examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stephanepericat / toptal-electron-loki-demo / src / common / utils.js View on Github external
el.bind('click', function(e) {
                e.preventDefault();
                var text = (scope.vm.keychain[attrs.copyPassword]) ? scope.vm.keychain[attrs.copyPassword].password : '';
                // atom's clipboard module
                clipboard.clear();
                clipboard.writeText(text);
            });
        };
github ialexryan / threedots-electron / app / main.js View on Github external
click: function() {
          var url = BrowserWindow.getFocusedWindow().webContents.getUrl();
          clipboard.writeText(url);
        }
      },
github maxogden / screencat / app.js View on Github external
ui.buttons.copy.addEventListener('click', function (e) {
  e.preventDefault()
  clipboard.writeText(ui.inputs.copy.value)
})
github lukemurray / data-atom / lib / views / table-view.js View on Github external
'core:copy': () => {
        let str = this.state.selectedItems.map(ele => ele.innerText).join('\n');
        Clipboard.writeText(str);
      }
    })
github BoostIO / Boostnote / browser / finder / index.jsx View on Github external
handleKeyDown: function (e) {
    if (e.keyCode === 38) {
      this.selectPrevious()
      e.preventDefault()
    }

    if (e.keyCode === 40) {
      this.selectNext()
      e.preventDefault()
    }

    if (e.keyCode === 13) {
      var article = this.state.currentArticle
      clipboard.writeText(article.content)
      hideFinder()
      e.preventDefault()
    }
    if (e.keyCode === 27) {
      hideFinder()
      e.preventDefault()
    }
  },
  focusInput: function () {
github materialsproject / MPContribs / mpcontribs-portal / mpcontribs / portal / assets / js / main.js View on Github external
$('#api_key_btn').on('click', function() {
        clipboard.writeText(api_key_code);
        $('#api_key_text').html('Copied!');
    });
github steelbrain / linter-ui-default / lib / element-panel.js View on Github external
el.addEventListener('keydown', function(e) {
    if (e.which === 67 && e.ctrlKey) {
      Clipboard.writeText(getSelection().toString())
    }
  })