-
-
Save swannodette/73067 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(); | |
}, | |
build: function() | |
{ | |
this.loadJSON(); | |
console.log('cool2'); | |
}, | |
loadJSON : function() | |
{ | |
var buildInterface = function(images) { | |
var gallery = $('gallery'); | |
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> printing images'); | |
console.log(images); | |
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) { | |
console.log(jsonObj); // changed by David | |
buildInterface(jsonObj.TestTwo); | |
} | |
}).send(); | |
} | |
}); | |
var TestTwo = new TestTwoSpace(TestTwoShift); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment