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 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 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..0370a5f 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); @@ -50,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/README.txt b/src/README.txt index 930d108..ae1db03 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 @@ -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/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/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.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 ) { diff --git a/src/functions/breadcrumb.php b/src/functions/breadcrumb.php index 43ab0d8..9e9f40e 100644 --- a/src/functions/breadcrumb.php +++ b/src/functions/breadcrumb.php @@ -1,26 +1,22 @@ '; // 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; $homeLink = esc_url( home_url() ); if (is_home() || is_front_page()) { - if ($showOnHome == 1) echo ''; - } else { - echo ''; - } } // end tainacan_interface_the_breadcrumb() diff --git a/src/functions/class-tainacanthemecollectioncolor.php b/src/functions/class-tainacanthemecollectioncolor.php index 6f115ce..4518a1a 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/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) diff --git a/src/functions/enqueues.php b/src/functions/enqueues.php index d59ca16..724091c 100644 --- a/src/functions/enqueues.php +++ b/src/functions/enqueues.php @@ -5,7 +5,7 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) { /** - * Inclui os scripts javascript e os styles necessários ao front-end do thema + * Inclui os scripts javascript e os styles necessários ao front-end do tema */ function tainacan_enqueues() { /** @@ -65,7 +65,6 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) { 'linkCopied' => __( 'Copied! Link sent to the transfer area.', 'tainacan-interface' ) )); - // Tainacan Icons wp_register_style( 'TainacanIconsFont', get_template_directory_uri() . '/assets/fonts/tainacan-icons-font/css/tainacanicons.min.css', '', '1.0.3', '' ); wp_enqueue_style( 'TainacanIconsFont' ); @@ -77,6 +76,6 @@ if ( ! function_exists( 'tainacan_enqueues' ) ) { wp_enqueue_script( 'comment-reply' ); } - } -} // End if(). + } // tainacan_enqueues +} add_action( 'wp_enqueue_scripts', 'tainacan_enqueues' ); 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 @@ '; - 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 ''; } ?>