changeset 24:80a86fb8f2b7

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 09 Aug 2022 22:49:59 -0600
parents c2a85b2ec677
children 80bf0adc9efd
files src/formats/bbcode.js src/formats/xhtml.js src/sceditor.js
diffstat 3 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/formats/bbcode.js	Tue Aug 09 13:25:17 2022 -0600
+++ b/src/formats/bbcode.js	Tue Aug 09 22:49:59 2022 -0600
@@ -635,6 +635,7 @@
 			isInline: false,
 			quoteType: QuoteType.never,
 			format: function (element, content) {
+console.log('a');
 				var authorAttr = 'data-author';
 				var	author = '';
 				var cite;
@@ -656,6 +657,7 @@
 						element.removeChild(cite);
 					}
 
+console.log('qqq');
 					content	= this.elementToBbcode(element);
 					author  = '=' + author.replace(/(^\s+|\s+$)/g, '');
 
@@ -2496,20 +2498,20 @@
 		 * Initializer
 		 * @private
 		 */
-		base.init = function () {
-			base.opts = this.opts;
+		base.init = function (editor) {
+			base.opts = editor.opts;
 			base.elementToBbcode = elementToBbcode;
 
 			// build the BBCode cache
 			buildBbcodeCache();
 
-			this.commands = extend(
-				true, {}, defaultCommandsOverrides, this.commands
+			editor.commands = extend(
+				true, {}, defaultCommandsOverrides, editor.commands
 			);
 
 			// Add BBCode helper methods
-			this.toBBCode   = base.toSource;
-			this.fromBBCode = base.toHtml;
+			editor.toBBCode   = base.toSource;
+			editor.fromBBCode = base.toHtml;
 		};
 
 		/**
--- a/src/formats/xhtml.js	Tue Aug 09 13:25:17 2022 -0600
+++ b/src/formats/xhtml.js	Tue Aug 09 22:49:59 2022 -0600
@@ -506,7 +506,7 @@
 		 * Init
 		 * @return {void}
 		 */
-		base.init = function () {
+		base.init = function (editor) {
 			if (!isEmptyObject(xhtmlFormat.converters || {})) {
 				each(
 					xhtmlFormat.converters,
@@ -522,8 +522,8 @@
 				);
 			}
 
-			this.commands = extend(true,
-				{}, defaultCommandsOverrides, this.commands);
+			editor.commands = extend(true,
+				{}, defaultCommandsOverrides, editor.commands);
 		};
 
 		/**
--- a/src/sceditor.js	Tue Aug 09 13:25:17 2022 -0600
+++ b/src/sceditor.js	Tue Aug 09 22:49:59 2022 -0600
@@ -4506,7 +4506,7 @@
 				pluginManager.register(plugin.trim());
 			});
 			if ('init' in format) {
-				format.init.call(base);
+				format.init(base);
 			}
 
 			// create the editor
@@ -4536,7 +4536,7 @@
 				// TODO: use editor doc and window?
 				pluginManager.call('ready');
 				if ('onReady' in format) {
-					format.onReady.call(base);
+					format.onReady(base);
 				}
 			};
 			onEvent(globalWin, 'load', loaded);