forked from nuysoft/Mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor.html
176 lines (174 loc) · 7.72 KB
/
editor.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Mock.js Service</title>
<link href="/bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<script src="/bower_components/jquery/dist/jquery.js"></script>
<script src="/dist/mock.js"></script>
<link href="/bower_components/codemirror/lib/codemirror.css" rel="stylesheet">
<link href="/bower_components/codemirror/theme/neat.css" rel="stylesheet">
<script src="/bower_components/codemirror/lib/codemirror.js"></script>
<script src="/bower_components/codemirror/mode/javascript/javascript.js"></script>
<script src="/bower_components/js-beautify/js/lib/beautify.js"></script>
<link href="/editor/editor.css" rel="stylesheet">
</head>
<body>
<div class="header">
<!-- -->
<div class="brand">
<div class="logo">
<a href="/"><i class="iconlogo">㐵</i></a>
</div>
<div class="name">Mock.js</div>
</div>
<!-- -->
<ul class="nav navbar-right">
<li><a href="#help" class="help"><i class="glyphicon glyphicon-question-sign"></i> Help</a></li>
<li><a href="javascript:void('About');" class="about"><i class="glyphicon glyphicon-info-sign"></i> About</a></li>
<li><a href="javascript:void('Login/Sign up');" class="account"><i class="glyphicon glyphicon-user"></i> Login/Sign up</a></li>
</ul>
<!-- -->
<ul class="nav">
<!-- <li><a class="save" href="javascript:;"><i class="glyphicon glyphicon-floppy-save"></i> Save</a></li> -->
<!-- <li><a class="update" href="javascript:;">Update</a></li> -->
<li><a class="tidy" href="javascript:;"><i class="glyphicon glyphicon-eye-open"></i> Tidy</a></li>
<!-- <li><a class="share" href="javascript:;"><i class="glyphicon glyphicon-share-alt"></i> Share</a></li> -->
</ul>
</div>
<div class="viewport">
<div class="box template pull-left">
<textarea name="tpl"></textarea>
</div>
<div class="box result pull-left">
<textarea name="data"></textarea>
<span class="badge"></span>
</div>
<div class="sidebar pull-left">
<div class="help">
<div class="content">
<h3>示例 Demo</h3>
<ul>
<li><a href="javascript:;" class="importSyntaxExample">导入语法示例</a></li>
<li><a href="javascript:;" class="importPlaceholderExample">导入占位符示例</a></li>
</ul>
<h3>语法 Syntax</h3>
<table class="table table-bordered">
<thead>
<tr>
<th>Type</th>
<th>Syntax</th>
</tr>
</thead>
<tbody>
<tr>
<td>String</td>
<td>
<p><code>'name|min-max': 'value'</code></p>
<p><code>'name|count': 'value'</code></p>
</td>
</tr>
<tr>
<td>Number</td>
<td>
<p><code>'name|+1': 100</code></p>
<p><code>'name|1-100': 100</code></p>
<p><code>'name|1-100.1-10</code></p>
</td>
</tr>
<tr>
<td>Boolean</td>
<td>
<p><code>'name|1': value</code></p>
<p><code>'name|min-max': value</code></p>
</td>
</tr>
<tr>
<td>Object</td>
<td>
<p><code>'name|min-max': {}</code></p>
<p><code>'name|count': {}</code></p>
</td>
</tr>
<tr>
<td>Array</td>
<td>
<p><code>'name|1': [{}, {} ...]</code></p>
<p><code>'name|min-max': [{}, {} ...]</code></p>
<p><code>'name|count': [{}, {} ...]</code></p>
</td>
</tr>
<tr>
<td>Function</td>
<td>
<p><code>'name': function(){}</code></p>
</td>
</tr>
</tbody>
</table>
<h3>占位符 Placeholder</h3>
<table class="table table-bordered">
<thead>
<tr>
<th>Type</th>
<th>Placeholder</th>
</tr>
</thead>
<tbody>
<tr>
<td>Basics</td>
<td><p>boolean, natural, integer, float, character, string, range, date, time, datetime, now</p></td>
</tr>
<tr>
<td>Image</td>
<td><p>image, dataImage</p></td>
</tr>
<tr>
<td>Color</td>
<td><p>color</td>
</tr>
<tr>
<td>Text</td>
<td><p>paragraph, sentence, word, title</p></td>
</tr>
<tr>
<td>Name</td>
<td><p>first, last, name</p></td>
</tr>
<tr>
<td>Web</td>
<td><p>url, domain, email, ip, tld</p></td>
</tr>
<tr>
<td>Address</td>
<td><p>area, region</p></td>
</tr>
<tr>
<td>Helpers</td>
<td><p>capitalize, upper, lower, pick, shuffle</p></td>
</tr>
<tr>
<td>Miscellaneous</td>
<td><p>guid, id</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="about">
<div class="content">
<h3>About</h3>
<p>TODO</p>
</div>
</div>
<div class="account">
<div class="content">
<h3>Account</h3>
<p>TODO</p>
</div>
</div>
</div>
</div>
<script src="/editor/editor.js"></script>
</body>
</html>