From 22f7bd801f458fd3a7b2116dba0740d359e31ffa Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Mon, 22 Mar 2021 00:12:18 -0300 Subject: [PATCH 1/9] Adds watch for mac os --- build-watch.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/build-watch.sh b/build-watch.sh index 4977df4..b5b6715 100755 --- a/build-watch.sh +++ b/build-watch.sh @@ -1,11 +1,16 @@ #!/bin/sh ## Run the build script whenever there is a change in src folder - echo 'Watching changes on src/' +current_OS=`uname` -while inotifywait -qqr src -e create,move,modify,delete; do - echo - echo 'Change detected, running build' - ./build.sh -done \ No newline at end of file +# For macOS (Darwin), you can install fsevents-tools via Homebrew: `brew install fsevents-tools` +if [ $current_OS == "Darwin" ]; then + notifyloop src ./build.sh +else + while inotifywait -qqr src -e create,move,modify,delete; do + echo + echo 'Change detected, running build' + ./build.sh + done +fi \ No newline at end of file From d0b425f31046888877cb15b144dd8a69a4605569 Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Mon, 22 Mar 2021 01:04:22 -0300 Subject: [PATCH 2/9] Tiny lints and doc refactors --- src/functions.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/functions.php b/src/functions.php index 0889778..0a0d285 100644 --- a/src/functions.php +++ b/src/functions.php @@ -9,9 +9,9 @@ const TAINACAN_INTERFACE_VERSION = '2.2.1'; if ( ! function_exists( 'tainacan_setup' ) ) { /** - * Execulta após o tema ser inicializado. + * Executa após o tema ser inicializado. * Isso é usado para a configuração básica do tema, registro dos recursos do tema e init hooks. - * Observe que esta função está conectada ao gancho after_setup_theme, que é executado antes do gancho de init. + * Observe que esta função está conectada ao gancho (`hook`) `after_setup_theme`, que é executado antes do gancho de init. */ function tainacan_setup() { @@ -154,7 +154,7 @@ if ( ! function_exists( 'tainacan_setup' ) ) { add_editor_style( 'editor-style.css' ); } -} // End if(). +} // tainacan_setup check add_action( 'after_setup_theme', 'tainacan_setup' ); /** @@ -404,9 +404,9 @@ function tainacan_block_patterns_init() { add_action( 'init', 'tainacan_block_patterns_init' ); /** - * get Logo function + * get Tainacan's logo function HTML * - * return custom logo or the default logo + * return custom or default Tainacan's logo */ function tainacan_get_logo() { if ( has_custom_logo() ) { @@ -426,7 +426,6 @@ function tainacan_get_logo() { * @return void */ function tainacan_change_logo_class( $html ) { - $html = str_replace( 'custom-logo-link', 'navbar-brand tainacan-logo', $html ); $html = str_replace( 'custom-logo', 'logo', $html ); @@ -475,7 +474,6 @@ function tainacan_collections_viewmode( $public_query_vars ) { add_filter( 'query_vars', 'tainacan_collections_viewmode' ); function tainacan_active( $selected, $current = true, $echo = true ) { - $return = $selected == $current ? 'active' : ''; if ( $echo ) { @@ -483,7 +481,6 @@ function tainacan_active( $selected, $current = true, $echo = true ) { } return $return; - } function tainacan_theme_collection_title( $title ) { From a3fca55397472fcb0cde3e2d815419b9c7371413 Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Mon, 19 Apr 2021 10:45:29 -0300 Subject: [PATCH 3/9] Updates README --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5506bcd..80aa326 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,16 @@ # tainacan-theme Default Tainacan Theme, to be used with tainacan plugin - # Instalação no WordPress - Copiar o arquivo `build-config-sample.cfg` para `build-config.cfg` - Ajustar o `PATH` da variável `destination` para o caminho desejado correspondente - Instalar o SASS - - sudo apt install ruby-full rubygems autogen autoconf libtool make - - sudo gem install sass + - `sudo apt install ruby-full rubygems autogen autoconf libtool make` + - `sudo gem install sass` - Instalar o Composer - - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - - HASH="$(wget -q -O - https://composer.github.io/installer.sig)" - - php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" - - sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer + - `php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"` + - `HASH="$(wget -q -O - https://composer.github.io/installer.sig)"` + - `php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"` + - `sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer` - Execute o build - - ./build.sh - - #Teste Commit + - ./build.sh \ No newline at end of file From 156c3014bc8853ff01faffa84f75e5cfc5141454 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Mon, 19 Apr 2021 11:36:17 -0300 Subject: [PATCH 4/9] Update README.txt --- src/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/README.txt b/src/README.txt index 930d108..3ce84db 100644 --- a/src/README.txt +++ b/src/README.txt @@ -1,5 +1,5 @@ === Tainacan Interface === -Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila +Contributors: andrebenedito, daltonmartins, fabianobn, jacsonp, leogermani, weryques, wetah, eduardohumberto, ravipassos, jessicafpx, marinagiolo, omarceloavila, r-guimaraes Requires at least: WordPress 4.8 Tested up to: WordPress 5.5.3 Version: 2.2.1 From b5dbdd58acf2dad46590c905fc5c372af8f7e1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Guimar=C3=A3es?= Date: Mon, 19 Apr 2021 15:47:24 -0300 Subject: [PATCH 5/9] Improves messages translation --- compile-sass.sh | 8 ++++---- install.sh | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/compile-sass.sh b/compile-sass.sh index 6739715..2ee9bf1 100755 --- a/compile-sass.sh +++ b/compile-sass.sh @@ -19,19 +19,19 @@ echo "Compiling Sass..." #cd ../../../../assets/scss cd src/assets/scss sass -E 'UTF-8' style.scss:../../style.css -echo "Style of Tainacan Compiled"; +echo "Tainacan's style compiled."; sass -E 'UTF-8' editor-style.scss:../../editor-style.css -echo "Style of Tainacan for Gutenberg Editor Compiled"; +echo "Tainacan's Gutenberg Editor style compiled"; sass bootstrap_custom.scss:../vendor/bootstrap/scss/bootstrap.min.css --style compressed -echo "Bootstrap Compiled"; +echo "Bootstrap style compiled"; rm -rf .sass-cache cd ../vendor/slick sass slick.scss:slick.min.css --style compressed sass slick-theme.scss:slick-theme.min.css --style compressed -echo "Slick for slider carousel Compiled"; +echo "Slick for slider carousel compiled"; rm -rf slick-theme.min.css.map slick.min.css.map .sass-cache/ cd ../../../ diff --git a/install.sh b/install.sh index 66612c2..b80e2fc 100644 --- a/install.sh +++ b/install.sh @@ -3,10 +3,9 @@ php -r ' echo "\n ..::Tainacan Theme::..\n"; echo "\nInitiating the installation with composer ... please wait!!\n"; +echo "\Copying files ...\n"; -echo "\nInitiating the copying of files...\n\n"; - -echo "\nCopy Frameword CSS - Bootstrap ...\n\n"; +echo "\nCopying Bootstrap Framework ...\n\n"; if (!file_exists("src/assets/vendor/bootstrap")) { mkdir("src/assets/vendor/", 0777, true); @@ -18,7 +17,7 @@ echo "\nCopy Frameword CSS - Bootstrap ...\n\n"; copy("vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js", "src/assets/vendor/bootstrap/js/bootstrap.min.js"); recurse_copy("vendor/twbs/bootstrap/js/src", "src/assets/vendor/bootstrap/js/src"); -echo "Copy Slick for Slider...\n\n"; +echo "Copying Slick Slider...\n\n"; if (!file_exists("src/assets/vendor/slick")) { mkdir("src/assets/vendor/slick/", 0777, true); mkdir("src/assets/vendor/slick/css", 0777, true); @@ -27,7 +26,7 @@ echo "Copy Slick for Slider...\n\n"; } recurse_copy("vendor/fabianobn/slick/slick/", "src/assets/vendor/slick/"); -echo "Finish Copy files! \n\n"; +echo "Finished copying files! \n\n"; function recurse_copy($src,$dst) { $dir = opendir($src); From 1e4107b4f00a108c914dae46a06d7391fc673dc5 Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Mon, 19 Apr 2021 21:26:59 -0300 Subject: [PATCH 6/9] adds extra spacing to item page`s breadcrumb --- src/functions/breadcrumb.php | 6 ++---- src/template-parts/single-items-header.php | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/functions/breadcrumb.php b/src/functions/breadcrumb.php index 43ab0d8..f2ee13c 100644 --- a/src/functions/breadcrumb.php +++ b/src/functions/breadcrumb.php @@ -1,15 +1,14 @@ '; // delimiter between crumbs $home = __('Home', 'tainacan-interface'); // text for the 'Home' link $showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show - $before = ''; // tag before the current crumb + $before = ' '; // tag before the current crumb $after = ''; // tag after the current crumb global $post; @@ -165,6 +164,5 @@ function tainacan_interface_the_breadcrumb() { } echo ''; - } } // end tainacan_interface_the_breadcrumb() diff --git a/src/template-parts/single-items-header.php b/src/template-parts/single-items-header.php index 736e84b..3a0b6dd 100644 --- a/src/template-parts/single-items-header.php +++ b/src/template-parts/single-items-header.php @@ -178,12 +178,12 @@ $next = $adjacent_links['next']; '; - tainacan_meta_date_author(); - echo ''; + tainacan_meta_date_author(); + echo '  '; } if ( function_exists('tainacan_the_item_edit_link') ) { echo ''; - tainacan_the_item_edit_link(null, ' - '); + tainacan_the_item_edit_link(null, ' - ', ' '); echo ''; } ?> From 21bcf67db48489a21d9cd9e016637127c97001bd Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Mon, 19 Apr 2021 23:07:12 -0300 Subject: [PATCH 7/9] fixes typos and tiny lints --- src/README.txt | 2 +- src/assets/scss/style.scss | 3 +-- src/functions/class-tainacanthemecollectioncolor.php | 8 -------- src/tainacan/header-collection.php | 2 +- src/tainacan/header-taxonomy.php | 2 +- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/README.txt b/src/README.txt index 3ce84db..ae1db03 100644 --- a/src/README.txt +++ b/src/README.txt @@ -17,7 +17,7 @@ For more information about Tainacan and Tainacan Interface please go to http://t == Copyright == -Tainacan Interface WordPress Theme, Copyright 2020 Tainacan.org +Tainacan Interface WordPress Theme, Copyright 2021 Tainacan.org Tainacan Interface is distributed under the terms of the GNU GPL This program is free software: you can redistribute it and/or modify diff --git a/src/assets/scss/style.scss b/src/assets/scss/style.scss index 000b350..a011222 100644 --- a/src/assets/scss/style.scss +++ b/src/assets/scss/style.scss @@ -3,7 +3,7 @@ Theme Name: Tainacan Interface Author: Tainacan Author URI: https://tainacan.org Theme URI: https://tainacan.org/blog/category/tema/ -Description: This is the default theme for the Tainacan project. Use this in conjunction with Tainacan plugin to easily manage and publish you digital collectinons with a beautiful faceted search interface. Ideal for museums, galleries, libraries and anyone who have a digital repository. +Description: This is the default theme for the Tainacan project. Use this in conjunction with Tainacan plugin to easily manage and publish you digital collections with a beautiful faceted search interface. Ideal for museums, galleries, libraries and anyone who have a digital repository. Version: 2.2.1 Tested up to: 5.5.3 Requires PHP: 5.6 @@ -156,7 +156,6 @@ body.loading-content main:before { background: #4ea2ad; width: 36px; height: 36px; - display: block; text-decoration: none; -webkit-border-radius: 35px; -moz-border-radius: 35px; diff --git a/src/functions/class-tainacanthemecollectioncolor.php b/src/functions/class-tainacanthemecollectioncolor.php index 6f115ce..f86107b 100644 --- a/src/functions/class-tainacanthemecollectioncolor.php +++ b/src/functions/class-tainacanthemecollectioncolor.php @@ -3,8 +3,6 @@ * Class that hooks in the tainacan plugin (if present) to add new options to Collections */ class TainacanThemeCollectionColor { - - public $tainacan_background_color = 'tainacan_theme_collection_background_color'; public $tainacan_text_color = 'tainacan_theme_collection_color'; @@ -40,7 +38,6 @@ class TainacanThemeCollectionColor { } function form() { - if ( ! function_exists( 'tainacan_get_api_postdata' ) ) { return ''; } @@ -114,9 +111,7 @@ class TainacanThemeCollectionColor { get_id(), $this->tainacan_text_color, $post->{$this->tainacan_text_color} ); } } - } - } new TainacanThemeCollectionColor(); -?> diff --git a/src/tainacan/header-collection.php b/src/tainacan/header-collection.php index fc243e7..3583303 100644 --- a/src/tainacan/header-collection.php +++ b/src/tainacan/header-collection.php @@ -3,7 +3,7 @@ Date: Tue, 20 Apr 2021 16:15:15 -0300 Subject: [PATCH 8/9] Warns user whether Tainacan plugin is not activated --- src/functions/customizer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/functions/customizer.php b/src/functions/customizer.php index 738e4ab..d785620 100644 --- a/src/functions/customizer.php +++ b/src/functions/customizer.php @@ -2435,6 +2435,10 @@ add_action( 'wp_head', 'tainacan_single_item_metadata_columns_count_output'); * @see wp_add_inline_style() */ function tainacan_items_page_filters_fixed_on_scroll_output() { + if (!defined('TAINACAN_VERSION')) { + _e('Tainacan plugin not activated!', 'tainacan-interface'); + return; + } $should_use_fixed_filters_logic = (version_compare(TAINACAN_VERSION, '0.17RC') >= 0) && get_theme_mod( 'tainacan_items_page_filters_fixed_on_scroll', false ); if (!$should_use_fixed_filters_logic) From 50c0d34498dc0b19c5679313957f61986b44a876 Mon Sep 17 00:00:00 2001 From: Rodrigo de Oliveira Date: Tue, 20 Apr 2021 16:46:36 -0300 Subject: [PATCH 9/9] Tiny refactors --- install.sh | 6 +++--- src/archive-tainacan-collection.php | 12 +++++++----- src/assets/js/copy-link.js | 1 - src/assets/js/js.js | 1 - src/functions/breadcrumb.php | 3 --- src/functions/class-tainacanthemecollectioncolor.php | 1 - src/functions/enqueues.php | 7 +++---- 7 files changed, 13 insertions(+), 18 deletions(-) diff --git a/install.sh b/install.sh index b80e2fc..0370a5f 100644 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ php -r ' echo "\n ..::Tainacan Theme::..\n"; echo "\nInitiating the installation with composer ... please wait!!\n"; -echo "\Copying files ...\n"; +echo "Copying files ...\n"; echo "\nCopying Bootstrap Framework ...\n\n"; @@ -49,12 +49,12 @@ function delete_files($target) { $files = glob( $target . "*", GLOB_MARK ); //GLOB_MARK adds a slash to directories returned foreach( $files as $file ){ - delete_files( $file ); + delete_files( $file ); } rmdir( $target ); } elseif(is_file($target)) { - unlink( $target ); + unlink( $target ); } } ' \ No newline at end of file diff --git a/src/archive-tainacan-collection.php b/src/archive-tainacan-collection.php index 3893a16..e37964f 100644 --- a/src/archive-tainacan-collection.php +++ b/src/archive-tainacan-collection.php @@ -1,5 +1,7 @@ + + @@ -41,16 +43,16 @@ - + diff --git a/src/assets/js/copy-link.js b/src/assets/js/copy-link.js index a372eb7..46040c5 100644 --- a/src/assets/js/copy-link.js +++ b/src/assets/js/copy-link.js @@ -22,7 +22,6 @@ function fallbackCopyTextToClipboard(text) { } function copyTextToClipboard(text) { - if (!navigator.clipboard) { fallbackCopyTextToClipboard(text); return; diff --git a/src/assets/js/js.js b/src/assets/js/js.js index 083a744..c958eac 100644 --- a/src/assets/js/js.js +++ b/src/assets/js/js.js @@ -3,7 +3,6 @@ jQuery( document ).ready(function( $ ) { $( 'body' ).removeClass('loading-content'); $( '#carouselExample' ).on( 'slide.bs.carousel', function ( e ) { - var $e = $( e.relatedTarget ); var idx = $e.index(); var itemsPerSlide = 3; diff --git a/src/functions/breadcrumb.php b/src/functions/breadcrumb.php index f2ee13c..9e9f40e 100644 --- a/src/functions/breadcrumb.php +++ b/src/functions/breadcrumb.php @@ -15,11 +15,8 @@ function tainacan_interface_the_breadcrumb() { $homeLink = esc_url( home_url() ); if (is_home() || is_front_page()) { - if ($showOnHome == 1) echo ''; - } else { - echo '