mirror of
https://github.com/flextype/flextype.git
synced 2025-08-15 01:24:25 +02:00
refactor(admin-plugin): total admin plugin refactor #414
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
/* purgecss start ignore */
|
||||
.flatpickr-day.endRange,
|
||||
.flatpickr-day.endRange.inRange,
|
||||
.flatpickr-day.endRange.nextMonthDay,
|
||||
.flatpickr-day.endRange.prevMonthDay,
|
||||
.flatpickr-day.endRange:focus,
|
||||
.flatpickr-day.endRange:hover,
|
||||
.flatpickr-day.selected,
|
||||
.flatpickr-day.selected.inRange,
|
||||
.flatpickr-day.selected.nextMonthDay,
|
||||
.flatpickr-day.selected.prevMonthDay,
|
||||
.flatpickr-day.selected:focus,
|
||||
.flatpickr-day.selected:hover,
|
||||
.flatpickr-day.startRange,
|
||||
.flatpickr-day.startRange.inRange,
|
||||
.flatpickr-day.startRange.nextMonthDay,
|
||||
.flatpickr-day.startRange.prevMonthDay,
|
||||
.flatpickr-day.startRange:focus,
|
||||
.flatpickr-day.startRange:hover
|
||||
{
|
||||
@apply bg-dark border-dark;
|
||||
}
|
||||
/* purgecss end ignore */
|
@@ -11,22 +11,12 @@ const tailwindConfig = "tailwind.config.js";
|
||||
|
||||
return gulp
|
||||
.src([
|
||||
// Select2
|
||||
'node_modules/select2/dist/css/select2.min.css',
|
||||
|
||||
// Swal2
|
||||
'node_modules/sweetalert2/dist/sweetalert2.min.css',
|
||||
|
||||
// AnimateCSS
|
||||
'node_modules/animate.css/animate.min.css',
|
||||
|
||||
// Flatpickr
|
||||
'node_modules/flatpickr/dist/flatpickr.min.css',
|
||||
|
||||
// Trumbowyg
|
||||
'node_modules/trumbowyg/dist/ui/trumbowyg.min.css',
|
||||
'node_modules/trumbowyg/dist/plugins/table/ui/trumbowyg.table.css',
|
||||
|
||||
// CodeMirror
|
||||
'node_modules/codemirror/lib/codemirror.css',
|
||||
'node_modules/codemirror/theme/elegant.css'])
|
||||
@@ -62,7 +52,7 @@ gulp.task("admin-panel-css", function() {
|
||||
.pipe(postcss([atimport(), tailwindcss(tailwindConfig)]))
|
||||
.pipe(
|
||||
purgecss({
|
||||
content: ["../form/templates/**/*.html", "templates/**/*.html"],
|
||||
content: ["templates/**/*.html"],
|
||||
extractors: [
|
||||
{
|
||||
extractor: TailwindExtractor = (content) => {
|
||||
@@ -94,9 +84,6 @@ gulp.task("admin-panel-css", function() {
|
||||
return gulp.src([ // jQuery
|
||||
'node_modules/jquery/dist/jquery.min.js',
|
||||
|
||||
// Select2
|
||||
'node_modules/select2/dist/js/select2.min.js',
|
||||
|
||||
// Swal2
|
||||
'node_modules/sweetalert2/dist/sweetalert2.min.js',
|
||||
|
||||
@@ -115,14 +102,6 @@ gulp.task("admin-panel-css", function() {
|
||||
// Clipboard
|
||||
'node_modules/clipboard/dist/clipboard.min.js',
|
||||
|
||||
// Flatpickr
|
||||
'node_modules/flatpickr/dist/flatpickr.min.js',
|
||||
|
||||
// Trumbowyg
|
||||
'node_modules/trumbowyg/dist/trumbowyg.min.js',
|
||||
'node_modules/trumbowyg/dist/plugins/noembed/trumbowyg.noembed.min.js',
|
||||
'node_modules/trumbowyg/dist/plugins/table/trumbowyg.table.min.js',
|
||||
|
||||
// CodeMirror
|
||||
'node_modules/codemirror/lib/codemirror.js',
|
||||
'node_modules/codemirror/mode/htmlmixed/htmlmixed.js',
|
||||
@@ -138,48 +117,16 @@ gulp.task("admin-panel-css", function() {
|
||||
.pipe(gulp.dest('assets/dist/js/'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Task: gulp trumbowyg-fonts
|
||||
*/
|
||||
gulp.task('trumbowyg-fonts', function(){
|
||||
return gulp.src(['node_modules/trumbowyg/dist/ui/icons.svg'])
|
||||
.pipe(gulp.dest('assets/dist/fonts/trumbowyg'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Task: gulp trumbowyg-langs
|
||||
*/
|
||||
gulp.task('trumbowyg-langs', function(){
|
||||
return gulp.src(['node_modules/trumbowyg/dist/*langs/**/*'])
|
||||
.pipe(gulp.dest('assets/dist/lang/trumbowyg'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Task: gulp flatpickr-langs
|
||||
*/
|
||||
gulp.task('flatpickr-langs', function(){
|
||||
return gulp.src(['node_modules/flatpickr/dist/*l10n/**/*'])
|
||||
.pipe(gulp.dest('assets/dist/lang/flatpickr'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Task: gulp fontawesome-icons
|
||||
*/
|
||||
gulp.task('fontawesome-icons', function(){
|
||||
return gulp.src(['node_modules/@fortawesome/fontawesome-free/svgs/**/*'])
|
||||
.pipe(gulp.dest('assets/dist/fontawesome/svgs'));
|
||||
});
|
||||
|
||||
/**
|
||||
* Task: gulp default
|
||||
*/
|
||||
gulp.task('default', gulp.series(
|
||||
'fontawesome-icons', 'trumbowyg-fonts', 'trumbowyg-langs', 'flatpickr-langs', 'vendor-css', 'admin-panel-css', 'vendor-js'
|
||||
'vendor-css', 'admin-panel-css', 'vendor-js'
|
||||
));
|
||||
|
||||
/**
|
||||
* Task: gulp watch
|
||||
*/
|
||||
gulp.task('watch', function () {
|
||||
gulp.watch(["../form/templates/**/*.html", "templates/**/*.html", "assets/src/"], gulp.series('vendor-css', 'admin-panel-css'));
|
||||
gulp.watch(["templates/**/*.html", "assets/src/"], gulp.series('vendor-css', 'admin-panel-css'));
|
||||
});
|
||||
|
@@ -31,12 +31,10 @@
|
||||
"jquery": "^3.4.1",
|
||||
"parsleyjs": "^2.9.2",
|
||||
"postcss-import": "^12.0.1",
|
||||
"select2": "^4.0.13",
|
||||
"speakingurl": "^14.0.1",
|
||||
"sweetalert2": "^9.7.2",
|
||||
"tailwindcss": "^1.2.0",
|
||||
"tippy.js": "^5.2.1",
|
||||
"clipboard": "~2.0.4",
|
||||
"trumbowyg": "~2.21.0"
|
||||
"clipboard": "~2.0.4"
|
||||
}
|
||||
}
|
||||
|
@@ -301,12 +301,7 @@
|
||||
{% include "plugins/admin/templates/partials/modules/tippy.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/forms-save.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/slugify.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/tabs.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/select2.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/swal2.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/trumbowyg.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/datetimepicker.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/filepicker.html" %}
|
||||
{% include "plugins/admin/templates/partials/modules/clipboard.html" %}
|
||||
|
||||
{% do
|
||||
|
@@ -1,15 +0,0 @@
|
||||
{% if registry.flextype.locale == 'en_US' %}
|
||||
{% set flatpickr_locale = 'en' %}
|
||||
{% else %}
|
||||
{% set flatpickr_locale = registry.flextype.locale|lower|slice(0, 2) %}
|
||||
{% endif %}
|
||||
{% if flatpickr_locale != 'en' %}
|
||||
<script type="text/javascript" src="{{ url() }}/site/plugins/admin/assets/dist/lang/flatpickr/l10n/{{ flatpickr_locale }}.js "></script>
|
||||
{% endif %}
|
||||
<script>
|
||||
flatpickr(".js-datetimepicker", {
|
||||
enableTime: true,
|
||||
dateFormat: "{{ registry.flextype.date_format }}",
|
||||
locale: "{{ flatpickr_locale }}"
|
||||
});
|
||||
</script>
|
@@ -1,11 +0,0 @@
|
||||
<script>
|
||||
$('.js-select').select2();
|
||||
$('.js-tags').select2({tags: true, multiple: true, tokenSeparators: [',', ' ']});
|
||||
|
||||
$('.js-tags').on('change', function (e) {
|
||||
$('.js-tags').each(function() {
|
||||
var name = $(this).attr('data-name');
|
||||
$('input[name='+name+']').val($(this).val().toString());
|
||||
});
|
||||
});
|
||||
</script>
|
@@ -1,6 +0,0 @@
|
||||
<script>
|
||||
$(".tabs__nav").on("click", ".tabs__nav__link:not(.tabs__nav__link--active)", function () {
|
||||
$(this).addClass("tabs__nav__link--active").siblings().removeClass("tabs__nav__link--active");
|
||||
$("div.tabs__content").removeClass("tabs__content--active").eq($(this).index()).addClass("tabs__content--active");
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user