From d1c05b5355572b25aaca3b45c572dccfbcd5bb87 Mon Sep 17 00:00:00 2001 From: Alexandre Germain Date: Sun, 20 Aug 2017 11:28:25 +0200 Subject: [PATCH] Fixed exception on NULL for get_permalink_light --- .gitignore | 1 + class/class-filters.php | 1 + class/shortcode/class-glossary.php | 46 ++-- class/shortcode/class-termlist.php | 244 ++++++++--------- css/ithoughts_tt_gl.min.css | 2 +- less/ithoughts_tt_gl.less | 418 +++++++++++++++-------------- 6 files changed, 368 insertions(+), 344 deletions(-) diff --git a/.gitignore b/.gitignore index dad2794..bb400fe 100755 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ package-lock.json .DS_Store ithoughts_tt_gl.log grunt_localconfig.json +less/*.css \ No newline at end of file diff --git a/class/class-filters.php b/class/class-filters.php index 9c96d8c..f611d70 100755 --- a/class/class-filters.php +++ b/class/class-filters.php @@ -47,6 +47,7 @@ public function getTermExcerpt( \WP_Post $term ) { } else { $content = wp_trim_words( $term->post_content, 25, '...' ); } + $content = strip_shortcodes($content); return $content; } diff --git a/class/shortcode/class-glossary.php b/class/shortcode/class-glossary.php index 71894fc..8d5937f 100755 --- a/class/shortcode/class-glossary.php +++ b/class/shortcode/class-glossary.php @@ -20,7 +20,7 @@ namespace ithoughts\tooltip_glossary\shortcode; if ( ! defined( 'ABSPATH' ) ) { - status_header( 403 );wp_die("Forbidden");// Exit if accessed directly + status_header( 403 );wp_die("Forbidden");// Exit if accessed directly } @@ -157,10 +157,14 @@ public function ithoughts_tt_gl_get_glossary_term_element( $term, $text = null, } } else { if ( is_numeric( $term ) ) { - $term = get_post( $term ); + $termRetrieved = get_post( $term ); + if(NULL === $termRetrieved){ + $backbone->log( \ithoughts\v5_0\LogLevel::WARN, "Term with id \"$term\" and text \"$text\" does not exists."); + } + $term = $termRetrieved; } else if ( ! ($term instanceof \WP_Post) ) { - // Error - return $text; + $backbone->log( \ithoughts\v5_0\LogLevel::WARN, "Unhandled term descriptor provided:", $term, gettype($term)); + $term = NULL; } } @@ -213,8 +217,12 @@ public function ithoughts_tt_gl_get_glossary_term_element( $term, $text = null, if ( ! isset( $datas['linkAttrs']['href'] ) ) { $href = 'javascript::void(0)'; - if ( $datas['options']['termlinkopt'] != 'none' ) { // If theere need a link - $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term,'glossary' ) ); + if ( $datas['options']['termlinkopt'] != 'none' ) { // If there need a link + if ( NULL !== $term ) { + $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term,'glossary' ) ); + } else { + $backbone->log( \ithoughts\v5_0\LogLevel::WARN, "Tried to call get_permalink_light on NULL term with text \"$text\"."); + } } $datas['linkAttrs']['href'] = $href; } @@ -231,9 +239,11 @@ public function ithoughts_tt_gl_get_glossary_term_element( $term, $text = null, $linkElement = '' . $text . ''; $datas['attributes']['class'] = 'itg-glossary' . ((isset( $datas['attributes']['class'] ) && $datas['attributes']['class']) ? ' ' . $datas['attributes']['class'] : ''); + if(NULL === $term){ + $datas['attributes']['class'] .= ' itg-notfound'; + } $args = \ithoughts\v5_0\Toolbox::concat_attrs( $datas['attributes'] ); - $backbone = \ithoughts\tooltip_glossary\Backbone::get_instance(); $backbone->add_script( 'qtip' ); return '' . $linkElement . ''; @@ -283,8 +293,8 @@ public function save_post_check_for_glossary_usage( $post_id, $post ) { public function glossary_usage_reset_for_post() { global $post; if ( is_singular() && get_post_meta( $post->ID, 'ithoughts_tt_gl_update_term_usage' ) ) : - // Find all glossary terms that have this post noted. - $args = array( + // Find all glossary terms that have this post noted. + $args = array( 'post_type' => 'glossary', 'numberposts' => -1, 'post_status' => 'publish', @@ -293,12 +303,12 @@ public function glossary_usage_reset_for_post() { 'value' => $post->ID, 'type' => 'DECIMAL', ), - ), - ); - $terms = get_posts( $args ); - foreach ( $terms as $term ) : - // Delete the meta entry - delete_post_meta( $term->ID, 'ithoughts_tt_gl_term_used', $post->ID ); + ), + ); + $terms = get_posts( $args ); + foreach ( $terms as $term ) : + // Delete the meta entry + delete_post_meta( $term->ID, 'ithoughts_tt_gl_term_used', $post->ID ); endforeach; endif; } @@ -314,9 +324,13 @@ public function glossary_remove_update_marker() { /** */ public function glossary_shortcode( $atts, $text = '' ) { + /* echo '
Found shortcode:
';
+			var_dump(array('atts' => $atts, 'text' => $text));
+			echo '
'; +*/ if ( ! isset( $atts['glossary-id'] ) || ! $atts['glossary-id'] ) { - return $text; + return apply_filters( 'ithoughts_tt_gl_get_glossary_term_element', NULL, $text, $atts ); } $id = $atts['glossary-id']; return apply_filters( 'ithoughts_tt_gl_get_glossary_term_element', $id, $text, $atts ); diff --git a/class/shortcode/class-termlist.php b/class/shortcode/class-termlist.php index 441bbd1..4fa76c0 100755 --- a/class/shortcode/class-termlist.php +++ b/class/shortcode/class-termlist.php @@ -20,7 +20,7 @@ namespace ithoughts\tooltip_glossary\shortcode; if ( ! defined( 'ABSPATH' ) ) { - status_header( 403 );wp_die("Forbidden");// Exit if accessed directly + status_header( 403 );wp_die("Forbidden");// Exit if accessed directly } if ( ! class_exists( __NAMESPACE__ . '\\TermList' ) ) { @@ -68,148 +68,148 @@ public function glossary_term_list( $atts, $content = '' ) { default:{ $mode = self::LIST_MODE_NONE; } + } + + // Sanity check the list of letters (if set by user). + $alphas = $this->filter_alphas_to_array( isset( $data['handled'] ) && isset( $data['handled']['alpha'] ) && $data['handled']['alpha'] ? $data['handled']['alpha'] : null ); + // Checks for partial listing options (on first letter, or group) + $group_ids = $this->filter_groupIds_to_array( isset( $data['handled'] ) && isset( $data['handled']['group'] ) ? $data['handled']['group'] : null ); + + $terms; + $count; + + // Define default desc to none. Will generate a simple link + // If no content is required, use microposts. Else, use normal terms + if ( $mode & self::LIST_MODE_MICROPOST ) { + // Add qtip script only if loading tooltips + if ( $mode === self::LIST_MODE_TIP ) { + \ithoughts\tooltip_glossary\Backbone::get_instance()->add_script( 'qtip' ); } - // Sanity check the list of letters (if set by user). - $alphas = $this->filter_alphas_to_array( isset( $data['handled'] ) && isset( $data['handled']['alpha'] ) && $data['handled']['alpha'] ? $data['handled']['alpha'] : null ); - // Checks for partial listing options (on first letter, or group) - $group_ids = $this->filter_groupIds_to_array( isset( $data['handled'] ) && isset( $data['handled']['group'] ) ? $data['handled']['group'] : null ); - - $terms; - $count; - - // Define default desc to none. Will generate a simple link - // If no content is required, use microposts. Else, use normal terms - if ( $mode & self::LIST_MODE_MICROPOST ) { - // Add qtip script only if loading tooltips - if ( $mode === self::LIST_MODE_TIP ) { - \ithoughts\tooltip_glossary\Backbone::get_instance()->add_script( 'qtip' ); - } - - // Fetch microposts - $termsInfos = $this->get_microposts( $group_ids,$alphas ); - } else { - // Fetch full posts - $linkdata = apply_filters( 'ithoughts_tt_gl-split-args', $linkdata ); - $termsInfos = $this->get_lists_terms( $group_ids,$alphas ); - } - - $terms = $this->dispatch_per_char( $termsInfos['terms'], 0, 'WP_Post' ); - $count = $termsInfos['count']; - - // Go through all glossaries, and restrict to alpha list if supplied. - $lists = array(); - $countItems = 0; - foreach ( $terms as $char => $terms_char ) { - if ( count( $alphas ) == 0 || in_array( $char, $alphas ) ) { - $lists[] = "
  • $char
  • "; + // Fetch microposts + $termsInfos = $this->get_microposts( $group_ids,$alphas ); + } else { + // Fetch full posts + $linkdata = apply_filters( 'ithoughts_tt_gl-split-args', $linkdata ); + $termsInfos = $this->get_lists_terms( $group_ids,$alphas ); + } + + $terms = $this->dispatch_per_char( $termsInfos['terms'], 0, 'WP_Post' ); + $count = $termsInfos['count']; + + // Go through all glossaries, and restrict to alpha list if supplied. + $lists = array(); + $countItems = 0; + foreach ( $terms as $char => $terms_char ) { + if ( count( $alphas ) == 0 || in_array( $char, $alphas ) ) { + $lists[] = "
  • $char
  • "; + $countItems++; + + foreach ( $terms_char as $term ) { $countItems++; - - foreach ( $terms_char as $term ) { - $countItems++; - $term_standardized_post; // If only microposts were retrieved, cast them in WP_Post (usable by standard methods) - if ( $mode & self::LIST_MODE_MICROPOST ) { - $term_standardized_post = $term->to_WP_Post(); - } else { - $term_standardized_post = &$term; - } - $linkAttrs = (isset( $linkdata['linkAttrs'] ) && is_array( $linkdata['linkAttrs'] )) ? $linkdata['linkAttrs'] : $linkdata; - $linkAttrs['title'] = esc_attr( $term_standardized_post->post_title ); - $linkAttrs['alt'] = esc_attr( $term_standardized_post->post_title ); - - $link = ''; - $content = ''; - switch ( $mode ) { - case self::LIST_MODE_NONE:{ - $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term_standardized_post, 'glossary' ) ); - $target = ''; - if ( $data['options']['termlinkopt'] != 'none' ) { - $linkAttrs['target'] = '_blank'; - } - $linkAttrs['href'] = &$href; - $args = \ithoughts\v5_0\Toolbox::concat_attrs( $linkAttrs ); - $link = '' . $term_standardized_post->post_title . ''; - }break; - - case self::LIST_MODE_TIP:{ - $link = apply_filters( 'ithoughts_tt_gl_get_glossary_term_element', $term_standardized_post, null, $linkdata ); - } break; - - case self::LIST_MODE_EXCERPT:{ - $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term_standardized_post, 'glossary' ) ); - $target = ''; - if ( $data['options']['termlinkopt'] != 'none' ) { - $linkAttrs['target'] = '_blank'; - } - $linkAttrs['href'] = &$href; - $args = \ithoughts\v5_0\Toolbox::concat_attrs( $linkAttrs ); - $link = '' . $term_standardized_post->post_title . ''; - $content = '
    ' . '' . apply_filters( 'ithoughts_tt_gl-term-excerpt', $term_standardized_post ) . ''; - } break; - - case self::LIST_MODE_FULL:{ - $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term_standardized_post, 'glossary' ) ); - $target = ''; - if ( $data['options']['termlinkopt'] != 'none' ) { - $linkAttrs['target'] = '_blank'; - } - $linkAttrs['href'] = &$href; - $args = \ithoughts\v5_0\Toolbox::concat_attrs( $linkAttrs ); - $link = '' . $term_standardized_post->post_title . ''; - $content = '
    ' . '' . $term->post_content . ''; - } break; - }// End switch(). - - $lists[] = "
  • $link$content
  • "; - }// End foreach(). - }// End if(). - }// End foreach(). - if ( ! isset( $data['handled']['cols'] ) || $data['handled']['cols'] == 0 || $data['handled']['cols'] === false ) { - $data['handled']['cols'] = 1; // set col size to all items + $term_standardized_post; // If only microposts were retrieved, cast them in WP_Post (usable by standard methods) + if ( $mode & self::LIST_MODE_MICROPOST ) { + $term_standardized_post = $term->to_WP_Post(); + } else { + $term_standardized_post = &$term; + } + $linkAttrs = (isset( $linkdata['linkAttrs'] ) && is_array( $linkdata['linkAttrs'] )) ? $linkdata['linkAttrs'] : $linkdata; + $linkAttrs['title'] = esc_attr( $term_standardized_post->post_title ); + $linkAttrs['alt'] = esc_attr( $term_standardized_post->post_title ); + + $link = ''; + $content = ''; + switch ( $mode ) { + case self::LIST_MODE_NONE:{ + $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term_standardized_post, 'glossary' ) ); + $target = ''; + if ( $data['options']['termlinkopt'] != 'none' ) { + $linkAttrs['target'] = '_blank'; + } + $linkAttrs['href'] = &$href; + $args = \ithoughts\v5_0\Toolbox::concat_attrs( $linkAttrs ); + $link = '' . $term_standardized_post->post_title . ''; + }break; + + case self::LIST_MODE_TIP:{ + $link = apply_filters( 'ithoughts_tt_gl_get_glossary_term_element', $term_standardized_post, null, $linkdata ); + } break; + + case self::LIST_MODE_EXCERPT:{ + $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term_standardized_post, 'glossary' ) ); + $target = ''; + if ( $data['options']['termlinkopt'] != 'none' ) { + $linkAttrs['target'] = '_blank'; + } + $linkAttrs['href'] = &$href; + $args = \ithoughts\v5_0\Toolbox::concat_attrs( $linkAttrs ); + $link = '' . $term_standardized_post->post_title . ''; + $content = '
    ' . '' . apply_filters( 'ithoughts_tt_gl-term-excerpt', $term_standardized_post ) . ''; + } break; + + case self::LIST_MODE_FULL:{ + $href = apply_filters( 'ithoughts_tt_gl_term_link', \ithoughts\v5_0\Toolbox::get_permalink_light( $term_standardized_post, 'glossary' ) ); + $target = ''; + if ( $data['options']['termlinkopt'] != 'none' ) { + $linkAttrs['target'] = '_blank'; + } + $linkAttrs['href'] = &$href; + $args = \ithoughts\v5_0\Toolbox::concat_attrs( $linkAttrs ); + $link = '' . $term_standardized_post->post_title . ''; + $content = '
    ' . '' . do_shortcode($term->post_content) . ''; + } break; + }// End switch(). + + $lists[] = "
  • $link$content
  • "; + }// End foreach(). + }// End if(). + }// End foreach(). + if ( ! isset( $data['handled']['cols'] ) || $data['handled']['cols'] == 0 || $data['handled']['cols'] === false ) { + $data['handled']['cols'] = 1; // set col size to all items + } + $chunked; + if ( $data['handled']['cols'] != 1 ) { + $termsPerChunkFloat = $countItems / $data['handled']['cols']; + $termsPerChunk = intval( $termsPerChunkFloat ); + if ( $termsPerChunkFloat != $termsPerChunk ) { + $termsPerChunk++; } - $chunked; - if ( $data['handled']['cols'] != 1 ) { - $termsPerChunkFloat = $countItems / $data['handled']['cols']; - $termsPerChunk = intval( $termsPerChunkFloat ); - if ( $termsPerChunkFloat != $termsPerChunk ) { - $termsPerChunk++; - } - if ( $termsPerChunk < 1 ) { - $termsPerChunk = 1; - } - $chunked = array_chunk( $lists, $termsPerChunk ); - } else { - $chunked = array( &$lists ); + if ( $termsPerChunk < 1 ) { + $termsPerChunk = 1; } + $chunked = array_chunk( $lists, $termsPerChunk ); + } else { + $chunked = array( &$lists ); + } - $data['attributes']['class'] = 'glossary-list-details' . ((isset( $data['attributes']['class'] ) && $data['attributes']['class']) ? ' ' . $data['attributes']['class'] : ''); - /* + $data['attributes']['class'] = 'glossary-list-details' . ((isset( $data['attributes']['class'] ) && $data['attributes']['class']) ? ' ' . $data['attributes']['class'] : ''); + /* if(isset($data["handled"]["masonry"])){ $data["attributes"]["class"] .= " masonry"; $data["attributes"]["class"] = trim($data["attributes"]["class"]); $data["attributes"]["data-cols"] = $data["handled"]["cols"]; }*/ - $args = \ithoughts\v5_0\Toolbox::concat_attrs( $data['attributes'] ); + $args = \ithoughts\v5_0\Toolbox::concat_attrs( $data['attributes'] ); - $return = '
    '; - if ( isset( $data['handled']['masonry'] ) ) {/* + $return = '
    '; + if ( isset( $data['handled']['masonry'] ) ) {/* \ithoughts\tooltip_glossary\Backbone::get_instance()->add_script('list'); $return .= '
      '; foreach( $chunked as $col => $items ){ $return .= implode( '', $items ); } $return .= '
    ';*/ - } else { - foreach ( $chunked as $col => $items ) { - $return .= '
      '; - $return .= implode( '', $items ); - $return .= '
    '; - } + } else { + foreach ( $chunked as $col => $items ) { + $return .= '
      '; + $return .= implode( '', $items ); + $return .= '
    '; } - $return .= '
    '; + } + $return .= '
    '; - return $return; + return $return; } // glossary_term_list } // termlist }// End if(). diff --git a/css/ithoughts_tt_gl.min.css b/css/ithoughts_tt_gl.min.css index 14d2bd6..bd3a517 100755 --- a/css/ithoughts_tt_gl.min.css +++ b/css/ithoughts_tt_gl.min.css @@ -1 +1 @@ -.glossary-menu-atoz{border-bottom:2px solid #000;box-sizing:border-box;display:block;height:25px;line-height:1em;margin:auto;padding:5px 0 10px;text-transform:uppercase;width:100%}.glossary-menu-atoz .glossary-menu-item{box-sizing:border-box;float:left;height:22px;list-style:none;margin:0 0 0 .5em;padding:1px 1%}.glossary-menu-atoz:after{clear:both;content:"";display:block}.glossary-atoz-wrapper .itg-atoz-items{padding:5px 5px 10px 20px}.glossary-list-details{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.itg-atoz-items-off,.tooltip{display:none}.glossary-list-details .glossary-list{-ms-flex:0 1 100%;flex:0 1 100%;padding:0 10px}.glossary-list-details .glossary-list li{list-style:none;padding-left:0}.glossary-list-details .glossary-list li .glossary-item-header{border-bottom:1px solid #eee;text-align:center;text-transform:uppercase}.glossary-list-details .glossary-list li .glossary-item{max-width:100%;text-align:justify}.glossary-menu-item a{text-decoration:none}.atozmenu-empty{color:#ccc}.itg-atoz-menu-off{color:#333;text-decoration:underline}.itg-atoz-menu-off:hover{background-color:#333;color:#eee}.tooltip{background:#f4f4f4;border:1px solid #ddd;box-sizing:border-box;color:#333;font-size:1.1em;line-height:1.5em;padding:10px;width:20%}.glossary-index{margin:15px auto;padding:5px 10px}.glossary-index header{-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-align:stretch;align-items:stretch;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.glossary-index header p.tileHead{background:#fff;border:1px solid #999;cursor:pointer;-ms-flex:1 1 auto;flex:1 1 auto;line-height:1;margin:5px 2.5px;padding:5px;text-align:center}.glossary-index header p.tileHead[data-empty=true]{color:#999;cursor:auto}.glossary-index header p.tile[data-hasglossaryItem]{color:#fff}.glossary-index[data-type=tile]{text-align:justify}.glossary-index[data-type=tile] .glossary-atoz-wrapper{margin:0 -10px;position:relative}.glossary-index[data-type=tile] article{opacity:1;pointer-events:all;position:absolute;top:0;transition:.5s opacity;visibility:visible}.glossary-index[data-type=tile] article[data-active=false]{opacity:0;pointer-events:none;transition:.5s opacity,.5s .5s visibility;visibility:hidden}.glossary-index[data-type=tile] p.tile{display:inline-block;margin:30px 15px}.glossary-index[data-type=tile] p.tile span a{background:#fff;border:1px solid grey;padding:15px}.itg-tipsContainer{position:absolute;width:100%;z-index:9999999}span.itg-glossary>a,span.itg-glossary>a:active,span.itg-glossary>a:hover,span.itg-glossary>a:visited,span.itg-mediatip>a,span.itg-mediatip>a:active,span.itg-mediatip>a:hover,span.itg-mediatip>a:visited,span.itg-tooltip>a,span.itg-tooltip>a:active,span.itg-tooltip>a:hover,span.itg-tooltip>a:visited{box-shadow:none;text-decoration:overline underline}.itg-mediatip{max-width:350px}.itg-mediatip .qtip-content{padding:0}.itg-mediatip .qtip-content :last-child,.itg-mediatip .qtip-content p{margin-bottom:0}.itg-mediatip .qtip-content img{max-height:75vh;vertical-align:middle}.itg-mediatip .itg_pin_container{border:1px solid;border-radius:.5em;box-sizing:border-box;float:right;height:2em;width:2em}.itg-mediatip .itg_pin_container .itg_pin{box-sizing:border-box;cursor:pointer;display:block;fill:currentColor;margin:.25em;transition:all .25s ease 0s}.itg-mediatip .itg_pin_container.pined .itg_pin{transform:rotate(-45deg);transition:.25s all}.qtip-content p{line-height:1.5em;padding-bottom:1em}.qtip-content :last-child{line-height:1.5em;margin-bottom:0;padding-bottom:0}.qtip-content a{color:inherit;text-decoration:underline}.ithoughts_tt_gl-force_no_pad .qtip-content{vertical-align:top}.ithoughts_tt_gl-video_tip,.ithoughts_tt_gl-video_tip iframe,.ithoughts_tt_gl-video_tip video{max-width:none;vertical-align:top}.ithoughts_tt_gl-title_with_pin{vertical-align:sub}.ithoughts_tt_gl-title_with_pin .qtip-titlebar .qtip-title{display:block;width:100%}.ithoughts_tt_gl-caption{border-top:1px solid currentColor;font-size:1.1em;padding-top:5px;text-align:justify} \ No newline at end of file +.glossary-menu-atoz{border-bottom:2px solid #000;box-sizing:border-box;display:block;height:25px;line-height:1em;margin:auto;padding:5px 0 10px;text-transform:uppercase;width:100%}.glossary-menu-atoz .glossary-menu-item{box-sizing:border-box;float:left;height:22px;list-style:none;margin:0 0 0 .5em;padding:1px 1%}.glossary-menu-atoz:after{clear:both;content:"";display:block}.glossary-atoz-wrapper .itg-atoz-items{padding:5px 5px 10px 20px}.glossary-list-details{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}.itg-atoz-items-off,.tooltip{display:none}.glossary-list-details .glossary-list{-ms-flex:0 1 100%;flex:0 1 100%;padding:0 10px}.glossary-list-details .glossary-list li{list-style:none;padding-left:0}.glossary-list-details .glossary-list li .glossary-item-header{border-bottom:1px solid #eee;text-align:center;text-transform:uppercase}.glossary-list-details .glossary-list li .glossary-item{max-width:100%;text-align:justify}.glossary-menu-item a{text-decoration:none}.atozmenu-empty{color:#ccc}.itg-atoz-menu-off{color:#333;text-decoration:underline}.itg-atoz-menu-off:hover{background-color:#333;color:#eee}.tooltip{background:#f4f4f4;border:1px solid #ddd;box-sizing:border-box;color:#333;font-size:1.1em;line-height:1.5em;padding:10px;width:20%}.glossary-index{margin:15px auto;padding:5px 10px}.glossary-index header{-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-align:stretch;align-items:stretch;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap}.glossary-index header p.tileHead{background:#fff;border:1px solid #999;cursor:pointer;-ms-flex:1 1 auto;flex:1 1 auto;line-height:1;margin:5px 2.5px;padding:5px;text-align:center}.glossary-index header p.tileHead[data-empty=true]{color:#999;cursor:auto}.glossary-index header p.tile[data-hasglossaryItem]{color:#fff}.glossary-index[data-type=tile]{text-align:justify}.glossary-index[data-type=tile] .glossary-atoz-wrapper{margin:0 -10px;position:relative}.glossary-index[data-type=tile] article{opacity:1;pointer-events:all;position:absolute;top:0;transition:.5s opacity;visibility:visible}.glossary-index[data-type=tile] article[data-active=false]{opacity:0;pointer-events:none;transition:.5s opacity,.5s .5s visibility;visibility:hidden}.glossary-index[data-type=tile] p.tile{display:inline-block;margin:30px 15px}.glossary-index[data-type=tile] p.tile span a{background:#fff;border:1px solid grey;padding:15px}.itg-tipsContainer{position:absolute;width:100%;z-index:9999999}.itg-glossary>a,.itg-glossary>a:active,.itg-glossary>a:hover,.itg-glossary>a:visited,.itg-mediatip>a,.itg-mediatip>a:active,.itg-mediatip>a:hover,.itg-mediatip>a:visited,.itg-tooltip>a,.itg-tooltip>a:active,.itg-tooltip>a:hover,.itg-tooltip>a:visited{box-shadow:none;text-decoration:overline underline}.itg-glossary.itg-notfound>a,.itg-glossary.itg-notfound>a:active,.itg-glossary.itg-notfound>a:hover,.itg-glossary.itg-notfound>a:visited,.itg-mediatip.itg-notfound>a,.itg-mediatip.itg-notfound>a:active,.itg-mediatip.itg-notfound>a:hover,.itg-mediatip.itg-notfound>a:visited,.itg-tooltip.itg-notfound>a,.itg-tooltip.itg-notfound>a:active,.itg-tooltip.itg-notfound>a:hover,.itg-tooltip.itg-notfound>a:visited{text-decoration:underline wavy}.itg-mediatip{max-width:350px}.itg-mediatip .qtip-content{padding:0}.itg-mediatip .qtip-content :last-child,.itg-mediatip .qtip-content p{margin-bottom:0}.itg-mediatip .qtip-content img{max-height:75vh;vertical-align:middle}.itg-mediatip .itg_pin_container{border:1px solid;border-radius:.5em;box-sizing:border-box;float:right;height:2em;width:2em}.itg-mediatip .itg_pin_container .itg_pin{box-sizing:border-box;cursor:pointer;display:block;fill:currentColor;margin:.25em;transition:all .25s ease 0s}.itg-mediatip .itg_pin_container.pined .itg_pin{transform:rotate(-45deg);transition:.25s all}.qtip-content p{line-height:1.5em;padding-bottom:1em}.qtip-content :last-child{line-height:1.5em;margin-bottom:0;padding-bottom:0}.qtip-content a{color:inherit;text-decoration:underline}.ithoughts_tt_gl-force_no_pad .qtip-content{vertical-align:top}.ithoughts_tt_gl-video_tip,.ithoughts_tt_gl-video_tip iframe,.ithoughts_tt_gl-video_tip video{max-width:none;vertical-align:top}.ithoughts_tt_gl-title_with_pin{vertical-align:sub}.ithoughts_tt_gl-title_with_pin .qtip-titlebar .qtip-title{display:block;width:100%}.ithoughts_tt_gl-caption{border-top:1px solid currentColor;font-size:1.1em;padding-top:5px;text-align:justify} \ No newline at end of file diff --git a/less/ithoughts_tt_gl.less b/less/ithoughts_tt_gl.less index 0fe395c..cfabf91 100755 --- a/less/ithoughts_tt_gl.less +++ b/less/ithoughts_tt_gl.less @@ -12,185 +12,193 @@ /* A-Z shortcode */ .glossary-menu-atoz{ - border-bottom: 2px solid #000; - box-sizing: border-box; - display: block; - height: 25px; - line-height: 1em; - margin: auto; - padding: 5px 0 10px; - text-transform: uppercase; - width: 100%; - - .glossary-menu-item{ - box-sizing: border-box; - float: left; - height: 22px; - list-style: none; - margin: 0 0 0 0.5em; - padding: 1px 1%; - } - &:after { - clear: both; - content: ""; - display: block; - } + border-bottom: 2px solid #000; + box-sizing: border-box; + display: block; + height: 25px; + line-height: 1em; + margin: auto; + padding: 5px 0 10px; + text-transform: uppercase; + width: 100%; + + .glossary-menu-item{ + box-sizing: border-box; + float: left; + height: 22px; + list-style: none; + margin: 0 0 0 0.5em; + padding: 1px 1%; + } + &:after { + clear: both; + content: ""; + display: block; + } } .glossary-atoz-wrapper .itg-atoz-items{ - padding: 5px 5px 10px 20px; + padding: 5px 5px 10px 20px; } .glossary-list-details{ - display: flex; - flex-direction: row; - - .glossary-list{ - flex: 0 1 100%; - padding: 0 10px; - - li{ - list-style: none; - padding-left: 0; - - .glossary-item-header{ - border-bottom: 1px solid #eee; - text-align: center; - text-transform: uppercase; - } - .glossary-item{ - max-width: 100%; - text-align: justify; - } - } - } + display: flex; + flex-direction: row; + + .glossary-list{ + flex: 0 1 100%; + padding: 0 10px; + + li{ + list-style: none; + padding-left: 0; + + .glossary-item-header{ + border-bottom: 1px solid #eee; + text-align: center; + text-transform: uppercase; + } + .glossary-item{ + max-width: 100%; + text-align: justify; + } + } + } } .glossary-menu-item a{ - text-decoration: none; + text-decoration: none; } .atozmenu-empty{ - color: #ccc; + color: #ccc; } .itg-atoz-menu-off{ - color: #333; + color: #333; - &:hover{ - background-color: #333; - color: #eee; - } + &:hover{ + background-color: #333; + color: #eee; + } } .itg-atoz-menu-off{ - text-decoration: underline; + text-decoration: underline; } .itg-atoz-items-off{ - display: none; + display: none; } /* Popup tooltip */ .tooltip { - background: #f4f4f4; - border: 1px solid #ddd; - box-sizing: border-box; - color: #333; - display: none; - font-size: 1.1em; - line-height: 1.5em; - padding: 10px; - width: 20%; + background: #f4f4f4; + border: 1px solid #ddd; + box-sizing: border-box; + color: #333; + display: none; + font-size: 1.1em; + line-height: 1.5em; + padding: 10px; + width: 20%; } .glossary-index{// Warning, was #glossary-index - margin: 15px auto; - padding: 5px 10px; - - header{ - align-content: stretch; - align-items: stretch; - display: flex; - flex-direction: row; - flex-wrap: wrap; - - p.tileHead{ - background: #ffffff; - border: 1px solid #999999; - cursor: pointer; - flex: 1 1 auto; - line-height: 1; - margin:5px 2.5px; - padding: 5px; - text-align: center; - - &[data-empty="true"]{ - color: #999999; - cursor: auto; - } - } - - p.tile[data-hasglossaryItem]{ - color: #fff; - } - } - - &[data-type=tile]{ - text-align: justify; - - .glossary-atoz-wrapper{ - margin: 0 -10px; - position: relative; - } - article{ - opacity: 1; - pointer-events: all; - position: absolute; - top:0; - transition:.5s opacity; - visibility: visible; - - &[data-active="false"]{ - opacity: 0; - pointer-events: none; - transition:.5s opacity,.5s .5s visibility; - visibility: hidden; - } - } - - p.tile{ - display: inline-block; - margin: 30px 15px; - - span a{ - background: #ffffff; - border: 1px solid grey; - padding: 15px; - } - } - } + margin: 15px auto; + padding: 5px 10px; + + header{ + align-content: stretch; + align-items: stretch; + display: flex; + flex-direction: row; + flex-wrap: wrap; + + p.tileHead{ + background: #ffffff; + border: 1px solid #999999; + cursor: pointer; + flex: 1 1 auto; + line-height: 1; + margin:5px 2.5px; + padding: 5px; + text-align: center; + + &[data-empty="true"]{ + color: #999999; + cursor: auto; + } + } + + p.tile[data-hasglossaryItem]{ + color: #fff; + } + } + + &[data-type=tile]{ + text-align: justify; + + .glossary-atoz-wrapper{ + margin: 0 -10px; + position: relative; + } + article{ + opacity: 1; + pointer-events: all; + position: absolute; + top:0; + transition:.5s opacity; + visibility: visible; + + &[data-active="false"]{ + opacity: 0; + pointer-events: none; + transition:.5s opacity,.5s .5s visibility; + visibility: hidden; + } + } + + p.tile{ + display: inline-block; + margin: 30px 15px; + + span a{ + background: #ffffff; + border: 1px solid grey; + padding: 15px; + } + } + } } .itg-tipsContainer{ - position: absolute; - width:100%; - z-index: 9999999; + position: absolute; + width:100%; + z-index: 9999999; } -span{ - &.itg-glossary, - &.itg-tooltip, - &.itg-mediatip{ - & > a, - & > a:hover, - & > a:visited, - & > a:active - { - box-shadow: none; - text-decoration: overline underline; - } - } +.itg-glossary, +.itg-tooltip, +.itg-mediatip{ + & > a { + &, + &:hover, + &:visited, + &:active + { + box-shadow: none; + text-decoration: overline underline; + } + } + &.itg-notfound > a { + &, + &:hover, + &:visited, + &:active{ + text-decoration: underline wavy; + } + } } @@ -198,82 +206,82 @@ span{ Specific styles for tip ****************************************************/ .itg-mediatip{ - max-width: 350px; - - .qtip-content{ - padding: 0; - - p,:last-child{ - margin-bottom: 0; - } - img{ - max-height: 75vh; - vertical-align: middle; - } - } - .itg_pin_container{ - border: 1px solid; - border-radius: 0.5em; - box-sizing: border-box; - float: right; - height: 2em; - width: 2em; - - .itg_pin{ - box-sizing: border-box; - cursor: pointer; - display: block; - fill: currentColor; - margin: 0.25em; - transition: all 0.25s ease 0s; - } - - &.pined .itg_pin{ - transform: rotate(-45deg); - transition: 0.25s all; - } - } + max-width: 350px; + + .qtip-content{ + padding: 0; + + p,:last-child{ + margin-bottom: 0; + } + img{ + max-height: 75vh; + vertical-align: middle; + } + } + .itg_pin_container{ + border: 1px solid; + border-radius: 0.5em; + box-sizing: border-box; + float: right; + height: 2em; + width: 2em; + + .itg_pin{ + box-sizing: border-box; + cursor: pointer; + display: block; + fill: currentColor; + margin: 0.25em; + transition: all 0.25s ease 0s; + } + + &.pined .itg_pin{ + transform: rotate(-45deg); + transition: 0.25s all; + } + } } .qtip-content{ - p{ - line-height: 1.5em; - padding-bottom: 1em; - } - :last-child{ - line-height: 1.5em; - margin-bottom: 0; - padding-bottom: 0; - } - a{ - color: inherit; - text-decoration: underline; - } + p{ + line-height: 1.5em; + padding-bottom: 1em; + } + :last-child{ + line-height: 1.5em; + margin-bottom: 0; + padding-bottom: 0; + } + a{ + color: inherit; + text-decoration: underline; + } } .ithoughts_tt_gl-force_no_pad .qtip-content{ - vertical-align: top; + vertical-align: top; } .ithoughts_tt_gl-video_tip, .ithoughts_tt_gl-video_tip iframe, .ithoughts_tt_gl-video_tip video{ - max-width: none; - vertical-align: top; + max-width: none; + vertical-align: top; } .ithoughts_tt_gl-title_with_pin{ - vertical-align: sub; + vertical-align: sub; - .qtip-titlebar .qtip-title{ - display: block; - width: 100%; - } + .qtip-titlebar .qtip-title{ + display: block; + width: 100%; + } } .ithoughts_tt_gl-caption{ - border-top: 1px solid currentColor; - font-size: 1.1em; - padding-top: 5px; - text-align: justify; + border-top: 1px solid currentColor; + font-size: 1.1em; + padding-top: 5px; + text-align: justify; } \ No newline at end of file