From 5b3c71fbbe45ab59bb475137cca6dfbc41a5c63c Mon Sep 17 00:00:00 2001 From: dragos-efy Date: Mon, 14 Aug 2023 23:12:54 +0300 Subject: [PATCH] EFY: Latest version Update It's still the old version of Piped, but the new one will come up soon. Now you have: - 1-12 main colors - more efficiency and quicker translations - notification control (position and type) - support for transparent windows and video wallpapers (but those won't save yet on page reload) - bigger ranges for visual filters - bug fixes and more --- public/efy | 2 +- src/piped.css | 2 ++ src/piped.js | 36 ++++++++++++++++++++---------------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/public/efy b/public/efy index f5e81556..7d9f9005 160000 --- a/public/efy +++ b/public/efy @@ -1 +1 @@ -Subproject commit f5e81556e52115ec5367f064dd682fbc898f5e01 +Subproject commit 7d9f90051ebe37001ccea87047c60ad2d5c78a40 diff --git a/src/piped.css b/src/piped.css index 460ac6cb..b24f3ea2 100644 --- a/src/piped.css +++ b/src/piped.css @@ -11,7 +11,9 @@ --efy_font_family: 'nunito', sans-serif,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji; --efy_audio_folder: ./efy/audio; --efy_folder: ./efy; + --efy_lang_code: en; --efy_modules: efy_quick, efy_mode, efy_filters, efy_backup, efy_accessibility, efy_audio, efy_language, efy_extra; + --efy_protocol: http; } /*Default Mode*/ [efy_mode=default] { --efy_scheme: dark; diff --git a/src/piped.js b/src/piped.js index aab000ea..9feb85d9 100644 --- a/src/piped.js +++ b/src/piped.js @@ -1,30 +1,34 @@ -import {$, $all, $ready_once, $insert, $add, $append} from '../public/efy/efy.js'; +import {$, $all, $add, $event, $ready} from '../public/efy/efy.js'; -$ready_once('#efy_sidebar').then(()=>{ - $insert($('#efy_sidebar'), 'afterbegin', $add('div', { id: 'piped_efy_module' })); +$ready('#efy_sidebar', ()=>{ + $add('div', {id: 'piped_efy_module'}, [], $('#efy_sidebar'), 'afterbegin'); - /*Custom Menu*/ $append($('#efy_modules'), $add('div', {id: 'custom_sidebar_menu'})); - for (let a = ['preferences', 'history', 'playlists', 'feed'], b = ['Preferences', 'History', 'Playlists', 'Feed'], c = $('#custom_sidebar_menu'), i = 0; i < a.length; i++){ $append(c, $add('a', {href: `./${a[i]}`}, [b[i]]))} + /*Custom Menu*/ $add('div', {id: 'custom_sidebar_menu'}, [], $('#efy_modules')); + for (let a = ['preferences', 'history', 'playlists', 'feed'], b = ['Preferences', 'History', 'Playlists', 'Feed'], c = $('#custom_sidebar_menu'), i = 0; i < a.length; i++){ $add('a', {href: `./${a[i]}`}, [b[i]], c)} - /*Custom Settings*/ $append($('#efy_modules'), $add('details', {id: 'piped_style'}, [ - $add('summary', {}, [$add('i', {efy_icon: 'dots'}), 'Piped Style']), $add('div', {efy_tabs: 'piped_style'})]), - ); - $insert($('#piped_style > summary'), 'beforeend', $add('mark', {efy_lang: 'alpha'})); + /*Custom Settings*/ $add('details', {id: 'piped_style'}, [ + $add('summary', {}, [ $add('i', {efy_icon: 'dots'}), 'Piped Style']), + $add('div', {efy_tabs: 'piped_style'}) + ], $('#efy_modules')); + + $add('mark', {efy_lang: 'alpha'}, [], $('#piped_style > summary'), 'beforeend'); /*Tabs*/ for (let a = ['option1', 'option2', 'option3'], b = ['Tab 1', 'Tab 2', 'Tab 3'], c = $('[efy_tabs=piped_style]'), i = 0; i < a.length; i++) { - $append(c, $add('button', {efy_tab: a[i]}, [b[i]])); + $add('button', {efy_tab: a[i]}, [b[i]], c); } for (let a = ['option1', 'option2', 'option3'], c = $('[efy_tabs=piped_style]'), i = 0; i < a.length; i++) { - $append(c, $add('div', {efy_content: a[i], efy_select: '', id: `efy_${a[i]}`})) + $add('div', {efy_content: a[i], efy_select: '', id: `efy_${a[i]}`}, [], c) + } + /*Active*/ for (let a = ['[efy_tab=option1]', '[efy_content=option1]'], b = '[efy_tabs=piped_style] > ', i = 0; i < a.length; i++){ + $(b + a[i]).setAttribute('efy_active', '') } - /*Active*/ for (let a = ['[efy_tab=option1]', '[efy_content=option1]'], b = '[efy_tabs=piped_style] > ', i = 0; i < a.length; i++){$(b + a[i]).setAttribute('efy_active', '')} /*Tab1*/ for (let a = 'comments_full captions-trans captions-solid'.split(' '), b = ['Comments - Full Width', 'Captions - No Background', 'Captions - Black Background'], c = $('[efy_tabs=piped_style] [efy_content=option1]'), i = 0; i < a.length; i++) { - $append(c, $add('input', {type: 'checkbox', name: 'piped_style_option1', id: `piped_style_${a[i]}`})); - $append(c, $add('label', {for: `piped_style_${a[i]}`}, [b[i]])); + $add('input', {type: 'checkbox', name: 'piped_style_option1', id: `piped_style_${a[i]}`}, [], c); + $add('label', {for: `piped_style_${a[i]}`}, [b[i]], c); } /*Comments & Captions*/ for (let a = ['comments_full', 'captions-trans', 'captions-solid'], b = ['.pp-comments', '.shaka-text-container', '.shaka-text-container'], c = ['pp-full-width', 'pp-trans', 'pp-solid'], i = 0; i < a.length; i++) { - $(`#piped_style_${a[i]}`).addEventListener('click', ()=>{ + $event($(`#piped_style_${a[i]}`), 'click', ()=>{ $all(b[i]).forEach( (e)=>{ e.classList.toggle(c[i]) }) }) } -}); +}, 1); \ No newline at end of file