Mercurial Hosting > freedit
changeset 36:b54e9e2212b7
try sceditor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 03 Aug 2022 23:55:17 -0600 |
parents | 1ce75c5ab0f7 |
children | 7076fd22fda5 |
files | src/test/sceditor.html |
diffstat | 1 files changed, 42 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/test/sceditor.html Wed Aug 03 23:55:17 2022 -0600 @@ -0,0 +1,42 @@ +<!doctype html> +<html> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sceditor@3/minified/themes/default.min.css" /> + <style> + xtextarea { + width: 100%; + height: 200px; + } + </style> + <script src="https://cdn.jsdelivr.net/npm/sceditor@3/minified/sceditor.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/sceditor@3/minified/formats/bbcode.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/sceditor@3/minified/icons/monocons.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/sceditor@3/minified/icons/material.min.js"></script> + <script> + sceditor.icons.material.icons.strike = '<path d="M23,12V14H18.61C19.61,16.14 19.56,22 12.38,22C4.05,22.05 4.37,15.5 4.37,15.5L8.34,15.55C8.37,18.92 11.5,18.92 12.12,18.88C12.76,18.83 15.15,18.84 15.34,16.5C15.42,15.41 14.32,14.58 13.12,14H1V12H23M19.41,7.89L15.43,7.86C15.43,7.86 15.6,5.09 12.15,5.08C8.7,5.06 9,7.28 9,7.56C9.04,7.84 9.34,9.22 12,9.88H5.71C5.71,9.88 2.22,3.15 10.74,2C19.45,0.8 19.43,7.91 19.41,7.89Z" />'; + + function init() { + let textarea = document.querySelector('textarea'); + sceditor.create(textarea, { + style: 'https://cdn.jsdelivr.net/npm/sceditor@3/minified/themes/content/default.min.css', + format: 'bbcode', + toolbar: 'source|link,image,youtube|code,bold,italic,underline,strike,superscript,size,color|quote,orderedlist,bulletlist', + autoExpand: true, + resizeMaxHeight: -1, + resizeEnabled: false, + width: '100%', + height: 100, + emoticonsEnabled: false, + icons: 'material', + }); + } + </script> + </head> + <body onload="init()"> + <p> + <a href="https://www.sceditor.com/">SCEditor</a> + </p> + <textarea></textarea> + </body> +</html>