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
function(scene, options){ | |
var opts = tools.mixin({ | |
folder: 'textures/skybox/default/', | |
filetype: 'png', | |
size: 1000000 | |
}, options || {}); | |
var urls = []; | |
['x','y','z'].forEach(function(axis){ |
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
onModelLoaded: function(collada){ | |
var object = collada.scene; | |
// some stuff here | |
var mesh = object.children.filter(function(child){ | |
return child instanceof THREE.Mesh; | |
})[0]; | |
object.geometry = mesh.geometry; |
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
// modify this: | |
} else if ( object instanceof THREE.Mesh ) { | |
// to: | |
} else if ( object.matrixWorld && object.geometry ) { |
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 onsuccess = function(){ | |
console.log('now the store is clean again!'); | |
} | |
var onerror = function(error){ | |
console.log('Oh noes, sth went wrong!', error); | |
} | |
customers.clear(onsuccess, onerror); |
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 id = 1; | |
var onsuccess = function(result){ | |
if(result !== false){ | |
console.log('deletion successful!'); | |
} | |
} | |
var onerror = function(error){ | |
console.log('Oh noes, sth went wrong!', error); | |
} |
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 onsuccess = function(data){ | |
console.log('Here is what we have in store ('+data.length+' items in total):'); | |
data.forEach(function(item){ | |
console.log(item); | |
}); | |
} | |
var onerror = function(error){ | |
console.log('Oh noes, sth went wrong!', error); | |
} |
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 updatedDude = { | |
id: 1, // or whatever id our dude has | |
firstname: 'John', | |
lastname: 'Doe', | |
age: 53, // dude is now a year older | |
emails: [ | |
'johndoe@example.com', | |
'jd@example.com' | |
] | |
}; |
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 dude = { | |
firstname: 'John', | |
lastname: 'Doe', | |
age: 52, | |
emails: [ | |
'johndoe@example.com', | |
'jd@example.com' | |
] | |
}; |
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 id = 1; // Or whatever you got returned. | |
var onsuccess = function(data){ | |
console.log('here is our dude:', data); | |
} | |
var onerror = function(error){ | |
console.log('Oh noes, sth went wrong!', error); | |
} | |
customers.get(id, onsuccess, onerror); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>IDBWrapper Tutorial, Step 1</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="IDBStore.js"></script> | |
<script type="text/javascript" src="tutorial.js"></script> | |
</body> | |
</html> |