Embedding Online Editor

WARNING: JavaScript Editor API is not finished jet! Use this only for testing!

Online Army Editor was written in single javascript file. It works on unpacked *.twr file. It can be easy used on your website or to convert your web browser into offline editor.

Example

Example embedded editor can be found here: LINK

View this page source to see the general concept.

Limitations

Editor needs to know the URLs to info.xml file and units XML files. It can also contain URL to folder containing media(thumbnails).

Editor can not run the lua validation or display scripts!

Online editor passes generated army to armycalc server to validate or print it!

Unless you will pass to it a special id identifying ruleset in database on armycalc.com (this does not work for now) editor on your website would not be able to validate or generate pdf from army!

Using editor offline (to test ruleset)

  • Create a new folder on your disk and place info.xml and units.xml there(files extracted from ruleset)
  • If your units contains thumbnails create 'media' catalogue there and place images in it
  • Save Example as index.html
  • In this file, replace this: infourl: 'http://armycalc.com/example/info.xml', unitsurls: ['http://armycalc.com/example/units.xml'], With this: infourl: 'info.xml', unitsurls: ['units.xml'],
  • Open index.html in web browser
© 2009,2010 FSW; almost valid XHTML; generated in: 0.07s;