Skip to content

Commit

Permalink
Merge branch 'release-0.5.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaumRystra committed Jun 17, 2015
2 parents c2b04d0 + 2b0d975 commit 612e127
Show file tree
Hide file tree
Showing 18 changed files with 208 additions and 34 deletions.
5 changes: 5 additions & 0 deletions rpg-docs/client/globalHelpers/openParentDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ openParentDialog = function(parent, charId, heroId) {
template: "itemDialog",
data: {itemId: parent.id},
};
} else if (parent.collection === "Spells") {
detail = {
template: "spellDialog",
data: {spellId: parent.id},
};
}
detail.heroId = heroId;
detail.charId = charId;
Expand Down
14 changes: 14 additions & 0 deletions rpg-docs/client/views/character/inventory/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,20 @@ Template.inventory.events({
heroId: itemId,
});
},
"hold .inventoryItem": function(event, instance) {
var itemId = this._id;
var charId = Template.parentData()._id;
var containerId = this.parent.id;
GlobalUI.showDialog({
template: "moveItemDialog",
data: {
charId: charId,
itemId: itemId,
containerId: containerId,
},
heading: "Move " + this.pluralName(),
});
},
"tap .incrementButtons": function(event) {
event.stopPropagation();
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
html /deep/ .moveItemDialog paper-tabs::shadow #selectionBar {
background-color: #D50000;
}

html /deep/ .moveItemDialog paper-tab::shadow #ink {
color: #D50000;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template name="moveItemDialog">
<div class="moveItemDialog">
<paper-tabs selected="{{selectedTab}}">
<paper-tab name="containers"
class="clickable">
Containers
</paper-tab>
<paper-tab name="characters"
class="clickable">
Characters
</paper-tab>
</paper-tabs>
<core-animated-pages selected="{{selectedTab}}"
transitions="slide-from-right"
style="width: 250px;
height: 200px;
overflow-y: auto;
overflow-x: hidden;">
<section name="containers">
<core-menu id="containerMenu" style="margin: 0;">
{{#each containers}}
<paper-item name={{_id}}
layout horizontal center>
<core-icon icon="image:brightness-1"
style="color: {{hexColor color}};
margin-right: 16px;">
</core-icon>
<div>{{name}}</div>
</paper-item>
{{/each}}
</core-menu>
</section>
<section name="characters">
<core-menu id="characterMenu" style="margin: 0;">
{{#each characters}}
<paper-item name={{_id}}
layout horizontal center>
<div class="item small">
{{name}}
</div>
</paper-item>
{{/each}}
</core-menu>
</section>
</core-animated-pages>
</div>
<paper-button id="cancelButton" affirmative> Cancel </paper-button>
<paper-button id="moveButton" affirmative> Move </paper-button>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Template.moveItemDialog.onCreated(function() {
Session.setDefault("moveItemDialogTab", "containers");
});

Template.moveItemDialog.helpers({
selectedTab: function() {
return Session.get("moveItemDialogTab");
},
characters: function() {
var userId = Meteor.userId();
return Characters.find(
{
$or: [
{readers: userId},
{writers: userId},
{owner: userId},
],
_id: {$ne: this.charId},
},
{fields: {name: 1}}
);
},
containers: function(){
return Containers.find(
{
charId: this.charId,
_id: {$ne: this.containerId},
},
{
fields: {color: 1, name: 1},
sort: {color: 1, name: 1},
}
);
},
});

Template.moveItemDialog.events({
"tap paper-tab": function(event) {
Session.set("moveItemDialogTab", event.currentTarget.getAttribute("name"));
},
"tap #moveButton": function(event, instance) {
var tab = Session.get("moveItemDialogTab");
if (tab === "containers"){
var containerId = instance.find("#containerMenu").selected;
if (!containerId) throw "no menu selection";
Meteor.call("moveItemToContainer", this.itemId, containerId);
} else if (tab === "characters"){
var characterId = instance.find("#characterMenu").selected;
if (!characterId) throw "no menu selection";
Meteor.call("moveItemToCharacter", this.itemId, characterId);
} else {
throw "Move item dialog tab is not set to containers or character," +
" it is set to " + tab;
}
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<template name="backgroundDialog">
{{#baseDialog title=title class=colorClass hideColor="true" hideDelete="true" startEditing=startEditing}}
<div class="pre-wrap">{{evaluateString charId value}}</div>
{{> proficiencyViewList charId=charId parentId=charId parentGroup="background"}}
{{else}}
{{> textDialogEdit}}
{{> proficiencyEditList parentId=charId parentCollection="Characters" charId=charId parentGroup="background"}}
{{/baseDialog}}
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Template.backgroundDialog.helpers({
value: function(){
var fieldSelector = {fields: {}};
fieldSelector.fields[this.field] = 1;
var char = Characters.findOne(this.charId, fieldSelector);
return char[this.field];
}
});
22 changes: 12 additions & 10 deletions rpg-docs/client/views/character/persona/persona.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,27 @@ Template.persona.helpers({

Template.persona.events({
"tap .characterField": function(event){
if (this.field !== "details"){
if (this.field === "details"){
this.charId = Template.parentData()._id;
GlobalUI.setDetail({
template: "personaDetailsDialog",
data: this,
heroId: this._id + this.field,
});
} else {
var template = "textDialog";
if (this.field === "backstory") template = "backgroundDialog";
var charId = Template.parentData()._id;
GlobalUI.setDetail({
template: "textDialog",
data: {
template: template,
data: {
charId: charId,
field: this.field,
title: this.title,
color: this.color,
},
heroId: this._id + this.field,
});
} else {
this.charId = Template.parentData()._id;
GlobalUI.setDetail({
template: "personaDetailsDialog",
data: this,
heroId: this._id + this.field,
});
}
}
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<template name="proficiencyView">
<div class="proficiencyView" layout horizontal center>
<core-icon icon="{{profIcon}}"></core-icon>
<div class="sideMargin">{{getName}}</div>
<div class="proficiencyView item small"
style="padding: 0;"
layout horizontal center>
<core-icon icon="{{profIcon}}" style="margin-right: 16px;"></core-icon>
<div>{{getName}}</div>
</div>
</template>


Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{#if proficiencies.count}}
<hr class="vertMargin">
<div class="proficiencies">
<h2 class="spaceAfter">Proficiencies</h2>
<h2 style="margin-bottom: 8px;">Proficiencies</h2>
{{#each proficiencies}}
{{> proficiencyView}}
{{/each}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
</div>
</div>
<div class="pre-wrap">{{evaluateString charId description}}</div>
{{> attacksViewList charId=charId parentId=_id}}
</template>

<template name="spellEdit">
Expand Down Expand Up @@ -126,4 +127,5 @@
<textarea id="descriptionInput" placeholder value={{description}}></textarea>
</paper-autogrow-textarea>
</paper-input-decorator>
{{> attackEditList parentId=_id parentCollection="Spells" charId=charId enabled=true name=name}}
</template>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.healthCard paper-slider{
.healthCard paper-diff-slider{
width: 100%;
margin-right: 8px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
</div>
<div class="right" flex layout vertical center-justified style="min-width: 180px;">
<div layout horizontal>
<paper-slider id="hitPointSlider"
<paper-diff-slider id="hitPointSlider"
value={{attributeValue "hitPoints"}}
max={{attributeBase "hitPoints"}}
editable pin
role="slider"
></paper-slider>
></paper-diff-slider>
</div>
{{#each tempHitPoints}}
<div>
{{name}}
<div layout horizontal>
<paper-slider class="tempHitPointSlider"
<paper-diff-slider class="tempHitPointSlider"
value={{left}}
max={{maximum}}
editable pin
role="slider"
flex
></paper-slider>
></paper-diff-slider>
{{#unless left}}{{#unless deleteOnZero}}
<paper-icon-button class="deleteTHP" icon="delete"></paper-icon-button>
{{/unless}}{{/unless}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,15 @@ Template.skillDialogView.helpers({
return Characters.findOne(this.charId, {fields:{_id: 1}});
},
sourceName: function(){
if (this.parent.collection === "Characters") return "inate";
if (this.parent.collection === "Characters"){
if (this.parent.group === "racial"){
return Characters.findOne(this.charId, {fields:{race: 1}}).race || "Race";
}
if (this.parent.group === "background"){
return "Background";
}
return "Innate";
}
return this.getParent().name;
},
operationName: function(){
Expand Down
3 changes: 2 additions & 1 deletion rpg-docs/client/views/layout/imports.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
<link rel="import" href="/components/paper-radio-group/paper-radio-group.html">
<link rel="import" href="/components/paper-shadow/paper-shadow.html">
<link rel="import" href="/components/paper-spinner/paper-spinner.html">
<link rel="import" href="/components/paper-slider/paper-slider.html">
<link rel="import" href="/components/paper-tabs/paper-tabs.html">
<link rel="import" href="/components/paper-toast/paper-toast.html">
<link rel="import" href="/components/paper-toggle-button/paper-toggle-button.html">

<!--custom components-->
<link rel="import" href="/custom_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="/custom_components/paper-slider-diff/paper-slider.html">
<link rel="import" href="/custom_components/paper-diff-slider/paper-diff-slider.html">
<link rel="import" href="/custom_components/swipe-detect/swipe-detect.html">
11 changes: 10 additions & 1 deletion rpg-docs/private/changeLogs/changeLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,19 @@ ChangeLogs.insert({
});

ChangeLogs.insert({
version: "0.5.5",
version: "0.5.6",
changes: [
"Changed front page",
"Moved to a darker style",
"Added support for letting characters be viewed by \"anyone with the link\"",
],
});

ChangeLogs.insert({
version: "0.5.7",
changes: [
"Added proficiencies to backgrounds",
"Added attacks to spells",
"Added a move item dialog to mobile devices, but it can't be accessed yet, because long-presses are broken",
],
});
Loading

0 comments on commit 612e127

Please sign in to comment.