{"html_url": "https://github.com/simonw/datasette/pull/181#issuecomment-378293484", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/181", "id": 378293484, "node_id": "MDEyOklzc3VlQ29tbWVudDM3ODI5MzQ4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-03T15:34:29Z", "updated_at": "2018-04-03T15:34:29Z", "author_association": "OWNER", "body": "Here's what this looks like:\r\n\r\n![2018-04-03 at 8 32 am](https://user-images.githubusercontent.com/9599/38259345-9e1c75ea-3719-11e8-83c9-2160c6fa079c.png)\r\n\r\nI need to figure out the right way to handle licensing of bundled software like this - it's MIT licensed which is compatible with Datasette's Apache 2 license, but I feel like bundled licensed software (including codemirror) needs to be recognized in the README or docs somehow.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 289425975, "label": "add \"format sql\" button to query page, uses sql-formatter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/181#issuecomment-378293599", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/181", "id": 378293599, "node_id": "MDEyOklzc3VlQ29tbWVudDM3ODI5MzU5OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-03T15:34:50Z", "updated_at": "2018-04-03T15:36:58Z", "author_association": "OWNER", "body": "Let's only show the \"Format SQL\" button if the user has JavaScript enabled. We can do that in this code here:\r\n\r\nhttps://github.com/bsmithgall/datasette/blob/4a7151a58d6ab7c8404a91beef7083e8a5807cf8/datasette/templates/_codemirror_foot.html#L14-L21", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 289425975, "label": "add \"format sql\" button to query page, uses sql-formatter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/181#issuecomment-378295376", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/181", "id": 378295376, "node_id": "MDEyOklzc3VlQ29tbWVudDM3ODI5NTM3Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-03T15:39:57Z", "updated_at": "2018-04-03T15:39:57Z", "author_association": "OWNER", "body": "On the licensing front: it looks like the way Django handles this is to keep the licensing header in the files intact, e.g. https://github.com/django/django/blob/6deaddcca367d0143c815aaa42342021baa3b41e/django/contrib/admin/static/admin/js/vendor/jquery/jquery.js\r\n\r\nSo for this change, adding a comment at the top of `sql-formatter.min.js` which references the MIT license would do the trick.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 289425975, "label": "add \"format sql\" button to query page, uses sql-formatter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/181#issuecomment-378297842", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/181", "id": 378297842, "node_id": "MDEyOklzc3VlQ29tbWVudDM3ODI5Nzg0Mg==", "user": {"value": 1957344, "label": "bsmithgall"}, "created_at": "2018-04-03T15:47:13Z", "updated_at": "2018-04-03T15:47:13Z", "author_association": "NONE", "body": "I can work on that -- would you prefer to inline a `display: hidden` and then have the javascript flip the visibility or include it as css?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 289425975, "label": "add \"format sql\" button to query page, uses sql-formatter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/181#issuecomment-379636695", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/181", "id": 379636695, "node_id": "MDEyOklzc3VlQ29tbWVudDM3OTYzNjY5NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-09T05:30:16Z", "updated_at": "2018-04-09T05:30:16Z", "author_association": "OWNER", "body": "I'd prefer to have the JavaScript actually manipulate the DOM to add the button - something like this:\r\n\r\n var button = document.createElement('button');\r\n button.value = 'Format SQL';\r\n button.addEventListener(\r\n 'click', format, false\r\n );\r\n document.getElementById('run-sql').parentNode.appendChild(button);", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 289425975, "label": "add \"format sql\" button to query page, uses sql-formatter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/181#issuecomment-379759875", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/181", "id": 379759875, "node_id": "MDEyOklzc3VlQ29tbWVudDM3OTc1OTg3NQ==", "user": {"value": 1957344, "label": "bsmithgall"}, "created_at": "2018-04-09T13:53:14Z", "updated_at": "2018-04-09T13:53:14Z", "author_association": "NONE", "body": "I've implemented that approach in 86ac746. It does cause the button to pop in only after Codemirror is finished rendering which is a bit awkward.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 289425975, "label": "add \"format sql\" button to query page, uses sql-formatter"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/181#issuecomment-552275451", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/181", "id": 552275451, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MjI3NTQ1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-11T03:08:25Z", "updated_at": "2019-11-11T03:08:25Z", "author_association": "OWNER", "body": "Closing this because this feature was shipped in #592 ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 289425975, "label": "add \"format sql\" button to query page, uses sql-formatter"}, "performed_via_github_app": null}