<commit_before>import $ from 'jquery';
import 'jquery-ui/ui/tabs';
import {ajaxCall, alert_jq, confirm_jq, prompt_jq, dderlState,
        smartDialogPosition} from './dderl';
import {sql_params_dlg} from './dderl.sqlparams';

export function StartSqlEditor(title = null, cmd) {
    $('<div>')
        .appendTo(document.body)
        .sql({
            autoOpen: false,
            title: title,
            cmdOwner: null,
            cmdFlat: cmd,
        })
        .sql('open');
}

function insertAtCursor(myField, myValue) {
  //IE support
  if (document.selection) {
    var temp;
    myField.focus();
    var sel = document.selection.createRange();
    temp = sel.text.length;
    sel.text = myValue;
    if (myValue.length === 0) {
      sel.moveStart('character', myValue.length);
      sel.moveEnd('character', myValue.length);
    } else {
      sel.moveStart('character', -myValue.length + temp);
    }
    sel.select();
  }
  //MOZILLA/NETSCAPE support<commit_msg>Fixed build adding missing default parameter<commit_after>import $ from 'jquery';
import 'jquery-ui/ui/tabs';
import {ajaxCall, alert_jq, confirm_jq, prompt_jq, dderlState,
        smartDialogPosition} from './dderl';
import {sql_params_dlg} from './dderl.sqlparams';

export function StartSqlEditor(title = null, cmd = undefined) {
    $('<div>')
        .appendTo(document.body)
        .sql({
            autoOpen: false,
            title: title,
            cmdOwner: null,
            cmdFlat: cmd,
        })
        .sql('open');
}

function insertAtCursor(myField, myValue) {
  //IE support
  if (document.selection) {
    var temp;
    myField.focus();
    var sel = document.selection.createRange();
    temp = sel.text.length;
    sel.text = myValue;
    if (myValue.length === 0) {
      sel.moveStart('character', myValue.length);
      sel.moveEnd('character', myValue.length);
    } else {
      sel.moveStart('character', -myValue.length + temp);
    }
    sel.select();
  }
  //MOZILLA/NETSCAPE support
{'fraction_non_alphanumeric': 0.14171256885327993, 'fraction_numerical': 0.00100150225338007, 'mean_word_length': 2.632727272727273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2468986', 'n_tokens_mistral': 644, 'n_tokens_neox': 633, 'n_words': 137}