diff --git a/css/area_nav-breadcrumb.less b/css/area_nav-breadcrumb.less index cd3f5b6..4376701 100755 --- a/css/area_nav-breadcrumb.less +++ b/css/area_nav-breadcrumb.less @@ -67,145 +67,6 @@ padding: .1em .1em 0; } } - - -/* + + + + + icon list + + + + + */ - .page-attributes { - list-style: none; - float: right; - display: inline-block; - max-width: 30%; - margin: -.45em 0 0; - padding: 0; - @media @screen_max-xs{ - max-width: 90%; - } - - > li { - .btn-usertools-wrapper(); // uniform li - .btn-usertools-num(); - - float: left; - - > strong, - > a { - display: block; - width: auto; - min-height: 2em; - border: 1px solid @color-border; - border-radius: @border-radius; - color: @color-nav; - text-align: center; - margin: 0; - } - - .prefix { - .btn-prefix (); - .icon-clipboard(); - } - -/* check !!! */ - &.do_none { - position: relative; - - strong { - background-color: @color-site-bg; - } - - .num { - background-color: @color-border; - color: @color-nav; - } - } -/* end check !!! */ - - &.plugin__qc { - display: inline-block; - overflow: visible; - position: static; - } - } // li - - a { - transition: @transition color, @transition background-color, @transition border-color; - - &[aria-expanded="false"] + #plugin__qc__wrapper { - display: none; - } - - &:hover, - &:active, - &:focus { - background-color: @button_color; - border-color: @button_background; - color: @button_background; - - .prefix { - color: @button_background; - } - } - } - - #plugin__qc__wrapper { - position: absolute; - right: 0; - width: auto; - border: 0 none; - background: @background_page-header; - background: -webkit-linear-gradient(top, @background_page-header, @color-content-bg); - background: linear-gradient(top, @background_page-header, @color-content-bg); - box-shadow: @box-shadow-bottom; - z-index: 2000; - - #plugin__qc__out{ - h1 { - font-size: @font-size-head3; - } - - h2 { - margin-top: 1.6em; - font-size: @font-size-head5; - } - > h1, - > h2, - > p, - > dl, - > div { - padding-left: 1rem; - margin-left: 0; - } - - > div p { - padding-left: 0; - margin-left: 0; - } - } - - &[aria-hidden="false"] { - margin-top: .5rem; - } - } - - #plugin__qc__icon { - display: none; - } - - #plugin__qc__link { - position: relative; - - .prefix { - .icon-emo-happy(); - - width: 100%; - font-size: @font-size-default; - - &::before { - width: 100%; - margin: .1em 0 0; - } - } - } - } } diff --git a/css/area_nav-page-attributes.less b/css/area_nav-page-attributes.less new file mode 100644 index 0000000..228f667 --- /dev/null +++ b/css/area_nav-page-attributes.less @@ -0,0 +1,30 @@ +/** + * Page Attribute Icons in the breadcrumb bar + */ +.page-attributes { + list-style: none; + float: right; + display: inline-block; + max-width: 30%; + margin: -.45em 0 0; + padding: 0; + @media @screen_max-xs { + max-width: 90%; + } + + > li { + .btn-usertools-wrapper(); // uniform li + .btn-usertools-num(); + + position: relative; + float: left; + display: block; + width: auto; + min-height: 2em; + border: 1px solid @color-border; + border-radius: @border-radius; + color: @color-nav; + text-align: center; + margin: 0; + } +} diff --git a/css/plugins/qc.less b/css/plugins/qc.less index dff5a32..42c57a5 100644 --- a/css/plugins/qc.less +++ b/css/plugins/qc.less @@ -1,6 +1,26 @@ -#plugin__qc__wrapper{ - font-size: @font-size-default; - p{ - font-size: @font-size-default; +/** + * Styles for the QC plugin + */ + +// icon in page attributes +.page-attributes .plugin_qc { + .qc_icon { + margin: 0; + width: 2em; + height: 2em; + + svg { + margin-top: 0.1em; + margin-left: 0.1em; + width: 1.6em; + height: 1.6em; + } } } + +// output +.qc-output { + font-size: 90%; + border-bottom: 1px solid @ini_border; +} + diff --git a/js/plugins/do_tasks.js b/js/plugins/do_tasks.js index 78a8f34..1ff8717 100755 --- a/js/plugins/do_tasks.js +++ b/js/plugins/do_tasks.js @@ -1,47 +1,49 @@ -( function( $, spc ) { - - var togglePageAnalysis = function(){ - var $this = $('.page-attributes').find('.plugin__qc'); - try{ - var $link = $this.find('#plugin__qc__link'), - $container = $this.find('#plugin__qc__wrapper'); - - if($container.length < 1){ - $this.remove(); - }else{ - $container.attr('aria-hidden','true'); - var $icon = $container.find('#plugin__qc__icon'); - $container.find('#plugin__qc__out').removeAttr('style'); - $link.on( 'click', function(e){ - e.preventDefault(); - $icon.trigger('click'); - var oldState = ($link.attr('aria-expanded')=== "true" ); - $container.attr('aria-hidden',oldState); - $(this).attr('aria-expanded',!oldState); - - }); - - if($container.length > 0){ - var num = $container.attr('data-errors'); - if(num){ - $link.find('.num').empty().append(num); - $link.closest('li').removeClass('do_none'); - } - } - - } - - }catch(err){ - $this.remove(); - } - }; - - $(function(){ - togglePageAnalysis(); - }); - -} )( jQuery, spc ); - - - +// FIXME figure out what this did and why +// ( function( $, spc ) { +// +// var togglePageAnalysis = function(){ +// var $this = $('.page-attributes').find('.plugin__qc'); +// try{ +// var $link = $this.find('#plugin__qc__link'), +// $container = $this.find('#plugin__qc__wrapper'); +// +// if($container.length < 1){ +// $this.remove(); +// }else{ +// $container.attr('aria-hidden','true'); +// var $icon = $container.find('#plugin__qc__icon'); +// $container.find('#plugin__qc__out').removeAttr('style'); +// $link.on( 'click', function(e){ +// e.preventDefault(); +// $icon.trigger('click'); +// var oldState = ($link.attr('aria-expanded')=== "true" ); +// $container.attr('aria-hidden',oldState); +// $(this).attr('aria-expanded',!oldState); +// +// }); +// +// if($container.length > 0){ +// var num = $container.attr('data-errors'); +// if(num){ +// $link.find('.num').empty().append(num); +// $link.closest('li').removeClass('do_none'); +// } +// } +// +// } +// +// }catch(err){ +// $this.remove(); +// } +// }; +// +// $(function(){ +// togglePageAnalysis(); +// }); +// +// } )( jQuery, spc ); +// +// +// +// diff --git a/js/plugins/qc.js b/js/plugins/qc.js new file mode 100644 index 0000000..65d795b --- /dev/null +++ b/js/plugins/qc.js @@ -0,0 +1,37 @@ +/** + * Add custom QC functionality instead of using the plugin's mechanism + */ +jQuery(function () { + var $panel = jQuery('div.qc-output').hide(); + + // load summary + jQuery('.page-attributes .plugin_qc a').load( + DOKU_BASE + '/lib/exe/ajax.php', + { + call: 'plugin_qc_short', + id: JSINFO['id'] + }, + function () { + jQuery(this).find('span span').addClass('num'); + } + ).click(function (e) { + e.preventDefault(); + + if ($panel.html() == '') { + // load output + $panel.load( + DOKU_BASE + '/lib/exe/ajax.php', + { + call: 'plugin_qc_long', + id: JSINFO['id'] + }, + function () { + $panel.dw_show(); + } + ); + } else { + $panel.dw_toggle(); + } + }); + +}); diff --git a/main.php b/main.php index 2934e3f..22fa813 100755 --- a/main.php +++ b/main.php @@ -230,7 +230,7 @@ $classWideContent = ($ACT === "show") ? "": "wide-content "; /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ /* page quality / page tasks */ /* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */ - include('tpl/nav-page-quality-tasks.php'); + include('tpl/nav-page-attributes.php'); ?> +
'; +} + + +if($qcPlugin && $qcPlugin->shouldShow()) { + echo '