Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Code Mirror - Editor Instance - Refactor and fix existing code - also AutoComplete for SQL Mode #54

Open
RohitDhankar opened this issue May 7, 2020 · 2 comments
Assignees
Labels
Front_End JavaScript Tasks which are predominantly coded in JavaScript

Comments

@RohitDhankar
Copy link
Member

New feature to be coded from scratch -
1/ Use Code Mirror = https://codemirror.net/doc/manual.html
2/ Create a Code Mirror - Editor Instance
3/ Auto Complete for SQL Mode

Old code references within existing code base -
1/ Url's within Url.py = Line 165 to 174

#CodeMirror

2/ Old HTML test pages
a) CodeMirror autoComplete = dc_dash/templates/dc_dash/dc_autoCompleteTest.html
b) dc_dash/templates/dc_dash/codeMirror_test2.html
c) dc_dash/templates/dc_dash/codeMirror_test1.html

@noob-master147
Copy link
Member

<title>Digital Cognition</title>
<script src="./codemirror/lib/codemirror.js"></script>
<link href="./codemirror/lib/codemirror.css" rel="stylesheet">

<link href="./codemirror/theme/abcdef.css" rel="stylesheet">
<script src="./codemirror/mode/sql/sql.js"></script>
<script src="./codemirror/addon/edit/closetag.js"></script>
<script src="./codemirror/addon/edit/closebrackets.js"></script>
<script src="./codemirror/addon/lint/"></script>
<script src="./codemirror/addon/edit/matchbrackets.js"></script>

<!-- linter -->
<script src="./codemirror/addon/lint/lint.js"></script>
<script src="./codemirror/addon/lint/"></script>
<link href="codemirror/addon/lint/lint.css" rel="stylesheet">

<!-- hinting -->
<script src="./codemirror/addon/hint/show-hint.js"></script>
<script src="./codemirror/addon/hint/sql-hint.js"></script>
<script src="./codemirror/addon/hint/css-hint.js"></script>
<link href="./codemirror/addon/hint/show-hint.css" rel="stylesheet">
<textarea id="editor">SELE</textarea> <script> var editor = CodeMirror.fromTextArea (document.getElementById('editor'), { mode: "text/x-sql", theme: "abcdef", lineNumbers: true, autoCloseTags: true, matchBrackets: true, autoCloseBrackets: true, gutters: ["CodeMirror-lint-markers"], lint: true, hint: true, extraKeys: { 'Ctrl-Space': 'autocomplete' }, }) editor.setOption("lint", {});
</script>

@noob-master147
Copy link
Member

This code works for AutoCompletion, code hinting on SQL queries @RohitDhankar

@RohitDhankar RohitDhankar added JavaScript Tasks which are predominantly coded in JavaScript Front_End labels May 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Front_End JavaScript Tasks which are predominantly coded in JavaScript
Projects
None yet
Development

No branches or pull requests

3 participants