From 67114e65d38c788b81f93c2a91ac1ede0eca3266 Mon Sep 17 00:00:00 2001
From: Daniel Bayley
Date: Sun, 13 Nov 2016 16:34:30 +0000
Subject: [PATCH 1/3] Docs shorthand object notation
A simple but slightly more imaginative example of shorthand object notation.
Closes #1808.
Signed-off-by: Daniel Bayley
---
documentation/coffee/objects_shorthand.coffee | 5 +++++
documentation/index.html.js | 5 +++++
documentation/js/objects_shorthand.js | 16 ++++++++++++++++
3 files changed, 26 insertions(+)
create mode 100644 documentation/coffee/objects_shorthand.coffee
create mode 100644 documentation/js/objects_shorthand.js
diff --git a/documentation/coffee/objects_shorthand.coffee b/documentation/coffee/objects_shorthand.coffee
new file mode 100644
index 0000000000..efcd9c3e28
--- /dev/null
+++ b/documentation/coffee/objects_shorthand.coffee
@@ -0,0 +1,5 @@
+name = "Michelangelo"
+mask = "Orange"
+pizza = "Pepperoni"
+turtle = {name, mask, pizza}
+output = "#{turtle.name} wears an #{turtle.mask} mask. He ordered the #{turtle.pizza} pizza."
diff --git a/documentation/index.html.js b/documentation/index.html.js
index b80425b1b7..7508949de8 100644
--- a/documentation/index.html.js
+++ b/documentation/index.html.js
@@ -456,6 +456,11 @@ Block
about it (say, when using jQuery).
<%= codeFor('objects_reserved') %>
+
+ CoffeeScript has a shortcut for creating objects when you want the key
+ to be set with a variable of the same name.
+
+ <%= code_for('objects_shorthand') %>
diff --git a/documentation/js/objects_shorthand.js b/documentation/js/objects_shorthand.js
new file mode 100644
index 0000000000..825e049f96
--- /dev/null
+++ b/documentation/js/objects_shorthand.js
@@ -0,0 +1,16 @@
+// Generated by CoffeeScript 1.11.1
+var mask, name, output, pizza, turtle;
+
+name = "Michelangelo";
+
+mask = "Orange";
+
+pizza = "Pepperoni";
+
+turtle = {
+ name: name,
+ mask: mask,
+ pizza: pizza
+};
+
+output = turtle.name + " wears an " + turtle.mask + " mask. He ordered the " + turtle.pizza + " pizza.";
From 569cf5d3e265d7871eef2218f355908b67525c64 Mon Sep 17 00:00:00 2001
From: Geoffrey Booth
Date: Sun, 20 Nov 2016 17:33:05 -0800
Subject: [PATCH 2/3] Update for new documentation folder structure
---
documentation/coffee/objects_shorthand.coffee | 5 -----
documentation/examples/objects_shorthand.coffee | 5 +++++
documentation/js/objects_shorthand.js | 16 ----------------
3 files changed, 5 insertions(+), 21 deletions(-)
delete mode 100644 documentation/coffee/objects_shorthand.coffee
create mode 100644 documentation/examples/objects_shorthand.coffee
delete mode 100644 documentation/js/objects_shorthand.js
diff --git a/documentation/coffee/objects_shorthand.coffee b/documentation/coffee/objects_shorthand.coffee
deleted file mode 100644
index efcd9c3e28..0000000000
--- a/documentation/coffee/objects_shorthand.coffee
+++ /dev/null
@@ -1,5 +0,0 @@
-name = "Michelangelo"
-mask = "Orange"
-pizza = "Pepperoni"
-turtle = {name, mask, pizza}
-output = "#{turtle.name} wears an #{turtle.mask} mask. He ordered the #{turtle.pizza} pizza."
diff --git a/documentation/examples/objects_shorthand.coffee b/documentation/examples/objects_shorthand.coffee
new file mode 100644
index 0000000000..4d3a9e251b
--- /dev/null
+++ b/documentation/examples/objects_shorthand.coffee
@@ -0,0 +1,5 @@
+name = "Michelangelo"
+mask = "orange"
+weapon = "nunchuks"
+turtle = {name, mask, weapon}
+output = "#{turtle.name} wears an #{turtle.mask} mask. Watch out for his #{turtle.weapon}!"
diff --git a/documentation/js/objects_shorthand.js b/documentation/js/objects_shorthand.js
deleted file mode 100644
index 825e049f96..0000000000
--- a/documentation/js/objects_shorthand.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Generated by CoffeeScript 1.11.1
-var mask, name, output, pizza, turtle;
-
-name = "Michelangelo";
-
-mask = "Orange";
-
-pizza = "Pepperoni";
-
-turtle = {
- name: name,
- mask: mask,
- pizza: pizza
-};
-
-output = turtle.name + " wears an " + turtle.mask + " mask. He ordered the " + turtle.pizza + " pizza.";
From eee9f2b8fc1c30f565e6daaead8fac999612743d Mon Sep 17 00:00:00 2001
From: Geoffrey Booth
Date: Sun, 20 Nov 2016 17:33:14 -0800
Subject: [PATCH 3/3] Fix typo
---
documentation/index.html.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/documentation/index.html.js b/documentation/index.html.js
index c3b1a2cea1..75bf60c954 100644
--- a/documentation/index.html.js
+++ b/documentation/index.html.js
@@ -461,7 +461,7 @@ Block
CoffeeScript has a shortcut for creating objects when you want the key
to be set with a variable of the same name.
- <%= code_for('objects_shorthand') %>
+ <%= codeFor('objects_shorthand') %>