124 timescales : [{ |
124 timescales : [{ |
125 label : "Semaine", |
125 label : "Semaine", |
126 span : 7 * 86400 * 1000, |
126 span : 7 * 86400 * 1000, |
127 grid_interval : 86400 * 1000, |
127 grid_interval : 86400 * 1000, |
128 grid_date_format : '{{dayOfMonth}} {{monthName}}', |
128 grid_date_format : '{{dayOfMonth}} {{monthName}}', |
129 min_importance : 1 |
129 min_importance : 0 |
130 }, { |
130 }, { |
131 label : "3 jours", |
131 label : "3 jours", |
132 span : 3 * 86400 * 1000, |
132 span : 3 * 86400 * 1000, |
133 grid_interval : 6 * 3600 * 1000, |
133 grid_interval : 6 * 3600 * 1000, |
134 grid_date_format : '{{^isDayStart}}{{0hours}}h{{0minutes}}{{/isDayStart}}{{#isDayStart}}{{dayOfMonth}} {{shortMonthName}}{{/isDayStart}}', |
134 grid_date_format : '{{^isDayStart}}{{0hours}}h{{0minutes}}{{/isDayStart}}{{#isDayStart}}{{dayOfMonth}} {{shortMonthName}}{{/isDayStart}}', |
169 "Cms\\Message": "Message", |
169 "Cms\\Message": "Message", |
170 "Cms\\Rule": "Règle", |
170 "Cms\\Rule": "Règle", |
171 "Cms\\Video": "Vidéo", |
171 "Cms\\Video": "Vidéo", |
172 "Cms\\SweetCadaver": "Cadavre exquis" |
172 "Cms\\SweetCadaver": "Cadavre exquis" |
173 }, |
173 }, |
174 maxtime: false |
174 maxtime: false, |
|
175 url_base: "" |
175 } |
176 } |
176 |
177 |
177 for (var _i = 0; _i < Tlns.Defaults.Timeline.timescales.length; _i++) { |
178 for (var _i = 0; _i < Tlns.Defaults.Timeline.timescales.length; _i++) { |
178 Tlns.Defaults.Timeline.timescales[_i].level = _i; |
179 Tlns.Defaults.Timeline.timescales[_i].level = _i; |
179 } |
180 } |
183 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>' |
184 + '<div class="Tl-BottomPart"><ul class="Tl-UniversLabels"></ul>' |
185 + '<div class="Tl-BottomPart"><ul class="Tl-UniversLabels"></ul>' |
185 + '<div class="Tl-MainPart"><div class="Tl-Occurrences"></div>' |
186 + '<div class="Tl-MainPart"><div class="Tl-Occurrences"></div>' |
186 + '</div>' |
187 + '</div>' |
187 + '<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 class="Tl-Overlay-Tip-Bottom"></div></div></div></div></div></div>' |
|
189 + '<div class="Tl-Details"></div>' |
188 |
190 |
189 Tlns.Templates.Univers = '<div class="Tl-UniversText">{{title}}</div>'; |
191 Tlns.Templates.Univers = '<div class="Tl-UniversText">{{title}}</div>'; |
190 |
192 |
191 Tlns.Templates.Occurrence = |
193 Tlns.Templates.Occurrence = |
192 '{{#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;">' |
194 + '</div>{{/occurrences}}'; |
196 + '</div>{{/occurrences}}'; |
195 |
197 |
196 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><p class="Tl-Tooltip-Date">{{formatted_date}} — {{translated_status}} — {{format}}</p>' |
197 + '<p class="Tl-Tooltip-Description">{{description}}</p>' |
199 + '<p class="Tl-Tooltip-Description">{{description}}</p>' |
198 // + '<p class="Tl-Tooltip-Characters">{{univers.mainCharacter}}{{#characters}}, {{.}}{{/characters}}</p>' |
200 // + '<p class="Tl-Tooltip-Characters">{{univers.mainCharacter}}{{#characters}}, {{.}}{{/characters}}</p>' |
|
201 |
|
202 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>' |
|
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>'; |
199 |
205 |
200 /* Classes */ |
206 /* Classes */ |
201 |
207 |
202 Tlns.Classes.Timeline = function(_options) { |
208 Tlns.Classes.Timeline = function(_options) { |
203 |
209 |
514 if (!_this.editing_occurrence.editing) { |
520 if (!_this.editing_occurrence.editing) { |
515 _(_this.occurrences).each(function(_occ) { |
521 _(_this.occurrences).each(function(_occ) { |
516 _occ.editing = false; |
522 _occ.editing = false; |
517 }); |
523 }); |
518 _this.editing_occurrence.editing = true; |
524 _this.editing_occurrence.editing = true; |
|
525 _this.$.find(".Tl-Details").html(Mustache.to_html(Tlns.Templates.OccurrenceDetails, _this.editing_occurrence)); |
519 } |
526 } |
520 _this.throttledDrawGrid(); |
527 _this.throttledDrawGrid(); |
521 } |
528 } |
522 }).mouseover(function(_event) { |
529 }).mouseover(function(_event) { |
523 var _el = $(this), |
530 var _el = $(this), |
618 } |
625 } |
619 } |
626 } |
620 this.format = this.timeline.class_labels[this.type]; |
627 this.format = this.timeline.class_labels[this.type]; |
621 if (_data.contentHasMedias && _data.contentHasMedias.length) { |
628 if (_data.contentHasMedias && _data.contentHasMedias.length) { |
622 this.image = _data.contentHasMedias[0].media.cinema.replace(/cinema\/[\d]+\/[\d]+/,'cinema/85/38'); |
629 this.image = _data.contentHasMedias[0].media.cinema.replace(/cinema\/[\d]+\/[\d]+/,'cinema/85/38'); |
|
630 this.detail_image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/135/135'); |
623 } |
631 } |
624 this.translated_status = Tlns.Defaults.Timeline.statuses[this.status]; |
632 this.translated_status = Tlns.Defaults.Timeline.statuses[this.status]; |
625 // this.published = (_data.publication && _data.publication == "En ligne"); |
633 // this.published = (_data.publication && _data.publication == "En ligne"); |
626 // this.locked = _data.verrouille || false; |
634 // this.locked = _data.verrouille || false; |
627 // this.characters = _data.personnagesSecondaires || []; |
635 // this.characters = _data.personnagesSecondaires || []; |
628 var _tmp = $('<p>').html(_data.resume || ""); |
636 var _tmp = $('<p>').html(_data.resume || ""); |
629 this.description = _tmp.text().trim().replace(/(\n|\r|\r\n)/mg,' ').replace(/(^.{60,80})[\s].+$/m,'$1…'); |
637 var trimmedDesc = _tmp.text().trim().replace(/(\n|\r|\r\n)/mg,' '); |
|
638 this.description = trimmedDesc.replace(/(^.{60,80})[\s].+$/m,'$1…'); |
|
639 this.detail_description = trimmedDesc.replace(/(^.{360,380})[\s].+$/m,'$1…'); |
|
640 this.url = this.timeline.url_base + _data.url; |
630 } |
641 } |
631 |
642 |
632 Tlns.Classes.Occurrence.prototype.addDependency = function(_id) { |
643 Tlns.Classes.Occurrence.prototype.addDependency = function(_id) { |
633 if (_(this.dependsOn).indexOf(_id) == -1) { |
644 if (_(this.dependsOn).indexOf(_id) == -1) { |
634 this.dependsOn.push(_id); |
645 this.dependsOn.push(_id); |