Topic: simpleviewer and rails 2.0

Hi all

I am trying to use simpleviewer with a rails app without much success.

The problem stems from (I believe) from the code:

<script type='text/javascript'>
<!--
window.onload = function&#40;&#41; &#123;
        if &#40;&#40;window.document.getElementById&#41; && &#40;window.document.getElementById&#40;'gallery'&#41;.focus&#41;&#41; &#123;
            window.document.getElementById&#40;'gallery'&#41;.focus&#40;&#41;;
        &#125;
    &#125;
function MM_openBrWindow&#40;theURL,winName,features&#41; &#123; //v2.0
  window.open&#40;theURL,winName,features&#41;;
&#125;
//-->
</script>

In rails 2.0 the page for the view is an html.erb extension and that does not seem to recognise the code from window.onload onwards.

That is to say the text is all greyed out as if commented out and I have tried it with and without the comments that are in there.

If I save the file as a standard html or htm them it will work but does anyone know a way to get the above code to work with html.erb

Any help would be appreciated especially in regard to where to
place the simpleviewer files in relation to rails opinionated file structure.

Martin

Re: simpleviewer and rails 2.0

I'm not sure where that JS code comes from, maybe the lightroom HTML template? Check the HTML that comes in the SimpleViewer download. It doesn't use JS except for the SWFObject code.

Felix Turner
SimpleViewer Support Team.