changeset 6:c26f7240e96b

fix emoticonsRoot
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 04 Aug 2022 20:05:05 -0600
parents dd47b95c9ec7
children df1e18048d97
files src/changes.txt src/examples/modified.html src/sceditor.js
diffstat 3 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
diff -r dd47b95c9ec7 -r c26f7240e96b src/changes.txt
--- a/src/changes.txt	Thu Aug 04 19:27:37 2022 -0600
+++ b/src/changes.txt	Thu Aug 04 20:05:05 2022 -0600
@@ -1,6 +1,8 @@
 changes, most recent at top
 
 
+fix emoticonsRoot
+
 Move /development/* to /
 
 Remove jQuery, another modern nightmare.
diff -r dd47b95c9ec7 -r c26f7240e96b src/examples/modified.html
--- a/src/examples/modified.html	Thu Aug 04 19:27:37 2022 -0600
+++ b/src/examples/modified.html	Thu Aug 04 20:05:05 2022 -0600
@@ -74,7 +74,7 @@
 			sceditor.create(textarea, {
 				format: 'bbcode',
 				icons: 'monocons',
-				style: '/themes/content/default.css'
+				style: '/themes/content/default.css',
 			});
 
 
diff -r dd47b95c9ec7 -r c26f7240e96b src/sceditor.js
--- a/src/sceditor.js	Thu Aug 04 19:27:37 2022 -0600
+++ b/src/sceditor.js	Thu Aug 04 20:05:05 2022 -0600
@@ -1,6 +1,9 @@
 (function () {
 	'use strict';
 
+	let baseUrl = document.currentScript.getAttribute('src').match(/.*\//)[0];
+	//console.log(baseUrl);
+
 	/**
 	 * Check if the passed argument is the
 	 * the passed type.
@@ -1404,7 +1407,7 @@
 		 *
 		 * @type {string}
 		 */
-		emoticonsRoot: '',
+		emoticonsRoot: baseUrl,
 		emoticons: {
 			dropdown: {
 				':)': 'emoticons/smile.png',