# HG changeset patch # User Chloe Laisne # Date 1476640197 -19800 # Node ID 766af1228b05dcaedef5290e49a1a842aa28835a # Parent 4a3899b6a7edfce0c31e3d9a07e0368497f804a2# Parent 8a29098c8273b56910ad735a67e3bbd3a400fe52 Merge diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/components/notice-component.js --- a/cms/app-client/app/components/notice-component.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/components/notice-component.js Sun Oct 16 23:19:57 2016 +0530 @@ -3,6 +3,7 @@ export default Ember.Component.extend({ player: Ember.inject.service(), + filter: Ember.inject.service(), classNames: ['notice-component'], @@ -61,8 +62,12 @@ actions: { - close: function() { - this.set('model', null); + addThemeFilter: function(id) { + this.get('filter').set('theme', id); + }, + + addLanguageFilter: function(id) { + this.get('filter').set('language', id); } } diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/components/playlist-component.js --- a/cms/app-client/app/components/playlist-component.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/components/playlist-component.js Sun Oct 16 23:19:57 2016 +0530 @@ -20,6 +20,22 @@ } }).on('init'), + playerItemObserver: Ember.observer('player.item', function() { + if(this.$() && this.get('player').get('item')) { + var ul = this.$().find('ul'); + var li = this.$().find('li#' + this.get('player').get('item').replace('.', '\\.').replace('/', '\\/')); + if(li.offset().top - ul.offset().top < 0) { + ul.animate({ + 'scrollTop': ul.scrollTop() + li.offset().top - ul.offset().top + }); + } else if(li.offset().top + li.outerHeight() - ul.offset().top > ul.outerHeight()) { + ul.animate({ + 'scrollTop': ul.scrollTop() + li.offset().top + li.outerHeight() - ul.offset().top - ul.height() + }); + } + } + }), + init: function() { this._super(...arguments); }, @@ -48,14 +64,10 @@ }, displayNotice: function(id) { - if(this.get('player').get('item') === id) { + if(this.get('player').get('window') !== 'notice') { this.get('player').displayMetadata('notice'); } else { - if(this.get('notice') !== id) { - this.set('notice', id); - } else { - this.set('notice', null); - } + this.get('player').displayMetadata(false); } } diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/components/sorting-component.js --- a/cms/app-client/app/components/sorting-component.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/components/sorting-component.js Sun Oct 16 23:19:57 2016 +0530 @@ -19,9 +19,11 @@ this.$('ul').on('scroll', Ember.run.bind(this, this.scrolling)); }), scrolling: function(event) { - if(Ember.$(event.target).scrollTop() + Ember.$(event.target).height() > Ember.$(event.target).get(0).scrollHeight - 50) { - this.triggerAction({ action:'loadMore', target: this }); - Ember.$(event.target).off('scroll'); + if(Ember.$(event.target).scrollTop() !== 0 ) { + if(Ember.$(event.target).scrollTop() + Ember.$(event.target).height() > Ember.$(event.target).get(0).scrollHeight - 50) { + this.triggerAction({ action:'loadMore', target: this }); + Ember.$(event.target).off('scroll'); + } } }, diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/components/visu-carto.js --- a/cms/app-client/app/components/visu-carto.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/components/visu-carto.js Sun Oct 16 23:19:57 2016 +0530 @@ -4,6 +4,8 @@ export default Ember.Component.extend({ + constants: Ember.inject.service(), + map: null, continentsMapVar: AmCharts.maps.continentsLow, @@ -21,7 +23,7 @@ filter: Ember.inject.service(), locationObserver: Ember.observer('filter.location', function() { if(!this.get('filter').get('location')) { - this.sendAction('setLocation', '6295630'); + this.sendAction('setLocation', this.get('constants').GEONAMES['world']); } }), @@ -30,7 +32,7 @@ if(this.get('map')) { if(this.get('map').selectedObject.id) { if(this.get('map').selectedObject.parentObject.mapVar === this.get('countriesMapVar')) { - if(this.get('map').selectedObject.id === '3017382') { + if(this.get('map').selectedObject.id === this.get('constants').GEONAMES['france']) { this.setFranceAreas(); this.set('dataProvider', { 'mapVar': this.get('franceMapVar'), diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/controllers/application.js --- a/cms/app-client/app/controllers/application.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/controllers/application.js Sun Oct 16 23:19:57 2016 +0530 @@ -22,7 +22,9 @@ filter: Ember.inject.service(), setFilter: Ember.observer('discourse', 'language', 'location', 'theme', function(sender, key) { - this.get('filter').set(key, this.get(key)); + if(this.get('filter').get(key) !== this.get(key)) { + this.get('filter').set(key, this.get(key)); + } }), filterObserver: Ember.observer('filter.discourse', 'filter.language', 'filter.location', 'filter.theme', function(sender, key) { key = key.split('.').pop(); diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/router.js --- a/cms/app-client/app/router.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/router.js Sun Oct 16 23:19:57 2016 +0530 @@ -10,9 +10,11 @@ didTransition:function() { this.get('player').toggleVideoscreen(false); - this.get('player').displayMetadata(false); + this.get('player').displayMetadata(this.get('player').get('window')); + this._super(...arguments); } + }); Router.map(function() { diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/routes/tabs/carto.js --- a/cms/app-client/app/routes/tabs/carto.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/routes/tabs/carto.js Sun Oct 16 23:19:57 2016 +0530 @@ -2,7 +2,16 @@ export default Ember.Route.extend({ - modelQueryParam: '6295630', + constants: Ember.inject.service(), + player: Ember.inject.service(), + + modelQueryParam: '', + + init: function() { + this._super(...arguments); + + this.set('modelQueryParam', this.get('constants').GEONAMES['world']); + }, model: function() { return this.store.query('geostat', { @@ -11,8 +20,12 @@ }); }, + activate: function() { + this.get('player').set('window', false); + }, + deactivate: function () { - this.set('modelQueryParam', '6295630'); + this.set('modelQueryParam', this.get('constants').GEONAMES['world']); }, setupController: function(controller) { diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/routes/tabs/chrono.js --- a/cms/app-client/app/routes/tabs/chrono.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/routes/tabs/chrono.js Sun Oct 16 23:19:57 2016 +0530 @@ -1,4 +1,11 @@ import Ember from 'ember'; export default Ember.Route.extend({ + + player: Ember.inject.service(), + + activate: function() { + this.get('player').set('window', false); + } + }); diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/routes/tabs/discours.js --- a/cms/app-client/app/routes/tabs/discours.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/routes/tabs/discours.js Sun Oct 16 23:19:57 2016 +0530 @@ -1,4 +1,11 @@ import Ember from 'ember'; export default Ember.Route.extend({ + + player: Ember.inject.service(), + + activate: function() { + this.get('player').set('window', false); + } + }); \ No newline at end of file diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/routes/tabs/thematiques.js --- a/cms/app-client/app/routes/tabs/thematiques.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/routes/tabs/thematiques.js Sun Oct 16 23:19:57 2016 +0530 @@ -2,6 +2,8 @@ export default Ember.Route.extend({ + player: Ember.inject.service(), + index: 0, limit: 40, sort: 'alphabetical', @@ -29,6 +31,14 @@ controller.set('themes', this.get('themes')); }, + deactivate: function () { + this.set('themes', []); + }, + + activate: function() { + this.get('player').set('window', false); + }, + actions: { setIndexQueryparams: function() { @@ -37,11 +47,15 @@ setSortQueryparams: function(sort) { this.set('sort', sort); - this.get('themes').replaceContent(0, this.get('themes').get('content').length, null); - // Force property reset to trigger request. - this.propertyWillChange('index'); - this.set('index', 0); - this.propertyDidChange('index'); + this.get('themes').get('content').clear(); + if(this.get('index') === 0) { + // Force property reset to trigger request + this.propertyWillChange('index'); + this.set('index', 0); + this.propertyDidChange('index'); + } else { + this.set('index', 0); + } } } diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/services/constants.js --- a/cms/app-client/app/services/constants.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/services/constants.js Sun Oct 16 23:19:57 2016 +0530 @@ -1,5 +1,10 @@ import Ember from 'ember'; +const GEONAMES = { + 'world': '6295630', + 'france': '3017382' +}; + const OLAC_ROLES = { 'http://www.language-archives.org/OLAC/1.1/annotator': 'bo.olac_role_annotator', 'http://www.language-archives.org/OLAC/1.1/author': 'bo.olac_role_author', @@ -310,6 +315,7 @@ OLAC_ROLES: OLAC_ROLES, DISCOURSE_CATEGORY_KEYS: DISCOURSE_CATEGORY_KEYS, DISCOURSE_CATEGORY_VALUES: DISCOURSE_CATEGORY_VALUES, + GEONAMES: GEONAMES, KEY_CODES: KEY_CODES, VIAF_BASE_URL: "http://viaf.org/viaf/", LEXVO_BASE_URL: "http://lexvo.org/id/iso639-3/", diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/services/player.js --- a/cms/app-client/app/services/player.js Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/services/player.js Sun Oct 16 23:19:57 2016 +0530 @@ -20,12 +20,16 @@ if(el === 'video') { this.toggleVideoscreen(); } else { - this.displayMetadata(el); + if(this.get('window') !== el) { + this.displayMetadata(el); + } else { + this.displayMetadata(false); + } } }, displayMetadata: function(el) { - if(this.get('window') !== el) { + if(typeof el !== 'undefined') { this.set('window', el); } else { this.set('window', false); diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/styles/components/notice-component.scss --- a/cms/app-client/app/styles/components/notice-component.scss Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/styles/components/notice-component.scss Sun Oct 16 23:19:57 2016 +0530 @@ -7,11 +7,27 @@ color: $dark-grey; } -.notice-component a { +.notice-component a.fa { + text-decoration: none; + color: inherit; + font-size: 0px; + margin-left: 5px; +} + +.notice-component a.fa:before { + font-size: 12px; +} + +.notice-component .action { + cursor: pointer; +} + +.notice-component a.doc-link-bnf, +.notice-component a.doc-link-lexvo { cursor: pointer; color: $dark-grey; text-decoration: none; - border-bottom: 1px dashed $dark-grey; + pointer-events: none; } .notice-component .language a { diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/styles/components/player-component.scss --- a/cms/app-client/app/styles/components/player-component.scss Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/styles/components/player-component.scss Sun Oct 16 23:19:57 2016 +0530 @@ -203,15 +203,18 @@ margin: 0 auto; } -.player-component #audio .controls.extra i.fa-bars { +.player-component #audio .controls.extra i.fa-text-height { position: relative; + overflow: hidden; + display: inline-block; + width: 16px; } -.player-component #audio .controls.extra i.fa-bars::before { +.player-component #audio .controls.extra i.fa-text-height::before { font-size: 21px; } -.player-component #audio .controls.extra i.fa-bars.active::before { +.player-component #audio .controls.extra i.fa-text-height.active::before { color: $blue; } diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/styles/components/playlist-component.scss --- a/cms/app-client/app/styles/components/playlist-component.scss Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/styles/components/playlist-component.scss Sun Oct 16 23:19:57 2016 +0530 @@ -18,6 +18,7 @@ font-size: 0px; overflow-y: scroll; background-color: $light-white; + position: relative; } .playlist-component ul li { @@ -47,9 +48,14 @@ float: right; text-align: right; font-size: 0px; + margin-left: 20px; } -.playlist-component ul li .tools button, +.playlist-component ul li .tools > * { + clear: both; +} + +.playlist-component ul li .tools .notice, .playlist-component ul li .tools .fa { border: 1px solid $dark-grey; cursor: pointer; @@ -57,56 +63,54 @@ pointer-events: all; } -.playlist-component ul li.playing .tools button, +.playlist-component ul li.playing .tools .notice, .playlist-component ul li.playing .tools .fa { border-color: $medium-blue; } -.playlist-component ul li.notice .tools button, +.playlist-component ul li.notice .tools .notice, .playlist-component ul li.notice .tools .fa { border-color: $dark-grey; } -.playlist-component ul li .tools button.active, -.playlist-component ul li .tools button:hover, +.playlist-component ul li .tools .notice.active, +.playlist-component ul li .tools .notice:hover, .playlist-component ul li .tools .fa:hover { background-color: $dark-grey; color: $light-white; } -.playlist-component ul li.playing .tools button.active, -.playlist-component ul li.playing .tools button:hover, +.playlist-component ul li .tools .fa.active, +.playlist-component ul li.playing .tools .notice.active, +.playlist-component ul li.playing .tools .notice:hover, .playlist-component ul li.playing .tools .fa:hover { background-color: $medium-blue; color: $light-blue; } -.playlist-component ul li.playing .tools button:hover, +.playlist-component ul li.playing .tools .notice:hover, .playlist-component ul li.playing .tools .fa:hover { color: $light-blue; } -.playlist-component ul li:not(.playing) .fa-bars { +.playlist-component ul li:not(.playing) .notice, +.playlist-component ul li:not(.playing) .fa-share-alt, +.playlist-component ul li:not(.playing) .fa-text-height { pointer-events: none; cursor: default; opacity: 0.5; } -.playlist-component ul li .meta { - padding-right: 78px; -} - .playlist-component ul li .meta p { margin: 0; } -.playlist-component ul li .tools button { +.playlist-component ul li .tools .notice { font-size: 12px; background-color: transparent; line-height: 20px; padding: 0 10px; margin-top: 10px; - display: block; width: 68px; } @@ -120,6 +124,11 @@ display: inline-block; } +.playlist-component ul li .tools .fa-play, +.playlist-component ul li .tools .fa-pause { + float: right; +} + .playlist-component ul li .tools .fa-play::before { margin-left: 3px; } @@ -145,12 +154,15 @@ float: right; } -.playlist-component ul li .title .fa-bars { - margin-right: 10px; +.playlist-component ul li .fa-text-height { + } -.playlist-component ul li .title .fa-bars::before { - font-size: 14px; +.playlist-component ul li .fa-text-height::before { + font-size: 13px; + display: inline-block; + overflow: hidden; + width: 10px; } .playlist-component ul li .language a { diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/styles/components/toolbar-component.scss --- a/cms/app-client/app/styles/components/toolbar-component.scss Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/styles/components/toolbar-component.scss Sun Oct 16 23:19:57 2016 +0530 @@ -32,5 +32,6 @@ .toolbar-component ul li.active { border-left-color: $dark-blue; background-color: $light-white; + pointer-events: none; color: $dark-blue; } \ No newline at end of file diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/templates/application.hbs --- a/cms/app-client/app/templates/application.hbs Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/templates/application.hbs Sun Oct 16 23:19:57 2016 +0530 @@ -2,12 +2,6 @@
- {{#if notice}} -
- {{ notice-component class="overlay" model=noticeModel }} -
- {{/if}} -
{{#if player.window}} {{#if (eq player.window 'notice')}} diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/templates/components/notice-component.hbs --- a/cms/app-client/app/templates/components/notice-component.hbs Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/templates/components/notice-component.hbs Sun Oct 16 23:19:57 2016 +0530 @@ -1,7 +1,3 @@ -{{#if model}} -Close -{{/if}} -

Notice

{{ item.title }}

@@ -17,7 +13,7 @@ - + @@ -26,9 +22,12 @@ {{#each subjects as |subject|}}
  • {{#if subject.url}} - - {{#if subject.name}}{{subject.name}}{{else}}{{component (getLinkType subject.url) url=subject.url}}{{/if}} - + {{#if subject.name}} + {{subject.name}} + {{else}} + {{component (getLinkType subject.url) url=subject.url}} + {{/if}} + Share {{else}} {{subject.name}} {{/if}} diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/templates/components/player-component.hbs --- a/cms/app-client/app/templates/components/player-component.hbs Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/templates/components/player-component.hbs Sun Oct 16 23:19:57 2016 +0530 @@ -22,7 +22,7 @@ {{/if}} {{/if}} {{#if player.transcript}} - Transcript + Transcript {{/if}}
    diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/templates/components/playlist-component.hbs --- a/cms/app-client/app/templates/components/playlist-component.hbs Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/templates/components/playlist-component.hbs Sun Oct 16 23:19:57 2016 +0530 @@ -3,15 +3,22 @@ {{#each documents as |document| }}
  • +
    {{#if document.transcript_url}} - Transcript + Transcript {{/if}} {{#if (ifAnd (eq player.playing true) (eq player.item document.id))}} - Pause + Pause {{else}} - Play + Play {{/if}} - Notice +
    +
    + + Share notice +

    diff -r 8a29098c8273 -r 766af1228b05 cms/app-client/app/templates/components/transcript-component.hbs --- a/cms/app-client/app/templates/components/transcript-component.hbs Fri Oct 14 01:28:34 2016 +0200 +++ b/cms/app-client/app/templates/components/transcript-component.hbs Sun Oct 16 23:19:57 2016 +0530 @@ -13,7 +13,9 @@

      {{#each annotations as |annotation|}}
    1. + {{#unless (if-and (if-operator player.progress '>=' annotation.begin) (if-operator player.progress '<' annotation.end))}} Play + {{/unless}} {{#if annotation.title}}{{annotation.title}}{{/if}} {{#each annotation.fragments as |fragment|}}
  • Langue{{#each item.languages as |lang index|}}{{if index ", "}}{{doc-language url=lang class="language"}}{{/each}}{{#each item.languages as |lang index|}}{{if index ", "}}{{ doc-language url=lang class="language"}}Share{{/each}}
    Sujet{{#if (if-operator item.computedSubjects.length '>' 1)}}s{{/if}}