-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommint.js
53 lines (45 loc) · 1.1 KB
/
commint.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$(document).ready(function () {
$.fn.readerImg = function (option) {
var $$ = $(this);
var upFile = option.src;
var width = option.width != undefined ? option.width : '640px';
if (upFile == undefined) {
return false;
}
if ($$.hasClass('none')) {
$$.removeClass('none');
} else {
$$.show();
}
if ($$[0].tagName != 'IMG') {
var imgOjb = document.createElement('img');
imgOjb.src = "";
imgOjb.alt = "";
$$.append(imgOjb);
$$ = $(imgOjb);
}
$$.css({width: width});
if (typeof (FileReader) != "undefined") {
var reader = new FileReader();
reader.onload = function (e) {
var result = e.target.result;
$$.attr('src', result);
}
reader.readAsDataURL(upFile);
}
};
/**
* datepicker
*/
function datepicker() {
$('input.datepicker').each(function() {
var options = $(this).data('options') || {};
options.show_icon = false;
if (typeof options.pair == 'string') {
options.pair = $(options.pair);
}
$(this).Zebra_DatePicker(options);
});
}
datepicker();
});