Drop file - Nodewebkit

Bugs will be moved here once resolved.

Post » Thu Jun 12, 2014 11:31 am

I always forget that. I never use minify because I refuse to install JRE,
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,415
Reputation: 59,516

Post » Thu Jun 12, 2014 12:45 pm

Thank you guys, so the problem come from minifier.

When exporting, Construct 2 gives the user the option to 'Minify script'. This runs the common and runtime scripts through Google Closure Compiler's ADVANCED_OPTIMIZATIONS mode. This imposes some limitations on what scripts can do. You must obey these limitations when writing your plugins, otherwise your plugin will be broken on export. More details can be found here (http://code.google.com/closure/compiler ... rial3.html).

The main thing is to always use dot syntax (Object.property) rather than bracket syntax (Object["property"]). All properties using dot syntax are changed by Closure Compiler, but none of the properties in bracket syntax are changed. Therefore, if you use Object.property in one place and Object["property"] in another to access the same property, the plugin will be broken on export. You may still use bracket syntax (e.g. for a dictionary of user-inputted strings) - just be aware of how Closure Compiler will transform the code.


i think i need change this :

...plugins/nodewebkit/runtime.js

window.ondrop = function (e)
{
e.preventDefault();

for (var i = 0; i < e["dataTransfer"]["files"].length; ++i)
{
droppedfile = e["dataTransfer"]["files"][i]["path"];
self.runtime.trigger(cr.plugins_.NodeWebkit.prototype.cnds.OnFileDrop, self);
}
return false;
};

e.preventDefault(); is the function prevent the original event browser , it seems that this function does not work after obfuscation
B
13
S
3
G
2
Posts: 49
Reputation: 1,675

Post » Mon Jun 16, 2014 3:32 pm

I think the minifier didn't recognise the ondrop or ondragover names used for that. Should be fixed in the next build.
Scirra Founder
B
397
S
236
G
88
Posts: 24,423
Reputation: 194,560

Post » Tue Jun 17, 2014 7:20 am

Construct 2 Release r173

Bug Fix
Node-webkit: drag-and-drop support did not always work after minified export


Now it's work minified.

Find me a person who regretted the purchase of "construct 2" so ​​I could ask him what planet he came from.
B
13
S
3
G
2
Posts: 49
Reputation: 1,675

Previous

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests