On Sat, Jun 23, 2018 at 6:58 AM, Lakshay arora arora.lakshya123@gmail.com wrote:
Hello Developers, I'm currently working on this feature as a part of my GSoC project. Isaac and I have been trying to think of some workarounds but your ideas are welcome. I have currently thought of the following workarounds.
Disable drag drop at the backend, but drag drop handlers in javascript are written in common,js which has other stuff also, so we can either separate it in some other file(which I don't think would be a good solution because it might cause some bugs), or we can find a way to expose the configuration to javascript(not sure but could lead to security issues) or we can leave the javascript as it is and disable it only on the server side.(it still works well, I've tested).
I have a few (untested) ideas about this, although I can't think of anything else in the code where a JavaScript configuration is controlled by a config.inc.php directive.
Can we move the part where we attach the event in js/common.js to a PHP file? If we can make these lines conditional that would prevent the attachment in the first place
common.js:$(document).on('dragenter', PMA_DROP_IMPORT._dragenter); common.js:$(document).on('dragover', PMA_DROP_IMPORT._dragover); common.js:$(document).on('dragleave', '.pma_drop_handler', PMA_DROP_IMPORT._dragleave); common.js:$(document).on('drop', 'body', PMA_DROP_IMPORT._drop);
Can we move the PMA_DROP_IMPORT functionality to a new file (js/drag_drop_import.js) and conditionally include that, like we do with CodemirrorEnable and libraries/classes/Header.php?
Can we set a variable early on in the execution of the common PHP functions that are called on every page where we set a JavaScript variable, then perform the test in JavaScript?
This is a new area for me, so those are a few of my early-morning ideas.
Thanks, Lakshya arora (nulll-pointer)
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers