Opened 14 years ago

Closed 13 years ago

#744 closed defect (duplicate)

Editor is influenced by existing onmouseover event of my button

Reported by: b.howe@… Owned by: gogo
Priority: high Milestone: 2.0
Component: Xinha Core Version: trunk
Severity: major Keywords: gui javascript
Cc:

Description

In my project the appearance of buttons are realized with onmouseover and onmouseout events to make them nicer. If I use an xinha editor in a page where also my buttons are in following happens.

Always, when I move my mouse over my buttons, the text in the editor area disappears and the cursor is positioned somewhere in the page, even out of the editor area. Are there any don'ts I need to know using own javascript functionality on the same page?

Change History (6)

comment:1 Changed 14 years ago by mharrisonline

JavaScript? in content executes inside the standard Xinha with sometimes disasterous results. I used to have problems with "onLoad" in body tags executing, so on the page that launches Xinha I replace "onLoad" with "onPlaceholder" in my content before loading the string into Xinha, and switch it back at save.

It sounds like you however are actually executing JavaScript? functions. You can easily disable all JavaScript? functions and sources in the content if you change the script language before it enters Xinha into a non-existant language the browser can't execute.

So, if you did a search and replace of the content string before it entered Xinha and switched out all incidences of the word "javascript" with "freezescript" and then switched it back on save, nothing would execute while it was inside Xinha, and all your JavaScript? would function normally after you saved.

comment:2 Changed 14 years ago by mharrisonline

I should mention that you must use the GetHtml? plugin, as Xinha running in IE will otherwise allow script nodes to be destroyed. The GetHtml? plugin preserves scripts in the page, and also makes it possible for embedded Flash to survive the editor, minus their flashvars values.

comment:3 Changed 14 years ago by anonymous

On the default example page here javascript gets stripped out in IE.
Tested with this dummy function:

<script language="text/javascript">
 function foo() {
  alert("bar");
 }
</script>

I also tried with

<script language="text/freezescript">
 function foo() {
  alert("bar");
 }
</script>

Am I doing something wrong or will this work in IE only with Xinha configured to work in FullPage? mode?

comment:4 Changed 14 years ago by mharrisonline

On the default example on this site, without changing any options, in IE 6, I just now went to HTML view, pasted in

<script language="text/javascript">
 function foo() {
  alert("bar");
 }
</script>

just before a paragraph,

Went back to design view, then back to HTML view, and the script was unchanged. You don't need to use the full page plugin or config, you just need the GetHtml? plugin activated.

<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam et tellus vitae justo varius placerat. Suspendisse iaculis velit semper dolor. Donec gravida tincidunt mi. Curabitur tristique ante elementum turpis. Aliquam nisl. Nulla posuere neque non tellus. Morbi vel nibh. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam nec wisi. In wisi. Curabitur pharetra bibendum lectus. 
</p> 
<script language="text/javascript">
 function foo() {
  alert("bar");
 }

</script> <ul>
  <li>Phasellus et massa sed diam viverra semper. 
  </li>
  <li>Mauris tincidunt felis in odio. 
  </li>
  <li>Nulla placerat nunc ut pede. 
  </li>
  <li>Vivamus ultrices mi sit amet urna. 
  </li>
  <li>Quisque sed augue quis nunc laoreet volutpat. 
  </li>
  <li>Nunc sit amet metus in tortor semper mattis. 
  </li>
</ul>

comment:5 Changed 14 years ago by wymsy

But if the script tag is the FIRST TEXT in the editor and you switch to design view and back, the script is removed. This is the problem reported in ticket #735. Any text or tag before the script tag causes the script to be preserved.

comment:6 Changed 13 years ago by gogo

  • Resolution set to duplicate
  • Status changed from new to closed

Duping this to #735, although it's almost not a bug by the first description - CSS is the way to do rollovers people :)

Note: See TracTickets for help on using tickets.