Update README.md

This commit is contained in:
Mimuuu
2014-05-23 03:21:06 +02:00
parent 4ec3401ca3
commit fb7eeaea47
+13 -2
View File
@@ -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. 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. 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 ## ## Implement the calculator ##
It's very easy, all you need to do is include the PHP file, the JS file and the CSS file. It's very easy, all you need to do is include the PHP file, the JS file and the CSS file.
```php ```php
@@ -23,4 +35,3 @@ Then you call the **getTree()** method to generate the 3 lists and everything, a
```php ```php
echo $AASkillsCalculator->getTree(); echo $AASkillsCalculator->getTree();
``` ```
After this, you are good to go.