forked from jojosati/bootstrap-datepicker-thai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
104 lines (91 loc) · 3.65 KB
/
demo.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="utf-8">
<title>bootstrap-datepicker-thai demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="//getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" media="screen">
<link href="css/datepicker.css" rel="stylesheet" media="screen">
<link href="//getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.css" rel="stylesheet">
<link href="//getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<h1><a href="//jojosati.github.com/bootstrap-datepicker-thai">Bootstrap Datepicker Thai</a> <small>on <a href="//github.com/jojosati/bootstrap-datepicker-thai">github</a></small></h1>
</div>
<div class="row-fluid">
<div class="span4">
<h3>Demo</h3>
<div id="example_html">
<label>default(en)</label>
<input class="input-medium" type="text"
data-provide="datepicker">
<label>th</label>
<input class="input-medium" type="text"
data-provide="datepicker" data-date-language="th">
<label>th-th</label>
<input class="input-medium" type="text"
data-provide="datepicker" data-date-language="th-th">
<label>inline en-th</label>
<div class="datepicker" data-date-language="en-th"></div>
</div>
</div>
<div class="span8">
<div>
<h3>HTML</h3>
<pre class="pre-scrollable prettyprint linenums" data-source="#example_html"></pre>
</div>
<div>
<h3>SCRIPT</h3>
<pre class="pre-scrollable prettyprint linenums" data-source="#example_script"></pre>
</div>
</div>
</div>
<div class="row-fluid">
<hr>
<footer>
<p>maintained by <a href="//github.com/jojosati">jojosati</a></p>
</footer>
</div>
</div>
<!-- Placed at the end of the document so the pages load faster -->
<script src="//getbootstrap.com/2.3.2/assets/js/jquery.js"></script>
<script src="//getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/bootstrap-datepicker-thai.js"></script>
<script src="js/locales/bootstrap-datepicker.th.js"></script>
<script id="example_script" type="text/javascript">
function demo() {
$('.datepicker').datepicker();
}
</script>
<script type="text/javascript">
$(function(){
$('pre[data-source]').each(function(){
var $this = $(this),
$source = $($this.data('source'));
var text = [];
$source.each(function(){
var $s = $(this);
if ($s.attr('type') == 'text/javascript'){
text.push($s.html().replace(/(\n)*/, ''));
} else {
text.push($s.clone().wrap('<div>').parent().html()
.replace(/(\"(?=[[{]))/g,'\'')
.replace(/\]\"/g,']\'').replace(/\}\"/g,'\'') // javascript not support lookbehind
.replace(/\"\;/g,'"'));
}
});
$this.text(text.join('\n\n').replace(/\t/g, ' '));
});
prettyPrint();
demo();
});
</script>
</body>
</html>