<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Marshall Culpepper wrote:
<blockquote
cite="mid:ab04aa740808181210x512198bau921ce04c96eecd2@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_quote">
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<div class="Ih2E3d">
<blockquote type="cite">
<div dir="ltr">Maxim/Sergey, any pointers?<br>
</div>
</blockquote>
</div>
1)For know we are not support execution of java script in visual editor.<br>
To allow javascript we should switch off design mode, but know it's
hard to do, because all selections events <br>
processing throw nsISelectionController which can be obtained only
if we switch mozilla in design mode. </div>
</blockquote>
<div><br>
Where is "design mode" turned on and off? So if I understand correctly
... taking the Mozilla renderer out of design mode turns off the
propogation of nsISelectionController events?<br>
</div>
</div>
</div>
</blockquote>
org.jboss.tools.vpe.editor.mozilla.MozillaEditor.getEditor(), this
method calls from VpeController.init();<br>
To Disable design mode you should comment body of method
org.jboss.tools.vpe.editor.mozilla.MozillaEditor.getEditor().<br>
Also for **Preview** tab we using another instance of mozilla , which
in browser mode and you can use preview mode, then you shouldn't<br>
swicth off design mode.<br>
<blockquote
cite="mid:ab04aa740808181210x512198bau921ce04c96eecd2@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"><br>
2) possibly JavaScript that inserted into head node doesn't be executed
automatically, because browser executes this scripts <br>
when documents are loaded. When we insert it into DOM, document already
loaded.</div>
</blockquote>
<div><br>
This sounds right, but if I can't execute javascript at all, I guess it
doesn't matter? =)<br>
</div>
</div>
</div>
</blockquote>
For execution js i have mode following steps(Easy way):<br>
1)create html page with following content <br>
<i> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</a>><br>
<html><br>
<head><br>
</head><br>
<body><br>
<input type="button" onclick="alert('I am an alert
box!!')" value="Display alert box" /><br>
<input type="button" onclick="document.write('Test');"
value="Display alert box" /><br>
</body><br>
</html><br>
2)</i> open <i>org.jboss.tools.vpe.html/templates/vpe-templates-html.xml</i>
file and add for tag with name="input" to copy attributes <i>onclick</i>
attribute.<br>
It's should looks like this: <vpe:copy
attrs="id,type,style,class,value,size,<b>onclick</b>" /> <br>
3) open page which was created in [1] in visual editor.<br>
4) switch to preview tab, and click on submit button on page.
JavaScript will be executed.<br>
<i></i>
<blockquote
cite="mid:ab04aa740808181210x512198bau921ce04c96eecd2@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_quote">
<div><br>
</div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000"><br>
<br>
PS. Using of JavaScript in Visual Editor can strongly change the
process handling, because we can modify dom using js, and using <br>
xpcom, there then many questins how to map elements from source and
visual part and others.<span style="color: rgb(128, 128, 128);"></span>
</div>
</blockquote>
</div>
<br>
Very true.. Our problem is that the appcelerator platform uses
javascript code to render widgets.. it's sounding more and more like it
would be better to try and approach this using Rhino. I'd still like to
fiddle with the design mode to see what I can accomplish though, any
pointers to source code?<br>
</div>
</blockquote>
I think it's better to use in test purposes preview tab for testing js,
in such way it's takes minimal changes.<br>
</body>
</html>