INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Theater View webpages and Girder - SOLVED (mostly)  (Read 1236 times)

Twit

  • Junior Woodchuck
  • **
  • Posts: 63
Theater View webpages and Girder - SOLVED (mostly)
« on: June 28, 2007, 12:57:56 pm »

EDIT: It appears that MC Theater View webpages do not like using a port other than default (80). If i link a webpage with any other port ie http://localhost:4434 then it gives me the problems.

Hi,

Sorry for the long post.

I currently use Theaterview almost exclusively. I am also a big girder user/fan. I do alot of 'av equipment' changing via girder.
I first started by adding extra buttons into Theater view but I can only add to the main menu, and I hate the way Theaterview briefly minimizes when running the girder event.exe.

I then thought about the fact that I can control my 'av equipment' via the internet using Girder's built in web server and 'bingo' , I can do the same via Theater View add a webpage link.

Sooo I had my first go at html coding. I designed a webpage with the same background and buttons as the noire skin. It is almost seamless. It looks good and I can create lots of extra buttons to do stuff.

If i load the page into IE or Firefox directly it works perfectly BUT if i load it into Theater View the buttons don't always work. I'ts a bit of a hit and miss thing. I can't seem to work out any 'sequence' to it, except that it never works on first click, and rarely on second. The clicks that don't work do not appear in the girder log, they get 'lost' somewhere.

I know nothing about coding and I am more of a cut/paste person. I basically took the origional girder webpage and deleted what I did not need. Could someone take a glance and see if I am doing anything wrong?

It all basically runs on the following 3 files:

index.html:

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>TheaterView
Extras</title>
<script src="girder.js" type="text/javascript">
</script> <script>
function SetImage(id, src)
{
var Image = document.getElementById(id);
Image.src = src;
return false;
}
function SendEventByID( EventID, DeviceID )
{
var Event = document.getElementById(EventID);
var Device = document.getElementById(DeviceID); SendEvent(Event.value, Device.value);
return false;
}
</script></head><body
 style="background-image: url(img/Background.png); width: 704px;"><br>
<div style="text-align: center;"><a href=""
 onclick='return SendEvent("jrmc.detach", "18");'
 onmousedown='return SetImage("Button1", "img/button1dn.png");'
 onmouseup='return SetImage("Button1", "img/button1up.png");'
 onmouseout='return SetImage("Button1", "img/button1up.png");'
 onmouseover='return SetImage("Button1", "img/button1dn.png");'><img
 src="img/button1up.png" id="Button1" border="0"></a></div></body></html>

More on next posts.
Logged

Twit

  • Junior Woodchuck
  • **
  • Posts: 63
Re: Theater View webpages not functioning correctly!
« Reply #1 on: June 28, 2007, 12:58:23 pm »

girder.js: This is the standard girder file, I have not modified it

Code: [Select]
function SendEvent( event, device )
{
   var formRequester = null;
   
try
   {
      formRequester = new XMLHttpRequest();
   }
   catch (error)
   {
       
      try
      {
         formRequester = new ActiveXObject("Msxml2.XMLHTTP");
      }   
      catch (err)
      {
         try
         {
            formRequester = new ActiveXObject("Microsoft.XMLHTTP");
         }
         catch (err2)
         {
        formRequester = null;
  return false;
         }
      }
   }

   formRequester.open("GET", "ajax_sendevent.lhtml?event="+event+"&device="+device);

   formRequester.onreadystatechange = function()
   {
      if (formRequester.readyState == 4)
      {
     return true;
      }
   }

   formRequester.send(null);
   return false;
}
Logged

Twit

  • Junior Woodchuck
  • **
  • Posts: 63
Re: Theater View webpages not functioning correctly!
« Reply #2 on: June 28, 2007, 12:58:48 pm »

ajax_sendevent.lhtml: also the origional unmodified file

Code: [Select]
<%
webserver:SetGZIP(false)
webserver:SetHeader("Cache-Control: no-cache, must-revalidate")
  webserver:SetHeader("Expires: Fri, 30 Oct 1998 14:19:41 GMT")
local table = webserver:GetCGI()
if ( gir ) then
  gir.TriggerEvent( table['event'], table['device'], 0)
end
%>

Any help would be appreciated.
Logged

Twit

  • Junior Woodchuck
  • **
  • Posts: 63
Re: Theater View webpages and Girder - SOLVED (mostly)
« Reply #3 on: June 28, 2007, 11:31:32 pm »

Solved - (mostly) - see first post
Logged
Pages: [1]   Go Up