Comments (13)
it seems like the example that Mike De Boer cooked up demonstrates that we basic support for OS sourced DND (drag in AND out).
Mike, any thoughts on limitations you've hit so far? Specifically, is it possible to synthetically build up a text or image file that will drag out properly?
from chromeless.
I have a sample DnD demonstration inside https://github.com/ajaxorg/chromeless/tree/master/examples/dragdrop
Could you check it out and see if the example is elaborate enough?
from chromeless.
It looks good. The only feature that I don't see is the ability to drag out an actual file, so that I dragstart on, for instance, a file icon in my ui and drag that to the desktop, and an actual file with a name specified by the web app is created (rather than a text clipping).
I think this could be fairly simply done by using the application/x-moz-file trick mentioned here:
https://developer.mozilla.org/En/DragDrop/Recommended_Drag_Types
It seems like if the chromeless application could cause the creation of a local temp file and populate it with content at drag start, then it would be possible to synthesize files and folders out of interface elements.
all that would be needed to do this is the ability to open a temp file with a specific name I think.
Does this make sense? If drag out of arbitrary synthesized file content is important, we should open a new bug to add tempfile/tempdir creation to the appropriate modules.
Thoughts?
from chromeless.
I agree and already saw the x-moz-file trick you mention, I just didn't implement it yet. I'm pretty certain it would work and I will finish that part when I get to working on the dragdrop implementation in cloud9.
from chromeless.
I am looking a bit this one too ok? Based on meeting I had with Lloyd on yesterday. Trying to help out you guys.
from chromeless.
yay! thanks marcio!
from chromeless.
Here is an update -- outside of our master because this does not work. I also filed a thread in dev-extensions to see other developer's opinion why it did not work. one thing to notice here is that the actual set of file ( nsIFile ) into the dataTransfer is being done in the module ( to workaround security exception ). I also executed the whole thing in system-level privileges and same effect - no drop effect. It's being canceled.
The same is basically Mike's desktop file list sample where expectation is to drag and drop the files to a target folder.
from chromeless.
@taboca thanks for the update! I know why it's not working... you can not mix and match the 'HTML 5' (built-in to firefox/ xulrunner and exposed as accessible API to the browser chrome) native drag/drop and the XUL/ XPCOM based solution. You have to choose one of the two. Prism has implemented the XPCOM solution. It's all JS and - with a little work - portable to chromeless, so check it out!
from chromeless.
@mike I did check in an initial case SHA: 8ce7f28 that shows a basic function for a file drop. This testcase, for now, creates a copy of the file in the target folder. It's all under misc.js and our code gets called when the drop happens: we get notified about the target folder name which user attempted to drop the div.
from chromeless.
@taboca awesome! I reviewed the code in the commit and it looks good!
One thing: I do not think that putting the functions in misc.js is a good idea - why not put them in dragdrop.js? This way the end-user/ dev knows better what to include when he or she is implementing drag/drop with Chromeless.
I'll check it out and implement it into Cloud9!
from chromeless.
Thanks, and yes -- agree with points. So a design plan for a polish update:
- Move to a dragdrop.js -- fix the documentation too -- I accidentally took out Lloyd's documentation ( comments ) framework from the code;
- Developer's ability to associate the expectation = success or error = as callback in user's JavaScript. The reasoning here is that a developer may prepare a case where user can drag and drop, but user may accidentally drop to the same browser area, or drop to an area that is not a valid OS receiver. If things ok, if the writing happens, we call developer's success function, ortherwise we call error callback.
- For now we support files, but we keep some code design annotation on next steps for folder. It should be developer's job to inform type=file or folder. We would support type==file for now.
- Move the dragdrop ( out to folder ) sample aspect to Mike's example app, and keep ./test more simplified.
from chromeless.
SHA: fcbcb1d
from chromeless.
I just tested this locally with chromeless tests/dragdrop/index.html
. looks good, closing. if for some reason this needs to be kept open, please re-open.
from chromeless.
Related Issues (20)
- Solaris SPARC support
- localStorage doesnt work with enableSystemPrivileges HOT 1
- Add special keys to hotkey api
- IndexedDB doesn't work HOT 3
- Error when Installing on Mac HOT 4
- jQuery Include fails when enableSystemPrivileges HOT 2
- Webcontent.inject fails when the content is loaded from remote webserver HOT 1
- The window size shoud be able to change browser code.
- LSOpenURLsWithRole failed on first run HOT 4
- Drag and Drop fullpath HOT 1
- window.top is the application window
- how could i make chromeless to work without proxy
- installation problem with fetching xulrunner HOT 2
- clearing cache in chromeless
- points to wrong xulrunner repository
- update for B2G
- Want to know HOT 3
- hAS cHROMELESS BEEN tOTALLY aBANDONED?????? HOT 3
- CODE_OF_CONDUCT.md file missing
- Is this project dead?
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 chromeless.