Fix including moment.js

This commit is contained in:
Aleksander Machniak 2019-01-07 12:26:04 +00:00
parent eb85d762c7
commit 59fc3c8168
2 changed files with 18 additions and 14 deletions

View file

@ -2447,21 +2447,15 @@ class calendar extends rcube_plugin
$title .= ' "' . $search . '"';
}
// Add CSS stylesheets to the page header
$skin_path = $this->local_skin_path();
$this->include_stylesheet($skin_path . '/fullcalendar.css');
$this->include_stylesheet($skin_path . '/print.css');
// Add JS files to the page header
$this->include_script('print.js');
$this->include_script('lib/js/moment.js');
$this->include_script('lib/js/fullcalendar.js');
// Add CSS and JS to the page
$this->ui->addCSS();
$this->ui->addJS();
$this->register_handler('plugin.calendar_css', array($this->ui, 'calendar_css'));
$this->register_handler('plugin.calendar_list', array($this->ui, 'calendar_list'));
$this->rc->output->set_pagetitle($title);
$this->rc->output->send("calendar.print");
$this->rc->output->send('calendar.print');
}
/**

View file

@ -110,6 +110,10 @@ class calendar_ui
{
$skin_path = $this->cal->local_skin_path();
$this->cal->include_stylesheet($skin_path . '/fullcalendar.css');
if ($this->rc->task == 'calendar' && $this->rc->action == 'print') {
$this->cal->include_stylesheet($skin_path . '/print.css');
}
}
/**
@ -117,12 +121,18 @@ class calendar_ui
*/
public function addJS()
{
$this->cal->include_script('calendar_ui.js');
$this->cal->include_script('lib/js/moment.js');
$this->cal->include_script('lib/js/fullcalendar.js');
$this->rc->output->include_script('treelist.js');
$this->cal->api->include_script('libkolab/libkolab.js');
jqueryui::miniColors();
if ($this->rc->task == 'calendar' && $this->rc->action == 'print') {
$this->cal->include_script('print.js');
}
else {
$this->rc->output->include_script('treelist.js');
$this->cal->api->include_script('libkolab/libkolab.js');
$this->cal->include_script('calendar_ui.js');
jqueryui::miniColors();
}
}
/**