diff --git a/apps/hedwig/resources/guide/touch.json b/apps/hedwig/resources/guide/touch.json index 781c43a..6bb2062 100644 --- a/apps/hedwig/resources/guide/touch.json +++ b/apps/hedwig/resources/guide/touch.json @@ -1 +1 @@ -{"title":"Writing Touch Applications","sections":[{"title":"Introduction","articles":[{"content":"

A Brief Touch on Touches

\n\n

Some text goes here.

\n\n

Note that links like the below must appear on empty lines with no preceding whitespace.

\n\n

touch-demo.js

","errors":[],"demos":{"touch-demo.js":{"ex":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","highlighted":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get("frame");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set("layout", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: "white",\n childViews: "dot1 dot2".w(),\n dot1: Dot.design({\n backgroundColor: "red",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: "blue",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","original":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n"}},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"A Brief Touch on Touches","any":"metadata","goes":"Here","damn":"gruber","this":"is still eye-readable","and":"He is wrong about touch apps."},{"content":"","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/"}]},{"title":"Built-In Support","articles":[{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/controls/button/touch.json"},{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/controls/scroll/touch.json"}]},{"title":"Advanced Concepts","articles":[{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/touch/capturing.json"},{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/touch/releasing.json"}]}],"file":"build/guides/touch"} \ No newline at end of file +{"title":"Writing Touch Applications","sections":[{"title":"Introduction","articles":[{"content":"

A Brief Touch on Touches

\n\n

Some text goes here.

\n\n

Note that links like the below must appear on empty lines with no preceding whitespace.

\n\n

touch-demo.js

","errors":[],"demos":{"touch-demo.js":{"ex":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","highlighted":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get("frame");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set("layout", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: "white",\n childViews: "dot1 dot2".w(),\n dot1: Dot.design({\n backgroundColor: "red",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: "blue",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","original":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n"}},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"A Brief Touch on Touches","any":"metadata","goes":"Here","damn":"gruber","this":"is still eye-readable","and":"He is wrong about touch apps."},{"content":"

Touch Events

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Touch Events"}]},{"title":"Built-In Support","articles":[{"content":"

ButtonView Touch Support

","errors":[],"demos":{},"articleDirectory":"articles/controls/button/","outputDirectory":"build/","title":"ButtonView Touch Support"},{"content":"

ScrollView Touch Support

","errors":[],"demos":{},"articleDirectory":"articles/controls/scroll/","outputDirectory":"build/","title":"ScrollView Touch Support"}]},{"title":"Advanced Concepts","articles":[{"content":"

Capturing

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Capturing"},{"content":"

Releasing

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Releasing"}]}],"file":"build/guides/touch"} \ No newline at end of file diff --git a/apps/hedwig/resources/main_page.js b/apps/hedwig/resources/main_page.js index b9e5f69..9cd9bff 100644 --- a/apps/hedwig/resources/main_page.js +++ b/apps/hedwig/resources/main_page.js @@ -39,7 +39,17 @@ Hedwig.mainPage = SC.Page.design({ classNames: ["paper-view"], theme: "paper", childViews: "contentView topToolbar".w(), + + // update master hidden status since we are doing this manually... + masterIsHidden: NO, + masterIsHiddenDidChange: function() { + console.error("MHDC"); + this.topToolbar.set("masterIsHidden", this.get("masterIsHidden")); + }.observes("masterIsHidden"), + topToolbar: SC.ToolbarView.design(SC.Animatable, SC.FlowedLayout, { + masterIsHidden: NO, + layout: { top: 0, right: 0, left: 0, height: 44 }, style: { diff --git a/docs/build/articles/controls/button/touch.html b/docs/build/articles/controls/button/touch.html new file mode 100644 index 0000000..43ba784 --- /dev/null +++ b/docs/build/articles/controls/button/touch.html @@ -0,0 +1,92 @@ +Docs + + +

ButtonView Touch Support

+
\ No newline at end of file diff --git a/docs/build/articles/controls/button/touch.json b/docs/build/articles/controls/button/touch.json new file mode 100644 index 0000000..2f25de2 --- /dev/null +++ b/docs/build/articles/controls/button/touch.json @@ -0,0 +1 @@ +{"content":"

ButtonView Touch Support

","errors":[],"demos":{},"articleDirectory":"articles/controls/button/","outputDirectory":"build/","title":"ButtonView Touch Support"} \ No newline at end of file diff --git a/docs/build/articles/controls/button/touch.md b/docs/build/articles/controls/button/touch.md new file mode 100644 index 0000000..357d160 --- /dev/null +++ b/docs/build/articles/controls/button/touch.md @@ -0,0 +1,2 @@ +ButtonView Touch Support +======================== \ No newline at end of file diff --git a/docs/build/articles/controls/scroll/touch.html b/docs/build/articles/controls/scroll/touch.html new file mode 100644 index 0000000..9ae3fad --- /dev/null +++ b/docs/build/articles/controls/scroll/touch.html @@ -0,0 +1,92 @@ +Docs + + +

ScrollView Touch Support

+
\ No newline at end of file diff --git a/docs/build/articles/controls/scroll/touch.json b/docs/build/articles/controls/scroll/touch.json new file mode 100644 index 0000000..b522be3 --- /dev/null +++ b/docs/build/articles/controls/scroll/touch.json @@ -0,0 +1 @@ +{"content":"

ScrollView Touch Support

","errors":[],"demos":{},"articleDirectory":"articles/controls/scroll/","outputDirectory":"build/","title":"ScrollView Touch Support"} \ No newline at end of file diff --git a/docs/build/articles/controls/scroll/touch.md b/docs/build/articles/controls/scroll/touch.md new file mode 100644 index 0000000..a67f526 --- /dev/null +++ b/docs/build/articles/controls/scroll/touch.md @@ -0,0 +1,2 @@ +ScrollView Touch Support +========================= \ No newline at end of file diff --git a/docs/build/articles/touch/capturing.html b/docs/build/articles/touch/capturing.html new file mode 100644 index 0000000..f1a88bf --- /dev/null +++ b/docs/build/articles/touch/capturing.html @@ -0,0 +1,92 @@ +Docs + + +

Capturing

+
\ No newline at end of file diff --git a/docs/build/articles/touch/capturing.json b/docs/build/articles/touch/capturing.json new file mode 100644 index 0000000..d04803c --- /dev/null +++ b/docs/build/articles/touch/capturing.json @@ -0,0 +1 @@ +{"content":"

Capturing

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Capturing"} \ No newline at end of file diff --git a/docs/build/articles/touch/capturing.md b/docs/build/articles/touch/capturing.md new file mode 100644 index 0000000..d44cd90 --- /dev/null +++ b/docs/build/articles/touch/capturing.md @@ -0,0 +1,2 @@ +Capturing +========== \ No newline at end of file diff --git a/docs/build/articles/touch/releasing.html b/docs/build/articles/touch/releasing.html new file mode 100644 index 0000000..a72f829 --- /dev/null +++ b/docs/build/articles/touch/releasing.html @@ -0,0 +1,92 @@ +Docs + + +

Releasing

+
\ No newline at end of file diff --git a/docs/build/articles/touch/releasing.json b/docs/build/articles/touch/releasing.json new file mode 100644 index 0000000..406498f --- /dev/null +++ b/docs/build/articles/touch/releasing.json @@ -0,0 +1 @@ +{"content":"

Releasing

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Releasing"} \ No newline at end of file diff --git a/docs/build/articles/touch/releasing.md b/docs/build/articles/touch/releasing.md new file mode 100644 index 0000000..34b0adc --- /dev/null +++ b/docs/build/articles/touch/releasing.md @@ -0,0 +1,2 @@ +Releasing +========= \ No newline at end of file diff --git a/docs/build/articles/touch/touch-events.html b/docs/build/articles/touch/touch-events.html index 10a4860..374ec28 100644 --- a/docs/build/articles/touch/touch-events.html +++ b/docs/build/articles/touch/touch-events.html @@ -88,5 +88,5 @@
+

Touch Events

\ No newline at end of file diff --git a/docs/build/articles/touch/touch-events.json b/docs/build/articles/touch/touch-events.json index b802c01..7ed4f1b 100644 --- a/docs/build/articles/touch/touch-events.json +++ b/docs/build/articles/touch/touch-events.json @@ -1 +1 @@ -{"content":"","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/"} \ No newline at end of file +{"content":"

Touch Events

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Touch Events"} \ No newline at end of file diff --git a/docs/build/articles/touch/touch-events.md b/docs/build/articles/touch/touch-events.md index e69de29..b66a14f 100644 --- a/docs/build/articles/touch/touch-events.md +++ b/docs/build/articles/touch/touch-events.md @@ -0,0 +1,2 @@ +Touch Events +============= \ No newline at end of file diff --git a/docs/build/guides/touch.json b/docs/build/guides/touch.json index 781c43a..6bb2062 100644 --- a/docs/build/guides/touch.json +++ b/docs/build/guides/touch.json @@ -1 +1 @@ -{"title":"Writing Touch Applications","sections":[{"title":"Introduction","articles":[{"content":"

A Brief Touch on Touches

\n\n

Some text goes here.

\n\n

Note that links like the below must appear on empty lines with no preceding whitespace.

\n\n

touch-demo.js

","errors":[],"demos":{"touch-demo.js":{"ex":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","highlighted":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get("frame");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set("layout", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: "white",\n childViews: "dot1 dot2".w(),\n dot1: Dot.design({\n backgroundColor: "red",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: "blue",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","original":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n"}},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"A Brief Touch on Touches","any":"metadata","goes":"Here","damn":"gruber","this":"is still eye-readable","and":"He is wrong about touch apps."},{"content":"","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/"}]},{"title":"Built-In Support","articles":[{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/controls/button/touch.json"},{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/controls/scroll/touch.json"}]},{"title":"Advanced Concepts","articles":[{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/touch/capturing.json"},{"error":{"message":"No such file or directory","stack":"Error: No such file or directory\n at Object.readFileSync (fs:74:20)\n at Object.readFile (/Users/alex/.seeds/packages/core-support/0.2.1/lib/fs.js:348:37)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:9:27\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:22:48\n at Object.process (/Volumes/Docs/Work/web/hedwig/docs/hoo/lib/guide.js:30:38)\n at /Volumes/Docs/Work/web/hedwig/docs/hoo/bin/hoo-worker:55:17\n at Stream. (/Volumes/Docs/Work/web/hedwig/docs/hoo/packages/spawn/lib/spawn.js:63:25)\n at IOWatcher.callback (net:310:14)\n at node.js:818:9","errno":2},"file":"build/articles/touch/releasing.json"}]}],"file":"build/guides/touch"} \ No newline at end of file +{"title":"Writing Touch Applications","sections":[{"title":"Introduction","articles":[{"content":"

A Brief Touch on Touches

\n\n

Some text goes here.

\n\n

Note that links like the below must appear on empty lines with no preceding whitespace.

\n\n

touch-demo.js

","errors":[],"demos":{"touch-demo.js":{"ex":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","highlighted":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get("frame");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set("layout", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: "white",\n childViews: "dot1 dot2".w(),\n dot1: Dot.design({\n backgroundColor: "red",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: "blue",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n","original":"var Dot = SC.View.extend({\n touchStart: function(touch) {\n var f = this.get(\"frame\");\n this._touch = {\n start: { x: touch.pageX, y: touch.pageY },\n ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }\n };\n return YES; // or we won't get touchesDragged\n },\n \n touchesDragged: function(evt, touches) {\n var t = this._touch;\n this.set(\"layout\", { \n left: t.ourStart.x + evt.pageX - t.start.x,\n top: t.ourStart.y + evt.pageY - t.start.y,\n width: t.ourStart.width,\n height: t.ourStart.height\n });\n }\n});\nvar MyExampleView = SC.View.extend({\n backgroundColor: \"white\",\n childViews: \"dot1 dot2\".w(),\n dot1: Dot.design({\n backgroundColor: \"red\",\n layout: { left: 10, top: 10, width: 100, height: 100 }\n }),\n dot2: Dot.design({\n backgroundColor: \"blue\",\n layout: { right: 10, bottom: 10, width: 100, height: 100 }\n })\n});\n\n// bootstrap code :)\nexports.getDemoView = function() {\n return MyExampleView;\n};\n"}},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"A Brief Touch on Touches","any":"metadata","goes":"Here","damn":"gruber","this":"is still eye-readable","and":"He is wrong about touch apps."},{"content":"

Touch Events

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Touch Events"}]},{"title":"Built-In Support","articles":[{"content":"

ButtonView Touch Support

","errors":[],"demos":{},"articleDirectory":"articles/controls/button/","outputDirectory":"build/","title":"ButtonView Touch Support"},{"content":"

ScrollView Touch Support

","errors":[],"demos":{},"articleDirectory":"articles/controls/scroll/","outputDirectory":"build/","title":"ScrollView Touch Support"}]},{"title":"Advanced Concepts","articles":[{"content":"

Capturing

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Capturing"},{"content":"

Releasing

","errors":[],"demos":{},"articleDirectory":"articles/touch/","outputDirectory":"build/","title":"Releasing"}]}],"file":"build/guides/touch"} \ No newline at end of file diff --git a/docs/src/articles/controls/button/touch.md b/docs/src/articles/controls/button/touch.md new file mode 100644 index 0000000..357d160 --- /dev/null +++ b/docs/src/articles/controls/button/touch.md @@ -0,0 +1,2 @@ +ButtonView Touch Support +======================== \ No newline at end of file diff --git a/docs/src/articles/controls/scroll/touch.md b/docs/src/articles/controls/scroll/touch.md new file mode 100644 index 0000000..a67f526 --- /dev/null +++ b/docs/src/articles/controls/scroll/touch.md @@ -0,0 +1,2 @@ +ScrollView Touch Support +========================= \ No newline at end of file diff --git a/docs/src/articles/touch/capturing.md b/docs/src/articles/touch/capturing.md new file mode 100644 index 0000000..d44cd90 --- /dev/null +++ b/docs/src/articles/touch/capturing.md @@ -0,0 +1,2 @@ +Capturing +========== \ No newline at end of file diff --git a/docs/src/articles/touch/releasing.md b/docs/src/articles/touch/releasing.md new file mode 100644 index 0000000..34b0adc --- /dev/null +++ b/docs/src/articles/touch/releasing.md @@ -0,0 +1,2 @@ +Releasing +========= \ No newline at end of file diff --git a/docs/src/articles/touch/touch-events.md b/docs/src/articles/touch/touch-events.md index e69de29..b66a14f 100644 --- a/docs/src/articles/touch/touch-events.md +++ b/docs/src/articles/touch/touch-events.md @@ -0,0 +1,2 @@ +Touch Events +============= \ No newline at end of file