<commit_before>/**
 * Module : neoui-dialog
 * Author : Kvkens(<EMAIL>)
 * Date	  : 2016-08-02 15:29:55
 */

import {BaseComponent} from 'tinper-sparrow/js/BaseComponent';
import {addClass,removeClass,hasClass,getStyle,makeDOM,makeModal} from 'tinper-sparrow/js/dom';
import {on,stopEvent,trigger} from 'tinper-sparrow/js/event';
import {extend} from 'tinper-sparrow/js/extend';
import {Button} from './neoui-button';
import {compMgr} from 'tinper-sparrow/js/compMgr';
import {trans} from 'tinper-sparrow/js/util/i18n';

/**
 * messageDialog.js
 */

'use strict';

/**
 * 消息提示框
 * @param options
 */

var messageDialogTemplate = '<div class="u-msg-dialog-top" id="{id}_top">' +
'<div class="u-msg-dialog" style="{width}{height}{top}">' +
'<div class="u-msg-dialog-content">' +
'<div class="u-msg-title">' +
'<h4>{title}</h4>' +
'</div>' +
'<div class="u-msg-content"></div>' +
'{footer}' +
'</div></div>';



var messageDialogF = function(options) {

	if(typeof options === 'string') {
		options = {
			content: options
		};
	}
	var defaultOptions = {
		id: '',
		msg: '',
		template: messageDialogTemplate,
		width: '',
		height: '',
		top: '',
		hasFooter: true,
		// title: '提示',
		// btnText: '确定',
		title: trans('dialog.title', '提示'),
		btnText: trans('dialog.btnText', '确定'),
		closeFun: function (){}

	}
	options = extend(defaultOptions, options);
	this.id = options['id'];
	this.hasFooter = options['hasFooter'];
	this.content = options['msg'];
	this.title = options['title'];
	this.template = options['template'];
	this.width = options['width'];
	this.height = options['height'];
	this.top = options['top'];
	this.bthText = options['btnText'];
	this.lazyShow = options['lazyShow'];
	this.closeFun = options['closeFun'];
	this.create();

	var msgDom = this.templateDom.querySelector('.u-msg-dialog');
if(this.height){
	this.resizeFun = function() {
		var cDom = msgDom.querySelector('.u-msg-content');
		if(!cDom) return;
		cDom.style.height = '';
		var wholeHeight = msgDom.offsetHeight;
		var contentHeight = msgDom.scrollHeight;
		// if(contentHeight > wholeHeight && cDom)<commit_msg>i18n-dialog去除冗余<commit_after>/**
 * Module : neoui-dialog
 * Author : Kvkens(<EMAIL>)
 * Date	  : 2016-08-02 15:29:55
 */

import {BaseComponent} from 'tinper-sparrow/js/BaseComponent';
import {addClass,removeClass,hasClass,getStyle,makeDOM,makeModal} from 'tinper-sparrow/js/dom';
import {on,stopEvent,trigger} from 'tinper-sparrow/js/event';
import {extend} from 'tinper-sparrow/js/extend';
import {Button} from './neoui-button';
import {compMgr} from 'tinper-sparrow/js/compMgr';
import {trans} from 'tinper-sparrow/js/util/i18n';

/**
 * messageDialog.js
 */

'use strict';

/**
 * 消息提示框
 * @param options
 */

var messageDialogTemplate = '<div class="u-msg-dialog-top" id="{id}_top">' +
'<div class="u-msg-dialog" style="{width}{height}{top}">' +
'<div class="u-msg-dialog-content">' +
'<div class="u-msg-title">' +
'<h4>{title}</h4>' +
'</div>' +
'<div class="u-msg-content"></div>' +
'{footer}' +
'</div></div>';



var messageDialogF = function(options) {

	if(typeof options === 'string') {
		options = {
			content: options
		};
	}
	var defaultOptions = {
		id: '',
		msg: '',
		template: messageDialogTemplate,
		width: '',
		height: '',
		top: '',
		hasFooter: true,
		// title: '提示',
		// btnText: '确定',
		title: trans('dialog.title', '提示'),
		btnText: trans('dialog.okText', '确定'),
		closeFun: function (){}

	}
	options = extend(defaultOptions, options);
	this.id = options['id'];
	this.hasFooter = options['hasFooter'];
	this.content = options['msg'];
	this.title = options['title'];
	this.template = options['template'];
	this.width = options['width'];
	this.height = options['height'];
	this.top = options['top'];
	this.bthText = options['btnText'];
	this.lazyShow = options['lazyShow'];
	this.closeFun = options['closeFun'];
	this.create();

	var msgDom = this.templateDom.querySelector('.u-msg-dialog');
if(this.height){
	this.resizeFun = function() {
		var cDom = msgDom.querySelector('.u-msg-content');
		if(!cDom) return;
		cDom.style.height = '';
		var wholeHeight = msgDom.offsetHeight;
		var contentHeight = msgDom.scrollHeight;
		// if(contentHeight > wholeHeight && cDom)
{'fraction_non_alphanumeric': 0.20324040981653563, 'fraction_numerical': 0.009054086252084823, 'mean_word_length': 4.64247311827957, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, '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': '6229508', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1525, 'n_words': 277}