<commit_before>/*global logger*/
/*
    AutoCompleteForMendix
    ========================

    @file      : AutoCompleteForMendix.js
    @version   : 3.1.1
    @author    : <NAME>
    @date      : 2017-03-31
    @copyright : AuraQ Limited 2017
    @license   : Apache V2

    Documentation
    ========================
    AutoComplete widget built using Select2 (https://select2.github.io/).
*/

// Required module list. Remove unnecessary modules, you can always get them back from the boilerplate.
define( [
    "dojo/_base/declare",
    "mxui/widget/_WidgetBase",
    "dijit/_TemplatedMixin",
    "mxui/dom",
    "dojo/dom",
    "dojo/dom-prop",
    "dojo/dom-geometry",
    "dojo/dom-class",
    "dojo/dom-style",
    "dojo/dom-construct",
    "dojo/_base/array", 
    "dojo/_base/lang",
    "dojo/text",
    "dojo/html",
    "dojo/_base/event",
    "dojo/_base/kernel",
    "AutoCompleteForMendix/lib/jquery-1.11.2",
    "AutoCompleteForMendix/lib/select2",
    "dojo/text!AutoCompleteForMendix/widget/template/AutoCompleteForMendix.html"
], function(declare, _WidgetBase, _TemplatedMixin, dom, dojoDom, dojoProp, dojoGeometry, dojoClass, dojoStyle, dojoConstruct, dojoArray, dojoLang, dojoText, dojoHtml, dojoEvent, dojo, _jQuery, _select2, widgetTemplate) {
    "use strict";

    var $ = _jQuery.noConflict(true);
    $ = _select2.createInstance($);

    // Declare widget's prototype.
    return declare("AutoCompleteForMendix.widget.AutoCompleteForMendix", [ _WidgetBase, _TemplatedMixin ], {
        // _TemplatedMixin will create our dom node using this HTML template.
        templateString: widgetTemplate,

        _$combo: null,
        _isValid : true,
        _displayAttributes : [],
        _sortParams : [],
        _queryAdapter : null,
        _entity: null,  
        _reference: null,
        _constrainedByAssociation: null,
        _constrainedByReference: null,
        _constrainedBySourceReference: null,
        _attributeList: null,
        _displayTemplate: "",
        _selectedTemplate: "",
        variableData : [],
        _currentSearchTerm : "",
        _localObjectCache: null,
        _updateCache : true,
        _queryTimeout : null,

        // Internal variables. Non-primitives created in the prototype are shared between all widget instances.
        _handles: null,
        _contextObj: null,
        _$alertdiv: null,
        _alertDiv: null,
        _hadValidationFeedback: false,

        // dojo.declare.constructor is called to construct the widget instance. Implement to initialize non-primitive properties.
        constructor: function() {
            // Uncomment the following line to enable debug messages
            //logger.level(logger.DEBUG);
            logger.debug(this.id + ".constructor");
            this._handles = [];
        },

        // dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
        postCreate: function() {
            logger.debug(this.id + ".postCreate");            

            $(document).on("touchstart",".select2");
            $(document).on("touchstart",".select2", function(event){
                $(event.target).trigger($.Event("click", {
                    pageX: event.originalEvent.touches[0].pageX,
                    pageY: event.originalEvent.touches[0].pageY,<commit_msg>remove extra touch event with empty handler<commit_after>/*global logger*/
/*
    AutoCompleteForMendix
    ========================

    @file      : AutoCompleteForMendix.js
    @version   : 3.1.2
    @author    : <NAME>
    @date      : 2017-05-08
    @copyright : AuraQ Limited 2017
    @license   : Apache V2

    Documentation
    ========================
    AutoComplete widget built using Select2 (https://select2.github.io/).
*/

// Required module list. Remove unnecessary modules, you can always get them back from the boilerplate.
define( [
    "dojo/_base/declare",
    "mxui/widget/_WidgetBase",
    "dijit/_TemplatedMixin",
    "mxui/dom",
    "dojo/dom",
    "dojo/dom-prop",
    "dojo/dom-geometry",
    "dojo/dom-class",
    "dojo/dom-style",
    "dojo/dom-construct",
    "dojo/_base/array", 
    "dojo/_base/lang",
    "dojo/text",
    "dojo/html",
    "dojo/_base/event",
    "dojo/_base/kernel",
    "AutoCompleteForMendix/lib/jquery-1.11.2",
    "AutoCompleteForMendix/lib/select2",
    "dojo/text!AutoCompleteForMendix/widget/template/AutoCompleteForMendix.html"
], function(declare, _WidgetBase, _TemplatedMixin, dom, dojoDom, dojoProp, dojoGeometry, dojoClass, dojoStyle, dojoConstruct, dojoArray, dojoLang, dojoText, dojoHtml, dojoEvent, dojo, _jQuery, _select2, widgetTemplate) {
    "use strict";

    var $ = _jQuery.noConflict(true);
    $ = _select2.createInstance($);

    // Declare widget's prototype.
    return declare("AutoCompleteForMendix.widget.AutoCompleteForMendix", [ _WidgetBase, _TemplatedMixin ], {
        // _TemplatedMixin will create our dom node using this HTML template.
        templateString: widgetTemplate,

        _$combo: null,
        _isValid : true,
        _displayAttributes : [],
        _sortParams : [],
        _queryAdapter : null,
        _entity: null,  
        _reference: null,
        _constrainedByAssociation: null,
        _constrainedByReference: null,
        _constrainedBySourceReference: null,
        _attributeList: null,
        _displayTemplate: "",
        _selectedTemplate: "",
        variableData : [],
        _currentSearchTerm : "",
        _localObjectCache: null,
        _updateCache : true,
        _queryTimeout : null,

        // Internal variables. Non-primitives created in the prototype are shared between all widget instances.
        _handles: null,
        _contextObj: null,
        _$alertdiv: null,
        _alertDiv: null,
        _hadValidationFeedback: false,

        // dojo.declare.constructor is called to construct the widget instance. Implement to initialize non-primitive properties.
        constructor: function() {
            // Uncomment the following line to enable debug messages
            //logger.level(logger.DEBUG);
            logger.debug(this.id + ".constructor");
            this._handles = [];
        },

        // dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
        postCreate: function() {
            logger.debug(this.id + ".postCreate");            

            $(document).on("touchstart",".select2", function(event){
                $(event.target).trigger($.Event("click", {
                    pageX: event.originalEvent.touches[0].pageX,
                    pageY: event.originalEvent.touches[0].pageY,
{'fraction_non_alphanumeric': 0.12543187622051977, 'fraction_numerical': 0.008562415502478594, 'mean_word_length': 2.56423982869379, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5322561', 'n_tokens_mistral': 2009, 'n_tokens_neox': 1904, 'n_words': 420}