Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9368b06d0 | ||
|
|
2703367681 | ||
|
|
d419442549 | ||
|
|
99df01c950 |
@@ -30,7 +30,7 @@ Schemas.Proficiency = new SimpleSchema({
|
|||||||
Proficiencies.attachSchema(Schemas.Proficiency);
|
Proficiencies.attachSchema(Schemas.Proficiency);
|
||||||
|
|
||||||
Proficiencies.attachBehaviour("softRemovable");
|
Proficiencies.attachBehaviour("softRemovable");
|
||||||
makeChild(Proficiencies);
|
makeChild(Proficiencies, ["enabled"]);
|
||||||
|
|
||||||
Proficiencies.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
Proficiencies.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||||
Proficiencies.deny(CHARACTER_SUBSCHEMA_DENY);
|
Proficiencies.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ TemporaryHitPoints = new Mongo.Collection("temporaryHitPoints");
|
|||||||
Schemas.TemporaryHitPoints = new SimpleSchema({
|
Schemas.TemporaryHitPoints = new SimpleSchema({
|
||||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||||
name: {type: String, optional: true},
|
name: {type: String, optional: true},
|
||||||
maximum: {type: Number, defaultValue: 0},
|
maximum: {type: Number, defaultValue: 0, min: 0, max: 500},
|
||||||
used: {type: Number, defaultValue: 0},
|
used: {type: Number, defaultValue: 0, min: 0, max: 500},
|
||||||
deleteOnZero:{type: Boolean, defaultValue: false},
|
deleteOnZero:{type: Boolean, defaultValue: false},
|
||||||
dateAdded: {
|
dateAdded: {
|
||||||
type: Date,
|
type: Date,
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
Template.addTHPDialog.events({
|
Template.addTHPDialog.events({
|
||||||
"tap #addButton": function(event, instance){
|
"tap #addButton": function(event, instance){
|
||||||
|
var max = +instance.find("#quantityInput").value;
|
||||||
|
if (!max || max < 0) max = 0;
|
||||||
TemporaryHitPoints.insert({
|
TemporaryHitPoints.insert({
|
||||||
charId: this.charId,
|
charId: this.charId,
|
||||||
name: instance.find("#nameInput").value,
|
name: instance.find("#nameInput").value,
|
||||||
maximum: +instance.find("#quantityInput").value,
|
maximum: max,
|
||||||
deleteOnZero: !!instance.find("#deleteWhenZeroCheckbox").checked,
|
deleteOnZero: !!instance.find("#deleteWhenZeroCheckbox").checked,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
role="slider"
|
role="slider"
|
||||||
flex
|
flex
|
||||||
></paper-diff-slider>
|
></paper-diff-slider>
|
||||||
{{#unless left}}{{#unless deleteOnZero}}
|
{{#unless left}}
|
||||||
<paper-icon-button class="deleteTHP" icon="delete"></paper-icon-button>
|
<paper-icon-button class="deleteTHP" icon="delete"></paper-icon-button>
|
||||||
{{/unless}}{{/unless}}
|
{{/unless}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
Meteor.methods({
|
Meteor.methods({
|
||||||
"getUserId": function(username){
|
"getUserId": function(username){
|
||||||
if (!username) return;
|
if (!username) return;
|
||||||
|
regex = new RegExp("^" + username + "$", "i")
|
||||||
var user = Meteor.users.findOne(
|
var user = Meteor.users.findOne(
|
||||||
{$or: [{username: username}, {"emails.address": username}]}
|
{$or: [
|
||||||
|
{username: username},
|
||||||
|
{"emails.address": regex},
|
||||||
|
{"services.google.email": regex},
|
||||||
|
]}
|
||||||
);
|
);
|
||||||
return user && user._id;
|
return user && user._id;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user