Instead of displaying an iframe, you could do one of the following:
- Add a div with the class
besogo-editor
and set attributes of the div to set options for besogo, and then callbesogo.autoInit()
to initialize the editor. - Add a div, and then call
besogo.create(div, options);
to initialize it with options specified in the dictionary objectoptions
.
Unfortunately, my code does not make it possible for this to be immediately done. However, the code could be modified to make this possible. The editor object actually has functions for setting game info, but the editor object is not directly exposed to the code calling besogo. However, this could be achieved by modifying the besogo.create
function to return a handle the editor object. My editor object does have a rudimentary game info editing capability built into the comment panel (but I suppose you wanted to trim that away).
Further, another way to do this is to pass an initial SGF file into besogo, with the game info fields set (if all you want to do is initialize player names, etc.)
Could you specify what limitations might be present in whatever platform you are working with? How are you even interfacing with a database if your platform is āno-codeā? I think youāll have to figure out how to directly modify the javascript, html, css in order to customize and integrate besogo properly.
Automatically loading an SGF can be done by passing the URL via the sgf
option, or just simply placing the SGF text into the body of the div. Please see the documentation in the README and let me know if you have any questions.
I think saving an SGF directly to your database could be accomplished by modifying the code in js/filePanel.js
to hook into your database rather than generating a download.
Would you mind just discussing this publicly here? I think keeping this process open might be helpful for other potential users that would like to do something similar. Further, someone else might offer advice as well.
For Japanese rules games, another way to accomplish preset handicap stones is for your website to set up an initial SGF file with the handicap stones set up as āset stonesā. Besogo will automatically set white as the first to play if there are black handicap set stones in the root node of the SGF.
Besogo is designed more as a generic SGF editor rather than a game interface (i.e., there is nothing to prevent funny business, or enforce the rules, in a competitive context) and it is not programmed to be aware of the differences between various rules. Adding support to automatically pass the first N turns of white in order to set handicap stones for Chinese rules would be possible, but it would require more significant implementation work. Weād have to think about what happens if a player navigates away from the current game state, or tries to create variations, etc. I guess the cleanest way would be to add a new state variable into the game tree to track how many more times white still needs to pass.