<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.js"></script>
<script src="http://builds.emberjs.com.s3.amazonaws.com/tags/v1.4.0/ember.js"></script>
<script type="text/javascript" src="https://rawgithub.com/endlessinc/ember-restless/master/dist/ember-restless.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="main">
<script type="text/x-handlebars" id="application">
<h2>Application Template</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" id="index">
{{#link-to 'new_activity'}}New Activity{{/link-to}}
{{#link-to 'activities'}}All Activities{{/link-to}}
</script>
<script type="text/x-handlebars" id="edit_activity">
<form id="edit-activity-form" role="form" {{action update on="submit"}}>
<div class="row">
{{form-input label="Progress" id="progress" value=progress type="text" sizeClass="col-md-12" errors=errors.progress}}
</div>
<div class="row">
<label class="control-label">Template</label><br>
{{view Ember.Select
id="ActivityType"
prompt=' - Select Template - '
contentBinding="App.ActivityTypeController"
selectionBinding="activityType"
optionValuePath="content.key"
optionLabelPath="content.displayName"
class="form-control"
}}
</div>
<div class="row">
{{form-input label="Title" id="title" value=title type="text" sizeClass="col-md-12" errors=errors.title}}
</div>
<div class="row">
{{form-input label="Subject Code" id="subjectCode" value=subjectCode sizeClass="col-md-12" errors=errors.subjectCode}}
</div>
<div class="row">
{{form-input label="Activity Code" id="activityCode" value=activityCode sizeClass="col-md-12" errors=errors.activityCode}}
</div>
<div class="row">
{{!-- this should be a select box --}}
{{form-input label="Workflow Status" id="workflowStatus" value=workflowStatus sizeClass="col-md-12" errors=errors.workflowStatus}}
</div>
{{outlet edit}}
</script>
<script type="text/x-handlebars" id="form-input">
<div {{bind-attr class=":form-group sizeClass errors:has-error" }}>
<label class="control-label" {{bind-attr for="inputId"}}>{{label}}</label><br>
{{input
id=inputId
value=value
type=type
class="form-control"
}}
<span class="help-block">{{errors}}</span>
</div>
</script>
<script type="text/x-handlebars" id="activities_table">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Activities</h3>
</div>
<table class="table table-hover table-striped">
<tr>
<th>Id</th>
<th>Title</th>
<th>Activity Code</th>
<th></th>
</tr>
{{#each}}
<tr>
<td>{{id}}</td>
<td>{{title}}</td>
<td>{{activityCode}}</td>
<td>
<div class="row">
<div class="col-md-4">
{{#link-to "activity" this classNames='btn btn-info' role='button'}}<span class="glyphicon glyphicon-info-sign"></span> View{{/link-to}}
</div>
<div class="col-md-4">
{{#link-to "edit_activity" this classNames='btn btn-primary btn-md' role='button'}}<span class="glyphicon glyphicon-edit"></span> Edit{{/link-to}}
</div>{{!--
<div class="col-md-4">
<button class="btn btn-danger" {{action "destroy" this}}><span class="glyphicon glyphicon-remove"></span> Delete</button>
</div> --}}
</div>
</td>
</tr>
{{/each}}
</table>
<div class="panel-footer">
{{#link-to 'new_activity' classNames='btn btn-primary btn-md' role='button'}}
<span class="glyphicon glyphicon-plus"></span> New Activity
{{/link-to}}
</div>
</div>
</script>
<script type="text/x-handlebars" id="EditIntroduction">
<h2>{{heading}}</h2>
</script>
<script type="text/x-handlebars" id="EditInteractive">
<h2>{{heading}}</h2>
</script>
<script type="text/x-handlebars" id="NoActivityType">
<p><em>Please select a template to continue editing the activity.</em></p>
</script>
</div>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |