comparison src/formats/bbcode.js @ 17:a199722647d0

finish last commit
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 08 Aug 2022 12:28:55 -0600
parents 0cb206904499
children 1334920263a2
comparison
equal deleted inserted replaced
16:8bd52902156a 17:a199722647d0
80 }, 80 },
81 justify: { 81 justify: {
82 txtExec: ['[justify]', '[/justify]'] 82 txtExec: ['[justify]', '[/justify]']
83 }, 83 },
84 font: { 84 font: {
85 txtExec: function (caller) { 85 txtExec: function (editor, caller) {
86 var editor = this;
87
88 getEditorCommand('font')._dropDown( 86 getEditorCommand('font')._dropDown(
89 editor, 87 editor,
90 caller, 88 caller,
91 function (fontName) { 89 function (fontName) {
92 editor.insertText( 90 editor.insertText(
96 } 94 }
97 ); 95 );
98 } 96 }
99 }, 97 },
100 size: { 98 size: {
101 txtExec: function (caller) { 99 txtExec: function (editor, caller) {
102 var editor = this;
103
104 getEditorCommand('size')._dropDown( 100 getEditorCommand('size')._dropDown(
105 editor, 101 editor,
106 caller, 102 caller,
107 function (fontSize) { 103 function (fontSize) {
108 editor.insertText( 104 editor.insertText(
112 } 108 }
113 ); 109 );
114 } 110 }
115 }, 111 },
116 color: { 112 color: {
117 txtExec: function (caller) { 113 txtExec: function (editor, caller) {
118 var editor = this;
119
120 getEditorCommand('color')._dropDown( 114 getEditorCommand('color')._dropDown(
121 editor, 115 editor,
122 caller, 116 caller,
123 function (color) { 117 function (color) {
124 editor.insertText( 118 editor.insertText(
128 } 122 }
129 ); 123 );
130 } 124 }
131 }, 125 },
132 bulletlist: { 126 bulletlist: {
133 txtExec: function (caller, selected) { 127 txtExec: function (editor, caller, selected) {
134 this.insertText( 128 editor.insertText(
135 '[ul]\n[li]' + 129 '[ul]\n[li]' +
136 selected.split(/\r?\n/).join('[/li]\n[li]') + 130 selected.split(/\r?\n/).join('[/li]\n[li]') +
137 '[/li]\n[/ul]' 131 '[/li]\n[/ul]'
138 ); 132 );
139 } 133 }
140 }, 134 },
141 orderedlist: { 135 orderedlist: {
142 txtExec: function (caller, selected) { 136 txtExec: function (editor, caller, selected) {
143 this.insertText( 137 editor.insertText(
144 '[ol]\n[li]' + 138 '[ol]\n[li]' +
145 selected.split(/\r?\n/).join('[/li]\n[li]') + 139 selected.split(/\r?\n/).join('[/li]\n[li]') +
146 '[/li]\n[/ol]' 140 '[/li]\n[/ol]'
147 ); 141 );
148 } 142 }
155 }, 149 },
156 code: { 150 code: {
157 txtExec: ['[code]', '[/code]'] 151 txtExec: ['[code]', '[/code]']
158 }, 152 },
159 image: { 153 image: {
160 txtExec: function (caller, selected) { 154 txtExec: function (editor, caller, selected) {
161 var editor = this;
162
163 getEditorCommand('image')._dropDown( 155 getEditorCommand('image')._dropDown(
164 editor, 156 editor,
165 caller, 157 caller,
166 selected, 158 selected,
167 function (url, width, height) { 159 function (url, width, height) {
181 } 173 }
182 ); 174 );
183 } 175 }
184 }, 176 },
185 email: { 177 email: {
186 txtExec: function (caller, selected) { 178 txtExec: function (editor, caller, selected) {
187 var editor = this;
188
189 getEditorCommand('email')._dropDown( 179 getEditorCommand('email')._dropDown(
190 editor, 180 editor,
191 caller, 181 caller,
192 function (url, text) { 182 function (url, text) {
193 editor.insertText( 183 editor.insertText(
198 } 188 }
199 ); 189 );
200 } 190 }
201 }, 191 },
202 link: { 192 link: {
203 txtExec: function (caller, selected) { 193 txtExec: function (editor, caller, selected) {
204 var editor = this;
205
206 getEditorCommand('link')._dropDown( 194 getEditorCommand('link')._dropDown(
207 editor, 195 editor,
208 caller, 196 caller,
209 function (url, text) { 197 function (url, text) {
210 editor.insertText( 198 editor.insertText(
218 }, 206 },
219 quote: { 207 quote: {
220 txtExec: ['[quote]', '[/quote]'] 208 txtExec: ['[quote]', '[/quote]']
221 }, 209 },
222 youtube: { 210 youtube: {
223 txtExec: function (caller) { 211 txtExec: function (editor, caller) {
224 var editor = this;
225
226 getEditorCommand('youtube')._dropDown( 212 getEditorCommand('youtube')._dropDown(
227 editor, 213 editor,
228 caller, 214 caller,
229 function (id) { 215 function (id) {
230 editor.insertText('[youtube]' + id + '[/youtube]'); 216 editor.insertText('[youtube]' + id + '[/youtube]');