This file contains hidden or 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
//code works on http://ast.codingthehumanities.com | |
var wishesButton = "<button type='button'>Click here for best wishes</button>" | |
$(".assignment").find("h1").append(wishesButton); | |
$('.assignment').on("click", "button", function() { | |
var message = ("<p>Good Luck!</p>"); | |
$(this).after(message); | |
$(this).remove(); |
This file contains hidden or 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 studentsTemplate2 ='<script id="students-template2" type="text/x-handlebars-template"><table><thead><th>Student Name</th><th>Special Skill</th><th>Email</th><th>Level</th></thead><tbody>{{#students2}}<tr><td>{{name}}</td><td>{{specialskill}}</td><td>{{email}}</td><td>{{level}}</td></tr>{{/students2}}</tbody></table></script>'; | |
$(".content").append(studentsTemplate2); | |
var studentTemplateScript2 = $("#students-template2").html(); | |
var theStudentTemplate2 = Handlebars.compile(studentTemplateScript2); | |
var data2 = { students2: [ | |
{name: "Goku", specialskill: "Spirit Bomb", email: "[email protected]", level: "Over 9000" }, |
This file contains hidden or 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 chartTitle = '<h2>Events and ratings</h2>' | |
$('.main').append(chartTitle) | |
var eventsJSON = localStorage.getItem('assignment'); | |
var data = JSON.parse(eventsJSON).events; | |
var events = data; | |
var w = 800 | |
var h = 300 | |
var barPadding = 5 |
This file contains hidden or 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 chartTitle = '<h2>Dutch Olympic Medals from 2000 to 2014</h2>' | |
$('.main').append(chartTitle) | |
var dataSource = '<p>Source: https://en.wikipedia.org/wiki/Netherlands_at_the_Olympics</p>' | |
$('body').append(dataSource) | |
var legend = '<p style="color:orange;font-size:20px;"> - Summer Games</p><p style="color:darkblue;font-size:20px;"> - Winter Games</p>' | |
$('body').append(legend) | |
d3.json( 'https://assignmentdata.firebaseio.com/.json', | |
function (assignmentdata){; |
This file contains hidden or 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
//implement the necessary firebase script | |
$('head').append("<script src='https://cdn.firebase.com/v0/firebase.js'></script>") | |
--------------------------------------------------- | |
//making and implementing the form | |
var inputs = "<input type='text' id='nameInput' placeholder='Olympic Game'><input type='number' id='medalsInput' placeholder='Medals total'><input type='checkbox' id='boolInput' placeholder='Summer Games'><label for='boolInput'>Summer Games</label><button type='submit' class='submit'>Submit</button>" | |
var firebaseData = new Firebase("https://assignment5.firebaseio.com"); |
This file contains hidden or 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
$(".assignment").find("h1").text('Assignment (click me!)'); | |
$('.assignment').on('click', "h1", function() { | |
var message = ('<p>Good Luck!</p>'); | |
$('.assignment').append(message); }); |
This file contains hidden or 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 studentsTemplate ='<script id="students-template" type="text/x-handlebars-template"><table><thead><th>Student Name</th><th>Special Skill</th><th>Email</th></thead><tbody>{{#students}}<tr><td>{{name}}</td><td>{{specialskill}}</td><td>{{email}}</td></tr>{{/students}}</tbody></table></script>'; | |
$(".content").append(studentsTemplate); | |
var studentTemplateScript = $("#students-template").html(); | |
var theStudentTemplate = Handlebars.compile(studentTemplateScript); | |
var data = { students: [ | |
{name: "Goku", specialskill: "Spirit Bomb", email: "[email protected]" }, |
This file contains hidden or 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 chartTitle = '<h2>Events and ratings</h2>' | |
$('.main').append(chartTitle) | |
var events = [ | |
{"name":"veniam ","rating":2,"ficticious":false}, | |
{"name":"consequat ","rating":2,"ficticious":true}, | |
{"name":"Excepteur reprehenderit ","rating":1,"ficticious":true}, | |
{"name":"ea ","rating":2,"ficticious":false}, | |
{"name":"sed ","rating":2,"ficticious":true}, | |
{"name":"sunt Ut ","rating":3,"ficticious":true}, |
This file contains hidden or 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
d3.json( 'https://assignmentdata.firebaseio.com/.json', | |
function (assignmentdata){; | |
var margin = { top: 20, right: 20, bottom: 20, left: 40 }; | |
var w = 800 - margin.left - margin.right; | |
var h = 500 - margin.top - margin.bottom; | |
var chartHeight = 400; | |
var barPadding = 5 | |
var medals = function(d) { return d.medals * 30}; |
This file contains hidden or 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
$('head').append("<script src='https://cdn.firebase.com/v0/firebase.js'></script>") | |
--------------------------------------------------- | |
var inputs = "<form><input type='text' id='nameInput' placeholder='Olympic Game'><input type='number' id='medalsInput' placeholder='Medals total'><input type='checkbox' id='boolInput' placeholder='Summer Games'><label for='boolInput'>Summer Games</label><button type='submit' class='submit'>Submit</button></form>" | |
var firebaseData = new Firebase("https://assignment5.firebaseio.com"); | |
var allData = null; | |
var allDataCount = 0; |
OlderNewer