iVis-at-Bilkent / cytoscape.js-clipboard

A Cytoscape.js extension to provide copy-paste utilities
MIT License
8 stars 4 forks source link

cy.clipboard is not a function #16

Open atom238 opened 1 month ago

atom238 commented 1 month ago

Hello, I upgraded cytoscape.js from 3.21.0 to 3.29.3 and after that I see error in browser console "TypeError: cy.clipboard is not a function at HTMLDocument.". My code:

<script src="https://unpkg.com/cytoscape-undo-redo/cytoscape-undo-redo.js"></script>
<script src="src/extensions/clipboard/cytoscape-clipboard.js"></script>
...
var cb = cy.clipboard();
document.addEventListener("keydown", function (e) {
    if (e.ctrlKey && e.target.nodeName === 'BODY')
        if (e.which == 67)
            cy.clipboard().copy(cy.$(":selected"));
        else if (e.which == 86)
            ur.do("paste");
        else if (e.which == 65) {
    cy.elements().select();
    e.preventDefault();
    }
});
ugurdogrusoz commented 1 month ago

@atom238 there hasn't been any work on this extension for a while, you might be right. we do not have any resources to work on this right now; feel free to create a PR on the unstable branch if you like.