Comments (2)
I tried various experiments in adding a "Paste" option in right click menu. Normally Paste menu item is disabled because Handsontable doesn't think there's anything in its clipboard (self.clipboardCache), but that's because that is not directly connected to system clipboard, which has to be read separately
via navigator.clipboard.readText() or navigator.clipboard.read() -> both of which are asynchronous calls which make getting at what system clipboard contains in the moment quite complicated. I set disabled to false just to test various possibilities of getting at system clipboard. Possibly other browser permissions have to be asked for by code as mentioned in https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard
contextMenu: [
'copy',
'cut',
{
key: 'paste',
name: 'Paste',
disabled: function () {
/* if (self.clipboardCache.length === 0) {
var test = navigator.clipboard.readText();
self.clipboardCache = test;
console.log("nav1", self.clipboardCache);
.then((stuff) => self.clipboardCache = ...) navigator.clipboard.readText();
// try dummy read write text to somewhere?
}*/
return false; //self.clipboardCache.length === 0;
},
callback: function () {
var plugin = this.getPlugin('copyPaste');
this.listen();
// BUG: It seems like extra lf is added by sheetclip, causing
// empty last row to be added and pasted. Exception is pasting
// of single empty cell
/*
if (self.clipboardCache.length === 0) {
const text = await navigator.clipboard.readText(); //AWAIT isn't allowed here.
console.log("test", test);
self.clipboardCache = self.sheetClip.parse(test);
console.log("nav2", self.clipboardCache);
};
*/
if (self.clipboardCache.length > 0)
self.clipboardCache = self.clipboardCache.slice(0, -1);
plugin.paste(self.clipboardCache);
},
},
'remove_row',
'row_above',
'row_below',
],
from dataharmonizer.
I have a hack solution for this that seems to be working, via date field right-click menu paste option. Only drawback is no ctrl-v for pasting on that particular type of field. Uploading shortly.
from dataharmonizer.
Related Issues (20)
- Loading a template modifies root slot definitions HOT 1
- Enumerations with a large number of elements are cut off when displaying the entire list HOT 3
- DH should materialize LinkML dynamic enumerations and display the permissible values with hierarchy preserved HOT 1
- When DH creates menus from LinkML enums, it requires the presence of the optional `text` property HOT 3
- Transform URLs in help popup into clickable links HOT 5
- "Dates" collected by DataHarmonizer are datetime objects HOT 7
- Document the fact that DH JSON is a bare list and not compatible with LinkML tools as is HOT 2
- Implement time and datetime datatypes HOT 2
- Add column help sidebar to core library HOT 2
- Can't install HOT 5
- `linkml.py` does not generate a `schema.js` as expected but a `schema.json` HOT 2
- Schema not loading in DataHarmonizer (only Chrome and Edge; Firefox working) HOT 3
- Adding term normalization / ontology lookup feature to DataHarmonizer HOT 1
- parse() function appears to have repeated regular expression compilation?
- Validation(), specifically setDataAtCell(), can be made much more efficient by eliminating re-render on each column. HOT 2
- Compress image assets HOT 6
- Customizable Help Menu with Linkage to LinkML generated data model schema documentation HOT 1
- Dropdown picklists including print tags in latest release HOT 3
- Proposal: UI for working with non-enum multivalued slots HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataharmonizer.