Hi,
PAF patch for issue RM1336
Changes: Added keyboard shortcuts (static/non configurable) to some query
tool operations.
Execute --> Ctrl + Shift + E
Explain --> Ctrl + Shift + X
Explain analyze --> Ctrl + Shift + A
Note: Keyboard shortcuts do not work if focus is set on any disabled button
inside query tool or out side the query tool.
--
*Harshal Dhumal*
*Software Engineer*
EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/tools/datagrid/templates/datagrid/index.html b/web/pgadmin/tools/datagrid/templates/datagrid/index.html
index 43510cd..bde3757 100644
--- a/web/pgadmin/tools/datagrid/templates/datagrid/index.html
+++ b/web/pgadmin/tools/datagrid/templates/datagrid/index.html
@@ -61,7 +61,7 @@ body {
</select>
</div>
<div class="btn-group" role="group" aria-label="">
- <button id="btn-flash" type="button" class="btn btn-default" style="width: 40px;" title="{{ _('Execute/Refresh') }}">
+ <button id="btn-flash" type="button" class="btn btn-default" style="width: 40px;" title="{{ _('Execute/Refresh (Ctrl+Shift+E)') }}">
<i class="fa fa-bolt" aria-hidden="true"></i>
</button>
<button id="btn-query-dropdown" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@@ -70,12 +70,12 @@ body {
<ul class="dropdown-menu dropdown-menu">
<li>
<a id="btn-explain" href="#">
- <span>{{ _('Explain') }}</span>
+ <span>{{ _('Explain (Ctrl+Shift+X)') }}</span>
</a>
</li>
<li>
<a id="btn-explain-analyze" href="#">
- <span>{{ _('Explain analyze') }}</span>
+ <span>{{ _('Explain analyze (Ctrl+Shift+A)') }}</span>
</a>
</li>
<li class="divider"></li>
diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index 60c4ee4..9c9514f 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -175,7 +175,8 @@ define(
"click #btn-explain-costs": "on_explain_costs",
"click #btn-explain-buffers": "on_explain_buffers",
"click #btn-explain-timing": "on_explain_timing",
- "change .limit": "on_limit_change"
+ "change .limit": "on_limit_change",
+ "keyup": "keyAction"
},
// This function is used to render the template.
@@ -1010,6 +1011,25 @@ define(
self,
self.handler
);
+ },
+
+ // Callback for keyboard event
+ keyAction: function(ev) {
+ if(ev.ctrlKey && ev.shiftKey) {
+ if(ev.keyCode == 69) {
+ // char e/E
+ // Execute query.
+ this.on_flash(ev);
+ } else if(ev.keyCode == 88){
+ // char x/X
+ // Explain query.
+ this.on_explain(ev);
+ } else if(ev.keyCode == 65) {
+ // char a/A
+ // Explain analyze query.
+ this.on_explain_analyze(ev);
+ }
+ }
}
});
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers