12 Commits
Author SHA1 Message Date
Valentin 18bcbf0562 dernières modifs 2024-06-28 01:03:20 +02:00
Valentin 648c737925 fin des corrections 2023-12-03 19:15:44 +01:00
Valentin 54e7a2e847 fini il reste juste les corrections sur la tl 2023-11-30 02:57:55 +01:00
Valentin 4999a4a944 avant corrections 2023-11-02 08:04:25 +01:00
Valentin 52fdf5bdf4 merge des contributions mais surement pb avec les lignes de titres de parties 2023-08-24 12:06:54 +02:00
Valentin 7fe64ecbf2 taff sur le grab du curseur de la tl 2023-08-18 03:23:58 +02:00
Valentin 7c5625f363 debug et améliorations de la TL 2023-08-17 02:20:42 +02:00
Valentin 56e1867e19 avancées sur la frise 2023-07-13 00:42:08 +02:00
Valentin 6746be702c début de l'ajout de la frise 2023-07-12 02:12:15 +02:00
Valentin 10bb3ba80d tous les éléments de l'ui 2023-07-05 02:24:23 +02:00
Valentin 7c1ff8501e tablehead sticky au scroll 2023-07-04 22:31:53 +02:00
Valentin 87d982ed34 unfuck tableau 2023-07-04 02:30:06 +02:00
46 changed files with 22544 additions and 1094 deletions
+236 -1
View File
@@ -100,8 +100,243 @@ collect(['setup', 'filters'])
}
add_action('admin_footer', 'cacher_bloc_foot_admin');
function custom_filter_dropdown() {
global $typenow;
if ($typenow == 'post') { // Adjust post type if needed
$selected = isset($_GET['custom_field_filter']) ? $_GET['custom_field_filter'] : '';
$options = array(
'isMainPart' => __('isMainPart', 'textdomain'),
'isSubPart' => __('isSubPart', 'textdomain'),
);
echo '<select name="custom_field_filter">';
echo '<option value="">' . __('All Custom Fields', 'textdomain') . '</option>';
foreach ($options as $key => $label) {
echo '<option value="' . $key . '"' . selected($selected, $key, false) . '>' . $label . '</option>';
}
echo '</select>';
}
}
add_action('restrict_manage_posts', 'custom_filter_dropdown');
function filter_by_custom_field($query) {
global $pagenow;
if (is_admin() && $pagenow == 'edit.php' && isset($_GET['custom_field_filter'])) {
$custom_field_key = sanitize_text_field($_GET['custom_field_filter']);
if (!empty($custom_field_key)) {
$meta_query = array(
array(
'key' => $custom_field_key,
'compare' => 'EXISTS',
),
);
$query->query_vars['meta_query'] = $meta_query;
}
}
}
add_filter('parse_query', 'filter_by_custom_field');
add_action('wp', 'generate_csv');
function generate_csv() {
if ('csv' === (isset($_GET['format']) ? $_GET['format'] : null)) {
// Query to get all posts
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'meta_key' => 'index',
'meta_type' => 'NUMERIC',
'orderby' => 'meta_value',
'order' => 'ASC'
);
$posts = get_posts($args);
if (!empty($posts)) {
// Initialize CSV data array
$csvData = array();
// Add CSV header row
$csvData[] = array('Temps', 'Images', 'Voix Off et In', 'Bande Son', 'Écrits', 'Section');
// Loop through posts and add them to the CSV data array
foreach ($posts as $post) {
$post_content = wp_strip_all_tags($post->post_content);
$content_array = explode("---", $post_content);
$temps = $post->post_title;
$images = isset($content_array[1]) ? $content_array[1] : '';
$images = substr($images, 0, -15);
$voixOffIn = isset($content_array[2]) ? $content_array[2] : '';
$voixOffIn = substr($voixOffIn, 0, -10);
$bandeson = isset($content_array[3]) ? $content_array[3] : '';
$bandeson = substr($bandeson, 0, -8);
$ecrits = isset($content_array[4]) ? $content_array[4] : '';
if (get_post_meta($post->ID, 'isMainPart', true)) {
$section = get_post_meta($post->ID, 'isMainPart', true);
} elseif (get_post_meta($post->ID, 'isSubPart', true)) {
$section = get_post_meta($post->ID, 'isSubPart', true);
} else {
$section = '';
}
$csvData[] = array(
$temps,
$images,
$voixOffIn,
$bandeson,
$ecrits,
$section,
);
}
$csvFileName = 'partition_livre_d_image.csv';
header('Content-Encoding: UTF-8');
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=' . $csvFileName);
echo "\xEF\xBB\xBF"; // UTF-8 BOM
// Output CSV data
$output = fopen('php://output', 'w');
foreach ($csvData as $row) {
fputcsv($output, $row);
}
fclose($output);
exit;
}
}
}
function custom_admin_styles() {
wp_enqueue_style('custom-admin', get_template_directory_uri() . '/resources/styles/admin_custom.css');
wp_enqueue_script('custom-admin-script', get_template_directory_uri() . '/resources/scripts/custom-admin-script.js', array(), null, true);
}
add_action('admin_enqueue_scripts', 'custom_admin_styles');
function restrict_revisions_by_author($query) {
global $current_user;
// Check if the user is logged in
if (is_user_logged_in()) {
get_currentuserinfo();
$author_id = $current_user->ID;
// Modify the query to filter revisions by author
if (isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'revision') {
$query->set('author', $author_id);
}
}
}
add_action('pre_get_posts', 'restrict_revisions_by_author');
function customize_editor_for_editor_role() {
if (current_user_can('revisor')) {
wp_enqueue_script('custom-editor-script', get_template_directory_uri() . '/resources/scripts/custom-editor-script.js', array(), null, true);
wp_enqueue_style('custom-editor-style', get_template_directory_uri() . '/resources/styles/custom-editor-style.css');
// Create my revisions page
$current_user = wp_get_current_user();
$author_id = $current_user->ID;
$revisionary_page = admin_url('admin.php?page=revisionary-q&author=' . $author_id);
// Get the content of the specific page (replace '123' with the actual page ID)
$page_id = 13940;
$page_content = get_post_field('post_content', $page_id);
$website_url = site_url();
// Localize the page content to be accessible in your custom script
wp_localize_script('custom-editor-script', 'pageContentData', array(
'content' => $page_content,
'websiteUrl' => $website_url,
'myRevisionsUrl' => $revisionary_page,
));
}
}
add_action('admin_enqueue_scripts', 'customize_editor_for_editor_role');
function remove_roles() {
remove_role('author');
remove_role('editor');
remove_role('subscriber');
remove_role('contributor');
}
add_action('init', 'remove_roles');
// Redirect all post URLs to the homepage
function redirect_single_posts_to_homepage() {
if (is_single() && isset($_GET['p'])) {
wp_redirect(home_url(), 301);
exit();
}
}
add_action('template_redirect', 'redirect_single_posts_to_homepage');
function log_posts_with_user_revisions() {
$current_user = wp_get_current_user();
if (current_user_can('revisor')) {
if ($current_user instanceof WP_User) {
$current_user_id = $current_user->ID;
$args = array(
'post_type' => 'revision', // Fetch all post types including revisions
'post_status' => 'inherit', // Fetch all post statuses including revisions
'posts_per_page' => -1, // Retrieve all posts
'author' => $current_user_id,
'fields' => 'ids', // Retrieve only IDs to speed up the query
);
$all_posts = get_posts($args);
$parents_posts_ids = array();
$revisions_dates = array();
foreach ($all_posts as $post_id) {
$current_revision_date = array();
$current_revision_date[] = get_post(wp_get_post_parent_id($post_id))->post_title;
$current_revision_date[] = get_post($post_id)->post_date;
$revisions_dates[] = $current_revision_date;
$parents_posts_ids[] = wp_get_post_parent_id($post_id);
}
$parents_posts_ids = array_unique($parents_posts_ids);
$history_posts_titles = array();
$history_posts_contents = array();
foreach ($parents_posts_ids as $parent_post_id) {
$history_posts_titles[] = get_post($parent_post_id)->post_title;
$history_posts_contents[] = strip_tags(get_post($parent_post_id)->post_content);
}
// Enqueue the script
wp_enqueue_script('contribution-history-script', get_template_directory_uri() . '/resources/scripts/contribution_history.js', array('jquery'), '1.0', true);
// Localize script to pass data to JavaScript
wp_localize_script('contribution-history-script', 'historyData', array(
'titles' => $history_posts_titles,
'contents' => $history_posts_contents,
'dates' => $revisions_dates
));
}
}
}
add_action('admin_enqueue_scripts', 'log_posts_with_user_revisions');
function custom_logout_redirect() {
wp_redirect( home_url() );
exit();
}
add_action('wp_logout','custom_logout_redirect');
// function supprimer_tous_les_articles() {
// $args = array(
+90 -2
View File
@@ -4,16 +4,104 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
<style>
span[class^="dot-"]{
opacity: 0;
}
.dot-one{
animation: dot-one 2s infinite linear
}
.dot-two{
animation: dot-two 2s infinite linear
}
.dot-three{
animation: dot-three 2s infinite linear
}
@keyframes dot-one{
0%{
opacity: 0;
}
15%{
opacity: 0;
}
25%{
opacity: 1;
}
100%{
opacity: 1;
}
}
@keyframes dot-two{
0%{
opacity: 0;
}
25%{
opacity: 0;
}
50%{
opacity: 1;
}
100%{
opacity: 1;
}
}
@keyframes dot-three{
0%{
opacity: 0;
}
50%{
opacity: 0;
}
75%{
opacity: 1;
}
100%{
opacity: 1;
}
}
</style>
</head>
<body <?php body_class(); ?>>
<body <?php body_class(); ?> style="background-color: #010d19;">
<?php wp_body_open(); ?>
<?php do_action('get_header'); ?>
<div id="app" class="banner bg-jlg-dark-blue text-jlg-white font-authentic flex w-full flex-col justify-center items-center">
<div id="app" class="banner bg-jlg-dark-blue text-jlg-white font-authentic flex w-full flex-col justify-center items-center" style="opacity: 0; transition: opacity 0.2s ease-out;">
<?php echo view(app('sage.view'), app('sage.data'))->render(); ?>
</div>
<div id="loading" style="
width: 100vw;
height: 100vh;
background-color: #010d19;
z-index: 9999;
position: fixed;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
font-family: sans-serif;
color: white;
opacity: 1;
transition: opacity 0.2s ease-out;
">
<p>
Chargement
<span class="dot-one">.</span>
<span class="dot-two">.</span>
<span class="dot-three">.</span>
</p>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
}, false);
</script>
<?php do_action('get_footer'); ?>
<?php wp_footer(); ?>
</body>
+18985
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -24,6 +24,6 @@
"@roots/sage": "6.12.2"
},
"dependencies": {
"caniuse-lite": "^1.0.30001504"
"caniuse-lite": "^1.0.30001513"
}
}
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
viewBox="0 -960 960 960"
width="24"
version="1.1"
id="svg1"
sodipodi:docname="arrow_drop_down.svg"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="38.541667"
inkscape:cx="12"
inkscape:cy="12"
inkscape:window-width="2160"
inkscape:window-height="1440"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<path
d="M480-360 280-560h400L480-360Z"
id="path1"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
viewBox="0 -960 960 960"
width="24"
version="1.1"
id="svg1"
sodipodi:docname="arrow_drop_up.svg"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="38.541667"
inkscape:cx="9.1718919"
inkscape:cy="11.532973"
inkscape:window-width="2160"
inkscape:window-height="1440"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<path
d="m280-400 200-200 200 200H280Z"
id="path1"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
height="24"
viewBox="0 -960 960 960"
width="24"
version="1.1"
id="svg1"
sodipodi:docname="pen_icon.svg"
inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1" />
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:zoom="38.541667"
inkscape:cx="12"
inkscape:cy="12"
inkscape:window-width="2160"
inkscape:window-height="1440"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1" />
<path
d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"
id="path1"
style="fill:#ffffff" />
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File
+182 -1
View File
@@ -1,10 +1,191 @@
import domReady from '@roots/sage/client/dom-ready';
import { customSearch } from './front/search.js';
import { customTimeline } from './front/timeline.js';
/**
* Application entrypoint
*/
domReady(async () => {
// ...
window.addEventListener('load', function() {
setTimeout(function() {
window.scrollTo(0, 0);
}, 0);
});
window.addEventListener('resize', function() {
setTimeout(function() {
window.scrollTo(0, 0);
let editButtons = document.querySelectorAll(".edit-button");
for (let editButton of editButtons) {
let editContainer = editButton.parentElement;
editContainer.style.height = `${editContainer.previousElementSibling.offsetHeight}px`;
}
}, 0);
});
// POUR LES LIENS D'EDITION/CONNEXION QUAND ON EST PAS CONNECTÉS
let connectLinks = document.querySelectorAll('a.xoo-el-login-tgr');
for (let connectLink of connectLinks) {
if (connectLink.previousElementSibling) {
let penImg = connectLink.previousElementSibling;
connectLink.classList.add('edit-button');
connectLink.innerText = '';
connectLink.append(penImg);
}
}
// CLEANER LE TABLEAU
let minHeadTh = document.querySelector("#main table thead tr th:first-of-type");
minHeadTh.style.width = `${100 / 8}%`;
let otherHeadThs = document.querySelectorAll("#main table thead tr th:not(:first-of-type)");
for (let otherHeadTh of otherHeadThs) {
otherHeadTh.style.width = `${100 / 8 * 1.75}%`;
}
let minTableTds = document.querySelectorAll("#main table tbody tr td:first-of-type");
for (let minTableTd of minTableTds) {
if (minTableTd.parentNode.childElementCount != 1) {
minTableTd.style.width = `${100 / 8}%`;
}
}
let otherTableTds = document.querySelectorAll("#main table tbody tr td:not(:first-of-type)");
for (let otherTableTd of otherTableTds) {
otherTableTd.style.width = `${100 / 8 * 1.75}%`;
}
let editButtons = document.querySelectorAll(".edit-button");
for (let editButton of editButtons) {
let editContainer = editButton.parentElement;
editContainer.style.height = `${editContainer.previousElementSibling.offsetHeight}px`;
}
// HEADER AU SCROLL
let tableHead = document.querySelector("thead tr");
let tHeadHeight = tableHead.offsetHeight;
tableHead.style.maxHeight = `${tHeadHeight}px`;
let headerHeight = document.querySelector("header").offsetHeight;
let titleLarge = document.querySelector('.brand span:nth-of-type(2)');
let titlesSmall = document.querySelectorAll('.brand span:not(.brand span:nth-of-type(2))');
let titleContainer = document.querySelector('.brand');
window.onscroll = () => {
tableHead.style.minHeight = `${headerHeight + 72}px`;
let scroll = window.scrollY;
let headerNewHeight = tHeadHeight - scroll;
if (headerNewHeight > 72) {
tableHead.style.height = `${headerHeight + headerNewHeight}px`;
titleContainer.style.lineHeight = "1.75rem";
titleLarge.style.fontSize = '35px';
for (let titleSmall of titlesSmall) {
titleSmall.style.fontSize = '25px';
}
} else {
tableHead.style.height = tableHead.style.minHeight;
titleContainer.style.lineHeight = "1.4rem";
titleLarge.style.fontSize = '24px';
for (let titleSmall of titlesSmall) {
titleSmall.style.fontSize = '17px';
}
}
}
// C'EST LA POUR LES PRIVACY POLICY
// texte d'explication du login popup
// et privacy policy
let loginPopupText = document.getElementById('content_login_popup');
let privacyText = document.getElementById('content_privacy').innerHTML;
loginPopupText = loginPopupText.innerHTML;
let loginPopupTextWrapper = document.getElementsByClassName('xoo-el-sidebar');
if (loginPopupTextWrapper[0]) {
loginPopupTextWrapper[0].innerHTML = `<div>Espace collaboratif du site</div>`;
loginPopupTextWrapper[0].innerHTML += loginPopupText;
}
let loginPopupHeader = document.querySelector('.xoo-el-sidebar div:first-of-type');
if (loginPopupHeader !== null) {
loginPopupHeader.setAttribute('style', 'background-color: white; width: 100%; font-weight: bold; padding: 20px 30px;');
}
let policyDropdown = document.createElement('div');
policyDropdown.style.width = "100%";
policyDropdown.style.cursor = "pointer";
policyDropdown.style.fontWeight = "bold";
policyDropdown.style.display = "flex";
policyDropdown.style.justifyContent = "space-between";
policyDropdown.style.backgroundColor = "white";
policyDropdown.style.padding = "20px 30px";
let policyDropdownTitle = document.createElement('p');
policyDropdownTitle.style.padding = "0";
let policyDropdownPlus = document.createElement('p');
policyDropdownPlus.style.padding = "0";
policyDropdownPlus.innerText = '+';
policyDropdownTitle.innerText = "Politique de confidentialité";
policyDropdown.appendChild(policyDropdownTitle);
policyDropdown.appendChild(policyDropdownPlus);
let privacyPolicyContent = document.createElement('div');
privacyPolicyContent.innerHTML = privacyText;
privacyPolicyContent.style.width = "100%";
privacyPolicyContent.style.padding = "0px";
let policyParagraphs = privacyPolicyContent.querySelectorAll('p, h2');
for (let policyParagraph of policyParagraphs) {
policyParagraph.style.padding = '0';
policyParagraph.style.marginBottom = '15px';
}
privacyPolicyContent.style.height = "0px";
privacyPolicyContent.style.overflow = "hidden";
let policyOpen = false;
policyDropdown.addEventListener('click', togglePolicy);
if (loginPopupTextWrapper[0]) {
loginPopupTextWrapper[0].appendChild(policyDropdown);
loginPopupTextWrapper[0].style.overflowY = "scroll";
loginPopupTextWrapper[0].appendChild(privacyPolicyContent);
}
const privacyCheck = document.querySelector(".xoo-aff-required.xoo-aff-checkbox_single label");
if (privacyCheck) {
privacyCheck.innerHTML = `
<input type="checkbox" name="xoo_el_reg_terms" class="xoo-aff-required xoo-aff-checkbox_single" value="yes">
J'accepte les <a>Conditions d'utilisation de la license et la politique de confidentialité</a>.
`;
}
const privacyLink = document.querySelector('.xoo-aff-checkbox_single a');
if (privacyLink) {
privacyLink.addEventListener('click', function (e) {
e.preventDefault();
e.target.style.cursor = "pointer";
togglePolicy();
});
}
function togglePolicy() {
if (policyOpen) {
privacyPolicyContent.style.height = "0px";
privacyPolicyContent.style.padding = "0px";
policyOpen = false;
} else {
privacyPolicyContent.style.height = "auto";
privacyPolicyContent.style.padding = "10px 20px";
policyOpen = true;
}
}
customTimeline();
customSearch();
// désactive le loading quand les éléments sont affichés correctement
setTimeout(() => {
let appEl = document.getElementById('app');
appEl.style.opacity = 1;
let loadingEl = document.getElementById('loading');
loadingEl.style.opacity = "0";
setTimeout(() => {
loadingEl.style.display = "none";
}, 200);
}, 100);
});
/**
+117
View File
@@ -0,0 +1,117 @@
const contributionPostsTitles = historyData.titles;
const contributionPostsContents = historyData.contents;
const contributionDates = historyData.dates;
document.addEventListener('DOMContentLoaded', function() {
if (document.querySelector('.revision-q') && contributionDates.length > 0) {
let historyBlock = document.createElement('div');
historyBlock.style.marginRight = "20px";
let historyTitle = document.createElement('h1');
historyTitle.style.marginTop = "100px";
historyTitle.style.fontWeight = "lighter";
historyTitle.innerText = "Minutages auxquels vous avez contribué";
historyBlock.append(historyTitle);
let historyTable = document.createElement('table');
historyTable.style.width = "100%";
historyTable.style.padding = "20px";
let historyTableHead = document.createElement('thead');
let tableHeadTr = document.createElement('tr');
let thDate = document.createElement('th');
thDate.style.paddingBottom = "10px";
thDate.style.fontStyle = "italic";
thDate.style.borderRight = "solid 1px white";
thDate.innerText = "Date de la contribution";
let thMinutage = document.createElement('th');
thMinutage.style.paddingBottom = "10px";
thMinutage.style.fontStyle = "italic";
thMinutage.innerText = "Minutage";
let thImage = document.createElement('th');
thImage.style.paddingBottom = "10px";
thImage.style.fontStyle = "italic";
thImage.innerText = "Images";
let thVoix = document.createElement('th');
thVoix.style.paddingBottom = "10px";
thVoix.style.fontStyle = "italic";
thVoix.innerText = "Voix Off et In";
let thBandeSon = document.createElement('th');
thBandeSon.style.paddingBottom = "10px";
thBandeSon.style.fontStyle = "italic";
thBandeSon.innerText = "Bande Son";
let thEcrits = document.createElement('th');
thEcrits.style.paddingBottom = "10px";
thEcrits.style.fontStyle = "italic";
thEcrits.innerText = "Écrits";
tableHeadTr.append(thDate);
tableHeadTr.append(thMinutage);
tableHeadTr.append(thImage);
tableHeadTr.append(thVoix);
tableHeadTr.append(thBandeSon);
tableHeadTr.append(thEcrits);
historyTableHead.append(tableHeadTr);
historyTable.append(historyTableHead);
let tableBody = document.createElement('tbody');
for (let i = 0; i < contributionPostsTitles.length; i++) {
let tableRow = document.createElement('tr');
let caseDate = document.createElement('th');
caseDate.style.borderRight = "solid 1px white";
for (let date of contributionDates) {
if (date[0] === contributionPostsTitles[i]) {
let thisDate = date[1];
let time = thisDate.split(' ')[1];
thisDate = thisDate.split(' ')[0].split('-');
thisDate = `${thisDate[2]}/${thisDate[1]}/${thisDate[0]}`;
caseDate.innerHTML += `<p>${thisDate} ${time}</p>`;
}
}
tableRow.append(caseDate);
let caseMinutage = document.createElement('th');
caseMinutage.innerText = contributionPostsTitles[i];
caseMinutage.style.paddingTop = "10px";
caseMinutage.style.paddingBottom = "10px";
tableRow.append(caseMinutage);
let casesContents = contributionPostsContents[i].split('---');
let imageTh = document.createElement('th');
imageTh.innerHTML = casesContents[1].slice(0, -17);
tableRow.append(imageTh);
let voixTh = document.createElement('th');
voixTh.innerHTML = casesContents[2].slice(0, -11);
tableRow.append(voixTh);
let bandeSonTh = document.createElement('th');
bandeSonTh.innerHTML = casesContents[3].slice(0, -8);
tableRow.append(bandeSonTh);
let ecritsTh = document.createElement('th');
ecritsTh.innerHTML = casesContents[4];
tableRow.append(ecritsTh);
tableBody.append(tableRow);
}
historyTable.append(tableBody);
let allThs = historyTable.querySelectorAll('th');
for (let th of allThs) {
th.style.padding = "10px";
th.style.paddingBottom = "20px";
th.style.paddingTop = "20px";
th.style.borderBottom = "solid 1px white";
}
historyBlock.append(historyTable);
let wpContent = document.querySelector('#wpbody-content');
wpContent.append(historyBlock);
}
});
+53
View File
@@ -0,0 +1,53 @@
document.addEventListener('DOMContentLoaded', function() {
setTimeout(() => {
if (document.querySelector('.block-editor-writing-flow')) {
setTimeout(() => {
document.querySelector('.rvy-current-status').innerText = replaceText(document.querySelector('.rvy-current-status').innerText);
document.querySelector('.revision-approve.revision-created').innerText = replaceText(document.querySelector('.revision-approve.revision-created').innerText);
let sendButton = document.querySelector('a.revision-approve');
sendButton.addEventListener('click', () => {
setTimeout(() => {
let elToDelete = document.querySelector('.components-panel__row.rvy-creation-ui.edit-post-revision-status')
elToDelete.style.display = "none";
}, 300);
});
}, 500);
} else if (document.querySelector('.revision-q')) {
document.querySelector('.wp-menu-name').innerText = replaceText(document.querySelector('.wp-menu-name').innerText);
document.querySelector('h1').innerText = replaceText(document.querySelector('h1').innerText);
let mine = document.querySelector('.mine a');
if (mine !== null) {
document.querySelector('.mine a').innerText = replaceText(document.querySelector('.mine a').innerText);
}
document.querySelector('#title a').innerText = replaceText(document.querySelector('#title a').innerText);
document.querySelector('#date a').innerText = replaceText(document.querySelector('#date a').innerText);
let sentStatus = document.querySelectorAll('.wp-list-table tbody tr td[data-colname="État"]');
if (sentStatus) {
for (let caseStatus of sentStatus) {
if (caseStatus.firstElementChild.innerText === "Envoyé") {
caseStatus.firstElementChild.innerText = "Envoyé, en attente de validation";
}
}
}
let revisionTitles = document.querySelectorAll('.row-title');
if (revisionTitles) {
for (let revisionTitle of revisionTitles) {
revisionTitle.innerText = revisionTitle.innerText + " (afficher)";
}
}
} else if (document.querySelector('.profile-php')) {
document.querySelector('#toplevel_page_revisionary-q a .wp-menu-name').innerText = replaceText(document.querySelector('#toplevel_page_revisionary-q a .wp-menu-name').innerText);
}
}, 1000);
})
function replaceText(content) {
content = content.replace(/Révision/g, 'Contribution');
content = content.replace(/révision/g, 'contribution');
content = content.replace(/Révisions/g, 'Contributions');
content = content.replace(/révisions/g, 'contributions');
return content;
}
+73
View File
@@ -0,0 +1,73 @@
(function($) {
var pageContent = pageContentData.content;
var websiteUrl = pageContentData.websiteUrl;
var myRevisionsUrl = pageContentData.myRevisionsUrl;
document.addEventListener('DOMContentLoaded', function() {
setTimeout(() => {
// display tutorial
let editorWriting = document.querySelector('.edit-post-visual-editor');
let writingSpace = document.querySelector('.block-editor-writing-flow');
let sidePannel = document.querySelector('.interface-interface-skeleton__sidebar');
if (writingSpace) {
writingSpace.style.maxWidth = "75vw";
writingSpace.style.overflowX = "hidden";
sidePannel.style.maxWidth = "25vw";
sidePannel.style.overflowX = "hidden";
writingSpace.style.padding = "0";
let tutorialWrapper = document.createElement('div');
let tutorialTitle = document.createElement('p');
tutorialWrapper.prepend(tutorialTitle);
tutorialTitle.innerText = "Notice d'utilisation de l'espace contribution";
tutorialTitle.style.fontSize = "1.3rem";
tutorialWrapper.setAttribute('id', 'tutorial_editor');
tutorialWrapper.style.width = "100%";
tutorialWrapper.style.backgroundColor = "#384756";
tutorialWrapper.style.padding = "20px";
tutorialWrapper.innerHTML += pageContent;
for (let tutorialParagraph of tutorialWrapper.children) {
tutorialParagraph.style.marginBottom = '10px';
}
sidePannel.appendChild(tutorialWrapper);
}
// create the go back to the index button and the go back to my revisions page
let pannel = document.querySelector('.interface-pinned-items');
if (pannel) {
let backToIndexButton = document.createElement('div');
let backToIndexLink = document.createElement('a');
backToIndexLink.setAttribute('href', websiteUrl);
backToIndexLink.innerHTML = "&#8592; Retour à la Partition";
backToIndexLink.style.color = "white";
backToIndexLink.style.padding = "6px 8px";
backToIndexLink.style.border = "solid 1px white";
backToIndexButton.style.paddingTop = '7px';
backToIndexButton.style.marginRight = '5px';
backToIndexButton.appendChild(backToIndexLink);
backToIndexButton.setAttribute('id', 'backToIndexButton');
pannel.prepend(backToIndexButton);
let backToMyRevisionsButton = document.createElement('div');
let backToMyRevisionsLink = document.createElement('a');
backToMyRevisionsLink.setAttribute('href', myRevisionsUrl);
backToMyRevisionsLink.innerHTML = "&#8592; Liste des contributions";
backToMyRevisionsLink.style.color = "white";
backToMyRevisionsLink.style.padding = "6px 8px";
backToMyRevisionsLink.style.border = "solid 1px white";
backToMyRevisionsButton.style.paddingTop = '7px';
backToMyRevisionsButton.style.marginRight = '5px';
backToMyRevisionsButton.appendChild(backToMyRevisionsLink);
backToMyRevisionsButton.setAttribute('id', 'backToMyRevisionsButton');
pannel.prepend(backToMyRevisionsButton);
}
// transformer le "article" en "envoyer"
let tabButton = document.querySelector('.components-button.edit-post-sidebar__panel-tab');
if (tabButton) {
tabButton.innerText = "Soumettre la contribution";
}
}, 2000);
})
})(jQuery);
+318
View File
@@ -0,0 +1,318 @@
function customSearch() {
let searchableContent = document.querySelectorAll('tr td:not(:last-of-type)');
let searchInput = document.querySelector('input[type="search"]');
let searchResults = document.querySelector('#search_results');
let isResultOpen = false;
let resultAmount = 0;
let resultAmountText = document.querySelector('#result_amount');
let hilightedWords;
let typingTimer;
let currentSelectedWord = 0;
let downArrow = document.querySelector('#search_results div div img:first-of-type');
let upArrow = document.querySelector('#search_results div div img:last-of-type');
let thereAreResults = false;
let inputIsActive = false;
searchInput.addEventListener('focus', () => { inputIsActive = true; toggleSearchResults(); });
searchInput.addEventListener('blur', () => { inputIsActive = false; });
searchInput.addEventListener('keydown', function(e) {
if ((e.key === 'Enter' || e.keyCode === 13) && resultAmount > 1) {
if (+resultAmountText.innerText.split('/')[0] === resultAmount) {
getToFirstOccurence();
} else {
getToNextOccurence(downArrow);
}
} else {
triggerSearch();
}
});
function triggerSearch() {
setTimeout(() => {
hilightedWords = [];
resultAmount = 0;
removeHighlightTags();
let input = searchInput.value.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
if (searchInput.value.length >= 3) {
thereAreResults = true;
clearTimeout(typingTimer);
typingTimer = setTimeout(function() {
searchInContent(input);
let currentScroll = window.scrollY;
if (hilightedWords.length != 0) {
searchResults.querySelector('div p:first-of-type').style.display = "block";
searchResults.querySelector('div p:last-of-type').style.display = "none";
for (let i = 0; i < hilightedWords.length; i++) {
let wordBoundingTop = hilightedWords[i].getBoundingClientRect().top;
if (hilightedWords.length <= 1) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = 1;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.add('disabled');
downArrow.classList.add('disabled');
} else {
if (currentScroll <= wordBoundingTop + currentScroll && i === 0) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = 1;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.add('disabled');
downArrow.classList.remove('disabled');
break;
} else if (
currentScroll <= wordBoundingTop + currentScroll && currentScroll >= hilightedWords[i - 1]?.getBoundingClientRect().top + currentScroll
) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = i + 1;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.remove('disabled');
if (i === hilightedWords.length - 1) {
downArrow.classList.add('disabled');
} else {
downArrow.classList.remove('disabled');
}
break;
} else if (currentScroll >= wordBoundingTop && i === hilightedWords.length - 1) {
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
currentSelectedWord = hilightedWords.length;
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText;
upArrow.classList.remove('disabled');
downArrow.classList.add('disabled');
break;
}
}
}
} else {
searchResults.querySelector('div p:first-of-type').style.display = "none";
searchResults.querySelector('div p:last-of-type').style.display = "block";
upArrow.classList.add('disabled');
downArrow.classList.add('disabled');
}
}, 800);
} else {
removeHighlightTags();
clearTimeout(typingTimer);
thereAreResults = false;
searchResults.querySelector('div p:first-of-type').style.display = "none";
searchResults.querySelector('div p:last-of-type').style.display = "block";
upArrow.classList.add('disabled');
downArrow.classList.add('disabled');
}
}, 10);
}
function searchInContent(input) {
for (let content of searchableContent) {
if (content.innerText != '') {
if (content.children.length > 0) {
for (let textEl of content.children) {
compareTexts(textEl, input);
}
} else {
compareTexts(content, input);
}
}
}
resultAmountText.innerText = resultAmount;
}
function compareTexts(textEl, input) {
if (textEl.innerText !== '') {
if (textEl.parentElement.tagName === "TR") {
input = input.replace(/'/g, '');
}
if (textEl.innerHTML.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").includes(input)) {
let splitContent = textEl.innerHTML.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").split(input);
let processedText = '';
for (let i = 0; i < splitContent.length; i++) {
if (splitContent[0] !== '' || splitContent[splitContent.length - 1] !== '') {
if (i === 0) {
processedText += textEl.innerHTML.substring(0, splitContent[i].length);
} else {
let amountOfTextToConcatenate = 0;
for (let j = 0; j <= i - 1; j ++) {
amountOfTextToConcatenate += splitContent[j].length + input.length;
}
processedText +=
'<span class="highlight">' +
textEl.innerHTML.substring(amountOfTextToConcatenate - input.length, amountOfTextToConcatenate) +
'</span>' +
textEl.innerHTML.substring(
amountOfTextToConcatenate, amountOfTextToConcatenate + splitContent[i].length
);
}
} else if (splitContent[splitContent.length - 1] === '' && splitContent[0] === '') {
processedText = '<span class="highlight">' + textEl.innerHTML + '</span>';
}
}
textEl.innerHTML = processedText;
hilightedWords = document.querySelectorAll('.highlight');
resultAmount = hilightedWords.length;
}
}
}
function removeHighlightTags() {
for (let content of searchableContent) {
if (content.innerHTML.includes('<span class="highlight">')) {
content.innerHTML = content.innerHTML.replace(/<span class="highlight">|<\/span>/g, '');
}
}
}
function toggleSearchResults() {
// dans le if thereAreResults || inputIsActive
// si on veut que les résultats restent ouvert
// quand il y a des résultats
if (inputIsActive) {
searchResults.style.top = `${searchInput.getBoundingClientRect().bottom + 5}px`;
searchResults.style.display = "block";
searchResults.style.opacity = 1;
searchResults.style.maxHeight = "1000px";
isResultOpen = true;
} else {
searchResults.style.opacity = 0;
searchResults.style.maxHeight = "0px";
isResultOpen = false;
setTimeout(() => {
searchResults.style.display = "none";
}, 300);
}
}
upArrow.addEventListener('click', function (el) {
getToPrevOccurence(el)
});
function getToPrevOccurence(el) {
if (!el.target.classList.contains('disabled')) {
let currentScroll = window.scrollY;
currentSelectedWord--;
let wordBoundingTop = hilightedWords[currentSelectedWord - 1].getBoundingClientRect().top;
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText.split('/')[1];
if (currentSelectedWord === 1) {
upArrow.classList.add('disabled');
downArrow.classList.remove('disabled');
} else {
upArrow.classList.remove('disabled');
downArrow.classList.remove('disabled');
}
}
}
downArrow.addEventListener('click', function (el) {
getToNextOccurence(el.target);
});
function getToNextOccurence(el) {
if (!el.classList.contains('disabled')) {
let currentScroll = window.scrollY;
currentSelectedWord++;
let wordBoundingTop = hilightedWords[currentSelectedWord - 1].getBoundingClientRect().top;
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText.split('/')[1];
if (currentSelectedWord === hilightedWords.length) {
downArrow.classList.add('disabled');
upArrow.classList.remove('disabled');
} else {
downArrow.classList.remove('disabled');
upArrow.classList.remove('disabled');
}
}
}
function getToFirstOccurence() {
let currentScroll = window.scrollY;
currentSelectedWord = 1;
let wordBoundingTop = hilightedWords[currentSelectedWord - 1].getBoundingClientRect().top;
let scrollValue = (wordBoundingTop + currentScroll) - window.innerHeight / 2;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
resultAmountText.innerText = currentSelectedWord + "/" + resultAmountText.innerText.split('/')[1];
downArrow.classList.remove('disabled');
upArrow.classList.add('disabled');
}
let tagsDiv = document.querySelector('#search_results > div:last-of-type');
window.addEventListener('click', function (el) {
if (!searchResults.contains(el.target) && isResultOpen && el.target != searchInput && el.target != tagsDiv) {
toggleSearchResults();
}
});
let searchWordList = document.querySelector('#content_search_tag');
searchWordList = searchWordList.innerText.substring(1, searchWordList.innerText.length - 1).split(', ');
for (let tag of searchWordList) {
let tagWrapper = document.createElement('p');
tagWrapper.innerText = tag;
tagWrapper.addEventListener('click', function () {
searchInput.value = tag;
triggerSearch();
});
tagsDiv.appendChild(tagWrapper);
}
}
export { customSearch };
+526
View File
@@ -0,0 +1,526 @@
function customTimeline() {
let colors, titles, partTitles;
let partDurations = [];
let totalTime;
let tlContainer, tlContainerHeight;
let partBlockHeights = [];
let activePartIndex = 0;
let steps = {
tlElSteps: [],
scrollSteps: []
}
let previousScroll;
let grabbing = false;
let titresFrise;
let cursor = document.querySelector('#cursor');
let titresCursor;
let partRects;
let isScrollingFromGrab = false;
let prevPartIndex = 0;
let lastCallTimestamp = 0;
let timestampDebounce = 200;
// titres de parties dans le tableau
function setPartTitlesInPartition() {
let mainpartTitles = document.querySelectorAll('.isMainPart');
for (let mainpartTitle of mainpartTitles) {
if (mainpartTitle.nextElementSibling.classList.contains('isSubPart')) {
mainpartTitle.firstElementChild.firstElementChild.style.height = "1.5rem";
mainpartTitle.firstElementChild.style.marginBottom = "-0.25rem";
mainpartTitle.style.borderBottom = "0";
mainpartTitle.style.paddingBottom = "0";
mainpartTitle.nextElementSibling.style.paddingTop = "0";
}
}
}
// couleurs titres
function setPartsColors() {
colors = [
{'red' : 'cf0118'},
{'blue1': '0101c4'},
{'blue2': '01049e'},
{'blue3': '010678'},
{'blue4': '010952'},
{'blue5': '00113c'},
{'yellow1': 'ade719'},
{'yellow2': '8cc700'},
{'yellow3': '74af00'},
{'yellow4': '5c9900'},
{'yellow5': '377600'},
{'pink1': 'cf0118'},
{'pink2': 'a10418'}
];
titles = document.querySelectorAll('.isMainPart, .isSubPart');
partTitles = [];
for (let title of titles) {
if (!title.nextElementSibling.classList.contains('isSubPart')) {
partTitles.push(title);
}
}
for (let i = 0; i < partTitles.length; i++) {
if (partTitles[i].previousElementSibling?.classList.contains('isMainPart')) {
partTitles[i].previousElementSibling.firstElementChild.firstElementChild.style.backgroundColor = "#" + Object.values(colors[i])[0];
}
partTitles[i].firstElementChild.firstElementChild.style.backgroundColor = "#" + Object.values(colors[i])[0];
}
}
// set parts rectangles
function convertToSeconds(timeStr) {
let [hourStr, minStr] = timeStr.split('h');
if (!minStr) {
minStr = hourStr;
hourStr = '0';
}
minStr = minStr.replace('', ':');
minStr = minStr.replace("'", ':');
const [min, sec] = minStr.split(':');
return parseInt(hourStr) * 3600 + parseInt(min) * 60 + parseInt(sec);
}
function getPartsTimes() {
let partTimesNodes = document.querySelectorAll('body #app main tbody tr:not(.isContentPart) + tr:not(.isSubPart) td:first-of-type');
let partTimes = Array.from(partTimesNodes);
for (let i = 0; i < partTimes.length; i++) {
partTimes[i] = convertToSeconds(partTimes[i].innerText);
}
let lastTime = document.querySelectorAll('body #app main tbody tr:last-of-type td:first-of-type');
partTimes.push(convertToSeconds(lastTime[0].innerText));
for (let i = 0; i < partTimes.length - 1; i++) {
partDurations.push(partTimes[i + 1] - partTimes[i]);
}
totalTime = convertToSeconds(lastTime[0].innerText);
}
function getAllHeights() {
partBlockHeights = [];
tlContainer = document.querySelector('#timeline_container');
let header = document.querySelector('header');
let footer = document.querySelector('footer');
tlContainer.style.height = `calc(100vh - ${header.offsetHeight}px - ${footer.offsetHeight}px - 60px)`;
tlContainer.style.top = `${header.offsetHeight + 30}px`;
tlContainerHeight = tlContainer.offsetHeight;
for (let partDuration of partDurations) {
partBlockHeights.push(partDuration / totalTime * tlContainerHeight);
}
}
function drawFriseRects() {
for (let i = 0; i < partBlockHeights.length; i++) {
let partDiv = document.createElement('div');
partDiv.classList.add('tlRectPart');
partDiv.style.height = partBlockHeights[i] + "px";
partDiv.style.backgroundColor = "#" + Object.values(colors[i])[0];
tlContainer.prepend(partDiv);
tlContainer.children[0].addEventListener("mouseenter", function() {
let el = tlContainer.children[tlContainer.children.length - 1 - i];
if (Array.from(el.parentNode.children).length - Array.from(el.parentNode.children).indexOf(el) - 1 != activePartIndex) {
el.style.width = "32px";
toggleTitleHover(i, 'show');
}
});
tlContainer.children[0].addEventListener("mouseleave", function() {
let el = tlContainer.children[tlContainer.children.length - 1 - i];
if (Array.from(el.parentNode.children).length - Array.from(el.parentNode.children).indexOf(el) - 1 != activePartIndex) {
el.style.width = "22px";
}
toggleTitleHover(i, 'hide');
});
tlContainer.children[0].addEventListener("click", function() {
isScrollingFromGrab = false;
titresFrise[i].el.scrollIntoView({ behavior: 'smooth', block: 'center' });
});
}
}
// detect if is scrolling
function isWindowScrolling() {
let currentScroll = window.scrollY;
if (currentScroll !== previousScroll) {
previousScroll = currentScroll;
return true;
} else {
return false;
}
}
// titres parties frise
function displayTimelineTitles() {
let mainWithoutSubAfter = [];
let mainWithSubAfter = [];
let subWithoutMainBefore = [];
let elements = Array.from(document.querySelectorAll('.isMainPart, .isSubPart'));
let lastMain = null;
for (let i = 0; i < elements.length; i++) {
let current = elements[i];
let next = elements[i + 1];
if (current.classList.contains('isMainPart')) {
lastMain = current;
if (next && next.classList.contains('isSubPart')) {
mainWithSubAfter.push({ index: i, main: current.innerText, sub: next.innerText, el: elements[i] });
} else {
mainWithoutSubAfter.push({ index: i, main: current.innerText, sub: "", el: elements[i] });
}
}
if (current.classList.contains('isSubPart')) {
let prevMain = lastMain && lastMain.classList.contains('isMainPart') ? lastMain.innerText : "";
subWithoutMainBefore.push({ index: i, main: prevMain, sub: current.innerText, el: elements[i] });
}
}
titresFrise = [...mainWithoutSubAfter, ...mainWithSubAfter, ...subWithoutMainBefore];
titresFrise.sort((a, b) => a.index - b.index);
for (let i = titresFrise.length - 1; i > 0; i--) {
let current = titresFrise[i];
let next = titresFrise[i - 1];
if (current.main === next.main && current.sub === next.sub) {
titresFrise.splice(i, 1);
}
}
let titreFriseEl = document.createElement('div');
titreFriseEl.setAttribute('id', 'titres_frise');
titreFriseEl.innerHTML = `
<p class="uppercase">${getCurrentTime(titresFrise[0].el)}</p>
<p>${titresFrise[0].main}</p>
<p class="font-authentic-60">${titresFrise[0].sub}</p>
`;
titreFriseEl.style.top = `${document.querySelector('#timeline_container').getBoundingClientRect().top}px`;
let main = document.querySelector('#main');
main.prepend(titreFriseEl);
titresCursor = document.querySelector('#titres_frise');
setTimeout(() => {
titreFriseEl.firstElementChild.innerText = getCurrentTime(titresFrise[0].el);
}, 10);
}
// création et togle des titres au survol des div de la timeline
function drawFixedTitles() {
let tlContainer = document.querySelector('#timeline_container');
let fixedTitlesContainer = document.createElement('div');
fixedTitlesContainer.setAttribute('id', 'fixedTitlesContainer');
main.prepend(fixedTitlesContainer);
for (let index = 0; index < titresFrise.length; index++) {
let titreFixedEl = document.createElement('div');
titreFixedEl.classList.add('tlFixedTitle');
titreFixedEl.style.top = `${tlContainer.children[index].getBoundingClientRect().top - 8}px`;
let titreFixedElContent = document.createElement('p');
titreFixedElContent.innerHTML = `
<p>${titresFrise[titresFrise.length - index - 1].main}</p>
<p class="font-authentic-60">${titresFrise[titresFrise.length - index - 1].sub}</p>
`;
titreFixedEl.append(titreFixedElContent);
fixedTitlesContainer.prepend(titreFixedEl);
}
}
function toggleTitleHover(elIndex, state) {
let fixedTitlesContainer = document.querySelector('#fixedTitlesContainer');
let el = fixedTitlesContainer.children[elIndex];
if (state === 'show') {
el.style.display = 'block';
setTimeout(() => {
el.style.opacity = '1';
}, 1);
} else if (state === 'hide') {
el.style.opacity = '0';
setTimeout(() => {
el.style.display = 'none';
}, 300);
}
}
// make the cursor move on scroll
function setupCursor() {
cursor.style.top = `${document.querySelector('#timeline_container').getBoundingClientRect().top}px`;
cursor.style.cursor = 'grab';
titresCursor.style.cursor = 'grab';
}
function setPartRects() {
partRects = document.querySelectorAll('#timeline_container div');
partRects = Array.from(partRects);
partRects = partRects.reverse();
partRects[0].style.width = '32px';
}
document.addEventListener("scroll", () => {
if (!grabbing) {
displayCurrentPartTitle(getCurrentPartFromScroll());
if (document.documentElement.scrollTop === 0) {
let firstTimeText = document.querySelector('tbody tr:nth-of-type(2) td:first-of-type');
titresCursor.firstElementChild.innerText = firstTimeText.innerText;
} else if (document.documentElement.scrollTop + window.innerHeight >= document.body.scrollHeight) {
let lastTimeText = document.querySelector('tbody tr:last-of-type td:first-of-type');
titresCursor.firstElementChild.innerText = lastTimeText.innerText;
}
moveCursorFromScroll(getCurrentPartFromScroll());
}
});
function makeElementDraggable(element, relatedEl) {
let offsetY;
element.addEventListener('mousedown', (e) => {
let elTransformY = element.style.transform ? +element.style.transform.split('(')[1].split('p')[0] : 0;
e.preventDefault();
grabbing = true;
offsetY = e.clientY - elTransformY;
element.style.cursor = 'grabbing';
});
document.addEventListener('mousemove', (e) => {
if (grabbing) {
const y = e.clientY - offsetY;
if (e.clientY < tlContainerHeight + tlContainer.offsetTop && e.clientY > tlContainer.offsetTop && y > 0) {
element.style.transform = `translateY(${y}px)`;
relatedEl.style.transform = `translateY(${y}px)`;
if (!isNaN(y)) displayCurrentPartTitle(getCurrentPartFromCursor(y));
} else if (e.clientY < tlContainer.offsetTop || y <= 0) {
element.style.transform = `translateY(0px)`;
relatedEl.style.transform = `translateY(0px)`;
setTimeout(() => {
let firstTimeText = document.querySelector('tbody tr:nth-of-type(2) td:first-of-type');
titresCursor.firstElementChild.innerText = firstTimeText.innerText;
}, 100);
} else if (e.clientY >= tlContainerHeight + tlContainer.offsetTop) {
element.style.transform = `translateY(${tlContainerHeight}px)`;
relatedEl.style.transform = `translateY(${tlContainerHeight}px)`;
let lastTimeText = document.querySelector('tbody tr:last-of-type td:first-of-type');
titresCursor.firstElementChild.innerText = lastTimeText.innerText;
}
}
});
document.addEventListener('mouseup', (e) => {
if (grabbing) {
scrollOnGrab(element);
let elTransformY = element.style.transform ? +element.style.transform.split('(')[1].split('p')[0] : 0;
offsetY = e.clientY - elTransformY;
const y = e.clientY - offsetY;
if (e.clientY < tlContainer.offsetTop || y <= 0) {
window.scrollTo(0, 0);
} else {
setTimeout(() => {
titresCursor.firstElementChild.innerText = getCurrentTime(titresFrise[getCurrentPartFromCursor(y)]?.el);
}, 1000);
}
}
element.style.cursor = 'grab';
grabbing = false;
});
}
// get heights of parts dans le tableau et dans la timeline
function getSteps() {
steps.tlElSteps = [];
steps.scrollSteps = [];
for (let i = 0; i < partRects.length; i++) {
// steps.tlElSteps.push(partRects[i].offsetTop);
steps.tlElSteps.push(partRects[i].getBoundingClientRect().top);
}
let titles = document.querySelectorAll('.isMainPart, .isSubPart');
for (let title of titles) {
let nextLine = title.nextElementSibling;
if (!nextLine?.classList.contains('isSubPart')) {
// steps.scrollSteps.push(title.offsetTop);
steps.scrollSteps.push(title.offsetTop);
}
}
}
function scrollOnGrab(el) {
let scrollValue;
if (getCursorPositionInTimelinePart(el).stepAfterMouseUp === steps.scrollSteps.length - 1) {
scrollValue =
((document.documentElement.scrollHeight - steps.scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp]) * getCursorPositionInTimelinePart(el).proportionInPart)
+ steps.scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp];
} else {
scrollValue =
((steps.scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp + 1] - steps.scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp]) * getCursorPositionInTimelinePart(el).proportionInPart)
+ steps.scrollSteps[getCursorPositionInTimelinePart(el).stepAfterMouseUp];
}
isScrollingFromGrab = true;
window.scrollTo({ top: scrollValue, behavior: 'smooth' });
setTimeout(() => {
isScrollingFromGrab = false;
}, 1000);
}
function getCursorPositionInTimelinePart(el) {
let elTransformY;
if (!el.style.transform) {
elTransformY = 0;
} else {
elTransformY = +el.style.transform.split('(')[1].split('p')[0];
}
let tlPartHeight, tlPartBottom, tlPartTop, proportionInPart, stepAfterMouseUp;
tlPartHeight = partRects[getCurrentPartFromCursor(elTransformY) || 0].getBoundingClientRect().height;
tlPartBottom = partRects[getCurrentPartFromCursor(elTransformY) || 0].getBoundingClientRect().bottom - tlContainer.getBoundingClientRect().top;
tlPartTop = steps.tlElSteps[getCurrentPartFromCursor(elTransformY) || 0] - steps.tlElSteps[0];
proportionInPart = 1 - ((tlPartHeight - (elTransformY - tlPartTop)) / tlPartHeight);
if (proportionInPart > 0 && proportionInPart < 1) {
stepAfterMouseUp = getCurrentPartFromCursor(elTransformY);
return {stepAfterMouseUp, proportionInPart};
} else {
stepAfterMouseUp = getCurrentPartFromCursor(elTransformY);
proportionInPart = 0;
return {stepAfterMouseUp, proportionInPart};
}
}
function moveCursorFromScroll(currentPartIndex) {
if (!isScrollingFromGrab) {
let currentScroll = window.scrollY;
let tlPartHeight = parseInt(partRects[currentPartIndex].style.height);
let cursorTopValue = partRects[currentPartIndex].getBoundingClientRect().top - parseInt(tlContainer.style.top);
let currentScrollPartTop = steps.scrollSteps[currentPartIndex] || 0;
let currentScrollPartHeight;
if (steps.scrollSteps[currentPartIndex + 1]) {
currentScrollPartHeight = steps.scrollSteps[currentPartIndex + 1] - currentScrollPartTop;
} else {
currentScrollPartHeight = document.querySelector('body').scrollHeight - currentScrollPartTop;
}
let currentScrollSincePartBottom = currentScroll - currentScrollPartTop;
let scrollPartProportion = currentScrollSincePartBottom / currentScrollPartHeight;
cursorTopValue = cursorTopValue + tlPartHeight * scrollPartProportion;
if (cursorTopValue > 0) {
cursor.style.transform = `translateY(${cursorTopValue}px)`;
titresCursor.style.transform = `translateY(${cursorTopValue}px)`;
} else {
cursor.style.transform = `translateY(0px)`;
titresCursor.style.transform = `translateY(0px)`;
}
}
}
function displayCurrentPartTitle(currentPartIndex) {
if (isNaN(currentPartIndex)) currentPartIndex = 0;
const currentTime = performance.now();
if (currentTime - lastCallTimestamp >= timestampDebounce) {
lastCallTimestamp = currentTime;
if (titresCursor) titresCursor.firstElementChild.innerText = getCurrentTime(titresFrise[currentPartIndex]?.el); // ICI POUR METTRE LE TEMPS BIEN
}
let mainEl = titresCursor.children[1];
let subEl = titresCursor.lastElementChild;
if (mainEl.innerText != titresFrise[currentPartIndex]?.main || subEl.innerText != titresFrise[currentPartIndex]?.sub) {
mainEl.innerText = titresFrise[currentPartIndex]?.main;
subEl.innerText = titresFrise[currentPartIndex]?.sub;
partRects[prevPartIndex].style.width = '22px';
partRects[currentPartIndex].style.width = '32px';
}
activePartIndex = currentPartIndex;
prevPartIndex = currentPartIndex;
}
function getCurrentPartFromScroll() {
let currentScroll = window.scrollY;
for (let i = 0; i < steps.scrollSteps.length; i++) {
if (
(currentScroll + window.innerHeight / 2 >= steps.scrollSteps[i]
&& currentScroll + window.innerHeight / 2 <= steps.scrollSteps[i + 1]) ||
(currentScroll + window.innerHeight / 2 >= steps.scrollSteps[i]
&& i === steps.scrollSteps.length - 1)
) {
return(i);
}
}
}
function getCurrentPartFromCursor(cursorTransformY) {
for (let i = 0; i < steps.tlElSteps.length; i++) {
if (cursorTransformY >= steps.tlElSteps[i] - steps.tlElSteps[0] && cursorTransformY < steps.tlElSteps[i + 1] - steps.tlElSteps[0]) {
return(i);
} else if (cursorTransformY > steps.tlElSteps[steps.tlElSteps.length - 1] - steps.tlElSteps[0]) {
return(steps.tlElSteps.length - 1);
}
}
}
function getCurrentTime(titleEl) {
let nextRow = titleEl?.nextElementSibling;
let allRowsUnder = [];
if (!grabbing) {
while(nextRow) {
if (nextRow.offsetTop - window.innerHeight / 4 > window.scrollY &&
nextRow.classList.contains('isContentPart')) {
return nextRow.firstElementChild.innerText;
}
allRowsUnder.push(nextRow.firstElementChild.innerText);
nextRow = nextRow.nextElementSibling;
}
return allRowsUnder[allRowsUnder.length-1];
} else {
let cursor = document.querySelector('#cursor');
if (nextRow.classList.contains('isSubPart')) nextRow = nextRow.nextElementSibling.nextElementSibling;
while(nextRow) {
if (nextRow.classList.contains('isMainPart') || nextRow.classList.contains('isSubPart')) {
break;
}
allRowsUnder.push(nextRow.firstElementChild.innerText);
nextRow = nextRow.nextElementSibling;
}
let currentRowIndex = Math.floor(allRowsUnder.length * getCursorPositionInTimelinePart(cursor).proportionInPart);
return allRowsUnder[currentRowIndex];
}
}
setPartTitlesInPartition();
setPartsColors();
getPartsTimes();
setTimeout(() => {
getAllHeights();
drawFriseRects();
displayTimelineTitles();
setupCursor();
drawFixedTitles();
setPartRects();
makeElementDraggable(cursor, titresCursor);
makeElementDraggable(titresCursor, cursor);
getSteps();
}, 100);
let resizeTimeout;
window.addEventListener('resize', () => {
tlContainer.innerHTML = '';
document.querySelector("#titres_frise")?.remove();
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(() => {
getAllHeights();
drawFriseRects();
displayTimelineTitles();
setupCursor();
setPartRects();
makeElementDraggable(titresCursor, cursor);
getSteps();
}, 100);
});
}
export { customTimeline };
+250
View File
@@ -0,0 +1,250 @@
@font-face {
font-family: "Authentic_Sans_60";
src: url("../assets/fonts/authentic-sans-90/AUTHENTICSans-60.woff") format("woff"),
url("../assets/fonts/authentic-sans-90/AUTHENTICSans-60.woff2") format("woff2"),
url("../assets/fonts/authentic-sans-90/AUTHENTICSans-60.otf") format("otf");
font-style: normal;
}
html {
background-color: #1e262e !important;
}
body.wp-admin, div:not(#tutorial_editor):not(.chart__bar-section.is-bar), .notice, table, th, td, tr, tr.active, tbody {
background-color: #26313b !important;
background: #26313b !important;
color: white !important;
font-family: "Authentic_Sans_60";
}
textarea {
color: #1e262e !important;
}
input[type="text"],
textarea {
border: solid 1px white !important;
color: white !important;
}
button span .components-menu-item__info,
button span .components-menu-item__item,
.components-menu-item__item,
.components-menu-item__shortcut,
.components-tab-panel__tabs-item {
color: white !important;
}
.components-tab-panel__tabs-item.is-active {
background-color: #1e262e !important;
}
#postcustomstuff input,
#postcustomstuff textarea,
#postcustomstuff select {
color: white !important;
background-color: #1e262e !important;
}
.wp-admin.toplevel_page_revisionary-q table,
.wp-admin.toplevel_page_revisionary-q table td,
.wp-admin.toplevel_page_revisionary-q table th,
.wp-admin.toplevel_page_revisionary-q table thead,
.wp-admin.toplevel_page_revisionary-q table tfoot,
.wp-admin #adminmenuwrap li,
.wp-admin #adminmenuwrap ul {
background: #1f2730 !important;
border: none;
}
.wp-admin #adminmenu li.current a {
background: #384756 !important;
}
.wp-admin .selected {
background-color: #384756 !important;
}
#wpadminbar .menupop {
background: #1e262e !important;
}
.wp-admin li,
.wp-admin ul {
background-color: #26313b !important;
}
.wp-admin .current::after {
border-right-color: #26313b !important;
}
.wp-admin table tbody tr,
.wp-admin #adminmenuback,
.wp-admin #adminmenuwrap,
.wp-admin #adminmenu,
#wpadminbar {
background-color: #1e262e !important;
}
.wp-admin th,
.wp-admin h1,
.wp-admin h2,
.wp-admin p,
.wp-admin label,
.wp-admin abbr,
.wp-admin td {
color: white !important;
}
.wp-admin a:not(#backToIndexButton a):not(#backToMyRevisionsButton a) {
color: #bbb !important;
}
.editor-styles-wrapper {
background-color: #26313b !important;
}
.edit-post-header {
background-color: #1e262e !important;
color: white !important;
}
.edit-post-header .components-button svg {
fill: white !important;
outline: white !important;
}
.edit-post-header button {
color: white !important;
outline-color: white !important;
background: none !important;
}
.interface-interface-skeleton__footer {
display: none !important;
}
.components-panel__header {
background-color: #26313b !important;
}
.components-panel__header ul li button {
color: white !important;
}
/* .components-panel__header ul li:last-of-type {
display: none;
} */
.interface-pinned-items button.has-icon {
display: none !important;
}
.wp-block-freeform,
h1.wp-block {
padding-left: 10px !important;
}
button#mceu_28-button i {
color: white !important;
}
.components-snackbar-list {
display: none !important;
}
.components-panel__header button.has-icon {
display: none !important;
}
.components-panel__header button svg {
fill: white !important;
outline: white !important;
}
.interface-interface-skeleton__sidebar {
background-color: #1e262e !important;
}
.components-panel__body-title:hover {
background-color: initial !important;
}
.components-panel__body-title button {
color: white !important;
}
.components-panel__body-title button svg {
fill: white !important;
outline: white !important;
}
.components-panel {
background-color: #1e262e !important;
color: white !important;
}
.components-panel > div:first-of-type {
display: block !important;
}
.user-admin-color-wrap {
display: none !important;
}
div.row-actions {
position: unset !important;
display: none !important;
}
#contextual-help-columns li,
#contextual-help-columns p {
color: #1e262e !important;
}
#bulk-revisions #bulk-action-selector-top > option[value="publish_revision"] {
display: none !important;
}
.highlight-cards-heading .highlight-cards-heading__settings-action svg {
fill: white !important;
}
.highlight-cards-heading,
.tooltip.popover.highlight-card-popover .popover__inner > button {
color: white !important;
}
.chart__bar-section.is-bar {
background: white !important;
background-color: white !important;
}
.chart__bar-section-inner {
background: green !important;
background-color: green !important;
}
.jetpack-connected header {
background-color: #26313b !important;
}
.jetpack-connected .stats-section-title,
.jetpack-connected .date {
color: white !important;
}
.jetpack-connected .components-button {
color: white !important;
}
.jetpack-connected .stats-date-control-picker .components-button {
color: #26313b !important;
}
.stats-navigation-arrows__previous svg,
.stats-navigation-arrows__next svg {
fill: white !important;
}
+243 -2
View File
@@ -28,7 +28,6 @@
url("/assets/fonts/authentic-sans-90/AUTHENTICSans-60.woff2") format("woff2"),
url("/assets/fonts/authentic-sans-90/AUTHENTICSans-60.otf") format("otf");
font-style: normal;
}
@font-face {
@@ -47,5 +46,247 @@
font-style: italic;
}
#wpadminbar {
display: none;
}
thead::after {
content: '';
display: block;
position: fixed;
width: 100px;
height: 91px;
background-color: #010d19;
top: 100px;
left: 83.3333vw;
z-index: 10;
}
.tlRectPart {
width: 22px;
border-bottom: solid 1px #010d19;
border-top: solid 1px #010d19;
transition: width 0.3s ease-out;
cursor: pointer;
}
.tlFixedTitle {
position: fixed;
z-index: 1;
display: none;
opacity: 0;
transition: opacity 0.3s ease-out;
width: 10vw;
left: 60px;
font-size: 0.9em;
line-height: 1.2;
}
.tlFixedTitle p {
background-color: #010d19;
}
#titres_frise {
font-size: 0.9em;
background-color: rgba(1, 13, 25, 0.6);
z-index: 20;
position: fixed;
left: 60px;
width: 10vw;
line-height: 1.2;
margin-top: -8px;
}
.isContentPart td:last-of-type {
position: absolute;
width: auto !important;
padding: 0;
right: 14vw;
height: auto;
display: flex;
align-items: center;
padding-bottom: 0.75rem;
}
.isContentPart td:last-of-type a {
font-size: 1.1rem;
opacity: 0.4;
transition: opacity 0.2s ease-in;
}
.isContentPart td:last-of-type a:hover {
opacity: 1 !important;
}
.isContentPart:hover td:last-of-type a {
opacity: 0.7;
}
em {
font-family: "Libre_Caslon";
font-style: italic;
}
.xoo-el-sidebar {
max-width: 50%;
background-color: #eee;
}
.xoo-el-sidebar p {
padding: 0px 30px;
margin-top: 10px;
margin-bottom: 10px;
color: #010d19;
}
.xoo-el-sidebar p:first-of-type {
margin-top: 20px;
}
.xoo-el-sidebar p:last-of-type {
margin-bottom: 20px;
}
#about_popup {
z-index: 15;
position: fixed;
top: 0;
left: 0;
display: none;
opacity: 0;
width: 100vw;
height: 100vh;
align-items: center;
justify-content: center;
transition: opacity 0.3s ease-out;
}
#about_popup #about_modale {
position: relative;
background-color: white;
color: #010d19;
width: 75vw;
max-width: 75vw;
max-height: 60vh;
overflow-y: scroll;
overflow-x: hidden;
}
#about_popup #about_modale span {
position: absolute;
top: 20px;
right: 5px;
color: #010d19;
font-size: 23px;
border-radius: 50%;
background-color: white;
border: 4px solid white;
cursor: pointer;
}
#about_popup #about_modale span:hover {
color: red;
}
#about_popup #about_modale #about_title {
color: #010d19;
background-color: white;
width: 100%;
height: 80px;
text-align: center;
font-family: 'Libre_Caslon';
padding-top: 25px;
text-transform: uppercase;
font-size: 1.3rem;
}
#about_popup #about_modale #about_content {
color: #010d19;
background-color: #eee;
padding: 40px 30px;
height: 100%;
}
#about_popup #about_modale #about_content p {
margin-bottom: 15px;
}
.highlight {
color: #010d19;
background-color: yellow;
}
input {
width: 100%;
}
#search_results {
display: none;
background-color: #26313b;
max-height: 0px;
height:auto;
opacity: 0;
transition: opacity 0.3s ease, max-height 0.3s ease;
}
#search_results img.disabled {
opacity: 0.4;
cursor: default;
}
#search_results > div:last-of-type {
padding: 15px;
border-top: solid 1px white;
}
#search_results > div:last-of-type p {
display: inline-block;
padding: 3px 9px;
margin: 5px 3px;
border: solid 1px white;
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.2);
cursor: pointer;
transition: background-color 0.2s ease;
}
#search_results > div:last-of-type p:hover {
background-color: rgba(255, 255, 255, 0.1);
}
.contributionWanted a {
opacity: 1 !important;
background-color: yellow;
border-radius: 8px;
color: #010d19;
padding: 3px 5px;
transform: translateX(8px);
}
.contributionWanted a:hover {
font-weight: bold;
}
.brand span {
transition: font-size 0.2s ease-in, line-height 0.2s ease-in;
}
.xoo-el-wrap .xoo-el-sidebar div,
.xoo-el-wrap .xoo-el-sidebar p,
.xoo-el-srcont .xoo-el-main div,
.xoo-el-srcont .xoo-el-main li,
.xoo-el-srcont .xoo-el-main input {
font-family: "Authentic_Sans_60" !important;
}
@media screen and (max-width: 1023px) {
.edit-button {
transform: translateX(70px);
}
thead::after {
left: auto;
right: 0 !important;
}
}
}
+82
View File
@@ -0,0 +1,82 @@
.edit-post-header > div:first-of-type,
.block-editor-block-toolbar,
.components-modal__screen-overlay,
.table-of-contents,
.table-of-contents__popover {
display: none !important;
}
/* .block-library-classic__toolbar
*/
#mceu_54-body > div:first-of-type,
#mceu_54-body > div:nth-of-type(2),
#mceu_54-body > div:nth-of-type(4),
#mceu_54-body > div:nth-of-type(5),
#mceu_54-body > div:nth-of-type(6),
#mceu_54-body > div:nth-of-type(7),
#mceu_54-body > div:nth-of-type(8),
#mceu_54-body > div:nth-of-type(9),
#mceu_54-body > div:nth-of-type(10),
#mceu_54-body > div:nth-of-type(11),
#mceu_54-body > div:nth-of-type(12),
#mceu_54-body > div:nth-of-type(13),
#mceu_54-body > div:nth-of-type(14) {
display: none !important;
}
.edit-post-header-toolbar__left > button:first-of-type,
.edit-post-header-toolbar__left > div:first-of-type,
.edit-post-header-toolbar__left > button:last-of-type {
display: none !important;
}
.edit-post-header__settings > button:first-of-type,
.edit-post-header__settings > div:first-of-type,
.edit-post-header__settings > div:last-of-type,
.edit-post-header__settings > button:last-of-type,
.block-editor-inserter,
.components-panel__header ul > li:last-of-type {
display: none !important;
}
.components-panel > div:not(:first-of-type):not(:last-of-type),
.edit-post-post-status > h2,
.edit-post-post-status > div:nth-of-type(3) {
display: none !important;
}
.edit-post-post-status > #backToIndexButton {
display: block !important;
}
.rvy-author-selection,
.rvy-submission-div > a:last-of-type,
.revision-created > a {
display: none !important;
}
#bulk-action-selector-top > option[value="submit_revision"],
#bulk-action-selector-top > option[value="approve_revision"],
#bulk-action-selector-top > option[value="decline_revision"],
#bulk-action-selector-top > option[value="publish_revision"] {
display: none !important;
}
.tablenav.bottom,
tfoot,
.search-box {
display: none !important;
}
.wpie-message {
display: none !important;
}
.block-editor-block-card {
display: none !important;
}
#toplevel_page_jetpack {
display: none !important;
}
+70 -31
View File
@@ -1,37 +1,47 @@
@extends('layouts.app')
@section('content')
<div id="about_popup">
<div id="about_modale">
<span class="xoo-el-icon-cancel-circle" aria-hidden="true" onclick="closeAboutPopup()"></span>
<div id="about_title">
À propos
</div>
<div id="about_content">
<?php echo apply_filters('the_content', get_post(9962)->post_content) ?>
</div>
</div>
</div>
<style>
tr {
border-bottom: 1px solid #000;
}
tbody tr:last-child {
border-bottom: none;
}
td {
padding-left: 10px; /* ou margin-left: 10px; */
}
</style>
<div id="content_search_tag" style="display: none;"><?php echo apply_filters('the_content', get_post(13943)->post_content) ?></div>
<div id="content_login_popup" style="display: none;"><?php echo apply_filters('the_content', get_post(9960)->post_content) ?></div>
<div id="content_privacy" style="display: none;"><?php echo apply_filters('the_content', get_post(3)->post_content) ?></div>
<table class="w-full bg-jlg-dark-blue flex justify-center">
<div class="fixed left-0 w-8 flex flex-col-reverse z-1" id="timeline_container"></div>
<svg class="fixed left-0 h-4 w-10 mt-[-4px] fill-jlg-white cursor-grab active:cursor-grabbing" id="cursor">
<polygon points="32,4 32,6 40,10 40,0" />
<rect width="32" height="2" y="4" />
</svg>
<table class="w-full bg-jlg-dark-blue flex justify-center mt-[70px] z-0 pl-10 lg:pl-[10px] pr-[96px] lg:pr-0">
<thead>
<tr class="border-jlg-white h-64 top-0 w-full lg:w-2/3 fixed flex items-stretch justify-around text-left lg:text-xl uppercase bg-jlg-dark-blue">
<tr class="border-jlg-white border-b h-64 top-0 w-full lg:w-2/3 fixed z-0 flex items-stretch justify-around text-left uppercase bg-jlg-dark-blue pr-[130px] lg:pr-0">
<th class="flex items-end justify-start"></th>
<th class="flex items-end justify-start pb-4">Images</th>
<th class="flex items-end justify-start pb-4">Voix Off et In</th>
<th class="flex items-end justify-start pb-4">Bande Son</th>
<th class="flex items-end justify-start pb-4">Écrits</th>
<th class="flex items-end justify-start"></th>
</tr>
</thead>
<tbody class="w-full lg:w-2/3 block bg-jlg-dark-blue">
<tbody class="w-full mb-48 lg:w-2/3 block bg-jlg-dark-blue">
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'meta_key' => 'Index',
'meta_key' => 'index',
'meta_type' => 'NUMERIC',
'orderby' => 'meta_value',
'order' => 'ASC'
@@ -40,27 +50,55 @@
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
$contenu = get_the_content();
if (get_post_meta(get_the_ID(), 'isMainPart', true)) { ?>
<tr class="border-jlg-white border-b font-authentic-90 uppercase w-full flex flex-row py-6 isMainPart">
<td class="pl-0 flex">
<div class="w-2 h-5 bg-jlg-white mr-3"></div>
<div>{{ get_post_meta(get_the_ID(), 'isMainPart', true) }}</div>
</td>
</tr>
<?php } elseif (get_post_meta(get_the_ID(), 'isSubPart', true)) { ?>
<tr class="border-jlg-white border-b font-authentic-90 w-full flex flex-row py-6 isSubPart">
<td class="pl-0 flex">
<div class="w-2 h-5 bg-jlg-white mr-3"></div>
<div>{{ get_post_meta(get_the_ID(), 'isSubPart', true) }}</div>
</td>
</tr>
<?php } else {
$contenu = wpautop(get_the_content());
$infosArray = explode("---", $contenu); // Divise le contenu en fonction des séparateurs
// Initialisez des variables pour stocker les informations
$images = isset($infosArray[0]) ? $infosArray[0] : '';
$voixOffIn = isset($infosArray[1]) ? $infosArray[1] : '';
$bandeson = isset($infosArray[2]) ? $infosArray[2] : '';
$ecrits = isset($infosArray[3]) ? $infosArray[3] : '';
$images = isset($infosArray[1]) ? $infosArray[1] : '';
$images = substr($images, 0, -21);
$voixOffIn = isset($infosArray[2]) ? $infosArray[2] : '';
$voixOffIn = substr($voixOffIn, 0, -16);
$bandeson = isset($infosArray[3]) ? $infosArray[3] : '';
$bandeson = substr($bandeson, 0, -14);
$ecrits = isset($infosArray[4]) ? $infosArray[4] : '';
//lien pour le crayon
$edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
$edit_link = site_url('/wp-admin/admin.php?page=rvy-revisions&post=' . get_the_ID() . '&action=revise');
?>
<tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
<td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
<td class="block pl-0 pr-6"><?php echo $images; ?></td>
<td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
<td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
<td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
<td class="block text-sm pl-0 pr-6"><?php if(is_user_logged_in()){ echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';} elseif (!is_user_logged_in()) { echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';}?></td>
</tr>
<?php
<tr class="border-jlg-light-white border-b font-authentic-60 w-full flex flex-row py-6 isContentPart">
<td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
<td class="block pl-0 pr-6"><?php echo $images; ?></td>
<td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
<td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
<td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
<td class="block text-sm pl-0 pr-6">
<?php if(is_user_logged_in()){
echo '<a title="Contribution" href="' . esc_url( $edit_link ) . '" class="edit-button">'; ?>
<img src="<?= get_template_directory_uri(); ?>/resources/assets/icons/pen_icon.svg" alt="icon pen" /></a>
<?php } elseif (!is_user_logged_in()) {
echo '<img src="' . get_template_directory_uri() . '/resources/assets/icons/pen_icon.svg" alt="icon pen" />';
echo do_shortcode('[xoo_el_action type="login" text="Connexion" redirect_to="' . $edit_link . '"]');
}?>
</td>
</tr>
<?php }
// endif;
endwhile;
endif;
@@ -70,6 +108,7 @@
</table>
@if (! have_posts())
<x-alert type="warning">
{!! __('Sorry, no results were found.', 'sage') !!}
+1 -1
View File
@@ -4,7 +4,7 @@
@include('sections.header')
<main id="main" class="main bg-jlg-dark-blue w-4/5 z-0 mt-96 mt-1/12">
<main id="main" class="main bg-jlg-dark-blue w-full z-0 mt-56">
@yield('content')
</main>
+61 -2
View File
@@ -1,3 +1,62 @@
<footer class="content-info">
@php(dynamic_sidebar('sidebar-footer'))
<footer class="fixed w-full h-[8vh] py-4 bottom-0 bg-jlg-dark-blue border-t border-jlg-light-white flex justify-between">
<!-- @php(dynamic_sidebar('sidebar-footer'))-->
<div class="text-sm">
<button class="px-4 py-2 rounded-md ml-6 underline underline-offset-8 hover:underline-offset-4 active:underline-offset-8" onclick="displayAboutPopup()" id="about_button">À PROPOS</button>
<button class="px-4 py-2 rounded-md ml-6 underline underline-offset-8 hover:underline-offset-4 active:underline-offset-8"><a href="mailto:<?php echo get_option('admin_email') ?>">CONTACT</a></button>
</div>
<div class="mr-6 flex items-center">
<a href="https://www.thalim.cnrs.fr/?lang=fr" target="_blank" class="w-12 mr-4">
<img class="w-full h-auto" alt="thalim" src="<?= get_template_directory_uri(); ?>/resources/assets/images/logos/thalim.png">
</a>
<a href="http://www.univ-paris3.fr/" target="_blank" class="w-24 mr-4">
<img class="w-full h-auto" alt="sorbonne" src="<?= get_template_directory_uri(); ?>/resources/assets/images/logos/sorbonne.png">
</a>
<a href="https://www.cnrs.fr/fr" target="_blank" class="w-12 mr-4">
<img class="w-full h-auto" alt="cnrs" src="<?= get_template_directory_uri(); ?>/resources/assets/images/logos/cnrs.png">
</a>
<a href="https://www.huma-num.fr/" target="_blank" class="w-12">
<img class="w-full h-auto" alt="humanum" src="<?= get_template_directory_uri(); ?>/resources/assets/images/logos/huma-num.png">
</a>
</div>
</footer>
<script>
// Define the event listener function
function closeAboutPopupHandler(event) {
event.preventDefault();
console.log(event.target);
if (
event.target != document.querySelector('#about_modale') &&
event.target != document.querySelector('#about_button') &&
event.target != document.querySelector('#about_title') &&
event.target != document.querySelector('#about_content') &&
event.target.parentElement != document.querySelector('#about_content') &&
(event.target.tagName != "EM" && event.target.parentElement.parentElement != document.querySelector('#about_content'))
) {
closeAboutPopup();
}
}
// Attach the event listener in the displayAboutPopup function
function displayAboutPopup() {
document.getElementById('about_popup').style.display = 'flex';
setTimeout(() => {
document.getElementById('about_popup').style.opacity = '1';
window.addEventListener('click', closeAboutPopupHandler);
}, 1);
document.body.style.overflow = 'hidden';
}
// Remove the event listener in the closeAboutPopup function
function closeAboutPopup() {
document.getElementById('about_popup').style.opacity = '0';
setTimeout(() => {
document.getElementById('about_popup').style.display = 'none';
}, 300);
document.body.style.overflowY = 'scroll';
// Remove the event listener
window.removeEventListener('click', closeAboutPopupHandler);
}
</script>
+43 -9
View File
@@ -1,22 +1,56 @@
<header class="border-b border-jlg-light-white py-4 h-1/12 shadow-xlg fixed top-0 w-full bg-jlg-dark-blue flex flex-row justify-between items-center z-10">
<div class="text-sm">
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors xoo-el-login-tgr">MES CONTRIBUTIONS</button>
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors">EXPORT</button>
<div class="flex flex-col">
<div class="text-sm mt-[-10px] mb-[15px] pl-5 text-center">
<?php if (is_user_logged_in()) {
$current_user = wp_get_current_user();
$logout_url = wp_logout_url();
echo "Connecté en tant que " . $current_user->display_name . " | <span class='underline decoration-dotted'><a href='" . esc_url($logout_url) . "'>Se déconnecter</a></span>";
} ?>
</div>
<div class="text-sm flex flex-row flex-nowrap">
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors whitespace-nowrap">
<?php
$current_user = wp_get_current_user();
$author_id = $current_user->ID;
$revisionary_page = admin_url('admin.php?page=revisionary-q&author=' . $author_id);
echo do_shortcode('[xoo_el_action type="login" change_to="' . $revisionary_page . '" change_to_text="MES CONTRIBUTIONS" text="CONTRIBUER" redirect_to="' . $revisionary_page . '"]');
?>
</button>
<button class="bg-jlg-xlight-white hover:bg-jlg-hxlight-white active:bg-jlg-axlight-white px-4 py-2 rounded-full border-jlg-hxlight-white border ml-6 transition-colors"><a href="<?php echo esc_url(home_url('/?format=csv')); ?>">EXPORT</a></button>
</div>
</div>
<a class="brand text-center text-2xl leading-none" href="{{ home_url('/') }}">
<a class="brand text-center leading-7 whitespace-nowrap" href="{{ home_url('/') }}">
<!-- {!! $siteName !!} -->
<span class="font-caslon uppercase">Partition<br></span>
<span class="font-caslon italic">Le Livre d'Image</span>
<span class="font-caslon uppercase text-2xl">Partition<br></span>
<span class="font-caslon italic text-3xl">Le Livre d'image<br></span>
<span class="font-caslon text-xl pr-1">de </span><span class="font-caslon text-2xl">Jean-Luc Godard</span>
</a>
<div class="mr-6">
<div class="mr-6 w-52">
<input type="search" class="px-4 py-2 rounded bg-jlg-xlight-white text-sm" placeholder="RECHERCHER">
</div>
<div class="z-30 right-6 absolute w-52 max-h-52 border-jlg-light-white border rounded" id="search_results">
<div class="flex flex-row p-3 justify-around items-center h-full text-sm">
<p><span id="result_amount">0</span> occurences</p>
<p class="hidden">Aucune occurence</p>
<div class="flex flex-row">
<img src="<?= get_template_directory_uri(); ?>/resources/assets/icons/arrow_drop_down.svg" alt="arrow down" class="cursor-pointer">
<img src="<?= get_template_directory_uri(); ?>/resources/assets/icons/arrow_drop_up.svg" alt="arrow up" class="cursor-pointer">
</div>
</div>
<div class="text-sm w-full">
</div>
</div>
@if (has_nav_menu('primary_navigation'))
<nav class="nav-primary" aria-label="{{ wp_get_nav_menu_name('primary_navigation') }}">
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
<nav class="nav-primary" aria-label="{{ wp_get_nav_menu_name('primary_navigation') }}">
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'nav', 'echo' => false]) !!}
</nav>
@endif
</header>
+2 -1
View File
@@ -24,7 +24,8 @@ const config = {
base: '15px',
lg: '18px',
xl: '21px',
'2xl': '35px'
'2xl': '25px',
'3xl': '35px',
}
},
},
+2 -2
View File
@@ -1361,12 +1361,12 @@
{
"name": "2xl",
"slug": "2xl",
"size": "35px"
"size": "25px"
},
{
"name": "3xl",
"slug": "3xl",
"size": "1.875rem"
"size": "35px"
},
{
"name": "4xl",
+1095 -1041
View File
File diff suppressed because it is too large Load Diff