Palview4 Manual  *   The Palview Pages  *   The Palview Developers Forum  *   Home  *   Palamede

The Magviewer Page


Something completely new to Palview4 is its new magazine system, and central to this new system is the new game viewer. This game viewer consists of an Html file and a JavaScript file. The viewer is used in conjunction with the new magazine page to replay any inserted games, even those from an inserted crosstable or index. The new page uses the viewer to display the games content by opening a new window for the viewer and passing the number of the game to be viewed. The viewer then takes this passed game number and loads the same numbered game's Html file into the viewer's IFRAME. The newly loaded game can then be replayed.

The new magazine page contains a small JavaScript function that is used to communicate with the viewer:

var vh=450;
var vw=700;
var top=left=0;
var scrnw=screen.width;
var scrnh=screen.height;
if(scrnw>vw){
 left=(scrnw-vw)/2;
 top=(scrnh-vh)/2;
 }
function Gm(gn)
{
 var viewer='gameview.htm?g=g'+gn;
 window.open(viewer,'','height='+vh+',width='+vw+',top='+top+',left='+left);
}

This JavaScript code will be used to link to the viewer and the games themselves so that they can be replayed. The links themselves always use the game's number in the PGN file as in gN.htm. (The first game in a PGN file is zero as far as the program goes, so its corresponding game html file would be g0.htm.) Note that these games are special Html files that are written specifically to be used in the new magazine game viewer. These games are created by the new magazine page. The viewer does not create any games at all - it only creates the viewer Html and JS files.

The first thing that you must do to create a viewer is to set the magviewer htmltype INI option.

htmltype = magviewer

Palview will write a separate Html file and JS file that together form the viewer.

You should be aware that a number of INI options are automatically set whenever you create a magazine page or a viewer. These values cannot be changed, otherwise the games written by the magazine might have different settings from the viewer and this could make the game viewer inoperative. The INI options and there preset values are:

movelinks = on

movingpcs = on

usekeystrokes = on

multilang = off

ns4comp = off

tooltipboard = off

jsfile = on — applies only to viewer


It is important to note that most of the iframe-specific INI options also apply equally to the viewer. For example, we use the INI option stylesheet to set a Cascading Stylesheet to be used for the viewer. (For more information, please see Palview and CSS.)

Below is an example of the new viewer:

As you can see above, the new viewer is actually loaded into a newly opened window. The height of this new window is determined by the INI option viewerheight and the width by viewerwidth. The window is automatically centered on the screen by the script.

Magazine Help

The new game viewer also has the ability to let webmasters integrate a help page. This is done by using the new INI options: helpurl, helpimg and helptooltip. Below is an example of the game viewer using a Question Mark image to signify that a help page is available:

Webmasters are responsible for actually creating their help page and setting the appropriate values for the above mentioned INI options. The help page itself is opened in a new window so that the game currently in the viewer is not interrupted in any way. You page visitors can even choose to minimize the help page, once it is loaded, so that they can refer to it as many times as they need until they are familiar with all the features built into the viewer.

Magazine Email

The new game viewing system was written as a tool for web based chess magazines to interact with their visitors. Not only are games expected to be viewed, but it is hoped that visitors will be encouraged to contribute to the content of the magazine itself. With this purpose in mind, we have added a number of new features to the magazine game viewer to help visitors to interact with the magazine and its content. The first thing that is required to participate in the magazine's content creation process is the ability to contact the magazine itself. To this end we have added the ability to supply an email address on the viewer page. You can see this in any of the examples. At the bottom of the page you'll see an image of an envelope followed by some text, in this case Editor.

The email address to be used is supplied with the new INI option mailtoaddress. (If this option is left blank, then no email link is written to the viewer file at all - useful if you don't want feedback from your visitors.) You can choose any image to use for your envelope with mailtoimg. The text that appears after the envelope image is supplied by the mailtotext INI option.

But there is still one more email feature built into the new viewer. This is the ability to assign a volunteer Editor - Annotator to a specific game. This is done by providing an email address to this volunteer Editor - Annotator using the new PGN Tag:

[AnnoEmail "user@provider.com"]

When Palview encounters a game with this new Tag, it will save the email address and write a mailto at the end of the game itself. This can be seen in the next picture.

The objective here is to provide a method of distributed game analysis whereby a volunteer provides an email address where anyone can send comments about the specific game. The volunteer reviews the commentary and either includes it in the PGN for the game itself, so that the comments can be recycled back into the game, or he rejects the comments. Either way, it distributes the responsibility for specific games to those who wish to take on that responsibility. (Note that volunteers do not have to use their own person email address. It is just as useful for such volunteers to create an email account with many of the free service providers, such as HotMail for this purpose.)

Also note that when the mailto is clicked, that the subject line of the email is automatically filled in for the specific game. In the above example, the subject line would match the Title line shown in the above picture, namely:

Korchnoi V. - Kasparov G., Candidates Match2 1984

Autofen

But why supply an email address to each game? The answer is to get your visitors to email the magazine if they believe they have some analysis to contribute about that game. This analysis can then be added to the game itself by the magazine editor, at his discretion. But in order to aid visitors in first checking their analysis, we have provided a new feature called the autofen. Visitors can click on the small board image beside the email text, called the fen image, and the current position in the game will be written beside it as a FEN string. Visitors can then copy / paste this FEN into their favorite chess engine to get it to analyze the position. You can see the FEN written in the example below.

Most chess engines these days also allow you to copy their analysis to the clipboard. This is also handy in that this analysis can in turn be pasted into the email to be sent to the magazine Editor.

Kibitz Move Recorder

Another useful new feature for magazine support is the ability for the new game viewer to record the Kibitz moves of the user. Palview3 introduced the ability to move the pieces freely on the board using the INI option movingpcs. With Palview4 we introduce the new capability to record these Kibitz moves as they are made by the user. This feature was added in order to allow users to take back some of their Kibitz moves by clicking on the controlpanel's Back button . You can tell that you are recording Kibitz moves when the color of the moves under the board change color and are preceded by the symbols: =>. This ability to take back Kibitz moves is especially useful when taking back moves that involve a capture since the captured piece will be restored to the board. You can see the recorder in action in the example below. (Note that the color used for the recorded moves can be set using the new INI option moverecordercolor.) This new capability is only possible with the new viewer.

Position Memory Feature

The new game viewer can also remember the position on the board at any time so that it can be recalled with a keystroke. To save the current board position, just press on the Numeric Keypad's + sign. To restore the saved position just press the - key on the Numeric Keypad.

Technical Notes About the Autofen

There are a couple of technical points that should be kept in mind about the new autofen feature. Firstly, Palview does not keep track of the FEN value known as the halfmove clock. This value keeps track of the number of moves made without a pawn move or a piece being captured. This value is only of interest in the very rarest of cases where draws may be claimed by the 50 Move Rule or by Three Fold Repetition of Position. This is not really of much interest in chess analysis, so this value will always be written to the FEN as zero. The other technical point arises when a page visitor makes a number of Kibitz moves on the board and then presses the autofen button. In this case, only the position part of the FEN is written - none of the game state, since these values are unknown. But this reduced FEN position can still be of value. For example, in ChessBase 8 you can paste this position using New -> Position -> Paste FEN. The program will then allow you to set the state variables to any values that you wish.