Improve toggle usability
This commit is contained in:
parent
2effa5b6f8
commit
f78a5ec245
@ -23,6 +23,9 @@ var unusedRules = [
|
|||||||
|
|
||||||
//we dont need all buttons
|
//we dont need all buttons
|
||||||
".btn-",
|
".btn-",
|
||||||
|
"!.btn-group",
|
||||||
|
"!.btn-default",
|
||||||
|
"!.btn-sm",
|
||||||
"!.btn-primary",
|
"!.btn-primary",
|
||||||
"!.btn-secondary",
|
"!.btn-secondary",
|
||||||
"!.btn-hero",
|
"!.btn-hero",
|
||||||
|
@ -2,14 +2,7 @@
|
|||||||
<article>
|
<article>
|
||||||
<?php if ($params['html']['date_modified']) { ?>
|
<?php if ($params['html']['date_modified']) { ?>
|
||||||
<div class="page-header sub-header clearfix">
|
<div class="page-header sub-header clearfix">
|
||||||
<h1><?php
|
<h1><?= $page['breadcrumbs']? $this->get_breadcrumb_title($page, $base_page) : $page['title'] ?></h1>
|
||||||
if ($page['breadcrumbs']) {
|
|
||||||
echo $this->get_breadcrumb_title($page, $base_page);
|
|
||||||
} else {
|
|
||||||
echo $page['title'];
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</h1>
|
|
||||||
<span style="float: left; font-size: 10px; color: gray;">
|
<span style="float: left; font-size: 10px; color: gray;">
|
||||||
<?= date("l, F j, Y", $page['modified_time']); ?>
|
<?= date("l, F j, Y", $page['modified_time']); ?>
|
||||||
</span>
|
</span>
|
||||||
@ -19,14 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1><?php
|
<h1><?= $page['breadcrumbs']? $this->get_breadcrumb_title($page, $base_page) : $page['title'] ?></h1>
|
||||||
if ($page['breadcrumbs']) {
|
|
||||||
echo $this->get_breadcrumb_title($page, $base_page);
|
|
||||||
} else {
|
|
||||||
echo $page['title'];
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</h1>
|
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<?php if ($params['html']['search']) { ?>
|
<?php if ($params['html']['search']) { ?>
|
||||||
<!-- Tipue Search -->
|
<!-- Tipue Search -->
|
||||||
<link href="<?php echo $base_url; ?>tipuesearch/tipuesearch.css" rel="stylesheet">
|
<link href="<?= $base_url; ?>tipuesearch/tipuesearch.css" rel="stylesheet">
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
@ -44,9 +44,8 @@
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
<!-- jQuery -->
|
<!-- jQuery -->
|
||||||
<?= '<script src="' . $base_url . 'themes/daux/js/jquery-1.11.3.min.js' . '"></script>' ?>
|
<script src="<?= $base_url; ?>themes/daux/js/jquery-1.11.3.min.js"></script>
|
||||||
|
|
||||||
<!-- hightlight.js -->
|
<!-- hightlight.js -->
|
||||||
<script src="<?= $base_url; ?>themes/daux/js/highlight.pack.js"></script>
|
<script src="<?= $base_url; ?>themes/daux/js/highlight.pack.js"></script>
|
||||||
|
@ -37,11 +37,21 @@
|
|||||||
<?php
|
<?php
|
||||||
foreach ($params['html']['links'] as $name => $url) {
|
foreach ($params['html']['links'] as $name => $url) {
|
||||||
echo '<a href="' . $url . '" target="_blank">' . $name . '</a><br>';
|
echo '<a href="' . $url . '" target="_blank">' . $name . '</a><br>';
|
||||||
}
|
} ?>
|
||||||
if ($params['html']['toggle_code']) {
|
|
||||||
echo '<a href="#" id="toggleCodeBlockBtn" onclick="toggleCodeBlocks();">Show Code Blocks Inline</a><br>';
|
<div id="toggleCodeBlock">
|
||||||
}
|
<?php if ($params['html']['toggle_code'] && $params['html']['float']) { ?>
|
||||||
?>
|
<br />
|
||||||
|
<span class="code-buttons-text">Code blocks</span>
|
||||||
|
<div class="btn-group" role="group">
|
||||||
|
<button id="code-hide" class="btn btn-sm btn-default">No</button>
|
||||||
|
<button id="code-below" class="btn btn-sm btn-default">Below</button>
|
||||||
|
<button id="code-float" class="btn btn-sm btn-default">Inline</button>
|
||||||
|
</div>
|
||||||
|
<?php } else if ($params['html']['toggle_code']) { ?>
|
||||||
|
<a id="toggleCodeBlockBtn" href="#" onclick="toggleCodeBlocks();">Show Code Blocks Inline</a><br>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Twitter -->
|
<!-- Twitter -->
|
||||||
<?php foreach ($params['html']['twitter'] as $handle) { ?>
|
<?php foreach ($params['html']['twitter'] as $handle) { ?>
|
||||||
@ -64,7 +74,7 @@
|
|||||||
<div id="tipue_search_content" style="display:none"></div>
|
<div id="tipue_search_content" style="display:none"></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div class="doc_content"">
|
<div class="doc_content">
|
||||||
<?= $this->section('content'); ?>
|
<?= $this->section('content'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
2
themes/daux/css/theme-blue.min.css
vendored
2
themes/daux/css/theme-blue.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-green.min.css
vendored
2
themes/daux/css/theme-green.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-navy.min.css
vendored
2
themes/daux/css/theme-navy.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme-red.min.css
vendored
2
themes/daux/css/theme-red.min.css
vendored
File diff suppressed because one or more lines are too long
2
themes/daux/css/theme.min.css
vendored
2
themes/daux/css/theme.min.css
vendored
File diff suppressed because one or more lines are too long
@ -37,16 +37,15 @@ _.debounce = function(func, wait, immediate) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var codeBlocks, codeBlockView, toggleCodeBlockBtn, codeBlockState;
|
var codeBlocks, codeBlockView, toggleCodeBlockBtn, toggleCodeSection, codeBlockState;
|
||||||
function toggleCodeBlocks() {
|
function toggleCodeBlocks() {
|
||||||
var hasFloat = $(document.body).hasClass("with-float")? 3 : 2;
|
setCodeBlockStyle(codeBlocks.hasClass('hidden') ? 1 : 0);
|
||||||
codeBlockState = (codeBlockState + 1) % hasFloat;
|
|
||||||
localStorage.setItem("codeBlockState", codeBlockState);
|
|
||||||
setCodeBlockStyle(codeBlockState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCodeBlockStyle(x) {
|
function setCodeBlockStyle(codeBlockState) {
|
||||||
switch (x) {
|
localStorage.setItem("codeBlockState", codeBlockState);
|
||||||
|
|
||||||
|
switch (codeBlockState) {
|
||||||
default:
|
default:
|
||||||
case 0:
|
case 0:
|
||||||
toggleCodeBlockBtn.html("Show Code Blocks");
|
toggleCodeBlockBtn.html("Show Code Blocks");
|
||||||
@ -69,21 +68,25 @@ function setCodeBlockStyle(x) {
|
|||||||
//Initialize CodeBlock Visibility Settings
|
//Initialize CodeBlock Visibility Settings
|
||||||
$(function () {
|
$(function () {
|
||||||
codeBlocks = $('.content-page article > pre');
|
codeBlocks = $('.content-page article > pre');
|
||||||
|
toggleCodeSection = $('#toggleCodeBlock');
|
||||||
toggleCodeBlockBtn = $('#toggleCodeBlockBtn');
|
toggleCodeBlockBtn = $('#toggleCodeBlockBtn');
|
||||||
|
|
||||||
// If there is no code block we hide the link
|
// If there is no code block we hide the link
|
||||||
if (!codeBlocks.size()) {
|
if (!codeBlocks.size()) {
|
||||||
toggleCodeBlockBtn.addClass('hidden');
|
toggleCodeSection.addClass('hidden');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#code-hide').click(function() { setCodeBlockStyle(0); });
|
||||||
|
$('#code-below').click(function() { setCodeBlockStyle(1); });
|
||||||
|
$('#code-float').click(function() { setCodeBlockStyle(2); });
|
||||||
|
|
||||||
codeBlockView = $('.right-column');
|
codeBlockView = $('.right-column');
|
||||||
if (!codeBlockView.size()) return;
|
if (!codeBlockView.size()) return;
|
||||||
|
|
||||||
codeBlockState = localStorage.getItem("codeBlockState");
|
codeBlockState = localStorage.getItem("codeBlockState");
|
||||||
if (!codeBlockState) {
|
if (!codeBlockState) {
|
||||||
codeBlockState = 2;
|
codeBlockState = 2;
|
||||||
localStorage.setItem("codeBlockState", codeBlockState);
|
|
||||||
} else codeBlockState = parseInt(codeBlockState);
|
} else codeBlockState = parseInt(codeBlockState);
|
||||||
|
|
||||||
setCodeBlockStyle(codeBlockState);
|
setCodeBlockStyle(codeBlockState);
|
||||||
@ -99,7 +102,7 @@ $(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// New Tree navigation
|
// New Tree navigation
|
||||||
$("ul.nav.nav-list > li.has-children > a > .arrow").click(function() {
|
$('ul.nav.nav-list > li.has-children > a > .arrow').click(function() {
|
||||||
$(this).parent().parent().toggleClass('open');
|
$(this).parent().parent().toggleClass('open');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
2
themes/daux/less/bootstrap/bootstrap.less
vendored
2
themes/daux/less/bootstrap/bootstrap.less
vendored
@ -25,7 +25,7 @@
|
|||||||
// Components
|
// Components
|
||||||
//@import "component-animations.less";
|
//@import "component-animations.less";
|
||||||
//@import "dropdowns.less";
|
//@import "dropdowns.less";
|
||||||
//@import "button-groups.less";
|
@import "button-groups.less";
|
||||||
//@import "input-groups.less";
|
//@import "input-groups.less";
|
||||||
@import "navs.less";
|
@import "navs.less";
|
||||||
@import "navbar.less";
|
@import "navbar.less";
|
||||||
|
@ -68,6 +68,14 @@ code {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.code-buttons-text {
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.5;
|
||||||
|
padding: 6px 10px 6px 0;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
//Sidebar Nav List
|
//Sidebar Nav List
|
||||||
.nav.nav-list {
|
.nav.nav-list {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user