<commit_before>opyright (C) 2013 salesforce.com, inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
({
    init: function(cmp) {
    	var closeAction = cmp.get("v.closeAction");
        var direction = cmp.get("v.direction");
        //handler for closeOnEsc and closeOnTabOut
        cmp._windowKeyHandler = this.lib.panelLibCore.getKeyEventListener(cmp, {closeOnEsc: true, closeOnTabOut:true}, closeAction);
        //handler for closeOnClickOut
        cmp._mouseEventHandler = this.lib.panelLibCore.getMouseEventListener(cmp, {closeOnClickOut: cmp.get('v.closeOnClickOut')}, closeAction);
        //create default close button
        if ($A.util.isEmpty(cmp.get('v.closeButton')) && cmp.get('v.showCloseButton')) {
            $A.componentService.createComponent('ui:button', {
                'body': $A.newCmp({componentDef: 'aura:unescapedHtml', attributes: {values: {value: '&times;'}}}),
                'class': "closeBtn",
                'press': cmp.getReference("c.onCloseBtnPressed"),
                'label': cmp.get('v.closeDialogLabel'),
                'buttonTitle': cmp.get('v.closeDialogLabel'),
                'labelDisplay': "false"
            }, function(button){
                cmp.set('v.closeButton', button);
            });
        }

        var direction = cmp.get("v.direction");
        if(direction && direction.match(/(north|south)(east|west)/)) {
            cmp.set('v.showPointer', false);
        }
    },
     
    _getKeyHandler: function(cmp) {
        if (!cmp._keyHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._keyHandler = this.lib.panelLibCore.getKeyEventListener(cmp, {closeOnEsc: true, trapFocus: true}, closeAction);
        }
        return cmp._keyHandler;
    },
    
    _getMouseHandler: function(cmp) {
        if (!cmp._mouseHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._mouseHandler = this.lib.panelLibCore.getMouseEventListener(cmp, {closeOnClickOut: cmp.get('v.closeOnClickOut')}, closeAction);
        }
        return cmp._mouseHandler;
    },
     
    _getKeyHandler: function(cmp) {
        if (!cmp._keyHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._keyHandler = this.lib.panelLibCore.getKeyEventListener(cmp, {closeOnEsc: true, trapFocus: true}, closeAction);
        }
        return cmp._keyHandler;
    },
    
    _getMouseHandler: function(cmp) {
        if (!cmp._mouseHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._mouseHandler = this.lib.panelLibCore.getMouseEventListener(cmp, {closeOnClickOut: cmp.get('v.closeOnClickOut')}, closeAction);
        }
        return cmp._mouseHandler;
    },
     
    _getKeyHandler: function(cmp) {
        if (!cmp._keyHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._keyHandler = this.lib.panelLibCore.getKeyEventListener(cmp, {closeOnEsc: true, trapFocus: true}, closeAction);
        }
        return cmp._keyHandler;
    },
    
    _getMouseHandler: function(cmp) {
        if (!cmp._mouseHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._mouseHandler = this.lib.panelLibCore.getMouseEventListener(cmp, {closeOnClickOut: cmp.get('v.closeOnClickOut')}, closeAction);
        }
        return cmp._mouseHandler;
    },

    _getReferenceElement: function(cmp) {

        var referenceElementSelector = cmp.get("v.referenceElementSelector");
        var referenceEl = cmp.get('v.referenceElement');
        
        if(!referenceEl) {
            referenceEl = referenceElementSelector ? document.querySelector(referenceElementSelector) : null;<commit_msg>changes for mobile modal<commit_after>/*
 * Copyright (C) 2013 salesforce.com, inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
({
    init: function(cmp) {   
        //create default close button
        if ($A.util.isEmpty(cmp.get('v.closeButton')) && cmp.get('v.showCloseButton')) {
            $A.componentService.createComponent('ui:button', {
                'body': $A.newCmp({componentDef: 'aura:unescapedHtml', attributes: {values: {value: '&times;'}}}),
                'class': "closeBtn",
                'press': cmp.getReference("c.onCloseBtnPressed"),
                'label': cmp.get('v.closeDialogLabel'),
                'buttonTitle': cmp.get('v.closeDialogLabel'),
                'labelDisplay': "false"
            }, function(button){
                cmp.set('v.closeButton', button);
            });
        }

        var direction = cmp.get("v.direction");
        if(direction && direction.match(/(north|south)(east|west)/)) {
            cmp.set('v.showPointer', false);
        }
    },
     
    _getKeyHandler: function(cmp) {
        if (!cmp._keyHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._keyHandler = this.lib.panelLibCore.getKeyEventListener(cmp, {closeOnEsc: true, trapFocus: true}, closeAction);
        }
        return cmp._keyHandler;
    },
    
    _getMouseHandler: function(cmp) {
        if (!cmp._mouseHandler && cmp.isValid()) {
        	var closeAction = cmp.get("v.closeAction");
            cmp._mouseHandler = this.lib.panelLibCore.getMouseEventListener(cmp, {closeOnClickOut: cmp.get('v.closeOnClickOut')}, closeAction);
        }
        return cmp._mouseHandler;
    },
     
    _getReferenceElement: function(cmp) {

        var referenceElementSelector = cmp.get("v.referenceElementSelector");
        var referenceEl = cmp.get('v.referenceElement');
        
        if(!referenceEl) {
            referenceEl = referenceElementSelector ? document.querySelector(referenceElementSelector) : null;
{'fraction_non_alphanumeric': 0.12877234104893057, 'fraction_numerical': 0.0023439789041898623, 'mean_word_length': 2.7103260869565218, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3106621', 'n_tokens_mistral': 1961, 'n_tokens_neox': 1924, 'n_words': 422}