Entropy.ch Discussion Forums Forum Index Entropy.ch Discussion Forums
Discussion forums about Mac OS X software development.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Doesn't work anymore with Safari 3.0 beta?

 
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> LogitechLCDTool
View previous topic :: View next topic  
Author Message
gashade



Joined: 19 Apr 2007
Posts: 12
Location: Amsterdam

PostPosted: Tue Jun 12, 2007 22:40    Post subject: Doesn't work anymore with Safari 3.0 beta? Reply with quote

LogitechLCDTool doesn't work anymore here. I didn't change anything to the HTML code. Only thing that I know is different is that I now have the Safari 3.0 beta installed. Could that be it?
Back to top
View user's profile Send private message AIM Address MSN Messenger
liyanage
Site Admin


Joined: 22 May 2003
Posts: 1104
Location: Zurich, Switzerland

PostPosted: Tue Jun 12, 2007 23:24    Post subject: Reply with quote

indeed, same here... Doesn't seem to be compatible with the webkit installed by Safari 3 beta.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
etj



Joined: 12 Jun 2007
Posts: 1

PostPosted: Wed Jun 13, 2007 0:05    Post subject: Reply with quote

Yes that seems to be it- when I used the Safari "Uninstaller" and went back to Safari 2.0.4, then it was back to normal for the LCD display.
Back to top
View user's profile Send private message
gashade



Joined: 19 Apr 2007
Posts: 12
Location: Amsterdam

PostPosted: Thu Jun 14, 2007 22:29    Post subject: Reply with quote

Is an update still in the works, Marc?
Thanks.
_________________
dvdpedia


Last edited by gashade on Wed Aug 01, 2007 22:51; edited 1 time in total
Back to top
View user's profile Send private message AIM Address MSN Messenger
liyanage
Site Admin


Joined: 22 May 2003
Posts: 1104
Location: Zurich, Switzerland

PostPosted: Sat Jun 16, 2007 8:20    Post subject: Reply with quote

yes, however, if a build for the Safari 3 beta webkit is incompatible with a system running Safari 2, then I will obviously have to configure for the latter, i.e. I can't promise a build that will work with Safari 3 beta systems.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
gashade



Joined: 19 Apr 2007
Posts: 12
Location: Amsterdam

PostPosted: Sun Jun 17, 2007 12:09    Post subject: Reply with quote

liyanage wrote:
yes, however, if a build for the Safari 3 beta webkit is incompatible with a system running Safari 2, then I will obviously have to configure for the latter, i.e. I can't promise a build that will work with Safari 3 beta systems.


Thanks Marc, looking forward to it very much!
Personally, I have gone back to Safari 2.
Back to top
View user's profile Send private message AIM Address MSN Messenger
liyanage
Site Admin


Joined: 22 May 2003
Posts: 1104
Location: Zurich, Switzerland

PostPosted: Sun Jun 17, 2007 22:05    Post subject: Reply with quote

It seems to be just a small JavaScript issue. Try to replace the "update" JavaScript function in the code with this version:

Code:
   function update() {
      var itunesStatus = application.runSystemScript('iTunesCurrentTrackFullStatus');
      itunesStatus = '(' + itunesStatus + ')';
      var itunes = eval(itunesStatus);
      setText('pos', formatTime(itunes['position']));
      setText('duration', formatTime(itunes['duration']));
      setText('artist', itunes['artist']);
      setText('name', itunes['name']);
      setText('album', itunes['album']);
      
      $('diamond').style.left = Math.floor(90 / itunes['duration'] * itunes['position']) + 'px';
      if(!application.updateDisplay()) stop();
   }



This works on my system with Safari 3 beta. Let me know if it works for you.

This is the full script:

Code:
<html>
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript">
   var timer;
   function setText(id, value) {$(id).innerHTML = value}
   function formatTime(sec) {var ss = Math.floor(sec % 60); ss = ss < 10 ? '0' + ss : ss; return Math.floor(sec/60) + ':' + ss}

   function update() {
      var itunesStatus = application.runSystemScript('iTunesCurrentTrackFullStatus');
      itunesStatus = '(' + itunesStatus + ')';
      var itunes = eval(itunesStatus);
      setText('pos', formatTime(itunes['position']));
      setText('duration', formatTime(itunes['duration']));
      setText('artist', itunes['artist']);
      setText('name', itunes['name']);
      setText('album', itunes['album']);
      
      $('diamond').style.left = Math.floor(90 / itunes['duration'] * itunes['position']) + 'px';
      if(!application.updateDisplay()) stop();
   }

   function handleButton(button, upDown) {
      if (upDown == "down") return;
      if (button == "Softkey1") window.application.runUserScript('iTunesActivate');
      if (button == "Softkey4") window.application.runSystemScript('visitEntropyWebsite');
      if (button == "Display") showOverlay();
   }

   function showOverlay() {
      var data = window.application.runUserScript('doShellScript');
      setText('overlay', data);
      $('overlay').style.display = 'block';
      setTimeout("$('overlay').style.display = 'none';", 4000);
   }

   function init() {
      window.application.registerUserScript('iTunesActivate', 'tell application "iTunes" to activate');
      window.application.registerUserScript('doShellScript', 'do shell script "uptime"');
      start();
   }
   
   function start() {
      timer = setInterval("update()", 1000);
   }
   
   function stop() {
      clearInterval(timer);
   }
</script>
<style type="text/css">
   #top {overflow: hidden; height: 13px; margin-left: 1px;}
   #time {width: 156px;}
   #progress {width: 90px; height: 7px; border: 1px solid black; position: relative; overflow: hidden;}
   #diamond {position: absolute; z-index: -1; margin-left: -3px;}
   #overlay {position: fixed; top: 0; left: 0; background-color: white; width: 160; height: 43; padding: 2px; display: none;}
</style>
<link rel="stylesheet" href="css/default.css" />
</head>

<body class="border" onload="init();">
<div id="top"><span id="artist"></span></div>
<marquee scrolldelay="1000" scrollamount="20"><span id="name"></span> - <span id="album"></span></marquee>
<table id="time"><tr><td id="pos"></td><td><div id="progress"><img id="diamond" src="data:image/gif;base64,R0lGODlhBwAHAIAAAP///wAAACH5BAAAAAAALAAAAAAHAAcAAAIMhGMZq8sOAUSHJZkKADs=" /></div></td><td id="duration"></td></tr></table>
<div id="overlay"></div>
</body>
</html>
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
gashade



Joined: 19 Apr 2007
Posts: 12
Location: Amsterdam

PostPosted: Mon Jun 18, 2007 10:03    Post subject: Reply with quote

Yes it works here too. Thank you, Marc!
_________________
dvdpedia
Back to top
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Entropy.ch Discussion Forums Forum Index -> LogitechLCDTool All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group