Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

examples removed from source.

menu removed.
tree structure fixes.
  • Loading branch information...
commit e7ae206d1f2f49f507f2ed17489d64d730651f4c 1 parent 429f128
@fsw authored
Showing with 31 additions and 1,231 deletions.
  1. +4 −2 Makefile
  2. +0 −112 css/menu.css
  3. +0 −25 examples/example1.twr/LICENSE
  4. +0 −13 examples/example1.twr/README
  5. +0 −36 examples/example1.twr/elements/core.xml
  6. +0 −19 examples/example1.twr/elements/equipment.xml
  7. +0 −4 examples/example1.twr/elements/heroes.xml
  8. +0 −4 examples/example1.twr/elements/magic.xml
  9. BIN  examples/example1.twr/favicon.png
  10. +0 −107 examples/example1.twr/info.xml
  11. 0  examples/example1.twr/scripts/helpers.js
  12. 0  examples/example1.twr/scripts/validator.js
  13. +0 −25 examples/example2.twr/LICENSE
  14. +0 −17 examples/example2.twr/README
  15. +0 −160 examples/example2.twr/elements/core_units.xml
  16. +0 −4 examples/example2.twr/elements/equipment.xml
  17. +0 −4 examples/example2.twr/elements/heroes.xml
  18. +0 −4 examples/example2.twr/elements/special_units.xml
  19. +0 −4 examples/example2.twr/elements/templates.xml
  20. +0 −4 examples/example2.twr/elements/tournament.xml
  21. 0  examples/example2.twr/errors.xml
  22. BIN  examples/example2.twr/icons/icon16.png
  23. BIN  examples/example2.twr/icons/icon32.png
  24. BIN  examples/example2.twr/icons/icon64.png
  25. +0 −171 examples/example2.twr/info.xml
  26. +0 −3  examples/example2.twr/lang/en.xml
  27. +0 −3  examples/example2.twr/lang/pl.xml
  28. 0  examples/example2.twr/scripts/display.js
  29. 0  examples/example2.twr/scripts/helpers1.js
  30. 0  examples/example2.twr/scripts/validator.js
  31. +4 −102 src/armycalc.js
  32. +0 −275 src/dep.instance.js
  33. +6 −2 src/instance.js
  34. +3 −17 tests/index.css
  35. +1 −1  tests/index.html
  36. +10 −104 web/armycalc.js
  37. +3 −9 web/template.html
View
6 Makefile
@@ -23,7 +23,6 @@ JS_FILES = ${SRC_DIR}/armycalc.js\
${SRC_DIR}/sandbox.js
CSS_FILES = ${CSS_DIR}/layout.css\
- ${CSS_DIR}/menu.css\
${CSS_DIR}/statusbar.css\
${CSS_DIR}/toolbar.css\
${CSS_DIR}/validation.css\
@@ -89,4 +88,7 @@ doc:
clean:
@@echo "Cleaning up"
@@rm ${AC}
-
+ @@rm ${AC_CSS}
+ @@rm ${AC_MIN}
+ @@rm ${AC_CSS_MIN}
+
View
112 css/menu.css
@@ -1,112 +0,0 @@
-/* MENU */
-
-div.acCanvas div.menucontainer {
- background: black;
- min-height: 25px;
- color: white;
- line-height: 22px;
- margin-bottom: 7px;
-}
-
-div.acCanvas div.menu {
- position:absolute;
- z-index:10;
- /*
- left:20px;
- margin-left:-2.5em;
- width:80%;
- */
-}
-
-div.acCanvas div.menu #acElements li>ul {
- top: auto;
- left: auto;
-}
-
-div.acCanvas div.menu #acElements {
- list-style: none;
-}
-
-div.acCanvas div.menu #acElements ul {
- padding: 0;
- margin:0;
- list-style: none;
- width:10em;
- z-index:99;
- position:relative;
- overflow:visible;
-}
-
-div.acCanvas div.menu #acElements li {
- margin:0;
- position: relative;
- float:left;
- width: 10em;
- background-color: black;
- border:solid 1px #444;
- display:block;
- height:auto;
-}
-
-div.acCanvas div.menu #acElements ul li{
- background-color: black;
-}
-
-div.acCanvas div.menu #acElements ul li{
- border-width:1px 1px 0 0;
-}
-
-div.acCanvas div.menu #acElements ul ul li{
- border-width:1px 1px 0 1px;
-}
-
-div.acCanvas div.menu #acElements ul ul li:last-child {
- border-width:1px;
-}
-
-div.acCanvas div.menu #acElements a {
- text-align: center;
- text-decoration:none;
- display:block;
- color: white;
- white-space: nowrap;
- /* padding: 0.1em;
- margin:0.2em 0 0.2em 0.1em;
- width:11.5em;
- height:1.05em; */
-}
-
-div.acCanvas div.menu #acElements a:hover {
- background-color: white;
- color: black;
-}
-/* div.acCanvas div.menu #acElements a:hover, div.acCanvas div.menu #acElements li:hover, div.acCanvas div.menu #acElements ul li:hover, div.acCanvas div.menu #acElements ul li a:hover */
-
-div.acCanvas div.menu #acElements ul{
- display:none;
-}
-
-/*all see this */
-div.acCanvas div.menu #acElements ul ul, div.acCanvas div.menu #acElements ul ul ul{
- display:none;
- position:absolute;
- margin-top:-1.8em;
- margin-left:10em;
-}
-
-/* non-IE browsers see this */
-div.acCanvas div.menu #acElements ul li>ul, div.acCanvas div.menu #acElements ul ul li>ul {
- margin-top:-1.35em;
-}
-
-
-div.acCanvas div.menu #acElements li:hover ul ul, div.acCanvas div.menu #acElements li:hover ul ul ul, div.acCanvas div.menu #acElements li:hover ul ul ul ul, div.acCanvas div.menu #acElements li:hover ul ul ul ul ul {
- display:none;
-}
-
-div.acCanvas div.menu #acElements li:hover ul, div.acCanvas div.menu #acElements ul li:hover ul, div.acCanvas div.menu #acElements ul ul li:hover ul, div.acCanvas div.menu #acElements ul ul ul li:hover ul, div.acCanvas div.menu #acElements ul ul ul ul li:hover ul {
- /* display:block; */
-}
-
-
-
View
25 examples/example1.twr/LICENSE
@@ -1,25 +0,0 @@
-Copyright 2011 CadoSolutions. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of
- conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
- of conditions and the following disclaimer in the documentation and/or other materials
- provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY CadoSolutions "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CadoSolutions OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are those of the
-authors and should not be interpreted as representing official policies, either expressed
-or implied, of CadoSolutions.
View
13 examples/example1.twr/README
@@ -1,13 +0,0 @@
-
-twr3examples
-this repository contains examples of TWR 3.0 files to share between clients
-part of the ArmyCalc project
-Copyright 2011 CadoSolutions. All rights reserved.
-released under terms of Simplified BSD License
-
-developer: Franciszek Szczepan Wawrzak <frank@wawrzak.com>
-project website: http://armycalc.com/
-
-
-
-
View
36 examples/example1.twr/elements/core.xml
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<elements version="3.0">
-
- <element id="warrior" minCount="1" maxCount="5" minSize="1" defaultSize="5" maxSize="20">
-
- <name>Warrior</name>
- <description>There have to be at least one and maximum 5 units of
- warriors in the army. Each unit can contain from 1 to 20 warriors.
- </description>
-
- <stats><stat id="str">5</stat><stat id="sta">5</stat><stat id="spe">5</stat><stat id="hp">10</stat></stats>
- <costs><cost id="pts">10</cost><cost id="gc">1</cost></costs>
-
- <thumbnail src="media/warrior.jpg"></thumbnail>
-
- <group extends="weapon"/>
-
- <group id="command">
- <element id="chieftain" minCount="0" maxCount="1" minSize="1" maxSize="1">
- <name>Chieftain</name>
- <stats><stat id="str">6</stat><stat id="sta">6</stat><stat id="spe">6</stat><stat id="hp">10</stat></stats>
-
- <element id="squire" minCount="1" maxCount="1" minSize="1" maxSize="1">
- <name>Chieftain's squire</name>
- <stats><stat id="str">1</stat><stat id="sta">1</stat><stat id="spe">1</stat><stat id="hp">1</stat></stats>
- </element>
- </element>
-
- <element id="musician" minCount="0" maxCount="1" minSize="1" maxSize="1">
- <name>Musician</name>
- </element>
- </group>
-
- </element>
-
-</elements>
View
19 examples/example1.twr/elements/equipment.xml
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<elements version="3.0">
-
- <group id="weapon" minTotalCount="0" maxTotalCount="1">
- <element id="shield" size="inherit" afterAppend="that.parent.stat('sta',that.parent.stat('sta')+1);"
- beforeRemove="that.parent.stat('sta',that.parent.stat('sta')-1);">
- <name>Shield</name>
- <description>Shield is a common equipment</description>
- <costs><cost id="pts">2</cost><cost id="gc">0</cost></costs>
- </element>
-
- <element id="2hWpn" size="inherit">
- <name>2 handed weapon</name>
- <description>Shield is a common equipment</description>
- <costs><cost id="pts">2</cost><cost id="gc">0</cost></costs>
- </element>
- </group>
-
-</elements>
View
4 examples/example1.twr/elements/heroes.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<elements version="3.0">
-
-</elements>
View
4 examples/example1.twr/elements/magic.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<elements version="3.0">
-
-</elements>
View
BIN  examples/example1.twr/favicon.png
Deleted file not rendered
View
107 examples/example1.twr/info.xml
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ruleset version="3.0">
-
- <identity>
- <uid>armycalc.twr3.test01</uid>
- <revision>3</revision>
- <url></url>
- </identity>
-
- <languages>
- <language id="pl">
- <transtab src="lang/polish.xml" />
- <name>Polski (polish)</name>
- </language>
- <language id="en" default="true">
- <transtab src="lang/english.xml" />
- <name>English</name>
- </language>
- </languages>
-
- <info>
- <name>Example TWR 3.0</name>
- <author>
- <name>francio</name>
- <email>francio@armycalc.com</email>
- <www></www>
- </author>
- <description>
- <short></short>
- <full></full>
- </description>
- <favicon src="favicon.png" />
- </info>
-
- <stats>
- <stat id="str" display="true">
- <name>strength</name>
- <shortname>Str</shortname>
- <default>5</default>
- </stat>
- <stat id="sta" display="true">
- <name>stamina</name>
- <shortname>Sta</shortname>
- <default>5</default>
- </stat>
- <stat id="spe" display="true">
- <name>speed</name>
- <shortname>Spe</shortname>
- <default>5</default>
- </stat>
- <stat id="hp" display="true">
- <name>hitpoints</name>
- <name>HP</name>
- <shortname>HP</shortname>
- <default>10</default>
- </stat>
- <stat id="us">
- <name>unit size</name>
- <name>US</name>
- <shortname>US</shortname>
- <default>1</default>
- </stat>
- </stats>
-
- <costs>
- <cost id="pts" default="true">
- <name>Points</name>
- <shortname>pts</shortname>
- <unit>pts</unit>
- <default>0</default>
- </cost>
- <cost id="gc">
- <name>Gold Coins</name>
- <shortname>GC</shortname>
- <unit>coins</unit>
- <default>0</default>
- </cost>
- </costs>
-
- <data>
- <elements>
- <elements src="elements/equipment.xml" />
- <elements src="elements/magic.xml" />
- <elements src="elements/core.xml" />
- <elements src="elements/heroes.xml" />
- </elements>
- <scripts>
- <script src="scripts/helpers.js" />
- <script src="scripts/validator.js" />
- </scripts>
- </data>
-
- <armies>
- <army id="defaultArmy">
- <group id="coreUnits">
- <name>Core Units</name>
- <element extends="warriors" />
- <element extends="archers" />
- </group>
- <element extends="hero" />
- </army>
- <army id="tournamentArmy" extends="defaultArmy">
- <element extends="specialHero" />
- </army>
- </armies>
-
-</ruleset>
View
0  examples/example1.twr/scripts/helpers.js
No changes.
View
0  examples/example1.twr/scripts/validator.js
No changes.
View
25 examples/example2.twr/LICENSE
@@ -1,25 +0,0 @@
-Copyright 2011 CadoSolutions. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of
- conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
- of conditions and the following disclaimer in the documentation and/or other materials
- provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY CadoSolutions "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CadoSolutions OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-The views and conclusions contained in the software and documentation are those of the
-authors and should not be interpreted as representing official policies, either expressed
-or implied, of CadoSolutions.
View
17 examples/example2.twr/README
@@ -1,17 +0,0 @@
-README
-
-This archive is a TWR file containing tabletop wargame data.
-This file is added to every TWR and it is not the part of the ruleset itself.
-
-####################
-List of required files that should be in this package:
-
-README - this file.
-LICENCE - licence of this data choosen by the author.
-info.xml - most important ruleset info.
-
-every other file here is specific to this game and should be referenced in info.xml in data section
-
-####################
-This file was build on armycalc.net a collaborative space for wargame players
-Please visit armycalc.net for more info
View
160 examples/example2.twr/elements/core_units.xml
@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<elements xmlns="armycalc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="armycalc http://armycalc.org/xmls/twr3elements.xsd" version="3.0">
-
- <element id="warrior" minCount="1" maxCount="5" defaultSize="5" maxSize="20">
- <name>Warrior</name>
- <description>There have to be at least one and maximum 5 units of warriors in the army. Each unit can contain from 1 to 20 warriors.</description>
- <stats>
- <stat id="str">5</stat>
- <stat id="sta">5</stat>
- <stat id="spe">5</stat>
- <stat id="hp">10</stat>
- </stats>
-
- <cost id="pts">10</cost>
- <cost id="gc">1</cost>
-
- <thumbnail src="media/warrior.jpg"></thumbnail>
-
- <elements>
- <element minCount="0" maxCount="1" minSize="1" maxSize="1">
- <uid>chieftain</uid>
- <name>Chieftain</name>
- <stats>
- <stat id="str">6</stat>
- <stat id="sta">6</stat>
- <stat id="spe">6</stat>
- <stat id="hp">10</stat>
- </stats>
-
- <elements>
- <element minCount="1" maxCount="1" minSize="1" maxSize="1">
- <uid>chieftains-squire</uid>
- <name>Chieftain's squire</name>
- <stats>
- <stat id="str">1</stat>
- <stat id="sta">1</stat>
- <stat id="spe">1</stat>
- <stat id="hp">1</stat>
- </stats>
- </element>
- </elements>
-
- </element>
- </elements>
-
- <elements maxTotalCount="1">
-
- <element minCount="0" maxCount="1" size="inherit"
- afterAppend = "that.parent.stat('sta',that.parent.stat('sta')+1);"
- beforeRemove = "that.parent.stat('sta',that.parent.stat('sta')-1);">
- <uid>shield</uid>
- <name>Shield</name>
- <cost id="pts">1</cost>
- </element>
-
- <element minCount="0" maxCount="1" size="inherit"
- afterAppend = "that.parent.stat('str',that.parent.stat('str')+1);"
- beforeRemove = "that.parent.stat('str',that.parent.stat('str')-1);">
- <uid>two-handed-weapon</uid>
- <name>Two handed weapon</name>
- <cost id="pts">1</cost>
-
- </element>
-
- </elements>
-
- </element>
-
- <element id="archer" minCount="0" maxCount="2" minSize="1" defaultSize="3" maxSize="20">
-
- <name>Archer</name>
- <description></description>
-
- <menu id="menu-infantry-units" />
-
- <stats>
- <stat id="str">4</stat>
- <stat id="sta">6</stat>
- <stat id="spe">5</stat>
- <stat id="hp">5</stat>
- </stats>
-
- <cost id="pts">10</cost>
- <cost id="gc">1</cost>
-
- <thumbnail src="media/archer.jpg"></thumbnail>
-
- <elements>
- <element minCont="0" maxCount="1" minSize="1" maxSize="1">
- <uid>chieftain</uid>
- <name>Chieftain</name>
- <stats>
- <stat id="str">6</stat>
- <stat id="sta">6</stat>
- <stat id="spe">6</stat>
- <stat id="hp">10</stat>
- </stats>
- </element>
- </elements>
-
- </element>
-
- <element id="peon" minCount="0" minSize="5" defaultSize="10">
-
- <name>Peon</name>
-
- <description></description>
-
- <menu id="menu-infantry-units" />
-
- <stats>
- <stat id="str">2</stat>
- <stat id="sta">2</stat>
- <stat id="spe">2</stat>
- <stat id="hp">4</stat>
- </stats>
-
- <cost id="pts">1</cost>
- <cost id="gc">0</cost>
-
- <thumbnail src="media/peon.jpg"></thumbnail>
-
- </element>
-
- <element id="horseman" minCount="0" maxCount="2" minSize="3" defaultSize="5" maxSize="10">
-
- <name>Horseman</name>
-
- <description></description>
-
- <menu id="menu-cavalry-units" />
-
- <stats>
- <stat id="str">3</stat>
- <stat id="sta">3</stat>
- <stat id="spe">3</stat>
- <stat id="hp">6</stat>
- </stats>
-
- <cost id="pts">1</cost>
- <cost id="gc">0</cost>
-
- <thumbnail src="media/horseman.jpg"></thumbnail>
-
- <elements>
- <element minCount="1" maxCount="1" size="inherit">
- <uid>horse</uid>
- <name>Horse</name>
- <stats>
- <stat id="str">0</stat>
- <stat id="sta">0</stat>
- <stat id="spe">25</stat>
- <stat id="hp">2</stat>
- </stats>
- </element>
- </elements>
-
- </element>
-
-</elements>
View
4 examples/example2.twr/elements/equipment.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<elements xmlns="armycalc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="armycalc http://armycalc.org/xmls/twr3elements.xsd" version="3.0">
-
-</elements>
View
4 examples/example2.twr/elements/heroes.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<elements xmlns="armycalc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="armycalc http://armycalc.org/xmls/twr3elements.xsd" version="3.0">
-
-</elements>
View
4 examples/example2.twr/elements/special_units.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<elements xmlns="armycalc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="armycalc http://armycalc.org/xmls/twr3elements.xsd" version="3.0">
-
-</elements>
View
4 examples/example2.twr/elements/templates.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<elements xmlns="armycalc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="armycalc http://armycalc.org/xmls/twr3elements.xsd" version="3.0">
-
-</elements>
View
4 examples/example2.twr/elements/tournament.xml
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<elements xmlns="armycalc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="armycalc http://armycalc.org/xmls/twr3elements.xsd" version="3.0">
-
-</elements>
View
0  examples/example2.twr/errors.xml
No changes.
View
BIN  examples/example2.twr/icons/icon16.png
Deleted file not rendered
View
BIN  examples/example2.twr/icons/icon32.png
Deleted file not rendered
View
BIN  examples/example2.twr/icons/icon64.png
Deleted file not rendered
View
171 examples/example2.twr/info.xml
@@ -1,171 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ruleset xmlns="armycalc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="armycalc http://armycalc.org/xsd/twr3info.xsd" version="3.0">
-
- <!--
- This section contains various information to help identify the ruleset in various application.
- When application opens an army it uses this section to find correspoding ruleset.
- -->
- <identity>
- <uid>123</uid>
- <revision>1</revision>
- <origin>git.armycalc.net/twr3/123.git</origin>
- <url>http://armycalc.net/game/123/files/</url>
- </identity>
-
- <!--
- further sections are for information purposes only.
- -->
- <name>Example Ruleset</name>
-
- <author>
- <name>francio</name>
- <email>francio@armycalc.com</email>
- <netid>1</netid>
- <login>francio</login>
- <url>http://armycalc.net/user/francio</url>
- </author>
-
- <description>
- <full tid="info_description_full">This is an example Ruleset. It contains example units, add-ons and validation script for the abstract game system.</full>
- <short tid="info_description_short">This is an example Ruleset. It contains example units, add-ons and validation script for the abstrac...</short>
- </description>
-
- <icons>
- <tiny src="icons/icon16.png"/>
- <small src="icons/icon32.png"/>
- <large src="icons/icon64.png"/>
- </icons>
-
-
- <!--
- Stat fields that would be possible to define for every element.
- The display attribute will make this stat shown on the default army list and in the editor
- -->
- <stats>
- <stat id="str" display="true">
- <name>strength</name>
- <shortname>Str</shortname>
- <default>5</default>
- </stat>
- <stat id="sta" display="true">
- <name>stamina</name>
- <shortname>Sta</shortname>
- <default>5</default>
- </stat>
- <stat id="spe" display="true">
- <name>speed</name>
- <shortname>Spe</shortname>
- <default>5</default>
- </stat>
- <stat id="hp" display="true">
- <name>hitpoints</name>
- <shortname>HP</shortname>
- <default>10</default>
- </stat>
- <stat id="xx">
- <name>hidden stat</name>
- <shortname>XX</shortname>
- <default>0</default>
- </stat>
- </stats>
-
- <!--
- costs are similar to stats. except that application would be using elements sizes to sum up their values.
- it is also possible to limit max and min cost for an element
- unit is a suffix for display purposes
- -->
- <costs>
- <cost id="pts">
- <name>Points</name>
- <shortname>pts</shortname>
- <unit>pts</unit>
- <default>0</default>
- </cost>
- <cost id="gc">
- <name>Gold Coins</name>
- <shortname>GC</shortname>
- <unit>coins</unit>
- <default>0</default>
- </cost>
- <cost id="us">
- <name>Unit Size</name>
- <shortname>US</shortname>
- <unit>us</unit>
- <default>0</default>
- </cost>
- </costs>
-
- <!--
- data files script includes
- order of this is important for the inheritance!
- -->
- <data>
- <elements>
- <elements src="elements/equipment.xml"></elements>
- <elements src="elements/templates.xml"></elements>
- <elements src="elements/core_units.xml"></elements>
- <elements src="elements/special_units.xml"></elements>
- <elements src="elements/heroes.xml"></elements>
- <elements src="elements/tournament.xml"></elements>
- </elements>
-
- <scripts>
- <script src="scripts/helpers1.js"/>
- <script>
- //<!--
- //scripts can be as well defined inline
- //-->
- </script>
- <script src="scripts/validator.js"/>
- <script src="scripts/display.js"/>
- </scripts>
- <errors>
- <errors src="errors.xml"/>
- </errors>
- <!--
- twr uses ISO 639-1 language codes (the code parameter)
- this will for example open this ruleset in preffered user language when editing online.
- http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
- -->
- <languages>
- <language code="pl" src="lang/pl.xml"/>
- <language code="en" default="true" src="lang/en.xml"/>
- </languages>
-
- </data>
-
- <!--
- this defines available armies. its syntax is very similar to the element syntax.
- all available sub-elements and groupd will be available in the main menu
- this adds some extra flexibility.
- army elements can extend each other same way elements can.
- this way you can create special models for tournaments etc.
- if you are creating a simple game system you can also use this to keep all races in single ruleset.
- if your game system is complex it is recommended to create separate rulesets for each race
- -->
- <armies>
-
- <army id="default-army">
- <name>Army</name>
- <maxCosts>
- <cost id="pts">1500</cost>
- <cost id="gc">10</cost>
- </maxCosts>
- <group id="root-core-units" extends="core-units"/>
- <group id="root-special-units" extends="special-units"/>
- <group id="root-heroes-units" extends="heroes-units"/>
- </army>
-
- <army id="tournament-army" extends="default-army">
- <name>Tournament Army</name>
- <maxCosts>
- <cost id="pts">2000</cost>
- <cost id="gc">20</cost>
- </maxCosts>
- <!-- other groups are inherited from default-army we just override the heroes group-->
- <group id="root-heroes-units" extends="tournament-heroes-units"/>
- </army>
-
- </armies>
-
-</ruleset>
View
3  examples/example2.twr/lang/en.xml
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<language>
-</language>
View
3  examples/example2.twr/lang/pl.xml
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<language>
-</language>
View
0  examples/example2.twr/scripts/display.js
No changes.
View
0  examples/example2.twr/scripts/helpers1.js
No changes.
View
0  examples/example2.twr/scripts/validator.js
No changes.
View
106 src/armycalc.js
@@ -20,10 +20,8 @@ var ArmyCalc = (function() {
this.canvas.find('#acMaximize').click(function(){that.setFullscreen(true); return false;});
this.canvas.find('#acMinimize').click(function(){that.setFullscreen(false); return false;});
-
this.canvas.find('#acNew').click(function(){that.newArmy(); return false;});
this.canvas.find('#acRevalidate').click(function(){that.revalidate(); return false;});
-
this.canvas.find('#acPrint').click(function(){that.print(); return false;});
this.canvas.find('#acDec').click( function(){ _focused_element.size(_focused_element.size()-1); return false;}).hide();
@@ -44,8 +42,8 @@ var ArmyCalc = (function() {
}).hide();
this.twr = new ArmyCalc.TwrReader({
- 'onProgress' : function(percent){ console.log('progress: ' + percent + '%'); },
- 'onLoaded' : function(){ console.log('DONE'); }
+ 'onProgress' : function(percent){ that.setStatus('loading ' + that.twrUrl + ' (' + Math.round(percent) + '%)'); },
+ 'onLoaded' : function(){ that.setStatus(that.twrUrl + ' loaded.'); }
});
this.army = null;
@@ -108,14 +106,9 @@ var ArmyCalc = (function() {
setError : function( text ){
this.statusElem.html('<b style="color:red">'+text+'</b>');
},
- calcLoadUnitsXml : function( xml ){
- console.log(xml);
- },
loadTWR : function( url ){
-
- this.twr.load( url );
- this.setStatus( 'loading '+url );
-
+ this.twrUrl = url;
+ this.twr.load( this.twrUrl );
},
revalidate : function( ){
if(! this.army ){
@@ -133,15 +126,11 @@ var ArmyCalc = (function() {
},
print : function( ){
-
if(! this.army ){
this.flashMsg( "Please create new army first!" );
return;
}
-
-
acPrintText(this.canvas.find(".unitslist").html());
-
},
newArmy : function( ){
@@ -174,93 +163,6 @@ var ArmyCalc = (function() {
for (id in costInputs ) {
that.army.maxTotalCosts[id] = costInputs[id].val();
}
-
-
- function appendToMenu(ul, children, path){
- for (var id in children) {
- if (children[id] instanceof ArmyCalc.ElementTemplate) {
- var menu_elem = $("<a rel='" + id + "'href='#'>"+children[id].name+"</a>");
- ul.append($("<li></li>").append(menu_elem));
- menu_elem.click(function(){
- var group = that.army;
- for (var i=0; i<path.length; i++)
- group = group.children[path[i]];
- var inst = group.appendElement($(this).attr('rel'));
- $('.submm').hide();
- inst.focus();
- return false;
- });
- }
- else if (children[id] instanceof ArmyCalc.GroupTemplate) {
- var subm = $("<ul class='submm'></ul>");
- appendToMenu(subm, children[id].children, path.concat(id));
- var menu_elem = $("<a href='#'>"+children[id].name+"</a>");
- menu_elem.click(function(){return false;});
- ul.append($("<li></li>").append(menu_elem).append(subm).hover( function(){
- $(this).children("ul").show();
- }, function(){
- $(this).children("ul").hide();
- }));
- }
- }
- }
- that.canvas.find('#acElements').html();
- appendToMenu(that.canvas.find('#acElements'), that.army.template.children, []);
- /*
- var menu_ul_by_id = {};
- // we are buliding the menu and populating the menu_ul_by_id table
- // TODO make this recurrent to populate multiple menu levels?
- $.each(calc.model.mainmenu,function( id, item ){
-
- menu_ul_by_id[id] = $("<ul class='submm'></ul>");
-
- var menu_elem = $("<a href='#'>"+item.name+"</a>");
-
- calc.canvas.find('#acElements').append(
- $("<li></li>")
- .append(menu_elem)
- .append(menu_ul_by_id[id])
- .hover(function(){ $(this).children("ul").show();},function(){$(this).children("ul").hide();})
- );
-
- $.each(item.submenus,function( child_id, child ){
- menu_ul_by_id[child_id] = $("<ul class='submm'></ul>");
- var menu_elem = $("<a href='#'>"+child.name+"</a>");
-
- menu_ul_by_id[id].append(
- $("<li></li>")
- .append(menu_elem)
- .append(menu_ul_by_id[child_id])
- .hover(function(){ $(this).children("ul").show();},function(){$(this).children("ul").hide();})
- );
-
- });
-
- });
-
- // we are appending all elements that have menu defined to the menu
- $.each(calc.army.element.elements,function( id, item ){
- $.each(item.elements,function( id, item ){
- if(item.menu_id){
- var appendButton = $("<a href='#'>"+item.name+"</a>");
- menu_ul_by_id[item.menu_id].append($("<li></li>").append(appendButton));
- appendButton.click( function(){
- calc.army.append( id );
- $('.submm').hide();
- } );
- }
- });
- });
-
- //in case a model does not define any units for a menu we remove it from the dom tree
- $.each(menu_ul_by_id,function( id, item ){
- if($(item).children('li').length == 0)
- $(item).parent().remove();
- });
- */
-
-
-
});
body.append($("<div class='submit'></div>").append(createButton));
View
275 src/dep.instance.js
@@ -1,275 +0,0 @@
-
-function acInstance( calc, ruleset, parent, element ){
-
- var that = this;
- this.parent = parent;
- this.isArmy = ( this.parent == null );
- this.calc = calc;
- this.army = calc.army;
- this.ruleset = ruleset;
-
-
- this.element = element;
- this.name = element.name;
-
-
- this._size = parseInt( element.defaultSize );
-
- this.size = function( newsize ){
- if( typeof newsize === 'undefined' )
- return this._size;
-
-
- this._size = newsize;
- this._dom_size.html( this._size );
-
-
-
- $.each( this.child, function( id, item ){
- $.each( item, function( id, item ){
- if(item.element.size === 'inherit')
- item.size(newsize);
- });
- });
-
- if((typeof(_focused_element) !== 'undefined') && (_focused_element == this )){
- $('#acDec').toggle( this.size() != this.element.minSize );
- $('#acInc').toggle( this.size() != this.element.maxSize );
- }
-
-
-
- $.each( this._costs_spans, function( id, item){
- if( that._size * that.element.cost[id] > 0 )
- item.text( that._size * that.element.cost[id] );
- else
- item.html( '&nbsp;' );
- });
-
- //$each()
-
- }
-
- this.stat = function( statid, newvalue ){
-
-
- if( typeof newvalue === 'undefined' )
- return this._stats[ statid ];
-
- if( statid in this._stats ){
- this._stats[ statid ] = newvalue;
- this._stats_spans[ statid ].text( this._stats[statid] );
- }
-
- }
-
- this._rebuildSubmenu = function(){
-
-
- }
-
- this._rebuildListElem = function(){
-
- }
-
-
- if(! this.isArmy ){
-
- this._subul = $("<ul></ul>");
- this._dom_size = $("<span>" + this._size + "</span>");
-
- this._anchor = $("<a href='#'> x "+this.name+"</a>").prepend( this._dom_size );
-
- this._costs_spans = {};
-
- $.each( this.ruleset.costs, function( id, item){
-
- that._costs_spans[ id ] = $("<span class='cst'>"+"</span>");
- that._anchor.append( that._costs_spans[ id ] );
-
- } );
-
-
- this._stats_spans = {};
-
- if( this.element.stats ){
-
- this._stats = {};
- for(id in this.element.stats)
- this._stats[id] = this.element.stats[id];
-
- $.each( this.ruleset.stats, function( id, item){
-
- that._stats_spans[ id ] = $("<span class='st'>"+that._stats[id]+"</span>");
- that._anchor.append( that._stats_spans[ id ] );
-
- });
- }
-
-
- this._li = $("<li></li>").append(this._anchor).append(this._subul);
-
-
-
- //TODO
- //should we keep submenus in memory or generate them on the fly on each click?
- this._submenu = $("<ul></ul>");
-
- if(this.element.thumbnail)
- this._submenu.append($("<li>"+this.element.thumbnail+"</li>"));
-
- if(this.element.description)
- this._submenu.append($("<li>"+this.element.description+"</li>"));
-
-
- //this._submenu.append($("<li><b>append:</b></li>"));
-
- $.each(this.element.elements,function( id, item ){
- $.each( item.elements, function( id, item ){
- var button = $("<a href='#'>"+item.name+"</a>");
- button.click( function(){ that.append(id);} );
- that._submenu.append($("<li></li>").append(button));
- });
- });
-
- calc.submenuElem.append(this._submenu);
-
- this._submenu.hide();
-
- this._anchor.click(function(){ that._focus(); return false; });
-
-
- } else {
-
- this._subul = $('#acUnits');
-
- }
-
- this._errorsul = $("<ul class='errors'></ul>");
-
-
- this.clear = function() {
- this.child={}
- var that = this;
- $.each( this.element.elements, function( id, item ){
- $.each( item.elements, function( id, item ){
- that.child[id] = [];
- });
- });
-
- }
-
- this.clear();
-
- this.toggleError = function( uid, on ){
-
- this._errorsul.find( '.' + uid ).remove();
- if(on)
- this._errorsul.append( "<li class='" + uid + " " + this.ruleset.errors[uid]['class'] + "'>" + this.ruleset.errors[uid]['message'] + "</li>" );
- }
-
- this.remove = function(){
-
- //checking if minCount was reached
- if( this.parent.child[this.element.uid].length > this.element.minCount ){
-
- if( this.element.beforeRemove )
- acSandbox( this.element.beforeRemove, { 'that':this, 'army':this.army } );
-
- this.clear();
- this.parent.child[this.element.uid].splice( this.parent.child[this.element.uid].indexOf( this ), 1 );
- this._li.remove();
- this._submenu.remove();
-
- } else
- this.calc.flashMsg( "Minimum count of "+this.element.name+" is "+this.element.minCount );
- }
-
-
- this.count = function( uid ) {
-
- if( typeof uid === 'undefined' )
- return this.parent.child[this.element.uid].length;
-
- if(uid in this.child)
- return this.child[uid].length;
-
- return 0;
- }
-
- this.append = function( uid ) {
-
- var element_to_append = null;
- var that = this;
-
- $.each( this.element.elements, function( id, item ){
- if(item.elements[uid]){
- element_to_append = item.elements[uid];
- //check if element group total count is reached
- var elements_group_count = 0;
- $.each( item.elements, function( id, item){
- elements_group_count += that.child[id].length;
- });
- //if so we do not append
- if( elements_group_count === item.maxTotalCount){
- that.calc.flashMsg("Maximum total count of group "+item.name+" reached ("+item.maxTotalCount+")");
- element_to_append = null;
- }
- }
- });
-
- if(!element_to_append)
- return;
-
- //checking if maxCount was reached
- if( (element_to_append.maxCount == null) || (this.child[uid].length < element_to_append.maxCount) ){
-
- var instance = new acInstance( calc, ruleset, this, element_to_append );
- this.child[uid].push( instance );
- this._subul.append( instance._li );
- if(element_to_append.size === 'inherit')
- instance.size(this._size);
-
- //HOOKS
- if( element_to_append.afterAppend )
- acSandbox( element_to_append.afterAppend, { 'that':instance, 'army':this.army } );
-
- } else
- this.calc.flashMsg("Maximum count of "+element_to_append.name+" reached ("+element_to_append.maxCount+")");
- }
-
-
- this._focus = function(){
-
- calc.submenuElem.children().hide();
- that._submenu.show();
-
- if(typeof(_focused_element) !== 'undefined')
- _focused_element._anchor.removeClass('focus');
-
- _focused_element = this;
- _focused_element._anchor.addClass('focus');
-
- $('#acUp').toggle(_focused_element._li.prev().length > 0);
- $('#acDown').toggle(_focused_element._li.next().length > 0);
-
- $('#acDec').toggle( (that.element.size === 'custom') && (that.size() != that.element.minSize) );
- $('#acInc').toggle( (that.element.size === 'custom') && (that.size() != that.element.maxSize) );
- $('#acRem').toggle( true );
-
- }
-
- //we check if any child element has minCount and append it if so.
- $.each( this.element.elements,function( id, item ){
- $.each( item.elements, function( id, item ){
- for(var i=0;i<item.minCount;i++)
- that.append(id);
- });
- });
-
-
- if(! this.isArmy )
- this.size( parseInt( element.defaultSize ) );
-
-}
-
View
8 src/instance.js
@@ -27,7 +27,7 @@
if (typeof parent.canvas.children != 'undefined'){
var anchor = $('<a href="#">' + template.name + '</a>');
- this.sizeSpan = $('<span> size </span>');
+ this.sizeSpan = $('<span> 0x </span>');
this.li = $('<li></li>').append(anchor.prepend(this.sizeSpan));
this.canvas.children = $('<ul></ul>');
anchor.click(function(){that.focus()});
@@ -42,11 +42,13 @@
for (var i in template.children) {
if(template.children[i] instanceof ArmyCalc.GroupTemplate)
{
+ console.log('adding ' + i + ' to ' + this.template.id);
this.children[i] = new ArmyCalc.GroupInstance(this, template.children[i]);
- this.canvas.available.append('<li>GROUP</li>');
+ //this.canvas.available.append('<li>GROUP</li>');
}
else
{
+ console.log('adding ' + i + ' to ' + this.template.id);
this.children[i] = [];
this.canvas.available.append(template.children[i]._createAppender(this));
}
@@ -69,6 +71,8 @@
},
appendElement : function( id ){
//TODO error handling
+ alert( 'kaszanka' + id + this.template.children.length);
+
var instance = new ArmyCalc.ElementInstance(this, this.template.children[id]);
this.children[id].push(instance);
return instance;
View
20 tests/index.css
@@ -49,22 +49,8 @@ table {
body {
background-color: #ccc;
- padding: 20px;
- width: 900px;
- margin: 0px auto;
+ padding: 0;
+ /*width: 900px;
+ margin: 0 auto;*/
}
-div#legend {
- float: left;
- width: 280px;
- padding: 10px;
-}
-
-div#rhs {
- margin-left: 300px;
-}
-
-div#legend p {
- padding:10px;
- font-size:13px;
-}
View
2  tests/index.html
@@ -20,7 +20,7 @@
//<!--
$.ajaxSetup({cache: false});
calc = new ArmyCalc('#calc', '../web/template.html');
- calc.loadTWR('../examples/dwarfs.twr/');
+ calc.loadTWR('../../armycalc.net/twrs/dwarfs.twr/');
//-->
</script>
View
114 web/armycalc.js
@@ -20,10 +20,8 @@ var ArmyCalc = (function() {
this.canvas.find('#acMaximize').click(function(){that.setFullscreen(true); return false;});
this.canvas.find('#acMinimize').click(function(){that.setFullscreen(false); return false;});
-
this.canvas.find('#acNew').click(function(){that.newArmy(); return false;});
this.canvas.find('#acRevalidate').click(function(){that.revalidate(); return false;});
-
this.canvas.find('#acPrint').click(function(){that.print(); return false;});
this.canvas.find('#acDec').click( function(){ _focused_element.size(_focused_element.size()-1); return false;}).hide();
@@ -44,8 +42,8 @@ var ArmyCalc = (function() {
}).hide();
this.twr = new ArmyCalc.TwrReader({
- 'onProgress' : function(percent){ console.log('progress: ' + percent + '%'); },
- 'onLoaded' : function(){ console.log('DONE'); }
+ 'onProgress' : function(percent){ that.setStatus('loading ' + that.twrUrl + ' (' + Math.round(percent) + '%)'); },
+ 'onLoaded' : function(){ that.setStatus(that.twrUrl + ' loaded.'); }
});
this.army = null;
@@ -108,14 +106,9 @@ var ArmyCalc = (function() {
setError : function( text ){
this.statusElem.html('<b style="color:red">'+text+'</b>');
},
- calcLoadUnitsXml : function( xml ){
- console.log(xml);
- },
loadTWR : function( url ){
-
- this.twr.load( url );
- this.setStatus( 'loading '+url );
-
+ this.twrUrl = url;
+ this.twr.load( this.twrUrl );
},
revalidate : function( ){
if(! this.army ){
@@ -133,15 +126,11 @@ var ArmyCalc = (function() {
},
print : function( ){
-
if(! this.army ){
this.flashMsg( "Please create new army first!" );
return;
}
-
-
acPrintText(this.canvas.find(".unitslist").html());
-
},
newArmy : function( ){
@@ -174,93 +163,6 @@ var ArmyCalc = (function() {
for (id in costInputs ) {
that.army.maxTotalCosts[id] = costInputs[id].val();
}
-
-
- function appendToMenu(ul, children, path){
- for (var id in children) {
- if (children[id] instanceof ArmyCalc.ElementTemplate) {
- var menu_elem = $("<a rel='" + id + "'href='#'>"+children[id].name+"</a>");
- ul.append($("<li></li>").append(menu_elem));
- menu_elem.click(function(){
- var group = that.army;
- for (var i=0; i<path.length; i++)
- group = group.children[path[i]];
- var inst = group.appendElement($(this).attr('rel'));
- $('.submm').hide();
- inst.focus();
- return false;
- });
- }
- else if (children[id] instanceof ArmyCalc.GroupTemplate) {
- var subm = $("<ul class='submm'></ul>");
- appendToMenu(subm, children[id].children, path.concat(id));
- var menu_elem = $("<a href='#'>"+children[id].name+"</a>");
- menu_elem.click(function(){return false;});
- ul.append($("<li></li>").append(menu_elem).append(subm).hover( function(){
- $(this).children("ul").show();
- }, function(){
- $(this).children("ul").hide();
- }));
- }
- }
- }
- that.canvas.find('#acElements').html();
- appendToMenu(that.canvas.find('#acElements'), that.army.template.children, []);
- /*
- var menu_ul_by_id = {};
- // we are buliding the menu and populating the menu_ul_by_id table
- // TODO make this recurrent to populate multiple menu levels?
- $.each(calc.model.mainmenu,function( id, item ){
-
- menu_ul_by_id[id] = $("<ul class='submm'></ul>");
-
- var menu_elem = $("<a href='#'>"+item.name+"</a>");
-
- calc.canvas.find('#acElements').append(
- $("<li></li>")
- .append(menu_elem)
- .append(menu_ul_by_id[id])
- .hover(function(){ $(this).children("ul").show();},function(){$(this).children("ul").hide();})
- );
-
- $.each(item.submenus,function( child_id, child ){
- menu_ul_by_id[child_id] = $("<ul class='submm'></ul>");
- var menu_elem = $("<a href='#'>"+child.name+"</a>");
-
- menu_ul_by_id[id].append(
- $("<li></li>")
- .append(menu_elem)
- .append(menu_ul_by_id[child_id])
- .hover(function(){ $(this).children("ul").show();},function(){$(this).children("ul").hide();})
- );
-
- });
-
- });
-
- // we are appending all elements that have menu defined to the menu
- $.each(calc.army.element.elements,function( id, item ){
- $.each(item.elements,function( id, item ){
- if(item.menu_id){
- var appendButton = $("<a href='#'>"+item.name+"</a>");
- menu_ul_by_id[item.menu_id].append($("<li></li>").append(appendButton));
- appendButton.click( function(){
- calc.army.append( id );
- $('.submm').hide();
- } );
- }
- });
- });
-
- //in case a model does not define any units for a menu we remove it from the dom tree
- $.each(menu_ul_by_id,function( id, item ){
- if($(item).children('li').length == 0)
- $(item).parent().remove();
- });
- */
-
-
-
});
body.append($("<div class='submit'></div>").append(createButton));
@@ -434,7 +336,7 @@ if (navigator.appName != 'Microsoft Internet Explorer') {
if (typeof parent.canvas.children != 'undefined'){
var anchor = $('<a href="#">' + template.name + '</a>');
- this.sizeSpan = $('<span> size </span>');
+ this.sizeSpan = $('<span> 0x </span>');
this.li = $('<li></li>').append(anchor.prepend(this.sizeSpan));
this.canvas.children = $('<ul></ul>');
anchor.click(function(){that.focus()});
@@ -449,11 +351,13 @@ if (navigator.appName != 'Microsoft Internet Explorer') {
for (var i in template.children) {
if(template.children[i] instanceof ArmyCalc.GroupTemplate)
{
+ console.log('adding ' + i + ' to ' + this.template.id);
this.children[i] = new ArmyCalc.GroupInstance(this, template.children[i]);
- this.canvas.available.append('<li>GROUP</li>');
+ //this.canvas.available.append('<li>GROUP</li>');
}
else
{
+ console.log('adding ' + i + ' to ' + this.template.id);
this.children[i] = [];
this.canvas.available.append(template.children[i]._createAppender(this));
}
@@ -476,6 +380,8 @@ if (navigator.appName != 'Microsoft Internet Explorer') {
},
appendElement : function( id ){
//TODO error handling
+ alert( 'kaszanka' + id + this.template.children.length);
+
var instance = new ArmyCalc.ElementInstance(this, this.template.children[id]);
this.children[id].push(instance);
return instance;
View
12 web/template.html
@@ -13,21 +13,14 @@
</div>
</div>
- <div class="menucontainer">
- <div class="menu">
- <ul id="acElements"></ul>
- </div>
- </div>
<div class="workspace">
- <div id="acAvailable">
-
- </div>
<div class="unitslist">
<div id="acUnitsHeader"></div>
<ul id="acUnits">
</ul>
total: <span id="acTotal"></span>
</div>
+
<div class="unitdetails">
<div id="acDetails">
<ul class='actions'>
@@ -39,10 +32,11 @@
</ul>
<div class='submenu'></div>
</div>
+ <div id="acAvailable">
+ </div>
</div>
</div>
<div class="statusbar">
-
<div class="status" id="acStatus"></div>
<div class="link">powered by <a href="http://armycalc.net/">ArmyCalc</a></div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.