Mercurial Hosting > sceditor
changeset 17:a199722647d0
finish last commit
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 08 Aug 2022 12:28:55 -0600 |
parents | 8bd52902156a |
children | 1334920263a2 |
files | src/formats/bbcode.js src/formats/xhtml.js src/plugins/format.js src/sceditor.js |
diffstat | 4 files changed, 28 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
diff -r 8bd52902156a -r a199722647d0 src/formats/bbcode.js --- a/src/formats/bbcode.js Sun Aug 07 21:41:55 2022 -0600 +++ b/src/formats/bbcode.js Mon Aug 08 12:28:55 2022 -0600 @@ -82,9 +82,7 @@ txtExec: ['[justify]', '[/justify]'] }, font: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('font')._dropDown( editor, caller, @@ -98,9 +96,7 @@ } }, size: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('size')._dropDown( editor, caller, @@ -114,9 +110,7 @@ } }, color: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('color')._dropDown( editor, caller, @@ -130,8 +124,8 @@ } }, bulletlist: { - txtExec: function (caller, selected) { - this.insertText( + txtExec: function (editor, caller, selected) { + editor.insertText( '[ul]\n[li]' + selected.split(/\r?\n/).join('[/li]\n[li]') + '[/li]\n[/ul]' @@ -139,8 +133,8 @@ } }, orderedlist: { - txtExec: function (caller, selected) { - this.insertText( + txtExec: function (editor, caller, selected) { + editor.insertText( '[ol]\n[li]' + selected.split(/\r?\n/).join('[/li]\n[li]') + '[/li]\n[/ol]' @@ -157,9 +151,7 @@ txtExec: ['[code]', '[/code]'] }, image: { - txtExec: function (caller, selected) { - var editor = this; - + txtExec: function (editor, caller, selected) { getEditorCommand('image')._dropDown( editor, caller, @@ -183,9 +175,7 @@ } }, email: { - txtExec: function (caller, selected) { - var editor = this; - + txtExec: function (editor, caller, selected) { getEditorCommand('email')._dropDown( editor, caller, @@ -200,9 +190,7 @@ } }, link: { - txtExec: function (caller, selected) { - var editor = this; - + txtExec: function (editor, caller, selected) { getEditorCommand('link')._dropDown( editor, caller, @@ -220,9 +208,7 @@ txtExec: ['[quote]', '[/quote]'] }, youtube: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('youtube')._dropDown( editor, caller,
diff -r 8bd52902156a -r a199722647d0 src/formats/xhtml.js --- a/src/formats/xhtml.js Sun Aug 07 21:41:55 2022 -0600 +++ b/src/formats/xhtml.js Mon Aug 08 12:28:55 2022 -0600 @@ -58,9 +58,7 @@ txtExec: ['<div style="text-align:justify;">', '</div>'] }, font: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('font')._dropDown( editor, caller, @@ -72,9 +70,7 @@ } }, size: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('size')._dropDown( editor, caller, @@ -86,9 +82,7 @@ } }, color: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('color')._dropDown( editor, caller, @@ -115,9 +109,7 @@ txtExec: ['<code>', '</code>'] }, image: { - txtExec: function (caller, selected) { - var editor = this; - + txtExec: function (editor, caller, selected) { getEditorCommand('image')._dropDown( editor, caller, @@ -141,9 +133,7 @@ } }, email: { - txtExec: function (caller, selected) { - var editor = this; - + txtExec: function (editor, caller, selected) { getEditorCommand('email')._dropDown( editor, caller, @@ -158,9 +148,7 @@ } }, link: { - txtExec: function (caller, selected) { - var editor = this; - + txtExec: function (editor, caller, selected) { getEditorCommand('link')._dropDown( editor, caller, @@ -178,9 +166,7 @@ txtExec: ['<blockquote>', '</blockquote>'] }, youtube: { - txtExec: function (caller) { - var editor = this; - + txtExec: function (editor, caller) { getEditorCommand('youtube')._dropDown( editor, caller,
diff -r 8bd52902156a -r a199722647d0 src/plugins/format.js --- a/src/plugins/format.js Sun Aug 07 21:41:55 2022 -0600 +++ b/src/plugins/format.js Mon Aug 08 12:28:55 2022 -0600 @@ -98,9 +98,8 @@ * @param {node} caller * @private */ - formatCmd = function (caller) { - var editor = this, - content = document.createElement('div'); + formatCmd = function (editor, caller) { + var content = document.createElement('div'); sceditor.utils.each(tags, function (tag, val) { var link = document.createElement('a');
diff -r 8bd52902156a -r a199722647d0 src/sceditor.js --- a/src/sceditor.js Sun Aug 07 21:41:55 2022 -0600 +++ b/src/sceditor.js Mon Aug 08 12:28:55 2022 -0600 @@ -2051,7 +2051,7 @@ editor.createDropDown(caller, 'font-picker', content); }, - exec: function (editor,caller) { + exec: function (editor, caller) { defaultCmds.font._dropDown(editor, caller, function (fontName) { editor.execCommand('fontname', fontName); }); @@ -2078,7 +2078,7 @@ editor.createDropDown(caller, 'fontsize-picker', content); }, - exec: function (editor,caller) { + exec: function (editor, caller) { defaultCmds.size._dropDown(editor, caller, function (fontSize) { editor.execCommand('fontsize', fontSize); }); @@ -2120,7 +2120,7 @@ editor.createDropDown(caller, 'color-picker', content); }, - exec: function (editor,caller) { + exec: function (editor, caller) { defaultCmds.color._dropDown(editor, caller, function (color) { editor.execCommand('forecolor', color); }); @@ -2161,7 +2161,7 @@ // END_COMMAND // START_COMMAND: Paste Text pastetext: { - exec: function (editor,caller) { + exec: function (editor, caller) { var val, content = createElement('div'); @@ -2275,7 +2275,7 @@ // START_COMMAND: Table table: { - exec: function (editor,caller) { + exec: function (editor, caller) { var content = createElement('div'); appendChild(content, _tmpl('table', { @@ -2363,7 +2363,7 @@ editor.createDropDown(caller, 'insertimage', content); }, - exec: function (editor,caller) { + exec: function (editor, caller) { defaultCmds.image._dropDown( editor, caller, @@ -2415,7 +2415,7 @@ editor.createDropDown(caller, 'insertemail', content); }, - exec: function (editor,caller) { + exec: function (editor, caller) { defaultCmds.email._dropDown( editor, caller, @@ -2469,7 +2469,7 @@ editor.createDropDown(caller, 'insertlink', content); }, - exec: function (editor,caller) { + exec: function (editor, caller) { defaultCmds.link._dropDown(editor, caller, function (url, text) { if (text || !editor.getRangeHelper().selectedHtml()) { editor.wysiwygEditorInsertHtml(