1- function showPreview ( objFileInput , html_element ) {
1+ function showPreview ( objFileInput , html_element ) {
22 if ( objFileInput . files [ 0 ] ) {
33 var fileReader = new FileReader ( ) ;
44 fileReader . onload = function ( e ) {
5- $ ( html_element ) . html ( '<img src="' + e . target . result + '" width="100%" height="100%" class="upload-preview" />' ) ;
5+ $ ( html_element ) . html ( '<img src="' + e . target . result + '" width="100%" height="100%" class="upload-preview" />' ) ;
66 }
7- fileReader . readAsDataURL ( objFileInput . files [ 0 ] ) ;
7+ fileReader . readAsDataURL ( objFileInput . files [ 0 ] ) ;
88 }
99}
1010
1111
12- $ ( function ( e ) {
13- $ ( "#form_upload_image" ) . submit ( function ( r ) {
14- form_data = new FormData ( this )
12+ $ ( function ( e ) {
13+ $ ( "#image-viewver" ) . hide ( ) ;
14+ $ ( "#image-viewver" ) . click ( function ( ) {
15+ $ ( this ) . fadeOut ( 1000 )
16+ } ) ;
17+ $ ( document ) . on ( "click" , "img:not(.viewver)" , function ( ) {
18+ $ ( "#image-viewver .content" ) . html ( "<img src='" + $ ( this ) . attr ( "src" ) + "' class='viewver' />" ) ;
19+ $ ( "#image-viewver" ) . fadeIn ( 1000 )
20+ } ) ;
21+
22+ $ ( "#form_upload_image" ) . submit ( function ( r ) {
23+ form_data = new FormData ( this )
1524 $ . ajax ( {
16- url :$ ( this ) . attr ( "action" ) ,
17- data :form_data ,
25+ url : $ ( this ) . attr ( "action" ) ,
26+ data : form_data ,
1827 contentType : false ,
1928 cache : false ,
2029 processData : false ,
2130 dataType : "json" ,
22- method :"POST" ,
23- success :function ( result ) {
31+ method : "POST" ,
32+ success : function ( result ) {
2433 console . log ( result ) ;
25- $ ( "#result-box" ) . html ( "<img src='/static/imageprocess/images/result/" + result [ "saved_name" ] + "' width='100%' height='100%' />" ) ;
34+ $ ( "#result-box" ) . html ( "<img src='/static/imageprocess/images/result/" + result [ "saved_name" ] + "' width='100%' height='100%' />" ) ;
2635 } ,
27- error :function ( result ) {
36+ error : function ( result ) {
2837 console . log ( "error" ) ;
2938 }
3039 } ) ;
3140 return false ;
3241 } ) ;
3342
3443
35- $ ( "#form_equalize" ) . submit ( function ( ) {
36-
37- form_data = new FormData ( this )
44+ $ ( "#form_equalize" ) . submit ( function ( ) {
45+
46+ form_data = new FormData ( this )
3847 $ . ajax ( {
39- url :$ ( this ) . attr ( "action" ) ,
40- data :form_data ,
48+ url : $ ( this ) . attr ( "action" ) ,
49+ data : form_data ,
4150 contentType : false ,
4251 cache : false ,
4352 processData : false ,
4453 dataType : "json" ,
45- method :"POST" ,
46- success :function ( result ) {
54+ method : "POST" ,
55+ success : function ( result ) {
4756 console . log ( result ) ;
48- $ ( "#result-box" ) . html ( "<img src='/static/imageprocess/images/result/" + result [ "saved_name" ] + "' width='100%' height='100%' />" ) ;
49- $ ( "#hist-preview" ) . html ( "<img src='/static/imageprocess/images/hist/" + result [ "preview_hist" ] + "' width='100%' height='100%' />" ) ;
50- $ ( "#hist-result-box" ) . html ( "<img src='/static/imageprocess/images/histresult/" + result [ "new_hist" ] + "' width='100%' height='100%' />" ) ;
57+ $ ( "#result-box" ) . html ( "<img src='/static/imageprocess/images/result/" + result [ "saved_name" ] + "' width='100%' height='100%' />" ) ;
58+ $ ( "#hist-preview" ) . html ( "<img src='/static/imageprocess/images/hist/" + result [ "preview_hist" ] + "' width='100%' height='100%' />" ) ;
59+ $ ( "#hist-result-box" ) . html ( "<img src='/static/imageprocess/images/histresult/" + result [ "new_hist" ] + "' width='100%' height='100%' />" ) ;
60+ } ,
61+ error : function ( result ) {
62+ console . log ( "error" ) ;
63+ }
64+ } ) ;
65+ return false ;
66+ } ) ;
67+
68+
69+ $ ( "#form_make_operation" ) . submit ( function ( ) {
70+ form_data = new FormData ( this )
71+ $ . ajax ( {
72+ url : $ ( this ) . attr ( "action" ) ,
73+ data : form_data ,
74+ contentType : false ,
75+ cache : false ,
76+ processData : false ,
77+ dataType : "json" ,
78+ method : "POST" ,
79+ success : function ( result ) {
80+ $ ( "#result-box" ) . html ( "<img src='/static/imageprocess/images/result/" + result [ "saved_name" ] + "' width='100%' height='100%' />" ) ;
5181 } ,
52- error :function ( result ) {
82+ error : function ( result ) {
5383 console . log ( "error" ) ;
5484 }
5585 } ) ;
5686 return false ;
57- } )
58- } ) ;
87+ } ) ;
88+
89+
90+ } ) ;
91+
92+
0 commit comments