From d710579025a86ae537b91846c06234df45a46619 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Thu, 26 Jan 2017 10:23:27 +0200 Subject: [PATCH] Updated inventory to Polymer 1 --- rpg-docs/client/style/listItem.css | 11 +- .../attacks/attackEdit/attackEdit.html | 56 ++-- .../attacks/attackEdit/attackEdit.js | 8 +- .../attackEditList/attackEditList.html | 2 +- .../attacks/attackView/attackView.html | 8 +- .../attacksViewList/attacksViewList.html | 4 +- .../client/views/character/characterSheet.js | 2 +- .../inventory/carryDialog/carryDialog.html | 10 +- .../containerDialog/containerDialog.html | 24 +- .../containerDialog/containerDialog.js | 34 +- .../views/character/inventory/inventory.html | 295 +++++++++--------- .../views/character/inventory/inventory.js | 88 +++--- .../inventory/itemDialog/itemDialog.html | 105 +++---- .../inventory/itemDialog/itemDialog.js | 104 +++--- .../splitStackDialog/splitStackDialog.html | 34 +- .../splitStackDialog/splitStackDialog.js | 16 +- .../stats/addTHPDialog/addTHPDialog.html | 2 +- .../client/views/layout/polymerImports.html | 1 + .../paperTemplates/dialogStack/dialogStack.js | 5 +- .../views/paperTemplates/fabMenu/fabMenu.css | 14 +- .../views/paperTemplates/fabMenu/fabMenu.html | 7 +- .../views/paperTemplates/fabMenu/fabMenu.js | 14 + rpg-docs/lib/methods/conditions.js | 5 +- .../public/custom_components/app-theme.html | 10 +- .../dicecloud-icons/dicecloud-icons.html | 9 + us.stackdump | 24 ++ 26 files changed, 480 insertions(+), 412 deletions(-) create mode 100644 rpg-docs/public/custom_components/dicecloud-icons/dicecloud-icons.html create mode 100644 us.stackdump diff --git a/rpg-docs/client/style/listItem.css b/rpg-docs/client/style/listItem.css index a8cc623a..87f61265 100644 --- a/rpg-docs/client/style/listItem.css +++ b/rpg-docs/client/style/listItem.css @@ -17,6 +17,12 @@ List items 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; } @@ -31,11 +37,6 @@ List items padding-bottom: 16px; } -.item[hero], &:active{ - box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.37); - z-index: 10; -} - .item iron-icon, .item paper-icon-button { color: #747474; color: rgba(0,0,0,0.54); diff --git a/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.html b/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.html index a5cd8e03..aca4fde8 100644 --- a/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.html +++ b/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.html @@ -1,39 +1,39 @@ \ No newline at end of file + diff --git a/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.js b/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.js index 295f0311..d313b1af 100644 --- a/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.js +++ b/rpg-docs/client/views/character/attacks/attackEdit/attackEdit.js @@ -15,7 +15,7 @@ var damageTypes = [ ]; Template.attackEdit.events({ - "tap .deleteAttack": function(event, instance) { + "click .deleteAttack": function(event, instance) { Attacks.softRemoveNode(this._id); GlobalUI.deletedToast(this._id, "Attacks", "Attack"); }, @@ -31,9 +31,8 @@ Template.attackEdit.events({ var value = event.currentTarget.value; Attacks.update(this._id, {$set: {details: value}}); }, - "core-select .damageTypeDropdown": function(event) { + "iron-select .damageTypeDropdown": function(event) { var detail = event.originalEvent.detail; - if (!detail.isSelected) return; var value = detail.item.getAttribute("name"); if (value == this.damageType) return; Attacks.update(this._id, {$set: {damageType: value}}); @@ -44,7 +43,4 @@ Template.attackEdit.helpers({ damageTypes: function() { return damageTypes; }, - DAMAGE_DICE: function() { - return DAMAGE_DICE; - }, }); diff --git a/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.html b/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.html index 154c5cd6..e6eae7df 100644 --- a/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.html +++ b/rpg-docs/client/views/character/attacks/attackEditList/attackEditList.html @@ -3,7 +3,7 @@ {{#if attacks.count}}
-

Attacks

+
Attacks
{{#each attacks}} {{>attackEdit}} {{/each}} diff --git a/rpg-docs/client/views/character/attacks/attackView/attackView.html b/rpg-docs/client/views/character/attacks/attackView/attackView.html index ba849b4e..d06683af 100644 --- a/rpg-docs/client/views/character/attacks/attackView/attackView.html +++ b/rpg-docs/client/views/character/attacks/attackView/attackView.html @@ -1,14 +1,14 @@ \ No newline at end of file + diff --git a/rpg-docs/client/views/character/characterSheet.js b/rpg-docs/client/views/character/characterSheet.js index 975064f3..8a46c4b7 100644 --- a/rpg-docs/client/views/character/characterSheet.js +++ b/rpg-docs/client/views/character/characterSheet.js @@ -2,7 +2,7 @@ Template.characterSheet.onRendered(function() { //default to the stats tab Session.setDefault(this.data._id + ".selectedTab", "0"); //watch this character and make sure their encumbrance is updated - trackEncumbranceConditions(this.data._id, this); + //trackEncumbranceConditions(this.data._id, this); }); var setTab = function(charId, tab){ diff --git a/rpg-docs/client/views/character/inventory/carryDialog/carryDialog.html b/rpg-docs/client/views/character/inventory/carryDialog/carryDialog.html index 5c319499..a8cabc7d 100644 --- a/rpg-docs/client/views/character/inventory/carryDialog/carryDialog.html +++ b/rpg-docs/client/views/character/inventory/carryDialog/carryDialog.html @@ -1,17 +1,17 @@ \ No newline at end of file + diff --git a/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html b/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html index 2682fa5e..e072cb19 100644 --- a/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html +++ b/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html @@ -11,32 +11,26 @@ diff --git a/rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.js b/rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.js index 59837c36..c9c385e8 100644 --- a/rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.js +++ b/rpg-docs/client/views/paperTemplates/fabMenu/fabMenu.js @@ -2,6 +2,20 @@ 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(); + 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(); diff --git a/rpg-docs/lib/methods/conditions.js b/rpg-docs/lib/methods/conditions.js index 4e42bdcc..a89f5d8b 100644 --- a/rpg-docs/lib/methods/conditions.js +++ b/rpg-docs/lib/methods/conditions.js @@ -115,7 +115,7 @@ trackEncumbranceConditions = function(charId, templateInstance) { give("encumbered2"); remove("encumbered"); } else if (weight > strength * 5 * carryMultiplier && - character.settings.useVariantEncumbrance){ + character.settings.useVariantEncumbrance){ give("encumbered"); remove("encumbered2"); } else { @@ -128,7 +128,7 @@ trackEncumbranceConditions = function(charId, templateInstance) { give("encumbered4"); remove("encumbered3"); } else if (weight > strength * 15 * carryMultiplier && - character.settings.useStandardEncumbrance) { + character.settings.useStandardEncumbrance) { give("encumbered3"); remove("encumbered4"); } else { @@ -138,6 +138,7 @@ trackEncumbranceConditions = function(charId, templateInstance) { }); }; +// jscs:disable maximumLineLength CONDITIONS = { //Conditions blind: { diff --git a/rpg-docs/public/custom_components/app-theme.html b/rpg-docs/public/custom_components/app-theme.html index cd68cb07..4d8f7066 100644 --- a/rpg-docs/public/custom_components/app-theme.html +++ b/rpg-docs/public/custom_components/app-theme.html @@ -5,9 +5,9 @@ diff --git a/rpg-docs/public/custom_components/dicecloud-icons/dicecloud-icons.html b/rpg-docs/public/custom_components/dicecloud-icons/dicecloud-icons.html new file mode 100644 index 00000000..5a6b5ac2 --- /dev/null +++ b/rpg-docs/public/custom_components/dicecloud-icons/dicecloud-icons.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/us.stackdump b/us.stackdump new file mode 100644 index 00000000..0852c264 --- /dev/null +++ b/us.stackdump @@ -0,0 +1,24 @@ +MSYS-1.0.12 Build:2012-07-05 14:56 +Exception: STATUS_NONCONTINUABLE_EXCEPTION at eip=77C10864 +eax=0028EDB0 ebx=0028FEE0 ecx=00000000 edx=C0000008 esi=0028EE2C edi=00000000 +ebp=0028EE14 esp=0028EDA4 program=us +cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B +Stack trace: +Frame Function Args +0028EE14 77C10864 (0028EE2C, 0028EE7C, 0028EE2C, 0028EE7C) +0028F2E0 77B90133 (00320114, 00000000, 00320238, 00000000) +0028F2F8 77BB8EE2 (00320114, 0028F358, 0028F588, 6803B9F5) +0028F588 6803BA01 (00320000, 00330F38, 68037457, 00000022) +0028FC38 6803AF8F (00320000, 00660065, 006E0061, 005A002E) +0028FCD8 6803ADC4 (00320000, 0028FD20, 0028FD28, 6803B334) +0028FD28 6803B33E (00320000, 0028FD88, 00000000, 68029DE3) +0028FD48 68039AE6 (00320000, 680F7174, 00011044, 00000000) +0028FE98 68052117 (680A4C64, 00000000, 0028FEE8, 680044EA) +0028FEE8 68004709 (00000000, 00000000, 0028FF28, 0048BC00) +0028FF08 68004C5F (00401248, 00000000, 00000000, 00000000) +0028FF28 68004C98 (00000000, 00000000, 00000000, 00000000) +0028FF58 0048BB08 (00401248, 00000000, 00000000, 00000000) +0028FF88 0040103D (7EFDE000, 0028FFD4, 77BB9F72, 7EFDE000) +0028FF94 755F33AA (7EFDE000, 7D5558E1, 00000000, 00000000) +0028FFD4 77BB9F72 (00401000, 7EFDE000, 00000000, 00000000) +End of stack trace (more stack frames may be present) \ No newline at end of file