Popravek editorja za sporocila uporabnikom
This commit is contained in:
parent
71c39fd552
commit
16bac04a3f
@ -156,7 +156,7 @@ class Notifications {
|
||||
echo '</div>';
|
||||
|
||||
// Inicializiramo editor
|
||||
echo '<script type="text/javascript">create_editor(\'notification\', false);</script>';
|
||||
echo '<script type="text/javascript">create_editor_notification(\'notification\');</script>';
|
||||
}
|
||||
|
||||
|
||||
@ -342,7 +342,7 @@ class Notifications {
|
||||
echo '<span class="bold">'.$row['title'].' <span class="italic">('.$row['date'].')</span></span>';
|
||||
|
||||
// Stara sporocila so brez editorja
|
||||
$text = (strpos($row['text'], '\n') !== false) ? nl2br($row['text']) : $row['text'];
|
||||
$text = (strtotime($row['date']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
|
||||
echo '<p>'.$text.'</p>';
|
||||
|
||||
echo '</div>';
|
||||
@ -368,7 +368,7 @@ class Notifications {
|
||||
echo '<span class="bold">'.$row['title'].' <span class="italic">('.$row['date'].')</span></span>';
|
||||
|
||||
// Stara sporocila so brez editorja
|
||||
$text = (strpos($row['text'], '\n') !== false) ? nl2br($row['text']) : $row['text'];
|
||||
$text = (strtotime($row['date']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
|
||||
echo '<br />'.$text;
|
||||
|
||||
echo '</li>';
|
||||
|
@ -1626,6 +1626,19 @@ function create_editor_hotspot (id, focus) {
|
||||
editor_init = true;
|
||||
}
|
||||
|
||||
function create_editor_notification(id) {
|
||||
|
||||
CKEDITOR.replace( id, {toolbar: 'Notification'}); // prikazi editor s Notification configuration
|
||||
|
||||
CKEDITOR.config.removePlugins = 'elementspath'; //odstrani spodnji tag, kjer po default-u so oznake html (body, p, ipd.)
|
||||
|
||||
CKEDITOR.instances[id].on('focus', function () {
|
||||
this.execCommand('selectAll');
|
||||
});
|
||||
|
||||
editor_init = true;
|
||||
}
|
||||
|
||||
// odstrani editor za ne-spremenljivka (treba preden se odstrani html)
|
||||
function remove_editor (id) {
|
||||
//odstranimo CKEDITOR v kolikor je inicializiran -> če preverjanja potem javi error in ostala javascript datoteka ne deluje
|
||||
|
@ -74,6 +74,15 @@ CKEDITOR.editorConfig = function (config) {
|
||||
//{name: 'insert', items: ['Image', 'ImageMap']}
|
||||
{name: 'insert', items: ['Image']}
|
||||
];
|
||||
config.toolbar_Notification = [
|
||||
{name: 'document', items: ['Source', '-']},
|
||||
{name: 'clipboard', items: ['PasteText','RemoveFormat', 'Undo', 'Redo', 'Scayt']},
|
||||
{name: 'basicstyles', items: ['Bold', 'Underline', 'Italic', 'Strike', '-']},
|
||||
{name: 'links', items: ['Link', 'Unlink', 'Image', 'SpecialChar']},
|
||||
{name: 'colors', items: ['TextColor', 'BGColor']},
|
||||
{name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock','-']},
|
||||
{name: 'vec', items:['-', 'FontSize', 'Font', 'Outdent', 'Indent']}
|
||||
];
|
||||
|
||||
config.removeButtons = 'Cut,Copy,Paste,Subscript,Superscript';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user