Added Emojis and headers (h1,h2...) in sceditor

This commit is contained in:
franciscoarocas 2020-09-20 18:15:30 +01:00
parent 3865260e7b
commit e6cef30448
41 changed files with 73 additions and 12 deletions

View File

@ -52,6 +52,7 @@
<script src="{$smarty.const.BLOG_BASEURL}/fp-interface/lang/{$lang_locale}/sceditor.js"></script>
<script src="{$smarty.const.BLOG_BASEURL}/admin/res/sceditor/plugins/flatPressFileManager.js"></script>
<script src="{$smarty.const.BLOG_BASEURL}/admin/res/sceditor/plugins/flatPressCustomBBCodes.js"></script>
<script src="{$smarty.const.BLOG_BASEURL}/admin/res/sceditor/plugins/flatPressEmojis.js"></script>
<script>
// Replace the textarea #example with SCEditor
var lang_editor = "{$lang_locale}";
@ -60,7 +61,7 @@
var textarea = document.getElementById('content_textarea');
sceditor.create(textarea, {
plugins: 'flatPressFileManager',
toolbar: 'bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,flatPressFileManager,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source',
toolbar: 'bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,flatPressFileManager,email,link,unlink|emojis,youtube,date,time|ltr,rtl|print,maximize,source',
emoticonsRoot: eRoot,
format: 'bbcode',
height: "400px",

View File

@ -44,6 +44,7 @@
<script src="{$smarty.const.BLOG_BASEURL}/fp-interface/lang/{$lang_locale}/sceditor.js"></script>
<script src="{$smarty.const.BLOG_BASEURL}/admin/res/sceditor/plugins/flatPressFileManager.js"></script>
<script src="{$smarty.const.BLOG_BASEURL}/admin/res/sceditor/plugins/flatPressCustomBBCodes.js"></script>
<script src="{$smarty.const.BLOG_BASEURL}/admin/res/sceditor/plugins/flatPressEmojis.js"></script>
<script>
// Replace the textarea #example with SCEditor
var lang_editor = "{$lang_locale}";
@ -53,7 +54,7 @@
var textarea = document.getElementById('content_textarea');
sceditor.create(textarea, {
plugins: 'flatPressFileManager',
toolbar: 'bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,flatPressFileManager,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source',
toolbar: 'bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,flatPressFileManager,email,link,unlink|emojis,youtube,date,time|ltr,rtl|print,maximize,source',
emoticonsRoot: eRoot,
format: 'bbcode',
height: "400px",

View File

@ -716,6 +716,20 @@ img {
color: #111 !important;
}
#sceditor-Emojis {
text-align: center;
}
#sceditor-Emojis a {
margin: 0.2rem;
cursor: pointer;
display: inline-block;
}
.sceditor-button-emojis div {
background-position: 0px -480px !important;
}
/* Modal to upload files */
#flatpress-files-modal .modal-header {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 965 B

View File

@ -1,9 +0,0 @@
Presenting, Nomicons: The Full Monty :o
Credits:
Oscar Gruno, aka Nominell v. 2.0 -> oscargruno@mac.com
Andy Fedosjeenko, aka Nightwolf -> bobo@animevanguard.com
Copyright (C) 2001-Infinity, Oscar Gruno & Andy Fedosjeenko
You can redistribute these files as much as you like, as long as you keep this file with them and give us the proper credit. You may even rape them if you please, just give us credit for our work.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 981 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1010 B

View File

@ -67,4 +67,17 @@ sceditor.formats.bbcode.set('img', {
return '<img' + attribs + ' src="' + sceditor.escapeUriScheme(content) + '" />';
}
}
});
});
// Header tag (From h1 to h6)
for(let i = 1; i < 7; ++i) { // Headers: h1 to h6
sceditor.formats.bbcode.set('h' + i, {
tags: {
['h' + i] : null,
},
isInline: false,
format: '[h'+ i +']{0}[/h' + i + ']',
html: '<h' + i + '>{0}</h' + i + '>',
});
}

View File

@ -0,0 +1,41 @@
const EMOJIS = [
'😀', '😃', '😄', '😁', '😆', '😅', '😂', '🤣', '😊', '😇',
'🙂', '🙃', '😉', '😌', '😍', '🥰', '😘', '😗', '😙', '😚',
'😋', '😛', '😝', '😜', '🤪', '🤨', '🧐', '🤓', '😎', '🤩',
'🥳', '😏', '😒', '😞', '😔', '😟', '😕', '🙁', '☹️', '😣',
'😖', '😫', '😩', '🥺', '😢', '😭', '😤', '😠', '😡', '🤬',
'🤯', '😳', '🥵', '🥶', '😱', '😨', '😰', '😥', '😓', '🤗',
'🤔', '🤭', '🤫', '🤥', '😶', '😐', '😑', '😬', '🙄', '😯',
'😦', '😧', '😮', '😲', '🥱', '😴', '🤤', '😪', '😵', '🤐',
'🥴', '🤢', '🤮', '🤧', '😷', '🤒', '🤕', '🤑', '🤠', '😈',
'👿'
];
sceditor.command.set('emojis', {
exec: function(caller) {
const sceditorInsert = this.insert;
const createEmojiLink = function(emoji) {
let link = document.createElement('a');
const linkText = document.createTextNode(emoji);
link.appendChild(linkText);
link.onclick = () => { sceditorInsert(emoji) };
return link;
};
const emojisShowListContent = function() {
let content = document.createElement('div');
content.id = 'sceditor-Emojis';
EMOJIS.forEach(function(emoji) {
content.appendChild(createEmojiLink(emoji));
});
return content;
};
this.createDropDown(caller, 'emojis-list', emojisShowListContent());
},
tooltip: 'Insert a emoji emoticon'
});