@@ -99,7 +99,7 @@ class="fa fa-list"></i> List</a>
9999 {!! Form:: label (' file_to_upload' , ' Choose File' , array (' class' => ' control-label' )); ! !}
100100 <div class =" controls" >
101101 <div class =" input-group" style =" width : 100% " >
102- <input type =" file" name =" file_to_upload" >
102+ <input type =" file" id = " file_to_upload " name =" file_to_upload" >
103103 </div >
104104 </div >
105105 </div >
@@ -115,6 +115,24 @@ class="fa fa-list"></i> List</a>
115115 </div >
116116</div >
117117
118+ <div class =" modal fade" id =" fileViewModal" tabindex =" -1" role =" dialog" aria-labelledby =" fileLabel" aria-hidden =" true" >
119+ <div class =" modal-dialog" >
120+ <div class =" modal-content" >
121+ <div class =" modal-header" >
122+ <button type =" button" class =" close" data-dismiss =" modal" aria-label =" Close" ><span
123+ aria-hidden =" true" >× ; </span ></button >
124+ <h4 class =" modal-title" id =" fileLabel" >View Fiile</h4 >
125+ </div >
126+ <div class =" modal-body" id =" fileview_body" >
127+
128+ </div >
129+ <div class =" modal-footer" >
130+ <button type =" button" class =" btn btn-default" data-dismiss =" modal" >Close</button >
131+ </div >
132+ </div >
133+ </div >
134+ </div >
135+
118136<script src =" //code.jquery.com/jquery-1.11.2.min.js" ></script >
119137<script src =" //code.jquery.com/jquery-migrate-1.2.1.min.js" ></script >
120138<script src =" //maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js" ></script >
@@ -154,6 +172,7 @@ function showResponse(responseText, statusText, xhr, $form) {
154172 if (responseText != " OK" ){
155173 notify (responseText);
156174 }
175+ $ (" #file_to_upload" ).val (' ' );
157176 loadImages ();
158177 }
159178
@@ -243,6 +262,7 @@ function trash(x) {
243262 if (data != " OK" ) {
244263 notify (data);
245264 } else {
265+ loadFiles ();
246266 loadImages ();
247267 }
248268 });
@@ -251,7 +271,6 @@ function trash(x) {
251271 }
252272
253273
254-
255274 function loadFiles () {
256275 $ .ajax ({
257276 type: " GET" ,
@@ -267,8 +286,6 @@ function loadFiles() {
267286 });
268287 }
269288
270-
271-
272289 function cropImage (x ) {
273290 $ .ajax ({
274291 type: " GET" ,
@@ -374,11 +391,11 @@ function notify(x) {
374391 bootbox .alert (x);
375392 }
376393
377- function scaleImage (x ) {
394+ function resizeImage (x ) {
378395 $ .ajax ({
379396 type: " GET" ,
380397 dataType: " text" ,
381- url: " /laravel-filemanager/scale " ,
398+ url: " /laravel-filemanager/resize " ,
382399 data: " img="
383400 + x
384401 + " &dir=" + $ (" #working_dir" ).val (),
@@ -398,6 +415,13 @@ function scaleImage(x) {
398415 $ (" #show_list" ).val (1 );
399416 loadImages ();
400417 });
418+
419+ function fileView (x ){
420+ $ (' #fileview_body' ).html (
421+ " <img class='img img-responsive' src='{!! Config:: get (' lfm.images_url' ) ! !}" + $ (" #working_dir" ).val () + " /" + x + " '>"
422+ );
423+ $ (' #fileViewModal' ).modal ();
424+ }
401425 </script >
402426</body >
403427</html >
0 commit comments