Skip to content
Snippets Groups Projects
Select Git revision
  • 260e35da8093d24b77fc1abdd8c47815dfee6a4c
  • main default protected
  • step-01354-5.5
  • biest-504
  • issue-3215
  • step-03209-bald-rapunzel
  • tic-3123
  • tic-2720-remove-less-compilation-in-plugins
  • step-1800
  • tic-2532
  • biest-561
  • tic-3225
  • 5.3
  • 5.4
  • step-2472
  • step-2660
  • step-1559
  • tic-3094
  • biest-3206
  • biest-3207
  • 5.0
  • v5.3.1
  • v5.2.3
  • v5.1.4
  • v5.0.6
  • v5.3
  • v5.2.2
  • v5.1.3
  • v5.0.5
  • v5.2.1
  • v5.1.2
  • v5.0.4
  • v5.2
  • v5.1.1
  • v5.0.3
  • v5.1
  • v5.0.2
  • v5.0.1
  • v5.0
39 results

fullcalendar.js

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    fullcalendar.js 1.64 KiB
    STUDIP.ready(function () {
        //Check if fullcalendar instances are to be displayed:
        $('*[data-fullcalendar="1"]').each(function () {
            STUDIP.loadChunk('fullcalendar').then(() => {
                if (this.calendar === undefined) {
                    let calendar;
                    if ($(this).hasClass('semester-plan')) {
                        calendar = STUDIP.Fullcalendar.createSemesterCalendarFromNode(this);
                    } else {
                        calendar = STUDIP.Fullcalendar.createFromNode(this);
                    }
    
                    continuousRefresh(calendar, 10);
                }
            });
        });
    
        function continuousRefresh(calendar, ttl) {
            setTimeout(() => {
                calendar.updateSize();
                if (ttl > 0) {
                    continuousRefresh(calendar, ttl - 1);
                }
            }, 200);
        }
    
        if ($('#event-color-picker > option').length <= 1) {
            var selectedColor = $('#selected-color').val();
            var colors = ['yellow', 'orange', 'red', 'violet', 'dark-violet', 'green', 'dark-green', 'petrol', 'brown'];
    
            var style = window.getComputedStyle(document.body);
            colors.forEach(color => {
                let real_color = style.getPropertyValue(`--${color}`).trim();
                $('#event-color-picker').append([
                    $('<input type="radio" name="event_color">').attr({
                        id: color,
                        value: real_color,
                        checked: selectedColor === real_color
                    }),
                    $('<label>').attr('for', color).css({
                        backgroundColor: `var(--${color})`
                    }),
                ]);
            });
        }
    
    });