Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sql_editor.js « transformations « js - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3c7b305a4346a87780be63040213b2f913fd7a9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * SQL syntax highlighting transformation plugin js
 *
 * @package PhpMyAdmin
 */
AJAX.registerOnload('transformations/sql_editor.js', function() {

    $.each($('textarea.transform_sql_editor'), function (i, e) {
        var height = $(e).css('height');
        var codemirror_editor = CodeMirror.fromTextArea(e, {
            lineNumbers: true,
            matchBrackets: true,
            extraKeys: {"Ctrl-Space": "autocomplete"},
            hintOptions: {"completeSingle": false, "completeOnSingleClick": true},
            indentUnit: 4,
            mode: "text/x-mysql",
            lineWrapping: true
        });
        codemirror_editor.on("inputRead", codemirrorAutocompleteOnInputRead);
        codemirror_editor.getScrollerElement().style.height = height;
        codemirror_editor.refresh();
        codemirror_editor.focus();
        $(codemirror_editor.getWrapperElement()).bind(
            'keydown',
            catchKeypressesFromSqlTextboxes
        );
    });

});