Skip to content

Commit 776f334

Browse files
Sean MolenaarSean Molenaar
Sean Molenaar
authored and
Sean Molenaar
committed
Extra info button
1 parent 24fd9f9 commit 776f334

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

src/PHPDraft/Out/HTML/default.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ div.main-url {
1212
line-break: loose;
1313
word-break: break-all;
1414
}
15-
15+
button.extra-info.btn{
16+
position: fixed;
17+
bottom: 10px;
18+
left: 10px;
19+
border-radius: 30px;
20+
}
21+
button.extra-info.btn:focus {
22+
border-width: 0px;
23+
box-shadow: none;
24+
outline: 0;
25+
}
1626
.request-panel > code, .popover-content {
1727
word-break: break-all;
1828
}

src/PHPDraft/Out/HTML/default.phtml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,22 @@ $base = $this->categories;
312312
</div>
313313
</div>
314314
</div>
315+
<?php $extras = array_filter($this->base_data, function ($value){
316+
return !in_array($value, ['HOST', 'TITLE', 'ALT_HOST', 'FORMAT', 'DESC']);
317+
}, ARRAY_FILTER_USE_KEY);
318+
if (!empty($extras)):
319+
$extras['host']=$this->base_data['HOST'];?>
320+
<button
321+
type="button"
322+
class="btn btn-lg extra-info"
323+
data-toggle="popover"
324+
title="Extra info"
325+
data-placement="top"
326+
data-html="true"
327+
data-content="<?php foreach ($extras as $key=>$value): ?><p><?= $key;?>: <?= $value;?></p><?php endforeach;?>">
328+
<span class="glyphicon glyphicon-question-sign"></span>
329+
</button>
330+
<?php endif;?>
315331
<?php foreach ($this->js as $js): ?>
316332
<script src="<?= $js ?>"></script>
317333
<?php endforeach; ?>
@@ -321,7 +337,6 @@ $base = $this->categories;
321337
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
322338
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
323339
crossorigin="anonymous"></script>
324-
<!--<script>--><?//= Minifier::minify_js(file_get_contents(__DIR__ . '/' . $this->template . '.js')); ?><!--</script>-->
325-
<script><?= file_get_contents(__DIR__ . '/' . $this->template . '.js'); ?></script>
340+
<script><?= Minifier::minify_js(file_get_contents(__DIR__ . '/' . $this->template . '.js')); ?></script>
326341
</body>
327342
</html>

0 commit comments

Comments
 (0)