Button Cloud Example ('-' * 20)
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
// individual row | |
App.Models.TableRow = Backbone.Model.extend({ | |
referenceSelf: function() { | |
return this; | |
}, | |
initialize: function() { | |
var self = this.referenceSelf(), |
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
<audio id="kablam!"> | |
<source src="/assets/kablam.mp3" type="audio/mpeg"> | |
</audio> | |
<button id="playSoundBtn">Kablam!</button> |
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
<form action="/api/photo" method="post"></form> | |
<h3>Upload Image</h3> | |
<input type="file" name="image" class="mui-form-control"> | |
<button class="mui-btn mui-btn-primary mui-btn-raised">My Button</button> | |
</form> |
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
<script type="text/javascript"> | |
$(document).ready(function(event) { | |
// select our input DOM element with a type of file | |
var fileInput = $('input[type="file"]')[0]; | |
// select our form, too | |
var form = $('form')[0]; | |
// prevent our form from submitting via POSTBACK | |
$(form).on('submit', function(event) { |
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
/** | |
* convertToBase64 | |
* @param binaryData: Input data from an <input type="file"> | |
*/ | |
function convertToBase64(binaryData) { | |
// use a FileReader | |
// https://developer.mozilla.org/en-US/docs/Web/API/FileReader | |
var reader = new FileReader(); | |
reader.onload = function (event) { | |
// try to read whatever file has been 'readAsDataURL' |
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
// prevent our form from submitting via POSTBACK | |
$(form).on('submit', function(event) { | |
event.preventDefault(); | |
var fileAsBase64 = convertToBase64($(fileInput).prop('files')[0]) | |
// now, you can sent your file over via an $ajax call! | |
}); |
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
## Diagram a Database | |
- Owners HAVE MANY Pets | |
- Pets HAVE ONE Owner | |
- Pets and Owners have ONE Home | |
- Owners have: | |
- ID (int) as Primary Key | |
- Name (string) | |
- PetID (int) as Foreign Key |
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
## Diagram a Database | |
- Owners HAVE MANY Pets | |
- Pets HAVE ONE Owner | |
- Pets and Owners have ONE Home | |
- Owners have: | |
- ID (int) as Primary Key | |
- Name (string) | |
- PetID (int) as Foreign Key |