diff --git a/README.md b/README.md index 15edce8..a92d79d 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,21 @@ The PHP file is used to create the basic setup, the 3 lists, the button and the Nothing but pure PHP / JS was used in order to use it the easiest way possible, without having to deal with any framework. -###### What's missing ###### +##### What's missing ##### The XML file is currently filled with false content. The same image and description is used for everything. The XML format is described further. +## How the files work ## +#### PHP file #### +Read the XML and return the HTML code of the calculator. +#### JS file #### +Everything is in one file so it's easier to implement, however the code inside the file is divided into several parts so it's still easy to read and edit: +* **Lists related** - Functions related to the "select" lists. +* **Skills related** - Functions related to anything that touches specific skills (highlight selected skills, display details, ...). +* **Points related** - Functions related to the points count. +* **URL/Skills related** - Functions related to the creation of the link, and reading the parameter to display a specific build. + +It is also worth mentioning that the **parentNode** / **childNodes** combination has been abused a lot, so changing casually the HTML would most likely break the entire thing. + ## Implement the calculator ## It's very easy, all you need to do is include the PHP file, the JS file and the CSS file. ```php @@ -23,4 +35,3 @@ Then you call the **getTree()** method to generate the 3 lists and everything, a ```php echo $AASkillsCalculator->getTree(); ``` -After this, you are good to go.