comparison src/formats/bbcode.js @ 30:db061869f28f

remove sceditor.command, add options.onCreate
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 12 Aug 2022 00:54:39 -0600
parents 8165b83907af
children c23475f3f466
comparison
equal deleted inserted replaced
29:ea32a44b5a6e 30:db061869f28f
21 21
22 var css = dom.css; 22 var css = dom.css;
23 var attr = dom.attr; 23 var attr = dom.attr;
24 var is = dom.is; 24 var is = dom.is;
25 var extend = utils.extend; 25 var extend = utils.extend;
26 var extendDeep = utils.extendDeep;
26 var each = utils.each; 27 var each = utils.each;
27 28
28 var EMOTICON_DATA_ATTR = 'data-sceditor-emoticon'; 29 var EMOTICON_DATA_ATTR = 'data-sceditor-emoticon';
29 30
30 var getEditorCommand = sceditor.command.get; 31 function getEditorCommand(cmd) {
32 return sceditor.commands[cmd];
33 }
31 34
32 var QuoteType = { 35 var QuoteType = {
33 /** @lends BBCodeParser.QuoteType */ 36 /** @lends BBCodeParser.QuoteType */
34 /** 37 /**
35 * Always quote the attribute value 38 * Always quote the attribute value
2504 base.elementToBbcode = elementToBbcode; 2507 base.elementToBbcode = elementToBbcode;
2505 2508
2506 // build the BBCode cache 2509 // build the BBCode cache
2507 buildBbcodeCache(); 2510 buildBbcodeCache();
2508 2511
2509 editor.commands = extend( 2512 editor.commands = extendDeep(
2510 true, {}, defaultCommandsOverrides, editor.commands 2513 {}, defaultCommandsOverrides, editor.commands
2511 ); 2514 );
2512 2515
2513 // Add BBCode helper methods 2516 // Add BBCode helper methods
2514 editor.toBBCode = base.toSource; 2517 editor.toBBCode = base.toSource;
2515 editor.fromBBCode = base.toHtml; 2518 editor.fromBBCode = base.toHtml;