From 419af9880a147eeb8b6d4389bb1f23585ddb75eb Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 21 Sep 2015 12:42:58 +0200 Subject: [PATCH 1/6] initial version of getTimeline() --- SeedDMS_Core/Core/inc.ClassDMS.php | 34 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index 7d95381e0..8ce394518 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -2157,7 +2157,7 @@ class SeedDMS_Core_DMS { * documents or used space per user, recent activity, etc. * * @param string $type type of statistic - * @param array statistical data + * @return array statistical data */ function getStatisticalData($type='') { /* {{{ */ switch($type) { @@ -2225,6 +2225,38 @@ class SeedDMS_Core_DMS { } } /* }}} */ + /** + * Returns changes with a period of time + * + * This method returns a list of all changes happened in the database + * within a given period of time. It currently just checks for + * entries in the database tables tblDocumentContent, tblDocumentFiles, + * and tblDocumentStatusLog + * + * @param string $start start date + * @param string $end end date + * @return array list of changes + */ + function getTimeline($startts='', $endts='') { /* {{{ */ + if(!$startts) + $startts = mktime(0, 0, 0); + if(!$endts) + $startts = mktime(24, 0, 0); + $timeline = array(); + + $queryStr = "SELECT document FROM tblDocumentContent WHERE date > ".$startts." AND date < ".$endts; + $resArr = $this->db->getResultArray($queryStr); + if (!$resArr) + return false; + $resArr = $this->db->getResultArray($queryStr); + foreach($resArr as $rec) { + $document = $this->getDocument($rec['document']); + $timeline = array_merge($timeline, $document->getTimeline); + } + return $timeline; + + } /* }}} */ + /** * Set a callback function * From 0d89f5b1c6caa26c628b43c3f5fa85dadd341757 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 21 Sep 2015 12:43:16 +0200 Subject: [PATCH 2/6] set font size of timeline boxes --- styles/bootstrap/application.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/bootstrap/application.css b/styles/bootstrap/application.css index 994286b4e..98118361b 100644 --- a/styles/bootstrap/application.css +++ b/styles/bootstrap/application.css @@ -124,10 +124,10 @@ div.help h3 { #timeline { font-size: 12px; - line-height: 18px; + line-height: 14px; } div.timeline-event-content { - margin: 2px; + margin: 3px 5px; } div.timeline-frame { border-radius: 4px; From c385d86a60673c2f8bdae7bd99c4805feae0b164 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 21 Sep 2015 16:46:17 +0200 Subject: [PATCH 3/6] add timeline over all documents --- SeedDMS_Core/Core/inc.ClassDMS.php | 2 +- SeedDMS_Core/Core/inc.ClassDocument.php | 6 +- out/out.Timeline.php | 51 ++++ styles/bootstrap/timeline/timeline-locales.js | 284 ++++++++++++++++++ styles/bootstrap/timeline/timeline-min.js | 218 ++++++++++++++ styles/bootstrap/timeline/timeline-theme.css | 157 ++++++++++ styles/bootstrap/timeline/timeline.css | 211 +++++++++++++ views/bootstrap/class.Timeline.php | 114 +++++++ 8 files changed, 1039 insertions(+), 4 deletions(-) create mode 100644 out/out.Timeline.php create mode 100644 styles/bootstrap/timeline/timeline-locales.js create mode 100644 styles/bootstrap/timeline/timeline-min.js create mode 100755 styles/bootstrap/timeline/timeline-theme.css create mode 100644 styles/bootstrap/timeline/timeline.css create mode 100644 views/bootstrap/class.Timeline.php diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index 8ce394518..a7d5d5b33 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -2251,7 +2251,7 @@ class SeedDMS_Core_DMS { $resArr = $this->db->getResultArray($queryStr); foreach($resArr as $rec) { $document = $this->getDocument($rec['document']); - $timeline = array_merge($timeline, $document->getTimeline); + $timeline = array_merge($timeline, $document->getTimeline()); } return $timeline; diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 6993f5753..5d09bd59c 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -2104,7 +2104,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ foreach ($resArr as $row) { $date = date('Y-m-d H:i:s', $row['date']); - $timeline[] = array('date'=>$date, 'msg'=>'Added version '.$row['version'], 'type'=>'add_version', 'params'=>array($row['version'])); + $timeline[] = array('date'=>$date, 'msg'=>'Added version '.$row['version'], 'type'=>'add_version', 'version'=>$row['version'], 'document'=>$this, 'params'=>array($row['version'])); } $queryStr = "SELECT * FROM tblDocumentFiles WHERE document = " . $this->_id; @@ -2114,7 +2114,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ foreach ($resArr as $row) { $date = date('Y-m-d H:i:s', $row['date']); - $timeline[] = array('date'=>$date, 'msg'=>'Added attachment "'.$row['name'].'"', 'type'=>'add_file'); + $timeline[] = array('date'=>$date, 'msg'=>'Added attachment "'.$row['name'].'"', 'document'=>$this, 'type'=>'add_file'); } $queryStr= @@ -2131,7 +2131,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ foreach ($resArr as $row) { $date = $row['date']; - $timeline[] = array('date'=>$date, 'msg'=>'Version '.$row['version'].': Status change to '.$row['status'], 'type'=>'status_change', 'params'=>array($row['version'], $row['status'])); + $timeline[] = array('date'=>$date, 'msg'=>'Version '.$row['version'].': Status change to '.$row['status'], 'type'=>'status_change', 'version'=>$row['version'], 'document'=>$this, 'status'=>$row['status'], 'params'=>array($row['version'], $row['status'])); } return $timeline; } /* }}} */ diff --git a/out/out.Timeline.php b/out/out.Timeline.php new file mode 100644 index 000000000..24a776c66 --- /dev/null +++ b/out/out.Timeline.php @@ -0,0 +1,51 @@ +isAdmin()) { + UI::exitError(getMLText("admin_tools"),getMLText("access_denied")); +} +$rootfolder = $dms->getFolder($settings->_rootFolderID); + +if(!empty($_GET['fromdate'])) { + $from = makeTsFromLongDate($_GET['fromdate'].' 00:00:00'); +} else { + $from = time()-7*86400; +} +if(!empty($_GET['todate'])) { + $to = makeTsFromLongDate($_GET['todate'].' 23:59:59'); +} else { + $to = time(); +} + +$data = $dms->getTimeline($from, $to); + +$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME'])); +$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'rootfolder'=>$rootfolder, 'from'=>$from, 'to'=>$to, 'data'=>$data)); +if($view) { + $view->show(); + exit; +} + +?> diff --git a/styles/bootstrap/timeline/timeline-locales.js b/styles/bootstrap/timeline/timeline-locales.js new file mode 100644 index 000000000..e6c591e61 --- /dev/null +++ b/styles/bootstrap/timeline/timeline-locales.js @@ -0,0 +1,284 @@ +if (typeof links === 'undefined') { + links = {}; + links.locales = {}; +} else if (typeof links.locales === 'undefined') { + links.locales = {}; +} + +// English =================================================== +links.locales['en'] = { + 'MONTHS': ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + 'MONTHS_SHORT': ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], + 'DAYS': ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], + 'DAYS_SHORT': ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], + 'ZOOM_IN': "Zoom in", + 'ZOOM_OUT': "Zoom out", + 'MOVE_LEFT': "Move left", + 'MOVE_RIGHT': "Move right", + 'NEW': "New", + 'CREATE_NEW_EVENT': "Create new event" +}; + +links.locales['en_US'] = links.locales['en']; +links.locales['en_UK'] = links.locales['en']; + +// French =================================================== +links.locales['fr'] = { + 'MONTHS': ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], + 'MONTHS_SHORT': ["Jan", "Fev", "Mar", "Avr", "Mai", "Jun", "Jul", "Aou", "Sep", "Oct", "Nov", "Dec"], + 'DAYS': ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], + 'DAYS_SHORT': ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"], + 'ZOOM_IN': "Zoomer", + 'ZOOM_OUT': "Dézoomer", + 'MOVE_LEFT': "Déplacer à gauche", + 'MOVE_RIGHT': "Déplacer à droite", + 'NEW': "Nouveau", + 'CREATE_NEW_EVENT': "Créer un nouvel évènement" +}; + +links.locales['fr_FR'] = links.locales['fr']; +links.locales['fr_BE'] = links.locales['fr']; +links.locales['fr_CA'] = links.locales['fr']; + +// Catalan =================================================== +links.locales['ca'] = { + 'MONTHS': ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Setembre", "Octubre", "Novembre", "Desembre"], + 'MONTHS_SHORT': ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], + 'DAYS': ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"], + 'DAYS_SHORT': ["Dm.", "Dl.", "Dm.", "Dc.", "Dj.", "Dv.", "Ds."], + 'ZOOM_IN': "Augmentar zoom", + 'ZOOM_OUT': "Disminuir zoom", + 'MOVE_LEFT': "Moure esquerra", + 'MOVE_RIGHT': "Moure dreta", + 'NEW': "Nou", + 'CREATE_NEW_EVENT': "Crear nou event" +}; +links.locales['ca_ES'] = links.locales['ca']; + +// German =================================================== +links.locales['de'] = { + 'MONTHS': ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], + 'MONTHS_SHORT': ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], + 'DAYS': ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"], + 'DAYS_SHORT': ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam"], + 'ZOOM_IN': "Vergrößern", + 'ZOOM_OUT': "Verkleinern", + 'MOVE_LEFT': "Nach links verschieben", + 'MOVE_RIGHT': "Nach rechts verschieben", + 'NEW': "Neu", + 'CREATE_NEW_EVENT': "Neues Ereignis erzeugen" +}; + +links.locales['de_DE'] = links.locales['de']; +links.locales['de_CH'] = links.locales['de']; + +// Danish =================================================== +links.locales['da'] = { + 'MONTHS': ["januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"], + 'MONTHS_SHORT': ["jan", "feb", "mar", "apr", "maj", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], + 'DAYS': ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"], + 'DAYS_SHORT': ["søn", "man", "tir", "ons", "tor", "fre", "lør"], + 'ZOOM_IN': "Zoom in", + 'ZOOM_OUT': "Zoom out", + 'MOVE_LEFT': "Move left", + 'MOVE_RIGHT': "Move right", + 'NEW': "New", + 'CREATE_NEW_EVENT': "Create new event" +}; +links.locales['da_DK'] = links.locales['da']; + +// Russian =================================================== +links.locales['ru'] = { + 'MONTHS': ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"], + 'MONTHS_SHORT': ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"], + 'DAYS': ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"], + 'DAYS_SHORT': ["Вос", "Пон", "Втo", "Срe", "Чет", "Пят", "Суб"], + 'ZOOM_IN': "Увeличить", + 'ZOOM_OUT': "Умeньшить", + 'MOVE_LEFT': "Сдвинуть налeво", + 'MOVE_RIGHT': "Сдвинуть направо", + 'NEW': "Новый", + 'CREATE_NEW_EVENT': "Создать новоe событиe" +}; +links.locales['ru_RU'] = links.locales['ru']; + +// Spanish =================================================== +links.locales['es'] = { + 'MONTHS': ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], + 'MONTHS_SHORT': ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], + 'DAYS': ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"], + 'DAYS_SHORT': ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"], + 'ZOOM_IN': "Aumentar zoom", + 'ZOOM_OUT': "Disminuir zoom", + 'MOVE_LEFT': "Mover izquierda", + 'MOVE_RIGHT': "Mover derecha", + 'NEW': "Nuevo", + 'CREATE_NEW_EVENT': "Crear nuevo evento" +}; + +links.locales['es_ES'] = links.locales['es']; + +// Dutch ===================================================== +links.locales['nl'] = { + 'MONTHS': ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"], + 'MONTHS_SHORT': ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"], + 'DAYS': ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"], + 'DAYS_SHORT': ["zo", "ma", "di", "wo", "do", "vr", "za"], + 'ZOOM_IN': "Inzoomen", + 'ZOOM_OUT': "Uitzoomen", + 'MOVE_LEFT': "Naar links", + 'MOVE_RIGHT': "Naar rechts", + 'NEW': "Nieuw", + 'CREATE_NEW_EVENT': "Nieuwe gebeurtenis maken" +}; + +links.locales['nl_NL'] = links.locales['nl']; +links.locales['nl_BE'] = links.locales['nl']; + +// Turkish =================================================== +links.locales['tr'] = { + 'MONTHS': ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], + 'MONTHS_SHORT': ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"], + 'DAYS': ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"], + 'DAYS_SHORT': ["Paz", "Pzt", "Sal", "Çar", "Per", "Cum", "Cmt"], + 'ZOOM_IN': "Büyült", + 'ZOOM_OUT': "Küçült", + 'MOVE_LEFT': "Sola Taşı", + 'MOVE_RIGHT': "Sağa Taşı", + 'NEW': "Yeni", + 'CREATE_NEW_EVENT': "Yeni etkinlik oluştur" +}; + +links.locales['tr_TR'] = links.locales['tr']; + +// Hungarian =================================================== +links.locales['hu'] = { + 'MONTHS': ["január", "február", "március", "április", "május", "június", "július", "augusztus", "szeptember", "október", "november", "december"], + 'MONTHS_SHORT': ["jan", "feb", "márc", "ápr", "máj", "jún", "júl", "aug", "szep", "okt", "nov", "dec"], + 'DAYS': ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"], + 'DAYS_SHORT': ["vas", "hét", "kedd", "sze", "csü", "pé", "szo"], + 'ZOOM_IN': "Nagyítás", + 'ZOOM_OUT': "Kicsinyítés", + 'MOVE_LEFT': "Balra", + 'MOVE_RIGHT': "Jobbra", + 'NEW': "Új", + 'CREATE_NEW_EVENT': "Új esemény készítése" +}; + +links.locales['hu_HU'] = links.locales['hu']; + +// Brazilian Portuguese =================================================== +links.locales['pt'] = { + 'MONTHS': ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], + 'MONTHS_SHORT': ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], + 'DAYS': ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], + 'DAYS_SHORT': ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"], + 'ZOOM_IN': "Aproximar", + 'ZOOM_OUT': "Afastar", + 'MOVE_LEFT': "Mover para esquerda", + 'MOVE_RIGHT': "Mover para direita", + 'NEW': "Novo", + 'CREATE_NEW_EVENT': "Criar novo evento" +}; + +links.locales['pt_BR'] = links.locales['pt']; + +// Portuguese =================================================== +links.locales['pt'] = { + 'MONTHS': ["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro", "Outubro", "Novembro", "Dezembro"], + 'MONTHS_SHORT': ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], + 'DAYS': ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"], + 'DAYS_SHORT': ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"], + 'ZOOM_IN': "Mais Zoom", + 'ZOOM_OUT': "Menos Zoom", + 'MOVE_LEFT': "Esquerda", + 'MOVE_RIGHT': "Direita", + 'NEW': "Novo", + 'CREATE_NEW_EVENT': "Criar novo evento" +}; + +links.locales['pt_PT'] = links.locales['pt']; + + +// Chinese =================================================== +links.locales['zh'] = { + 'MONTHS': ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], + 'MONTHS_SHORT': ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], + 'DAYS': ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], + 'DAYS_SHORT': ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], + 'ZOOM_IN': "放大", + 'ZOOM_OUT': "缩小", + 'MOVE_LEFT': "左移", + 'MOVE_RIGHT': "右移", + 'NEW': "新建", + 'CREATE_NEW_EVENT': "创建新的事件" +}; + +links.locales['zh_CN'] = links.locales['zh']; +links.locales['zh_TR'] = links.locales['zh']; + + +// Arabic =================================================== +links.locales['ar'] = { + 'MONTHS': ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], + 'MONTHS_SHORT': ["يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"], + 'DAYS': ["الأحد", "الأثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"], + 'DAYS_SHORT': ["الأحد", "الأثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"], + 'ZOOM_IN': "تكبير", + 'ZOOM_OUT': "تصغير", + 'MOVE_LEFT': "تحريك لليسار", + 'MOVE_RIGHT': "تحريك لليمين", + 'NEW': "جديد", + 'CREATE_NEW_EVENT': "إنشاء حدث جديد" +}; + +links.locales['ar_AR'] = links.locales['ar']; + + +// Japanese =================================================== +links.locales['ja'] = { + 'MONTHS': ["一月", "二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"], + 'MONTHS_SHORT': ["一月", "二月", "三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"], + 'DAYS': ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"], + 'DAYS_SHORT': ["日", "月", "火", "水", "木", "金", "土"], + 'ZOOM_IN': "拡大する", + 'ZOOM_OUT': "縮小する", + 'MOVE_LEFT': "左に移動", + 'MOVE_RIGHT': "右に移動", + 'NEW': "新しい", + 'CREATE_NEW_EVENT': "新しいイベントの作成" +}; + +links.locales['ja_JA'] = links.locales['ja']; + +// Korean =================================================== +links.locales['ko'] = { + 'MONTHS': ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], + 'MONTHS_SHORT': ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], + 'DAYS': ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"], + 'DAYS_SHORT': ["일", "월", "화", "수", "목", "금", "토"], + 'ZOOM_IN': "줌 인", + 'ZOOM_OUT': "줌 아웃", + 'MOVE_LEFT': "왼쪽으로 이동", + 'MOVE_RIGHT': "오른쪽으로 이동", + 'NEW': "신규", + 'CREATE_NEW_EVENT': "새 이벤트 생성" +}; + +links.locales['ko_KO'] = links.locales['ko']; + +// Polish =================================================== +links.locales['pl'] = { + 'MONTHS': ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], + 'MONTHS_SHORT': ["Sty", "Lut", "Mar", "Kwi", "Maj", "Cze", "Lip", "Sie", "Wrz", "Paź", "Lis", "Gru"], + 'DAYS': ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"], + 'DAYS_SHORT': ["niedz", "pon", "wt", "śr", "czw", "pt", "sob"], + 'ZOOM_IN': "Powiększ", + 'ZOOM_OUT': "Zmniejsz", + 'MOVE_LEFT': "Przesuń w lewo", + 'MOVE_RIGHT': "Przesuń w prawo", + 'NEW': "Nowy", + 'CREATE_NEW_EVENT': "Utwórz nowe wydarzenie" +}; + +links.locales['ko'] = links.locales['ko_KO']; diff --git a/styles/bootstrap/timeline/timeline-min.js b/styles/bootstrap/timeline/timeline-min.js new file mode 100644 index 000000000..904601fe5 --- /dev/null +++ b/styles/bootstrap/timeline/timeline-min.js @@ -0,0 +1,218 @@ +/* + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy + of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations under + the License. + + Copyright (c) 2011-2015 Almende B.V. + + @author Jos de Jong, + @date 2015-03-04 + @version 2.9.1 +*/ +typeof links==="undefined"&&(links={});typeof google==="undefined"&&(google=void 0);if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a){for(var b=0;b3)b.group=3;if(c>4)b.className=4;if(c>5)b.editable=5;if(c>6)b.type=6}return b}; +links.Timeline.prototype.setData=function(a){this.unselectItem();a||(a=[]);this.stackCancelAnimation();this.clearItems();this.data=a;var b=this.items;this.deleteGroups();if(google&&google.visualization&&a instanceof google.visualization.DataTable)for(var c=links.Timeline.mapColumnIds(a),d=0,e=a.getNumberOfRows();d0&&c.addRows(e);e=links.Timeline.mapColumnIds(c);for(d in b)if(b.hasOwnProperty(d)){var f=e[d];if(f==void 0){var f=b[d],g="string";typeof f=="number"?g="number":typeof f=="boolean"?g="boolean":f instanceof Date&&(g="datetime");f=c.addColumn(g,d)}c.setValue(a,f,b[d])}}else if(links.Timeline.isArray(c))for(d in e=c[a],e==void 0&& +(e={},c[a]=e),b)b.hasOwnProperty(d)&&(e[d]=b[d]);else throw"Cannot update data, unknown type of data";};links.Timeline.prototype.getItemIndex=function(a){for(var b=this.dom.items.frame,c=this.items,d=void 0;a.parentNode&&a.parentNode!==b;)a=a.parentNode;if(a.parentNode===b)for(var b=0,e=c.length;bd.valueOf()&&(b=new Date(d.valueOf()));this.applyRange(a,b);c==void 0||c==!0?this.render({animate:!1}):this.recalcConversion()};links.Timeline.prototype.setVisibleChartRangeAuto=function(){var a=this.getDataRange(!0);this.setVisibleChartRange(a.min,a.max)};links.Timeline.prototype.setVisibleChartRangeNow=function(){var a=this.end.valueOf()-this.start.valueOf(),b=new Date((new Date).valueOf()-a/2);this.setVisibleChartRange(b,new Date(b.valueOf()+a))}; +links.Timeline.prototype.getVisibleChartRange=function(){return{start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())}}; +links.Timeline.prototype.getDataRange=function(a){var b=this.items,c=void 0,d=void 0;if(b)for(var e=0,f=b.length;e0&&this.render({animate:a?a.animate:void 0,renderTimesLeft:b-1}))}; +links.Timeline.prototype.repaint=function(){var a=this.repaintFrame(),b=this.repaintAxis(),c=this.repaintGroups(),d=this.repaintItems();this.repaintCurrentTime();this.repaintCustomTime();return a||b||c||d};links.Timeline.prototype.reflowFrame=function(){var a=this.dom,b=this.size,c=a.frame?a.frame.offsetWidth:0,d=a.frame?a.frame.clientHeight:0,a=(a=b.frameWidth!==c)||b.frameHeight!==d;b.frameWidth=c;b.frameHeight=d;return a}; +links.Timeline.prototype.repaintFrame=function(){var a=!1,b=this.dom,c=this.options,d=this.size;if(!b.frame)b.frame=document.createElement("DIV"),b.frame.className="timeline-frame ui-widget ui-widget-content ui-corner-all",b.container.appendChild(b.frame),a=!0;var e=c.autoHeight?d.actualHeight+"px":c.height||"100%",c=c.width||"100%",a=(a=a||b.frame.style.height!=e)||b.frame.style.width!=c;b.frame.style.height=e;b.frame.style.width=c;if(!b.content){b.content=document.createElement("DIV");b.content.className= +"timeline-content";b.frame.appendChild(b.content);a=document.createElement("DIV");a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.height="100%";a.style.width="0px";b.content.appendChild(a);b.contentTimelines=a;var a=this.eventParams,f=this;if(!a.onMouseDown)a.onMouseDown=function(a){f.onMouseDown(a)},links.Timeline.addEventListener(b.content,"mousedown",a.onMouseDown);if(!a.onTouchStart)a.onTouchStart=function(a){f.onTouchStart(a)},links.Timeline.addEventListener(b.content, +"touchstart",a.onTouchStart);if(!a.onMouseWheel)a.onMouseWheel=function(a){f.onMouseWheel(a)},links.Timeline.addEventListener(b.content,"mousewheel",a.onMouseWheel);if(!a.onDblClick)a.onDblClick=function(a){f.onDblClick(a)},links.Timeline.addEventListener(b.content,"dblclick",a.onDblClick);a=!0}b.content.style.left=d.contentLeft+"px";b.content.style.top="0px";b.content.style.width=d.contentWidth+"px";b.content.style.height=d.frameHeight+"px";this.repaintNavigation();return a}; +links.Timeline.prototype.reflowAxis=function(){var a,b=this.options,c=this.size,d=this.dom.axis,e=d&&d.characterMinor?d.characterMinor.clientWidth:0,f=d&&d.characterMinor?d.characterMinor.clientHeight:0,g=d&&d.characterMajor?d.characterMajor.clientWidth:0,h=d&&d.characterMajor?d.characterMajor.clientHeight:0,i=(b.showMinorLabels?f:0)+(b.showMajorLabels?h:0),k=b.axisOnTop?0:c.frameHeight-i,m=b.axisOnTop?i:k;a=(a=(a=c.axis.top!==k)||c.axis.line!==m)||c.axis.height!==i;c.axis.top=k;c.axis.line=m;c.axis.height= +i;c.axis.labelMajorTop=b.axisOnTop?0:m+(b.showMinorLabels?f:0);c.axis.labelMinorTop=b.axisOnTop?b.showMajorLabels?h:0:m;c.axis.lineMinorTop=b.axisOnTop?c.axis.labelMinorTop:0;c.axis.lineMinorHeight=b.showMajorLabels?c.frameHeight-h:c.frameHeight;c.axis.lineMinorWidth=d&&d.minorLines&&d.minorLines.length?d.minorLines[0].offsetWidth:1;c.axis.lineMajorWidth=d&&d.majorLines&&d.majorLines.length?d.majorLines[0].offsetWidth:1;a=(a=(a=(a=a||c.axis.characterMinorWidth!==e)||c.axis.characterMinorHeight!== +f)||c.axis.characterMajorWidth!==g)||c.axis.characterMajorHeight!==h;c.axis.characterMinorWidth=e;c.axis.characterMinorHeight=f;c.axis.characterMajorWidth=g;c.axis.characterMajorHeight=h;d=Math.max(c.frameHeight-i,0);c.contentLeft=b.groupsOnRight?0:c.groupsWidth;c.contentWidth=Math.max(c.frameWidth-c.groupsWidth,0);c.contentHeight=d;return a}; +links.Timeline.prototype.repaintAxis=function(){var a=!1,b=this.dom,c=this.options,d=this.size,e=this.step,f=b.axis;if(!f)f={},b.axis=f;if(!d.axis.properties)d.axis.properties={};if(!f.minorTexts)f.minorTexts=[];if(!f.minorLines)f.minorLines=[];if(!f.majorTexts)f.majorTexts=[];if(!f.majorLines)f.majorLines=[];if(!f.frame)f.frame=document.createElement("DIV"),f.frame.style.position="absolute",f.frame.style.left="0px",f.frame.style.top="0px",b.content.appendChild(f.frame);b.content.removeChild(f.frame); +f.frame.style.width=d.contentWidth+"px";f.frame.style.height=d.axis.height+"px";var g=this.screenToTime(0),h=this.screenToTime(d.contentWidth);if(d.axis.characterMinorWidth)this.minimumStep=this.screenToTime(d.axis.characterMinorWidth*6)-this.screenToTime(0),e.setRange(g,h,this.minimumStep);g=this.repaintAxisCharacters();a=a||g;this.repaintAxisStartOverwriting();e.start();g=void 0;for(h=0;!e.end()&&h<1E3;){h++;var i=this.timeToScreen(e.getCurrent()),k=e.isMajor();c.showMinorLabels&&this.repaintAxisMinorText(i, +e.getLabelMinor(c));k&&c.showMajorLabels?(i>0&&(g==void 0&&(g=i),this.repaintAxisMajorText(i,e.getLabelMajor(c))),this.repaintAxisMajorLine(i)):this.repaintAxisMinorLine(i);e.next()}c.showMajorLabels&&(e=this.screenToTime(0),c=this.step.getLabelMajor(c,e),d=c.length*d.axis.characterMajorWidth+10,(g==void 0||dd;)c.removeChild(e[d]),e.splice(d,1);e=a.axis.minorLines;for(d=b.minorLineNum;e.length>d;)c.removeChild(e[d]),e.splice(d,1);e=a.axis.majorTexts;for(d=b.majorTextNum;e.length>d;)c.removeChild(e[d]),e.splice(d,1);a=a.axis.majorLines;for(d=b.majorLineNum;a.length>d;)c.removeChild(a[d]),a.splice(d,1)}; +links.Timeline.prototype.repaintAxisHorizontal=function(){var a=this.dom.axis,b=this.size,c=this.options;if(c=c.showMinorLabels||c.showMajorLabels){if(!a.backgroundLine){var d=document.createElement("DIV");d.className="timeline-axis";d.style.position="absolute";d.style.left="0px";d.style.width="100%";d.style.border="none";a.frame.insertBefore(d,a.frame.firstChild);a.backgroundLine=d}if(a.backgroundLine)a.backgroundLine.style.top=b.axis.top+"px",a.backgroundLine.style.height=b.axis.height+"px"}else a.backgroundLine&& +(a.frame.removeChild(a.backgroundLine),delete a.backgroundLine);c?(a.line?(c=a.frame.removeChild(a.line),a.frame.appendChild(c)):(c=document.createElement("DIV"),c.className="timeline-axis",c.style.position="absolute",c.style.left="0px",c.style.width="100%",c.style.height="0px",a.frame.appendChild(c),a.line=c),a.line.style.top=b.axis.line+"px"):a.line&&a.line.parentElement&&(a.frame.removeChild(a.line),delete a.line)}; +links.Timeline.prototype.repaintAxisMinorText=function(a,b){var c=this.size,d=this.dom,e=c.axis.properties,f=d.axis.frame,d=d.axis.minorTexts,g=e.minorTextNum;if(g0||h.update.length>0||h.hide.length>0;a=h.show.shift();)a.showDOM(g),a.getImageUrls(i),f.push(a); +for(;a=h.update.shift();)a.updateDOM(g),a.getImageUrls(i),b=this.renderedItems.indexOf(a),b==-1&&f.push(a);for(;a=h.hide.shift();)a.hideDOM(g),b=this.renderedItems.indexOf(a),b!=-1&&f.splice(b,1);f.forEach(function(a){a.updatePosition(e)});this.repaintDeleteButton();this.repaintDragAreas();d.content.appendChild(g);i.length&&links.imageloader.loadAll(i,function(){e.render()},!1);return c}; +links.Timeline.prototype.reflowGroups=function(){for(var a=!1,b=this.options,c=this.size,d=this.dom,e=0,f=this.groups,g=this.dom.groups?this.dom.groups.labels:[],h=0,i=f.length;h-b.contentWidth&&d<2*b.contentWidth?"":"none";a.currentTime.style.left= +d+"px";a.currentTime.title="Current time: "+c;this.currentTimeTimer!=void 0&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer);var e=this,a=1/this.conversion.factor/2;a<30&&(a=30);this.currentTimeTimer=setTimeout(function(){e.repaintCurrentTime()},a)}else a.currentTime&&(a.contentTimelines.removeChild(a.currentTime),delete a.currentTime)}; +links.Timeline.prototype.repaintCustomTime=function(){var a=this.dom,b=this.size;if(this.options.showCustomTime){if(!a.customTime){var c=document.createElement("DIV");c.className="timeline-customtime";c.style.position="absolute";c.style.top="0px";c.style.height="100%";var d=document.createElement("DIV");d.style.position="relative";d.style.top="0px";d.style.left="-10px";d.style.height="100%";d.style.width="20px";c.appendChild(d);a.contentTimelines.appendChild(c);a.customTime=c;this.customTime=new Date}c= +this.timeToScreen(this.customTime);a.customTime.style.display=c>-b.contentWidth&&c<2*b.contentWidth?"":"none";a.customTime.style.left=c+"px";a.customTime.title="Time: "+this.customTime}else a.customTime&&(a.contentTimelines.removeChild(a.customTime),delete a.customTime)}; +links.Timeline.prototype.repaintDeleteButton=function(){var a=this.dom,b=a.items.frame,c=a.items.deleteButton;if(!c)c=document.createElement("DIV"),c.className="timeline-navigation-delete",c.style.position="absolute",b.appendChild(c),a.items.deleteButton=c;var a=this.selection&&this.selection.index!==void 0?this.selection.index:-1,d=this.selection&&this.selection.index!==void 0?this.items[a]:void 0;d&&d.rendered&&this.isEditable(d)?(a=d.getRight(this),d=d.top,c.style.left=a+"px",c.style.top=d+"px", +c.style.display="",b.removeChild(c),b.appendChild(c)):c.style.display="none"}; +links.Timeline.prototype.repaintDragAreas=function(){var a=this.options,b=this.dom,c=this.dom.items.frame,d=b.items.dragLeft;if(!d)d=document.createElement("DIV"),d.className="timeline-event-range-drag-left",d.style.position="absolute",c.appendChild(d),b.items.dragLeft=d;var e=b.items.dragRight;if(!e)e=document.createElement("DIV"),e.className="timeline-event-range-drag-right",e.style.position="absolute",c.appendChild(e),b.items.dragRight=e;var b=this.selection&&this.selection.index!==void 0?this.selection.index: +-1,f=this.selection&&this.selection.index!==void 0?this.items[b]:void 0;if(f&&f.rendered&&this.isEditable(f)&&(f instanceof links.Timeline.ItemRange||f instanceof links.Timeline.ItemFloatingRange)){var b=f.getLeft(this),g=f.getRight(this),h=f.top,f=f.height;d.style.left=b+"px";d.style.top=h+"px";d.style.width=a.dragAreaWidth+"px";d.style.height=f+"px";d.style.display="";c.removeChild(d);c.appendChild(d);e.style.left=g-a.dragAreaWidth+"px";e.style.top=h+"px";e.style.width=a.dragAreaWidth+"px";e.style.height= +f+"px";e.style.display="";c.removeChild(e);c.appendChild(e)}else d.style.display="none",e.style.display="none"}; +links.Timeline.prototype.repaintNavigation=function(){var a=this,b=this.options,c=this.dom,d=c.frame,e=c.navBar;if(!e){var f=b.showButtonNew&&b.editable,g=b.showNavigation&&(b.zoomable||b.moveable);if(g||f)e=document.createElement("DIV"),e.style.position="absolute",e.className="timeline-navigation ui-widget ui-state-highlight ui-corner-all",b.groupsOnRight?e.style.left="10px":e.style.right="10px",b.axisOnTop?e.style.bottom="10px":e.style.top="10px",c.navBar=e,d.appendChild(e);if(f)e.addButton=document.createElement("DIV"), +e.addButton.className="timeline-navigation-new",e.addButton.title=b.CREATE_NEW_EVENT,c=document.createElement("SPAN"),c.className="ui-icon ui-icon-circle-plus",e.addButton.appendChild(c),links.Timeline.addEventListener(e.addButton,"mousedown",function(c){links.Timeline.preventDefault(c);links.Timeline.stopPropagation(c);c=a.screenToTime(a.size.contentWidth/2);b.snapEvents&&a.step.snap(c);a.addItem({start:c,content:b.NEW,group:a.groups.length?a.groups[0].content:void 0},!0);c=a.items.length-1;a.selectItem(c); +a.applyAdd=!0;a.trigger("add");a.applyAdd?(a.render({animate:!1}),a.selectItem(c)):a.deleteItem(c)}),e.appendChild(e.addButton);f&&g&&links.Timeline.addClassName(e.addButton,"timeline-navigation-new-line");if(g){if(b.zoomable)e.zoomInButton=document.createElement("DIV"),e.zoomInButton.className="timeline-navigation-zoom-in",e.zoomInButton.title=this.options.ZOOM_IN,f=document.createElement("SPAN"),f.className="ui-icon ui-icon-circle-zoomin",e.zoomInButton.appendChild(f),links.Timeline.addEventListener(e.zoomInButton, +"mousedown",function(b){links.Timeline.preventDefault(b);links.Timeline.stopPropagation(b);a.zoom(0.4);a.trigger("rangechange");a.trigger("rangechanged")}),e.appendChild(e.zoomInButton),e.zoomOutButton=document.createElement("DIV"),e.zoomOutButton.className="timeline-navigation-zoom-out",e.zoomOutButton.title=this.options.ZOOM_OUT,f=document.createElement("SPAN"),f.className="ui-icon ui-icon-circle-zoomout",e.zoomOutButton.appendChild(f),links.Timeline.addEventListener(e.zoomOutButton,"mousedown", +function(b){links.Timeline.preventDefault(b);links.Timeline.stopPropagation(b);a.zoom(-0.4);a.trigger("rangechange");a.trigger("rangechanged")}),e.appendChild(e.zoomOutButton);if(b.moveable)e.moveLeftButton=document.createElement("DIV"),e.moveLeftButton.className="timeline-navigation-move-left",e.moveLeftButton.title=this.options.MOVE_LEFT,f=document.createElement("SPAN"),f.className="ui-icon ui-icon-circle-arrow-w",e.moveLeftButton.appendChild(f),links.Timeline.addEventListener(e.moveLeftButton, +"mousedown",function(b){links.Timeline.preventDefault(b);links.Timeline.stopPropagation(b);a.move(-0.2);a.trigger("rangechange");a.trigger("rangechanged")}),e.appendChild(e.moveLeftButton),e.moveRightButton=document.createElement("DIV"),e.moveRightButton.className="timeline-navigation-move-right",e.moveRightButton.title=this.options.MOVE_RIGHT,f=document.createElement("SPAN"),f.className="ui-icon ui-icon-circle-arrow-e",e.moveRightButton.appendChild(f),links.Timeline.addEventListener(e.moveRightButton, +"mousedown",function(b){links.Timeline.preventDefault(b);links.Timeline.stopPropagation(b);a.move(0.2);a.trigger("rangechange");a.trigger("rangechanged")}),e.appendChild(e.moveRightButton)}}};links.Timeline.prototype.setCurrentTime=function(a){this.clientTimeOffset=a.valueOf()-(new Date).valueOf();this.repaintCurrentTime()};links.Timeline.prototype.getCurrentTime=function(){return new Date((new Date).valueOf()+this.clientTimeOffset)}; +links.Timeline.prototype.setCustomTime=function(a){this.customTime=new Date(a.valueOf());this.repaintCustomTime()};links.Timeline.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())};links.Timeline.prototype.setScale=function(a,b){this.step.setScale(a,b);this.render()};links.Timeline.prototype.setAutoScale=function(a){this.step.setAutoScale(a);this.render()};links.Timeline.prototype.redraw=function(){this.setData(this.data)};links.Timeline.prototype.checkResize=function(){this.render()}; +links.Timeline.prototype.isEditable=function(a){return a?a.editable!=void 0?a.editable:this.options.editable:!1};links.Timeline.prototype.recalcConversion=function(){this.conversion.offset=this.start.valueOf();this.conversion.factor=this.size.contentWidth/(this.end.valueOf()-this.start.valueOf())};links.Timeline.prototype.screenToTime=function(a){var b=this.conversion;return new Date(a/b.factor+b.offset)}; +links.Timeline.prototype.timeToScreen=function(a){var b=this.conversion;return(a.valueOf()-b.offset)*b.factor}; +links.Timeline.prototype.onTouchStart=function(a){var b=this.eventParams,c=this;if(!b.touchDown){b.touchDown=!0;b.zoomed=!1;this.onMouseDown(a);if(!b.onTouchMove)b.onTouchMove=function(a){c.onTouchMove(a)},links.Timeline.addEventListener(document,"touchmove",b.onTouchMove);if(!b.onTouchEnd)b.onTouchEnd=function(a){c.onTouchEnd(a)},links.Timeline.addEventListener(document,"touchend",b.onTouchEnd);var d=this.getItemIndex(links.Timeline.getTarget(a));b.doubleTapStartPrev=b.doubleTapStart;b.doubleTapStart= +(new Date).valueOf();b.doubleTapItemPrev=b.doubleTapItem;b.doubleTapItem=d;links.Timeline.preventDefault(a)}};links.Timeline.prototype.onTouchMove=function(a){var b=this.eventParams;if(a.scale&&a.scale!==1)b.zoomed=!0;if(b.zoomed){if(this.options.zoomable){b.zoomed=!0;var c=b.end.valueOf()-b.start.valueOf(),d=c/a.scale-c,c=new Date(parseInt(b.start.valueOf()-d/2)),b=new Date(parseInt(b.end.valueOf()+d/2));this.setVisibleChartRange(c,b);this.trigger("rangechange")}}else this.onMouseMove(a);links.Timeline.preventDefault(a)}; +links.Timeline.prototype.onTouchEnd=function(a){var b=this.eventParams;b.touchDown=!1;b.zoomed&&this.trigger("rangechanged");b.onTouchMove&&(links.Timeline.removeEventListener(document,"touchmove",b.onTouchMove),delete b.onTouchMove);b.onTouchEnd&&(links.Timeline.removeEventListener(document,"touchend",b.onTouchEnd),delete b.onTouchEnd);this.onMouseUp(a);var c=(new Date).valueOf();this.getItemIndex(links.Timeline.getTarget(a));if(b.doubleTapStartPrev&&c-b.doubleTapStartPrev<500&&b.doubleTapItem== +b.doubleTapItemPrev)b.touchDown=!0,this.onDblClick(a),b.touchDown=!1;links.Timeline.preventDefault(a)}; +links.Timeline.prototype.onMouseDown=function(a){var a=a||window.event,b=this.eventParams,c=this.options,d=this.dom;if((a.which?a.which==1:a.button==1)||b.touchDown){b.mouseX=links.Timeline.getPageX(a);b.mouseY=links.Timeline.getPageY(a);b.frameLeft=links.Timeline.getAbsoluteLeft(this.dom.content);b.frameTop=links.Timeline.getAbsoluteTop(this.dom.content);b.previousLeft=0;b.previousOffset=0;b.moved=!1;b.start=new Date(this.start.valueOf());b.end=new Date(this.end.valueOf());b.target=links.Timeline.getTarget(a); +var e=d.items&&d.items.dragRight?d.items.dragRight:void 0;b.itemDragLeft=b.target===(d.items&&d.items.dragLeft?d.items.dragLeft:void 0);b.itemDragRight=b.target===e;b.itemDragLeft||b.itemDragRight?(b.itemIndex=this.selection&&this.selection.index!==void 0?this.selection.index:void 0,delete b.clusterIndex):(b.itemIndex=this.getItemIndex(b.target),b.clusterIndex=this.getClusterIndex(b.target));b.customTime=b.target===d.customTime||b.target.parentNode===d.customTime?this.customTime:void 0;b.addItem= +c.editable&&a.ctrlKey;if(b.addItem){var f=b.mouseY-b.frameTop,d=this.screenToTime(b.mouseX-b.frameLeft);c.snapEvents&&this.step.snap(d);e=new Date(d.valueOf());c=c.NEW;f=this.getGroupFromHeight(f);this.addItem({start:d,end:e,content:c,group:this.getGroupName(f)});b.itemIndex=this.items.length-1;delete b.clusterIndex;this.selectItem(b.itemIndex);b.itemDragRight=!0}c=this.items[b.itemIndex];d=this.isSelected(b.itemIndex);b.editItem=d&&this.isEditable(c);b.editItem?(b.itemStart=c.start,b.itemEnd=c.end, +b.itemGroup=c.group,b.itemLeft=c.getLeft(this),b.itemRight=c.getRight(this)):this.dom.frame.style.cursor="move";if(!b.touchDown){var g=this;if(!b.onMouseMove)b.onMouseMove=function(a){g.onMouseMove(a)},links.Timeline.addEventListener(document,"mousemove",b.onMouseMove);if(!b.onMouseUp)b.onMouseUp=function(a){g.onMouseUp(a)},links.Timeline.addEventListener(document,"mouseup",b.onMouseUp);links.Timeline.preventDefault(a)}}}; +links.Timeline.prototype.onMouseMove=function(a){var a=a||window.event,b=this.eventParams,c=this.size,d=this.dom,e=this.options,f=links.Timeline.getPageX(a),g=links.Timeline.getPageY(a);if(b.mouseX==void 0)b.mouseX=f;if(b.mouseY==void 0)b.mouseY=g;f-=b.mouseX;if(Math.abs(f)>=1)b.moved=!0;if(b.customTime)this.customTime=this.screenToTime(this.timeToScreen(b.customTime)+f),this.repaintCustomTime(),this.trigger("timechange");else if(b.editItem){var d=this.items[b.itemIndex],h,i;if(b.itemDragLeft&&e.timeChangeable){h= +b.itemLeft+f;i=b.itemRight;d.start=this.screenToTime(h);e.snapEvents&&(this.step.snap(d.start),h=this.timeToScreen(d.start));if(h>i)h=i,d.start=this.screenToTime(h);this.trigger("change")}else if(b.itemDragRight&&e.timeChangeable){h=b.itemLeft;i=b.itemRight+f;d.end=this.screenToTime(i);e.snapEvents&&(this.step.snap(d.end),i=this.timeToScreen(d.end));if(i=1&&(a=0.9);a<=-1&&(a=-0.9);a<0&&(a/=1+a);var c=new Date(this.start.valueOf()-(this.start.valueOf()-b)*a),d=new Date(this.end.valueOf()-(this.end.valueOf()-b)*a),e=d.valueOf()-c.valueOf(),f=Number(this.options.zoomMin)||10;f<10&&(f=10);e>=f&&(this.applyRange(c,d,b),this.render({animate:this.options.animate&&this.options.animateZoom}))}; +links.Timeline.prototype.move=function(a){var b=this.end.valueOf()-this.start.valueOf();this.applyRange(new Date(this.start.valueOf()+b*a),new Date(this.end.valueOf()+b*a));this.render()}; +links.Timeline.prototype.applyRange=function(a,b,c){var a=a.valueOf(),b=b.valueOf(),d=b-a,e=this.options,f=Number(e.zoomMin)||10;f<10&&(f=10);var g=Number(e.zoomMax)||31536E10;g>31536E10&&(g=31536E10);g=e&&(e=h+864E5),g>e-h&&(g=e-h),f>e-h&&(f=e-h));a>=b&&(b+=864E5);if(dg&&(f=d-g,i=c?(c.valueOf()-a)/d:0.5,a+=Math.round(f* +i),b-=Math.round(f*(1-i)));h!=void 0&&(f=a-h,f<0&&(a-=f,b-=f));e!=void 0&&(f=e-b,f<0&&(a+=f,b+=f));this.start=new Date(a);this.end=new Date(b)};links.Timeline.prototype.confirmDeleteItem=function(a){this.applyDelete=!0;this.isSelected(a)||this.selectItem(a);this.trigger("delete");this.applyDelete&&this.deleteItem(a);delete this.applyDelete}; +links.Timeline.prototype.deleteItem=function(a,b){if(a>=this.items.length)throw"Cannot delete row, index out of range";this.selection&&this.selection.index!==void 0&&(this.selection.index==a?this.unselectItem():this.selection.index>a&&this.selection.index--);this.renderQueue.hide.push(this.items.splice(a,1)[0]);if(this.data)if(google&&google.visualization&&this.data instanceof google.visualization.DataTable)this.data.removeRow(a);else if(links.Timeline.isArray(this.data))this.data.splice(a,1);else throw"Cannot delete row from data, unknown data type"; +this.options.cluster&&this.clusterGenerator.updateData();b||this.render()}; +links.Timeline.prototype.deleteAllItems=function(){this.unselectItem();this.clearItems();this.deleteGroups();if(this.data)if(google&&google.visualization&&this.data instanceof google.visualization.DataTable)this.data.removeRows(0,this.data.getNumberOfRows());else if(links.Timeline.isArray(this.data))this.data.splice(0,this.data.length);else throw"Cannot delete row from data, unknown data type";this.options.cluster&&this.clusterGenerator.updateData();this.render()}; +links.Timeline.prototype.getGroupFromHeight=function(a){var b,c,d=this.groups;if(d.length){if(this.options.axisOnTop)for(b=d.length-1;b>=0;b--){if(c=d[b],a>c.top)break}else for(b=0;bc.top)break;return c}}; +links.Timeline.Item=function(a,b){if(a)this.start=a.start,this.end=a.end,this.content=a.content,this.className=a.className,this.editable=a.editable,this.group=a.group,this.type=a.type;this.dotHeight=this.dotWidth=this.lineWidth=this.height=this.width=this.left=this.top=0;this.rendered=!1;if(b)for(var c in b)b.hasOwnProperty(c)&&(this[c]=b[c])};links.Timeline.Item.prototype.reflow=function(){return!1}; +links.Timeline.Item.prototype.getImageUrls=function(a){this.dom&&links.imageloader.filterImageUrls(this.dom,a)};links.Timeline.Item.prototype.select=function(){};links.Timeline.Item.prototype.unselect=function(){};links.Timeline.Item.prototype.createDOM=function(){};links.Timeline.Item.prototype.showDOM=function(){};links.Timeline.Item.prototype.hideDOM=function(){};links.Timeline.Item.prototype.updateDOM=function(){};links.Timeline.Item.prototype.updatePosition=function(){}; +links.Timeline.Item.prototype.isRendered=function(){return this.rendered};links.Timeline.Item.prototype.isVisible=function(){return!1};links.Timeline.Item.prototype.setPosition=function(){};links.Timeline.Item.prototype.getLeft=function(){return 0};links.Timeline.Item.prototype.getRight=function(){return 0};links.Timeline.Item.prototype.getWidth=function(){return this.width||0};links.Timeline.ItemBox=function(a,b){links.Timeline.Item.call(this,a,b)};links.Timeline.ItemBox.prototype=new links.Timeline.Item; +links.Timeline.ItemBox.prototype.reflow=function(){var a=this.dom,b=a.dot.offsetHeight,c=a.dot.offsetWidth,a=a.line.offsetWidth,d=this.dotHeight!=b||this.dotWidth!=c||this.lineWidth!=a;this.dotHeight=b;this.dotWidth=c;this.lineWidth=a;return d};links.Timeline.ItemBox.prototype.select=function(){var a=this.dom;links.Timeline.addClassName(a,"timeline-event-selected ui-state-active");links.Timeline.addClassName(a.line,"timeline-event-selected ui-state-active");links.Timeline.addClassName(a.dot,"timeline-event-selected ui-state-active")}; +links.Timeline.ItemBox.prototype.unselect=function(){var a=this.dom;links.Timeline.removeClassName(a,"timeline-event-selected ui-state-active");links.Timeline.removeClassName(a.line,"timeline-event-selected ui-state-active");links.Timeline.removeClassName(a.dot,"timeline-event-selected ui-state-active")}; +links.Timeline.ItemBox.prototype.createDOM=function(){var a=document.createElement("DIV");a.style.position="absolute";a.style.left=this.left+"px";a.style.top=this.top+"px";var b=document.createElement("DIV");b.className="timeline-event-content";b.innerHTML=this.content;a.appendChild(b);b=document.createElement("DIV");b.style.position="absolute";b.style.width="0px";a.line=b;b=document.createElement("DIV");b.style.position="absolute";b.style.width="0px";b.style.height="0px";a.dot=b;this.dom=a;this.updateDOM(); +return a};links.Timeline.ItemBox.prototype.showDOM=function(a){var b=this.dom;b||(b=this.createDOM());if(b.parentNode!=a)b.parentNode&&this.hideDOM(),a.appendChild(b),a.insertBefore(b.line,a.firstChild),a.appendChild(b.dot),this.rendered=!0};links.Timeline.ItemBox.prototype.hideDOM=function(){var a=this.dom;if(a)a.parentNode&&a.parentNode.removeChild(a),a.line&&a.line.parentNode&&a.line.parentNode.removeChild(a.line),a.dot&&a.dot.parentNode&&a.dot.parentNode.removeChild(a.dot),this.rendered=!1}; +links.Timeline.ItemBox.prototype.updateDOM=function(){var a=this.dom;if(a){var b=a.line,c=a.dot;a.firstChild.innerHTML=this.content;a.className="timeline-event timeline-event-box ui-widget ui-state-default";b.className="timeline-event timeline-event-line ui-widget ui-state-default";c.className="timeline-event timeline-event-dot ui-widget ui-state-default";this.isCluster&&(links.Timeline.addClassName(a,"timeline-event-cluster ui-widget-header"),links.Timeline.addClassName(b,"timeline-event-cluster ui-widget-header"), +links.Timeline.addClassName(c,"timeline-event-cluster ui-widget-header"));this.className&&(links.Timeline.addClassName(a,this.className),links.Timeline.addClassName(b,this.className),links.Timeline.addClassName(c,this.className))}}; +links.Timeline.ItemBox.prototype.updatePosition=function(a){var b=this.dom;if(b){var c=a.timeToScreen(this.start),d=a.options.axisOnTop,e=a.size.axis.top,f=a.size.axis.height,a=a.options.box&&a.options.box.align?a.options.box.align:void 0;b.style.top=this.top+"px";b.style.left=a=="right"?c-this.width+"px":a=="left"?c+"px":c-this.width/2+"px";a=b.line;b=b.dot;a.style.left=c-this.lineWidth/2+"px";b.style.left=c-this.dotWidth/2+"px";d?(a.style.top=f+"px",a.style.height=Math.max(this.top-f,0)+"px",b.style.top= +f-this.dotHeight/2+"px"):(a.style.top=this.top+this.height+"px",a.style.height=Math.max(e-this.top-this.height,0)+"px",b.style.top=e-this.dotHeight/2+"px")}};links.Timeline.ItemBox.prototype.isVisible=function(a,b){return this.cluster?!1:this.start>a&&this.start2*c&&(a=2*c);b.style.top=this.top+"px";b.style.left=d+"px";b.style.width=Math.max(a-d,1)+"px"}};links.Timeline.ItemRange.prototype.isVisible=function(a,b){return this.cluster?!1:this.end>a&&this.start2*c&&(a=2*c);b.style.top=this.top+"px";b.style.left=d+"px";b.style.width=Math.max(a-d,1)+"px"}};links.Timeline.ItemFloatingRange.prototype.isVisible=function(a,b){return this.cluster?!1:this.end&&this.start?this.end>a&&this.starta:!0}; +links.Timeline.ItemFloatingRange.prototype.setPosition=function(a,b){var c=this.dom;c.style.left=a+"px";c.style.width=b-a+"px";if(this.group)this.top=this.group.top,c.style.top=this.top+"px"};links.Timeline.ItemFloatingRange.prototype.getLeft=function(a){return this.start?a.timeToScreen(this.start):0};links.Timeline.ItemFloatingRange.prototype.getRight=function(a){return this.end?a.timeToScreen(this.end):a.size.contentWidth}; +links.Timeline.ItemFloatingRange.prototype.getWidth=function(a){return this.getRight(a)-this.getLeft(a)};links.Timeline.ItemDot=function(a,b){links.Timeline.Item.call(this,a,b)};links.Timeline.ItemDot.prototype=new links.Timeline.Item;links.Timeline.ItemDot.prototype.reflow=function(){var a=this.dom,b=a.dot.offsetHeight,c=a.dot.offsetWidth,a=a.content.offsetHeight,d=this.dotHeight!=b||this.dotWidth!=c||this.contentHeight!=a;this.dotHeight=b;this.dotWidth=c;this.contentHeight=a;return d}; +links.Timeline.ItemDot.prototype.select=function(){links.Timeline.addClassName(this.dom,"timeline-event-selected ui-state-active")};links.Timeline.ItemDot.prototype.unselect=function(){links.Timeline.removeClassName(this.dom,"timeline-event-selected ui-state-active")}; +links.Timeline.ItemDot.prototype.createDOM=function(){var a=document.createElement("DIV");a.style.position="absolute";var b=document.createElement("DIV");b.className="timeline-event-content";a.appendChild(b);var c=document.createElement("DIV");c.style.position="absolute";c.style.width="0px";c.style.height="0px";a.appendChild(c);a.content=b;a.dot=c;this.dom=a;this.updateDOM();return a}; +links.Timeline.ItemDot.prototype.showDOM=function(a){var b=this.dom;b||(b=this.createDOM());if(b.parentNode!=a)b.parentNode&&this.hideDOM(),a.appendChild(b),this.rendered=!0};links.Timeline.ItemDot.prototype.hideDOM=function(){var a=this.dom;if(a)a.parentNode&&a.parentNode.removeChild(a),this.rendered=!1}; +links.Timeline.ItemDot.prototype.updateDOM=function(){if(this.dom){var a=this.dom,b=a.dot;a.firstChild.innerHTML=this.content;a.className="timeline-event-dot-container";b.className="timeline-event timeline-event-dot ui-widget ui-state-default";this.isCluster&&(links.Timeline.addClassName(a,"timeline-event-cluster ui-widget-header"),links.Timeline.addClassName(b,"timeline-event-cluster ui-widget-header"));this.className&&(links.Timeline.addClassName(a,this.className),links.Timeline.addClassName(b, +this.className))}};links.Timeline.ItemDot.prototype.updatePosition=function(a){var b=this.dom;if(b)a=a.timeToScreen(this.start),b.style.top=this.top+"px",b.style.left=a-this.dotWidth/2+"px",b.content.style.marginLeft=1.5*this.dotWidth+"px",b.dot.style.top=(this.height-this.dotHeight)/2+"px"};links.Timeline.ItemDot.prototype.isVisible=function(a,b){return this.cluster?!1:this.start>a&&this.start=this.items.length)throw"Cannot get item, index out of range";var b=this.data;if(google&&google.visualization&&b instanceof google.visualization.DataTable){var c=links.Timeline.mapColumnIds(b),b={},d;for(d in c)c.hasOwnProperty(d)&&(b[d]=this.data.getValue(a,c[d]))}else if(links.Timeline.isArray(this.data))b=links.Timeline.clone(this.data[a]);else throw"Unknown data type. DataTable or Array expected.";a=this.items[a];b.start=new Date(a.start.valueOf()); +if(a.end)b.end=new Date(a.end.valueOf());b.content=a.content;if(a.group)b.group=this.getGroupName(a.group);if(a.className)b.className=a.className;if(typeof a.editable!=="undefined")b.editable=a.editable;if(a.type)b.type=a.type;return b}; +links.Timeline.prototype.getCluster=function(a){if(a>=this.clusters.length)throw"Cannot get cluster, index out of range";var b={},c=this.clusters[a],a=c.items;b.start=new Date(c.start.valueOf());if(c.type)b.type=c.type;b.items=[];for(c=0;cb.content?1:a.content0){if(a[0].row!=void 0){var b=a[0].row;if(this.items[b])return a=this.items[b],this.selectItem(b),b=a.start,a=a.end,a=a!=void 0?(a.valueOf()+b.valueOf())/2:b.valueOf(),b=this.end.valueOf()-this.start.valueOf(),this.setVisibleChartRange(new Date(a-b/2),new Date(a+b/2)),!0}}else this.unselectItem();return!1}; +links.Timeline.prototype.getSelection=function(){var a=[];this.selection&&(this.selection.index!==void 0?a.push({row:this.selection.index}):a.push({cluster:this.selection.cluster}));return a};links.Timeline.prototype.selectItem=function(a){this.unselectItem();this.selection=void 0;if(this.items[a]!=void 0){var b=this.items[a];this.selection={index:a};if(b&&b.dom){if(this.isEditable(b))b.dom.style.cursor="move";b.select()}this.repaintDeleteButton();this.repaintDragAreas()}}; +links.Timeline.prototype.selectCluster=function(a){this.unselectItem();this.selection=void 0;if(this.clusters[a]!=void 0)this.selection={cluster:a},this.repaintDeleteButton(),this.repaintDragAreas()};links.Timeline.prototype.isSelected=function(a){return this.selection&&this.selection.index==a}; +links.Timeline.prototype.unselectItem=function(){if(this.selection&&this.selection.index!==void 0){var a=this.items[this.selection.index];if(a&&a.dom)a.dom.style.cursor="",a.unselect();this.selection=void 0;this.repaintDeleteButton();this.repaintDragAreas()}}; +links.Timeline.prototype.stackItems=function(a){a==void 0&&(a=!1);var b=this.stack;if(!b)this.stack=b={};b.sortedItems=this.stackOrder(this.renderedItems);b.finalItems=this.stackCalculateFinal(b.sortedItems);if(a||b.timer){var c=this,d=function(){var a=c.stackMoveOneStep(b.sortedItems,b.finalItems);c.repaint();a?delete b.timer:b.timer=setTimeout(d,30)};if(!b.timer)b.timer=setTimeout(d,30)}else this.stackMoveToFinal(b.sortedItems,b.finalItems)}; +links.Timeline.prototype.stackCancelAnimation=function(){this.stack&&this.stack.timer&&(clearTimeout(this.stack.timer),delete this.stack.timer)};links.Timeline.prototype.getItemsByGroup=function(a){for(var b={},c=0;ch?1:-1;Math.abs(k)>4&&(m=k/4);h=parseInt(h+m);h!=i&&(c=!1);g.top=h;g.bottom=g.top+g.height}else g.top=f.top,g.bottom=f.bottom;g.left=f.left;g.right=f.right}return c}; +links.Timeline.prototype.stackMoveToFinal=function(a,b){for(var c=0,d=b.length;c=c;d--){var h=a[d];if(f(g,h,e)&&d!=b)return h}};links.Timeline.prototype.collision=function(a,b,c){c==void 0&&(c=0);return a.left-cb.left&&a.top-cb.top}; +links.Timeline.prototype.trigger=function(a){var b=null;switch(a){case "rangechange":case "rangechanged":b={start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())};break;case "timechange":case "timechanged":b={time:new Date(this.customTime.valueOf())}}links.events.trigger(this,a,b);google&&google.visualization&&google.visualization.events.trigger(this,a,b)}; +links.Timeline.prototype.clusterItems=function(){if(this.options.cluster){var a=this.clusterGenerator.getClusters(this.conversion.factor,this.options.clusterMaxItems);if(this.clusters!=a){var b=this.renderQueue;this.clusters&&this.clusters.forEach(function(a){b.hide.push(a);a.items.forEach(function(a){a.cluster=void 0})});a.forEach(function(a){a.items.forEach(function(b){b.cluster=a})});this.clusters=a}}}; +links.Timeline.prototype.filterItems=function(){function a(a){a.forEach(function(a){var c=a.rendered,f=a.isVisible(d,e);c!=f&&(c&&b.hide.push(a),f&&b.show.indexOf(a)==-1&&b.show.push(a))})}var b=this.renderQueue,c=this.end-this.start,d=new Date(this.start.valueOf()-c),e=new Date(this.end.valueOf()+c);a(this.items);this.clusters&&a(this.clusters)};links.Timeline.ClusterGenerator=function(a){this.timeline=a;this.clear()}; +links.Timeline.ClusterGenerator.prototype.clear=function(){this.items=[];this.groups={};this.clearCache()};links.Timeline.ClusterGenerator.prototype.clearCache=function(){this.cache={};this.cacheLevel=-1;this.cache[this.cacheLevel]=[]};links.Timeline.ClusterGenerator.prototype.setData=function(a,b){this.items=a||[];this.applyOnChangedLevel=this.dataChanged=!0;if(b&&b.applyOnChangedLevel)this.applyOnChangedLevel=b.applyOnChangedLevel}; +links.Timeline.ClusterGenerator.prototype.updateData=function(){this.dataChanged=!0;this.applyOnChangedLevel=!1};links.Timeline.ClusterGenerator.prototype.filterData=function(){var a=this.items||[],b={};this.groups=b;a.forEach(function(a){var c=a.group?a.group.content:"",f=b[c];f||(f=[],b[c]=f);f.push(a);if(a.start)a.center=a.end?(a.start.valueOf()+a.end.valueOf())/2:a.start.valueOf()});for(var c in b)b.hasOwnProperty(c)&&b[c].sort(function(a,b){return a.center-b.center});this.dataChanged=!1}; +links.Timeline.ClusterGenerator.prototype.getClusters=function(a,b){var c=-1,d=0;a>0&&(c=Math.round(Math.log(100/a)/Math.log(2)),d=Math.pow(2,c));if(this.dataChanged){var e=c!=this.cacheLevel;if(this.applyOnChangedLevel?e:1)this.clearCache(),this.filterData()}this.cacheLevel=c;e=this.cache[c];if(!e){var e=[],f;for(f in this.groups)if(this.groups.hasOwnProperty(f))for(var g=this.groups[f],h=g.length,i=0;i=0&&k.center-g[l].center=0&&k.center-e[l].centerb){for(var m=m-b+1,l=[],s=void 0,q=void 0,o=void 0,p=!1,n=0,u=i;l.length'+n+" events",k=k.group?k.group.content:void 0;t=p?this.timeline.createItem({start:new Date(q),end:new Date(o),content:n,group:k}):this.timeline.createItem({start:new Date(s),content:n,group:k});t.isCluster=!0;t.items=l;t.items.forEach(function(a){a.cluster=t});e.push(t);i+=m}else delete k.cluster,i+=1}this.cache[c]=e}return e}; +links.events=links.events||{listeners:[],indexOf:function(a){for(var b=this.listeners,c=0,d=this.listeners.length;cthis._end.valueOf()}; +links.Timeline.StepDate.prototype.next=function(){var a=this.current.valueOf();if(this.current.getMonth()<6)switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current=new Date(this.current.valueOf()+this.step*1E3);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+this.step*6E4);break;case links.Timeline.StepDate.SCALE.HOUR:this.current= +new Date(this.current.valueOf()+this.step*36E5);var b=this.current.getHours();this.current.setHours(b-b%this.step);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step)}else switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current= +new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case links.Timeline.StepDate.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step); +break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step)}if(this.step!=1)switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current.getMilliseconds()0)this.step=b;this.autoScale=!1};links.Timeline.StepDate.prototype.setAutoScale=function(a){this.autoScale=a}; +links.Timeline.StepDate.prototype.setMinimumStep=function(a){if(a!=void 0){if(31104E9>a)this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=1E3;if(15552E9>a)this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=500;if(31104E8>a)this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=100;if(15552E8>a)this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=50;if(31104E7>a)this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=10;if(15552E7>a)this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step= +5;if(31104E6>a)this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=1;if(7776E6>a)this.scale=links.Timeline.StepDate.SCALE.MONTH,this.step=3;if(2592E6>a)this.scale=links.Timeline.StepDate.SCALE.MONTH,this.step=1;if(432E6>a)this.scale=links.Timeline.StepDate.SCALE.DAY,this.step=5;if(1728E5>a)this.scale=links.Timeline.StepDate.SCALE.DAY,this.step=2;if(864E5>a)this.scale=links.Timeline.StepDate.SCALE.DAY,this.step=1;if(432E5>a)this.scale=links.Timeline.StepDate.SCALE.WEEKDAY,this.step=1;if(144E5> +a)this.scale=links.Timeline.StepDate.SCALE.HOUR,this.step=4;if(36E5>a)this.scale=links.Timeline.StepDate.SCALE.HOUR,this.step=1;if(9E5>a)this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=15;if(6E5>a)this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=10;if(3E5>a)this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=5;if(6E4>a)this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=1;if(15E3>a)this.scale=links.Timeline.StepDate.SCALE.SECOND,this.step=15;if(1E4>a)this.scale=links.Timeline.StepDate.SCALE.SECOND, +this.step=10;if(5E3>a)this.scale=links.Timeline.StepDate.SCALE.SECOND,this.step=5;if(1E3>a)this.scale=links.Timeline.StepDate.SCALE.SECOND,this.step=1;if(200>a)this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=200;if(100>a)this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=100;if(50>a)this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=50;if(10>a)this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=10;if(5>a)this.scale=links.Timeline.StepDate.SCALE.MILLISECOND, +this.step=5;if(1>a)this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=1}}; +links.Timeline.StepDate.prototype.snap=function(a){if(this.scale==links.Timeline.StepDate.SCALE.YEAR){var b=a.getFullYear()+Math.round(a.getMonth()/12);a.setFullYear(Math.round(b/this.step)*this.step);a.setMonth(0);a.setDate(0);a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else if(this.scale==links.Timeline.StepDate.SCALE.MONTH)a.getDate()>15?(a.setDate(1),a.setMonth(a.getMonth()+1)):a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0);else if(this.scale== +links.Timeline.StepDate.SCALE.DAY||this.scale==links.Timeline.StepDate.SCALE.WEEKDAY){switch(this.step){case 5:case 2:a.setHours(Math.round(a.getHours()/24)*24);break;default:a.setHours(Math.round(a.getHours()/12)*12)}a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0)}else if(this.scale==links.Timeline.StepDate.SCALE.HOUR){switch(this.step){case 4:a.setMinutes(Math.round(a.getMinutes()/60)*60);break;default:a.setMinutes(Math.round(a.getMinutes()/30)*30)}a.setSeconds(0);a.setMilliseconds(0)}else if(this.scale== +links.Timeline.StepDate.SCALE.MINUTE){switch(this.step){case 15:case 10:a.setMinutes(Math.round(a.getMinutes()/5)*5);a.setSeconds(0);break;case 5:a.setSeconds(Math.round(a.getSeconds()/60)*60);break;default:a.setSeconds(Math.round(a.getSeconds()/30)*30)}a.setMilliseconds(0)}else if(this.scale==links.Timeline.StepDate.SCALE.SECOND)switch(this.step){case 15:case 10:a.setSeconds(Math.round(a.getSeconds()/5)*5);a.setMilliseconds(0);break;case 5:a.setMilliseconds(Math.round(a.getMilliseconds()/1E3)*1E3); +break;default:a.setMilliseconds(Math.round(a.getMilliseconds()/500)*500)}else this.scale==links.Timeline.StepDate.SCALE.MILLISECOND&&(b=this.step>5?this.step/2:1,a.setMilliseconds(Math.round(a.getMilliseconds()/b)*b))}; +links.Timeline.StepDate.prototype.isMajor=function(){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return this.current.getMilliseconds()==0;case links.Timeline.StepDate.SCALE.SECOND:return this.current.getSeconds()==0;case links.Timeline.StepDate.SCALE.MINUTE:return this.current.getHours()==0&&this.current.getMinutes()==0;case links.Timeline.StepDate.SCALE.HOUR:return this.current.getHours()==0;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return this.current.getDate()== +1;case links.Timeline.StepDate.SCALE.MONTH:return this.current.getMonth()==0;case links.Timeline.StepDate.SCALE.YEAR:return!1;default:return!1}}; +links.Timeline.StepDate.prototype.getLabelMinor=function(a,b){if(b==void 0)b=this.current;switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return String(b.getMilliseconds());case links.Timeline.StepDate.SCALE.SECOND:return String(b.getSeconds());case links.Timeline.StepDate.SCALE.MINUTE:return this.addZeros(b.getHours(),2)+":"+this.addZeros(b.getMinutes(),2);case links.Timeline.StepDate.SCALE.HOUR:return this.addZeros(b.getHours(),2)+":"+this.addZeros(b.getMinutes(),2);case links.Timeline.StepDate.SCALE.WEEKDAY:return a.DAYS_SHORT[b.getDay()]+ +" "+b.getDate();case links.Timeline.StepDate.SCALE.DAY:return String(b.getDate());case links.Timeline.StepDate.SCALE.MONTH:return a.MONTHS_SHORT[b.getMonth()];case links.Timeline.StepDate.SCALE.YEAR:return String(b.getFullYear());default:return""}}; +links.Timeline.StepDate.prototype.getLabelMajor=function(a,b){if(b==void 0)b=this.current;switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return this.addZeros(b.getHours(),2)+":"+this.addZeros(b.getMinutes(),2)+":"+this.addZeros(b.getSeconds(),2);case links.Timeline.StepDate.SCALE.SECOND:return b.getDate()+" "+a.MONTHS[b.getMonth()]+" "+this.addZeros(b.getHours(),2)+":"+this.addZeros(b.getMinutes(),2);case links.Timeline.StepDate.SCALE.MINUTE:return a.DAYS[b.getDay()]+" "+b.getDate()+ +" "+a.MONTHS[b.getMonth()]+" "+b.getFullYear();case links.Timeline.StepDate.SCALE.HOUR:return a.DAYS[b.getDay()]+" "+b.getDate()+" "+a.MONTHS[b.getMonth()]+" "+b.getFullYear();case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return a.MONTHS[b.getMonth()]+" "+b.getFullYear();case links.Timeline.StepDate.SCALE.MONTH:return String(b.getFullYear());default:return""}};links.Timeline.StepDate.prototype.addZeros=function(a,b){for(var c=""+a;c.length=0&&(b="DOMMouseScroll"),a.addEventListener(b,c,d)):a.attachEvent("on"+b,c)}; +links.Timeline.removeEventListener=function(a,b,c,d){a.removeEventListener?(d===void 0&&(d=!1),b==="mousewheel"&&navigator.userAgent.indexOf("Firefox")>=0&&(b="DOMMouseScroll"),a.removeEventListener(b,c,d)):a.detachEvent("on"+b,c)};links.Timeline.getTarget=function(a){if(!a)a=window.event;var b;if(a.target)b=a.target;else if(a.srcElement)b=a.srcElement;if(b.nodeType!=void 0&&b.nodeType==3)b=b.parentNode;return b}; +links.Timeline.stopPropagation=function(a){if(!a)a=window.event;a.stopPropagation?a.stopPropagation():a.cancelBubble=!0};links.Timeline.preventDefault=function(a){if(!a)a=window.event;a.preventDefault?a.preventDefault():a.returnValue=!1};links.Timeline.getAbsoluteLeft=function(a){for(var b=document.documentElement,c=document.body,d=a.offsetLeft,a=a.offsetParent;a!=null&&a!=c&&a!=b;)d+=a.offsetLeft,d-=a.scrollLeft,a=a.offsetParent;return d}; +links.Timeline.getAbsoluteTop=function(a){for(var b=document.documentElement,c=document.body,d=a.offsetTop,a=a.offsetParent;a!=null&&a!=c&&a!=b;)d+=a.offsetTop,d-=a.scrollTop,a=a.offsetParent;return d};links.Timeline.getPageY=function(a){"targetTouches"in a&&a.targetTouches.length&&(a=a.targetTouches[0]);if("pageY"in a)return a.pageY;var b=document.documentElement,c=document.body;return a.clientY+(b&&b.scrollTop||c&&c.scrollTop||0)-(b&&b.clientTop||c&&c.clientTop||0)}; +links.Timeline.getPageX=function(a){"targetTouches"in a&&a.targetTouches.length&&(a=a.targetTouches[0]);if("pageX"in a)return a.pageX;var b=document.documentElement,c=document.body;return a.clientX+(b&&b.scrollLeft||c&&c.scrollLeft||0)-(b&&b.clientLeft||c&&c.clientLeft||0)};links.Timeline.addClassName=function(a,b){for(var c=a.className.split(" "),d=b.split(" "),e=!1,f=0;f + * @copyright Copyright (C) 2002-2005 Markus Westphal, + * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, + * 2010-2012 Uwe Steinmann + * @version Release: @package_version@ + */ + +/** + * Include parent class + */ +require_once("class.Bootstrap.php"); + +/** + * Class which outputs the html page for Timeline view + * + * @category DMS + * @package SeedDMS + * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann + * @copyright Copyright (C) 2002-2005 Markus Westphal, + * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, + * 2010-2012 Uwe Steinmann + * @version Release: @package_version@ + */ +class SeedDMS_View_Timeline extends SeedDMS_Bootstrap_Style { + var $dms; + var $folder_count; + var $document_count; + var $file_count; + var $storage_size; + + function show() { /* {{{ */ + $this->dms = $this->params['dms']; + $user = $this->params['user']; + $data = $this->params['data']; + $from = $this->params['from']; + $to = $this->params['to']; + + $this->htmlAddHeader(''."\n", 'css'); + $this->htmlAddHeader(''."\n", 'js'); + $this->htmlAddHeader(''."\n", 'js'); + + $this->htmlStartPage(getMLText("timeline")); + $this->globalNavigation(); + $this->contentStart(); + $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); +?> + +\n"; + +echo "
\n"; +$this->contentHeading(getMLText("timeline")); +echo "
\n"; +?> +
+
+ +
+ + + + - + + + + +
+
+
+ +
+ +
+
+
+\n"; +echo "
\n"; + +echo "
\n"; +$this->contentHeading(getMLText("timeline")); + foreach($data as &$item) { + switch($item['type']) { + case 'add_version': + $msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version'])); + break; + case 'add_file': + $msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()))); + break; + case 'status_change': + $msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version'], 'status'=> getOverallStatusText($item['status']))); + break; + default: + $msg = '???'; + } + $item['msg'] = $msg; + } +$this->printTimeline($data, 500); +echo "
\n"; +echo "
\n"; + +$this->contentContainerEnd(); +$this->htmlEndPage(); + } /* }}} */ +} +?> From fc909100d248e1bc0337a06ef49820be7b7d573f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 21 Sep 2015 16:47:05 +0200 Subject: [PATCH 4/6] add link to timeline, move version info into last line --- views/bootstrap/class.AdminTools.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.AdminTools.php b/views/bootstrap/class.AdminTools.php index c6061edf2..58f6203fc 100644 --- a/views/bootstrap/class.AdminTools.php +++ b/views/bootstrap/class.AdminTools.php @@ -85,10 +85,11 @@ class SeedDMS_View_AdminTools extends SeedDMS_Bootstrap_Style {


-
+

+
Date: Mon, 21 Sep 2015 16:47:47 +0200 Subject: [PATCH 5/6] pass $timeline instead of $document to printTimeline() --- views/bootstrap/class.Bootstrap.php | 20 +++----------------- views/bootstrap/class.ViewDocument.php | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 22f145cb1..cd66d678c 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2017,8 +2017,7 @@ mayscript> * * @param object $document document */ - protected function printTimeline($document) { /* {{{ */ - $timeline = $document->getTimeline(); + protected function printTimeline($timeline, $height=300) { /* {{{ */ ?>