public inbox for [email protected]  
help / color / mirror / Atom feed
[pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
5+ messages / 3 participants
[nested] [flat]

* [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
@ 2021-04-27 14:41  Pradip Parkale <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Pradip Parkale @ 2021-04-27 14:41 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Please find the attached patch for #6355. I have added the event to prevent
the browser from opening the dragged file.


-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


Attachments:

  [application/octet-stream] RM6355.patch (1.8K, 3-RM6355.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/panel.js b/web/pgadmin/browser/static/js/panel.js
index bf9e874ce..8c0fd3b03 100644
--- a/web/pgadmin/browser/static/js/panel.js
+++ b/web/pgadmin/browser/static/js/panel.js
@@ -97,6 +97,17 @@ define(
                 that.onCreate.apply(that, [myPanel, $container]);
               }
 
+              // Prevent browser from opening the drag file.
+              $('.pg-panel-content').bind('dragover', function (event) {
+                event.stopPropagation();
+                event.preventDefault();
+              });
+              $('.pg-panel-content').bind('drop', function (event) {
+                event.stopPropagation();
+                event.preventDefault();
+
+              });
+
               if (that.elContainer) {
                 myPanel.pgElContainer = $container;
                 $container.addClass('pg-el-container');
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index b5503255c..4486832c2 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -491,6 +491,17 @@ define('tools.querytool', [
         }, 200);
       });
 
+      // Prevent browser from opening the drag file.
+      $('#datagrid').bind('dragover', function (event) {
+        event.stopPropagation();
+        event.preventDefault();
+      });
+      $('#datagrid').bind('drop', function (event) {
+        event.stopPropagation();
+        event.preventDefault();
+
+      });
+
       var open_new_tab = self.browser_preferences.new_browser_tab_open;
       if (_.isNull(open_new_tab) || _.isUndefined(open_new_tab) || !open_new_tab.includes('qt')) {
         // Listen on the panel closed event and notify user to save modifications.


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
@ 2021-04-28 06:32  Akshay Joshi <[email protected]>
  parent: Pradip Parkale <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Akshay Joshi @ 2021-04-28 06:32 UTC (permalink / raw)
  To: Pradip Parkale <[email protected]>; +Cc: pgadmin-hackers

Thanks, patch applied.

On Tue, Apr 27, 2021 at 8:12 PM Pradip Parkale <
[email protected]> wrote:

> Hi Hackers,
>
> Please find the attached patch for #6355. I have added the event to
> prevent the browser from opening the dragged file.
>
>
> --
> Thanks & Regards,
> Pradip Parkale
> Software Engineer | EnterpriseDB Corporation
>


-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
@ 2021-05-05 14:49  Murtuza Zabuawala <[email protected]>
  parent: Akshay Joshi <[email protected]>
  0 siblings, 2 replies; 5+ messages in thread

From: Murtuza Zabuawala @ 2021-05-05 14:49 UTC (permalink / raw)
  To: pgadmin-hackers; +Cc: Pradip Parkale <[email protected]>; Akshay Joshi <[email protected]>

Hello,

PFA patch to remove duplicate code and avoid DOM search operation in
panel.js.

--
Regards,
Murtuza Zabuawala
*EDB*
*POWER TO POSTGRES*
https://www.edbpostgres.com


On Wed, Apr 28, 2021 at 12:02 PM Akshay Joshi <[email protected]>
wrote:

> Thanks, patch applied.
>
> On Tue, Apr 27, 2021 at 8:12 PM Pradip Parkale <
> [email protected]> wrote:
>
>> Hi Hackers,
>>
>> Please find the attached patch for #6355. I have added the event to
>> prevent the browser from opening the dragged file.
>>
>>
>> --
>> Thanks & Regards,
>> Pradip Parkale
>> Software Engineer | EnterpriseDB Corporation
>>
>
>
> --
> *Thanks & Regards*
> *Akshay Joshi*
> *pgAdmin Hacker | Principal Software Architect*
> *EDB Postgres <http://edbpostgres.com>*
>
> *Mobile: +91 976-788-8246*
>


Attachments:

  [application/octet-stream] remove_duplication.diff (1.4K, 3-remove_duplication.diff)
  download | inline diff:
diff --git a/web/pgadmin/browser/static/js/panel.js b/web/pgadmin/browser/static/js/panel.js
index c0371b2dc..c9e64132b 100644
--- a/web/pgadmin/browser/static/js/panel.js
+++ b/web/pgadmin/browser/static/js/panel.js
@@ -98,11 +98,7 @@ define(
               }
 
               // Prevent browser from opening the drag file.
-              $('.pg-panel-content').bind('dragover', function (event) {
-                event.stopPropagation();
-                event.preventDefault();
-              });
-              $('.pg-panel-content').bind('drop', function (event) {
+              $container.bind('dragover drop', function (event) {
                 event.stopPropagation();
                 event.preventDefault();
               });
diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
index 1ef690e55..e99db6955 100644
--- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js
@@ -492,11 +492,7 @@ define('tools.querytool', [
       });
 
       // Prevent browser from opening the drag file.
-      $('#datagrid').bind('dragover', function (event) {
-        event.stopPropagation();
-        event.preventDefault();
-      });
-      $('#datagrid').bind('drop', function (event) {
+      $('#datagrid').bind('dragover drop', function (event) {
         event.stopPropagation();
         event.preventDefault();
       });


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
@ 2021-05-06 07:21  Pradip Parkale <[email protected]>
  parent: Murtuza Zabuawala <[email protected]>
  1 sibling, 0 replies; 5+ messages in thread

From: Pradip Parkale @ 2021-05-06 07:21 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers; Akshay Joshi <[email protected]>

Hi Akshay,

Patch looks good to me.

On Wed, May 5, 2021 at 8:20 PM Murtuza Zabuawala <
[email protected]> wrote:

> Hello,
>
> PFA patch to remove duplicate code and avoid DOM search operation in
> panel.js.
>
> --
> Regards,
> Murtuza Zabuawala
> *EDB*
> *POWER TO POSTGRES*
> https://www.edbpostgres.com
>
>
> On Wed, Apr 28, 2021 at 12:02 PM Akshay Joshi <
> [email protected]> wrote:
>
>> Thanks, patch applied.
>>
>> On Tue, Apr 27, 2021 at 8:12 PM Pradip Parkale <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for #6355. I have added the event to
>>> prevent the browser from opening the dragged file.
>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Pradip Parkale
>>> Software Engineer | EnterpriseDB Corporation
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>

-- 
Thanks & Regards,
Pradip Parkale
Software Engineer | EnterpriseDB Corporation


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it.
@ 2021-05-06 08:40  Akshay Joshi <[email protected]>
  parent: Murtuza Zabuawala <[email protected]>
  1 sibling, 0 replies; 5+ messages in thread

From: Akshay Joshi @ 2021-05-06 08:40 UTC (permalink / raw)
  To: Murtuza Zabuawala <[email protected]>; +Cc: pgadmin-hackers; Pradip Parkale <[email protected]>

Thanks, patch applied.

On Wed, May 5, 2021 at 8:20 PM Murtuza Zabuawala <
[email protected]> wrote:

> Hello,
>
> PFA patch to remove duplicate code and avoid DOM search operation in
> panel.js.
>
> --
> Regards,
> Murtuza Zabuawala
> *EDB*
> *POWER TO POSTGRES*
> https://www.edbpostgres.com
>
>
> On Wed, Apr 28, 2021 at 12:02 PM Akshay Joshi <
> [email protected]> wrote:
>
>> Thanks, patch applied.
>>
>> On Tue, Apr 27, 2021 at 8:12 PM Pradip Parkale <
>> [email protected]> wrote:
>>
>>> Hi Hackers,
>>>
>>> Please find the attached patch for #6355. I have added the event to
>>> prevent the browser from opening the dragged file.
>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Pradip Parkale
>>> Software Engineer | EnterpriseDB Corporation
>>>
>>
>>
>> --
>> *Thanks & Regards*
>> *Akshay Joshi*
>> *pgAdmin Hacker | Principal Software Architect*
>> *EDB Postgres <http://edbpostgres.com>*
>>
>> *Mobile: +91 976-788-8246*
>>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2021-05-06 08:40 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 14:41 [pgAdmin][RM6355]: pgAdmin is able to open external files that are dragged into it. Pradip Parkale <[email protected]>
2021-04-28 06:32 ` Akshay Joshi <[email protected]>
2021-05-05 14:49   ` Murtuza Zabuawala <[email protected]>
2021-05-06 07:21     ` Pradip Parkale <[email protected]>
2021-05-06 08:40     ` Akshay Joshi <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox