Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EPF » Problem including javascript functions in EPF(How are the .js files included/referenced in EPF?)
Problem including javascript functions in EPF [message #1403970] Mon, 28 July 2014 19:34 Go to next message
luis gonzales is currently offline luis gonzalesFriend
Messages: 1
Registered: July 2014
Junior Member
Hi, i am trying to highlight some hotspots defined in a picture using jquery and maphighlight function as it can be seen in "source_code" file (also attached):

index.php/fa/18656/0/

This code is seen in the "rich text" view as follows:

index.php/fa/18657/0/

so the definition of hotspots works fone.

It is supposed, and in google there are a lot of working examples, that once generated the html, the graphic area of the hotspot is highlighted when the mouse is over the figure.

However, in the "preview" view it can be see that the mouse changes from the arrow to a finger when it is on some of the hotspots but the hotspost it is not highlighted.

I think that the js scripts are not properly defined or included in EPF; anyone knows how to include/call .js files?


Thank you so much for your help
Re: Problem including javascript functions in EPF [message #1417659 is a reply to message #1403970] Fri, 05 September 2014 21:23 Go to previous message
Bruce MacIsaac is currently offline Bruce MacIsaacFriend
Messages: 61
Registered: July 2009
Member
The problem lies in the "tidy" feature of the RMC rich text editor. When you "save", the tidy feature changes the javascript, sometimes introducing errors.
I've also observed issues with publishing as well.
There are a few solutions to try:

1. You can change the javascript so that tidy and publishing doesn't change it.
For example, I noticed that some characters, like "<" were not handled correctly, so I did the following:
var left=String.fromCharCode(60)
Then I used "left" in strings where I needed a left angle bracket.

It takes some trial and error to get this approach to work.

2. Use an external javascript file, e.g.
<SCRIPT SRC="filename.js">
But if only it was so easy. Unlike graphic files, which RMC recognizes as being associated with the page, javascript files are not copied at publishing time.
The workaround is to add a template, or some other element that supports file attachments, and attach the file to that element. Now the javascript file will be copied over at publication time.
However, you will have to use a relative path to refer to it.
For example, to reference a filename.js script attached to a template but referenced from a concept, the path would be ../templates/resources/filename.js

Previous Topic:Uploading EPF Published Sites to Confluence
Next Topic:EPF All practices library
Goto Forum:
  


Current Time: Tue Mar 19 09:26:41 GMT 2024

Powered by FUDForum. Page generated in 0.02076 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top