JSFiddle - React, Tailwind, and code Playground
by zdfs
HTML
<script src="https://dl.dropbox.com/u/2877180/Fiddles/handlebars.js"></script>
<script src="https://dl.dropbox.com/u/2877180/Fiddles/ember.js"></script>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Omega</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="css/style.css?v=2">
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<!-- Application View -->
<script type="text/x-handlebars" data-template-name="omega">
{{view Omega.ToolbarView controllerBinding="controller.controllers.toolbarController"}}
<div class="content">
{{outlet}}
</div>
</script>
<!-- Toolbar View -->
<script type="text/x-handlebars" data-template-name="toolbar">
<div class="header">
<ul>
<li><a {{action goHome}} class="waiting-room-trig">Waiting Room</a></li>
<li><a {{action viewWebcam}} class="webcam-trig">Webcam</a></li>
<li><a {{action viewScreen}} class="screenshare-trig">Screenshare</a></li>
</ul>
</div>
</script>
<!-- Waiting Room View -->
<script type="text/x-handlebars" data-template-name="waiting-room">
<h1>Waiting Room</h1>
</script>
<!-- Webcam View -->
<script type="text/x-handlebars" data-template-name="webcam">
<div class="webcam" style="border:1px solid black; height: 200px;">
Webcams
</div>
...
CSS
/* ==== Scroll down to find where to put your styles :) ==== */
/* HTML5 ✰ Boilerplate */
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
blockquote, q { quotes: none; }
blockquote:before, blockquote:after,
q:before, q:after { content: ''; content: none; }
ins { background-color: #ff9; color: #000; text-decoration: none; }
mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
del { text-decoration: line-through; }
abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
table { border-collapse: collapse; border-spacing: 0; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
input, select { vertical-align: middle; }
body { font:13px/1.231 sans-serif; *font-size:small; }
select, input, textarea, button { font:99% sans-serif; }
pre, code, kbd, samp { font-family: monospace, sans-serif; }
html { overflow-y: scroll; }
a:hover, a:active { outline: none; }
ul, ol { margin-left: 2em; }
ol { list-style-type: decimal; }
nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
small { font-size: 85%; }
strong, th { font-weight: bold; }
td { vertical-align: top; }
sub, sup { font-size: 75%; line-height: 0; position: relative; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; }
textarea { overflow:...
JavaScript
// ******************************************
// Create The Ember Application
// ******************************************
Omega = Em.Application.create();
// ******************************************
// Transition Mixins
// ******************************************
Omega.transitionSpeed = 150;
Omega.FadeTransition = Em.Mixin.create({
didInsertElement: function () {
//Ember.Logger.log('didInsertElement', this.$());
return this.$().hide().fadeIn(Omega.transitionSpeed);
},
transitionIn: function () {
//Ember.Logger.log('transitionIn', this.$());
return this.$().hide().fadeIn(Omega.transitionSpeed);
},
transitionOut: function () {
//Ember.Logger.log('transitionOut', this.$());
return this.$().fadeOut(Omega.transitionSpeed);
}
});
Omega.SlideTransition = Em.Mixin.create({
didInsertElement: function () {
//Ember.Logger.log('didInsertElement', this.$());
return this.$().hide().slideDown(Omega.transitionSpeed);
},
transitionIn: function () {
//Ember.Logger.log('transitionIn', this.$());
return this.$().hide().slideDown(Omega.transitionSpeed);
},
transitionOut: function () {
//Ember.Logger.log('transitionOut', this.$());
return this.$().slideUp(Omega.transitionSpeed);
}
});
// ******************************************
// Initialize Controllers
// ******************************************
Omega.ApplicationController = Em.Controller.extend();
Omega.ToolbarController = Em.Controller.extend();
Omega.HomeController = Em.Controller.extend();
Omega.WebcamController = Em.Controller.extend();
Omega.ScreenshareController = Em.Controller.extend();
Omega.ProfileController = Em.Controller.extend();
Omega.PostsController = Em.Controller.extend();
Omega.PhotosController = Em.Controller.extend();
Omega.ApplicationView = Em.View.extend({ templateName: "omega" });
Omega.ToolbarView ...