This repository was archived by the owner on May 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-18
lines changed Expand file tree Collapse file tree 1 file changed +17
-18
lines changed Original file line number Diff line number Diff line change 1- $ ( document ) . ready ( function ( ) {
1+ $ ( document ) . ready ( function ( ) {
22 $ ( '.file:even' ) . addClass ( 'even' ) ;
3- $ ( ".field h1, .icon" ) . click ( function ( ) {
3+ $ ( ".field h1, .icon" ) . click ( function ( ) {
44 $ ( this ) . parent ( ) . find ( ".innercont" ) . toggleClass ( "hide" ) ;
55 $ ( this ) . parent ( ) . find ( ".icon" ) . toggleClass ( "icon-up" ) ;
66 } ) ;
7- $ ( "#uploadclick" ) . click ( function ( e ) {
7+ $ ( "#uploadclick" ) . click ( function ( e ) {
88 var input , file ;
99
10- if ( ! window . FileReader ) {
11- alert ( "The file API isn't supported on this browser yet." ) ;
12- return ;
13- }
14-
15- input = document . getElementById ( 'fileinput' ) ;
16- file = input . files [ 0 ] ;
17- if ( file . size > 1024 * 1024 * 10 ) {
18- alert ( "Die Datei ist größer als 10MB!" ) ;
19- e . preventDefault ( ) ;
20- }
21- else {
22- //
23- }
24- } ) ;
10+ if ( ! window . FileReader ) {
11+ alert ( "The file API isn't supported on this browser yet." ) ;
12+ return ;
13+ }
14+ var filesize = parseInt ( $ ( "#maxsize" ) . text ( ) . slice ( 0 , - 3 ) ) ;
15+ input = document . getElementById ( 'fileinput' ) ;
16+ file = input . files [ 0 ] ;
17+ if ( file . size > 1024 * 1024 * $ ( '#maxsize' ) . text ( ) . slice ( 0 , - 3 ) ) {
18+ alert ( "Die Datei ist größer als " + filesize + " MB!" ) ;
19+ e . preventDefault ( ) ;
20+ } else {
21+ //nuttin
22+ }
23+ } ) ;
2524} ) ;
You can’t perform that action at this time.
0 commit comments