article note format updates
This commit is contained in:
parent
75666ac7ab
commit
4cbc62d2a5
|
@ -909,9 +909,18 @@ class Article extends Handler_Protected {
|
||||||
|
|
||||||
static function format_article_note($id, $note, $allow_edit = true) {
|
static function format_article_note($id, $note, $allow_edit = true) {
|
||||||
|
|
||||||
$str = "<div class='articleNote' onclick=\"Plugins.Note.edit($id)\">
|
if ($allow_edit) {
|
||||||
<div class='noteEdit' onclick=\"Plugins.Note.edit($id)\">".
|
$onclick = "onclick='Plugins.Note.edit($id)'";
|
||||||
($allow_edit ? __('(edit note)') : "")."</div>$note</div>";
|
$note_class = 'editable';
|
||||||
|
} else {
|
||||||
|
$onclick = '';
|
||||||
|
$note_class = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return "<div class='article-note $note_class'>
|
||||||
|
<i class='material-icons'>note</i>
|
||||||
|
<div $onclick class='body'>$note</div>
|
||||||
|
</div>";
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,15 +80,18 @@ body.ttrss_main div.post div.content iframe {
|
||||||
min-width: 50%;
|
min-width: 50%;
|
||||||
max-width: 98%;
|
max-width: 98%;
|
||||||
}
|
}
|
||||||
body.ttrss_main div.articleNote {
|
body.ttrss_main .article-note {
|
||||||
background-color: #fff7d5;
|
background-color: #fff7d5;
|
||||||
padding: 5px;
|
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
border: 1px solid #e7d796;
|
border: 1px solid #e7d796;
|
||||||
color: #9a8c59;
|
color: #9a8c59;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
body.ttrss_main div.articleNote div.noteEdit {
|
body.ttrss_main .article-note > * {
|
||||||
float: right;
|
align-self: center;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
body.ttrss_main .article-note.editable {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
body.ttrss_main h1 {
|
body.ttrss_main h1 {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -81,19 +81,23 @@ body.ttrss_main {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div.articleNote {
|
.article-note {
|
||||||
background-color : #fff7d5;
|
background-color : #fff7d5;
|
||||||
padding : 5px;
|
|
||||||
margin : 5px;
|
margin : 5px;
|
||||||
border: 1px solid #e7d796;
|
border: 1px solid #e7d796;
|
||||||
color : #9a8c59;
|
color : #9a8c59;
|
||||||
|
display : flex;
|
||||||
|
|
||||||
div.noteEdit {
|
> * {
|
||||||
float : right;
|
align-self : center;
|
||||||
cursor : pointer;
|
padding : 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.article-note.editable {
|
||||||
|
cursor : pointer;
|
||||||
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size : 18px;
|
font-size : 18px;
|
||||||
font-weight : 600;
|
font-weight : 600;
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Note extends Plugin {
|
||||||
|
|
||||||
function hook_article_button($line) {
|
function hook_article_button($line) {
|
||||||
return "<i class='material-icons' onclick=\"Plugins.Note.edit(".$line["id"].")\"
|
return "<i class='material-icons' onclick=\"Plugins.Note.edit(".$line["id"].")\"
|
||||||
style='cursor : pointer' title='".__('Edit article note')."'>note_add</i>";
|
style='cursor : pointer' title='".__('Edit article note')."'>note</i>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit() {
|
function edit() {
|
||||||
|
|
|
@ -20,14 +20,15 @@ Plugins.Note = {
|
||||||
if (reply) {
|
if (reply) {
|
||||||
ArticleCache.del(id);
|
ArticleCache.del(id);
|
||||||
|
|
||||||
var elem = $("POSTNOTE-" + id);
|
const elem = $("POSTNOTE-" + id);
|
||||||
|
|
||||||
if (elem) {
|
if (elem) {
|
||||||
Element.hide(elem);
|
|
||||||
elem.innerHTML = reply.note;
|
elem.innerHTML = reply.note;
|
||||||
|
|
||||||
if (reply.raw_length != 0)
|
if (reply.raw_length != 0)
|
||||||
new Effect.Appear(elem);
|
Element.show(elem);
|
||||||
|
else
|
||||||
|
Element.hide(elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -196,7 +196,7 @@ body.flat.ttrss_main.ttrss_index .dijitMenu .dijitMenuItemSelected td {
|
||||||
body.flat.ttrss_main.ttrss_index .dijitMenu .dijitMenuSeparator * {
|
body.flat.ttrss_main.ttrss_index .dijitMenu .dijitMenuSeparator * {
|
||||||
border-bottom-color: var(--border-dark) ! important;
|
border-bottom-color: var(--border-dark) ! important;
|
||||||
}
|
}
|
||||||
body.flat.ttrss_main.ttrss_index .articleNote {
|
body.flat.ttrss_main.ttrss_index .article-note {
|
||||||
background: var(--bg-panel);
|
background: var(--bg-panel);
|
||||||
border-color: #9a8c59;
|
border-color: #9a8c59;
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@ body.flat.ttrss_main.ttrss_index {
|
||||||
border-bottom-color : var(--border-dark) ! important;
|
border-bottom-color : var(--border-dark) ! important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.articleNote {
|
.article-note {
|
||||||
background : var(--bg-panel);
|
background : var(--bg-panel);
|
||||||
border-color : #9a8c59;
|
border-color : #9a8c59;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue