File:  [mozdev] / bbecontainer / www / adjust_editor.html
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Thu Dec 31 07:09:37 2009 UTC (9 years, 9 months ago) by moonwalker
Branches: MAIN
CVS tags: HEAD
*** empty log message ***

div h3 { margin:11px 5px 6px 5px;font-size:14px; }
.inserted_code {
	  margin:5px 0 5px 30px;
.container_of_inserted_code {
	  margin:5px 0 5px 30px;
<link rel="STYLESHEET" href="styles.css" type="text/css">
<script type="text/javascript" src="menu.js"></script>

<h1>Preparing A New Editor</h1>
in order to prepare a new editor,<br>
some code has to be inserted it.<br>

<div style="border: 1px solid ; padding: 5px; background-color: rgb(192, 208, 208);">
	<b>code to be inserted in javascript:</b>
  <div style="margin-left: 15px;">
		<span class="container_of_inserted_code" style="color: rgb(0, 128, 0);">
	<pre class="inserted_code">function getElem(name) {return document.getElementById(name)}<br><br>function gen_event(target,evt_name,flg_bubble,rnode,strings)<br>{<br>	var evt=document.createEvent("MutationEvents")<br>	if (!strings) { strings=[]; }<br>	evt.initMutationEvent(evt_name,(flg_bubble)?true:false,false,rnode ,strings[0],strings[1],strings[2],evt.MODIFICATION);<br>	target.dispatchEvent(evt);<br>	return document.getElementById( getElem('control_point').getAttribute("val") )<br>}<br><br> function content_load_handler(evt)<br>  {<br>	var,editor=document.getElementById("ctl_id") )<br>	var data=control_point.getAttribute("data")<br>	<br>	if (<span style="color: rgb(0, 128, 0);">/*the editor is not in wysiwyg mode*/</span>)&nbsp;&nbsp;&nbsp;<span style="color: rgb(0, 128, 0);">/*switch the editor to </span><span style="color: rgb(0, 128, 0);">wysiwyg </span><span style="color: rgb(0, 128, 0);">mode*/</span>;<br>"text/html");<br>		editor.contentDocument.write( data);<br>		editor.contentDocument.close();<br>	gen_event(editor,"set_base_url",true)<br>  }<br>	</pre>

  <div style="margin-left: 15px;">
        <span class="container_of_inserted_code">function on_load() {</span>  
	<div class="inserted_code">
	<span class="container_of_inserted_code">}</span>
<br>for the on_load function,you should make sure that it will run during the window.onload event , but not interfere with the onload event of<br>the editor<br><br>
<div style="border: 1px solid ; padding: 5px; background-color: rgb(192, 208, 208);">
   <b>inserted html code</b>
<div style="margin-left: 15px;">you have to add an html element to the document,
which has the following attributes:
	<div class="inserted_code">
        id="control_point" onclick="content_load_handler(this);"  style="display:none;"


<!-- *** from mozdev *** -->
<p id="mozdev-feedback">
    For questions or comments about BBEcontainer, please send a message to the
    <a href="">bbecontainer mailing list</a>.<br>

    <!-- For general site related questions or comments, -->
    For questions or comments <em>not</em> about a specific project,
    please read our <a href="">feedback</a> page.<br>    
    <a href="">Copyright</a>  2009. All rights reserved. 
    <a href="">Terms of Use</a>.
<!-- *** *********** *** -->


FreeBSD-CVSweb <>