Skip to content

Commit

Permalink
Working version of progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
jwswj committed Nov 6, 2011
1 parent c47d1a1 commit ce87291
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 4 deletions.
Binary file added public/css/burgues_script-webfont.eot
Binary file not shown.
224 changes: 224 additions & 0 deletions public/css/burgues_script-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/burgues_script-webfont.ttf
Binary file not shown.
Binary file added public/css/burgues_script-webfont.woff
Binary file not shown.
46 changes: 46 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@font-face {
font-family: 'BurguesScriptRegular';
src: url('burgues_script-webfont.eot');
src: url('burgues_script-webfont.eot?#iefix') format('embedded-opentype'),
url('burgues_script-webfont.woff') format('woff'),
url('burgues_script-webfont.ttf') format('truetype'),
url('burgues_script-webfont.svg#BurguesScriptRegular') format('svg');
font-weight: normal;
font-style: normal;

}

em {
font-style: italic;
}
strong {
font-weight: bold;
}

/* Links */
a {
color: #574319;

}

/* Main Section */
html {
background: #F4F1ED;
text-align: center;
color: #574319;
}

h1 {
font-size: 44px;
line-height: 40px;
font-family: 'BurguesScriptRegular', sans-serif;
text-indent: 30px;
position: relative;
}


#contentWrapper {
width: 620px;
margin-left: 190px;
text-align: left;
}
4 changes: 4 additions & 0 deletions public/js/jquery.min.js

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions public/js/jquery.transloadit2.js

Large diffs are not rendered by default.

File renamed without changes.
44 changes: 41 additions & 3 deletions views/fake.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
<h1>Pretend to post a photo</h1>

<form id="photo" name="photo" method="post" action="/fake">
<script type="text/javascript" src="//assets.transloadit.com/js/jquery.transloadit2.js"></script>
<script type="text/javascript">
// We call .transloadit() after the DOM is initialized:
$(document).ready(function() {
// Don't forget this goes inside your document.ready
$('#newpicture').transloadit({
modal: false,
autoSubmit: false,
wait: true,
onProgress: function(bytesReceived, bytesExpected) {
// render your own progress bar!
$('#progress')
.text((bytesReceived / bytesExpected * 100).toFixed(2)+'%');
},
onError: function(assembly) {
alert(assembly.error+': '+assembly.message);
},
onSuccess: function(assembly) {
console.log(assembly);
}
});
// Event handler to submit form
$('#button').click(function(){
$('#newpicture').submit();
return false;
});
});
</script>

<div id="progress"></div>

<form id="newpicture" name="newpicture" method="POST" action="http://api2.transloadit.com/assemblies" enctype="multipart/form-data">
<input type="hidden" name="params" value="{&quot;auth&quot;:{&quot;key&quot;:&quot;121f5af949ab45b6a29924e5aa4e9520&quot;},&quot;template_id&quot;:&quot;0a31cdf7aa7b4acfa1508da329d0075d&quot;,&quot;redirect_url&quot;:&quot;/fake&quot;}" />
<label for="name">Name</label>
<input id="name" name="name" type="text">
<input id="name" name="name" type="text" value="SianJason">
<label for="photo">Photo</label>
<input id="photo" type="file" name="photo">
<label for="caption">Caption</label>
<input id="caption" name="caption" type="text">
<button type="submit">Add</button>
</form>
</form>
<a id="button" href="">Submit form</a>
2 changes: 1 addition & 1 deletion views/layout.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title>Sian & Jason's Wedding 11-11-11</title>
<title>Weddings Pics</title>

<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
Expand Down

0 comments on commit ce87291

Please sign in to comment.