comparison src/sceditor.js @ 17:a199722647d0

finish last commit
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 08 Aug 2022 12:28:55 -0600
parents 8bd52902156a
children 1334920263a2
comparison
equal deleted inserted replaced
16:8bd52902156a 17:a199722647d0
2049 }, true)); 2049 }, true));
2050 }); 2050 });
2051 2051
2052 editor.createDropDown(caller, 'font-picker', content); 2052 editor.createDropDown(caller, 'font-picker', content);
2053 }, 2053 },
2054 exec: function (editor,caller) { 2054 exec: function (editor, caller) {
2055 defaultCmds.font._dropDown(editor, caller, function (fontName) { 2055 defaultCmds.font._dropDown(editor, caller, function (fontName) {
2056 editor.execCommand('fontname', fontName); 2056 editor.execCommand('fontname', fontName);
2057 }); 2057 });
2058 }, 2058 },
2059 tooltip: 'Font Name' 2059 tooltip: 'Font Name'
2076 }, true)); 2076 }, true));
2077 } 2077 }
2078 2078
2079 editor.createDropDown(caller, 'fontsize-picker', content); 2079 editor.createDropDown(caller, 'fontsize-picker', content);
2080 }, 2080 },
2081 exec: function (editor,caller) { 2081 exec: function (editor, caller) {
2082 defaultCmds.size._dropDown(editor, caller, function (fontSize) { 2082 defaultCmds.size._dropDown(editor, caller, function (fontSize) {
2083 editor.execCommand('fontsize', fontSize); 2083 editor.execCommand('fontsize', fontSize);
2084 }); 2084 });
2085 }, 2085 },
2086 tooltip: 'Font Size' 2086 tooltip: 'Font Size'
2118 e.preventDefault(); 2118 e.preventDefault();
2119 }); 2119 });
2120 2120
2121 editor.createDropDown(caller, 'color-picker', content); 2121 editor.createDropDown(caller, 'color-picker', content);
2122 }, 2122 },
2123 exec: function (editor,caller) { 2123 exec: function (editor, caller) {
2124 defaultCmds.color._dropDown(editor, caller, function (color) { 2124 defaultCmds.color._dropDown(editor, caller, function (color) {
2125 editor.execCommand('forecolor', color); 2125 editor.execCommand('forecolor', color);
2126 }); 2126 });
2127 }, 2127 },
2128 tooltip: 'Font Color' 2128 tooltip: 'Font Color'
2159 'Please use the keyboard shortcut Ctrl/Cmd-V' 2159 'Please use the keyboard shortcut Ctrl/Cmd-V'
2160 }, 2160 },
2161 // END_COMMAND 2161 // END_COMMAND
2162 // START_COMMAND: Paste Text 2162 // START_COMMAND: Paste Text
2163 pastetext: { 2163 pastetext: {
2164 exec: function (editor,caller) { 2164 exec: function (editor, caller) {
2165 var val, 2165 var val,
2166 content = createElement('div'); 2166 content = createElement('div');
2167 2167
2168 appendChild(content, _tmpl('pastetext', { 2168 appendChild(content, _tmpl('pastetext', {
2169 label: editor._( 2169 label: editor._(
2273 }, 2273 },
2274 // END_COMMAND 2274 // END_COMMAND
2275 2275
2276 // START_COMMAND: Table 2276 // START_COMMAND: Table
2277 table: { 2277 table: {
2278 exec: function (editor,caller) { 2278 exec: function (editor, caller) {
2279 var content = createElement('div'); 2279 var content = createElement('div');
2280 2280
2281 appendChild(content, _tmpl('table', { 2281 appendChild(content, _tmpl('table', {
2282 rows: editor._('Rows:'), 2282 rows: editor._('Rows:'),
2283 cols: editor._('Cols:'), 2283 cols: editor._('Cols:'),
2361 e.preventDefault(); 2361 e.preventDefault();
2362 }); 2362 });
2363 2363
2364 editor.createDropDown(caller, 'insertimage', content); 2364 editor.createDropDown(caller, 'insertimage', content);
2365 }, 2365 },
2366 exec: function (editor,caller) { 2366 exec: function (editor, caller) {
2367 defaultCmds.image._dropDown( 2367 defaultCmds.image._dropDown(
2368 editor, 2368 editor,
2369 caller, 2369 caller,
2370 '', 2370 '',
2371 function (url, width, height) { 2371 function (url, width, height) {
2413 e.preventDefault(); 2413 e.preventDefault();
2414 }); 2414 });
2415 2415
2416 editor.createDropDown(caller, 'insertemail', content); 2416 editor.createDropDown(caller, 'insertemail', content);
2417 }, 2417 },
2418 exec: function (editor,caller) { 2418 exec: function (editor, caller) {
2419 defaultCmds.email._dropDown( 2419 defaultCmds.email._dropDown(
2420 editor, 2420 editor,
2421 caller, 2421 caller,
2422 function (email, text) { 2422 function (email, text) {
2423 if (!editor.getRangeHelper().selectedHtml() || text) { 2423 if (!editor.getRangeHelper().selectedHtml() || text) {
2467 } 2467 }
2468 }, EVENT_CAPTURE); 2468 }, EVENT_CAPTURE);
2469 2469
2470 editor.createDropDown(caller, 'insertlink', content); 2470 editor.createDropDown(caller, 'insertlink', content);
2471 }, 2471 },
2472 exec: function (editor,caller) { 2472 exec: function (editor, caller) {
2473 defaultCmds.link._dropDown(editor, caller, function (url, text) { 2473 defaultCmds.link._dropDown(editor, caller, function (url, text) {
2474 if (text || !editor.getRangeHelper().selectedHtml()) { 2474 if (text || !editor.getRangeHelper().selectedHtml()) {
2475 editor.wysiwygEditorInsertHtml( 2475 editor.wysiwygEditorInsertHtml(
2476 '<a href="' + entities(url) + '">' + 2476 '<a href="' + entities(url) + '">' +
2477 entities(text || url) + 2477 entities(text || url) +