Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of https://github.com/mozilla/towtruck
Conflicts:
	app/http/views/layout.ejs
	app/http/views/site/about.ejs
	app/http/views/towtruck/interface.html
  • Loading branch information
aarondruck committed Mar 13, 2013
2 parents f6f8799 + cbc289b commit f0fa698
Show file tree
Hide file tree
Showing 31 changed files with 1,292 additions and 597 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,3 +3,4 @@ node_modules
.env*
addon/Profile
dump.rdb
app/http/public/recorder.css
57 changes: 28 additions & 29 deletions app/http/public/application.js
Expand Up @@ -3,35 +3,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

$(function(){
navigator.id.watch({
loggedInUser: currentUser,
onlogin: function(assertion) {
$.ajax({
type: 'POST',
url: '/persona/verify',
data: {assertion: assertion},
success: function(res, status, xhr) {
window.location.reload();
},
error: function(xhr, status, err) { alert("Login failure: " + err); }
});
},
onlogout: function() {
// A user has logged out! Here you need to:
// Tear down the user's session by redirecting the user or making a call to your backend.
// Also, make sure loggedInUser will get set to null on the next page load.
// (That's a literal JavaScript null. Not false, 0, or undefined. null.)
$.ajax({
type: 'POST',
url: '/persona/logout',
success: function(res, status, xhr) {
window.location.reload();
},
error: function(xhr, status, err) { alert("Logout failure: " + err); }
});
}
});

$("#login").click(function(){
navigator.id.request();
return false;
Expand All @@ -41,4 +12,32 @@ $(function(){
navigator.id.logout();
return false;
});

$("#year").text((new Date).getFullYear());

$('.carousel').carousel({
interval: 0
});

var cursorPositions = [
{top: 150, left: 50},
{top: 340, left: 160},
{top: 220, left: 190},
{top: 90, left: 80}
];

var animateCursor = function(){
var cursor = $('#towtruck_demo_cursor');
var position = cursorPositions.pop();
cursorPositions.unshift(position);
cursor.animate(position, 'slow', function(){
setTimeout(animateCursor, 900);
});
};

animateCursor();

$('.copy-input').click(function(){
$(this).select();
});
});
17 changes: 12 additions & 5 deletions app/http/public/example/form.html
Expand Up @@ -74,11 +74,14 @@ <h1>Form Example</h1>


<div>
<label for="about">
The Cat In The Hat, or the Cat In The Hat Comes Back: which is
better, in essay form:
</label>
<textarea style="width: 100%; height: 10em" placeholder="There's no wrong answer! Except you must choose one."></textarea>
<button id="about-toggle" type="button">Essay (+)</button>
<div id="about-group" style="display: none">
<label for="about">
The Cat In The Hat, or the Cat In The Hat Comes Back: which is
better, in essay form:
</label>
<textarea style="width: 100%; height: 10em" placeholder="There's no wrong answer! Except you must choose one."></textarea>
</div>
</div>

<div>
Expand Down Expand Up @@ -117,7 +120,11 @@ <h1>Form Example</h1>
<!--<script src="bootstrap/js/bootstrap-carousel.js"></script>-->
<!--<script src="bootstrap/js/bootstrap-typeahead.js"></script>-->

<script>
TowTruck = {cloneClicks: "#about-toggle"};
</script>
<script src="/towtruck.js"></script>
<script src="startup.js"></script>
<script src="form.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions app/http/public/example/form.js
@@ -0,0 +1,11 @@
$(function () {
$("#about-toggle").click(function () {
if ($("#about-group").is(":visible")) {
$("#about-group").hide();
$("#about-toggle").text("Essay (+)");
} else {
$("#about-group").show();
$("#about-toggle").text("Essay (-)");
}
});
});
2 changes: 1 addition & 1 deletion app/http/public/example/index.html
Expand Up @@ -36,7 +36,7 @@
<li><a href="code.html">Code Editor</a></li>
<li><a href="form.html">Form</a></li>
<li><a href="docs.html">Docs</a></li>
<li><a id="start-towtruck" href="#" title="Start TowTruck; work on this page with a friend!"><img src="/images/icn-logo.png" style="height: 25px;"></a></li>
<li><button class="btn btn-info btn-small" id="start-towtruck" href="#" title="Start TowTruck; work on this page with a friend!"><img src="/images/icn-logo.png" style="height: 25px;">Call for Help</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions app/http/public/recorder.html
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TowTruck recorder</title>
<script>
// FIXME: need to make this dynamic:
defaultHubBase = "";
baseUrl = (location.href + "").replace(/\/recorder\.html.*/, "");
// FIXME: this is copied from towtruck.js:
require = {
context: "towtruck",
baseUrl: baseUrl + "/towtruck",
urlArgs: "bust=" + Date.now(),
paths: {
jquery: "libs/jquery-1.8.3.min",
walkabout: "libs/walkabout.js/walkabout",
tinycolor: "libs/tinycolor",
"alien-avatar-generator": "libs/alien-avatar-generator"
},
deps: ["recorder"],
callback: function () {
require({context: "towtruck"})(["recorder"], function (recorder) {
recorder.start({
baseUrl: baseUrl,
defaultHubBase: defaultHubBase
});
});
}
};
console.log("require", require);
</script>
<script src="./towtruck/libs/require.js"></script>
<link rel="stylesheet" href="recorder.css">
</head>
<body>

<div id="connection-status">
<span id="not-connected" data-toggles="#connection-status span">Not Connected</span>
<span id="connected" data-toggles="#connection-status span" style="display: none">Connected</span>
<span id="no-session-id" data-toggles="#connection-status span" style="display: none">There's no <code>#&amp;towtruck=SESSION_ID</code> in the URL.</span>
<button id="restart">Restart recording</button>
<button id="select">Select record</button>
</div>

<div>
<textarea id="record">/* TowTruck session starts */

</textarea>
</div>


</body>
</html>
17 changes: 17 additions & 0 deletions app/http/public/recorder.less
@@ -0,0 +1,17 @@
body {
font-family: sans-serif;
}

#record {
width: 100%;
height: 80%;
}

#connected {
font-weight: bold;
color: #090;
}

#not-connected {
color: #900;
}

0 comments on commit f0fa698

Please sign in to comment.