Skip to content

Commit

Permalink
Merge pull request bagisto#7968 from amit-webkul/account
Browse files Browse the repository at this point in the history
Updating tinymce
  • Loading branch information
devansh-webkul authored Aug 17, 2023
2 parents ad12887 + a5c8f40 commit 0df224d
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 44 deletions.
1 change: 1 addition & 0 deletions packages/Webkul/Admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@vitejs/plugin-vue": "^4.2.3",
"flatpickr": "^4.6.13",
"mitt": "^3.0.1",
"tinymce": "^6.6.2",
"vee-validate": "^4.9.1",
"vue-flatpickr": "^2.3.0",
"vuedraggable": "^4.1.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/Webkul/Admin/src/Resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ import draggable from 'vuedraggable';
import Flatpickr from "flatpickr";
import 'flatpickr/dist/flatpickr.css';

import 'tinymce/tinymce';
import 'tinymce/skins/ui/oxide/skin.min.css';
import 'tinymce/skins/content/default/content.min.css';
import 'tinymce/skins/content/default/content.css';
import 'tinymce/icons/default/icons';
import 'tinymce/themes/silver/theme';
import 'tinymce/models/dom/model';

/**
* Registration of all global validators.
*/
Expand Down
4 changes: 4 additions & 0 deletions packages/Webkul/Admin/src/Resources/assets/js/tinymce.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
initTinyMCE() {
tinyMCEHelper.initTinyMCE({
target: this.$refs[this.id].$el,
height: 200,
height: 300,
width: "100%",
plugins: 'image imagetools media wordcount save fullscreen code table lists link hr',
plugins: 'image media wordcount save fullscreen code table lists link',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify | link hr |numlist bullist outdent indent | removeformat | code | table',
image_advtab: true,
valid_elements : '*[*]',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script>
{{-- <script src="{{ bagisto_asset('js/tinymce.min.js') }}"></script> --}}

<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.6.2/tinymce.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script>
let tinyMCEHelper = {
Expand All @@ -7,6 +9,7 @@
let config = {
relative_urls : false,
menubar: false,
remove_script_host : false,
document_base_url : '{{ asset('/') }}',
uploadRoute: '{{ route('admin.tinymce.upload') }}',
Expand Down Expand Up @@ -38,8 +41,8 @@
let reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
let id = 'blobid' + (new Date()).getTime();
let blobCache = tinymce.activeEditor.editorUpload.blobCache;
let id = 'blobid' + new Date().getTime();
let blobCache = tinymce.get().editorUpload.blobCache;
let base64 = reader.result.split(',')[1];
let blobInfo = blobCache.create(id, file, base64);
blobCache.add(blobInfo);
Expand All @@ -59,7 +62,7 @@
xhr.open('POST', config.uploadRoute);
xhr.upload.onprogress = function (e) {
progress(e.loaded / e.total * 100);
progress((e.loaded / e.total) * 100);
};
xhr.onload = function() {
Expand Down Expand Up @@ -94,6 +97,6 @@
formData.append('file', blobInfo.blob(), blobInfo.filename());
xhr.send(formData);
}
},
};
</script>
1 change: 1 addition & 0 deletions packages/Webkul/Admin/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default defineConfig(({ mode }) => {
input: [
"src/Resources/assets/css/app.css",
"src/Resources/assets/js/app.js",
"src/Resources/assets/js/tinymce.js",
],
refresh: true,
}),
Expand Down
1 change: 1 addition & 0 deletions public/themes/admin/default/build/assets/app-72d38502.css

Large diffs are not rendered by default.

34 changes: 0 additions & 34 deletions public/themes/admin/default/build/assets/app-7538412e.js

This file was deleted.

34 changes: 34 additions & 0 deletions public/themes/admin/default/build/assets/app-8ff54681.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/themes/admin/default/build/assets/app-eac4354c.css

This file was deleted.

86 changes: 86 additions & 0 deletions public/themes/admin/default/build/assets/tinymce-18f574f5.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions public/themes/admin/default/build/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"src/Resources/assets/css/app.css": {
"file": "assets/app-eac4354c.css",
"file": "assets/app-72d38502.css",
"isEntry": true,
"src": "src/Resources/assets/css/app.css"
},
Expand Down Expand Up @@ -176,8 +176,20 @@
"css": [
"assets/app-c04ede37.css"
],
"file": "assets/app-7538412e.js",
"file": "assets/app-8ff54681.js",
"isEntry": true,
"src": "src/Resources/assets/js/app.js"
},
"src/Resources/assets/js/tinymce.css": {
"file": "assets/tinymce-f6d54ec3.css",
"src": "src/Resources/assets/js/tinymce.css"
},
"src/Resources/assets/js/tinymce.js": {
"css": [
"assets/tinymce-f6d54ec3.css"
],
"file": "assets/tinymce-18f574f5.js",
"isEntry": true,
"src": "src/Resources/assets/js/tinymce.js"
}
}

0 comments on commit 0df224d

Please sign in to comment.