public inbox for [email protected]help / color / mirror / Atom feed
[pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection 5+ messages / 2 participants [nested] [flat]
* [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection @ 2016-09-15 07:54 Surinder Kumar <[email protected]> 2016-09-15 08:08 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Dave Page <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Surinder Kumar @ 2016-09-15 07:54 UTC (permalink / raw) To: pgadmin-hackers Hi *Please find the attached patch patch with following changes:* 1) Implemented CodeMirror addon 'simplescrollbars'. 2) The CodeMirror instance of query tool was not rendering into wcDocker's *'pg-panel-content' div*. it renders outside the div, due to which it took little more time investigating why scrollbars doesn't appear in editor. 3) Add new css specific to query tool. Please review. Thanks, Surinder Kumar -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [application/octet-stream] RM1579.patch (3.8K, 3-RM1579.patch) download | inline diff: diff --git a/web/pgadmin/static/css/overrides.css b/web/pgadmin/static/css/overrides.css index 122c942..1580110 100755 --- a/web/pgadmin/static/css/overrides.css +++ b/web/pgadmin/static/css/overrides.css @@ -53,8 +53,8 @@ iframe { /* Ensure the codemirror editor displays full height gutters when resized */ .CodeMirror, .CodeMirror-gutters { - height: 100% !important; -} + height: 100% !important; +} /* Padding for the treeview */ .browser-browser-pane { diff --git a/web/pgadmin/templates/base.html b/web/pgadmin/templates/base.html index 53aaf8d..db76f61 100755 --- a/web/pgadmin/templates/base.html +++ b/web/pgadmin/templates/base.html @@ -50,6 +50,8 @@ href="{{ url_for('static', filename='css/slickgrid/slick-default-theme.css')}}"/> <link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/slickgrid/smoothness/jquery-ui-1.11.3.custom.css' if config.DEBUG else 'css/slickgrid/smoothness/jquery-ui-1.11.3.custom.min.css')}}"/> + <link type="text/css" rel="stylesheet" + href="{{ url_for('static', filename='js/codemirror/addon/scroll/simplescrollbars.css')}}"/> <!-- View specified stylesheets --> {% for stylesheet in current_app.stylesheets %} diff --git a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css index deac360..e30b562 100644 --- a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css +++ b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css @@ -156,6 +156,18 @@ min-height: 100%; } +/* Changes specific to output panel of query tool */ +#output-panel, #output-panel .CodeMirror, #output-panel .CodeMirror-gutters { + height: 100% !important; +} + +#output-panel .CodeMirror-gutter-wrapper { + width: 43px; + height: 22px; + border-right: 1px solid #ddd !important; + background: #f7f7f7 !important; +} + .CodeMirror-foldgutter { width: .9em; } diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js index 75205d3..d81e79d 100644 --- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js @@ -7,7 +7,7 @@ define( 'codemirror/addon/selection/active-line', 'codemirror/addon/fold/foldgutter', 'codemirror/addon/fold/foldcode', 'codemirror/addon/hint/show-hint', 'codemirror/addon/hint/sql-hint', - 'codemirror/addon/fold/pgadmin-sqlfoldcode', + 'codemirror/addon/fold/pgadmin-sqlfoldcode','codemirror/addon/scroll/simplescrollbars', 'backgrid.sizeable.columns', 'wcdocker', 'pgadmin.file_manager' ], function( @@ -191,9 +191,9 @@ define( sql_panel.load(main_docker); var sql_panel_obj = main_docker.addPanel('sql_panel', wcDocker.DOCK.TOP); - var output_container = $('<div id="output-panel"></div>'); - var text_container = $('<textarea id="sql_query_tool"></textarea>').append(output_container); - sql_panel_obj.layout().addItem(text_container); + var text_container = $('<textarea id="sql_query_tool"></textarea>'); + var output_container = $('<div id="output-panel"></div>').append(text_container); + sql_panel_obj.$container.find('.pg-panel-content').append(output_container); self.query_tool_obj = CodeMirror.fromTextArea(text_container.get(0), { lineNumbers: true, @@ -210,7 +210,8 @@ define( }, gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], extraKeys: pgBrowser.editor_shortcut_keys, - tabSize: pgAdmin.Browser.editor_options.tabSize + tabSize: pgAdmin.Browser.editor_options.tabSize, + scrollbarStyle: 'simple' }); // Create panels for 'Data Output', 'Explain', 'Messages' and 'History' ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection 2016-09-15 07:54 [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> @ 2016-09-15 08:08 ` Dave Page <[email protected]> 2016-09-15 09:04 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Dave Page @ 2016-09-15 08:08 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers (pgadmin4)piranha:pgadmin4 dpage$ git apply ~/Downloads/RM1579.patch error: patch failed: web/pgadmin/static/css/overrides.css:53 error: web/pgadmin/static/css/overrides.css: patch does not apply Please rebase! On Thu, Sep 15, 2016 at 8:54 AM, Surinder Kumar <[email protected]> wrote: > Hi > > Please find the attached patch patch with following changes: > > 1) Implemented CodeMirror addon 'simplescrollbars'. > > 2) The CodeMirror instance of query tool was not rendering into wcDocker's > 'pg-panel-content' div. it renders outside the div, due to which it took > little more time investigating why scrollbars doesn't appear in editor. > > 3) Add new css specific to query tool. > > > Please review. > > Thanks, > Surinder Kumar > > > > -- > Sent via pgadmin-hackers mailing list ([email protected]) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-hackers > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection 2016-09-15 07:54 [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> 2016-09-15 08:08 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Dave Page <[email protected]> @ 2016-09-15 09:04 ` Surinder Kumar <[email protected]> 2016-09-15 09:17 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Dave Page <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Surinder Kumar @ 2016-09-15 09:04 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers Hi Please find updated patch. On Thu, Sep 15, 2016 at 1:38 PM, Dave Page <[email protected]> wrote: > (pgadmin4)piranha:pgadmin4 dpage$ git apply ~/Downloads/RM1579.patch > error: patch failed: web/pgadmin/static/css/overrides.css:53 > error: web/pgadmin/static/css/overrides.css: patch does not apply > > Please rebase! > > On Thu, Sep 15, 2016 at 8:54 AM, Surinder Kumar > <[email protected]> wrote: > > Hi > > > > Please find the attached patch patch with following changes: > > > > 1) Implemented CodeMirror addon 'simplescrollbars'. > > > > 2) The CodeMirror instance of query tool was not rendering into > wcDocker's > > 'pg-panel-content' div. it renders outside the div, due to which it took > > little more time investigating why scrollbars doesn't appear in editor. > > > > 3) Add new css specific to query tool. > > > > > > Please review. > > > > Thanks, > > Surinder Kumar > > > > > > > > -- > > Sent via pgadmin-hackers mailing list ([email protected]) > > To make changes to your subscription: > > http://www.postgresql.org/mailpref/pgadmin-hackers > > > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers Attachments: [application/octet-stream] RM1579_v1.patch (3.3K, 3-RM1579_v1.patch) download | inline diff: diff --git a/web/pgadmin/templates/base.html b/web/pgadmin/templates/base.html index 53aaf8d..db76f61 100755 --- a/web/pgadmin/templates/base.html +++ b/web/pgadmin/templates/base.html @@ -50,6 +50,8 @@ href="{{ url_for('static', filename='css/slickgrid/slick-default-theme.css')}}"/> <link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/slickgrid/smoothness/jquery-ui-1.11.3.custom.css' if config.DEBUG else 'css/slickgrid/smoothness/jquery-ui-1.11.3.custom.min.css')}}"/> + <link type="text/css" rel="stylesheet" + href="{{ url_for('static', filename='js/codemirror/addon/scroll/simplescrollbars.css')}}"/> <!-- View specified stylesheets --> {% for stylesheet in current_app.stylesheets %} diff --git a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css index 5ecfa5f..1046366 100644 --- a/web/pgadmin/tools/sqleditor/static/css/sqleditor.css +++ b/web/pgadmin/tools/sqleditor/static/css/sqleditor.css @@ -156,6 +156,18 @@ min-height: 100%; } +/* Changes specific to output panel of query tool */ +#output-panel, #output-panel .CodeMirror, #output-panel .CodeMirror-gutters { + height: 100% !important; +} + +#output-panel .CodeMirror-gutter-wrapper { + width: 43px; + height: 22px; + border-right: 1px solid #ddd !important; + background: #f7f7f7 !important; +} + .CodeMirror-foldgutter { width: .9em; } diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js index 75205d3..d81e79d 100644 --- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js @@ -7,7 +7,7 @@ define( 'codemirror/addon/selection/active-line', 'codemirror/addon/fold/foldgutter', 'codemirror/addon/fold/foldcode', 'codemirror/addon/hint/show-hint', 'codemirror/addon/hint/sql-hint', - 'codemirror/addon/fold/pgadmin-sqlfoldcode', + 'codemirror/addon/fold/pgadmin-sqlfoldcode','codemirror/addon/scroll/simplescrollbars', 'backgrid.sizeable.columns', 'wcdocker', 'pgadmin.file_manager' ], function( @@ -191,9 +191,9 @@ define( sql_panel.load(main_docker); var sql_panel_obj = main_docker.addPanel('sql_panel', wcDocker.DOCK.TOP); - var output_container = $('<div id="output-panel"></div>'); - var text_container = $('<textarea id="sql_query_tool"></textarea>').append(output_container); - sql_panel_obj.layout().addItem(text_container); + var text_container = $('<textarea id="sql_query_tool"></textarea>'); + var output_container = $('<div id="output-panel"></div>').append(text_container); + sql_panel_obj.$container.find('.pg-panel-content').append(output_container); self.query_tool_obj = CodeMirror.fromTextArea(text_container.get(0), { lineNumbers: true, @@ -210,7 +210,8 @@ define( }, gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], extraKeys: pgBrowser.editor_shortcut_keys, - tabSize: pgAdmin.Browser.editor_options.tabSize + tabSize: pgAdmin.Browser.editor_options.tabSize, + scrollbarStyle: 'simple' }); // Create panels for 'Data Output', 'Explain', 'Messages' and 'History' ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection 2016-09-15 07:54 [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> 2016-09-15 08:08 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Dave Page <[email protected]> 2016-09-15 09:04 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> @ 2016-09-15 09:17 ` Dave Page <[email protected]> 2016-09-15 09:24 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> 0 siblings, 1 reply; 5+ messages in thread From: Dave Page @ 2016-09-15 09:17 UTC (permalink / raw) To: Surinder Kumar <[email protected]>; +Cc: pgadmin-hackers Thanks, applied. One minor tweak to look at - in firefox, the width of the left margin in the query tool changes when you add a line, if the font size in preferences is not set to 1em. I think the width is initially sized for the font, then gets adjusted as you hit return. This doesn't seem to affect Chrome, and is only a minor annoyance in Firefox. On Thu, Sep 15, 2016 at 10:04 AM, Surinder Kumar <[email protected]> wrote: > Hi > > Please find updated patch. > > On Thu, Sep 15, 2016 at 1:38 PM, Dave Page <[email protected]> wrote: >> >> (pgadmin4)piranha:pgadmin4 dpage$ git apply ~/Downloads/RM1579.patch >> error: patch failed: web/pgadmin/static/css/overrides.css:53 >> error: web/pgadmin/static/css/overrides.css: patch does not apply >> >> Please rebase! >> >> On Thu, Sep 15, 2016 at 8:54 AM, Surinder Kumar >> <[email protected]> wrote: >> > Hi >> > >> > Please find the attached patch patch with following changes: >> > >> > 1) Implemented CodeMirror addon 'simplescrollbars'. >> > >> > 2) The CodeMirror instance of query tool was not rendering into >> > wcDocker's >> > 'pg-panel-content' div. it renders outside the div, due to which it took >> > little more time investigating why scrollbars doesn't appear in editor. >> > >> > 3) Add new css specific to query tool. >> > >> > >> > Please review. >> > >> > Thanks, >> > Surinder Kumar >> > >> > >> > >> > -- >> > Sent via pgadmin-hackers mailing list ([email protected]) >> > To make changes to your subscription: >> > http://www.postgresql.org/mailpref/pgadmin-hackers >> > >> >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection 2016-09-15 07:54 [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> 2016-09-15 08:08 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Dave Page <[email protected]> 2016-09-15 09:04 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> 2016-09-15 09:17 ` Re: [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Dave Page <[email protected]> @ 2016-09-15 09:24 ` Surinder Kumar <[email protected]> 0 siblings, 0 replies; 5+ messages in thread From: Surinder Kumar @ 2016-09-15 09:24 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers On Thu, Sep 15, 2016 at 2:47 PM, Dave Page <[email protected]> wrote: > Thanks, applied. > > One minor tweak to look at - in firefox, the width of the left margin > in the query tool changes when you add a line, if the font size in > preferences is not set to 1em. I think the width is initially sized > for the font, then gets adjusted as you hit return. This doesn't seem > to affect Chrome, and is only a minor annoyance in Firefox. > Ok, I will look into it. > > On Thu, Sep 15, 2016 at 10:04 AM, Surinder Kumar > <[email protected]> wrote: > > Hi > > > > Please find updated patch. > > > > On Thu, Sep 15, 2016 at 1:38 PM, Dave Page <[email protected]> wrote: > >> > >> (pgadmin4)piranha:pgadmin4 dpage$ git apply ~/Downloads/RM1579.patch > >> error: patch failed: web/pgadmin/static/css/overrides.css:53 > >> error: web/pgadmin/static/css/overrides.css: patch does not apply > >> > >> Please rebase! > >> > >> On Thu, Sep 15, 2016 at 8:54 AM, Surinder Kumar > >> <[email protected]> wrote: > >> > Hi > >> > > >> > Please find the attached patch patch with following changes: > >> > > >> > 1) Implemented CodeMirror addon 'simplescrollbars'. > >> > > >> > 2) The CodeMirror instance of query tool was not rendering into > >> > wcDocker's > >> > 'pg-panel-content' div. it renders outside the div, due to which it > took > >> > little more time investigating why scrollbars doesn't appear in > editor. > >> > > >> > 3) Add new css specific to query tool. > >> > > >> > > >> > Please review. > >> > > >> > Thanks, > >> > Surinder Kumar > >> > > >> > > >> > > >> > -- > >> > Sent via pgadmin-hackers mailing list ([email protected] > ) > >> > To make changes to your subscription: > >> > http://www.postgresql.org/mailpref/pgadmin-hackers > >> > > >> > >> > >> > >> -- > >> Dave Page > >> Blog: http://pgsnake.blogspot.com > >> Twitter: @pgsnake > >> > >> EnterpriseDB UK: http://www.enterprisedb.com > >> The Enterprise PostgreSQL Company > > > > > > > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2016-09-15 09:24 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-09-15 07:54 [pgAdmin4][Patch]: RM1579 - Unable to scroll the query text window during selection Surinder Kumar <[email protected]> 2016-09-15 08:08 ` Dave Page <[email protected]> 2016-09-15 09:04 ` Surinder Kumar <[email protected]> 2016-09-15 09:17 ` Dave Page <[email protected]> 2016-09-15 09:24 ` Surinder Kumar <[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