183 |
183 |
184 Tlns.Templates.Timeline = '<div class="Tl-Main"><div class="Tl-Grid"></div><div class="Tl-TopBar"></div>' |
184 Tlns.Templates.Timeline = '<div class="Tl-Main"><div class="Tl-Grid"></div><div class="Tl-TopBar"></div>' |
185 + '<div class="Tl-BottomPart"><ul class="Tl-UniversLabels"></ul>' |
185 + '<div class="Tl-BottomPart"><ul class="Tl-UniversLabels"></ul>' |
186 + '<div class="Tl-MainPart"><div class="Tl-Occurrences"></div>' |
186 + '<div class="Tl-MainPart"><div class="Tl-Occurrences"></div>' |
187 + '</div>' |
187 + '</div>' |
188 + '<div class="Tl-Overlay-Container"><div class="Tl-Overlay-Box"><div class="Tl-Overlay"><div class="Tl-Overlay-Tip-Top"></div><div class="Tl-Overlay-Main"></div><div class="Tl-Overlay-Tip-Bottom"></div></div></div></div></div></div>' |
188 + '<div class="Tl-Overlay-Container"><div class="Tl-Overlay-Box"><div class="Tl-Overlay"><div class="Tl-Overlay-Tip-Top"></div><div class="Tl-Overlay-Main"></div></div></div></div></div></div>' |
189 + '<div class="Tl-Details"></div>' |
189 + '<div class="Tl-Details"></div>' |
190 |
190 |
191 Tlns.Templates.Univers = '<div class="Tl-UniversText">{{title}}</div>'; |
191 Tlns.Templates.Univers = '<div class="Tl-UniversText">{{title}}</div>'; |
192 |
192 |
193 Tlns.Templates.Occurrence = |
193 Tlns.Templates.Occurrence = |
194 '{{#occurrences}}<div class="Tl-Occurrence Tl-OccOnGrid Tl-Occ{{type}} Tl-Occ{{status}}{{#editing}} Tl-Editing{{/editing}}" occurrence-id="{{id}}" style="left: {{x}}px; top: {{y}}px;">' |
194 '{{#occurrences}}<div class="Tl-Occurrence Tl-OccOnGrid Tl-Occ{{type}} Tl-Occ{{status}}{{#editing}} Tl-Editing{{/editing}}" occurrence-id="{{id}}" style="left: {{x}}px; top: {{y}}px;">' |
195 + '{{#image}}<img src="{{image}}" />{{/image}}' |
195 + '{{#image}}<img src="{{image}}" />{{/image}}' |
196 + '</div>{{/occurrences}}'; |
196 + '</div>{{/occurrences}}'; |
197 |
197 |
198 Tlns.Templates.OccurrenceTooltip = '<h3 class="Tl-Tooltip-Title">{{title}}</h3><p class="Tl-Tooltip-Date">{{formatted_date}} — {{translated_status}} — {{format}}</p>' |
198 Tlns.Templates.OccurrenceTooltip = '<h3 class="Tl-Tooltip-Title">{{title}}</h3>'; |
199 + '<p class="Tl-Tooltip-Description">{{description}}</p>' |
|
200 // + '<p class="Tl-Tooltip-Characters">{{univers.mainCharacter}}{{#characters}}, {{.}}{{/characters}}</p>' |
|
201 |
199 |
202 Tlns.Templates.OccurrenceDetails = '<div class="Tl-Detail"><img class="Tl-Detail-Image" src="{{detail_image}}" />' |
200 Tlns.Templates.OccurrenceDetails = '<div class="Tl-Detail"><img class="Tl-Detail-Image" src="{{detail_image}}" />' |
203 + '<h2 class="Tl-Detail-Title">{{title}}</h2><p class="Tl-Detail-Description">{{detail_description}}</p>' |
201 + '<h2 class="Tl-Detail-Title">{{title}}</h2><p class="Tl-Detail-Description">{{detail_description}}</p>' |
204 + '<div class="Tl-Detail-Bottom"><span class="Tl-Detail-Date">{{formatted_date}}</span><a class="Tl-Detail-Read" href="{{url}}" target="_blank">Lire la suite</a></div></div>'; |
202 + '<div class="Tl-Detail-Bottom"><span class="Tl-Detail-Date">{{formatted_date}}</span><a class="Tl-Detail-Read" href="{{url}}" target="_blank">Lire la suite</a></div></div>'; |
205 |
203 |
439 _occurrence = this.getOccurrence(_id); |
437 _occurrence = this.getOccurrence(_id); |
440 switch (_data.__CLASS__) { |
438 switch (_data.__CLASS__) { |
441 case "Cms\\Previously": |
439 case "Cms\\Previously": |
442 case "Cms\\Chapter": |
440 case "Cms\\Chapter": |
443 case "Cms\\Article": |
441 case "Cms\\Article": |
|
442 case "Cms\\Video": |
444 case "Cms\\Poll": |
443 case "Cms\\Poll": |
|
444 case "Cms\\Rule": |
445 case "Cms\\CallWitness": |
445 case "Cms\\CallWitness": |
446 case "Cms\\CallCharacter": |
446 case "Cms\\CallCharacter": |
447 case "Cms\\SweetCadaver": |
447 case "Cms\\SweetCadaver": |
448 if (typeof _occurrence === "undefined") { |
448 if (typeof _occurrence === "undefined") { |
449 _occurrence = new Tlns.Classes.Occurrence(this); |
449 _occurrence = new Tlns.Classes.Occurrence(this); |
476 var _this = this; |
474 var _this = this; |
477 _(this.occurrences).each(function(_occ) { |
475 _(this.occurrences).each(function(_occ) { |
478 _occ.x = _this.current_scale * (_occ.date - _this.start_time); |
476 _occ.x = _this.current_scale * (_occ.date - _this.start_time); |
479 _occ.y = _occ.univers.y; |
477 _occ.y = _occ.univers.y; |
480 }); |
478 }); |
481 var minT = this.timeFromX(-85), |
479 var minT = this.timeFromX(-38), |
482 minI = this.timescales[this.level].min_importance; |
480 minI = this.timescales[this.level].min_importance; |
483 var _visible = _(this.occurrences).filter(function(_occ) { |
481 var _visible = _(this.occurrences).filter(function(_occ) { |
484 return (_occ.date >= minT && _occ.date <= _this.end_time && _occ.status && (_occ.importance >= minI)); |
482 return (_occ.date >= minT && _occ.date <= _this.end_time && _occ.status && (_occ.importance >= minI)); |
485 }); |
483 }); |
486 |
484 |
530 var _el = $(this), |
528 var _el = $(this), |
531 _id = _el.attr("occurrence-id"); |
529 _id = _el.attr("occurrence-id"); |
532 if (typeof _id !== "undefined") { |
530 if (typeof _id !== "undefined") { |
533 var _occurrence = _this.getOccurrence(_id); |
531 var _occurrence = _this.getOccurrence(_id); |
534 if (!_this.is_dragging) { |
532 if (!_this.is_dragging) { |
535 var _html = Mustache.to_html(Tlns.Templates.OccurrenceTooltip, _occurrence), |
533 var _html = Mustache.to_html(Tlns.Templates.OccurrenceTooltip, _occurrence); |
536 isup = (_event.pageY - _this.dragging_bounds.top) >= (.4 * _this.main_height); |
534 _this.showTooltip(_occurrence.x + 19, _occurrence.y + 20, _html); |
537 _this.showTooltip(_occurrence.x + 42, _occurrence.y + (isup ? 10 : 20), _html, isup); |
|
538 } |
535 } |
539 } |
536 } |
540 }).mouseout(function() { |
537 }).mouseout(function() { |
541 var _el = $(this), |
538 var _el = $(this), |
542 _id = _el.attr("occurrence-id"); |
539 _id = _el.attr("occurrence-id"); |
591 this.type = _data.__CLASS__; |
588 this.type = _data.__CLASS__; |
592 this.importance = _data.importance; |
589 this.importance = _data.importance; |
593 switch(_data.__CLASS__) { |
590 switch(_data.__CLASS__) { |
594 case "Cms\\Previously": |
591 case "Cms\\Previously": |
595 case "Cms\\Chapter": |
592 case "Cms\\Chapter": |
|
593 case "Cms\\Video": |
596 this.univers_id = 0; |
594 this.univers_id = 0; |
597 break; |
595 break; |
598 case "Cms\\Article": |
596 case "Cms\\Article": |
599 this.univers_id = 1; |
597 this.univers_id = 1; |
600 break; |
598 break; |
601 case "Cms\\Poll": |
599 case "Cms\\Poll": |
|
600 case "Cms\\Rule": |
602 case "Cms\\CallWitness": |
601 case "Cms\\CallWitness": |
603 case "Cms\\CallCharacter": |
|
604 this.univers_id = 2; |
602 this.univers_id = 2; |
605 break; |
603 break; |
|
604 case "Cms\\CallCharacter": |
606 case "Cms\\SweetCadaver": |
605 case "Cms\\SweetCadaver": |
607 this.univers_id = 3; |
606 this.univers_id = 3; |
608 break; |
607 break; |
609 } |
608 } |
610 this.univers = this.timeline.univers[this.univers_id]; |
609 this.univers = this.timeline.univers[this.univers_id]; |
624 this.status = "a_valider"; |
623 this.status = "a_valider"; |
625 } |
624 } |
626 } |
625 } |
627 this.format = this.timeline.class_labels[this.type]; |
626 this.format = this.timeline.class_labels[this.type]; |
628 if (_data.contentHasMedias && _data.contentHasMedias.length) { |
627 if (_data.contentHasMedias && _data.contentHasMedias.length) { |
629 this.image = _data.contentHasMedias[0].media.cinema.replace(/cinema\/[\d]+\/[\d]+/,'cinema/85/38'); |
628 this.image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/38/38'); |
630 this.detail_image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/135/135'); |
629 this.detail_image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/135/135'); |
631 } |
630 } |
632 this.translated_status = Tlns.Defaults.Timeline.statuses[this.status]; |
631 this.translated_status = Tlns.Defaults.Timeline.statuses[this.status]; |
633 // this.published = (_data.publication && _data.publication == "En ligne"); |
632 // this.published = (_data.publication && _data.publication == "En ligne"); |
634 // this.locked = _data.verrouille || false; |
633 // this.locked = _data.verrouille || false; |