Mercurial Hosting > sceditor
comparison 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 |
comparison
equal
deleted
inserted
replaced
28:f227fdfebded | 29:ea32a44b5a6e |
---|---|
24 function isFunction(fn) { | 24 function isFunction(fn) { |
25 return typeof fn === 'function'; | 25 return typeof fn === 'function'; |
26 } | 26 } |
27 | 27 |
28 sceditor.plugins['alternative-lists'] = function () { | 28 sceditor.plugins['alternative-lists'] = function () { |
29 var base = this; | 29 var base = {}; |
30 | 30 |
31 /** | 31 /** |
32 * Private functions | 32 * Private functions |
33 * @private | 33 * @private |
34 */ | 34 */ |
35 var bulletHandler; | 35 var bulletHandler; |
36 var orderedHandler; | 36 var orderedHandler; |
37 var insertListTag; | 37 var insertListTag; |
38 | 38 |
39 base.init = function () { | 39 base.init = function (editor) { |
40 var opts = this.opts; | 40 var opts = editor.opts; |
41 | 41 |
42 // Enable for BBCode only | 42 // Enable for BBCode only |
43 if (opts.format && opts.format !== 'bbcode') { | 43 if (opts.format && opts.format !== 'bbcode') { |
44 return; | 44 return; |
45 } | 45 } |
68 // unknown listType, use default bullet list behavior | 68 // unknown listType, use default bullet list behavior |
69 toHtml = sceditor.formats.bbcode.get('ul').html; | 69 toHtml = sceditor.formats.bbcode.get('ul').html; |
70 } | 70 } |
71 | 71 |
72 if (isFunction(toHtml)) { | 72 if (isFunction(toHtml)) { |
73 return toHtml.call(this, token, attrs, content); | 73 return toHtml(token, attrs, content); |
74 } else { | 74 } else { |
75 token.attrs['0'] = content; | 75 token.attrs['0'] = content; |
76 return sceditor.formats.bbcode.formatBBCodeString( | 76 return sceditor.formats.bbcode.formatBBCodeString( |
77 toHtml, token.attrs); | 77 toHtml, token.attrs); |
78 } | 78 } |
140 * | 140 * |
141 * @param {node} caller | 141 * @param {node} caller |
142 * @private | 142 * @private |
143 */ | 143 */ |
144 orderedHandler = function (caller, selected) { | 144 orderedHandler = function (caller, selected) { |
145 console.log('a'); | |
145 var editor = this; | 146 var editor = this; |
146 | 147 |
147 insertListTag(editor, '1', selected); | 148 insertListTag(editor, '1', selected); |
148 }; | 149 }; |
149 | 150 |
150 bulletHandler = function (caller, selected) { | 151 bulletHandler = function (caller, selected) { |
152 console.log('b'); | |
151 var editor = this; | 153 var editor = this; |
152 | 154 |
153 insertListTag(editor, '', selected); | 155 insertListTag(editor, '', selected); |
154 }; | 156 }; |
155 | 157 |
158 return base; | |
156 }; | 159 }; |
157 })(sceditor); | 160 })(sceditor); |