Compare commits

..
34 Commits
Author SHA1 Message Date
bachir 5ebbbcdf08 mignified assets for prod 2018-04-26 22:08:19 +02:00
bachir 3c20c69e2d Merge branch 'prod' 2018-04-26 22:05:18 +02:00
bachir 77b16de28b fixed production mobile display 2018-04-26 22:00:37 +02:00
bachir f0c2883d0e home for mobile is ok 2018-04-26 21:41:43 +02:00
bachir b7abbe605b translated audio doc links 2018-04-26 18:30:24 +02:00
bachir fcd97f6492 added agenda title to home agenda 2018-04-26 18:19:06 +02:00
bachir 1c12c205ec audio player autohide @ 15sec 2018-04-26 18:11:59 +02:00
bachir 2ee7077ecf removed some dpm 2018-04-26 17:46:07 +02:00
bachir 7601ad0b4c mobile dev alpha, redirecting is working, started mobile display 2018-04-26 17:43:50 +02:00
bachir bf32cbaee8 fixed icon links bug (mask not working every where) 2018-04-26 16:22:30 +02:00
bachir 916911e1d6 nothing 2018-04-26 16:10:40 +02:00
bachir 168e1009e8 fixed random player 2018-04-26 16:09:53 +02:00
bachir b4c613c9a4 fix audio cartel 2018-04-26 15:36:00 +02:00
bachir 1eb3163ad6 changed relation for document on player cartel 2018-04-26 15:30:35 +02:00
bachir b6dfcd4485 head title always = only site name 2018-04-26 12:29:00 +02:00
bachir c0837f799e closing production page, also close the agenda and reload the prod home 2018-04-26 12:21:30 +02:00
bachir 9e64c092d4 inter-titre ... 2018-04-26 12:10:16 +02:00
bachir c9b30d9046 uninstalled mobile_js_redirect 2018-04-26 01:32:22 +02:00
bachir 9cf2dd32d8 updated mobile_js_redirect settings 2018-04-26 01:23:29 +02:00
bachir 7a02d86270 updated mobile_js_redirect settings 2018-04-26 01:01:37 +02:00
bachir 61261ea35b updated doamin and mobile_js_redirect settings 2018-04-26 00:55:45 +02:00
bachir 265670ec89 added mobile_js_redirect 2018-04-26 00:51:03 +02:00
bachir 13e1af6f8e search entries foldable 2018-04-26 00:15:31 +02:00
bachir 03a6d00061 click on 'collection' menu remove home 2018-04-25 23:38:10 +02:00
bachir 8b0a0ea705 hidden index,notice,article sur-title and/or title 2018-04-25 23:32:54 +02:00
bachir bd68707e61 social media btns 2018-04-25 23:23:03 +02:00
bachir e2b0c1c59a lazy load audio in views admin pages 2018-04-25 22:33:16 +02:00
bachir d3eea03e7d added h4.inter-titre style to wysiwyg 2018-04-25 22:24:21 +02:00
bachir 225e5c5929 lower media query css trigger 2018-04-25 21:27:55 +02:00
bachir 79b253c350 removed ECMA6 js code 2018-04-25 21:14:25 +02:00
bachir b1ebaf63c0 mignified assets for prod 2018-04-25 21:11:45 +02:00
bachir 32d2c3709a unmignified assets for debug purpose 2018-04-25 21:06:32 +02:00
bachir 4659728d34 mignified assets for prod 2018-04-25 20:12:49 +02:00
bachir aa55ae2e35 responive header and footer ready (remains centering entree block 2018-04-25 20:09:49 +02:00
90 changed files with 3152 additions and 3104 deletions
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
@@ -0,0 +1,14 @@
This is a simple module that adds a JS in the HTML head to perform a redirect
from a desktop site URL to a mobile one or the other way around. This is
useful when Varnish or any other reverse proxy cache is being used to cache
your site and keep a mobile vs desktop redirect working.
Install this module like any other module and set the "Desktop site URL" and
"Mobile site URL" for this to work.
To be able to access the administrative area or avoid redirection at any point,
use the query string below:
?stopredirect=true
URL settings - /admin/config/system/mobile_js_redirect
@@ -0,0 +1,46 @@
/**
* @file
* Client-side Javascript routine for Mobile JS Redirect module.
*/
var mobile_pattern = new RegExp(mobile_js_redirect_devices_regexp, 'i');
var mobile = (mobile_pattern.test(navigator.userAgent.toLowerCase()));
// Both of these variables have to be set for this mechanism to work.
// If this plugin is being used by a Drupal Gardens site, we can simply
// set these variables manually and upload this file to the site.
var target_url = mobile_js_redirect_target_url;
var mobile_url = mobile_js_redirect_mobile_url;
var desktop_url = mobile_js_redirect_desktop_url;
// Check whether the noRedirect flag is set.
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
var no_redirect = false;
var secure = (window.location.protocol == "https:") ? true : false;
for (var i = 0; i < hashes.length; i++) {
var hash = hashes[i].split('=');
if (hash[0] != null && hash[0] == 'stopredirect' && hash[1] != null && hash[1] == 'true') {
no_redirect = true;
// Add session cookie to stop future redirect.
jQuery.cookie('mobile_js_redirect.stopredirect', 1, { path: '/', secure: secure });
break;
}
else if (jQuery.cookie('mobile_js_redirect.stopredirect') == 1) {
no_redirect = true;
}
}
if (mobile_url != null && desktop_url != null && !no_redirect) {
// Remove protocol and path.
var regex = /[\/:?#]/;
var url_parts = target_url.replace('http://', '').replace('https://', '').split(regex);
if (mobile && window.location.hostname == url_parts[0]) {
// The device is mobile but the URL is desktop, so redirect.
document.location = mobile_url;
}
else if (!mobile && window.location.hostname == url_parts[0]) {
// The device is desktop but the URL is mobile, so redirect.
document.location = desktop_url;
}
}
@@ -0,0 +1,11 @@
name: 'Mobile JS Redirect'
type: module
description: 'Client-side redirect based on the user-agent string.'
# core: 8.x
configure: 'admin/config/system/mobile_js_redirect'
# Information added by Drupal.org packaging script on 2016-11-30
version: '8.x-1.0-beta1'
core: '8.x'
project: 'mobile_js_redirect'
datestamp: 1480536188
@@ -0,0 +1,7 @@
mobile-js-redirect-js:
version: 1.x
js:
js/mobile_js_redirect.js: {}
dependencies:
- core/jquery
- core/jquery.cookie
@@ -0,0 +1,6 @@
system.mobile_js_redirect_admin:
title: 'Mobile JS Redirect'
parent: system.admin_config_system
description: 'Manage the Mobile JS Redirect Settings.'
route_name: mobile_js_redirect.admin_form
weight: 30
@@ -0,0 +1,90 @@
<?php
/**
* @file
* Client-side redirect based on the user-agent string.
*/
use Drupal\Component\Utility\Html;
/**
* Default value for devices list option.
*/
const MOBILE_JS_REDIRECT_REGEXP_DEVICES_LIST = 'iphone|ipad|ipod|android|blackberry|mini|windowssce|iemobile|palm';
/**
* Implements hook_page_attachments().
*/
function mobile_js_redirect_page_attachments(array &$attachments) {
$attachments['#attached']['library'][] = 'mobile_js_redirect/mobile-js-redirect-js';
$attachments['#attached']['html_head'][] = [
[
'#type' => 'html_tag',
'#tag' => 'script',
'#value' => mobile_js_get_urls(),
],
'mobile-js-redirect-js',
];
}
/**
* Get URLs for use on JS file.
*/
function mobile_js_get_urls() {
global $base_root;
$urls = \Drupal::config('mobile_js_redirect.settings')->get('mobile_js_redirect_urls');
$current_url = $base_root . \Drupal::request()->getRequestUri();
$current_devices_list = (!empty(\Drupal::config('mobile_js_redirect.settings')->get('mobile_js_redirect_regexp_devices_list'))) ? \Drupal::config('mobile_js_redirect.settings')->get('mobile_js_redirect_regexp_devices_list') : MOBILE_JS_REDIRECT_REGEXP_DEVICES_LIST;
$devices_list = Html::escape($current_devices_list);
// Set default values.
$javascript = "var mobile_js_redirect_target_url = '';";
$javascript .= "var mobile_js_redirect_desktop_url = '';";
$javascript .= "var mobile_js_redirect_mobile_url = '';";
$urls_arr = explode(PHP_EOL, $urls);
foreach ($urls_arr as $value) {
$url_line = explode('|', $value);
$last_char = substr($url_line[0], -1);
if ($last_char == '*') {
$trated_url = substr($url_line[0], 0, -1);
if (strpos($current_url, $trated_url) !== FALSE) {
$javascript = mobile_js_update_urls($url_line);
break;
}
}
if ($url_line[0] == $current_url || $url_line[0] . '/' == $current_url) {
$javascript = mobile_js_update_urls($url_line);
break;
}
}
$javascript .= "var mobile_js_redirect_devices_regexp = '$devices_list';";
return $javascript;
}
/**
* Update URL values.
*/
function mobile_js_update_urls($url_array) {
$target_url = (!empty($url_array[0])) ? $url_array[0] : '';
$last_char = substr($url_array[0], -1);
if ($last_char == '*') {
$target_url = substr($url_array[0], 0, -1);
}
$url_desktop = (!empty($url_array[1])) ? $url_array[1] : '';
$url_mobile = (!empty($url_array[2])) ? $url_array[2] : '';
$javascript = "var mobile_js_redirect_target_url = '$target_url';";
$javascript .= "var mobile_js_redirect_desktop_url = '$url_desktop';";
$javascript .= "var mobile_js_redirect_mobile_url = '$url_mobile';";
return $javascript;
}
@@ -0,0 +1,7 @@
mobile_js_redirect.admin_form:
path: '/admin/config/system/mobile_js_redirect'
defaults:
_title: 'Mobile JS Redirect Settings'
_form: '\Drupal\mobile_js_redirect\Form\MobileJsRedirectAdminForm'
requirements:
_permission: 'administer site configuration'
@@ -0,0 +1,87 @@
<?php
namespace Drupal\mobile_js_redirect\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Implements an MobileJsRedirectAdminForm form.
*/
class MobileJsRedirectAdminForm extends ConfigFormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'mobile_js_redirect_form';
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return ['mobile_js_redirect.settings'];
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this->config('mobile_js_redirect.settings');
$form['site_urls'] = array(
'#type' => 'fieldset',
'#title' => t('Site URLs'),
'#description' => t('Mobile and Desktop sites URLs - Please read the instructions below the textarea.'),
);
$form['site_urls']['mobile_js_redirect_urls'] = array(
'#type' => 'textarea',
'#description' => t('- Put each group of urls on a line separated by | character (pipe) without spaces like: TARGET URL|DESKTOP URL|MOBILE URL.<br>- You can use the * character (asterisk) as a wildcard on target url.<br>- If you wont redirect one of these (desktop or mobile) leave blank.<br>- The redirect occurrs on the first "true" match.'),
'#default_value' => $config->get('mobile_js_redirect_urls'),
'#attributes' => array('placeholder' => array('Target URL|Desktop URL|Mobile URL')),
'#size' => 10,
'#resizable' => FALSE,
);
$form['devices_list'] = array(
'#type' => 'fieldset',
'#title' => t('Devices List'),
'#description' => t('Enter list of User Agent device names which should be recognized as mobile devices.<br>The default list Devices List is: iphone|ipad|ipod|android|blackberry|mini|windowssce|iemobile|palm'),
);
$form['devices_list']['mobile_js_redirect_regexp_devices_list'] = array(
'#type' => 'textfield',
'#description' => t('Use | for separation.'),
'#default_value' => (!empty($config->get('mobile_js_redirect_regexp_devices_list'))) ? $config->get('mobile_js_redirect_regexp_devices_list') : MOBILE_JS_REDIRECT_REGEXP_DEVICES_LIST,
);
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
if (empty($form_state->getValue('mobile_js_redirect_regexp_devices_list'))) {
$form_state->setErrorByName('mobile_js_redirect_regexp_devices_list', $this->t('The device list is empty. Please fill the Device list to continue.'));
}
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this->config('mobile_js_redirect.settings');
foreach ($form_state->getValues() as $key => $value) {
if (strpos($key, 'mobile_js_redirect_') !== FALSE) {
$config->set($key, $value);
}
}
$config->save();
drupal_set_message($this->t('Mobile Js Redirect configuration has been saved.'));
}
}
@@ -0,0 +1,89 @@
<?php
namespace Drupal\mobile_js_redirect\Tests;
use Drupal\simpletest\WebTestBase;
/**
* Tests for the Mobile JS Redirect module.
*
* @group Mobile Js Redirect
*/
class MobileJsRedirectTests extends WebTestBase {
protected $strictConfigSchema = FALSE;
/**
* {@inheritdoc}
*/
public static $modules = array('mobile_js_redirect');
/**
* {@inheritdoc}
*/
private $user;
/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
$this->user = $this->DrupalCreateUser(array(
'administer site configuration',
));
}
/**
* {@inheritdoc}
*/
public function testMobileJsRedirectPageExists() {
$this->drupalLogin($this->user);
// Generator test:
$this->drupalGet('admin/config/system/mobile_js_redirect');
$this->assertResponse(200);
}
/**
* {@inheritdoc}
*/
public function testConfigForm() {
// Test form structure.
$this->drupalLogin($this->user);
$this->drupalGet('admin/config/system/mobile_js_redirect');
$this->assertResponse(200);
$config = $this->config('mobile_js_redirect.settings');
$this->assertFieldByName(
'mobile_js_redirect_urls',
$config->get('mobile_js_redirect_urls'),
'Page title field has the default value'
);
$this->assertFieldByName(
'mobile_js_redirect_regexp_devices_list',
$config->get('mobile_js_redirect_regexp_devices_list'),
'Page title field has the default value'
);
$this->drupalPostForm(NULL, array(
'mobile_js_redirect_urls' => 'targetexample|desktopredirect|mobileredirect',
'mobile_js_redirect_regexp_devices_list' => 'iphone|ipad|ipod|android|blackberry|mini|windowssce|iemobile|palm',
), t('Save configuration'));
$this->drupalGet('admin/config/system/mobile_js_redirect');
$this->assertResponse(200);
$this->assertFieldByName(
'mobile_js_redirect_urls',
'targetexample|desktopredirect|mobileredirect',
'URLs text is OK.'
);
$this->assertFieldByName(
'mobile_js_redirect_regexp_devices_list',
'iphone|ipad|ipod|android|blackberry|mini|windowssce|iemobile|palm',
'Devices List text is OK.'
);
}
}
@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
@@ -0,0 +1,53 @@
CONTENTS OF THIS FILE
---------------------
* Introduction
* Configuration
* Features
* More information
INTRODUCTION
------------
The AddToAny module provides share buttons for Drupal. Sharing icons and
features are maintained by AddToAny, the universal sharing platform.
By default, the module places share buttons below node content.
CONFIGURATION
-------------
To configure AddToAny, go to:
Administration > Configuration > Web services > AddToAny.
Explore AddToAny's documentation for the Drupal module:
https://www.addtoany.com/buttons/customize/drupal
FEATURES
--------
The module strives to remain lightweight & efficient while integrating with
core Drupal features and major contributed modules such as:
* Blocks
* Views
* Display Suite (contributed)
AddToAny core is optimized to load asynchronously, and many sharing and social
media features come from AddToAny core including:
* Universal share menus
* Share counters
* Share templates
* Custom icons
* Automatic Google Analytics integration
* Event tracking (useful for integration with other analytics software)
* Link tracking using bit.ly, goo.gl, and custom URL shorteners
* Automatic localization (over 50 languages)
MORE INFORMATION
----------------
* AddToAny's official website:
https://www.addtoany.com/
@@ -0,0 +1,21 @@
<?php
/**
* @file
* Hooks specific to the AddToAny module.
*/
/**
* Alter the entity types that the AddToAny pseudo-field is available for.
*
* @param array $types
* The entity types.
*/
function hook_addtoany_entity_types_alter(&$types) {
// Add the "taxonomy_term" entity type.
$types[] = 'taxonomy_term';
}
/**
* @} End of "addtogroup addtoany".
*/
@@ -0,0 +1,5 @@
addtoany.settings:
title: 'AddToAny Settings'
base_route_name: addtoany.admin_settings
names:
- addtoany.settings
@@ -0,0 +1,14 @@
name: AddToAny
type: module
description: 'Share buttons by AddToAny, including the AddToAny universal sharing button, Facebook, Twitter, Google+, Pinterest, and over 100 more on the <a href="https://www.addtoany.com/" target="_blank">AddToAny</a> platform.'
package: Other
# core: 8.x
dependencies:
- drupal:node
configure: addtoany.admin_settings
# Information added by Drupal.org packaging script on 2018-03-07
version: '8.x-1.9'
core: '8.x'
project: 'addtoany'
datestamp: 1520385667
@@ -0,0 +1,132 @@
<?php
/**
* @file
* Install, update and uninstall functions for the AddToAny module.
*/
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\node\Entity\NodeType;
/**
* Implements hook_install().
*/
function addtoany_install() {
// Build a structured list of node bundles and view modes that have AddToAny
// enabled by default.
$node_enable_by_default = [
'article' => ['default', 'teaser'],
'page' => ['default', 'teaser'],
];
// Get the config entity storage handler.
$storage = \Drupal::entityTypeManager()->getStorage('entity_view_display');
foreach ($node_enable_by_default as $bundle => $viewmodes) {
// Set a default weight per node type.
$display_weight = ($bundle == 'article') ? 5 : 101;
foreach ($viewmodes as $viewmode) {
// Get the config entity for this bundle and view mode.
$display = $storage->load('node.' . $bundle . '.' . $viewmode);
// Enable the AddToAny extra field and save the config.
if (!empty($display)) {
$display->setComponent('addtoany', ['weight' => $display_weight])->save();
}
}
}
}
/**
* Migrate global placement settings to settings per view mode.
*/
function addtoany_update_8101(&$sandbox) {
$config_factory = \Drupal::configFactory();
// Gather the settings we need to migrate.
$addtoany_settings = $config_factory->getEditable('addtoany.settings');
$node_types = $addtoany_settings->getOriginal('nodetypes');
$display_in_teasers = $addtoany_settings->getOriginal('display_in_teasers');
$display_in_nodecont = $addtoany_settings->getOriginal('display_in_nodecont');
$display_weight = $addtoany_settings->getOriginal('display_weight');
$new_display_weight = $display_weight;
// The entity display repository stores which view modes are enabled.
$entity_display_repository = \Drupal::getContainer()->get('entity_display.repository');
// Check if AddToAny is currently shown on at least one node type.
if (!empty($node_types) && $display_in_nodecont) {
// Loop over the AddToAny-enabled node types.
foreach ($node_types as $bundle) {
// Get enabled view modes.
$view_modes = $entity_display_repository->getViewModeOptionsByBundle('node', $bundle);
// If the teaser view mode is enabled but the old settings excluded it,
// take it out.
if (!empty($view_modes['teaser']) && $display_in_teasers == FALSE) {
unset($view_modes['teaser']);
}
// Check if the old default weight was set.
if ($display_weight == 10) {
// Set the new default weight per node type.
$new_display_weight = ($bundle == 'article') ? 5 : 101;
}
// Loop over the view modes and apply new settings to match the old.
foreach ($view_modes as $view_mode => $view_mode_info) {
$display = EntityViewDisplay::load('node.' . $bundle . '.' . $view_mode);
$display->setComponent('addtoany', ['weight' => $new_display_weight])->save();
}
}
}
// Convert Display Suite fields to regular "extra fields".
if (\Drupal::moduleHandler()->moduleExists('ds')) {
// The DsField implementation only supported node entities.
$all_node_types = NodeType::loadMultiple();
foreach ($all_node_types as $node_type) {
// Get enabled view modes.
$view_modes = $entity_display_repository->getViewModeOptionsByBundle('node', $node_type->id());
// Loop over the view modes and apply new settings to match the old.
foreach ($view_modes as $view_mode => $view_mode_info) {
// Get the entity view display config entity.
$display = EntityViewDisplay::load('node.' . $node_type->id() . '.' . $view_mode);
// Check if this view mode uses Display Suite fields and if the Display
// Suite AddToAny field ("addtoany_field") was enabled.
$ds_fields = $display->getThirdPartySetting('ds', 'fields');
if (!empty($ds_fields) && isset($ds_fields['addtoany_field'])) {
// Remove the DS field, add the extra field.
unset($ds_fields['addtoany_field']);
$display->setComponent('addtoany');
// Keep the rest of the DS fields.
$display->setThirdPartySetting('ds', 'fields', $ds_fields);
// Find where the DS field was placed and put the AddToAny extra field
// in its place.
$ds_regions = $display->getThirdPartySetting('ds', 'regions');
foreach ($ds_regions as $label => $ds_region_fields) {
$key = array_search('addtoany_field', $ds_region_fields);
if ($key !== FALSE) {
$ds_regions[$label][$key] = 'addtoany';
}
}
// Apply the altered region settings.
$display->setThirdPartySetting('ds', 'regions', $ds_regions);
// Save the view mode.
$display->save();
}
}
}
}
// Finally, clean up no longer used settings.
$addtoany_settings->clear('nodetypes')
->clear('display_in_teasers')
->clear('display_in_nodecont')
->clear('display_weight')
->save();
}
@@ -0,0 +1,21 @@
addtoany:
version: VERSION
js:
https://static.addtoany.com/menu/page.js: { attributes: { async: true }, type: external, minified: true }
js/addtoany.js: {}
css:
theme:
css/addtoany.css: {}
dependencies:
- core/drupal
addtoany.admin:
version: VERSION
js:
js/addtoany.admin.js: {}
css:
theme:
css/addtoany.admin.css: {}
dependencies:
- core/jquery
- core/drupal
@@ -0,0 +1,5 @@
addtoany.admin_settings:
title: 'AddToAny'
parent: system.admin_config_services
description: 'Configure AddToAny share buttons.'
route_name: addtoany.admin_settings
@@ -0,0 +1,4 @@
addtoany.admin_settings_tab:
route_name: addtoany.admin_settings
title: Settings
base_route: addtoany.admin_settings
@@ -0,0 +1,270 @@
<?php
/**
* @file
* Handle AddToAny integration.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Render\Markup;
use Drupal\Core\Url;
use Drupal\Component\Utility\UrlHelper;
use Drupal\node\Entity\Node;
/**
* Implements hook_theme().
*/
function addtoany_theme() {
return [
'addtoany_standard' => [
'variables' => [
'addtoany_html' => FALSE,
'link_url' => FALSE,
'link_title' => FALSE,
'buttons_size' => FALSE,
'button_setting' => FALSE,
'button_image' => FALSE,
'universal_button_placement' => FALSE,
'entity_type' => '',
'bundle' => '',
],
],
];
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
function addtoany_theme_suggestions_addtoany_standard(array $variables) {
$suggestion = 'addtoany_standard__';
$suggestions = [];
if (!empty($variables['entity_type'])) {
$suggestion .= $variables['entity_type'];
$suggestions[] = $suggestion;
}
if (!empty($variables['entity_type']) && !empty($variables['bundle'])) {
$suggestion .= '__' . $variables['bundle'];
$suggestions[] = $suggestion;
}
return $suggestions;
}
/**
* Implements hook_entity_extra_field_info().
*/
function addtoany_entity_extra_field_info() {
$extra = [];
$types = ['node', 'comment', 'media'];
// Allow modules to alter the entity types.
\Drupal::moduleHandler()->alter('addtoany_entity_types', $types);
foreach ($types as $type) {
$bundles = Drupal::service('entity_type.bundle.info')->getBundleInfo($type);
foreach ($bundles as $bundle => $bundle_data) {
$extra[$type][$bundle]['display']['addtoany'] = [
'label' => t('AddToAny'),
'description' => t('Share buttons by AddToAny'),
'weight' => 5,
'visible' => FALSE,
];
}
}
return $extra;
}
/**
* Implements hook_ENTITY_TYPE_view().
*/
function addtoany_entity_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
if ($display->getComponent('addtoany')) {
$data = addtoany_create_entity_data($entity);
$build['addtoany'] = [
'#addtoany_html' => \Drupal::token()->replace($data['addtoany_html'], ['node' => $entity]),
'#link_url' => $data['link_url'],
'#link_title' => $data['link_title'],
'#button_setting' => $data['button_setting'],
'#button_image' => $data['button_image'],
'#universal_button_placement' => $data['universal_button_placement'],
'#buttons_size' => $data['buttons_size'],
'#entity_type' => $entity->getEntityType()->id(),
'#bundle' => $entity->bundle(),
'#theme' => 'addtoany_standard',
];
}
}
/**
* Implements hook_page_attachments().
*/
function addtoany_page_attachments(&$page) {
$config = \Drupal::config('addtoany.settings');
// Initial JavaScript.
$additional_js = $config->get('additional_js');
if (\Drupal::moduleHandler()->moduleExists('token')) {
$node = \Drupal::routeMatch()->getParameter('node');
$data = [];
if ($node) {
if (is_numeric($node)) {
$node = Node::load($node);
}
$data = ['node' => $node];
$additional_js = \Drupal::token()->replace($additional_js, $data);
}
}
$javascript_header = 'window.a2a_config=window.a2a_config||{};'
. 'a2a_config.callbacks=[];a2a_config.overlays=[];'
. 'a2a_config.templates={};'
. (($config->get('no_3p')) ? 'a2a_config.no_3p=1;' : '')
. $additional_js;
// Add AddToAny initial JS config.
$page['#attached']['html_head'][] = [
// The data.
[
// Add a <script> tag.
'#tag' => 'script',
// Add JavaScript to the <script> tag.
'#value' => Markup::create($javascript_header),
// Give weight so it appears after meta tags, etc.
'#weight' => 10,
],
// Assign a key to reference this HTML <HEAD> element when altering.
'addtoany-js',
];
// Custom CSS.
$css = $config->get('additional_css');
if (!empty($css)) {
// Add AddToAny custom CSS.
$page['#attached']['html_head'][] = [
// The data.
[
// Add a <style> tag.
'#tag' => 'style',
// Add CSS to the <style> tag.
'#value' => $css,
// Give weight so it appears after meta tags, etc.
'#weight' => 10,
],
// Assign a key to reference this HTML <HEAD> element when altering.
'addtoany-css',
];
}
// Add module's main library, which includes external AddToAny core JS,
// and the module's CSS.
$page['#attached']['library'][] = 'addtoany/addtoany';
}
/**
* Generate data for AddToAny buttons for a node.
*
* @param object $node
* The node object to create the buttons for.
* @param object $config
* If present this will be used as custom config data. Use NULL for default
* config data.
*
* @return array
* The array with url, title, additional_html that will be send to Twig.
*/
function addtoany_create_entity_data($node, $config = NULL) {
$url = isset($node) ? $node->url('canonical', ['absolute' => TRUE]) : NULL;
$title = isset($node) ? $node->label() : NULL;
return addtoany_create_data($url, $title, $config);
}
/**
* Generate data for AddToAny buttons.
*
* @param string $url
* If present this will be used as the URL.
* @param string $title
* If present this will be used as the title. Use an empty string for no title
* or NULL to use the current page title.
* @param object $config
* If present this will be used as custom config data. Use NULL for default
* config data.
*
* @return array
* The array with url, title, additional_html that will be send to Twig.
*/
function addtoany_create_data($url = NULL, $title = NULL, $config = NULL) {
if (is_null($config)) {
$config = \Drupal::config('addtoany.settings');
}
$additional_html = rtrim($config->get('additional_html'));
$universal_button_placement = $config->get('universal_button_placement');
$is_front = \Drupal::service('path.matcher')->isFrontPage();
// Default to <front> or the current path.
if (!isset($url)) {
// Use <front> for the front page to avoid '/node' as the final URL,
// otherwise use current path.
$url = ($is_front) ? Url::fromRoute('<front>')
->setAbsolute()
->toString() : Url::fromRoute('<current>')->setAbsolute()->toString();
}
else {
// Sanitize and encode URL for HTML output.
$url = UrlHelper::stripDangerousProtocols($url);
}
// Default to the current title if available, otherwise use the site name.
if (!isset($title)) {
$site_name = \Drupal::config('system.site')->get('name');
if ($is_front) {
$title = $site_name;
}
else {
$request = \Drupal::request();
$route_match = \Drupal::routeMatch();
$title = \Drupal::service('title_resolver')
->getTitle($request, $route_match->getRouteObject());
// Expecting array|string|null from getTitle.
if (is_array($title)) {
$title['#allowed_tags'] = [];
$title = \Drupal::service('renderer')->renderPlain($title);
}
}
$title = (empty($title)) ? $site_name : $title;
}
$buttons_size = $config->get('buttons_size');
// Must be a 3 digit positive integer.
$buttons_size = (
$buttons_size !== '32' && strlen($buttons_size) <= 3 && $buttons_size !== ''
&& is_numeric($buttons_size) && intval($buttons_size) == $buttons_size && $buttons_size > 0
) ? $buttons_size : '32';
$button_setting = $config->get('universal_button');
if ($button_setting == 'custom') {
$button_image = UrlHelper::stripDangerousProtocols($config->get('custom_universal_button'));
}
$info = [
'link_url' => $url,
'link_title' => $title,
'buttons_size' => $buttons_size,
'button_setting' => $button_setting,
'button_image' => isset($button_image) ? $button_image : '',
'universal_button_placement' => $universal_button_placement,
'addtoany_html' => $additional_html,
];
return $info;
}
@@ -0,0 +1,4 @@
# Permissions for the addtoany module
'administer addtoany':
title: 'Administer AddToAny'
description: 'Perform administration tasks for the AddToAny module.'
@@ -0,0 +1,7 @@
addtoany.admin_settings:
path: '/admin/config/services/addtoany'
defaults:
_form: '\Drupal\addtoany\Form\AddToAnySettingsForm'
_title: 'AddToAny'
requirements:
_permission: 'administer addtoany'
@@ -0,0 +1,21 @@
<?php
/**
* @file
* Views integration for AddToAny.
*/
/**
* Implements hook_views_data_alter().
*/
function addtoany_views_data_alter(array &$data) {
// Add the addtoany link to the node fields.
$data['node']['addtoany_share'] = [
'title' => t('AddToAny share buttons'),
'field' => [
'title' => t('AddToAny share buttons'),
'help' => t('Provide share buttons for sharing the content.'),
'id' => 'node_addtoany_share',
],
];
}
@@ -0,0 +1,11 @@
buttons_size: 32
additional_html: |
<a class="a2a_button_facebook"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_google_plus"></a>
additional_css: ''
additional_js: ''
universal_button: default
custom_universal_button: ''
universal_button_placement: before
no_3p: false
@@ -0,0 +1,28 @@
# Schema file for the configuration files of the addtoany module.
addtoany.settings:
type: config_object
label: 'AddToAny Settings'
mapping:
buttons_size:
type: integer
additional_html:
type: text
label: 'Additional HTML'
additional_css:
type: string
label: 'Additional CSS'
additional_js:
type: string
label: 'Additional JS'
universal_button:
type: string
label: 'Universal Button Type'
custom_universal_button:
type: uri
lable: 'Custom button URL'
universal_button_placement:
type: string
label: 'Universal Button Placement'
no_3p:
type: boolean
label: 'Disable 3rd Party Cookies'
@@ -0,0 +1,7 @@
.addtoany-round-icon {
border-radius: 14%;
}
.addtoany-universal-button-option img {
vertical-align: middle;
}
@@ -0,0 +1,54 @@
.addtoany {
display: inline;
}
.addtoany_list {
display: inline;
line-height: 16px;
}
.addtoany_list > a,
.addtoany_list a img,
.addtoany_list a > span {
vertical-align: middle;
}
.addtoany_list > a {
border: 0;
display: inline-block;
font-size: 16px;
padding: 0 4px;
}
.addtoany_list.a2a_kit_size_32 > a {
font-size: 32px;
}
.addtoany_list .a2a_counter img {
float: left;
}
.addtoany_list a span.a2a_img {
display: inline-block;
height: 16px;
opacity: 1;
overflow: hidden;
width: 16px;
}
.addtoany_list a span {
display: inline-block;
float: none;
}
.addtoany_list.a2a_kit_size_32 a > span {
border-radius: 4px;
height: 32px;
line-height: 32px;
opacity: 1;
width: 32px;
}
.addtoany_list a:hover:hover img,
.addtoany_list a:hover span {
opacity: .7;
}
.addtoany_list a.addtoany_share_save img {
border: 0;
width: auto;
height: auto;
}
.addtoany_list a .a2a_count {
position: relative;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><path fill="#0166FF" d="M0 0h32v32H0z"/><g fill="#FFF"><path d="M14 7h4v18h-4z"/><path d="M7 14h18v4H7z"/></g></svg>

After

Width:  |  Height:  |  Size: 179 B

@@ -0,0 +1,33 @@
(function ($) {
'use strict';
Drupal.behaviors.addtoany = {
attach: function (context, settings) {
// Initial page setup
var addtoany_icon = $('input[name="addtoany_universal_button"]').next('label').find('img:first');
var initial_icon_size_int = parseInt($('input[name="addtoany_buttons_size"]').val());
// Set the A2A icon's size to match selected Icon Size
addtoany_icon.height(initial_icon_size_int).width(initial_icon_size_int);
// Bring attention to large A2A icon option
// because the universal button will likely be changed to match the other icons
// (Drupal #states can't handle this)
$('input[name="addtoany_buttons_size"]').change(function () {
var icon_size = $(this).val();
var icon_size_int = parseInt(icon_size);
// Set the A2A icon's size to match selected Icon Size
addtoany_icon.height(icon_size_int).width(icon_size_int);
});
}
};
}(jQuery));
@@ -0,0 +1,14 @@
/* global a2a*/
(function (Drupal) {
'use strict';
Drupal.behaviors.addToAny = {
attach: function (context, settings) {
// If not the full document (it's probably AJAX), and window.a2a exists
if (context !== document && window.a2a) {
a2a.init_all('page'); // Init all uninitiated AddToAny instances
}
}
};
})(Drupal);
@@ -0,0 +1,216 @@
<?php
namespace Drupal\addtoany\Form;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Extension\ModuleHandler;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Configure AddToAny settings for this site.
*/
class AddToAnySettingsForm extends ConfigFormBase {
/**
* Drupal\Core\Extension\ModuleHandler definition.
*
* @var Drupal\Core\Extension\ModuleHandler
*/
protected $moduleHandler;
/**
* Constructs a AddToAnySettingsForm object.
*
* @param \Drupal\Core\Extension\ModuleHandler $module_handler
* The factory for configuration objects.
*/
public function __construct(ModuleHandler $module_handler) {
$this->moduleHandler = $module_handler;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('module_handler')
);
}
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'addtoany_settings_form';
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return [
'addtoany.settings',
];
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
global $base_path;
$addtoany_settings = $this->config('addtoany.settings');
$button_img = '<img src="' . $base_path . drupal_get_path('module', 'addtoany') . '/images/%s" width="%d" height="%d"%s />';
$button_options = [
'default' => sprintf($button_img, 'a2a_32_32.svg', 32, 32, ' class="addtoany-round-icon"'),
'custom' => $this->t('Custom button'),
'none' => $this->t('None'),
];
$attributes_for_code = [
'autocapitalize' => ['off'],
'autocomplete' => ['off'],
'autocorrect' => ['off'],
'spellcheck' => ['false'],
];
// Attach CSS and JS.
$form['#attached']['library'][] = 'addtoany/addtoany.admin';
$form['addtoany_button_settings'] = [
'#type' => 'details',
'#title' => $this->t('Buttons'),
'#open' => TRUE,
];
$form['addtoany_button_settings']['addtoany_buttons_size'] = [
'#type' => 'number',
'#title' => $this->t('Icon size'),
'#field_suffix' => ' ' . $this->t('pixels'),
'#default_value' => $addtoany_settings->get('buttons_size'),
'#size' => 10,
'#maxlength' => 3,
'#min' => 8,
'#max' => 999,
'#required' => TRUE,
];
$form['addtoany_button_settings']['addtoany_service_button_settings'] = [
'#type' => 'details',
'#title' => $this->t('Service Buttons'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
];
$form['addtoany_button_settings']['addtoany_service_button_settings']['addtoany_additional_html'] = [
'#type' => 'textarea',
'#title' => $this->t('Service Buttons HTML code'),
'#default_value' => $addtoany_settings->get('additional_html'),
'#description' => $this->t('You can add HTML code to display customized <a href="https://www.addtoany.com/buttons/customize/drupal/standalone_services" target="_blank">standalone service buttons</a> next to each universal share button. For example: <br /> <code>&lt;a class=&quot;a2a_button_facebook&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_twitter&quot;&gt;&lt;/a&gt;<br />&lt;a class=&quot;a2a_button_pinterest&quot;&gt;&lt;/a&gt;</code>
'),
'#attributes' => $attributes_for_code,
];
$form['addtoany_button_settings']['universal_button'] = [
'#type' => 'details',
'#title' => $this->t('Universal Button'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
/* #states workaround in addtoany.admin.js */
];
$form['addtoany_button_settings']['universal_button']['addtoany_universal_button'] = [
'#type' => 'radios',
'#title' => $this->t('Button'),
'#default_value' => $addtoany_settings->get('universal_button'),
'#attributes' => ['class' => ['addtoany-universal-button-option']],
'#options' => $button_options,
];
$form['addtoany_button_settings']['universal_button']['addtoany_custom_universal_button'] = [
'#type' => 'textfield',
'#title' => $this->t('Custom button URL'),
'#default_value' => $addtoany_settings->get('custom_universal_button'),
'#description' => $this->t('URL of the button image. Example: http://example.com/share.png'),
'#states' => [
// Show only if custom button is selected.
'visible' => [
':input[name="addtoany_universal_button"]' => ['value' => 'custom'],
],
],
];
$form['addtoany_button_settings']['universal_button']['addtoany_universal_button_placement'] = [
'#type' => 'radios',
'#title' => $this->t('Button placement'),
'#default_value' => $addtoany_settings->get('universal_button_placement'),
'#options' => [
'after' => $this->t('After the service buttons'),
'before' => $this->t('Before the service buttons'),
],
'#states' => [
// Hide when universal sharing is disabled.
'invisible' => [
':input[name="addtoany_universal_button"]' => ['value' => 'none'],
],
],
];
$form['addtoany_additional_settings'] = [
'#type' => 'details',
'#title' => $this->t('Additional options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
];
$form['addtoany_additional_settings']['addtoany_additional_js'] = [
'#type' => 'textarea',
'#title' => $this->t('Additional JavaScript'),
'#default_value' => $addtoany_settings->get('additional_js'),
'#description' => $this->t('You can add special JavaScript code for AddToAny. See <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">AddToAny documentation</a>.'),
'#attributes' => $attributes_for_code,
];
$form['addtoany_additional_settings']['addtoany_additional_css'] = [
'#type' => 'textarea',
'#title' => $this->t('Additional CSS'),
'#default_value' => $addtoany_settings->get('additional_css'),
'#description' => $this->t('You can add special CSS code for AddToAny. See <a href="https://www.addtoany.com/buttons/customize/drupal" target="_blank">AddToAny documentation</a>.'),
'#attributes' => $attributes_for_code,
];
$form['addtoany_additional_settings']['addtoany_no_3p'] = [
'#type' => 'checkbox',
'#title' => $this->t('Disable 3rd party cookies'),
'#default_value' => $addtoany_settings->get('no_3p'),
'#description' => $this->t('Disabling may affect analytics and limit some functionality.'),
];
if ($this->moduleHandler->moduleExists('token')) {
$form['tokens'] = [
'#theme' => 'token_tree_link',
'#token_types' => ['node'],
'#global_types' => TRUE,
'#click_insert' => TRUE,
'#show_restricted' => FALSE,
'#recursion_limit' => 3,
'#text' => $this->t('Browse available tokens'),
];
}
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state->getValues();
$this->config('addtoany.settings')
->set('additional_css', $values['addtoany_additional_css'])
->set('additional_html', $values['addtoany_additional_html'])
->set('additional_js', $values['addtoany_additional_js'])
->set('buttons_size', $values['addtoany_buttons_size'])
->set('custom_universal_button', $values['addtoany_custom_universal_button'])
->set('universal_button', $values['addtoany_universal_button'])
->set('universal_button_placement', $values['addtoany_universal_button_placement'])
->set('no_3p', $values['addtoany_no_3p'])
->save();
parent::submitForm($form, $form_state);
}
}
@@ -0,0 +1,42 @@
<?php
namespace Drupal\addtoany\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\node\Entity\Node;
/**
* Provides an 'AddToAny' block.
*
* @Block(
* id = "addtoany_block",
* admin_label = @Translation("AddToAny buttons"),
* )
*/
class AddToAnyBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
$node = \Drupal::routeMatch()->getParameter('node');
if (is_numeric($node)) {
$node = Node::load($node);
}
$data = addtoany_create_entity_data($node);
return [
'#addtoany_html' => \Drupal::token()->replace($data['addtoany_html'], ['node' => $node]),
'#link_url' => $data['link_url'],
'#link_title' => $data['link_title'],
'#button_setting' => $data['button_setting'],
'#button_image' => $data['button_image'],
'#universal_button_placement' => $data['universal_button_placement'],
'#buttons_size' => $data['buttons_size'],
'#theme' => 'addtoany_standard',
'#cache' => [
'contexts' => ['url'],
],
];
}
}
@@ -0,0 +1,44 @@
<?php
namespace Drupal\addtoany\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
/**
* Field handler to flag the node type.
*
* @ingroup views_field_handlers
*
* @ViewsField("node_addtoany_share")
*/
class NodeAddToAnyShare extends FieldPluginBase {
/**
* @{inheritdoc}
*/
public function query() {
// Leave empty to avoid a query on this field.
}
/**
* @{inheritdoc}
*/
public function render(ResultRow $values) {
$entity = $values->_entity;
if ($entity->access('view')) {
$data = addtoany_create_entity_data($entity);
return [
'#addtoany_html' => \Drupal::token()->replace($data['addtoany_html'], ['node' => $entity]),
'#link_url' => $data['link_url'],
'#link_title' => $data['link_title'],
'#button_setting' => $data['button_setting'],
'#button_image' => $data['button_image'],
'#universal_button_placement' => $data['universal_button_placement'],
'#buttons_size' => $data['buttons_size'],
'#theme' => 'addtoany_standard',
];
}
}
}
@@ -0,0 +1,45 @@
{#
/**
* @file
* Default theme implementation to standard AddToAny buttons.
*
* Available variables:
* - addtoany_html: HTML for AddToAny buttons.
* - button_image: URL for universal button.
* - button_setting: Setting of button.
* - button_size: Size of buttons.
* - universal_button_placement: Value of 'before' or 'after' to place button.
* - link_url: Value of URL to share.
* - link_title: Value of page title to share.
*
* @ingroup themeable
*/
#}
{# Remove whitespace between tags for even spacing between buttons. #}
{% spaceless %}
{% if button_setting != 'none' %}
{% set universal_button %}
<a class="a2a_dd addtoany_share" href="https://www.addtoany.com/share#url={{ link_url|url_encode }}&amp;title={{ link_title|url_encode }}">
{% if button_image %}
<img src="{{ button_image }}">
{% endif %}
</a>
{% endset %}
{% endif %}
<span class="a2a_kit a2a_kit_size_{{ buttons_size }} addtoany_list" data-a2a-url="{{ link_url }}" data-a2a-title="{{ link_title }}">
{% if universal_button_placement == 'before' %}
{{ universal_button }}
{% endif %}
{% if addtoany_html %}
{{ addtoany_html|raw }}
{% endif %}
{% if universal_button_placement == 'after' %}
{{ universal_button }}
{% endif %}
</span>
{% endspaceless %}
@@ -42,4 +42,4 @@ function render(){_ctx.clearRect(0,0,_scene_props.width,_scene_props.height);che
_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($){var edlpcorpus=new EdlpCorpus();});})(jQuery,Drupal,drupalSettings);
$(document).ready(function($){if(drupalSettings.path.isFront&&!edlp_mobile.device_is_mobile){var edlpcorpus=new EdlpCorpus();}});})(jQuery,Drupal,drupalSettings);
@@ -1225,8 +1225,11 @@
init();
}
$(document).ready(function($) {
var edlpcorpus = new EdlpCorpus();
if(drupalSettings.path.isFront && !edlp_mobile.device_is_mobile){
var edlpcorpus = new EdlpCorpus();
}
});
})(jQuery, Drupal, drupalSettings);
@@ -10,6 +10,7 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Url;
use Drupal\Core\Link;
use Drupal\workflow\Entity\WorkflowManager;
@@ -118,31 +119,48 @@ function edlp_corpus_node_view(array &$build, EntityInterface $entity, EntityVie
// build the array of relateds classified by page_type (taxonomy)
$relateds = array();
foreach ($nodes as $nid => $node) {
$page_type = $node->get('field_page_type')->get(0)->getValue();
// $page_type = $node->get('field_page_type')->get(0)->getValue();
// dpm($page_type, 'page_type');
$term = entity_load('taxonomy_term', $page_type['target_id']);
// $term = entity_load('taxonomy_term', $page_type['target_id']);
// dpm($term, 'term');
$relateds[$term->getName()][] = $node->getTitle();
// $relateds[$term->getName()][] = $node->getTitle();
$url = Url::fromRoute('entity.node.canonical', ['node'=>$node->id()]);
$url->setOptions(array(
'attributes' => array(
'class' => ['ajax-link'],
'data-drupal-link-system-path' => $url->getInternalPath()
)
));
$link = Link::fromTextAndUrl(trim($node->getTitle()), $url);
// $relateds[$term->getName()][] = $link;
$relateds[] = $link->toRenderable();
}
// dpm($relateds, 'relateds');
// if relateds, build the sentence for display and the render array
if(count($relateds)){
$relations = '<h3>' . t('This sound is about :') . '</h3><p>';
// $relations = '<h3>' . t('This sound is about :') . '</h3>';
foreach ($relateds as $cat => $titles) {
$relations .= '<span class="cat">' . $cat . ' :</span> ' . implode(', ', $titles) . ' | ';
}
// foreach ($relateds as $cat => $titles) {
// // $relations .= '<span class="cat">' . $cat . ' :</span> ' . implode(', ', $titles) . ' | ';
// $relations[] =
// }
$relations = preg_replace('/\s\|\s$/', '', $relations);
$relations .= '</p>';
// $relations = preg_replace('/\s\|\s$/', '', $relations);
// $relations .= '</p>';
$build['relations'] = array(
'#type'=>"container",
'#attributes'=>array(
'class'=>'relations'
),
"#markup"=> $relations,
'title' => array(
"#markup"=> '<h3>' . t('This sound is about :') . '</h3>',
),
'content' => array (
'#theme' => 'item_list',
'#items' => $relateds,
),
);
}
@@ -93,12 +93,19 @@ function template_preprocess_edlp_home(&$vars){
// );
// render the next events of agenda as list
$agenda = array (
'#theme' => 'item_list',
'#items' => [],
$agenda = array(
'#type'=>"container",
'title'=>array(
'#markup'=>"<h3>".t("Agenda")."</h3>",
),
'list'=> array(
'#theme' => 'item_list',
'#items' => [],
),
);
foreach($vars['agenda_items'] as $node){
$agenda['#items'][] = $view_builder->view($node, 'teaser');
$agenda['list']['#items'][] = $view_builder->view($node, 'teaser');
}
$vars['agenda'] = render($agenda);
@@ -0,0 +1,7 @@
name: 'edlp_mobile'
type: module
description: 'Handle some mobile behaviours'
core: 8.x
package: 'Edlp'
dependencies:
- domain
@@ -0,0 +1,150 @@
<?php
/**
* @file
* Contains edlp_mobile.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
// use Drupal\domain\DomainStorage;
// use Drupal\domain\DomainElementManager;
/**
* Implements hook_help().
*/
function edlp_mobile_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the edlp_mobile module.
case 'help.page.edlp_mobile':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Handle some mobile behaviours') . '</p>';
return $output;
default:
}
}
/**
* hook_entity_extra_field_info()
*/
// function edlp_mobile_entity_extra_field_info(){
// $extra = [];
// $extra['domain']['relations'] = [
// 'label' => t('Relations'),
// 'description' => 'Display enregistrement relations with other content types',
// 'weight' => 99,
// ];
// return $extra;
// }
// should be the right way
// function edlp_mobile_entity_field_storage_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) {
// if ($entity_type->id() == 'domain') {
// $definitions['device'] = \Drupal\Core\Field\BaseFieldDefinition::create('string')
// ->setName('Device')
// ->setLabel(t('Define a target device for this domain (mobile|desktop)'))
// ->setTargetEntityTypeId($entity_type->id());
// return $definitions;
// }
// }
/**
* Implements hook_page_attachments().
* @param array $attachments
*/
function edlp_mobile_page_attachments(array &$attachments) {
$is_mobile_domain = false;
global $base_root;
//dpm($base_root, '$base_root');
$current_domain = preg_replace('/http:\/\/|https:\/\//i', '', $base_root);
//dpm($current_domain, '$current_domain');
$domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
$domains = $domain_storage->loadMultiple();
//dpm($domains);
$domain_alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
//dpm($domain_alias_storage);
foreach ($domains as $domain_id => $domain) {
if($domain->isActive()){
//dpm($domain);
$alias_ids = $domain_alias_storage->getQuery()->condition('domain_id', $domain_id)->execute();
//dpm($alias_ids, 'alias_ids');
$aliases = $domain_alias_storage->loadMultiple($alias_ids);
// dpm($aliases, 'aliases');
foreach ($aliases as $alias_id => $alias) {
if($alias->getPattern() == $current_domain){
// we found the current domain and current alias
// dpm($domain, 'domain');
// dpm($alias, 'alias');
$env = $alias->getEnvironment();
$env_aliases = $domain_alias_storage->loadByEnvironment($env);
// dpm($env_aliases, '$env_aliases');
// find out mibile alias and desktop alias
// this is dirty
// 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
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();
}
}
}else{
// current domain/alias is mobile
$is_mobile_domain = false;
$desktop_url = $alias->getPattern();
// find desktop pattern
foreach ($env_aliases as $env_alias_id => $env_alias) {
if($env_alias_id != $alias_id){
// we found the desktop pattern
$mobile_url = $env_alias->getPattern();
}
}
}
break;
}
}
break;
}
}
// $mobile =
$current_path = \Drupal::service('path.current')->getPath();
$is_front = \Drupal::service('path.matcher')->isFrontPage();
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();
// $redirect = false;
$js_str = "var edlp_mobile = {\n
current_url:'".$base_root."',\n
current_path:'".$current_path."',\n
is_front:".($is_front ? 'true':'false').",\n
lang_code:'".$current_language."',\n
is_mobile_domain:".($is_mobile_domain ? 'true':'false').",\n
mobile_url:'".$mobile_url."',\n
desktop_url:'".$desktop_url."',\n
};";
$attachments['#attached']['html_head'][] = [
[
'#type' => 'html_tag',
'#tag' => 'script',
'#value' => $js_str,
'#weight' => -1000,
'#group' => 'edlp'
],
// A key, to make it possible to recognize this HTML element when altering.
'edlp_mobile',
];
}
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 3.96875 3.9687501"><g transform="translate(0 -293.031)"><rect style="isolation:auto;mix-blend-mode:normal" width="3.969" height="3.969" y="293.031" rx="2.299" ry="2.874" color="#000" overflow="visible" fill="none"/><path d="M1.516 294.3q-.122.188-.28.557-.044-.092-.075-.147-.03-.057-.083-.13-.051-.074-.104-.115-.051-.043-.128-.071-.076-.03-.166-.03H.224q-.029 0-.047-.019-.018-.018-.018-.047v-.391q0-.029.018-.047t.047-.018H.68q.51 0 .836.458zm2.277 1.582q.018.018.018.047 0 .028-.018.047l-.652.652q-.019.018-.047.018-.027 0-.047-.02-.019-.019-.019-.045v-.391l-.173.002q-.108 0-.165.002l-.149-.002q-.091-.005-.144-.011l-.13-.022q-.078-.015-.13-.037-.05-.024-.118-.06-.067-.034-.12-.08-.053-.048-.112-.109-.059-.063-.114-.142.12-.19.277-.557.045.092.076.149.03.055.081.128.053.074.104.116.053.041.128.072.078.028.168.028h.521v-.391q0-.029.019-.047.018-.018.047-.018.024 0 .049.02zm0-1.826q.018.018.018.047 0 .028-.018.046l-.652.653q-.019.018-.047.018-.027 0-.047-.018-.019-.02-.019-.047v-.392h-.521q-.098 0-.178.031-.08.03-.14.092-.062.06-.104.126-.043.063-.092.157-.065.126-.159.348l-.102.227q-.04.091-.11.214-.067.122-.13.203-.062.082-.151.17-.088.087-.184.14-.093.051-.216.086-.122.032-.26.032H.223q-.029 0-.047-.018t-.018-.047v-.391q0-.029.018-.047t.047-.018H.68q.098 0 .178-.03.08-.031.14-.092.062-.062.104-.125.043-.065.092-.159.065-.126.159-.348l.1-.227q.043-.091.11-.214.07-.122.13-.203.064-.082.151-.17.09-.087.184-.138.095-.053.218-.086.122-.034.26-.034h.522v-.392q0-.028.019-.047.018-.018.047-.018.024 0 .049.02z" 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="#fb0000"/></g></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 3.96875 3.9687501"><g transform="translate(0 -293.031)"><rect style="isolation:auto;mix-blend-mode:normal" width="3.969" height="3.969" y="293.031" rx="2.299" ry="2.874" color="#000" overflow="visible" fill="none"/><path d="M2.33 295.421a.927.927 0 0 0 .282-.68.92.92 0 0 0-.283-.678.92.92 0 0 0-.678-.283.927.927 0 0 0-.68.283.924.924 0 0 0-.28.678.93.93 0 0 0 .28.68.93.93 0 0 0 .68.281c.265 0 .49-.094.678-.281zm1.301.912c.053.053.08.117.08.193a.26.26 0 0 1-.082.193.26.26 0 0 1-.193.081.255.255 0 0 1-.193-.081l-.736-.734a1.469 1.469 0 0 1-.856.266c-.204 0-.4-.04-.587-.118a1.55 1.55 0 0 1-.483-.322 1.55 1.55 0 0 1-.322-.482 1.503 1.503 0 0 1 0-1.174c.08-.187.188-.348.322-.482.136-.136.297-.243.483-.322a1.48 1.48 0 0 1 1.173 0 1.472 1.472 0 0 1 .804.804c.08.186.12.382.12.586 0 .315-.088.6-.266.856z" 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-size="20" font-family="#dc143c" letter-spacing="0" word-spacing="0" fill="red" stroke-width="1.033"/></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 3.96875 3.9687501"><g transform="translate(0 -293.031)"><path d="M3.946 295.143q0 .391-.141.74l-.048.116-.436.077q-.052.196-.214.323-.16.125-.368.125v.076q0 .033-.021.054-.022.021-.055.021h-.15q-.034 0-.055-.02-.021-.022-.021-.055v-1.358q0-.033.021-.054.021-.022.054-.022h.151q.033 0 .055.022.02.02.02.054v.075q.168 0 .307.085.14.083.22.224l.16-.028q.068-.224.068-.455 0-.349-.207-.658-.208-.309-.559-.493-.349-.183-.743-.183-.393 0-.745.183-.349.184-.556.493-.208.309-.208.658 0 .231.069.455l.16.028q.08-.141.22-.224.139-.085.306-.085v-.075q0-.033.021-.054.021-.022.055-.022h.15q.033 0 .055.022.02.02.02.054v1.358q0 .033-.02.054-.022.021-.055.021h-.15q-.034 0-.055-.02-.021-.022-.021-.055v-.076q-.207 0-.37-.125-.16-.127-.212-.323L.21 296l-.047-.116q-.141-.349-.141-.74 0-.356.158-.686.158-.33.422-.57.264-.244.627-.387.363-.144.754-.144.392 0 .755.144.363.143.627.386.264.24.422.57.158.33.158.687z" 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="#fb0000"/><rect style="isolation:auto;mix-blend-mode:normal" width="3.969" height="3.969" y="293.031" rx="2.299" ry="2.874" color="#000" overflow="visible" fill="none"/></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -1,2 +0,0 @@
void 0;if(edlp.redirect){void 0;void 0;edlp.sys_path=edlp.sys_path.replace(/^\//,'');edlp.url=window.location.pathname;edlp.hash=window.location.hash;window.localStorage.setItem('edlp_origin',JSON.stringify(edlp));window.location.replace(window.location.origin+'/'+edlp.lang_code);}else{void 0;}
@@ -1,7 +1,6 @@
(function($,Drupal,drupalSettings){EdlpTheme=function(){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;function init(){void 0;if(!drupalSettings.path.isFront)
return;_deferred=initEvents();_audioPlayer=new AudioPlayer();_compoPlayer=new CompoPlayer();initAjaxLinks();initHistory();};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',initAjaxLinks).on('open_entree',function(e){void 0;closeAllModals();_$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();});}
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'}
(function($,Drupal,drupalSettings){EdlpTheme=function(){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;function init(){void 0;initEvents();_audioPlayer=new AudioPlayer();_compoPlayer=new CompoPlayer();checkLayout();initAjaxLinks();initHistory();};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',initAjaxLinks).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();void 0;if(typeof navpos!='undefined'){$audioplayer.css({'width':navpos.left+'px'});}}};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=window.location.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;if(data.entity_type=="node"&&data.bundle=="evenement"){if(_$row.find('.col.event').length){_$row.find('.col.event').replaceWith(data.rendered);}else if(_$row.find('.col.aside').length){_$row.find('.col.aside').replaceWith(data.rendered);}else{_$row.append(data.rendered);}}else{_$row.removeAttr('style').html(data.rendered);}
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').removeClass('is-active');$('.is-active-trail').removeClass('is-active-trail');if(typeof state.selector!='undefined'){void 0;$('a[selector="'+state.selector+'"]').addClass('is-active');initAudioLinksInContent();}else{if(typeof state.view_mode!='undefined'){$('a[viewmode="'+state.view_mode+'"][data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');}else{$('a[data-drupal-link-system-path="'+state.sys_path+'"]').addClass('is-active');}
@@ -12,35 +11,37 @@ if(typeof data.documents_lies!='undefined'){if(_corpus_ready){_$body.trigger({ty
if(typeof data.block!='undefined'){if(!$('#'+data.block.id,'.region-'+data.block.region).length){$('.region-'+data.block.region).append(data.block.rendered);}}
if(state.sys_path=="productions"){initProductions();}else{addCloseModalBtnToCols();}
if(data.entity_type=="node"&&data.bundle=="enregistrement"&&data.view_mode=="transcript"){initEnregistrementTranscript();}
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();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 initAudioLinksInContent(){_$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(){$('.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){var $col=$(this).parents('.col');var theme=$col.attr('theme');if(theme!=''){_$body.trigger({'type':theme+'-col-closed'});}
$col.remove();checkRowEmpty();checkVisibleCorpusMapSpace();};function refreshAllBlocks(){var path=window.location.origin+Drupal.url(_ajax_settings.blocksjson_path);$.getJSON(path,{}).done(function(data){onAjaxBlockLoaded(data);}).fail(function(jqxhr,textStatus,error){onAjaxBlockLoadError(jqxhr,textStatus,error);});};function onAjaxBlockLoadError(jqxhr,textStatus,error){void 0;};function onAjaxBlockLoaded(data){void 0;for(var blockname in data.blocks){var block=data.blocks[blockname];void 0;$(block.id).replaceWith(block.rendered);}};function initHistory(){initFirstLoad();window.addEventListener('popstate',onHistoryPopState);};function initFirstLoad(){void 0;var edlp_origin=JSON.parse(window.localStorage.getItem('edlp_origin'));void 0;if(edlp_origin!=null&&edlp_origin.sys_path){var view_mode=edlp_origin.hash.replace('#','');var state=getSysPathState(edlp_origin.sys_path,view_mode);if(edlp_origin.entity_type=="taxonomy_term"&&edlp_origin.entity_bundle=="entrees"&&view_mode){state.selector='entree-'+view_mode+'-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(_$body.is('.entity-type-node.bundle-page')){$col.add($col.siblings('.col')).remove();}else{$col.remove();}
checkRowEmpty();checkVisibleCorpusMapSpace();};function initHistory(){initFirstLoad();window.addEventListener('popstate',onHistoryPopState);};function initFirstLoad(){void 0;var edlp_origin=JSON.parse(window.localStorage.getItem('edlp_origin'));void 0;if(edlp_origin!=null&&edlp_origin.sys_path){var view_mode=edlp_origin.hash.replace('#','');var state=getSysPathState(edlp_origin.sys_path,view_mode);if(edlp_origin.entity_type=="taxonomy_term"&&edlp_origin.entity_bundle=="entrees"&&view_mode){state.selector='entree-'+view_mode+'-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');if(view_mode==""){state.audio=true;state.node=node;_$body.attr('booted','booted');}else{ajaxLoadContent(state);}}
else if(state.ajax_path){ajaxLoadContent(state);}
if(state.entree_tid){openEntree(state.entree_tid);}
history.replaceState(state,null,edlp_origin.url+edlp_origin.hash);window.localStorage.removeItem("edlp_origin");}else{history.replaceState({home:true},null,window.location.pathname);_$body.attr('booted','booted');}};function onHistoryPopState(e){void 0;if(e.state.home){backToFrontPage(true);}
else if(e.state.audio){_audioPlayer.openDocument(e.state.node,'popstate',e.state.historic_index);}
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.site-name','#block-edlptheme-branding').add('a','#block-mainnavigation').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');_$ajaxLinks=$('.ajax-link:not(.ajax-enabled)').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'))
if(e.state.ajax_path){e.state.url=null;ajaxLoadContent(e.state);}}};function initAjaxLinks(){$('a.site-name','#block-edlptheme-branding').add('a','#block-mainnavigation').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');$('a[data-drupal-link-system-path="<front>"]','#block-mainnavigation').removeClass('is-active');_$ajaxLinks=$('.ajax-link:not(.ajax-enabled)').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'))
return false;if($link.is('.audio-link')){_audioPlayer.emmit('stop-shuffle').openDocument({nid:$link.attr('nid'),audio_url:$link.attr('audio_url'),title:$link.find('.field--name-title').html()});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>'){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;}
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').setAutoOpenArticle(e.article).openDocument(e.target_node);});_randomPlayer=new RandomPlayer(e.playlist);_$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();switch(true){case $col.is('.float-right'):right_limit=Math.max(right_limit,Math.abs(offset.left-window.innerWidth));break;default:left_limit=Math.max(left_limit,offset.left+$col.width());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.hideTimer=false;this.hideTimeMS=10000;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());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);}
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();switch(true){case $col.is('.float-right'):right_limit=Math.max(right_limit,Math.abs(offset.left-window.innerWidth));break;default:left_limit=Math.max(left_limit,offset.left+$col.width());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.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());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){if(typeof node=='undefined'||typeof node.nid=='undefined'||typeof node.audio_url=='undfined'||typeof node.document_url=='undfined'){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"){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,};history.pushState(state,null,node.document_url);}}else{this.currentHistoricIndex=historic_index;}
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.setSRC(this.historic[this.currentHistoricIndex].audio_url);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;}
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(error=>{void 0;}).then(()=>{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.audio.play();}else{this.audio.pause();}},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();}},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.emmit('audio-ended');this.stop();},loadNode(nid){this.$cartel.addClass('loading');var vm='player_cartel';var ajax_path=_ajax_settings.entityjson_path+'/node/'+nid+'/'+vm;var path=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();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=art;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;}},hide(){this.$container_parent.removeClass('audio-player-visible');this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},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){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];setTimeout(function(){handler(args);},0);}
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.audio.play();}else{this.audio.pause();}},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();}},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=window.location.origin+Drupal.url(ajax_path);$.getJSON(path,{}).done(this.onNodeLoaded.bind(this)).fail(this.onNodeLoadFail.bind(this));},onNodeLoaded(data){this.$cartel.html(data.rendered).removeClass('loading');_$body.trigger({'type':'new-audio-cartel-loaded'});initAjaxLinks();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=art;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;}},hide(){this.$container_parent.removeClass('audio-player-visible');this.$container.removeClass('visible');try{_$corpus_canvas.trigger('audio-node-closed');}catch(e){void 0;}},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.$btn=$('<a>').html('Shuffle').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-ended',this.onAudioPlayerEnded.bind(this)).on('audio-play-next',this.onAudioPlayNext.bind(this)).on('stop-shuffle',this.stop.bind(this));_$corpus_canvas.on('update-random-playlist',this.updatePlaylist.bind(this));},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.shuffledPlaylist=[];while(tempPLaylist.length>0){var r=Math.floor(Math.random()*tempPLaylist.length);this.shuffledPlaylist.push(tempPLaylist.splice(r,1)[0]);}},toggleActive(e){if(this.active){this.stop();}else{this.start();}},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=_audioPlayer.shuffle_is_active=false;this.$btn.removeClass('is-active');if(typeof _paq!=='undefined'){_paq.push(['trackEvent','RandomPlayer','stop']);}},next(){if(this.active&&this.shuffledPlaylist.length>0)
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0]);},onAudioPlayNext(){this.next();},onAudioPlayerEnded(){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.openDocument(this.playlist[this.current_index],this);}
function RandomPlayer(playlist){this.active=false;this.playlist=playlist;this.$btn=$('<a>').html('Shuffle').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));},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.shuffledPlaylist=[];while(tempPLaylist.length>0){var r=Math.floor(Math.random()*tempPLaylist.length);this.shuffledPlaylist.push(tempPLaylist.splice(r,1)[0]);}},toggleActive(e){if(this.active){this.stop();}else{this.start();}},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=_audioPlayer.shuffle_is_active=false;this.$btn.removeClass('is-active');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]);},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();}
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');}
@@ -48,8 +49,8 @@ return this;},showHideControls(){if(this.$controls){if(this.playing&&!this.pause
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(){this.next();},};function initProductions(){void 0;_$row.find('.col').addClass('offfield');var $grid=$('.grid',_$row).masonry({itemSelector:'.col',columnWidth:'.col-2',horizontalOrder:true,containerStyle:null,transitionDuration:0,});$grid.imagesLoaded().progress(function(){$grid.masonry('layout');});$grid.imagesLoaded(function(){$grid.masonry('layout');});$grid.on('layoutComplete',checkProductionBlockVisible);};function checkProductionBlockVisible(e,items){void 0;for(var i in items){if(!items[i].isTransitioning){if(items[i].position.y+items[i].size.outerHeight<_$row.height()){$(items[i].element).removeClass('offfield');}else{$(items[i].element).addClass('offfield');}}}}
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');_$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,drupalSettings.path.baseUrl+drupalSettings.path.currentLanguage);}}
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 initProductions(){void 0;_$row.find('.col').addClass('offfield');var $grid=$('.grid',_$row).masonry({itemSelector:'.col',columnWidth:'.col-2',horizontalOrder:true,containerStyle:null,transitionDuration:0,});$grid.imagesLoaded().progress(function(){$grid.masonry('layout');});$grid.imagesLoaded(function(){$grid.masonry('layout');});$grid.on('layoutComplete',checkProductionBlockVisible);};function checkProductionBlockVisible(e,items){void 0;for(var i in items){if(!items[i].isTransitioning){if(items[i].position.y+items[i].size.outerHeight<_$row.height()){$(items[i].element).removeClass('offfield');}else{$(items[i].element).addClass('offfield');}}}}
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');_$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,drupalSettings.path.baseUrl+drupalSettings.path.currentLanguage);}}
function initHome(){addCloseModalBtnToCols();var $grid=$('.grid',_$row).masonry({itemSelector:'.col',columnWidth:'.col-2',horizontalOrder:true,containerStyle:null,});$grid.imagesLoaded().progress(function(){$grid.masonry('layout');});$grid.imagesLoaded(function(){$grid.masonry('layout');});}
function closeAllModals(){_$row.html('');_$ajaxLinks.removeClass('is-active');_$body.trigger({'type':'all-modal-closed'});};function checkRowEmpty(){if(!$('.col',_$row).length){if(!_$body.is('.entity-type-taxonomy_term.bundle-entrees')){if(!_$body.is('.entity-type-node.bundle-page')){backToFrontPage();}else{_$corpus_canvas.trigger({'type':'scramble-collection'});}}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);
function closeAllModals(){_$row.html('');_$ajaxLinks.removeClass('is-active');_$body.trigger({'type':'all-modal-closed'});};function checkRowEmpty(){if(!$('.col',_$row).length){if(!_$body.is('.entity-type-taxonomy_term.bundle-entrees')){if(!_$body.is('.entity-type-node.bundle-page')){backToFrontPage();}else{_$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&&!edlp_mobile.device_is_mobile){var edlptheme=new EdlpTheme();}else{$('body').attr('booted','booted');}});})(jQuery,Drupal,drupalSettings);
@@ -0,0 +1,5 @@
void 0;function checkMobile(){var user_agent=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge|maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(user_agent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(user_agent.substr(0,4));}
if(typeof edlp_mobile!="undefined"){var device_redirect=false;var device_is_mobile=checkMobile();edlp_mobile.device_is_mobile=device_is_mobile;switch(true){case(device_is_mobile&&!edlp_mobile.is_mobile_domain):device_redirect=true;window.location.replace(window.location.protocol+'//'+edlp_mobile.mobile_url);break;case(edlp_mobile.is_mobile_domain&&!device_is_mobile):device_redirect=true;window.location.replace(window.location.protocol+'//'+edlp_mobile.desktop_url);break;default:break;}
if(device_is_mobile){document.documentElement.className+="is-mobile";}}
if(edlp.redirect&&!device_redirect&&!device_is_mobile){void 0;void 0;edlp.sys_path=edlp.sys_path.replace(/^\//,'');edlp.url=window.location.pathname;edlp.hash=window.location.hash;window.localStorage.setItem('edlp_origin',JSON.stringify(edlp));window.location.replace(window.location.origin+'/'+edlp.lang_code);}else{void 0;}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,72 @@
<?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="15"
height="15"
viewBox="0 0 3.96875 3.9687501"
version="1.1"
id="svg15566"
inkscape:version="0.92.2 2405546, 2018-03-11"
sodipodi:docname="random-active.svg">
<defs
id="defs15560" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="31.678384"
inkscape:cx="-6.5337228"
inkscape:cy="7.0840227"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1" />
<metadata
id="metadata15563">
<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 />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-293.03123)">
<rect
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"
id="rect16117"
width="3.96875"
height="3.96875"
x="0.00048444583"
y="293.03122"
rx="2.2991402"
ry="2.8739254" />
<path
d="m 1.516095,294.30021 q -0.1222929,0.18749 -0.279235,0.55641 -0.044898,-0.0916 -0.075444,-0.14675 -0.030546,-0.0571 -0.083541,-0.13044 -0.050971,-0.0733 -0.10388279,-0.11414 -0.0509707,-0.0429 -0.12841126,-0.0713 -0.075444,-0.0305 -0.16508441,-0.0305 H 0.22395036 q -0.0286135,0 -0.0469225,-0.0183 -0.018309,-0.0183 -0.018309,-0.0469 v -0.39132 q 0,-0.0285 0.018309,-0.0469 0.018309,-0.0183 0.0469225,-0.0183 h 0.45654663 q 0.50955081,0 0.83565301,0.45859 z m 2.2766246,1.58161 q 0.018308,0.0183 0.018308,0.0468 0,0.0285 -0.018308,0.0469 l -0.6522044,0.65222 q -0.018308,0.0183 -0.046922,0.0183 -0.026497,0 -0.046922,-0.0203 -0.018308,-0.0183 -0.018308,-0.0449 v -0.39132 q -0.065232,0 -0.1732267,0.002 -0.1080321,0 -0.1651121,0.002 -0.057043,0 -0.1487719,-0.002 -0.091637,-0.005 -0.1447146,-0.0107 -0.052996,-0.008 -0.1304451,-0.0223 -0.077468,-0.0143 -0.128402,-0.0366 -0.050971,-0.0244 -0.118208,-0.0592 -0.067256,-0.0347 -0.1202504,-0.0815 -0.052995,-0.0469 -0.1120988,-0.10802 -0.059159,-0.0632 -0.1141229,-0.14267 0.120232,-0.18955 0.2771648,-0.55642 0.044898,0.0917 0.075352,0.14877 0.030546,0.055 0.081516,0.12842 0.052995,0.0733 0.1039932,0.11618 0.052995,0.0408 0.1284113,0.0713 0.077468,0.0285 0.1671269,0.0285 H 3.028334 v -0.39132 q 0,-0.0285 0.018308,-0.0469 0.018308,-0.0183 0.046922,-0.0183 0.024381,0 0.048947,0.0203 z m 0,-1.82621 q 0.018308,0.0183 0.018308,0.0469 0,0.0285 -0.018308,0.0469 l -0.6522044,0.6522 q -0.018308,0.0183 -0.046922,0.0183 -0.026497,0 -0.046922,-0.0183 -0.018308,-0.0203 -0.018308,-0.0469 v -0.39132 H 2.5066014 q -0.097783,0 -0.1773211,0.0306 -0.079492,0.0306 -0.1406386,0.0916 -0.061183,0.0612 -0.1040023,0.12636 -0.042874,0.0632 -0.091637,0.15695 -0.065232,0.12637 -0.1589937,0.34853 -0.059159,0.13452 -0.1018586,0.22623 -0.04085,0.0916 -0.1100655,0.21401 -0.067256,0.12229 -0.1304354,0.20381 -0.061183,0.0815 -0.1508144,0.16917 -0.087589,0.0876 -0.1834486,0.14064 -0.093707,0.051 -0.21602751,0.0856 -0.12230212,0.0326 -0.26088921,0.0326 H 0.22392276 q -0.0286135,0 -0.0469225,-0.0183 -0.018309,-0.0183 -0.018309,-0.0469 v -0.39133 q 0,-0.0285 0.018309,-0.0469 0.018309,-0.0183 0.0469225,-0.0183 h 0.45654663 q 0.0977828,0 0.17732116,-0.0306 0.0794922,-0.0305 0.14062941,-0.0916 0.0611832,-0.0612 0.10399334,-0.12433 0.04269,-0.0652 0.091637,-0.15897 0.065232,-0.12637 0.1589661,-0.34853 0.059159,-0.13452 0.099927,-0.22623 0.042874,-0.0916 0.1100746,-0.21401 0.06928,-0.1223 0.1304355,-0.20382 0.063207,-0.0815 0.1508236,-0.16916 0.089613,-0.0876 0.1834302,-0.13861 0.09575,-0.053 0.2180793,-0.0856 0.1223021,-0.0346 0.260889,-0.0346 h 0.5217599 v -0.39133 q 0,-0.0285 0.018308,-0.0469 0.01831,-0.0183 0.046923,-0.0183 0.024381,0 0.048947,0.0203 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:#fb0000;fill-opacity:1;stroke:none;stroke-width:0.19848903"
id="path35497"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.5 KiB

@@ -0,0 +1,79 @@
<?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="15"
height="15"
viewBox="0 0 3.96875 3.9687501"
version="1.1"
id="svg15566"
inkscape:version="0.92.2 2405546, 2018-03-11"
sodipodi:docname="search-active.svg">
<defs
id="defs15560" />
<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.0816285"
inkscape:cy="7.0840227"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1" />
<metadata
id="metadata15563">
<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.03123)">
<rect
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"
id="rect16117"
width="3.96875"
height="3.96875"
x="0"
y="293.03122"
rx="2.2991402"
ry="2.8739254" />
<g
id="g35509"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:20px;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:#ff0000;fill-opacity:1;stroke:none;stroke-width:1.03276014"
transform="matrix(0.19219275,0,0,0.19219275,-321.49785,187.32388)"
aria-label="">
<path
sodipodi:nodetypes="cscscscsccscsccscccscccscccscc"
inkscape:connector-curvature="0"
id="path35507"
d="m 1684.9076,562.44127 c 0.9821,-0.98214 1.4732,-2.16145 1.4732,-3.53794 0,-1.37649 -0.4911,-2.55208 -1.4732,-3.52679 -0.9747,-0.98214 -2.1503,-1.47321 -3.5268,-1.47321 -1.3765,0 -2.5558,0.49107 -3.5379,1.47321 -0.9747,0.97471 -1.4621,2.1503 -1.4621,3.52679 0,1.37649 0.4874,2.5558 1.4621,3.53794 0.9821,0.97471 2.1614,1.46206 3.5379,1.46206 1.3765,0 2.5521,-0.48735 3.5268,-1.46206 z m 6.7746,4.74331 c 0.2753,0.27529 0.4129,0.61011 0.4129,1.00446 0,0.39435 -0.1414,0.72917 -0.4241,1.00447 -0.2753,0.28273 -0.6101,0.4241 -1.0044,0.4241 -0.4018,0 -0.7366,-0.14137 -1.0045,-0.4241 l -3.8281,-3.81697 c -1.3319,0.92262 -2.8163,1.38393 -4.4532,1.38393 -1.0639,0 -2.0833,-0.20461 -3.058,-0.61384 -0.9673,-0.41667 -1.8043,-0.9747 -2.5112,-1.67411 -0.6994,-0.70684 -1.2574,-1.54389 -1.6741,-2.51116 -0.4092,-0.9747 -0.6138,-1.99404 -0.6138,-3.05803 0,-1.06399 0.2046,-2.07961 0.6138,-3.04688 0.4167,-0.9747 0.9747,-1.81175 1.6741,-2.51116 0.7069,-0.70685 1.5439,-1.26488 2.5112,-1.6741 0.9747,-0.41667 1.9941,-0.625 3.058,-0.625 1.064,0 2.0796,0.20833 3.0469,0.625 0.9747,0.40922 1.8118,0.96725 2.5112,1.6741 0.7068,0.69941 1.2648,1.53646 1.6741,2.51116 0.4167,0.96727 0.625,1.98289 0.625,3.04688 0,1.63691 -0.4613,3.12128 -1.3839,4.45312 z"
style="stroke-width:1.03276014;fill:#ff0000;fill-opacity:1" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

@@ -0,0 +1,72 @@
<?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="15"
height="15"
viewBox="0 0 3.96875 3.9687501"
version="1.1"
id="svg15566"
inkscape:version="0.92.2 2405546, 2018-03-11"
sodipodi:docname="studio-active.svg">
<defs
id="defs15560" />
<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.0816285"
inkscape:cy="7.0840227"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1" />
<metadata
id="metadata15563">
<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.03123)">
<path
d="m 3.9459776,295.14291 q 0,0.39137 -0.1414624,0.74029 l -0.047254,0.11547 -0.4361469,0.0778 q -0.051936,0.1957 -0.2145454,0.32301 -0.1603423,0.12495 -0.3677999,0.12495 v 0.0755 q 0,0.033 -0.021179,0.0543 -0.021285,0.0212 -0.054278,0.0212 H 2.5124214 q -0.033099,0 -0.054171,-0.0212 -0.021285,-0.0212 -0.021285,-0.0543 v -1.35802 q 0,-0.033 0.021285,-0.0543 0.021179,-0.0212 0.054171,-0.0212 H 2.663313 q 0.032992,0 0.054278,0.0212 0.021179,0.0212 0.021179,0.0543 v 0.0755 q 0.1673877,0 0.3064876,0.0848 0.139121,0.0825 0.21926,0.22399 l 0.1603209,-0.0282 q 0.068432,-0.22398 0.068432,-0.45503 0,-0.34893 -0.2074681,-0.65778 -0.2074787,-0.30886 -0.5587612,-0.49276 -0.348941,-0.18389 -0.7426557,-0.18389 -0.3937467,0 -0.7450184,0.18389 -0.34893039,0.1839 -0.55639848,0.49276 -0.20748938,0.30885 -0.20748938,0.65778 0,0.23105 0.0684323,0.45503 l 0.16031078,0.0282 q 0.0801393,-0.14147 0.2192495,-0.22399 0.13912088,-0.0848 0.30649808,-0.0848 v -0.0755 q 0,-0.033 0.021285,-0.0543 0.021179,-0.0212 0.054278,-0.0212 H 1.456414 q 0.032992,0 0.054277,0.0212 0.021179,0.0212 0.021179,0.0543 v 1.35802 q 0,0.033 -0.021179,0.0543 -0.021285,0.0212 -0.054277,0.0212 H 1.3055326 q -0.033099,0 -0.054278,-0.0212 -0.021285,-0.0212 -0.021285,-0.0543 v -0.0755 q -0.2074574,0 -0.37014117,-0.12495 -0.16031046,-0.12731 -0.21219342,-0.32301 l -0.43615766,-0.0778 -0.0472534,-0.11547 q -0.14145164,-0.34892 -0.14145164,-0.74029 0,-0.35601 0.15794777,-0.68608 0.1579797,-0.33006 0.42202419,-0.57054 0.26405514,-0.24285 0.62712953,-0.38666 0.3630851,-0.14382 0.7544691,-0.14382 0.3913414,0 0.7544265,0.14382 0.3630744,0.14381 0.6271297,0.38666 0.2640656,0.24048 0.4220346,0.57054 0.1579586,0.33007 0.1579586,0.68608 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:#fb0000;fill-opacity:1;stroke:none;stroke-width:0.19848901"
id="path35495"
inkscape:connector-curvature="0" />
<rect
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"
id="rect16117"
width="3.96875"
height="3.96875"
x="1.3877788e-17"
y="293.03122"
rx="2.2991402"
ry="2.8739254" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

@@ -1,20 +0,0 @@
console.log('EDLP THEME HISTORY.js');
// var edlp is provided by edlp_ajax.module file
if(edlp.redirect){
console.log('history redirect', edlp);
console.log('window.location', window.location);
// window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, ''));
edlp.sys_path = edlp.sys_path.replace(/^\//, '');
// window.localStorage.setItem('edlp_origin_url', window.location.pathname);
edlp.url = window.location.pathname;
// window.localStorage.setItem('edlp_origin_hash', window.location.hash);
edlp.hash = window.location.hash;
window.localStorage.setItem('edlp_origin', JSON.stringify(edlp));
// redirect to home
window.location.replace(window.location.origin+'/'+edlp.lang_code);
}else{
console.log('history do not redirect');
}
@@ -24,14 +24,16 @@
function init(){
console.log("EdlpTheme init()");
if(!drupalSettings.path.isFront)
return;
// if(!drupalSettings.path.isFront)
// return;
_deferred = initEvents();
initEvents();
_audioPlayer = new AudioPlayer();
_compoPlayer = new CompoPlayer();
checkLayout();
initAjaxLinks();
initHistory();
@@ -76,7 +78,7 @@
.on('open_entree', function(e){
console.log('on_open_entree : e', e);
closeAllModals();
checkLayout();
// add body class for currently loaded content
// var body_classes = [
// 'path-'+sys_path.replace(/\//g, '-'),
@@ -88,11 +90,6 @@
// record new history state
if(typeof e.url != 'undefined'){
// var state = {
// ajax_path:null,
// sys_path:null,
// entree_tid:e.tid
// };
var state = getSysPathState(e.sys_path);
history.pushState(state, null, e.url);
@@ -103,17 +100,40 @@
_paq.push(['setCustomUrl', e.url]);
_paq.push(['setDocumentTitle', e.title]);
_paq.push(['trackPageView']);
// js event
// trackEvent(category, action, [name], [value])
// _paq.push(['trackEvent', 'AjaxNav', 'loaded', state.url]);
}
}
})
.on('close_entree', function(e){
backToFrontPage();
checkLayout();
});
window.addEventListener('resize', checkLayout, false);
}
// __ ___ _ ___ _
// \ \ / (_)_ _ __| |_____ __ __ | _ \___ __(_)______
// \ \/\/ /| | ' \/ _` / _ \ V V / | / -_|_-< |_ / -_)
// \_/\_/ |_|_||_\__,_\___/\_/\_/ |_|_\___/__/_/__\___|
function checkLayout(){
var $audioplayer = $("#audio-player");
if($audioplayer.length){
var navpos = $('#block-mainnavigation').position();
console.log('navpos', navpos);
if(typeof navpos != 'undefined'){
$audioplayer.css({
'width':navpos.left+'px'
});
}
}
// entrees
// TODO: center the entrees menu
};
// ___ _ _ ___
// / __| __ _ _ ___| | | _ ) __ _ _ _ ___
// \__ \/ _| '_/ _ \ | | _ \/ _` | '_(_-<
@@ -299,6 +319,10 @@
initEnregistrementTranscript();
}
if(state.sys_path == "search"){
initSearch();
}
// update the language switcher block if it comes in the response
if(typeof data.translations_links != 'undefined'){
console.log('state',state);
@@ -406,8 +430,13 @@
if(theme != ''){
_$body.trigger({'type':theme+'-col-closed'});
}
// remove the col
$col.remove();
if(_$body.is('.entity-type-node.bundle-page')){
// remove all the col (prod page and agenda in case)
$col.add($col.siblings('.col')).remove();
}else{
// remove the col
$col.remove();
}
checkRowEmpty();
checkVisibleCorpusMapSpace();
};
@@ -418,28 +447,28 @@
// /_/ \_\/ \__,_/_\_\ |___/_\___/\__|_\_\/__/
// |__/
// NOT USED (YET)
function refreshAllBlocks(){
var path = window.location.origin + Drupal.url(_ajax_settings.blocksjson_path);
$.getJSON(path, {})
.done(function(data){
onAjaxBlockLoaded(data);
})
.fail(function(jqxhr, textStatus, error){
onAjaxBlockLoadError(jqxhr, textStatus, error);
});
};
function onAjaxBlockLoadError(jqxhr, textStatus, error){
console.warn('ajax block load failed: '+error, jqxhr.responseText);
};
function onAjaxBlockLoaded(data){
console.log('onAjaxBlockLoaded', data);
// TODO: update each blocks (exepted language switcher)
for (var blockname in data.blocks) {
var block = data.blocks[blockname];
console.log(blockname, block);
$(block.id).replaceWith(block.rendered);
}
};
// function refreshAllBlocks(){
// var path = window.location.origin + Drupal.url(_ajax_settings.blocksjson_path);
// $.getJSON(path, {})
// .done(function(data){
// onAjaxBlockLoaded(data);
// })
// .fail(function(jqxhr, textStatus, error){
// onAjaxBlockLoadError(jqxhr, textStatus, error);
// });
// };
// function onAjaxBlockLoadError(jqxhr, textStatus, error){
// console.warn('ajax block load failed: '+error, jqxhr.responseText);
// };
// function onAjaxBlockLoaded(data){
// console.log('onAjaxBlockLoaded', data);
// // TODO: update each blocks (exepted language switcher)
// for (var blockname in data.blocks) {
// var block = data.blocks[blockname];
// console.log(blockname, block);
// $(block.id).replaceWith(block.rendered);
// }
// };
// _ _ _ _
// | || (_)__| |_ ___ _ _ _ _
@@ -579,6 +608,8 @@
.add('a', '.field--name-field-son')
.addClass('ajax-link');
$('a[data-drupal-link-system-path="<front>"]', '#block-mainnavigation').removeClass('is-active');
_$ajaxLinks = $('.ajax-link:not(.ajax-enabled)')
.each(function(i,e){
var $this = $(this);
@@ -774,7 +805,7 @@
// hiding
this.hideTimer = false;
this.hideTimeMS = 10000;
this.hideTimeMS = 15000;
// history
this.currentHistoricIndex = null;
@@ -855,6 +886,8 @@
this.currentHistoricIndex = historic_index;
}
// TODO: stop random player if playing from studio
this.emmit('audio-open-document', {caller:caller});
@@ -952,12 +985,11 @@
var promise = this.audio.play();
// console.log('promise', promise);
if (promise !== undefined) {
promise.catch(error => {
promise.catch(function(error){
// Auto-play was prevented
// Show a UI element to let the user manually start playback
console.warn('autoplay failed, ask for playing', error);
}).then(() => {
}).then(function(){
// Auto-play started
console.log('autoplay succeed');
});
@@ -1016,8 +1048,8 @@
},
onEnded(){
console.log('AudioPlayer onEnded()');
this.emmit('audio-ended');
this.stop();
this.emmit('audio-ended');
},
// cartel functions
loadNode(nid){
@@ -1098,17 +1130,19 @@
return this;
},
emmit(event_name, args){
// console.log('AudioPlayer emmit() event_name', event_name);
console.log('AudioPlayer emmit()', event_name, args, this.event_handlers[event_name]);
// console.log('AudioPlayer emmit() handlers', this.event_handlers[event_name]);
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];
// console.log('AudioPlayer emmit() loop handler', handler);
setTimeout(function(){
// console.log('AudioPlayer emmit() timeout handler', handler);
handler(args);
}, 0);
(function(handler, args){
setTimeout(function(){
// console.log('AudioPlayer emmit() timeout handler', handler);
handler(args);
}, 0);
}(handler, args));
}
return this;
},
@@ -1139,8 +1173,11 @@
// attach an event on AudioPlayer
_audioPlayer
.on('audio-ended', this.onAudioPlayerEnded.bind(this))
.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));
@@ -1193,16 +1230,21 @@
}
},
next(){
console.log('RandomPlayer next', this.active, this.shuffledPlaylist.length);
if(this.active && this.shuffledPlaylist.length > 0)
_audioPlayer.openDocument(this.shuffledPlaylist.splice(0,1)[0]);
},
onAudioPlayNext(){
//console.log('RandomPlayer : onAudioPlayNext()');
this.next();
console.log('RandomPlayer : onAudioPlayNext()');
if(this.active){
this.next();
}
},
onAudioPlayerEnded(){
//console.log('RandomPlayer : onAudioPlayerEnded()');
this.next();
console.log('RandomPlayer : onAudioPlayerEnded()');
if(this.active){
this.next();
}
}
};
@@ -1305,7 +1347,9 @@
this.paused = false;
_audioPlayer.play();
}else{
_audioPlayer.openDocument(this.playlist[this.current_index], this);
// _audioPlayer;
_audioPlayer.emmit('stop-shuffle').openDocument(this.playlist[this.current_index], this);
// TODO: stop random player
}
this.setActiveItem().showHideControls();
},
@@ -1431,7 +1475,9 @@
}
},
onAudioPlayerEnded(){
this.next();
if(this.playing){
this.next();
}
},
// onAudioPlayNext(){
// this.next();
@@ -1488,6 +1534,21 @@
}
}
// ___ _
// / __| ___ __ _ _ _ __| |_
// \__ \/ -_) _` | '_/ _| ' \
// |___/\___\__,_|_| \__|_||_|
function initSearch(){
// if($('#edit-entries input:checked', '#edlp-search-form').length){
// $('#edit-entries--wrapper', '#edlp-search-form').toggleClass('opened');
// }
$('#edit-entries--wrapper legend', '#edlp-search-form').on('click', function(){
$(this).parent().toggleClass('opened');
});
};
// ___ _ _ _
// | __|_ _ _ _ ___ __ _(_)__| |_ _ _ ___ _ __ ___ _ _| |_
// | _|| ' \| '_/ -_) _` | (_-< _| '_/ -_) ' \/ -_) ' \ _|
@@ -1582,6 +1643,9 @@
}else{
// if we were on production page just scramble collection in case of map was filtered
_$corpus_canvas.trigger({'type':'scramble-collection'});
// reload production home
$('a[data-drupal-link-system-path="productions"]', '#block-mainnavigation')
.removeClass('is-active').trigger('click');
}
}else{
// remove is-active class from index or notice entree links
@@ -1595,7 +1659,7 @@
} // end EdlpTheme()
$(document).ready(function($) {
if(drupalSettings.path.isFront){
if(drupalSettings.path.isFront && !edlp_mobile.device_is_mobile){
var edlptheme = new EdlpTheme();
}else{
$('body').attr('booted', 'booted');
@@ -0,0 +1,57 @@
console.log('EDLP THEME redirect.js');
function checkMobile(){
var user_agent = navigator.userAgent||navigator.vendor||window.opera;
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(user_agent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(user_agent.substr(0,4));
}
// var edlp_mobile is provided by edlp_mobile.module file
if(typeof edlp_mobile != "undefined"){
// console.log(edlp_mobile);
// console.log('window.location', window.location);
var device_redirect = false;
var device_is_mobile = checkMobile();
// console.log('is_mobile_domain', edlp_mobile.is_mobile_domain);
// console.log('device_is_mobile', device_is_mobile);
edlp_mobile.device_is_mobile = device_is_mobile;
switch(true){
case (device_is_mobile && !edlp_mobile.is_mobile_domain):
// console.log('redirect to mobile domain', window.location.protocol +'//'+ edlp_mobile.mobile_url);
device_redirect = true;
// TODO: redirect to mobile domain
window.location.replace(window.location.protocol +'//'+ edlp_mobile.mobile_url);
break;
case (edlp_mobile.is_mobile_domain && !device_is_mobile):
// console.log('redirect to desktop domain', window.location.protocol +'//'+ edlp_mobile.desktop_url);
device_redirect = true;
// TODO: redirect to desktop domain
window.location.replace(window.location.protocol +'//'+ edlp_mobile.desktop_url);
break;
default:
// console.log('do not redirect');
break;
}
if(device_is_mobile){
document.documentElement.className += "is-mobile";
}
}
// var edlp is provided by edlp_ajax.module file
if(edlp.redirect && !device_redirect && !device_is_mobile){
console.log('redirect', edlp);
console.log('window.location', window.location);
// window.localStorage.setItem('edlp_origin_path', edlp.sys_path.replace(/^\//, ''));
edlp.sys_path = edlp.sys_path.replace(/^\//, '');
// window.localStorage.setItem('edlp_origin_url', window.location.pathname);
edlp.url = window.location.pathname;
// window.localStorage.setItem('edlp_origin_hash', window.location.hash);
edlp.hash = window.location.hash;
window.localStorage.setItem('edlp_origin', JSON.stringify(edlp));
// redirect to home
window.location.replace(window.location.origin+'/'+edlp.lang_code);
}else{
console.log('history do not redirect');
}
@@ -89,6 +89,10 @@ header[role="banner"]{
white-space: nowrap;
text-indent: 500px;
overflow: hidden;
html.is-mobile &{
$w:170px;
width:$w; height:$w * 0.22;
}
}
}
opacity: 1;
@@ -102,6 +106,8 @@ header[role="banner"]{
#block-mainnavigation{
float:right;
margin-top: 25px;
z-index: 21;
position: relative;
ul{
margin:0; padding: 0;
white-space: nowrap;
@@ -135,6 +141,30 @@ header[role="banner"]{
}
}
}
@media only screen and (max-width: 1270px) {
margin-top: 15px;
ul{
li{
display: block;
a{
@include content_petit;
}
}
li:first-of-type{
display:none;
}
}
}
html.is-mobile &{
// outline: 1px solid orange;
margin-top:4px;
li{
a{
font-size: 0.680em;
padding:0; margin:0;
}
}
}
}
.block-language{
@@ -171,6 +201,20 @@ header[role="banner"]{
}
}
}
@media only screen and (max-width: 1270px) {
margin-top: 15px;
margin-left: 0.5em;
border-left: 1px solid red;
ul{
li{
display: block;
a{
@include content_petit;
}
}
}
}
}
@@ -266,6 +310,7 @@ main[role="main"]{
@include content_titles;
margin:0.9em 0 0;
}
article.node:not(.node--type-enregistrement)>h2, h2.title{
@include content_titles;
}
@@ -278,13 +323,17 @@ main[role="main"]{
article.node.node--type-enregistrement.node--view-mode-transcript,
article.node.node--type-enregistrement.node--view-mode-article{
>h2{
// display: none;
@include content_subtitles;
margin:0.9em 0 0 0;
margin:1em 0 0.9em 0;
}
h3.sur-title{
display: none;
}
}
article.node.node--type-enregistrement.node--view-mode-index{
&,p{margin:0}
h2.node-title{margin-top: 0.2em;}
h2.node-title{margin-top: 0.5em; line-height: 0.9;}
}
article.node.node--type-enregistrement.node--view-mode-transcript{
html.js &{
@@ -373,15 +422,17 @@ main[role="main"]{
}
div.taxonomy-term{
padding-top:1em!important;
>h2{
// display:none;
@include content_subtitles;
margin: 1em 0 0.5em;
display:none;
// @include content_subtitles;
// margin: 1em 0 0.5em;
}
>.content{
}
.field__label{
@include content_titles;
display:none;
// @include content_titles;
}
.field--name-field-notice{
.field__label{
@@ -396,6 +447,13 @@ main[role="main"]{
}
}
h4.inter-titre{
@include content_courant;
font-weight: normal;
font-style: italic;
margin:1.1em 0 0.4em 0;
}
article.node p, div.taxonomy-term p{
@include content_courant;
margin:0 0 1em 0;
@@ -460,8 +518,6 @@ main[role="main"]{
}
}
img{
max-width: 100%;
height: auto;
@@ -530,14 +586,17 @@ main[role="main"]{
}
}
#audio-player{
// outline: 1px solid blue;
position: absolute;
box-sizing: border-box;
// overflow: hidden;
top:0; left:0;
padding-left:0.7em;
// background-color: white;
height:100%; min-width:300px;
height:100%;
min-width:700px;
z-index: 20;
opacity: 0;
// outline: 1px solid blue;
pointer-events: none;
transition: opacity 0.7s ease-in-out;
&.visible{
@@ -551,7 +610,6 @@ main[role="main"]{
// word-break:keep-all;
padding:0;
max-height: 100%;
// outline: 1px solid green;
white-space: normal;
@include btn;
}
@@ -598,9 +656,10 @@ main[role="main"]{
height:100%;
}
.cartel{
// TODO: set max-width regarding responsive
position: relative;
// max-width: 350px;
// min-width: 200px;
width: calc(100% - 260px);
// outline: 1px solid orange;
margin-left: 1em;
background-color: white;
opacity: 1;
@@ -617,6 +676,8 @@ main[role="main"]{
width:1.5em;
}
.cartels{
width:calc(100% - 1.5em);
// outline: 1px solid green;
.first-cartel{
// visibility: hidden;
.entrees{
@@ -646,7 +707,7 @@ main[role="main"]{
white-space: normal;
}
.col-left{
a{
a.ajax-link{
display: block;
font-size: 0.82em;
font-weight: 600;
@@ -655,15 +716,35 @@ main[role="main"]{
.col-right{
border-left:1px solid #1A1A1A;
margin-left:5px; padding-left:5px;
max-width: calc(100% - 100px);
h3{
font-size: 0.82em;
// display: inline;
// float: left;
@include content_subtitles;
margin:0;
}
p{
font-size: 0.756em;
margin:0;
span.cat{
font-weight: 600;
div.item-list{
// float: left;
// display: inline;
max-width: 100%;
}
ul{
// display: inline;
max-width: 100%;
padding:0; margin:0;
li{
padding:0; margin:0;
display: inline-block;
list-style: none;
&:not(:last-of-type){
margin-right:0.4em;
&:after{
content:","
}
}
a{
@include content_courant;
}
}
}
}
@@ -1107,6 +1188,47 @@ main[role="main"]{
width:90%;
}
#edit-entries--wrapper{
legend{
cursor: pointer;
display: block;
width:100%;
&:after{
content: '\2304';
font-size: 2em;
font-weight: 200;
display:inline-block;
line-height: 0;
letter-spacing: 0;
// width:15px;
height:13px;
overflow: hidden;
// text-align: center;
// outline: 1px solid orange;
float: right;
margin-top: 0.5em 0 0 0;
}
}
#edit-entries{
overflow: hidden;
height:1px;
margin:0;
transition: height 0.4s ease-in-out;
}
&.opened{
legend:after{
// content: '\2303';
transform: rotateZ(180deg);
transform-origin: center;
margin-top: 0 0 0.5em 0;
}
#edit-entries{
height:362px;
}
}
}
#edit-entries{
.form-item{
label, input{
@@ -1202,6 +1324,7 @@ main[role="main"]{
&:checked{background-color: var(--e-col-123);}
}
}
}
}
@@ -1437,8 +1560,23 @@ footer{
// min-width: 50px;
text-align: right;
}
@media only screen and (max-width: 1270px) {
.region-footer-left{
width:9%;
}
.region-footer-center{
width: 80%;
overflow:hidden;
text-align: center;
}
.region-footer-right{
box-sizing: content-box;
min-width:5%;
}
}
}
#block-footer{
display: inline-block;
margin-bottom: 1em;
@@ -1474,6 +1612,22 @@ footer{
}
}
}
@media only screen and (max-width: 1270px) {
margin-top: 15px;
ul{
li{
display: block;
margin-left: 0!important;
padding:0;
line-height: 0.6;
a{
@include content_petit;
padding:0;
}
}
}
}
}
// remove #block-productions from selector
@@ -1511,40 +1665,6 @@ footer{
}
}
// .block-language{
// display: inline-block;
// position: relative;
// ul{
// position: absolute;
// bottom:0;
// margin:0;
// padding:0;
// transform-origin: left bottom;
// transform: rotateZ(-45deg);
// white-space: nowrap;
// pointer-events: all;
// li{
// margin:0; padding:0;
// list-style: none;
// display: inline-block;
// &:last-of-type{
// &:before{
// content:"/";
// margin:0 0.2em;
// }
// }
// a{
// color: inherit;
// text-decoration: none;
// font-size: 0.756em;
// }
// &.is-active{
// a{color: red;}
// }
// }
// }
// }
nav#block-productions.block-menu{
position: relative;
pointer-events: none;
@@ -1786,38 +1906,49 @@ footer{
}
$icons_w:20px;
@mixin iconlinkblock($bgimgurl) {
$mobile_icon_w:15px;
@mixin iconlinkblock($bgimgurl, $bgimgurlactive) {
pointer-events: all;
margin-left: 0.5em;
// @include btn;
a{
box-sizing: border-box;
$wh:$icons_w;
display: block;
$wh:$icons_w;
width:$wh; height:$wh;
text-indent: $wh*2;
margin: 0;
overflow: hidden;
mask-image: $bgimgurl;
mask-size: contain;
background-color: #000;
transition: background-color 0.3s ease-in-out;
// mask-image: $bgimgurl;
// mask-size: contain;
// background-color: #000;
// transition: background-color 0.3s ease-in-out;
background-image: $bgimgurl;
background-repeat: no-repeat;
background-size: contain;
cursor: pointer;
&.is-active{
background-color: red;
&:hover, &.is-active{
// background-color: red;
background-image: $bgimgurlactive;
}
html.is-mobile &{
$wh:$mobile_icon_w;
width:$wh; height:$wh;
text-indent: $wh*2;
}
}
}
.block.random-player{
margin-bottom: 1em;
@include iconlinkblock(url(../img/random.svg));
@include iconlinkblock(url(../img/random.svg), url(../img/random-active.svg));
}
#block-studiolinkblock{
margin-bottom: 1em;
margin-left: 0.2em;
@include iconlinkblock(url(../img/studio.svg));
@include iconlinkblock(url(../img/studio.svg), url(../img/studio-active.svg));
}
#block-userlogin{
@@ -1893,10 +2024,99 @@ footer{
#block-edlpsearchlinkblock{
margin-bottom: 1em;
@include iconlinkblock(url(../img/search.svg));
@include iconlinkblock(url(../img/search.svg), url(../img/search-active.svg));
margin-left: 0.2em;
}
.block-language{
float: none;
margin-top: 0;
margin-right: 2em;
ul{
margin:0; padding:0;
li{
display: inline-block; vertical-align: middle;
list-style: none;
pointer-events: all;
a{
font-size: 0.690em;
color:inherit;
text-decoration: none;
text-transform: capitalize;
margin-left: 0.8em;
@include btn;
&:before{
content: "";
display:inline-block;
$sq:0.6em;
width: $sq; height:$sq;
border: 1px solid red;
margin-right: 0.3em;
}
}
&.is-active,
&:hover{
a:before{
border-color: red;
background-color: red;
}
}
}
}
html.is-mobile &{
// outline: 1px solid green;
border-left: none;
ul{
margin-right:0.5em;
}
li{
line-height: 0;
a{
padding:0;
margin:0;
// &:before{display: none;}
&.is-active{
display:none;
}
}
}
}
}
html.is-mobile &{
position: fixed;
box-sizing: border-box;
bottom:0; left:0;
width:100%;
background-color: #fff;
padding-top:0;
padding-bottom:0;
.region-footer-left, .region-footer-right{
width: 50%;
>*{
margin:0.4em 0!important;
}
}
#block-footer, .block-language{
// margin-top: 0;
li{
display: inline-block;
a{
font-size: 0.680em;
&:before{
$sq:5px;
width: $sq; height:$sq;
}
}
}
}
.region-footer-right{
text-align: right;
}
}
}
// _ _ _ ___
@@ -28,8 +28,13 @@ $med-bp:1080px;
@mixin col($col, $offset: 0, $sum: $default_sum, $gap: $default_gap, $align: top) {
@extend %col-reset;
padding-left: $gap*$offset;
padding-right: $gap;
@if $col == $default_sum {
padding-right: 0;
}@else{
padding-right: $gap;
}
&:last-child{padding-right: 0;}
margin-left: percentage(($col/$sum)*$offset);
// @media only screen and (min-width: 768px) {
@@ -37,6 +37,15 @@ header[role="banner"]{
}
}
}
html.is-mobile header[role="banner"]{
position:fixed;
box-sizing: border-box;
top:0; left:0; width:100%;
background-color: #fff;
>.wrapper{
height:50px;
}
}
aside.messages{
border: none;
@@ -49,7 +58,7 @@ aside.messages{
overflow-y: auto;
}
main[role="main"]{
html:not(.is-mobile) main[role="main"]{
// outline:1px solid green;
z-index: 1;
position: absolute;
@@ -69,6 +78,11 @@ main[role="main"]{
}
}
html.is-mobile main[role="main"]{
padding:80px 1em 40px;
// background-color: blue;
}
body.toolbar-horizontal.toolbar-themes.toolbar-no-tabs{
main[role="main"]{
padding-top: 7em + 1em;
@@ -5,7 +5,7 @@ base theme: classy
core: 8.x
libraries:
- core/normalize
- edlptheme/history-js
- edlptheme/redirect-js
- edlptheme/global-css
- edlptheme/global-js
@@ -4,11 +4,11 @@ global-css:
theme:
assets/dist/styles/app.min.css: {}
history-js:
redirect-js:
version: VERSION
header: true
js:
assets/dist/scripts/history.min.js: { weight:-998, preprocess: false, minified: true }
assets/dist/scripts/redirect.min.js: { weight:-998, preprocess: false, minified: true }
global-js:
version: VERSION
@@ -22,7 +22,22 @@ use Drupal\Core\Render\Element;
// dpm('edlptheme_page_attachments', $attachments);
// }
/**
* Prepares variables for HTML document templates.
*
* Default template: html.html.twig.
*
* @param array $variables
* An associative array containing:
* - page: A render element representing the page.
*/
function edlptheme_preprocess_html(&$vars) {
$site_config = \Drupal::config('system.site');
$head_title = [
'name' => $site_config->get('name'),
];
$vars['head_title'] = $head_title;
}
function edlptheme_preprocess_page(&$vars){
// dsm($vars, 'vars');
@@ -187,7 +202,7 @@ function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
'data-drupal-link-system-path' => $url->getInternalPath()
)
));
$vars['link_transcript'] = Link::fromTextAndUrl(t("Lire le text."), $url);
$vars['link_transcript'] = Link::fromTextAndUrl(t("Read the text."), $url);
}
// if article not empty
@@ -202,7 +217,7 @@ function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
'data-drupal-link-system-path' => $url->getInternalPath()
)
));
$vars['link_article'] = Link::fromTextAndUrl(t("Lire l'article."), $url);
$vars['link_article'] = Link::fromTextAndUrl(t("Read the article."), $url);
}
// relations (defined in edlp_corpus.module)
@@ -250,5 +265,5 @@ function edlptheme_preprocess_links__language_block(&$vars){
}
function edlptheme_preprocess_file_link(&$vars){
}
@@ -29,7 +29,7 @@ function handleError(err) {
}
gulp.task('scripts', function () {
gulp.src(['./assets/scripts/main.js', './assets/scripts/history.js']) // './assets/scripts/shared_variables.js',
gulp.src(['./assets/scripts/main.js', './assets/scripts/redirect.js']) // './assets/scripts/shared_variables.js',
// .pipe(concat('main.js'))
.pipe(gulpif(prod, stripDebug()))
.pipe(gulpif(prod, jsmin()))
@@ -18,7 +18,7 @@
<div class="grid">
{% for node in nodes %}
<div class="col col-{{ node.cols }}">
<div class="col small-col-12 med-col-4 large-col-{{ node.cols }}">
<div class="wrapper">
{{ node.build }}
</div>
@@ -26,7 +26,7 @@
{% endfor %}
<div class="agenda col col-3">
<div class="agenda col small-col-12 med-col-4 large-col-3">
<div class="wrapper">
{{ agenda }}
</div>
@@ -1,6 +1,6 @@
<div class="grid">
{% for node in nodes %}
<div class="col col-{{ node.cols }}">
<div class="col small-col-12 med-col-4 large-col-{{ node.cols }}">
<div class="wrapper">
{{ node.build }}
</div>
@@ -104,12 +104,13 @@
</div>
</section>
<section class="second-cartel">
{% if col_left %}
{# if col_left #}
<div class="col-left">
{{ link_transcript }}
{{ link_article }}
{{ content.addtoany }}
</div>
{% endif %}
{# endif #}
{% if col_right %}
<div class="col-right">
{{ content.relations }}
@@ -43,7 +43,6 @@
{%- endif -%}
<ul{{ attributes }}>
{%- for item in links -%}
<!-- {{ dump(item) }} -->
<li{{ item.attributes }}>
{%- if item.link -%}
{{ item.link }}
@@ -0,0 +1,11 @@
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"
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
custom_universal_button: ''
universal_button_placement: before
no_3p: false
_core:
default_config_hash: 8aJF-FDdnrk-N2gLGWFQcLZIpuJZA0BE9NtgXTVJfVk
langcode: fr
@@ -2,7 +2,7 @@ position: tr
vertical: 70
horizontal: 10
fixed: 1
width: 400px
width: 600px
autoclose: 7
opendelay: 0.3
disable_autoclose: 1
@@ -15,8 +15,8 @@ popout:
effect: fadeIn
duration: fast
jquery_ui:
draggable: 0
resizable: 0
draggable: 1
resizable: 1
visibility:
message_type:
id: message_type
@@ -25,7 +25,8 @@ visibility:
domains:
encyclopediedelaparole_org: encyclopediedelaparole_org
negate: false
context_mapping: { }
context_mapping:
'entity:domain': '@domain.current_domain_context:entity:domain'
request_path:
id: request_path
pages: '<front>'
@@ -9,7 +9,7 @@ dependencies:
id: edlpsearchlinkblock
theme: edlptheme
region: footer_right
weight: 0
weight: -3
provider: null
plugin: edlp_search_link_block
settings:
@@ -12,7 +12,7 @@ dependencies:
id: footer
theme: edlptheme
region: footer_left
weight: -4
weight: -7
provider: null
plugin: 'system_menu_block:footer'
settings:
@@ -10,7 +10,7 @@ dependencies:
id: languageswitcher
theme: edlptheme
region: footer_left
weight: -3
weight: -6
provider: null
plugin: 'language_block:language_interface'
settings:
@@ -0,0 +1,27 @@
uuid: c9f90b2a-6eb4-49ec-a5d0-38e824469041
langcode: en
status: true
dependencies:
module:
- domain
- language
theme:
- edlptheme
id: languageswitcher_2
theme: edlptheme
region: footer_right
weight: -6
provider: null
plugin: 'language_block:language_interface'
settings:
id: 'language_block:language_interface'
label: 'Language switcher'
provider: language
label_display: '0'
visibility:
domain:
id: domain
domains:
m_encyclopediedelaparole_org: m_encyclopediedelaparole_org
negate: false
context_mapping: { }
@@ -5,7 +5,6 @@ dependencies:
config:
- system.menu.main
module:
- domain
- system
theme:
- edlptheme
@@ -22,10 +21,4 @@ settings:
label_display: '0'
level: 1
depth: 0
visibility:
domain:
id: domain
domains:
encyclopediedelaparole_org: encyclopediedelaparole_org
negate: false
context_mapping: { }
visibility: { }
@@ -5,6 +5,7 @@ dependencies:
config:
- system.menu.productions
module:
- domain
- system
theme:
- edlptheme
@@ -27,3 +28,10 @@ visibility:
pages: '<front>'
negate: false
context_mapping: { }
domain:
id: domain
domains:
encyclopediedelaparole_org: 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
- language
theme:
- edlptheme
@@ -17,4 +18,10 @@ settings:
label: 'Sélecteur de langue'
provider: language
label_display: '0'
visibility: { }
visibility:
domain:
id: domain
domains:
encyclopediedelaparole_org: encyclopediedelaparole_org
negate: false
context_mapping: { }
@@ -9,7 +9,7 @@ dependencies:
id: studiolinkblock
theme: edlptheme
region: footer_right
weight: -6
weight: -5
provider: null
plugin: edlp_studio_link_block
settings:
@@ -10,7 +10,7 @@ dependencies:
id: userlogin
theme: edlptheme
region: footer_right
weight: -5
weight: -4
provider: null
plugin: user_login_block
settings:
@@ -224,6 +224,9 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
url_redirects:
weight: 50
region: content
hidden:
created: true
field_collectionneurs: true
@@ -45,6 +45,7 @@ content:
link: false
third_party_settings: { }
hidden:
addtoany: true
body: true
chutier_actions: true
field_collectionneurs: true
@@ -11,6 +11,7 @@ dependencies:
- field.field.node.enregistrement.field_genres
- field.field.node.enregistrement.field_langues
- field.field.node.enregistrement.field_locuteurs
- field.field.node.enregistrement.field_nbr_locuteurs
- field.field.node.enregistrement.field_son
- field.field.node.enregistrement.field_transcript_trad
- field.field.node.enregistrement.field_transcript_vo
@@ -29,6 +30,11 @@ content:
region: content
settings: { }
third_party_settings: { }
addtoany:
weight: 3
region: content
settings: { }
third_party_settings: { }
chutier_actions:
weight: 1
region: content
@@ -54,12 +60,18 @@ content:
third_party_settings: { }
type: entity_reference_label
region: content
relations:
weight: 4
region: content
settings: { }
third_party_settings: { }
hidden:
body: true
field_collectionneurs: true
field_genres: true
field_langues: true
field_locuteurs: true
field_nbr_locuteurs: true
field_son: true
field_transcript_trad: true
field_transcript_vo: true
@@ -58,6 +58,7 @@ content:
settings: { }
third_party_settings: { }
hidden:
addtoany: true
field_afficher_en_page_d_acceuil: true
field_documents_lies: true
field_page_type: true
@@ -5,9 +5,13 @@ dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.page.body
- field.field.node.page.field_afficher_en_page_d_acceuil
- field.field.node.page.field_documents_lies
- field.field.node.page.field_page_type
- field.field.node.page.field_son
- field.field.node.page.field_view_mode
- field.field.node.page.field_visuel
- field.field.node.page.field_workflow_generic
- image.style.large
- node.type.page
module:
@@ -30,7 +34,7 @@ content:
region: content
field_son:
type: audiofield_audioplayer
weight: 5
weight: 3
region: content
label: above
settings:
@@ -43,6 +47,8 @@ content:
audio_player_initial_volume: 8
audio_player_autoplay: false
download_link: false
audio_player_lazyload: false
download_button: false
third_party_settings: { }
field_visuel:
type: image
@@ -59,5 +65,12 @@ content:
settings: { }
third_party_settings: { }
hidden:
addtoany: true
field_afficher_en_page_d_acceuil: true
field_documents_lies: true
field_page_type: true
field_view_mode: true
field_workflow_generic: true
langcode: true
production_parent: true
production_subtree: true
@@ -1,6 +1,7 @@
module:
action: 0
actions_permissions: 0
addtoany: 0
admin_toolbar: 0
admin_toolbar_links_access_filter: 0
audiofield: 0
@@ -38,6 +39,7 @@ module:
edlp_fils: 0
edlp_home: 0
edlp_migrate: 0
edlp_mobile: 0
edlp_productions: 0
edlp_search: 0
edlp_studio: 0
@@ -6,6 +6,6 @@ id: encyclopediedelaparole_org
domain_id: 10185300
hostname: encyclopediedelaparole.org
name: 'Encyclopédie de la parole'
scheme: http
scheme: https
weight: 1
is_default: true
@@ -6,6 +6,6 @@ id: m_encyclopediedelaparole_org
domain_id: 10706927
hostname: m.encyclopediedelaparole.org
name: 'Encyclopédie de la parole Mobile'
scheme: http
scheme: https
weight: 2
is_default: false
@@ -15,6 +15,7 @@ settings:
-
name: Formats
items:
- Styles
- Bold
- Italic
- Underline
@@ -50,7 +51,7 @@ settings:
linkit_enabled: true
linkit_profile: collection
stylescombo:
styles: ''
styles: h4.inter-titre|Inter-titre
language:
language_list: un
image_upload:
@@ -49,7 +49,7 @@ filters:
status: false
weight: -43
settings:
allowed_html: '<em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <u> <a href hreflang !href accesskey id rel target title data-entity-type data-entity-uuid data-entity-substitution> <img src alt data-entity-type data-entity-uuid data-entity-substitution>'
allowed_html: '<em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h5 id> <h6 id> <u> <a href hreflang !href accesskey id rel target title data-entity-type data-entity-uuid data-entity-substitution> <img src alt data-entity-type data-entity-uuid data-entity-substitution> <p> <h1> <pre> <h4 id class="inter-titre">'
filter_html_help: true
filter_html_nofollow: false
audio_links:
@@ -0,0 +1 @@
additional_html: "<a class=\"a2a_button_facebook\"></a>\n<a class=\"a2a_button_twitter\"></a>\n<a class=\"a2a_button_google_plus\"></a>\n"
@@ -1676,6 +1676,8 @@ display:
audio_player_soundmanager_theme: default
audio_player_initial_volume: '8'
audio_player_autoplay: 0
audio_player_lazyload: 1
download_button: 0
download_link: 0
group_column: ''
group_columns: { }