changeset 7:df1e18048d97

add examples/min.html and better defaults
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 04 Aug 2022 23:46:09 -0600
parents c26f7240e96b
children 292d40f68d50
files src/changes.txt src/examples/min.html src/examples/modified.html src/sceditor.js
diffstat 4 files changed, 33 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/changes.txt	Thu Aug 04 20:05:05 2022 -0600
+++ b/src/changes.txt	Thu Aug 04 23:46:09 2022 -0600
@@ -1,6 +1,8 @@
 changes, most recent at top
 
 
+Added examples/min.html and fixed defaults of 'style', 'width', and 'height'.  'width' defaults to 600 and 'height' defaults to 300.  The dimensions of the textarea aren't used.  This guarantees a reasonable default.
+
 fix emoticonsRoot
 
 Move /development/* to /
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/examples/min.html	Thu Aug 04 23:46:09 2022 -0600
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+	<head>
+		<meta name="viewport" content="width=device-width, initial-scale=1">
+
+		<link rel="stylesheet" href="/themes/default.css" />
+		  
+		<script src="/sceditor.js"></script>
+		<script src="/icons/monocons.js"></script>
+		<script src="/formats/bbcode.js"></script>
+		<script>
+			function init() {
+				let textarea = document.querySelector('textarea');
+				sceditor.create(textarea, {
+					format: 'bbcode',
+					icons: 'monocons',
+				});
+			}
+		</script>
+	</head>
+	<body>
+		<textarea></textarea>
+	</body>
+	<script>init();</script>
+</html>
--- a/src/examples/modified.html	Thu Aug 04 20:05:05 2022 -0600
+++ b/src/examples/modified.html	Thu Aug 04 23:46:09 2022 -0600
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 	<head>
+		<meta name="viewport" content="width=device-width, initial-scale=1">
 		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 
 		<title>SCEditor Demo</title>
--- a/src/sceditor.js	Thu Aug 04 20:05:05 2022 -0600
+++ b/src/sceditor.js	Thu Aug 04 23:46:09 2022 -0600
@@ -1338,7 +1338,7 @@
 		 *
 		 * @type {string}
 		 */
-		style: 'jquery.sceditor.default.css',
+		style: baseUrl+'themes/content/default.css',
 
 		/**
 		 * Comma separated list of fonts for the font selector
@@ -1455,7 +1455,7 @@
 		 *
 		 * @type {?number}
 		 */
-		width: null,
+		width: 600,
 
 		/**
 		 * Height of the editor including toolbar. Set to null for automatic
@@ -1463,7 +1463,7 @@
 		 *
 		 * @type {?number}
 		 */
-		height: null,
+		height: 300,
 
 		/**
 		 * If to allow the editor to be resized
@@ -5976,10 +5976,9 @@
 			appendChild(editorContainer, wysiwygEditor);
 			appendChild(editorContainer, sourceEditor);
 
-			// TODO: make this optional somehow
 			base.dimensions(
-				options.width || width(original),
-				options.height || height(original)
+				options.width,
+				options.height
 			);
 
 			// Add ios to HTML so can apply CSS fix to only it