Permalink
Browse files

Keep on swimming, keep, on swimming, keep on swimming swimming swimmi…

…ng...
  • Loading branch information...
1 parent 89a2099 commit 922f4c14a676394477bdab4b719a907a78c0955c @ialexi ialexi committed Apr 16, 2010
@@ -15,6 +15,10 @@ Hedwig.articleController = SC.ObjectController.create(
contentBinding: "Hedwig.guideBrowserController.selection",
contentBindingDefault: SC.Binding.single(),
+ html: function() {
+ return "<div class='article'>" + (this.get("contents") || "") + "</div>";
+ }.property("contents").cacheable(),
+
toolbarShouldShow: YES,
toggleToolbar: function() {
this.set("toolbarShouldShow", !this.get("toolbarShouldShow"));
@@ -27,9 +31,5 @@ Hedwig.articleController = SC.ObjectController.create(
replacementFor: function(href) {
return "<div class='hedwig-demo' href='" + href + "' style=''></div>";
- },
-
- openDemo: function(href) {
- console.error("DEMO: " + href);
}
}) ;

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -184,7 +184,7 @@ Hedwig.mainPage = SC.Page.design({
contentView: SC.ScrollView.design({
borderStyle: SC.BORDER_NONE,
contentView: SC.StaticContentView.design({
- contentBinding: "Hedwig.articleController.contents",
+ contentBinding: "Hedwig.articleController.html",
contentDidChange: function() {
sc_super();
this.invokeLater("processContent", 1);

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,180 +1,37 @@
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
+var Dot = SC.View.extend({
+ touchStart: function(touch) {
+ var f = this.get("frame");
+ this._touch = {
+ start: { x: touch.pageX, y: touch.pageY },
+ ourStart: { x: f.x, y: f.y, width: f.width, height: f.height }
+ };
+ return YES; // or we won't get touchesDragged
+ },
+
+ touchesDragged: function(evt, touches) {
+ var t = this._touch;
+ this.set("layout", {
+ left: t.ourStart.x + evt.pageX - t.start.x,
+ top: t.ourStart.y + evt.pageY - t.start.y,
+ width: t.ourStart.width,
+ height: t.ourStart.height
+ });
+ }
+});
+var MyExampleView = SC.View.extend({
+ backgroundColor: "white",
+ childViews: "dot1 dot2".w(),
+ dot1: Dot.design({
+ backgroundColor: "red",
+ layout: { left: 10, top: 10, width: 100, height: 100 }
+ }),
+ dot2: Dot.design({
+ backgroundColor: "blue",
+ layout: { right: 10, bottom: 10, width: 100, height: 100 }
+ })
});
// bootstrap code :)
exports.getDemoView = function() {
return MyExampleView;
};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-
-var MyExampleView = SC.View.extend({
- backgroundColor: "red"
-});
-
-// bootstrap code :)
-exports.getDemoView = function() {
- return MyExampleView;
-};
-

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 922f4c1

Please sign in to comment.