Implemented very basic value-auditing for skills/abilities
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<h2>Saving Throws</h2>
|
||||
<table class="skillTable">
|
||||
{{#each saveList}}
|
||||
<tr>
|
||||
<tr title={{effectList skill ..}}>
|
||||
<td><div class="profIcon" style="background-image: url(/png/profIcons/{{profIcon skill}})"></div></td>
|
||||
{{#if failSkill}}
|
||||
<td class="fail">fail</td>
|
||||
@@ -16,7 +16,7 @@
|
||||
<h2>Skills</h2>
|
||||
<table class="skillTable">
|
||||
{{#each skillList}}
|
||||
<tr>
|
||||
<tr title={{effectList skill ..}}>
|
||||
<td><div class="profIcon" style="background-image: url(/png/profIcons/{{profIcon skill}})"></div></td>
|
||||
{{#if failSkill}}
|
||||
<td class="fail">fail</td>
|
||||
|
||||
@@ -9,11 +9,13 @@ Template.textField.helpers({
|
||||
},
|
||||
input: function(){
|
||||
var text = this.character.strings[this.field];
|
||||
return Spacebars.SafeString(text);
|
||||
if (_.isString(text)) return Spacebars.SafeString(text);
|
||||
return text;
|
||||
},
|
||||
output: function(){
|
||||
var html = evaluateString(this.character, this.character.strings[this.field]);
|
||||
return Spacebars.SafeString(html);
|
||||
if (_.isString(html)) return Spacebars.SafeString(html);
|
||||
return html;
|
||||
},
|
||||
outputClass: function(){
|
||||
if(Template.instance().editing.get()){
|
||||
@@ -28,6 +30,7 @@ Template.textField.events({
|
||||
"blur #textInput": function(){
|
||||
Template.instance().editing.set(false);
|
||||
var text = $("#textInput").html();
|
||||
if(!_.isString(text)) text = "";
|
||||
//TODO sanitise the html
|
||||
var setter = {};
|
||||
setter["strings."+this.field] = text;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{>loginButtons}}
|
||||
<div>
|
||||
{{# each characters}}
|
||||
<li><a href="{{ pathFor 'character' }} ">{{_id}}</a></li>
|
||||
<li><a href="{{ pathFor 'character' }} ">{{_id}}</a> <button class="deleteChar">delete</button></li>
|
||||
{{/each}}
|
||||
</div>
|
||||
<input id="addCharacter" type="button" value="Add Character">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Template.home.events({
|
||||
"click #addCharacter": function (event, template) {
|
||||
Characters.insert(new Character(Meteor.userId()));
|
||||
Characters.insert({});
|
||||
},
|
||||
"click #delete": function(event, template){
|
||||
"click .delete": function(event, template){
|
||||
Characters.remove(this._id);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user