Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be0283a342 | ||
|
|
e05561dcf9 | ||
|
|
3c776ed018 | ||
|
|
ebecb46935 | ||
|
|
d83fe917d0 | ||
|
|
f526de88a7 | ||
|
|
55adca36d5 | ||
|
|
be6f54e53a | ||
|
|
d41c27c86d | ||
|
|
f4397e65ab | ||
|
|
c00c69a0c7 | ||
|
|
6737983782 | ||
|
|
78441439c3 | ||
|
|
9b72e1aea2 | ||
|
|
684eca8603 | ||
|
|
868e5f96a4 | ||
|
|
6fe368cde7 | ||
|
|
2ffacb88e0 | ||
|
|
af3af0e550 | ||
|
|
81f50d94c1 | ||
|
|
49e6d51b95 | ||
|
|
1e4e1a3b11 | ||
|
|
4440c88417 | ||
|
|
98047ca806 | ||
|
|
051cabc712 | ||
|
|
636fa504f1 | ||
|
|
ff9fc916f6 | ||
|
|
2206a607b2 | ||
|
|
ce224301b2 | ||
|
|
e6a9911dfc | ||
|
|
8a1871ee18 | ||
|
|
402f885f85 |
11
README.md
11
README.md
@@ -1,4 +1,13 @@
|
||||
RPG Docs
|
||||
========
|
||||
|
||||
This is the repo for [DiceCloud](dicecloud.com). The currently deployed version should always be the head of the master branch.
|
||||
This is the repo for [DiceCloud](dicecloud.com). The currently deployed version should always be the latest release of the master branch.
|
||||
|
||||
Getting started
|
||||
---------------
|
||||
|
||||
`git clone https://github.com/ThaumRystra/RPG-Docs RPG-Docs`
|
||||
`cd RPG-Docs`
|
||||
`cd rpg-docs`
|
||||
`bower install`
|
||||
`meteor`
|
||||
|
||||
1
rpg-docs/.gitignore
vendored
1
rpg-docs/.gitignore
vendored
@@ -4,4 +4,5 @@
|
||||
settings.json
|
||||
public/components
|
||||
nohup.out
|
||||
node_modules
|
||||
dump
|
||||
|
||||
@@ -10,3 +10,4 @@ notices-for-facebook-graph-api-2
|
||||
1.2.0-meteor-platform-split
|
||||
1.2.0-cordova-changes
|
||||
1.2.0-breaking-changes
|
||||
1.3.0-split-minifiers-package
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
thaum:vulcanize
|
||||
thaum:vulcanize@0.0.5
|
||||
iron:router
|
||||
accounts-password
|
||||
accounts-ui
|
||||
@@ -22,13 +22,10 @@ useraccounts:polymer
|
||||
accounts-google
|
||||
splendido:accounts-meld
|
||||
email
|
||||
fourseven:scss@2.1.1
|
||||
wolves:bourbon
|
||||
meteorhacks:subs-manager
|
||||
meteorhacks:kadira
|
||||
chuangbo:marked
|
||||
reywood:iron-router-ga
|
||||
standard-minifiers
|
||||
meteor-base
|
||||
mobile-experience
|
||||
mongo
|
||||
@@ -44,3 +41,7 @@ check
|
||||
useraccounts:iron-routing
|
||||
wizonesolutions:canonical
|
||||
meteorhacks:fast-render
|
||||
fourseven:scss
|
||||
wolves:bourbon
|
||||
standard-minifier-css
|
||||
standard-minifier-js
|
||||
|
||||
@@ -1 +1 @@
|
||||
METEOR@1.2.0.2
|
||||
METEOR@1.3.2.4
|
||||
|
||||
@@ -1,121 +1,131 @@
|
||||
accounts-base@1.2.1
|
||||
accounts-google@1.0.6
|
||||
accounts-oauth@1.1.7
|
||||
accounts-password@1.1.3
|
||||
accounts-ui@1.1.6
|
||||
accounts-ui-unstyled@1.1.8
|
||||
aldeed:collection2@2.5.0
|
||||
aldeed:simple-schema@1.3.3
|
||||
autoupdate@1.2.3
|
||||
babel-compiler@5.8.24_1
|
||||
babel-runtime@0.1.4
|
||||
base64@1.0.4
|
||||
binary-heap@1.0.4
|
||||
blaze@2.1.3
|
||||
blaze-html-templates@1.0.1
|
||||
blaze-tools@1.0.4
|
||||
boilerplate-generator@1.0.4
|
||||
caching-compiler@1.0.0
|
||||
caching-html-compiler@1.0.2
|
||||
callback-hook@1.0.4
|
||||
check@1.0.6
|
||||
accounts-base@1.2.7
|
||||
accounts-google@1.0.9
|
||||
accounts-oauth@1.1.12
|
||||
accounts-password@1.1.8
|
||||
accounts-ui@1.1.9
|
||||
accounts-ui-unstyled@1.1.12
|
||||
aldeed:collection2@2.9.1
|
||||
aldeed:collection2-core@1.1.1
|
||||
aldeed:schema-deny@1.0.1
|
||||
aldeed:schema-index@1.0.1
|
||||
aldeed:simple-schema@1.5.3
|
||||
allow-deny@1.0.4
|
||||
autoupdate@1.2.9
|
||||
babel-compiler@6.6.4
|
||||
babel-runtime@0.1.8
|
||||
base64@1.0.8
|
||||
binary-heap@1.0.8
|
||||
blaze@2.1.7
|
||||
blaze-html-templates@1.0.4
|
||||
blaze-tools@1.0.8
|
||||
boilerplate-generator@1.0.8
|
||||
caching-compiler@1.0.4
|
||||
caching-html-compiler@1.0.6
|
||||
callback-hook@1.0.8
|
||||
check@1.2.1
|
||||
chuangbo:cookie@1.1.0
|
||||
chuangbo:marked@0.3.5_1
|
||||
coffeescript@1.0.10
|
||||
dburles:collection-helpers@1.0.3
|
||||
dburles:mongo-collection-instances@0.3.4
|
||||
ddp@1.2.2
|
||||
ddp-client@1.2.1
|
||||
ddp-common@1.2.1
|
||||
ddp-rate-limiter@1.0.0
|
||||
ddp-server@1.2.1
|
||||
deps@1.0.9
|
||||
diff-sequence@1.0.1
|
||||
ecmascript@0.1.5
|
||||
ecmascript-collections@0.1.6
|
||||
coffeescript@1.0.17
|
||||
dburles:collection-helpers@1.0.4
|
||||
dburles:mongo-collection-instances@0.3.5
|
||||
ddp@1.2.5
|
||||
ddp-client@1.2.7
|
||||
ddp-common@1.2.5
|
||||
ddp-rate-limiter@1.0.4
|
||||
ddp-server@1.2.6
|
||||
deps@1.0.12
|
||||
diff-sequence@1.0.5
|
||||
ecmascript@0.4.3
|
||||
ecmascript-runtime@0.2.10
|
||||
ecwyne:mathjs@0.25.0
|
||||
ejson@1.0.7
|
||||
email@1.0.7
|
||||
fastclick@1.0.7
|
||||
fourseven:scss@2.1.1
|
||||
geojson-utils@1.0.4
|
||||
google@1.1.6
|
||||
hot-code-push@1.0.0
|
||||
html-tools@1.0.5
|
||||
htmljs@1.0.5
|
||||
http@1.1.1
|
||||
id-map@1.0.4
|
||||
iron:controller@1.0.8
|
||||
iron:core@1.0.8
|
||||
iron:dynamic-template@1.0.8
|
||||
iron:layout@1.0.8
|
||||
iron:location@1.0.9
|
||||
iron:middleware-stack@1.0.9
|
||||
iron:router@1.0.9
|
||||
iron:url@1.0.9
|
||||
jquery@1.11.4
|
||||
lai:collection-extensions@0.1.4
|
||||
launch-screen@1.0.4
|
||||
less@2.5.0_3
|
||||
livedata@1.0.15
|
||||
localstorage@1.0.5
|
||||
logging@1.0.8
|
||||
ejson@1.0.11
|
||||
email@1.0.12
|
||||
fastclick@1.0.11
|
||||
fourseven:scss@3.4.3
|
||||
geojson-utils@1.0.8
|
||||
google@1.1.11
|
||||
hot-code-push@1.0.4
|
||||
html-tools@1.0.9
|
||||
htmljs@1.0.9
|
||||
http@1.1.5
|
||||
id-map@1.0.7
|
||||
iron:controller@1.0.12
|
||||
iron:core@1.0.11
|
||||
iron:dynamic-template@1.0.12
|
||||
iron:layout@1.0.12
|
||||
iron:location@1.0.11
|
||||
iron:middleware-stack@1.1.0
|
||||
iron:router@1.0.12
|
||||
iron:url@1.0.11
|
||||
jquery@1.11.8
|
||||
lai:collection-extensions@0.2.1_1
|
||||
launch-screen@1.0.11
|
||||
less@2.6.0
|
||||
livedata@1.0.18
|
||||
localstorage@1.0.9
|
||||
logging@1.0.12
|
||||
matb33:collection-hooks@0.8.1
|
||||
meteor@1.1.9
|
||||
meteor-base@1.0.1
|
||||
meteorhacks:fast-render@2.10.0
|
||||
meteorhacks:inject-data@1.4.1
|
||||
meteorhacks:kadira@2.23.4
|
||||
meteorhacks:meteorx@1.3.1
|
||||
mdg:validation-error@0.2.0
|
||||
meteor@1.1.14
|
||||
meteor-base@1.0.4
|
||||
meteorhacks:fast-render@2.14.0
|
||||
meteorhacks:inject-data@2.0.0
|
||||
meteorhacks:kadira@2.28.7
|
||||
meteorhacks:meteorx@1.4.1
|
||||
meteorhacks:picker@1.0.3
|
||||
meteorhacks:subs-manager@1.6.2
|
||||
minifiers@1.1.7
|
||||
minimongo@1.0.10
|
||||
mobile-experience@1.0.1
|
||||
mobile-status-bar@1.0.6
|
||||
momentjs:moment@2.10.6
|
||||
mongo@1.1.2
|
||||
mongo-id@1.0.1
|
||||
mongo-livedata@1.0.9
|
||||
npm-bcrypt@0.7.8_2
|
||||
npm-mongo@1.4.39_1
|
||||
oauth@1.1.6
|
||||
oauth2@1.1.5
|
||||
observe-sequence@1.0.7
|
||||
ordered-dict@1.0.4
|
||||
percolate:migrations@0.9.6
|
||||
promise@0.5.0
|
||||
random@1.0.4
|
||||
rate-limit@1.0.0
|
||||
reactive-dict@1.1.2
|
||||
reactive-var@1.0.6
|
||||
reload@1.1.4
|
||||
retry@1.0.4
|
||||
meteorhacks:subs-manager@1.6.4
|
||||
minifier-css@1.1.11
|
||||
minifier-js@1.1.11
|
||||
minimongo@1.0.16
|
||||
mobile-experience@1.0.4
|
||||
mobile-status-bar@1.0.12
|
||||
modules@0.6.1
|
||||
modules-runtime@0.6.3
|
||||
momentjs:moment@2.13.1
|
||||
mongo@1.1.7
|
||||
mongo-id@1.0.4
|
||||
mongo-livedata@1.0.12
|
||||
npm-bcrypt@0.8.5
|
||||
npm-mongo@1.4.43
|
||||
oauth@1.1.10
|
||||
oauth2@1.1.9
|
||||
observe-sequence@1.0.11
|
||||
ordered-dict@1.0.7
|
||||
percolate:migrations@0.9.8
|
||||
promise@0.6.7
|
||||
raix:eventemitter@0.1.3
|
||||
random@1.0.9
|
||||
rate-limit@1.0.4
|
||||
reactive-dict@1.1.7
|
||||
reactive-var@1.0.9
|
||||
reload@1.1.8
|
||||
retry@1.0.7
|
||||
reywood:iron-router-ga@0.7.1
|
||||
routepolicy@1.0.6
|
||||
service-configuration@1.0.5
|
||||
session@1.1.1
|
||||
sha@1.0.4
|
||||
softwarerero:accounts-t9n@1.0.9
|
||||
spacebars@1.0.7
|
||||
spacebars-compiler@1.0.7
|
||||
routepolicy@1.0.10
|
||||
service-configuration@1.0.9
|
||||
session@1.1.5
|
||||
sha@1.0.7
|
||||
softwarerero:accounts-t9n@1.3.4
|
||||
spacebars@1.0.11
|
||||
spacebars-compiler@1.0.11
|
||||
splendido:accounts-emails-field@1.2.0
|
||||
splendido:accounts-meld@1.3.1
|
||||
srp@1.0.4
|
||||
standard-minifiers@1.0.1
|
||||
templating@1.1.4
|
||||
templating-tools@1.0.0
|
||||
srp@1.0.8
|
||||
standard-minifier-css@1.0.6
|
||||
standard-minifier-js@1.0.6
|
||||
templating@1.1.9
|
||||
templating-tools@1.0.4
|
||||
thaum:vulcanize@0.0.5
|
||||
tracker@1.0.9
|
||||
ui@1.0.8
|
||||
underscore@1.0.4
|
||||
url@1.0.5
|
||||
useraccounts:core@1.12.3
|
||||
useraccounts:iron-routing@1.12.3
|
||||
tracker@1.0.13
|
||||
ui@1.0.11
|
||||
underscore@1.0.8
|
||||
url@1.0.9
|
||||
useraccounts:core@1.14.2
|
||||
useraccounts:iron-routing@1.14.2
|
||||
useraccounts:polymer@1.12.3
|
||||
webapp@1.2.2
|
||||
webapp-hashing@1.0.5
|
||||
webapp@1.2.8
|
||||
webapp-hashing@1.0.9
|
||||
wizonesolutions:canonical@0.0.5
|
||||
wolves:bourbon@1.2.0
|
||||
wolves:bourbon@3.1.0
|
||||
zimme:collection-behaviours@1.1.3
|
||||
zimme:collection-softremovable@1.0.4
|
||||
zimme:collection-softremovable@1.0.5
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
public/components
|
||||
public/custom_components
|
||||
@@ -59,71 +59,74 @@ Schemas.Effect = new SimpleSchema({
|
||||
|
||||
Effects.attachSchema(Schemas.Effect);
|
||||
|
||||
if (Meteor.isServer) Characters.after.insert(function(userId, char) {
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Constitution modifier for each level",
|
||||
stat: "hitPoints",
|
||||
operation: "add",
|
||||
calculation: "level * constitutionMod",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Proficiency bonus by level",
|
||||
stat: "proficiencyBonus",
|
||||
operation: "add",
|
||||
calculation: "floor(level / 4 + 1.75)",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Dexterity Armor Bonus",
|
||||
stat: "armor",
|
||||
operation: "add",
|
||||
calculation: "dexterityArmor",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Natural Armor",
|
||||
stat: "armor",
|
||||
operation: "base",
|
||||
value: 10,
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Natural Carrying Capacity",
|
||||
stat: "carryMultiplier",
|
||||
operation: "base",
|
||||
value: "1",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Effects.attachBehaviour("softRemovable");
|
||||
makeChild(Effects, ["enabled"]); //children of lots of things
|
||||
|
||||
Effects.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Effects.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
//give characters default character effects
|
||||
Characters.after.insert(function(userId, char) {
|
||||
if (Meteor.isServer) {
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Constitution modifier for each level",
|
||||
stat: "hitPoints",
|
||||
operation: "add",
|
||||
calculation: "level * constitutionMod",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Proficiency bonus by level",
|
||||
stat: "proficiencyBonus",
|
||||
operation: "add",
|
||||
calculation: "floor(level / 4 + 1.75)",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Dexterity Armor Bonus",
|
||||
stat: "armor",
|
||||
operation: "add",
|
||||
calculation: "dexterityArmor",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Natural Armor",
|
||||
stat: "armor",
|
||||
operation: "base",
|
||||
value: 10,
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
Effects.insert({
|
||||
charId: char._id,
|
||||
name: "Natural Carrying Capacity",
|
||||
stat: "carryMultiplier",
|
||||
operation: "base",
|
||||
value: "1",
|
||||
parent: {
|
||||
id: char._id,
|
||||
collection: "Characters",
|
||||
group: "Inate",
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -35,3 +35,81 @@ makeParent(Features, ["name", "enabled"]); //parents of effects and attacks
|
||||
|
||||
Features.allow(CHARACTER_SUBSCHEMA_ALLOW);
|
||||
Features.deny(CHARACTER_SUBSCHEMA_DENY);
|
||||
|
||||
//give characters default feature of base ability scores of 10
|
||||
Characters.after.insert(function(userId, char) {
|
||||
if (Meteor.isServer){
|
||||
var featureId = Features.insert({
|
||||
name: "Base Ability Scores",
|
||||
charId: char._id,
|
||||
enabled: true,
|
||||
alwaysEnabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "strength",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "dexterity",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "constitution",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "intelligence",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "wisdom",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
Effects.insert({
|
||||
stat: "charisma",
|
||||
charId: char._id,
|
||||
parent: {
|
||||
id: featureId,
|
||||
collection: "Features",
|
||||
},
|
||||
operation: "base",
|
||||
value: 10,
|
||||
enabled: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -228,6 +228,9 @@ Characters.after.insert(function(userId, char) {
|
||||
id: containerId,
|
||||
collection: "Containers",
|
||||
},
|
||||
settings: {
|
||||
showIncrement: true,
|
||||
},
|
||||
});
|
||||
Items.insert({
|
||||
name: "Silver piece",
|
||||
@@ -241,6 +244,9 @@ Characters.after.insert(function(userId, char) {
|
||||
id: containerId,
|
||||
collection: "Containers",
|
||||
},
|
||||
settings: {
|
||||
showIncrement: true,
|
||||
},
|
||||
});
|
||||
Items.insert({
|
||||
name: "Copper piece",
|
||||
@@ -254,6 +260,9 @@ Characters.after.insert(function(userId, char) {
|
||||
id: containerId,
|
||||
collection: "Containers",
|
||||
},
|
||||
settings: {
|
||||
showIncrement: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
"name": "RPG Docs",
|
||||
"version": "0.0.0",
|
||||
"homepage": "",
|
||||
"authors": ["Stefan Zermatten"],
|
||||
"authors": [
|
||||
"Stefan Zermatten"
|
||||
],
|
||||
"license": "none",
|
||||
"private": true,
|
||||
"ignore": [
|
||||
@@ -15,11 +17,10 @@
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#~0.5.5",
|
||||
"core-elements": "Polymer/core-elements#~0.5.5",
|
||||
"paper-elements": "Polymer/paper-elements#~0.5.5"
|
||||
"paper-elements": "Polymer/paper-elements#~0.5.5",
|
||||
"paper-fab-menu": "cwdoh/paper-fab-menu#~0.4.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"core-component-page": "^0.5.0",
|
||||
"polymer": "^0.5.0",
|
||||
"webcomponentsjs": "^0.5.0"
|
||||
"webcomponentsjs": "0.6.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "bourbon/bourbon";
|
||||
@import "{wolves:bourbon}/bourbon";
|
||||
|
||||
$thickColumnWidth: 304px;
|
||||
$thinColumnWidth: 240px;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "bourbon/bourbon";
|
||||
@import "{wolves:bourbon}/bourbon";
|
||||
@import "colors";
|
||||
|
||||
//apply a natural box layout model to all elements
|
||||
@@ -48,7 +48,7 @@ hr {
|
||||
|
||||
//FABs
|
||||
.floatyButton {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
bottom: 24px;
|
||||
right: 24px;
|
||||
}
|
||||
|
||||
@@ -18,3 +18,7 @@
|
||||
body /deep/ core-menu {
|
||||
overflow-x: hidden !important;
|
||||
}
|
||||
|
||||
html /deep/ paper-dropdown {
|
||||
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ var operations = {
|
||||
base: {name: "Base Value: "},
|
||||
proficiency: {name: "Proficiency"},
|
||||
add: {name: "+"},
|
||||
mul: {name: "x"},
|
||||
mul: {name: "×"},
|
||||
min: {name: "Min: "},
|
||||
max: {name: "Max: "},
|
||||
advantage: {name: "Advantage"},
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<template name="spellDetails">
|
||||
<div class="body2">
|
||||
Level {{level}} {{school}}, {{preparedString}}
|
||||
Level {{level}} {{school}} {{#if ritual}}ritual{{/if}}, {{preparedString}}
|
||||
</div>
|
||||
<div style="margin: 16px 0 16px 0;">
|
||||
{{#if castingTime}}
|
||||
@@ -136,4 +136,4 @@
|
||||
</paper-autogrow-textarea>
|
||||
</paper-input-decorator>
|
||||
{{> attackEditList parentId=_id parentCollection="Spells" charId=charId enabled=true name=name}}
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
padding: 8px 0 8px 16px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.singleLineItem core-icon {
|
||||
@@ -19,4 +20,4 @@
|
||||
/* Required for text-overflow to do anything */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
{{#if characters.count}}
|
||||
<div>
|
||||
{{#each characters}}
|
||||
<div class="singleLineItem characterRepresentative"
|
||||
<a href={{pathFor route="characterSheet" data=this}}
|
||||
class="singleLineItem characterRepresentative"
|
||||
layout horizontal center>
|
||||
<core-icon icon="image:brightness-1"></core-icon>
|
||||
<div>{{name}}</div>
|
||||
</div>
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@@ -23,7 +23,7 @@ Template.characterSideList.helpers({
|
||||
|
||||
Template.characterSideList.events({
|
||||
"tap .singleLineItem": function(event, instance) {
|
||||
Router.go("characterSheet", {_id: this._id});
|
||||
//Router.go("characterSheet", {_id: this._id});
|
||||
$("core-drawer-panel").get(0).closeDrawer();
|
||||
},
|
||||
"tap core-item": function() {
|
||||
|
||||
26
rpg-docs/client/views/layout/head.html
Normal file
26
rpg-docs/client/views/layout/head.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width initial-scale=1.0, user-scalable=no">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic,900,900italic,100italic,100&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
|
||||
<script src="/components/webcomponentsjs/webcomponents.js"></script>
|
||||
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png?v=lk6WXp6Pmj">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png?v=lk6WXp6Pmj">
|
||||
<link rel="icon" type="image/png" href="/favicon-32x32.png?v=lk6WXp6Pmj" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/favicon-194x194.png?v=lk6WXp6Pmj" sizes="194x194">
|
||||
<link rel="icon" type="image/png" href="/favicon-96x96.png?v=lk6WXp6Pmj" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="/android-chrome-192x192.png?v=lk6WXp6Pmj" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="/favicon-16x16.png?v=lk6WXp6Pmj" sizes="16x16">
|
||||
<link rel="manifest" href="/manifest.json?v=lk6WXp6Pmj">
|
||||
<link rel="shortcut icon" href="/favicon.ico?v=lk6WXp6Pmj">
|
||||
<meta name="msapplication-TileColor" content="#b91d1d">
|
||||
<meta name="msapplication-TileImage" content="/mstile-144x144.png?v=lk6WXp6Pmj">
|
||||
<meta name="theme-color" content="#d12929">
|
||||
</head>
|
||||
@@ -15,3 +15,11 @@
|
||||
#navPanel {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.layout > core-header-panel {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.layout > core-animated-pages {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template name="layout">
|
||||
<core-drawer-panel responsiveWidth="905px">
|
||||
<core-drawer-panel class="layout" responsiveWidth="905px">
|
||||
<core-header-panel drawer navigation flex mode="seamed" class="white">
|
||||
<div id="accountSummary">
|
||||
{{#if currentUser}}
|
||||
@@ -19,9 +19,9 @@
|
||||
<core-item id="changeLog" icon="list" label="Change Log"></core-item>
|
||||
</div>
|
||||
</core-header-panel>
|
||||
<core-animated-pages main
|
||||
navigation
|
||||
detail-pages
|
||||
<core-animated-pages main
|
||||
navigation
|
||||
detail-pages
|
||||
transitions="hero-transition cross-fade"
|
||||
selected={{globalDetailSelected}}>
|
||||
<section id="mainContentSection" class={{notSelected}}>
|
||||
@@ -66,4 +66,4 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
</paper-toast>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<link rel="import" href="/components/paper-dialog/paper-action-dialog.html">
|
||||
<link rel="import" href="/components/paper-dialog/paper-dialog.html">
|
||||
<link rel="import" href="/components/paper-dialog/paper-dialog-transition.html">
|
||||
<link rel="import" href="/components/paper-dropdown/paper-dropdown.html">
|
||||
<link rel="import" href="/components/paper-fab/paper-fab.html">
|
||||
<link rel="import" href="/components/paper-fab-menu/paper-fab-menu.html">
|
||||
<link rel="import" href="/components/paper-icon-button/paper-icon-button.html">
|
||||
@@ -40,4 +39,5 @@
|
||||
|
||||
<!--custom components-->
|
||||
<link rel="import" href="/custom_components/paper-dropdown-menu/paper-dropdown-menu.html">
|
||||
<link rel="import" href="/custom_components/paper-dropdown/paper-dropdown.html">
|
||||
<link rel="import" href="/custom_components/paper-diff-slider/paper-diff-slider.html">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "bourbon/bourbon";
|
||||
@import "{wolves:bourbon}/bourbon";
|
||||
|
||||
.mini-holder {
|
||||
position: absolute;
|
||||
@@ -43,4 +43,3 @@
|
||||
@include transform(rotate(405deg));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
{
|
||||
"imports": [
|
||||
"/custom_components/paper-dropdown/paper-dropdown.html",
|
||||
"/custom_components/paper-dropdown-menu/paper-dropdown-menu.html",
|
||||
"/custom_components/paper-diff-slider/paper-diff-slider.html",
|
||||
"/custom_components/swipe-detect/swipe-detect.html",
|
||||
|
||||
"/components/core-animated-pages/core-animated-pages.html",
|
||||
"/components/core-animated-pages/transitions/cross-fade.html",
|
||||
"/components/core-animated-pages/transitions/hero-transition.html",
|
||||
@@ -20,7 +25,6 @@
|
||||
"/components/paper-dialog/paper-action-dialog.html",
|
||||
"/components/paper-dialog/paper-dialog.html",
|
||||
"/components/paper-dialog/paper-dialog-transition.html",
|
||||
"/components/paper-dropdown/paper-dropdown.html",
|
||||
"/components/paper-fab/paper-fab.html",
|
||||
"/components/paper-fab-menu/paper-fab-menu.html",
|
||||
"/components/paper-icon-button/paper-icon-button.html",
|
||||
@@ -36,10 +40,6 @@
|
||||
"/components/paper-slider/paper-slider.html",
|
||||
"/components/paper-tabs/paper-tabs.html",
|
||||
"/components/paper-toast/paper-toast.html",
|
||||
"/components/paper-toggle-button/paper-toggle-button.html",
|
||||
|
||||
"/custom_components/paper-dropdown-menu/paper-dropdown-menu.html",
|
||||
"/custom_components/paper-diff-slider/paper-diff-slider.html",
|
||||
"/custom_components/swipe-detect/swipe-detect.html"
|
||||
"/components/paper-toggle-button/paper-toggle-button.html"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
// if we want to add more functions, consider pulling out into its own file
|
||||
(function() {
|
||||
math.import({
|
||||
"if": function(pred, a, b) {
|
||||
return (!!(pred)) ? a : b;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
//evaluates a calculation string
|
||||
evaluate = function(charId, string){
|
||||
if (!string) return string;
|
||||
|
||||
16
rpg-docs/package.json
Normal file
16
rpg-docs/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "rpg-docs",
|
||||
"version": "0.10.0",
|
||||
"description": "Unofficial Online Realtime D&D 5e App",
|
||||
"scripts": {
|
||||
"postinstall": "bower install"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ThaumRystra/RPG-Docs"
|
||||
},
|
||||
"author": "Stefan Zermatten",
|
||||
"dependencies": {
|
||||
"bower": "^1.7.9"
|
||||
}
|
||||
}
|
||||
1
rpg-docs/packages/meteor-vulcanize/.gitignore
vendored
Normal file
1
rpg-docs/packages/meteor-vulcanize/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.npm
|
||||
3
rpg-docs/packages/meteor-vulcanize/.versions
Normal file
3
rpg-docs/packages/meteor-vulcanize/.versions
Normal file
@@ -0,0 +1,3 @@
|
||||
differential:vulcanize@0.0.5
|
||||
meteor@1.1.6
|
||||
underscore@1.0.3
|
||||
29
rpg-docs/packages/meteor-vulcanize/README.md
Normal file
29
rpg-docs/packages/meteor-vulcanize/README.md
Normal file
@@ -0,0 +1,29 @@
|
||||
Vulcanize
|
||||
==============================================================================
|
||||
This package a meteor build plugin that wraps the [vulcanize](https://www.npmjs.com/package/vulcanize) npm package, which is used to process web components into a single output file.
|
||||
|
||||
### Usage
|
||||
1. Ensure all your components are located somewhere under your public directory.
|
||||
2. Include an `imports.html` file anywhere available to the client, that contains the html imports that would normally go inside your `<head>` tag.
|
||||
|
||||
````
|
||||
<!-- Core Components -->
|
||||
<link rel="import" href="/components/core-animation/core-animation.html">
|
||||
<link rel="import" href="/components/core-animated-pages/core-animated-pages.html">
|
||||
<link rel="import" href="/components/core-animated-pages/transitions/slide-from-right.html">
|
||||
<link rel="import" href="/components/core-drawer-panel/core-drawer-panel.html">
|
||||
<link rel="import" href="/components/core-pages/core-pages.html">
|
||||
...
|
||||
|
||||
<!-- Paper Components -->
|
||||
<link rel="import" href="/components/paper-dialog/paper-action-dialog.html">
|
||||
<link rel="import" href="/components/paper-dialog/paper-dialog-transition.html">
|
||||
<link rel="import" href="/components/paper-input/paper-input.html">
|
||||
...
|
||||
````
|
||||
|
||||
- Running your app in development as usual will result in the contents of `imports.html` being added to your `<head>` tag, resulting in multiple subsequent HTTP requests (good in development - debugging).
|
||||
|
||||
- Running `meteor`, `meteor build`, `modulus deploy`, etc with the `VULCANIZE=true` environment variable set will result in all your html imports being vulcanized or concatenated into a single html import (good in production). The resulting file will be called `vulcanized.html`, which will be automatically added to your `<head>` tag. For example, `VULCANIZE=true meteor`, `VULCANIZE=true modulus deploy`.
|
||||
|
||||
- Setting the `CDN_PREFIX` environment variable will prepend the string to the beginning of the file path that is inserted into your HTML's `<head>` tag.
|
||||
15
rpg-docs/packages/meteor-vulcanize/package.js
Normal file
15
rpg-docs/packages/meteor-vulcanize/package.js
Normal file
@@ -0,0 +1,15 @@
|
||||
Package.describe({
|
||||
name: 'thaum:vulcanize',
|
||||
summary: 'Vulcanize',
|
||||
version: '0.0.5',
|
||||
git: 'https://github.com/Differential/meteor-vulcanize'
|
||||
});
|
||||
|
||||
Package.registerBuildPlugin({
|
||||
name: 'vulcanize',
|
||||
use: [],
|
||||
sources: [
|
||||
'vulcanize.js'
|
||||
],
|
||||
npmDependencies: {'vulcanize': '0.7.11'}
|
||||
});
|
||||
20
rpg-docs/packages/meteor-vulcanize/versions.json
Normal file
20
rpg-docs/packages/meteor-vulcanize/versions.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"dependencies": [
|
||||
[
|
||||
"meteor",
|
||||
"1.1.3"
|
||||
],
|
||||
[
|
||||
"underscore",
|
||||
"1.0.1"
|
||||
]
|
||||
],
|
||||
"pluginDependencies": [
|
||||
[
|
||||
"vulcanize",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"toolVersion": "meteor-tool@1.0.35",
|
||||
"format": "1.0"
|
||||
}
|
||||
5
rpg-docs/packages/meteor-vulcanize/vulcanize-tests.js
Normal file
5
rpg-docs/packages/meteor-vulcanize/vulcanize-tests.js
Normal file
@@ -0,0 +1,5 @@
|
||||
// Write your tests here!
|
||||
// Here is an example.
|
||||
Tinytest.add('example', function (test) {
|
||||
test.equal(true, true);
|
||||
});
|
||||
70
rpg-docs/packages/meteor-vulcanize/vulcanize.js
Normal file
70
rpg-docs/packages/meteor-vulcanize/vulcanize.js
Normal file
@@ -0,0 +1,70 @@
|
||||
var vulcan = Npm.require('vulcanize');
|
||||
var crypto = Npm.require('crypto');
|
||||
var url = Npm.require('url');
|
||||
|
||||
var _ = Npm.require('underscore');
|
||||
|
||||
var handler = function(compileStep) {
|
||||
var importsHtml = compileStep.read().toString('utf8');
|
||||
|
||||
if (process.env.VULCANIZE) {
|
||||
log('Vulcanizing imports...');
|
||||
vulcanize(compileStep, importsHtml);
|
||||
} else {
|
||||
log('Adding all imports...');
|
||||
addImports(compileStep, importsHtml);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var vulcanize = function(compileStep, importsHtml) {
|
||||
|
||||
var vulcanOutputHandler = function(filename, data) {
|
||||
|
||||
var filenameHash = crypto.createHash('md5').update(data).digest('hex');
|
||||
var filePath = '/vulcanized-' + filenameHash + '.html';
|
||||
|
||||
compileStep.addAsset({
|
||||
path: filePath,
|
||||
data: data
|
||||
});
|
||||
|
||||
if (_.isString(process.env.CDN_PREFIX)) {
|
||||
filePath = url.resolve(process.env.CDN_PREFIX, filePath);
|
||||
}
|
||||
|
||||
compileStep.addHtml({
|
||||
section: 'head',
|
||||
data: '<link rel="import" href="' + filePath + '">'
|
||||
});
|
||||
};
|
||||
|
||||
vulcan.setOptions({
|
||||
inputSrc: importsHtml,
|
||||
outputHandler: vulcanOutputHandler,
|
||||
abspath: 'public',
|
||||
strip: true
|
||||
}, function(error) {
|
||||
if (error) {
|
||||
log(error);
|
||||
} else {
|
||||
vulcan.processDocument();
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var addImports = function(compileStep, importsHtml) {
|
||||
compileStep.addHtml({
|
||||
section: 'head',
|
||||
data: importsHtml
|
||||
});
|
||||
};
|
||||
|
||||
var log = function() {
|
||||
args = _.values(arguments);
|
||||
args.unshift("Vulcanize:");
|
||||
console.log.apply(this, args);
|
||||
};
|
||||
|
||||
Plugin.registerSourceHandler("imports.html", handler);
|
||||
@@ -115,7 +115,7 @@ ChangeLogs.insert({
|
||||
"Added encumbrance effects that automatically apply when carrying too much load",
|
||||
"Added a bunch of UI elements to make your character's current load clear",
|
||||
"Floating button menus now close as expected when you click a sub-button",
|
||||
"Base values in attribute summaries no longer look like added values"
|
||||
"Base values in attribute summaries no longer look like added values",
|
||||
],
|
||||
});
|
||||
|
||||
@@ -276,8 +276,6 @@ ChangeLogs.insert({
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
|
||||
ChangeLogs.insert({
|
||||
version: "0.8.0",
|
||||
changes: [
|
||||
@@ -294,3 +292,30 @@ ChangeLogs.insert({
|
||||
"Added extra indexes to the database to improve performance",
|
||||
],
|
||||
});
|
||||
|
||||
ChangeLogs.insert({
|
||||
version: "0.9.1",
|
||||
changes: [
|
||||
"Fixed rendering issues in Chrome 49+",
|
||||
"Made character names in the side-bar into regular links",
|
||||
],
|
||||
});
|
||||
|
||||
ChangeLogs.insert({
|
||||
version: "0.9.2",
|
||||
changes: [
|
||||
"New characters now have starting ability scores of 10",
|
||||
"Coins are incrementable by default",
|
||||
"Fixed multiplication sign",
|
||||
"Added \"if\" function to equations",
|
||||
"Added ritual tag to spells in the spell list",
|
||||
"Updated dependencies to keep up with Chrome's breaking changes",
|
||||
],
|
||||
});
|
||||
|
||||
ChangeLogs.insert({
|
||||
version: "0.9.3",
|
||||
changes: [
|
||||
"Fixed invisible dropdown boxes in Chrome 52",
|
||||
],
|
||||
});
|
||||
|
||||
29
rpg-docs/public/custom_components/paper-dropdown/.bower.json
Normal file
29
rpg-docs/public/custom_components/paper-dropdown/.bower.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "paper-dropdown",
|
||||
"private": false,
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^0.5",
|
||||
"core-animation": "Polymer/core-animation#^0.5",
|
||||
"core-collapse": "Polymer/core-collapse#^0.5",
|
||||
"core-dropdown": "Polymer/core-dropdown#^0.5",
|
||||
"core-transition": "Polymer/core-transition#^0.5",
|
||||
"core-icons": "Polymer/core-icons#^0.5",
|
||||
"paper-icon-button": "Polymer/paper-icon-button#^0.5",
|
||||
"paper-item": "Polymer/paper-item#^0.5",
|
||||
"paper-shadow": "Polymer/paper-shadow#^0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "web-component-tester#master"
|
||||
},
|
||||
"version": "0.5.6",
|
||||
"homepage": "https://github.com/Polymer/paper-dropdown",
|
||||
"_release": "0.5.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "0.5.6",
|
||||
"commit": "30db0c00276fd8740bc7488f58703ad9f2449e9d"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/paper-dropdown.git",
|
||||
"_target": "^0.5",
|
||||
"_originalSource": "Polymer/paper-dropdown"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
paper-dropdown
|
||||
==============
|
||||
|
||||
owner: @morethanreal
|
||||
|
||||
See the [component page](https://www.polymer-project.org/0.5/docs/elements/paper-dropdown.html) for more information.
|
||||
19
rpg-docs/public/custom_components/paper-dropdown/bower.json
Normal file
19
rpg-docs/public/custom_components/paper-dropdown/bower.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "paper-dropdown",
|
||||
"private": false,
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^0.5",
|
||||
"core-animation": "Polymer/core-animation#^0.5",
|
||||
"core-collapse": "Polymer/core-collapse#^0.5",
|
||||
"core-dropdown": "Polymer/core-dropdown#^0.5",
|
||||
"core-transition": "Polymer/core-transition#^0.5",
|
||||
"core-icons": "Polymer/core-icons#^0.5",
|
||||
"paper-icon-button": "Polymer/paper-icon-button#^0.5",
|
||||
"paper-item": "Polymer/paper-item#^0.5",
|
||||
"paper-shadow": "Polymer/paper-shadow#^0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "web-component-tester#master"
|
||||
},
|
||||
"version": "0.5.6"
|
||||
}
|
||||
456
rpg-docs/public/custom_components/paper-dropdown/demo.html
Normal file
456
rpg-docs/public/custom_components/paper-dropdown/demo.html
Normal file
@@ -0,0 +1,456 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
<title>paper-dropdown</title>
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents.js"></script>
|
||||
|
||||
<link href="../core-collapse/core-collapse.html" rel="import">
|
||||
<link href="../core-icons/core-icons.html" rel="import">
|
||||
<link href="../paper-icon-button/paper-icon-button.html" rel="import">
|
||||
<link href="../paper-item/paper-item.html" rel="import">
|
||||
|
||||
<link href="paper-dropdown.html" rel="import">
|
||||
|
||||
<style shim-shadowdom>
|
||||
body {
|
||||
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
padding: 24px;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
section > div {
|
||||
padding: 14px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
x-trigger {
|
||||
z-index: auto;
|
||||
}
|
||||
|
||||
html /deep/ paper-dropdown:not(.no-padding)::shadow #scroller {
|
||||
box-sizing: border-box;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.with-margin {
|
||||
margin: 12px;
|
||||
}
|
||||
|
||||
.open-below {
|
||||
top: 38px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<polymer-element name="x-trigger" extends="paper-icon-button" relative on-tap="{{toggle}}" noink>
|
||||
<template>
|
||||
<shadow></shadow>
|
||||
<content></content>
|
||||
</template>
|
||||
<script>
|
||||
Polymer({
|
||||
toggle: function() {
|
||||
if (!this.dropdown) {
|
||||
this.dropdown = this.querySelector('paper-dropdown');
|
||||
}
|
||||
this.dropdown && this.dropdown.toggle();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</polymer-element>
|
||||
|
||||
<template is="auto-binding">
|
||||
|
||||
<section>
|
||||
|
||||
<div>Absolutely positioned dropdowns</div>
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown>
|
||||
halign = left
|
||||
<br>
|
||||
valign = top
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown valign="bottom">
|
||||
halign = left
|
||||
<br>
|
||||
valign = bottom
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown halign="right">
|
||||
halign = right
|
||||
<br>
|
||||
valign = top
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown class="no-padding">
|
||||
<div class="menu">
|
||||
<paper-item>Item 1</paper-item>
|
||||
<paper-item>Item 2</paper-item>
|
||||
<paper-item>Item 3</paper-item>
|
||||
</div>
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<div>Layered dropdowns</div>
|
||||
|
||||
<button onclick="document.getElementById('collapse').toggle()">toggle core-collapse</button>
|
||||
|
||||
<br>
|
||||
|
||||
<core-collapse id="collapse">
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown layered>
|
||||
halign = left
|
||||
<br>
|
||||
valign = top
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
</core-collapse>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<div>Scrolling and margin</div>
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown>
|
||||
no margin<br>
|
||||
<br>
|
||||
<template repeat="{{countries}}">
|
||||
{{name}}<br>
|
||||
</template>
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown class="with-margin">
|
||||
with margin<br>
|
||||
<br>
|
||||
<template repeat="{{countries}}">
|
||||
{{name}}<br>
|
||||
</template>
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<div>Custom position</div>
|
||||
|
||||
<x-trigger icon="menu">
|
||||
<paper-dropdown class="open-below">
|
||||
top: 38px
|
||||
</paper-dropdown>
|
||||
</x-trigger>
|
||||
|
||||
</section>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
scope = document.querySelector('template[is=auto-binding]');
|
||||
|
||||
scope.countries = [
|
||||
{name: 'Afghanistan', code: 'AF'},
|
||||
{name: 'Åland Islands', code: 'AX'},
|
||||
{name: 'Albania', code: 'AL'},
|
||||
{name: 'Algeria', code: 'DZ'},
|
||||
{name: 'American Samoa', code: 'AS'},
|
||||
{name: 'Andorra', code: 'AD'},
|
||||
{name: 'Angola', code: 'AO'},
|
||||
{name: 'Anguilla', code: 'AI'},
|
||||
{name: 'Antarctica', code: 'AQ'},
|
||||
{name: 'Antigua and Barbuda', code: 'AG'},
|
||||
{name: 'Argentina', code: 'AR'},
|
||||
{name: 'Armenia', code: 'AM'},
|
||||
{name: 'Aruba', code: 'AW'},
|
||||
{name: 'Australia', code: 'AU'},
|
||||
{name: 'Austria', code: 'AT'},
|
||||
{name: 'Azerbaijan', code: 'AZ'},
|
||||
{name: 'Bahamas', code: 'BS'},
|
||||
{name: 'Bahrain', code: 'BH'},
|
||||
{name: 'Bangladesh', code: 'BD'},
|
||||
{name: 'Barbados', code: 'BB'},
|
||||
{name: 'Belarus', code: 'BY'},
|
||||
{name: 'Belgium', code: 'BE'},
|
||||
{name: 'Belize', code: 'BZ'},
|
||||
{name: 'Benin', code: 'BJ'},
|
||||
{name: 'Bermuda', code: 'BM'},
|
||||
{name: 'Bhutan', code: 'BT'},
|
||||
{name: 'Bolivia', code: 'BO'},
|
||||
{name: 'Bosnia and Herzegovina', code: 'BA'},
|
||||
{name: 'Botswana', code: 'BW'},
|
||||
{name: 'Bouvet Island', code: 'BV'},
|
||||
{name: 'Brazil', code: 'BR'},
|
||||
{name: 'British Indian Ocean Territory', code: 'IO'},
|
||||
{name: 'Brunei Darussalam', code: 'BN'},
|
||||
{name: 'Bulgaria', code: 'BG'},
|
||||
{name: 'Burkina Faso', code: 'BF'},
|
||||
{name: 'Burundi', code: 'BI'},
|
||||
{name: 'Cambodia', code: 'KH'},
|
||||
{name: 'Cameroon', code: 'CM'},
|
||||
{name: 'Canada', code: 'CA'},
|
||||
{name: 'Cape Verde', code: 'CV'},
|
||||
{name: 'Cayman Islands', code: 'KY'},
|
||||
{name: 'Central African Republic', code: 'CF'},
|
||||
{name: 'Chad', code: 'TD'},
|
||||
{name: 'Chile', code: 'CL'},
|
||||
{name: 'China', code: 'CN'},
|
||||
{name: 'Christmas Island', code: 'CX'},
|
||||
{name: 'Cocos (Keeling) Islands', code: 'CC'},
|
||||
{name: 'Colombia', code: 'CO'},
|
||||
{name: 'Comoros', code: 'KM'},
|
||||
{name: 'Congo', code: 'CG'},
|
||||
{name: 'Congo, The Democratic Republic of the', code: 'CD'},
|
||||
{name: 'Cook Islands', code: 'CK'},
|
||||
{name: 'Costa Rica', code: 'CR'},
|
||||
{name: 'Cote D\'Ivoire', code: 'CI'},
|
||||
{name: 'Croatia', code: 'HR'},
|
||||
{name: 'Cuba', code: 'CU'},
|
||||
{name: 'Cyprus', code: 'CY'},
|
||||
{name: 'Czech Republic', code: 'CZ'},
|
||||
{name: 'Denmark', code: 'DK'},
|
||||
{name: 'Djibouti', code: 'DJ'},
|
||||
{name: 'Dominica', code: 'DM'},
|
||||
{name: 'Dominican Republic', code: 'DO'},
|
||||
{name: 'Ecuador', code: 'EC'},
|
||||
{name: 'Egypt', code: 'EG'},
|
||||
{name: 'El Salvador', code: 'SV'},
|
||||
{name: 'Equatorial Guinea', code: 'GQ'},
|
||||
{name: 'Eritrea', code: 'ER'},
|
||||
{name: 'Estonia', code: 'EE'},
|
||||
{name: 'Ethiopia', code: 'ET'},
|
||||
{name: 'Falkland Islands (Malvinas)', code: 'FK'},
|
||||
{name: 'Faroe Islands', code: 'FO'},
|
||||
{name: 'Fiji', code: 'FJ'},
|
||||
{name: 'Finland', code: 'FI'},
|
||||
{name: 'France', code: 'FR'},
|
||||
{name: 'French Guiana', code: 'GF'},
|
||||
{name: 'French Polynesia', code: 'PF'},
|
||||
{name: 'French Southern Territories', code: 'TF'},
|
||||
{name: 'Gabon', code: 'GA'},
|
||||
{name: 'Gambia', code: 'GM'},
|
||||
{name: 'Georgia', code: 'GE'},
|
||||
{name: 'Germany', code: 'DE'},
|
||||
{name: 'Ghana', code: 'GH'},
|
||||
{name: 'Gibraltar', code: 'GI'},
|
||||
{name: 'Greece', code: 'GR'},
|
||||
{name: 'Greenland', code: 'GL'},
|
||||
{name: 'Grenada', code: 'GD'},
|
||||
{name: 'Guadeloupe', code: 'GP'},
|
||||
{name: 'Guam', code: 'GU'},
|
||||
{name: 'Guatemala', code: 'GT'},
|
||||
{name: 'Guernsey', code: 'GG'},
|
||||
{name: 'Guinea', code: 'GN'},
|
||||
{name: 'Guinea-Bissau', code: 'GW'},
|
||||
{name: 'Guyana', code: 'GY'},
|
||||
{name: 'Haiti', code: 'HT'},
|
||||
{name: 'Heard Island and Mcdonald Islands', code: 'HM'},
|
||||
{name: 'Holy See (Vatican City State)', code: 'VA'},
|
||||
{name: 'Honduras', code: 'HN'},
|
||||
{name: 'Hong Kong', code: 'HK'},
|
||||
{name: 'Hungary', code: 'HU'},
|
||||
{name: 'Iceland', code: 'IS'},
|
||||
{name: 'India', code: 'IN'},
|
||||
{name: 'Indonesia', code: 'ID'},
|
||||
{name: 'Iran, Islamic Republic Of', code: 'IR'},
|
||||
{name: 'Iraq', code: 'IQ'},
|
||||
{name: 'Ireland', code: 'IE'},
|
||||
{name: 'Isle of Man', code: 'IM'},
|
||||
{name: 'Israel', code: 'IL'},
|
||||
{name: 'Italy', code: 'IT'},
|
||||
{name: 'Jamaica', code: 'JM'},
|
||||
{name: 'Japan', code: 'JP'},
|
||||
{name: 'Jersey', code: 'JE'},
|
||||
{name: 'Jordan', code: 'JO'},
|
||||
{name: 'Kazakhstan', code: 'KZ'},
|
||||
{name: 'Kenya', code: 'KE'},
|
||||
{name: 'Kiribati', code: 'KI'},
|
||||
{name: 'Korea, Democratic People\'S Republic of', code: 'KP'},
|
||||
{name: 'Korea, Republic of', code: 'KR'},
|
||||
{name: 'Kuwait', code: 'KW'},
|
||||
{name: 'Kyrgyzstan', code: 'KG'},
|
||||
{name: 'Lao People\'S Democratic Republic', code: 'LA'},
|
||||
{name: 'Latvia', code: 'LV'},
|
||||
{name: 'Lebanon', code: 'LB'},
|
||||
{name: 'Lesotho', code: 'LS'},
|
||||
{name: 'Liberia', code: 'LR'},
|
||||
{name: 'Libyan Arab Jamahiriya', code: 'LY'},
|
||||
{name: 'Liechtenstein', code: 'LI'},
|
||||
{name: 'Lithuania', code: 'LT'},
|
||||
{name: 'Luxembourg', code: 'LU'},
|
||||
{name: 'Macao', code: 'MO'},
|
||||
{name: 'Macedonia, The Former Yugoslav Republic of', code: 'MK'},
|
||||
{name: 'Madagascar', code: 'MG'},
|
||||
{name: 'Malawi', code: 'MW'},
|
||||
{name: 'Malaysia', code: 'MY'},
|
||||
{name: 'Maldives', code: 'MV'},
|
||||
{name: 'Mali', code: 'ML'},
|
||||
{name: 'Malta', code: 'MT'},
|
||||
{name: 'Marshall Islands', code: 'MH'},
|
||||
{name: 'Martinique', code: 'MQ'},
|
||||
{name: 'Mauritania', code: 'MR'},
|
||||
{name: 'Mauritius', code: 'MU'},
|
||||
{name: 'Mayotte', code: 'YT'},
|
||||
{name: 'Mexico', code: 'MX'},
|
||||
{name: 'Micronesia, Federated States of', code: 'FM'},
|
||||
{name: 'Moldova, Republic of', code: 'MD'},
|
||||
{name: 'Monaco', code: 'MC'},
|
||||
{name: 'Mongolia', code: 'MN'},
|
||||
{name: 'Montserrat', code: 'MS'},
|
||||
{name: 'Morocco', code: 'MA'},
|
||||
{name: 'Mozambique', code: 'MZ'},
|
||||
{name: 'Myanmar', code: 'MM'},
|
||||
{name: 'Namibia', code: 'NA'},
|
||||
{name: 'Nauru', code: 'NR'},
|
||||
{name: 'Nepal', code: 'NP'},
|
||||
{name: 'Netherlands', code: 'NL'},
|
||||
{name: 'Netherlands Antilles', code: 'AN'},
|
||||
{name: 'New Caledonia', code: 'NC'},
|
||||
{name: 'New Zealand', code: 'NZ'},
|
||||
{name: 'Nicaragua', code: 'NI'},
|
||||
{name: 'Niger', code: 'NE'},
|
||||
{name: 'Nigeria', code: 'NG'},
|
||||
{name: 'Niue', code: 'NU'},
|
||||
{name: 'Norfolk Island', code: 'NF'},
|
||||
{name: 'Northern Mariana Islands', code: 'MP'},
|
||||
{name: 'Norway', code: 'NO'},
|
||||
{name: 'Oman', code: 'OM'},
|
||||
{name: 'Pakistan', code: 'PK'},
|
||||
{name: 'Palau', code: 'PW'},
|
||||
{name: 'Palestinian Territory, Occupied', code: 'PS'},
|
||||
{name: 'Panama', code: 'PA'},
|
||||
{name: 'Papua New Guinea', code: 'PG'},
|
||||
{name: 'Paraguay', code: 'PY'},
|
||||
{name: 'Peru', code: 'PE'},
|
||||
{name: 'Philippines', code: 'PH'},
|
||||
{name: 'Pitcairn', code: 'PN'},
|
||||
{name: 'Poland', code: 'PL'},
|
||||
{name: 'Portugal', code: 'PT'},
|
||||
{name: 'Puerto Rico', code: 'PR'},
|
||||
{name: 'Qatar', code: 'QA'},
|
||||
{name: 'Reunion', code: 'RE'},
|
||||
{name: 'Romania', code: 'RO'},
|
||||
{name: 'Russian Federation', code: 'RU'},
|
||||
{name: 'RWANDA', code: 'RW'},
|
||||
{name: 'Saint Helena', code: 'SH'},
|
||||
{name: 'Saint Kitts and Nevis', code: 'KN'},
|
||||
{name: 'Saint Lucia', code: 'LC'},
|
||||
{name: 'Saint Pierre and Miquelon', code: 'PM'},
|
||||
{name: 'Saint Vincent and the Grenadines', code: 'VC'},
|
||||
{name: 'Samoa', code: 'WS'},
|
||||
{name: 'San Marino', code: 'SM'},
|
||||
{name: 'Sao Tome and Principe', code: 'ST'},
|
||||
{name: 'Saudi Arabia', code: 'SA'},
|
||||
{name: 'Senegal', code: 'SN'},
|
||||
{name: 'Serbia and Montenegro', code: 'CS'},
|
||||
{name: 'Seychelles', code: 'SC'},
|
||||
{name: 'Sierra Leone', code: 'SL'},
|
||||
{name: 'Singapore', code: 'SG'},
|
||||
{name: 'Slovakia', code: 'SK'},
|
||||
{name: 'Slovenia', code: 'SI'},
|
||||
{name: 'Solomon Islands', code: 'SB'},
|
||||
{name: 'Somalia', code: 'SO'},
|
||||
{name: 'South Africa', code: 'ZA'},
|
||||
{name: 'South Georgia and the South Sandwich Islands', code: 'GS'},
|
||||
{name: 'Spain', code: 'ES'},
|
||||
{name: 'Sri Lanka', code: 'LK'},
|
||||
{name: 'Sudan', code: 'SD'},
|
||||
{name: 'Suriname', code: 'SR'},
|
||||
{name: 'Svalbard and Jan Mayen', code: 'SJ'},
|
||||
{name: 'Swaziland', code: 'SZ'},
|
||||
{name: 'Sweden', code: 'SE'},
|
||||
{name: 'Switzerland', code: 'CH'},
|
||||
{name: 'Syrian Arab Republic', code: 'SY'},
|
||||
{name: 'Taiwan, Province of China', code: 'TW'},
|
||||
{name: 'Tajikistan', code: 'TJ'},
|
||||
{name: 'Tanzania, United Republic of', code: 'TZ'},
|
||||
{name: 'Thailand', code: 'TH'},
|
||||
{name: 'Timor-Leste', code: 'TL'},
|
||||
{name: 'Togo', code: 'TG'},
|
||||
{name: 'Tokelau', code: 'TK'},
|
||||
{name: 'Tonga', code: 'TO'},
|
||||
{name: 'Trinidad and Tobago', code: 'TT'},
|
||||
{name: 'Tunisia', code: 'TN'},
|
||||
{name: 'Turkey', code: 'TR'},
|
||||
{name: 'Turkmenistan', code: 'TM'},
|
||||
{name: 'Turks and Caicos Islands', code: 'TC'},
|
||||
{name: 'Tuvalu', code: 'TV'},
|
||||
{name: 'Uganda', code: 'UG'},
|
||||
{name: 'Ukraine', code: 'UA'},
|
||||
{name: 'United Arab Emirates', code: 'AE'},
|
||||
{name: 'United Kingdom', code: 'GB'},
|
||||
{name: 'United States', code: 'US'},
|
||||
{name: 'United States Minor Outlying Islands', code: 'UM'},
|
||||
{name: 'Uruguay', code: 'UY'},
|
||||
{name: 'Uzbekistan', code: 'UZ'},
|
||||
{name: 'Vanuatu', code: 'VU'},
|
||||
{name: 'Venezuela', code: 'VE'},
|
||||
{name: 'Viet Nam', code: 'VN'},
|
||||
{name: 'Virgin Islands, British', code: 'VG'},
|
||||
{name: 'Virgin Islands, U.S.', code: 'VI'},
|
||||
{name: 'Wallis and Futuna', code: 'WF'},
|
||||
{name: 'Western Sahara', code: 'EH'},
|
||||
{name: 'Yemen', code: 'YE'},
|
||||
{name: 'Zambia', code: 'ZM'},
|
||||
{name: 'Zimbabwe', code: 'ZW'}
|
||||
];
|
||||
|
||||
scope.pastries = [
|
||||
'Apple fritter',
|
||||
'Croissant',
|
||||
'Donut',
|
||||
'Financier',
|
||||
'Jello',
|
||||
'Madeleine',
|
||||
'Pound cake',
|
||||
'Pretzel',
|
||||
'Sfogliatelle'
|
||||
];
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
22
rpg-docs/public/custom_components/paper-dropdown/index.html
Normal file
22
rpg-docs/public/custom_components/paper-dropdown/index.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents.js"></script>
|
||||
<link rel="import" href="../core-component-page/core-component-page.html">
|
||||
|
||||
</head>
|
||||
<body unresolved>
|
||||
|
||||
<core-component-page sources='["paper-dropdown.html","paper-dropdown-transition.html"]'></core-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,15 @@
|
||||
/* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */
|
||||
|
||||
:host(.core-transition) #ripple,
|
||||
:host(.core-transition) #background {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
:host(.core-transition) #scroller {
|
||||
opacity: 0;
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
<!--
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<!--
|
||||
|
||||
`paper-dropdown-transition` is a transition for `paper-dropdown`.
|
||||
|
||||
Add the class `menu` to a `core-selector` child of the `paper-dropdown` to
|
||||
enable the optional list cascade transition.
|
||||
|
||||
@group Paper Elements
|
||||
@class paper-dropdown-transition
|
||||
@extends core-transition-css
|
||||
@status unstable
|
||||
-->
|
||||
<link href="../../components/polymer/polymer.html" rel="import">
|
||||
<link href="../../components/core-transition/core-transition-css.html" rel="import">
|
||||
<link href="../../components/core-animation/web-animations.html" rel="import">
|
||||
|
||||
<polymer-element name="paper-dropdown-transition" extends="core-transition-css">
|
||||
<template>
|
||||
<link href="paper-dropdown-transition.css" rel="stylesheet" no-shim>
|
||||
</template>
|
||||
<script>
|
||||
Polymer('paper-dropdown-transition', {
|
||||
|
||||
publish: {
|
||||
|
||||
/**
|
||||
* The duration of the transition in ms. You can also set the duration by
|
||||
* setting a `duration` attribute on the target:
|
||||
*
|
||||
* <paper-dropdown duration="1000"></paper-dropdown>
|
||||
*
|
||||
* @attribute duration
|
||||
* @type number
|
||||
* @default 500
|
||||
*/
|
||||
duration: 350
|
||||
|
||||
},
|
||||
|
||||
setup: function(node) {
|
||||
this.super(arguments);
|
||||
|
||||
var to = {
|
||||
'top': '0%',
|
||||
'left': '0%',
|
||||
'bottom': '100%',
|
||||
'right': '100%'
|
||||
};
|
||||
|
||||
var bg = node.$.background;
|
||||
bg.style.webkitTransformOrigin = to[node.halign] + ' ' + to[node.valign];
|
||||
bg.style.transformOrigin = to[node.halign] + ' ' + to[node.valign];
|
||||
},
|
||||
|
||||
transitionOpened: function(node, opened) {
|
||||
this.super(arguments);
|
||||
|
||||
if (opened) {
|
||||
if (this.player) {
|
||||
this.player.cancel();
|
||||
}
|
||||
|
||||
var duration = Number(node.getAttribute('duration')) || this.duration;
|
||||
|
||||
var anims = [];
|
||||
|
||||
var size = node.getBoundingClientRect();
|
||||
|
||||
var ink = node.$.ripple;
|
||||
// var offset = 40 / Math.max(size.width, size.height);
|
||||
var offset = 0.2;
|
||||
anims.push(new Animation(ink, [{
|
||||
'opacity': 0.9,
|
||||
'transform': 'scale(0)',
|
||||
}, {
|
||||
'opacity': 0.9,
|
||||
'transform': 'scale(1)'
|
||||
}], {
|
||||
duration: duration * offset,
|
||||
}));
|
||||
|
||||
// XXX: cancel() seems not to be working until chrome 41 so set the opacity for the
|
||||
// background here to prevent a flash.
|
||||
anims.push(new Animation(node.$.background, [{
|
||||
'opacity': 0,
|
||||
'transform': 'scale(0)'
|
||||
}, {
|
||||
'opacity': 0,
|
||||
'transform': 'scale(0)'
|
||||
}], {
|
||||
duration: 0,
|
||||
delay: 0,
|
||||
fill: 'forwards'
|
||||
}));
|
||||
|
||||
var bg = node.$.background;
|
||||
var sx = 40 / size.width;
|
||||
var sy = 40 / size.height;
|
||||
anims.push(new Animation(bg, [{
|
||||
'opacity': 0.9,
|
||||
'transform': 'scale(' + sx + ',' + sy + ')',
|
||||
}, {
|
||||
'opacity': 1,
|
||||
'transform': 'scale(' + Math.max(sx, 0.95) + ',' + Math.max(sy, 0.5) + ')'
|
||||
}, {
|
||||
'opacity': 1,
|
||||
'transform': 'scale(1, 1)'
|
||||
}], {
|
||||
delay: duration * offset,
|
||||
duration: duration * (1 - offset),
|
||||
fill: 'forwards'
|
||||
}));
|
||||
|
||||
var menu = node.querySelector('.menu');
|
||||
if (menu) {
|
||||
var items = menu.items || menu.children.array();
|
||||
var itemDelay = offset + (1 - offset) / 2;
|
||||
var itemDuration = duration * (1 - itemDelay) / items.length;
|
||||
var reverse = this.valign === 'bottom';
|
||||
|
||||
items.forEach(function(item, i) {
|
||||
anims.push(new Animation(item, [{
|
||||
'opacity': 0
|
||||
}, {
|
||||
'opacity': 1
|
||||
}], {
|
||||
delay: duration * itemDelay + itemDuration * (reverse ? items.length - 1 - i : i),
|
||||
duration: itemDuration,
|
||||
fill: 'both'
|
||||
}));
|
||||
}.bind(this));
|
||||
|
||||
anims.push(new Animation(node.$.scroller, [{
|
||||
'opacity': 1
|
||||
}, {
|
||||
'opacity': 1
|
||||
}], {
|
||||
delay: duration * itemDelay,
|
||||
duration: itemDuration * items.length,
|
||||
fill: 'both'
|
||||
}));
|
||||
|
||||
} else {
|
||||
anims.push(new Animation(node.$.scroller, [{
|
||||
'opacity': 0
|
||||
}, {
|
||||
'opacity': 1
|
||||
}], {
|
||||
delay: duration * (offset + (1 - offset) / 2),
|
||||
duration: duration * 0.5,
|
||||
fill: 'both'
|
||||
}));
|
||||
}
|
||||
|
||||
var group = new AnimationGroup(anims/*, {
|
||||
easing: 'cubic-bezier(0.4, 0, 0.2, 1)'
|
||||
}*/);
|
||||
this.player = document.timeline.play(group);
|
||||
this.player.onfinish = function() {
|
||||
this.fire('core-transitionend', this, node);
|
||||
}.bind(this);
|
||||
|
||||
} else {
|
||||
this.fire('core-transitionend', this, node);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</polymer-element>
|
||||
|
||||
<paper-dropdown-transition id="paper-dropdown-transition"></paper-dropdown-transition>
|
||||
@@ -0,0 +1,115 @@
|
||||
<!--
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<!--
|
||||
|
||||
`paper-dropdown` is a `core-dropdown` with a `paper-shadow`. By default, it
|
||||
is animated on open with `paper-dropdown-transition`. Use this element with
|
||||
`paper-dropdown-menu` or `paper-menu-button` to implement UI controls that
|
||||
open a drop-down.
|
||||
|
||||
Example:
|
||||
|
||||
<paper-dropdown>
|
||||
Hi!
|
||||
</paper-dropdown>
|
||||
|
||||
Theming
|
||||
-------
|
||||
|
||||
Style the background color of the dropdown with these selectors:
|
||||
|
||||
paper-dropdown::shadow #ripple,
|
||||
paper-dropdown::shadow #background {
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
@group Paper Elements
|
||||
@element paper-dropdown
|
||||
@extends core-dropdown
|
||||
@status unstable
|
||||
-->
|
||||
|
||||
<link href="../../components/polymer/polymer.html" rel="import">
|
||||
<link href="../../components/core-dropdown/core-dropdown.html" rel="import">
|
||||
<link href="../../components/paper-shadow/paper-shadow.html" rel="import">
|
||||
|
||||
<!--<link href="paper-dropdown-transition.html" rel="import">-->
|
||||
|
||||
<style shim-shadowdom>
|
||||
html /deep/ paper-dropdown {
|
||||
position: absolute;
|
||||
overflow: visible;
|
||||
min-height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<polymer-element name="paper-dropdown" extends="core-dropdown">
|
||||
<template>
|
||||
|
||||
<style>
|
||||
#ripple {
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.26);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
:host([halign=right]) #ripple {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
:host([valign=bottom]) #ripple {
|
||||
top: auto;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#background {
|
||||
background-color: #fff;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
#scroller {
|
||||
overflow: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="ripple"></div>
|
||||
|
||||
<div id="background" fit>
|
||||
<paper-shadow fit></paper-shadow>
|
||||
</div>
|
||||
|
||||
<div id="scroller" relative>
|
||||
<content></content>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
publish: { //Chrome 52 breaks this
|
||||
// transition: 'paper-dropdown-transition'
|
||||
},
|
||||
ready: function() {
|
||||
this.super();
|
||||
this.sizingTarget = this.$.scroller;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</polymer-element>
|
||||
Reference in New Issue
Block a user