-
-
Save swannodette/73066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TestTwoSpace = ShiftSpace.Space.extend({ | |
attributes: { | |
name: 'TestTwo', | |
icon: 'TestTwo.png' | |
} | |
}); | |
var TestTwoShift = ShiftSpace.Shift.extend({ | |
setup: function(json) { | |
console.log("Setup test two shift"); | |
this.build(); | |
this.save(); | |
// this.manageElement(this.element); | |
// this.makeDraggable(); | |
}, | |
build: function() { | |
this.loadJSON(); | |
console.log('cool2'); | |
}, | |
loadJSON : function(){ | |
var buildInterface = function(images){ | |
var gallery = $('gallery'); | |
images.each(function(image) { | |
var el = new ShiftSpace.Element('div', {'class': 'preview'}); | |
var name = new ShiftSpace.Element('h3').setHTML(image.name).injectInside(el); | |
var img = new ShiftSpace.Element('img', {'src': + image.src}).injectAfter(name); | |
console.log('cool3'); | |
el.inject(gallery); | |
console.log('cool4'); | |
}); | |
} | |
var url = 'http://localhost/~clintnewsom/shiftspace/spaces/TestTwo/TestTwo_data.js'; | |
var request = new Json.Remote(url, { | |
onComplete: function(jsonObj) { | |
buildInterface(jsonObj.previews); | |
} | |
}).send(); | |
} | |
/* | |
makeDraggable : function(){ | |
this.element.makeDraggable({ | |
'onComplete': function() { | |
this.save(); | |
}.bind(this) | |
}); | |
} | |
// encode: function() { | |
// var pos = this.element.getPosition(); | |
// return { | |
//summary: this.messageValue, | |
//message: this.messageValue, | |
// position: pos | |
// }; | |
// } | |
*/ | |
}); | |
var TestTwo = new TestTwoSpace(TestTwoShift); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment