diff --git a/.gitignore b/.gitignore index a0990bd..58560ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /kdmvenv +*.pyc +/.idea diff --git a/static/javascript/kdm.js b/static/javascript/kdm.js index 6503f7b..8363347 100644 --- a/static/javascript/kdm.js +++ b/static/javascript/kdm.js @@ -53,6 +53,24 @@ $rootScope.deletetab = function(tabid) { deleteTab($rootScope, tabid); } + + $rootScope.inc = function(item, name="value") { + if(item[name] === undefined) { + item[name] = 0 + }else if(typeof item[name] === "string") { + item[name] = Number(item[name]) + } + item[name] += 1; + } + + $rootScope.dec = function(item, name="value") { + if(item[name] === undefined) { + item[name] = 0 + }else if(typeof item[name] === "string") { + item[name] = Number(item[name]) + } + item[name] -= 1; + } $rootScope.tabs = []; diff --git a/static/templates/char/armour.html b/static/templates/char/armour.html index c7b81cd..0f54389 100644 --- a/static/templates/char/armour.html +++ b/static/templates/char/armour.html @@ -1,13 +1,15 @@