This commit is contained in:
Thomas 2025-01-24 11:17:12 +01:00
parent 81ab180112
commit cb32d69821
7 changed files with 40 additions and 50 deletions

View File

@ -10,7 +10,7 @@ window.bs5Utils = new Bs5Utils()
//require('./js/tether.min');
//require('./js/dropzone');
//require('./js/summernote/mediabundle.plugin');
//import 'multiselect-two-sides'
//require('bootstrap-toggle/js/bootstrap-toggle.min');
import ace from 'brace'
@ -20,9 +20,10 @@ import 'brace/mode/xml'
import 'brace/theme/monokai'
import 'brace/ext/searchbox'
import * as bootstrap from 'bootstrap'
import 'summernote'
import 'summernote/dist/summernote-lite.js'
//window.Dropzone = './js/dropzone';
import './js/summernote/mediabundle.plugin.js'
import { init } from './js/init.js';
import { ajaxModal } from './js/tools/ajaxModal.js'
@ -42,7 +43,6 @@ window.psc.init();
import 'bootstrap/dist/css/bootstrap.min.css';
import './less/base.scss';
import 'summernote/dist/summernote-lite.min.css';
//import 'multiselect/css/multi-select.css';
$(function() {
@ -89,12 +89,12 @@ $(function() {
// go to the latest tab, if it exists:
var lastTab = localStorage.getItem('lastTab');
if (lastTab) {
if (lastTab && $('[href="' + lastTab + '"]').length > 0) {
bootstrap.Tab.getInstance('[href="' + lastTab + '"]').show();
}
var lastTabDoc = localStorage.getItem('lastTabDoc');
if (lastTabDoc) {
if (lastTabDoc && $('[href="' + lastTabDoc + '"]').length > 0) {
bootstrap.Tab.getInstance('[href="' + lastTabDoc + '"]').show();
}
@ -134,7 +134,7 @@ $(function() {
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']],
['table', ['table']],
['insert', ['link', 'hr']],
['insert', ['link', 'hr', 'image']],
['view', ['fullscreen', 'codeview']],
['help', ['help']],
['media', ['media']]

View File

@ -1,37 +1,26 @@
(function (factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals: jQuery
factory(window.jQuery);
}
}(function ($){
$.extend($.summernote.plugins, {
'media': function(context) {
var self = this;
import $ from 'jquery'
$.extend($.summernote.plugins, {
'media': function(context) {
var self = this;
// ui has renders to build ui elements.
// - you can create a button with `ui.button`
var ui = $.summernote.ui;
// ui has renders to build ui elements.
// - you can create a button with `ui.button`
var ui = $.summernote.ui;
// add hello button
context.memo('button.media', function() {
// create button
var button = ui.button({
contents: '<i class="fa fa-images"/> Media',
tooltip: 'Media',
click: function() {
mediaBundleBrowser(context.$note.attr('id'));
},
});
// create jQuery object from button instance.
var $media = button.render();
return $media;
// add hello button
context.memo('button.media', function() {
// create button
var button = ui.button({
contents: '<i class="fa fa-images"/> Media',
click: function() {
mediaBundleBrowser(context.$note.attr('id'));
},
});
}
});
}));
// create jQuery object from button instance.
var $media = button.render();
return $media;
});
}
});

View File

@ -65,10 +65,10 @@ export class mediaChooser {
replaceUrl = $this.closest('.thumbnail-wrapper').data('replace-url');
// Store values
itemUrl = path;
itemId = id;
itemTitle = title;
itemThumbPath = thumbPath;
var itemUrl = path;
var itemId = id;
var itemTitle = title;
var itemThumbPath = thumbPath;
// Save
if (!cke) {

View File

@ -97,7 +97,7 @@ return [
'version' => '2.2.2',
'type' => 'css',
],
'summernote' => [
'summernote/dist/summernote-lite.js' => [
'version' => '0.9.1',
],
];

View File

@ -180,7 +180,8 @@
{% endblock %}
{% block scripts %}
<script>
<script type="module">
import $ from 'jquery'
$(document).ready(function() {
{% if htmlId %}
$(".sommernote_insertImage").click(function() {

View File

@ -932,10 +932,10 @@
{% block javascripts %}
{{ parent() }}
<script>
<script type="module">
var wto;
import $ from 'jquery'
$(function() {
$('#product_url').on('keyup', (function() {
clearTimeout(wto);

View File

@ -1105,8 +1105,8 @@ a[href^="#formlayouter"] {display:none;}
{% block javascripts %}
{{ parent() }}
<script>
<script type="module">
import $ from 'jquery'
var wto;
function loadLangData() {