diff src/plugins/alternative-lists.js @ 29:ea32a44b5a6e

remove more oo
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 11 Aug 2022 19:54:03 -0600
parents b7725dab7482
children db061869f28f
line wrap: on
line diff
--- a/src/plugins/alternative-lists.js	Thu Aug 11 00:04:48 2022 -0600
+++ b/src/plugins/alternative-lists.js	Thu Aug 11 19:54:03 2022 -0600
@@ -26,7 +26,7 @@
 	}
 
 	sceditor.plugins['alternative-lists'] = function () {
-		var base = this;
+		var base = {};
 
 		/**
 		 * Private functions
@@ -36,8 +36,8 @@
 		var orderedHandler;
 		var insertListTag;
 
-		base.init = function () {
-			var opts = this.opts;
+		base.init = function (editor) {
+			var opts = editor.opts;
 
 			// Enable for BBCode only
 			if (opts.format && opts.format !== 'bbcode') {
@@ -70,7 +70,7 @@
 					}
 
 					if (isFunction(toHtml)) {
-						return toHtml.call(this, token, attrs, content);
+						return toHtml(token, attrs, content);
 					} else {
 						token.attrs['0'] = content;
 						return sceditor.formats.bbcode.formatBBCodeString(
@@ -142,16 +142,19 @@
 		 * @private
 		 */
 		orderedHandler = function (caller, selected) {
+console.log('a');
 			var editor = this;
 
 			insertListTag(editor, '1', selected);
 		};
 
 		bulletHandler = function (caller, selected) {
+console.log('b');
 			var editor = this;
 
 			insertListTag(editor, '', selected);
 		};
 
+		return base;
 	};
 })(sceditor);