Add bootstrap theme
This commit is contained in:
parent
0acfcb4619
commit
587e29ec6a
4 changed files with 614 additions and 127 deletions
579
package-lock.json
generated
579
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -25,15 +25,20 @@
|
|||
"rollup-plugin-terser": "^7.0.0",
|
||||
"svelte": "^3.0.0",
|
||||
"svelte-fullcalendar": "^1.1.1",
|
||||
"svelte-reactive-preprocessor": "^0.8.0"
|
||||
"svelte-reactive-preprocessor": "^0.8.0",
|
||||
"sveltestrap": "^5.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fullcalendar/adaptive": "^5.10.1",
|
||||
"@fullcalendar/bootstrap5": "^5.10.2",
|
||||
"@fullcalendar/list": "^5.10.1",
|
||||
"@fullcalendar/rrule": "^5.10.1",
|
||||
"@nextcloud/cdav-library": "^1.0.0",
|
||||
"bootstrap": "^5.1.3",
|
||||
"bootstrap-icons": "^1.8.1",
|
||||
"ical.js": "^1.5.0",
|
||||
"lodash": "^4.17.21",
|
||||
"rollup-plugin-copy": "^3.4.0",
|
||||
"rrule": "^2.6.8",
|
||||
"sirv-cli": "^1.0.0",
|
||||
"svelte-simple-modal": "^1.3.1"
|
||||
|
|
136
rollup.config.js
136
rollup.config.js
|
@ -1,13 +1,14 @@
|
|||
import svelte from 'rollup-plugin-svelte';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import livereload from 'rollup-plugin-livereload';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import css from 'rollup-plugin-css-only';
|
||||
import postcss from 'rollup-plugin-postcss';
|
||||
import dev from 'rollup-plugin-dev';
|
||||
import svelte from 'rollup-plugin-svelte'
|
||||
import commonjs from '@rollup/plugin-commonjs'
|
||||
import resolve from '@rollup/plugin-node-resolve'
|
||||
import livereload from 'rollup-plugin-livereload'
|
||||
import { terser } from 'rollup-plugin-terser'
|
||||
import css from 'rollup-plugin-css-only'
|
||||
import postcss from 'rollup-plugin-postcss'
|
||||
import dev from 'rollup-plugin-dev'
|
||||
import copy from 'rollup-plugin-copy'
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
const production = !process.env.ROLLUP_WATCH
|
||||
|
||||
/*
|
||||
function serve() {
|
||||
|
@ -32,58 +33,79 @@ function serve() {
|
|||
}*/
|
||||
|
||||
export default {
|
||||
input: 'src/main.js',
|
||||
output: {
|
||||
sourcemap: true,
|
||||
format: 'iife',
|
||||
name: 'app',
|
||||
file: 'public/build/bundle.js'
|
||||
},
|
||||
plugins: [
|
||||
svelte({
|
||||
compilerOptions: {
|
||||
// enable run-time checks when not in production
|
||||
dev: !production
|
||||
},
|
||||
}),
|
||||
// we'll extract any component CSS out into
|
||||
// a separate file - better for performance
|
||||
css({ output: 'bundle.css' }),
|
||||
input: 'src/main.js',
|
||||
output: {
|
||||
sourcemap: true,
|
||||
format: 'iife',
|
||||
name: 'app',
|
||||
file: 'public/build/bundle.js'
|
||||
},
|
||||
plugins: [
|
||||
svelte({
|
||||
compilerOptions: {
|
||||
// enable run-time checks when not in production
|
||||
dev: !production
|
||||
}
|
||||
}),
|
||||
|
||||
// Copy font files
|
||||
copy({
|
||||
targets: [
|
||||
{
|
||||
src: [
|
||||
'node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff',
|
||||
'node_modules/bootstrap-icons/font/fonts/bootstrap-icons.woff2'
|
||||
],
|
||||
dest: 'public/build/fonts'
|
||||
}
|
||||
]
|
||||
}),
|
||||
|
||||
// we'll extract any component CSS out into
|
||||
// a separate file - better for performance
|
||||
css({ output: 'bundle.css' }),
|
||||
|
||||
// for FullCalendar
|
||||
postcss(),
|
||||
|
||||
// If you have external dependencies installed from
|
||||
// npm, you'll most likely need these plugins. In
|
||||
// some cases you'll need additional configuration -
|
||||
// consult the documentation for details:
|
||||
// https://github.com/rollup/plugins/tree/master/packages/commonjs
|
||||
resolve({
|
||||
browser: true,
|
||||
dedupe: ['svelte', 'svelte/transition', 'svelte/internal']
|
||||
}),
|
||||
commonjs(),
|
||||
// If you have external dependencies installed from
|
||||
// npm, you'll most likely need these plugins. In
|
||||
// some cases you'll need additional configuration -
|
||||
// consult the documentation for details:
|
||||
// https://github.com/rollup/plugins/tree/master/packages/commonjs
|
||||
resolve({
|
||||
browser: true,
|
||||
dedupe: ['svelte', 'svelte/transition', 'svelte/internal']
|
||||
}),
|
||||
commonjs(),
|
||||
|
||||
// In dev mode, call `npm run start` once
|
||||
// the bundle has been generated
|
||||
!production && dev({
|
||||
dirs: ['public'],
|
||||
proxy: [
|
||||
{ from: '/cal/klub-reseau', to: 'https://nuage.beta.rz.ens.wtf/remote.php/dav/public-calendars/' },
|
||||
{ from: '/cal/eleves-ens', to: 'https://cloud.eleves.ens.fr/remote.php/dav/public-calendars/' }
|
||||
],
|
||||
port: 5000
|
||||
}),
|
||||
// In dev mode, call `npm run start` once
|
||||
// the bundle has been generated
|
||||
!production &&
|
||||
dev({
|
||||
dirs: ['public'],
|
||||
proxy: [
|
||||
{
|
||||
from: '/cal/klub-reseau',
|
||||
to: 'https://nuage.beta.rz.ens.wtf/remote.php/dav/public-calendars/'
|
||||
},
|
||||
{
|
||||
from: '/cal/eleves-ens',
|
||||
to: 'https://cloud.eleves.ens.fr/remote.php/dav/public-calendars/'
|
||||
}
|
||||
],
|
||||
port: 5000
|
||||
}),
|
||||
|
||||
// Watch the `public` directory and refresh the
|
||||
// browser on changes when not in production
|
||||
!production && livereload('public'),
|
||||
// Watch the `public` directory and refresh the
|
||||
// browser on changes when not in production
|
||||
!production && livereload('public'),
|
||||
|
||||
// If we're building for production (npm run build
|
||||
// instead of npm run dev), minify
|
||||
production && terser()
|
||||
],
|
||||
watch: {
|
||||
clearScreen: false
|
||||
}
|
||||
};
|
||||
// If we're building for production (npm run build
|
||||
// instead of npm run dev), minify
|
||||
production && terser()
|
||||
],
|
||||
watch: {
|
||||
clearScreen: false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,26 +14,38 @@
|
|||
import { refreshEvents, calendarTree } from './calendar';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
import 'bootstrap/dist/css/bootstrap.css';
|
||||
import 'bootstrap-icons/font/bootstrap-icons.css';
|
||||
import bootstrap5Plugin from '@fullcalendar/bootstrap5';
|
||||
|
||||
const modal = writable(null);
|
||||
let calendar;
|
||||
|
||||
let options = writable({
|
||||
initialView: 'timeGridWeek',
|
||||
plugins: [timeGridPlugin, dayGridPlugin, rrulePlugin, listPlugin, adaptivePlugin],
|
||||
plugins: [
|
||||
timeGridPlugin,
|
||||
dayGridPlugin,
|
||||
rrulePlugin,
|
||||
listPlugin,
|
||||
adaptivePlugin,
|
||||
bootstrap5Plugin
|
||||
],
|
||||
locale: frLocale,
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,listWeek'
|
||||
},
|
||||
height: "100%",
|
||||
height: '100%',
|
||||
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
|
||||
nowIndicator: true,
|
||||
now: new Date(),
|
||||
eventClick: info => {
|
||||
modal.set(bind(EventDetails, { event: info.event }));
|
||||
},
|
||||
events: []
|
||||
events: [],
|
||||
themeSystem: 'bootstrap5'
|
||||
});
|
||||
|
||||
let selectedCalendars;
|
||||
|
@ -53,7 +65,6 @@
|
|||
});
|
||||
}, 300);
|
||||
|
||||
|
||||
onMount(async () => {
|
||||
const events = await reloadEvents(selectedCalendars);
|
||||
options.update(opts => ({
|
||||
|
|
Loading…
Reference in a new issue