How to use coUBB Rich Editor V0.2

July 11th, 2010 by LuckyMouse Leave a reply »

coUBB Rich Editor is more easy to use in verion 0.2.

(Test past: IE , FF, OPERA)

You must use DIV to contain the textarea or input which want to load coUBB editor, or it would have error under IE.

You only need to add below code before ‘</body>’.

<script type=”text/javascript” src=”http://api-s1.colorfulphp.com/ubb/ubb.js”></script>

And you may config your editor textarea first. Put the config codes before that line.

(Please replace ‘ to english quote, wordpress always replace to other quote….)

(Please visit wiki for the correct js code: http://wiki.colorfulphp.com/index.php?title=CoUBB_Editor_0.2)

<script type=”text/javascript”><!–
//you may delete any line in config, then it will use default value of that argument.
coUBB_c = {
‘mode’:'basic’,       //editor type, there are only basic mode, so don’t modify. you may delete this line.
‘ver’:'0.2′,          // we use 0.2 version here, so don’t modify. you may delete this line.
‘width’:'99%’,        //editor default with, if it is a textarea, we will use textarea with
‘height’:'200px’,     //editor default height, if it is a textarea, we will use textarea height
‘id’:'do_content’,    //textarea or input element ID
‘auto’:1,             //auto add editor, recommend set to 1.
‘css’:':default’,     //editor css, you may use your path: ‘css’:'http://yourpath/css’  (don’t add .css)
‘css_e’:”,           //editor input area css, same as above
‘css_es’:”,          //editor input area css string, you can put the css style here instead load css path above. suche as: ‘css_es’:'<style type=”text/css”>body {font: 12px Arial,Verdana,Tahoma;color:#666;background:#fff;} blockquote {border:1px solid #ccc;background:#f7f7f7;margin:5px;padding:5px;} img {border: 0}</style>’
‘is_html’:0,          //Is the default value is html? 0 is UBB code.
’smile’:”,           //you may add your smile here, see below “about smile”
’smile_’:{‘base’:”, ‘ext’:”, ‘type’:”} //smile type, see below “about smile”
};
//–>
</script>

About Smile:

You may set you smile in ver0.2.

’smile’ : {
‘id’   : ‘imgname’,
‘id2′ : ‘imagename2′
}

‘id’  is use to set smile class “span.coUBB_smilie_id” (please see CSS article for more information)

‘imagename’  the smile image name, don’t add ext(such as .gif, .png). you need set “ext” use ’smile_’:{‘ext’:’.gif’}, default value is “.png”.

You may not set image here instead of a string “:)”, if you like to inster “:)” as a smile image in your editor. You need set ’smile_”:{type”:”str”} too.

If you use image of smile, you should set the image base path in ’smile_’ : {‘base’:'dirname/’}

Advertisement

Leave a Reply

Disable UBB Code:

UBB WYSIWYG Editor ColorfulPHP