tags:

views:

193

answers:

2

Hello, I'm trying to get around Nicedit, and especially the "removeFormat" function.

The problem is I cannot find the "removeFormat" method source code in the code below. The JS syntax looks strange to me. Can someone help me ?

Sorry, the code is too long. Nicedit is here : http://nicedit.com/download.php

Here is what I found about 'removeFormat in the source code'. But no "removeformat" command ??! :

var nicEditorConfig = bkClass.extend({
buttons: {
    'removeformat': {
        name: __('Supprimer la mise en forme'),
        command: 'removeformat',
        noActive: true
    }
},
iconsPath: 'http://js.nicedit.com/nicEditIcons-latest.gif',
buttonList: ['save', 'bold', 'italic', 'underline', 'left', 'center', 'right', 'justify', 'ol', 'ul', 'fontSize', 'fontFamily', 'fontFormat', 'indent', 'outdent', 'image', 'upload', 'link', 'unlink', 'forecolor', 'bgcolor'],
iconList: {
    "xhtml": 1,
    "bgcolor": 2,
    "forecolor": 3,
    "bold": 4,
    "center": 5,
    "hr": 6,
    "indent": 7,
    "italic": 8,
    "justify": 9,
    "left": 10,
    "ol": 11,
    "outdent": 12,
    "removeformat": 13,
    "right": 14,
    "save": 25,
    "strikethrough": 16,
    "subscript": 17,
    "superscript": 18,
    "ul": 19,
    "underline": 20,
    "image": 21,
    "link": 22,
    "unlink": 23,
    "close": 24,
    "arrow": 26,
    "upload": 27,
    "question":2
}

});`

A: 

Nicedit seems to be almost dead, isn't it ?

Franck
A: 

same problem here, mysteriously..there is nothing to be found like 'removeformat' or 'removeFormat' in the source. However I found out why :

many command-strings are redirected to this function:

nicCommand : function(cmd,args) { document.execCommand(cmd,false,args); }

The execCommand is supported by many major browsers (including IE):

https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commands

Coder of salvation
Yes, you got it ! Nicedit uses browsers internal commands.
Franck