comparison src/formats/bbcode.js @ 18:1334920263a2

remove more object-oriented code
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 08 Aug 2022 16:20:23 -0600
parents a199722647d0
children 80a86fb8f2b7
comparison
equal deleted inserted replaced
17:a199722647d0 18:1334920263a2
2623 delete bbcodeHandlers[name]; 2623 delete bbcodeHandlers[name];
2624 }; 2624 };
2625 2625
2626 bbcodeHandlers[name] = bbcode; 2626 bbcodeHandlers[name] = bbcode;
2627 } 2627 }
2628
2629 return this;
2630 }; 2628 };
2631 2629
2632 /** 2630 /**
2633 * Renames a BBCode 2631 * Renames a BBCode
2634 * 2632 *
2644 if (name in bbcodeHandlers) { 2642 if (name in bbcodeHandlers) {
2645 bbcodeHandlers[newName] = bbcodeHandlers[name]; 2643 bbcodeHandlers[newName] = bbcodeHandlers[name];
2646 2644
2647 delete bbcodeHandlers[name]; 2645 delete bbcodeHandlers[name];
2648 } 2646 }
2649
2650 return this;
2651 }; 2647 };
2652 2648
2653 /** 2649 /**
2654 * Removes a BBCode 2650 * Removes a BBCode
2655 * 2651 *
2659 */ 2655 */
2660 bbcodeFormat.remove = function (name) { 2656 bbcodeFormat.remove = function (name) {
2661 if (name in bbcodeHandlers) { 2657 if (name in bbcodeHandlers) {
2662 delete bbcodeHandlers[name]; 2658 delete bbcodeHandlers[name];
2663 } 2659 }
2664
2665 return this;
2666 }; 2660 };
2667 2661
2668 bbcodeFormat.formatBBCodeString = formatBBCodeString; 2662 bbcodeFormat.formatBBCodeString = formatBBCodeString;
2669 2663
2670 sceditor.formats.bbcode = bbcodeFormat; 2664 sceditor.formats.bbcode = bbcodeFormat;