├── docs
├── 进度.txt
├── jquery-validate的用户和说明.docx
└── ~$uery-validate的用户和说明.docx
├── demo
├── img
│ ├── tmp
│ │ ├── 160x120.gif
│ │ ├── 260x180.gif
│ │ ├── 360x268.gif
│ │ └── 670x240.gif
│ ├── glyphicons-halflings.png
│ └── glyphicons-halflings-white.png
├── css
│ ├── prettify_bootstrap.css
│ ├── site.css
│ └── bootstrap-responsive.min.css
├── login.htm
├── js
│ ├── site.js
│ ├── prettify.js
│ └── bootstrap.min.js
├── blank.htm
├── files.htm
├── profile.htm
├── settings.htm
├── tasks.htm
├── help.htm
├── help-inner.htm
├── projects.htm
├── activity.htm
├── messages.htm
├── gallery.htm
└── index.html
├── README.md
├── jquery-validation
├── jquery.validate.zh-CN.js
├── jquery.metadata.js
└── jquery.validate.methods.js
└── LICENSE
/docs/进度.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/docs/进度.txt
--------------------------------------------------------------------------------
/demo/img/tmp/160x120.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/demo/img/tmp/160x120.gif
--------------------------------------------------------------------------------
/demo/img/tmp/260x180.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/demo/img/tmp/260x180.gif
--------------------------------------------------------------------------------
/demo/img/tmp/360x268.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/demo/img/tmp/360x268.gif
--------------------------------------------------------------------------------
/demo/img/tmp/670x240.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/demo/img/tmp/670x240.gif
--------------------------------------------------------------------------------
/docs/jquery-validate的用户和说明.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/docs/jquery-validate的用户和说明.docx
--------------------------------------------------------------------------------
/docs/~$uery-validate的用户和说明.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/docs/~$uery-validate的用户和说明.docx
--------------------------------------------------------------------------------
/demo/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/demo/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | jquery-validate-zh-CN
2 | =====================
3 |
4 | 适合web项目中的前端jquery的表单校验,使用非常简单,非常容易修改.
5 |
6 | 描述:
7 | 使用bootstrap来做网页版的开发。
8 |
--------------------------------------------------------------------------------
/demo/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangko27/jquery-validate-zh-CN/HEAD/demo/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/demo/css/prettify_bootstrap.css:
--------------------------------------------------------------------------------
1 | .com { color: #93a1a1; }
2 | .lit { color: #195f91; }
3 | .pun, .opn, .clo { color: #93a1a1; }
4 | .fun { color: #dc322f; }
5 | .str, .atv { color: #D14; }
6 | .kwd, .linenums .tag { color: #1e347b; }
7 | .typ, .atn, .dec, .var { color: teal; }
8 | .pln { color: #48484c; }
9 |
10 | .prettyprint {
11 | padding: 8px;
12 | background-color: #f7f7f9;
13 | border: 1px solid #e1e1e8;
14 | }
15 | .prettyprint.linenums {
16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
19 | }
20 |
21 | /* Specify class=linenums on a pre to get line numbering */
22 | ol.linenums {
23 | margin: 0 0 0 33px; /* IE indents via margin-left */
24 | }
25 | ol.linenums li {
26 | padding-left: 12px;
27 | color: #bebec5;
28 | line-height: 18px;
29 | text-shadow: 0 1px 0 #fff;
30 | }
--------------------------------------------------------------------------------
/jquery-validation/jquery.validate.zh-CN.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Translated default messages for the jQuery validation plugin.
3 | * Locale: CN
4 | */
5 | jQuery.extend(jQuery.validator.messages, {
6 | required: "此内容为必填项,请输入!",
7 | remote: "内容输入错误!",
8 | email: "E-mail格式错误,请重新输入!",
9 | url: "网址格式错误,请重新输入!",
10 | date: "日期格式错误,请重新输入!",
11 | dateISO: "日期格式错误,请重新输入!",
12 | number: "请输入合法的数字!",
13 | digits: "请输入零或正整数!",
14 | creditcard: "信用卡号格式错误,请重新输入!",
15 | equalTo: "两次输入不一致,请重新输入!",
16 | accept: "请输入拥有合法后缀名的字符串!",
17 | maxlength: jQuery.validator.format("字符串长度不能大于{0}!"),
18 | minlength: jQuery.validator.format("字符串长度不能小于{0}!"),
19 | rangelength: jQuery.validator.format("字符串长度只允许在{0}-{1}之间!"),
20 | range: jQuery.validator.format("输入的数值只允许在{0}-{1}之间!"),
21 | max: jQuery.validator.format("输入的数值不允许大于{0}!"),
22 | min: jQuery.validator.format("输入的数值不允许小于{0}!"),
23 | integer: "请输入合法的整数!",
24 | positive: "请输入合法的正数!",
25 | positiveInteger: "请输入合法的正整数!",
26 | mobile: "手机号码格式错误,请重新输入!",
27 | phone: "电话号码格式错误,请重新输入!",
28 | zipCode: "邮政编码格式错误,请重新输入!",
29 | requiredTo: "此内容为必填项,请输入!",
30 | username: "只允许包含中文、英文、数字和下划线!",
31 | prefix: "请输入以 {0} 开头的字符串!",
32 | lettersonly: "只允许包含字母!"
33 | });
--------------------------------------------------------------------------------
/demo/login.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Login - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
Akira Login
16 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/demo/css/site.css:
--------------------------------------------------------------------------------
1 | /* Akira CSS by Shawn Drew */
2 |
3 | /* general */
4 | body {padding-top:20px; padding-bottom:20px;}
5 |
6 | h1 {padding-bottom:0.2em;}
7 |
8 | .meta {color:#999; font-size:.9em; display:block;}
9 | .meta em {font-style:normal; font-weight:bold;}
10 |
11 | /* login */
12 | #login-page.container {width:320px;}
13 |
14 | /* dashboard */
15 | .summary {display:table; width:100%; padding:0; margin:0 0 20px 0;}
16 | .summary ul {margin:0; padding:0; overflow:hidden; display:table-row;}
17 | .summary li {margin:0; padding:19px; display:table-cell; border-right:1px solid #eee;}
18 | .summary li:last-child {border:none;}
19 | .summary a {display:block; font-size:1.2em; line-height:1.4em; text-transform:uppercase; color:#000;}
20 | .summary .count {display:block; font-size:1.75em; font-weight:bold;}
21 |
22 | /* dashboard - ie fixes */
23 | .ie7 .summary {display:block;}
24 | .ie7 .summary ul {margin:0; padding:0; overflow:hidden; display:block;}
25 | .ie7 .summary li {float:left;}
26 |
27 | .ielt9 .summary .last {border:none;}
28 |
29 | /* tasks */
30 | .tasks {margin:0; padding:0;}
31 | .tasks li {list-style-type:none; padding-bottom:0.3em;}
32 | .tasks input {vertical-align:baseline;}
33 | .tasks .meta {padding-left:18px;}
34 | .tasks.done {opacity:0.8;}
35 |
36 | /* messages */
37 | .messages {margin:0; padding:0;}
38 | .messages .messages {padding-top:19px;}
39 | .messages li {list-style-type:none; padding-bottom:0.3em;}
40 | .messages .well {padding:19px;}
41 | .messages .messages .well {border:none; -webkit-box-shadow:none;-moz-box-shadow:none; box-shadow:none; border-left:3px solid #eee;border-left:3px solid rgba(0, 0, 0, 0.05);}
42 |
43 | /* blank slate */
44 | .blank-slate {text-align:center;}
45 |
46 | /* files */
47 | .files li {list-style-type:none;}
48 | .files .meta {padding-left:18px;}
49 |
50 | .zebra-list {margin:0 0 18px 0; padding:0;}
51 | .zebra-list li {border:1px solid #DDD; padding:8px; border-bottom:none;}
52 | .zebra-list li:nth-child(odd) {background-color:#F9F9F9;}
53 | .zebra-list li:first-child {-webkit-border-radius:4px 4px 0 0; -moz-border-radius:4px 4px 0 0; border-radius:4px 4px 0 0;}
54 | .zebra-list li:last-child {border-bottom:1px solid #DDD; -webkit-border-radius:0 0 4px 4px; -moz-border-radius:0 0 4px 4px; border-radius:0 0 4px 4px;}
--------------------------------------------------------------------------------
/demo/js/site.js:
--------------------------------------------------------------------------------
1 | /**
2 | * jQuery.ScrollTo - Easy element scrolling using jQuery.
3 | * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
4 | * Dual licensed under MIT and GPL.
5 | * Date: 5/25/2009
6 | * @author Ariel Flesler
7 | * @version 1.4.2
8 | *
9 | * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
10 | */
11 | ;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
12 |
13 |
14 | (function($){
15 |
16 | $(function() {
17 |
18 | /* toggle links */
19 | $('.toggle-link').click(function(e) {
20 |
21 | var target = $($(this).attr('href')).toggleClass('hidden');
22 |
23 | $.scrollTo(target);
24 |
25 | e.preventDefault();
26 |
27 | });
28 |
29 | });
30 |
31 | })(this.jQuery);
--------------------------------------------------------------------------------
/jquery-validation/jquery.metadata.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Metadata - jQuery plugin for parsing metadata from elements
3 | *
4 | * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
5 | *
6 | * Dual licensed under the MIT and GPL licenses:
7 | * http://www.opensource.org/licenses/mit-license.php
8 | * http://www.gnu.org/licenses/gpl.html
9 | *
10 | * Revision: $Id: jquery.metadata.js 4187 2007-12-16 17:15:27Z joern.zaefferer $
11 | *
12 | */
13 |
14 | /**
15 | * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
16 | * in the JSON will become a property of the element itself.
17 | *
18 | * There are three supported types of metadata storage:
19 | *
20 | * attr: Inside an attribute. The name parameter indicates *which* attribute.
21 | *
22 | * class: Inside the class attribute, wrapped in curly braces: { }
23 | *
24 | * elem: Inside a child element (e.g. a script tag). The
25 | * name parameter indicates *which* element.
26 | *
27 | * The metadata for an element is loaded the first time the element is accessed via jQuery.
28 | *
29 | * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
30 | * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
31 | *
32 | * @name $.metadata.setType
33 | *
34 | * @example This is a p
35 | * @before $.metadata.setType("class")
36 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
37 | * @desc Reads metadata from the class attribute
38 | *
39 | * @example This is a p
40 | * @before $.metadata.setType("attr", "data")
41 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
42 | * @desc Reads metadata from a "data" attribute
43 | *
44 | * @example This is a p
45 | * @before $.metadata.setType("elem", "script")
46 | * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
47 | * @desc Reads metadata from a nested script element
48 | *
49 | * @param String type The encoding type
50 | * @param String name The name of the attribute to be used to get metadata (optional)
51 | * @cat Plugins/Metadata
52 | * @descr Sets the type of encoding to be used when loading metadata for the first time
53 | * @type undefined
54 | * @see metadata()
55 | */
56 |
57 | (function($) {
58 |
59 | $.extend({
60 | metadata : {
61 | defaults : {
62 | type: 'class',
63 | name: 'metadata',
64 | cre: /({.*})/,
65 | single: 'metadata'
66 | },
67 | setType: function( type, name ){
68 | this.defaults.type = type;
69 | this.defaults.name = name;
70 | },
71 | get: function( elem, opts ){
72 | var settings = $.extend({},this.defaults,opts);
73 | // check for empty string in single property
74 | if ( !settings.single.length ) settings.single = 'metadata';
75 |
76 | var data = $.data(elem, settings.single);
77 | // returned cached data if it already exists
78 | if ( data ) return data;
79 |
80 | data = "{}";
81 |
82 | if ( settings.type == "class" ) {
83 | var m = settings.cre.exec( elem.className );
84 | if ( m )
85 | data = m[1];
86 | } else if ( settings.type == "elem" ) {
87 | if( !elem.getElementsByTagName )
88 | return undefined;
89 | var e = elem.getElementsByTagName(settings.name);
90 | if ( e.length )
91 | data = $.trim(e[0].innerHTML);
92 | } else if ( elem.getAttribute != undefined ) {
93 | var attr = elem.getAttribute( settings.name );
94 | if ( attr )
95 | data = attr;
96 | }
97 |
98 | if ( data.indexOf( '{' ) <0 )
99 | data = "{" + data + "}";
100 |
101 | data = eval("(" + data + ")");
102 |
103 | $.data( elem, settings.single, data );
104 | return data;
105 | }
106 | }
107 | });
108 |
109 | /**
110 | * Returns the metadata object for the first member of the jQuery object.
111 | *
112 | * @name metadata
113 | * @descr Returns element's metadata object
114 | * @param Object opts An object contianing settings to override the defaults
115 | * @type jQuery
116 | * @cat Plugins/Metadata
117 | */
118 | $.fn.metadata = function( opts ){
119 | return $.metadata.get( this[0], opts );
120 | };
121 |
122 | })(jQuery);
--------------------------------------------------------------------------------
/demo/blank.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Projects - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
74 |
75 |
125 |
126 |
127 | Blank Slate
128 |
129 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/demo/files.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Files - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
74 |
75 |
125 |
126 |
127 | Files
128 |
129 |
140 |
New File
141 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
--------------------------------------------------------------------------------
/demo/profile.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Profile - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
74 |
75 |
125 |
126 |
127 | Edit Your Profile
128 |
129 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
--------------------------------------------------------------------------------
/demo/settings.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Settings - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Settings
128 |
129 |
130 |
131 | Configure Your Settings
132 |
133 |
Notifications
134 |
149 |
150 |
151 |
Notification Email
152 |
153 |
154 |
Leave blank to use your profile email address.
155 |
156 |
157 |
158 |
Super Admins
159 |
174 |
175 |
176 | Save Cancel
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
--------------------------------------------------------------------------------
/demo/tasks.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Tasks - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Tasks
128 |
129 |
146 |
New Task
147 |
148 |
149 | New Task
150 |
151 |
Task Details
152 |
153 |
154 |
155 |
156 |
157 | Create Cancel
158 |
159 |
160 |
161 |
162 | Completed Tasks
163 |
164 |
165 |
166 | Wash the Car Completed 2 days ago by John
167 |
168 |
169 | Call the plumber Completed 5 days ago by John
170 |
171 |
172 | Try that new cookie recipe Completed 2 weeks ago by Jill
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
--------------------------------------------------------------------------------
/demo/help.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Help - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Help
128 |
129 |
130 |
131 | Help
132 |
133 |
134 | Find all our help and tours below.
135 |
136 |
159 |
160 |
161 |
162 | Recently Added Help
163 |
164 |
165 |
166 |
167 |
168 | Name
169 |
170 |
171 | Date
172 |
173 |
174 | View
175 |
176 |
177 |
178 |
179 |
180 |
181 | Dashboard
182 |
183 |
184 | 4 days ago
185 |
186 |
187 | View
188 |
189 |
190 |
191 |
192 | Tasks
193 |
194 |
195 | 5 days ago
196 |
197 |
198 | View
199 |
200 |
201 |
202 |
203 | Activity
204 |
205 |
206 | 5 days ago
207 |
208 |
209 | View
210 |
211 |
212 |
213 |
214 | Introduction Tour
215 |
216 |
217 | 6 days ago
218 |
219 |
220 | View
221 |
222 |
223 |
224 |
225 | Project Organisation
226 |
227 |
228 | 9 days ago
229 |
230 |
231 | View
232 |
233 |
234 |
235 |
236 | How to upload multiple files
237 |
238 |
239 | 16 days ago
240 |
241 |
242 | View
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
--------------------------------------------------------------------------------
/demo/help-inner.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Help - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Creating a new Project
128 |
129 |
130 |
131 | Help /
132 |
133 |
134 | Projects /
135 |
136 |
137 | Creating a new Project
138 |
139 |
140 |
141 |
142 |
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.
143 |
Header Level 2
144 |
145 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
146 | Aliquam tincidunt mauris eu risus.
147 |
148 |
149 |
Header Level 3
150 |
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
151 |
152 | Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
153 | Aliquam tincidunt mauris eu risus.
154 |
155 |
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus
156 |
157 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/demo/projects.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Projects - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Projects
128 |
129 |
130 |
131 |
132 |
133 | Name
134 |
135 |
136 | Client
137 |
138 |
139 | Tasks
140 |
141 |
142 | Messages
143 |
144 |
145 | Files
146 |
147 |
148 | Progress
149 |
150 |
151 |
152 |
153 |
154 |
155 | Nike.com Redesign
156 |
157 |
158 | Monsters Inc
159 |
160 |
161 | 11
162 |
163 |
164 | 2
165 |
166 |
167 | 4
168 |
169 |
170 |
173 |
174 |
175 |
176 |
177 | Twitter Server Consulting
178 |
179 |
180 | Bad Robot
181 |
182 |
183 | 7
184 |
185 |
186 | 3
187 |
188 |
189 | 0
190 |
191 |
192 |
195 |
196 |
197 |
198 |
199 | Childrens Book Illustration
200 |
201 |
202 | Evil Genius
203 |
204 |
205 | 10
206 |
207 |
208 | 2
209 |
210 |
211 | 1
212 |
213 |
214 |
217 |
218 |
219 |
220 |
221 |
New Project
222 |
223 |
224 | New Project
225 |
226 |
Project Name
227 |
228 |
229 |
230 |
231 |
232 |
Client
233 |
234 | -- Select client -- Bad Robot Evil Genius Monsters Inc
235 |
236 |
237 |
238 |
Project Summary
239 |
240 |
241 |
242 |
243 |
244 | Create Cancel
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
--------------------------------------------------------------------------------
/demo/activity.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Activity - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Activity
128 |
129 |
130 |
131 |
132 |
133 | Project
134 |
135 |
136 | Client
137 |
138 |
139 | Type
140 |
141 |
142 | Date
143 |
144 |
145 | View
146 |
147 |
148 |
149 |
150 |
151 |
152 | Nike.com Redesign
153 |
154 |
155 | Monsters Inc
156 |
157 |
158 | New Task
159 |
160 |
161 | 4 days ago
162 |
163 |
164 | View
165 |
166 |
167 |
168 |
169 | Nike.com Redesign
170 |
171 |
172 | Monsters Inc
173 |
174 |
175 | New Message
176 |
177 |
178 | 5 days ago
179 |
180 |
181 | View
182 |
183 |
184 |
185 |
186 | Nike.com Redesign
187 |
188 |
189 | Monsters Inc
190 |
191 |
192 | New Project
193 |
194 |
195 | 5 days ago
196 |
197 |
198 | View
199 |
200 |
201 |
202 |
203 | Twitter Server Consulting
204 |
205 |
206 | Bad Robot
207 |
208 |
209 | New Task
210 |
211 |
212 | 6 days ago
213 |
214 |
215 | View
216 |
217 |
218 |
219 |
220 | Childrens Book Illustration
221 |
222 |
223 | Evil Genius
224 |
225 |
226 | New Message
227 |
228 |
229 | 9 days ago
230 |
231 |
232 | View
233 |
234 |
235 |
236 |
237 | Twitter Server Consulting
238 |
239 |
240 | Bad Robot
241 |
242 |
243 | New Task
244 |
245 |
246 | 16 days ago
247 |
248 |
249 | View
250 |
251 |
252 |
253 |
254 | Twitter Server Consulting
255 |
256 |
257 | Bad Robot
258 |
259 |
260 | New Project
261 |
262 |
263 | 16 days ago
264 |
265 |
266 | View
267 |
268 |
269 |
270 |
271 | Twitter Server Proposal
272 |
273 |
274 | Bad Robot
275 |
276 |
277 | Completed Project
278 |
279 |
280 | 20 days ago
281 |
282 |
283 | View
284 |
285 |
286 |
287 |
288 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
--------------------------------------------------------------------------------
/demo/messages.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Messages - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Messages
128 |
129 |
130 |
131 |
132 |
133 |
134 | Ut fermentum tortor at enim blandit gravida et et odio. Quisque eu libero vitae nibh malesuada sagittis. Integer eget turpis velit. Maecenas auctor eleifend ante in dictum. Proin mattis dictum imperdiet. Nam sed leo ut massa volutpat pharetra eget vel nisi. Vestibulum vel nunc felis, in ultrices neque. Duis ut rutrum lectus. Vivamus ultricies aliquam est ac gravida. Nulla facilisis sem sed est sagittis sed auctor turpis mollis. Duis ultricies viverra dapibus. Nunc lectus quam, rutrum aliquet cursus vitae, gravida vel arcu.
135 |
136 | Written 2 weeks ago by Jill
137 |
138 |
139 |
140 | Donec id consequat odio. Etiam felis tellus, pretium tincidunt malesuada quis, vestibulum a leo. Cras tortor enim, elementum nec pretium non, vestibulum sit amet massa. Vivamus non velit quis purus luctus pretium et ut quam. Aenean eu urna nulla, quis iaculis nunc. Nam consectetur erat nec turpis dapibus ac sodales dolor pulvinar. Fusce eu consectetur risus. In ut erat sit amet nunc tempor mattis sit amet id diam.
141 |
142 | Written 1 week ago by John
143 |
144 |
145 |
146 | Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Phasellus enim nibh, congue nec tincidunt sed, luctus ullamcorper leo. Nunc ac mauris augue. Nam non nulla tellus, vitae volutpat nibh. Maecenas fringilla vestibulum neque vitae tristique. Ut fermentum accumsan dolor, ut tincidunt lacus dictum non. Proin non ultrices libero. Praesent hendrerit, dolor ut facilisis porta, lorem massa ullamcorper dolor, at dictum elit augue vel lorem. Pellentesque vitae elit quis erat congue gravida ac sed urna. Vivamus vitae purus lectus. Maecenas nec dui lorem. Mauris viverra, est et mattis malesuada, sapien lectus congue justo, eget ultricies lorem ante a nulla. In facilisis nisi in dolor ultricies id hendrerit tortor suscipit.
147 |
148 | Written 4 days ago by Jill
149 |
150 |
151 |
152 | Nascetur ridiculus mus. Phasellus enim nibh, congue nec tincidunt sed, luctus ullamcorper leo. Nunc ac mauris augue. Nam non nulla tellus, vitae volutpat nibh. Maecenas fringilla vestibulum neque vitae tristique. Ut fermentum accumsan dolor, ut tincidunt lacus dictum non. Proin non ultrices libero. Praesent hendrerit, dolor ut facilisis porta, lorem massa ullamcorper dolor, at dictum elit augue vel lorem. Pellentesque vitae elit quis erat congue gravida ac sed urna. Vivamus vitae purus lectus. Maecenas nec dui lorem. Mauris viverra, est et mattis malesuada, sapien lectus congue justo, eget ultricies lorem ante a nulla.
153 |
154 | Written 2 days ago by Jill
155 |
163 |
164 |
165 |
166 | Sapien lectus congue justo, eget ultricies lorem ante a nulla.
167 |
168 | Written 1 day ago by Jill
169 |
170 |
171 |
172 |
173 |
Reply
174 |
175 |
176 | Reply
177 |
178 |
Message
179 |
180 |
181 |
182 |
183 |
184 | Create Cancel
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
--------------------------------------------------------------------------------
/demo/gallery.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Files - Akira
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Akira
19 |
20 |
59 |
60 |
61 |
62 |
70 |
71 |
72 |
73 |
74 |
75 |
125 |
126 |
127 | Gallery
128 |
129 |
161 |
Gallery with Captions
162 |
163 |
164 |
165 |
166 |
167 |
Thumbnail label
168 |
Thumbnail caption right here...
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
Thumbnail label
177 |
Thumbnail caption right here...
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
Thumbnail label
186 |
Thumbnail caption right here...
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
Thumbnail label
195 |
Thumbnail caption right here...
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
Thumbnail label
204 |
Thumbnail caption right here...
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
Thumbnail label
213 |
Thumbnail caption right here...
214 |
215 |
216 |
217 |
218 |
Gallery with Feature Graphic
219 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
--------------------------------------------------------------------------------
/demo/js/prettify.js:
--------------------------------------------------------------------------------
1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
13 |
14 |
15 |
16 |
69 |
70 |
71 |
72 |
实例代码
73 |
74 | <form class="form-horizontal" id="inputForm">
75 | <div class="control-group">
76 | <label class="control-label"
77 | for="username">用户名</label>
78 | <div class="controls">
79 | <input type="text" name="username" id="username"
80 | class="{required:true,username:true}">
81 | </div>
82 | </div>
83 | <div class="control-group">
84 | <label class="control-label"
85 | for="email">电子邮件</label>
86 | <div class="controls">
87 | <input type="text" id="email" name="email"
88 | class="{required:true,email:true}">
89 | </div>
90 | </div>
91 | <div class="control-group">
92 | <label class="control-label"
93 | for="terms-and-conditions">服务协议</label>
94 | <div class="controls">
95 | <label class="checkbox">
96 | <input type="checkbox"
97 | id="terms-and-conditions"
98 | name="terms-and-conditions"
99 | class="{required:true}">
100 | 我已阅读并同意
101 | <a href="#">《用户注册协议》</a>
102 | </label>
103 | <p class="help-block"></p>
104 | </div>
105 | </div>
106 | <div class="control-group">
107 | <label class="control-label">我常来往的城市</label>
108 | <div class="controls">
109 | <label class="checkbox">
110 | <input type="checkbox"
111 | name="mycities[]"
112 | value="beijing"/>
113 | 北京
114 | </label>
115 | <label class="checkbox">
116 | <input type="checkbox"
117 | name="mycities[]"
118 | value="kunming"/>
119 | 昆明
120 | </label>
121 | <label class="checkbox">
122 | <input type="checkbox"
123 | name="mycities[]"
124 | value="zhaotong"/>
125 | 昭通
126 | </label>
127 | </div>
128 | </div>
129 | <div class="form-actions">
130 | <button type="submit"
131 | class="btn btn-primary">提交验证
132 | <i class="icon-ok icon-white"></i></button><br />
133 | (该操作将不会提交到真实服务器,你懂的)
134 | </div>
135 | </form>
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 |
180 |
181 | 提交验证
182 | (该操作将不会提交到真实服务器,你懂的)
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
202 |
203 |
204 |
205 |
206 |
准备环境
207 |
208 |
211 |
212 |
213 |
214 | <script src="js/jquery.min.js"></script>
215 | <!--引入验证的js代码--->
216 | <script src="../jquery-validation/jquery.validate.js"></script>
217 | <script src="../jquery-validation/jquery.validate.methods.js"></script>
218 | <script src="../jquery-validation/jquery.metadata.js"></script>
219 | <script src="../jquery-validation/jquery.validate.zh-CN.js"></script>
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
怎么使用
229 |
230 |
233 |
234 |
235 |
236 | <script>
237 | $(function() {
238 | //inputForm为需要验证表单ID
239 | $("#inputForm").validate();
240 | });
241 | </script>
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
提示信息
250 |
251 |
255 |
256 |
257 |
258 | 1 required:true 必须输入的字段。
259 | 2 remote:"ajaxMessage.view" 使用 ajax 方法调用 ajaxMessage.view 验证返回信息。
260 | 3 email:true 必须输入正确格式的电子邮件。
261 | 4 url:true 必须输入正确格式的网址。
262 | 5 date:true 必须输入正确格式的日期。日期校验 ie6 出错,慎用。
263 | 6 dateISO:true 必须输入正确格式的日期(ISO),例如:2009-06-23,1998/01/22。只验证格式,不验证有效性。
264 | 7 number:true 必须输入合法的数字(负数,小数)。
265 | 8 digits:true 必须输入整数。
266 | 9 creditcard:true 必须输入合法的信用卡号。
267 | 10 equalTo:"#field" 输入值必须和 #field 相同。
268 | 11 accept:true 输入拥有合法后缀名的字符串(上传文件的后缀)。
269 | 12 maxlength:5 输入长度最多是 5 的字符串(汉字算一个字符)。
270 | 13 minlength:10 输入长度最小是 10 的字符串(汉字算一个字符)。
271 | 14 rangelength:[5,10] 输入长度必须介于 5 和 10 之间的字符串(汉字算一个字符)。
272 | 15 range:[5,10] 输入值必须介于 5 和 10 之间。
273 | 16 max:5 输入值不能大于 5。
274 | 17 min:10 输入值不能小于 10。
275 |
276 |
277 |
278 |
279 | 1 对于复杂的验证,可以通过jQuery.validator.addMethod添加自定义的验证规则
280 | 2 官网提供的additional-methods.js里包含一些常用的验证方式,比如lettersonly,ziprange,nowhitespace等
281 | 3 邮政编码验证,在熟练使用后,你也不用编写这些验证,只需要把jquery.validate.methods.js做相应的修改即可
282 |
283 | 例如
284 | jQuery.validator.addMethod("zipCode", function(value, element) {
285 | var zip = /^[0-9]{6}$/;
286 | return this.optional(element) || (zip.test(value));
287 | }, "邮政编码格式错误,请重新输入!");
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
提示信息
299 |
300 |
304 |
305 |
306 |
307 | messages: {
308 | required: "This field is required.",
309 | remote: "Please fix this field.",
310 | email: "Please enter a valid email address.",
311 | url: "Please enter a valid URL.",
312 | date: "Please enter a valid date.",
313 | dateISO: "Please enter a valid date (ISO).",
314 | dateDE: "Bitte geben Sie ein gültiges Datum ein.",
315 | number: "Please enter a valid number.",
316 | numberDE: "Bitte geben Sie eine Nummer ein.",
317 | digits: "Please enter only digits",
318 | creditcard: "Please enter a valid credit card number.",
319 | equalTo: "Please enter the same value again.",
320 | accept: "Please enter a value with a valid extension.",
321 | maxlength: $.validator.format("Please enter no more than {0} characters."),
322 | minlength: $.validator.format("Please enter at least {0} characters."),
323 | rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
324 | range: $.validator.format("Please enter a value between {0} and {1}."),
325 | max: $.validator.format("Please enter a value less than or equal to {0}."),
326 | min: $.validator.format("Please enter a value greater than or equal to {0}.")
327 | },
328 |
329 |
330 |
331 |
332 | 说明:
333 | 1 推荐做法,将此文件放入jquery.validate.zh-CN.js中,在页面中引入:
334 | 2 这个文件你将在下载包中找到
335 | <script src="../jquery-validation/jquery.validate.zh-CN.js"></script>
336 |
337 | jQuery.extend(jQuery.validator.messages, {
338 | required: "必选字段",
339 | remote: "请修正该字段",
340 | email: "请输入正确格式的电子邮件",
341 | url: "请输入合法的网址",
342 | date: "请输入合法的日期",
343 | dateISO: "请输入合法的日期 (ISO).",
344 | number: "请输入合法的数字",
345 | digits: "只能输入整数",
346 | creditcard: "请输入合法的信用卡号",
347 | equalTo: "请再次输入相同的值",
348 | accept: "请输入拥有合法后缀名的字符串",
349 | maxlength: jQuery.validator.format("请输入一个 长度最多是 {0} 的字符串"),
350 | minlength: jQuery.validator.format("请输入一个 长度最少是 {0} 的字符串"),
351 | rangelength: jQuery.validator.format("请输入 一个长度介于 {0} 和 {1} 之间的字符串"),
352 | range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),
353 | max: jQuery.validator.format("请输入一个最大为{0} 的值"),
354 | min: jQuery.validator.format("请输入一个最小为{0} 的值")
355 | });
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
391 |
392 |
393 |
394 |
Email address
395 |
396 |
400 |
401 |
402 |
403 |
404 |
Email address
405 |
409 |
410 | Test Validation
411 |
412 |
413 |
414 | <form class="form-horizontal">
415 | <div class="control-group">
416 | <label class="control-label">Email address</label>
417 | <div class="controls">
418 | <input type="email" />
419 | <p class="help-block"></p>
420 | </div>
421 | </div>
422 | </form>
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
451 |
452 |