annotate src/test/sceditor.html.luan @ 38:19269d18b949

sceditor work
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 05 Aug 2022 00:04:58 -0600
parents src/test/sceditor.html@7076fd22fda5
children 3354d4ac89f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
1 local Luan = require "luan:Luan.luan"
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
2 local error = Luan.error
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
3 local Io = require "luan:Io.luan"
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
4 local Http = require "luan:http/Http.luan"
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
5
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
6
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
7 local base_url = "http://localhost:8081"
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
8
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
9 return function()
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
10 Io.stdout = Http.response.text_writer()
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
11 %>
36
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 <!doctype html>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 <html>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 <head>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15 <meta name="viewport" content="width=device-width, initial-scale=1">
38
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
16 <link rel="stylesheet" href="<%=base_url%>/themes/default.css" />
36
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
17 <style>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
18 xtextarea {
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
19 width: 100%;
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
20 height: 200px;
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
21 }
37
Franklin Schmidt <fschmidt@gmail.com>
parents: 36
diff changeset
22 div.sceditor-container input[type="text"] {
Franklin Schmidt <fschmidt@gmail.com>
parents: 36
diff changeset
23 width: 300px;
Franklin Schmidt <fschmidt@gmail.com>
parents: 36
diff changeset
24 }
36
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
25 </style>
38
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
26 <script src="<%=base_url%>/sceditor.js"></script>
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
27 <script src="<%=base_url%>/formats/bbcode.js"></script>
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
28 <script src="<%=base_url%>/icons/monocons.js"></script>
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
29 <script src="<%=base_url%>/icons/material.js"></script>
36
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
30 <script>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
31 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" />';
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
32
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
33 function init() {
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
34 let textarea = document.querySelector('textarea');
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
35 sceditor.create(textarea, {
38
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
36 //style: '<%=base_url%>/themes/content/default.css',
36
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
37 format: 'bbcode',
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
38 toolbar: 'source|link,image,youtube|code,bold,italic,underline,strike,superscript,size,color|quote,orderedlist,bulletlist',
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
39 autoExpand: true,
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
40 resizeMaxHeight: -1,
37
Franklin Schmidt <fschmidt@gmail.com>
parents: 36
diff changeset
41 //resizeEnabled: false,
36
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
42 width: '100%',
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
43 height: 100,
38
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
44 //emoticonsEnabled: false,
36
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
45 icons: 'material',
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
46 });
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
47 }
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
48 </script>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
49 </head>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
50 <body onload="init()">
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
51 <p>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
52 <a href="https://www.sceditor.com/">SCEditor</a>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
53 </p>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
54 <textarea></textarea>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
55 </body>
b54e9e2212b7 try sceditor
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
56 </html>
38
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
57 <%
19269d18b949 sceditor work
Franklin Schmidt <fschmidt@gmail.com>
parents: 37
diff changeset
58 end