Floating page content bugfix and prevent incompatable image uploads. Fixes #26.
This commit is contained in:
		
							parent
							
								
									b498b60cdd
								
							
						
					
					
						commit
						9969698783
					
				| 
						 | 
					@ -110,7 +110,11 @@ class ImageController extends Controller
 | 
				
			||||||
    public function upload(Request $request)
 | 
					    public function upload(Request $request)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $this->checkPermission('image-create');
 | 
					        $this->checkPermission('image-create');
 | 
				
			||||||
 | 
					        $this->validate($request, [
 | 
				
			||||||
 | 
					            'file' => 'image|mimes:jpeg,gif,png'
 | 
				
			||||||
 | 
					        ]);
 | 
				
			||||||
        $imageUpload = $request->file('file');
 | 
					        $imageUpload = $request->file('file');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $name = str_replace(' ', '-', $imageUpload->getClientOriginalName());
 | 
					        $name = str_replace(' ', '-', $imageUpload->getClientOriginalName());
 | 
				
			||||||
        $storageName = substr(sha1(time()), 0, 10) . '-' . $name;
 | 
					        $storageName = substr(sha1(time()), 0, 10) . '-' . $name;
 | 
				
			||||||
        $imagePath = '/uploads/images/' . Date('Y-m-M') . '/';
 | 
					        $imagePath = '/uploads/images/' . Date('Y-m-M') . '/';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -110,6 +110,12 @@
 | 
				
			||||||
                                dz.removeFile(file);
 | 
					                                dz.removeFile(file);
 | 
				
			||||||
                            });
 | 
					                            });
 | 
				
			||||||
                        });
 | 
					                        });
 | 
				
			||||||
 | 
					                        this.on('error', function(file, errorMessage, xhr) {
 | 
				
			||||||
 | 
					                            if(errorMessage.file) {
 | 
				
			||||||
 | 
					                                $(file.previewElement).find('[data-dz-errormessage]').text(errorMessage.file[0]);
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            console.log(errorMessage);
 | 
				
			||||||
 | 
					                        });
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,12 +19,16 @@
 | 
				
			||||||
  max-width: 840px;
 | 
					  max-width: 840px;
 | 
				
			||||||
  overflow-wrap: break-word;
 | 
					  overflow-wrap: break-word;
 | 
				
			||||||
  .align-left {
 | 
					  .align-left {
 | 
				
			||||||
    float: left !important;
 | 
					 | 
				
			||||||
    text-align: left;
 | 
					    text-align: left;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  img.align-left, table.align-left {
 | 
				
			||||||
 | 
					    float: left !important;
 | 
				
			||||||
    margin: $-xs $-s $-xs 0;
 | 
					    margin: $-xs $-s $-xs 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  .align-right {
 | 
					  .align-right {
 | 
				
			||||||
    float: right !important;
 | 
					    float: right !important;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  img.align-right, table.align-right {
 | 
				
			||||||
    text-align: right;
 | 
					    text-align: right;
 | 
				
			||||||
    margin: $-xs 0 $-xs $-s;
 | 
					    margin: $-xs 0 $-xs $-s;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue