DIR Return Create A Forum - Home
---------------------------------------------------------
The Chess Variant Forum
HTML https://chessvariantforum.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: General Discussion
*****************************************************
#Post#: 189--------------------------------------------------
Forum capabilities: diagrams?
By: HGMuller Date: January 23, 2018, 9:15 am
---------------------------------------------------------
Would it be feasible to enhance the forum with the possibility
to post 'interactive diagrams', like f.e.the one at
HTML http://www.chessvariants.com/report/paco-shako
(where you can
move the pieces around, an in this case where it even contains
an AI that replies)? On chessvariants.com I can do that by
posting directly in HTML (after the uderlying JavaScript file
was put on the server, once and for all).
It would be nice if this board would recognize tags
[diag][/diag], treat the text in between as the description of
the desired diagram, so that it would appear in the posting.
#Post#: 194--------------------------------------------------
Re: Forum capabilities: diagrams?
By: Asher Hurowitz Date: January 23, 2018, 12:50 pm
---------------------------------------------------------
I'll look into it - do you have any ideas?
#Post#: 200--------------------------------------------------
Re: Forum capabilities: diagrams?
By: HGMuller Date: January 23, 2018, 4:14 pm
---------------------------------------------------------
Well, I am not familiar with forum software, so I have no idea
if the software used here provides a mechanism for extension. I
do know that, for instance, the TalkChess forum allows you to
embed an orthodox-Chess diagram in your postig by a [d] tag
followed by a FEN description of the position, and allows you to
embed games between [pgn], [/pgn] tags.
What I have is a JavaScript file called betza.js, which searches
any page that links to it for HTML elements with
class="idiagram" , and then reads the text it contains as a
diagram description, and replaces it by the diagram (which is a
HTML table of piece images, that then can be dragged around). So
what would be needed on the HTML page is something like
[font=courier]<script type="text/javascript"
src="/betza.js"></script>
<div class="idiagram>
files=6
ranks=6
promoChoice=QRN
symmetry=mirror
pawn::::a2-f2
knight:N:::b1,e1
rook::::a1,f1
queen::::c1
king::K::d1
</div>[/font]
to show the start position of Los Alamos Chess. The first line
would provide the link to the script, the rest the definition of
the diagram.
The question is whether we could make the forum software that
generates the HTML for the forum pages to put this <div
class="idiagram> and </div> in the right places on the page, and
the line with the link in the page header. On chessvariants.com
this is possible because you can write your postings directly in
HTML if you want.
#Post#: 202--------------------------------------------------
Re: Forum capabilities: diagrams?
By: GothicChessInventor Date: January 23, 2018, 4:38 pm
---------------------------------------------------------
[quote author=HGMuller link=topic=41.msg200#msg200
date=1516745685]
knight:N:::b1,e1
king::K::d1
[/quote]
So the letters field is just a name disambiguator for displaying
the PGN moves?
#Post#: 207--------------------------------------------------
Re: Forum capabilities: diagrams?
By: HGMuller Date: January 24, 2018, 2:06 am
---------------------------------------------------------
The format for the piece-definition lines in the diagram is:
<piece name>:<SAN/FEN ID>:<move in Betza notation>:<root name of
image file>:<list of squares>
This can be optionally followed by :<number of pieces in hand> .
Empty fields revert to their defaults. For the ID this would be
the (capitalized) first letter of the name (which is why the
Knight has to be overrided), and for the image is the name
itself. For the orthodox pieces and most common fairy pieces it
knows a default move (but for the King this has to be overruled
to suppress castling in Los Alamos Chess). In the list of
squares an extra comma separates white and black pieces (but
because a symmetry was specified, only white pieces had to be
mentioned in the example.
The actual filename of the image used for the piece is
<graphics directory> <color prefix> <root name> . <graphics
extension>
where the other elements (if the defaults won't do) are set for
the entire diagram through lines like
graphicsDir=/images/
graphicsType=png
whitePrefix=w
blackPrefix=b
squareSize=53
All images would have to be present somewhere, of course,
preferably on the forum server itself. (Although in principle
you could use a HTTP link in the graphicsDir specification.)
It is my wish to extend the script in the future with an AI, so
that you can actually play against it. For the Peace Chess
diagram my first posting referred to this is already realized.
(But Peace Chess is so different from typical Chess variants
that this AI is not geerally usable.)
#Post#: 268--------------------------------------------------
Re: Forum capabilities: diagrams?
By: HGMuller Date: January 27, 2018, 12:41 pm
---------------------------------------------------------
This forum seems completely devoid of any form of help. Like a
list of BBC tags that it would recognize, and in particular, how
one should incorporate HTML text. On many forums this can be
done with tags, but here these tags just seem ignored.
All I would need to make diagrams possible is a HTML <script>
tag to be included in the page header. That could then link to a
JavaScript program that would scan all text in postings for
occurrence of [diag][/diag] tags, and convert those to a Chess
diagram according to the descrption contained between those
tags.
*****************************************************