Added permalink field to post view
This commit is contained in:
parent
f52e97e08a
commit
68c34a9f93
3 changed files with 37 additions and 1 deletions
|
@ -102,7 +102,6 @@ embed {
|
||||||
#sidebar .score .selected {
|
#sidebar .score .selected {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sidebar .score a:first-of-type:before {
|
#sidebar .score a:first-of-type:before {
|
||||||
content: '[';
|
content: '[';
|
||||||
color: black;
|
color: black;
|
||||||
|
@ -112,6 +111,19 @@ embed {
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sidebar .permalink {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 1em 0 0 -1px;
|
||||||
|
width: 100%;
|
||||||
|
font-size: 85%;
|
||||||
|
line-height: 150%;
|
||||||
|
height: auto;
|
||||||
|
padding: 0.2em 0.5em;
|
||||||
|
cursor: text;
|
||||||
|
color: dimgray;
|
||||||
|
border: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
#sidebar .left a,
|
#sidebar .left a,
|
||||||
#sidebar .right a {
|
#sidebar .right a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
|
@ -2,6 +2,26 @@ $(function()
|
||||||
{
|
{
|
||||||
function onDomUpdate()
|
function onDomUpdate()
|
||||||
{
|
{
|
||||||
|
$('#sidebar .permalink').bindOnce('select-link', 'click', function(e)
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
var node = $(this)[0];
|
||||||
|
if (document.body.createTextRange)
|
||||||
|
{
|
||||||
|
var range = document.body.createTextRange();
|
||||||
|
range.moveToElementText(node);
|
||||||
|
range.select();
|
||||||
|
}
|
||||||
|
else if (window.getSelection)
|
||||||
|
{
|
||||||
|
var selection = window.getSelection();
|
||||||
|
var range = document.createRange();
|
||||||
|
range.selectNodeContents(node);
|
||||||
|
selection.removeAllRanges();
|
||||||
|
selection.addRange(range);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#sidebar a.edit-post').bindOnce('edit-post', 'click', function(e)
|
$('#sidebar a.edit-post').bindOnce('edit-post', 'click', function(e)
|
||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
@ -190,6 +190,10 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<span class="permalink" title="Permalink">
|
||||||
|
<?= Core::getRouter()->linkTo(['PostController', 'genericView'], ['identifier' => $post->getId()]) ?>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="unit hl-options">
|
<div class="unit hl-options">
|
||||||
|
|
Loading…
Reference in a new issue