File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11js/*.min.js
2+ test/vendor
Original file line number Diff line number Diff line change @@ -44,8 +44,6 @@ <h2>Result</h2>
4444 < br >
4545</ form >
4646< script src ="js/md5.js "> </ script >
47- <!-- jQuery is not required by JavaScript MD5, but included for the demo -->
48- < script src ="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js "> </ script >
4947< script src ="js/demo.js "> </ script >
5048</ body >
5149</ html >
Original file line number Diff line number Diff line change 99 * http://www.opensource.org/licenses/MIT
1010 */
1111
12- /*global window, $ */
12+ /*global document, md5 */
1313
14- $ ( function ( ) {
14+ ( function ( ) {
1515 'use strict' ;
1616
17- $ ( '#calculate' ) . on ( 'click' , function ( event ) {
18- event . preventDefault ( ) ;
19- $ ( '#result' ) . val ( window . md5 ( $ ( '#input' ) . val ( ) ) ) ;
20- } ) ;
21- $ ( '#input' ) . val ( '日本' ) ;
17+ var input = document . getElementById ( 'input' ) ;
18+ document . getElementById ( 'calculate' ) . addEventListener (
19+ 'click' ,
20+ function ( event ) {
21+ event . preventDefault ( ) ;
22+ document . getElementById ( 'result' ) . value = md5 ( input . value ) ;
23+ }
24+ ) ;
25+ input . value = '日本' ;
2226
23- } ) ;
27+ } ( ) ) ;
Original file line number Diff line number Diff line change 1919< meta charset ="utf-8 ">
2020< title > JavaScript MD5 Test</ title >
2121< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
22- < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/ mocha/2.3.4/mocha.min .css ">
22+ < link rel ="stylesheet " href ="vendor/ mocha.css ">
2323</ head >
2424< body >
2525< div id ="mocha "> </ div >
26- < script src ="https://cdnjs.cloudflare.com/ajax/libs/ mocha/2.3.4/mocha.min .js "> </ script >
27- < script src ="https://cdnjs.cloudflare.com/ajax/libs/ expect.js/0.2.0/expect.min .js "> </ script >
26+ < script src ="vendor/ mocha.js "> </ script >
27+ < script src ="vendor/ expect.js "> </ script >
2828< script >
2929mocha . setup ( 'bdd' ) ;
3030</ script >
You can’t perform that action at this time.
0 commit comments