Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: drag and drop error #157

Closed
roymacdonald opened this issue May 21, 2017 · 5 comments
Closed

Windows: drag and drop error #157

roymacdonald opened this issue May 21, 2017 · 5 comments

Comments

@roymacdonald
Copy link
Contributor

Hi,
I've noticed an error in windows (win 10, x64) that it will add an incorrect folder path when you drag and drop a project folder into PG. Right now this folder path includes the folder that one is drag'n'droping but it should be the path of the folder that contains the folder being dragged.
Example.
this is how it shows now:
OF_folder/apps/myApps/project_folder_being_dragged
but it should be
OF_folder/apps/myApps

I haven't worked with PG code so I'll have to dig a bit to find how to fix this. Sure it is an easy thing. But I wont be able to do this until a few more days. If anyone knows how to fix it please go for it. :)

All the best!

@Daandelange
Copy link
Member

Hey Roy,
My guess would be that the RegEx is not working correctly on windows.
Check /frontend/app.js (line 726)
To test, you can open the Webkit inspector in the PG and paste this in the console:

var folder = "myGeniusApp";
var fullPath = "/path/to/of/apps/myApps/myGeniusApp";
var regExp2 = new RegExp("\\b/"+folder+"\\b","gi");
fullPath.replace(regExp2,"");

Otherwise the problem could be e.originalEvent.
Try changing var files = e.originalEvent.dataTransfer.files; to var files = e.files;.

Debugging can be done with breakpoints via the Webkit Inspector.

@roymacdonald
Copy link
Contributor Author

Hi @Daandelange Thanks for the tips. I will give it a try and post the results.
Best!

@hiroMTB
Copy link
Contributor

hiroMTB commented May 24, 2019

I assume this is not fixed yet?

@roymacdonald
Copy link
Contributor Author

@hiroMTB I have no idea. At least I did not fix it.
best

@hiroMTB
Copy link
Contributor

hiroMTB commented May 25, 2019

@Daandelange
Your first idea is right.
Windows returns path with forward slash, (e.g. \of\apps\mySketch)
macOS and Linux returns path with back slash (e.g. /of/apps/mySketch)
So RegExp can not find project name on Windows. (This is so so annoying btw!)

I tested path.normalize() with / and it works for both of macOS and Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants