Docs Home

String.prototype.parseHTML

@File: /surebert/widget/editor.js

@Description: Parses HTML to for sb.widget.editor dataOut and viewSource methods.


@Param: boolean basicOnly Removes all non basic html is basicOnly =1
@Example:

str = str.parseHTML(1);

String.prototype.removeBlankHTML

@File: /surebert/widget/editor.js

@Description: Removes blank HTML tags


@Example:

var str = 'hello<b></b>world';
str = str.removeBlankHTML();
//str ='helloworld'

String.prototype.stripHTMLComments

@File: /surebert/widget/editor.js

@Description: Strips HTML comments from a string


@Example:

str = str.stripHTMLComments();

String.prototype.stripWordHTML

@File: /surebert/widget/editor.js

@Description: Strips word HTML from a string. The following function is a slight variation of the word cleaner code posted by Weeezl (user @ InteractiveTools forums).


@Example:

str = str.stripWordHTML();

sb.widget.editor

@File: /surebert/widget/editor.js

@Author: Paul Visco http://www.estrip.org?u=paul

@Description: The surebert widget creates a live text editor. It replaces all iframes passed to the constructor with real text editors. if they cannot be built it replaces them with empty textareas. The textareas have setContent and getContent methods just like real sb.widget.editor instances so that you can set and get the data in the same way.


@Param: string id The id of the iframe to replace with an editor
@Param: function onload A function which is run after the editor is created. The 'this' in the function is the editor.
@Example:

<div id="info">
<iframe id="myEditor" ></iframe>
</div>
<script type="text/javascript">

sb.dom.onReady({
    id : '#myEditor',
    onReady : function(){
        myEditor1 = new sb.widget.editor('#myEditor', function(){
            this.dataIn('hello world');
        });
    }
});

</script>

sb.widget.editor.buttons

@File: /surebert/widget/editor.js

@Description: These booleen values toggle the editor buttons on or off on a global scope e.g. all editors on the page

sb.widget.editor.plugin

@File: /surebert/widget/editor.js

@Description: A plugin button maker for sb.editors, any plugins instantiated on the page are applied to every sb.widget.editor instance on the page. Every plugin has three properties.


@Example:

var myTestPlugin = new sb.widget.editor.plugin({
    name : 'plugin',
    title : 'This is a demo plugin',
    handler : function(){
        alert('This does nothing but alerts plugin');
    }
});

sb.widget.editor.plugin

@File: /surebert/widget/editor.js

@Description: A plugin button maker for sb.editors, any plugins instantiated on the page are applied to every sb.widget.editor instance on the page. Every plugin has three properties.


@Example:

var myTestPlugin = new sb.widget.editor.plugin({
    name : 'plugin',
    title : 'This is a demo plugin',
    handler : function(){
        alert('This does nothing but alerts plugin');
    },
    styles : {
        backgroundColor:'green',
        color: 'white'
    }
});

sb.widget.editor.prototype

@File: /surebert/widget/editor.js

@Description: THese are the properties associated with every sb.widget.editor instance