Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e4794aec1 | ||
|
|
54c815ded4 | ||
|
|
6fddfcc64c | ||
|
|
a8c2ce1d3c | ||
|
|
36829fbe5c | ||
|
|
4fcddebc73 | ||
|
|
bd66c260fa | ||
|
|
1e9ff928df | ||
|
|
25fce000bc | ||
|
|
cfbfbebd76 | ||
|
|
8ea7ffeea2 | ||
|
|
e32c4fab75 | ||
|
|
1005117b72 | ||
|
|
7c5bc8e053 | ||
|
|
4cb1ded556 | ||
|
|
6fb9824380 | ||
|
|
62de7f6b06 | ||
|
|
eb19a2f6b3 | ||
|
|
f19d9445a8 | ||
|
|
180b98274b | ||
|
|
3b6f9cbd98 | ||
|
|
7246675e32 | ||
|
|
46bc4b6423 | ||
|
|
4a85f75e53 | ||
|
|
2e73cacb27 | ||
|
|
1081ca49a6 | ||
|
|
fdcb29a4f9 | ||
|
|
af35857e79 | ||
|
|
a3f3c1e960 | ||
|
|
8b4d7ea685 | ||
|
|
55f7def7cb | ||
|
|
4d89162957 |
@@ -1,5 +1,5 @@
|
||||
buttons_size: 20
|
||||
additional_html: "<a class=\"a2a_button_facebook\"></a>\r\n<a class=\"a2a_button_twitter\"></a>\r\n<a class=\"a2a_button_reddit\"></a>\r\n<a class=\"a2a_button_email\"></a>\r\n"
|
||||
buttons_size: 17
|
||||
additional_html: "<a class=\"a2a_button_facebook\"></a>\r\n<a class=\"a2a_button_twitter\"></a>\r\n<a class=\"a2a_button_email\"></a>\r\n"
|
||||
additional_css: '.a2a_svg { border-radius: 0 !important; }'
|
||||
additional_js: "a2a_config.icon_color = \"#fff,#1A1A1A\";\r\na2a_config.templates.email = {\r\n subject: \"Encyclopédie de la parole - ${title}\",\r\n body: \"Encyclopédie de la parole\\n${link}\"\r\n};"
|
||||
universal_button: none
|
||||
|
||||
@@ -24,6 +24,7 @@ visibility:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
expo_encyclopediedelaparole_org: expo_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping:
|
||||
'entity:domain': '@domain.current_domain_context:entity:domain'
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- edlp_search
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -17,4 +18,11 @@ settings:
|
||||
label: 'Edlp search link block'
|
||||
provider: edlp_search
|
||||
label_display: '0'
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- system
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -22,4 +23,11 @@ settings:
|
||||
use_site_logo: true
|
||||
use_site_name: true
|
||||
use_site_slogan: true
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- system
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -11,7 +12,7 @@ _core:
|
||||
id: edlptheme_content
|
||||
theme: edlptheme
|
||||
region: content
|
||||
weight: -2
|
||||
weight: -5
|
||||
provider: null
|
||||
plugin: system_main_block
|
||||
settings:
|
||||
@@ -19,4 +20,12 @@ settings:
|
||||
label: 'Main page content'
|
||||
provider: system
|
||||
label_display: '0'
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping:
|
||||
'entity:domain': '@domain.current_domain_context:entity:domain'
|
||||
|
||||
@@ -28,7 +28,6 @@ visibility:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping:
|
||||
'entity:domain': '@domain.current_domain_context:entity:domain'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
uuid: 85586498-0023-422f-a6b2-19db835228b3
|
||||
langcode: en
|
||||
status: false
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
@@ -22,6 +22,6 @@ visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
uuid: c9f90b2a-6eb4-49ec-a5d0-38e824469041
|
||||
langcode: en
|
||||
status: true
|
||||
status: false
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
|
||||
@@ -5,6 +5,7 @@ dependencies:
|
||||
config:
|
||||
- system.menu.main
|
||||
module:
|
||||
- domain
|
||||
- domain_menu_access
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -21,5 +22,12 @@ settings:
|
||||
label_display: visible
|
||||
level: '1'
|
||||
depth: '0'
|
||||
expand_all_items: false
|
||||
visibility: { }
|
||||
expand_all_items: 0
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -9,7 +9,7 @@ dependencies:
|
||||
id: messages
|
||||
theme: edlptheme
|
||||
region: content
|
||||
weight: -4
|
||||
weight: -7
|
||||
provider: null
|
||||
plugin: system_messages_block
|
||||
settings:
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- edlp_studio
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -17,4 +18,11 @@ settings:
|
||||
label: 'Studio link block'
|
||||
provider: edlp_studio
|
||||
label_display: '0'
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- edlp_studio
|
||||
theme:
|
||||
- edlptheme
|
||||
@@ -17,4 +18,11 @@ settings:
|
||||
label: 'Studio User login'
|
||||
provider: edlp_studio
|
||||
label_display: visible
|
||||
visibility: { }
|
||||
visibility:
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -3,6 +3,7 @@ langcode: fr
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- domain
|
||||
- node
|
||||
- user
|
||||
theme:
|
||||
@@ -10,7 +11,7 @@ dependencies:
|
||||
id: tabs
|
||||
theme: edlptheme
|
||||
region: content
|
||||
weight: -3
|
||||
weight: -6
|
||||
provider: null
|
||||
plugin: local_tasks_block
|
||||
settings:
|
||||
@@ -39,3 +40,10 @@ visibility:
|
||||
negate: false
|
||||
context_mapping:
|
||||
user: '@user.current_user_context:current_user'
|
||||
domain:
|
||||
id: domain
|
||||
domains:
|
||||
encyclopediedelaparole_org: encyclopediedelaparole_org
|
||||
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
|
||||
negate: false
|
||||
context_mapping: { }
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
uuid: 1b44e5e7-bba8-4a19-9063-535e4ee09615
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: expo_encyclopediedelaparole_org
|
||||
domain_id: 110224
|
||||
hostname: expo.encyclopediedelaparole.org
|
||||
name: 'Encyclopédie de la parole EXPO'
|
||||
scheme: https
|
||||
weight: 3
|
||||
is_default: false
|
||||
@@ -1,7 +1,7 @@
|
||||
allow_non_ascii: false
|
||||
www_prefix: false
|
||||
login_paths: /user/login\r\n/user/password
|
||||
css_classes: ''
|
||||
css_classes: 'domain-[domain:id] domain-[domain:machine-name]'
|
||||
_core:
|
||||
default_config_hash: cGy1RN-NwgFrdUwA-OY7bvwtQ6Nz6UxhenvnJ4Pp4-k
|
||||
langcode: fr
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: bf2e0afd-4ee3-4d84-910c-1a274091a092
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: beta_encyclopediedelaparole_org
|
||||
domain_id: encyclopediedelaparole_org
|
||||
pattern: beta.encyclopediedelaparole.org
|
||||
redirect: 0
|
||||
environment: development
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: 92fa7238-52c4-4bd3-b183-45cdb85a51eb
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: beta_m_encyclopediedelaparole_org
|
||||
domain_id: m_encyclopediedelaparole_org
|
||||
pattern: beta.m.encyclopediedelaparole.org
|
||||
redirect: 0
|
||||
environment: testing
|
||||
@@ -0,0 +1,9 @@
|
||||
uuid: cd1a12bc-5ff9-477c-bf94-cc05093961c6
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: dev_expo_encyclopediedelaparole_org
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
pattern: dev.expo.encyclopediedelaparole.org
|
||||
redirect: 0
|
||||
environment: local
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: 2b55dc7d-81c1-4074-918e-78833a72b2a2
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: edlp_figli_io
|
||||
domain_id: encyclopediedelaparole_org
|
||||
pattern: edlp.figli.io
|
||||
redirect: 0
|
||||
environment: testing
|
||||
@@ -1,9 +0,0 @@
|
||||
uuid: 3ea77fdb-0d81-4c7a-8cf4-1fc67c5538ab
|
||||
langcode: fr
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: edlp_m_figli_io
|
||||
domain_id: m_encyclopediedelaparole_org
|
||||
pattern: edlp.m.figli.io
|
||||
redirect: 0
|
||||
environment: development
|
||||
@@ -5,31 +5,24 @@ dependencies:
|
||||
config:
|
||||
- field.storage.node.body
|
||||
- field.storage.node.field_description
|
||||
- field.storage.node.field_entrees
|
||||
- field.storage.node.field_genres
|
||||
- field.storage.taxonomy_term.field_synonyms
|
||||
- field.storage.node.field_langues
|
||||
- field.storage.node.field_locuteurs
|
||||
- field.storage.node.field_transcript_trad
|
||||
- field.storage.node.field_transcript_vo
|
||||
- field.storage.node.field_entrees
|
||||
- field.storage.node.field_locuteurs
|
||||
- field.storage.node.field_workflow
|
||||
- field.storage.node.field_genres
|
||||
- field.storage.node.field_langues
|
||||
- field.storage.taxonomy_term.field_synonyms
|
||||
- search_api.server.edlp_db
|
||||
module:
|
||||
- taxonomy
|
||||
- search_api
|
||||
- node
|
||||
- search_api
|
||||
id: collection
|
||||
name: Collection
|
||||
description: ''
|
||||
read_only: false
|
||||
field_settings:
|
||||
node_grants:
|
||||
label: 'Node access information'
|
||||
property_path: search_api_node_grants
|
||||
type: string
|
||||
indexed_locked: true
|
||||
type_locked: true
|
||||
hidden: true
|
||||
body:
|
||||
label: Article
|
||||
datasource_id: 'entity:node'
|
||||
@@ -38,12 +31,6 @@ field_settings:
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.body
|
||||
title:
|
||||
label: Title
|
||||
datasource_id: 'entity:node'
|
||||
property_path: title
|
||||
type: text
|
||||
boost: !!float 3
|
||||
field_description:
|
||||
label: Description
|
||||
datasource_id: 'entity:node'
|
||||
@@ -53,6 +40,55 @@ field_settings:
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_description
|
||||
field_entrees:
|
||||
label: Entrée(s)
|
||||
datasource_id: 'entity:node'
|
||||
property_path: field_entrees
|
||||
type: integer
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_entrees
|
||||
field_genres:
|
||||
label: 'Genre(s) » Taxonomy term » Name'
|
||||
datasource_id: 'entity:node'
|
||||
property_path: 'field_genres:entity:name'
|
||||
type: text
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_genres
|
||||
module:
|
||||
- taxonomy
|
||||
- taxonomy
|
||||
field_langues:
|
||||
label: 'Langue(s) » Taxonomy term » Name'
|
||||
datasource_id: 'entity:node'
|
||||
property_path: 'field_langues:entity:name'
|
||||
type: text
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_langues
|
||||
module:
|
||||
- taxonomy
|
||||
- taxonomy
|
||||
field_locuteurs:
|
||||
label: Locuteur(s)
|
||||
datasource_id: 'entity:node'
|
||||
property_path: field_locuteurs
|
||||
type: integer
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_locuteurs
|
||||
field_synonyms:
|
||||
label: 'Genre(s) » Taxonomy term » Synonyms'
|
||||
datasource_id: 'entity:node'
|
||||
property_path: 'field_genres:entity:field_synonyms'
|
||||
type: text
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_genres
|
||||
- field.storage.taxonomy_term.field_synonyms
|
||||
module:
|
||||
- taxonomy
|
||||
field_transcript_trad:
|
||||
label: 'Transcription (Traduction)'
|
||||
datasource_id: 'entity:node'
|
||||
@@ -71,20 +107,26 @@ field_settings:
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_transcript_vo
|
||||
status:
|
||||
label: status
|
||||
field_workflow:
|
||||
label: Workflow
|
||||
datasource_id: 'entity:node'
|
||||
property_path: status
|
||||
type: boolean
|
||||
indexed_locked: true
|
||||
type_locked: true
|
||||
uid:
|
||||
label: uid
|
||||
property_path: field_workflow
|
||||
type: string
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_workflow
|
||||
langcode:
|
||||
label: Langue
|
||||
datasource_id: 'entity:node'
|
||||
property_path: uid
|
||||
type: integer
|
||||
indexed_locked: true
|
||||
type_locked: true
|
||||
property_path: langcode
|
||||
type: string
|
||||
dependencies:
|
||||
module:
|
||||
- node
|
||||
language_with_fallback:
|
||||
label: 'Language (with fallback)'
|
||||
property_path: language_with_fallback
|
||||
type: string
|
||||
name:
|
||||
label: 'Entrée(s) » Taxonomy term » Name'
|
||||
datasource_id: 'entity:node'
|
||||
@@ -95,61 +137,43 @@ field_settings:
|
||||
- field.storage.node.field_entrees
|
||||
module:
|
||||
- taxonomy
|
||||
field_entrees:
|
||||
label: Entrée(s)
|
||||
datasource_id: 'entity:node'
|
||||
property_path: field_entrees
|
||||
type: integer
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_entrees
|
||||
field_locuteurs:
|
||||
label: Locuteur(s)
|
||||
datasource_id: 'entity:node'
|
||||
property_path: field_locuteurs
|
||||
type: integer
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_locuteurs
|
||||
field_workflow:
|
||||
label: Workflow
|
||||
datasource_id: 'entity:node'
|
||||
property_path: field_workflow
|
||||
- taxonomy
|
||||
node_grants:
|
||||
label: 'Node access information'
|
||||
property_path: search_api_node_grants
|
||||
type: string
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_workflow
|
||||
field_genres:
|
||||
label: 'Genre(s) » Taxonomy term » Name'
|
||||
indexed_locked: true
|
||||
type_locked: true
|
||||
hidden: true
|
||||
status:
|
||||
label: status
|
||||
datasource_id: 'entity:node'
|
||||
property_path: 'field_genres:entity:name'
|
||||
type: text
|
||||
property_path: status
|
||||
type: boolean
|
||||
indexed_locked: true
|
||||
type_locked: true
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_genres
|
||||
module:
|
||||
- taxonomy
|
||||
field_langues:
|
||||
label: 'Langue(s) » Taxonomy term » Name'
|
||||
- node
|
||||
title:
|
||||
label: Title
|
||||
datasource_id: 'entity:node'
|
||||
property_path: 'field_langues:entity:name'
|
||||
property_path: title
|
||||
type: text
|
||||
boost: !!float 3
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_langues
|
||||
module:
|
||||
- taxonomy
|
||||
field_synonyms:
|
||||
label: 'Genre(s) » Taxonomy term » Synonyms'
|
||||
- node
|
||||
uid:
|
||||
label: uid
|
||||
datasource_id: 'entity:node'
|
||||
property_path: 'field_genres:entity:field_synonyms'
|
||||
type: text
|
||||
property_path: uid
|
||||
type: integer
|
||||
indexed_locked: true
|
||||
type_locked: true
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.node.field_genres
|
||||
- field.storage.taxonomy_term.field_synonyms
|
||||
module:
|
||||
- taxonomy
|
||||
- node
|
||||
datasource_settings:
|
||||
'entity:node':
|
||||
bundles:
|
||||
@@ -157,31 +181,17 @@ datasource_settings:
|
||||
selected:
|
||||
- enregistrement
|
||||
languages:
|
||||
default: true
|
||||
selected: { }
|
||||
default: false
|
||||
selected:
|
||||
- en
|
||||
- fr
|
||||
processor_settings:
|
||||
entity_status: { }
|
||||
rendered_item: { }
|
||||
tokenizer:
|
||||
all_fields: true
|
||||
fields:
|
||||
- body
|
||||
- title
|
||||
- field_description
|
||||
- field_transcript_trad
|
||||
- field_transcript_vo
|
||||
- name
|
||||
- field_genres
|
||||
- field_langues
|
||||
- field_synonyms
|
||||
spaces: ''
|
||||
overlap_cjk: 1
|
||||
minimum_word_size: '3'
|
||||
weights:
|
||||
preprocess_index: -6
|
||||
preprocess_query: -6
|
||||
aggregated_field: { }
|
||||
add_url: { }
|
||||
aggregated_field: { }
|
||||
content_access:
|
||||
weights:
|
||||
preprocess_query: -30
|
||||
entity_status: { }
|
||||
html_filter:
|
||||
all_fields: false
|
||||
fields:
|
||||
@@ -192,11 +202,11 @@ processor_settings:
|
||||
title: true
|
||||
alt: true
|
||||
tags:
|
||||
b: 2
|
||||
h1: 5
|
||||
h2: 3
|
||||
h3: 2
|
||||
strong: 2
|
||||
b: 2
|
||||
weights:
|
||||
preprocess_index: -15
|
||||
preprocess_query: -15
|
||||
@@ -204,40 +214,62 @@ processor_settings:
|
||||
all_fields: true
|
||||
fields:
|
||||
- body
|
||||
- title
|
||||
- field_description
|
||||
- field_transcript_trad
|
||||
- field_transcript_vo
|
||||
- name
|
||||
- field_workflow
|
||||
- field_genres
|
||||
- field_langues
|
||||
- field_synonyms
|
||||
- field_transcript_trad
|
||||
- field_transcript_vo
|
||||
- field_workflow
|
||||
- langcode
|
||||
- language_with_fallback
|
||||
- name
|
||||
- title
|
||||
weights:
|
||||
preprocess_index: -20
|
||||
preprocess_query: -20
|
||||
language_with_fallback: { }
|
||||
rendered_item: { }
|
||||
reverse_entity_references: { }
|
||||
tokenizer:
|
||||
all_fields: true
|
||||
fields:
|
||||
- body
|
||||
- field_description
|
||||
- field_genres
|
||||
- field_langues
|
||||
- field_synonyms
|
||||
- field_transcript_trad
|
||||
- field_transcript_vo
|
||||
- name
|
||||
- title
|
||||
spaces: ''
|
||||
overlap_cjk: 1
|
||||
minimum_word_size: '3'
|
||||
weights:
|
||||
preprocess_index: -6
|
||||
preprocess_query: -6
|
||||
transliteration:
|
||||
all_fields: true
|
||||
fields:
|
||||
- body
|
||||
- title
|
||||
- field_description
|
||||
- field_transcript_trad
|
||||
- field_transcript_vo
|
||||
- name
|
||||
- field_workflow
|
||||
- field_genres
|
||||
- field_langues
|
||||
- field_synonyms
|
||||
- field_transcript_trad
|
||||
- field_transcript_vo
|
||||
- field_workflow
|
||||
- langcode
|
||||
- language_with_fallback
|
||||
- name
|
||||
- title
|
||||
weights:
|
||||
preprocess_index: -20
|
||||
preprocess_query: -20
|
||||
content_access:
|
||||
weights:
|
||||
preprocess_query: -30
|
||||
tracker_settings:
|
||||
default:
|
||||
indexing_order: fifo
|
||||
indexing_order: lifo
|
||||
options:
|
||||
index_directly: true
|
||||
cron_limit: 50
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: 68e32c87-ed2f-4047-a098-f779258ea8be
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_add_action.expo_encyclopediedelaparole_org
|
||||
label: 'Add selected content to the Encyclopédie de la parole domain'
|
||||
type: node
|
||||
plugin: domain_access_add_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: 7ec41e65-c60f-4eb2-8d13-137d765fe086
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_add_editor_action.expo_encyclopediedelaparole_org
|
||||
label: 'Add editors to the Encyclopédie de la parole domain'
|
||||
type: user
|
||||
plugin: domain_access_add_editor_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: 0a61de2c-75c7-40a8-83f9-f2b7c2e6b297
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_remove_action.expo_encyclopediedelaparole_org
|
||||
label: 'Remove selected content from the Encyclopédie de la parole domain'
|
||||
type: node
|
||||
plugin: domain_access_remove_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
uuid: b2943b17-1e04-4fa8-aa3f-f6fc1b3f2757
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- domain.record.expo_encyclopediedelaparole_org
|
||||
module:
|
||||
- domain_access
|
||||
id: domain_access_remove_editor_action.expo_encyclopediedelaparole_org
|
||||
label: 'Remove editors from the Encyclopédie de la parole domain'
|
||||
type: user
|
||||
plugin: domain_access_remove_editor_action
|
||||
configuration:
|
||||
domain_id: expo_encyclopediedelaparole_org
|
||||
@@ -61,7 +61,8 @@ function edlp_ajax_page_attachments(array &$attachments) {
|
||||
$redirect = true;
|
||||
}
|
||||
|
||||
// $redirect = false;
|
||||
$site_name = \Drupal::config('system.site')->get('name');
|
||||
|
||||
$js_str = "var edlp = {\n
|
||||
sys_path:'".$current_path."',\n
|
||||
is_front:".($is_front ? 'true':'false').",\n
|
||||
@@ -71,6 +72,7 @@ function edlp_ajax_page_attachments(array &$attachments) {
|
||||
entity_bundle:'".$entity_bundle."',\n
|
||||
entity_id:'".$entity_id."',\n
|
||||
audio_url:'".$audio_url."',\n
|
||||
site_name:'".$site_name."',\n
|
||||
};";
|
||||
|
||||
$attachments['#attached']['html_head'][] = [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
(function($,Drupal,drupalSettings){EdlpCorpus=function(){var _activated=true;var _$body=$('body');var _$container=_$body;var _$canvas=$('<canvas id="corpus-map">').appendTo(_$container);var _canvas=_$canvas[0];var _ctx=_canvas.getContext('2d');var _dpi=window.devicePixelRatio;var _scene_props={width:window.innerWidth,height:window.innerHeight,'margin_top':75,'margin_right':0,'margin_bottom':65,'margin_left':0};var _evolution_zone={left:_scene_props.width/4,right:_scene_props.width-_scene_props.width/4,center:_scene_props.width/2,};var _physics=new Physics();var _nodes=[];var _articles_nodes=[];var _no_articles_nodes=[];var _nodes_by_entries={};var _nodes_by_nid={};var _nodes_Nid_Id={};var _nodes_centered=[];var _nodes_centered_attractions=[];var _loaded=false;var _playlist=[];var _p_velocity_factor=0.5;var _mouse_in=true;var _m_pos={x:0,y:0};var _node_hover_id=-1;var _node_opened_id=-1;var _$entrees_block=$('#block-edlpentreesblock');var _$entrees_block_termlinks=$('a.term-link',_$entrees_block);var _$articles_link;var _node_pop_up;var _settings=drupalSettings.edlp_corpus;var _ecolors=_settings.colors;var _attracter;var check_parts_colid_frq=2;var check_parts_colid_tick=1;function init(){initCanvas();if(_activated){loadCorpus();}else{_$canvas.addClass('de-activated');}};function initCanvas(){window.addEventListener('resize',onResizeCanvas,false);onResizeCanvas();};function onResizeCanvas(){_scene_props.width=window.innerWidth;_scene_props.height=window.innerHeight;_canvas.style.width=_scene_props.width+'px';_canvas.style.height=_scene_props.height+'px';_canvas.width=_scene_props.width*_dpi;_canvas.height=_scene_props.height*_dpi;_ctx.scale(_dpi,_dpi);moveEvolutionZone();if(_loaded){for(var i=0;i<_nodes.length;i++){_nodes[i].onResizeCanvas();}}};function loadCorpus(){var ajax_path=_settings.load_corpus_ajax_url;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(function(data){onCorpusLoaded(data);}).fail(function(jqxhr,textStatus,error){onCorpusLoadError(jqxhr,textStatus,error);});};function onCorpusLoadError(jqxhr,textStatus,error){void 0;};function onCorpusLoaded(data){void 0;initPhysics();buildNodes(data.nodes);initArtilesLink();initNodePopup();initEvents();checkPreOpenedEntry();startAnime();_loaded=true;};function initPhysics(){_attracter=_physics.makeParticle(1000);_attracter.fixed=true;resizePhysics();};function resizePhysics(){if(typeof _attracter!='undefined'){_attracter.position={x:_evolution_zone.center,y:_scene_props.height/2};}};function buildNodes(nodes){var d;for(var i in nodes){d=i<1?true:false;new Node(i,nodes[i],d);_playlist.push({'id':i,'nid':nodes[i].nid,'audio_url':nodes[i].audio_url,'document_url':nodes[i].document_url,});}};function Node(i,node,d){this.id=i;for(key in node)
|
||||
(function($,Drupal,drupalSettings){EdlpCorpus=function(){var _activated=true;var _$body=$('body');var _$container=_$body;var _$canvas=$('<canvas id="corpus-map">').appendTo(_$container);var _canvas=_$canvas[0];var _ctx=_canvas.getContext('2d');var _dpi=window.devicePixelRatio;var _is_expo=$('body').hasClass('domain-expo-encyclopediedelaparole-org');var _scene_props={width:window.innerWidth,height:window.innerHeight,'margin_top':_is_expo?0:75,'margin_right':0,'margin_bottom':_is_expo?0:65,'margin_left':0};var _evolution_zone={left:_scene_props.width/4,right:_scene_props.width-_scene_props.width/4,center:_scene_props.width/2,};var _physics=new Physics();var _nodes=[];var _articles_nodes=[];var _no_articles_nodes=[];var _nodes_by_entries={};var _nodes_by_nid={};var _nodes_Nid_Id={};var _nodes_centered=[];var _nodes_centered_attractions=[];var _loaded=false;var _playlist=[];var _p_velocity_factor=0.5;var _mouse_in=true;var _m_pos={x:0,y:0};var _node_hover_id=-1;var _node_opened_id=-1;var _$entrees_block=$('#block-edlpentreesblock');var _$entrees_block_termlinks=$('a.term-link',_$entrees_block);var _$articles_link;var _node_pop_up;var _settings=drupalSettings.edlp_corpus;var _ecolors=_settings.colors;var _attracter;var check_parts_colid_frq=2;var check_parts_colid_tick=1;function init(){void 0;initCanvas();if(_activated){loadCorpus();}else{_$canvas.addClass('de-activated');}};function initCanvas(){window.addEventListener('resize',onResizeCanvas,false);onResizeCanvas();};function onResizeCanvas(){_scene_props.width=window.innerWidth;_scene_props.height=window.innerHeight;_canvas.style.width=_scene_props.width+'px';_canvas.style.height=_scene_props.height+'px';_canvas.width=_scene_props.width*_dpi;_canvas.height=_scene_props.height*_dpi;_ctx.scale(_dpi,_dpi);moveEvolutionZone();if(_loaded){for(var i=0;i<_nodes.length;i++){_nodes[i].onResizeCanvas();}}};function loadCorpus(){var ajax_path=_settings.load_corpus_ajax_url;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(function(data){onCorpusLoaded(data);}).fail(function(jqxhr,textStatus,error){onCorpusLoadError(jqxhr,textStatus,error);});};function onCorpusLoadError(jqxhr,textStatus,error){void 0;};function onCorpusLoaded(data){void 0;initPhysics();buildNodes(data.nodes);initArtilesLink();initNodePopup();initEvents();checkPreOpenedEntry();startAnime();_loaded=true;};function initPhysics(){_attracter=_physics.makeParticle(1000);_attracter.fixed=true;resizePhysics();};function resizePhysics(){if(typeof _attracter!='undefined'){_attracter.position={x:_evolution_zone.center,y:_scene_props.height/2};}};function buildNodes(nodes){var d;for(var i in nodes){d=i<1?true:false;new Node(i,nodes[i],d);_playlist.push({'id':i,'nid':nodes[i].nid,'audio_url':nodes[i].audio_url,'document_url':nodes[i].document_url,});}};function Node(i,node,d){this.id=i;for(key in node)
|
||||
this[key]=node[key];_nodes.push(this);_nodes_by_nid[this.nid]=this;_nodes_Nid_Id[this.nid]=this.id;if(this.has_article==1){_articles_nodes.push(this);}else{_no_articles_nodes.push(this);}
|
||||
for(var j=0;j<this.entrees.length;j++){if(typeof _nodes_by_entries[this.entrees[j]]=='undefined')
|
||||
_nodes_by_entries[this.entrees[j]]=[];_nodes_by_entries[this.entrees[j]].push(this);}
|
||||
@@ -7,7 +7,7 @@ this.debug=d;this.mass=Math.max(1,this.entrees.length);this.velocity_threshold=0
|
||||
this.d=this.r*2;this.e_color='e_col_'+this.entrees[Math.floor(Math.random(this.entrees.length))];this.canvas=document.createElement('canvas');this.canvas_ctx=this.canvas.getContext('2d');this.line_width=1;this.w=this.r*2+this.line_width*2;this.w_2=this.w/2;this.canvas.width=this.w;this.canvas.height=this.w;this.canvas_ctx.fillStyle='rgb(255,255,255)';this.canvas_ctx.lineWidth=this.line_width;this.wall_bouncing_elasticity=0.75;this.hover=false;this.opened=false;this.faded=false;this.center=false;this.aside=false;this.scrambling=false;if(typeof Node.initialized=="undefined"){Node.prototype.init=function(){this.calcWallLimits();this.x=this.wall_limits.left+Math.random()*(this.wall_limits.right-this.wall_limits.left);this.y=this.wall_limits.top+Math.random()*(this.wall_limits.bottom-this.wall_limits.top);this.ori_pos={x:this.x,y:this.y};this.initPhysics();};Node.prototype.initPhysics=function(){this.p=_physics.makeParticle(this.mass,this.x,this.y);this.p.velocity=new Physics.Vector((Math.random()-0.5)*_p_velocity_factor,(Math.random()-0.5)*_p_velocity_factor);this.ori_p=_physics.makeParticle(1000,this.ori_pos.x,this.ori_pos.y);this.ori_p.fixed=true;this.ori_p_attract=_physics.makeAttraction(this.ori_p,this.p,1000,_scene_props.width*2);this.ori_p_attract.on=false;this.attract=_physics.makeAttraction(_attracter,this.p,1000,_scene_props.width*2);this.attract.on=false;};Node.prototype.calcWallLimits=function(){this.wall_limits={top:_scene_props.margin_top+this.r,right:_scene_props.width-_scene_props.margin_right-this.r,bottom:_scene_props.height-_scene_props.margin_bottom-this.r,left:_scene_props.margin_left+this.r}};Node.prototype.onResizeCanvas=function(){this.calcWallLimits();this.shuffleOriP();};Node.prototype.shuffleOriP=function(){this.ori_pos.x=this.wall_limits.left+Math.random()*(this.wall_limits.right-this.wall_limits.left);this.ori_pos.y=this.wall_limits.top+Math.random()*(this.wall_limits.bottom-this.wall_limits.top);this.scramble();};Node.prototype.onUpdate=function(){if(this.hover||this.opened){this.p.fixed=true;}else{this.p.fixed=false;if(this.center)
|
||||
this.limitEvolutionZone();this.checkWallBouncing();this.updatePos();if(this.scrambling){this.checkOriPDist();}}
|
||||
if(_mouse_in&&!this.aside&&!this.faded)
|
||||
this.checkMouse();this.redraw();};Node.prototype.checkVelocityThreshold=function(){if(!this.centered||!this.aside){if(Math.abs(this.p.velocity.x)<this.velocity_threshold&&Math.abs(this.p.velocity.y)<this.velocity_threshold){this.p.velocity.multiplyScalar(0);}}};Node.prototype.checkWallBouncing=function(){switch(true){case this.x<this.wall_limits.left&&this.p.velocity.x<0:this.p.position.x=this.wall_limits.left;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.x>this.wall_limits.right&&this.p.velocity.x>0:this.p.position.x=this.wall_limits.right;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y<this.wall_limits.top&&this.p.velocity.y<0:this.p.position.y=this.wall_limits.top;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y>this.wall_limits.bottom&&this.p.velocity.y>0:this.p.position.y=this.wall_limits.bottom;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;}};Node.prototype.updatePos=function(){this.x=this.p.position.x;this.y=this.p.position.y;};Node.prototype.checkMouse=function(){if(_m_pos.x>this.x-this.r&&_m_pos.x<this.x+this.r&&_m_pos.y>this.y-this.r&&_m_pos.y<this.y+this.r){if(_node_hover_id==-1||_node_hover_id!==this.id){this.setHover();}}else{this.unsetHover();}};Node.prototype.setHover=function(){this.hover=true;_node_hover_id=this.id;_node_pop_up.setNode(this);};Node.prototype.unsetHover=function(){this.hover=false;if(_node_hover_id==this.id){_node_hover_id=-1;_node_pop_up.removeNode();}};Node.prototype.open=function(){this.opened=true;_node_opened_id=this.id;};Node.prototype.close=function(){this.opened=false;};Node.prototype.fade=function(){this.faded=true;};Node.prototype.unFade=function(){this.faded=false;};Node.prototype.setCenteredOnEntree=function(tid){this.e_color='e_col_'+tid;this.setCentered();};Node.prototype.setCentered=function(){this.center=true;this.stopScrambling();this.unsetAside();this.attract.on=true;}
|
||||
this.checkMouse();this.redraw();};Node.prototype.checkVelocityThreshold=function(){if(!this.centered||!this.aside){if(Math.abs(this.p.velocity.x)<this.velocity_threshold&&Math.abs(this.p.velocity.y)<this.velocity_threshold){this.p.velocity.multiplyScalar(0);}}};Node.prototype.checkWallBouncing=function(){switch(true){case this.x<this.wall_limits.left&&this.p.velocity.x<0:this.p.position.x=this.wall_limits.left;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.x>this.wall_limits.right&&this.p.velocity.x>0:this.p.position.x=this.wall_limits.right;this.p.velocity.multiplyScalarXY(-1,1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y<this.wall_limits.top&&this.p.velocity.y<0:this.p.position.y=this.wall_limits.top;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;case this.y>this.wall_limits.bottom&&this.p.velocity.y>0:this.p.position.y=this.wall_limits.bottom;this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(this.wall_bouncing_elasticity);break;}};Node.prototype.updatePos=function(){this.x=this.p.position.x;this.y=this.p.position.y;};Node.prototype.checkMouse=function(){if(_m_pos.x>this.x-this.r&&_m_pos.x<this.x+this.r&&_m_pos.y>this.y-this.r&&_m_pos.y<this.y+this.r){if(_node_hover_id==-1||_node_hover_id!==this.id){this.setHover();}}else{this.unsetHover();}};Node.prototype.setHover=function(){this.hover=true;_node_hover_id=this.id;_node_pop_up.setNode(this);};Node.prototype.unsetHover=function(){this.hover=false;if(_node_hover_id==this.id){_node_hover_id=-1;_node_pop_up.removeNode();}};Node.prototype.open=function(){this.opened=true;_node_opened_id=this.id;_$body.trigger({'type':'map-node-opened','node':this});};Node.prototype.close=function(){this.opened=false;};Node.prototype.fade=function(){this.faded=true;};Node.prototype.unFade=function(){this.faded=false;};Node.prototype.setCenteredOnEntree=function(tid){this.e_color='e_col_'+tid;this.setCentered();};Node.prototype.setCentered=function(){this.center=true;this.stopScrambling();this.unsetAside();this.attract.on=true;}
|
||||
Node.prototype.unsetCentered=function(){this.center=false;this.attract.on=false;}
|
||||
Node.prototype.limitEvolutionZone=function(){this.dist_to_attracter=this.p.distanceTo(_attracter);if(this.dist_to_attracter<_scene_props.width/4){if(this.p.velocity.length()>0.4){this.p.velocity.multiplyScalar(0.99);}}
|
||||
if(this.x<_evolution_zone.left||this.x>_evolution_zone.right||Math.abs(_attracter.position.y-this.y)>_scene_props.height/4){this.attract.on=true;}else{this.attract.on=false;}}
|
||||
@@ -32,11 +32,11 @@ filterEntree(tid);if(bubbling){_$body.trigger({'type':'open_entree','tid':tid,'u
|
||||
scrambleCollection();_$body.trigger({'type':'close_entree','tid':tid});}};function filterEntree(t){_nodes_centered=[];for(var n=0;n<_nodes.length;n++){if(_nodes[n].entrees.indexOf(t)==-1){_nodes[n].setAside();}else{_nodes[n].setCenteredOnEntree(t);_nodes_centered.push(_nodes[n]);}}
|
||||
updateRandomPlaylist(_nodes_centered);createNodesRepulsions();};function highlightEntries(){_$entrees_block_termlinks.parents('li').removeClass('highlighted').parents('.item-list').removeClass('highlighted');var id=-1;if(_node_hover_id!=-1){id=_node_hover_id;}else if(_node_opened_id!=-1){id=_node_opened_id;}
|
||||
var entree;if(id!=-1){for(var i=0;i<_nodes[id].entrees.length;i++){entree=_nodes[id].entrees[i];_$entrees_block_termlinks.filter(function(){return $(this).attr('tid')==entree;}).parents('li').addClass('highlighted').parents('.item-list').addClass('highlighted');}}};function filterByNids(nids){_nodes_centered=[];for(var n=0;n<_nodes.length;n++){if(nids.indexOf(_nodes[n].nid)==-1){_nodes[n].setAside();}else{_nodes[n].setCentered();_nodes_centered.push(_nodes[n]);}}
|
||||
updateRandomPlaylist(_nodes_centered);createNodesRepulsions();};function scrambleCollection(){for(var i=0;i<_nodes.length;i++){_nodes[i].scramble();}
|
||||
updateRandomPlaylist(_nodes_centered);createNodesRepulsions();};function scrambleCollection(){void 0;for(var i=0;i<_nodes.length;i++){_nodes[i].scramble();}
|
||||
updateRandomPlaylist(_playlist);};function closeAllEntries(){_$entrees_block_termlinks.each(function(index,el){if($(this).parents('li').is('.opened')){$(this).trigger('click');return false;}});};function initArtilesLink(){var href=window.location.origin+drupalSettings.path.baseUrl+_settings.articlesindex_url;_$articles_link=$('<a>').html('Articles').attr("href",href).attr("data-drupal-link-system-path",_settings.articlesindex_url).addClass('articles-link ajax-link');$('.item-list ul',_$entrees_block).append($('<li>').append($('<span class="oblique-wrapper">').append(_$articles_link)));};function initEvents(){void 0;_$canvas.on('mousemove',function(event){event.preventDefault();_m_pos.x=event.originalEvent.clientX;_m_pos.y=event.originalEvent.clientY;}).on('mouseenter',function(event){_mouse_in=true;}).on('mouseout',function(event){_mouse_in=false;_node_pop_up.removeNode();}).on('click',function(event){if(event.target.tagName!="A"&&event.target.tagName!="INPUT"){event.preventDefault();if(_node_hover_id!=-1){var event={'type':'corpus-cliked-on-node','target_node':_nodes[_node_hover_id],};_$canvas.trigger(event);}else{_$canvas.trigger('corpus-cliked-on-map');}}}).on('mouseover-audio-link',function(e){void 0;_nodes_by_nid[e.nid].setHover();}).on('mouseout-audio-link',function(e){void 0;_nodes_by_nid[e.nid].unsetHover();}).on('audio-node-opened',function(e){openNodeByNid(e.nid);}).on('audio-node-closed',function(e){closeNode();}).on('open-entree',function(e){toggleEntree(e.tid);}).on('close-all-entree',function(e){closeAllEntries();}).on('scramble-collection',function(e){void 0;scrambleCollection();}).on('shuffle-collection',function(e){void 0;onResizeCanvas();});_$entrees_block_termlinks.on('click',function(event){event.preventDefault();toggleEntree($(this).attr('tid'),true);return false;});_$body.on('chutier-action-done',function(e){_nodes_by_nid[e.target_id].chutier_action=e.new_action;}).on('ajax-node-loaded-linked-documents',function(e){void 0;filterByNids(e.nids);}).on('search-results-loaded',function(e){filterByNids(e.results);}).on('search-closed',function(e){scrambleCollection();}).on('new-content-not-entree-ajax-loaded',function(e){if(_$entrees_block_termlinks.parents('li.opened').length){_$entrees_block_termlinks.parents('li').removeClass('opened').parents('.item-list').removeClass('opened');scrambleCollection();}}).on('visible-space-changed',function(e){moveEvolutionZone(e.left_limit,e.right_limit);});};function checkPreOpenedEntry(){_$entrees_block.find('li.entree').each(function(index,el){var $li=$(this);if($('a.is-active',$li).length){$li.addClass('opened').parents('.item-list').addClass('opened');filterEntree($li.attr('tid'));return false;}});};function initNodePopup(){_node_pop_up=new NodePopUp();};function NodePopUp(){this.visible=false;this.node;this.$dom=$('<div>').addClass('node-popup').attr('pos','top-right').appendTo('body');this.$content=$('<div>').addClass('inner').appendTo(this.$dom);if(typeof NodePopUp.initialized=="undefined"){NodePopUp.prototype.setNode=function(n){this.node=n;this.setPositioning();this.setContent();};NodePopUp.prototype.setPositioning=function(){switch(true){case this.node.x>_evolution_zone.right-350&&this.node.y<this.node.wall_limits.top+200:this.$dom.attr('pos','bottom-left');break;case this.node.x>_evolution_zone.right-350:this.$dom.attr('pos','top-left');break;case this.node.y<this.node.wall_limits.top+200:this.$dom.attr('pos','bottom-right');break;default:this.$dom.attr('pos','top-right');}};NodePopUp.prototype.setContent=function(){this.$content.html('');var $entrees=$('<div>').addClass('entrees');for(var i=0;i<this.node.entrees.length;i++){var tid=this.node.entrees[i];$entrees.append($('<span>').addClass('entree').attr('tid',tid));}
|
||||
var $chutier_action=$('<span>').addClass('chutier-icon').attr('action',this.node.chutier_action);this.$content.append($entrees).append('<h2 class="title">'+this.node.title+'</h2>').append('<section class="description">'+this.node.description+'</section>').append($chutier_action);};NodePopUp.prototype.removeNode=function(){this.node=false;};NodePopUp.prototype.draw=function(){if(this.node){this.$dom.css({'display':"block",'left':this.node.x+"px",'top':this.node.y+"px",});}else{this.$dom.css({'display':"none",});}};NodePopUp.initialized=true;}}
|
||||
function render(){_ctx.clearRect(0,0,_scene_props.width,_scene_props.height);checkParticulesCollisions();for(var i=0;i<_nodes.length;i++){_nodes[i].onUpdate();}
|
||||
_node_pop_up.draw();if(_node_hover_id!=-1){_canvas.style.cursor='pointer';}else{_canvas.style.cursor='auto';}
|
||||
highlightEntries();};function startAnime(){_physics.onUpdate(render);_physics.play()
|
||||
$('body').attr('corpus','map-ready').trigger({'type':'corpus-map-ready','playlist':_playlist});};init();}
|
||||
$(document).ready(function($){if(drupalSettings.path.isFront&&!edlp_mobile.device_is_mobile){var edlpcorpus=new EdlpCorpus();}});})(jQuery,Drupal,drupalSettings);
|
||||
$(document).ready(function($){void 0;if(drupalSettings.path.isFront&&!edlp_mobile.device_is_mobile){void 0;var edlpcorpus=new EdlpCorpus();}});})(jQuery,Drupal,drupalSettings);
|
||||
@@ -25,14 +25,15 @@
|
||||
var _canvas = _$canvas[0];
|
||||
var _ctx = _canvas.getContext('2d');
|
||||
var _dpi = window.devicePixelRatio;
|
||||
var _is_expo = $('body').hasClass('domain-expo-encyclopediedelaparole-org');
|
||||
var _scene_props = {
|
||||
width:window.innerWidth,
|
||||
height:window.innerHeight,
|
||||
// 'margin_top':90, // with red border on head
|
||||
'margin_top':75, // without red border on head
|
||||
'margin_top': _is_expo ? 0 : 75, // without red border on head
|
||||
// 'margin_top':0,
|
||||
'margin_right':0,
|
||||
'margin_bottom':65,
|
||||
'margin_bottom': _is_expo ? 0 : 65,
|
||||
// 'margin_bottom':0,
|
||||
'margin_left':0
|
||||
};
|
||||
@@ -81,6 +82,7 @@
|
||||
// _/ // / / / / /_(__ )
|
||||
// /___/_/ /_/_/\__/____/
|
||||
function init(){
|
||||
console.log("Corpus init()");
|
||||
initCanvas();
|
||||
if(_activated){
|
||||
loadCorpus();
|
||||
@@ -449,6 +451,10 @@
|
||||
this.opened = true;
|
||||
_node_opened_id = this.id;
|
||||
//this.drawSprite();
|
||||
_$body.trigger({
|
||||
'type':'map-node-opened',
|
||||
'node':this
|
||||
});
|
||||
};
|
||||
Node.prototype.close = function(){
|
||||
this.opened = false;
|
||||
@@ -759,7 +765,7 @@
|
||||
console.log("_scene_props", _scene_props);
|
||||
_evolution_zone.left =
|
||||
left == 0
|
||||
? left+20
|
||||
? left+20
|
||||
: Math.max(_scene_props.width/5, left+20);
|
||||
_evolution_zone.right =
|
||||
right == 0
|
||||
@@ -888,7 +894,7 @@
|
||||
// };
|
||||
|
||||
function scrambleCollection(){
|
||||
// console.log('scrambleCollection');
|
||||
console.log('Corpus scrambleCollection');
|
||||
for (var i = 0; i < _nodes.length; i++) {
|
||||
_nodes[i].scramble();
|
||||
}
|
||||
@@ -1305,7 +1311,9 @@
|
||||
|
||||
|
||||
$(document).ready(function($) {
|
||||
console.log("Corpus ready");
|
||||
if(drupalSettings.path.isFront && !edlp_mobile.device_is_mobile){
|
||||
console.log("Corpus new edlpCorpus()");
|
||||
var edlpcorpus = new EdlpCorpus();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -319,3 +319,30 @@ function edlp_corpus_node_update(EntityInterface $node) {
|
||||
function edlp_corpus_node_delete(EntityInterface $node) {
|
||||
_edlp_corpus_invalidate_corpus_cache($node);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implements hook_theme_suggestions_HOOK().
|
||||
*/
|
||||
function edlp_corpus_theme_suggestions_file_link(array $vars) {
|
||||
// dpm($vars);
|
||||
$suggestions = [];
|
||||
|
||||
// /** @var \Drupal\edlp_studio\CompositionInterface $compo */
|
||||
// $compo = $vars['elements']['#composition'];
|
||||
//
|
||||
$file = $vars['file'];
|
||||
// dpm($file);
|
||||
$mime = str_replace('/', '-',$file->getMimeType());
|
||||
// $owner = $file->getOwner();
|
||||
// dpm($owner);
|
||||
// $refentities = $file->referencedEntities();
|
||||
// dpm($refentities);
|
||||
|
||||
$suggestions[] = 'file-link';
|
||||
$suggestions[] = 'file-link__' . $mime;
|
||||
// $suggestions[] = 'file-link__' . $owner;
|
||||
|
||||
// dpm($suggestions);
|
||||
return $suggestions;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ function template_preprocess_edlp_corpus_docsindex(&$vars){
|
||||
"#attributes"=>array(
|
||||
"class"=>['docsindex']
|
||||
),
|
||||
"#markup"=>"<h3>".t("Documents Index")."</h3>",
|
||||
"#markup"=>"<h3>".t("All Documents")."</h3>",
|
||||
"docsindex"=>$docsindex_list
|
||||
);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ class CorpusController extends ControllerBase {
|
||||
$data = [
|
||||
'rendered'=> $rendered,
|
||||
'title'=>t('Documents Index'),
|
||||
'documents_lies' => $this->docsindex_nids,
|
||||
// 'documents_lies' => $this->docsindex_nids,
|
||||
];
|
||||
|
||||
// translations links
|
||||
|
||||
@@ -71,6 +71,9 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$desktop_domain = $domain_storage->load('encyclopediedelaparole_org');
|
||||
// dpm($desktop_domain, 'desktop_domain');
|
||||
|
||||
$expo_domain = $domain_storage->load('expo_encyclopediedelaparole_org');
|
||||
// dpm($expo_domain, 'expo_domain');
|
||||
|
||||
$current_domain = $domain_storage->loadByHostname($current_hostname);
|
||||
// dpm($current_domain, 'current_domain');
|
||||
|
||||
@@ -79,6 +82,7 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$is_mobile_domain = ($current_domain->id() == $mobile_domain->id());
|
||||
$mobile_url = $mobile_domain->getHostname();
|
||||
$desktop_url = $desktop_domain->getHostname();
|
||||
$expo_url = $expo_domain->getHostname();
|
||||
}else{
|
||||
// we are not in a main domain, so we look for an alias
|
||||
$domain_alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
|
||||
@@ -93,34 +97,30 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
$env_aliases = $domain_alias_storage->loadByEnvironment($env);
|
||||
// dpm($env_aliases, '$env_aliases');
|
||||
// find out mibile alias and desktop alias
|
||||
// this is dirty
|
||||
// get mobile pattern
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
switch ($env_alias->getDomainId()) {
|
||||
case 'm_encyclopediedelaparole_org':
|
||||
$mobile_url = $env_alias->getPattern();
|
||||
break;
|
||||
case 'encyclopediedelaparole_org':
|
||||
$desktop_url = $env_alias->getPattern();
|
||||
break;
|
||||
case 'expo_encyclopediedelaparole_org':
|
||||
$expo_url = $env_alias->getPattern();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// TODO: set target device as domain setting
|
||||
if ($domain_id == 'm_encyclopediedelaparole_org'){
|
||||
// current domain/alias is mobile
|
||||
$is_mobile_domain = true;
|
||||
$mobile_url = $alias->getPattern();
|
||||
// find desktop pattern
|
||||
// we assume that there is only two alias by env (mobile or desktop)
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
if($env_alias_id != $alias->id()){
|
||||
// we found the desktop pattern
|
||||
$desktop_url = $env_alias->getPattern();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}elseif($domain_id == 'expo_encyclopediedelaparole_org'){
|
||||
// current domain/alias is expo
|
||||
$is_mobile_domain = false;
|
||||
}else{
|
||||
// current domain/alias is desktop
|
||||
$is_mobile_domain = false;
|
||||
$desktop_url = $alias->getPattern();
|
||||
// find mobile pattern
|
||||
// we assume that there is only two alias by env (mobile or desktop)
|
||||
foreach ($env_aliases as $env_alias_id => $env_alias) {
|
||||
if($env_alias_id != $alias->id()){
|
||||
// we found the mobile pattern
|
||||
$mobile_url = $env_alias->getPattern();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,8 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
// $desktop_home_path = "???";
|
||||
$desktop_home_path = \Drupal::config('domain_site_settings.domainconfigsettings')->get('encyclopediedelaparole_org.site_frontpage', FALSE);
|
||||
|
||||
$expo_home_path = \Drupal::config('domain_site_settings.domainconfigsettings')->get('expo_encyclopediedelaparole_org.site_frontpage', FALSE);
|
||||
|
||||
// $redirect = false;
|
||||
$js_str = "var edlp_mobile = {\n
|
||||
current_url:'".$base_root."',\n
|
||||
@@ -146,6 +148,8 @@ function edlp_mobile_page_attachments(array &$attachments) {
|
||||
mobile_home_path:'".$mobile_home_path."',\n
|
||||
desktop_url:'".$desktop_url."',\n
|
||||
desktop_home_path:'".$desktop_home_path."',\n
|
||||
expo_url:'".$expo_url."',\n
|
||||
expo_home_path:'".$expo_home_path."',\n
|
||||
};";
|
||||
|
||||
$attachments['#attached']['html_head'][] = [
|
||||
|
||||
@@ -150,10 +150,14 @@ class EdlpSearchController extends ControllerBase {
|
||||
$query->addConditionGroup($wf_condition_group);
|
||||
|
||||
// Search for keys.
|
||||
if (!empty($this->keys)) {
|
||||
if (!empty($this->keys)) { // && strlen($this->keys) > 2
|
||||
// dpm($this->keys);
|
||||
$query->keys($this->keys);
|
||||
}
|
||||
// else{
|
||||
// $this->matches = [];
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
if(null !== $this->field_synonyms){
|
||||
@@ -167,6 +171,7 @@ class EdlpSearchController extends ControllerBase {
|
||||
$result = $query->execute();
|
||||
$items = $result->getResultItems();
|
||||
// dpm($items);
|
||||
|
||||
$this->matches = [];
|
||||
foreach ($items as $item) {
|
||||
// get the field from item
|
||||
@@ -185,6 +190,7 @@ class EdlpSearchController extends ControllerBase {
|
||||
// dpm($fields);
|
||||
// get field content
|
||||
$field_text = $fields[0]->getText();
|
||||
// $entity_id = $fields[0]->get('tid');
|
||||
|
||||
// if content already in matches, skip item
|
||||
if( in_array($field_text, $this->matches) ){
|
||||
@@ -192,6 +198,7 @@ class EdlpSearchController extends ControllerBase {
|
||||
}
|
||||
|
||||
// add the item to the return list
|
||||
// $matches_names = $field_text . '('.$entity_id.')';
|
||||
$this->matches[] = $field_text;
|
||||
|
||||
// do not return more than 14 items
|
||||
@@ -250,7 +257,6 @@ class EdlpSearchController extends ControllerBase {
|
||||
|
||||
$response = new JsonResponse();
|
||||
$response->setData([
|
||||
'test'=>'search results',
|
||||
'keys'=>$this->keys,
|
||||
'entries' => $this->entries,
|
||||
'entry_names' => $this->entry_names,
|
||||
@@ -308,8 +314,12 @@ class EdlpSearchController extends ControllerBase {
|
||||
$parse_mode = \Drupal::getContainer()
|
||||
->get('plugin.manager.search_api.parse_mode')
|
||||
->createInstance('direct');
|
||||
// $parse_mode->setConjunction('AND');
|
||||
$query->setParseMode($parse_mode);
|
||||
|
||||
// search in both languages (if not conditions will not work)
|
||||
$query->setLanguages(array('fr','en'));
|
||||
|
||||
// workflow
|
||||
$wf_condition_group = $query->createConditionGroup('OR');
|
||||
$wf_condition_group->addCondition('field_workflow', 'corpus_documents_publie', "=");
|
||||
@@ -335,6 +345,8 @@ class EdlpSearchController extends ControllerBase {
|
||||
$query->addCondition('field_genres', $this->genres, "=");
|
||||
}
|
||||
|
||||
// TODO: locuteurs
|
||||
|
||||
// entries
|
||||
$this->entry_names = [];
|
||||
if (!empty($this->entries)){
|
||||
@@ -348,20 +360,12 @@ class EdlpSearchController extends ControllerBase {
|
||||
$query->addConditionGroup($entries_condition_group);
|
||||
}
|
||||
|
||||
// TODO: locuteurs
|
||||
|
||||
$current_langcode = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
$query->setLanguages(array($current_langcode));
|
||||
|
||||
// $language = \Drupal::languageManager()->getCurrentLanguage()->getId();
|
||||
// // $language = \Drupal::languageManager()->getCurrentLanguage()->getName();
|
||||
// $query->addCondition('search_api_language', $language);
|
||||
|
||||
$result = $query->execute();
|
||||
$items = $result->getResultItems();
|
||||
// dpm($items);
|
||||
|
||||
$this->items = [];
|
||||
$ids = [];
|
||||
foreach ($items as $item) {
|
||||
try {
|
||||
/** @var \Drupal\Core\Entity\EntityInterface $entity */
|
||||
@@ -373,7 +377,12 @@ class EdlpSearchController extends ControllerBase {
|
||||
if (!$entity) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// get distinct results
|
||||
if(in_array($entity->id(), $ids)){
|
||||
continue;
|
||||
}
|
||||
$ids[] = $entity->id();
|
||||
// record results
|
||||
$this->items[] = $entity;
|
||||
}
|
||||
// dpm($this->items);
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
|
||||
(function($,Drupal,drupalSettings){var _settings=drupalSettings.edlp_studio;var $composer;function init(){initEvents();initStudio();};function initEvents(){$('body').on('new-audio-cartel-loaded',initAjaxChutierLinks).on('new-content-ajax-loaded',initAjaxChutierLinks).on('new-content-ajax-loaded',initStudio).on('all-modal-closed',initStudio);};function initStudio(){if($('#studio-ui').length){$composer=$('.composition_ui .composer','#studio-ui');initAjaxChutierLinks();initAjaxCompoLinks();initDragAndDropUI();$('body').trigger({'type':'studio-initialized'});}else{$('body').trigger({'type':'studio-not-active'});}}
|
||||
function initAjaxChutierLinks(){$('.chutier-ajax-link:not(.ajax-enabled)').addClass('ajax-enabled').on('click',onClickChutierAjaxLink);};function onClickChutierAjaxLink(e){e.preventDefault();addRemoveToChutier($(this));return false;};function addRemoveToChutier($link){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$link.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onActionToChutierDone($link,data);}).fail(function(jqxhr,textStatus,error){onErrorActionToChutier(jqxhr,textStatus,error,$link);});};function onActionToChutierDone($link,data){$('body').trigger({'type':'chutier-action-done','action_done':data.action_done,'new_action':data.action_done=='add'?'remove':'add','target_id':$link.attr('target_id'),});$link.replaceWith(data.new_link);initAjaxChutierLinks();updateStudioChutier();};function onErrorActionToChutier(jqxhr,textStatus,error,$link){void 0;};function initAjaxCompoLinks(){$('.new-composition-link:not(.ajax-enabled)').on('click',onClickNewCompoLink).addClass('ajax-enabled');$('.composition-link:not(.ajax-enabled)').on('click',onClickCompoLink).addClass('ajax-enabled');$('.delete-composition-link:not(.ajax-enabled)').on('click',onClickDeleteCompoLink).addClass('ajax-enabled');};function onClickCompoLink(e){e.preventDefault();openCompo($(this));return false;};function openCompo($link){var cid=$link.attr('cid');var ajax_path=_settings.open_compo_ajax_url+'/'+cid;var path=window.location.origin+Drupal.url(ajax_path);$link.addClass('ajax-loading');$composer.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onOpenCompoDone(data,$link);}).fail(function(jqxhr,textStatus,error){onErrorOpenCompo(jqxhr,textStatus,error,$link);});};function onOpenCompoDone(data,$link){$('.composition-link').removeClass('is-active');$link.removeClass('ajax-loading').addClass('is-active');if($('.composition',$composer).length){$('.composition',$composer).replaceWith(data.compo);}else{$('header',$composer).after(data.compo);}
|
||||
$composer.removeClass('ajax-loading');initDragAndDropUI();$('body').trigger({'type':'on-studio-compo-opened'});};function onErrorOpenCompo(jqxhr,textStatus,error,$link){$link.removeClass('ajax-loading');void 0;};function onClickNewCompoLink(e){e.preventDefault();setInputForNewCompoName($(this));return false;};function setInputForNewCompoName($link){var $form=$('<form>').addClass('new-compo-form').append($('<input>').attr('type','text').attr('placeholder','new name')).append($('<button>').attr('type','submit').html('+')).submit(function(e){onNewCompoFormSubmit(e,$link,$(this));});$link.after($form).addClass('folded');$form.children('input[type="text"]').focus();};function onNewCompoFormSubmit(e,$link,$form){var name=$('input[type="text"]',$form).val();if(name!=''){$form.addClass('ajax-loading').children('*').attr('disabled','disabled');createNewCompo(name,$link,$form);}
|
||||
e.preventDefault();};function createNewCompo(name,$link,$form){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$.getJSON(path,{'new_name':name}).done(function(data){onCreateCompoDone(data,$link,$form);}).fail(function(jqxhr,textStatus,error){onErrorCreateCompo(jqxhr,textStatus,error,$link);});};function onCreateCompoDone(data,$link,$form){var $new_link=$(data.new_link);var $delete_link=$(data.delete_link);$link.removeClass('folded').parents('li').before($('<li>').append($new_link).append($delete_link));$form.remove();initAjaxCompoLinks();openCompo($new_link);};function onErrorCreateCompo(jqxhr,textStatus,error,$link){void 0;};function onClickDeleteCompoLink(e){e.preventDefault();deleteCompo($(this));return false;};function deleteCompo($link){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+Drupal.url(ajax_path);$link.parents('li').addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onDeleteCompoDone(data,$link);}).fail(function(jqxhr,textStatus,error){onErrorDeleteCompo(jqxhr,textStatus,error,$link);});};function onDeleteCompoDone(data,$link,$form){if(data.status=="ok"){$link.parents('li').remove();if($('.composition-link').length){openCompo($('.composition-link').eq(0));}else{$('.composition',$composer).html();}}else{void 0;}};function onErrorDeleteCompo(jqxhr,textStatus,error,$link){$link.parents('li').removeClass('ajax-loading');void 0;};function updateStudioChutier(){$studioChutier=$('#studio-ui .chutier_ui');if($studioChutier.length){var ajax_path=_settings.chutier_ui_ajax;var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$studioChutier.addClass('loading');$.getJSON(path,{}).done(function(data){onLoadedChutier($studioChutier,data);}).fail(function(jqxhr,textStatus,error){onLoadChutierError(jqxhr,textStatus,error,$studioChutier);});}};function onLoadedChutier($studioChutier,data){$studioChutier.replaceWith(data.rendered);initAjaxChutierLinks();setChutierDraggable();$('body').trigger({'type':'on-studio-chutier-updated'});}
|
||||
(function($,Drupal,drupalSettings){var _settings=drupalSettings.edlp_studio;var _$composer;function init(){initEvents();initStudio();};function initEvents(){$('body').on('new-audio-cartel-loaded',initAjaxChutierLinks).on('new-content-ajax-loaded',initAjaxChutierLinks).on('new-content-ajax-loaded',initStudio).on('all-modal-closed',initStudio);};function initStudio(){if($('#studio-ui').length){_$composer=$('.composition_ui .composer','#studio-ui');initAjaxChutierLinks();initAjaxCompoLinks();initDragAndDropUI();initUsedChutierInCompo();$('body').trigger({'type':'studio-initialized'});}else{$('body').trigger({'type':'studio-not-active'});}}
|
||||
function initAjaxChutierLinks(){$('.chutier-ajax-link:not(.ajax-enabled)').addClass('ajax-enabled').on('click',onClickChutierAjaxLink);};function onClickChutierAjaxLink(e){e.preventDefault();addRemoveToChutier($(this));return false;};function addRemoveToChutier($link){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$link.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onActionToChutierDone($link,data);}).fail(function(jqxhr,textStatus,error){onErrorActionToChutier(jqxhr,textStatus,error,$link);});};function onActionToChutierDone($link,data){$('body').trigger({'type':'chutier-action-done','action_done':data.action_done,'new_action':data.action_done=='add'?'remove':'add','target_id':$link.attr('target_id'),});$link.replaceWith(data.new_link);initAjaxChutierLinks();updateStudioChutier();};function onErrorActionToChutier(jqxhr,textStatus,error,$link){void 0;};function initAjaxCompoLinks(){$('.new-composition-link:not(.ajax-enabled)').on('click',onClickNewCompoLink).addClass('ajax-enabled');$('.composition-link:not(.ajax-enabled)').on('click',onClickCompoLink).addClass('ajax-enabled');$('.delete-composition-link:not(.ajax-enabled)').on('click',onClickDeleteCompoLink).addClass('ajax-enabled');};function initUsedChutierInCompo(){void 0;$('.documents',"#studio-ui .chutier_ui").on("wheel",function(event){void 0;this.scrollLeft+=event.originalEvent.deltaY;})
|
||||
$('.chutier-link.on-compo','#studio-ui .chutier_ui').removeClass('on-compo');var nid;$('.audio-link',_$composer).each(function(index,el){nid=$(el).attr('nid');void 0;$('.chutier-link[target_id="'+nid+'"]','#studio-ui .chutier_ui').addClass('on-compo');});};function onClickCompoLink(e){e.preventDefault();openCompo($(this));return false;};function openCompo($link){var cid=$link.attr('cid');var ajax_path=_settings.open_compo_ajax_url+'/'+cid;var path=window.location.origin+Drupal.url(ajax_path);$link.addClass('ajax-loading');_$composer.addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onOpenCompoDone(data,$link);}).fail(function(jqxhr,textStatus,error){onErrorOpenCompo(jqxhr,textStatus,error,$link);});};function onOpenCompoDone(data,$link){void 0;$('.composition-link').removeClass('is-active');$link.removeClass('ajax-loading').addClass('is-active');if($('.composition',_$composer).length){$('.composition',_$composer).replaceWith(data.compo);}else{$('header',_$composer).after(data.compo);}
|
||||
_$composer.removeClass('ajax-loading');if(!$('.field--name-documents .field__item',_$composer).length){_$composer.addClass('empty');}else{_$composer.removeClass('empty');}
|
||||
initDragAndDropUI();initUsedChutierInCompo();$('body').trigger({'type':'on-studio-compo-opened'});};function onErrorOpenCompo(jqxhr,textStatus,error,$link){$link.removeClass('ajax-loading');void 0;};function onClickNewCompoLink(e){e.preventDefault();setInputForNewCompoName($(this));return false;};function setInputForNewCompoName($link){var $form=$('<form>').addClass('new-compo-form').append($('<input>').attr('type','text').attr('placeholder','new name')).append($('<button>').attr('type','submit').html('+')).submit(function(e){onNewCompoFormSubmit(e,$link,$(this));});$link.after($form).addClass('folded');$form.children('input[type="text"]').focus();};function onNewCompoFormSubmit(e,$link,$form){var name=$('input[type="text"]',$form).val();if(name!=''){$form.addClass('ajax-loading').children('*').attr('disabled','disabled');createNewCompo(name,$link,$form);}
|
||||
e.preventDefault();};function createNewCompo(name,$link,$form){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$.getJSON(path,{'new_name':name}).done(function(data){onCreateCompoDone(data,$link,$form);}).fail(function(jqxhr,textStatus,error){onErrorCreateCompo(jqxhr,textStatus,error,$link);});};function onCreateCompoDone(data,$link,$form){var $new_link=$(data.new_link);var $delete_link=$(data.delete_link);$link.removeClass('folded').parents('li').after($('<li>').append($new_link).append($delete_link));$form.remove();initAjaxCompoLinks();openCompo($new_link);};function onErrorCreateCompo(jqxhr,textStatus,error,$link){void 0;};function onClickDeleteCompoLink(e){e.preventDefault();deleteCompo($(this));return false;};function deleteCompo($link){var ajax_path=$link.attr('data-drupal-link-system-path');var path=window.location.origin+Drupal.url(ajax_path);$link.parents('li').addClass('ajax-loading');$.getJSON(path,{}).done(function(data){onDeleteCompoDone(data,$link);}).fail(function(jqxhr,textStatus,error){onErrorDeleteCompo(jqxhr,textStatus,error,$link);});};function onDeleteCompoDone(data,$link,$form){if(data.status=="ok"){$link.parents('li').remove();if($('.composition-link').length){openCompo($('.composition-link').eq(0));}else{$('.composition',_$composer).html();}}else{void 0;}};function onErrorDeleteCompo(jqxhr,textStatus,error,$link){$link.parents('li').removeClass('ajax-loading');void 0;};function updateStudioChutier(){$studioChutier=$('#studio-ui .chutier_ui');if($studioChutier.length){var ajax_path=_settings.chutier_ui_ajax;var path=window.location.origin+drupalSettings.path.baseUrl+ajax_path;$studioChutier.addClass('loading');$.getJSON(path,{}).done(function(data){onLoadedChutier($studioChutier,data);}).fail(function(jqxhr,textStatus,error){onLoadChutierError(jqxhr,textStatus,error,$studioChutier);});}};function onLoadedChutier($studioChutier,data){$studioChutier.replaceWith(data.rendered);initAjaxChutierLinks();setChutierDraggable();$('body').trigger({'type':'on-studio-chutier-updated'});}
|
||||
function onLoadChutierError(jqxhr,textStatus,error,$studioChutier){void 0;$studioChutier.removeClass('loading');}
|
||||
function initDragAndDropUI(){if(!$('.composition_ui .composer .composition .field--name-documents').length){$field_documents=$('<div>').addClass('field').addClass('field--name-documents').appendTo('.composition_ui .composer .composition');}else{$field_documents=$('.composition_ui .composer .composition .field--name-documents');$('.field__item',$field_documents).each(function(i){$(this).prepend($('<span>').addClass('handler'));});}
|
||||
var $remove_zone=$('<div>').addClass('remove-drop-zone').appendTo('.composition_ui .composer .composition').droppable({tolerance:'pointer',over:function(e,ui){ui.draggable.addClass('ready-to-remove');},out:function(e,ui){ui.draggable.removeClass('ready-to-remove');},drop:function(e,ui){ui.draggable.remove();}});$field_documents.sortable({revert:false,handle:".handler",receive:function(e,ui){$('.field__item',this).attr('style','');},update:function(e,ui){onOrderChanged(e,ui);},connectWith:$remove_zone,});setChutierDraggable();};function setChutierDraggable(){$('.chutier_ui .item-list li>div').draggable({containment:$('#studio-ui'),scroll:false,helper:function(e){return $('<div>').addClass('field__item').append($('<article>').addClass('node').append($('<h2>').addClass('node-title').append($('.audio-link',this).clone().removeClass('ajax-enable')))).prepend($('<span>').addClass('handler'));},cursorAt:{bottom:10,left:10},zIndex:999,revert:true,revertDuration:0,connectToSortable:$('.composition_ui .composer .composition .field--name-documents'),});}
|
||||
function onOrderChanged(e,ui){var cid=$(e.target).parents('.composition').attr('cid');var documents={};$('a',e.target).each(function(i){documents[i]=$(this).attr('nid');});recordCompoList(cid,documents);};function recordCompoList(cid,docs){var ajax_path=_settings.save_compo_ajax_url+'/'+cid;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{documents:docs}).done(function(data){onRecordCompoDone(data);}).fail(function(jqxhr,textStatus,error){onErrorRecordCompo(jqxhr,textStatus,error);});$('body').trigger({'type':'on-studio-compo-updated'});}
|
||||
function onOrderChanged(e,ui){var cid=$(e.target).parents('.composition').attr('cid');var documents={};$('a',e.target).each(function(i){documents[i]=$(this).attr('nid');});initUsedChutierInCompo();_$composer.removeClass('empty');recordCompoList(cid,documents);};function recordCompoList(cid,docs){var ajax_path=_settings.save_compo_ajax_url+'/'+cid;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{documents:docs}).done(function(data){onRecordCompoDone(data);}).fail(function(jqxhr,textStatus,error){onErrorRecordCompo(jqxhr,textStatus,error);});$('body').trigger({'type':'on-studio-compo-updated'});}
|
||||
function onRecordCompoDone(data){if(data.status=="ok"){}else{void 0;}};function onErrorRecordCompo(jqxhr,textStatus,error){void 0;};init();})(jQuery,Drupal,drupalSettings);
|
||||
@@ -1,7 +1,7 @@
|
||||
(function ($, Drupal, drupalSettings) {
|
||||
|
||||
var _settings = drupalSettings.edlp_studio;
|
||||
var $composer;
|
||||
var _$composer;
|
||||
|
||||
// audio play is handled by edlp_theme
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
|
||||
function initStudio(){
|
||||
if($('#studio-ui').length){
|
||||
$composer = $('.composition_ui .composer', '#studio-ui');
|
||||
_$composer = $('.composition_ui .composer', '#studio-ui');
|
||||
initAjaxChutierLinks();
|
||||
initAjaxCompoLinks();
|
||||
initDragAndDropUI();
|
||||
initUsedChutierInCompo();
|
||||
$('body').trigger({'type':'studio-initialized'});
|
||||
}else{
|
||||
$('body').trigger({'type':'studio-not-active'});
|
||||
@@ -94,6 +95,25 @@
|
||||
.on('click', onClickDeleteCompoLink)
|
||||
.addClass('ajax-enabled');
|
||||
};
|
||||
function initUsedChutierInCompo(){
|
||||
console.log('initUsedChutierInCompo');
|
||||
|
||||
// invert scrolling
|
||||
$('.documents',"#studio-ui .chutier_ui").on("wheel", function(event) {
|
||||
console.log('wheel', event);
|
||||
this.scrollLeft += event.originalEvent.deltaY;
|
||||
})
|
||||
|
||||
$('.chutier-link.on-compo', '#studio-ui .chutier_ui').removeClass('on-compo');
|
||||
var nid;
|
||||
$('.audio-link', _$composer).each(function(index, el) {
|
||||
nid = $(el).attr('nid');
|
||||
console.log('compo item', nid);
|
||||
$('.chutier-link[target_id="'+nid+'"]', '#studio-ui .chutier_ui').addClass('on-compo');
|
||||
});
|
||||
|
||||
//audio-link
|
||||
};
|
||||
|
||||
// ___ ___
|
||||
// / _ \ _ __ ___ _ _ / __|___ _ __ _ __ ___
|
||||
@@ -111,7 +131,7 @@
|
||||
var ajax_path = _settings.open_compo_ajax_url+'/'+cid;
|
||||
var path = window.location.origin + Drupal.url(ajax_path);
|
||||
$link.addClass('ajax-loading');
|
||||
$composer.addClass('ajax-loading');
|
||||
_$composer.addClass('ajax-loading');
|
||||
$.getJSON(path, {})
|
||||
.done(function(data){
|
||||
onOpenCompoDone(data, $link);
|
||||
@@ -121,16 +141,22 @@
|
||||
});
|
||||
};
|
||||
function onOpenCompoDone(data, $link){
|
||||
//console.log('onActionToCompoDone',data);
|
||||
console.log('onOpenCompoDone',data);
|
||||
$('.composition-link').removeClass('is-active');
|
||||
$link.removeClass('ajax-loading').addClass('is-active');
|
||||
if($('.composition', $composer).length){
|
||||
$('.composition', $composer).replaceWith(data.compo);
|
||||
if($('.composition', _$composer).length){
|
||||
$('.composition', _$composer).replaceWith(data.compo);
|
||||
}else{
|
||||
$('header', $composer).after(data.compo);
|
||||
$('header', _$composer).after(data.compo);
|
||||
}
|
||||
_$composer.removeClass('ajax-loading');
|
||||
if(!$('.field--name-documents .field__item', _$composer).length){
|
||||
_$composer.addClass('empty');
|
||||
}else{
|
||||
_$composer.removeClass('empty');
|
||||
}
|
||||
$composer.removeClass('ajax-loading');
|
||||
initDragAndDropUI();
|
||||
initUsedChutierInCompo();
|
||||
$('body').trigger({
|
||||
'type':'on-studio-compo-opened'
|
||||
});
|
||||
@@ -192,7 +218,7 @@
|
||||
$link
|
||||
.removeClass('folded')
|
||||
.parents('li')
|
||||
.before($('<li>').append($new_link).append($delete_link));
|
||||
.after($('<li>').append($new_link).append($delete_link));
|
||||
$form.remove();
|
||||
// open new composition to composer
|
||||
initAjaxCompoLinks();
|
||||
@@ -233,7 +259,7 @@
|
||||
if($('.composition-link').length){
|
||||
openCompo($('.composition-link').eq(0));
|
||||
}else{
|
||||
$('.composition', $composer).html();
|
||||
$('.composition', _$composer).html();
|
||||
}
|
||||
}else{
|
||||
console.warn(data.message);
|
||||
@@ -342,7 +368,7 @@
|
||||
containment:$('#studio-ui'),
|
||||
scroll:false,
|
||||
helper:function(e){
|
||||
// we reproduce here the irem structure of destination sortable elements
|
||||
// we reproduce here the item structure of destination sortable elements
|
||||
// var $audio_link = $('.audio-link',this);
|
||||
return $('<div>').addClass('field__item')
|
||||
.append(
|
||||
@@ -374,6 +400,8 @@
|
||||
documents[i] = $(this).attr('nid');
|
||||
});
|
||||
// console.log(documents);
|
||||
initUsedChutierInCompo();
|
||||
_$composer.removeClass('empty');
|
||||
recordCompoList(cid, documents);
|
||||
};
|
||||
function recordCompoList(cid, docs){
|
||||
|
||||
@@ -41,12 +41,17 @@ function template_preprocess_edlp_chutier_ui(&$vars){
|
||||
$remove_url = Chutier::getActionsUrl($node->id(), $vars['uid']);
|
||||
|
||||
// build the link
|
||||
$vars['documents']['#items'][] = array(
|
||||
array_unshift($vars['documents']['#items'], array(
|
||||
'#type' => 'container',
|
||||
'entrees' => array(
|
||||
'#type' => 'container',
|
||||
'#attributes'=>['class'=>['entrees']],
|
||||
'#markup'=>$entrees,
|
||||
'remove_link' => array(
|
||||
'#title' => t("Chutier."),
|
||||
'#type' => 'link',
|
||||
'#url' => $remove_url,
|
||||
'#options'=>array(
|
||||
'attributes' => array(
|
||||
'data-drupal-link-system-path' => $remove_url->getInternalPath()
|
||||
),
|
||||
),
|
||||
),
|
||||
'link'=>array(
|
||||
'#title' => $trunc_title,
|
||||
@@ -64,17 +69,12 @@ function template_preprocess_edlp_chutier_ui(&$vars){
|
||||
),
|
||||
),
|
||||
),
|
||||
'remove_link' => array(
|
||||
'#title' => t("Chutier."),
|
||||
'#type' => 'link',
|
||||
'#url' => $remove_url,
|
||||
'#options'=>array(
|
||||
'attributes' => array(
|
||||
'data-drupal-link-system-path' => $remove_url->getInternalPath()
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
'entrees' => array(
|
||||
'#type' => 'container',
|
||||
'#attributes'=>['class'=>['entrees']],
|
||||
'#markup'=>$entrees,
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ function template_preprocess_edlp_compositions_list(&$vars){
|
||||
|
||||
$title = $entity->getName();
|
||||
|
||||
$vars['compositions']['#items'][] = array(
|
||||
array_unshift($vars['compositions']['#items'], array(
|
||||
'compo_link' => array(
|
||||
'#title' => $title,
|
||||
'#type' => 'link',
|
||||
@@ -29,7 +29,7 @@ function template_preprocess_edlp_compositions_list(&$vars){
|
||||
'attributes' => array(
|
||||
'data-drupal-link-system-path' => $url->getInternalPath(),
|
||||
'cid' => $entity->id(),
|
||||
'class' => ['composition-link', $i==0 ? 'is-active':''],
|
||||
'class' => ['composition-link', $i==count($vars['composition_entities'])-1 ? 'is-active':''],
|
||||
'title'=>$title,
|
||||
),
|
||||
),
|
||||
@@ -47,11 +47,11 @@ function template_preprocess_edlp_compositions_list(&$vars){
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
));
|
||||
$i++;
|
||||
}
|
||||
|
||||
$vars['compositions']['#items'][] = array(
|
||||
array_unshift($vars['compositions']['#items'], array(
|
||||
'#title' => t('New composition'),
|
||||
'#type' => 'link',
|
||||
'#url' => $vars['new_composition_url'],
|
||||
@@ -61,5 +61,5 @@ function template_preprocess_edlp_compositions_list(&$vars){
|
||||
'class' => ['new-composition-link']
|
||||
),
|
||||
),
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class StudioUIController extends ControllerBase {
|
||||
$query = \Drupal::entityQuery('composition')
|
||||
->condition('user_id', $this->user->id())
|
||||
->range(0,1)
|
||||
->sort('created');
|
||||
->sort('created', 'DESC');
|
||||
|
||||
$compos_id = $query->execute();
|
||||
if(count($compos_id)){
|
||||
|
||||
+166
-83
@@ -1,3 +1,6 @@
|
||||
/*jslint browser: true*/
|
||||
/*jslint jquery: true*/
|
||||
|
||||
/*
|
||||
* jQuery Hotkeys Plugin
|
||||
* Copyright 2010, John Resig
|
||||
@@ -8,106 +11,186 @@
|
||||
*
|
||||
* Original idea by:
|
||||
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
|
||||
*/
|
||||
*/
|
||||
|
||||
(function(jQuery){
|
||||
/*
|
||||
* One small change is: now keys are passed by object { keys: '...' }
|
||||
* Might be useful, when you want to pass some other data to your handler
|
||||
*/
|
||||
|
||||
jQuery.hotkeys = {
|
||||
version: "0.8+",
|
||||
(function(jQuery) {
|
||||
|
||||
specialKeys: {
|
||||
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
|
||||
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
|
||||
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
|
||||
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
|
||||
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
|
||||
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
|
||||
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 188: ",", 190: ".",
|
||||
191: "/", 224: "meta"
|
||||
},
|
||||
jQuery.hotkeys = {
|
||||
version: "0.8",
|
||||
|
||||
shiftNums: {
|
||||
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
|
||||
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
|
||||
".": ">", "/": "?", "\\": "|"
|
||||
}
|
||||
};
|
||||
specialKeys: {
|
||||
8: "backspace",
|
||||
9: "tab",
|
||||
10: "return",
|
||||
13: "return",
|
||||
16: "shift",
|
||||
17: "ctrl",
|
||||
18: "alt",
|
||||
19: "pause",
|
||||
20: "capslock",
|
||||
27: "esc",
|
||||
32: "space",
|
||||
33: "pageup",
|
||||
34: "pagedown",
|
||||
35: "end",
|
||||
36: "home",
|
||||
37: "left",
|
||||
38: "up",
|
||||
39: "right",
|
||||
40: "down",
|
||||
45: "insert",
|
||||
46: "del",
|
||||
59: ";",
|
||||
61: "=",
|
||||
96: "0",
|
||||
97: "1",
|
||||
98: "2",
|
||||
99: "3",
|
||||
100: "4",
|
||||
101: "5",
|
||||
102: "6",
|
||||
103: "7",
|
||||
104: "8",
|
||||
105: "9",
|
||||
106: "*",
|
||||
107: "+",
|
||||
109: "-",
|
||||
110: ".",
|
||||
111: "/",
|
||||
112: "f1",
|
||||
113: "f2",
|
||||
114: "f3",
|
||||
115: "f4",
|
||||
116: "f5",
|
||||
117: "f6",
|
||||
118: "f7",
|
||||
119: "f8",
|
||||
120: "f9",
|
||||
121: "f10",
|
||||
122: "f11",
|
||||
123: "f12",
|
||||
144: "numlock",
|
||||
145: "scroll",
|
||||
173: "-",
|
||||
186: ";",
|
||||
187: "=",
|
||||
188: ",",
|
||||
189: "-",
|
||||
190: ".",
|
||||
191: "/",
|
||||
192: "`",
|
||||
219: "[",
|
||||
220: "\\",
|
||||
221: "]",
|
||||
222: "'"
|
||||
},
|
||||
|
||||
function keyHandler( handleObj ) {
|
||||
shiftNums: {
|
||||
"`": "~",
|
||||
"1": "!",
|
||||
"2": "@",
|
||||
"3": "#",
|
||||
"4": "$",
|
||||
"5": "%",
|
||||
"6": "^",
|
||||
"7": "&",
|
||||
"8": "*",
|
||||
"9": "(",
|
||||
"0": ")",
|
||||
"-": "_",
|
||||
"=": "+",
|
||||
";": ": ",
|
||||
"'": "\"",
|
||||
",": "<",
|
||||
".": ">",
|
||||
"/": "?",
|
||||
"\\": "|"
|
||||
},
|
||||
|
||||
var origHandler = handleObj.handler,
|
||||
//use namespace as keys so it works with event delegation as well
|
||||
//will also allow removing listeners of a specific key combination
|
||||
//and support data objects
|
||||
keys = (handleObj.namespace || "").toLowerCase().split(" ");
|
||||
keys = jQuery.map(keys, function(key) { return key.split("."); });
|
||||
// excludes: button, checkbox, file, hidden, image, password, radio, reset, search, submit, url
|
||||
textAcceptingInputTypes: [
|
||||
"text", "password", "number", "email", "url", "range", "date", "month", "week", "time", "datetime",
|
||||
"datetime-local", "search", "color", "tel"],
|
||||
|
||||
//no need to modify handler if no keys specified
|
||||
//Added keys[0].substring(0, 12) to work with jQuery ui 1.9.0
|
||||
//Added accordion, tabs and menu, then jquery ui can use keys.
|
||||
options: {
|
||||
filterTextInputs: true
|
||||
}
|
||||
};
|
||||
|
||||
if (keys.length === 1 && (keys[0] === "" ||
|
||||
keys[0].substring(0, 12) === "autocomplete" ||
|
||||
keys[0].substring(0, 9) === "accordion" ||
|
||||
keys[0].substring(0, 4) === "tabs" ||
|
||||
keys[0].substring(0, 4) === "menu")) {
|
||||
return;
|
||||
}
|
||||
function keyHandler(handleObj) {
|
||||
if (typeof handleObj.data === "string") {
|
||||
handleObj.data = {
|
||||
keys: handleObj.data
|
||||
};
|
||||
}
|
||||
|
||||
handleObj.handler = function( event ) {
|
||||
// Don't fire in text-accepting inputs that we didn't directly bind to
|
||||
// important to note that $.fn.prop is only available on jquery 1.6+
|
||||
if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
|
||||
event.target.type === "text" || $(event.target).prop('contenteditable') == 'true' )) {
|
||||
return;
|
||||
}
|
||||
// Only care when a possible input has been specified
|
||||
if (!handleObj.data || !handleObj.data.keys || typeof handleObj.data.keys !== "string") {
|
||||
return;
|
||||
}
|
||||
|
||||
// Keypress represents characters, not special keys
|
||||
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
|
||||
character = String.fromCharCode( event.which ).toLowerCase(),
|
||||
key, modif = "", possible = {};
|
||||
var origHandler = handleObj.handler,
|
||||
keys = handleObj.data.keys.toLowerCase().split(" ");
|
||||
|
||||
// check combinations (alt|ctrl|shift+anything)
|
||||
if ( event.altKey && special !== "alt" ) {
|
||||
modif += "alt_";
|
||||
}
|
||||
handleObj.handler = function(event) {
|
||||
// Don't fire in text-accepting inputs that we didn't directly bind to
|
||||
if (this !== event.target && (/textarea|select/i.test(event.target.nodeName) ||
|
||||
(jQuery.hotkeys.options.filterTextInputs &&
|
||||
jQuery.inArray(event.target.type, jQuery.hotkeys.textAcceptingInputTypes) > -1))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( event.ctrlKey && special !== "ctrl" ) {
|
||||
modif += "ctrl_";
|
||||
}
|
||||
var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[event.which],
|
||||
character = String.fromCharCode(event.which).toLowerCase(),
|
||||
modif = "",
|
||||
possible = {};
|
||||
|
||||
// TODO: Need to make sure this works consistently across platforms
|
||||
if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
|
||||
modif += "meta_";
|
||||
}
|
||||
jQuery.each(["alt", "ctrl", "shift"], function(index, specialKey) {
|
||||
|
||||
if ( event.shiftKey && special !== "shift" ) {
|
||||
modif += "shift_";
|
||||
}
|
||||
if (event[specialKey + 'Key'] && special !== specialKey) {
|
||||
modif += specialKey + '+';
|
||||
}
|
||||
});
|
||||
|
||||
if ( special ) {
|
||||
possible[ modif + special ] = true;
|
||||
// metaKey is triggered off ctrlKey erronously
|
||||
if (event.metaKey && !event.ctrlKey && special !== "meta") {
|
||||
modif += "meta+";
|
||||
}
|
||||
|
||||
} else {
|
||||
possible[ modif + character ] = true;
|
||||
possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
|
||||
if (event.metaKey && special !== "meta" && modif.indexOf("alt+ctrl+shift+") > -1) {
|
||||
modif = modif.replace("alt+ctrl+shift+", "hyper+");
|
||||
}
|
||||
|
||||
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
|
||||
if ( modif === "shift_" ) {
|
||||
possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
|
||||
}
|
||||
}
|
||||
if (special) {
|
||||
possible[modif + special] = true;
|
||||
}
|
||||
else {
|
||||
possible[modif + character] = true;
|
||||
possible[modif + jQuery.hotkeys.shiftNums[character]] = true;
|
||||
|
||||
for ( var i = 0, l = keys.length; i < l; i++ ) {
|
||||
if ( possible[ keys[i] ] ) {
|
||||
return origHandler.apply( this, arguments );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
// "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
|
||||
if (modif === "shift+") {
|
||||
possible[jQuery.hotkeys.shiftNums[character]] = true;
|
||||
}
|
||||
}
|
||||
|
||||
jQuery.each([ "keydown", "keyup", "keypress" ], function() {
|
||||
jQuery.event.special[ this ] = { add: keyHandler };
|
||||
});
|
||||
for (var i = 0, l = keys.length; i < l; i++) {
|
||||
if (possible[keys[i]]) {
|
||||
return origHandler.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
})( jQuery );
|
||||
jQuery.each(["keydown", "keyup", "keypress"], function() {
|
||||
jQuery.event.special[this] = {
|
||||
add: keyHandler
|
||||
};
|
||||
});
|
||||
|
||||
})(jQuery || this.jQuery || window.jQuery);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 3.1749999 3.1750001"><path style="isolation:auto;mix-blend-mode:normal" d="M0 0h3.175v3.175H0z" color="#000" overflow="visible" fill="none"/><path d="M2.576.16c.029 0 .057.007.083.018a.207.207 0 0 1 .098.077.197.197 0 0 1 .038.117v2.431a.197.197 0 0 1-.038.117.207.207 0 0 1-.098.077.212.212 0 0 1-.083.016.224.224 0 0 1-.157-.06l-.831-.8-.832.8a.225.225 0 0 1-.34-.033.203.203 0 0 1-.036-.117V.372A.204.204 0 0 1 .516.178.209.209 0 0 1 .6.16z" style="line-height:20px;-inkscape-font-specification:'Crimson, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start" font-weight="400" font-family="#dc143c" letter-spacing="0" word-spacing="0" fill="#f80000"/></svg>
|
||||
|
After Width: | Height: | Size: 791 B |
+41
-17
@@ -1,14 +1,16 @@
|
||||
|
||||
(function($,Drupal,drupalSettings){EdlpTheme=function(){var _origin=window.location.origin;var _base_url=drupalSettings.path.baseUrl;var _ajax_settings=drupalSettings.edlp_ajax;var _$body=$('body');var _corpus_ready=false;var _$corpus_canvas;var _$row=$('main[role="main"]>.layout-content>.row');var _$ajaxLinks;var _audioPlayer;var _randomPlayer;var _compoPlayer;var _ajax_timing={start:0,end:0};var _corpus_promise;var _is_mobile=edlp_mobile.device_is_mobile;var _is_loggedin=drupalSettings.user.uid===0?false:true;var _$log_form;var _user_tokens;function init(){void 0;if(!_is_loggedin){initLogForm();}
|
||||
(function($,Drupal,drupalSettings){EdlpTheme=function(){var _origin=window.location.origin;var _base_url=drupalSettings.path.baseUrl;var _ajax_settings=drupalSettings.edlp_ajax;var _$body=$('body');var _corpus_ready=false;var _$corpus_canvas;var _$row=$('main[role="main"]>.layout-content>.row');var _$ajaxLinks;var _audioPlayer;var _randomPlayer;var _compoPlayer;var _ajax_timing={start:0,end:0};var _corpus_promise;var _is_mobile=edlp_mobile.device_is_mobile;var _is_loggedin=drupalSettings.user.uid===0?false:true;var _$log_form;var _user_tokens;var _states_history=[];var _is_expo=$('body').hasClass('domain-expo-encyclopediedelaparole-org');function init(){void 0;if(!_is_loggedin){initLogForm();}
|
||||
if(_is_mobile){initMobile();}
|
||||
initEvents();_audioPlayer=new AudioPlayer();_compoPlayer=new CompoPlayer();initAjaxLinks();initHistory();if(!_is_mobile){checkLayout();initAudioLinksHover();}
|
||||
if(_is_mobile){if(drupalSettings.path.isFront){initHomeMobile();}
|
||||
_$body.attr('booted','booted');}};function initLogForm(){void 0;_$log_form=$('#user-login-form:not(ajax-enebled)').on('submit',onSubmitLogForm).addClass('ajax-enabled');};function onSubmitLogForm(e){e.preventDefault();var args={name:$('input#edit-name[type="text"]',this).val(),pass:$('input#edit-pass[type="password"]',this).val()};logIn(args).then(getStudioLinkBlock);return false;};function logIn(args){void 0;_$log_form.addClass('ajax-loading');_$body.addClass('ajax-loading');return $.ajax({type:'POST',headers:{'Content-Type':'application/json'},xhrFields:{withCredentials:true},url:_origin+_base_url+"user/login?_format=json",data:JSON.stringify(args),success:function(response){_user_tokens=response;},error:function(xhr,ajaxOptions,thrownError){void 0;void 0;}});};function getStudioLinkBlock(){var path=_origin+_base_url+'edlp/ajax/blocks/json/';$.getJSON(path+"studiolinkblock",{}).done(onStudioLinkBlockLoaded).fail(function(jqxhr,textStatus,error){void 0;});};function onStudioLinkBlockLoaded(data){void 0;$('#block-studiouserlogin').replaceWith(data.blocks.studiolinkblock.rendered);initAjaxLinks();_$log_form.removeClass('ajax-loading');_$body.removeClass('ajax-loading');}
|
||||
_$body.attr('booted','booted');}};function initLogForm(){void 0;_$log_form=$('#user-login-form:not(ajax-enebled)').on('submit',onSubmitLogForm).addClass('ajax-enabled');};function onSubmitLogForm(e){e.preventDefault();var args={name:$('input#edit-name[type="text"]',this).val(),pass:$('input#edit-pass[type="password"]',this).val()};logIn(args).then(logedin);return false;};function logIn(args){void 0;_$log_form.addClass('ajax-loading');_$body.addClass('ajax-loading');return $.ajax({type:'POST',headers:{'Content-Type':'application/json'},xhrFields:{withCredentials:true},url:_origin+_base_url+"user/login?_format=json",data:JSON.stringify(args),success:function(response){_user_tokens=response;},error:function(xhr,ajaxOptions,thrownError){void 0;void 0;}});};function logedin(){$('body').addClass('user-logged-in');getStudioLinkBlock();};function getStudioLinkBlock(){var path=_origin+_base_url+'edlp/ajax/blocks/json/';$.getJSON(path+"studiolinkblock",{}).done(onStudioLinkBlockLoaded).fail(function(jqxhr,textStatus,error){void 0;});};function onStudioLinkBlockLoaded(data){void 0;$('#block-studiouserlogin').replaceWith(data.blocks.studiolinkblock.rendered);initAjaxLinks();refreshFavoritesLinks();_$log_form.removeClass('ajax-loading');_$body.removeClass('ajax-loading');}
|
||||
function initMobile(){$('h2, a','#block-mainnavigation').add('h2, a','#block-mainnavigation-2').on('click',onclickHomeMobileMenu);}
|
||||
function onclickHomeMobileMenu(e){$('#block-mainnavigation-2').toggleClass('opened');};function initHomeMobile(){};function initEvents(){var $corpus_df=$.Deferred();_corpus_promise=$corpus_df.promise();_$body.on('corpus-map-ready',function(e){onCorpusMapReady(e);$corpus_df.resolve();}).on('on-studio-chutier-updated',initAjaxLinks).on('studio-initialized',function(e){_compoPlayer.newCompo();}).on('studio-not-active',function(e){_compoPlayer.deactivate();}).on('on-studio-compo-updated',function(e){initAjaxLinks();_compoPlayer.refresh();}).on('on-studio-compo-opened',function(e){initAjaxLinks();_compoPlayer.newCompo();}).on('search-results-loaded',function(e){initAjaxLinks();initAudioLinksHover();checkVisibleCorpusMapSpace();}).on('open_entree',function(e){void 0;closeAllModals();checkLayout();_$body.removeClass();if(typeof e.url!='undefined'){var state=getSysPathState(e.sys_path);history.pushState(state,null,e.url);if(typeof _paq!=='undefined'){_paq.push(['setCustomUrl',e.url]);_paq.push(['setDocumentTitle',e.title]);_paq.push(['trackPageView']);}}}).on('close_entree',function(e){backToFrontPage();checkLayout();});window.addEventListener('resize',checkLayout,false);}
|
||||
function checkLayout(){var $audioplayer=$("#audio-player");if($audioplayer.length){var navpos=$('#block-mainnavigation').position();if(typeof navpos!='undefined'){$audioplayer.css({'width':navpos.left+'px'});}}
|
||||
checkGridBlockHeight();checkGridBlockVisible();};function initScrollbars(){};function getSysPathState(sys_path,view_mode){var state={'sys_path':sys_path,'ajax_path':sys_path};var node_match=state.ajax_path.match(/^\/?(node\/(\d+))$/i);void 0;var term_match=state.ajax_path.match(/^\/?(taxonomy\/term\/(\d+))$/i);void 0;if(node_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+node_match[1];state.node_nid=node_match[2];if(view_mode){state.ajax_path+='/'+view_mode;state.view_mode=view_mode;}}else if(term_match){state.ajax_path=_ajax_settings.entityjson_path+'/'+term_match[1];state.ajax_path=state.ajax_path.replace(/taxonomy\/term/,'taxonomy_term');state.entree_tid=term_match[2];if(view_mode){state.ajax_path+='/'+view_mode;state.view_mode=view_mode;}else{state.ajax_path=null;}}else{state.ajax_path+='/ajax'}
|
||||
return state;};function ajaxLoadContent(state){void 0;_$body.addClass('ajax-loading');_ajax_timing.start=performance.now();var path=_origin+Drupal.url(state.ajax_path);$.getJSON(path,{}).done(function(data){onAjaxLoaded(data,state);}).fail(function(jqxhr,textStatus,error){onAjaxLoadError(jqxhr,textStatus,error,state.sys_path);});};function onAjaxLoadError(jqxhr,textStatus,error,sys_path){void 0;$('.ajax-loading').removeClass('ajax-loading');_$body.removeClass('ajax-loading');};function onAjaxLoaded(data,state){void 0;var $rendered=$(data.rendered);$rendered.attr({'sys_path':state.sys_path,'view_mode':state.view_mode});if(data.entity_type=="node"&&data.bundle=="evenement"){if(_$row.find('.col.event').length){_$row.find('.col.event').replaceWith($rendered);}else if(_$row.find('.col.aside').length){_$row.find('.col.aside').replaceWith($rendered);}else{_$row.append($rendered);}}else{_$row.removeAttr('style').html($rendered);}
|
||||
return state;};function ajaxLoadContent(state){void 0;_$body.addClass('ajax-loading');_ajax_timing.start=performance.now();var path=_origin+Drupal.url(state.ajax_path);$.getJSON(path,{}).done(function(data){onAjaxLoaded(data,state);}).fail(function(jqxhr,textStatus,error){onAjaxLoadError(jqxhr,textStatus,error,state.sys_path);});};function onAjaxLoadError(jqxhr,textStatus,error,sys_path){void 0;$('.ajax-loading').removeClass('ajax-loading');_$body.removeClass('ajax-loading');};function onAjaxLoaded(data,state){void 0;var $rendered=$(data.rendered);$rendered.attr({'sys_path':state.sys_path,'view_mode':state.view_mode});if(data.entity_type=="node"&&data.bundle=="evenement"){if(_$row.find('.col.event').length){_$row.find('.col.event').replaceWith($rendered);}else if(_$row.find('.col.aside').length){_$row.find('.col.aside').replaceWith($rendered);}else{_$row.append($rendered);}}
|
||||
else if((state.context=='document-transcript'||state.context=='document-artcile')&&state.caller=="search"){_$row.append($rendered);}
|
||||
else{_$row.removeAttr('style').html($rendered);}
|
||||
if((data.entity_type=="node"&&data.bundle=="static")||state.sys_path=="docsindex"){$('.ajax-link.is-active.articles-link').removeClass('is-active');}
|
||||
var body_classes=['path-'+state.sys_path.replace(/\//g,'-'),'entity-type-'+data.entity_type,'bundle-'+data.bundle,'view-mode-'+data.view_mode];_$body.removeClass().addClass(body_classes.join(' '));if(state.node_nid)
|
||||
_$body.addClass('path-edlp-node');$('.ajax-loading').removeClass('ajax-loading');$('.ajax-link.is-active:not(.articles-link)').removeClass('is-active');$('.is-active-trail').removeClass('is-active-trail');if(typeof state.selector!='undefined'){void 0;$('a[selector="'+state.selector+'"]').addClass('is-active');initAudioLinksHover();}else{if(typeof state.view_mode!='undefined'){$('a[viewmode="'+state.view_mode+'"][data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');}else{_corpus_promise.done(function(){$('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');});}
|
||||
@@ -23,8 +25,12 @@ if(data.entity_type=="node"&&data.bundle=="enregistrement"&&data.view_mode=="tra
|
||||
if(state.sys_path=="search"){initSearch();}
|
||||
if(typeof data.translations_links!='undefined'){void 0;var lang_code=drupalSettings.path.currentLanguage;var $links=$(data.translations_links);$links.find('li[hreflang="'+lang_code+'"]').addClass('is-active').find('a').addClass('is-active');if(state.view_mode){$links.find('a').each(function(i,e){var $a=$(this);$a.attr('href',$a.attr('href')+'#'+state.view_mode);});}
|
||||
$('ul','.block.language-switcher-language-url').replaceWith($links);}
|
||||
initAjaxLinks();initAudioLinksHover();checkVisibleCorpusMapSpace();_$body.trigger({'type':'new-content-ajax-loaded'});Drupal.attachBehaviors(_$row[0]);_$body.attr('booted','booted');_$body.removeClass('ajax-loading');if(state.url){history.pushState(state,null,state.url);if(typeof _paq!=='undefined'){_paq.push(['setCustomUrl',state.url]);_paq.push(['setDocumentTitle',data.title]);_ajax_timing.end=performance.now();_paq.push(['setGenerationTimeMs',_ajax_timing.end-_ajax_timing.start]);_paq.push(['trackPageView']);}}};function initAudioLinksHover(){void 0;_$row.find('a.audio-link').on('mouseover',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseover-audio-link',nid:$(this).attr('nid')});}}).on('mouseout',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseout-audio-link',nid:$(this).attr('nid')});}});};function addCloseModalBtnToCols(){if(_is_mobile)return;$('.col',_$row).each(function(index,el){if($('span.close-col-btn',this).length)
|
||||
return true;$(this).children('.wrapper').prepend($('<span>').addClass('close-col-btn').on('click',onCloseModal));});};function onCloseModal(e){void 0;var $col=$(this).parents('.col');var theme=$col.attr('theme');if(theme!=''){_$body.trigger({'type':theme+'-col-closed'});}
|
||||
initAjaxLinks();initAudioLinksHover();checkVisibleCorpusMapSpace();_$body.trigger({'type':'new-content-ajax-loaded'});Drupal.attachBehaviors(_$row[0]);_$body.attr('booted','booted');_$body.removeClass('ajax-loading');_states_history.unshift(state);if(state.url){history.pushState(state,null,state.url);if(typeof _paq!=='undefined'){_paq.push(['setCustomUrl',state.url]);_paq.push(['setDocumentTitle',data.title]);_ajax_timing.end=performance.now();_paq.push(['setGenerationTimeMs',_ajax_timing.end-_ajax_timing.start]);_paq.push(['trackPageView']);}}};function initAudioLinksHover(){void 0;_$row.find('a.audio-link').not('article.node--view-mode-docsindex a.audio-link').on('mouseover',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseover-audio-link',nid:$(this).attr('nid')});}}).on('mouseout',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseout-audio-link',nid:$(this).attr('nid')});}});};function addCloseModalBtnToCols(){if(_is_mobile)return;$('.col',_$row).each(function(index,el){if($('span.close-col-btn',this).length)
|
||||
return true;$(this).children('.wrapper').prepend($('<span>').addClass('close-col-btn').on('click',onCloseModal));});};function onCloseModal(e){void 0;void 0;if(['document-transcript','document-article'].indexOf(_states_history[0].context)!=-1)
|
||||
{if(_states_history[0].caller=="production"){for(var i=0;i<_states_history.length;i++){if(_states_history[i].context=="production"){void 0;ajaxLoadContent(_states_history[i]);return;}}}
|
||||
if(_states_history[0].caller=="entree-index"){for(var i=0;i<_states_history.length;i++){if(_states_history[i].context=="entree-index"){void 0;ajaxLoadContent(_states_history[i]);return;}}}
|
||||
if(_states_history[0].caller=="entree-notice"){for(var i=0;i<_states_history.length;i++){if(_states_history[i].context=="entree-notice"){void 0;ajaxLoadContent(_states_history[i]);return;}}}}
|
||||
var $col=$(this).parents('.col');var theme=$col.attr('theme');if(theme!=''){_$body.trigger({'type':theme+'-col-closed'});}
|
||||
if(_$body.is('.entity-type-node.bundle-page')&&$(this).next().is('.node--type-page')){$col.add($col.siblings('.col')).remove();}else{$col.remove();}
|
||||
checkRowEmpty();checkVisibleCorpusMapSpace();if($col.attr('view_mode')&&$col.attr('sys_path')){$('a[data-drupal-link-system-path="'+$col.attr('sys_path')+'"][viewmode="'+$col.attr('view_mode')+'"]').removeClass('is-active');}};function initHistory(){initFirstLoad();window.addEventListener('popstate',onHistoryPopState);};function initFirstLoad(){void 0;void 0;var edlp_origin=JSON.parse(window.localStorage.getItem('edlp_origin'));void 0;if(edlp_origin!=null&&edlp_origin.sys_path){var hash=edlp_origin.hash.replace('#','');var state=getSysPathState(edlp_origin.sys_path,hash);if(edlp_origin.entity_type=="taxonomy_term"&&edlp_origin.entity_bundle=="entrees"&&hash){state.selector='entree-'+hash+'-link-'+edlp_origin.entity_id;if(_corpus_ready){_$corpus_canvas.trigger({type:'open-entree',tid:edlp_origin.entity_id});}else{$('li.entree[tid="'+edlp_origin.entity_id+'"] a.term-link').addClass('is-active');}}
|
||||
if(edlp_origin.audio_url){var node={nid:edlp_origin.entity_id,audio_url:edlp_origin.audio_url};_audioPlayer.openDocument(node,'history_first_load');closeAllModals();if(hash==""||hash=='random'){state.audio=true;state.node=node;_$body.attr('booted','booted');}else{ajaxLoadContent(state);}}
|
||||
@@ -35,43 +41,61 @@ else if(e.state.audio){_audioPlayer.openDocument(e.state.node,'popstate',e.state
|
||||
else{if(e.state.entree_tid){openEntree(e.state.entree_tid);}
|
||||
if(e.state.ajax_path){e.state.url=null;ajaxLoadContent(e.state);}}};function initAjaxLinks(){$('a','#block-mainnavigation').add('a','#block-mainnavigation-2').add('a','#block-footer.menu--footer').add('a','#block-productions').add('a','article.node:not(.node--type-enregistrement) h2.node-title').add('a','.productions-subtree').add('a','.productions-parent').add('a','.field--name-field-son').addClass('ajax-link');if(!_is_mobile){$('a.site-name','#block-edlptheme-branding').addClass('ajax-link');}
|
||||
_$ajaxLinks=$('.ajax-link');activateAjaxLinks();};function activateAjaxLinks(){_$ajaxLinks.each(function(i,e){var $this=$(this);if($this.is('.ajax-enable'))return;if($this.attr('data-drupal-link-system-path')||$this.is('[type^="audio"]')){$this.on('click',onClickAjaxLink).addClass('ajax-enable');}});};function onClickAjaxLink(e){e.preventDefault();var $link=$(this);if($link.is('.is-active')&&!$link.is('.site-name'))
|
||||
return false;if($link.is('.audio-link')){caller=$link.parents('.lastdocs, .lastdocs-home').length?'lastdocs':null;_audioPlayer.emmit('stop-shuffle').openDocument({nid:$link.attr('nid'),audio_url:$link.attr('audio_url'),title:$link.find('.field--name-title').html()},caller);return false;}
|
||||
return false;if($link.is('.audio-link')){caller=$link.parents('.lastdocs, .lastdocs-home').length?'lastdocs':null;if(!caller){caller=$link.parents('.composition_ui').length?'studio-compo':null;}
|
||||
if(caller=='studio-compo'){var index=$link.parents('.field__item').index();void 0;_compoPlayer.start(index);}else{_audioPlayer.emmit('stop-shuffle').openDocument({nid:$link.attr('nid'),audio_url:$link.attr('audio_url'),title:$link.find('.field--name-title').html()},caller);}
|
||||
return false;}
|
||||
if($link.is('[type^="audio"]')){_audioPlayer.emmit('stop-shuffle').openSound($link.attr('href'),$link.html());return false;}
|
||||
var sys_path=$(this).attr('data-drupal-link-system-path');if(sys_path=='<front>'){if(!_is_mobile){if($link.is('.is-active')&&_corpus_ready){_$corpus_canvas.trigger({'type':'shuffle-collection'});}else{backToFrontPage();}
|
||||
return false;}}
|
||||
var view_mode=$link.attr('viewmode');var state=getSysPathState(sys_path,view_mode);state.url=$(this).attr('href');if(view_mode){state.url+="#"+view_mode;}
|
||||
var contexts=/^.*\/(productions|documents|entrees|search)(\/.*)?/g.exec(state.url);void 0;if(contexts){switch(contexts[1]){case'productions':state.context="production"
|
||||
break;case'entrees':switch(view_mode){case'index':state.context="entree-index";break;case'notice':state.context="entree-notice";break;}
|
||||
break;case'search':state.context="search";break;case'documents':switch(view_mode){case'transcript':state.context="document-transcript";break;case'article':state.context="document-article";break;default:state.context="document";}
|
||||
if(typeof _states_history[0]!="undefined"){if(_states_history[0].caller){state.caller=_states_history[0].caller}else{state.caller=_states_history[0].context}}else{state.caller=null;}
|
||||
break;}}else{state.context=null;}
|
||||
if($link.is('[selector]')){state.selector=$link.attr('selector');}
|
||||
$link.addClass('ajax-loading');ajaxLoadContent(state);return false;};function onCorpusMapReady(e){_corpus_ready=true;_$corpus_canvas=$('canvas#corpus-map');_$corpus_canvas.on('corpus-cliked-on-map',function(e){backToFrontPage();}).on('corpus-cliked-on-node',function(e){_audioPlayer.emmit('stop-shuffle').openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);initAjaxLinks();_$body.attr('corpus-map','ready');}
|
||||
function openEntree(tid){if(tid){closeAllModals();_$body.removeClass();if(_corpus_ready){_$corpus_canvas.trigger({type:'open-entree',tid:tid});}else{$('li.entree[tid="'+tid+'"] a.term-link').addClass('is-active');}}};function checkVisibleCorpusMapSpace(){var left_limit=0,right_limit=0;_$row.find('.col').each(function(i,e){var $col=$(this);var offset=$col.offset();void 0;switch(true){case $col.is('.float-right'):right_limit=Math.max(right_limit,Math.abs(offset.left-15-window.innerWidth));break;default:left_limit=Math.max(left_limit,offset.left+$col.width()+15);break;}});void 0;if(_corpus_ready){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});}else{_corpus_promise.done(function(){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});});}};function AudioPlayer(){var that=this;this.fid;this.audio=new Audio();this.audio_events=["loadedmetadata","playing","pause","timeupdate","ended","error"];this.$container=$('<div id="audio-player">');this.$btns=$('<div>').addClass('btns').appendTo(this.$container);this.$previous=$('<div>').addClass('previous').appendTo(this.$btns);this.$playpause=$('<div>').addClass('play-pause').appendTo(this.$btns);this.$next=$('<div>').addClass('next').appendTo(this.$btns);this.$timelinecont=$('<div>').addClass('time-line-container').appendTo(this.$container);this.$timeline=$('<div>').addClass('time-line').appendTo(this.$timelinecont);this.$loader=$('<div>').addClass('loader').appendTo(this.$timeline);this.$cursor=$('<div>').addClass('cursor').appendTo(this.$timeline);this.$time=$('<div>').addClass('time').appendTo(this.$container);this.$currentTime=$('<div>').addClass('current-time').html('00:00').appendTo(this.$time);this.$duration=$('<div>').addClass('duration').html('00:00').appendTo(this.$time);this.$fav=$('<div>').addClass('favoris').appendTo(this.$container);this.$cartel=$('<div>').addClass('cartel').appendTo(this.$container);this.scndCartel_visible=0;this.cartelSwitchIntervalMS=7000;this.cartelSwitchInterval=false;this.hideTimer=false;this.hideTimeMS=15000;this.currentHistoricIndex=null;this.historic=[];this.shuffle_is_active=false;this.auto_open_article=false;this.event_handlers={'audio-open-document':[],'audio-play':[],'audio-pause':[],'audio-play-next':[],'audio-ended':[],'stop-shuffle':[]};this.init();};AudioPlayer.prototype={init(){this.$container_parent=$('header[role="banner"] .region-header');this.$container.appendTo(this.$container_parent);this.timeline_w=parseInt(this.$timeline.width());this.$loader.on('click',this.seek.bind(this));var fn='';for(var i=0;i<this.audio_events.length;i++){fn=this.audio_events[i];fn='on'+fn.charAt(0).toUpperCase()+fn.slice(1);this.audio.addEventListener(this.audio_events[i],this[fn].bind(this),true);}
|
||||
$link.addClass('ajax-loading');ajaxLoadContent(state);return false;};function refreshFavoritesLinks(){void 0;_audioPlayer.reloadNode();if(_states_history[0].view_mode=='index'||_states_history[0].sys_path=="docsindex"){ajaxLoadContent(_states_history[0]);}}
|
||||
function onCorpusMapReady(e){_corpus_ready=true;_$corpus_canvas=$('canvas#corpus-map');_$corpus_canvas.on('corpus-cliked-on-map',function(e){backToFrontPage();}).on('corpus-cliked-on-node',function(e){_audioPlayer.emmit('stop-shuffle').openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);if(_is_expo){initExpo();}
|
||||
initAjaxLinks();_$body.attr('corpus-map','ready');}
|
||||
function openEntree(tid){if(tid){closeAllModals();_$body.removeClass();if(_corpus_ready){_$corpus_canvas.trigger({type:'open-entree',tid:tid});}else{$('li.entree[tid="'+tid+'"] a.term-link').addClass('is-active');}}};function checkVisibleCorpusMapSpace(){var left_limit=0,right_limit=0;_$row.find('.col').each(function(i,e){var $col=$(this);var offset=$col.offset();void 0;switch(true){case $col.is('.float-right'):right_limit=Math.max(right_limit,Math.abs(offset.left-15-window.innerWidth));break;default:left_limit=Math.max(left_limit,offset.left+$col.width()+15);break;}});void 0;if(_corpus_ready){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});}else{_corpus_promise.done(function(){_$body.trigger({type:'visible-space-changed',left_limit:left_limit,right_limit:right_limit});});}};function AudioPlayer(){var that=this;this.fid;this.audio=new Audio();this.audio_events=["loadedmetadata","playing","pause","timeupdate","ended","error"];this.$container=$('<div id="audio-player">');this.$btns=$('<div>').addClass('btns').appendTo(this.$container);this.$previous=$('<div>').addClass('previous').appendTo(this.$btns);this.$playpause=$('<div>').addClass('play-pause').appendTo(this.$btns);this.$next=$('<div>').addClass('next').appendTo(this.$btns);this.$timelinecont=$('<div>').addClass('time-line-container').appendTo(this.$container);this.$timeline=$('<div>').addClass('time-line').appendTo(this.$timelinecont);this.$loader=$('<div>').addClass('loader').appendTo(this.$timeline);this.$cursor=$('<div>').addClass('cursor').appendTo(this.$timeline);this.$time=$('<div>').addClass('time').appendTo(this.$container);this.$currentTime=$('<div>').addClass('current-time').html('00:00').appendTo(this.$time);this.$duration=$('<div>').addClass('duration').html('00:00').appendTo(this.$time);this.$fav=$('<div>').addClass('favoris').appendTo(this.$container);this.$cartel=$('<div>').addClass('cartel').appendTo(this.$container);this.scndCartel_visible=0;this.cartelSwitchIntervalMS=7000;this.cartelSwitchInterval=false;this.visible=false;this.hideTimer=false;this.hideTimeMS=15000;this.currentHistoricIndex=null;this.historic=[];this.shuffle_is_active=false;this.auto_open_article=false;this.event_handlers={'audio-open-document':[],'audio-play':[],'audio-pause':[],'audio-play-next':[],'audio-ended':[],'stop-shuffle':[]};this.init();};AudioPlayer.prototype={init(){if(!_is_expo){this.$container_parent=$('header[role="banner"] .region-header');}else{this.$container_parent=$('main[role="main"]');}
|
||||
this.$container.appendTo(this.$container_parent);this.timeline_w=parseInt(this.$timeline.width());this.$loader.on('click',this.seek.bind(this));var fn='';for(var i=0;i<this.audio_events.length;i++){fn=this.audio_events[i];fn='on'+fn.charAt(0).toUpperCase()+fn.slice(1);this.audio.addEventListener(this.audio_events[i],this[fn].bind(this),true);}
|
||||
this.$previous.on('click',this.playPrevious.bind(this));this.$playpause.on('click',this.togglePlayPause.bind(this));this.$next.on('click',this.playNext.bind(this));},openDocument(node,caller,historic_index){void 0;if(typeof node=='undefined'||typeof node.nid=='undefined'||typeof node.audio_url=='undefined'){void 0;return false;}
|
||||
if(typeof caller=='undefined'||caller!='popstate'){this.historic.push(node);this.currentHistoricIndex=this.historic.length-1;if(caller!="history_first_load"){if(typeof node.document_url=='undefined'){void 0;}else{var state={audio:true,node:{nid:node.nid,audio_url:node.audio_url,document_url:node.document_url,title:node.title||null,},historic_index:this.currentHistoricIndex,};var url=node.document_url+(caller=='random'?'#random':'');history.pushState(state,null,url);}}}else{this.currentHistoricIndex=historic_index;}
|
||||
if(typeof caller=='undefined'||caller!='popstate'){void 0;this.historic.push(node);this.currentHistoricIndex=this.historic.length-1;if(caller!="history_first_load"){if(typeof node.document_url=='undefined'){void 0;}else{var state={audio:true,node:{nid:node.nid,audio_url:node.audio_url,document_url:node.document_url,title:node.title||null,},historic_index:this.currentHistoricIndex,};var url=node.document_url+(caller=='random'?'#random':'');history.pushState(state,null,url);}}}else{this.currentHistoricIndex=historic_index;}
|
||||
if(_$body.is('.path-frontpage')&&caller!=='lastdocs'&&!_is_mobile){closeAllModals();}
|
||||
this.emmit('audio-open-document',{caller:caller});if(typeof _paq!=='undefined'){if(typeof node.title!='undefined'){_paq.push(['trackEvent','Audio','play',node.title]);}}
|
||||
this.launch();},launch(){this.clearTimeOutToHide();this.clearIntervalAutoCartelSwitch();this.setSRC(this.historic[this.currentHistoricIndex].audio_url);if(!_is_mobile){this.loadNode(this.historic[this.currentHistoricIndex].nid);}
|
||||
try{_$corpus_canvas.trigger({'type':'audio-node-opened','nid':this.historic[this.currentHistoricIndex].nid});}catch(e){void 0;var that=this;_corpus_promise.done(function(){_$corpus_canvas.trigger({'type':'audio-node-opened','nid':that.historic[that.currentHistoricIndex].nid});});}
|
||||
this.showHidePreviousBtn();this.showHideNextBtn();this.show();},openSound(url,title){this.hide();this.clearTimeOutToHide();this.$cartel.html("");this.setSRC(url);this.show();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','Audio','play',url]);}},setSRC(url){void 0;this.audio.src=url;this.play();},onLoadedmetadata(){var rem=parseInt(this.audio.duration,10),mins=Math.floor(rem/60,10),secs=rem-mins*60;this.$duration.html('<span>'+(mins<10?'0':'')+mins+':'+(secs<10?'0':'')+secs+'</span>');this.updateLoadingBar();},updateLoadingBar(){void 0;if(this.audio.buffered.length>0){this.$loader.css({'width':parseInt((100*this.audio.buffered.end(0)/this.audio.duration),10)+'%'});if(this.audio.buffered.end(0)<this.audio.duration){window.requestAnimationFrame(this.updateLoadingBar.bind(this));}else{void 0;}}else{window.requestAnimationFrame(this.updateLoadingBar.bind(this));}},onError(){void 0;},play(){this.clearTimeOutToHide();var promise=this.audio.play();if(promise!==undefined){promise.catch(function(error){void 0;}).then(function(){void 0;});}},playPrevious(){if(this.currentHistoricIndex>0){this.currentHistoricIndex-=1;this.launch();}},playNext(){if(this.currentHistoricIndex<this.historic.length-1){this.currentHistoricIndex+=1;this.launch();}else{this.emmit('audio-play-next');}},togglePlayPause(e){if(this.audio.paused){this.play();}else{this.stop();}},stop(){this.audio.pause();if(!(_$body.is('.path-node-'+this.historic[this.currentHistoricIndex].nid)&&(_$body.is('.view-mode-article')||_$body.is('.view-mode-transcript')))){this.timeOutToHide();}},seek(e){var seek=e.originalEvent.layerX/this.timeline_w*this.audio.duration
|
||||
void 0;this.audio.currentTime=seek;},onPlaying(){this.$btns.addClass('is-playing');this.emmit('audio-play');},onPause(){this.$btns.removeClass('is-playing');this.emmit('audio-pause');},onTimeupdate(){this.$cursor.css({'left':(this.audio.currentTime/this.audio.duration*this.timeline_w)+"px"});var rem=parseInt(this.audio.currentTime,10),mins=Math.floor(rem/60,10),secs=rem-mins*60;this.$currentTime.html('<span>'+(mins<10?'0':'')+mins+':'+(secs<10?'0':'')+secs+'</span>');},onEnded(){void 0;this.stop();this.emmit('audio-ended');},loadNode(nid){this.$cartel.addClass('loading');var vm='player_cartel';var ajax_path=_ajax_settings.entityjson_path+'/node/'+nid+'/'+vm;var path=_origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){void 0;this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();this.scndCartel_visible=0;this.$cartel.removeClass('second-visible');if(this.$cartel.find('.second-cartel .col-left').children().length>1||this.$cartel.find('.second-cartel').children('.col-right').length){this.cartelSwitchInterval=setInterval(this.switchCartel.bind(this),this.cartelSwitchIntervalMS);}
|
||||
Drupal.attachBehaviors(this.$cartel);this.setAutoOpenArticle();if(this.auto_open_article){this.$cartel.find('a.link-article').trigger('click');this.auto_open_article=false;}},onNodeLoadFail(jqxhr,textStatus,error){void 0;this.$cartel.removeClass('loading').html('');},setAutoOpenArticle(art){this.auto_open_article=$('a.articles-link').is('.is-active');return this;},show(){this.$container_parent.addClass('audio-player-visible');this.$container.addClass('visible');},showHidePreviousBtn(){if(this.historic.length>1&&this.currentHistoricIndex>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}},showHideNextBtn(){if(this.currentHistoricIndex<this.historic.length-1||this.shuffle_is_active){this.$next.addClass('is-active');}else{this.$next.removeClass('is-active');}},timeOutToHide(){this.clearTimeOutToHide();this.hideTimer=setTimeout(this.hide.bind(this),this.hideTimeMS);},clearTimeOutToHide(){if(this.hideTimer){clearTimeout(this.hideTimer);this.hideTimer=false;}},switchCartel(){if(this.scndCartel_visible){this.$cartel.removeClass('second-visible');this.scndCartel_visible=0;this.clearIntervalAutoCartelSwitch();}else{this.$cartel.addClass('second-visible');this.scndCartel_visible=1;}},clearIntervalAutoCartelSwitch(){if(this.cartelSwitchInterval){clearInterval(this.cartelSwitchInterval);this.cartelSwitchInterval=false;}},hide(){this.$container_parent.removeClass('audio-player-visible');this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},deActivateRandom(){this.shuffle_is_active=false;this.showHideNextBtn();},on(event_name,handler){if(typeof this.event_handlers[event_name]=='undefined'){void 0;}
|
||||
void 0;this.audio.currentTime=seek;},seekToEnd(){if(this.audio.duration>40){void 0;this.audio.currentTime=this.audio.duration-20;}},onPlaying(){this.$btns.addClass('is-playing');this.emmit('audio-play');},onPause(){this.$btns.removeClass('is-playing');this.emmit('audio-pause');},onTimeupdate(){this.$cursor.css({'left':(this.audio.currentTime/this.audio.duration*this.timeline_w)+"px"});var rem=parseInt(this.audio.currentTime,10),mins=Math.floor(rem/60,10),secs=rem-mins*60;this.$currentTime.html('<span>'+(mins<10?'0':'')+mins+':'+(secs<10?'0':'')+secs+'</span>');},onEnded(){void 0;this.stop();this.emmit('audio-ended');},reloadNode(){if(this.visible){if(!_is_mobile){void 0;this.loadNode(this.historic[this.currentHistoricIndex].nid);}}},loadNode(nid){this.$cartel.addClass('loading');var vm='player_cartel';var ajax_path=_ajax_settings.entityjson_path+'/node/'+nid+'/'+vm;var path=_origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){void 0;this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();this.scndCartel_visible=0;this.$cartel.removeClass('second-visible');if(!_is_expo){if(this.$cartel.find('.second-cartel .col-left').children().length>1||this.$cartel.find('.second-cartel').children('.col-right').length){this.cartelSwitchInterval=setInterval(this.switchCartel.bind(this),this.cartelSwitchIntervalMS);}
|
||||
Drupal.attachBehaviors(this.$cartel);}
|
||||
this.setAutoOpenArticle();if(this.auto_open_article){this.$cartel.find('a.link-article').trigger('click');this.auto_open_article=false;}},onNodeLoadFail(jqxhr,textStatus,error){void 0;this.$cartel.removeClass('loading').html('');},setAutoOpenArticle(art){this.auto_open_article=$('a.articles-link').is('.is-active');return this;},show(){this.visible=true;this.$container_parent.addClass('audio-player-visible');this.$container.addClass('visible');},showHidePreviousBtn(){if(this.historic.length>1&&this.currentHistoricIndex>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}},showHideNextBtn(){if(this.currentHistoricIndex<this.historic.length-1||this.shuffle_is_active){this.$next.addClass('is-active');}else{this.$next.removeClass('is-active');}},timeOutToHide(){this.clearTimeOutToHide();this.hideTimer=setTimeout(this.hide.bind(this),this.hideTimeMS);},clearTimeOutToHide(){if(this.hideTimer){clearTimeout(this.hideTimer);this.hideTimer=false;}},switchCartel(){if(this.scndCartel_visible){this.$cartel.removeClass('second-visible');this.scndCartel_visible=0;this.clearIntervalAutoCartelSwitch();}else{this.$cartel.addClass('second-visible');this.scndCartel_visible=1;}},clearIntervalAutoCartelSwitch(){if(this.cartelSwitchInterval){clearInterval(this.cartelSwitchInterval);this.cartelSwitchInterval=false;}},hide(){this.visible=false;this.$container_parent.removeClass('audio-player-visible');this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},deActivateRandom(){this.shuffle_is_active=false;this.showHideNextBtn();},on(event_name,handler){if(typeof this.event_handlers[event_name]=='undefined'){void 0;}
|
||||
this.event_handlers[event_name].push(handler);return this;},emmit(event_name,args){void 0;var handler;var args=args||{};for(var i=this.event_handlers[event_name].length-1;i>=0;i--){handler=this.event_handlers[event_name][i];(function(handler,args){setTimeout(function(){handler(args);},0);}(handler,args));}
|
||||
return this;},}
|
||||
function RandomPlayer(playlist){this.active=false;this.playlist=playlist;this.path=_base_url+drupalSettings.path.pathPrefix+'#random'
|
||||
this.$btn=$('<a>').html('Shuffle').attr('href',this.path).attr('alt',drupalSettings.edlp_corpus.random_link_title).addClass('random-player-btn');this.init();};RandomPlayer.prototype={init(){$('<div>').addClass('block random-player').append(this.$btn).prependTo('.region-footer-right');this.$btn.on('click',this.toggleActive.bind(this));_audioPlayer.on('audio-play-next',this.onAudioPlayNext.bind(this)).on('audio-ended',this.onAudioPlayerEnded.bind(this)).on('stop-shuffle',this.stop.bind(this));_$corpus_canvas.on('update-random-playlist',this.updatePlaylist.bind(this));if(window.location.hash=='#random'){this.start();}},updatePlaylist(e){this.playlist=e.playlist;this.shuffle();},shuffle(){var tempPLaylist=[];for(var i=this.playlist.length-1;i>=0;i--){tempPLaylist.push(this.playlist[i]);}
|
||||
this.$btn=$('<a>').html('Shuffle').attr('href',this.path).attr('alt',drupalSettings.edlp_corpus.random_link_title).addClass('random-player-btn');this.init();};RandomPlayer.prototype={init(){$('<div>').addClass('block random-player').append(this.$btn).prependTo('.region-footer-right');this.$btn.on('click',this.toggleActive.bind(this));_audioPlayer.on('audio-play-next',this.onAudioPlayNext.bind(this)).on('audio-ended',this.onAudioPlayerEnded.bind(this)).on('stop-shuffle',this.stop.bind(this));_$corpus_canvas.on('update-random-playlist',this.updatePlaylist.bind(this));if(window.location.hash=='#random'){this.start();}},updatePlaylist(e){if(!_is_expo){this.playlist=e.playlist;this.shuffle();}},shuffle(){var tempPLaylist=[];for(var i=this.playlist.length-1;i>=0;i--){tempPLaylist.push(this.playlist[i]);}
|
||||
this.shuffledPlaylist=[];while(tempPLaylist.length>0){var r=Math.floor(Math.random()*tempPLaylist.length);this.shuffledPlaylist.push(tempPLaylist.splice(r,1)[0]);}},toggleActive(e){e.preventDefault();if(this.active){this.stop();}else{this.start();}
|
||||
return false;},start(){this.active=_audioPlayer.shuffle_is_active=true;this.$btn.addClass('is-active');this.shuffle();this.next();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','start']);}},stop(){this.active=false;this.$btn.removeClass('is-active');history.replaceState(history.state,null,window.location.pathname);_audioPlayer.deActivateRandom();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','stop']);}},next(){void 0;if(this.active&&this.shuffledPlaylist.length>0)
|
||||
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0],'random');},onAudioPlayNext(){void 0;if(this.active){this.next();}},onAudioPlayerEnded(){void 0;if(this.active){this.next();}}};function CompoPlayer(){this.active=false;this.playing=false;this.paused=false;this.playlist=[];this.current_index=0;this.$composer=null;this.$compo=null;this.$controls=null;this.init();};CompoPlayer.prototype={init(){_audioPlayer.on('audio-open-document',this.onAudioOpenDocument.bind(this)).on('audio-play',this.onAudioPlayerPlay.bind(this)).on('audio-pause',this.onAudioPlayerPause.bind(this)).on('audio-ended',this.onAudioPlayerEnded.bind(this));},newCompo(){this.initControls();},initControls(){this.$composer=$('.composition_ui .composer');this.$compo=$('.composition_ui .composer .composition');this.$controls=$('.composition_ui .composer .compo-player-controls');if(!this.$controls.is('.ready')&&this.$compo){this.$previous=$('<div>').addClass('previous').on('click',this.prev.bind(this)).appendTo(this.$controls);this.$playpause=$('<div>').addClass('play-pause').on('click',this.togglePlayPause.bind(this)).appendTo(this.$controls);this.$next=$('<div>').addClass('next').on('click',this.next.bind(this)).appendTo(this.$controls);this.$controls.addClass('ready');this.refresh();this.active=true;}},refresh(){this.stop();this.playlist=[];var that=this;$('.field--name-documents .field__item',this.$compo).each(function(i,el){var $link=$('a.audio-link',this);that.playlist.push({item:$(this),audio_url:$link.attr("audio_url"),nid:$link.attr("nid"),});});this.showHideControls();},togglePlayPause(){if(this.playing&&!this.paused){this.pause();}else{if(this.playing&&this.paused){this.play();}else{this.start();}}},start(){this.playing=true;this.play();},play(){if(this.paused){this.paused=false;_audioPlayer.play();}else{_audioPlayer.emmit('stop-shuffle').openDocument(this.playlist[this.current_index],this);}
|
||||
this.setActiveItem().showHideControls();},pause(){this.paused=true;this.showHideControls();_audioPlayer.stop();},next(){if(this.playing){this.current_index+=1;if(this.current_index<this.playlist.length){this.play();}else{this.stop();}}},prev(){if(this.playing){this.current_index-=1;if(this.current_index>=0){this.play();}else{this.stop();}}},stop(){if(this.playing){_audioPlayer.stop();}
|
||||
return false;},start(){this.active=_audioPlayer.shuffle_is_active=true;this.$btn.addClass('is-active');this.shuffle();this.next();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','start']);}},stop(){this.active=false;this.$btn.removeClass('is-active');history.replaceState(history.state,null,window.location.pathname);_audioPlayer.deActivateRandom();if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','stop']);}},next(){void 0;if(this.active){if(this.shuffledPlaylist.length==0){this.shuffle();}
|
||||
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0],'random');}},onAudioPlayNext(){void 0;if(this.active){this.next();}},onAudioPlayerEnded(){void 0;if(this.active){this.next();if(_is_expo){_$corpus_canvas.trigger({'type':'scramble-collection'});}}}};function CompoPlayer(){this.active=false;this.playing=false;this.paused=false;this.playlist=[];this.current_index=0;this.$composer=null;this.$compo=null;this.$controls=null;this.init();};CompoPlayer.prototype={init(){_audioPlayer.on('audio-open-document',this.onAudioOpenDocument.bind(this)).on('audio-play',this.onAudioPlayerPlay.bind(this)).on('audio-pause',this.onAudioPlayerPause.bind(this)).on('audio-ended',this.onAudioPlayerEnded.bind(this));},newCompo(){void 0;this.initControls();},initControls(){this.$composer=$('.composition_ui .composer');this.$compo=$('.composition_ui .composer .composition');this.$controls=$('.composition_ui .composer .compo-player-controls');if(!this.$controls.is('.ready')&&this.$compo){this.$previous=$('<div>').addClass('previous').on('click',this.prev.bind(this)).appendTo(this.$controls);this.$playpause=$('<div>').addClass('play-pause').on('click',this.togglePlayPause.bind(this)).appendTo(this.$controls);this.$next=$('<div>').addClass('next').on('click',this.next.bind(this)).appendTo(this.$controls);this.$controls.addClass('ready');this.active=true;}
|
||||
this.refresh();},refresh(){this.stop();this.playlist=[];var that=this;$('.field--name-documents .field__item',this.$compo).each(function(i,el){var $link=$('a.audio-link',this);that.playlist.push({item:$(this),audio_url:$link.attr("audio_url"),nid:$link.attr("nid"),});});this.showHideControls();},togglePlayPause(){if(this.playing&&!this.paused){this.pause();}else{if(this.playing&&this.paused){this.play();}else{this.start();}}},start(i){this.current_index=i||0;this.playing=true;this.play();},play(){void 0;if(this.paused){this.paused=false;_audioPlayer.play();}else{void 0;_audioPlayer.emmit('stop-shuffle').openDocument(this.playlist[this.current_index],this);}
|
||||
this.setActiveItem().showHideControls();},pause(){this.paused=true;this.showHideControls();_audioPlayer.stop();},next(){void 0;if(this.playing){this.current_index+=1;if(this.current_index<this.playlist.length){this.play();}else{this.stop();}}},prev(){if(this.playing){this.current_index-=1;if(this.current_index>=0){this.play();}else{this.stop();}}},stop(){if(this.playing){_audioPlayer.stop();}
|
||||
this.reset();},reset(){this.playing=false;this.paused=false;this.resetIndex();},resetIndex(){this.current_index=0;this.showHideControls().resetActiveItems();},setActiveItem(){this.resetActiveItems();if(this.playing&&this.current_index>=0){this.playlist[this.current_index].item.addClass('is-active');}
|
||||
this.showHideControls();return this;},resetActiveItems(){for(var n=0;n<this.playlist.length;n++){this.playlist[n].item.removeClass('is-active');}
|
||||
return this;},showHideControls(){if(this.$controls){if(this.playing&&!this.paused){this.$controls.addClass('is-playing');}else{this.$controls.removeClass('is-playing');}}
|
||||
if(this.$playpause){if(this.playlist.length>0){this.$playpause.addClass('is-active');}else{this.$playpause.removeClass('is-active');}}
|
||||
if(this.$next){if(this.playing&&this.playlist.length>1&&this.current_index<this.playlist.length-1){this.$next.addClass('is-active');}else{this.$next.removeClass('is-active');}}
|
||||
if(this.$previous){if(this.playing&&this.playlist.length>1&&this.current_index>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}}
|
||||
return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){if(this.playing){this.next();}},};function initGrid(){void 0;if(!_is_mobile){checkGridBlockHeight();_$row.find('.col').addClass('offfield');}
|
||||
return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){void 0;if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){void 0;if(this.playing){this.paused=false;this.next();}},};function initExpo(){void 0;document.title=edlp.site_name;if(window.location.hash=='#black'){$('body').addClass('expo-black');}
|
||||
_$body.on('map-node-opened',checkExpoPlayerPositionning);_randomPlayer.start();initKeyboard();}
|
||||
function checkExpoPlayerPositionning(e){void 0;switch(true){case e.node.x>window.innerWidth-610&&e.node.y<200:_audioPlayer.$container.attr('pos','bottom-left');break;case e.node.x>window.innerWidth-610:_audioPlayer.$container.attr('pos','top-left');break;case e.node.y<200:_audioPlayer.$container.attr('pos','bottom-right');break;default:_audioPlayer.$container.attr('pos','top-right');}
|
||||
_audioPlayer.$container.css({'display':"block",'left':e.node.x+"px",'top':e.node.y+"px",});}
|
||||
function initKeyboard(){$(document).bind('keyup','alt+n',function(){_randomPlayer.next();});}
|
||||
function initGrid(){void 0;if(!_is_mobile){checkGridBlockHeight();_$row.find('.col').addClass('offfield');}
|
||||
if(false){var $grid=$('.grid',_$row).masonry({itemSelector:'.col',columnWidth:'.col-2',containerStyle:null,resizeContainer:false,transitionDuration:0,});$grid.imagesLoaded().progress(function(){$grid.masonry('layout');});$grid.imagesLoaded(function(){$grid.masonry('layout');});$grid.on('layoutComplete',checkGridBlockVisible);}else{if(!_is_mobile){checkGridBlockVisible();}}};function checkGridBlockHeight(){var $r_h=_$row.height();var $this;$('.grid .col',_$row).each(function(i,e){$this=$(this);if(!$this.is('[init-height]')){$this.attr('init-height',$this.outerHeight())}
|
||||
$this.height(Math.min($this.attr('init-height'),_$row.height()));});};function checkGridBlockVisible(){var $r_h=_$row.height();var $this,pos;$('.grid .col',_$row).each(function(i,e){$this=$(this);pos=$this.position();if(pos.top+$this.height()<=$r_h){$this.removeClass('offfield');}else{$this.addClass('offfield');}});}
|
||||
function initCollectionNav(){void 0;$('.field--name-field-notice, .index','.taxonomy-term.vocabulary-entrees.home_mobile').addClass('closed');$('.field--name-field-notice>.field__label','.taxonomy-term.vocabulary-entrees.home_mobile').on('click',onClickCollectionNotice);$('.index>.field__label','.taxonomy-term.vocabulary-entrees.home_mobile').on('click',onClickCollectionIndex);};function onClickCollectionNotice(e){toggleEntreeOpening($(this).parent(),'notice');};function onClickCollectionIndex(e){toggleEntreeOpening($(this).parent(),'index');};function toggleEntreeOpening($e,part){$e.toggleClass('closed').parents('.taxonomy-term.vocabulary-entrees.home_mobile').toggleClass(part+'-opened');}
|
||||
function initSearch(){$('#edit-entries--wrapper legend','#edlp-search-form').on('click',function(){$(this).parent().toggleClass('opened');});};function initEnregistrementTranscript(){void 0;var $node=_$row.find('article.node--type-enregistrement.node--view-mode-transcript');var $nav=$('<nav>').prependTo($node);$node.find('.field--name-field-transcript-vo').addClass('visible').find('.field__label').clone().appendTo($nav).addClass('is-active').attr('field_target','.field--name-field-transcript-vo');$node.find('.field--name-field-transcript-trad').find('.field__label').clone().appendTo($nav).attr('field_target','.field--name-field-transcript-trad');$nav.find('.field__label').on('click',function(){var $this=$(this).addClass('is-active');$this.siblings('.is-active').removeClass('is-active');$this.parents('article.node').find('.field.visible').removeClass('visible');$this.parents('article.node').find($this.attr('field_target')).addClass('visible');});};function backToFrontPage(pop_state){void 0;closeAllModals();$('body').removeClass().addClass('path-frontpage');$('a[data-drupal-link-system-path="<front>"]').addClass('is-active');if(_corpus_ready){_$corpus_canvas.trigger({'type':'close-all-entree'});_$corpus_canvas.trigger({'type':'scramble-collection'});}
|
||||
if(typeof pop_state=="undefined"||!pop_state){void 0;history.pushState({home:true},null,_base_url+drupalSettings.path.currentLanguage);}}
|
||||
if(typeof pop_state=="undefined"||!pop_state){void 0;state={home:true,context:"home",caller:null}
|
||||
_states_history.unshift(state);history.pushState(state,null,_base_url+drupalSettings.path.currentLanguage);}}
|
||||
function closeAllModals(){_$row.html('');_$ajaxLinks.removeClass('is-active');_$body.trigger({'type':'all-modal-closed'});checkVisibleCorpusMapSpace();};function checkRowEmpty(){void 0;if(!$('.col',_$row).length){if(!_$body.is('.entity-type-taxonomy_term.bundle-entrees')){if(!_$body.is('.entity-type-node.bundle-page')){if(_$body.is('.bundle-enregistrement.view-mode-article')&&$('a.articles-link').is('.is-active')){void 0;$('a.articles-link').removeClass('is-active').trigger('click');}else{backToFrontPage();}}else{if(_corpus_ready){_$corpus_canvas.trigger({'type':'scramble-collection'});}
|
||||
$('a[data-drupal-link-system-path="productions"]','#block-mainnavigation').removeClass('is-active').trigger('click');}}else{$('.entree-content a.is-active').removeClass('is-active');}}};init();}
|
||||
$(document).ready(function($){if(drupalSettings.path.isFront){var edlptheme=new EdlpTheme();}else{$('body').attr('booted','booted');}});})(jQuery,Drupal,drupalSettings);
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="12"
|
||||
height="12"
|
||||
viewBox="0 0 3.1749999 3.1750001"
|
||||
version="1.1"
|
||||
id="svg14944"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||
sodipodi:docname="favori-oncompo.svg">
|
||||
<defs
|
||||
id="defs14938" />
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="31.678384"
|
||||
inkscape:cx="-5.1506961"
|
||||
inkscape:cy="5.0420999"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1145"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="28"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata14941">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-293.82497)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.05833328;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="m 0,293.82497 h 3.175 v 3.175 H 0 Z"
|
||||
id="rect15501"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="m 2.57591,293.98564 c 0.028933,0 0.0566,0.006 0.083,0.017 0.041533,0.0163 0.074233,0.0421 0.0981,0.0773 0.025133,0.0352 0.0377,0.0742 0.0377,0.11694 v 2.43129 c 0,0.0427 -0.012567,0.0817 -0.0377,0.11694 -0.023933,0.0352 -0.056633,0.061 -0.0981,0.0773 -0.023933,0.0101 -0.0516,0.0151 -0.083,0.0151 -0.060333,0 -0.1125167,-0.0201 -0.15655,-0.0604 l -0.83181,-0.79974 -0.83181001,0.79974 c -0.0452667,0.0415 -0.09745,0.0622 -0.15655,0.0622 -0.0289333,0 -0.0566,-0.006 -0.083,-0.017 -0.0415333,-0.0163 -0.0748667,-0.0421 -0.1,-0.0773 -0.0239333,-0.0351 -0.0359,-0.0741 -0.0359,-0.11685 v -2.43129 c 0,-0.0427 0.0119667,-0.0817 0.0359,-0.11694 0.0251333,-0.0352 0.0584667,-0.061 0.1,-0.0773 0.0264,-0.0113 0.0540667,-0.017 0.083,-0.017 z"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:20px;font-family:Crimson;-inkscape-font-specification:'Crimson, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#f80000;fill-opacity:1;stroke:none;stroke-width:0.42250523"
|
||||
id="path11601"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccssccscccsccsscccc" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
@@ -22,6 +22,8 @@
|
||||
var _is_loggedin = drupalSettings.user.uid === 0 ? false : true;
|
||||
var _$log_form;
|
||||
var _user_tokens;
|
||||
var _states_history = [];
|
||||
var _is_expo = $('body').hasClass('domain-expo-encyclopediedelaparole-org');
|
||||
|
||||
// ___ _ _
|
||||
// |_ _|_ _ (_) |_
|
||||
@@ -79,7 +81,7 @@
|
||||
pass : $('input#edit-pass[type="password"]', this).val()
|
||||
};
|
||||
// console.log(args);
|
||||
logIn(args).then(getStudioLinkBlock);
|
||||
logIn(args).then(logedin);
|
||||
return false;
|
||||
};
|
||||
function logIn(args){
|
||||
@@ -108,6 +110,10 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
function logedin(){
|
||||
$('body').addClass('user-logged-in');
|
||||
getStudioLinkBlock();
|
||||
};
|
||||
function getStudioLinkBlock(){
|
||||
var path = _origin+_base_url+'edlp/ajax/blocks/json/';
|
||||
$.getJSON(path+"studiolinkblock", {})
|
||||
@@ -120,6 +126,7 @@
|
||||
console.log('onStudioLinkBlockLoaded', data);
|
||||
$('#block-studiouserlogin').replaceWith(data.blocks.studiolinkblock.rendered);
|
||||
initAjaxLinks();
|
||||
refreshFavoritesLinks();
|
||||
_$log_form.removeClass('ajax-loading');
|
||||
_$body.removeClass('ajax-loading');
|
||||
}
|
||||
@@ -366,7 +373,14 @@
|
||||
}else{
|
||||
_$row.append($rendered);
|
||||
}
|
||||
}else{
|
||||
}
|
||||
else if(
|
||||
(state.context == 'document-transcript' || state.context == 'document-artcile')
|
||||
&& state.caller == "search"
|
||||
){
|
||||
_$row.append($rendered);
|
||||
}
|
||||
else{
|
||||
_$row.removeAttr('style').html($rendered);
|
||||
}
|
||||
|
||||
@@ -514,15 +528,12 @@
|
||||
_$body.removeClass('ajax-loading');
|
||||
|
||||
|
||||
// record the states history as we can't get them from history api
|
||||
_states_history.unshift(state);
|
||||
|
||||
// url is null means that we are loading content on popState event
|
||||
// so we don't record the state again
|
||||
if(state.url){
|
||||
// var state = {
|
||||
// ajax_path:ajax_path,
|
||||
// sys_path:sys_path,
|
||||
// };
|
||||
// console.log('url:'+url+' ; state',state);
|
||||
// console.log(window.location);
|
||||
// /!\ we can not pushestate with absolute url /!\
|
||||
history.pushState(state, null, state.url);
|
||||
|
||||
@@ -547,6 +558,7 @@
|
||||
function initAudioLinksHover(){
|
||||
console.log("initAudioLinksHover()");
|
||||
_$row.find('a.audio-link')
|
||||
.not('article.node--view-mode-docsindex a.audio-link')
|
||||
.on('mouseover', function(event) {
|
||||
event.preventDefault();
|
||||
if(_corpus_ready){
|
||||
@@ -584,6 +596,55 @@
|
||||
|
||||
function onCloseModal(e){
|
||||
console.log("onCloseModal");
|
||||
|
||||
// check from production to audio text back to production
|
||||
console.log("onCloseModal _states_history",_states_history);
|
||||
if(['document-transcript', 'document-article'].indexOf(_states_history[0].context) != -1)
|
||||
{
|
||||
if (_states_history[0].caller == "production") {
|
||||
for (var i = 0; i < _states_history.length; i++) {
|
||||
if (_states_history[i].context == "production") {
|
||||
// history.go(i*-1-1);
|
||||
console.log("onCloseModal return to production", _states_history[i]);
|
||||
ajaxLoadContent(_states_history[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_states_history[0].caller == "entree-index") {
|
||||
for (var i = 0; i < _states_history.length; i++) {
|
||||
if (_states_history[i].context == "entree-index") {
|
||||
console.log("onCloseModal return to entree-index", _states_history[i]);
|
||||
ajaxLoadContent(_states_history[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_states_history[0].caller == "entree-notice") {
|
||||
for (var i = 0; i < _states_history.length; i++) {
|
||||
if (_states_history[i].context == "entree-notice") {
|
||||
console.log("onCloseModal return to entree-notice", _states_history[i]);
|
||||
ajaxLoadContent(_states_history[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// return to productions home when closing a prod
|
||||
// if(['production'].indexOf(_states_history[0].context) != -1)
|
||||
// {
|
||||
// var i = 0;
|
||||
// while (_states_history[i].caller == "production-home") {
|
||||
// if (_states_history[i].context == "production-home") {
|
||||
// // history.go(i*-1-1);
|
||||
// console.log("onCloseModal return to productions home", _states_history[i]);
|
||||
// ajaxLoadContent(_states_history[i]);
|
||||
// return;
|
||||
// }
|
||||
// i++;
|
||||
// }
|
||||
// }
|
||||
|
||||
// check for theme attribute and emmit event
|
||||
var $col = $(this).parents('.col');
|
||||
var theme = $col.attr('theme');
|
||||
@@ -814,15 +875,26 @@
|
||||
if($link.is('.audio-link')){
|
||||
// check if caller is lastdocs block
|
||||
caller = $link.parents('.lastdocs, .lastdocs-home').length ? 'lastdocs' : null;
|
||||
// check if caller is studio composition
|
||||
if(!caller){
|
||||
caller = $link.parents('.composition_ui').length ? 'studio-compo' : null;
|
||||
}
|
||||
// open audio player
|
||||
_audioPlayer
|
||||
.emmit('stop-shuffle')
|
||||
.openDocument({
|
||||
nid:$link.attr('nid'),
|
||||
audio_url:$link.attr('audio_url'),
|
||||
title:$link.find('.field--name-title').html()
|
||||
},
|
||||
caller);
|
||||
if(caller == 'studio-compo'){
|
||||
var index = $link.parents('.field__item').index();
|
||||
console.log('audio link caller', caller, index);
|
||||
// _compoPlayer.setIndex(index);
|
||||
_compoPlayer.start(index);
|
||||
}else{
|
||||
_audioPlayer
|
||||
.emmit('stop-shuffle')
|
||||
.openDocument({
|
||||
nid:$link.attr('nid'),
|
||||
audio_url:$link.attr('audio_url'),
|
||||
title:$link.find('.field--name-title').html()
|
||||
},
|
||||
caller);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -871,6 +943,64 @@
|
||||
state.url += "#"+view_mode;
|
||||
}
|
||||
|
||||
// get context for navigation purpose
|
||||
// var contexts = state.url.match(/^.*\/(productions)\/.*/g);
|
||||
var contexts = /^.*\/(productions|documents|entrees|search)(\/.*)?/g.exec(state.url);
|
||||
console.log("onClickAjaxLink contexts", contexts);
|
||||
if(contexts){
|
||||
switch (contexts[1]) {
|
||||
case 'productions':
|
||||
// console.log("onClickAjaxLink is production");
|
||||
// if (typeof contexts[2] !== 'undefined') {
|
||||
state.context = "production"
|
||||
// }else{
|
||||
// state.context = "production-home"
|
||||
// }
|
||||
break;
|
||||
case 'entrees':
|
||||
switch(view_mode) {
|
||||
case 'index':
|
||||
state.context = "entree-index";
|
||||
break;
|
||||
case 'notice':
|
||||
state.context = "entree-notice";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'search':
|
||||
state.context = "search";
|
||||
break;
|
||||
case 'documents':
|
||||
// console.log("onClickAjaxLink is production");
|
||||
switch (view_mode) {
|
||||
case 'transcript':
|
||||
state.context = "document-transcript";
|
||||
break;
|
||||
case 'article':
|
||||
state.context = "document-article";
|
||||
break;
|
||||
default:
|
||||
state.context = "document";
|
||||
}
|
||||
// get the caller from pecedent context
|
||||
if(typeof _states_history[0] != "undefined"){
|
||||
if(_states_history[0].caller){
|
||||
state.caller = _states_history[0].caller
|
||||
}else{
|
||||
state.caller = _states_history[0].context
|
||||
}
|
||||
}else{
|
||||
state.caller = null;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
state.context = null;
|
||||
// state.context = caller;
|
||||
}
|
||||
|
||||
|
||||
if($link.is('[selector]')){
|
||||
state.selector = $link.attr('selector');
|
||||
}
|
||||
@@ -882,6 +1012,17 @@
|
||||
return false;
|
||||
};
|
||||
|
||||
function refreshFavoritesLinks(){
|
||||
console.log("refreshFavoritesLinks", _states_history);
|
||||
// reload the active audioPlayer cartel
|
||||
_audioPlayer.reloadNode();
|
||||
|
||||
// current content (index)
|
||||
if(_states_history[0].view_mode == 'index' || _states_history[0].sys_path == "docsindex"){
|
||||
ajaxLoadContent(_states_history[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// ___
|
||||
// / __|___ _ _ _ __ _ _ ___
|
||||
// | (__/ _ \ '_| '_ \ || (_-<
|
||||
@@ -905,7 +1046,11 @@
|
||||
.openDocument(e.target_node);
|
||||
});
|
||||
|
||||
_randomPlayer = new RandomPlayer(e.playlist);
|
||||
_randomPlayer = new RandomPlayer(e.playlist);
|
||||
|
||||
if (_is_expo) {
|
||||
initExpo();
|
||||
}
|
||||
|
||||
// mainly for articles link
|
||||
initAjaxLinks();
|
||||
@@ -1006,6 +1151,7 @@
|
||||
this.cartelSwitchInterval = false;
|
||||
|
||||
// hiding
|
||||
this.visible = false;
|
||||
this.hideTimer = false;
|
||||
this.hideTimeMS = 15000;
|
||||
|
||||
@@ -1031,7 +1177,11 @@
|
||||
};
|
||||
AudioPlayer.prototype = {
|
||||
init(){
|
||||
this.$container_parent = $('header[role="banner"] .region-header');
|
||||
if(!_is_expo){
|
||||
this.$container_parent = $('header[role="banner"] .region-header');
|
||||
}else{
|
||||
this.$container_parent = $('main[role="main"]');
|
||||
}
|
||||
// append ui to document
|
||||
this.$container.appendTo(this.$container_parent);
|
||||
// record timeline width
|
||||
@@ -1065,6 +1215,7 @@
|
||||
|
||||
// if we don't come from history popstate
|
||||
if(typeof caller == 'undefined' || caller != 'popstate'){
|
||||
console.log('');
|
||||
this.historic.push(node);
|
||||
this.currentHistoricIndex = this.historic.length-1;
|
||||
// this.shuffle_mode = shuffle_mode || false;
|
||||
@@ -1206,6 +1357,11 @@
|
||||
this.clearTimeOutToHide();
|
||||
// this.audio.play();
|
||||
|
||||
// making sound shorter for debuging purpose
|
||||
// if(_is_expo){
|
||||
// setTimeout(this.seekToEnd.bind(this), 20000);
|
||||
// }
|
||||
|
||||
// Not really needed has we trigger play right after setting the source https://stackoverflow.com/questions/47431439/mp4-video-safari-showing-unhandled-promise-rejection-object-domerror-in-c
|
||||
var promise = this.audio.play();
|
||||
// console.log('promise', promise);
|
||||
@@ -1260,6 +1416,12 @@
|
||||
console.log("Audio seeking : seek", seek);
|
||||
this.audio.currentTime = seek;
|
||||
},
|
||||
seekToEnd(){
|
||||
if (this.audio.duration > 40) {
|
||||
console.log("seekToEnd", this.audio.duration);
|
||||
this.audio.currentTime = this.audio.duration - 20;
|
||||
}
|
||||
},
|
||||
// audio events
|
||||
onPlaying(){
|
||||
this.$btns.addClass('is-playing');
|
||||
@@ -1286,6 +1448,14 @@
|
||||
this.emmit('audio-ended');
|
||||
},
|
||||
// cartel functions
|
||||
reloadNode(){
|
||||
if(this.visible){
|
||||
if(!_is_mobile){
|
||||
console.log('reloadNode (cartel)');
|
||||
this.loadNode(this.historic[this.currentHistoricIndex].nid);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadNode(nid){
|
||||
this.$cartel.addClass('loading');
|
||||
var vm = 'player_cartel';
|
||||
@@ -1296,21 +1466,23 @@
|
||||
.fail(this.onNodeLoadFail.bind(this));
|
||||
},
|
||||
onNodeLoaded(data){
|
||||
console.log('AudioPlayer node loaded', data);
|
||||
console.log('AudioPlayer node loaded');//, data);
|
||||
this.$cartel.html(data.rendered).removeClass('loading');
|
||||
_$body.trigger({'type':'new-audio-cartel-loaded'});
|
||||
initAjaxLinks();
|
||||
// cartel autoswitch
|
||||
this.scndCartel_visible = 0;
|
||||
this.$cartel.removeClass('second-visible');
|
||||
// if second cartel has special info ?
|
||||
if (this.$cartel.find('.second-cartel .col-left').children().length > 1
|
||||
|| this.$cartel.find('.second-cartel').children('.col-right').length){
|
||||
// init cartel auto switch
|
||||
this.cartelSwitchInterval = setInterval(this.switchCartel.bind(this), this.cartelSwitchIntervalMS);
|
||||
if(!_is_expo){
|
||||
// if second cartel has special info ?
|
||||
if (this.$cartel.find('.second-cartel .col-left').children().length > 1
|
||||
|| this.$cartel.find('.second-cartel').children('.col-right').length){
|
||||
// init cartel auto switch
|
||||
this.cartelSwitchInterval = setInterval(this.switchCartel.bind(this), this.cartelSwitchIntervalMS);
|
||||
}
|
||||
// call drupal behaviours (for addtoany)
|
||||
Drupal.attachBehaviors(this.$cartel);
|
||||
}
|
||||
// call drupal behaviours (for addtoany)
|
||||
Drupal.attachBehaviors(this.$cartel);
|
||||
// open automaticly tha article if needed
|
||||
this.setAutoOpenArticle();
|
||||
if(this.auto_open_article){
|
||||
@@ -1328,6 +1500,7 @@
|
||||
},
|
||||
// global
|
||||
show(){
|
||||
this.visible = true;
|
||||
this.$container_parent.addClass('audio-player-visible');
|
||||
this.$container.addClass('visible');
|
||||
},
|
||||
@@ -1380,6 +1553,7 @@
|
||||
},
|
||||
hide(){
|
||||
// console.log('AudioPlayer hide()');
|
||||
this.visible = false;
|
||||
this.$container_parent.removeClass('audio-player-visible');
|
||||
this.$container.removeClass('visible');
|
||||
// trigger highlighted node remove on corpus map
|
||||
@@ -1452,25 +1626,21 @@
|
||||
_audioPlayer
|
||||
.on('audio-play-next', this.onAudioPlayNext.bind(this))
|
||||
.on('audio-ended', this.onAudioPlayerEnded.bind(this))
|
||||
// .on('audio-ended', function(e){
|
||||
// console.log('RandomPlayer, audio-ended', e);
|
||||
// })
|
||||
.on('stop-shuffle', this.stop.bind(this));
|
||||
|
||||
|
||||
_$corpus_canvas
|
||||
.on('update-random-playlist', this.updatePlaylist.bind(this));
|
||||
|
||||
// provide a link to auto start random player
|
||||
if(window.location.hash == '#random'){
|
||||
this.start();
|
||||
// window.location.hash = '';
|
||||
}
|
||||
},
|
||||
updatePlaylist(e){
|
||||
// debugger;
|
||||
this.playlist = e.playlist;
|
||||
this.shuffle();
|
||||
if (!_is_expo) {
|
||||
this.playlist = e.playlist;
|
||||
this.shuffle();
|
||||
}
|
||||
},
|
||||
shuffle(){
|
||||
var tempPLaylist = [];
|
||||
@@ -1520,8 +1690,12 @@
|
||||
},
|
||||
next(){
|
||||
console.log('RandomPlayer next', this.active, this.shuffledPlaylist.length);
|
||||
if(this.active && this.shuffledPlaylist.length > 0)
|
||||
if(this.active){
|
||||
if (this.shuffledPlaylist.length == 0) {
|
||||
this.shuffle();
|
||||
}
|
||||
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0], 'random');
|
||||
}
|
||||
},
|
||||
onAudioPlayNext(){
|
||||
console.log('RandomPlayer : onAudioPlayNext()');
|
||||
@@ -1533,6 +1707,9 @@
|
||||
console.log('RandomPlayer : onAudioPlayerEnded()');
|
||||
if(this.active){
|
||||
this.next();
|
||||
if(_is_expo){
|
||||
_$corpus_canvas.trigger({'type':'scramble-collection'}); //shuffle-collection scramble-collection
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1567,7 +1744,7 @@
|
||||
// this.newCompo();
|
||||
},
|
||||
newCompo(){
|
||||
//console.log('CompoPlayer newCompo()');
|
||||
console.log('CompoPlayer newCompo()');
|
||||
// this.$compo = $('.composition_ui .composer .composition');
|
||||
this.initControls();
|
||||
},
|
||||
@@ -1589,11 +1766,11 @@
|
||||
|
||||
this.$controls.addClass('ready');
|
||||
|
||||
this.refresh();
|
||||
|
||||
this.active = true;
|
||||
// this.newCompo();
|
||||
}
|
||||
this.refresh();
|
||||
},
|
||||
refresh(){
|
||||
// console.log('CompoPlayer refresh(), this', this);
|
||||
@@ -1624,21 +1801,23 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
start(){
|
||||
start(i){
|
||||
//console.log('start');
|
||||
// console.log('CompoPlayer start()');
|
||||
this.current_index = i || 0;
|
||||
this.playing = true;
|
||||
this.play();
|
||||
},
|
||||
play(){
|
||||
// console.log('play');
|
||||
console.log('CompoPlayer play()', this.playlist[this.current_index]);
|
||||
if(this.paused){
|
||||
this.paused = false;
|
||||
_audioPlayer.play();
|
||||
}else{
|
||||
console.log('CompoPlayer opendoc with audio player');
|
||||
// _audioPlayer;
|
||||
_audioPlayer.emmit('stop-shuffle').openDocument(this.playlist[this.current_index], this);
|
||||
// TODO: stop random player
|
||||
|
||||
}
|
||||
this.setActiveItem().showHideControls();
|
||||
},
|
||||
@@ -1649,7 +1828,7 @@
|
||||
_audioPlayer.stop();
|
||||
},
|
||||
next(){
|
||||
// console.log('CompoPlayer next()');
|
||||
console.log('CompoPlayer next()',this.playing);
|
||||
if(this.playing){
|
||||
this.current_index += 1;
|
||||
if(this.current_index < this.playlist.length){
|
||||
@@ -1743,6 +1922,7 @@
|
||||
},
|
||||
// _audioPlayer events
|
||||
onAudioOpenDocument(args){
|
||||
console.log('Compo player onAudioOpenDocument', args);
|
||||
if(args.caller !== this){
|
||||
// console.log('CompoPlayer onAudioOpenDocument() called by other');
|
||||
this.reset();
|
||||
@@ -1764,7 +1944,10 @@
|
||||
}
|
||||
},
|
||||
onAudioPlayerEnded(){
|
||||
console.log('onAudioPlayerEnded');
|
||||
if(this.playing){
|
||||
// this paused shoudn't be true but i'm lazzy to find why it is ...
|
||||
this.paused = false;
|
||||
this.next();
|
||||
}
|
||||
},
|
||||
@@ -1773,7 +1956,50 @@
|
||||
// }
|
||||
};
|
||||
|
||||
// ___
|
||||
// | __|_ ___ __ ___
|
||||
// | _|\ \ / '_ \/ _ \
|
||||
// |___/_\_\ .__/\___/
|
||||
// |_|
|
||||
function initExpo(){
|
||||
console.log('initExpo', window.location.hash);
|
||||
document.title = edlp.site_name;
|
||||
if(window.location.hash == '#black'){
|
||||
$('body').addClass('expo-black');
|
||||
}
|
||||
_$body.on('map-node-opened', checkExpoPlayerPositionning);
|
||||
_randomPlayer.start();
|
||||
initKeyboard();
|
||||
}
|
||||
function checkExpoPlayerPositionning(e){
|
||||
console.log('checkExpoPlayerPositionning', e.node);
|
||||
|
||||
// optimized for 1280px width screen
|
||||
switch(true){
|
||||
case e.node.x > window.innerWidth-610 && e.node.y < 200:
|
||||
_audioPlayer.$container.attr('pos', 'bottom-left');
|
||||
break;
|
||||
case e.node.x > window.innerWidth-610:
|
||||
_audioPlayer.$container.attr('pos', 'top-left');
|
||||
break;
|
||||
case e.node.y < 200:
|
||||
_audioPlayer.$container.attr('pos', 'bottom-right');
|
||||
break;
|
||||
default:
|
||||
_audioPlayer.$container.attr('pos', 'top-right');
|
||||
}
|
||||
|
||||
_audioPlayer.$container.css({
|
||||
'display':"block",
|
||||
'left':e.node.x+"px",
|
||||
'top':e.node.y+"px",
|
||||
});
|
||||
}
|
||||
function initKeyboard(){
|
||||
$(document).bind('keyup', 'alt+n', function(){
|
||||
_randomPlayer.next();
|
||||
});
|
||||
}
|
||||
// ___ _ _
|
||||
// / __|_ _(_)__| |
|
||||
// | (_ | '_| / _` |
|
||||
@@ -2002,7 +2228,13 @@
|
||||
|
||||
if(typeof pop_state == "undefined" || !pop_state){
|
||||
console.log('backToFrontPage push state');
|
||||
history.pushState({home:true}, null, _base_url+drupalSettings.path.currentLanguage);
|
||||
state = {
|
||||
home:true,
|
||||
context:"home",
|
||||
caller:null
|
||||
}
|
||||
_states_history.unshift(state);
|
||||
history.pushState(state, null, _base_url+drupalSettings.path.currentLanguage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,42 @@
|
||||
}
|
||||
}
|
||||
|
||||
@mixin entree-micro-square-expo-player{
|
||||
white-space: nowrap;
|
||||
// line-height: 0;
|
||||
span.entree{
|
||||
display:inline-block;
|
||||
&:before{
|
||||
content:"";
|
||||
display:inline-block;
|
||||
$s:6px;
|
||||
width:$s; height:$s;
|
||||
background-color: black;
|
||||
margin-right: 2px;
|
||||
}
|
||||
&[tid='134']:before{background-color: var(--e-col-134);}
|
||||
&[tid='121']:before{background-color: var(--e-col-121);}
|
||||
&[tid='125']:before{background-color: var(--e-col-125);}
|
||||
&[tid='119']:before{background-color: var(--e-col-119);}
|
||||
&[tid='132']:before{background-color: var(--e-col-132);}
|
||||
&[tid='122']:before{background-color: var(--e-col-122);}
|
||||
&[tid='129']:before{background-color: var(--e-col-129);}
|
||||
&[tid='120']:before{background-color: var(--e-col-120);}
|
||||
&[tid='130']:before{background-color: var(--e-col-130);}
|
||||
&[tid='118']:before{background-color: var(--e-col-118);}
|
||||
&[tid='127']:before{background-color: var(--e-col-127);}
|
||||
&[tid='133']:before{background-color: var(--e-col-133);}
|
||||
&[tid='128']:before{background-color: var(--e-col-128);}
|
||||
&[tid='124']:before{background-color: var(--e-col-124);}
|
||||
&[tid='116']:before{background-color: var(--e-col-116);}
|
||||
&[tid='117']:before{background-color: var(--e-col-117);}
|
||||
&[tid='131']:before{background-color: var(--e-col-131);}
|
||||
&[tid='126']:before{background-color: var(--e-col-126);}
|
||||
&[tid='123']:before{background-color: var(--e-col-123);}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@mixin btn {
|
||||
padding: 3px;
|
||||
background-color: white;
|
||||
@@ -63,6 +99,20 @@
|
||||
// pointer-events: none;
|
||||
// }
|
||||
|
||||
body.domain-expo-encyclopediedelaparole-org{
|
||||
* {
|
||||
pointer-events: none!important;
|
||||
cursor:none!important;
|
||||
}
|
||||
// cursor: none;
|
||||
// canvas#corpus-map{
|
||||
// cursor: none!important;
|
||||
// }
|
||||
}
|
||||
|
||||
body.expo-black{
|
||||
background-color: $expo-black;
|
||||
}
|
||||
|
||||
// _ _
|
||||
// | |_ ___ __ _ __| |___ _ _
|
||||
@@ -71,6 +121,13 @@
|
||||
header[role="banner"]{
|
||||
pointer-events: all;
|
||||
// TODO: what header height to fit well with player ??
|
||||
|
||||
> .wrapper > .region-header > .block{
|
||||
// outline: 1px solid orange;
|
||||
}
|
||||
#audio-player {
|
||||
// outline: 1px solid red;
|
||||
}
|
||||
}
|
||||
|
||||
#block-edlptheme-branding{
|
||||
@@ -885,6 +942,13 @@ main[role="main"]{
|
||||
// background-color: white;
|
||||
height:100%;
|
||||
min-width:700px;
|
||||
width: calc(100% - 460px);
|
||||
// width: calc(100% - 950px);
|
||||
@media only screen and (max-width: 1270px) {
|
||||
width: calc(100% - 180px);
|
||||
|
||||
|
||||
}
|
||||
z-index: 20;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
@@ -953,11 +1017,13 @@ main[role="main"]{
|
||||
height:100%;
|
||||
}
|
||||
.cartel{
|
||||
// outline: 1px solid green;
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
margin-top: 0.5em;
|
||||
margin-left: 1em;
|
||||
// min-width: 200px;
|
||||
width: calc(100% - 260px);
|
||||
// outline: 1px solid orange;
|
||||
margin-left: 1em;
|
||||
// background-color: white;
|
||||
opacity: 1;
|
||||
transition: opacity 0.5s ease-in-out;
|
||||
@@ -971,6 +1037,7 @@ main[role="main"]{
|
||||
}
|
||||
.actions{
|
||||
width:1.5em;
|
||||
margin-top: 0.1em;
|
||||
}
|
||||
.cartels{
|
||||
width:calc(100% - 1.5em);
|
||||
@@ -980,16 +1047,18 @@ main[role="main"]{
|
||||
opacity:1;
|
||||
transition: opacity 0.2s ease-in-out;
|
||||
.entrees{
|
||||
@include entree-micro-square;
|
||||
body:not(.domain-expo-encyclopediedelaparole-org) &{
|
||||
@include entree-micro-square;
|
||||
}
|
||||
}
|
||||
h2.node-title{
|
||||
margin:0.2em 0 0;
|
||||
font-size: 0.9em;
|
||||
font-size: 1em;
|
||||
font-weight: 600;
|
||||
}
|
||||
p{
|
||||
margin:0;
|
||||
font-size: 0.756em;
|
||||
font-size: 0.882em;
|
||||
}
|
||||
}
|
||||
.second-cartel{
|
||||
@@ -1006,14 +1075,21 @@ main[role="main"]{
|
||||
white-space: normal;
|
||||
}
|
||||
.col-left{
|
||||
a.ajax-link{
|
||||
// position: relative;
|
||||
a.ajax-link,
|
||||
a.link-audio-download{
|
||||
display: block;
|
||||
font-size: 0.82em;
|
||||
font-weight: 600;
|
||||
}
|
||||
.addtoany_list > a:first-child{
|
||||
padding-left: 0;
|
||||
margin-left:-4px;
|
||||
.addtoany_list {
|
||||
// outline: 1px solid blue;
|
||||
// margin-top: -1em;
|
||||
// top: -1em;
|
||||
& > a:first-child{
|
||||
padding-left: 0;
|
||||
margin-left:-4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.col-right{
|
||||
@@ -1069,6 +1145,128 @@ main[role="main"]{
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
// ___
|
||||
// | __|_ ___ __ ___
|
||||
// | _|\ \ / '_ \/ _ \
|
||||
// |___/_\_\ .__/\___/
|
||||
// |_|
|
||||
body.domain-expo-encyclopediedelaparole-org &{
|
||||
position: absolute;
|
||||
box-sizing: content-box;
|
||||
// optimized for 1280px width screen
|
||||
width:550px; min-width:550px; max-width:550px; height:100px;
|
||||
left: 50vw; top:50vh;
|
||||
transform: translate(-50%, -50%);
|
||||
background-color: rgba(255,255,255, 0.8);
|
||||
outline: 1px solid red;
|
||||
padding:0.5em 0.5em 0 0.5em; margin:0;
|
||||
.btns,
|
||||
.actions,
|
||||
.favoris{
|
||||
display: none;
|
||||
}
|
||||
.time-line-container{
|
||||
margin:1.5em 0 0;
|
||||
}
|
||||
.time{
|
||||
margin:1.23em 0 0;
|
||||
>*{
|
||||
width:50px;
|
||||
}
|
||||
.current-time{
|
||||
font-size: 1em;
|
||||
}
|
||||
.duration{
|
||||
margin-top:0.28em;
|
||||
}
|
||||
}
|
||||
.cartel{
|
||||
margin-top: 0;
|
||||
width:calc(100% - 190px);
|
||||
article.node--type-enregistrement{
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.cartels .first-cartel{
|
||||
h2.node-title{
|
||||
margin:0;
|
||||
}
|
||||
.entrees{
|
||||
font-size: 1em;
|
||||
@include entree-micro-square-expo-player;
|
||||
span.entree{
|
||||
margin-right:0.5em;
|
||||
&:after{
|
||||
content: attr(title);
|
||||
font-size: 0.75em;
|
||||
text-transform: lowercase;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
* {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
$w:60px; // diagonal length
|
||||
$s:($w *1.4)*0.5; // side given the diagonal (1.4 is the square root of 2)
|
||||
&:before{
|
||||
content:"";
|
||||
position: absolute;
|
||||
width: $w; height:0;
|
||||
border-top: 1px solid red;
|
||||
}
|
||||
// pos attributes refers to where the popup appears
|
||||
&[pos="bottom-right"]{
|
||||
transform: translateY($s) translateX($s);
|
||||
&:before{
|
||||
top:-1px;
|
||||
left: -$w - 1px;
|
||||
transform-origin: bottom right;
|
||||
transform: rotateZ(45deg);
|
||||
}
|
||||
}
|
||||
&[pos="bottom-left"]{
|
||||
transform: translateX(-100%) translateY($s) translateX(-$s);
|
||||
&:before{
|
||||
// top:calc(100% + 1px);*
|
||||
top:0;
|
||||
left: 100%;
|
||||
transform-origin: top left;
|
||||
transform: rotateZ(-45deg);
|
||||
}
|
||||
}
|
||||
&[pos="top-left"]{
|
||||
transform: translateY(-100%) translateX(-100%) translateY(-$s) translateX(-$s);
|
||||
&:before{
|
||||
bottom:0;
|
||||
left: 100%;
|
||||
transform-origin: top left;
|
||||
transform: rotateZ(45deg);
|
||||
}
|
||||
}
|
||||
&[pos="top-right"]{
|
||||
transform: translateY(-100%) translateY(-$s) translateX($s);
|
||||
&:before{
|
||||
top:calc(100% + 1px);
|
||||
left: - ($w +1px);
|
||||
transform-origin: top right;
|
||||
transform: rotateZ(-45deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
body.expo-black &{
|
||||
background-color: $expo-black-bg;
|
||||
color:#fff;
|
||||
.time-line-container .time-line .loader{
|
||||
border-top: 2px solid $expo-black-bg;
|
||||
border-bottom: 2px solid $expo-black-bg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1128,6 +1326,7 @@ main[role="main"]{
|
||||
|
||||
.row .col .studio-ui-wrapper{
|
||||
height: 100%;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#studio-ui{
|
||||
height:100%;
|
||||
@@ -1192,9 +1391,10 @@ main[role="main"]{
|
||||
background-color: red;
|
||||
}
|
||||
} // end mixin
|
||||
|
||||
$compo_height:250px;
|
||||
.chutier_ui{
|
||||
height: 50%;
|
||||
// height: 65%;
|
||||
height: calc(100% - #{$compo_height});
|
||||
border-bottom: 1px solid red;
|
||||
position: relative;
|
||||
&>h2{
|
||||
@@ -1212,17 +1412,28 @@ main[role="main"]{
|
||||
.documents{
|
||||
padding-top: 35px;
|
||||
height:calc(100% - 35px);
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
// box-sizing: content-box;
|
||||
// outline: 1px solid green;
|
||||
.item-list{
|
||||
height: 100%;
|
||||
}
|
||||
ul,li{
|
||||
margin:0; padding:0;
|
||||
line-height: 1.2;
|
||||
}
|
||||
ul{
|
||||
// display: grid;
|
||||
// grid-template-columns: repeat( auto-fit, minmax(200px, 1fr) );
|
||||
max-height: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
li{
|
||||
display: inline-block; vertical-align: top;
|
||||
width:49%; margin-bottom: 0.5em;
|
||||
flex: 0 0 auto;
|
||||
margin-bottom: 0.3em;
|
||||
white-space: nowrap;
|
||||
>div{
|
||||
display:inline-block;
|
||||
@@ -1231,8 +1442,14 @@ main[role="main"]{
|
||||
cursor:grab;
|
||||
}
|
||||
}
|
||||
.entrees{
|
||||
@include entree-micro-square;
|
||||
.chutier-icon{
|
||||
display: inline-block;
|
||||
width:0.7em; height:0.7em;
|
||||
margin-right: 0.3em;
|
||||
opacity: 0.8;
|
||||
&.on-compo{
|
||||
background-image: url(../img/favori-oncompo.svg);
|
||||
}
|
||||
}
|
||||
a.audio-link{
|
||||
// text-transform: capitalize;
|
||||
@@ -1240,10 +1457,9 @@ main[role="main"]{
|
||||
margin-right: 0.5em;
|
||||
white-space: normal;
|
||||
}
|
||||
.chutier-icon{
|
||||
display: inline-block;
|
||||
width:0.7em; height:0.7em;
|
||||
opacity: 0.8;
|
||||
.entrees{
|
||||
display:inline-block;
|
||||
@include entree-micro-square;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1251,7 +1467,8 @@ main[role="main"]{
|
||||
}
|
||||
$compo_square_size:12px;
|
||||
.composition_ui{
|
||||
height:50%;
|
||||
// height:35%;
|
||||
height:$compo_height;
|
||||
&>h2{
|
||||
z-index: 10;
|
||||
position: absolute;
|
||||
@@ -1392,6 +1609,10 @@ main[role="main"]{
|
||||
padding-bottom:$padding;
|
||||
font-size: 0.756em;
|
||||
}
|
||||
&:not(.empty)>header{
|
||||
// display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
>.composition{
|
||||
position: relative;
|
||||
height:calc(100% - #{$header_height + $actions_height + $padding*2});
|
||||
@@ -2076,7 +2297,7 @@ footer{
|
||||
pointer-events: none;
|
||||
// docsindex
|
||||
&:first-of-type{
|
||||
margin-right: 4em;
|
||||
margin-right: 3.4em;
|
||||
}
|
||||
// articles
|
||||
&:last-of-type:not(.entree){
|
||||
@@ -2275,6 +2496,13 @@ footer{
|
||||
}
|
||||
}
|
||||
|
||||
body.domain-expo-encyclopediedelaparole-org &{
|
||||
.block-block-edlp-entrees{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$icons_w:20px;
|
||||
$mobile_icon_w:15px;
|
||||
@mixin iconlinkblock($bgimgurl, $bgimgurlactive) {
|
||||
@@ -2334,6 +2562,11 @@ footer{
|
||||
margin-bottom: 1em;
|
||||
margin-left: 0.2em;
|
||||
@include iconlinkblock(url(../img/studio.svg), url(../img/studio-active.svg));
|
||||
body.user-logged-in &{
|
||||
a{
|
||||
background-image: url(../img/studio-active.svg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#block-userlogin,
|
||||
@@ -2554,6 +2787,9 @@ footer{
|
||||
top:0.4em; right:0.4em;
|
||||
}
|
||||
}
|
||||
body.domain-expo-encyclopediedelaparole-org &{
|
||||
display:none!important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
$transparent-bg: rgba(255,255,255, 0.95);
|
||||
$expo-black:#282828;
|
||||
$expo-black-bg:rgba(40,40,40,0.9);
|
||||
|
||||
@@ -102,6 +102,12 @@ body.toolbar-horizontal.toolbar-themes.toolbar-no-tabs{
|
||||
// // overflow-y: hidden;
|
||||
// }
|
||||
// }
|
||||
body.domain-expo-encyclopediedelaparole-org{
|
||||
main[role="main"] .layout-content{
|
||||
padding:0; margin:0;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
footer[role="contentinfo"]{
|
||||
// outline: 1px solid pink;
|
||||
|
||||
@@ -13,7 +13,7 @@ redirect-js:
|
||||
global-js:
|
||||
version: VERSION
|
||||
js:
|
||||
# assets/dist/bower/jquery.hotkeys.js: { scope: footer }
|
||||
assets/dist/bower/jquery.hotkeys.js: { scope: footer }
|
||||
assets/dist/bower/imagesloaded.pkgd.min.js: { minified: true }
|
||||
assets/dist/bower/masonry.pkgd.min.js: { minified: true }
|
||||
assets/dist/scripts/main.min.js: { minified: true }
|
||||
|
||||
@@ -62,7 +62,7 @@ function edlptheme_preprocess_html(&$vars) {
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_page(&$vars){
|
||||
// dsm($vars, 'vars');
|
||||
// dpm($vars, 'vars');
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_node(&$vars){
|
||||
@@ -222,7 +222,7 @@ function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
));
|
||||
$vars['link_transcript'] = Link::fromTextAndUrl(t("Read the text."), $url);
|
||||
$vars['link_transcript'] = Link::fromTextAndUrl(t("Read the text"), $url);
|
||||
}
|
||||
|
||||
// if article not empty
|
||||
@@ -237,7 +237,7 @@ function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
));
|
||||
$vars['link_article'] = Link::fromTextAndUrl(t("Read the article."), $url);
|
||||
$vars['link_article'] = Link::fromTextAndUrl(t("Read the article"), $url);
|
||||
}
|
||||
|
||||
// relations (defined in edlp_corpus.module)
|
||||
@@ -249,6 +249,39 @@ function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
|
||||
if($vars['col_left'] || $vars['col_right']){
|
||||
$vars['second_cartel'] = true;
|
||||
}
|
||||
|
||||
// get the audio file url
|
||||
$field_son_values = $node->get('field_son')->getValue();
|
||||
$son_fid = count($field_son_values) ? $field_son_values[0]['target_id'] : "";
|
||||
$son_file = \Drupal\file\Entity\File::load($son_fid);
|
||||
if($son_file){
|
||||
$son_uri = $son_file->getFileUri();
|
||||
$son_url = file_create_url($son_uri);
|
||||
|
||||
$base = log($son_file->getSize(), 1024);
|
||||
$suffixes = array('', 'K', 'M', 'G', 'T');
|
||||
$file_size = round(pow(1024, $base - floor($base)), 0) .' '. $suffixes[floor($base)];
|
||||
|
||||
preg_match('/^.*(\.\S+)$/', $son_uri, $matches);
|
||||
$extension = $matches[1];
|
||||
|
||||
$node_title = $node->getTitle();
|
||||
$new_file_name = str_replace(' ', '_', $node_title) . $extension;
|
||||
|
||||
$config = \Drupal::config('system.site');
|
||||
$site_title = str_replace(' ', '_', $config->get('name'));
|
||||
|
||||
$url = Url::fromUri($son_url);
|
||||
$url->setOptions(array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-audio-download'],
|
||||
'download' => $site_title .'__'. $new_file_name,
|
||||
'title' => $new_file_name . ' ('.$file_size.')'
|
||||
)
|
||||
));
|
||||
$vars['link_audio_download'] = Link::fromTextAndUrl(t("Download"), $url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -285,5 +318,5 @@ function edlptheme_preprocess_links__language_block(&$vars){
|
||||
}
|
||||
|
||||
function edlptheme_preprocess_file_link(&$vars){
|
||||
|
||||
// dpm($vars);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Theme override for a field.
|
||||
*
|
||||
* To override output, copy the "field.html.twig" from the templates directory
|
||||
* to your theme's directory and customize it, just like customizing other
|
||||
* Drupal templates such as page.html.twig or node.html.twig.
|
||||
*
|
||||
* Instead of overriding the theming for all fields, you can also just override
|
||||
* theming for a subset of fields using
|
||||
* @link themeable Theme hook suggestions. @endlink For example,
|
||||
* here are some theme hook suggestions that can be used for a field_foo field
|
||||
* on an article node type:
|
||||
* - field--node--field-foo--article.html.twig
|
||||
* - field--node--field-foo.html.twig
|
||||
* - field--node--article.html.twig
|
||||
* - field--field-foo.html.twig
|
||||
* - field--text-with-summary.html.twig
|
||||
* - field.html.twig
|
||||
*
|
||||
* Available variables:
|
||||
* - attributes: HTML attributes for the containing element.
|
||||
* - label_hidden: Whether to show the field label or not.
|
||||
* - title_attributes: HTML attributes for the title.
|
||||
* - label: The label for the field.
|
||||
* - multiple: TRUE if a field can contain multiple items.
|
||||
* - items: List of all the field items. Each item contains:
|
||||
* - attributes: List of HTML attributes for each item.
|
||||
* - content: The field item's content.
|
||||
* - entity_type: The entity type to which the field belongs.
|
||||
* - field_name: The name of the field.
|
||||
* - field_type: The type of the field.
|
||||
* - label_display: The display settings for the label.
|
||||
*
|
||||
*
|
||||
* @see template_preprocess_field()
|
||||
*/
|
||||
#}
|
||||
{%
|
||||
set classes = [
|
||||
'field',
|
||||
'field--name-' ~ field_name|clean_class,
|
||||
'field--type-' ~ field_type|clean_class,
|
||||
'field--label-' ~ label_display,
|
||||
]
|
||||
%}
|
||||
{%
|
||||
set title_classes = [
|
||||
'field__label',
|
||||
label_display == 'visually_hidden' ? 'visually-hidden',
|
||||
]
|
||||
%}
|
||||
|
||||
{% if label_hidden %}
|
||||
{% if multiple %}
|
||||
<div{{ attributes.addClass(classes, 'field__items') }}>
|
||||
{% for item in items %}
|
||||
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% for item in items %}
|
||||
<div{{ attributes.addClass(classes, 'field__item') }}>{{ item.content }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div{{ attributes.addClass(classes) }}>
|
||||
<div{{ title_attributes.addClass(title_classes) }}>{{ label }}</div>
|
||||
{% if multiple %}
|
||||
<div class="field__items">
|
||||
{% endif %}
|
||||
{% for item in items %}
|
||||
<div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div>
|
||||
{% endfor %}
|
||||
{% if multiple %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
+1
@@ -108,6 +108,7 @@
|
||||
<div class="col-left">
|
||||
{{ link_transcript }}
|
||||
{{ link_article }}
|
||||
{{ link_audio_download }}
|
||||
{{ content.addtoany }}
|
||||
</div>
|
||||
{# endif #}
|
||||
|
||||
Reference in New Issue
Block a user