=== File http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.colors.js ===
document.htmlbox_colors=function(){
>>> return ['white', 'FFFFFF', 'ivory', 'FFFFF0', 'lightyellow', 'FFFFE0', 'yellow', 'FFFF00', 'snow', 'FFFAFA', 'floralwhite', 'FFFAF0', 'lemonchiffon', 'FFFACD', 'cornsilk', 'FFF8DC', 'seashell', 'FFF5EE', 'lavenderblush', 'FFF0F5', 'papayawhip', 'FFEFD5', 'blanchedalmond', 'FFEBCD', 'mistyrose', 'F FE4E1', 'bisque', 'FFE4C4', 'moccasin', 'FFE4B5', 'navajowhite', 'FFDEAD', 'peachpuff', 'FFDAB9', 'gold', 'FFD700', 'pink', 'FFC0CB', 'lightpink ', 'FFB6C1', 'orange', 'FFA500', 'lightsalmon', 'FFA07A', 'darkorange', 'FF8C00', 'coral', 'FF7F50', 'hotpink', 'FF69B4', 'tomato', 'FF6347', 'orangered', 'FF4500', 'deeppink', 'FF1493', 'magenta', 'FF00FF', 'fuchsia', 'FF00FF', 'red', 'FF0000', 'oldlace', 'FDF5E6', 'lightgoldenrodyellow', 'FAFAD2', ' linen', 'FAF0E6', 'antiquewhite', 'FAEBD7', 'salmon', 'FA8072', 'ghostwhite', 'F8F8FF', 'mintcream', 'F5FFFA', 'whitesmoke', 'F5F5F5', 'beige', ' F5F5DC', 'wheat', 'F5DEB3', 'sandybrown', 'F4A460', 'azure', 'F0FFFF', 'honeydew', 'F0FFF0', 'aliceblue', 'F0F8FF', 'khaki', 'F0E68C', 'lightcoral ', 'F08080', 'palegoldenrod', 'EEE8AA', 'violet', 'EE82EE', 'darksalmon', 'E9967A', 'lavender', 'E6E6FA', 'lightcyan', 'E0FFFF', 'burlywood', 'DEB887', 'plum', 'DDA0DD', 'gainsboro', 'DCDCDC', 'crimson', 'DC143C', 'palevioletred', 'DB7093', 'goldenrod', 'DAA520', 'orchid', 'DA70D6', 'thistle', 'D8BFD8', 'lightgrey', 'D3D3D3', 'tan', 'D2B48C', 'chocolate', 'D2691E', 'peru', 'CD853F', 'indianred', 'CD5C5C', 'mediumvioletred', 'C71585', 'silver', 'C0C0C0', 'darkkhaki', 'BDB76B', 'rosybrown', 'BC8F8F', 'mediumorchid', 'BA55D3', 'darkgoldenrod', 'B8860B', 'firebrick', 'B22222', 'powderblue', 'B0E0E6', 'lightsteelblue', 'B0C4DE', 'paleturquoise', 'AFEEEE', 'greenyellow', 'ADFF2F', 'lightblue', 'ADD8E6', 'darkgray', 'A9A9A9', 'brown', 'A52A2A', 'sienna', "A0522D", 'yellowgreen', "9ACD32", 'darkorchid', '9932CC', 'palegreen', '98FB98', 'darkviolet', '9400D3', 'mediumpurple', '9370DB', 'lightgreen', '90EE90', 'darkseagreen', '8FBC8F', 'saddlebrown', '8B4513', 'darkmagenta', '8B008B', 'darkred', '8B0000', 'blueviolet', '8A2BE2', 'lightskyblue', '87CEFA', 'skyblue', '87CEEB', 'gray', '808080', 'olive', '808000', 'purple', '800080', 'maroon', '800000', 'aquamarine', '7FFFD4', 'chartreuse', '7FFF00', 'lawngreen', '7CFC00', 'mediumslateblue', '7B68EE', 'lightslategray', '778899', 'slategray', '708090', 'olivedrab', '6B8E23', 'slateblue', '6A5ACD', 'dimgray', '696969', 'mediumaquamarine', '66CDAA', 'cornflowerblue', '6495ED', 'cadetblue', '5F9EA0', 'darkolivegreen', '556B2F', 'indigo', '4B0082', 'mediumturquoise', '48D1CC', 'darkslateblue', '483D8B', 'steelblue', '4682B4', 'royalblue', '4169E1', 'turquoise', '40E0D0', 'mediumseagreen', '3CB371', 'limegreen', '32CD32', 'darkslategray', '2F4F4F', 'seagreen', '2E8B57', 'forestgreen', '228B22', 'lightseagreen', '20B2AA', 'dodgerblue', '1E90FF', 'midnightblue', '191970', 'cyan', '00FFFF', 'aqua', '00FFFF', 'springgreen', '00FF7F', 'lime', '00FF00', 'mediumspringgreen', '00FA9A', 'darkturquoise', '00CED1', 'deepskyblue', '00BFFF', 'darkcyan', "008B8B", 'teal', "008080", 'green', '008000', 'darkgreen', '006400', 'blue', '0000FF', 'mediumblue', '0000CD', 'darkblue', '00008B', 'navy', '000080', 'black', '000000'];
};
=== File http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.styles.js ===
document.htmlbox_styles=function(){
>>> return [
[
'Pull Orange - Right',
'
',
'
'
],
[
'Pull Orange - Left',
'',
'
'
],
[
'Curly',
'',
'
'
]
];
};
=== File http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.syntax.js ===
document.htmlbox_syntax=function(){
>>> return [
[
'Actionscript',
'Actionscript Code
',
'
'
],
[
'ADA',
'ADA Code
',
'
'
],
[
'Applescript',
'Applescript Code
',
'
'
],
[
'ASP',
'ASP Code
',
'
'
],
[
'Basic',
'Basic Code
',
'
'
],
[
'C#',
'C# Code
',
'
'
],
[
'C++',
'C++ Code
',
'
'
],
[
'ColdFusion',
'ColdFusion Code
',
'
'
],
[
'CSS',
'',
'
'
],
[
'HTML',
'
HTML Code
',
'
'
],
[
'Java',
'
Java Code
',
'
'
],
[
'JavaScript',
'
JavaScript Code
',
'
'
],
[
'Lisp',
'
Lisp Code
',
'
'
],
[
'Lua',
'
Lua Code
',
'
'
],
[
'MySQL',
'
MySQL Code
',
'
'
],
[
'Perl',
'
Perl Code
',
'
'
],
[
'PHP',
'
PHP Code
',
'
'
],
[
'Python',
'
Python Code
',
'
'
],
[
'Ruby',
'
Ruby Code
',
'
'
],
[
'Scheme',
'
Scheme Code
',
'
'
],
[
'SQL',
'
SQL Code
',
'
'
],
[
'VB.NET',
'
VB.NET Code
',
'
'
],
[
'XML',
'
XML Code
',
'
'
]
];
};
=== File http://localhost/subjectPrograms/ClientSideOnly/htmledit/xhtml.js ===
/*
Html2Xhtml : Javascript Mini HTML to XHTML Parser
-------------------------------------------------
Current version: 0.3
Copyright 2006 All rights reserved. Jacob Lee
Free for non-commercial && commercial use.
*/
>>> function getXHTML(data){return new Html2Xhtml(data).parse()};function Html2Xhtml(data){this.data=data||''};Html2Xhtml.prototype.setHTML=function(data){this.data=data||this.data};Html2Xhtml.prototype.parse=function(){var state=0;var xhtml='';var p=0;var unget=false;var tagname='';var attrname='';var attrval='';var quot='';var data=this.data;var len=data.length;var phpval='';var tagtype=0;var insidepre=false;var codetype='';while(1){if(p>=len&&!unget){return xhtml}if(unget){unget=false}else{var c=data.substr(p++,1)}switch(state){case 0:if(c=='<'){state=1;break}xhtml+=c;break;case 1:if(/[a-zA-Z]/.test(c)){state=2;tagtype=1;tagname=c.toLowerCase();break}if(c=='/'){state=2;tagtype=-1;break}if(c=='!'){if(data.substr(p,2)=='--'){xhtml+='';state=0;break}xhtml+=c;break;case 10:if(c=='>'){state=0}xhtml+=c;break;case 11:if(c=="'"||c=='"'){quot=c;state=12;break}if(c==codetype&&data.substr(p,1)=='>'){state=0;xhtml+=c+'>';codetype='';p++;break}xhtml+=c;break;case 12:if(c==quot){state=11;xhtml+=quot+Html2Xhtml.escapeQuot(phpval,quot)+quot;phpval=quot='';break}phpval+=c;break;case 13:if(c=='<'&&data.substr(p,tagname.length+1).toLowerCase()=='/'+tagname){unget=true;state=0;tagname='';break}if(tagname=='textarea'){xhtml+=Html2Xhtml.escapeHTMLChar(c)}else{xhtml+=c}break}}return xhtml};Html2Xhtml.escapeQuot=function(str,quot){if(!quot){quot='"'}if(quot=='"'){return str.replace(/"/ig,'\\"')}return str.replace(/'/ig,"\\'")};Html2Xhtml.escapeHTMLChar=function(c){if(c=='&'){return'&'}if(c=='<'){return'<'}if(c=='>'){return'>'}return c};Html2Xhtml.isSpaceChar={' ':1,'\r':1,'\n':1,'\t':1};Html2Xhtml.isEmptyTag={'area':1,'base':1,'basefont':1,'br':1,'hr':1,'img':1,'input':1,'link':1,'meta':1,'param':1};Html2Xhtml.isEmptyAttr={'checked':1,'compact':1,'declare':1,'defer':1,'disabled':1,'ismap':1,'multiple':1,'noresize':1,'nosave':1,'noshade':1,'nowrap':1,'readonly':1,'selected':1};Html2Xhtml.hasNLBefore={'div':1,'p':1,'table':1,'tbody':1,'tr':1,'td':1,'th':1,'title':1,'head':1,'body':1,'script':1,'comment':1,'li':1,'meta':1,'h1':1,'h2':1,'h3':1,'h4':1,'h5':1,'h6':1,'hr':1,'ul':1,'ol':1,'option':1,'link':1};Html2Xhtml.hasNLAfter={'html':1,'head':1,'body':1,'p':1,'th':1,'style':1};Html2Xhtml.dontAnalyzeContent={'textarea':1,'script':1,'style':1};
=== File http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js ===
//============================= START OF CLASS ==============================//
// CLASS: HtmlBox //
//===========================================================================//
/**
* HtmlBox is a cross-browser widget that replaces the normal textboxes with
* rich text area like in OpenOffice Text. It has Ajax support out of the box.
* PS. It requires JQuery in order to function.
* TODO: Smilies, CSS for Safari
*
*
* Copyright@2007-2009 Remiya Solutions All rights reserved!
* @author Remiya Solutions
* @version 4.0
*/
>>> (function($){
>>> $.fn.htmlbox=function(options){
// START: Settings
// Are there any plugins?
>>> var colors = (typeof document.htmlbox_colors === 'function')?document.htmlbox_colors():['silver','silver','white','white','yellow','yellow','orange','orange','red','red','green','green','blue','blue','brown','brown','black','black'];
>>> var styles = (typeof document.htmlbox_styles === 'function')?document.htmlbox_styles():[['No Styles','','']];
>>> var syntax = (typeof document.htmlbox_syntax === 'function')?document.htmlbox_syntax():[['No Syntax','','']];
>>> var urm = (typeof htmlbox_undo_redo_manager === 'function')?new htmlbox_undo_redo_manager():false;
// Default option
>>> var d={
toolbars:[["bold","italic","underline"]], // Buttons
idir:"./images/",// HtmlBox Image Directory, This is needed for the images to work
icons:"default", // Icon set
about:true,
skin:"default", // Skin, silver
output:"xhtml", // Output
toolbar_height:24,// Toolbar height
tool_height:16, // Tools height
tool_width:16, // Tools width
tool_image_height:16, // Tools image height
tool_image_width:16, // Tools image width
css:"body{margin:3px;font-family:verdana;font-size:11px;}p{margin:0px;}",
--- success:function(data){alert(data);}, // AJAX on success
--- error:function(a,b,c){return this;} // AJAX on error
};
// User options
>>> d = $.extend(d, options);
// Is forward slash added to the image directory
>>> if(d.idir.substring(d.idir.length-1)!="/"){d.idir+="/";}
// END: Settings
// ------------- START: PRIVATE METHODS -----------------//
//========================= START OF METHOD ===========================//
// METHOD: get_selection //
//=====================================================================//
/**
* Returns the selected (X)HTML code
* @access private
*/
>>> var get_selection = function(){
var range;
>>> if($.browser.msie){
--- range = d.iframe.contentWindow.document.selection.createRange();
--- if (range.htmlText && range.text){return range.htmlText;}
>>> }else{
>>> if (d.iframe.contentWindow.getSelection) {
--- var selection = d.iframe.contentWindow.getSelection();
--- if (selection.rangeCount>0&&window.XMLSerializer){
--- range=selection.getRangeAt(0);
--- var html=new XMLSerializer().serializeToString(range.cloneContents());
--- return html;
--- }if (selection.rangeCount > 0) {
--- range = selection.getRangeAt(0);
--- var clonedSelection = range.cloneContents();
--- var div = document.createElement('div');
--- div.appendChild(clonedSelection);
--- return div.innerHTML;
}
}
}
};
//=====================================================================//
// METHOD: get_selection //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: in_array //
//=====================================================================//
/**
* Coppies the PHP in_array function. This is useful for Objects.
* @access private
*/
>>> var in_array=function(o,a){
>>> for (var i in a){ if((i===o)){return true;} }
>>> return false;
};
//=====================================================================//
// METHOD: in_array //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: insert_text //
//=====================================================================//
/**
* Inserts text at the cursor position or selection
* @access private
*/
>>> var insert_text = function(text,start,end){
--- if($.browser.msie){
--- if(typeof d.idoc.selection !== "undefined" && d.idoc.selection.type !== "Text" && d.idoc.selection.type !== "None"){start = false;d.idoc.selection.clear();}
--- var sel = d.idoc.selection.createRange();sel.pasteHTML(text);
--- if (text.indexOf("\n") === -1) {
--- if (start === false) {} else {
--- if (typeof start !== "undefined") {
--- sel.moveStart("character", - text.length + start);
--- sel.moveEnd("character", - end);
--- } else {
--- sel.moveStart("character", - text.length);
}
}
--- sel.select();
}
--- }else{
--- d.idoc.execCommand("insertHTML", false, text);
}
};
//=====================================================================//
// METHOD: insert_text //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: keyup //
//=====================================================================//
/**
* Keyup event.
* @access private
*/
>>> var keyup = function(e){
// Updating the textarea component, so whenever it is posted it will send all the data
--- var html = $("#1"+d.id).is(":visible")?$("#"+d.id).val():html = d.iframe.contentWindow.document.body.innerHTML;
--- if(urm){urm.add(html);} // Undo Redo
--- html = (typeof getXHTML === 'function')?getXHTML(html):html;
--- $("#"+d.id).val(html);
--- if(undefined!==d.change){d.change();}
};
//=====================================================================//
// METHOD: keyup //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: style //
//=====================================================================//
/**
* Sets the CSS style to the HtmlBox iframe
* @access private
*/
>>> var style = function(){
// START: HtmlBox Style
>>> if(d.css.indexOf("background:")===-1){d.css+="body{background:white;}";}
>>> if(d.css.indexOf("background-image:")===-1){
--- d.css=d.css+"body{background-image:url("+d.idir+"logo.gif);background-position:top right;background-repeat:no-repeat;}";
}
>>> if( d.idoc.createStyleSheet) {
--- d.idoc.createStyleSheet().cssText=d.css;
>>> }else {
>>> var css=d.idoc.createElement('link');
>>> css.rel='stylesheet'; css.href='data:text/css,'+escape(d.css);
>>> if($.browser.opera){
--- d.idoc.documentElement.appendChild(css);
>>> }else{
>>> d.idoc.getElementsByTagName("head")[0].appendChild(css);
}
}
// END: HtmlBox Style
};
//=====================================================================//
// METHOD: style //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: toolbar //
//=====================================================================//
/**
* The toolbar of HtmlBox
* @return this
* @access private
*/
>>> var toolbar=function(){
>>> var h = "";
>>> if(d.about&&!in_array(d.toolbars[0],"about")){d.toolbars[0][d.toolbars[0].length]="separator";d.toolbars[0][d.toolbars[0].length]="about";}
>>> for(var k=0;k>> var toolbar = d.toolbars[k];
>>> h += "";
>>> for(var i=0;i<(toolbar.length);i++){
>>> var img = (d.icons=="default")?d.idir+"default/"+toolbar[i]+".gif":d.idir+d.icons+"/"+toolbar[i]+".png";
>>> if(undefined===toolbar[i]){continue;}
// START: Custom button
>>> else if(typeof(toolbar[i])!='string'){
--- img = d.idir+d.icons+"/"+toolbar[i].icon;
--- var cmd = "var cmd = unescape(\""+escape( toolbar[i].command.toString() )+"\");eval(\"var fn=\"+cmd);fn()'";
--- h += " ";
}
// END: Custom button
>>> else if(toolbar[i]==="separator"){h += " ";}
>>> else if(toolbar[i]==="fontsize"){
>>> h += "- SIZE - 1 2 3 4 5 6 7 ";
>>> }else if(toolbar[i]==="fontfamily"){
>>> h += "- FONT - Arial Courier Cursive Georgia Monospace Tahoma Verdana ";
>>> }else if(toolbar[i]==="formats"){
>>> h += "- FORMATS - Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 Paragraph First Indent Preformatted ";
>>> }else if(toolbar[i]==="fontcolor"){
>>> h += "-COLOR- ";
>>> for(var m=0;m>> h+=""+colors[m]+" ";
}
>>> h += " ";
>>> }else if(toolbar[i]==="highlight"){
>>> h += "-HIGHLIGHT- ";
>>> for(var n=0;n>> h+=""+colors[n]+" ";
}
>>> h += " ";
>>> }else if(toolbar[i]==="styles"){
>>> h += "-STYLES- ";
>>> for(var o=0;o>> h+=""+styles[o][0]+" ";
}
>>> h += " ";
>>> }else if(toolbar[i]==="syntax"){
>>> h += "-SYNTAX- ";
>>> for(var p=0;p>> h+=""+syntax[p][0]+" ";
}
>>> h += " ";
}
// Commands
>>> var cmds = {"about":"About","bold":"Bold","center":"Center","code":"View Code","copy":"Copy","cut":"Cut","hr":"Insert Line","link":"Insert Link","image":"Insert Image","indent":"Indent","italic":"Italic","justify":"Justify","left":"Left","ol":"Numbered List","outdent":"Outdent","paragraph":"Insert Paragraph","paste":"Paste","quote":"Quote","redo":"Redo","removeformat":"Remove Format","right":"Right","strike":"Strikethrough","striptags":"Strip Tags","sub":"Subscript","sup":"Superscript","ul":"Bulleted List","underline":"Underline","undo":"Undo","unlink":"Remove Link"};
>>> if(in_array(toolbar[i],cmds)){h += " ";}
}
>>> h += "
";
}
>>> return h;
};
//=====================================================================//
// METHOD: toolbar //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: wrap_tags //
//=====================================================================//
/**
* Wraps tags around the cursor position or selection
* @access private
*/
>>> this.wrap_tags = function(start,end){
>>> var sel = get_selection();
--- if(undefined===sel){sel="";}
--- if(undefined===end){end="";}
--- insert_text(start+sel+end,start.length,end.length);
};
//=====================================================================//
// METHOD: wrap_tags //
//========================== END OF METHOD ============================//
// -------------- END: PRIVATE METHODS ------------------//
// ------------- START: PUBLIC METHODS -----------------//
//========================= START OF METHOD ===========================//
// METHOD: _init //
//=====================================================================//
/**
* Draws the HtmlBox on the screen
* @return this
* @access private
*/
>>> this._init = function(is_init){
>>> if(undefined===window.global_hb){global_hb=[];}
>>> if(!$(this).attr("id")){$(this).attr("id","jqhb_"+global_hb.length);d.id="jqhb_"+global_hb.length;global_hb[d.id]=global_hb;}else{d.id=$(this).attr("id");}
>>> if(undefined === global_hb[d.id]){global_hb[d.id]=this;}
// START: Timeout to allow creation of DesignMode
//if(undefined===is_init){setTimeout("global_hb['"+d.id+"'].init(true)",250);return false;}
// END: Timeout to allow creation of DesignMode
>>> d.ta_wrap_id = d.id+"_wrap";
>>> var w=$(this).css("width");var h=$(this).css("height");$(this).wrap("");
// START: Appending toolbar
>>> $(this).parent().parent().parent().parent().prepend(toolbar());
>>> $("."+d.id+"_tb").height(d.toolbar_height);
>>> $("."+d.id+"_html_button").each(function(){
// Set tool dimension
>>> $(this).width(d.tool_width).height(d.tool_height);
// Set image dimension
>>> $(this).find("image").each(function(){$(this).width(d.tool_image_width).height(d.tool_image_height);});
// Set borders
>>> $(this).css("border","1px solid transparent").css("background","transparent").css("margin","1px 1px 1px 1px").css("padding","1px");
>>> $(this).mouseover(function(){$(this).css("border","1px solid #BFCAFF").css("background","#EFF2FF");});
>>> $(this).mouseout(function(){$(this).css("border","1px solid transparent").css("background","transparent");});
}
);
// Selectors
>>> $("."+d.id+"_tb").find("select").each(function(){
>>> $(this).css("border","1px solid #E9EAEF").css("background","transparent").css("margin","2px 2px 3px 2px");
>>> if($.browser.mozilla){$(this).css("padding","0").css("position","relative").css("top","-2px");}
}
);
// END: Appending toolbar
// START: Skin
// default
>>> var hb_border = "1px solid #7F7647";
>>> var hb_background = "#DFDDD1";
>>> var tb_border = "1px solid #7F7647";
>>> if(d.skin=="blue"){
>>> hb_border = "1px solid #7E9DB9";
>>> hb_background = "#D7E3F2";
>>> tb_border = "1px solid #7E9DB9";
}
>>> if(d.skin=="red"){
--- hb_border = "1px solid #B91E00";
--- hb_background = "#FFD7CF";
--- tb_border = "1px solid #B91E00";
}
>>> if(d.skin=="green"){
--- hb_border = "1px solid #8DB900";
--- hb_background = "#D5EF86";
--- tb_border = "1px solid #8DB900";
}
>>> if(d.skin=="silver"){
--- hb_border = "1px solid #DDDDDD";
--- hb_background = "#F4F4F3";
--- tb_border = "1px solid #DDDDDD";
}
>>> $("#"+d.id+"_wrap").css("border",hb_border);
>>> $("#"+d.id+"_wrap").css("background",hb_background);
>>> $("#"+d.id+"_container").css("background","white");
>>> $("."+d.id+"_tb").css("border-bottom",tb_border);
//$("."+d.id+"_tb").css("background-image","url("+d.idir+"bg_blue.gif)");
//style='background:silver;border-bottom:1px outset white'
// END: Skin
>>> try {
>>> var iframe=document.createElement("IFRAME");// var doc=null;
>>> $(iframe).css("width",w).css("height",h).attr("id",d.id+"_html").css("border","0");
>>> $(this).parent().prepend(iframe);
// START: Shortcuts for less code
>>> d.iframe = iframe;
>>> d.idoc = document;
// END: Shortcuts
>>> d.idoc.designMode="on";
// START: Insert text
// Is there text in the textbox?
>>> var text = ($(this).val()==="")?"":$(this).val();
>>> if($.browser.mozilla||$.browser.safari){
//if(text===""){text=" ";}
--- d.idoc.open('text/html', 'replace'); d.idoc.write(text); d.idoc.close();
>>> }else{
>>> if(text!==""){d.idoc.write(text);}
}
// Needed by browsers other than MSIE to become editable
>>> if($.browser.msie===false){document.body.contentEditable = true;}
// END: Insert text
// START: HtmlBox Style
>>> if(d.css.indexOf("background:")===-1){d.css+="body{background:white;}";}
>>> if(d.css.indexOf("background-image:")===-1){
>>> d.css=d.css+"body{background-image:url("+d.idir+"logo.gif);background-position:top right;background-repeat:no-repeat;}";
}
>>> if(d.idoc.createStyleSheet) {
--- setTimeout("global_hb['"+d.id+"'].set_text(global_hb['"+d.id+"'].get_html())",10);
>>> }else {style();}
// END: HtmlBox Style
// START: Adding events
>>> if(document.attachEvent){
--- document.attachEvent("onkeyup", keyup);
>>> }else{
>>> document.addEventListener("keyup",keyup,false);
}
>>> $(this).hide();
--- }catch(e){
--- alert("This rich text component is not supported by your browser.\n"+e);
--- $(this).show();
--- }
>>> return this;
};
//=====================================================================//
// METHOD: _init //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: cmd //
//=====================================================================//
/**
* Executes a user-specified command
* @since 2.0
* @return this
*/
>>> this.cmd = function(cmd,arg1){
// When user clicks toolbar button make sure it always targets its respective WYSIWYG
>>> d.iframe.focus();
// START: Prepare commands
>>> if(cmd==="paragraph"){cmd="format";arg1="p";}
>>> var cmds = {"center":"justifycenter","hr":"inserthorizontalrule","justify":"justifyfull","left":"justifyleft","ol":"insertorderedlist","right":"justifyright","strike":"strikethrough","sub":"subscript","sup":"superscript","ul":"insertunorderedlist"};
>>> if(in_array(cmd,cmds)){cmd=cmds[cmd];}
// END: Prepare commands
>>> if(cmd==="code"){
--- var text = this.get_html();
--- if($("#"+d.id).is(":visible")){
--- $("#"+d.id).hide();
--- $("#"+d.id+"_html").show();
--- this.set_text(text);
--- }else{
--- $("#"+d.id).show();
--- $("#"+d.id+"_html").hide();
--- this.set_text(text);
--- $("#"+d.id).focus();
}
>>> }else if(cmd==="link"){
>>> d.idoc.execCommand("createlink", false, prompt("Paste Web Address URL Here:"));
>>> }else if(cmd==="image"){
--- d.idoc.execCommand("insertimage", false, prompt("Paste Image URL Here:"));
>>> }else if(cmd==="fontsize"){
--- d.idoc.execCommand(cmd, false,arg1);
>>> }else if(cmd==="backcolor"){
--- if($.browser.msie){
--- d.idoc.execCommand("backcolor", false,arg1);
--- }else{
--- d.idoc.execCommand("hilitecolor", false,arg1);
}
>>> }else if(cmd==="fontcolor"){
--- d.idoc.execCommand("forecolor", false,arg1);
>>> }else if(cmd==="fontname"){
--- d.idoc.execCommand(cmd, false, arg1);
>>> }else if(cmd==="cut"){
>>> if($.browser.msie === false){
>>> alert("Available in IExplore only.\nUse CTRL+X to cut text!");
--- }else{
--- d.idoc.execCommand('Cut');
}
>>> }else if(cmd==="copy"){
--- if($.browser.msie === false){
--- alert("Available in IExplore only.\nUse CTRL+C to copy text!");
--- }else{
--- d.idoc.execCommand('Copy');
}
>>> }else if(cmd==="paste"){
>>> if($.browser.msie === false){
>>> alert("Available in IExplore only.\nUse CTRL+V to paste text!");
--- }else{
--- d.idoc.execCommand('Paste');
}
>>> }else if(cmd==="format"){
--- if(arg1==="pindent"){this.wrap_tags('','
');}
--- else if(arg1!==""){d.idoc.execCommand('formatBlock', false, "<"+arg1+">");}
>>> }else if(cmd==="striptags"){
>>> var sel = get_selection();
--- sel = sel.replace(/(<([^>]+)>)/ig,"");
--- insert_text(sel);
>>> }else if(cmd==="quote"){
>>> this.wrap_tags('Quote
','
');
>>> }else if(cmd==="styles"){
--- this.wrap_tags(styles[arg1][1],styles[arg1][2]);
>>> }else if(cmd==="syntax"){
--- this.wrap_tags(syntax[arg1][1],syntax[arg1][2]);
>>> }else if(cmd==="bold"){
--- this.wrap_tags(""," ");
>>> }else if(cmd==="undo"&&urm){
--- if(urm.can_undo()){
--- var undo = urm.undo();
--- this.set_text(undo);
--- return true;
}
>>> }else if(cmd==="redo"&&urm){
--- if(urm.can_redo()){
--- var redo = urm.redo();
--- this.set_text(redo);
--- return true;
}
>>> }else if(cmd==="about"){
--- var about = "HtmlBox is a modern, cross-browser, interactive, open-source text area built on top of the excellent jQuery library.
";
--- about += "Official Website: http://remiya.com
";
--- about += "License: MIT license
";
--- about += "Version: 4.0
";
--- about += "Credits:
";
--- about += "JQuery (JavaScript Framework)
";
--- about += "Silk (Icon Set)
";
--- var html = '';
--- html += 'About HtmlBox ';
--- html += ''+about+'
';
--- html += 'Copyright©2009 Remiya Solutions All right reserved! Close
';
--- html += '
';
--- var w = 300;var h = 200;
--- var top = ($(window).height()-200)/2+$(document).scrollTop();
--- var left = ($(window).width()-300)/2;
--- if ($("#"+d.id+"_about").length === 0){
--- $("body").append("about
");
--- $("#"+d.id+"_about").html(html);
--- }else{
--- $("#"+d.id+"_about").css("top",top);
--- $("#"+d.id+"_about").css("left",left);
}
--- $("#"+d.id+"_about").focus();
--- $("#"+d.id+"_about").fadeIn(1000);
>>> }else{
>>> var arg = (undefined===arg1)?null:arg1;
>>> d.idoc.execCommand(cmd, false, arg);
}
//Setting the changed text to textearea
>>> if($("#"+d.id).is(":visible")===false){
>>> $("#"+d.id).val(this.get_html());
// Register change
--- if(urm){urm.add(this.get_html());}
--- if(undefined!==d.change){d.change();}
}
};
//=====================================================================//
// METHOD: cmd //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: get_text //
//=====================================================================//
/**
* Returns the text without tags of the HtmlBox
* @since 1.2
* @return this
*/
>>> this.get_text = function(){
// Is textbox visible?
--- if($("#"+d.id).is(":visible")){ return $("#"+d.id).val(); }
// Iframe is visible
var text;
--- if($.browser.msie){
--- text = d.iframe.contentWindow.document.body.innerText;
--- }else{
--- var html = d.iframe.contentWindow.document.body.ownerDocument.createRange();
--- html.selectNodeContents(d.iframe.contentWindow.document.body);
--- text = html;
}
--- return text;
};
//=====================================================================//
// METHOD: get_text //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: set_text //
//=====================================================================//
/**
* Sets the text as a content of the HtmlBox
* @since 1.2
* @return this
*/
>>> this.set_text = function(txt){
--- var text = (undefined===txt)?"":txt;
--- if(text=="" && $.browser.safari){text = " ";}// Bug in Chrome and Safari
// Is textarea visible? Writing to it.
--- if($("#"+d.id).is(":visible")){
--- $("#"+d.id).val(text);
--- }else{
// Textarea not visible. write to iframe
--- if($.browser.mozilla||$.browser.safari){
//if($.trim(text)===""){text=" ";}
--- d.idoc.open('text/html', 'replace'); d.idoc.write(text); d.idoc.close();
--- }else{
--- d.idoc.body.innerHTML = "";
--- if(text!==""){d.idoc.write(text);}
}
--- style(); // Setting the CSS style for the iframe
--- d.idoc.body.contentEditable = true;
}
--- if(urm){urm.add(this.get_html());}
--- if(undefined!==d.change){d.change();}
--- return this;
};
//=====================================================================//
// METHOD: set_text //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: get_html //
//=====================================================================//
/**
* Returns the (X)HTML content of the HtmlBox
* @return this
*/
>>> this.get_html = function(){
var html;
>>> if($("#"+d.id).is(":visible")){
--- html = $("#"+d.id).val();
>>> }else{
>>> html = d.iframe.contentWindow.document.body.innerHTML;
}
--- if(typeof getXHTML === 'function'){ return getXHTML(html); }else{return html;}
};
//=====================================================================//
// METHOD: get_html //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: change //
//=====================================================================//
/**
* Specifies a function to be executed on text change in the HtmlBox
*/
>>> this.change=function(fn){d.change=fn;return this;};
//=====================================================================//
// METHOD: change //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: remove //
//=====================================================================//
/**
* Removes the HtmlBox instance from the DOM and the globalspace
*/
>>> this.remove = function(){
--- global_hb[d.id]=undefined;
--- $("#"+d.id+"_wrap").remove();
--- if ($("#"+d.id+"_about").length === 0){$("#"+d.id+"_about").remove();}
};
//=====================================================================//
// METHOD: remove //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: post //
//=====================================================================//
/**
* Posts the form data to the specified URL using Ajax
* @param String the URL to post to
* @param String the text to be posted, default the (X)HTML text
* @return this;
*/
>>> this.post=function(url,data){
--- if(undefined===data){data=this.get_html();} data=(d.id+"="+data);
--- $.ajax({type: "POST", data: data,url: url,dataType: "html",error:d.error,success:d.success});
};
//=====================================================================//
// METHOD: post //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: get //
//=====================================================================//
/**
* Gets the form data to the specified URL using Ajax
* @param String the URL to get to
* @param String the text to be posted, default the (X)HTML text
* @return this;
*/
>>> this.get=function(url,data){
--- if(undefined===data){data=this.get_html();} data=(d.id+"="+data);
--- $.ajax({type: "GET", data: data,url: url,dataType: "html",error:d.error,success:d.success});
};
//=====================================================================//
// METHOD: get //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: success //
//=====================================================================//
/**
* Specifies what is to be executed on successful Ajax POST or GET
*/
>>> this.success=function(fn){d.success=fn;return this;};
//=====================================================================//
// METHOD: success //
//========================== END OF METHOD ============================//
//========================= START OF METHOD ===========================//
// METHOD: error //
//=====================================================================//
/**
* Specifies what is to be executed on error Ajax POST or GET
* @return {HtmlBox} the instance of this HtmlBox
*/
>>> this.error=function(fn){d.error=fn;return this;};
//=====================================================================//
// METHOD: error //
//========================== END OF METHOD ============================//
// -------------- END: PUBLIC METHODS ------------------//
>>> this._init(false);
>>> return this;
};
})(jQuery);
//===========================================================================//
// CLASS: HtmlBox //
//============================== END OF CLASS ===============================//
=== Inline script in: http://localhost/subjectPrograms/ClientSideOnly/htmledit/demo_full.html ===
>>> $("#ha").css("height","100%").css("width","100%").htmlbox({
toolbars:[
[
// Cut, Copy, Paste
"separator","cut","copy","paste",
// Undo, Redo
"separator","undo","redo",
// Bold, Italic, Underline, Strikethrough, Sup, Sub
"separator","bold","italic","underline","strike","sup","sub",
// Left, Right, Center, Justify
"separator","justify","left","center","right",
// Ordered List, Unordered List, Indent, Outdent
"separator","ol","ul","indent","outdent",
// Hyperlink, Remove Hyperlink, Image
"separator","link","unlink","image"
],
[// Show code
"separator","code",
// Formats, Font size, Font family, Font color, Font, Background
"separator","formats","fontsize","fontfamily",
"separator","fontcolor","highlight",
],
[
//Strip tags
"separator","removeformat","striptags","hr","paragraph",
// Styles, Source code syntax buttons
"separator","quote","styles","syntax"
]
],
skin:"blue"
});
Total lines (including un-executable): 881
Total executable lines: 335
Covered lines: 179
Coverage: ~53%
Errors:13 errors/warningsh in the script:
CRASH - TypeError: Cannot find function execCommand in object [object HTMLDocument]. (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#421)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#421)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 25], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot read property "document" from null (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#596)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#596)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 3], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot find function execCommand in object [object HTMLDocument]. (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [5, 0, 0, 0, 0, 0, 0, 5], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=true, button=2, clientX=125, clientY=262, ctrlKey=true, detail=0, metaKey=false, screenX=513, screenY=430, shiftKey=false], formState={[id=ha_formats, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 3, 0] id: ha_formats, input_options=[, h1, h2, h3, h4, h5, h6, p, pindent, pre]]="h3", [id=ha_fontsize, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 4, 0] id: ha_fontsize, input_options=[, 1, 2, 3, 4, 5, 6, 7]]="", [id=ha_fontfamily, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 5, 0] id: ha_fontfamily, input_options=[, arial, courier, cursive, georgia, monospace, tahoma, verdana]]="", [id=ha_fontcolor, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 7, 0] id: ha_fontcolor, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="darkgray", [id=ha_highlight, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 8, 0] id: ha_highlight, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="magenta", [id=ha_styles, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 7, 0] id: ha_styles, input_options=[, 0, 2]]="2", [id=ha_syntax, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 8, 0] id: ha_syntax, input_options=[, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]]="2"}]], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 9], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot read property "org.mozilla.javascript.Undefined@7944bb8e" from undefined (resources/env.rhino.js#6277(eval)#1)(resources/env.rhino.js#6277(eval)#1)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [5, 0, 0, 0, 0, 0, 0, 5], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=true, button=2, clientX=125, clientY=262, ctrlKey=true, detail=0, metaKey=false, screenX=513, screenY=430, shiftKey=false], formState={[id=ha_formats, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 3, 0] id: ha_formats, input_options=[, h1, h2, h3, h4, h5, h6, p, pindent, pre]]="h3", [id=ha_fontsize, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 4, 0] id: ha_fontsize, input_options=[, 1, 2, 3, 4, 5, 6, 7]]="", [id=ha_fontfamily, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 5, 0] id: ha_fontfamily, input_options=[, arial, courier, cursive, georgia, monospace, tahoma, verdana]]="", [id=ha_fontcolor, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 7, 0] id: ha_fontcolor, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="darkgray", [id=ha_highlight, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 8, 0] id: ha_highlight, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="magenta", [id=ha_styles, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 7, 0] id: ha_styles, input_options=[, 0, 2]]="2", [id=ha_syntax, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 8, 0] id: ha_syntax, input_options=[, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]]="2"}]], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 7, 0] id: ha_styles, event name=onchange}, evt_input=EventInput [eventObjectInput=com.ibm.jsconcolic.inputgeneration.EventObjectInput@747a14ce, formState={}]]]]CRASH - TypeError: Cannot find function execCommand in object [object HTMLDocument]. (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 16], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot find function execCommand in object [object HTMLDocument]. (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 26], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot find function execCommand in object [object HTMLDocument]. (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 1], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot read property "getSelection" from null (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#62)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#62)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 6], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot find function execCommand in object [object HTMLDocument]. (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#509)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 10], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot read property "document" from null (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#596)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#596)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [5, 0, 0, 0, 0, 0, 0, 5], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=true, button=2, clientX=125, clientY=262, ctrlKey=true, detail=0, metaKey=false, screenX=513, screenY=430, shiftKey=false], formState={[id=ha_formats, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 3, 0] id: ha_formats, input_options=[, h1, h2, h3, h4, h5, h6, p, pindent, pre]]="h3", [id=ha_fontsize, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 4, 0] id: ha_fontsize, input_options=[, 1, 2, 3, 4, 5, 6, 7]]="", [id=ha_fontfamily, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 5, 0] id: ha_fontfamily, input_options=[, arial, courier, cursive, georgia, monospace, tahoma, verdana]]="", [id=ha_fontcolor, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 7, 0] id: ha_fontcolor, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="darkgray", [id=ha_highlight, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 8, 0] id: ha_highlight, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="magenta", [id=ha_styles, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 7, 0] id: ha_styles, input_options=[, 0, 2]]="2", [id=ha_syntax, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 8, 0] id: ha_syntax, input_options=[, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]]="2"}]], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 3], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot read property "org.mozilla.javascript.Undefined@7944bb8e" from undefined (resources/env.rhino.js#6277(eval)#1)(resources/env.rhino.js#6277(eval)#1)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 5, 0] id: ha_fontfamily, event name=onchange}, evt_input=EventInput [eventObjectInput=com.ibm.jsconcolic.inputgeneration.EventObjectInput@747a14ce, formState={}]]]]CRASH - TypeError: Cannot read property "document" from null (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#596)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#596)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [5, 0, 0, 0, 0, 0, 0, 5], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=true, button=2, clientX=125, clientY=262, ctrlKey=true, detail=0, metaKey=false, screenX=513, screenY=430, shiftKey=false], formState={[id=ha_formats, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 3, 0] id: ha_formats, input_options=[, h1, h2, h3, h4, h5, h6, p, pindent, pre]]="h3", [id=ha_fontsize, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 4, 0] id: ha_fontsize, input_options=[, 1, 2, 3, 4, 5, 6, 7]]="", [id=ha_fontfamily, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 5, 0] id: ha_fontfamily, input_options=[, arial, courier, cursive, georgia, monospace, tahoma, verdana]]="", [id=ha_fontcolor, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 7, 0] id: ha_fontcolor, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="darkgray", [id=ha_highlight, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 1, 0, 0, 0, 0, 8, 0] id: ha_highlight, input_options=[, white, ivory, lightyellow, yellow, snow, floralwhite, lemonchiffon, cornsilk, seashell, lavenderblush, papayawhip, blanchedalmond, mistyrose, bisque, moccasin, navajowhite, peachpuff, gold, pink, lightpink , orange, lightsalmon, darkorange, coral, hotpink, tomato, orangered, deeppink, magenta, fuchsia, red, oldlace, lightgoldenrodyellow, linen, antiquewhite, salmon, ghostwhite, mintcream, whitesmoke, beige, wheat, sandybrown, azure, honeydew, aliceblue, khaki, lightcoral , palegoldenrod, violet, darksalmon, lavender, lightcyan, burlywood, plum, gainsboro, crimson, palevioletred, goldenrod, orchid, thistle, lightgrey, tan, chocolate, peru, indianred, mediumvioletred, silver, darkkhaki, rosybrown, mediumorchid, darkgoldenrod, firebrick, powderblue, lightsteelblue, paleturquoise, greenyellow, lightblue, darkgray, brown, sienna, yellowgreen, darkorchid, palegreen, darkviolet, mediumpurple, lightgreen, darkseagreen, saddlebrown, darkmagenta, darkred, blueviolet, lightskyblue, skyblue, gray, olive, purple, maroon, aquamarine, chartreuse, lawngreen, mediumslateblue, lightslategray, slategray, olivedrab, slateblue, dimgray, mediumaquamarine, cornflowerblue, cadetblue, darkolivegreen, indigo, mediumturquoise, darkslateblue, steelblue, royalblue, turquoise, mediumseagreen, limegreen, darkslategray, seagreen, forestgreen, lightseagreen, dodgerblue, midnightblue, cyan, aqua, springgreen, lime, mediumspringgreen, darkturquoise, deepskyblue, darkcyan, teal, green, darkgreen, blue, mediumblue, darkblue, navy, black]]="magenta", [id=ha_styles, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 7, 0] id: ha_styles, input_options=[, 0, 2]]="2", [id=ha_syntax, name=null, type=SELECT, elm=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 8, 0] id: ha_syntax, input_options=[, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]]="2"}]], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 0, 0, 0, 0, 0, 1], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]]CRASH - TypeError: Cannot read property "getSelection" from null (http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#62)(http://localhost/subjectPrograms/ClientSideOnly/htmledit/htmlbox.full.js#62)
Chain: EventChain [event_chain=[EventInfo [evt_handler={element=null, event name=INIT}, evt_input=null], EventInfo [evt_handler={element=ElementDescriptor: [1, 0, 2, 0, 0, 0, 0, 2], event name=onclick}, evt_input=EventInput [eventObjectInput=MouseEventObjectInput [altKey=false, button=0, clientX=0, clientY=0, ctrlKey=false, detail=1, metaKey=false, screenX=0, screenY=0, shiftKey=false], formState={}]]]