From 0e194a540818842a616ddb6c82dbc85d46001fcc Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Mon, 27 Jul 2015 10:21:26 +0200 Subject: [PATCH] Added markdown to text areas --- rpg-docs/.meteor/packages | 1 + rpg-docs/.meteor/versions | 1 + rpg-docs/client/style/main.scss | 7 ++++++- .../character/features/featureDialog/featureDialog.html | 2 +- rpg-docs/client/views/character/features/features.html | 5 +++-- rpg-docs/client/views/character/features/features.js | 2 +- .../inventory/containerDialog/containerDialog.html | 2 +- .../views/character/inventory/itemDialog/itemDialog.html | 4 ++-- .../journal/experienceDialog/experienceDialog.html | 2 +- rpg-docs/client/views/character/journal/journal.html | 2 +- .../views/character/journal/noteDialog/noteDialog.html | 2 +- .../persona/backgroundDialog/backgroundDialog.html | 2 +- rpg-docs/client/views/character/persona/persona.html | 2 +- .../views/character/persona/textDialog/textDialog.html | 2 +- .../views/character/spells/spellDialog/spellDialog.html | 2 +- .../character/spells/spellListDialog/spellListDialog.html | 2 +- 16 files changed, 24 insertions(+), 16 deletions(-) diff --git a/rpg-docs/.meteor/packages b/rpg-docs/.meteor/packages index bbd56e0f..63666300 100644 --- a/rpg-docs/.meteor/packages +++ b/rpg-docs/.meteor/packages @@ -27,3 +27,4 @@ fourseven:scss@2.1.1 wolves:bourbon meteorhacks:subs-manager meteorhacks:kadira +chuangbo:marked diff --git a/rpg-docs/.meteor/versions b/rpg-docs/.meteor/versions index d99c6a38..f890e0c5 100644 --- a/rpg-docs/.meteor/versions +++ b/rpg-docs/.meteor/versions @@ -14,6 +14,7 @@ blaze-tools@1.0.3 boilerplate-generator@1.0.3 callback-hook@1.0.3 check@1.0.5 +chuangbo:marked@0.3.5 coffeescript@1.0.6 dburles:collection-helpers@1.0.3 dburles:mongo-collection-instances@0.3.3 diff --git a/rpg-docs/client/style/main.scss b/rpg-docs/client/style/main.scss index 77a3172f..5006ac3b 100644 --- a/rpg-docs/client/style/main.scss +++ b/rpg-docs/client/style/main.scss @@ -29,6 +29,11 @@ core-header-panel[drawer] { box-shadow: 2px 0px 5px 0px rgba(0,0,0,0.2); } +//Paragraphs +p { + margin-bottom: 8px; +} + //Horizontal rule hr { background-color: #444; @@ -37,7 +42,7 @@ hr { color: #444; height: 1px; line-height: 0; - margin: 16px -16px; + margin: 16px 0; text-align: center; } diff --git a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html index 1ee51cd8..500da4f9 100644 --- a/rpg-docs/client/views/character/features/featureDialog/featureDialog.html +++ b/rpg-docs/client/views/character/features/featureDialog/featureDialog.html @@ -32,7 +32,7 @@ {{/if}} {{#if description}} -
{{evaluateString charId description}}
+
{{#markdown}}{{evaluateString charId description}}{{/markdown}}
{{/if}} {{> effectsViewList charId=charId parentId=_id}} diff --git a/rpg-docs/client/views/character/features/features.html b/rpg-docs/client/views/character/features/features.html index 5726c166..165bd73a 100644 --- a/rpg-docs/client/views/character/features/features.html +++ b/rpg-docs/client/views/character/features/features.html @@ -102,8 +102,9 @@ {{/if}} {{#if description}} -
{{evaluateString charId shortDescription}}
+
+ {{#markdown}}{{evaluateString charId shortDescription}}{{/markdown}} +
{{/if}} {{#if hasUses}}
diff --git a/rpg-docs/client/views/character/features/features.js b/rpg-docs/client/views/character/features/features.js index a0b1f329..99687f39 100644 --- a/rpg-docs/client/views/character/features/features.js +++ b/rpg-docs/client/views/character/features/features.js @@ -5,7 +5,7 @@ Template.features.helpers({ }, shortDescription: function() { if (_.isString(this.description)){ - return this.description.split(/[\n\r]{3,}/)[0]; + return this.description.split(/^( *[-*_]){3,} *(?:\n+|$)/m)[0]; } }, hasUses: function(){ diff --git a/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html b/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html index dfcf1ca1..2682fa5e 100644 --- a/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html +++ b/rpg-docs/client/views/character/inventory/containerDialog/containerDialog.html @@ -41,6 +41,6 @@
{{#if description}}
-
{{evaluateString charId description}}
+
{{#markdown}}{{evaluateString charId description}}{{/markdown}}
{{/if}} diff --git a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html index 3b67667d..bab6cea1 100644 --- a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html +++ b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html @@ -18,8 +18,8 @@ {{#if requiresAttunement}}
Requires Attunement
{{/if}} {{#if description}} -
-
{{evaluateString charId description}}
+
+
{{#markdown}}{{evaluateString charId description}}{{/markdown}}
{{/if}} {{> effectsViewList charId=charId parentId=_id}} {{> attacksViewList charId=charId parentId=_id}} diff --git a/rpg-docs/client/views/character/journal/experienceDialog/experienceDialog.html b/rpg-docs/client/views/character/journal/experienceDialog/experienceDialog.html index 600361f6..6573d590 100644 --- a/rpg-docs/client/views/character/journal/experienceDialog/experienceDialog.html +++ b/rpg-docs/client/views/character/journal/experienceDialog/experienceDialog.html @@ -6,7 +6,7 @@ {{#if description}}
-
{{description}}
+
{{#markdown}}{{description}}{{/markdown}}
{{/if}} {{else}} {{> experienceEdit}} diff --git a/rpg-docs/client/views/character/journal/journal.html b/rpg-docs/client/views/character/journal/journal.html index 6d2a048a..2f69fb6e 100644 --- a/rpg-docs/client/views/character/journal/journal.html +++ b/rpg-docs/client/views/character/journal/journal.html @@ -87,7 +87,7 @@ layout horizontal center> {{name}} -
{{description}}
+
{{#markdown}}{{description}}{{/markdown}}
{{/each}} diff --git a/rpg-docs/client/views/character/journal/noteDialog/noteDialog.html b/rpg-docs/client/views/character/journal/noteDialog/noteDialog.html index 754a9a7b..ecb6c682 100644 --- a/rpg-docs/client/views/character/journal/noteDialog/noteDialog.html +++ b/rpg-docs/client/views/character/journal/noteDialog/noteDialog.html @@ -1,7 +1,7 @@