# HG changeset patch # User veltr # Date 1379612069 -7200 # Node ID 7d1c2c21d8914036a9c5b2145b1c509ab3576c38 # Parent 907a53a35a95ca6cf978a952d2be69006ef99a24 Added pictos diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/css/base.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/timeline/css/base.css Thu Sep 19 19:34:29 2013 +0200 @@ -0,0 +1,55 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} + +ul, li { + list-style: none; +} + +input::-moz-focus-inner /*Remove button padding in FF*/ +{ + border: 0; + padding: 0; +} + +table { + border-collapse: separate; border-spacing: 0; +} + +th, td { + vertical-align: top; +} + +img a { + border: none; +} + +body { + font-size: 10px; font-family: Arial, Helvetica, sans-serif; +} + +/* FRONT PAGE SPECIFIC */ + +h1 { + text-align: center; font-size: 20px; font-weight: bold; margin: 5px; +} +#timeline { + width: 780px; margin: 5px auto; text-align: center; +} \ No newline at end of file diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/css/timeline.css --- a/timeline/css/timeline.css Wed Sep 04 18:23:51 2013 +0200 +++ b/timeline/css/timeline.css Thu Sep 19 19:34:29 2013 +0200 @@ -1,52 +1,3 @@ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} - -ul, li { - list-style: none; -} - -input::-moz-focus-inner /*Remove button padding in FF*/ -{ - border: 0; - padding: 0; -} - -table { - border-collapse: separate; border-spacing: 0; -} - -th, td { - vertical-align: top; -} - -img a { - border: none; -} - -body { - font-size: 10px; font-family: Arial, Helvetica, sans-serif; -} - -/************************************************/ - .Tl-Main { font-family: Arial, Helvetica, sans-serif; text-align: left; position: relative; @@ -123,7 +74,7 @@ } .Tl-Occurrence { - width: 38px; height: 38px; cursor: pointer; border: 2px solid rgba(255,255,255,.9); + width: 32px; height: 32px; cursor: pointer; border: 2px solid rgba(255,255,255,.9); } .Tl-Occurrence img { diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/img/flash.png Binary file timeline/img/flash.png has changed diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/img/previously.png Binary file timeline/img/previously.png has changed diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/img/regle.png Binary file timeline/img/regle.png has changed diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/img/roman.png Binary file timeline/img/roman.png has changed diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/img/sondage.png Binary file timeline/img/sondage.png has changed diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/img/struggle.png Binary file timeline/img/struggle.png has changed diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/img/temoignage.png Binary file timeline/img/temoignage.png has changed diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/js/timeline.js --- a/timeline/js/timeline.js Wed Sep 04 18:23:51 2013 +0200 +++ b/timeline/js/timeline.js Thu Sep 19 19:34:29 2013 +0200 @@ -119,8 +119,14 @@ height : 225, min_width : 400, min_height : 100, - main_width : 700, - linelabels : [], + main_width : 726, + linelabels : [ + "RDV", + "Actu", + "Appels", + "Persos" + ], + picto_url: "img/", timescales : [{ label : "Semaine", span : 7 * 86400 * 1000, @@ -154,22 +160,58 @@ occurrences: [], grid_spacing: 12, tooltip_date_format: '{{dayOfMonth}} {{shortMonthName}} {{year}} {{0hours}}:{{0minutes}}', - statuses: { - "valide": "Validée", - "a_valider": "A valider", - "a_realiser": "A réaliser" - }, - class_labels: { - "Cms\\Previously": "Précédemment", - "Cms\\Chapter": "Chapitre", - "Cms\\Article": "Article", - "Cms\\Poll": "Sondage", - "Cms\\CallWitness": "Appel à Témoins", - "Cms\\CallCharacter": "Appel à Personnage", - "Cms\\Message": "Message", - "Cms\\Rule": "Règle", - "Cms\\Video": "Vidéo", - "Cms\\SweetCadaver": "Cadavre exquis" + class_info: { + "Cms\\Previously": { + label: "Précédemment", + univers_id: 0, + picto: "previously.png", + show: true + }, + "Cms\\Chapter": { + label: "Roman", + univers_id: 0, + picto: "roman.png", + show: true + }, + "Cms\\FlashTrash": { + label: "JT", + univers_id: 0, + picto: "flash.png", + show: true + }, + "Cms\\Article": { + label: "Article", + univers_id: 1, + show: true + }, + "Cms\\Poll": { + label: "Sondage", + univers_id: 2, + picto: "sondage.png", + show: true + }, + "Cms\\CallWitness": { + label: "Appel à Témoins", + univers_id: 2, + picto: "temoignage.png", + show: true + }, + "Cms\\Rule": { + label: "Règle du jour", + univers_id: 2, + picto: "regle.png", + show: true + }, + "Cms\\CallCharacter": { + label: "Appel à Personnage", + univers_id: 3, + show: true + }, + "Cms\\SweetCadaver": { + label: "Cadavre exquis", + univers_id: 3, + show: true + } }, maxtime: false, url_base: "" @@ -191,7 +233,7 @@ Tlns.Templates.Univers = '
{{title}}
'; Tlns.Templates.Occurrence = - '{{#occurrences}}
' + '{{#occurrences}}
' + '{{#image}}{{/image}}' + '
{{/occurrences}}'; @@ -434,23 +476,14 @@ Tlns.Classes.Timeline.prototype.createOrUpdateOccurrence = function(_data) { var _id = _data.id, - _occurrence = this.getOccurrence(_id); - switch (_data.__CLASS__) { - case "Cms\\Previously": - case "Cms\\Chapter": - case "Cms\\Article": - case "Cms\\Video": - case "Cms\\Poll": - case "Cms\\Rule": - case "Cms\\CallWitness": - case "Cms\\CallCharacter": - case "Cms\\SweetCadaver": - if (typeof _occurrence === "undefined") { - _occurrence = new Tlns.Classes.Occurrence(this); - this.occurrences.push(_occurrence); - } - _occurrence.update(_data); - break; + _occurrence = this.getOccurrence(_id), + typeinfo = this.class_info[_data.__CLASS__]; + if (typeinfo && typeinfo.show) { + if (typeof _occurrence === "undefined") { + _occurrence = new Tlns.Classes.Occurrence(this); + this.occurrences.push(_occurrence); + } + _occurrence.update(_data); } return _occurrence; } @@ -476,10 +509,10 @@ _occ.x = _this.current_scale * (_occ.date - _this.start_time); _occ.y = _occ.univers.y; }); - var minT = this.timeFromX(-38), + var minT = this.timeFromX(-32), minI = this.timescales[this.level].min_importance; var _visible = _(this.occurrences).filter(function(_occ) { - return (_occ.date >= minT && _occ.date <= _this.end_time && _occ.status && (_occ.importance >= minI)); + return (_occ.date >= minT && _occ.date <= _this.end_time && (_occ.importance >= minI)); }); var _moved = true, l = 0; @@ -587,48 +620,17 @@ this.title = _data.title; this.type = _data.__CLASS__; this.importance = _data.importance; - switch(_data.__CLASS__) { - case "Cms\\Previously": - case "Cms\\Chapter": - case "Cms\\Video": - this.univers_id = 0; - break; - case "Cms\\Article": - this.univers_id = 1; - break; - case "Cms\\Poll": - case "Cms\\Rule": - case "Cms\\CallWitness": - this.univers_id = 2; - break; - case "Cms\\CallCharacter": - case "Cms\\SweetCadaver": - this.univers_id = 3; - break; + var typeinfo = this.timeline.class_info[_data.__CLASS__]; + this.univers_id = typeinfo.univers_id; + if (_data.contentHasMedias && _data.contentHasMedias.length) { + this.image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/32/32'); + this.detail_image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/135/135'); + } + if (typeinfo.picto) { + this.image = this.timeline.picto_url + typeinfo.picto; } this.univers = this.timeline.univers[this.univers_id]; - if (typeof _data.statut !== "undefined" || typeof this.status === "undefined") { - switch(_data.statut) { - case "Validée": - case "valide": - this.status = "valide" - break; - case "A réaliser": - case "a_realiser": - this.status = "a_realiser"; - break; - case "A valider": - case "a_valider": - default: - this.status = "a_valider"; - } - } - this.format = this.timeline.class_labels[this.type]; - if (_data.contentHasMedias && _data.contentHasMedias.length) { - this.image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/38/38'); - this.detail_image = _data.contentHasMedias[0].media.carre.replace(/carre\/[\d]+\/[\d]+/,'carre/135/135'); - } - this.translated_status = Tlns.Defaults.Timeline.statuses[this.status]; + this.format = typeinfo.label; // this.published = (_data.publication && _data.publication == "En ligne"); // this.locked = _data.verrouille || false; // this.characters = _data.personnagesSecondaires || []; diff -r 907a53a35a95 -r 7d1c2c21d891 timeline/timeline.html --- a/timeline/timeline.html Wed Sep 04 18:23:51 2013 +0200 +++ b/timeline/timeline.html Thu Sep 19 19:34:29 2013 +0200 @@ -7,14 +7,9 @@ + @@ -32,17 +27,12 @@ _tl = new Tlns.Classes.Timeline({ email: 'anarchy@solicis.fr', token: token, - linelabels: [ - "Les jalons de l'histoire", - "L'actualité", - "Les appels à contribuer", - "Les Persos d'Anarchy" - ], api_endpoint: "http://anarchy2.solicis.fr/api/cms/content?callback=?", container: "timeline", sync_now: false, - central_time: Date.parse("2013-07-18T00:00:00Z"), + central_time: Date.now(),//Date.parse("2013-07-18T00:00:00Z"), maxtime: Date.now(), + picto_url: "img/", url_base: "http://anarchy2.solicis.fr" }); });