diff --git a/app/.gitignore b/app/.gitignore
index 88a0a828..086ca397 100644
--- a/app/.gitignore
+++ b/app/.gitignore
@@ -4,6 +4,7 @@
settings.json
public/components
public/_imports.html
+private/oldClient
nohup.out
node_modules
dump
diff --git a/app/.meteor/packages b/app/.meteor/packages
index f4f33b90..6f11acb1 100644
--- a/app/.meteor/packages
+++ b/app/.meteor/packages
@@ -16,7 +16,6 @@ momentjs:moment
dburles:mongo-collection-instances
percolate:migrations
ecwyne:mathjs
-useraccounts:polymer
accounts-google@1.3.1
splendido:accounts-meld
email@1.2.3
@@ -25,20 +24,17 @@ chuangbo:marked
meteor-base@1.4.0
mobile-experience@1.0.5
mongo@1.5.0
-blaze-html-templates
session@1.1.7
jquery@1.11.10
tracker@1.2.0
logging@1.1.20
reload@1.2.0
ejson@1.1.0
-spacebars
check@1.3.1
wizonesolutions:canonical
standard-minifier-js@2.3.4
shell-server@0.3.1
seba:minifiers-autoprefixer
-nikogosovd:multiple-uihooks
templates:array
ecmascript@0.11.1
es5-shim@4.8.0
@@ -54,3 +50,4 @@ meteortesting:mocha
mdg:validated-method
akryum:vue-component
akryum:vue-router2
+static-html
diff --git a/app/.meteor/versions b/app/.meteor/versions
index 07ac97ab..601c3b9c 100644
--- a/app/.meteor/versions
+++ b/app/.meteor/versions
@@ -21,7 +21,6 @@ babel-runtime@1.2.7
base64@1.0.11
binary-heap@1.0.10
blaze@2.3.3
-blaze-html-templates@1.1.2
blaze-tools@1.0.10
boilerplate-generator@1.5.0
caching-compiler@1.1.12
@@ -86,7 +85,6 @@ momentjs:moment@2.22.2
mongo@1.5.1
mongo-dev-server@1.1.0
mongo-id@1.0.7
-nikogosovd:multiple-uihooks@0.1.8
npm-bcrypt@0.9.3
npm-mongo@3.0.11
oauth@1.2.3
@@ -111,24 +109,21 @@ session@1.1.8
sha@1.0.9
shell-server@0.3.1
socket-stream-client@0.2.2
-softwarerero:accounts-t9n@1.3.11
spacebars@1.0.15
spacebars-compiler@1.1.3
splendido:accounts-emails-field@1.2.0
splendido:accounts-meld@1.3.1
srp@1.0.12
standard-minifier-js@2.3.4
+static-html@1.2.2
templates:array@1.0.3
templating@1.3.2
templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
tracker@1.2.0
-ui@1.0.13
underscore@1.0.10
url@1.2.0
-useraccounts:core@1.14.2
-useraccounts:polymer@1.14.2
webapp@1.6.2
webapp-hashing@1.0.9
wizonesolutions:canonical@0.0.5
diff --git a/app/client/compatibility/jquery.quickfit.js b/app/client/compatibility/jquery.quickfit.js
deleted file mode 100644
index f8d6ebe6..00000000
--- a/app/client/compatibility/jquery.quickfit.js
+++ /dev/null
@@ -1,174 +0,0 @@
-// jscs:disable
-// https://github.com/chunksnbits/jquery-quickfit
-(function ($) {
- var Quickfit, QuickfitHelper, defaults, pluginName;
-
- pluginName = 'quickfit';
-
- defaults = {
- min: 8,
- max: 12,
- tolerance: 0.02,
- truncate: false,
- width: null,
- sampleNumberOfLetters: 10,
- sampleFontSize: 12
- };
- QuickfitHelper = (function () {
-
- var sharedInstance = null;
-
- QuickfitHelper.instance = function (options) {
- if (!sharedInstance) {
- sharedInstance = new QuickfitHelper(options);
- }
- return sharedInstance;
- };
-
- function QuickfitHelper(options) {
- this.options = options;
-
- this.item = $(' ');
- this.item.css({
- position: 'absolute',
- left: '-1000px',
- top: '-1000px',
- 'font-size': "" + this.options.sampleFontSize + "px"
- });
- $('body').append(this.item);
-
- this.meassures = {};
- }
-
- QuickfitHelper.prototype.getMeassure = function (letter) {
- var currentMeassure;
- currentMeassure = this.meassures[letter];
- if (!currentMeassure) {
- currentMeassure = this.setMeassure(letter);
- }
- return currentMeassure;
- };
-
- QuickfitHelper.prototype.setMeassure = function (letter) {
- var currentMeassure, index, sampleLetter, text, _ref;
-
- text = '';
- sampleLetter = letter === ' ' ? ' ' : letter;
-
- for (index = 0, _ref = this.options.sampleNumberOfLetters - 1; 0 <= _ref ? index <= _ref : index >= _ref; 0 <= _ref ? index++ : index--) {
- text += sampleLetter;
- }
-
- this.item.html(text);
- currentMeassure = this.item.width() / this.options.sampleNumberOfLetters / this.options.sampleFontSize;
- this.meassures[letter] = currentMeassure;
-
- return currentMeassure;
- };
-
- return QuickfitHelper;
-
- })();
-
- Quickfit = (function () {
-
- function Quickfit(element, options) {
- this.$element = element;
- this.options = $.extend({}, defaults, options);
- this.$element = $(this.$element);
- this._defaults = defaults;
- this._name = pluginName;
- this.quickfitHelper = QuickfitHelper.instance(this.options);
- }
-
- Quickfit.prototype.fit = function () {
- var elementWidth;
- if (!this.options.width) {
- elementWidth = this.$element.width();
- this.options.width = elementWidth - this.options.tolerance * elementWidth;
- }
- if (this.text = this.$element.attr('data-quickfit')) {
- this.previouslyTruncated = true;
- } else {
- this.text = this.$element.text();
- }
- this.calculateFontSize();
-
- if (this.options.truncate) this.truncate();
-
- return {
- $element: this.$element,
- size: this.fontSize
- };
- };
-
- Quickfit.prototype.calculateFontSize = function () {
- var letter, textWidth, i;
-
- textWidth = 0;
- for (i = 0; i < this.text.length; ++i) {
- letter = this.text.charAt(i);
- textWidth += this.quickfitHelper.getMeassure(letter);
- }
-
- this.targetFontSize = parseInt(this.options.width / textWidth);
- return this.fontSize = Math.max(this.options.min, Math.min(this.options.max, this.targetFontSize));
- };
-
- Quickfit.prototype.truncate = function () {
- var index, lastLetter, letter, textToAdd, textWidth;
-
- if (this.fontSize > this.targetFontSize) {
- textToAdd = '';
- textWidth = 3 * this.quickfitHelper.getMeassure('.') * this.fontSize;
-
- index = 0;
- while (textWidth < this.options.width && index < this.text.length) {
- letter = this.text[index++];
- if (lastLetter) textToAdd += lastLetter;
- textWidth += this.fontSize * this.quickfitHelper.getMeassure(letter);
- lastLetter = letter;
- }
-
- if (textToAdd.length + 1 === this.text.length) {
- textToAdd = this.text;
- } else {
- textToAdd += '...';
- }
- this.textWasTruncated = true;
-
- return this.$element.attr('data-quickfit', this.text).html(textToAdd);
-
- } else {
- if (this.previouslyTruncated) {
- return this.$element.html(this.text);
- }
- }
- };
-
- return Quickfit;
-
- })();
-
- return $.fn.quickfit = function (options) {
- var measurements = [];
-
- // Separate measurements from repaints
- // First calculate all measurements...
- var $elements = this.each(function () {
- var measurement = new Quickfit(this, options).fit();
- measurements.push(measurement);
- return measurement.$element;
- });
-
- // ... then apply the measurements.
- for (var i = 0; i < measurements.length; i++) {
- var measurement = measurements[i];
-
- measurement.$element.css({ fontSize: measurement.size + 'px' });
- }
-
- return $elements;
- };
-
-})(jQuery, window);
diff --git a/app/client/globalHelpers/GlobalUI.js b/app/client/globalHelpers/GlobalUI.js
deleted file mode 100644
index cf757253..00000000
--- a/app/client/globalHelpers/GlobalUI.js
+++ /dev/null
@@ -1,38 +0,0 @@
-this.GlobalUI = (function() {
- function GlobalUI() {}
- var toast;
- GlobalUI.toast = function(opts) {
- if (!toast) toast = $("#global-toast")[0];
- if (_.isObject(opts)){
- toast.text = opts.text;
- Session.set("global.ui.toastTemplate", opts.template);
- Session.set("global.ui.toastData", opts.data);
- } else {
- toast.text = opts;
- Session.set("global.ui.toastTemplate");
- Session.set("global.ui.toastData");
- }
- return toast.show();
- };
-
- GlobalUI.deletedToast = function(id, collection, itemName) {
- GlobalUI.toast({
- text: itemName ? itemName + " deleted" : "Deleted item from" + collection,
- template: "undoToast",
- data: {
- id: id,
- collection: collection,
- },
- });
- };
- return GlobalUI;
-})();
-
-Template.layout.helpers({
- globalToastTemplate: function() {
- return Session.get("global.ui.toastTemplate");
- },
- globalToastData: function() {
- return Session.get("global.ui.toastData");
- },
-});
diff --git a/app/client/globalHelpers/canCast.js b/app/client/globalHelpers/canCast.js
deleted file mode 100644
index deae88c1..00000000
--- a/app/client/globalHelpers/canCast.js
+++ /dev/null
@@ -1,3 +0,0 @@
-Template.registerHelper("canCast", function() {
- return Characters.find({_id: this._id, spells: {$size: 0}}).count() === 0;
-});
diff --git a/app/client/globalHelpers/canEditCharacter.js b/app/client/globalHelpers/canEditCharacter.js
deleted file mode 100644
index 57d0ce6f..00000000
--- a/app/client/globalHelpers/canEditCharacter.js
+++ /dev/null
@@ -1,11 +0,0 @@
-Template.registerHelper("canEditCharacter", function(charId) {
- return canEditCharacter(charId);
-});
-
-canEditCharacter = function(charId) {
- var char = Characters.findOne(charId);
- if (!char) return false;
- var userId = Meteor.userId();
- return char.owner === userId ||
- _.contains(char.writers, userId);
-};
diff --git a/app/client/globalHelpers/characterPath.js b/app/client/globalHelpers/characterPath.js
deleted file mode 100644
index 723ee07b..00000000
--- a/app/client/globalHelpers/characterPath.js
+++ /dev/null
@@ -1,3 +0,0 @@
-Template.registerHelper("characterPath", function(char) {
- return `\/character\/${char._id}\/${char.urlName || "-"}`;
-});
diff --git a/app/client/globalHelpers/colorClass.js b/app/client/globalHelpers/colorClass.js
deleted file mode 100644
index 01982703..00000000
--- a/app/client/globalHelpers/colorClass.js
+++ /dev/null
@@ -1,11 +0,0 @@
-Template.registerHelper("colorClass", function(color) {
- if (color) {
- return getColorClass(color);
- } else if (this.color) {
- return getColorClass(this.color);
- }
-});
-
-Template.registerHelper("hexColor", function(color) {
- return getHexColor(color);
-});
diff --git a/app/client/globalHelpers/detailHero.js b/app/client/globalHelpers/detailHero.js
deleted file mode 100644
index 105d8522..00000000
--- a/app/client/globalHelpers/detailHero.js
+++ /dev/null
@@ -1,9 +0,0 @@
-Template.registerHelper("detailHero", function(suffix, givenId) {
- var id = givenId || this._id;
- if (suffix) {
- id += suffix;
- }
- if (Session.equals("global.ui.detailHeroId", id)) {
- return "hero";
- }
-});
diff --git a/app/client/globalHelpers/evaluate.js b/app/client/globalHelpers/evaluate.js
deleted file mode 100644
index 65ad0240..00000000
--- a/app/client/globalHelpers/evaluate.js
+++ /dev/null
@@ -1,37 +0,0 @@
-Template.registerHelper("evaluate", function(charId, string) {
- return evaluate(charId, string);
-});
-
-Template.registerHelper("evaluateSigned", function(charId, string) {
- var number = evaluate(charId, string);
- if (_.isFinite(number)) {
- return number > 0 ? "+" + number : "" + number;
- } else {
- return number;
- }
-});
-
-Template.registerHelper("evaluateSignedSpaced", function(charId, string) {
- var number = evaluate(charId, string);
- if (_.isFinite(number)) {
- return number > 0 ? "+ " + number : "- " + (-1 * number);
- } else {
- return number;
- }
-});
-
-Template.registerHelper("evaluateString", function(charId, string) {
- return evaluateString(charId, string);
-});
-
-Template.registerHelper("evaluateSpellString", function(charId, spellListId, string) {
- return evaluateSpellString(charId, spellListId, string);
-});
-
-Template.registerHelper("evaluateShortString", function(charId, string) {
- if (_.isString(string)){
- return evaluateString(
- charId, string.split(/^( *[-*_]){3,} *(?:\n+|$)/m)[0]
- );
- }
-});
diff --git a/app/client/globalHelpers/openParentDialog.js b/app/client/globalHelpers/openParentDialog.js
deleted file mode 100644
index b220a652..00000000
--- a/app/client/globalHelpers/openParentDialog.js
+++ /dev/null
@@ -1,26 +0,0 @@
-openParentDialog = function({
- parent, charId, element, returnElement, callback,
-}) {
- let template;
- let data;
- if (parent.collection === "Characters" && parent.group === "racial") {
- template = "raceDialog";
- data = {charId: parent.id};
- } else if (parent.collection === "Features") {
- template = "featureDialog";
- data = {featureId: parent.id};
- } else if (parent.collection === "Classes") {
- template = "classDialog";
- data = {classId: parent.id};
- } else if (parent.collection === "Items") {
- template = "itemDialog";
- data = {itemId: parent.id};
- } else if (parent.collection === "Spells") {
- template = "spellDialog";
- data = {spellId: parent.id};
- } else if (parent.collection === "Buffs") {
- template = "buffDialog";
- data = {buffId: parent.id};
- }
- pushDialogStack({template, data, element, returnElement, callback});
-};
diff --git a/app/client/globalHelpers/round.js b/app/client/globalHelpers/round.js
deleted file mode 100644
index b1d483f8..00000000
--- a/app/client/globalHelpers/round.js
+++ /dev/null
@@ -1,6 +0,0 @@
-Template.registerHelper("round", function(value, decimalPlaces) {
- decimalPlaces = +decimalPlaces || 2;
- var num = +value;
- var tens = Math.pow(10, decimalPlaces);
- return Math.round(num * tens) / tens;
-});
diff --git a/app/client/globalHelpers/session.js b/app/client/globalHelpers/session.js
deleted file mode 100644
index e461f209..00000000
--- a/app/client/globalHelpers/session.js
+++ /dev/null
@@ -1,3 +0,0 @@
-Template.registerHelper("session", function(key) {
- return Session.get(key);
-});
diff --git a/app/client/globalHelpers/signedString.js b/app/client/globalHelpers/signedString.js
deleted file mode 100644
index 668f0488..00000000
--- a/app/client/globalHelpers/signedString.js
+++ /dev/null
@@ -1,3 +0,0 @@
-Template.registerHelper("signedString", function(number) {
- return number >= 0 ? "+" + number : "" + number;
-});
diff --git a/app/client/globalHelpers/valueString.js b/app/client/globalHelpers/valueString.js
deleted file mode 100644
index 67f0a865..00000000
--- a/app/client/globalHelpers/valueString.js
+++ /dev/null
@@ -1,63 +0,0 @@
-Template.registerHelper("valueString", function(value) {
- var intValue = Math.round(value * 100);
- var cp = intValue % 10;
- intValue -= cp;
- cp = Math.round(cp);
- sp = intValue % 100;
- intValue -= sp;
- sp = Math.round(sp / 10)
- gp = Math.floor(value);
-
- var resultArray = [];
- if (gp > 0) {
- resultArray.push(gp + " gp");
- }
- if (sp > 0) {
- resultArray.push(sp + " sp");
- }
- if (cp > 0) {
- resultArray.push(cp + " cp");
- }
-
- //build string with correct spacing
- var result = "";
- for (var i = 0, l = resultArray.length; i < l; i++) {
- //add a space between values
- if (i !== 0) {
- result += " ";
- }
- result += resultArray[i];
- }
- return result;
-});
-
-Template.registerHelper("longValueString", function(value) {
- var resultArray = [];
- //sp
- var gp = Math.floor(value);
- if (gp > 0) {
- resultArray.push(gp + " gp");
- }
- //sp
- var sp = Math.floor(10 * (value % 1));
- if (sp > 0 || resultArray.length) {
- resultArray.push(sp + " sp");
- }
- //cp
- var cp = 10 * ((value * 10) % 1);
- cp = Math.round(cp * 1000) / 1000;
- if (cp > 0 || resultArray.length) {
- resultArray.push(cp + " cp");
- }
-
- //build string with correct spacing
- var result = "";
- for (var i = 0; i < resultArray.length; i++) {
- //add a space between values
- if (i !== 0) {
- result += " ";
- }
- result += resultArray[i];
- }
- return result;
-});
diff --git a/app/client/head.html b/app/client/head.html
index ca10a2f4..452058b0 100644
--- a/app/client/head.html
+++ b/app/client/head.html
@@ -1,3 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/client/lib/bindProperty.js b/app/client/lib/bindProperty.js
deleted file mode 100644
index b2de2e00..00000000
--- a/app/client/lib/bindProperty.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Take in a map like this:
- * {
- * "#someId": {
- * proprty1() { return someReactiveValue()}
- * }
- * }
- * and bind the properties to the DOM on autorun.
- *
- * Useful for polymer components where you need to set the order of property updating
- * or alter properties that don't bind well to their attributes
- */
-Blaze.Template.prototype.binding = function(bindingMap){
- this.onRendered(function(){
- _.each(bindingMap, (propertyMap, cssPattern) => {
- node = this.find(cssPattern);
- _.each(propertyMap, (func, property) => {
- this.autorun(() => {
- node[property] = func && func.call && func.call(this, node);
- });
- });
- });
- });
-};
diff --git a/app/client/lib/improvedInitiativeJson.js b/app/client/lib/improvedInitiativeJson.js
deleted file mode 100644
index eb1502e8..00000000
--- a/app/client/lib/improvedInitiativeJson.js
+++ /dev/null
@@ -1,195 +0,0 @@
-improvedInitiativeJson = function(charId, options){
- options = options || {
- features: true,
- attacks: true,
- description: true,
- };
- var char = Characters.findOne(charId);
- if (!char) return;
- var baseValue = function(attributeName){
- return Characters.calculate.attributeBase(charId, attributeName);
- };
- var skillMod = function(skillName){
- return Characters.calculate.skillMod(charId, skillName);
- };
- var damageMods = getDamageMods(charId);
- return JSON.stringify({
- "Id": char._id,
- "Name": char.name,
- "Source": "DiceCloud",
- "Type": char.race,
- "HP": {
- "Value": baseValue("hitPoints"),
- "Notes": getHitDiceString(charId) || "",
- },
- "AC": {
- "Value": baseValue("armor"),
- "Notes": getArmorString(charId) || "",
- },
- "InitiativeModifier": skillMod("initiative"),
- "Speed": ["" + baseValue("speed")],
- "Abilities": {
- "Str": baseValue("strength"),
- "Dex": baseValue("dexterity"),
- "Con": baseValue("constitution"),
- "Cha": baseValue("charisma"),
- "Int": baseValue("intelligence"),
- "Wis": baseValue("wisdom"),
- },
- "DamageVulnerabilities": damageMods.vulnerabilities,
- "DamageResistances": damageMods.resistances,
- "DamageImmunities": damageMods.immunities,
- "ConditionImmunities": [],
- "Saves": [
- {"Name": "Str", "Modifier": skillMod("strengthSave")},
- {"Name": "Dex", "Modifier": skillMod("dexteritySave")},
- {"Name": "Con", "Modifier": skillMod("constitutionSave")},
- {"Name": "Int", "Modifier": skillMod("intelligenceSave")},
- {"Name": "Wis", "Modifier": skillMod("wisdomSave")},
- {"Name": "Cha", "Modifier": skillMod("charismaSave")},
- ],
- "Skills": getSkills(charId),
- "Senses": [
- "passive Perception " +
- Characters.calculate.passiveSkill(charId, "perception")
- ],
- "Languages": getLanguages(charId),
- "Challenge": "",
- "Traits": options.features ? getTraits(charId) : [],
- "Actions": options.attacks ? getActions(charId) : [],
- "Reactions": [],
- "LegendaryActions": [],
- "Description": options.description ? char.description : "",
- "Player": Meteor.user().username,
- }, null, 2);
-}
-
-var getHitDiceString = function(charId){
- var d6 = Characters.calculate.attributeBase(charId, "d6HitDice");
- var d8 = Characters.calculate.attributeBase(charId, "d8HitDice");
- var d10 = Characters.calculate.attributeBase(charId, "d10HitDice");
- var d12 = Characters.calculate.attributeBase(charId, "d12HitDice");
- var con = Characters.calculate.abilityMod(charId,"constitution");
- var string = "" +
- (d6 ? `${d6}d6 + ` : "") +
- (d8 ? `${d8}d8 + ` : "") +
- (d10 ? `${d10}d10 + ` : "") +
- (d12 ? `${d12}d12 + ` : "") +
- con;
-}
-
-var getArmorString = function(charId){
- var bases = Effects.find({
- charId: charId,
- stat: "armor",
- operation: "base",
- enabled: true,
- }).map(e => ({
- ame: e.name,
- value: evaluateEffect(charId, e),
- }));
- var base = bases.length && _.max(bases, b => b.value).name || "";
- var effects = Effects.find({
- charId: charId,
- stat: "armor",
- operation: {$ne: "base"},
- enabled: true,
- }).map(e => e.name);
- var strings = base ? [base] : [];
- strings = strings.concat(effects);
- return strings.join(", ");
-}
-
-var getDamageMods = function(charId){
- // jscs:disable maximumLineLength
- var multipliers = [
- {name: "Acid", value: Characters.calculate.attributeValue(charId, "acidMultiplier")},
- {name: "Bludgeoning", value: Characters.calculate.attributeValue(charId, "bludgeoningMultiplier")},
- {name: "Cold", value: Characters.calculate.attributeValue(charId, "coldMultiplier")},
- {name: "Fire", value: Characters.calculate.attributeValue(charId, "fireMultiplier")},
- {name: "Force", value: Characters.calculate.attributeValue(charId, "forceMultiplier")},
- {name: "Lightning", value: Characters.calculate.attributeValue(charId, "lightningMultiplier")},
- {name: "Necrotic", value: Characters.calculate.attributeValue(charId, "necroticMultiplier")},
- {name: "Piercing", value: Characters.calculate.attributeValue(charId, "piercingMultiplier")},
- {name: "Poison", value: Characters.calculate.attributeValue(charId, "poisonMultiplier")},
- {name: "Psychic", value: Characters.calculate.attributeValue(charId, "psychicMultiplier")},
- {name: "Radiant", value: Characters.calculate.attributeValue(charId, "radiantMultiplier")},
- {name: "Slashing", value: Characters.calculate.attributeValue(charId, "slashingMultiplier")},
- {name: "Thunder", value: Characters.calculate.attributeValue(charId, "thunderMultiplier")},
- ];
- // jscs:enable maximumLineLength
- multipliers = _.groupBy(multipliers, "value");
- var names = o => o.name;
- return {
- "immunities": _.map(multipliers["0"], names),
- "resistances": _.map(multipliers["0.5"], names),
- "vulnerabilities": _.map(multipliers["2"], names),
- };
-}
-
-var getSkills = function(charId){
- var allSkills = [
- {name: "acrobatics", attribute: "dexterity"},
- {name: "animalHandling", attribute: "wisdom"},
- {name: "arcana", attribute: "intelligence"},
- {name: "athletics", attribute: "strength"},
- {name: "deception", attribute: "charisma"},
- {name: "history", attribute: "intelligence"},
- {name: "insight", attribute: "wisdom"},
- {name: "intimidation", attribute: "charisma"},
- {name: "investigation", attribute: "intelligence"},
- {name: "medicine", attribute: "wisdom"},
- {name: "nature", attribute: "intelligence"},
- {name: "perception", attribute: "wisdom"},
- {name: "performance", attribute: "charisma"},
- {name: "persuasion", attribute: "charisma"},
- {name: "religion", attribute: "intelligence"},
- {name: "sleightOfHand", attribute: "dexterity"},
- {name: "stealth", attribute: "dexterity"},
- {name: "survival", attribute: "wisdom"},
- ];
- var skills = [];
- _.each(allSkills, skill => {
- var value = Characters.calculate.skillMod(charId, skill.name);
- var mod = Characters.calculate.abilityMod(charId, skill.attribute);
- if (value !== mod){
- skills.push({Name: skill.name, Modifier: value});
- }
- });
- return skills;
-};
-
-var getLanguages = function(charId){
- return Proficiencies.find({
- charId,
- enabled: true,
- type: "language",
- }).map(l => l.name);
-};
-
-var getTraits = function(charId){
- return Features.find(
- {charId: charId},
- {sort: {color: 1, name: 1}}
- ).map(f => ({
- Name: f.name,
- // evaluateShortString helper
- Content: evaluateString(
- charId, f.description && f.description.split(/^( *[-*_]){3,} *(?:\n+|$)/m)[0]
- ) || "",
- Usage: "",
- }));
-}
-
-var getActions = function(charId){
- return Attacks.find(
- {charId, enabled: true},
- {sort: {color: 1, name: 1}}
- ).map(a => ({
- Name: a.name,
- Content: `+${evaluate(charId, a.attackBonus)} to hit, ` +
- `${evaluateString(charId, a.damage)} ${a.damageType} damage, ` +
- `${a.details}`,
- Usage: "",
- }));
-}
diff --git a/app/client/lib/printing.js b/app/client/lib/printing.js
deleted file mode 100644
index 1eb0357a..00000000
--- a/app/client/lib/printing.js
+++ /dev/null
@@ -1,12 +0,0 @@
-Session.setDefault("isPrinting", false);
-if (window.matchMedia) {
- var mediaQueryList = window.matchMedia("print");
- mediaQueryList.addListener(function(mql) {
- if (mql.matches) {
- Session.set("isPrinting", true);
- Tracker.flush();
- } else {
- Session.set("isPrinting", false);
- }
- });
-}
diff --git a/app/client/lib/removeDuplicateProficiencies.js b/app/client/lib/removeDuplicateProficiencies.js
deleted file mode 100644
index 1f315e70..00000000
--- a/app/client/lib/removeDuplicateProficiencies.js
+++ /dev/null
@@ -1,17 +0,0 @@
-removeDuplicateProficiencies = function(proficiencies) {
- dict = {};
- proficiencies.forEach(function(prof) {
- if (prof.name in dict) { //if we have already gone over another proficiency for the same thing
- if (dict[prof.name].value < prof.value) {
- dict[prof.name] = prof; //then take the new one if it's higher, otherwise leave it
- }
- } else {
- dict[prof.name] = prof; //if it wasn't already there, store it
- }
- });
- profs = []
- _.forEach(dict, function(prof) {
- profs.push(prof);
- })
- return profs;
-};
diff --git a/app/client/lib/requestAnimationFramePolyfill.js b/app/client/lib/requestAnimationFramePolyfill.js
deleted file mode 100644
index 0fb801e6..00000000
--- a/app/client/lib/requestAnimationFramePolyfill.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
-// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
-
-// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
-
-// MIT license
-var lastTime = 0;
-var vendors = ["ms", "moz", "webkit", "o"];
-for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
- window.requestAnimationFrame = window[vendors[x] + "RequestAnimationFrame"];
- window.cancelAnimationFrame = window[vendors[x] + "CancelAnimationFrame"] ||
- window[vendors[x] + "CancelRequestAnimationFrame"];
-}
-
-if (!window.requestAnimationFrame)
-window.requestAnimationFrame = function(callback, element) {
- var currTime = new Date().getTime();
- var timeToCall = Math.max(0, 16 - (currTime - lastTime));
- var id = window.setTimeout(function() { callback(currTime + timeToCall); },
- timeToCall);
- lastTime = currTime + timeToCall;
- return id;
-};
-
-if (!window.cancelAnimationFrame)
-window.cancelAnimationFrame = function(id) {
- clearTimeout(id);
-};
diff --git a/app/client/main.js b/app/client/main.js
index d4491d98..c6da8c92 100644
--- a/app/client/main.js
+++ b/app/client/main.js
@@ -1,2 +1,2 @@
import "/imports/ui/vueSetup.js";
-import "/imports/styles/stylesIndex.js";
+import "/imports/ui/styles/stylesIndex.js";
diff --git a/app/client/style/bounce.css b/app/client/style/bounce.css
deleted file mode 100644
index 481754d5..00000000
--- a/app/client/style/bounce.css
+++ /dev/null
@@ -1,17 +0,0 @@
-@keyframes bounce {
- from {
- transform: translate(0px,0px);
- }
- to {
- transform: translate(0px,-16px);
- }
-}
-
-.bounce{
- animation-name: bounce;
- animation-duration: 0.3s;
- animation-direction: alternate;
- animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
- animation-delay: 0s;
- animation-iteration-count: infinite;
-}
diff --git a/app/client/style/cards.css b/app/client/style/cards.css
deleted file mode 100644
index 801203a0..00000000
--- a/app/client/style/cards.css
+++ /dev/null
@@ -1,87 +0,0 @@
-/*Column layout*/
-.column-container {
- column-fill: balance;
- column-gap: 0px;
- column-width: 304px;
- padding: 4px;
- transform: translateZ(0);
-}
-
-.column-container.thin-columns {
- column-count: 4;
- column-width: 240px;
-}
-
-.column-container > div {
- padding: 4px;
- -webkit-column-break-inside: avoid;
- page-break-inside: avoid;
- break-inside: avoid;
-}
-
-/*Cards*/
-.card {
- background: white;
- border-radius: 2px;
- position: initial;
-}
-
-.card .top {
- cursor: pointer;
- padding: 16px;
- border-radius: 2px 2px 0 0;
-}
-
-.card .top.white {
- cursor: auto;
- padding: 16px;
- border-bottom: rgba(0,0,0,0.12) solid 1px;
-}
-
-.card .bottom {
- padding: 16px;
- border-radius: 0 0 2px 2px;
-}
-
-.card .bottom.list {
- padding: 16px 0;
-}
-
-.card .bottom.list .paper-font-subhead {
- color: rgba(0,0,0,0.54);
- font-size: 14px;
- font-weight: 500;
- letter-spacing: 0.010em;
- padding: 12px 16px 12px 16px;
-}
-
-.card .bottom.text {
- white-space: pre-wrap;
-}
-
-.card .left {
- padding: 16px;
- border-radius: 2px 0 0 2px;
- text-align: center;
- min-width: 72px;
-}
-
-.card .right {
- padding: 16px;
- border-radius: 0 2px 2px 0;
-}
-
-.card .left paper-icon-button {
- display: block;
- height: 32px;
- padding: 0;
- width: 32px;
-}
-
-.card .left paper-icon-button[disabled] {
- color: rgba(255, 255, 255, 0.2);
-}
-
-.card img, .card iron-image {
- max-width: 100%;
-}
diff --git a/app/client/style/colors.css b/app/client/style/colors.css
deleted file mode 100644
index 04aa90a2..00000000
--- a/app/client/style/colors.css
+++ /dev/null
@@ -1,87 +0,0 @@
-.red {
- background-color: #F44336;
-}
-
-.pink {
- background-color: #E91E63;
-}
-
-.purple {
- background-color: #9C27B0;
-}
-
-.deep-purple {
- background-color: #673AB7;
-}
-
-.indigo {
- background-color: #3F51B5;
-}
-
-.blue {
- background-color: #2196F3;
-}
-
-.light-blue {
- background-color: #03A9F4;
-}
-
-.cyan {
- background-color: #00BCD4;
-}
-
-.teal {
- background-color: #009688;
-}
-
-.green {
- background-color: #4CAF50;
-}
-
-.light-green {
- background-color: #8BC34A;
-}
-
-.lime {
- background-color: #CDDC39;
-}
-
-.yellow {
- background-color: #FFEB3B;
-}
-
-.amber {
- background-color: #FFC107;
-}
-
-.orange {
- background-color: #FF9800;
-}
-
-.deep-orange {
- background-color: #FF5722;
-}
-
-.brown {
- background-color: #795548;
-}
-
-.grey {
- background-color: #9E9E9E;
-}
-
-.blue-grey {
- background-color: #607D8B;
-}
-
-.app-grey {
- background-color: #424242;
-}
-
-.white {
- background-color: #ffffff;
-}
-
-.black {
- background-color: #262626;
-}
diff --git a/app/client/style/listItem.css b/app/client/style/listItem.css
deleted file mode 100644
index 87f61265..00000000
--- a/app/client/style/listItem.css
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-List items
-*/
-.item-slot {
- background-color: rgb(232, 232, 232);
- background-color: rgba(0, 0, 0, 0.1);
-}
-
-.item {
- background: white;
- cursor: pointer;
- font-size: 16px;
- height: 40px;
- margin: 1px 0 1px 0;
- padding: 0 16px 0 16px;
- position: relative;
- transition: box-shadow 0.3s ease, opacity 0.5s ease-in-out;
-}
-
-.item > .itemName {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.item.small {
- height: 32px;
-}
-
-.item.tall {
- height: 56px;
-}
-
-.item.flexible {
- height: auto;
- padding-top: 16px;
- padding-bottom: 16px;
-}
-
-.item iron-icon, .item paper-icon-button {
- color: #747474;
- color: rgba(0,0,0,0.54);
-}
diff --git a/app/client/style/main.css b/app/client/style/main.css
deleted file mode 100644
index 93a8d7dc..00000000
--- a/app/client/style/main.css
+++ /dev/null
@@ -1,115 +0,0 @@
-/*apply a natural box layout model to all elements*/
-*, *:before, *:after {
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-root {
- display: block;
-}
-
-body {
- font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial;
- margin: 0;
- overflow-x: hidden;
- background-color: #E0E0E0;
-}
-
-/*Paragraphs*/
-p {
- margin-bottom: 8px;
-}
-
-//Horizontal rule
-hr {
- background-color: #444;
- opacity: 0.12;
- border-width: 0;
- color: #444;
- height: 1px;
- line-height: 0;
- margin: 16px 0;
- text-align: center;
-}
-
-.avatar {
- display: inline-block;
- box-sizing: border-box;
- width: 40px;
- height: 40px;
- border-radius: 50%;
- font-size: 26px;
- font-color: rgba(255, 255, 255, 0.58) !important;
-}
-
-/*
- temporary fix for https://github.com/PolymerElements/paper-item/issues/71
- */
-paper-icon-item::shadow #contentIcon {
- flex-shrink: 0;
-}
-
-/*FABs*/
-.floatyButton {
- position: fixed;
- bottom: 24px;
- right: 24px;
- /* stop the fab from flashing during animation */
- transform: scale(1) translateZ(0px);
- z-index: 3;
-}
-
-paper-fab {
- background-color: #d13b2e;
-}
-
-paper-fab.keyboard-focus {
- background: #630c05;
-}
-
-.red-button:not([disabled]) {
- background: #d23f31;
- color: #fff;
- margin-top: 16px;
-}
-
-/*Buttons*/
-paper-button {
- color: #000;
- color: rgba(0,0,0,0.87);
- font-size: 14px;
- font-weight: 400;
- letter-spacing: 0.010;
- text-transform: uppercase;
-}
-
-dicecloud-selector paper-item {
- white-space: nowrap;
- overflow: hidden;
-}
-
-/*Style shortcuts*/
-.scroll-y {
- overflow-y: auto;
-}
-
-.clickable, core-item, paper-tab {
- cursor: pointer;
-}
-
-.pre-wrap, .prewrap{
- white-space: pre-wrap;
-}
-
-.padded {
- padding: 8px;
-}
-
-.fullwidth {
- width: 100%;
-}
-
-.fab-buffer {
- height: 100px;
-}
diff --git a/app/client/style/tables.css b/app/client/style/tables.css
deleted file mode 100644
index 28499097..00000000
--- a/app/client/style/tables.css
+++ /dev/null
@@ -1,15 +0,0 @@
-td {
- padding: 8px;
-}
-
-.strengthTable{
- width: 100%;
-}
-
-.strengthTable td:nth-child(2){
- text-align: right;
-}
-
-.summaryTable td:nth-child(3){
- text-align: right;
-}
diff --git a/app/client/views/GeneralCSS/typography.css b/app/client/views/GeneralCSS/typography.css
deleted file mode 100644
index 7f13bc6d..00000000
--- a/app/client/views/GeneralCSS/typography.css
+++ /dev/null
@@ -1,68 +0,0 @@
-body .paper-font-display4, body .paper-font-display3, body .paper-font-title, body .paper-font-caption{
- white-space: normal;
-}
-
-.white-text {
- color: #dedede;
- color: rgba(255,255,255,0.87);
-}
-
-.white-text .paper-font-display2{
- color: #8a8a8a;
- color: rgba(255,255,255,0.54);
-}
-
-.white-text .paper-font-display1, .white-text.paper-font-display1{
- color: #8a8a8a;
- color: rgba(255,255,255,0.54);
-}
-
-.white-text h1, .white-text .paper-font-headline, .white-text.paper-font-headline{
- color: #dedede;
- color: rgba(255,255,255,0.87);
-}
-
-.white-text h2, .white-text .paper-font-title, .white-text.paper-font-title{
- color: #dedede;
- color: rgba(255,255,255,0.87);
-}
-
-.white-text h3, .white-text .paper-font-subhead{
- color: #dedede;
- color: rgba(255,255,255,0.87);
-}
-
-.white-text .paper-font-body2{
- color: #dedede;
- color: rgba(255,255,255,0.87);
-}
-
-.white-text p, .white-text .paper-font-body1{
- color: #dedede;
- color: rgba(255,255,255,0.87);
-}
-
-.white-text .paper-font-caption{
- color: #8a8a8a;
- color: rgba(255,255,255,0.54);
-}
-
-.black54 {
- color: #757575;
- color: rgba(0,0,0,0.54);
-}
-
-.white54 {
- color: #8a8a8a;
- color: rgba(255,255,255,0.54);
-}
-
-.black87 {
- color: #212121;
- color: rgba(0,0,0,0.87);
-}
-
-.white87 {
- color: #dedede;
- color: rgba(255,255,255,0.87);
-}
diff --git a/app/client/views/character/attacks/attackEdit/attackEdit.html b/app/client/views/character/attacks/attackEdit/attackEdit.html
deleted file mode 100644
index 2a4230d0..00000000
--- a/app/client/views/character/attacks/attackEdit/attackEdit.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
- {{> formulaSuffix}}
-
-
-
-
-
-
-
-
- {{> bracketSuffix}}
-
-
-
-
- {{#each damageTypes}}
-
- {{/each}}
-
-
-
-
-
-
-
-
diff --git a/app/client/views/character/attacks/attackEdit/attackEdit.js b/app/client/views/character/attacks/attackEdit/attackEdit.js
deleted file mode 100644
index d313b1af..00000000
--- a/app/client/views/character/attacks/attackEdit/attackEdit.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var damageTypes = [
- "bludgeoning",
- "piercing",
- "slashing",
- "acid",
- "cold",
- "fire",
- "force",
- "lightning",
- "necrotic",
- "poison",
- "psychic",
- "radiant",
- "thunder",
-];
-
-Template.attackEdit.events({
- "click .deleteAttack": function(event, instance) {
- Attacks.softRemoveNode(this._id);
- GlobalUI.deletedToast(this._id, "Attacks", "Attack");
- },
- "change .attackBonusInput": function(event) {
- var value = event.currentTarget.value;
- Attacks.update(this._id, {$set: {attackBonus: value}});
- },
- "change .damageInput": function(event) {
- var value = event.currentTarget.value;
- Attacks.update(this._id, {$set: {damage: value}});
- },
- "change .detailInput": function(event) {
- var value = event.currentTarget.value;
- Attacks.update(this._id, {$set: {details: value}});
- },
- "iron-select .damageTypeDropdown": function(event) {
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- if (value == this.damageType) return;
- Attacks.update(this._id, {$set: {damageType: value}});
- },
-});
-
-Template.attackEdit.helpers({
- damageTypes: function() {
- return damageTypes;
- },
-});
diff --git a/app/client/views/character/attacks/attackEditList/attackEditList.html b/app/client/views/character/attacks/attackEditList/attackEditList.html
deleted file mode 100644
index e6eae7df..00000000
--- a/app/client/views/character/attacks/attackEditList/attackEditList.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- {{#if attacks.count}}
-
-
-
Attacks
- {{#each attacks}}
- {{>attackEdit}}
- {{/each}}
-
- {{/if}}
- Add Attack
-
diff --git a/app/client/views/character/attacks/attackEditList/attackEditList.js b/app/client/views/character/attacks/attackEditList/attackEditList.js
deleted file mode 100644
index 4e37dcbc..00000000
--- a/app/client/views/character/attacks/attackEditList/attackEditList.js
+++ /dev/null
@@ -1,38 +0,0 @@
-Template.attackEditList.helpers({
- attacks: function() {
- var cursor = Attacks.find({"parent.id": this.parentId, charId: this.charId});
- return cursor;
- }
-});
-
-Template.attackEditList.events({
- "tap #addAttackButton": function() {
- if (typeof this.isSpell !== 'undefined' && this.isSpell) {
- var parentSpell = Spells.findOne({"_id": this.parentId})
- if (parentSpell && parentSpell.parent.collection == "SpellLists") {
- var spellList = SpellLists.findOne({"_id":parentSpell.parent.id});
- if (spellList && spellList.attackBonus) {
- Attacks.insert({
- charId: this.charId,
- parent: {
- id: this.parentId,
- collection: this.parentCollection
- },
- attackBonus: "attackBonus",
- damage: "1d10",
- damageType: "fire",
- });
- return;
- }
- }
- }
-
- Attacks.insert({
- charId: this.charId,
- parent: {
- id: this.parentId,
- collection: this.parentCollection
- },
- });
- },
-});
diff --git a/app/client/views/character/attacks/attackView/attackView.html b/app/client/views/character/attacks/attackView/attackView.html
deleted file mode 100644
index 6aa4157c..00000000
--- a/app/client/views/character/attacks/attackView/attackView.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- {{evaluateAttackBonus charId attack}}
-
-
-
- {{evaluateDamage charId attack}} {{attack.damageType}}
-
- {{#if attack.details}}
-
- {{attack.details}}
-
- {{/if}}
-
-
-
diff --git a/app/client/views/character/attacks/attackView/attackView.js b/app/client/views/character/attacks/attackView/attackView.js
deleted file mode 100644
index 5f8bf096..00000000
--- a/app/client/views/character/attacks/attackView/attackView.js
+++ /dev/null
@@ -1,28 +0,0 @@
-Template.attackView.helpers ({
- evaluateAttackBonus: function(charId, attack) {
- if (attack.parent.collection == "Spells") {
- var spell = Spells.findOne(attack.parent.id);
- if (spell) {
- bonus = evaluate(charId, attack.attackBonus, {"spellListId": spell.parent.id});
- }
- } else {
- var bonus = evaluate(charId, attack.attackBonus);
- }
-
- if (_.isFinite(bonus)) {
- return bonus > 0 ? "+" + bonus : "" + bonus;
- } else {
- return bonus;
- }
- },
- evaluateDamage: function(charId, attack) {
- if (attack.parent.collection == "Spells") {
- var spell = Spells.findOne(attack.parent.id);
- if (spell) {
- return evaluateSpellString(charId, spell.parent.id, attack.damage);
- }
- } else {
- return evaluateString(charId, attack.damage);
- }
- },
-})
\ No newline at end of file
diff --git a/app/client/views/character/attacks/attacksViewList/attacksViewList.html b/app/client/views/character/attacks/attacksViewList/attacksViewList.html
deleted file mode 100644
index 8954daca..00000000
--- a/app/client/views/character/attacks/attacksViewList/attacksViewList.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
- {{#if attacks.count}}
-
-
-
Attacks
- {{#each attack in attacks}}
- {{> attackView attack=attack charId=charId}}
- {{/each}}
-
- {{/if}}
-
diff --git a/app/client/views/character/attacks/attacksViewList/attacksViewList.js b/app/client/views/character/attacks/attacksViewList/attacksViewList.js
deleted file mode 100644
index cdea3b13..00000000
--- a/app/client/views/character/attacks/attacksViewList/attacksViewList.js
+++ /dev/null
@@ -1,5 +0,0 @@
-Template.attacksViewList.helpers({
- attacks: function() {
- return Attacks.find({"parent.id": this.parentId, charId: this.charId});
- }
-});
diff --git a/app/client/views/character/buffs/applyBuffDialog/applyBuffDialog.html b/app/client/views/character/buffs/applyBuffDialog/applyBuffDialog.html
deleted file mode 100644
index 12634ba8..00000000
--- a/app/client/views/character/buffs/applyBuffDialog/applyBuffDialog.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
- Apply Buff
-
-
-
-
- {{> characterPicker selfId=buff.charId includeSelf=canApplyToSelf writableOnly=true}}
-
-
-
- {{#if buff.description}}
-
{{#markdown}}{{evaluateString buff.charId buff.description}}{{/markdown}}
-
- {{/if}}
- {{> effectsViewList charId=buff.charId parentId=buff._id}}
- {{> proficiencyViewList charId=buff.charId parentId=buff._id}}
- {{> attacksViewList charId=buff.charId parentId=buff._id}}
-
-
-
-
-
diff --git a/app/client/views/character/buffs/applyBuffDialog/applyBuffDialog.js b/app/client/views/character/buffs/applyBuffDialog/applyBuffDialog.js
deleted file mode 100644
index afed51f6..00000000
--- a/app/client/views/character/buffs/applyBuffDialog/applyBuffDialog.js
+++ /dev/null
@@ -1,32 +0,0 @@
-Template.applyBuffDialog.onCreated(function(){
- this.selectedTarget = new ReactiveVar("default");
-});
-
-Template.applyBuffDialog.helpers({
- cantApply: function() {
- return this.buff.target === "others" && Template.instance().selectedTarget.get() === "default"; //this is the only case where we can't apply a buff
- },
- canApplyToSelf: function() {
- return this.buff.target !== "others"; //i.e. it is "self" or "both"
- },
-});
-
-Template.applyBuffDialog.events({
- "iron-select .characterPicker": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- Template.instance().selectedTarget.set(value);
- },
- "click #applyButton": function(event, instance){
- var targetId = Template.instance().selectedTarget.get();
- if (targetId === "default") {
- if (this.buff.target === "others") return; //since we have "Select a character" selected
- targetId = this.buff.charId; //otherwise, the default is to target self
- }
-
- popDialogStack(targetId);
- },
- "click #cancelButton": function(event, instance){
- popDialogStack();
- },
-});
diff --git a/app/client/views/character/buffs/buffDialog/buffDialog.html b/app/client/views/character/buffs/buffDialog/buffDialog.html
deleted file mode 100644
index 6bd27c7e..00000000
--- a/app/client/views/character/buffs/buffDialog/buffDialog.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
- {{#with buff}}
- {{#baseDialog title=name class="white" hideColor=true startEditing=true editOnly=true}}
- {{> buffDetails}}
- {{else}}
- {{> buffDetails}}
- {{/baseDialog}}
- {{/with}}
-
-
-
-
- {{appliedBy}}
-
-
- {{#if description}}
- {{#markdown}}{{evaluateString charId description}}{{/markdown}}
-
- {{/if}}
- {{> effectsViewList charId=charId parentId=_id}}
- {{> proficiencyViewList charId=charId parentId=_id}}
- {{> attacksViewList charId=charId parentId=_id}}
-
diff --git a/app/client/views/character/buffs/buffDialog/buffDialog.js b/app/client/views/character/buffs/buffDialog/buffDialog.js
deleted file mode 100644
index 36fbb6e2..00000000
--- a/app/client/views/character/buffs/buffDialog/buffDialog.js
+++ /dev/null
@@ -1,50 +0,0 @@
-Template.buffDialog.onCreated(function(){
- var buff = Buffs.findOne(this.buffId);
- Meteor.subscribe("singleCharacterName", buff.charId); //so we can access the names of public characters
-});
-
-Template.buffDialog.helpers({
- buff: function(){
- return Buffs.findOne(this.buffId);
- },
-});
-
-Template.buffDialog.events({
- "click #deleteButton": function(event, instance){
- Buffs.softRemoveNode(instance.data.buffId);
- popDialogStack();
- },
-});
-
-const typeDict = {
- "Features": "feature",
- "Items": "item",
- "Spells": "spell",
-}; //really, we should only need these three
-
-Template.buffDetails.helpers({
- appliedBy: function() {
- if (this.type == "inate") {
- return "Innate.";
- } else {
- var myName = Characters.findOne(this.charId).name;
- var applierCharacter = Characters.findOne(this.appliedBy) || {name: "???"}
- // "???" indicates that either we do not have read access to the buff-giver, or that the buff-giver does not exist.
-
- if (applierCharacter.name === myName) {
- var charName = "your "
- } else {
- if (applierCharacter.name && applierCharacter.name[applierCharacter.name.length - 1] === 's') {
- var charName = applierCharacter.name + "' ";
- } else {
- var charName = applierCharacter.name + "'s ";
- }
- }
-
- var type = typeDict[this.appliedByDetails.collection] + " ";
- var applierThing = this.appliedByDetails.name;
-
- return "Applied by " + charName + type + applierThing + ".";
- }
- },
-});
\ No newline at end of file
diff --git a/app/client/views/character/buffs/buffListItem/buffListItem.html b/app/client/views/character/buffs/buffListItem/buffListItem.html
deleted file mode 100644
index cb6d1b66..00000000
--- a/app/client/views/character/buffs/buffListItem/buffListItem.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- {{buff.name}}
-
-
- {{#if canEditCharacter buff.charId}}
-
-
- {{/if}}
-
-
diff --git a/app/client/views/character/buffs/buffListItem/buffListItem.js b/app/client/views/character/buffs/buffListItem/buffListItem.js
deleted file mode 100644
index 23f1d9ed..00000000
--- a/app/client/views/character/buffs/buffListItem/buffListItem.js
+++ /dev/null
@@ -1,21 +0,0 @@
-Template.buffListItem.helpers({
- name: function() {
- return this.buff.name
- }
-});
-
-Template.buffListItem.events({
- "click .buffListItem": function(event){
- var buffId = this.buff._id;
- var charId = this.buff.charId;
- pushDialogStack({
- template: "buffDialog",
- data: {buffId: buffId, charId: charId},
- element: event.currentTarget,
- });
- },
- "tap .deleteButton": function(event){
- event.stopPropagation();
- Buffs.remove(this.buff._id);
- },
-});
diff --git a/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.css b/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.css
deleted file mode 100644
index 93345d5c..00000000
--- a/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.condition-library-dialog .item.selected {
- background-color: #e4e4e4;
-}
-
-.condition-library-dialog table {
- border-collapse: collapse;
-}
-
-.condition-library-dialog .library-condition td, tr {
- position: relative;
-}
diff --git a/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.html b/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.html
deleted file mode 100644
index c295e596..00000000
--- a/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
- Conditions
-
-
-
-
-
-
-
-
-
- {{conditionName condition}}
-
-
-
-
diff --git a/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.js b/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.js
deleted file mode 100644
index bb1b5a05..00000000
--- a/app/client/views/character/buffs/conditionLibraryDialog/conditionLibraryDialog.js
+++ /dev/null
@@ -1,166 +0,0 @@
-Template.conditionLibraryDialog.onCreated(function(){
- this.selectedCondition = new ReactiveVar();
-});
-
-Template.conditionLibraryDialog.helpers({
- conditions: function(){
- return Object.keys(LIBRARY_CONDITIONS)
- },
- isSelected(condition){
- const selected = Template.instance().selectedCondition.get();
- return selected && selected === condition;
- },
-});
-
-Template.conditionLibraryDialog.events({
- "click .cancelButton": function(event, template){
- popDialogStack();
- },
- "click .okButton": function(event, template){
- popDialogStack(template.selectedCondition.get());
- },
- "click .library-condition": function(event, template){
- template.selectedCondition.set(this.condition);
- },
- "click #backButton": function(event, template){
- popDialogStack();
- },
-});
-
-Template.libraryCondition.helpers({
- conditionName: function(name){
- return LIBRARY_CONDITIONS[name].buff.name;
- },
-})
-
-
-LIBRARY_CONDITIONS = {
- //Conditions
- blind: {
- buff: {
- name: "Blind",
- description: "A blinded creature can’t see and automatically fails any ability check that requires sight.\n\nAttack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage.",
- },
- },
-
- deaf: {
- buff: {
- name: "Deaf",
- description: "A deafened creature can’t hear and automatically fails any ability check that requires hearing.",
- },
- },
-
- frightened: {
- buff: {
- name: "Frightened",
- description: "A frightened creature has disadvantage on ability checks and attack rolls while the source of its fear is within line of sight.\n\nThe creature can’t willingly move closer to the source of its fear.",
- }
- },
-
- grappled: {
- buff:{
- name: "Grappled",
- description: "A grappled creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.\n\nThe condition ends if the grappler is incapacitated.\n\nThe condition also ends if an effect removes the grappled creature from the reach of the grappler or grappling effect, such as when a creature is hurled away by the thunder wave spell.",
- },
- },
-
- incapacitated: {
- buff: {
- name: "Incapacitated",
- description: "An incapacitated creature can’t take actions or reactions.",
- }
- },
-
- invisible: {
- buff: {
- name: "Invisible",
- description: "An invisible creature is impossible to see without the aid of magic or a special sense. For the purpose of hiding, the creature is heavily obscured. The creature’s location can be detected by any noise it makes or any tracks it leaves.\n\nAttack rolls against the creature have disadvantage, and the creature’s attack rolls have advantage.",
- }
- },
-
- paralyzed: {
- buff: {
- name: "Paralyzed",
- description: "A paralyzed creature is **incapacitated** and can’t move or speak.\n\nAttack rolls against the creature have advantage.\n\nAny attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature.",
- },
- },
-
- petrified: {
- buff: {
- name: "Petrified",
- description: "A petrified creature is transformed, along with any nonmagical object it is wearing or carrying, into a solid inanimate substance (usually stone). Its weight increases by a factor of ten, and it ceases aging.\n\nA petrified creature is **incapacitated** and can’t move or speak, and is unaware of its surroundings.\n\nAttack rolls against the creature have advantage.\n\nThe creature is immune to poison and disease, although a poison or disease already in its system is suspended, not neutralized.",
- },
- },
-
- poisoned: {
- buff: {
- name: "Poisoned",
- description: "A poisoned creature has disadvantage on attack rolls and ability checks.",
- },
- },
-
- prone: {
- buff: {
- name: "Prone",
- description: "A prone creature’s only movement option is to crawl, unless it stands up and thereby ends the condition.\n\nThe creature has disadvantage on attack rolls.\n\nAn attack roll against the creature has advantage if the attacker is within 5 feet of the creature. Otherwise, the attack roll has disadvantage.",
- }
- },
-
- restrained: {
- buff: {
- name: "Restrained",
- description: "A restrained creature’s speed becomes 0, and it can’t benefit from any bonus to its speed.\n\nAttack rolls against the creature have advantage, and the creature’s attack rolls have disadvantage.\n\nThe creature has disadvantage on Dexterity saving throws.",
- },
- },
-
- stunned: {
- buff: {
- name: "Stunned",
- description: "A stunned creature is **incapacitated**, can’t move, and can speak only falteringly\n\nThe creature automatically fails Strength and Dexterity saving throws.\n\nAttack rolls against the creature have advantage.",
- },
- },
-
- unconscious: {
- buff: {
- name: "Unconscious",
- description: "An unconscious creature is **incapacitated**, can’t move or speak, and is unaware of its surroundings.\n\nThe creature drops whatever it’s holding and falls **prone**.\n\nThe creature automatically fails Strength and Dexterity saving throws.\n\nAttack rolls against the creature have advantage.\n\nAny attack that hits the creature is a critical hit if the attacker is within 5 feet of the creature.",
- },
- },
-
- exhaustion1: {
- buff: {
- name: "Exhaustion - 1",
- description: "Disadvantage on ability checks\n\nFinishing a long rest reduces a creature’s exhaustion level by 1, provided that the creature has also ingested some food and drink.",
- },
- },
- exhaustion2: {
- buff: {
- name: "Exhaustion - 2",
- description: "Speed halved",
- },
- },
- exhaustion3: {
- buff: {
- name: "Exhaustion - 3",
- description: "Disadvantage on attack rolls and saving throws",
- },
- },
- exhaustion4: {
- buff: {
- name: "Exhaustion - 4",
- description: "Hit point maximum halved",
- },
- },
- exhaustion5: {
- buff: {
- name: "Exhaustion - 5",
- description: "Speed reduced to 0",
- },
- },
- exhaustion6: {
- buff: {
- name: "Exhaustion - 6",
- description: "You have died of exhaustion",
- },
- },
-};
diff --git a/app/client/views/character/buffs/conditionView/conditionView.html b/app/client/views/character/buffs/conditionView/conditionView.html
deleted file mode 100644
index 4dff87ab..00000000
--- a/app/client/views/character/buffs/conditionView/conditionView.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- {{condition.name}}
-
-
- {{#if canEditCharacter condition.charId}}
-
-
- {{/if}}
-
-
diff --git a/app/client/views/character/buffs/conditionView/conditionView.js b/app/client/views/character/buffs/conditionView/conditionView.js
deleted file mode 100644
index 8d22a0ea..00000000
--- a/app/client/views/character/buffs/conditionView/conditionView.js
+++ /dev/null
@@ -1,15 +0,0 @@
-Template.conditionView.events({
- "click .conditionView": function(event){
- var condition = this.condition;
- var charId = Template.parentData()._id;
- pushDialogStack({
- template: "conditionViewDialog",
- data: {condition: condition},
- element: event.currentTarget,
- });
- },
- "tap .deleteButton": function(event){
- event.stopPropagation();
- Conditions.remove(this.condition._id);
- },
-});
diff --git a/app/client/views/character/buffs/conditionViewDialog/conditionViewDialog.html b/app/client/views/character/buffs/conditionViewDialog/conditionViewDialog.html
deleted file mode 100644
index 9800cc25..00000000
--- a/app/client/views/character/buffs/conditionViewDialog/conditionViewDialog.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
- {{#baseDialog title=condition.name class="white" hideColor=true startEditing=true editOnly=true}}}
- {{> conditionDetails condition=condition}}
- {{else}}
- {{> conditionDetails condition=condition}}
- {{/baseDialog}}
-
-
-
- {{#if condition.description}}
- {{#markdown}}{{evaluateString condition.charId condition.description}}{{/markdown}}
- {{/if}}
- {{> effectsViewList charId=condition.charId parentId=condition._id}}
-
\ No newline at end of file
diff --git a/app/client/views/character/buffs/conditionViewDialog/conditionViewDialog.js b/app/client/views/character/buffs/conditionViewDialog/conditionViewDialog.js
deleted file mode 100644
index da029186..00000000
--- a/app/client/views/character/buffs/conditionViewDialog/conditionViewDialog.js
+++ /dev/null
@@ -1,6 +0,0 @@
-Template.conditionViewDialog.events({
- "click #deleteButton": function(event, instance){
- Conditions.remove(instance.data.condition._id);
- popDialogStack();
- },
-});
\ No newline at end of file
diff --git a/app/client/views/character/buffs/customBuffEdit/customBuffEdit.html b/app/client/views/character/buffs/customBuffEdit/customBuffEdit.html
deleted file mode 100644
index 59ada714..00000000
--- a/app/client/views/character/buffs/customBuffEdit/customBuffEdit.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
- {{#baseEditDialog title=buff.name hideColor=true}}
-
-
-
-
-
-
-
- Self only
-
-
- Others only
-
-
- Both
-
-
-
-
-
-
-
-
- {{> effectsEditList parentId=buff._id parentCollection="CustomBuffs" charId=buff.charId name=name enabled=false}}
- {{> attackEditList parentId=buff._id parentCollection="CustomBuffs" charId=buff.charId name=name enabled=false}}
- {{> proficiencyEditList parentId=buff._id parentCollection="CustomBuffs" charId=buff.charId enabled=false}}
- {{/baseEditDialog}}
-
\ No newline at end of file
diff --git a/app/client/views/character/buffs/customBuffEdit/customBuffEdit.js b/app/client/views/character/buffs/customBuffEdit/customBuffEdit.js
deleted file mode 100644
index 76329df4..00000000
--- a/app/client/views/character/buffs/customBuffEdit/customBuffEdit.js
+++ /dev/null
@@ -1,47 +0,0 @@
-Template.customBuffEdit.helpers({
- buff(){
- return CustomBuffs.findOne(this.customBuffId);
- },
-});
-
-const debounce = (f) => _.debounce(f, 300);
-
-Template.customBuffEdit.events({
- "input #buffNameInput": debounce(function(event){
- const input = event.currentTarget;
- var name = input.value;
- if (!name){
- input.invalid = true;
- input.errorMessage = "Name is required";
- } else {
- input.invalid = false;
- CustomBuffs.update(this.customBuffId, {
- $set: {name: name}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }
- }),
- "input #buffDescriptionInput": debounce(function(event){
- var description = event.currentTarget.value;
- CustomBuffs.update(this.customBuffId, {
- $set: {description: description}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "iron-select .target-dropdown": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- const buff = CustomBuffs.findOne(this.customBuffId);
- if (value === buff.target) return;
- CustomBuffs.update(this.customBuffId, {$set: {target: value}});
- },
- "click #deleteButton": function(event, instance){
- CustomBuffs.softRemoveNode(instance.data.customBuffId);
- GlobalUI.deletedToast(instance.data.customBuffId, "Buffs", "Buff");
- popDialogStack();
- },
-});
diff --git a/app/client/views/character/buffs/customBuffEditList/customBuffEditList.html b/app/client/views/character/buffs/customBuffEditList/customBuffEditList.html
deleted file mode 100644
index f5abb8eb..00000000
--- a/app/client/views/character/buffs/customBuffEditList/customBuffEditList.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
- {{#if buffs.count}}
-
-
- Buffs
-
-
- {{#each buff in buffs}}
- {{> customBuffEditListItem buff=buff}}
- {{/each}}
-
-
- {{/if}}
-
- Add Buff
-
-
-
-
-
- {{> customBuffView buff=buff}}
-
-
-
diff --git a/app/client/views/character/buffs/customBuffEditList/customBuffEditList.js b/app/client/views/character/buffs/customBuffEditList/customBuffEditList.js
deleted file mode 100644
index c9f1e752..00000000
--- a/app/client/views/character/buffs/customBuffEditList/customBuffEditList.js
+++ /dev/null
@@ -1,41 +0,0 @@
-Template.customBuffEditList.helpers({
- buffs: function(){
- var selector = {
- "parent.id": this.parentId,
- "charId": this.charId,
- };
- return CustomBuffs.find(selector);
- }
-});
-
-Template.customBuffEditList.events({
- "tap #addBuffButton": function(event, instance){
- if (!_.isBoolean(this.enabled)) {
- this.enabled = true;
- }
- const customBuffId = CustomBuffs.insert({
- name: this.name || "New Buff",
- charId: this.charId,
- parent: {
- id: this.parentId,
- collection: this.parentCollection,
- },
- });
- pushDialogStack({
- template: "customBuffEdit",
- data: {customBuffId},
- element: event.currentTarget,
- returnElement: () => instance.find(`tr.buff[data-id='${customBuffId}']`),
- });
- },
-});
-
-Template.customBuffEditListItem.events({
- "tap .edit-buff": function(event, template){
- pushDialogStack({
- template: "customBuffEdit",
- data: {customBuffId: this.buff._id},
- element: event.currentTarget.parentElement.parentElement,
- });
- },
-});
diff --git a/app/client/views/character/buffs/customBuffView/customBuffView.html b/app/client/views/character/buffs/customBuffView/customBuffView.html
deleted file mode 100644
index 09971a01..00000000
--- a/app/client/views/character/buffs/customBuffView/customBuffView.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
- {{buff.name}}
-
- {{#if canEditCharacter buff.charId}}
-
Apply{{toSelf}}
- {{/if}}
-
-
diff --git a/app/client/views/character/buffs/customBuffView/customBuffView.js b/app/client/views/character/buffs/customBuffView/customBuffView.js
deleted file mode 100644
index fdc30712..00000000
--- a/app/client/views/character/buffs/customBuffView/customBuffView.js
+++ /dev/null
@@ -1,82 +0,0 @@
-const applyBuff = function(targetId, buff) {
- var parent = global[buff.parent.collection].findOne(buff.parent.id);
-
- //insert new buff
- newBuffId = Buffs.insert({
- charId: targetId,
- name: buff.name,
- description: buff.description,
- lifeTime: {total: buff.lifeTime.total},
- type: "custom",
-
- appliedBy: buff.charId,
- appliedByDetails: {
- name: parent.name,
- collection: buff.parent.collection,
- },
- });
-
- //insert children
- Attacks.find({"parent.id": buff._id}).forEach(function(doc){
- temp = _.clone(doc);
- temp.parent.id = newBuffId;
- temp.parent.collection = "Buffs";
- delete temp._id;
-
- Attacks.insert(temp);
- });
- Effects.find({"parent.id": buff._id}).forEach(function(doc){
- temp = _.clone(doc);
- temp.parent.id = newBuffId;
- temp.parent.collection = "Buffs";
- delete temp._id;
-
- Effects.insert(temp);
- });
- Proficiencies.find({"parent.id": buff._id}).forEach(function(doc){
- temp = _.clone(doc);
- temp.parent.id = newBuffId;
- temp.parent.collection = "Buffs";
- delete temp._id;
-
- Proficiencies.insert(temp);
- });
-
- let target;
- if (targetId == buff.charId) {
- target = "self";
- } else {
- target = Characters.findOne(targetId) || {};
- target = target && target.name || "target"
- }
- GlobalUI.toast(`${buff.name || "Buff"} applied to ${target}`);
-};
-
-Template.customBuffView.helpers({
- toSelf: function() {
- if (this.buff.target === "self") {
- return " to self";
- } else {
- return "";
- }
- }
-});
-
-Template.customBuffView.events({
- "click .apply-buff-button": function(){
- if (this.buff.target !== "self") {
- pushDialogStack({
- template: "applyBuffDialog",
- data: {buff: this.buff},
- element: event.currentTarget,
- callback: (targetId) => {
- if (!targetId) return;
- applyBuff(targetId, this.buff);
- },
- });
- } else {
- var targetId = this.buff.charId;
- applyBuff(targetId, this.buff);
- }
- },
-});
diff --git a/app/client/views/character/buffs/customBuffViewList/customBuffViewList.html b/app/client/views/character/buffs/customBuffViewList/customBuffViewList.html
deleted file mode 100644
index 7aae4d4c..00000000
--- a/app/client/views/character/buffs/customBuffViewList/customBuffViewList.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
- {{#if buffs.count}}
-
-
- Buffs
-
- {{#each buff in buffs}}
-
- {{> customBuffView buff=buff}}
-
- {{/each}}
-
- {{/if}}
-
diff --git a/app/client/views/character/buffs/customBuffViewList/customBuffViewList.js b/app/client/views/character/buffs/customBuffViewList/customBuffViewList.js
deleted file mode 100644
index 2efa4dd4..00000000
--- a/app/client/views/character/buffs/customBuffViewList/customBuffViewList.js
+++ /dev/null
@@ -1,9 +0,0 @@
-Template.customBuffViewList.helpers({
- buffs: function(){
- var selector = {
- "parent.id": this.parentId,
- "charId": this.charId,
- };
- return CustomBuffs.find(selector);
- }
-});
diff --git a/app/client/views/character/characterSettings/characterSettings.html b/app/client/views/character/characterSettings/characterSettings.html
deleted file mode 100644
index 27a06e8b..00000000
--- a/app/client/views/character/characterSettings/characterSettings.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
- {{#with character}}
-
-
-
-
- Character Settings
-
-
-
-
-
-
- {{/with}}
-
diff --git a/app/client/views/character/characterSettings/characterSettings.js b/app/client/views/character/characterSettings/characterSettings.js
deleted file mode 100644
index 773fe2bb..00000000
--- a/app/client/views/character/characterSettings/characterSettings.js
+++ /dev/null
@@ -1,38 +0,0 @@
-Template.characterSettings.helpers({
- character: function() {
- return Characters.findOne(this._id, {fields: {settings: 1}});
- }
-});
-
-Template.characterSettings.events({
- "change #variantEncumbrance": function(event, instance){
- var value = instance.find("#variantEncumbrance").checked;
- if (this.settings.useVariantEncumbrance !== value){
- Characters.update(
- this._id,
- {$set: {"settings.useVariantEncumbrance": value}}
- );
- }
- },
- "change #hideSpellcasting": function(event, instance){
- var value = instance.find("#hideSpellcasting").checked;
- if (this.settings.hideSpellcasting !== value){
- Characters.update(
- this._id,
- {$set: {"settings.hideSpellcasting": value}}
- );
- }
- },
- "change #swapStatAndModifier": function(event, instance){
- var value = instance.find("#swapStatAndModifier").checked;
- if (this.settings.swapStatAndModifier !== value){
- Characters.update(
- this._id,
- {$set: {"settings.swapStatAndModifier": value}}
- );
- }
- },
- "click .doneButton": function(event, instance){
- popDialogStack();
- },
-});
diff --git a/app/client/views/character/characterSettings/deleteCharacterConfirmation.html b/app/client/views/character/characterSettings/deleteCharacterConfirmation.html
deleted file mode 100644
index 9ddcb7e2..00000000
--- a/app/client/views/character/characterSettings/deleteCharacterConfirmation.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- Delete Character
-
-
-
-
-
-
-
diff --git a/app/client/views/character/characterSettings/deleteCharacterConfirmation.js b/app/client/views/character/characterSettings/deleteCharacterConfirmation.js
deleted file mode 100644
index fda5ba5c..00000000
--- a/app/client/views/character/characterSettings/deleteCharacterConfirmation.js
+++ /dev/null
@@ -1,29 +0,0 @@
-Template.deleteCharacterConfirmation.onCreated(function() {
- this.canDelete = new ReactiveVar(false);
-});
-
-Template.deleteCharacterConfirmation.helpers({
- cantDelete: function() {
- return !Template.instance().canDelete.get();
- },
- getStyle: function() {
- if (Template.instance().canDelete.get()) {
- return "background: #d23f31; color: white;";
- }
- },
-});
-
-Template.deleteCharacterConfirmation.events({
- "change #nameInput, input #nameInput": function(event, instance) {
- var canDel = instance.find("#nameInput").value === this.name;
- instance.canDelete.set(canDel);
- },
- "click #deleteButton": function(event, instance) {
- if (instance.find("#nameInput").value === this.name) {
- popDialogStack(true);
- }
- },
- "click .cancelButton": function(event, instance){
- popDialogStack();
- },
-});
diff --git a/app/client/views/character/characterSettings/shareDialog.html b/app/client/views/character/characterSettings/shareDialog.html
deleted file mode 100644
index 4554da61..00000000
--- a/app/client/views/character/characterSettings/shareDialog.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
- Share
-
-
-
-
-
-
-
diff --git a/app/client/views/character/characterSettings/shareDialog.js b/app/client/views/character/characterSettings/shareDialog.js
deleted file mode 100644
index 6574fa84..00000000
--- a/app/client/views/character/characterSettings/shareDialog.js
+++ /dev/null
@@ -1,94 +0,0 @@
-Template.shareDialog.onCreated(function(){
- this.userId = new ReactiveVar();
- this.autorun(() => {
- var char = Characters.findOne(Template.currentData()._id, {
- fields: {readers: 1, writers: 1}
- });
- if (!char) return;
- this.subscribe("userNames", _.union(char.readers, char.writers));
- });
-});
-
-Template.shareDialog.onRendered(function(){
- // Polymer not mirroring selected attribute properly
- this.$("paper-listbox").each(function(){
- this.selected = this.getAttribute("selected");
- });
-});
-
-Template.shareDialog.helpers({
- viewPermission: function() {
- var char = Characters.findOne(this._id, {fields: {settings: 1}});
- return char.settings.viewPermission || "whitelist";
- },
- readers: function(){
- var char = Characters.findOne(this._id, {fields: {readers: 1}});
- return char.readers;
- },
- writers: function(){
- var char = Characters.findOne(this._id, {fields: {writers: 1}});
- //Meteor.users.find({_id: {$in: char.writers}});
- return char.writers
- },
- username: function(id){
- const user = Meteor.users.findOne(id);
- return user && user.username || "user: " + id;
- },
- shareButtonDisabled: function(){
- return !Template.instance().userId.get();
- },
- userFindError: function(){
- if (!Template.instance().userId.get()){
- return "User not found";
- }
- },
-});
-
-Template.shareDialog.events({
- "iron-select .visibilityDropdown": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- var char = Characters.findOne(this._id, {fields: {settings: 1}});
- if (value == char.settings.viewPermission) return;
- Characters.update(this._id, {$set: {"settings.viewPermission": value}});
- },
- "input #userNameOrEmailInput":
- function(event, instance){
- var userName = instance.find("#userNameOrEmailInput").value;
- instance.userId.set(undefined);
- Meteor.call("getUserId", userName, function(err, result) {
- if (err){
- console.error(err);
- } else {
- console.log(result);
- instance.userId.set(result);
- }
- });
- },
- "click #shareButton": function(event, instance){
- var self = this;
- var permission = instance.find("#accessLevelMenu").selected;
- if (!permission) throw "no permission set";
- var userId = instance.userId.get();
- if (!userId) return;
- if (permission === "write"){
- Characters.update(self._id, {
- $addToSet: {writers: userId},
- $pull: {readers: userId},
- });
- } else {
- Characters.update(self._id, {
- $addToSet: {readers: userId},
- $pull: {writers: userId},
- });
- }
- },
- "click .deleteShare": function(event, instance) {
- Characters.update(instance.data._id, {
- $pull: {writers: this.id, readers: this.id}
- });
- },
- "click .doneButton": function(event, instance){
- popDialogStack();
- },
-});
diff --git a/app/client/views/character/characterSettings/unshareCharacterConfirmation.html b/app/client/views/character/characterSettings/unshareCharacterConfirmation.html
deleted file mode 100644
index c5c689d8..00000000
--- a/app/client/views/character/characterSettings/unshareCharacterConfirmation.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
- Unshare Character
-
-
-
-
-
-
-
diff --git a/app/client/views/character/characterSettings/unshareCharacterConfirmation.js b/app/client/views/character/characterSettings/unshareCharacterConfirmation.js
deleted file mode 100644
index de240ee3..00000000
--- a/app/client/views/character/characterSettings/unshareCharacterConfirmation.js
+++ /dev/null
@@ -1,31 +0,0 @@
-Template.unshareCharacterConfirmation.onCreated(function() {
- this.canUnshare = new ReactiveVar(false);
-});
-
-Template.unshareCharacterConfirmation.helpers({
- cantUnshare: function() {
- return !Template.instance().canUnshare.get();
- },
- getStyle: function() {
- if (Template.instance().canUnshare.get()) {
- return "background: #d23f31; color: white;";
- }
- }
-});
-
-Template.unshareCharacterConfirmation.events({
- "change #nameInput, input #nameInput": function(event, instance) {
- var can = instance.find("#nameInput").value === this.name;
- instance.canUnshare.set(can);
- },
- "click #unshareButton": function(event, instance) {
- if (instance.find("#nameInput").value === this.name) {
- setTimeout(popDialogStack, 100); //weird things happen without the delay.
- Router.go("/characterList");
- Meteor.call("removeMeFromReaders", this._id);
- }
- },
- "click .cancelButton": function(event, instance){
- popDialogStack();
- },
-});
diff --git a/app/client/views/character/characterSheet.css b/app/client/views/character/characterSheet.css
deleted file mode 100644
index 5ce11aa5..00000000
--- a/app/client/views/character/characterSheet.css
+++ /dev/null
@@ -1,24 +0,0 @@
-app-toolbar.medium-tall {
- height: 108px;
-}
-
-.character-name {
- padding-left: 16px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.character-menu paper-icon-item{
- cursor: pointer;
-}
-
-.character-sheet app-header {
- position: relative;
- z-index: 1;
-}
-
-.character-sheet iron-pages > div {
- overflow-y: auto;
- overflow-x: hidden;
-}
diff --git a/app/client/views/character/characterSheet.html b/app/client/views/character/characterSheet.html
deleted file mode 100644
index 8785892b..00000000
--- a/app/client/views/character/characterSheet.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
- {{name}}
-
- {{#if canEditCharacter _id}}
- {{> colorDropdown}}
-
- {{else}}
-
- {{/if}}
-
-
-
- Stats
- Features
- Inventory
- {{#unless hideSpellcasting}}
- Spells
- {{/unless}}
- Persona
- Journal
-
-
-
- {{#if newUserExperience}}{{> newUserStepper}}{{/if}}
-
-
-
- {{> stats}}
- {{> features}}
- {{> inventory}}
- {{#unless hideSpellcasting}}
- {{> spells}}
- {{/unless}}
- {{> persona}}
- {{> journal}}
-
-
-
-
diff --git a/app/client/views/character/characterSheet.js b/app/client/views/character/characterSheet.js
deleted file mode 100644
index a2a549f4..00000000
--- a/app/client/views/character/characterSheet.js
+++ /dev/null
@@ -1,244 +0,0 @@
-let tabPages, tabSliders, tabFabs, tabFabMenus;
-Template.characterSheet.onRendered(function() {
- //default to the stats tab
- Session.setDefault(this.data._id + ".selectedTab", "0");
-
- // Keep the header's scroll target up to date with the currently selected tab
- let header;
- this.autorun(() => {
- const tab = getTab(Template.currentData()._id);
- header = header || this.find("app-header");
- if (!header) return;
- Tracker.afterFlush(() => {
- header.scrollTarget = this.find("#tabPages .iron-selected");
- header._scrollHandler && header._scrollHandler();
- });
- });
-
- _.defer(() => {
- // Store all the tab page components for use in animations
- tabPages = _.times(6, (n) =>
- this.$(`.tab-page:nth-child(${n + 1})`)
- );
- tabSliders = _.times(6, (n) =>
- tabPages[n].find(".animation-slider")
- );
- tabFabs = _.times(6, (n) =>
- tabPages[n].find(".floatyButton")
- );
- tabFabMenus = _.times(6, (n) =>
- tabPages[n].find(".mini-holder")
- );
- });
-
- //watch this character and make sure their encumbrance is updated
- //trackEncumbranceConditions(this.data._id, this);
-});
-
-/**
- * Page change animations that suck less than neon-animated-pages
- */
-const tabAnimation = ({oldTab, newTab, duration}) => {
- if (newTab === oldTab) return;
- duration = duration || 400;
- const delay = (element, f) => {
- element.on(
- "transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",
- (event) => {
- if (event.target == event.currentTarget){
- f();
- $(this).off(event);
- }
- }
- );
- }
- const isForward = newTab > oldTab;
- const entryAnimation = {
- before: {
- transform: isForward ? "translateX(100%)" : "translateX(-100%)",
- },
- during: {
- transition: `transform ${duration}ms ease`,
- transform: "",
- },
- after: {
- transition: "",
- transform: "",
- },
- }
- const exitAnimation = {
- before: {
- transform: "translateZ(0)",
- },
- during: {
- transition: `transform ${duration}ms ease`,
- transform: isForward ? "translateX(-100%)" : "translateX(100%)",
- },
- after: {
- transition: "",
- transform: "",
- display: "",
- },
- }
- const oldPage = tabPages[oldTab];
- const newPage = tabPages[newTab];
- if (oldPage.length && newPage.length){
- oldPage[0].style.setProperty("display", "initial", "important");
- oldPage.css({zIndex: "1"});
- newPage.css({zIndex: "0"});
- _.defer(() => {
- oldPage.css({
- transition: `z-index ${duration}ms linear`,
- zIndex: "0",
- });
- newPage.css({
- transition: `z-index ${duration}ms linear`,
- zIndex: "1",
- });
- });
- delay(oldPage, () => oldPage.css({
- display: "",
- transition: "",
- zIndex: "",
- }));
- delay(newPage, () => newPage.css({
- transition: "",
- zIndex: "",
- }));
- }
- const oldSlider = tabSliders[oldTab];
- if (oldSlider.length){
- oldSlider.css(exitAnimation.before);
- _.defer(() => oldSlider.css(exitAnimation.during));
- delay(oldSlider, () => oldSlider.css(exitAnimation.after));
- }
- const newSlider = tabSliders[newTab];
- if (newSlider.length){
- newSlider.css(entryAnimation.before);
- _.defer(() => newSlider.css(entryAnimation.during));
- delay(newSlider, () => newSlider.css(entryAnimation.after));
- }
- slideDown = ({element, reverse}) => {
- element.css({
- transform: reverse ? "translateY(80px)" : "",
- });
- const fraction = duration / 4;
- _.defer(() => element.css({
- transition: reverse ?
- `transform ${fraction}ms ease-out ${duration - fraction}ms` :
- `transform ${fraction}ms ease-in`,
- transform: reverse ? "" : "translateY(80px)",
- }));
- delay(element, () => element.css({
- transition: "",
- }));
- }
-
- const oldFab = tabFabs[oldTab];
- const newFab = tabFabs[newTab];
- if (oldFab.length && !newFab.length){
- slideDown({element: oldFab});
- }
- if (newFab.length && !oldFab.length){
- slideDown({element: newFab, reverse: true});
- }
- if (newFab.length && oldFab.length){
- newFab.css({transform: ""});
- }
-
- const oldFabMenu = tabFabMenus[oldTab];
- if (oldFabMenu.length) {
- Blaze.getView(oldFabMenu[0]).templateInstance().active.set(false);
- }
-}
-
-var setTab = function(charId, tab){
- tabAnimation({
- oldTab: +Session.get(charId + ".selectedTab"),
- newTab: +tab,
- });
- return Session.set(charId + ".selectedTab", tab);
-};
-
-var getTab = function(charId){
- return Session.get(charId + ".selectedTab");
-};
-
-Template.characterSheet.helpers({
- printing: function(){
- return Session.get("isPrinting");
- },
- printUrl: function(){
- return `/character/${this._id}/${this.urlName || "-"}/print`
- },
- selectedTab: function(){
- return getTab(this._id);
- },
- hideSpellcasting: function() {
- var char = Characters.findOne(this._id);
- return char && char.settings.hideSpellcasting;
- },
- newUserExperience: function(){
- var char = Characters.findOne(this._id);
- return char && char.settings.newUserExperience;
- },
- shouldBounce: function(tab){
- const selected = Session.get(this._id + ".selectedTab")
- const step = Session.get("newUserExperienceStep");
- if (selected == tab) return false;
- return (tab === 1 && step === 0) ||
- (tab === 5 && step === 1) ||
- (tab === 0 && step === 2);
- },
-});
-
-Template.characterSheet.events({
- "iron-select #characterSheetTabs": function(event, instance){
- setTab(this._id, event.target.selected);
- },
- "color-change": function(event, instance){
- console.log("character color change")
- Characters.update(this._id, {$set: {color: event.color}});
- },
- "click #deleteCharacter": function(event, instance){
- pushDialogStack({
- data: this,
- template: "deleteCharacterConfirmation",
- element: event.currentTarget.parentElement.parentElement,
- callback: (result) => {
- if (result === true){
- Router.go("/characterList");
- Tracker.afterFlush(() => Characters.remove(this._id));
- }
- },
- });
- },
- "click #shareCharacter": function(event, instance){
- pushDialogStack({
- data: this,
- template: "shareDialog",
- element: event.currentTarget.parentElement.parentElement,
- });
- },
- "click #characterSettings": function(event, instance){
- pushDialogStack({
- data: this,
- template: "characterSettings",
- element: event.currentTarget.parentElement.parentElement,
- });
- },
- "click #characterExport": function(event, instance){
- pushDialogStack({
- data: this,
- template: "exportDialog",
- element: event.currentTarget.parentElement.parentElement,
- });
- },
- "click #unshareCharacter": function(event, instance){
- pushDialogStack({
- data: this,
- template: "unshareCharacterConfirmation",
- element: event.currentTarget.parentElement.parentElement,
- });
- },
-});
diff --git a/app/client/views/character/effects/effectEdit/effectEdit.css b/app/client/views/character/effects/effectEdit/effectEdit.css
deleted file mode 100644
index 30e73411..00000000
--- a/app/client/views/character/effects/effectEdit/effectEdit.css
+++ /dev/null
@@ -1,25 +0,0 @@
-.effectEdit .operationDropDown {
- width: 152px;
-}
-
-.effectEdit .statDropDown {
- width: 152px;
-}
-
-.effectEdit .damageMultiplierDropDown {
- width: 152px;
-}
-
-.effectEdit .deleteEffect {
- flex-shrink: 0;
-}
-
-.effectEdit .effect-table-view {
- align-self: center;
- color: #757575;
- color: rgba(0,0,0,0.54);
-}
-
-.effectEdit .iron-selected {
- color: #ad2a1f;
-}
diff --git a/app/client/views/character/effects/effectEdit/effectEdit.html b/app/client/views/character/effects/effectEdit/effectEdit.html
deleted file mode 100644
index 9716e3d9..00000000
--- a/app/client/views/character/effects/effectEdit/effectEdit.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
- {{#with effect}}
- {{#baseEditDialog hideColor=true title="Effect"}}
-
-
-
- {{#if showEffectValueInput}}
-
- {{> formulaSuffix}}
-
- {{else}}
-
- {{/if}}
-
-
- {{#if operations}}
-
- {{else}} {{#if showMultiplierOperations}}
-
- {{else}}
-
- {{/if}} {{/if}}
-
-
- {{/baseEditDialog}}
- {{/with}}
-
-
-
-
-
-
-
diff --git a/app/client/views/character/effects/effectEdit/effectEdit.js b/app/client/views/character/effects/effectEdit/effectEdit.js
deleted file mode 100644
index 7575dbf5..00000000
--- a/app/client/views/character/effects/effectEdit/effectEdit.js
+++ /dev/null
@@ -1,262 +0,0 @@
-//TODO add dexterity armor
-// jscs:disable maximumLineLength
-var stats = [
- {stat: "strength", name: "Strength", group: "Ability Scores"},
- {stat: "dexterity", name: "Dexterity", group: "Ability Scores"},
- {stat: "constitution", name: "Constitution", group: "Ability Scores"},
- {stat: "intelligence", name: "Intelligence", group: "Ability Scores"},
- {stat: "wisdom", name: "Wisdom", group: "Ability Scores"},
- {stat: "charisma", name: "Charisma", group: "Ability Scores"},
-
- {stat: "strengthSave", name: "Strength Save", group: "Saving Throws"},
- {stat: "dexteritySave", name: "Dexterity Save", group: "Saving Throws"},
- {stat: "constitutionSave", name: "Constitution Save", group: "Saving Throws"},
- {stat: "intelligenceSave", name: "Intelligence Save", group: "Saving Throws"},
- {stat: "wisdomSave", name: "Wisdom Save", group: "Saving Throws"},
- {stat: "charismaSave", name: "Charisma Save", group: "Saving Throws"},
-
- {stat: "acrobatics", name: "Acrobatics", group: "Skills"},
- {stat: "animalHandling", name: "Animal Handling", group: "Skills"},
- {stat: "arcana", name: "Arcana", group: "Skills"},
- {stat: "athletics", name: "Athletics", group: "Skills"},
- {stat: "deception", name: "Deception", group: "Skills"},
- {stat: "history", name: "History", group: "Skills"},
- {stat: "insight", name: "Insight", group: "Skills"},
- {stat: "intimidation", name: "Intimidation", group: "Skills"},
- {stat: "investigation", name: "Investigation", group: "Skills"},
- {stat: "medicine", name: "Medicine", group: "Skills"},
- {stat: "nature", name: "Nature", group: "Skills"},
- {stat: "perception", name: "Perception", group: "Skills"},
- {stat: "performance", name: "Performance", group: "Skills"},
- {stat: "persuasion", name: "Persuasion", group: "Skills"},
- {stat: "religion", name: "Religion", group: "Skills"},
- {stat: "sleightOfHand", name: "Sleight of Hand", group: "Skills"},
- {stat: "stealth", name: "Stealth", group: "Skills"},
- {stat: "survival", name: "Survival", group: "Skills"},
- {stat: "initiative", name: "Initiative", group: "Skills"},
-
- {stat: "hitPoints", name: "Hit Points", group: "Stats"},
- {stat: "tempHP", name: "Temporary Hit Points", group: "Stats"},
- {stat: "armor", name: "Armor", group: "Stats"},
- {stat: "dexterityArmor", name: "Dexterity Armor Bonus", group: "Stats"},
- {stat: "speed", name: "Speed", group: "Stats"},
- {stat: "proficiencyBonus", name: "Proficiency Bonus", group: "Stats"},
- {stat: "ki", name: "Ki Points", group: "Stats"},
- {stat: "sorceryPoints", name: "Sorcery Points", group: "Stats"},
- {stat: "rages", name: "Rages", group: "Stats"},
- {stat: "rageDamage", name: "Rage Damage", group: "Stats"},
- {stat: "expertiseDice", name: "Expertise Dice", group: "Stats"},
- {stat: "superiorityDice", name: "Superiority Dice", group: "Stats"},
- {stat: "carryMultiplier", name: "Carry Capacity Multiplier", group: "Stats"},
-
- {stat: "level1SpellSlots", name: "level 1", group: "Spell Slots"},
- {stat: "level2SpellSlots", name: "level 2", group: "Spell Slots"},
- {stat: "level3SpellSlots", name: "level 3", group: "Spell Slots"},
- {stat: "level4SpellSlots", name: "level 4", group: "Spell Slots"},
- {stat: "level5SpellSlots", name: "level 5", group: "Spell Slots"},
- {stat: "level6SpellSlots", name: "level 6", group: "Spell Slots"},
- {stat: "level7SpellSlots", name: "level 7", group: "Spell Slots"},
- {stat: "level8SpellSlots", name: "level 8", group: "Spell Slots"},
- {stat: "level9SpellSlots", name: "level 9", group: "Spell Slots"},
-
- {stat: "d6HitDice", name: "d6 Hit Dice", group: "Hit Dice"},
- {stat: "d8HitDice", name: "d8 Hit Dice", group: "Hit Dice"},
- {stat: "d10HitDice", name: "d10 Hit Dice", group: "Hit Dice"},
- {stat: "d12HitDice", name: "d12 Hit Dice", group: "Hit Dice"},
-
- {stat: "acidMultiplier", name: "Acid", group: "Weakness/Resistance"},
- {stat: "bludgeoningMultiplier", name: "Bludgeoning", group: "Weakness/Resistance"},
- {stat: "coldMultiplier", name: "Cold", group: "Weakness/Resistance"},
- {stat: "fireMultiplier", name: "Fire", group: "Weakness/Resistance"},
- {stat: "forceMultiplier", name: "Force", group: "Weakness/Resistance"},
- {stat: "lightningMultiplier", name: "Lightning", group: "Weakness/Resistance"},
- {stat: "necroticMultiplier", name: "Necrotic", group: "Weakness/Resistance"},
- {stat: "piercingMultiplier", name: "Piercing", group: "Weakness/Resistance"},
- {stat: "poisonMultiplier", name: "Poison", group: "Weakness/Resistance"},
- {stat: "psychicMultiplier", name: "Psychic", group: "Weakness/Resistance"},
- {stat: "radiantMultiplier", name: "Radiant", group: "Weakness/Resistance"},
- {stat: "slashingMultiplier", name: "Slashing", group: "Weakness/Resistance"},
- {stat: "thunderMultiplier", name: "Thunder", group: "Weakness/Resistance"},
-];
-
-// jscs:enable maximumLineLength
-
-var statsDict = _.indexBy(stats, "stat");
-var statGroups = _.groupBy(stats, "group");
-var statGroupNames = _.keys(statGroups);
-
-var attributeOperations = [
- {name: "Base Value", operation: "base"},
- {name: "Add", operation: "add"},
- {name: "Multiply", operation: "mul"},
- {name: "Min", operation: "min"},
- {name: "Max", operation: "max"},
-];
-var skillOperations = [
- {name: "Add", operation: "add"},
- {name: "Multiply", operation: "mul"},
- {name: "Min", operation: "min"},
- {name: "Max", operation: "max"},
- {name: "Advantage", operation: "advantage"},
- {name: "Disadvantage", operation: "disadvantage"},
- {name: "Passive Bonus", operation: "passiveAdd"},
- {name: "Automatically Fail", operation: "fail"},
- {name: "Conditional Benefit", operation: "conditional"},
-];
-
-Template.effectEdit.onRendered(function(){
- _.defer(() => {
- const statElement = this.find(".statMenu .iron-selected");
- statElement && statElement.scrollIntoView();
- const opElement = this.find(".operationMenu .iron-selected");
- opElement && opElement.scrollIntoView();
- });
-});
-
-Template.effectEdit.helpers({
- effect: function(){
- return Effects.findOne(this.id);
- },
- statGroups: function(){
- return statGroupNames;
- },
- stats: function(){
- var group = this;
- return statGroups[group];
- },
- operations: function(){
- var stat = statsDict[this.stat];
- var group = stat && stat.group;
- if (group === "Weakness/Resistance") return null;
- if (group === "Saving Throws" || group === "Skills"){
- return skillOperations;
- } else {
- return attributeOperations;
- }
- },
- showMultiplierOperations: function(){
- var stat = statsDict[this.stat];
- return stat && stat.group === "Weakness/Resistance"
- },
- showEffectValueInput: function(){
- var stat = statsDict[this.stat];
- var group = stat && stat.group;
- if (
- group === "Weakness/Resistance"
- ) return false;
- var op = this.operation;
- if (
- !op ||
- op === "advantage" ||
- op === "disadvantage" ||
- op === "fail"
- ) return false;
- return true;
- },
- effectValue: function(){
- return this.calculation || this.value;
- },
- isGroupSelected: function(groupName, statName){
- var stat = statsDict[statName]
- return stat && (stat.group === groupName);
- },
-});
-
-var setStat = function(statName, effectId){
- var setter = {stat: statName};
- var effect = Effects.findOne(this._id);
- var group = statsDict[statName].group;
- if (group === "Saving Throws" || group === "Skills"){
- // Skills must have a valid skill operation
- if (!_.contains(
- _.map(skillOperations, ao => ao.operation),
- effect.operation
- )){
- setter.operation = "add";
- }
- } else if (group !== "Weakness/Resistance"){
- // Attributes must have a valid attribute operation
- if (!_.contains(
- _.map(attributeOperations, ao => ao.operation),
- effect.operation
- )){
- setter.operation = "base";
- }
- } else {
- // Weakness/Resistance must have a mul operation and value
- if (effect.operation !== "mul"){
- setter.operation = "mul";
- }
- if (!_.contains([0, 0.5, 2], effect.value)){
- setter.value = 0.5;
- }
- }
- Effects.update(effectId, {$set: setter});
-};
-
-var scrollAnimationId;
-var scrollElementToView = element => {
- var scrollFunction = function(){
- element.scrollIntoView();
- scrollAnimationId = requestAnimationFrame(scrollFunction);
- };
- return scrollFunction;
-}
-
-Template.effectEdit.events({
- "click #deleteButton": function(event, instance){
- Effects.softRemoveNode(instance.data.id);
- GlobalUI.deletedToast(instance.data.id, "Effects", "Effect");
- popDialogStack();
- },
- "click .statGroupTitle": function(event, instance){
- var groupName = this.toString();
- var firstStat = statGroups[groupName][0].stat;
- setStat(firstStat, instance.data.id);
- scrollAnimationId = requestAnimationFrame(scrollElementToView(event.target));
- _.delay(() => cancelAnimationFrame(scrollAnimationId), 300);
- },
- "iron-select .statMenu": function(event){
- var detail = event.originalEvent.detail;
- var statName = detail.item.getAttribute("name");
- if (statName == this.stat) return;
- setStat(statName, this._id);
- },
- "iron-select .operationMenu": function(event){
- var detail = event.originalEvent.detail;
- var opName = detail.item.getAttribute("name");
- if (opName == this.operation) return;
- Effects.update(this._id, {$set: {operation: opName}});
- },
- "iron-select .multiplierMenu": function(event){
- var detail = event.originalEvent.detail;
- var value = +detail.item.getAttribute("name");
- if (value == this.value) return;
- Effects.update(this._id, {$set: {
- value: value,
- calculation: "",
- operation: "mul",
- }});
- },
- "change .effectValueInput, input .effectValueInput":
- _.debounce(function(event){
- var value = event.currentTarget.value;
- var numValue = value === "" ? NaN : +value;
- if (_.isFinite(numValue)){
- if (this.value === numValue) return;
- Effects.update(this._id, {
- $set: {value: numValue},
- $unset: {calculation: ""},
- });
- } else if (_.isString(value)){
- if (this.calculation === value) return;
- Effects.update(this._id, {
- $set: {calculation: value},
- $unset: {value: ""},
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }
- }, 400),
-});
diff --git a/app/client/views/character/effects/effectView/effectView.css b/app/client/views/character/effects/effectView/effectView.css
deleted file mode 100644
index e69de29b..00000000
diff --git a/app/client/views/character/effects/effectView/effectView.html b/app/client/views/character/effects/effectView/effectView.html
deleted file mode 100644
index 9fb1db03..00000000
--- a/app/client/views/character/effects/effectView/effectView.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
- {{statName}}
- {{operationName}}{{statValue}}
-
diff --git a/app/client/views/character/effects/effectView/effectView.js b/app/client/views/character/effects/effectView/effectView.js
deleted file mode 100644
index a7bad92f..00000000
--- a/app/client/views/character/effects/effectView/effectView.js
+++ /dev/null
@@ -1,179 +0,0 @@
-var stats = {
- "strength":{"name":"Strength"},
- "dexterity":{"name":"Dexterity"},
- "constitution":{"name":"Constitution"},
- "intelligence":{"name":"Intelligence"},
- "wisdom":{"name":"Wisdom"},
- "charisma":{"name":"Charisma"},
-
- "strengthSave":{"name":"Strength Save"},
- "dexteritySave":{"name":"Dexterity Save"},
- "constitutionSave":{"name":"Constitution Save"},
- "intelligenceSave":{"name":"Intelligence Save"},
- "wisdomSave":{"name":"Wisdom Save"},
- "charismaSave":{"name":"Charisma Save"},
-
- "acrobatics":{"name":"Acrobatics"},
- "animalHandling":{"name":"Animal Handling"},
- "arcana":{"name":"Arcana"},
- "athletics":{"name":"Athletics"},
- "deception":{"name":"Deception"},
- "history":{"name":"History"},
- "insight":{"name":"Insight"},
- "intimidation":{"name":"Intimidation"},
- "investigation":{"name":"Investigation"},
- "medicine":{"name":"Medicine"},
- "nature":{"name":"Nature"},
- "perception":{"name":"Perception"},
- "performance":{"name":"Performance"},
- "persuasion":{"name":"Persuasion"},
- "religion":{"name":"Religion"},
- "sleightOfHand":{"name":"Sleight of Hand"},
- "stealth":{"name":"Stealth"},
- "survival":{"name":"Survival"},
- "initiative":{"name":"Initiative"},
-
- "hitPoints":{"name":"Hit Points"},
- "tempHP":{"name":"Temporary Hit Points"},
- "armor":{"name":"Armor"},
- "dexterityArmor":{"name":"Dexterity Armor Bonus"},
- "speed":{"name":"Speed"},
- "proficiencyBonus":{"name":"Proficiency Bonus"},
- "ki":{"name":"Ki Points"},
- "sorceryPoints":{"name":"Sorcery Points"},
- "rages":{"name":"Rages"},
- "rageDamage":{"name":"Rage Damage"},
- "expertiseDice":{"name":"Expertise Dice"},
- "superiorityDice":{"name":"Superiority Dice"},
- "carryMultiplier": {"name": "Carry Capacity Multiplier"},
-
- "level1SpellSlots":{"name":"level 1 Spell Slots"},
- "level2SpellSlots":{"name":"level 2 Spell Slots"},
- "level3SpellSlots":{"name":"level 3 Spell Slots"},
- "level4SpellSlots":{"name":"level 4 Spell Slots"},
- "level5SpellSlots":{"name":"level 5 Spell Slots"},
- "level6SpellSlots":{"name":"level 6 Spell Slots"},
- "level7SpellSlots":{"name":"level 7 Spell Slots"},
- "level8SpellSlots":{"name":"level 8 Spell Slots"},
- "level9SpellSlots":{"name":"level 9 Spell Slots"},
-
- "d6HitDice":{"name":"d6 Hit Dice"},
- "d8HitDice":{"name":"d8 Hit Dice"},
- "d10HitDice":{"name":"d10 Hit Dice"},
- "d12HitDice":{"name":"d12 Hit Dice"},
-
- "acidMultiplier":{"name":"Acid damage", "group": "Weakness/Resistance"},
- "bludgeoningMultiplier":{
- "name":"Bludgeoning damage", "group": "Weakness/Resistance",
- },
- "coldMultiplier":{
- "name":"Cold damage", "group": "Weakness/Resistance",
- },
- "fireMultiplier":{
- "name":"Fire damage", "group": "Weakness/Resistance",
- },
- "forceMultiplier":{
- "name":"Force damage", "group": "Weakness/Resistance",
- },
- "lightningMultiplier":{
- "name":"Lightning damage", "group": "Weakness/Resistance",
- },
- "necroticMultiplier":{
- "name":"Necrotic damage", "group": "Weakness/Resistance",
- },
- "piercingMultiplier":{
- "name":"Piercing damage", "group": "Weakness/Resistance",
- },
- "poisonMultiplier":{
- "name":"Poison damage", "group": "Weakness/Resistance",
- },
- "psychicMultiplier":{
- "name":"Psychic damage", "group": "Weakness/Resistance",
- },
- "radiantMultiplier":{
- "name":"Radiant damage", "group": "Weakness/Resistance",
- },
- "slashingMultiplier":{
- "name":"Slashing damage", "group": "Weakness/Resistance",
- },
- "thunderMultiplier":{
- "name":"Thunder damage", "group": "Weakness/Resistance",
- },
-};
-
-var operations = {
- base: {name: "Base Value: "},
- proficiency: {name: "Proficiency"},
- add: {name: "+"},
- mul: {name: "×"},
- min: {name: "Min: "},
- max: {name: "Max: "},
- advantage: {name: "Advantage"},
- disadvantage: {name: "Disadvantage"},
- passiveAdd: {name: "Passive Bonus: "},
- fail: {name: "Automatically Fail"},
-};
-
-Template.effectView.helpers({
- sourceName: function(){
- var id = this.parent.id;
- if (!id) return;
- switch (this.parent.collection){
- case "Features":
- return "Feature - " + Features.findOne(id, {fields: {name: 1}}).name;
- case "Classes":
- return Classes.findOne(id, {fields: {name: 1}}).name;
- case "Buffs":
- return "Buff - " + Buffs.findOne(id, {fields: {name: 1}}).name;
- case "Items":
- return "Equipment - " + Items.findOne(id, {fields: {name: 1}}).name;
- case "Characters":
- return Characters.findOne(this.charId, {fields: {race: 1}}).race;
- default:
- return "Inate";
- }
- },
- statName: function(){
- return stats[this.stat] && stats[this.stat].name || "No Stat";
- },
- operationName: function(){
- if (
- this.operation === "proficiency" ||
- this.operation === "conditional"
- ) return null;
- if (stats[this.stat] && stats[this.stat].group === "Weakness/Resistance")
- return null;
- if (this.operation === "add" && evaluateEffect(this.charId, this) < 0)
- return null;
- return operations[this.operation] &&
- operations[this.operation].name || "No Operation";
- },
- statValue: function(){
- if (
- this.operation === "advantage" ||
- this.operation === "disadvantage" ||
- this.operation === "fail"
- ){
- return null;
- }
- if (this.operation === "proficiency"){
- if (this.value == 0.5 || this.calculation == 0.5)
- return "Half Proficiency";
- if (this.value == 1 || this.calculation == 1)
- return "Proficiency";
- if (this.value == 2 || this.calculation == 2)
- return "Double Proficiency";
- }
- if (this.operation === "conditional"){
- return this.calculation || this.value;
- }
- if (stats[this.stat] && stats[this.stat].group === "Weakness/Resistance"){
- if (this.value === 0.5) return "Resistance";
- if (this.value === 2) return "Vulnerability";
- if (this.value === 0) return "Immunity";
- }
- var value = evaluateEffect(this.charId, this);
- if (_.isNumber(value)) return value;
- return this.calculation || this.value;
- },
-});
diff --git a/app/client/views/character/effects/effectsEditList/effectsEditList.css b/app/client/views/character/effects/effectsEditList/effectsEditList.css
deleted file mode 100644
index 7c92fe71..00000000
--- a/app/client/views/character/effects/effectsEditList/effectsEditList.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.effectsEditList .effect {
- background: white;
-}
diff --git a/app/client/views/character/effects/effectsEditList/effectsEditList.html b/app/client/views/character/effects/effectsEditList/effectsEditList.html
deleted file mode 100644
index f6216b3d..00000000
--- a/app/client/views/character/effects/effectsEditList/effectsEditList.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
- {{#if effects.length}}
-
-
Effects
-
- {{#each effects}}
-
- {{>effectView}}
-
-
-
-
-
- {{/each}}
-
-
- {{/if}}
- Add Effect
-
diff --git a/app/client/views/character/effects/effectsEditList/effectsEditList.js b/app/client/views/character/effects/effectsEditList/effectsEditList.js
deleted file mode 100644
index 0a8646d4..00000000
--- a/app/client/views/character/effects/effectsEditList/effectsEditList.js
+++ /dev/null
@@ -1,46 +0,0 @@
-Template.effectsEditList.helpers({
- effects: function(){
- var selector = {
- "parent.id": this.parentId,
- "parent.collection": this.parentCollection,
- "charId": this.charId,
- };
- if (this.parentGroup){
- selector["parent.group"] = this.parentGroup;
- }
- var effects = Effects.find(selector).fetch();
- return _.sortBy(effects, effect => statOrder[effect.stat] || 999);
- }
-});
-
-Template.effectsEditList.events({
- "tap #addEffectButton": function(event, instance){
- if (!_.isBoolean(this.enabled)) {
- this.enabled = true;
- }
- const effectId = Effects.insert({
- name: this.name,
- charId: this.charId,
- parent: {
- id: this.parentId,
- collection: this.parentCollection,
- group: this.parentGroup,
- },
- operation: "add",
- enabled: this.enabled,
- });
- pushDialogStack({
- template: "effectEdit",
- data: {id: effectId},
- element: event.currentTarget,
- returnElement: () => instance.find(`tr.effect[data-id='${effectId}']`),
- });
- },
- "tap .edit-effect": function(event, template){
- pushDialogStack({
- template: "effectEdit",
- data: {id: this._id},
- element: event.currentTarget.parentElement.parentElement,
- });
- },
-});
diff --git a/app/client/views/character/effects/effectsViewList/effectsViewList.html b/app/client/views/character/effects/effectsViewList/effectsViewList.html
deleted file mode 100644
index 32c75c11..00000000
--- a/app/client/views/character/effects/effectsViewList/effectsViewList.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- {{#if effects.length}}
-
-
Effects
-
- {{#each effects}}
- {{>effectView}}
- {{/each}}
-
-
- {{/if}}
-
diff --git a/app/client/views/character/effects/effectsViewList/effectsViewList.js b/app/client/views/character/effects/effectsViewList/effectsViewList.js
deleted file mode 100644
index a50f07c5..00000000
--- a/app/client/views/character/effects/effectsViewList/effectsViewList.js
+++ /dev/null
@@ -1,15 +0,0 @@
-Template.effectsViewList.helpers({
- effects: function(){
- var selector = {
- "parent.id": this.parentId,
- "charId": this.charId,
- };
- if (this.parentGroup){
- selector["parent.group"] = this.parentGroup;
- }
- let effects = Effects.find(selector, {
- fields: {parent: 0},
- }).fetch();
- return _.sortBy(effects, effect => statOrder[effect.stat] || 999);
- }
-});
diff --git a/app/client/views/character/export/exportDialog/exportDialog.css b/app/client/views/character/export/exportDialog/exportDialog.css
deleted file mode 100644
index 5a701686..00000000
--- a/app/client/views/character/export/exportDialog/exportDialog.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.exportDialog .iiexport {
- overflow-y: auto;
- width: 100% !important;
-}
diff --git a/app/client/views/character/export/exportDialog/exportDialog.html b/app/client/views/character/export/exportDialog/exportDialog.html
deleted file mode 100644
index 78ba88a9..00000000
--- a/app/client/views/character/export/exportDialog/exportDialog.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
- {{#with character}}
-
-
- Export Character to Improved Initiative
-
-
-
-
- {{/with}}
-
-
diff --git a/app/client/views/character/export/exportDialog/exportDialog.js b/app/client/views/character/export/exportDialog/exportDialog.js
deleted file mode 100644
index cd3b4ffb..00000000
--- a/app/client/views/character/export/exportDialog/exportDialog.js
+++ /dev/null
@@ -1,60 +0,0 @@
-Template.exportDialog.helpers({
- character: function(){
- return Characters.findOne(this._id);
- },
- improvedInitiativeJson: function(){
- var options = {
- features: this.settings.exportFeatures,
- attacks: this.settings.exportAttacks,
- description: this.settings.exportDescription,
- }
- return improvedInitiativeJson(this._id, options);
- },
-});
-
-Template.exportDialog.events({
- "change #exportFeatures": function(event, template){
- Characters.update(this._id, {$set: {
- "settings.exportFeatures": event.target.checked,
- }});
- },
- "change #exportAttacks": function(event, template){
- Characters.update(this._id, {$set: {
- "settings.exportAttacks": event.target.checked,
- }});
- },
- "change #exportDescription": function(event, template){
- Characters.update(this._id, {$set: {
- "settings.exportDescription": event.target.checked,
- }});
- },
- "click #copyExportButton": function(event, template){
- var copyTextarea = template.find(".iiexport");
- copyTextarea.select();
- var msg;
- try {
- var successful = document.execCommand("copy");
- var msg = successful ? "JSON copied to clipboard" : "Unable to copy JSON";
- } catch (err) {
- msg = "Unable to copy JSON";
- } finally {
- clearSelection();
- GlobalUI.toast(msg);
- }
- },
- "click .doneButton": function(event, instance){
- popDialogStack();
- },
-});
-
-var clearSelection = function(){
- if (window.getSelection) {
- if (window.getSelection().empty) { // Chrome
- window.getSelection().empty();
- } else if (window.getSelection().removeAllRanges) { // Firefox
- window.getSelection().removeAllRanges();
- }
- } else if (document.selection) { // IE?
- document.selection.empty();
- }
-};
diff --git a/app/client/views/character/features/featureDialog/featureDialog.html b/app/client/views/character/features/featureDialog/featureDialog.html
deleted file mode 100644
index 187e2216..00000000
--- a/app/client/views/character/features/featureDialog/featureDialog.html
+++ /dev/null
@@ -1,95 +0,0 @@
-
- {{#with feature}}
- {{#baseDialog title=name class=colorClass startEditing=../startEditing}}
- {{> featureDetails}}
- {{else}}
- {{> featureEdit}}
- {{/baseDialog}}
- {{/with}}
-
-
-
- {{#if or canEnable hasUses}}
-
- {{#if canEnable}}
-
enabled
- {{/if}}
- {{#if hasUses}}
-
- Uses: {{usesLeft}}/{{usesValue}}
-
- {{/if}}
- {{#if hasUses}}
-
- {{/if}}
-
-
-
- {{/if}}
-
- {{#if description}}
- {{#markdown}}{{evaluateString charId description}}{{/markdown}}
- {{/if}}
-
- {{> effectsViewList charId=charId parentId=_id}}
- {{> proficiencyViewList charId=charId parentId=_id}}
- {{> attacksViewList charId=charId parentId=_id}}
- {{> customBuffViewList charId=charId parentId=_id}}
-
-
-
-
- {{#if showNewUserExperience}}
- {{# infoBox}}
-
- Features represent all the permanent things your character can do.
-
- A feature can change a character's stats with effects,
- or give the character proficiencies, attacks, and buffs.
-
- Give the feature a name, and close it to continue.
-
- {{/infoBox}}
- {{/if}}
-
-
-
-
-
-
- Always Enabled
-
-
- Enabled
-
-
- Disabled
-
-
-
-
- Limit uses
-
- {{#if usesSet}}
-
- {{> formulaSuffix}}
-
- {{else}}
-
- {{/if}}
-
-
-
-
-
- {{> effectsEditList parentId=_id parentCollection="Features" charId=charId name=name enabled=enabled}}
- {{> proficiencyEditList parentId=_id parentCollection="Features" charId=charId enabled=enabled}}
- {{> attackEditList parentId=_id parentCollection="Features" charId=charId enabled=enabled name=name}}
- {{> customBuffEditList parentId=_id parentCollection="Features" charId=charId}}
-
diff --git a/app/client/views/character/features/featureDialog/featureDialog.js b/app/client/views/character/features/featureDialog/featureDialog.js
deleted file mode 100644
index ed94038b..00000000
--- a/app/client/views/character/features/featureDialog/featureDialog.js
+++ /dev/null
@@ -1,137 +0,0 @@
-Template.featureDialog.helpers({
- feature: function(){
- return Features.findOne(this.featureId);
- },
-});
-
-Template.featureDialog.events({
- "color-change": function(event, instance){
- Features.update(instance.data.featureId, {$set: {color: event.color}});
- },
- "tap #deleteButton": function(event, instance){
- Features.softRemoveNode(instance.data.featureId);
- GlobalUI.deletedToast(instance.data.featureId, "Features", "Feature");
- popDialogStack();
- },
-});
-
-Template.featureDetails.helpers({
- or: function(a, b){
- return a || b;
- },
- hasUses: function(){
- return this.usesValue() > 0;
- },
- noUsesLeft: function(){
- return this.usesLeft() <= 0;
- },
- usesFull: function(){
- return this.usesLeft() >= this.usesValue();
- },
-});
-
-Template.featureDetails.events({
- "click .useFeature": function(event){
- var featureId = this._id;
- Features.update(featureId, {$inc: {used: 1}});
- },
- "click .resetFeature": function(event){
- var featureId = this._id;
- Features.update(featureId, {$set: {used: 0}});
- },
-
- "change .enabledCheckbox": function(event){
- var enabled = !this.enabled;
- Features.update(this._id, {$set: {enabled: enabled}});
- },
-});
-
-Template.featureEdit.helpers({
- showNewUserExperience: function(){
- return Session.get("newUserExperienceStep") === 0 ||
- Session.get("newUserExperienceStep") === 1;
- },
- usesSet: function(){
- return _.isString(this.uses);
- },
- enabledSelection: function(){
- if (this.enabled){
- if (this.alwaysEnabled){
- return "alwaysEnabled";
- } else {
- return "enabled";
- }
- } else if (this.enabled === false){ //make sure it is false, not just falsey
- return "disabled";
- }
- },
-});
-
-const debounce = (f) => _.debounce(f, 300);
-
-Template.featureEdit.events({
- "input #featureNameInput": debounce(function(event){
- const input = event.currentTarget;
- var name = input.value;
- if (!name){
- input.invalid = true;
- input.errorMessage = "Name is required";
- } else {
- input.invalid = false;
- Features.update(this._id, {
- $set: {name: name}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }
- }),
- "input #featureDescriptionInput": debounce(function(event){
- var description = event.currentTarget.value;
- Features.update(this._id, {
- $set: {description: description}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "change #limitUseCheck": debounce(function(event){
- var currentUses = this.uses;
- var featureId = this._id;
- if (event.target.checked && !_.isString(currentUses)){
- Features.update(featureId, {
- $set: {uses: ""}
- }, {
- removeEmptyStrings: false
- });
- } else if (!event.target.checked && _.isString(currentUses)){
- Features.update(featureId, {
- $unset: {uses: ""}
- });
- }
- }),
- "input #usesInput, input #quantityInput": debounce(function(event){
- var value = event.currentTarget.value;
- var featureId = this._id;
- Features.update(featureId, {
- $set: {uses: value}
- }, {
- removeEmptyStrings: false,
- });
- }),
- "iron-select .enabled-dropdown": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- var setter;
- if (value === "enabled"){
- setter = {enabled: true, alwaysEnabled: false};
- } else if (value === "disabled"){
- setter = {enabled: false, alwaysEnabled: false};
- } else {
- setter = {enabled: true, alwaysEnabled: true};
- }
- if (setter.enabled === this.enabled &&
- setter.alwaysEnabled === this.alwaysEnabled) return;
- Features.update(this._id, {$set: setter});
- },
-});
diff --git a/app/client/views/character/features/features.css b/app/client/views/character/features/features.css
deleted file mode 100644
index 520f9e55..00000000
--- a/app/client/views/character/features/features.css
+++ /dev/null
@@ -1,53 +0,0 @@
-.containerTop {
- cursor: pointer;
-}
-
-.featureCardTop {
- margin-bottom: 8px;
-}
-
-.card.featureCard .bottom {
- padding-bottom: 8px;
-}
-
-.containerMain.featureDescription {
- white-space: pre-line;
-}
-
-.resourceCards paper-material.healthCard {
- width: 100%;
-}
-
-/*To change the ink color for checked state:*/
-.containerTop paper-checkbox::shadow #ink[checked] {
- color: #ffffff;
-}
-
-/*To change the checkbox checked color:*/
-.containerTop paper-checkbox::shadow #checkbox.checked {
- background-color: #ffffff;
- background-color: rgba(255,255,255,0.27);
- border-color: #ffffff;
- border-color: rgba(255,255,255,0.27);
-}
-
-/*ensure the checkmark is shown when ticked*/
-.containerTop paper-checkbox::shadow #checkbox.checked #checkmark {
- display: initial;
-}
-
-/*To change the ink color for unchecked state:*/
-.containerTop paper-checkbox::shadow #ink {
- color: #ffffff;
-}
-
-/*To change the checkbox unchecked color:*/
-.containerTop paper-checkbox::shadow #checkbox {
- border-color: #ffffff;
- border-color: rgba(255,255,255,0.54);
-}
-
-/*ensure checkmark isn't shown early*/
-.containerTop paper-checkbox::shadow #checkbox #checkmark {
- display: none;
-}
diff --git a/app/client/views/character/features/features.html b/app/client/views/character/features/features.html
deleted file mode 100644
index 0b3e120a..00000000
--- a/app/client/views/character/features/features.html
+++ /dev/null
@@ -1,171 +0,0 @@
-
-
-
-
- {{>resource name="expertiseDice" title="Expertise Dice" color="teal" char=this}}
-
- {{>resource name="ki" title="Ki Points" color="teal" char=this}}
-
- {{>resource name="rages" title="Rages" color="teal" char=this}}
-
- {{>resource name="sorceryPoints" title="Sorcery Points" color="teal" char=this}}
-
- {{>resource name="superiorityDice" title="Superiority Dice" color="teal" char=this}}
-
-
-
-
-
- Attacks
-
-
- {{#each attack in attacks}}
- {{>attackListItem attack=attack charId=_id}}
- {{/each}}
-
-
-
-
-
-
-
-
- Proficiencies
-
-
- {{#if weaponProfs.length}}
-
Weapons
- {{/if}}
- {{#each weaponProfs}}
- {{> proficiencyListItem}}
- {{/each}}
- {{#if armorProfs.length}}
-
Armor
- {{/if}}
- {{#each armorProfs}}
- {{> proficiencyListItem}}
- {{/each}}
- {{#if toolProfs.length}}
-
Tools
- {{/if}}
- {{#each toolProfs}}
- {{> proficiencyListItem}}
- {{/each}}
-
-
-
-
-
- {{#each features}}
-
-
-
-
- {{name}}
-
- {{#if hasUses}}
-
- {{usesLeft}}/{{usesValue}}
-
- {{/if}}
- {{#if canEnable}}
-
-
-
- {{#simpleTooltip}}Feature enabled{{/simpleTooltip}}
-
- {{/if}}
-
- {{#if hasCharacters (evaluateShortString charId description)}}
-
- {{#markdown}}{{evaluateShortString charId description}}{{/markdown}}
- {{> customBuffViewList charId=charId parentId=_id}}
-
- {{/if}}
- {{#if hasUses}}
-
- {{/if}}
-
-
- {{/each}}
-
- {{#if canEditCharacter _id}}
-
- {{/if}}
-
-
-
-
- {{#if characterCalculate "attributeBase" char._id name}}
-
-
-
-
-
{{characterCalculate "attributeValue" char._id name}}
-
-
-
- {{title}}
-
-
-
-
- {{/if}}
-
-
-
-
-
-
-
- {{evaluateAttackBonus charId attack}}
-
-
-
- {{attack.name}}
-
-
- {{evaluateDamage charId attack}} {{attack.damageType}}
-
- {{#if attack.details}}
-
- {{attack.details}}
-
- {{/if}}
-
-
-
-
-
diff --git a/app/client/views/character/features/features.js b/app/client/views/character/features/features.js
deleted file mode 100644
index 3b997c67..00000000
--- a/app/client/views/character/features/features.js
+++ /dev/null
@@ -1,188 +0,0 @@
-Template.features.helpers({
- features: function(){
- var features = Features.find({charId: this._id}, {sort: {color: 1, name: 1}});
- return features;
- },
- hasUses: function(){
- return this.usesValue() > 0;
- },
- noUsesLeft: function(){
- return this.usesLeft() <= 0 || !canEditCharacter(this.charId);
- },
- usesFull: function(){
- return this.usesLeft() >= this.usesValue() || !canEditCharacter(this.charId);
- },
- colorClass: function(){
- return getColorClass(this.color);
- },
- featureOrder: function(){
- return _.indexOf(_.keys(colorOptions), this.color);
- },
- attacks: function(){
- return Attacks.find(
- {charId: this._id, enabled: true},
- {sort: {color: 1, name: 1}});
- },
- canEnable: function(){
- return !this.alwaysEnabled;
- },
- weaponProfs: function(){
- var profs = Proficiencies.find({charId: this._id, type: "weapon"});
- return removeDuplicateProficiencies(profs);
- },
- armorProfs: function(){
- var profs = Proficiencies.find({charId: this._id, type: "armor"});
- return removeDuplicateProficiencies(profs);
- },
- toolProfs: function(){
- var profs = Proficiencies.find({charId: this._id, type: "tool"});
- return removeDuplicateProficiencies(profs);
- },
- hasCharacters: function(string){
- return string && string.match(/\S/);
- },
- shouldFloatyButtonBounce: function(){
- const step = Session.get("newUserExperienceStep");
- return step === 0 && Features.find({charId: this._id}).count() <= 1;
- },
-});
-
-Template.features.events({
- "click #addFeature": function(event, instance){
- var featureId = Features.insert({
- name: "New Feature",
- charId: this._id,
- enabled: true,
- alwaysEnabled: true,
- });
- pushDialogStack({
- template: "featureDialog",
- data: {featureId: featureId, charId: this._id, startEditing: true},
- element: event.currentTarget,
- returnElement: () => instance.find(`.featureCard[data-id='${featureId}']`),
- });
- },
- "click .featureCard .top": function(event){
- var featureId = this._id;
- var charId = Template.parentData()._id;
- pushDialogStack({
- template: "featureDialog",
- data: {featureId: featureId, charId: charId},
- element: event.currentTarget.parentElement,
- });
- },
- "click .useFeature": function(event){
- var featureId = this._id;
- Features.update(featureId, {$inc: {used: 1}});
- },
- "click .resetFeature": function(event){
- var featureId = this._id;
- Features.update(featureId, {$set: {used: 0}});
- },
- "click .enabledCheckbox": function(event){
- event.stopPropagation();
- },
- "change .enabledCheckbox": function(event){
- var enabled = !this.enabled;
- Features.update(this._id, {$set: {enabled: enabled}});
- },
-});
-
-Template.resource.helpers({
- cantIncrement: function(){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- var base = Characters.calculate.attributeBase(this.char._id, this.name);
- var baseBigger = value < base;
- return !baseBigger || !canEditCharacter(this.char._id);
- },
- cantDecrement: function(){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- var valuePositive = value > 0;
- return !valuePositive || !canEditCharacter(this.char._id);
- },
- getColor: function(){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- if (value > 0){
- return this.color;
- } else {
- return "grey";
- }
- },
-});
-
-Template.resource.events({
- "click .resourceResetMax": function(event){
- var modifier = {$set: {}};
- modifier.$set[this.name + ".adjustment"] = 0;
- Characters.update(this.char._id, modifier, {validate: false});
- },
- "click .resourceResetZero": function(event){
- var base = Characters.calculate.attributeBase(this.char._id, this.name);
- var modifier = {$set: {}};
- modifier.$set[this.name + ".adjustment"] = -base;
- Characters.update(this.char._id, modifier, {validate: false});
- },
- "click .resourceUp": function(event){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- var base = Characters.calculate.attributeBase(this.char._id, this.name);
- if (value < base){
- var modifier = {$inc: {}};
- modifier.$inc[this.name + ".adjustment"] = 1;
- Characters.update(this.char._id, modifier, {validate: false});
- }
- },
- "click .resourceDown": function(event){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- if (value > 0){
- var modifier = {$inc: {}};
- modifier.$inc[this.name + ".adjustment"] = -1;
- Characters.update(this.char._id, modifier, {validate: false});
- }
- },
- "click .right": function(event, instance) {
- pushDialogStack({
- template: "attributeDialog",
- data: {name: this.title, statName: this.name, charId: this.char._id},
- element: event.currentTarget.parentElement,
- });
- },
-});
-
-Template.attackListItem.helpers({
- evaluateAttackBonus: function(charId, attack) {
- if (attack.parent.collection == "Spells") {
- var spell = Spells.findOne(attack.parent.id);
- if (spell) {
- bonus = evaluate(charId, attack.attackBonus, {"spellListId": spell.parent.id});
- }
- } else {
- var bonus = evaluate(charId, attack.attackBonus);
- }
-
- if (_.isFinite(bonus)) {
- return bonus > 0 ? "+" + bonus : "" + bonus;
- } else {
- return bonus;
- }
- },
- evaluateDamage: function(charId, attack) {
- if (attack.parent.collection == "Spells") {
- var spell = Spells.findOne(attack.parent.id);
- if (spell) {
- return evaluateSpellString(charId, spell.parent.id, attack.damage);
- }
- } else {
- return evaluateString(charId, attack.damage);
- }
- },
-});
-
-Template.attackListItem.events({
- "click .attack": function(event, instance){
- openParentDialog({
- parent: instance.data.attack.parent,
- charId: instance.data.charId,
- element: event.currentTarget,
- });
- },
-});
diff --git a/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.css b/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.css
deleted file mode 100644
index 6a0ea04f..00000000
--- a/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.carryCapacityBar {
- background-color: #7DC580;
- background-color: rgba(255,255,255,0.27);
- position: relative;
- height: 4px;
-}
-
-.carryCapacityBar div{
- height: 100%;
- position: absolute;
-}
-.carryCapacityBar .tick {
- border-right: solid 2px #E5E5E5;
- border-right-color: rgba(255,255,255,0.54);
-}
diff --git a/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.html b/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.html
deleted file mode 100644
index 6e584305..00000000
--- a/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- {{#if overCarriedPercent}}
-
- {{/if}}
-
diff --git a/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.js b/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.js
deleted file mode 100644
index 99fdccc9..00000000
--- a/app/client/views/character/inventory/carryCapacityBar/carryCapacityBar.js
+++ /dev/null
@@ -1,67 +0,0 @@
-var getFractionCarried = function(char) {
- //find out the weight
- var weight = 0;
- Containers.find(
- {charId: char._id, isCarried: true}
- ).forEach(function(container){
- weight += container.totalWeight();
- });
- Items.find(
- {charId: char._id, "parent.id": char._id},
- {fields: {weight : 1, quantity: 1}}
- ).forEach(function(item){
- weight += item.totalWeight();
- });
- //get strength
- var strength = Characters.calculate.attributeValue(char._id, "strength");
- var carryMultiplier = Characters.calculate
- .attributeValue(char._id, "carryMultiplier");
- var capacity = strength * 15 * carryMultiplier;
- return weight / capacity;
-};
-
-Template.carryCapacityBar.onCreated(function() {
- var self = this;
- self.carriedFraction = new ReactiveVar(0);
- self.autorun(function() {
- self.carriedFraction.set(getFractionCarried(Template.currentData()));
- });
-});
-
-Template.carryCapacityBar.helpers({
- carriedPercent: function() {
- var percent = 100 * Template.instance().carriedFraction.get();
- return percent > 100 ? 100 : percent;
- },
- overCarriedPercent: function() {
- var percent = 100 * Template.instance().carriedFraction.get();
- var overPercent = percent - 100;
- if (overPercent < 0) return 0;
- if (overPercent > 100) return 100;
- return overPercent;
- },
- carriedColor: function() {
- var frac = Template.instance().carriedFraction.get();
- if (frac < 1 / 3){
- return "#2196F3";
- } else if (frac < 2 / 3){
- return "#CDDC39";
- } else if (frac < 1) {
- return "#FFC107";
- } else {
- return "#F44336";
- }
- },
- overCarriedColor: function() {
- var frac = Template.instance().carriedFraction.get();
- if (frac < 1 / 3){
- return "#2196F3";
- } else if (frac < 2 / 3){
- return "#CDDC39";
- } else if (frac < 1) {
- return "#FFC107";
- } else {
- return "#F44336";
- }
- },
-});
diff --git a/app/client/views/character/inventory/carryDialog/carryDialog.html b/app/client/views/character/inventory/carryDialog/carryDialog.html
deleted file mode 100644
index a8cabc7d..00000000
--- a/app/client/views/character/inventory/carryDialog/carryDialog.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
- {{#baseDialog title="Weight Carried" class=color hideEdit=true}}
-
-
- {{round carriedWeight 1}}
-
-
- lbs
-
-
-
-
-
- {{> carryCapacityTable}}
-
- {{/baseDialog}}
-
diff --git a/app/client/views/character/inventory/carryDialog/carryDialog.js b/app/client/views/character/inventory/carryDialog/carryDialog.js
deleted file mode 100644
index c4d4fd7a..00000000
--- a/app/client/views/character/inventory/carryDialog/carryDialog.js
+++ /dev/null
@@ -1,20 +0,0 @@
-Template.carryDialog.helpers({
- carriedWeight: function() {
- var weight = 0;
- Containers.find(
- {charId: this.charId, isCarried: true}
- ).forEach(function(container){
- weight += container.totalWeight();
- });
- Items.find(
- {charId: this.charId, "parent.id": this.charId},
- {fields: {weight : 1, quantity: 1}}
- ).forEach(function(item){
- weight += item.totalWeight();
- });
- return weight;
- },
- color: function() {
- if (this.color) return this.color + " white-text";
- },
-});
diff --git a/app/client/views/character/inventory/containerDialog/containerDialog.html b/app/client/views/character/inventory/containerDialog/containerDialog.html
deleted file mode 100644
index e11b1202..00000000
--- a/app/client/views/character/inventory/containerDialog/containerDialog.html
+++ /dev/null
@@ -1,45 +0,0 @@
-
- {{#with container}}
- {{#baseDialog title=name class=colorClass startEditing=../startEditing}}
- {{> containerView}}
- {{else}}
- {{> containerEdit}}
- {{/baseDialog}}
- {{/with}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- Container {{round weight}} lbs {{longValueString value}}
- Contents {{round contentsWeight}} lbs {{longValueString contentsValue}}
- Total {{round totalWeight}} lbs {{longValueString totalValue}}
-
-
- {{#if description}}
-
- {{#markdown}}{{evaluateString charId description}}{{/markdown}}
- {{/if}}
-
diff --git a/app/client/views/character/inventory/containerDialog/containerDialog.js b/app/client/views/character/inventory/containerDialog/containerDialog.js
deleted file mode 100644
index 288999c5..00000000
--- a/app/client/views/character/inventory/containerDialog/containerDialog.js
+++ /dev/null
@@ -1,61 +0,0 @@
-Template.containerDialog.helpers({
- container: function(){
- return Containers.findOne(this.containerId);
- }
-});
-
-Template.containerDialog.events({
- "color-change": function(event, instance){
- Containers.update(instance.data.containerId, {$set: {color: event.color}});
- },
- "tap #deleteButton": function(event, instance){
- Containers.softRemoveNode(instance.data.containerId);
- GlobalUI.deletedToast(
- instance.data.containerId,
- "Containers", "Container and contents"
- );
- popDialogStack();
- },
-});
-
-Template.containerEdit.events({
- //TODO validate input (integer, non-negative, etc) for these inputs and give validation errors
- "input #containerNameInput": function(event){
- var name = Template.instance().find("#containerNameInput").value;
- Containers.update(this._id, {
- $set: {name: name}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- },
- "change #weightInput, input #weightInput": function(event){
- var weight = +Template.instance().find("#weightInput").value;
- Containers.update(this._id, {
- $set: {weight: weight}
- }, {
- removeEmptyStrings: false,
- });
- },
- "change #valueInput, input #valueInput": function(event){
- var value = +Template.instance().find("#valueInput").value;
- Containers.update(this._id, {
- $set: {value: value}
- }, {
- removeEmptyStrings: false,
- });
- },
- "input #containerDescriptionInput": function(event, instance){
- var description = instance.find("#containerDescriptionInput").value;
- Containers.update(this._id, {
- $set: {description: description}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- },
- "change #carriedToggle": function(event, instance){
- var carried = !this.isCarried;
- Containers.update(this._id, {$set: {isCarried: carried}});
- }
-});
diff --git a/app/client/views/character/inventory/inventory.html b/app/client/views/character/inventory/inventory.html
deleted file mode 100644
index c135c6ec..00000000
--- a/app/client/views/character/inventory/inventory.html
+++ /dev/null
@@ -1,180 +0,0 @@
-
-
-
-
-
-
-
-
- Net Worth
-
-
- {{valueString netWorth}}
-
-
-
-
-
-
-
-
-
- Weight Carried
-
-
- {{round weightCarried}} lbs
-
-
-
- {{> carryCapacityBar}}
-
- {{#if encumberedConditions.count}}
-
- {{#each condition in encumberedConditions}}
-
-
-
-
-
- {{condition.name}}
-
-
-
- {{/each}}
-
- {{/if}}
-
-
-
-
-
-
-
- Equipment
-
-
- {{valueString equipmentValue}}
-
-
- {{round equipmentWeight}} lbs
-
-
-
- {{#if attuned.count}}
-
Attuned
- {{/if}}
- {{#each attuned}}
- {{>inventoryItem}}
- {{/each}}
- {{#if attuned.count}}
-
Equipment
- {{/if}}
- {{#each equipment}}
- {{>inventoryItem}}
- {{/each}}
-
-
-
-
-
-
-
-
- Carried
-
-
- {{valueString carriedValue}}
-
-
- {{round carriedWeight}} lbs
-
-
-
- {{#each carriedItems}}
- {{>inventoryItem}}
- {{/each}}
-
-
-
- {{#each containers}}
-
-
-
-
- {{name}}
-
-
- {{valueString totalValue}}
-
-
- {{round totalWeight}} lbs
-
-
-
-
- {{#simpleTooltip}} Container carried{{/simpleTooltip}}
-
-
-
- {{#each items ../_id _id}}
- {{>inventoryItem}}
- {{/each}}
-
-
-
- {{/each}}
-
-
-
- {{#if canEditCharacter _id}}
- {{#fabMenu}}
-
-
-
- {{#simpleTooltip class="always"}} Container {{/simpleTooltip}}
-
-
-
-
- {{#simpleTooltip class="always"}} Item from library {{/simpleTooltip}}
-
-
-
-
- {{#simpleTooltip class="always"}} Item {{/simpleTooltip}}
-
- {{/fabMenu}}
- {{/if}}
-
-
-
-
-
-
- {{#if ne1 quantity}}{{quantity}} {{/if}}{{pluralName}}
-
- {{#if settings.showIncrement}}{{#if canEditCharacter charId}}
-
- {{/if}}{{/if}}
-
-
-
diff --git a/app/client/views/character/inventory/inventory.js b/app/client/views/character/inventory/inventory.js
deleted file mode 100644
index 4234ecff..00000000
--- a/app/client/views/character/inventory/inventory.js
+++ /dev/null
@@ -1,353 +0,0 @@
-Template.inventory.created = function(){
- this.showAddButtons = new ReactiveVar(false);
-};
-
-Template.inventory.helpers({
- containers: function(){
- return Containers.find({charId: this._id}, {sort: {color: 1, name: 1}});
- },
- items: function(charId, containerId){
- return Items.find(
- {charId: charId, "parent.id": containerId},
- {sort: {color: 1, name: 1}}
- );
- },
- attuned: function(){
- return Items.find(
- {charId: this._id, enabled: true, requiresAttunement: true},
- {sort: {color: 1, name: 1}}
- );
- },
- equipment: function(){
- return Items.find(
- {charId: this._id, enabled: true, requiresAttunement: false},
- {sort: {color: 1, name: 1}}
- );
- },
- carriedItems: function(){
- return Items.find(
- {charId: this._id, enabled: false, "parent.id": this._id},
- {sort: {color: 1, name: 1}}
- );
- },
- showAddButtons: function(){
- return Template.instance().showAddButtons.get();
- },
- colorClass: function(){
- return getColorClass(this.color);
- },
- netWorth: function(){
- var worth = 0;
- Items.find(
- {charId: this._id},
- {fields: {value : 1, quantity: 1}}
- ).forEach(function(item){
- worth += item.totalValue();
- });
- Containers.find(
- {charId: this._id},
- {fields: {value : 1}}
- ).forEach(function(container) {
- if (container.value) worth += container.value;
- });
- return worth;
- },
- weightCarried: function(){
- var weight = 0;
- Containers.find(
- {charId: this._id, isCarried: true}
- ).forEach(function(container){
- weight += container.totalWeight();
- });
- Items.find(
- {charId: this._id, "parent.id": this._id},
- {fields: {weight : 1, quantity: 1}}
- ).forEach(function(item){
- weight += item.totalWeight();
- });
- return weight;
- },
- encumberedBuffs: function(){
- return Conditions.find({
- charId: this._id,
- name: {$in: [
- "Encumbered",
- "Heavily encumbered",
- "Over encumbered",
- "Can't move load",
- ]},
- });
- },
- equipmentValue: function(){
- var value = 0;
- Items.find(
- {charId: this._id, enabled: true},
- {fields: {value : 1, quantity: 1}}
- ).forEach(function(item){
- value += item.totalValue();
- });
- return value;
- },
- equipmentWeight: function(){
- var weight = 0;
- Items.find({
- charId: this._id, enabled: true,
- }, {
- fields: {weight : 1, quantity: 1}
- }).forEach(function(item){
- weight += item.totalWeight();
- });
- return weight;
- },
- carriedValue: function(){
- var value = 0;
- Items.find(
- {charId: this._id, enabled: false, "parent.id": this._id},
- {fields: {value : 1, quantity: 1}}
- ).forEach(function(item){
- value += item.totalValue();
- });
- return value;
- },
- carriedWeight: function(){
- var weight = 0;
- Items.find(
- {charId: this._id, enabled: false, "parent.id": this._id},
- {fields: {weight : 1, quantity: 1}}
- ).forEach(function(item){
- weight += item.totalWeight();
- });
- return weight;
- },
-});
-
-Template.inventory.events({
- "click .addItem": function(event, instance){
- var charId = this._id;
- var itemId = Items.insert({
- charId: charId,
- parent:{
- id: charId,
- collection: "Characters",
- },
- });
- pushDialogStack({
- template: "itemDialog",
- data: {itemId: itemId, charId: charId, startEditing: true},
- element: event.currentTarget,
- returnElement: () => $(`[data-id='${itemId}']`).get(0),
- });
- },
- "click .libraryItem": function(event, instance){
- var charId = this._id;
- var itemId = Items.insert({
- charId: charId,
- parent:{
- id: charId,
- collection: "Characters",
- },
- });
- pushDialogStack({
- template: "itemLibraryDialog",
- element: event.currentTarget,
- callback: (result) => {
- if (!result) {
- Items.remove(itemId);
- return;
- }
- // Make the library item into a regular item
- let item = _.omit(result, "libraryName", "library", "attacks", "effects");
- delete item.settings.category;
- // Update the item to match library item
- Items.update(itemId, {$set: item});
- // Copy over attacks and effects
- _.each(result.attacks, (attack) => {
- attack.charId = charId;
- attack.parent = {id: itemId, collection: "Items"};
- Attacks.insert(attack);
- });
- _.each(result.effects, (effect) => {
- effect.charId = charId;
- effect.parent = {id: itemId, collection: "Items"};
- Effects.insert(effect);
- });
- },
- returnElement: () => $(`[data-id='${itemId}']`).get(0),
- })
- },
- "click .addContainer": function(event, instance){
- var containerId = Containers.insert({
- name: "New Container",
- isCarried: true,
- charId: this._id,
- });
- pushDialogStack({
- template: "containerDialog",
- data: {
- containerId: containerId,
- charId: this.charId,
- startEditing: true,
- },
- element: event.currentTarget,
- returnElement: instance.find(`.itemContainer[data-id='${containerId}']`),
- });
- },
- "click .weightCarried": function(event, instance) {
- var charId = this._id;
- pushDialogStack({
- template: "carryDialog",
- data: {charId: charId, color: "green"},
- element: event.currentTarget.parentElement,
- });
- },
- "click .condition": function(event, instance){
- pushDialogStack({
- template: "conditionViewDialogDialog",
- data: {condition: this.condition},
- element: event.currentTarget,
- });
- },
- "click .inventoryItem": function(event, instance){
- var itemId = this._id;
- var charId = Template.parentData()._id;
- pushDialogStack({
- template: "itemDialog",
- data: {itemId: itemId, charId: charId},
- element: event.currentTarget,
- returnElement: () => $(`[data-id='${itemId}']`).get(0),
- });
- },
- "click .incrementButtons": function(event, instance) {
- event.stopPropagation();
- },
- "click .addItemQuantity": function(event, instance) {
- var itemId = this._id;
- Items.update(itemId, {$set: {quantity: this.quantity + 1}});
- },
- "click .subItemQuantity": function(event, instance) {
- var itemId = this._id;
- Items.update(itemId, {$set: {quantity: this.quantity - 1}});
- },
- "click .itemContainer .top": function(event, instance){
- pushDialogStack({
- template: "containerDialog",
- data: {containerId: this._id, charId: this.charId},
- element: event.currentTarget.parentElement,
- });
- },
- "click .carriedCheckbox": function(event, instance){
- event.stopPropagation();
- },
- "change .carriedCheckbox": function(event, instance){
- var carried;
- if (this.isCarried) carried = false;
- else carried = true;
- Containers.update(this._id, {$set: {isCarried: carried}});
- },
-});
-
-Template.inventoryItem.helpers({
- ne1: function(num){
- return num !== 1;
- },
- lt1: function(num) {
- return num < 1;
- },
- hidden: function(){
- return Session.equals("inventory.dragItemId", this._id) ? "hidden" : null;
- },
-});
-
-Template.layout.events({
- "dragstart .inventoryItem": function(event, instance){
- event.originalEvent.dataTransfer.setData("dicecloud-id/items", this._id);
- Session.set("inventory.dragItemId", this._id);
- },
- "dragover .itemContainer, dragenter .itemContainer":
- function(event, instance){
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/items")){
- event.preventDefault();
- }
- },
- "dragover .equipmentContainer, dragenter .equipmentContainer":
- function(event, instance){
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/items")){
- event.preventDefault();
- }
- },
- "dragover .carriedContainer, dragenter .carriedContainer":
- function(event, instance){
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/items")){
- event.preventDefault();
- }
- },
- "dragover .characterRepresentative, dragenter .characterRepresentative":
- function(event, instance){
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/items")){
- event.preventDefault();
- }
- },
- "dragend .inventoryItem": function(event, instance){
- Session.set("inventory.dragItemId", null);
- },
- "drop .itemContainer": function(event, instance){
- var itemId = event.originalEvent.dataTransfer.getData("dicecloud-id/items");
- if (event.ctrlKey){
- //split the stack to the container
- pushDialogStack({
- template: "splitStackDialog",
- data: {
- id: itemId,
- parentCollection: "Containers",
- parentId: this._id,
- },
- });
- } else {
- //move item to the container
- Meteor.call("moveItemToContainer", itemId, this._id);
- }
- Session.set("inventory.dragItemId", null);
- },
- "drop .equipmentContainer": function(event, instance){
- var itemId = event.originalEvent.dataTransfer.getData("dicecloud-id/items");
- Meteor.call("equipItem", itemId, this._id);
- Session.set("inventory.dragItemId", null);
- },
- "drop .carriedContainer": function(event, instance){
- var itemId = event.originalEvent.dataTransfer.getData("dicecloud-id/items");
- if (event.ctrlKey){
- //split the stack to the container
- pushDialogStack({
- template: "splitStackDialog",
- data: {
- id: itemId,
- parentCollection: "Characters",
- },
- });
- } else {
- //move item to the character
- Meteor.call("moveItemToCharacter", itemId, this._id);
- }
- Session.set("inventory.dragItemId", null);
- },
- "drop .characterRepresentative": function(event, instance) {
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/items")){
- var itemId = event.originalEvent.dataTransfer.getData("dicecloud-id/items");
- if (event.ctrlKey){
- //split the stack to the container
- pushDialogStack({
- template: "splitStackDialog",
- data: {
- id: itemId,
- parentCollection: "Characters",
- parentId: this._id,
- },
- });
- } else {
- //move item to the character
- Meteor.call("moveItemToCharacter", itemId, this._id);
- }
- Session.set("inventory.dragItemId", null);
- }
- },
-});
diff --git a/app/client/views/character/inventory/itemDialog/itemDialog.css b/app/client/views/character/inventory/itemDialog/itemDialog.css
deleted file mode 100644
index ef3dda4d..00000000
--- a/app/client/views/character/inventory/itemDialog/itemDialog.css
+++ /dev/null
@@ -1,3 +0,0 @@
-body /deep/ .itemDialogWidth {
- width: 560px;
-}
diff --git a/app/client/views/character/inventory/itemDialog/itemDialog.html b/app/client/views/character/inventory/itemDialog/itemDialog.html
deleted file mode 100644
index 50d5f614..00000000
--- a/app/client/views/character/inventory/itemDialog/itemDialog.html
+++ /dev/null
@@ -1,86 +0,0 @@
-
- {{#with item}}
- {{#baseDialog title=itemHeading class=colorClass startEditing=../startEditing}}
- {{> itemDetails}}
- {{else}}
- {{> itemEdit}}
- {{/baseDialog}}
- {{/with}}
-
-
-
-
- {{#if weight}}
{{round totalWeight}} lbs
{{/if}}
- {{#if value}}
{{valueString totalValue}}
{{/if}}
-
-
- {{#if enabled}}
Equipped
{{/if}}
- {{#if requiresAttunement}}
Requires Attunement
{{/if}}
-
- {{#if description}}
-
- {{#markdown}}{{evaluateString charId description}}{{/markdown}}
- {{/if}}
- {{> effectsViewList charId=charId parentId=_id}}
- {{> attacksViewList charId=charId parentId=_id}}
- {{> customBuffViewList charId=charId parentId=_id}}
-
-
-
-
-
-
-
- {{# if ne1 quantity}}
-
-
- {{else}}
-
-
- {{/if}}
-
- Show increment buttons
-
-
-
-
- {{> containerDropdown}}
-
- Equipped
-
-
- Requires Attunement
-
-
-
-
-
-
-
-
-
- {{> effectsEditList parentId=_id parentCollection="Items" charId=charId enabled=equipped name=name}}
-
- {{> attackEditList parentId=_id parentCollection="Items" charId=charId enabled=equipped name=name}}
-
- {{> customBuffEditList parentId=_id parentCollection="Items" charId=charId}}
-
-
-
-
-
- {{#each containers}}
-
- {{/each}}
-
-
-
diff --git a/app/client/views/character/inventory/itemDialog/itemDialog.js b/app/client/views/character/inventory/itemDialog/itemDialog.js
deleted file mode 100644
index 28955459..00000000
--- a/app/client/views/character/inventory/itemDialog/itemDialog.js
+++ /dev/null
@@ -1,147 +0,0 @@
-var getContainers = function(charId){
- return Containers.find(
- {charId: charId},
- {sort: {name: 1, _id: 1}, fields: {name: 1}}
- );
-};
-
-Template.itemDialog.onCreated(function(){
- this.editing = new ReactiveVar(!!this.data.startEditing);
-});
-
-Template.itemDialog.helpers({
- item: function(){
- return Items.findOne(this.itemId);
- },
- editing: function(){
- return Template.instance().editing.get();
- },
- itemHeading: function(){
- if (this.quantity === 1){
- return this.name;
- } else {
- var pName = this.plural || this.name;
- return this.quantity + " " + pName;
- }
- },
-});
-
-Template.itemDialog.events({
- "click #editButton": function(event, instance){
- instance.editing.set(true);
- },
- "click #doneEditingButton": function(event, instance){
- instance.editing.set(false);
- },
- "color-change": function(event, instance){
- Items.update(instance.data.itemId, {$set: {color: event.color}});
- },
- "click #deleteButton": function(event, instance){
- Items.softRemoveNode(instance.data.itemId);
- GlobalUI.deletedToast(instance.data.itemId, "Items", "Item");
- popDialogStack();
- },
-});
-
-Template.itemEdit.helpers({
- ne1: function(num){
- return num != 1;
- },
-});
-
-const debounce = (f) => _.debounce(f, 200);
-
-Template.itemEdit.events({
- //TODO validate input (integer, non-negative, etc) for these inputs and give validation errors
- "input #itemNameInput": debounce(function(event, instance){
- const input = event.currentTarget;
- var name = input.value;
- if (!name){
- input.invalid = true;
- input.errorMessage = "Name is required";
- } else {
- input.invalid = false;
- Items.update(this._id, {
- $set: {name: name}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }
- }),
- "input #itemPluralInput": debounce(function(event, instance){
- var plural = event.currentTarget.value;
- Items.update(this._id, {
- $set: {plural: plural}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #quantityInput": debounce(function(event, instance){
- var quantity = +event.currentTarget.value;
- Items.update(this._id, {
- $set: {quantity: quantity}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #weightInput": debounce(function(event, instance){
- var weight = +event.currentTarget.value;
- Items.update(this._id, {
- $set: {weight: weight}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #valueInput": debounce(function(event, instance){
- var value = +event.currentTarget.value;
- Items.update(this._id, {
- $set: {value: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #itemDescriptionInput": debounce(function(event, instance){
- var description = event.currentTarget.value;
- Items.update(this._id, {
- $set: {description: description}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "change #equippedInput": function(event){
- var equipped = event.currentTarget.checked;
- if (equipped){
- Meteor.call("equipItem", this._id, this.charId);
- } else {
- Meteor.call("unequipItem", this._id, this.charId);
- }
- },
- "change #incrementCheckbox": function(event){
- var value = event.currentTarget.checked;
- Items.update(this._id, {$set: {"settings.showIncrement": value}});
- },
- "change #attunementCheckbox": function(event){
- var value = event.currentTarget.checked;
- Items.update(this._id, {$set: {requiresAttunement: value}});
- },
-});
-
-Template.containerDropdown.helpers({
- containers: function(){
- return getContainers(this.charId);
- }
-});
-
-Template.containerDropdown.events({
- "iron-select #containerDropDown": function(event){
- var detail = event.originalEvent.detail;
- var containerId = detail.item.getAttribute("name");
- Meteor.call("moveItemToContainer", Template.currentData()._id, containerId);
- }
-});
diff --git a/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.css b/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.css
deleted file mode 100644
index 5c8d14a9..00000000
--- a/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.css
+++ /dev/null
@@ -1,23 +0,0 @@
-.item-library-dialog .item.selected {
- background-color: #e4e4e4;
-}
-
-.item-library-dialog .category-header {
- font-size: 16px;
-}
-
-.item-library-dialog .category-header iron-icon {
- transition: transform 0.3s ease;
-}
-
-.item-library-dialog .category-header iron-icon.open {
- transform: rotate(90deg);
-}
-
-.item-library-dialog table {
- border-collapse: collapse;
-}
-
-.item-library-dialog .library-item td {
- position: relative;
-}
diff --git a/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.html b/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.html
deleted file mode 100644
index 1dcb352e..00000000
--- a/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.html
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
- Items
-
-
-
-
-
-
-
-
-
-
-
-
- {{itemName}}
-
-
-
- {{itemWeight}} lb.
-
-
-
- {{valueString itemValue}}
-
-
-
-
diff --git a/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.js b/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.js
deleted file mode 100644
index 7ca93920..00000000
--- a/app/client/views/character/inventory/itemLibraryDialog/itemLibraryDialog.js
+++ /dev/null
@@ -1,130 +0,0 @@
-const librarySubs = new SubsManager();
-
-const categories = [
- {name: "Weapons", key: "weapons"},
- {name: "Armor", key: "armor"},
- {name: "Adventuring Gear", key: "adventuringGear"},
- {name: "Tools", key: "tools"},
-];
-
-Template.itemLibraryDialog.onCreated(function(){
- this.selectedItem = new ReactiveVar();
- this.searchTerm = new ReactiveVar();
- this.categoriesOpen = new ReactiveVar([]);
- this.readyDict = new ReactiveDict();
- this.searchReady = new ReactiveVar();
- librarySubs.subscribe("standardLibraries");
- this.autorun(() => {
- // Subscribe to all open categories
- _.each(this.categoriesOpen.get(), (key) => {
- var handle = librarySubs.subscribe("standardLibraryItems", key);
- this.autorun(() => {
- this.readyDict.set(key, handle.ready());
- });
- });
- });
- this.autorun(() => {
- // If we are searching, subscibe to all categories
- if (this.searchTerm.get()){
- let handles = _.map(categories, category =>
- librarySubs.subscribe("standardLibraryItems", category.key)
- );
- // Ready when all handles are ready
- this.autorun(() => {
- this.searchReady.set(_.every(handles, h => h.ready()));
- });
- }
- });
-});
-
-Template.itemLibraryDialog.helpers({
- ready(key){
- return Template.instance().readyDict.get(key);
- },
- categories(){
- return categories;
- },
- itemsInCategory(categoryKey){
- return LibraryItems.find({
- library: "SRDLibraryGA3XWsd",
- "settings.category": categoryKey,
- }, {
- sort: {name: 1},
- });
- },
- isSelected(item){
- const selected = Template.instance().selectedItem.get();
- return selected && selected._id === item._id;
- },
- isOpen(key){
- const cats = Template.instance().categoriesOpen.get();
- return _.contains(cats, key);
- },
- searchTerm(){
- return Template.instance().searchTerm.get();
- },
- searchReady(){
- return Template.instance().searchReady.get();
- },
- searchItems(){
- const searchTerm = Template.instance().searchTerm.get();
- if (!searchTerm) return;
- return LibraryItems.find({
- library: "SRDLibraryGA3XWsd",
- name: {
- $regex: new RegExp(".*" + searchTerm + ".*", "gi")
- },
- });
- },
-});
-
-Template.itemLibraryDialog.events({
- "click .cancelButton": function(event, template){
- popDialogStack();
- },
- "click .okButton": function(event, template){
- popDialogStack(template.selectedItem.get());
- },
- "click .library-item": function(event, template){
- template.selectedItem.set(this.item);
- },
- "click #backButton": function(event, template){
- popDialogStack();
- },
- "click .category-header": function(event, template){
- let cats = template.categoriesOpen.get();
- const key = this.key;
- // Toggle whether this key is in the array or not
- if (_.contains(cats, key)){
- cats = _.without(cats, key);
- } else {
- cats.push(key);
- }
- template.categoriesOpen.set(cats);
- },
- "input .search-input, change .search-input": function(event, template){
- const value = event.currentTarget.value;
- template.searchTerm.set(value);
- },
-});
-
-Template.libraryItem.helpers({
- itemName: function(){
- return this.item.libraryName || this.item.name;
- },
- itemWeight: function(){
- if (this.item.quantity) {
- return this.item.weight * this.item.quantity;
- } else {
- return this.item.weight;
- }
- },
- itemValue: function(){
- if (this.item.quantity) {
- return this.item.value * this.item.quantity;
- } else {
- return this.item.value;
- }
- },
-
-});
diff --git a/app/client/views/character/inventory/moveItemDialog/moveItemDialog.css b/app/client/views/character/inventory/moveItemDialog/moveItemDialog.css
deleted file mode 100644
index 5762ebbf..00000000
--- a/app/client/views/character/inventory/moveItemDialog/moveItemDialog.css
+++ /dev/null
@@ -1,7 +0,0 @@
-html /deep/ .moveItemDialog paper-tabs::shadow #selectionBar {
- background-color: #D50000;
-}
-
-html /deep/ .moveItemDialog paper-tab::shadow #ink {
- color: #D50000;
-}
diff --git a/app/client/views/character/inventory/moveItemDialog/moveItemDialog.html b/app/client/views/character/inventory/moveItemDialog/moveItemDialog.html
deleted file mode 100644
index 80ee29ea..00000000
--- a/app/client/views/character/inventory/moveItemDialog/moveItemDialog.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
- Containers
-
-
- Characters
-
-
-
-
-
-
-
- Cancel
- Move
-
diff --git a/app/client/views/character/inventory/moveItemDialog/moveItemDialog.js b/app/client/views/character/inventory/moveItemDialog/moveItemDialog.js
deleted file mode 100644
index cf69a756..00000000
--- a/app/client/views/character/inventory/moveItemDialog/moveItemDialog.js
+++ /dev/null
@@ -1,56 +0,0 @@
-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;
- }
- },
-});
diff --git a/app/client/views/character/inventory/splitStackDialog/splitStackDialog.html b/app/client/views/character/inventory/splitStackDialog/splitStackDialog.html
deleted file mode 100644
index e2677945..00000000
--- a/app/client/views/character/inventory/splitStackDialog/splitStackDialog.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
- Split Stack
-
-
-
-
-
-
-
diff --git a/app/client/views/character/inventory/splitStackDialog/splitStackDialog.js b/app/client/views/character/inventory/splitStackDialog/splitStackDialog.js
deleted file mode 100644
index 924bbf69..00000000
--- a/app/client/views/character/inventory/splitStackDialog/splitStackDialog.js
+++ /dev/null
@@ -1,35 +0,0 @@
-Template.splitStackDialog.onRendered(function(){
- this.find("#quantityInput").focus();
-});
-
-Template.splitStackDialog.helpers({
- quantity: function(){
- var item = Items.findOne(this.id);
- if (item) return Math.round(item.quantity / 2);
- }
-});
-
-Template.splitStackDialog.events({
- "click #moveButton": function(event, instance){
- Meteor.call(
- "splitItemToParent",
- this.id,
- +instance.find("#quantityInput").value,
- {collection: this.parentCollection , id: this.parentId}
- );
- popDialogStack();
- },
- "click #cancelButton": function(event, instance){
- popDialogStack();
- },
- "click #oneButton":function(event, instance){
- instance.find("#quantityInput").value = 1;
- },
- "click #halfButton":function(event, instance){
- var val = Math.round(Items.findOne(this.id).quantity / 2);
- instance.find("#quantityInput").value = val;
- },
- "click #allButton":function(event, instance){
- instance.find("#quantityInput").value = Items.findOne(this.id).quantity;
- },
-});
diff --git a/app/client/views/character/journal/classDialog/classDialog.html b/app/client/views/character/journal/classDialog/classDialog.html
deleted file mode 100644
index 6162104c..00000000
--- a/app/client/views/character/journal/classDialog/classDialog.html
+++ /dev/null
@@ -1,25 +0,0 @@
-
- {{#with class}}
- {{#baseDialog title=name class=colorClass startEditing=../startEditing}}
-
-
- {{level}}
-
-
- level
-
-
-
- {{> effectsViewList charId=charId parentId=_id}}
- {{> proficiencyViewList charId=charId parentId=_id}}
- {{else}}
-
-
-
-
-
- {{> effectsEditList parentId=_id parentCollection="Classes" charId=charId}}
- {{> proficiencyEditList parentId=_id parentCollection="Classes" charId=charId}}
- {{/baseDialog}}
- {{/with}}
-
diff --git a/app/client/views/character/journal/classDialog/classDialog.js b/app/client/views/character/journal/classDialog/classDialog.js
deleted file mode 100644
index 3ecc36d3..00000000
--- a/app/client/views/character/journal/classDialog/classDialog.js
+++ /dev/null
@@ -1,35 +0,0 @@
-const debounce = (f) => _.debounce(f, 300);
-
-Template.classDialog.helpers({
- class: function(){
- return Classes.findOne(this.classId);
- }
-});
-
-Template.classDialog.events({
- "color-change": function(event, instance){
- Classes.update(instance.data.classId, {$set: {color: event.color}});
- },
- "click #deleteButton": function(event, instance){
- Classes.softRemoveNode(instance.data.classId);
- GlobalUI.deletedToast(instance.data.classId, "Classes", "Class");
- popDialogStack();
- },
- "input #classNameInput, change #classNameInput": debounce(function(event){
- var value = event.currentTarget.value;
- Classes.update(this._id, {
- $set: {name: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #levelValueInput, change #levelValueInput": debounce(function(event){
- var value = event.currentTarget.value;
- Classes.update(this._id, {
- $set: {level: value}
- }, {
- removeEmptyStrings: false,
- });
- }),
-});
diff --git a/app/client/views/character/journal/experienceDialog/experienceDialog.css b/app/client/views/character/journal/experienceDialog/experienceDialog.css
deleted file mode 100644
index 2cc1e765..00000000
--- a/app/client/views/character/journal/experienceDialog/experienceDialog.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.noteDialog .colorDropdown {
- top: 0;
-}
diff --git a/app/client/views/character/journal/experienceDialog/experienceDialog.html b/app/client/views/character/journal/experienceDialog/experienceDialog.html
deleted file mode 100644
index d76a7cd1..00000000
--- a/app/client/views/character/journal/experienceDialog/experienceDialog.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
- {{#with experience}}
- {{#baseDialog title=name class=color hideColor="true" startEditing=../startEditing}}
-
- {{value}}
-
- {{#if description}}
-
- {{#markdown}}{{description}}{{/markdown}}
- {{/if}}
- {{else}}
- {{> experienceEdit}}
- {{/baseDialog}}
- {{/with}}
-
-
-
-
-
-
-
diff --git a/app/client/views/character/journal/experienceDialog/experienceDialog.js b/app/client/views/character/journal/experienceDialog/experienceDialog.js
deleted file mode 100644
index a4af9661..00000000
--- a/app/client/views/character/journal/experienceDialog/experienceDialog.js
+++ /dev/null
@@ -1,55 +0,0 @@
-Template.experienceDialog.helpers({
- experience: function(){
- Experiences.findOne(this.experienceId);
- return Experiences.findOne(this.experienceId);
- },
- color: function() {
- var char = Characters.findOne(this.charId, {fields: {color: 1}});
- if (char) return getColorClass(char.color);
- },
-});
-
-Template.experienceDialog.events({
- "tap #deleteButton": function(event, instance){
- Experiences.softRemove(instance.data.experienceId);
- GlobalUI.deletedToast(
- instance.data.experienceId,
- "Experiences", "Experience"
- );
- popDialogStack();
- },
-});
-
-const debounce = (f) => _.debounce(f, 300);
-
-Template.experienceEdit.events({
- "input #experienceNameInput, change #experienceNameInput":
- debounce(function(event){
- var value = event.currentTarget.value;
- Experiences.update(this._id, {
- $set: {name: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #valueInput, change #valueInput":
- debounce(function(event){
- var value = +event.currentTarget.value;
- Experiences.update(this._id, {
- $set: {value: value}
- }, {
- removeEmptyStrings: false,
- });
- }),
- "input #experienceDescriptionInput":
- debounce(function(event){
- var value = event.currentTarget.value;
- Experiences.update(this._id, {
- $set: {description: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
-});
diff --git a/app/client/views/character/journal/journal.css b/app/client/views/character/journal/journal.css
deleted file mode 100644
index f0423d04..00000000
--- a/app/client/views/character/journal/journal.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.experiences {
- padding: 0 0 16px 0;
-}
-
-.experience {
- height: 48px;
-}
diff --git a/app/client/views/character/journal/journal.html b/app/client/views/character/journal/journal.html
deleted file mode 100644
index 8632954c..00000000
--- a/app/client/views/character/journal/journal.html
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
Experience
-
{{characterCalculate "experience" _id}} XP
-
-
-
- {{#each experiences}}
-
- {{/each}}
-
- {{#if moreExperiencesOrCollapse}}
-
-
- Load More
-
-
- Collapse
-
-
- {{/if}}
-
-
-
-
-
-
-
-
- Level {{characterCalculate "level" _id}}
-
- {{#if nextLevelXP}}
-
- Next Level: {{nextLevelXP}}XP
-
- {{/if}}
-
-
-
-
-
-
- {{#each classes}}
-
-
- {{name}} {{level}}
-
-
- {{/each}}
-
-
-
-
- {{#each notes}}
-
-
-
- {{name}}
-
-
- {{#markdown}}{{evaluateShortString charId description}}{{/markdown}}
-
-
-
- {{/each}}
-
-
- {{#if canEditCharacter _id}}
-
- {{/if}}
-
diff --git a/app/client/views/character/journal/journal.js b/app/client/views/character/journal/journal.js
deleted file mode 100644
index a1cbef98..00000000
--- a/app/client/views/character/journal/journal.js
+++ /dev/null
@@ -1,148 +0,0 @@
-Template.journal.created = function(){
- var self = this;
- self.experiencesLimit = new ReactiveVar(
- self.data.settings && self.data.settings.experiencesInc || 10
- );
-};
-
-Template.journal.helpers({
- notes: function(){
- return Notes.find({charId: this._id}, {sort: {color: 1, name: 1}});
- },
- experiences: function(){
- return Experiences.find(
- {charId: this._id},
- {
- sort: {dateAdded: -1},
- limit: Template.instance().experiencesLimit.get(),
- }
- );
- },
- notMoreExperiences: function(){
- return Experiences.find(
- {charId: this._id}
- ).count() < Template.instance().experiencesLimit.get();
- },
- cantCollapse: function(){
- return Template.instance().experiencesLimit.get() <=
- (this.settings && this.settings.experiencesInc || 10);
- },
- moreExperiencesOrCollapse: function(){
- var allShown = Experiences.find({charId: this._id}).count() <
- Template.instance().experiencesLimit.get();
- var canCollapse = Template.instance().experiencesLimit.get() >
- (this.settings && this.settings.experiencesInc || 10);
- return !allShown || canCollapse;
- },
- classes: function(){
- return Classes.find({charId: this._id}, {sort: {createdAt: 1}});
- },
- levels: function(charId){
- return Levels.find({charId: charId, classId: this._id}, {sort: {value: 1}});
- },
- nextLevelXP: function(){
- var currentLevel = Characters.calculate.level(this._id);
- if (currentLevel < 20){
- return XP_TABLE[currentLevel];
- }
- },
- race: function(){
- var char = Characters.findOne(this._id, {fields: {race: 1}});
- return char && char.race;
- },
- shouldRaceBounce: function(){
- return Session.get("newUserExperienceStep") === 1;
- },
-});
-
-Template.journal.events({
- "click .noteTop": function(event){
- pushDialogStack({
- template: "noteDialog",
- data: {noteId: this._id, charId: this.charId},
- element: event.currentTarget.parentElement,
- });
- },
- "click .experience": function(event){
- pushDialogStack({
- template: "experienceDialog",
- data: {experienceId: this._id, charId: this.charId},
- element: event.currentTarget,
- });
- },
- "click .class": function(event){
- pushDialogStack({
- template: "classDialog",
- data: {classId: this._id, charId: this.charId},
- element: event.currentTarget,
- });
- },
- "click .race": function(event){
- pushDialogStack({
- template: "raceDialog",
- data: {charId: this._id},
- element: event.currentTarget,
- });
- },
- "click #addNote": function(event, instance){
- var charId = this._id;
- var noteId = Notes.insert({
- name: "New Note",
- charId: charId,
- });
- pushDialogStack({
- template: "noteDialog",
- data: {noteId: noteId, charId: charId, startEditing: true},
- element: event.currentTarget,
- returnElement: () => instance.find(`.note[data-id='${noteId}']`),
- });
- },
- "click #addXP": function(event, instance){
- var charId = this._id;
- var expId = Experiences.insert({
- charId: charId
- });
- pushDialogStack({
- template: "experienceDialog",
- data: {experienceId: expId, charId: charId, startEditing: true},
- element: event.currentTarget,
- returnElement: () => instance.find(`.experience[data-id='${expId}']`),
- });
- },
- "click #addClassButton":function(event, instance){
- var charId = this._id;
- var classId = Classes.insert({
- charId: charId,
- name: "new Class",
- level: 1,
- });
- pushDialogStack({
- template: "classDialog",
- data: {classId: classId, charId: charId, startEditing: true},
- element: event.currentTarget,
- returnElement: () => instance.find(`.class[data-id='${classId}']`),
- });
- },
- "click #moreExperiences": function(event, instance){
- instance.experiencesLimit.set(
- instance.experiencesLimit.get() +
- (this.settings && this.settings.experiencesInc || 10)
- );
- },
- "click #lessExperiences": function(event, instance){
- instance.experiencesLimit.set(
- this.settings && this.settings.experiencesInc || 10
- );
- // Scroll to the top of the div
- instance.$(".scroll-y").animate({
- scrollTop: (
- instance.$(".scroll-y").scrollTop() +
- instance.$(".experiencesCard").position().top -
- 8
- )
- }, 300);
- // HACK jiggle the columns :( to workaround chrome bug that stops .containers height from updating
- var cs = instance.$(".containers").removeClass("containers");
- _.defer(function(){cs.addClass("containers");});
- },
-});
diff --git a/app/client/views/character/journal/noteDialog/noteDialog.css b/app/client/views/character/journal/noteDialog/noteDialog.css
deleted file mode 100644
index 2cc1e765..00000000
--- a/app/client/views/character/journal/noteDialog/noteDialog.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.noteDialog .colorDropdown {
- top: 0;
-}
diff --git a/app/client/views/character/journal/noteDialog/noteDialog.html b/app/client/views/character/journal/noteDialog/noteDialog.html
deleted file mode 100644
index d099eb44..00000000
--- a/app/client/views/character/journal/noteDialog/noteDialog.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
- {{#with note}}
- {{#baseDialog title=name class=colorClass startEditing=../startEditing}}
- {{#markdown}}{{evaluateString charId description}}{{/markdown}}
- {{else}}
- {{> noteDialogEdit}}
- {{/baseDialog}}
- {{/with}}
-
-
-
-
-
-
-
-
diff --git a/app/client/views/character/journal/noteDialog/noteDialog.js b/app/client/views/character/journal/noteDialog/noteDialog.js
deleted file mode 100644
index db566503..00000000
--- a/app/client/views/character/journal/noteDialog/noteDialog.js
+++ /dev/null
@@ -1,46 +0,0 @@
-Template.noteDialog.helpers({
- note: function(){
- return Notes.findOne(this.noteId);
- }
-});
-
-Template.noteDialog.events({
- "color-change": function(event, instance){
- Notes.update(instance.data.noteId, {$set: {color: event.color}});
- },
- "tap #deleteButton": function(event, instance){
- Notes.softRemove(instance.data.noteId);
- GlobalUI.deletedToast(instance.data.noteId, "Notes", "Note");
- popDialogStack();
- },
-});
-
-const debounce = (f) => _.debounce(f, 300);
-
-Template.noteDialogEdit.events({
- "change #noteNameInput, input #noteNameInput": debounce(function(event){
- const input = event.currentTarget;
- var name = input.value;
- if (!name){
- input.invalid = true;
- input.errorMessage = "Name is required";
- } else {
- input.invalid = false;
- Notes.update(this._id, {
- $set: {name: name}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }
- }),
- "input #noteDescriptionInput": debounce(function(event){
- var value = event.currentTarget.value;
- Notes.update(this._id, {
- $set: {description: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
-});
diff --git a/app/client/views/character/journal/raceDialog/raceDialog.html b/app/client/views/character/journal/raceDialog/raceDialog.html
deleted file mode 100644
index 190e539c..00000000
--- a/app/client/views/character/journal/raceDialog/raceDialog.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
- {{#baseDialog title="Race" class=color hideColor="true" hideDelete="true" startEditing=startEditing}}
- {{#if showNewUserExperience}}
- {{#infoBox}}
- {{#if stepComplete}}
- You can add all the effects you need to represent how your race affects your character's attributes.
- {{else}}
- Click the edit button to edit your race and add a racial effect
- {{/if}}
- {{/infoBox}}
- {{/if}}
-
- {{race}}
-
- {{> effectsViewList charId=charId parentId=charId parentGroup="racial"}}
- {{> proficiencyViewList charId=charId parentId=charId parentGroup="racial"}}
- {{else}}
- {{#if showNewUserExperience}}
- {{#infoBox}}
- {{#if stepComplete}}
- You can add all the effects you need to represent how your race affects your character's attributes.
- {{else}}
-
- Add an effect with the following options:
- Attribute: stats > speed
- Operation: Base Value
- Value: 30 (might be different for some races)
-
- {{/if}}
- {{/infoBox}}
- {{/if}}
-
- {{> effectsEditList parentId=charId parentCollection="Characters" charId=charId parentGroup="racial"}}
- {{> proficiencyEditList parentId=charId parentCollection="Characters" charId=charId parentGroup="racial"}}
- {{/baseDialog}}
-
diff --git a/app/client/views/character/journal/raceDialog/raceDialog.js b/app/client/views/character/journal/raceDialog/raceDialog.js
deleted file mode 100644
index 63553e8a..00000000
--- a/app/client/views/character/journal/raceDialog/raceDialog.js
+++ /dev/null
@@ -1,28 +0,0 @@
-Template.raceDialog.events({
- "input #raceInput, change #raceInput": _.debounce(function(event){
- var value = event.currentTarget.value;
- Characters.update(this.charId, {
- $set: {race: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }, 300),
-});
-
-Template.raceDialog.helpers({
- race: function(){
- var char = Characters.findOne(this.charId, {fields: {race: 1}});
- return char && char.race;
- },
- color: function() {
- var char = Characters.findOne(this.charId, {fields: {color: 1}});
- if (char) return getColorClass(char.color);
- },
- stepComplete: function(){
- return Session.get("newUserExperienceStep") > 1;
- },
- showNewUserExperience: function(){
- return Session.get("newUserExperienceStep") >= 1;
- },
-});
diff --git a/app/client/views/character/newCharacterDialog/newCharacterDialog.html b/app/client/views/character/newCharacterDialog/newCharacterDialog.html
deleted file mode 100644
index 8db8bfe5..00000000
--- a/app/client/views/character/newCharacterDialog/newCharacterDialog.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
- New Character
-
-
-
-
-
-
-
diff --git a/app/client/views/character/newCharacterDialog/newCharacterDialog.js b/app/client/views/character/newCharacterDialog/newCharacterDialog.js
deleted file mode 100644
index dbc086f6..00000000
--- a/app/client/views/character/newCharacterDialog/newCharacterDialog.js
+++ /dev/null
@@ -1,49 +0,0 @@
-Template.newCharacterDialog.onCreated(function(){
- this.character = {};
- this.schema = new SimpleSchema({
- //strings
- name: {type: String},
- gender: {type: String, optional: true},
- race: {type: String, optional: true},
- });
- this.context = this.schema.newContext();
- this.context.runOnce = new ReactiveVar(false);
-});
-
-Template.newCharacterDialog.helpers({
- invalid(){
- let context = Template.instance().context;
- let valid = context.isValid() && context.runOnce.get();
- return !valid;
- },
- errorAtts(key){
- let error = Template.instance().context.keyErrorMessage(key);
- if (error){
- return {
- invalid: true,
- ["error-message"]: error,
- }
- }
- },
-});
-
-changeFunction = function(field){
- return _.debounce(function(event, instance){
- instance.character[field] = event.currentTarget.value;
- instance.schema.clean(instance.character);
- instance.context.validate(instance.character);
- if (!instance.context.runOnce.get()) instance.context.runOnce.set(true);
- }, 200);
-};
-
-Template.newCharacterDialog.events({
- "input .nameInput": changeFunction("name"),
- "input .genderInput": changeFunction("gender"),
- "input .raceInput": changeFunction("race"),
- "click .cancelButton": function(event, instance){
- popDialogStack();
- },
- "click .addButton": function(event, instance){
- popDialogStack(instance.character);
- },
-});
diff --git a/app/client/views/character/newUserStepper/newUserStepper.css b/app/client/views/character/newUserStepper/newUserStepper.css
deleted file mode 100644
index b6e01f44..00000000
--- a/app/client/views/character/newUserStepper/newUserStepper.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.newUserStepper {
- height: 180px !important;
-}
-
-.newUserStepper paper-step .invalid-step-message {
- color: #d13b2e;
- visibility: hidden;
-}
-
-.newUserStepper paper-step[invalid] .invalid-step-message {
- visibility: visible;
-}
diff --git a/app/client/views/character/newUserStepper/newUserStepper.html b/app/client/views/character/newUserStepper/newUserStepper.html
deleted file mode 100644
index e4cce0e4..00000000
--- a/app/client/views/character/newUserStepper/newUserStepper.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
- To get started, add a feature
-
-
-
-
- Add a racial effect to set your speed
-
-
-
-
- View your speed stat
-
-
-
- Done! If you get stuck, be sure to check out the guide , or ask for help using the feedback form
-
-
-
-
-
-
-
-
diff --git a/app/client/views/character/newUserStepper/newUserStepper.js b/app/client/views/character/newUserStepper/newUserStepper.js
deleted file mode 100644
index c45acd9a..00000000
--- a/app/client/views/character/newUserStepper/newUserStepper.js
+++ /dev/null
@@ -1,58 +0,0 @@
-Template.newUserStepper.onRendered(function(){
- Session.set("newUserExperienceStep", 0);
- let stepper = this.find("paper-stepper");
- _.defer(() => {
- this.autorun((c) => {
- var step = Session.get("newUserExperienceStep");
- var hasFeatures = Features.find({charId: this.data._id}).count() > 1;
- if (step === 0 && hasFeatures){
- stepper.continue();
- }
- });
- this.autorun((c) => {
- var step = Session.get("newUserExperienceStep");
- var hasEffect = !!Effects.find({
- charId: this.data._id,
- stat: "speed",
- "parent.group": "racial",
- operation: "base",
- value: {$gt: 0},
- }).count();
- if (step === 1 && hasEffect){
- stepper.continue();
- }
- });
- this.autorun((c) => {
- var step = Session.get("newUserExperienceStep");
- if (step === 2 && Session.get("viewedSpeed")){
- Session.set("viewedSpeed", undefined);
- stepper.continue();
- }
- });
- });
-});
-
-Template.newUserStepper.events({
- "paper-stepper-progressed paper-stepper": function(event, template){
- const step = template.find("paper-stepper").selected;
- Session.set("newUserExperienceStep", step);
- },
- "paper-stepper-completed paper-stepper": function(event, template){
- Session.set("newUserExperienceStep", undefined);
- Session.set("showNewUserExperience", undefined);
- Characters.update(this._id, {$unset: {"settings.newUserExperience": 1}});
- },
- "click .done-button": function(event, instance){
- const stepper = instance.find("paper-stepper");
- stepper.continue();
- },
-});
-
-Template.stats.events({
- "click .stat-card": function(event, instance){
- var step = Session.get("newUserExperienceStep");
- if (this.stat === "speed" && step === 2){
- Session.set("viewedSpeed", true);
- }
- }
-});
diff --git a/app/client/views/character/persona/backgroundDialog/backgroundDialog.html b/app/client/views/character/persona/backgroundDialog/backgroundDialog.html
deleted file mode 100644
index 4236ea94..00000000
--- a/app/client/views/character/persona/backgroundDialog/backgroundDialog.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
- {{#baseDialog title=title class=colorClass hideColor="true" hideDelete="true"}}
- {{#markdown}}{{evaluateString charId value}}{{/markdown}}
- {{> proficiencyViewList charId=charId parentId=charId parentGroup="background"}}
- {{else}}
- {{> textDialogEdit}}
- {{> proficiencyEditList parentId=charId parentCollection="Characters" charId=charId parentGroup="background"}}
- {{/baseDialog}}
-
\ No newline at end of file
diff --git a/app/client/views/character/persona/backgroundDialog/backgroundDialog.js b/app/client/views/character/persona/backgroundDialog/backgroundDialog.js
deleted file mode 100644
index 2ec4e486..00000000
--- a/app/client/views/character/persona/backgroundDialog/backgroundDialog.js
+++ /dev/null
@@ -1,8 +0,0 @@
-Template.backgroundDialog.helpers({
- value: function(){
- var fieldSelector = {fields: {}};
- fieldSelector.fields[this.field] = 1;
- var char = Characters.findOne(this.charId, fieldSelector);
- return char[this.field];
- }
-});
diff --git a/app/client/views/character/persona/peronaDetailsDialog/personaDetailsDialog.html b/app/client/views/character/persona/peronaDetailsDialog/personaDetailsDialog.html
deleted file mode 100644
index 38f0c332..00000000
--- a/app/client/views/character/persona/peronaDetailsDialog/personaDetailsDialog.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
- {{#baseDialog title=name class="deep-purple white-text" hideColor="true" hideDelete="true" startEditing=startEditing}}
- {{#with char}}
- {{alignment}} {{gender}} {{race}}
-
- {{/with}}
- {{else}}
- {{#with char}}
- {{> personaDetailsEdit}}
- {{/with}}
- {{/baseDialog}}
-
-
-
-
-
diff --git a/app/client/views/character/persona/peronaDetailsDialog/personaDetailsDialog.js b/app/client/views/character/persona/peronaDetailsDialog/personaDetailsDialog.js
deleted file mode 100644
index 018525dc..00000000
--- a/app/client/views/character/persona/peronaDetailsDialog/personaDetailsDialog.js
+++ /dev/null
@@ -1,26 +0,0 @@
-Template.personaDetailsDialog.helpers({
- char: function() {
- return Characters.findOne(
- this._id,
- {fields: {name: 1, alignment: 1, gender: 1, race: 1, picture: 1}}
- );
- }
-});
-
-inputHandler = (field) => _.debounce(function(event){
- var input = event.currentTarget.value;
- Characters.update(this._id, {
- $set: {[field]: input}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
-}, 300);
-
-Template.personaDetailsEdit.events({
- "input #nameInput, change #nameInput": inputHandler("name"),
- "input #alignmentInput, change #alignmentInput": inputHandler("alignment"),
- "input #genderInput, change #genderInput": inputHandler("gender"),
- "input #raceInput, change #raceInput": inputHandler("race"),
- "input #pictureInput, change #pictureInput": inputHandler("picture"),
-});
diff --git a/app/client/views/character/persona/persona.html b/app/client/views/character/persona/persona.html
deleted file mode 100644
index 327e3053..00000000
--- a/app/client/views/character/persona/persona.html
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
- {{#with characterDetails}}
-
-
- {{#unless picture}}
-
- {{else}}
-
- {{/unless}}
-
- {{#if picture}}
-
- {{name}}
-
- {{/if}}
-
- {{alignment}} {{gender}} {{race}}
-
-
-
-
- {{/with}}
-
{{> containerCard characterField "description" "Description"}}
-
{{> containerCard characterField "personality" "Personality Traits"}}
-
{{> containerCard characterField "ideals" "Ideals"}}
-
{{> containerCard characterField "bonds" "Bonds"}}
-
{{> containerCard characterField "flaws" "Flaws"}}
-
{{> containerCard characterField "backstory" "Background"}}
-
-
-
- Languages
-
-
- {{#each languages}}
- {{> proficiencyListItem}}
- {{/each}}
-
-
-
-
-
-
-
- {{#containerCardHelper this}}{{evaluateShortString _id body}}{{/containerCardHelper}}
-
-
-
-
-
- {{#markdown}}{{> UI.contentBlock}}{{/markdown}}
-
-
diff --git a/app/client/views/character/persona/persona.js b/app/client/views/character/persona/persona.js
deleted file mode 100644
index 5a7fc10b..00000000
--- a/app/client/views/character/persona/persona.js
+++ /dev/null
@@ -1,84 +0,0 @@
-var colorMap = {
- description: "e",
- personality: "f",
- ideals: "g",
- bonds: "h",
- flaws: "i",
- backstory: "j",
-};
-
-var removeDuplicateProficiencies = function(proficiencies) {
- dict = {};
- proficiencies.forEach(function(prof) {
- if (prof.name in dict) { //if we have already gone over another proficiency for the same thing
- if (dict[prof.name].value < prof.value) {
- dict[prof.name] = prof; //then take the new one if it's higher, otherwise leave it
- }
- } else {
- dict[prof.name] = prof; //if it wasn't already there, store it
- }
- });
- profs = []
- _.forEach(dict, function(prof) {
- profs.push(prof);
- })
- return profs;
-};
-
-Template.persona.helpers({
- characterDetails: function(){
- var char = Characters.findOne(
- this._id,
- {fields: {name: 1, gender: 1, alignment: 1, race:1, picture: 1}}
- );
- char.field = "details";
- char.title = char.name;
- char.color = "d";
- return char;
- },
- characterField: function(field, title){
- var fieldSelector = {fields: {}};
- fieldSelector.fields[field] = 1;
- var char = Characters.findOne(this._id, fieldSelector);
- var color = colorMap[field];
- return {
- _id: char._id,
- title: title,
- field: field,
- color: color,
- body: char[field],
- topClass: "characterField",
- };
- },
- languages: function(){
- var profs = Proficiencies.find({charId: this._id, type: "language"});
- return removeDuplicateProficiencies(profs);
- },
-});
-
-Template.persona.events({
- "click .characterField": function(event){
- if (this.field == "details"){
- this.charId = Template.parentData()._id;
- pushDialogStack({
- template: "personaDetailsDialog",
- data: this,
- element: event.currentTarget.parentElement,
- });
- } else {
- var template = "textDialog";
- if (this.field === "backstory") template = "backgroundDialog";
- var charId = Template.parentData()._id;
- pushDialogStack({
- template: template,
- data: {
- charId: charId,
- field: this.field,
- title: this.title,
- color: this.color,
- },
- element: event.currentTarget.parentElement,
- });
- }
- }
-});
diff --git a/app/client/views/character/persona/textDialog/textDialog.html b/app/client/views/character/persona/textDialog/textDialog.html
deleted file mode 100644
index a714a6f7..00000000
--- a/app/client/views/character/persona/textDialog/textDialog.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
- {{#baseDialog title=title class=colorClass hideColor="true" hideDelete="true"}}
- {{#markdown}}{{evaluateString charId value}}{{/markdown}}
- {{else}}
- {{> textDialogEdit}}
- {{/baseDialog}}
-
-
-
-
-
-
diff --git a/app/client/views/character/persona/textDialog/textDialog.js b/app/client/views/character/persona/textDialog/textDialog.js
deleted file mode 100644
index e374bf38..00000000
--- a/app/client/views/character/persona/textDialog/textDialog.js
+++ /dev/null
@@ -1,29 +0,0 @@
-Template.textDialog.helpers({
- value: function(){
- var fieldSelector = {fields: {}};
- fieldSelector.fields[this.field] = 1;
- var char = Characters.findOne(this.charId, fieldSelector);
- return char[this.field];
- }
-});
-
-Template.textDialogEdit.helpers({
- value: function(){
- var fieldSelector = {fields: {}};
- fieldSelector.fields[this.field] = 1;
- var char = Characters.findOne(this.charId, fieldSelector);
- return char[this.field];
- }
-});
-
-Template.textDialogEdit.events({
- "input #textInput": _.debounce(function(event){
- var input = event.currentTarget.value;
- Characters.update(this.charId, {
- $set: {[this.field]: input}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }, 300),
-});
diff --git a/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.css b/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.css
deleted file mode 100644
index c182e654..00000000
--- a/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.printedAbility .title.paper-font-subhead {
- font-size: 2.5mm !important;
-}
diff --git a/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.html b/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.html
deleted file mode 100644
index a1199dc3..00000000
--- a/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- {{title}}
-
-
- {{characterCalculate "attributeValue" ../_id ability}}
-
-
- {{abilityMod}}
-
-
-
diff --git a/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.js b/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.js
deleted file mode 100644
index 62e74b7d..00000000
--- a/app/client/views/character/printedCharacterSheet/printedAbility/printedAbility.js
+++ /dev/null
@@ -1,9 +0,0 @@
-Template.printedAbility.helpers({
- abilityMod: function() {
- return signedString(
- Characters.calculate.abilityMod(
- Template.parentData()._id, this.ability
- )
- );
- }
-});
diff --git a/app/client/views/character/printedCharacterSheet/printedAttack/printedAttack.html b/app/client/views/character/printedCharacterSheet/printedAttack/printedAttack.html
deleted file mode 100644
index fd59995f..00000000
--- a/app/client/views/character/printedCharacterSheet/printedAttack/printedAttack.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- {{evaluateAttackBonus charId attack}}
-
-
-
- {{attack.name}}
-
-
- {{evaluateDamage charId attack}} {{attack.damageType}}
-
- {{#if attack.details}}
-
- {{attack.details}}
-
- {{/if}}
-
-
-
-
diff --git a/app/client/views/character/printedCharacterSheet/printedAttack/printedAttack.js b/app/client/views/character/printedCharacterSheet/printedAttack/printedAttack.js
deleted file mode 100644
index 1dfe3e70..00000000
--- a/app/client/views/character/printedCharacterSheet/printedAttack/printedAttack.js
+++ /dev/null
@@ -1,30 +0,0 @@
-Template.printedAttack.helpers({
- evaluateAttackBonus: function(charId, attack) {
- if (attack.parent.collection == "Spells") {
- var spell = Spells.findOne(attack.parent.id);
- if (spell) {
- bonus = evaluate(charId, attack.attackBonus, {
- "spellListId": spell.parent.id
- });
- }
- } else {
- var bonus = evaluate(charId, attack.attackBonus);
- }
-
- if (_.isFinite(bonus)) {
- return bonus > 0 ? "+" + bonus : "" + bonus;
- } else {
- return bonus;
- }
- },
- evaluateDamage: function(charId, attack) {
- if (attack.parent.collection == "Spells") {
- var spell = Spells.findOne(attack.parent.id);
- if (spell) {
- return evaluateSpellString(charId, spell.parent.id, attack.damage);
- }
- } else {
- return evaluateString(charId, attack.damage);
- }
- },
-});
diff --git a/app/client/views/character/printedCharacterSheet/printedCharacterSheet.css b/app/client/views/character/printedCharacterSheet/printedCharacterSheet.css
deleted file mode 100644
index 27ce9c52..00000000
--- a/app/client/views/character/printedCharacterSheet/printedCharacterSheet.css
+++ /dev/null
@@ -1,190 +0,0 @@
-.printed .page {
- width: 100%;
- padding: 6mm;
- page-break-inside: avoid;
- page-break-after: always;
-}
-
-.printed .shrink-to-fit {
- white-space: nowrap;
- overflow: hidden;
-}
-
-.printed p {
- margin-bottom: 1mm;
-}
-
-.printed .double-border {
- position: relative;
- padding: 11px 10px;
-}
-
-.printed .double-border > * {
- position: relative;
-}
-
-.printed .double-border:before {
- content: "";
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- border: 16px solid transparent;
- border-image-source: url(/png/doubleLineImageBorder.png);
- border-image-slice: 110 126 fill;
- border-image-repeat: stretch;
- box-sizing: content-box;
-}
-
-.printed .double-border.printedAbility {
- padding: 11px 6px 0;
- margin-bottom: 3mm;
-}
-
-.printed .double-border.printedAbility:last-of-type {
- margin-bottom: 0;
-}
-
-.printed .printedAbility .modifier {
- position: relative;
- top: 4px;
- z-index: 1;
- padding: 2px 18px;
- background-image: url(/png/upwardPointingBorder.png);
- background-position: center;
- background-size: contain;
- background-repeat: no-repeat;
- print-color-adjust: exact;
- -webkit-print-color-adjust: exact;
-}
-
-.printed .octogon-border {
- position: relative;
- padding: 0 20px;
-}
-
-.printed .octogon-border:before {
- content: "";
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- border: 22px solid transparent;
- border-image: url(/png/octogonBorder.png) 124 118 fill;
- z-index: -1;
-}
-
-.printed iron-icon {
- width: 16px;
- min-width: 16px;
- height: 16px;
- min-height: 16px;
-}
-
-.printed .proficiencies, .printed .attacks, .printed .background {
- overflow: hidden;
-}
-
-.printed .shield-background {
- background: url(/png/shieldBorder.png);
- background-size: cover;
- background-repeat: no-repeat;
- print-color-adjust: exact;
- -webkit-print-color-adjust: exact;
- padding: 4px 8px 8px;
- width: 80px;
- height: 91px;
- position: relative;
-}
-
-.printed .shield-background .paper-font-subhead {
- width: 64px;
- text-align: center;
- line-height: 1.1;
-}
-
-.printed {
- font-size: 3mm;
-}
-
-.printed .paper-font-body2 {
- font-size: 3mm;
- line-height: 4mm;
-}
-
-.printed .paper-font-subhead {
- font-size: 3mm !important;
- line-height: 3.5mm !important;
- font-weight: bold !important;
- text-transform: uppercase !important;
-}
-
-.printed .paper-font-subhead.modifier {
- font-size: 4mm !important;
- line-height: 6mm !important;
-}
-
-.printed .paper-font-display1 {
- font-size: 7mm !important;
- line-height: 12mm !important;
-}
-
-.printed .paper-font-headline {
- font-size: 5mm !important;
- line-height: 6mm !important;
-}
-
-.printed .lined-background {
- background-image: url(/png/horizontalLine.png);
- background-size: 100% 4mm;
- print-color-adjust: exact;
- -webkit-print-color-adjust: exact;
-}
-
-@media screen {
- .printed .page {
- width: 210mm;
- height: 297mm;
- background: white;
- margin: 8px;
- box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
- 0 1px 5px 0 rgba(0, 0, 0, 0.12),
- 0 3px 1px -2px rgba(0, 0, 0, 0.2);
- }
-
- .printed .page-holder {
- width: calc(210mm + 16px);
- }
-
- .printed {
- overflow: auto;
- padding-left:
- }
-}
-
-@media print {
- app-drawer {
- display: none;
- }
- app-header {
- display: none;
- }
- .printed {
- position: fixed;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- z-index: 99;
- background: #fff;
- }
- .printed .page-holder {
- height: 100%
- }
-
- .printed .page {
- height: 100%;
- }
-}
diff --git a/app/client/views/character/printedCharacterSheet/printedCharacterSheet.html b/app/client/views/character/printedCharacterSheet/printedCharacterSheet.html
deleted file mode 100644
index 8aded073..00000000
--- a/app/client/views/character/printedCharacterSheet/printedCharacterSheet.html
+++ /dev/null
@@ -1,276 +0,0 @@
-
-
-
-
-
-
-
- {{name}}
-
-
-
- {{#simpleTooltip}} Print {{/simpleTooltip}}
-
-
-
-
-
-
-
-
-
-
- {{name}}
-
-
-
- {{#each classes}}
-
- {{name}} {{level}}
-
- {{/each}}
-
-
- {{character.alignment}} {{character.gender}} {{character.race}}
-
-
-
-
- dicecloud.com
-
-
- {{characterUrl}}
-
-
-
-
-
-
-
-
- {{> printedLongStat stat="" name="Inspiration" prefix=""}}
-
-
- {{> printedLongStat stat="proficiencyBonus" name="Proficiency Bonus" prefix="+"}}
-
-
-
-
- {{> printedAbility ability="strength" title="Strength"}}
- {{> printedAbility ability="dexterity" title="Dexterity"}}
- {{> printedAbility ability="constitution" title="Constitution"}}
- {{> printedAbility ability="intelligence" title="Intelligence"}}
- {{> printedAbility ability="wisdom" title="Wisdom"}}
- {{> printedAbility ability="charisma" title="Charisma"}}
-
-
-
-
- {{> printedSkillRow name="Strength" skill="strengthSave"}}
- {{> printedSkillRow name="Dexterity" skill="dexteritySave"}}
- {{> printedSkillRow name="Constitution" skill="constitutionSave"}}
- {{> printedSkillRow name="Intelligence" skill="intelligenceSave"}}
- {{> printedSkillRow name="Wisdom" skill="wisdomSave"}}
- {{> printedSkillRow name="Charisma" skill="charismaSave"}}
-
-
- Saving Throws
-
-
-
-
- {{> printedSkillRow name="Acrobatics" skill="acrobatics"}}
- {{> printedSkillRow name="Animal Handling" skill="animalHandling"}}
- {{> printedSkillRow name="Arcana" skill="arcana"}}
- {{> printedSkillRow name="Athletics" skill="athletics"}}
- {{> printedSkillRow name="Deception" skill="deception"}}
- {{> printedSkillRow name="History" skill="history"}}
- {{> printedSkillRow name="Insight" skill="insight"}}
- {{> printedSkillRow name="Intimidation" skill="intimidation"}}
- {{> printedSkillRow name="Investigation" skill="investigation"}}
- {{> printedSkillRow name="Medicine" skill="medicine"}}
- {{> printedSkillRow name="Nature" skill="nature"}}
- {{> printedSkillRow name="Perception" skill="perception" showPassive="true"}}
- {{> printedSkillRow name="Performance" skill="performance"}}
- {{> printedSkillRow name="Persuasion" skill="persuasion"}}
- {{> printedSkillRow name="Religion" skill="religion"}}
- {{> printedSkillRow name="Sleight of Hand" skill="sleightOfHand"}}
- {{> printedSkillRow name="Stealth" skill="stealth"}}
- {{> printedSkillRow name="Survival" skill="survival"}}
-
-
- Skills
-
-
-
-
-
-
- Proficiencies
-
-
-
- {{#if armorProfs.length}}
-
Armor
- {{/if}}
- {{#each armorProfs}}
- {{> printedProficiency}}
- {{/each}}
- {{#if weaponProfs.length}}
-
Weapons
- {{/if}}
- {{#each weaponProfs}}
- {{> printedProficiency}}
- {{/each}}
-
- {{#if toolProfs.length}}
-
-
Tools
- {{#each toolProfs}}
- {{> printedProficiency}}
- {{/each}}
-
- {{/if}}
-
-
-
-
-
-
- {{> printedSquareStat stat="armor" name="Armor Class" class="shield-background"}}
-
-
- {{> printedSquareStat stat="initiative" name="Initiative" isSkill="true" class="double-border"}}
-
-
- {{> printedSquareStat stat="speed" name="Speed" class="double-border"}}
-
-
-
-
- Hit point maximum:
-
- {{characterCalculate "attributeBase" _id "hitPoints"}}
-
-
-
-
-
-
- Hit Points
-
-
-
-
-
-
-
- Temporary Hit Points
-
-
-
-
-
- Total:
-
- {{hitDiceTotal}}
-
-
-
-
-
-
- Hit Dice
-
-
-
-
- Successes
-
-
-
-
-
-
-
- Failures
-
-
-
-
-
-
-
- Death Saves
-
-
-
-
-
- Attacks
-
- {{#each attack in attacks}}
- {{> printedAttack attack=attack charId=_id}}
- {{/each}}
-
-
-
-
-
- Languages
-
-
-
- {{#each languageProfs.left}}
- {{> printedProficiency}}
- {{/each}}
-
- {{#if languageProfs.right.length}}
-
- {{#each languageProfs.right}}
- {{> printedProficiency}}
- {{/each}}
-
- {{/if}}
-
-
-
- {{#markdown}}{{evaluateShortString character._id character.personality}}{{/markdown}}
-
- Personality traits
-
-
-
- {{#markdown}}{{evaluateShortString character._id character.ideals}}{{/markdown}}
-
- Ideals
-
-
-
- {{#markdown}}{{evaluateShortString character._id character.bonds}}{{/markdown}}
-
- Bonds
-
-
-
- {{#markdown}}{{evaluateShortString character._id character.flaws}}{{/markdown}}
-
- Flaws
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/client/views/character/printedCharacterSheet/printedCharacterSheet.js b/app/client/views/character/printedCharacterSheet/printedCharacterSheet.js
deleted file mode 100644
index 46efeff6..00000000
--- a/app/client/views/character/printedCharacterSheet/printedCharacterSheet.js
+++ /dev/null
@@ -1,80 +0,0 @@
-import QRCode from "qrcode"
-
-Template.printedCharacterSheet.onRendered(function(){
- // Quickfit is only called once on rendering, text will not resize reactively
- this.$(".shrink-to-fit").quickfit({
- min: 7,
- max: 36,
- truncate: true,
- });
- let url = `https://dicecloud.com/character/${this.data._id}`;
- let canvas = this.find("#qrCode");
- QRCode.toCanvas(canvas, url, {
- margin: 0,
- width: 200,
- }, function(error){
- $(canvas).css("width", "60px").css("height", "60px");
- if (error) console.error(error)
- });
-});
-
-Template.printedCharacterSheet.helpers({
- character(){
- return Characters.findOne(this._id);
- },
- classes: function(){
- return Classes.find({charId: this._id}, {sort: {createdAt: 1}});
- },
- weaponProfs: function(){
- var profs = Proficiencies.find({charId: this._id, type: "weapon"});
- return removeDuplicateProficiencies(profs);
- },
- armorProfs: function(){
- var profs = Proficiencies.find({charId: this._id, type: "armor"});
- return removeDuplicateProficiencies(profs);
- },
- toolProfs: function(){
- var profs = Proficiencies.find({charId: this._id, type: "tool"});
- return removeDuplicateProficiencies(profs);
- },
- languageProfs: function(){
- var profs = Proficiencies.find({charId: this._id, type: "language"});
- profs = removeDuplicateProficiencies(profs);
- if (profs.length > 3){
- var halfway = Math.floor(profs.length / 2);
- var left = profs.slice(0, halfway);
- var right = profs.slice(halfway);
- return {left, right};
- } else {
- return {left: profs, right: []};
- }
- },
- attacks: function(){
- return Attacks.find(
- {charId: this._id, enabled: true},
- {sort: {color: 1, name: 1}});
- },
- hitDiceTotal: function(){
- let d6 = Characters.calculate.attributeValue(this._id, "d6HitDice");
- let d8 = Characters.calculate.attributeValue(this._id, "d8HitDice");
- let d10 = Characters.calculate.attributeValue(this._id, "d10HitDice");
- let d12 = Characters.calculate.attributeValue(this._id, "d12HitDice");
- d6 = d6 ? d6 + "d6" : "";
- d8 = d8 ? d8 + "d8" : "";
- d10 = d10 ? d10 + "d10" : "";
- d12 = d12 ? d12 + "d12" : "";
- return [d6, d8, d10, d12].filter(Boolean).join(" ");
- },
- characterUrl: function(){
- return `/character/${this._id}`
- },
-});
-
-Template.printedCharacterSheet.events({
- "click .printButton": function(event, instance){
- print();
- },
- "click .backButton": function(event, instance){
- history && history.back();
- },
-});
diff --git a/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.css b/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.css
deleted file mode 100644
index 724a727c..00000000
--- a/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.css
+++ /dev/null
@@ -1,20 +0,0 @@
-.printedLongStat .title {
- white-space: nowrap;
- margin-left: 2mm;
-}
-
-.printedLongStat .numbers {
- z-index: 1;
- min-width: 74px;
- min-height: 45px;
-}
-
-.printed .printedLongStat.double-border{
- padding: 0;
-}
-
-.printed .printedLongStat.double-border:before {
- top: 4px;
- bottom: 4px;
- left: 33px;
-}
diff --git a/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.html b/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.html
deleted file mode 100644
index 06b4d06e..00000000
--- a/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- {{#if stat}}
- {{#if isSkill}}
- {{prefix}}{{skillMod}}
- {{else}}
- {{prefix}}{{characterCalculate "attributeValue" ../_id stat}}
- {{/if}}
- {{/if}}
-
-
- {{name}}
-
-
-
diff --git a/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.js b/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.js
deleted file mode 100644
index ea1cb92d..00000000
--- a/app/client/views/character/printedCharacterSheet/printedLongStat/printedLongStat.js
+++ /dev/null
@@ -1,9 +0,0 @@
-Template.printedLongStat.helpers({
- skillMod: function() {
- return signedString(
- Characters.calculate.skillMod(
- Template.parentData()._id, this.stat
- )
- );
- },
-});
diff --git a/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.css b/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.css
deleted file mode 100644
index 12be1f4d..00000000
--- a/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.printedProficiency iron-icon {
- margin-right: 2mm;
-}
diff --git a/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.html b/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.html
deleted file mode 100644
index 276f5856..00000000
--- a/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
diff --git a/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.js b/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.js
deleted file mode 100644
index 1c3d1d69..00000000
--- a/app/client/views/character/printedCharacterSheet/printedProficiency/printedProficiency.js
+++ /dev/null
@@ -1,40 +0,0 @@
-Template.printedProficiency.helpers({
- profIcon: function(){
- var prof = this.value;
- if (prof > 0 && prof < 1) return "image:brightness-2";
- if (prof === 1) return "image:brightness-1";
- if (prof > 1) return "av:album";
- return "radio-button-off";
- },
- getName: function(){
- if (this.type === "skill") return skills[this.name];
- if (this.type === "save") return saves[this.name];
- return this.name;
- },
-});
-
-Template.printedProficiency.events({
- "click .proficiency": function(event, instance){
- if (this.parent.collection == "Characters") {
- if (this.parent.group == "background") {
- pushDialogStack({
- template: "backgroundDialog",
- data: {
- "charId": this.charId,
- "field":"background",
- "title":"Background",
- "color":"j",
- },
- element: event.currentTarget,
- })
- return;
- }
- }
-
- openParentDialog({
- parent: this.parent,
- charId: this.charId,
- element: event.currentTarget,
- });
- }
-});
diff --git a/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.css b/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.css
deleted file mode 100644
index 634fd5d1..00000000
--- a/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.css
+++ /dev/null
@@ -1,10 +0,0 @@
-.printedSkillRow {
- height: 24px;
- min-width: 140px;
-}
-
-.printedSkillRow .skill-mod {
- width: 36px;
- text-align: center;
- font-size: 3.5mm;
-}
diff --git a/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.html b/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.html
deleted file mode 100644
index cee2c576..00000000
--- a/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- {{#if failSkill}}
-
fail
- {{else}}
-
- {{skillMod}}
-
- {{/if}}
-
- {{name}}
- {{#if conditionalCount}}
- *
- {{/if}}
- {{#if showPassive}}
- ({{characterCalculate "passiveSkill" ../_id skill}})
- {{/if}}
-
-
-
diff --git a/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.js b/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.js
deleted file mode 100644
index 66ff3757..00000000
--- a/app/client/views/character/printedCharacterSheet/printedSkillRow/printedSkillRow.js
+++ /dev/null
@@ -1,41 +0,0 @@
-Template.printedSkillRow.helpers({
- skillMod: function() {
- return signedString(
- Characters.calculate.skillMod(
- Template.parentData()._id, this.skill
- )
- );
- },
- profIcon: function(){
- var charId = Template.parentData()._id;
- var prof = Characters.calculate.proficiency(charId, this.skill);
- if (prof > 0 && prof < 1) return "image:brightness-2";
- if (prof === 1) return "image:brightness-1";
- if (prof > 1) return "av:album";
- return "radio-button-unchecked";
- },
- failSkill: function(){
- var charId = Template.parentData()._id;
- return Effects.find({
- charId: charId,
- stat: this.skill,
- enabled: true,
- operation: "fail",
- }).count();
- },
- advantage: function(){
- var charId = Template.parentData()._id;
- var advantage = Characters.calculate.advantage(charId, this.skill);
- if (advantage > 0) return "advantage";
- if (advantage < 0) return "disadvantage";
- },
- conditionalCount: function(){
- var charId = Template.parentData()._id;
- return Effects.find({
- charId: charId,
- stat: this.skill,
- enabled: true,
- operation: "conditional",
- }).count();
- },
-});
diff --git a/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.css b/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.css
deleted file mode 100644
index 4cf5ab13..00000000
--- a/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.printedSquareStat {
- min-width: 67px;
-}
-
-.printedSquareStat .title.paper-font-subhead {
- font-size: 2.5mm !important;
-}
diff --git a/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.html b/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.html
deleted file mode 100644
index f217af9e..00000000
--- a/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- {{#if isSkill}}
- {{prefix}}{{skillMod}}
- {{else}}
- {{prefix}}{{characterCalculate "attributeValue" ../_id stat}}
- {{/if}}
-
-
- {{name}}
-
-
-
diff --git a/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.js b/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.js
deleted file mode 100644
index 680f5f16..00000000
--- a/app/client/views/character/printedCharacterSheet/printedSquareStat/printedSquareStat.js
+++ /dev/null
@@ -1,9 +0,0 @@
-Template.printedSquareStat.helpers({
- skillMod: function() {
- return signedString(
- Characters.calculate.skillMod(
- Template.parentData()._id, this.stat
- )
- );
- },
-});
diff --git a/app/client/views/character/proficiencies/proficiencyEdit/proficiencyEdit.html b/app/client/views/character/proficiencies/proficiencyEdit/proficiencyEdit.html
deleted file mode 100644
index 522e9b0a..00000000
--- a/app/client/views/character/proficiencies/proficiencyEdit/proficiencyEdit.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
- {{> UI.dynamic template=nameInputTemplate}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/client/views/character/proficiencies/proficiencyEdit/proficiencyEdit.js b/app/client/views/character/proficiencies/proficiencyEdit/proficiencyEdit.js
deleted file mode 100644
index fdacf251..00000000
--- a/app/client/views/character/proficiencies/proficiencyEdit/proficiencyEdit.js
+++ /dev/null
@@ -1,87 +0,0 @@
-var profTypes = [
- {type: "skill", name: "Skill"},
- {type: "save", name: "Saving Throw"},
- {type: "weapon", name: "Weapon"},
- {type: "armor", name: "Armor"},
- {type: "tool", name: "Tool"},
- {type: "language", name: "Language"},
-];
-
-var saves = [
- {name: "Strength Save", stat: "strengthSave"},
- {name: "Dexterity Save", stat: "dexteritySave"},
- {name: "Constitution Save", stat: "constitutionSave"},
- {name: "Intelligence Save", stat: "intelligenceSave"},
- {name: "Wisdom Save", stat: "wisdomSave"},
- {name: "Charisma Save", stat: "charismaSave"},
-];
-
-var skills = [
- {name: "Acrobatics", stat: "acrobatics"},
- {name: "Animal Handling", stat: "animalHandling"},
- {name: "Arcana", stat: "arcana"},
- {name: "Athletics", stat: "athletics"},
- {name: "Deception", stat: "deception"},
- {name: "History", stat: "history"},
- {name: "Insight", stat: "insight"},
- {name: "Intimidation", stat: "intimidation"},
- {name: "Investigation", stat: "investigation"},
- {name: "Medicine", stat: "medicine"},
- {name: "Nature", stat: "nature"},
- {name: "Perception", stat: "perception"},
- {name: "Performance", stat: "performance"},
- {name: "Persuasion", stat: "persuasion"},
- {name: "Religion", stat: "religion"},
- {name: "Sleight of Hand", stat: "sleightOfHand"},
- {name: "Stealth", stat: "stealth"},
- {name: "Survival", stat: "survival"},
- {name: "Initiative", stat: "initiative"},
-];
-
-Template.proficiencyEdit.helpers({
- proficiencyTypes: function(){
- return profTypes;
- },
- nameInputTemplate: function(){
- if (!this.type) return null;
- if (this.type === "skill" ||
- this.type === "save") return "nameDropdown";
- return "nameInput";
- },
-});
-
-Template.proficiencyEdit.events({
- "click .deleteProficiency": function(event){
- Proficiencies.softRemoveNode(this._id);
- GlobalUI.deletedToast(this._id, "Proficiencies", "Proficiency");
- },
- "iron-select .typeDropDown": function(event){
- var detail = event.originalEvent.detail;
- var type = detail.item.getAttribute("name");
- if (type == this.type) return;
- Proficiencies.update(this._id, {$set: {type: type}});
- },
- "iron-select .valueDropDown": function(event){
- var detail = event.originalEvent.detail;
- var value = +detail.item.getAttribute("name");
- if (value == this.value) return;
- Proficiencies.update(this._id, {$set: {value: value}});
- },
- "iron-select .nameDropDown": function(event){
- var detail = event.originalEvent.detail;
- var name = detail.item.getAttribute("name");
- if (name == this.name) return;
- Proficiencies.update(this._id, {$set: {name: name}});
- },
- "change .nameInput": function(event){
- var name = event.currentTarget.value;
- Proficiencies.update(this._id, {$set: {name: name}});
- },
-});
-
-Template.nameDropdown.helpers({
- nameDropdownItems: function(){
- if (this.type === "skill") return skills;
- if (this.type === "save") return saves;
- }
-});
diff --git a/app/client/views/character/proficiencies/proficiencyEditList/proficiencyEditList.html b/app/client/views/character/proficiencies/proficiencyEditList/proficiencyEditList.html
deleted file mode 100644
index e0f6d090..00000000
--- a/app/client/views/character/proficiencies/proficiencyEditList/proficiencyEditList.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
- {{#if proficiencies.count}}
-
-
Proficiencies
- {{#each proficiencies}}
- {{>proficiencyEdit}}
- {{/each}}
-
- {{/if}}
-
- Add Proficiency
-
-
diff --git a/app/client/views/character/proficiencies/proficiencyEditList/proficiencyEditList.js b/app/client/views/character/proficiencies/proficiencyEditList/proficiencyEditList.js
deleted file mode 100644
index 893ce18a..00000000
--- a/app/client/views/character/proficiencies/proficiencyEditList/proficiencyEditList.js
+++ /dev/null
@@ -1,31 +0,0 @@
-Template.proficiencyEditList.helpers({
- proficiencies: function(){
- var selector = {
- "parent.id": this.parentId,
- "charId": this.charId,
- };
- if (this.parentGroup){
- selector["parent.group"] = this.parentGroup;
- }
- return Proficiencies.find(selector);
- }
-});
-
-Template.proficiencyEditList.events({
- "tap #addProficiencyButton": function(){
- if (!_.isBoolean(this.enabled)) {
- this.enabled = true;
- }
- Proficiencies.insert({
- charId: this.charId,
- parent: {
- id: this.parentId,
- collection: this.parentCollection,
- group: this.parentGroup,
- },
- enabled: this.enabled,
- value: 1,
- type: "skill",
- });
- },
-});
diff --git a/app/client/views/character/proficiencies/proficiencyListItem/proficiencyListItem.html b/app/client/views/character/proficiencies/proficiencyListItem/proficiencyListItem.html
deleted file mode 100644
index a40f715a..00000000
--- a/app/client/views/character/proficiencies/proficiencyListItem/proficiencyListItem.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
diff --git a/app/client/views/character/proficiencies/proficiencyListItem/proficiencyListItem.js b/app/client/views/character/proficiencies/proficiencyListItem/proficiencyListItem.js
deleted file mode 100644
index 6b667474..00000000
--- a/app/client/views/character/proficiencies/proficiencyListItem/proficiencyListItem.js
+++ /dev/null
@@ -1,40 +0,0 @@
-Template.proficiencyListItem.helpers({
- profIcon: function(){
- var prof = this.value;
- if (prof > 0 && prof < 1) return "image:brightness-2";
- if (prof === 1) return "image:brightness-1";
- if (prof > 1) return "av:album";
- return "radio-button-off";
- },
- getName: function(){
- if (this.type === "skill") return skills[this.name];
- if (this.type === "save") return saves[this.name];
- return this.name;
- },
-});
-
-Template.proficiencyListItem.events({
- "click .proficiency": function(event, instance){
- if (this.parent.collection == "Characters") {
- if (this.parent.group == "background") {
- pushDialogStack({
- template: "backgroundDialog",
- data: {
- "charId": this.charId,
- "field":"background",
- "title":"Background",
- "color":"j",
- },
- element: event.currentTarget,
- })
- return;
- }
- }
-
- openParentDialog({
- parent: this.parent,
- charId: this.charId,
- element: event.currentTarget,
- });
- }
-});
diff --git a/app/client/views/character/proficiencies/proficiencyView/proficiencyView.html b/app/client/views/character/proficiencies/proficiencyView/proficiencyView.html
deleted file mode 100644
index cb1d97d5..00000000
--- a/app/client/views/character/proficiencies/proficiencyView/proficiencyView.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
diff --git a/app/client/views/character/proficiencies/proficiencyView/proficiencyView.js b/app/client/views/character/proficiencies/proficiencyView/proficiencyView.js
deleted file mode 100644
index 88a72cfd..00000000
--- a/app/client/views/character/proficiencies/proficiencyView/proficiencyView.js
+++ /dev/null
@@ -1,45 +0,0 @@
-var saves = {
- strengthSave: "Strength Save",
- dexteritySave: "Dexterity Save",
- constitutionSave: "Constitution Save",
- intelligenceSave: "Intelligence Save",
- wisdomSave: "Wisdom Save",
- charismaSave: "Charisma Save",
-};
-
-var skills = {
- acrobatics: "Acrobatics",
- animalHandling: "Animal Handling",
- arcana: "Arcana",
- athletics: "Athletics",
- deception: "Deception",
- history: "History",
- insight: "Insight",
- intimidation: "Intimidation",
- investigation: "Investigation",
- medicine: "Medicine",
- nature: "Nature",
- perception: "Perception",
- performance: "Performance",
- persuasion: "Persuasion",
- religion: "Religion",
- sleightOfHand: "Sleight of Hand",
- stealth: "Stealth",
- survival: "Survival",
- initiative: "Initiative",
-};
-
-Template.proficiencyView.helpers({
- profIcon: function(){
- var prof = this.value;
- if (prof > 0 && prof < 1) return "image:brightness-2";
- if (prof === 1) return "image:brightness-1";
- if (prof > 1) return "av:album";
- return "radio-button-off";
- },
- getName: function(){
- if (this.type === "skill") return skills[this.name];
- if (this.type === "save") return saves[this.name];
- return this.name;
- },
-});
diff --git a/app/client/views/character/proficiencies/proficiencyViewList/proficiencyViewList.html b/app/client/views/character/proficiencies/proficiencyViewList/proficiencyViewList.html
deleted file mode 100644
index 3cd2512f..00000000
--- a/app/client/views/character/proficiencies/proficiencyViewList/proficiencyViewList.html
+++ /dev/null
@@ -1,12 +0,0 @@
-
- {{#if proficiencies.count}}
-
-
- Proficiencies
-
- {{#each proficiencies}}
- {{> proficiencyView}}
- {{/each}}
-
- {{/if}}
-
diff --git a/app/client/views/character/proficiencies/proficiencyViewList/proficiencyViewList.js b/app/client/views/character/proficiencies/proficiencyViewList/proficiencyViewList.js
deleted file mode 100644
index 1a26036f..00000000
--- a/app/client/views/character/proficiencies/proficiencyViewList/proficiencyViewList.js
+++ /dev/null
@@ -1,12 +0,0 @@
-Template.proficiencyViewList.helpers({
- proficiencies: function(){
- var selector = {
- "parent.id": this.parentId,
- "charId": this.charId,
- };
- if (this.parentGroup){
- selector["parent.group"] = this.parentGroup;
- }
- return Proficiencies.find(selector);
- }
-});
diff --git a/app/client/views/character/spells/spellDialog/spellDialog.css b/app/client/views/character/spells/spellDialog/spellDialog.css
deleted file mode 100644
index 322ecc5b..00000000
--- a/app/client/views/character/spells/spellDialog/spellDialog.css
+++ /dev/null
@@ -1,7 +0,0 @@
-.spell-dialog paper-checkbox {
- margin: 8px;
-}
-
-.spell-dialog paper-dropdown-menu, .spell-dialog paper-input {
- margin: 0 4px;
-}
diff --git a/app/client/views/character/spells/spellDialog/spellDialog.html b/app/client/views/character/spells/spellDialog/spellDialog.html
deleted file mode 100644
index 80403084..00000000
--- a/app/client/views/character/spells/spellDialog/spellDialog.html
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
- {{#with spell}}
- {{#baseDialog title=name class=colorClass startEditing=../startEditing}}
- {{> spellDetails}}
- {{else}}
- {{> spellEdit}}
- {{/baseDialog}}
- {{/with}}
-
-
-
-
-
- {{schoolAndLevel}}{{#if ritual}} (ritual){{/if}}, {{preparedString}}
-
-
- {{#if castingTime}}
-
- Casting Time: {{castingTime}}
-
- {{/if}}
- {{#if range}}
-
- Range: {{range}}
-
- {{/if}}
- {{#if getComponents}}
-
- Components: {{getComponents}}
-
- {{/if}}
- {{#if duration}}
-
- Duration: {{duration}}
-
- {{/if}}
-
- {{#markdown}}{{evaluateSpellString charId parent.id description}}{{/markdown}}
- {{> attacksViewList charId=charId parentId=_id}}
- {{> customBuffViewList charId=charId parentId=_id}}
-
-
-
-
-
-
-
- {{#each spellLists}}
-
- {{/each}}
-
-
-
-
-
-
- {{#each spellLevels}}
-
- {{/each}}
-
-
-
-
- {{#each magicSchools}}
-
- {{/each}}
-
-
-
-
- {{#each preparedOptions}}
-
- {{/each}}
-
-
-
- Ritual
-
-
-
-
-
-
- Verbal
-
-
- Somatic
-
-
-
-
-
-
-
-
-
- {{> customBuffEditList parentId=_id parentCollection="Spells" charId=charId}}
- {{> attackEditList parentId=_id parentCollection="Spells" charId=charId enabled=true name=name isSpell=true}}
-
diff --git a/app/client/views/character/spells/spellDialog/spellDialog.js b/app/client/views/character/spells/spellDialog/spellDialog.js
deleted file mode 100644
index b7b65861..00000000
--- a/app/client/views/character/spells/spellDialog/spellDialog.js
+++ /dev/null
@@ -1,182 +0,0 @@
-var spellLevels = [
- {name: "Cantrip", level: 0},
- {name: "Level 1", level: 1},
- {name: "Level 2", level: 2},
- {name: "Level 3", level: 3},
- {name: "Level 4", level: 4},
- {name: "Level 5", level: 5},
- {name: "Level 6", level: 6},
- {name: "Level 7", level: 7},
- {name: "Level 8", level: 8},
- {name: "Level 9", level: 9},
-];
-
-Template.spellDialog.helpers({
- spell: function(){
- return Spells.findOne(this.spellId);
- }
-});
-
-Template.spellDialog.events({
- "color-change": function(event, instance){
- Spells.update(instance.data.spellId, {$set: {color: event.color}});
- },
- "tap #deleteButton": function(event, instance){
- Spells.softRemoveNode(instance.data.spellId);
- GlobalUI.deletedToast(instance.data.spellId, "Spells", "Spell");
- popDialogStack();
- },
-});
-
-Template.spellDetails.helpers({
- schoolAndLevel: function(){
- if (this.level == 0) {
- return this.school + " cantrip";
- } else {
- return "Level " + this.level + " " + this.school;
- }
- },
- getComponents: function(){
- var components = "";
- if (this.components.concentration) components += "C";
- if (this.components.verbal) components += components.length ? ", V" : "V";
- if (this.components.somatic) components += components.length ? ", S" : "S";
- if (this.components.material) {
- components += components.length ? ", M" : "M";
- components += " (" + this.components.material + ")";
- }
- return components;
- },
- preparedString: function(){
- if (this.prepared === "prepared") return "prepared";
- if (this.prepared === "unprepared") return "unprepared";
- if (this.prepared === "always") return "always prepared";
- },
-});
-
-Template.spellEdit.helpers({
- spellLists: function(){
- return SpellLists.find({charId: this.charId}, {fields: {name: 1}});
- },
- magicSchools: function(){
- return magicSchools;
- },
- spellLevels: function(){
- return spellLevels;
- },
- preparedOptions: function(){
- return [
- {name: "Prepared", value: "prepared"},
- {name: "Unprepared", value: "unprepared"},
- {name: "Always Prepared", value: "always"},
- ];
- },
-});
-
-const debounce = (f) => _.debounce(f, 300);
-
-Template.spellEdit.events({
- "change #spellNameInput, input #spellNameInput": debounce(function(event){
- const input = event.currentTarget;
- var value = input.value;
- if (!value){
- input.invalid = true;
- input.errorMessage = "Name is required";
- } else {
- input.invalid = false;
- Spells.update(this._id, {
- $set: {name: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }
- }),
- "change #castingTimeInput, input #castingTimeInput": debounce(function(event){
- var value = event.currentTarget.value;
- Spells.update(this._id, {
- $set: {castingTime: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "change #rangeInput, input #rangeInput": debounce(function(event){
- var value = event.currentTarget.value;
- Spells.update(this._id, {
- $set: {range: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "change #durationInput, input #durationInput": debounce(function(event){
- var value = event.currentTarget.value;
- Spells.update(this._id, {
- $set: {duration: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "change #materialInput, input #materialInput": debounce(function(event){
- var value = event.currentTarget.value;
- Spells.update(this._id, {
- $set: {"components.material": value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #descriptionInput": debounce(function(event){
- var value = event.currentTarget.value;
- Spells.update(this._id, {
- $set: {"description": value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "iron-select #listDropdown": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- if (value == this.parent.id) return;
- Spells.update(this._id, {
- $set: {"parent.id": value}
- });
- },
- "iron-select #levelDropdown": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- if (value == this.level) return;
- Spells.update(this._id, {$set: {level: value}});
- },
- "iron-select #schoolDropdown": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- if (value == this.school) return;
- Spells.update(this._id, {$set: {school: value}});
- },
- "iron-select #preparedDropdown": function(event){
- var detail = event.originalEvent.detail;
- var value = detail.item.getAttribute("name");
- if (value == this.school) return;
- Spells.update(this._id, {$set: {prepared: value}});
- },
- "change #verbalCheckbox": function(event){
- var value = event.currentTarget.checked;
- Spells.update(this._id, {$set: {"components.verbal": value}});
- },
- "change #somaticCheckbox": function(event){
- var value = event.currentTarget.checked;
- Spells.update(this._id, {$set: {"components.somatic": value}});
- },
- "change #concentrationCheckbox": function(event){
- var value = event.currentTarget.checked;
- Spells.update(this._id, {$set: {"components.concentration": value}});
- },
- "change #ritualCheckbox": function(event){
- var value = event.currentTarget.checked;
- Spells.update(this._id, {$set: {"ritual": value}});
- },
-});
diff --git a/app/client/views/character/spells/spellListDialog/spellListDialog.css b/app/client/views/character/spells/spellListDialog/spellListDialog.css
deleted file mode 100644
index bb3c280d..00000000
--- a/app/client/views/character/spells/spellListDialog/spellListDialog.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.spellListDialog .colorDropdown {
- top: 0;
-}
\ No newline at end of file
diff --git a/app/client/views/character/spells/spellListDialog/spellListDialog.html b/app/client/views/character/spells/spellListDialog/spellListDialog.html
deleted file mode 100644
index f78259e4..00000000
--- a/app/client/views/character/spells/spellListDialog/spellListDialog.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
- {{#with spellList}}
- {{#baseDialog title=name class=colorClass startEditing=../startEditing}}
-
-
- {{#if attackBonus}}
-
- Attack Bonus: {{evaluateSigned charId attackBonus}}
-
- {{/if}}
- {{#if saveDC}}
-
- Save DC: {{evaluate charId saveDC}}
-
- {{/if}}
- {{#if maxPrepared}}
-
- Max Prepared Spells: {{evaluate charId maxPrepared}}
-
- {{/if}}
-
-
-
{{#markdown}}{{evaluateString charId description}}{{/markdown}}
-
- {{else}}
-
-
-
-
-
-
- {{> formulaSuffix}}
-
-
-
- {{> formulaSuffix}}
-
-
-
- {{> formulaSuffix}}
-
-
-
-
- {{/baseDialog}}
- {{/with}}
-
diff --git a/app/client/views/character/spells/spellListDialog/spellListDialog.js b/app/client/views/character/spells/spellListDialog/spellListDialog.js
deleted file mode 100644
index c967d72c..00000000
--- a/app/client/views/character/spells/spellListDialog/spellListDialog.js
+++ /dev/null
@@ -1,80 +0,0 @@
-Template.spellListDialog.helpers({
- spellList: function(){
- return SpellLists.findOne(this.spellListId);
- }
-});
-
-const debounce = (f) => _.debounce(f, 300);
-
-Template.spellListDialog.events({
- "color-change": function(event, instance){
- SpellLists.update(instance.data.spellListId, {$set: {color: event.color}});
- },
- "click #deleteButton": function(event, instance){
- SpellLists.softRemoveNode(instance.data.spellListId);
- GlobalUI.deletedToast(
- instance.data.spellListId,
- "SpellLists",
- "Spell list and contents"
- );
- popDialogStack();
- },
- //TODO clean up String -> num here so they don't need casting by Schema.clean
- //TODO validate input (integer, non-negative, etc) for these inputs and give validation errors
- "change #spellListNameInput, input #spellListNameInput":
- debounce(function(event){
- const input = event.currentTarget;
- var value = input.value;
- if (!value){
- input.invalid = true;
- input.errorMessage = "Name is required";
- } else {
- input.invalid = false;
- SpellLists.update(this._id, {
- $set: {name: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }
- }),
- "change #spellListSaveDCInput, input #spellListSaveDCInput":
- debounce(function(event){
- var value = event.currentTarget.value;
- SpellLists.update(this._id, {
- $set: {saveDC: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "change #spellListAttackBonusInput, input #spellListAttackBonusInput":
- debounce(function(event){
- var value = event.currentTarget.value;
- SpellLists.update(this._id, {
- $set: {attackBonus: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "change #spellListMaxPreparedInput, input #spellListMaxPreparedInput":
- debounce(function(event){
- var value = event.currentTarget.value;
- SpellLists.update(this._id, {
- $set: {maxPrepared: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
- "input #spellListDescriptionInput": debounce(function(event){
- var value = event.currentTarget.value;
- SpellLists.update(this._id, {
- $set: {description: value}
- }, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- }),
-});
diff --git a/app/client/views/character/spells/spells.css b/app/client/views/character/spells/spells.css
deleted file mode 100644
index d71097fe..00000000
--- a/app/client/views/character/spells/spells.css
+++ /dev/null
@@ -1,101 +0,0 @@
-#spells .containerMain {
- padding: 0 0 16px 0;
-}
-
-#spells .inventoryItem {
- height: 56px;
-}
-
-#spells .inventoryItem iron-icon{
- width: 32px;
- height: 32px;
-}
-
-#spells .inventoryItem[disabled] {
- color: #ccc !important;
- color: rgba(0,0,0,0.26) !important;
- pointer-events: initial !important;
- cursor: pointer !important;
-}
-
-#spells .inventoryItem[disabled] iron-icon{
- color: #ccc !important;
- color: rgba(0,0,0,0.26) !important;
-}
-
-#spells .inventoryItem paper-checkbox{
- pointer-events: initial !important;
-}
-
-#spells paper-checkbox /deep/ #ink {
- color: #009688;
-}
-
-#spells .inventoryItem.spellSlot {
- height: 48px;
-}
-
-.slotName {
- margin-right: 16px;
-}
-
-.slotBubble {
- pointer-events: initial !important;
-}
-
-.slotBubble {
- color: #000;
- color: rgba(0,0,0,0.54);
-}
-
-.slotBubble[disabled] {
- color: #cccccc;
- color: rgba(0,0,0,0.26);
-}
-
-.spellsContainer{
- padding: 4px;
-}
-
-.card.spellList {
- min-width: 280px;
- margin: 4px;
-}
-
-.card.spellSlotContainer {
- width: initial;
- margin: 4px;
-}
-
-.spellList.card .bottom.list {
- column-width: 300px;
- column-gap: 8px;
- column-fill: balance;
- padding: 16px 4px;
-}
-
-.spellList .bottom .paper-font-subhead {
- margin-left: 16px;
-}
-
-.spell.item > div > div {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.spell.item > div {
- min-width: 0;
-}
-
-.spell.item iron-icon {
- flex-shrink: 0;
-}
-
-.spellLevel {
- -webkit-backface-visibility: hidden;
- -webkit-transform: translateX(0);
- -webkit-column-break-inside: avoid;
- page-break-inside: avoid;
- break-inside: avoid;
-}
diff --git a/app/client/views/character/spells/spells.html b/app/client/views/character/spells/spells.html
deleted file mode 100644
index c992daa4..00000000
--- a/app/client/views/character/spells/spells.html
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
- {{#if hasSlots}}
-
-
- Spell Slots
-
-
- {{#each levels}}{{#if showSlots ..}}
-
-
-
- {{name}}
-
-
- {{#each slotBubbles ..}}
-
-
- {{/each}}
-
-
-
- {{/if}}{{/each}}
-
-
- {{/if}}
- {{#each spellLists}}
-
-
-
-
{{name}}
-
- {{#if saveDC}}
-
- Save DC: {{evaluate charId saveDC}}
-
- {{/if}}
- {{#if attackBonus}}
-
- Attack Bonus: {{evaluateSigned charId attackBonus}}
-
- {{/if}}
-
-
- {{#if showUnprepared _id}}
- {{#if maxPrepared}}
-
- {{numPrepared}} / {{evaluate charId maxPrepared}}
-
- {{/if}}
-
-
-
- {{#simpleTooltip}}
- Done
- {{/simpleTooltip}}
-
- {{else}}
-
-
-
- {{#simpleTooltip}}
- Change prepared spells
- {{/simpleTooltip}}
-
- {{/if}}
-
-
- {{#each levels}}
-
- {{#if spellCount .. ../../_id}}
-
- {{name}}
-
- {{/if}}
- {{#each spells ../_id ../../_id}}
- {{#if showSpell ../../_id}}
-
-
-
-
-
{{name}}
-
- {{school}}
- {{castingTime}}
- {{#if ritual}}
- (ritual)
- {{/if}}
- {{#if spellComponents}}
- - {{spellComponents}}
- {{/if}}
-
-
- {{#if showUnprepared ../../_id}}
-
-
- {{/if}}
-
-
- {{/if}}
- {{/each}}
-
- {{/each}}
-
-
- {{/each}}
-
-
-
- {{#if canEditCharacter _id}}
- {{#fabMenu}}
-
-
-
- {{#simpleTooltip class="always"}}
- Spell list
- {{/simpleTooltip}}
-
-
-
-
- {{#simpleTooltip class="always"}}
- Spell from library
- {{/simpleTooltip}}
-
-
-
-
- {{#simpleTooltip class="always"}}
- Spell
- {{/simpleTooltip}}
-
- {{/fabMenu}}
- {{/if}}
-
diff --git a/app/client/views/character/spells/spells.js b/app/client/views/character/spells/spells.js
deleted file mode 100644
index df7a68af..00000000
--- a/app/client/views/character/spells/spells.js
+++ /dev/null
@@ -1,387 +0,0 @@
-var spellLevels = [
- {name: "Cantrips", level: 0},
- {name: "Level 1", level: 1},
- {name: "Level 2", level: 2},
- {name: "Level 3", level: 3},
- {name: "Level 4", level: 4},
- {name: "Level 5", level: 5},
- {name: "Level 6", level: 6},
- {name: "Level 7", level: 7},
- {name: "Level 8", level: 8},
- {name: "Level 9", level: 9},
-];
-
-var materialNeedsGp = function(string) {
- if (!string) return false;
- gpRegExp = /\b[0-9]+ ?(cp|sp|gp)\b/i;
- return gpRegExp.test(string);
-}
-
-const showUnprepared = (listId) => {
- return Session.get(`showUnprepared.${listId}`);
-}
-
-Template.spells.helpers({
- spellLists: function(){
- return SpellLists.find({charId: this._id}, {sort: {color: 1, name: 1}});
- },
- spellCount: function(list, charId){
- if (!list) return;
- if (showUnprepared(list._id)){
- return Spells.find(
- {charId: charId, "parent.id": list._id, level: this.level},
- {fields: {_id: 1, level: 1}}
- ).count() > 0;
- } else {
- return Spells.find(
- {
- charId: charId,
- "parent.id": list._id,
- level: this.level,
- prepared: {$in: ["prepared", "always"]},
- },
- {fields: {_id: 1, level: 1}}
- ).count() > 0;
- }
- },
- spells: function(listId, charId){
- return Spells.find(
- {charId: charId, "parent.id": listId, level: this.level},
- {sort: {color: 1, name: 1}}
- );
- },
- levels: function(){
- return spellLevels;
- },
- showUnprepared: function(listId){
- return showUnprepared(listId);
- },
- numPrepared: function(){
- return Spells.find({
- charId: Template.parentData()._id,
- "parent.id": this._id,
- prepared: "prepared",
- }).count();
- },
- order: function(){
- return _.indexOf(_.keys(colorOptions), this.color);
- },
- spellComponents: function(){
- var components = "";
- if (this.components.verbal){
- components += "V";
- }
- if (this.components.somatic){
- components += components ? ", S" : "S";
- }
- if (this.components.material){
- components += components ? ", M" : "M";
- if (materialNeedsGp(this.components.material)) {components += "gp";}
- }
- if (this.components.concentration){
- components += components ? ", C" : "C";
- }
- return components;
- },
- isPrepared: function(){
- return this.prepared === "prepared" || this.prepared === "always";
- },
- showSpell: function(listId){
- if (showUnprepared(listId)) {
- return true;
- } else {
- return this.prepared === "prepared" || this.prepared === "always";
- }
- },
- cantUnprepare: function(){
- return this.prepared === "always";
- },
- cantCast: function(level, char){
- for (var i = level; i <= 9; i++){
- if (Characters.calculate.attributeValue(
- char._id, "level" + i + "SpellSlots"
- ) > 0){
- return false;
- }
- }
- return true;
- },
- showSlots: function(char){
- return this.level && Characters.calculate.attributeBase(
- char._id, "level" + this.level + "SpellSlots"
- );
- },
- hasSlots: function(){
- for (var i = 1; i <= 9; i += 1){
- if (Characters.calculate.attributeBase(
- this._id, "level" + i + "SpellSlots"
- )){
- return true;
- }
- }
- return false;
- },
- slotBubbles: function(char){
- var baseSlots = Characters.calculate.attributeBase(
- char._id, "level" + this.level + "SpellSlots"
- );
- var currentSlots = Characters.calculate.attributeValue(
- char._id, "level" + this.level + "SpellSlots"
- );
- var slotsUsed = baseSlots - currentSlots;
- var bubbles = [];
- var i;
- for (i = 0; i < currentSlots; i++){
- bubbles.push({
- icon: "radio-button-checked",
- disabled: i !== currentSlots - 1 || !canEditCharacter(char._id), //last full slot not disabled
- attribute: "level" + this.level + "SpellSlots",
- charId: char._id,
- });
- }
- for (i = 0; i < slotsUsed; i++){
- bubbles.push({
- icon: "radio-button-unchecked",
- disabled: i !== 0 || !canEditCharacter(char._id), //first empty slot not disabled
- attribute: "level" + this.level + "SpellSlots",
- charId: char._id,
- });
- }
- return bubbles;
- },
- slotStatName: function() {
- return "level" + this.level + "SpellSlots";
- },
-});
-
-Template.spells.events({
- "click .slotBubble": function(event){
- var modifier;
- if (!event.currentTarget.disabled){
- var char = Characters.findOne(this.charId);
- if (event.currentTarget.icon === "radio-button-unchecked"){
- if (
- Characters.calculate.attributeValue(char._id, this.attribute) <
- Characters.calculate.attributeBase(char._id, this.attribute)
- ){
- modifier = {$inc: {}};
- modifier.$inc[this.attribute + ".adjustment"] = 1;
- Characters.update(this.charId, modifier, {validate: false});
- }
- } else {
- if (Characters.calculate.attributeValue(char._id, this.attribute) > 0){
- modifier = {$inc: {}};
- modifier.$inc[this.attribute + ".adjustment"] = -1;
- Characters.update(this.charId, modifier, {validate: false});
- }
- }
- }
- event.stopPropagation();
- },
- "click .spellSlot": function(event, instance) {
- var name = "Level " + this.level + " Spell Slots";
- var stat = "level" + this.level + "SpellSlots";
- var charId = instance.data._id;
- pushDialogStack({
- template: "attributeDialog",
- data: {name: name, statName: stat, charId: charId},
- element: event.currentTarget,
- });
- },
- "click .spellList .top": function(event){
- pushDialogStack({
- template: "spellListDialog",
- data: {spellListId: this._id, charId: this.charId},
- element: event.currentTarget.parentElement,
- });
- },
- "click .spell": function(event){
- pushDialogStack({
- template: "spellDialog",
- data: {spellId: this._id, charId: this.charId},
- element: event.currentTarget,
- });
- },
- "click .addSpellList": function(event, instance){
- var charId = this.charId;
- var id = SpellLists.insert({
- name: "New SpellList",
- charId: this._id,
- saveDC: "8 + intelligenceMod + proficiencyBonus",
- attackBonus: "intelligenceMod + proficiencyBonus",
- });
- pushDialogStack({
- template: "spellListDialog",
- data: {spellListId: id, charId: charId, startEditing: true},
- element: event.currentTarget,
- returnElement: () => instance.find(`.spellList[data-id='${id}']`),
- });
- },
- "click .addSpell": function(event, instance){
- var charId = this._id;
- var list = SpellLists.findOne({charId});
- var listId = list && list._id
- if (!listId){
- listId = SpellLists.insert({
- name: "New SpellList",
- charId: charId,
- saveDC: "8 + intelligenceMod + proficiencyBonus",
- attackBonus: "intelligenceMod + proficiencyBonus",
- });
- }
- var id = Spells.insert({
- name: "New Spell",
- charId: this._id,
- parent: {
- id: listId,
- collection: "SpellLists",
- },
- prepared: "prepared",
- });
- pushDialogStack({
- template: "spellDialog",
- data: {spellId: id, charId: charId, startEditing: true},
- element: event.currentTarget,
- returnElement: () => instance.find(`.spell[data-id='${id}']`),
- });
- },
- "click .librarySpell": function(event, instance){
- var charId = this._id;
- var spellId = Random.id();
- var list = SpellLists.findOne({charId});
- var listId = list && list._id
- pushDialogStack({
- template: "spellLibraryDialog",
- element: event.currentTarget,
- callback: (resultArray) => {
- if (!resultArray) return;
- if (!listId){
- listId = SpellLists.insert({
- name: "New SpellList",
- charId: charId,
- saveDC: "8 + intelligenceMod + proficiencyBonus",
- attackBonus: "intelligenceMod + proficiencyBonus",
- });
- }
-
- //loop through all returned spells
- _.each(resultArray, (rawSpell, index) =>{
- // Make the library spell into a regular spell
- let spell = _.omit(rawSpell, "_id", "library", "attacks", "effects");
- // Use the ID generated earlier for the first spell so we
- // can animate to it
- if (index == 0) {
- spell._id = spellId;
- }
- spell.charId = charId;
- spell.parent = {
- id: listId,
- collection: "SpellLists",
- };
- spell.prepared = "prepared";
- let insertedSpellId = Spells.insert(spell);
- // Copy over attacks and effects
- _.each(rawSpell.attacks, (attack) => {
- if (!("attackBonus" in attack)) {attack.attackBonus = "attackBonus"} //if no attack bonus provided, use spell list's
- attack.charId = charId;
- attack.parent = {id: insertedSpellId, collection: "Spells"};
- Attacks.insert(attack);
- });
- _.each(rawSpell.effects, (effect) => {
- effect.charId = charId;
- effect.parent = {id: insertedSpellId, collection: "Spells"};
- Effects.insert(effect);
- });
-
- _.each(rawSpell.buffs, (buff) => {
- buff.charId = charId;
- buff.parent = {id: insertedSpellId, collection: "Spells"};
- buffId = Buffs.insert(buff);
-
- _.each(buff.attacks, (attack) => {
- if (!(attackBonus in attack)) {attack.attackBonus = "attackBonus"} //if no attack bonus provided, use spell list's
- attack.charId = charId;
- attack.parent = {id: buffId, collection: "Buffs"};
- Attacks.insert(attack);
- });
- _.each(buff.effects, (effect) => {
- effect.charId = charId;
- effect.parent = {id: buffId, collection: "Buffs"};
- Effects.insert(effect);
- });
- _.each(buff.proficiencies, (prof) => {
- prof.charId = charId;
- prof.parent = {id: buffId, collection: "Buffs"};
- Proficiencies.insert(prof);
- });
- });
- });
- },
- returnElement: () => $(`[data-id='${spellId}']`).get(0),
- })
- },
- "click .preparedCheckbox": function(event){
- event.stopPropagation();
- },
- "change .preparedCheckbox": function(event){
- var value = event.currentTarget.checked;
- if (this.prepared === "unprepared" && value)
- Spells.update(this._id, {$set: {prepared: "prepared"}});
- else if (this.prepared === "prepared" && !value)
- Spells.update(this._id, {$set: {prepared: "unprepared"}});
- },
- "click .prepSpells": function(event){
- Session.set(`showUnprepared.${this._id}`, true);
- event.stopPropagation();
- },
- "click .finishPrep": function(event){
- Session.set(`showUnprepared.${this._id}`, false);
- event.stopPropagation();
- },
-});
-
-Template.layout.events({
- "dragstart .spellItem": function(event, instance){
- event.originalEvent.dataTransfer.setData("dicecloud-id/spells", this._id);
- Session.set("spellLists.dragSpellId", this._id);
- },
- "dragend .spellItem": function(event, instance){
- Session.set("spellLists.dragSpellId", null);
- },
-
- "dragover .spellList, dragenter .spellList": function(event, instance){
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/spells")){
- event.preventDefault();
- }
- },
- "drop .spellList": function(event, instance){
- var spellId = event.originalEvent.dataTransfer.getData("dicecloud-id/spells");
- if (event.ctrlKey){
- //copy spell to new list
- Meteor.call("copySpellToList", spellId, this._id);
- } else {
- //move spell to new list
- Meteor.call("moveSpellToList", spellId, this._id);
- }
- Session.set("spellLists.dragSpellId", null);
- },
-
- "dragover .characterRepresentative, dragenter .characterRepresentative": function(event, instance){
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/spells")){
- event.preventDefault();
- }
- },
- "drop .characterRepresentative": function(event, instance) {
- if (_.contains(event.originalEvent.dataTransfer.types, "dicecloud-id/spells")){ //to prevent conflicts with item drag/drop
- var spellId = event.originalEvent.dataTransfer.getData("dicecloud-id/spells");
- if (event.ctrlKey){
- //copy spell to character
- Meteor.call("copySpellToCharacter", spellId, this._id);
- } else {
- //move spell to character
- Meteor.call("moveSpellToCharacter", spellId, this._id);
- }
- Session.set("spellLists.dragSpellId", null);
- }
- },
-});
diff --git a/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.css b/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.css
deleted file mode 100644
index 64ade5b8..00000000
--- a/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.spell-library-dialog .category-header {
- font-size: 16px;
-}
-
-.spell-library-dialog .category-header iron-icon {
- transition: transform 0.3s ease;
-}
-
-.spell-library-dialog .category-header iron-icon.open {
- transform: rotate(90deg);
-}
diff --git a/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.html b/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.html
deleted file mode 100644
index 2a13b43d..00000000
--- a/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.html
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
- Spells
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.js b/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.js
deleted file mode 100644
index c8cab1d2..00000000
--- a/app/client/views/character/spells/spellsLibraryDialog/spellLibraryDialog.js
+++ /dev/null
@@ -1,135 +0,0 @@
-const librarySubs = new SubsManager();
-
-const categories = [
- {name: "Cantrips", key: 0},
- {name: "Level 1", key: 1},
- {name: "Level 2", key: 2},
- {name: "Level 3", key: 3},
- {name: "Level 4", key: 4},
- {name: "Level 5", key: 5},
- {name: "Level 6", key: 6},
- {name: "Level 7", key: 7},
- {name: "Level 8", key: 8},
- {name: "Level 9", key: 9},
-];
-
-Template.spellLibraryDialog.onCreated(function(){
- this.selectedSpells = new ReactiveVar([]); //this holds an array of the selected spells by ID
- this.searchTerm = new ReactiveVar();
- this.categoriesOpen = new ReactiveVar([]);
- this.readyDict = new ReactiveDict();
- this.searchReady = new ReactiveVar();
- librarySubs.subscribe("standardLibraries");
- this.autorun(() => {
- // Subscribe to all open categories
- _.each(this.categoriesOpen.get(), (key) => {
- var handle = librarySubs.subscribe("standardLibrarySpells", key);
- this.autorun(() => {
- this.readyDict.set(key, handle.ready());
- });
- });
- });
- this.autorun(() => {
- // If we are searching, subscibe to all categories
- if (this.searchTerm.get()){
- let handles = _.map(categories, category =>
- librarySubs.subscribe("standardLibrarySpells", category.key)
- );
- // Ready when all handles are ready
- this.autorun(() => {
- this.searchReady.set(_.every(handles, h => h.ready()));
- });
- }
- });
-});
-
-Template.spellLibraryDialog.helpers({
- ready(key){
- return Template.instance().readyDict.get(key);
- },
- categories(){
- return categories;
- },
- spellsInCategory(categoryKey){
- return LibrarySpells.find({
- library: "SRDLibraryGA3XWsd",
- level: categoryKey,
- }, {
- sort: {name: 1},
- });
- },
- isSelected(spell){
- const selected = Template.instance().selectedSpells.get();
- return _.contains(selected, spell._id);
- },
- selectedCount(){
- const selected = Template.instance().selectedSpells.get();
- return selected && selected.length;
- },
- isOpen(key){
- const cats = Template.instance().categoriesOpen.get();
- return _.contains(cats, key);
- },
- searchTerm(){
- return Template.instance().searchTerm.get();
- },
- searchReady(){
- return Template.instance().searchReady.get();
- },
- searchSpells(){
- const searchTerm = Template.instance().searchTerm.get();
- if (!searchTerm) return;
- return LibrarySpells.find({
- library: "SRDLibraryGA3XWsd",
- name: {
- $regex: new RegExp(".*" + searchTerm + ".*", "gi")
- },
- });
- },
-});
-
-Template.spellLibraryDialog.events({
- "click .cancelButton": function(event, template){
- popDialogStack();
- },
- "click .okButton": function(event, template){
- const selectedIds = template.selectedSpells.get();
- var returnSpells = [];
- _.each(selectedIds, (id) => {
- let spell = LibrarySpells.findOne(id);
- if (spell) {
- returnSpells.push(spell)
- }
- });
- popDialogStack(returnSpells);
- },
- "click .library-spell": function(event, template){
- let selected = template.selectedSpells.get();
- const spellId = this.spell._id;
- // Toggle whether this spellId is in the array or not
- if (_.contains(selected, spellId)){
- selected = _.without(selected, spellId);
- } else {
- selected.push(spellId);
- }
- template.selectedSpells.set(selected);
- },
- "click #backButton": function(event, template){
- popDialogStack();
- },
- "click .category-header": function(event, template){
- let cats = template.categoriesOpen.get();
- const key = this.key;
- // Toggle whether this key is in the array or not
- if (_.contains(cats, key)){
- cats = _.without(cats, key);
- } else {
- cats.push(key);
- }
- template.categoriesOpen.set(cats);
- },
- "input .search-input, change .search-input": function(event, template){
- const value = event.currentTarget.value;
- template.searchTerm.set(value);
- },
-});
diff --git a/app/client/views/character/stats/abilityCards/abilityCards.css b/app/client/views/character/stats/abilityCards/abilityCards.css
deleted file mode 100644
index 52be38a1..00000000
--- a/app/client/views/character/stats/abilityCards/abilityCards.css
+++ /dev/null
@@ -1,23 +0,0 @@
-.ability-mini-card {
- min-width: 75px;
- text-align: center;
- cursor: pointer;
- -webkit-margin-collapse: separate;
- background: #fff;
-}
-
-.ability-mini-card .title {
- padding: 16px;
-}
-
-.ability-mini-card .numbers {
- min-width: 72px;
- padding: 16px;
-}
-
-.ability-mini-card .modifier {
- font-weight: 600;
- font-size: 24px;
- color: #747474;
- color: rgba(0,0,0,0.54);
-}
diff --git a/app/client/views/character/stats/abilityCards/abilityCards.html b/app/client/views/character/stats/abilityCards/abilityCards.html
deleted file mode 100644
index 797c2ffb..00000000
--- a/app/client/views/character/stats/abilityCards/abilityCards.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- {{#if swap}}
-
- {{abilityMod}}
-
-
- {{characterCalculate "attributeValue" ../_id ability}}
-
- {{else}}
-
- {{characterCalculate "attributeValue" ../_id ability}}
-
-
- {{abilityMod}}
-
- {{/if}}
-
-
- {{title}}
-
-
-
-
diff --git a/app/client/views/character/stats/abilityCards/abilityCards.js b/app/client/views/character/stats/abilityCards/abilityCards.js
deleted file mode 100644
index 533d6708..00000000
--- a/app/client/views/character/stats/abilityCards/abilityCards.js
+++ /dev/null
@@ -1,14 +0,0 @@
-Template.abilityMiniCard.helpers({
- abilityMod: function() {
- return signedString(
- Characters.calculate.abilityMod(
- Template.parentData()._id, this.ability
- )
- );
- },
- swap: function() {
- var character = Characters.findOne({"_id": Template.parentData()._id})
- if (character) {return character.settings.swapStatAndModifier;}
- else {return false;}
- },
-});
diff --git a/app/client/views/character/stats/addEHPDialog/addEHPDialog.html b/app/client/views/character/stats/addEHPDialog/addEHPDialog.html
deleted file mode 100644
index bf7cab05..00000000
--- a/app/client/views/character/stats/addEHPDialog/addEHPDialog.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
- Add Hitpoint Slider
-
-
-
-
-
-
-
diff --git a/app/client/views/character/stats/addEHPDialog/addEHPDialog.js b/app/client/views/character/stats/addEHPDialog/addEHPDialog.js
deleted file mode 100644
index 8d2d3437..00000000
--- a/app/client/views/character/stats/addEHPDialog/addEHPDialog.js
+++ /dev/null
@@ -1,20 +0,0 @@
-Template.addEHPDialog.onRendered(function(){
- this.find("#quantityInput").focus();
-});
-
-Template.addEHPDialog.events({
- "tap .addButton": function(event, instance){
- popDialogStack();
- var max = +instance.find("#quantityInput").value;
- if (!max || max < 0) max = 0;
- TemporaryHitPoints.insert({
- charId: this.charId,
- name: instance.find("#nameInput").value,
- maximum: max,
- deleteOnZero: !!instance.find("#deleteWhenZeroCheckbox").checked,
- });
- },
- "tap .cancelButton": function(event, instance){
- popDialogStack();
- },
-});
diff --git a/app/client/views/character/stats/attributeDialog/attributeDialog.html b/app/client/views/character/stats/attributeDialog/attributeDialog.html
deleted file mode 100644
index 7d33a489..00000000
--- a/app/client/views/character/stats/attributeDialog/attributeDialog.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
- {{#baseDialog title=name class=color hideEdit=true}}
- {{> attributeDialogView}}
- {{/baseDialog}}
-
-
-
- {{#if showNewUserExperience}}
- {{#infoBox}}
-
- This dialog shows how your speed is set by the effect you added to your character's race.
-
-
- In DiceCloud you don't change stats directly, rather you add effects which impact your stats in different ways. This way, you can always tell where your stats came from, and how they got to their current value.
-
- {{/infoBox}}
- {{/if}}
-
-
- {{attributeValue}}
-
- {{#if adjustment}}
-
- /{{attributeBase}}
-
- {{/if}}
-
-
-
-
-
-
- {{#each baseEffects}}
-
- {{sourceName}}
- Base: {{statValue}}
-
- {{/each}}
- {{#each addEffects}}
-
- {{sourceName}}
- {{signedString statValue}}
-
- {{/each}}
- {{#each mulEffects}}
-
- {{sourceName}}
- × {{statValue}}
-
- {{/each}}
- {{#each minEffects}}
-
- {{sourceName}}
- Min: {{statValue}}
-
- {{/each}}
- {{#each maxEffects}}
-
- {{sourceName}}
- Max: {{statValue}}
-
- {{/each}}
- {{#if adjustment}}
-
- Base Value
- {{attributeBase}}
-
-
- Adjustment
- {{signedString adjustment}}
-
- {{/if}}
-
- Total
- {{attributeValue}}
-
-
-
-
diff --git a/app/client/views/character/stats/attributeDialog/attributeDialog.js b/app/client/views/character/stats/attributeDialog/attributeDialog.js
deleted file mode 100644
index 5c145202..00000000
--- a/app/client/views/character/stats/attributeDialog/attributeDialog.js
+++ /dev/null
@@ -1,165 +0,0 @@
-//TODO add dexterity armor
-var stats = {
- "strength":{"name":"Strength"},
- "dexterity":{"name":"Dexterity"},
- "constitution":{"name":"Constitution"},
- "intelligence":{"name":"Intelligence"},
- "wisdom":{"name":"Wisdom"},
- "charisma":{"name":"Charisma"},
- "strengthSave":{"name":"Strength Save"},
- "dexteritySave":{"name":"Dexterity Save"},
- "constitutionSave":{"name":"Constitution Save"},
- "intelligenceSave":{"name":"Intelligence Save"},
- "wisdomSave":{"name":"Wisdom Save"},
- "charismaSave":{"name":"Charisma Save"},
- "acrobatics":{"name":"Acrobatics"},
- "animalHandling":{"name":"Animal Handling"},
- "arcana":{"name":"Arcana"},
- "athletics":{"name":"Athletics"},
- "deception":{"name":"Deception"},
- "history":{"name":"History"},
- "insight":{"name":"Insight"},
- "intimidation":{"name":"Intimidation"},
- "investigation":{"name":"Investigation"},
- "medicine":{"name":"Medicine"},
- "nature":{"name":"Nature"},
- "perception":{"name":"Perception"},
- "performance":{"name":"Performance"},
- "persuasion":{"name":"Persuasion"},
- "religion":{"name":"Religion"},
- "sleightOfHand":{"name":"Sleight of Hand"},
- "stealth":{"name":"Stealth"},
- "survival":{"name":"Survival"},
- "initiative":{"name":"Initiative"},
- "hitPoints":{"name":"Hit Points"},
- "armor":{"name":"Armor"},
- "dexterityArmor":{"name":"Dexterity Armor Bonus"},
- "speed":{"name":"Speed"},
- "proficiencyBonus":{"name":"Proficiency Bonus"},
- "ki":{"name":"Ki Points"},
- "sorceryPoints":{"name":"Sorcery Points"},
- "rages":{"name":"Rages"},
- "rageDamage":{"name":"Rage Damage"},
- "expertiseDice":{"name":"Expertise Dice"},
- "superiorityDice":{"name":"Superiority Dice"},
- "level1SpellSlots":{"name":"level 1 Spell Slots"},
- "level2SpellSlots":{"name":"level 2 Spell Slots"},
- "level3SpellSlots":{"name":"level 3 Spell Slots"},
- "level4SpellSlots":{"name":"level 4 Spell Slots"},
- "level5SpellSlots":{"name":"level 5 Spell Slots"},
- "level6SpellSlots":{"name":"level 6 Spell Slots"},
- "level7SpellSlots":{"name":"level 7 Spell Slots"},
- "level8SpellSlots":{"name":"level 8 Spell Slots"},
- "level9SpellSlots":{"name":"level 9 Spell Slots"},
- "d6HitDice":{"name":"d6 Hit Dice"},
- "d8HitDice":{"name":"d8 Hit Dice"},
- "d10HitDice":{"name":"d10 Hit Dice"},
- "d12HitDice":{"name":"d12 Hit Dice"},
- "acidMultiplier":{"name":"Acid", "group": "Weakness/Resistance"},
- "bludgeoningMultiplier":{"name":"Bludgeoning", "group": "Weakness/Resistance"},
- "coldMultiplier":{"name":"Cold", "group": "Weakness/Resistance"},
- "fireMultiplier":{"name":"Fire", "group": "Weakness/Resistance"},
- "forceMultiplier":{"name":"Force", "group": "Weakness/Resistance"},
- "lightningMultiplier":{"name":"Lightning", "group": "Weakness/Resistance"},
- "necroticMultiplier":{"name":"Necrotic", "group": "Weakness/Resistance"},
- "piercingMultiplier":{"name":"Piercing", "group": "Weakness/Resistance"},
- "poisonMultiplier":{"name":"Poison", "group": "Weakness/Resistance"},
- "psychicMultiplier":{"name":"Psychic", "group": "Weakness/Resistance"},
- "radiantMultiplier":{"name":"Radiant", "group": "Weakness/Resistance"},
- "slashingMultiplier":{"name":"Slashing", "group": "Weakness/Resistance"},
- "thunderMultiplier":{"name":"Thunder", "group": "Weakness/Resistance"},
-};
-
-var operations = {
- base: {name: "Base Value"},
- proficiency: {name: "Proficiency"},
- add: {name: "+"},
- mul: {name: "×"},
- min: {name: "Min"},
- max: {name: "Max"},
- advantage: {name: "Advantage"},
- disadvantage: {name: "Disadvantage"},
- passiveAdd: {name: "Passive Bonus"},
- fail: {name: "Automatically Fail"},
- conditional: {name: "Conditional Benefit"},
-};
-
-var abilities = {
- strength: {name: "Strength"},
- dexterity: {name: "Dexterity"},
- constitution: {name: "Constitution"},
- intelligence: {name: "Intelligence"},
- wisdom: {name: "Wisdom"},
- charisma: {name: "Charisma"},
-};
-
-Template.attributeDialog.helpers({
- color: function(){
- if (this.color) return this.color + " white-text";
- var char = Characters.findOne(this.charId, {fields: {color: 1}});
- if (char) return getColorClass(char.color);
- },
-});
-
-Template.attributeDialogView.helpers({
- or: function(a, b, c){
- return a || b || c;
- },
- adjustment: function(){
- var value = Characters.calculate.attributeValue(this.charId, this.statName);
- var base = Characters.calculate.attributeBase(this.charId, this.statName);
- return value - base;
- },
- baseEffects: function(){
- return Effects.find(
- {charId: this.charId, stat: this.statName, operation: "base", enabled: true}
- );
- },
- addEffects: function(){
- return Effects.find(
- {charId: this.charId, stat: this.statName, operation: "add", enabled: true}
- );
- },
- mulEffects: function(){
- return Effects.find(
- {charId: this.charId, stat: this.statName, operation: "mul", enabled: true}
- );
- },
- minEffects: function(){
- return Effects.find(
- {charId: this.charId, stat: this.statName, operation: "min", enabled: true}
- );
- },
- maxEffects: function(){
- return Effects.find(
- {charId: this.charId, stat: this.statName, operation: "max", enabled: true}
- );
- },
- attributeBase: function(){
- return Characters.calculate.attributeBase(this.charId, this.statName);
- },
- attributeValue: function() {
- return Characters.calculate.attributeValue(this.charId, this.statName);
- },
- sourceName: function(){
- if (this.parent.group === "racial"){
- return this.getParent().race;
- }
- if (this.parent.collection === "Characters"){
- return this.name;
- }
- return this.getParent().name;
- },
- operationName: function(){
- var op = operations[this.operation];
- return op && op.name || "No Operation";
- },
- statValue: function(){
- return evaluateEffect(this.charId, this);
- },
- showNewUserExperience: function(){
- if (this.statName === "speed"){
- return Session.get("newUserExperienceStep") >= 2;
- }
- },
-});
diff --git a/app/client/views/character/stats/attributeDialog/strengthDialog/strengthDialog.html b/app/client/views/character/stats/attributeDialog/strengthDialog/strengthDialog.html
deleted file mode 100644
index 88a05987..00000000
--- a/app/client/views/character/stats/attributeDialog/strengthDialog/strengthDialog.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
- {{#baseDialog title=name class=color hideEdit=true}}
- {{> attributeDialogView}}
-
-
-
Carrying
- {{> carryCapacityTable}}
-
Jumping
-
-
- Running long jump
- {{evaluate charId "strength"}} feet
-
-
- Standing long jump
- {{evaluate charId "floor(strength/2)"}} feet
-
-
- Running high jump
- {{evaluate charId "3 + strengthMod"}} feet
-
- Can reach a ledge as high as
- {{evaluate charId "3 + strengthMod"}} feet
- + 1.5× your height
-
-
-
- Standing high jump
- {{evaluate charId "floor((3 + strengthMod)/2)"}} feet
-
- Can reach a ledge as high as
- {{evaluate charId "floor((3 + strengthMod)/2)"}} feet
- + 1.5× your height
-
-
-
-
- {{/baseDialog}}
-
diff --git a/app/client/views/character/stats/attributeDialog/strengthDialog/strengthDialog.js b/app/client/views/character/stats/attributeDialog/strengthDialog/strengthDialog.js
deleted file mode 100644
index 7d328efe..00000000
--- a/app/client/views/character/stats/attributeDialog/strengthDialog/strengthDialog.js
+++ /dev/null
@@ -1,7 +0,0 @@
-Template.strengthDialog.helpers({
- color: function(){
- if (this.color) return this.color + " white-text";
- var char = Characters.findOne(this.charId, {fields: {color: 1}});
- if (char) return getColorClass(char.color);
- },
-});
diff --git a/app/client/views/character/stats/carryCapacityTable/carryCapacityTable.html b/app/client/views/character/stats/carryCapacityTable/carryCapacityTable.html
deleted file mode 100644
index b47e29a7..00000000
--- a/app/client/views/character/stats/carryCapacityTable/carryCapacityTable.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
- Encumbered
- >{{evaluate charId "strength * 5 * carryMultiplier"}}lbs
- Variant rule, encumbered characters move 10 feet slower
-
-
- Heavily encumbered
- >{{evaluate charId "strength * 10 * carryMultiplier"}}lbs
-
- Variant rule, heavily encumbered characters move 20 feet slower and have disadvantage on ability checks, attack rolls, and saving thows that use Strength, Dexterity, or Constitution
-
-
-
- Over Encumbered
- >{{evaluate charId "strength * 15 * carryMultiplier"}}lbs
-
- Characters that can only just lift, push or drag their current load can only move at 5 feet.
-
-
-
- Push, drag or lift maximum
- {{evaluate charId "strength * 30 * carryMultiplier"}}lbs
-
-
-
-
diff --git a/app/client/views/character/stats/healthCard/healthCard.css b/app/client/views/character/stats/healthCard/healthCard.css
deleted file mode 100644
index c1d00f05..00000000
--- a/app/client/views/character/stats/healthCard/healthCard.css
+++ /dev/null
@@ -1,27 +0,0 @@
-.healthCard paper-diff-slider{
- width: 100%;
- margin-right: 8px;
-}
-
-.healthCard .bottom-border {
- border-bottom: rgba(0,0,0,0.24) solid 1px;
- margin-bottom: 12px;
-}
-
-.healthCard #stableButton {
- color: #b71c1c;
- transition: color 0.4s ease;
- width: 100%;
-}
-
-.healthCard #stableButton:before {
- content: "Unstable";
-}
-
-.healthCard #stableButton.stable {
- color: #1b5e20;
-}
-
-.healthCard #stableButton.stable:before{
- content: "Stable";
-}
diff --git a/app/client/views/character/stats/healthCard/healthCard.html b/app/client/views/character/stats/healthCard/healthCard.html
deleted file mode 100644
index 2bef59df..00000000
--- a/app/client/views/character/stats/healthCard/healthCard.html
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
- {{#if characterCalculate "attributeBase" _id "tempHP"}}
-
-
- {{/if}}
-
- {{#each extraHitPoints}}
-
-
- {{name}}
-
-
- {{#unless left}}
-
- {{/unless}}
-
-
-
- {{/each}}
-
- {{#if multipliers.immunities.length}}
-
- Immune: {{#each multipliers.immunities}} {{name}} {{/each}}
-
- {{/if}}
- {{#if multipliers.resistances.length}}
-
- Resistance: {{#each multipliers.resistances}} {{name}} {{/each}}
-
- {{/if}}
- {{#if multipliers.weaknesses.length}}
-
- Weakness: {{#each multipliers.weaknesses}} {{name}} {{/each}}
-
- {{/if}}
-
- {{#if showDeathSave}}
- {{#with deathSaveObject}}
-
-
- Death Saves
-
-
-
-
- {{#if dead}}
- DEAD
- {{else}}
-
-
- {{/if}}
-
-
-
-
- {{/with}}
- {{/if}}
-
-
-
diff --git a/app/client/views/character/stats/healthCard/healthCard.js b/app/client/views/character/stats/healthCard/healthCard.js
deleted file mode 100644
index 1c1e7751..00000000
--- a/app/client/views/character/stats/healthCard/healthCard.js
+++ /dev/null
@@ -1,147 +0,0 @@
-const currentId = () => Template.currentData()._id;
-
-// Use binding to ensure max is always set before value to prevent value clamping poorly
-Template.healthCard.binding({
- "#hitPointSlider": {
- max: () => Characters.calculate.attributeBase(currentId() , "hitPoints"),
- value: () => Characters.calculate.attributeValue(currentId() , "hitPoints"),
- },
-});
-
-// Reset the old value between characters so that we don't get red health lost
-// bar when changing character
-Template.healthCard.onRendered(function(){
- let oldId = Template.currentData()._id;
- this.autorun(() => {
- const id = Template.currentData()._id;
- if (oldId !== id){
- this.find("#hitPointSlider").resetOldValue();
- var thpSlider = this.find("#temporaryHitPointSlider");
- thpSlider && thpSlider.resetOldValue();
- oldId = id;
- }
- });
-});
-
-Template.healthCard.helpers({
- extraHitPoints: function(){
- return TemporaryHitPoints.find({charId: this._id});
- },
- showDeathSave: function(){
- return Characters.calculate.attributeValue(this._id, "hitPoints") <= 0;
- },
- deathSaveObject: function(){
- var char = Characters.findOne(this._id, {fields: {deathSave: 1}});
- return char && char.deathSave;
- },
- failIcon: function(num){
- if (num <= this.fail) return "radio-button-checked";
- else return "radio-button-unchecked";
- },
- passIcon: function(num){
- if (num <= this.pass) return "radio-button-checked";
- else return "radio-button-unchecked";
- },
- failDisabled: function(num){
- return !(num === this.fail || num - 1 === this.fail);
- },
- passDisabled: function(num){
- return !(num === this.pass || num - 1 === this.pass);
- },
- dead: function(){
- return this.fail >= 3;
- },
- multipliers: function(){
- // jscs:disable maximumLineLength
- var multipliers = [
- {name: "Acid", value: Characters.calculate.attributeValue(this._id, "acidMultiplier")},
- {name: "Bludgeoning", value: Characters.calculate.attributeValue(this._id, "bludgeoningMultiplier")},
- {name: "Cold", value: Characters.calculate.attributeValue(this._id, "coldMultiplier")},
- {name: "Fire", value: Characters.calculate.attributeValue(this._id, "fireMultiplier")},
- {name: "Force", value: Characters.calculate.attributeValue(this._id, "forceMultiplier")},
- {name: "Lightning", value: Characters.calculate.attributeValue(this._id, "lightningMultiplier")},
- {name: "Necrotic", value: Characters.calculate.attributeValue(this._id, "necroticMultiplier")},
- {name: "Piercing", value: Characters.calculate.attributeValue(this._id, "piercingMultiplier")},
- {name: "Poison", value: Characters.calculate.attributeValue(this._id, "poisonMultiplier")},
- {name: "Psychic", value: Characters.calculate.attributeValue(this._id, "psychicMultiplier")},
- {name: "Radiant", value: Characters.calculate.attributeValue(this._id, "radiantMultiplier")},
- {name: "Slashing", value: Characters.calculate.attributeValue(this._id, "slashingMultiplier")},
- {name: "Thunder", value: Characters.calculate.attributeValue(this._id, "thunderMultiplier")},
- ];
- // jscs:enable maximumLineLength
- multipliers = _.groupBy(multipliers, "value");
- return {
- "immunities": multipliers["0"] || [],
- "resistances": multipliers["0.5"] || [],
- "weaknesses": multipliers["2"] || [],
- };
- },
-});
-
-Template.healthCard.events({
- "change #hitPointSlider": function(event){
- var value = event.currentTarget.value;
- var base = Characters.calculate.attributeBase(this._id, "hitPoints");
- var adjustment = value - base;
- Characters.update(this._id, {$set: {"hitPoints.adjustment": adjustment}});
- //reset the death saves if we are gaining HP
- if (value > 0)
- Characters.update(
- this._id,
- {$set: {
- "deathSave.pass": 0,
- "deathSave.fail": 0,
- "deathSave.stable": false,
- }}
- );
- },
- "change #temporaryHitPointSlider": function(event){ //this is the actual THP stat
- var value = event.currentTarget.value;
- var base = Characters.calculate.attributeBase(this._id, "tempHP");
- var adjustment = value - base;
- Characters.update(this._id, {$set: {"tempHP.adjustment": adjustment}});
- },
- "change .extraHitPointSlider": function(event){ //this is the extra bars
- var value = event.currentTarget.value;
- var used = this.maximum - value;
- TemporaryHitPoints.update(this._id, {$set: {"used": used}});
- },
- "click .deleteEHP": function(event){
- TemporaryHitPoints.remove(this._id);
- },
- "click #addExtraHP": function(event){
- pushDialogStack({
- template: "addEHPDialog",
- data: {charId: this._id},
- element: event.currentTarget.parentElement,
- });
- },
- "click .failBubble": function(event){
- if (event.currentTarget.disabled) return;
- var char = Template.parentData();
- if (event.currentTarget.icon === "radio-button-unchecked"){
- Characters.update(char._id, {$set: {"deathSave.fail": this.fail + 1}});
- } else {
- Characters.update(char._id, {$set: {"deathSave.fail": this.fail - 1}});
- }
- },
- "click .passBubble": function(event){
- if (event.currentTarget.disabled) return;
- var char = Template.parentData();
- if (event.currentTarget.icon === "radio-button-unchecked"){
- Characters.update(char._id, {$set: {"deathSave.pass": this.pass + 1}});
- } else {
- Characters.update(char._id, {$set: {"deathSave.pass": this.pass - 1}});
- }
- },
- "click #stableButton": function(event){
- var char = Characters.findOne(Template.parentData()._id, {
- fields: {deathSave: 1}
- });
- Characters.update(char._id, {
- $set: {
- "deathSave.stable": !char.deathSave.stable
- }
- });
- },
-});
diff --git a/app/client/views/character/stats/hitDice/hitDice.html b/app/client/views/character/stats/hitDice/hitDice.html
deleted file mode 100644
index 76fe31a7..00000000
--- a/app/client/views/character/stats/hitDice/hitDice.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
- {{#if characterCalculate "attributeBase" ../_id name}}
-
-
-
-
-
-
- {{characterCalculate "attributeValue" ../_id name}}
-
-
- d{{diceNum}} {{conMod}}
-
-
-
-
- Hit Dice
-
-
-
- {{/if}}
-
diff --git a/app/client/views/character/stats/hitDice/hitDice.js b/app/client/views/character/stats/hitDice/hitDice.js
deleted file mode 100644
index 90afb5ba..00000000
--- a/app/client/views/character/stats/hitDice/hitDice.js
+++ /dev/null
@@ -1,50 +0,0 @@
-Template.hitDice.helpers({
- cantIncrement: function(){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- var base = Characters.calculate.attributeBase(this.char._id, this.name);
- return value >= base || !canEditCharacter(this.char._id);
- },
- cantDecrement: function(){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- return value <= 0 || !canEditCharacter(this.char._id);
- },
- conMod: function(){
- return signedString(
- Characters.calculate.abilityMod(this.char._id, "constitution")
- );
- },
-});
-
-Template.hitDice.events({
- "click .resourceUp": function(event){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- var base = Characters.calculate.attributeBase(this.char._id, this.name);
- if (value < base){
- var modifier = {$inc: {}};
- modifier.$inc[this.name + ".adjustment"] = 1;
- Characters.update(this.char._id, modifier, {validate: false});
- }
- },
- "click .resourceDown": function(event){
- var value = Characters.calculate.attributeValue(this.char._id, this.name);
- if (value > 0){
- var modifier = {$inc: {}};
- modifier.$inc[this.name + ".adjustment"] = -1;
- Characters.update(this.char._id, modifier, {validate: false});
- }
- },
- "click .right": function(event, template) {
- var charId = Template.parentData()._id;
- var title = "d" + this.diceNum + " Hit Dice";
- pushDialogStack({
- template: "attributeDialog",
- data: {
- name: title,
- statName: this.name,
- charId: charId,
- color: "green",
- },
- element: event.currentTarget.parentElement,
- });
- },
-});
diff --git a/app/client/views/character/stats/skillDialog/skillDialog.css b/app/client/views/character/stats/skillDialog/skillDialog.css
deleted file mode 100644
index 8097de8f..00000000
--- a/app/client/views/character/stats/skillDialog/skillDialog.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.summaryNumber{
- width: 50px;
-}
diff --git a/app/client/views/character/stats/skillDialog/skillDialog.html b/app/client/views/character/stats/skillDialog/skillDialog.html
deleted file mode 100644
index a0918755..00000000
--- a/app/client/views/character/stats/skillDialog/skillDialog.html
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
- {{#baseDialog title=name class=color hideEdit=true}}
- {{> skillDialogView}}
- {{/baseDialog}}
-
-
-
-
-
- {{characterCalculate "skillMod" charId skillName}}
-
-
-
- {{#if profSource}}
- {{proficiencyValue}} - {{#with profSource}}{{sourceName}}{{/with}}
- {{else}}
- Not Proficient
- {{/if}}
-
-
-
-
-
-
-
- {{abilityName}}
- {{characterCalculate "abilityMod" charId ability}}
-
- {{#if characterCalculate "proficiency" charId skillName}}
-
- {{proficiencyValue}}
- {{signedString profBonus}}
-
- {{/if}}
- {{#each addEffects}}
-
- {{sourceName}}
- {{signedString statValue}}
-
- {{/each}}
- {{#each mulEffects}}
-
- {{sourceName}}
- ×{{statValue}}
-
- {{/each}}
- {{#each minEffects}}
-
- {{sourceName}}
- Min: {{statValue}}
-
- {{/each}}
- {{#each maxEffects}}
-
- {{sourceName}}
- Max: {{statValue}}
-
- {{/each}}
-
- Total
- {{characterCalculate "skillMod" charId skillName}}
-
- {{#each passiveEffects}}
-
- {{sourceName}}
- Passive Bonus: {{statValue}}
-
- {{/each}}
- {{#if showPassiveTotal}}
-
- Passive Score
- {{characterCalculate "passiveSkill" charId skillName}}
-
- {{/if}}
-
-
-
- {{#if or advEffects.count dadvEffects.count conditionalEffects.count}}
-
- {{/if}}
-
-
- {{#if advEffects.count}}
-
- Advantage
-
-
- {{#each advEffects}}
-
{{sourceName}}
- {{/each}}
-
- {{/if}}
-
-
- {{#if dadvEffects.count}}
-
- Disadvantage
-
-
- {{#each dadvEffects}}
-
{{sourceName}}
- {{/each}}
-
- {{/if}}
-
-
- {{#each conditionalEffects}}
-
-
{{sourceName}}
-
*{{statValue}}
-
- {{/each}}
-
diff --git a/app/client/views/character/stats/skillDialog/skillDialog.js b/app/client/views/character/stats/skillDialog/skillDialog.js
deleted file mode 100644
index d3b5f6cd..00000000
--- a/app/client/views/character/stats/skillDialog/skillDialog.js
+++ /dev/null
@@ -1,256 +0,0 @@
-//TODO add dexterity armor
-var stats = {
- "strength":{"name":"Strength"},
- "dexterity":{"name":"Dexterity"},
- "constitution":{"name":"Constitution"},
- "intelligence":{"name":"Intelligence"},
- "wisdom":{"name":"Wisdom"},
- "charisma":{"name":"Charisma"},
- "strengthSave":{"name":"Strength Save"},
- "dexteritySave":{"name":"Dexterity Save"},
- "constitutionSave":{"name":"Constitution Save"},
- "intelligenceSave":{"name":"Intelligence Save"},
- "wisdomSave":{"name":"Wisdom Save"},
- "charismaSave":{"name":"Charisma Save"},
- "acrobatics":{"name":"Acrobatics"},
- "animalHandling":{"name":"Animal Handling"},
- "arcana":{"name":"Arcana"},
- "athletics":{"name":"Athletics"},
- "deception":{"name":"Deception"},
- "history":{"name":"History"},
- "insight":{"name":"Insight"},
- "intimidation":{"name":"Intimidation"},
- "investigation":{"name":"Investigation"},
- "medicine":{"name":"Medicine"},
- "nature":{"name":"Nature"},
- "perception":{"name":"Perception"},
- "performance":{"name":"Performance"},
- "persuasion":{"name":"Persuasion"},
- "religion":{"name":"Religion"},
- "sleightOfHand":{"name":"Sleight of Hand"},
- "stealth":{"name":"Stealth"},
- "survival":{"name":"Survival"},
- "initiative":{"name":"Initiative"},
- "hitPoints":{"name":"Hit Points"},
- "armor":{"name":"Armor"},
- "dexterityArmor":{"name":"Dexterity Armor Bonus"},
- "speed":{"name":"Speed"},
- "proficiencyBonus":{"name":"Proficiency Bonus"},
- "ki":{"name":"Ki Points"},
- "sorceryPoints":{"name":"Sorcery Points"},
- "rages":{"name":"Rages"},
- "rageDamage":{"name":"Rage Damage"},
- "expertiseDice":{"name":"Expertise Dice"},
- "superiorityDice":{"name":"Superiority Dice"},
- "level1SpellSlots":{"name":"level 1 Spell Slots"},
- "level2SpellSlots":{"name":"level 2 Spell Slots"},
- "level3SpellSlots":{"name":"level 3 Spell Slots"},
- "level4SpellSlots":{"name":"level 4 Spell Slots"},
- "level5SpellSlots":{"name":"level 5 Spell Slots"},
- "level6SpellSlots":{"name":"level 6 Spell Slots"},
- "level7SpellSlots":{"name":"level 7 Spell Slots"},
- "level8SpellSlots":{"name":"level 8 Spell Slots"},
- "level9SpellSlots":{"name":"level 9 Spell Slots"},
- "d6HitDice":{"name":"d6 Hit Dice"},
- "d8HitDice":{"name":"d8 Hit Dice"},
- "d10HitDice":{"name":"d10 Hit Dice"},
- "d12HitDice":{"name":"d12 Hit Dice"},
- "acidMultiplier":{"name":"Acid", "group": "Weakness/Resistance"},
- "bludgeoningMultiplier":{"name":"Bludgeoning", "group": "Weakness/Resistance"},
- "coldMultiplier":{"name":"Cold", "group": "Weakness/Resistance"},
- "fireMultiplier":{"name":"Fire", "group": "Weakness/Resistance"},
- "forceMultiplier":{"name":"Force", "group": "Weakness/Resistance"},
- "lightningMultiplier":{"name":"Lightning", "group": "Weakness/Resistance"},
- "necroticMultiplier":{"name":"Necrotic", "group": "Weakness/Resistance"},
- "piercingMultiplier":{"name":"Piercing", "group": "Weakness/Resistance"},
- "poisonMultiplier":{"name":"Poison", "group": "Weakness/Resistance"},
- "psychicMultiplier":{"name":"Psychic", "group": "Weakness/Resistance"},
- "radiantMultiplier":{"name":"Radiant", "group": "Weakness/Resistance"},
- "slashingMultiplier":{"name":"Slashing", "group": "Weakness/Resistance"},
- "thunderMultiplier":{"name":"Thunder", "group": "Weakness/Resistance"},
-};
-
-var operations = {
- base: {name: "Base Value"},
- proficiency: {name: "Proficiency"},
- add: {name: "+"},
- mul: {name: "×"},
- min: {name: "Min"},
- max: {name: "Max"},
- advantage: {name: "Advantage"},
- disadvantage: {name: "Disadvantage"},
- passiveAdd: {name: "Passive Bonus"},
- fail: {name: "Automatically Fail"},
- conditional: {name: "Conditional Benefit"},
-};
-
-var abilities = {
- strength: {name: "Strength"},
- dexterity: {name: "Dexterity"},
- constitution: {name: "Constitution"},
- intelligence: {name: "Intelligence"},
- wisdom: {name: "Wisdom"},
- charisma: {name: "Charisma"},
-};
-
-Template.skillDialog.helpers({
- color: function(){
- if (this.color) return this.color + " white-text";
- var char = Characters.findOne(this.charId, {fields: {color: 1}});
- if (char) return getColorClass(char.color);
- },
-});
-
-Template.skillDialogView.helpers({
- or: function(a, b, c){
- return a || b || c;
- },
- profIcon: function(){
- var prof = Characters.calculate.proficiency(this.charId, this.skillName);
- if (prof > 0 && prof < 1) return "image:brightness-2";
- if (prof === 1) return "image:brightness-1";
- if (prof > 1) return "av:album";
- return "radio-button-off";
- },
- profSource: function(){
- return Proficiencies.findOne(
- {charId: this.charId, name: this.skillName},
- {sort: {value: -1}}
- );
- },
- profBonus: function(){
- var char = Characters.findOne(this.charId);
- if (!char) return;
- var prof = Characters.calculate.proficiency(this.charId, this.skillName);
- var proficiencyBonus =
- Characters.calculate.attributeValue(this.charId, "proficiencyBonus");
- return prof * proficiencyBonus;
- },
- proficiencyValue: function(){
- var prof = Characters.calculate.proficiency(this.charId, this.skillName);
- if (prof == 0.5) return "Half Proficiency";
- if (prof == 1) return "Proficient";
- if (prof == 2) return "Double Proficiency";
- return prof + "x Proficiency";
- },
- addEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "add",
- enabled: true,
- });
- },
- mulEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "mul",
- enabled: true,
- });
- },
- minEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "min",
- enabled: true,
- });
- },
- maxEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "max",
- enabled: true,
- });
- },
- advEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "advantage",
- enabled: true,
- });
- },
- dadvEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "disadvantage",
- enabled: true,
- });
- },
- conditionalEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "conditional",
- enabled: true,
- });
- },
- passiveEffects: function(){
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "passiveAdd",
- enabled: true,
- });
- },
- showPassiveTotal: function(){
- if (this.skillName === "perception") return true;
- return Effects.find({
- charId: this.charId,
- stat: this.skillName,
- operation: "passiveAdd",
- enabled: true,
- }).count();
- },
- ability: function(){
- var opts = {fields: {}};
- opts.fields[this.skillName] = 1;
- var char = Characters.findOne(this.charId, opts);
- var skill = char && char[this.skillName];
- return skill.ability;
- },
- abilityName: function(){
- var skill = Characters.calculate.getField(this.charId, this.skillName);
- if (!skill) return;
- var ability = skill.ability;
- return abilities[ability] && abilities[ability].name;
- },
- sourceName: function(){
- if (this.parent.collection === "Characters"){
- if (this.parent.group === "racial"){
- return Characters.calculate.getField(this.charId, "race") || "Race";
- }
- if (this.parent.group === "background"){
- return "Background";
- }
- return "Innate";
- }
- return this.getParent().name;
- },
- operationName: function(){
- if (stats[this.stat].group === "Weakness/Resistance") return null;
- return operations[this.operation] &&
- operations[this.operation].name ||
- "No Operation";
- },
- statValue: function(){
- if (
- this.operation === "advantage" ||
- this.operation === "disadvantage" ||
- this.operation === "fail"
- ){
- return null;
- }
- if (stats[this.stat].group === "Weakness/Resistance"){
- if (this.value === 0.5) return "Resistance";
- if (this.value === 2) return "Vulnerability";
- if (this.value === 0) return "Immunity";
- return " Damage x" + this.value;
- }
- return evaluate(this.charId, this.calculation) || this.value;
- },
-});
diff --git a/app/client/views/character/stats/skillRow/skillRow.css b/app/client/views/character/stats/skillRow/skillRow.css
deleted file mode 100644
index 449a6ab6..00000000
--- a/app/client/views/character/stats/skillRow/skillRow.css
+++ /dev/null
@@ -1,22 +0,0 @@
-.skill-row .skill-mod{
- width: 45px;
- text-align: center;
-}
-
-.skill-row .skill-mod.fail {
- color: #D50000;
-}
-
-.skill-row .skill-mod.advantage{
- background-image: url(/png/advantage/greenUp.png);
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
-}
-
-.skill-row .skill-mod.disadvantage{
- background-image: url(/png/advantage/redDown.png);
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
-}
diff --git a/app/client/views/character/stats/skillRow/skillRow.html b/app/client/views/character/stats/skillRow/skillRow.html
deleted file mode 100644
index 207dbac2..00000000
--- a/app/client/views/character/stats/skillRow/skillRow.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- {{#if failSkill}}
-
fail
- {{else}}
-
- {{skillMod}}
-
- {{/if}}
-
- {{name}}
- {{#if conditionalCount}}
- *
- {{/if}}
- {{#if isPassiveShown}}
- ({{characterCalculate "passiveSkill" ../_id skill}})
- {{/if}}
-
-
-
-
diff --git a/app/client/views/character/stats/skillRow/skillRow.js b/app/client/views/character/stats/skillRow/skillRow.js
deleted file mode 100644
index 25a15d6c..00000000
--- a/app/client/views/character/stats/skillRow/skillRow.js
+++ /dev/null
@@ -1,53 +0,0 @@
-Template.skillRow.helpers({
- skillMod: function() {
- return signedString(
- Characters.calculate.skillMod(
- Template.parentData()._id, this.skill
- )
- );
- },
- profIcon: function(){
- var charId = Template.parentData()._id;
- var prof = Characters.calculate.proficiency(charId, this.skill);
- if (prof > 0 && prof < 1) return "image:brightness-2";
- if (prof === 1) return "image:brightness-1";
- if (prof > 1) return "av:album";
- return "radio-button-unchecked";
- },
- failSkill: function(){
- var charId = Template.parentData()._id;
- return Effects.find({
- charId: charId,
- stat: this.skill,
- enabled: true,
- operation: "fail",
- }).count();
- },
- advantage: function(){
- var charId = Template.parentData()._id;
- var advantage = Characters.calculate.advantage(charId, this.skill);
- if (advantage > 0) return "advantage";
- if (advantage < 0) return "disadvantage";
- },
- conditionalCount: function(){
- var charId = Template.parentData()._id;
- return Effects.find({
- charId: charId,
- stat: this.skill,
- enabled: true,
- operation: "conditional",
- }).count();
- },
- isPassiveShown: function(){
- if (this.showPassive === "forced") return true;
- if (this.showPassive === "ifNeeded"){
- var charId = Template.parentData()._id;
- return Effects.find({
- charId,
- stat: this.skill,
- operation: "passiveAdd",
- enabled: true,
- }).count();
- }
- },
-});
diff --git a/app/client/views/character/stats/statCard/statCard.css b/app/client/views/character/stats/statCard/statCard.css
deleted file mode 100644
index 77cbb57b..00000000
--- a/app/client/views/character/stats/statCard/statCard.css
+++ /dev/null
@@ -1,30 +0,0 @@
-.stat-card {
- min-width: 75px;
- text-align: center;
- cursor: pointer;
- -webkit-margin-collapse: separate;
- background: #fff;
-}
-
-.stat-card .title {
- padding: 16px;
-}
-
-.stat-card .numbers {
- min-width: 72px;
- padding: 16px;
-}
-
-.stat-card .advantage{
- background-image: url(/png/advantage/greenUp.png);
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
-}
-
-.stat-card .disadvantage{
- background-image: url(/png/advantage/redDown.png);
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center;
-}
diff --git a/app/client/views/character/stats/statCard/statCard.html b/app/client/views/character/stats/statCard/statCard.html
deleted file mode 100644
index b68e0188..00000000
--- a/app/client/views/character/stats/statCard/statCard.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- {{#if isSkill}}
-
- {{prefix}}{{skillMod}}
-
- {{else}}
- {{prefix}}{{characterCalculate "attributeValue" ../_id stat}}
- {{/if}}
-
-
- {{name}}
-
-
-
-
diff --git a/app/client/views/character/stats/statCard/statCard.js b/app/client/views/character/stats/statCard/statCard.js
deleted file mode 100644
index 017145fd..00000000
--- a/app/client/views/character/stats/statCard/statCard.js
+++ /dev/null
@@ -1,15 +0,0 @@
-Template.statCard.helpers({
- skillMod: function() {
- return signedString(
- Characters.calculate.skillMod(
- Template.parentData()._id, this.stat
- )
- );
- },
- advantage: function(){
- var charId = Template.parentData()._id;
- var advantage = Characters.calculate.advantage(charId, this.stat);
- if (advantage > 0) return "advantage";
- if (advantage < 0) return "disadvantage";
- },
-});
diff --git a/app/client/views/character/stats/stats.css b/app/client/views/character/stats/stats.css
deleted file mode 100644
index fe8f696e..00000000
--- a/app/client/views/character/stats/stats.css
+++ /dev/null
@@ -1,51 +0,0 @@
-.card-top {
- flex-grow: 1;
- padding: 16px;
- border-radius: 2px 2px 0 0;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-
-.editEffect > * {
- vertical-align: bottom;
-}
-
-.detailCard {
- background: white;
- border-radius: 2px;
- padding: 16px;
-}
-
-#armorHeading {
- background: url(/jpg/rusted-metal-armor.jpg) no-repeat;
- -webkit-background-size: cover;
- -moz-background-size: cover;
- -o-background-size: cover;
- background-size: cover;
-}
-
-#detailContainer {
- position: fixed;
- display: flex;
- justify-content: center;
- align-items: center;
- pointer-events: none;
-}
-
-#detailContainer > *{
- pointer-events: auto;
-}
-
-#darkOverlay {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: rgba(0,0,0,0.6);
-}
-
-section:not(.core-selected):not([animate]) paper-material[hero] {
- visibility: hidden;
-}
\ No newline at end of file
diff --git a/app/client/views/character/stats/stats.html b/app/client/views/character/stats/stats.html
deleted file mode 100644
index 6994f18c..00000000
--- a/app/client/views/character/stats/stats.html
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
- {{> healthCard}}
-
-
-
- {{> abilityMiniCard ability="strength" title="Strength" color="red"}}
- {{> abilityMiniCard ability="dexterity" title="Dexterity" color="indigo"}}
- {{> abilityMiniCard ability="constitution" title="Constitution" color="green"}}
- {{> abilityMiniCard ability="intelligence" title="Intelligence" color="deep-orange"}}
- {{> abilityMiniCard ability="wisdom" title="Wisdom" color="purple"}}
- {{> abilityMiniCard ability="charisma" title="Charisma" color="pink"}}
-
-
- {{> statCard stat="armor" name="Armor Class" color="teal"}}
-
- {{> statCard stat="speed" name="Speed" color="teal" bounce=shouldSpeedBounce}}
-
- {{> statCard stat="initiative" name="Initiative" color="indigo" isSkill="true"}}
-
- {{> statCard stat="proficiencyBonus" name="Proficiency Bonus" color="blue" prefix="+"}}
-
-
- {{>hitDice name="d6HitDice" diceNum="6" char=this}}
- {{>hitDice name="d8HitDice" diceNum="8" char=this}}
- {{>hitDice name="d10HitDice" diceNum="10" char=this}}
- {{>hitDice name="d12HitDice" diceNum="12" char=this}}
-
-
-
-
- Saving Throws
-
-
- {{> skillRow name="Strength" skill="strengthSave"}}
- {{> skillRow name="Dexterity" skill="dexteritySave"}}
- {{> skillRow name="Constitution" skill="constitutionSave"}}
- {{> skillRow name="Intelligence" skill="intelligenceSave"}}
- {{> skillRow name="Wisdom" skill="wisdomSave"}}
- {{> skillRow name="Charisma" skill="charismaSave"}}
-
-
-
-
-
-
-
-
Conditions
- {{#if canEditCharacter _id}}
-
- {{/if}}
-
-
-
- {{#each condition in conditions}}
- {{>conditionView condition=condition}}
- {{/each}}
-
- {{#if buffs.count}}
-
- {{/if}}
-
- {{#each buff in buffs}}
- {{>buffListItem buff=buff}}
- {{/each}}
-
-
-
-
-
-
-
-
- Skills
-
-
- {{> skillRow name="Acrobatics" skill="acrobatics" showPassive="ifNeeded"}}
- {{> skillRow name="Animal Handling" skill="animalHandling" showPassive="ifNeeded"}}
- {{> skillRow name="Arcana" skill="arcana" showPassive="ifNeeded"}}
- {{> skillRow name="Athletics" skill="athletics" showPassive="ifNeeded"}}
- {{> skillRow name="Deception" skill="deception" showPassive="ifNeeded"}}
- {{> skillRow name="History" skill="history" showPassive="ifNeeded"}}
- {{> skillRow name="Insight" skill="insight" showPassive="ifNeeded"}}
- {{> skillRow name="Intimidation" skill="intimidation" showPassive="ifNeeded"}}
- {{> skillRow name="Investigation" skill="investigation" showPassive="ifNeeded"}}
- {{> skillRow name="Medicine" skill="medicine" showPassive="ifNeeded"}}
- {{> skillRow name="Nature" skill="nature" showPassive="ifNeeded"}}
- {{> skillRow name="Perception" skill="perception" showPassive="forced"}}
- {{> skillRow name="Performance" skill="performance" showPassive="ifNeeded"}}
- {{> skillRow name="Persuasion" skill="persuasion" showPassive="ifNeeded"}}
- {{> skillRow name="Religion" skill="religion" showPassive="ifNeeded"}}
- {{> skillRow name="Sleight of Hand" skill="sleightOfHand" showPassive="ifNeeded"}}
- {{> skillRow name="Stealth" skill="stealth" showPassive="ifNeeded"}}
- {{> skillRow name="Survival" skill="survival" showPassive="ifNeeded"}}
-
-
-
-
-
-
diff --git a/app/client/views/character/stats/stats.js b/app/client/views/character/stats/stats.js
deleted file mode 100644
index 528575be..00000000
--- a/app/client/views/character/stats/stats.js
+++ /dev/null
@@ -1,96 +0,0 @@
-Template.stats.helpers({
- conditions: function() {
- return Conditions.find({charId: this._id});
- },
- buffs: function() {
- var selector = {
- "charId": this._id,
- };
- return Buffs.find(selector);
- },
- // New user experience
- shouldSpeedBounce: function(){
- return Session.get("newUserExperienceStep") === 2;
- },
-})
-
-Template.stats.events({
- "click .stat-card": function(event, instance){
- var charId = instance.data._id;
- if (this.isSkill){
- pushDialogStack({
- template: "skillDialog",
- data: {
- name: this.name,
- skillName: this.stat,
- charId: charId,
- color: this.color,
- },
- element: event.currentTarget,
- });
- } else {
- pushDialogStack({
- template: "attributeDialog",
- data: {
- name: this.name,
- statName: this.stat,
- charId: charId,
- color: this.color,
- },
- element: event.currentTarget,
- });
- }
- },
- "click .ability-mini-card": function(event, instance){
- var charId = Template.parentData()._id;
- var template = "attributeDialog";
- if (this.ability === "strength") template = "strengthDialog";
- pushDialogStack({
- template: template,
- data: {
- name: this.title,
- statName: this.ability,
- charId: charId,
- color: this.color,
- },
- element: event.currentTarget,
- });
- },
- "tap .skill-row": function(event, instance){
- var skill = this.skill;
- var charId = instance.data._id;
- pushDialogStack({
- template: "skillDialog",
- data: {
- name: this.name,
- skillName: skill,
- charId: charId,
- },
- element: event.currentTarget,
- });
- },
- "tap .hitPointTitle": function(event, instance) {
- pushDialogStack({
- template: "attributeDialog",
- data: {
- name: "Hit Points",
- statName: "hitPoints",
- charId: this._id,
- color: "green",
- },
- element: event.currentTarget.parentElement.parentElement,
- });
- },
- "click #addCondition": function(event, template){
- pushDialogStack({
- template: "conditionLibraryDialog",
- element: event.currentTarget,
- callback: (result) => {
- if (!result) {
- return;
- } else Meteor.call("giveCondition", this._id, result)
- },
- //returnElement: () => $(`[data-id='${itemId}']`).get(0),
- })
- },
-});
diff --git a/app/client/views/characterList/characterList.css b/app/client/views/characterList/characterList.css
deleted file mode 100644
index bfa17b1c..00000000
--- a/app/client/views/characterList/characterList.css
+++ /dev/null
@@ -1,44 +0,0 @@
-.character-card{
- background-color: #fff;
- height: 300px;
- min-width: 250px;
- max-width: 500px;
- flex-basis: 300px;
- margin: 4px;
- position: relative;
-}
-
-.partyHeader {
- display: inline-block;
- min-width: 80px;
-}
-
-.partyHeader iron-icon {
- visibility: hidden;
-}
-
-.partyHeader:hover iron-icon{
- visibility: initial;
-}
-
-.character-card .initials {
- font-size: 100px;
- color: rgba(255,255,255,0.1);
- background: linear-gradient(-8deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
-}
-
-.character-card paper-item {
- padding-top: 16px;
- padding-bottom: 16px;
- height: 76px;
- background-color: #545454;
- background-color: rgba(0,0,0,0.3);
-}
-
-.character-card .name {
- font-weight: 500;
-}
-
-.character-card paper-ripple {
- color: #fff ;
-}
diff --git a/app/client/views/characterList/characterList.html b/app/client/views/characterList/characterList.html
deleted file mode 100644
index 94962a5b..00000000
--- a/app/client/views/characterList/characterList.html
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
- Characters
-
-
-
- {{#if currentUser}}
- {{#if characters.count}}
-
- {{# each charactersWithNoParty}}
- {{> characterCard}}
- {{/each}}
- {{> gridPadding class="character-card flex layout vertical" num=12}}
-
- {{# each party in parties}}
-
- {{#with party}}
-
- {{/with}}
-
- {{# each charactersInParty party._id}}
- {{> characterCard}}
- {{/each}}
- {{> gridPadding class="character-card flex layout vertical" num=12}}
-
-
- {{/each}}
- {{else}}
-
-
You don't seem to have any characters yet
-
Add Character
-
- {{/if}}
- {{else}}
-
-
You must sign in to view your characters
-
- {{/if}}
-
- {{#fabMenu}}
-
-
-
- {{#simpleTooltip class="always"}} New Party {{/simpleTooltip}}
-
-
-
-
- {{#simpleTooltip class="always"}} New Character {{/simpleTooltip}}
-
- {{/fabMenu}}
-
-
-
-
-
-
-
-
- {{#unless picture}}
-
- {{initials name}}
-
- {{/unless}}
-
-
-
- {{name}}
-
-
- {{alignment}} {{gender}} {{race}}
-
-
-
-
-
-
diff --git a/app/client/views/characterList/characterList.js b/app/client/views/characterList/characterList.js
deleted file mode 100644
index 5bdee54b..00000000
--- a/app/client/views/characterList/characterList.js
+++ /dev/null
@@ -1,84 +0,0 @@
-Template.characterList.helpers({
- characters() {
- var userId = Meteor.userId();
- return Characters.find(
- {$or: [{readers: userId}, {writers: userId}, {owner: userId}]},
- {sort: {name: 1}}
- );
- },
- parties() {
- return Parties.find(
- {owner: Meteor.userId()},
- {sort: {name: 1}},
- );
- },
- charactersInParty(partyId) {
- var userId = Meteor.userId();
- var party = Parties.findOne(partyId);
- return Characters.find(
- {
- _id: {$in: party.characters},
- $or: [{readers: userId}, {writers: userId}, {owner: userId}],
- },
- {sort: {name: 1}}
- );
- },
- charactersWithNoParty() {
- var userId = Meteor.userId();
- var charArrays = Parties.find({owner: userId}).map(p => p.characters);
- var partyChars = _.uniq(_.flatten(charArrays));
- return Characters.find(
- {
- _id: {$nin: partyChars},
- $or: [{readers: userId}, {writers: userId}, {owner: userId}],
- },
- {sort: {name: 1}}
- );
- },
-});
-
-Template.characterCard.helpers({
- initials(name){
- return name.replace(/[^A-Z]/g, "");
- },
-});
-
-Template.characterList.events({
- "click .partyHeader": function(event, instance){
- pushDialogStack({
- template: "partyDialog",
- data: {
- _id: this._id,
- startEditing: true,
- },
- element: event.currentTarget.parentElement,
- });
- },
- "click .addCharacter": function(event, instance) {
- pushDialogStack({
- template: "newCharacterDialog",
- element: event.currentTarget,
- callback(character){
- if (!character) return;
- character.owner = Meteor.userId();
- let _id = Characters.insert(character);
- let urlName = getSlug(character.name, {maintainCase: true}) || "-"
- Router.go("characterSheet", {_id, urlName});
- },
- })
- },
- "click .addParty": function(event, instance) {
- var partyId = Parties.insert({
- owner: Meteor.userId(),
- });
- pushDialogStack({
- template: "partyDialog",
- data: {
- _id: partyId,
- startEditing: true,
- },
- element: event.currentTarget,
- returnElement: instance.find(`.party[data-id='${partyId}']`),
- });
- },
-});
diff --git a/app/client/views/characterList/characterPicker/characterPicker.css b/app/client/views/characterList/characterPicker/characterPicker.css
deleted file mode 100644
index 7062c38f..00000000
--- a/app/client/views/characterList/characterPicker/characterPicker.css
+++ /dev/null
@@ -1,17 +0,0 @@
-.characterPicker .character-name {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.characterPicker .partyHead {
- font-weight: 500;
-}
-
-.characterPicker .partyHead iron-icon {
- transition: transform 0.3s ease;
-}
-
-.characterPicker .partyHead iron-icon.open {
- transform: rotate(90deg);
-}
diff --git a/app/client/views/characterList/characterPicker/characterPicker.html b/app/client/views/characterList/characterPicker/characterPicker.html
deleted file mode 100644
index 2f43a12a..00000000
--- a/app/client/views/characterList/characterPicker/characterPicker.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
- {{#if selfId}}{{#if includeSelf}}
-
-
- Self
-
-
- {{/if}}{{/if}}
- {{#each charactersWithNoParty}}
-
-
- {{name}}
-
-
- {{/each}}
- {{#each parties}}
-
-
-
- {{name}}
-
-
- {{#each charactersInParty}}
-
-
- {{name}}
-
-
- {{/each}}
-
- {{/each}}
-
-
diff --git a/app/client/views/characterList/characterPicker/characterPicker.js b/app/client/views/characterList/characterPicker/characterPicker.js
deleted file mode 100644
index d8c094a5..00000000
--- a/app/client/views/characterList/characterPicker/characterPicker.js
+++ /dev/null
@@ -1,53 +0,0 @@
-Template.characterPicker.onCreated(function() {
- this.subscribe("characterList");
- this.openedParties = new ReactiveVar(new Set());
-});
-
-Template.characterPicker.helpers({
- parties() {
- return Parties.find(
- {owner: Meteor.userId()},
- {sort: {name: 1}},
- );
- },
- charactersInParty() {
- var userId = Meteor.userId();
- var selector = {
- _id: {$in: this.characters, $ne: this.selfId},
- $or: [{readers: userId}, {writers: userId}, {owner: userId}],
- };
- if (this.writableOnly) {
- selector.$or = [{writers: userId}, {owner: userId}];
- }
- return Characters.find(selector,{sort: {name: 1}});
- },
- charactersWithNoParty() {
- var userId = Meteor.userId();
- var charArrays = Parties.find({owner: userId}).map(p => p.characters);
- var partyChars = _.uniq(_.flatten(charArrays));
- var selector = {
- _id: {$nin: partyChars, $ne: this.selfId},
- $or: [{readers: userId}, {writers: userId}, {owner: userId}],
- };
- if (this.writableOnly) {
- selector.$or = [{writers: userId}, {owner: userId}];
- }
- return Characters.find(selector, {sort: {name: 1}});
- },
- isOpen(id) {
- var openedParties = Template.instance().openedParties.get();
- return openedParties.has(id);
- },
-});
-
-Template.characterPicker.events({
- "click .partyHead": function(event, instance){
- var openedParties = instance.openedParties.get();
- if (openedParties.has(this._id)){
- openedParties.delete(this._id);
- } else {
- openedParties.add(this._id);
- }
- instance.openedParties.set(openedParties);
- },
-});
diff --git a/app/client/views/characterList/characterSideList.css b/app/client/views/characterList/characterSideList.css
deleted file mode 100644
index 1b08159b..00000000
--- a/app/client/views/characterList/characterSideList.css
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- prevent character names from wrapping
- */
-
-.side-list .character-name {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.side-list .partyHead {
- font-weight: 500;
- cursor: pointer;
-}
-
-.side-list .partyHead iron-icon {
- transition: transform 0.3s ease;
-}
-
-.side-list .partyHead iron-icon.open {
- transform: rotate(90deg);
-}
diff --git a/app/client/views/characterList/characterSideList.html b/app/client/views/characterList/characterSideList.html
deleted file mode 100644
index 8a3fe6fd..00000000
--- a/app/client/views/characterList/characterSideList.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
diff --git a/app/client/views/characterList/characterSideList.js b/app/client/views/characterList/characterSideList.js
deleted file mode 100644
index a1faad12..00000000
--- a/app/client/views/characterList/characterSideList.js
+++ /dev/null
@@ -1,51 +0,0 @@
-Template.characterSideList.onCreated(function() {
- this.subscribe("characterList");
- this.openedParties = new ReactiveVar(new Set());
-});
-
-Template.characterSideList.helpers({
- parties() {
- return Parties.find(
- {owner: Meteor.userId()},
- {sort: {name: 1}},
- );
- },
- charactersInParty() {
- var userId = Meteor.userId();
- return Characters.find(
- {
- _id: {$in: this.characters},
- $or: [{readers: userId}, {writers: userId}, {owner: userId}],
- },
- {sort: {name: 1}}
- );
- },
- charactersWithNoParty() {
- var userId = Meteor.userId();
- var charArrays = Parties.find({owner: userId}).map(p => p.characters);
- var partyChars = _.uniq(_.flatten(charArrays));
- return Characters.find(
- {
- _id: {$nin: partyChars},
- $or: [{readers: userId}, {writers: userId}, {owner: userId}],
- },
- {sort: {name: 1}}
- );
- },
- isOpen(id) {
- var openedParties = Template.instance().openedParties.get();
- return openedParties.has(id);
- },
-});
-
-Template.characterSideList.events({
- "click .partyHead": function(event, instance){
- var openedParties = instance.openedParties.get();
- if (openedParties.has(this._id)){
- openedParties.delete(this._id);
- } else {
- openedParties.add(this._id);
- }
- instance.openedParties.set(openedParties);
- },
-});
diff --git a/app/client/views/characterList/partyDialog/partyDialog.css b/app/client/views/characterList/partyDialog/partyDialog.css
deleted file mode 100644
index f4ddf6ed..00000000
--- a/app/client/views/characterList/partyDialog/partyDialog.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.partyEdit .inPartyCheckbox {
- margin-bottom: 8px;
-}
diff --git a/app/client/views/characterList/partyDialog/partyDialog.html b/app/client/views/characterList/partyDialog/partyDialog.html
deleted file mode 100644
index 9c6d1b86..00000000
--- a/app/client/views/characterList/partyDialog/partyDialog.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
- {{#with party}}
- {{#baseDialog title=name hideColor=true startEditing=true}}
- {{> partyDetails}}
- {{else}}
- {{> partyEdit}}
- {{/baseDialog}}
- {{/with}}
-
-
-
-
-
- {{#each character in getCharacters}}
-
{{character.name}}
- {{/each}}
-
-
-
-
-
-
-
-
- {{#each allCharacters}}
-
- {{name}}
-
- {{/each}}
-
-
diff --git a/app/client/views/characterList/partyDialog/partyDialog.js b/app/client/views/characterList/partyDialog/partyDialog.js
deleted file mode 100644
index cb1c8e97..00000000
--- a/app/client/views/characterList/partyDialog/partyDialog.js
+++ /dev/null
@@ -1,62 +0,0 @@
-Template.partyDialog.helpers({
- party(){
- return Parties.findOne(this._id);
- }
-});
-
-Template.partyDetails.helpers({
- getCharacters (){
- var userId = Meteor.userId();
- return Characters.find(
- {
- _id: {$in: this.characters},
- $or: [{readers: userId}, {writers: userId}, {owner: userId}],
- },
- {sort: {name: 1}}
- );
- }
-});
-
-Template.partyEdit.helpers({
- allCharacters() {
- var userId = Meteor.userId();
- return Characters.find(
- {$or: [{readers: userId}, {writers: userId}, {owner: userId}]},
- {sort: {name: 1}}
- );
- },
- charInParty(charId) {
- return _.contains(Template.parentData().characters, charId);
- },
-});
-
-Template.partyDialog.events({
- "click #deleteButton": function(event, instance){
- Parties.remove(instance.data._id);
- popDialogStack();
- },
- "click #doneEditingButton": function(event, instance){
- popDialogStack();
- },
-});
-
-Template.partyEdit.events({
- "change .inPartyCheckbox": function(event, instance){
- var currentCharacters = this.characters;
- var checked = event.currentTarget.checked;
- var charId = this._id;
- var partyId = instance.data._id;
- if (checked){
- Parties.update(partyId, {$addToSet: {characters: charId}});
- } else {
- Parties.update(partyId, {$pull: {characters: charId}});
- }
- },
- "input .partyNameInput": function(event, instance){
- var name = event.currentTarget.value;
- Parties.update(this._id, {$set: {name}}, {
- removeEmptyStrings: false,
- trimStrings: false,
- });
- },
-});
diff --git a/app/client/views/feedback/feedback.html b/app/client/views/feedback/feedback.html
deleted file mode 100644
index 53d6731d..00000000
--- a/app/client/views/feedback/feedback.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
- Feedback
-
-
-
-
-
-
-
diff --git a/app/client/views/feedback/feedback.js b/app/client/views/feedback/feedback.js
deleted file mode 100644
index ee3db5da..00000000
--- a/app/client/views/feedback/feedback.js
+++ /dev/null
@@ -1,36 +0,0 @@
-Template.feedback.onCreated(function() {
- this.title = new ReactiveVar("");
- this.description = new ReactiveVar("");
-});
-
-Template.feedback.helpers({
- invalid: function() {
- var inst = Template.instance();
- return !inst.title.get() ||
- !inst.description.get();
- }
-});
-
-Template.feedback.events({
- "input #feedbackTitle": function(event, instance) {
- instance.title.set(instance.find("#feedbackTitle").value);
- },
- "input #feedbackDescription": function(event, instance) {
- instance.description.set(instance.find("#feedbackDescription").value);
- },
- "click #sendButton": function(event, instance) {
- var report = {};
- report.title = instance.find("#feedbackTitle").value;
- report.severity = instance.find("#severity").value;
- report.type = instance.find(".typeMenu").value;
- report.description = instance.find("#feedbackDescription").value;
- report.metaData = {
- url: window.location.href,
- session: _.pairs(Session.keys),
- };
- popDialogStack(report);
- },
- "click #cancelButton": function(event, template){
- popDialogStack();
- },
-});
diff --git a/app/client/views/guide/guide.css b/app/client/views/guide/guide.css
deleted file mode 100644
index a8b022f1..00000000
--- a/app/client/views/guide/guide.css
+++ /dev/null
@@ -1,11 +0,0 @@
-.wallOfText h2{
- margin-top: 24px
-}
-
-.wallOfText p{
- margin-top: 8px;
-}
-
-.wallOfText a{
- color: #d13b2e;
-}
\ No newline at end of file
diff --git a/app/client/views/guide/guide.html b/app/client/views/guide/guide.html
deleted file mode 100644
index 398fe8fe..00000000
--- a/app/client/views/guide/guide.html
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
-
- Guide
-
-
-
-
{{#markdown}}
-
-## Character Sheet Philosophy
-
-Setting up your character on DiceCloud is going to take you a little longer than just filling it in on a paper character sheet would have. The goal of using an online sheet is to make actually playing the game more streamlined, and ultimately more fun. So putting a little extra effort into setting up your character now will pay off over and over again once you're playing.
-
-The idea is to track where each number comes from, and allow you to easily make changes on the fly.
-Let's look at a hypothetical example.
-
-You need to swim through a sunken section of dungeon to fetch the quest's Thing.
-You'll need to take off your magical Plate Armor of +1 Constitution to swim without sinking, of course. Taking it off will change your armor class, your speed and your constitution, which in turn changes your hit points and your constitution saving throw. Working out all those changes in the middle of a game will drag the game to a halt.
-Fortunately you have a digital character sheet, so it's a matter of dragging your Plate Armor +1 Con from your "equipment" box to your "backpack" box and you're done. Your hitpoints change correctly, your saving throws are up to date, your armor class goes back to reflecting the fact that you have natural armor from being a dragonborn. Your character sheet keeps up and you ultimately get more time to play the game. Huzzah!
-
----
-
-## Creating a Character
-
- - In the [character list]({{pathFor route="characterList"}}), click the plus button, floating in the bottom right corner.
- - Give your character a name, gender and race - these can all be changed later if you change your mind. Then click the Add button.
- - Your new character should open, with your ability scores at a default of 10, but most other attributes at zero.
-
-
-## Adding Racial Effects
-You have already given your character a race, but you haven't yet specified what that race does for your character, so let's do that.
-
- - Click the Journal tab.
- - In the card that displays your level, click on your race to open the racial dialog box.
- - Click the edit button (the pencil icon) in the top corner of the racial dialog.
-
-In the edit mode of the racial dialog you can change your race's name and add effects and proficiencies your race gives you. We will only be adding the base traits our race gives us, specific features can go in the features tab so we can more easily reference them later.
-
-Let's add some of the effects all races will give.
-
- - Click the Add Effect button; a new window will open - this is the effect edit dialog.
- - In the left menu, scroll down to "Stats" and choose "Speed".
- - The right menu let's us choose how to effect that stat. Choose "Base Value", since our character's base speed comes from their race.
- - Finally, input the value for our characters speed, it'll probably be 30 unless you chose a slower race, such as a dwarf.
- - Close the Race dialog and navigate to the Stats tab.
- - The speed card should now correctly display the character's speed.
- - Click the speed card to see how that value was calculated.
- - Currently there is only one number effecting the total, the speed from our race, but as more effects from different sources start impacting our character's speed, they will show up here.
-
-You can now also add any other *stat changes* given yo you by your race, for example a human's +1 to each ability score, or an elf's +2 Dexterity.
-
-## Adding your ability scores
-
-Your character's ability scores are currently all 10 by default - which means that they're no better than your average commoner! Whether you roll your abilities, point-buy them, or just use the standard set of values, you'll need to update them.
-
- - Navigate to the *Features* tab.
- - Select the *Base Ability Scores* feature, which was added automatically.
- - Click the edit button (the pencil icon) in the top right corner.
- - Click the pencil icon to the right of your character's Strength to open the effect edit dialog.
- - Input your character's rolled or point-bought strength, *without* the racial modifier.
- - Notice that the operation is *Base Value* by default - this is what we want, as it is the character's *base* Strength score.
- - Repeat for the rest of your ability scores.
-
-You can now check that your ability scores appear on your *Stats* page and that your skills that use them have their values calculated accordingly.
-
-We didn't include your character's racial ability modifiers in the feature, so you should go back to your character's racial dialog and add them in there as effects. Remember to use the add operation, rather than base value, since your race adds to your ability scores.
-
-By separating the source of your character's stats you can easily check how your character got their ability scores and stats, even after 20 levels, without getting confused or making mistakes.
-
-## Adding a Class
-
-Currently your character is at level 0, because they don't have any class levels. Let's fix that.
-
- - Click the plus button in the card that currently says "Level 0"
- - A new class has now been added, name the class in the Class Name input and leave the level as 1.
-
-We now have a class, let's add the saving throw proficiencies it gives us.
-
- - Click the Add Proficiency button
- - Click the dropdown box that currently has "Skill" selected, and choose "Saving Throw" instead
- - In the second dropdown choose the first saving throw your class gives you
- - The third dropdown let's us specify if we have half or double our proficiency bonus for this proficiency, leave it at the default "proficient" for now
-
-If you navigate back to the stat page, you will see that you now have a proficiency bonus, based on your class level, and the saving throw you are proficienct in will take your proficiency bonus into account.
-
-One of the most important things your class gives you is your hit points, so let's go add those now.
-
- - Navigate to the class dialog box by clicking on your class name in the journal tab and hitting the edit button
- - Click the Add Effect button
- - Scroll down to *Stats* on the left, and choose the *Hit Points* stat.
- - Choose the *Base Value* operation.
-
-Now we need to decide how many hit points our class gives us. We will assume that we take the constant hit points per level, since it's both the rule used for league play and it's statistically advantageous over rolling for hit points every level.
-
-We could work out our hit points every level and change the effect each time, but we can do one better: we can input the calculation directly into the value field and have the character sheet figure it out for us.
-
-Let's assume we are creating a fighter, so in the class name you typed in "Fighter" (with the capital F, but without the quote marks). A fighter gets 10 hp at first level and 6 hitpoints every level after that.
-
-Let's rather split that into 4 bonus hit points at first level, and 6 hit points for every fighter level your character has. We can the write this as `4 + 6*FighterLevel` where the `*` represents multiplication.
-
-*Note that we __don't add the constitution modifier here__; that's already taken care of by default, since all characters add their constitution modifier to their hit points automatically.*
-
- - In the value field input `4 + 6*FighterLevel` - the spaces aren't needed, but you must spell your class name exactly as it is spelt in the class name input box, capital letters and all, in our case "Fighter"
- - Create a new effect that sets the base value of *d10 Hit Dice* to *FighterLevel*, since we also get a number of hit dice equal to our fighter's level.
- - Check how your changes are reflected in the *Stats* tab.
- - Change your level and check that the *Stats* tab gets updated accordingly.
-
-This method of including calculations in other stats allows you to take full advantage of having a digital character sheet, as it means that you can change any one thing in your character sheet and everthing else will update automatically.
-
----
-
-## Additional Tips
-
-Any input field with a light bulb icon is a *formula field*: it will compute any and all variables and functions within it. For example, the "Value" field in the effect edit dialog is a formula field, so you could set the value to `3`, or `FighterLevel*2`, or any formula you can think of.
-
-Any input field with a curly brackets icon is a *smart input field*: you can also use formulas here, but they must be enclosed within {curly brackets}. For example, the "Damage" field of a spell or weapon is a smart input field, so you could type `1d8 + {strengthMod}` for the damage, and if your strength modifier was +3, it would display as "1d8 + 3".
-
-The full list of functions and variables can be found on the GitHub wiki, [here](https://github.com/ThaumRystra/DiceCloud1/wiki/Function-and-Variable-List).
-
-Any description field, as well as some others like your background or description, can be formatted with Markdown.
-For example, having \*asterisks\* around something makes it *italic*, and a \*\*pair\*\* makes it **bold**.
-If you need to display an actual asterisk, you can escape it with a backslash, like this: \\\*.
-You can read more about Markdown [here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet "Markdown Cheatsheet") and [here](https://daringfireball.net/projects/markdown/syntax "Markdown's origianal specification").
-
-In addition, using three or more hyphens on their own line (like this: " --- "; this is the Markdown for a horizontal rule) will cut off the description of a feature card or any of the cards on the Persona page, so that the full description is only displayed - this is useful when having the full feature text would be annoyingly long, so you can simply display a summary on the card and have it expand into the full text.
-
-
- {{/markdown}}
-
-
-
diff --git a/app/client/views/home/home.html b/app/client/views/home/home.html
deleted file mode 100644
index 1ef4d03b..00000000
--- a/app/client/views/home/home.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- {{> intro}}
-
-
diff --git a/app/client/views/home/home.js b/app/client/views/home/home.js
deleted file mode 100644
index cf9a237b..00000000
--- a/app/client/views/home/home.js
+++ /dev/null
@@ -1,15 +0,0 @@
-Template.home.helpers({
- selectedTab: function(){
- return Session.get("homePage.selectedTab");
- },
-});
-
-Template.home.events({
- "core-animated-pages-transition-end .tabPages": function(event) {
- event.stopPropagation();
- },
- "tap .homeTabs paper-tab": function(event, instance){
- Session.set("homePage.selectedTab",
- event.currentTarget.getAttribute("name"));
- },
-});
diff --git a/app/client/views/home/intro/intro.css b/app/client/views/home/intro/intro.css
deleted file mode 100644
index cf6f52bc..00000000
--- a/app/client/views/home/intro/intro.css
+++ /dev/null
@@ -1,38 +0,0 @@
-.intro .section {
- width: 100%;
- min-height: 200px;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- padding-top: 24px;
- padding-bottom: 24px;
-}
-
-.intro .section > div, .intro .section > h2 {
- padding: 32px;
-}
-
-.intro .section .display1 {
- margin-bottom: 16px;
-}
-
-.intro .section .columns > div {
- max-width: 300px;
- padding: 16px;
- text-align: center;
- min-width: 0;
-}
-
-.intro .section .columns {
- max-width: 100%;
-}
-
-.intro paper-button {
- flex-basis: 200px;
-}
-
-
-.intro paper-button:not([raised]) {
- color: #d13b2e;
-}
diff --git a/app/client/views/home/intro/intro.html b/app/client/views/home/intro/intro.html
deleted file mode 100644
index 6b687a5f..00000000
--- a/app/client/views/home/intro/intro.html
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
- Realtime D&D 5e Character Tracker
-
-
- Spend less time shuffling paper and more time playing
-
- {{#unless currentUser}}
-
- {{else}}
-
- {{/unless}}
-
-
-
-
Character Sheets
-
- Check out the example characters
-
-
-
-
-
-
-
-
- Guide
-
-
- Learn how your class gives you features, those features have effects,
- and those effects determine your stats.
-
-
-
- View Guide
-
-
-
-
-
-
- Open Source
-
-
- Shape upcoming features, track bugs, and contribute to the DiceCloud codebase
-
-
-
- GitHub Repo
-
-
-
-
-
-
-
diff --git a/app/client/views/layout/head.html b/app/client/views/layout/head.html
deleted file mode 100644
index 583fdf40..00000000
--- a/app/client/views/layout/head.html
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/client/views/layout/layout.css b/app/client/views/layout/layout.css
deleted file mode 100644
index 2ecbb5ad..00000000
--- a/app/client/views/layout/layout.css
+++ /dev/null
@@ -1,38 +0,0 @@
-#accountSummary {
- min-height: 146px;
- color: white;
-}
-
-#mainContentSection {
- display: initial !important;
-}
-
-#navPanel paper-icon-item {
- background: white;
- cursor: pointer;
-}
-
-app-drawer-layout.layout {
- z-index: 0;
-}
-
-#accountSummary > #background {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- overflow: hidden;
-}
-
-#accountSummary > #background > #backgroundFrontLayer {
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- height: 100%;
- pointer-events: none;
- background-size: cover;
- background-image: url(/png/paper-dice-crown.png);
-}
diff --git a/app/client/views/layout/layout.html b/app/client/views/layout/layout.html
deleted file mode 100644
index 1997308d..00000000
--- a/app/client/views/layout/layout.html
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
- {{> appDrawer}}
-
- {{> yield}}
-
-
- {{> Template.dynamic template=globalToastTemplate data=globalToastData }}
-
-
- {{> dialogStack}}
-
-
-
-
-
-
-
- {{#if currentUser}}
-
- {{profileLink}}
-
- {{else}}
-
- Sign in
-
- {{/if}}
-
-
-
-
-
diff --git a/app/client/views/layout/layout.js b/app/client/views/layout/layout.js
deleted file mode 100644
index 0d24a237..00000000
--- a/app/client/views/layout/layout.js
+++ /dev/null
@@ -1,45 +0,0 @@
-Template.layout.onCreated(function() {
- this.subscribe("user");
-});
-
-Template.appDrawer.helpers({
- profileLink: function() {
- var user = Meteor.user();
- return user.profile && user.profile.username || user.username || "My Account";
- },
-});
-
-let drawerLayout;
-const closeDrawer = function(instance){
- if (!drawerLayout) drawerLayout = $("app-drawer-layout")[0];
- if (drawerLayout && drawerLayout.narrow){
- drawerLayout.drawer.close();
- }
-}
-
-Template.appDrawer.events({
- "click a": function(event, instance){
- closeDrawer(instance);
- },
- "click .feedback": function(event, instance) {
- pushDialogStack({
- template: "feedback",
- element: event.currentTarget,
- callback: function(report){
- if (!report) return;
- Meteor.call("insertReport", report, function(e, result){
- GlobalUI.toast({
- text: e && e.details || "Feedback submitted"
- });
- });
- },
- });
- closeDrawer(instance);
- },
- "click .patreon": function(event, instance){
- ga("send", "event", "externalLink", "patreon");
- },
- "click .github": function(event, instance){
- ga("send", "event", "externalLink", "github");
- },
-});
diff --git a/app/client/views/layout/testLayout.html b/app/client/views/layout/testLayout.html
deleted file mode 100644
index 633c870a..00000000
--- a/app/client/views/layout/testLayout.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
- {{> yield}}
-
-
-
diff --git a/app/client/views/library/itemLibrary/itemLibrary.html b/app/client/views/library/itemLibrary/itemLibrary.html
deleted file mode 100644
index 5fbf353b..00000000
--- a/app/client/views/library/itemLibrary/itemLibrary.html
+++ /dev/null
@@ -1,5 +0,0 @@
-
- {{#each items}}
- {{> libraryItem}}
- {{/each}}
-
diff --git a/app/client/views/library/itemLibrary/itemLibrary.js b/app/client/views/library/itemLibrary/itemLibrary.js
deleted file mode 100644
index 480effcc..00000000
--- a/app/client/views/library/itemLibrary/itemLibrary.js
+++ /dev/null
@@ -1,7 +0,0 @@
-Template.itemLibrary.helpers({
- items(){
- return Items.find({charId: {$in: [
- "SRDLibrary",
- ]}});
- },
-});
diff --git a/app/client/views/library/library.html b/app/client/views/library/library.html
deleted file mode 100644
index e22c9a84..00000000
--- a/app/client/views/library/library.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- {{> itemLibrary}}
- {{! {{> spellLibrary}} }}
-
-
-
-
diff --git a/app/client/views/loading/loading.css b/app/client/views/loading/loading.css
deleted file mode 100644
index 0203493a..00000000
--- a/app/client/views/loading/loading.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.bigSpinner {
- width: 100px;
- height: 100px;
- margin-bottom: 16px;
-}
diff --git a/app/client/views/loading/loading.html b/app/client/views/loading/loading.html
deleted file mode 100644
index 53ec6928..00000000
--- a/app/client/views/loading/loading.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/app/client/views/loading/loading.js b/app/client/views/loading/loading.js
deleted file mode 100644
index 3680efd5..00000000
--- a/app/client/views/loading/loading.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var hints = [
- "Drag and drop items to move them between containers.",
- "Hold Ctrl while dragging items around to only move some of them.",
- "Magic items are considered priceless, don't give them a gold value.",
- "You can use formulae in {curly brackets} in any field with a {} icon.",
- "You can disable the 'Spells' tab from the charecter menu in the top right.",
- "You can share your character with others from the menu in the top right.",
- "Your spells, features, and items are ordered by their colour, which you can set with the paint bucket.",
- "You can only have three magic items attuned to you at once. Choose carefully!",
- "Click the '+' underneath 'Hit Points' to add additional health bars for temporary HP, wild shapes, familiars and more.",
-];
-
-Template.loading.helpers({
- randomHint: function(){
- return Random.choice(hints);
- }
-});
diff --git a/app/client/views/meta/changeLog/changeLog.html b/app/client/views/meta/changeLog/changeLog.html
deleted file mode 100644
index 63f66b9e..00000000
--- a/app/client/views/meta/changeLog/changeLog.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
- Change Log
-
-
-
-
-
-
- {{#each changeLogs}}
-
- {{version}}
-
- {{#each changes}}
- {{this}}
- {{/each}}
-
-
- {{/each}}
-
-
-
-
-
diff --git a/app/client/views/meta/error/error.html b/app/client/views/meta/error/error.html
deleted file mode 100644
index 945893f9..00000000
--- a/app/client/views/meta/error/error.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{#if errorMessage}}
-
{{errorMessage}}
-
Try Again
- {{/if}}
-
-
-
-
diff --git a/app/client/views/meta/error/error.js b/app/client/views/meta/error/error.js
deleted file mode 100644
index 3870d686..00000000
--- a/app/client/views/meta/error/error.js
+++ /dev/null
@@ -1,17 +0,0 @@
-Template.error.onRendered(function(){
- const error = Session.get("error") || {};
- if (error.href) window.history.replaceState("", "", error.href);
-});
-
-Template.error.helpers({
- errorMessage: function(){
- const error = Session.get("error") || {};
- return error.reason;
- },
-});
-
-Template.error.events({
- "click .try-again": function(event, instance){
- window.location.reload();
- },
-});
diff --git a/app/client/views/notFound/notFound.html b/app/client/views/notFound/notFound.html
deleted file mode 100644
index c919c7e1..00000000
--- a/app/client/views/notFound/notFound.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
The data for the page you requested could not be found.
- {{#if currentUser}}
- It might not exist, or you might not have permission to view it.
- {{else}}
- Perhaps you need to sign in first:
- {{atForm}}
- {{/if}}
-
-
\ No newline at end of file
diff --git a/app/client/views/paperTemplates/baseDialog/baseDialog.css b/app/client/views/paperTemplates/baseDialog/baseDialog.css
deleted file mode 100644
index 8cb79b8b..00000000
--- a/app/client/views/paperTemplates/baseDialog/baseDialog.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.base-dialog h1,
-.base-dialog h2,
-.base-dialog h3,
-.base-dialog h4,
-.base-dialog h5,
-.base-dialog h6{
- margin-bottom: 8px;
-}
-
-.base-dialog p{
- margin-bottom: 20px;
-}
\ No newline at end of file
diff --git a/app/client/views/paperTemplates/baseDialog/baseDialog.html b/app/client/views/paperTemplates/baseDialog/baseDialog.html
deleted file mode 100644
index 9515f55f..00000000
--- a/app/client/views/paperTemplates/baseDialog/baseDialog.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
- {{title}}
- {{#if editing}}
- {{#unless hideDelete}}
-
-
- {{/unless}}
- {{#unless hideColor}}
- {{> colorDropdown}}
- {{/unless}}
- {{#unless editOnly}}
-
-
- {{/unless}}
- {{else}}
- {{#if showEdit}}
-
-
- {{/if}}
- {{/if}}
-
-
- {{#unless editing}}
- {{> UI.contentBlock}}
- {{else}}
- {{> UI.elseBlock}}
- {{/unless}}
-
-
-
diff --git a/app/client/views/paperTemplates/baseDialog/baseDialog.js b/app/client/views/paperTemplates/baseDialog/baseDialog.js
deleted file mode 100644
index 2d51ead3..00000000
--- a/app/client/views/paperTemplates/baseDialog/baseDialog.js
+++ /dev/null
@@ -1,28 +0,0 @@
-Template.baseDialog.onCreated(function(){
- this.editing = new ReactiveVar(!!this.data.startEditing);
-});
-
-Template.baseDialog.helpers({
- editing: function(){
- if (!Template.parentData() || !Template.parentData().charId) return true;
- return Template.instance().editing.get() &&
- canEditCharacter(Template.parentData().charId);
- },
- showEdit: function() {
- if (this.hideEdit) return false;
- if (!Template.parentData() || !Template.parentData().charId) return true;
- return canEditCharacter(Template.parentData().charId);
- },
-});
-
-Template.baseDialog.events({
- "tap #backButton": function(){
- popDialogStack();
- },
- "tap #editButton": function(event, instance){
- instance.editing.set(true);
- },
- "tap #doneEditingButton": function(event, instance){
- instance.editing.set(false);
- },
-});
diff --git a/app/client/views/paperTemplates/baseEditDialog/baseEditDialog.html b/app/client/views/paperTemplates/baseEditDialog/baseEditDialog.html
deleted file mode 100644
index b90019f5..00000000
--- a/app/client/views/paperTemplates/baseEditDialog/baseEditDialog.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
- {{title}}
- {{#unless hideDelete}}
-
-
- {{/unless}}
- {{#unless hideColor}}
- {{> colorDropdown}}
- {{/unless}}
-
-
- {{> UI.contentBlock}}
-
-
-
diff --git a/app/client/views/paperTemplates/baseEditDialog/baseEditDialog.js b/app/client/views/paperTemplates/baseEditDialog/baseEditDialog.js
deleted file mode 100644
index b50f622f..00000000
--- a/app/client/views/paperTemplates/baseEditDialog/baseEditDialog.js
+++ /dev/null
@@ -1,5 +0,0 @@
-Template.baseEditDialog.events({
- "tap #backButton": function(){
- popDialogStack();
- },
-});
diff --git a/app/client/views/paperTemplates/colorDropdown/colorDropdown.css b/app/client/views/paperTemplates/colorDropdown/colorDropdown.css
deleted file mode 100644
index b83e917b..00000000
--- a/app/client/views/paperTemplates/colorDropdown/colorDropdown.css
+++ /dev/null
@@ -1,4 +0,0 @@
-.colorDropdown paper-item {
- width: 150px;
- cursor: pointer;
-}
diff --git a/app/client/views/paperTemplates/colorDropdown/colorDropdown.html b/app/client/views/paperTemplates/colorDropdown/colorDropdown.html
deleted file mode 100644
index a1e756f0..00000000
--- a/app/client/views/paperTemplates/colorDropdown/colorDropdown.html
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
diff --git a/app/client/views/paperTemplates/colorDropdown/colorDropdown.js b/app/client/views/paperTemplates/colorDropdown/colorDropdown.js
deleted file mode 100644
index e6fa01b0..00000000
--- a/app/client/views/paperTemplates/colorDropdown/colorDropdown.js
+++ /dev/null
@@ -1,28 +0,0 @@
-Template.colorDropdown.helpers({
- colors: function(){
- let colors = "";
- _.each(colorOptions, (option) => {
- colors += !colors ? `["${option.color}"` : `, "${option.color}"`;
- });
- colors += "]";
- return colors;
- },
- selectedColor: function(){
- const selected = _.find(colorOptions, (option) => option.key === this.color);
- return selected && selected.color;
- },
-});
-
-Template.colorDropdown.events({
- "color-picker-selected": function(event, instance){
- var color = event.originalEvent.detail.color;
- var option = _.find(colorOptions, (option) => {
- return option.color === color.toUpperCase()}
- );
- var key = option && option.key;
- instance.$("paper-swatch-picker").trigger({
- type: "color-change",
- color: key,
- });
- }
-});
diff --git a/app/client/views/paperTemplates/dialogStack/dialogStack.css b/app/client/views/paperTemplates/dialogStack/dialogStack.css
deleted file mode 100644
index 51419b07..00000000
--- a/app/client/views/paperTemplates/dialogStack/dialogStack.css
+++ /dev/null
@@ -1,91 +0,0 @@
-.dialog-stack {
- z-index: 1;
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- visibility: visible;
- transition: visibility 0s linear;
-}
-
-.dialog-stack.hide {
- visibility: hidden;
- transition: visibility 0s linear 400ms;
-}
-
-.dialog-stack .backdrop {
- background: #000;
- transform: translateZ(0);
- opacity: 0.4;
- transition: opacity 400ms linear;
-}
-
-.dialog-stack.hide .backdrop {
- opacity: 0;
- transition: opacity 200ms linear;
-}
-
-.dialog-stack .dialog-sizer {
- position: relative;
- height: 80%;
- width: 80%;
- max-width: 800px;
- max-height: 600px;
-}
-
-.dialog-stack app-toolbar {
- border-radius: 2px 2px 0 0;
-}
-
-@media (max-width: 640px) {
- .dialog-stack app-toolbar {
- border-radius: 0;
- }
-}
-
-@media (max-width: 640px) {
- .dialog-stack .dialog-sizer {
- width: 100%;
- height: 100%;
- max-width: initial;
- max-height: initial;
- }
- .dialog-stack .dialog {
- border-radius: 0;
- }
-}
-
-.dialog-stack .dialog {
- position: absolute;
- width: 100%;
- height: 100%;
- background: white;
- box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),
- 0 3px 14px 2px rgba(0, 0, 0, 0.12),
- 0 5px 5px -3px rgba(0, 0, 0, 0.4);
- border-radius: 2px;
- transform-origin: top left;
- transition: top 400ms ease, left 400ms ease;
- z-index: 3;
- overflow: visible;
-}
-
-.dialog-stack .dialog .testButton {
- height: 200px;
- width: 100px;
- background: red;
- border-radius: 30px;
-}
-
-.dialog-stack .dialog .form {
- padding: 24px;
-}
-
-.dialog-stack .dialog .buttons {
- padding: 8px 8px 8px 24px;
-}
-
-.dialog-stack .dialog img, .dialog-stack .dialog iron-image {
- max-width: 100%;
-}
diff --git a/app/client/views/paperTemplates/dialogStack/dialogStack.html b/app/client/views/paperTemplates/dialogStack/dialogStack.html
deleted file mode 100644
index 5a0f7d28..00000000
--- a/app/client/views/paperTemplates/dialogStack/dialogStack.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- {{#each dialogs}}
-
- {{> UI.dynamic template=template data=data}}
-
- {{/each}}
-
-
-
-
-
-
- Test dialog {{data}}
-
-
-
diff --git a/app/client/views/paperTemplates/dialogStack/dialogStack.js b/app/client/views/paperTemplates/dialogStack/dialogStack.js
deleted file mode 100644
index e52cb10a..00000000
--- a/app/client/views/paperTemplates/dialogStack/dialogStack.js
+++ /dev/null
@@ -1,328 +0,0 @@
-dialogs = new ReactiveArray();
-const offset = 16;
-const duration = 400;
-
-pushDialogStack = function({template, data, element, returnElement, callback}){
- // Generate a new _id so that Blaze knows how to shuffle the array
- const _id = Random.id();
- dialogs.push({
- _id,
- template,
- data,
- element,
- returnElement,
- callback,
- });
-
- updateHistory();
-};
-
-var currentResult;
-
-popDialogStack = function(result){
- if (history && history.state && history.state.openDialogs){
- currentResult = result;
- history.back();
- } else {
- popDialogStackAction(result);
- }
-}
-
-window.onpopstate = function(event){
- let state = event.state;
- let numDialogs = dialogs._array.length;
- if (_.isFinite(state.openDialogs) && numDialogs > state.openDialogs){
- popDialogStackAction(currentResult);
- currentResult = undefined;
- }
-}
-
-popDialogStackAction = function(result){
- const dialog = dialogs.pop();
- updateHistory();
- if (!dialog) return;
- dialog.callback && dialog.callback(result);
-};
-
-let updateHistory = function(){
- // history should looks like: [{openDialogs: 0}, {openDialogs: n}] where
- // n is the number of open dialogs
-
- // If we can't access the history object, give up
- if (!history) return;
- // Make sure that there is a state tracking open dialogs
- // replace the state without bashing it in the process
- if (!history.state || !_.isFinite(history.state.openDialogs)){
- let newState = _.clone(history.state) || {};
- newState.openDialogs = 0;
- history.replaceState(newState, "");
- }
-
- const numDialogs = dialogs._array.length;
- const stateDialogs = history.state.openDialogs;
-
- // If the number of dialogs and state dialogs are equal, we don't need to do
- // anything
- if (numDialogs === stateDialogs) return;
-
- if (stateDialogs > 0){
- // On a dialog count
- if (numDialogs === 0){
- // but shouldn't be
- history.back();
- } else {
- // but should replace with correct count
- let newState = _.clone(history.state) || {};
- newState.openDialogs = dialogs._array.length;
- history.replaceState(newState, "");
- }
- } else if (numDialogs > 0 && stateDialogs === 0){
- // On the zero state, push a dialog count
- history.pushState({openDialogs: numDialogs}, "");
- } else {
- console.warn(
- "History could not be updated correctly, unexpected case",
- {stateDialogs, numDialogs},
- )
- }
-};
-
-Template.dialogStack.helpers({
- dialogStackClass(){
- if (!dialogs.get().length) return "hide";
- },
- dialogs(){
- return dialogs.get();
- },
- dialogStyle(index){
- const length = dialogs.get().length;
- if (index >= length) return;
- const num = length - 1;
- const left = (num - index) * -offset;
- const top = (num - index) * -offset;
- return `left:${left}px; top:${top}px;`;
- },
-});
-
-Template.dialogStack.events({
- "click .dialog-stack .backdrop": function(event){
- if (event.target === event.currentTarget) popDialogStack();
- },
-});
-
-// Only supports border radius defined like "20px" or "100%"
-const transformedRadius = (radiusString, deltaWidth, deltaHeight) => {
- if (/^\d+\.?\d*px$/.test(radiusString)){
- //The radius is defined in pixel units, so get the radius as a number
- const rad = +radiusString.match(/\d+\.?\d*/)[0];
- // Set the x and y radius of the "to" element, compensating for scale
- return `${rad / deltaWidth}px / ${rad / deltaHeight}px`;
- } else if (/^\d+\.?\d*%$/.test(radiusString)) {
- //The radius is defined as a percentage, so just use it as is
- return radiusString;
- }
-};
-
-const imitate = (
- element, source, deltaLeft, deltaTop, deltaWidth, deltaHeight
-) => {
- element.style.transform = `translate(${deltaLeft}px, ${deltaTop}px) ` +
- `scale(${deltaWidth}, ${deltaHeight})`;
- element.style.background = $(source).css("background");
- // Imitate the border radius after transform
- const border = $(source).css("border-radius")
- const rad = transformedRadius(border, deltaWidth, deltaHeight);
- element.style.borderRadius = rad
-}
-
-const shrinkAnimation = ({element, reverse}) => {
- element.css({
- transform: reverse ? "scale(0) translateZ(0)" : "",
- });
- const fraction = duration / 4;
- _.defer(() => element.css({
- transition: reverse ?
- `transform ${fraction}ms ease ${duration - fraction}ms` :
- `transform ${fraction}ms ease`
- ,
- transform: reverse ? "" : "scale(0) translateZ(0)",
- }));
- _.delay(() => element.css({
- transition: "",
- }), duration);
-}
-
-const dialogOpenAnimation = ({element, returnElement, dialog}) => {
- // hide all floaty buttons when we open the first dialog
- let fabs = $(".mini-holder paper-fab, .floatyButton").filter(
- (index, el) => el !== element && el !== returnElement
- );
- if (dialogs._array.length === 1) {
- shrinkAnimation({element: fabs});
- }
-
- const dialogRect = dialog.getBoundingClientRect();
- const elementRect = element.getBoundingClientRect();
- element.style.visibility = "hidden";
- returnElement = _.isFunction(returnElement) ? returnElement() : returnElement;
- if (returnElement) returnElement.style.visibility = "hidden";
- // Get how must the element change to become the dialog
- const deltaLeft = elementRect.left - dialogRect.left;
- const deltaTop = elementRect.top - dialogRect.top;
- const deltaWidth = elementRect.width / dialogRect.width;
- const deltaHeight = elementRect.height / dialogRect.height;
-
- // Make the dialog imitate the element, immediately
- dialog.style.transition = "none";
- imitate(dialog, element, deltaLeft, deltaTop, deltaWidth, deltaHeight);
-
- _.defer(() => {
- // Next frame, undo the imitation, let dialog animate back into place
- dialog.style.transition = `all ${duration}ms ease`;
- dialog.style.transform = "";
- dialog.style.borderRadius = "";
- dialog.style.background = "";
- });
- // Clean up after the animation is done and call our callback
- _.delay(() => {
- dialog.style.transition = "";
- }, duration);
-}
-
-const dialogCloseAnimation = ({element, returnElement, dialog, callback}) => {
- // unhide all floaty buttons when we close the last dialog
- let fabs = $(".mini-holder paper-fab, .floatyButton").filter(
- (index, el) => el !== element && el !== returnElement
- );
- if (dialogs._array.length === 0) {
- shrinkAnimation({element: fabs, reverse: true});
- }
-
- // We are returning to a different element
- // pop the original element back in and use the returnElement in its place
- returnElement = _.isFunction(returnElement) ? returnElement() : returnElement;
- if (returnElement && returnElement !== element){
- let originalElement = element;
- element = returnElement;
- originalElement.style.transition = "";
- originalElement.style.visibility = "";
- originalElement.style.transform = "scale(0) translateZ(0px)";
- _.defer(() => {
- originalElement.style.transition = `transform ${duration}ms ease`;
- originalElement.style.transform = "";
- });
- _.delay(() => {
- originalElement.style.transition = "";
- }, duration);
- }
- // Reset the dialog if it is mid-transition
- dialog.style.transition = "none";
- dialog.style.transform = "none";
- dialog.style.borderRadius = "";
- dialog.style.background = "";
- dialog.style.opacity = "1";
- // Get the original bounding rectangles of both elements
- const dialogRect = dialog.getBoundingClientRect();
- const elementRect = element.getBoundingClientRect();
-
- // Set up a clone of the original element
- // This lets us have a fixed position element which isn't clipped
- clone = element.cloneNode(true);
- clone.style.position = "fixed";
- clone.style.top = 0;
- clone.style.left = 0;
- clone.style.width = elementRect.width + "px";
- clone.style.height = elementRect.height + "px";
- clone.style.visibility = "";
- clone.style.zIndex = 2;
-
- // Compensate for stack moving at the same time if we are many dialogs deep
- const stackCompensation = dialogs._array.length ? 16 : 0;
-
- // Insert clone before its progenitor so it can inherit css correctly
- element.parentNode && element.parentNode.insertBefore(clone, element);
-
- // Polymer messes up fixed positioning, measure and compensate
- startingRect = clone.getBoundingClientRect();
- clone.style.top = (elementRect.top - startingRect.top + stackCompensation) +
- "px";
- clone.style.left = (elementRect.left - startingRect.left + stackCompensation) +
- "px";
-
- // How must the original dialog change to become the element
- const deltaLeft = dialogRect.left - elementRect.left - stackCompensation;
- const deltaTop = dialogRect.top - elementRect.top - stackCompensation;
- const deltaWidth = dialogRect.width / elementRect.width;
- const deltaHeight = dialogRect.height / elementRect.height;
-
- // Make the clone imitate the dialog
- clone.style.transition = "none";
- clone.style.transformOrigin = "top left"
- imitate(clone, dialog, deltaLeft, deltaTop, deltaWidth, deltaHeight);
-
- _.defer(() => {
- // Next frame, undo the imitation, let clone animate into its place
- clone.style.transition = `all ${duration}ms ease`;
- clone.style.transform = "";
- clone.style.borderRadius = "";
- clone.style.background = "";
- // Make the dialog follow the clone in and fade away
- dialog.style.transition = `all ${duration}ms ease, ` +
- `opacity ${duration / 2}ms linear`;
- dialog.style.opacity = 0;
- imitate(dialog, element, -deltaLeft,
- -deltaTop, 1 / deltaWidth, 1 / deltaHeight);
- });
- // Clean up after the animation is done and call our callback
- _.delay(() => {
- element.style.visibility = "";
- clone.remove();
- if (callback) callback();
- }, duration);
-};
-
-Template.dialogStack.onRendered(function(){
- $(".dialog-sizer")[0]._uihooks = {
- insertElement: function(node, next) {
- $(node).insertBefore(next);
- const data = Blaze.getData(node);
- if (data.element){
- // Store the reference to the element on the DOM node itself,
- // since Blaze won't keep the data around for the remove hook
- node._dialogStackElement = data.element;
- node._dialogStackReturnElement = data.returnElement;
- dialogOpenAnimation({
- element: data.element,
- returnElement: data.returnElement,
- dialog: node,
- });
- }
- },
- removeElement: function(node) {
- const element = node._dialogStackElement;
- const returnElement = node._dialogStackReturnElement;
- if (element){
- dialogCloseAnimation({
- element,
- returnElement,
- dialog: node,
- callback(){
- node.remove();
- },
- });
- } else {
- node.remove();
- }
- },
- }
-});
-
-Template.testDialog.events({
- "click .testButton": function(event, template){
- pushDialogStack({
- template: "testDialog",
- element: event.currentTarget,
- data: Random.id(),
- });
- },
-})
diff --git a/app/client/views/paperTemplates/fabMenu/fabMenu.css b/app/client/views/paperTemplates/fabMenu/fabMenu.css
deleted file mode 100644
index ccc4d06b..00000000
--- a/app/client/views/paperTemplates/fabMenu/fabMenu.css
+++ /dev/null
@@ -1,41 +0,0 @@
-.mini-holder {
- position: fixed;
- padding: 4px;
- bottom: 80px;
- right: 24px;
- width: 56px;
- pointer-events: none;
- flex-direction: column-reverse !important;
-}
-
-.mini-holder > div{
- transform: scale(0);
- transition-property: transform;
- transition-duration: 0.3s;
- transition-timing-function: ease-in-out;
- margin: 4px;
-}
-
-.mini-holder.active > div {
- transform: scale(1);
-}
-
-.mini-holder.active {
- pointer-events: auto;
-}
-
-.mini-holder.active > div:nth-child(2){
- transition-delay: 0.1s;
-}
-
-.mini-holder.active > div:nth-child(3){
- transition-delay: 0.2s;
-}
-
-.mini-holder.active > div:nth-child(4){
- transition-delay: 0.3s;
-}
-
-.mini-holder.active > div:nth-child(5){
- transition-delay: 0.4s;
-}
diff --git a/app/client/views/paperTemplates/fabMenu/fabMenu.html b/app/client/views/paperTemplates/fabMenu/fabMenu.html
deleted file mode 100644
index 902cff36..00000000
--- a/app/client/views/paperTemplates/fabMenu/fabMenu.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- {{> UI.contentBlock}}
-
-
diff --git a/app/client/views/paperTemplates/fabMenu/fabMenu.js b/app/client/views/paperTemplates/fabMenu/fabMenu.js
deleted file mode 100644
index 2f478246..00000000
--- a/app/client/views/paperTemplates/fabMenu/fabMenu.js
+++ /dev/null
@@ -1,34 +0,0 @@
-Template.fabMenu.onCreated(function() {
- this.active = new ReactiveVar(false);
-});
-
-Template.fabMenu.onRendered(function(){
- const fab = this.find("paper-fab.expand-menu");
- // Do a spin animation to turn the + icon into a x when active
- this.autorun(() => {
- const active = this.active.get();
- if (fab && fab.updateStyles){
- const iconStyle = active ?
- "transition: transform 0.3s ease; transform: rotate(225deg);" :
- "transition: transform 0.3s ease;";
- fab.updateStyles({
- ["--paper-fab-iron-icon"]: iconStyle,
- });
- }
- })
-});
-
-Template.fabMenu.helpers({
- active: function() {
- return Template.instance().active.get();
- },
-});
-
-Template.fabMenu.events({
- "click .expand-menu": function(event, instance) {
- instance.active.set(!instance.active.get());
- },
- "click .mini-holder paper-fab": function(event, instance) {
- instance.active.set(false);
- },
-});
diff --git a/app/client/views/paperTemplates/gridPadding/gridPadding.html b/app/client/views/paperTemplates/gridPadding/gridPadding.html
deleted file mode 100644
index d83c9245..00000000
--- a/app/client/views/paperTemplates/gridPadding/gridPadding.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- {{#each list}}
-
- {{/each}}
-
\ No newline at end of file
diff --git a/app/client/views/paperTemplates/gridPadding/gridPadding.js b/app/client/views/paperTemplates/gridPadding/gridPadding.js
deleted file mode 100644
index ec9a930d..00000000
--- a/app/client/views/paperTemplates/gridPadding/gridPadding.js
+++ /dev/null
@@ -1,6 +0,0 @@
-Template.gridPadding.helpers({
- //create a list of true values with length = num
- list: function(){
- return _.range(1, this.num);
- }
-});
diff --git a/app/client/views/paperTemplates/infoBox/infoBox.css b/app/client/views/paperTemplates/infoBox/infoBox.css
deleted file mode 100644
index 933dc37c..00000000
--- a/app/client/views/paperTemplates/infoBox/infoBox.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.infoBox iron-icon {
- color: #747474;
- color: rgba(0,0,0,0.54);
- height: 32px;
- width: 32px;
- margin-right: 12px;
-}
-
-.infoBox > div > p {
- margin: 0;
-}
-
-.infoBox > div > p + p {
- margin-top: 10px;
-}
diff --git a/app/client/views/paperTemplates/infoBox/infoBox.html b/app/client/views/paperTemplates/infoBox/infoBox.html
deleted file mode 100644
index bc86be2d..00000000
--- a/app/client/views/paperTemplates/infoBox/infoBox.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
- {{> Template.contentBlock}}
-
-
-
diff --git a/app/client/views/paperTemplates/inputSuffixes/inputSuffixes.css b/app/client/views/paperTemplates/inputSuffixes/inputSuffixes.css
deleted file mode 100644
index 4bf159bc..00000000
--- a/app/client/views/paperTemplates/inputSuffixes/inputSuffixes.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.textarea-bracket-suffix {
- margin-bottom: 12px;
-}
-
-.description-input > paper-textarea {
- width: 100%;
- width: 100% - 24px;
-}
diff --git a/app/client/views/paperTemplates/inputSuffixes/inputSuffixes.html b/app/client/views/paperTemplates/inputSuffixes/inputSuffixes.html
deleted file mode 100644
index 08c15e04..00000000
--- a/app/client/views/paperTemplates/inputSuffixes/inputSuffixes.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
- {{# simpleTooltip}}
- This is a formula field
- {{/ simpleTooltip}}
-
-
-
-
-
-
- {{# simpleTooltip}}
- This field accepts formulae in {curly brackets}
- {{/ simpleTooltip}}
-
-
-
-
-
-
-
- {{# simpleTooltip}}
- This field accepts markdown formatting
- {{/ simpleTooltip}}
-
-
-
- {{# simpleTooltip}}
- This field accepts formulae in {curly brackets}
- {{/ simpleTooltip}}
-
-
-
diff --git a/app/client/views/paperTemplates/ripple/ripple.css b/app/client/views/paperTemplates/ripple/ripple.css
deleted file mode 100644
index 476395f8..00000000
--- a/app/client/views/paperTemplates/ripple/ripple.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.custom-ripple {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- color: #D50000;
-}
\ No newline at end of file
diff --git a/app/client/views/paperTemplates/ripple/ripple.html b/app/client/views/paperTemplates/ripple/ripple.html
deleted file mode 100644
index e490c974..00000000
--- a/app/client/views/paperTemplates/ripple/ripple.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
- {{#if color}}
-
- {{else}}
-
- {{/if}}
-
\ No newline at end of file
diff --git a/app/client/views/paperTemplates/simpleTooltip/simpleTooltip.css b/app/client/views/paperTemplates/simpleTooltip/simpleTooltip.css
deleted file mode 100644
index 67822bb6..00000000
--- a/app/client/views/paperTemplates/simpleTooltip/simpleTooltip.css
+++ /dev/null
@@ -1,36 +0,0 @@
-.simple-tooltip {
- pointer-events: none;
-}
-
-.simple-tooltip:active {
- pointer-events: none;
-}
-
-/* Show the tooltip if a older sibling is hovered */
-*:hover ~ .simple-tooltip > .tooltip {
- opacity: 0.9;
-}
-
-/* Show the tooltip if parent is hovered */
-*:hover > .simple-tooltip > .tooltip {
- opacity: 0.9;
-}
-
-.tooltip {
- opacity: 0;
- transition: opacity 200ms ease-in;
- font-size: 12px;
- line-height: 1;
- background-color: #616161;
- color: white;
- padding: 8px;
- border-radius: 2px;
- position: absolute;
- right: calc(100% + 8px);
- pointer-events: none;
- white-space: nowrap;
-}
-
-.tooltip.always {
- opacity: 0.9;
-}
diff --git a/app/client/views/paperTemplates/simpleTooltip/simpleTooltip.html b/app/client/views/paperTemplates/simpleTooltip/simpleTooltip.html
deleted file mode 100644
index f364ba71..00000000
--- a/app/client/views/paperTemplates/simpleTooltip/simpleTooltip.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
diff --git a/app/client/views/paperTemplates/undoToast/undoToast.html b/app/client/views/paperTemplates/undoToast/undoToast.html
deleted file mode 100644
index f4f10501..00000000
--- a/app/client/views/paperTemplates/undoToast/undoToast.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Undo
-
\ No newline at end of file
diff --git a/app/client/views/paperTemplates/undoToast/undoToast.js b/app/client/views/paperTemplates/undoToast/undoToast.js
deleted file mode 100644
index 77fdc85d..00000000
--- a/app/client/views/paperTemplates/undoToast/undoToast.js
+++ /dev/null
@@ -1,18 +0,0 @@
-Template.undoToast.events({
- "tap #undoButton": function(event, instance){
- var collection = window[this.collection];
- if (!collection){
- console.warn(
- "Collection with name ",
- this.collection,
- " could not be found"
- );
- return;
- }
- if (collection.restoreNode){
- collection.restoreNode(this.id);
- } else {
- collection.restore(this.id);
- }
- }
-});
diff --git a/app/client/views/user/profile/profile.css b/app/client/views/user/profile/profile.css
deleted file mode 100644
index 5d3a8a1c..00000000
--- a/app/client/views/user/profile/profile.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.profile paper-button, .profile a, .profile #at-nav-button {
- color: #d13b2e;
-}
diff --git a/app/client/views/user/profile/profile.html b/app/client/views/user/profile/profile.html
deleted file mode 100644
index 5a8e6a50..00000000
--- a/app/client/views/user/profile/profile.html
+++ /dev/null
@@ -1,74 +0,0 @@
-
- {{#with currentUser}}
-
-
-
-
- Account
-
-
-
-
-
-
- Username
- {{profileName}}
-
-
-
-
-
-
- Email
-
- {{#each emails}}
-
- {{address}}
- {{#if verified}}
-
-
- {{#simpleTooltip}}Verified{{/simpleTooltip}}
-
- {{/if}}
-
- {{/each}}
-
-
-
-
-
-
- Change password
-
-
-
-
-
- API Key
-
-
- {{#if apiKey}}
- {{#unless showApiKey}}
-
- Show
-
- {{else}}
- {{apiKey}}
- {{/unless}}
- {{else}}
-
- Generate
-
- {{/if}}
-
-
-
-
- {{> atForm state="signIn"}}
-
- {{> atNavButton }}
-
-
-
- {{/with}}
-
diff --git a/app/client/views/user/profile/profile.js b/app/client/views/user/profile/profile.js
deleted file mode 100644
index ca64f6ea..00000000
--- a/app/client/views/user/profile/profile.js
+++ /dev/null
@@ -1,42 +0,0 @@
-Template.profile.onCreated(function(){
- this.showApiKey = new ReactiveVar(false);
-});
-
-Template.profile.helpers({
- profileName: function() {
- var user = Meteor.user();
- return user.profile && user.profile.username ||
- user.username ||
- "Tap to set username";
- },
- showApiKey: function(){
- return Template.instance().showApiKey.get();
- },
-});
-
-Template.profile.events({
- "click .username-edit": function(event, instance){
- if (this._id === Meteor.userId()){
- pushDialogStack({
- template: "usernameDialog",
- element: event.currentTarget,
- });
- }
- },
- "click #at-resend-verification-email": function(event, instance){
- if (!Meteor.user()) return;
- Accounts.sendVerificationEmail(Meteor.userId(), this.address);
- GlobalUI.toast({
- text: "Email verification sent to " + this.address,
- template: "",
- data: {},
- });
- },
- "click .showApiKey": function(event, instance){
- instance.showApiKey.set(!instance.showApiKey.get());
- },
- "click .generateMyApiKey": function(event, instance){
- Meteor.call("generateMyApiKey");
- instance.showApiKey.set(true);
- },
-});
diff --git a/app/client/views/user/profile/userNameDialog/usernameDialog.html b/app/client/views/user/profile/userNameDialog/usernameDialog.html
deleted file mode 100644
index 8ed72314..00000000
--- a/app/client/views/user/profile/userNameDialog/usernameDialog.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
- Change Username
-
-
-
-
-
-
-
diff --git a/app/client/views/user/profile/userNameDialog/usernameDialog.js b/app/client/views/user/profile/userNameDialog/usernameDialog.js
deleted file mode 100644
index e4484cde..00000000
--- a/app/client/views/user/profile/userNameDialog/usernameDialog.js
+++ /dev/null
@@ -1,53 +0,0 @@
-var getUsername = function() {
- var user = Meteor.user();
- return user.profile && user.profile.username || user.username;
-};
-
-Template.usernameDialog.onCreated(function() {
- this.errorMessage = new ReactiveVar();
- this.username = new ReactiveVar(getUsername());
-});
-
-Template.usernameDialog.helpers({
- profileName: function() {
- return getUsername();
- },
- invalid: function() {
- return !!Template.instance().errorMessage.get();
- },
- errorMessage: function() {
- return Template.instance().errorMessage.get();
- },
-});
-
-Template.usernameDialog.events({
- "change #usernameInput, input #usernameInput": function(event, instance) {
- var username = instance.find("#usernameInput").value;
- username = username.trim().toLowerCase().replace(/\s+/gm, "");
- if (username.length < 3){
- instance.errorMessage.set("Username too short");
- } else {
- instance.errorMessage.set("Validating...");
- Meteor.call("getUserId", username, function(err, userId){
- if (userId && userId !== Meteor.userId())
- instance.errorMessage.set("This username is taken");
- else
- instance.errorMessage.set();
- });
- }
- },
- "click #changeButton": function(event, instance){
- var username = instance.find("#usernameInput").value;
- popDialogStack();
- username = username.trim().replace(/\s+/gm, " ");
- var profileName = username;
- username = username.toLowerCase().replace(/\s+/gm, "");
- Meteor.users.update(
- Meteor.userId(),
- {$set: {username: username, "profile.username": profileName}}
- );
- },
- "click #cancelButton": function(event, instance){
- popDialogStack();
- },
-});
diff --git a/app/client/views/user/signIn/signIn.html b/app/client/views/user/signIn/signIn.html
deleted file mode 100644
index fcda082d..00000000
--- a/app/client/views/user/signIn/signIn.html
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
- {{#if loggingIn}}
-
- {{else}}{{#if currentUser}}
- {{#with currentUser}}
-
- {{username}}
-
-
- {{#each emails}}
- {{address}}
- {{/each}}
-
-
-
-
-
-
-
- {{/with}}
- {{else}}
- {{#if session "creatingNewUser"}}
- {{> creatingUser}}
- {{else}} {{#if session "forgotPassword"}}
- {{> forgotPassword}}
- {{else}}
- {{> signingIn}}
- {{/if}}{{/if}}
- {{/if}}{{/if}}
-
-
-
-
- Sign In
-
-
-
-
- Sign In
-
-
-
- New Account
-
-
-
-
- Create Account
-
-
-
- New Account
-
- Reset Password
-
diff --git a/app/client/views/user/signIn/signIn.js b/app/client/views/user/signIn/signIn.js
deleted file mode 100644
index c73fa486..00000000
--- a/app/client/views/user/signIn/signIn.js
+++ /dev/null
@@ -1,21 +0,0 @@
-Template.signIn.events({
- "tap #signInButton": function(event, instance){
- var email = instance.find("#emailInput").value;
- var pass = instance.find("#passwordInput").value;
- Meteor.loginWithPassword(email, pass);
- },
- "keypress #emailInput, keypress #passwordInput": function(event, instance) {
- if (event.which === 13) {
- var email = instance.find("#emailInput").value;
- var pass = instance.find("#passwordInput").value;
- Meteor.loginWithPassword(email, pass);
- }
- },
- "tap #signOutButton": function(event, instance){
- Meteor.logout();
- },
- "tap #createAccountButton": function(event, instance){
- console.warn("not yet implemented");
- //Session.set("creatingNewUser", true);
- },
-});
diff --git a/app/client/views/user/titledAtForm/titledAtForm.html b/app/client/views/user/titledAtForm/titledAtForm.html
deleted file mode 100644
index 4c332c27..00000000
--- a/app/client/views/user/titledAtForm/titledAtForm.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/app/imports/ui/pages/Register.vue b/app/imports/ui/pages/Register.vue
index ade65894..17618c9b 100644
--- a/app/imports/ui/pages/Register.vue
+++ b/app/imports/ui/pages/Register.vue
@@ -97,8 +97,13 @@
submit () {
console.log("submitting");
if (this.$refs.form.validate()) {
- Meteor.loginWithPassword(this.name, this.password, e => {
- this.error = e && e.reason;
+ Accounts.createUser({
+ username: this.username,
+ password: this.password,
+ email: this.email,
+ }, function(e){
+ console.error(e);
+ this.error = e.reason;
});
}
},
diff --git a/app/lib/constants/useraccountsConfig.js b/app/lib/constants/useraccountsConfig.js
deleted file mode 100644
index c58c0daa..00000000
--- a/app/lib/constants/useraccountsConfig.js
+++ /dev/null
@@ -1,82 +0,0 @@
-AccountsTemplates.configure({
- //behaviour
- confirmPassword: true,
- enablePasswordChange: true,
- enforceEmailVerification: false,
- overrideLoginErrors: false,
- sendVerificationEmail: true,
- lowercaseUsername: true,
- //appearance
- continuousValidation: true,
- negativeValidation: true,
- negativeFeedback: true,
- showValidating: true,
- showAddRemoveServices: true,
- showForgotPasswordLink: true,
- showResendVerificationEmailLink: true,
- texts: {
- resendVerificationEmailLink_link: "Resend email verification",
- },
-});
-/*
-AccountsTemplates.configureRoute("changePwd", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-AccountsTemplates.configureRoute("enrollAccount", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-AccountsTemplates.configureRoute("forgotPwd", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-AccountsTemplates.configureRoute("resetPwd", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-AccountsTemplates.configureRoute("signIn", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-AccountsTemplates.configureRoute("signUp", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-AccountsTemplates.configureRoute("verifyEmail", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-AccountsTemplates.configureRoute("resendVerificationEmail", {
- template: "titledAtForm",
- layoutTemplate: "layout",
-});
-*/
-if (Meteor.isServer){
- Meteor.methods({
- "userExists": function(username){
- return !!Meteor.users.findOne({username: username});
- },
- });
-}
-
-AccountsTemplates.addField({
- _id: "username",
- type: "text",
- required: true,
- func: function(value){
- if (Meteor.isClient) {
- var self = this;
- Meteor.call("userExists", value, function(err, userExists){
- if (!userExists)
- self.setSuccess();
- else
- self.setError("This username is taken");
- self.setValidating(false);
- });
- return;
- }
- // Server
- return Meteor.call("userExists", value);
- },
-});