Added SunEditor + First test

This commit is contained in:
Torsten Schneider 2021-02-25 07:56:54 +01:00
parent a6e8c73f57
commit 6e2055e96f
12 changed files with 21563 additions and 15 deletions

View file

@ -102,22 +102,17 @@ class UserController extends Controller
if ($breite>$hoehe) {
Image::make($request->bild)
->widen(1200)
->save(public_path().'/img/user/'.$user->id.'_gross.jpg')
->save(storage_path().'/img/user/'.$user->id.'_gross.jpg');
->save(storage_path().'/img_storage/user/'.$user->id.'_gross.jpg');
Image::make($request->bild)
->widen(64)
->save(public_path().'/img/user/'.$user->id.'.jpg')
->save(storage_path().'/img/user/'.$user->id.'.jpg');
->save(storage_path().'/img_storage/user/'.$user->id.'.jpg');
}else {
Image::make($request->bild)
->heighten(900)
->save(public_path().'/img/user/'.$user->id.'_gross.jpg')
->save(storage_path().'/img/user/'.$user->id.'_gross.jpg');
->save(storage_path().'/img_storage/user/'.$user->id.'_gross.jpg');
Image::make($request->bild)
->widen(96)
->save(public_path().'/img/user/'.$user->id.'.jpg')
->save(storage_path().'/img/user/'.$user->id.'.jpg');
->save(storage_path().'/img_storage/user/'.$user->id.'.jpg');
}
}

View file

@ -8596,6 +8596,11 @@
}
}
},
"suneditor": {
"version": "2.36.4",
"resolved": "https://registry.npmjs.org/suneditor/-/suneditor-2.36.4.tgz",
"integrity": "sha512-xOB96cQWzt8PQ8fSF6Q5NzxMPpOFTeaQBbHTx+ZuUt6s7hxh2LE8bh0yU+hLmeoXfBCTtV/A0zb+e7sLy2G0BA=="
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",

View file

@ -24,6 +24,7 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.14.0",
"lightbox2": "^2.11.3"
"lightbox2": "^2.11.3",
"suneditor": "^2.36.4"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

File diff suppressed because one or more lines are too long

View file

@ -5,3 +5,4 @@
*/
require('./bootstrap');
require('./suneditor')

27
motorradig/resources/js/suneditor.js vendored Normal file
View file

@ -0,0 +1,27 @@
import 'suneditor/dist/css/suneditor.min.css'
import suneditor from 'suneditor'
import plugins from 'suneditor/src/plugins'
suneditor.create('sample', {
plugins: plugins,
buttonList: [
['undo', 'redo'],
['font', 'fontSize', 'formatBlock'],
['paragraphStyle', 'blockquote'],
['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'],
['fontColor', 'hiliteColor', 'textStyle'],
['removeFormat'],
'/', // Line break
['outdent', 'indent'],
['align', 'horizontalRule', 'list', 'lineHeight'],
['table', 'link', 'image', 'video', 'audio' /** ,'math' */], // You must add the 'katex' library at options to use the 'math' plugin.
/** ['imageGallery'] */ // You must add the "imageGalleryUrl".
['fullScreen', 'showBlocks', 'codeView'],
['preview', 'print'],
['save', 'template']
]
})

View file

@ -18,10 +18,15 @@
</div>
@endif
<!--
<span>
<h4>{!! $content !!} </h4>
</span>
<h4>\{\!! $content !!}</h4>
</span>
-->
<textarea style="width:100%; height:100vh;" id="sample">
{!! $content !!}
</textarea>
</div>
</div>
</div>
@ -30,4 +35,6 @@
</div>
@endsection

View file

@ -27,8 +27,9 @@
@if(file_exists (storage_path().'/img_storage/user/'.$user->id.'.jpg'))
<!--File exists -->
<a href="/img_storage/user/{{$user->id}}_gross.jpg" data-lightbox="{{$user->id}}_gross.jpg" data-title="{{ $user->name }}">
<img src="/img_storage/user/{{$user->id}}.jpg" class="mt-3 ml-3" >
<!-- then ? and rand is added after image to fake a different image every time in order to fool the browser cache -->
<a href="/img_storage/user/{{$user->id}}_gross.jpg" data-lightbox="{{$user->id}}_gross.jpg?{{rand()}}" data-title="{{ $user->name }}">
<img src="/img_storage/user/{{$user->id}}.jpg?{{rand()}}" class="mt-3 ml-3" >
</a>
@else
<img src="/img/placeholder/user64x96.jpg" class="mt-3 ml-3" >

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Before After
Before After