Socket
Socket
Sign inDemoInstall

cytoscape-clipboard

Package Overview
Dependencies
2
Maintainers
6
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.4 to 2.1.0

cytoscape-edge-bend-editing.js

33

cytoscape-clipboard.js

@@ -5,5 +5,5 @@ ;(function () {

// registers the extension on a cytoscape lib ref
var register = function (cytoscape, $) {
var register = function (cytoscape) {
if (!cytoscape || !$) {
if (!cytoscape) {
return;

@@ -17,13 +17,2 @@ } // can't register if cytoscape unspecified

var options = {
clipboardSize: 0,
beforeCopy: null,
afterCopy: null,
beforePaste: null,
afterPaste: null
};
$.extend(true, options, opts);
function getScratch() {

@@ -63,3 +52,3 @@ if (!cy.scratch("_clipboard")) {

function changeIds(jsons) {
jsons = $.extend(true, [], jsons);
jsons = [].concat(jsons);
for (var i = 0; i < jsons.length; i++) {

@@ -105,9 +94,3 @@ var jsonFirst = jsons[i];

if(options.beforeCopy) {
options.beforeCopy(nodes.union(edges));
}
clipboard[id] = {nodes: nodes.jsons(), edges: edges.jsons()};
if(options.afterCopy) {
options.afterCopy(clipboard[id]);
}
return id;

@@ -118,5 +101,2 @@ },

var res = cy.collection();
if(options.beforePaste) {
options.beforePaste(clipboard[id]);
}
if (clipboard[id]) {

@@ -132,5 +112,2 @@ var nodes = changeIds(clipboard[id].nodes);

}
if(options.afterPaste) {
options.afterPaste(res);
}
return res;

@@ -165,6 +142,6 @@ }

if (typeof cytoscape !== 'undefined' && typeof jQuery !== 'undefined') { // expose to global cytoscape (i.e. window.cytoscape)
register(cytoscape, jQuery);
if (typeof cytoscape !== 'undefined') { // expose to global cytoscape (i.e. window.cytoscape)
register(cytoscape);
}
})();

@@ -20,3 +20,3 @@ var gulp = require('gulp');

gulp.task('publish', [], function( next ){
runSequence('confver', 'lint', 'pkgver','push', 'tag', 'npm', next);
runSequence('confver', /*'lint',*/ 'pkgver','push', 'tag', 'npm', next);
});

@@ -23,0 +23,0 @@

{
"name": "cytoscape-clipboard",
"version": "2.0.4",
"version": "2.1.0",
"description": "Adds copy-paste utilities to cytoscape.",

@@ -5,0 +5,0 @@ "main": "cytoscape-clipboard.js",

@@ -9,6 +9,2 @@ cytoscape-clipboard

## Demo
Click [here](https://rawgit.com/iVis-at-Bilkent/cytoscape.js-clipboard/master/demo.html) for demo
## API

@@ -37,22 +33,3 @@

var options = {
clipboardSize: 0,
// The following 4 options allow the user to provide custom behavior to
// the extension. They can be used to maintain consistency of some data
// when elements are duplicated.
// These 4 options are set to null by default. The function prototypes
// are provided below for explanation purpose only.
// Function executed on the collection of elements being copied, before
// they are serialized in the clipboard
beforeCopy: function(eles) {},
// Function executed on the clipboard just after the elements are copied.
// clipboard is of the form: {nodes: json, edges: json}
afterCopy: function(clipboard) {},
// Function executed on the clipboard right before elements are pasted,
// when they are still in the clipboard.
beforePaste: function(clipboard) {},
// Function executed on the collection of pasted elements, after they
// are pasted.
afterPaste: function(eles) {}
clipboardSize: 0
};

@@ -59,0 +36,0 @@ ```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc