38. COFFEESCRIPT
foods =
miso: 4
teriyaki: 6
sushi: 12
condiments = (food.sauce for food of foods)
price = (if sushi then 12 else 4)
fetch chopsticks if food isnt miso
fetch chopsticks unless food is miso
#html5best - @mahemoff - Intel AppUp - MWC
39. JADE
!!! 5
html(lang="en")
head
title= pageTitle
script(type='text/javascript')
if (foo) {
bar()
}
body
h1 Jade - node template engine
#container
- if (youAreUsingJade)
p You are amazing
- else
p Get on it!
#html5best - @mahemoff - Intel AppUp - MWC
64. Logged in?
Show name
Allowed to Managing your
rate? page?
Show thumbs Show edit controls
Leaving a comment?
Show textarea
The Problem: Display Logic
#html5best - @mahemoff - Intel AppUp - MWC
65. function startEditing() {
$(‘.titleInput’).show();
$(‘.mixPanel’).slideDown();
$(‘.comments’).fadeOut();
}
function stopEditing() {
$(‘.titleInput’).hide();
$(‘.mixPanel’).slideUp();
$(‘.comments’).fadeIn();
}
The Problem: Display Logic
#html5best - @mahemoff - Intel AppUp - MWC