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.1 to 2.0.2

18

cytoscape-clipboard.js

@@ -17,3 +17,7 @@ ;(function () {

var options = {
clipboardSize: 0
clipboardSize: 0,
beforeCopy: null,
afterCopy: null,
beforePaste: null,
afterPaste: null
};

@@ -99,3 +103,9 @@

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;

@@ -106,2 +116,5 @@ },

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

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

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

@@ -119,0 +135,0 @@ }

2

package.json
{
"name": "cytoscape-clipboard",
"version": "2.0.1",
"version": "2.0.2",
"description": "Adds copy-paste utilities to cytoscape.",

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

@@ -32,3 +32,22 @@ cytoscape-clipboard

var options = {
clipboardSize: 0
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) {}
};

@@ -35,0 +54,0 @@ ```

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