Skip to content

Commit

Permalink
Extra info button
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Molenaar authored and Sean Molenaar committed Oct 28, 2016
1 parent 24fd9f9 commit 776f334
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
12 changes: 11 additions & 1 deletion src/PHPDraft/Out/HTML/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ div.main-url {
line-break: loose;
word-break: break-all;
}

button.extra-info.btn{
position: fixed;
bottom: 10px;
left: 10px;
border-radius: 30px;
}
button.extra-info.btn:focus {
border-width: 0px;
box-shadow: none;
outline: 0;
}
.request-panel > code, .popover-content {
word-break: break-all;
}
Expand Down
19 changes: 17 additions & 2 deletions src/PHPDraft/Out/HTML/default.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@ $base = $this->categories;
</div>
</div>
</div>
<?php $extras = array_filter($this->base_data, function ($value){
return !in_array($value, ['HOST', 'TITLE', 'ALT_HOST', 'FORMAT', 'DESC']);
}, ARRAY_FILTER_USE_KEY);
if (!empty($extras)):
$extras['host']=$this->base_data['HOST'];?>
<button
type="button"
class="btn btn-lg extra-info"
data-toggle="popover"
title="Extra info"
data-placement="top"
data-html="true"
data-content="<?php foreach ($extras as $key=>$value): ?><p><?= $key;?>: <?= $value;?></p><?php endforeach;?>">
<span class="glyphicon glyphicon-question-sign"></span>
</button>
<?php endif;?>
<?php foreach ($this->js as $js): ?>
<script src="<?= $js ?>"></script>
<?php endforeach; ?>
Expand All @@ -321,7 +337,6 @@ $base = $this->categories;
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<!--<script>--><?//= Minifier::minify_js(file_get_contents(__DIR__ . '/' . $this->template . '.js')); ?><!--</script>-->
<script><?= file_get_contents(__DIR__ . '/' . $this->template . '.js'); ?></script>
<script><?= Minifier::minify_js(file_get_contents(__DIR__ . '/' . $this->template . '.js')); ?></script>
</body>
</html>

0 comments on commit 776f334

Please sign in to comment.