mirror of
https://github.com/flextype/flextype.git
synced 2025-08-23 05:16:03 +02:00
refactor(admin-plugin): decouple js components from base.html #186
Decouple: - trumbowyg
This commit is contained in:
@@ -239,9 +239,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% set admin_build = base_url() ~ '/site/plugins/admin/assets/dist/js/admin-build.min.js' %}
|
||||
|
||||
{% do assets.add('js', admin_build, 'admin', 1) %}
|
||||
|
||||
{% for assets_admin in assets.get('js', 'admin') %}
|
||||
{% for assets_by_priorities in assets_admin %}
|
||||
<script type="text/javascript" src="{{ assets_by_priorities.asset }}"></script>
|
||||
@@ -252,39 +250,11 @@
|
||||
{% include "plugins/admin/views/partials/messenger.html" %}
|
||||
{% include "plugins/admin/views/partials/clipboard.html" %}
|
||||
{% include "plugins/admin/views/partials/custom-file-input.html" %}
|
||||
|
||||
{% include "plugins/admin/views/partials/trumbowyg.html" %}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$.trumbowyg.svgPath = '{{base_url()}}/site/plugins/admin/assets/dist/fonts/trumbowyg/icons.svg';
|
||||
$('.js-html-editor').trumbowyg({
|
||||
btnsDef: {
|
||||
// Customizables dropdowns
|
||||
image: {
|
||||
dropdown: ['insertImage', 'noembed'],
|
||||
ico: 'insertImage'
|
||||
}
|
||||
},
|
||||
btns: [
|
||||
['undo', 'redo'], // Only supported in Blink browsers
|
||||
['formatting'],
|
||||
['strong', 'em', 'del'],
|
||||
['link'],
|
||||
['image'],
|
||||
['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
|
||||
['unorderedList', 'orderedList'],
|
||||
['table'],
|
||||
['removeformat'],
|
||||
['fullscreen'],
|
||||
['viewHTML']
|
||||
],
|
||||
lang: '{{ locale }}',
|
||||
autogrow: false,
|
||||
removeformatPasted: true
|
||||
});
|
||||
|
||||
$('.js-save-form-submit').click(function() {
|
||||
$("#form" ).submit();
|
||||
});
|
||||
|
28
site/plugins/admin/views/partials/trumbowyg.html
Normal file
28
site/plugins/admin/views/partials/trumbowyg.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<script type="text/javascript">
|
||||
$.trumbowyg.svgPath = '{{base_url()}}/site/plugins/admin/assets/dist/fonts/trumbowyg/icons.svg';
|
||||
$('.js-html-editor').trumbowyg({
|
||||
btnsDef: {
|
||||
// Customizables dropdowns
|
||||
image: {
|
||||
dropdown: ['insertImage', 'noembed'],
|
||||
ico: 'insertImage'
|
||||
}
|
||||
},
|
||||
btns: [
|
||||
['undo', 'redo'], // Only supported in Blink browsers
|
||||
['formatting'],
|
||||
['strong', 'em', 'del'],
|
||||
['link'],
|
||||
['image'],
|
||||
['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
|
||||
['unorderedList', 'orderedList'],
|
||||
['table'],
|
||||
['removeformat'],
|
||||
['fullscreen'],
|
||||
['viewHTML']
|
||||
],
|
||||
lang: '{{ locale }}',
|
||||
autogrow: false,
|
||||
removeformatPasted: true
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user