December 2, 2008

Using the Chess Viewer Applet

This is a demonstration of some custom features:
  • Dark squares have a different color;
  • Second game is pre-selected;
  • The viewer is enclosed in a bordered box;

Here is the modified CV section of the post body that is producing these results:

<div style="border: 1px solid blue; width: 651px; height: 580px;">
<script id="oChessViewer" style="margin: 10px;" type="text/javascript">
/*
[Event "Munich"]
[Site "Munich"]
[Date "1991.??.??"]
[Round "?"]
.
.
.
1-0
*/
makeChessApplet ( null, { DarkSquares: "C08262", GameToSelect: "2" } );
</script>
</div>

Below are the actual changes along with some explanations and internal processing details:

  • The way new parameters are submitted to the Chess Viewer Deluxe applet. Proper values are assigned to two of them (“DarkSquares“ and “GameToSelect“) which are passed in when the “makeChessApplet” function is called. The most common parameters are handled nicely by the “HTML generator” so you don’t have to do it manually (but you could). For a complete list of all possible parameters check the CVD’s home page.
  • There is a mandatory ID of “oChessViewer” defined on the SCRIPT element. The ID is later inherited by the chess viewer (CV) object. That's quite convenient and can be used in your CSS (as I do in mine) to define a style that applies to each of the CV objects.
  • There is an optional “style” attribute defined on the SCRIPT element which also gets inherited by the CV object. The example makes good use of it to overwrite the current settings for margins (from the CSS).
  • The outer box is defined in the most usual HTML fashion and shows how easy the CV object is nested inside it. In fact, the CV object literally replaces the SCRIPT element and, from user’s point of view, the PGN data is naturally inherited by it.

11 comments:

 
author bstp
authorUrl https://www.blogger.com/profile/01106953160882820403
adminClass blog-admin pid-73880119
data:comment.favicon 
bstp said...

Hello,

The homepage of the Chess Viewer Deluxe does not exist anymore : is there a way to get the full list of commands ? I could put them on my site if you wish.

I did not notice your were the author of CVD : kudos !

Best regards,

B

 
author bstp
authorUrl https://www.blogger.com/profile/01106953160882820403
adminClass blog-admin pid-73880119
data:comment.favicon 
bstp said...

I just found the homepage link at the bottom of your page :

http://chesstuff.blogspot.com/2008/11/chess-viewer-deluxe.html

Sorry!

PS: Please correct the link in your text !

 
author Nikolai Pilafov
authorUrl https://www.blogger.com/profile/00695284688005658187
adminClass blog-admin pid-8567400
data:comment.favicon 
Nikolai Pilafov said...

Yeah,
Unfortunately, keeping it all free of charge means I have to use free hosting. Occasionally they decide to pull the plug and some downtime is inevitable. In this case Yahoo’s geocities has closed down after a very long time of service.

The good news is that I already made all of the modifications and there’s a new release (3.5a) of the applet itself. The link to the CVD’s home page works just fine but there’s a slight chance that a locally cached version of the applet might be still used on your system. Deleting the temporary files in your Java control panel and restarting the browser will speed up the transition.

I’m sorry for this inconvenience.

 
author Unknown
authorUrl https://www.blogger.com/profile/00052281374643302758
adminClass blog-admin pid-627398306
data:comment.favicon 
Unknown said...

Is there any way to get a scroll bar for the games list? Currently, one can only look at the first 6 games in the list.

 
author Unknown
authorUrl https://www.blogger.com/profile/00052281374643302758
adminClass blog-admin 
data:comment.favicon 
Unknown said...
This comment has been removed by the author.
 
author Nikolai Pilafov
authorUrl https://www.blogger.com/profile/00695284688005658187
adminClass blog-admin pid-8567400
data:comment.favicon 
Nikolai Pilafov said...

Hi Quagaars,
I’m sorry to hear about your problem. My guess is that you’re using Linux since that’s the only platform with similar issue. I remember testing it on my Open SUSE and the vertical scroll bar was indeed missing with one JRE but worked fine with another JRE from Sun. I haven’t seen that problem on Mac or Windows in the last three years which made me believe that Java developers might have fixed it at one point.
Can you try a different JRE and/or browser?

 
author Unknown
authorUrl https://www.blogger.com/profile/00052281374643302758
adminClass blog-admin pid-627398306
data:comment.favicon 
Unknown said...

Ah! You are right. I tried it on a Windows machine and it worked fine. That's too bad for me.

 
author Nikolai Pilafov
authorUrl https://www.blogger.com/profile/00695284688005658187
adminClass blog-admin pid-8567400
data:comment.favicon 
Nikolai Pilafov said...

I wish we knew more about the underlying problem and, ideally, a workaround to fix the issue. For that to happen I need feedback from more Linux users using various JREs and/or browsers. As a very first step I always suggest running my Testing LiveConnect object functionality. It already helped reveal some troubles with non-compliant JREs (or browsers).

 
author Carlos Luis Pujol
authorUrl https://www.blogger.com/profile/10296492929147010145
adminClass blog-admin pid-1769414904
data:comment.favicon 
Carlos Luis Pujol said...

Hi, Mr Pilafov.

I wonder is you could do some work for hire, over the same CVD, and do some customizations. If you are interested, please, get in contact with me.

Carlos Pujol
ChessForReal.com

 
author Unknown
authorUrl https://www.blogger.com/profile/16375996057121929872
adminClass blog-admin pid-900638217
data:comment.favicon 
Unknown said...

I use Firefox but Viewer is not showing anymore...what went wrong?

 
author Bikerman
authorUrl https://www.blogger.com/profile/07646693950832588907
adminClass blog-admin pid-2028040536
data:comment.favicon 
Bikerman said...

Hi Nikolai. This is a truly excellent viewer - congratulations and thank-you for the hard work. I'm not sure this blog is still active - last post aa couple of years old is normally not a good sign, but I needed to thank you and this was the only place I could find :-)