Skip to content

Commit

Permalink
Added renamed Cornish to Instapoppin'.
Browse files Browse the repository at this point in the history
  • Loading branch information
toolness committed Oct 15, 2011
1 parent c175fed commit e678d85
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cornish Test</title>
<title>Instapoppin' Test</title>
<script src="popcorn.min.js"></script>
<script src="cornish.js"></script>
<script src="instapoppin.js"></script>
<style>
div.subtitles {
position: relative;
Expand Down
14 changes: 7 additions & 7 deletions cornish.js → instapoppin.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* cornish.js version 0.1
* instapoppin.js version 0.1
*
* Copyright 2011, Mozilla Foundation
* Licensed under the MIT license
*/

var Cornish = (function() {
var Instapoppin = (function() {
var activateOnLoad = true;

function ParseError(message) { this.message = message; }
Expand Down Expand Up @@ -85,7 +85,7 @@ var Cornish = (function() {
},
getActiveDurations: function(element) {
var activeDuring = element.getAttribute('data-active-during');
return Cornish.parseDurations(activeDuring);
return Instapoppin.parseDurations(activeDuring);
}
};

Expand All @@ -109,17 +109,17 @@ var Cornish = (function() {
return;
}
var pop = Popcorn(primaries[0]);
Cornish.getParticipatingElements().forEach(function(elem) {
var durations = Cornish.getActiveDurations(elem);
Instapoppin.getParticipatingElements().forEach(function(elem) {
var durations = Instapoppin.getActiveDurations(elem);
durations.forEach(function(duration) {
pop.code({
start: duration.start,
end: duration.end,
onStart: function() {
Cornish.addClass(elem, 'active');
Instapoppin.addClass(elem, 'active');
},
onEnd: function() {
Cornish.removeClass(elem, 'active');
Instapoppin.removeClass(elem, 'active');
}
});
});
Expand Down
16 changes: 8 additions & 8 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Cornish Unit Tests</title>
<title>Instapoppin' Unit Tests</title>
<link rel="stylesheet" href="qunit.css">

<script src="qunit.js"></script>
<script src="../cornish.js"></script>
<script src="../instapoppin.js"></script>

<script>
module("Cornish.parseDurations()");
module("Instapoppin.parseDurations()");

test("errors thrown when input can't be parsed", function() {
function ensureFails(str) {
raises(function() {
Cornish.parseDurations(str);
}, Cornish.ParseError, "'" + str + "' fails");
Instapoppin.parseDurations(str);
}, Instapoppin.ParseError, "'" + str + "' fails");
}

ensureFails("blah");
Expand All @@ -29,8 +29,8 @@

test("durations provided when input can be parsed", function() {
function ensureWorks(str, expected) {
deepEqual(Cornish.parseDurations(str), expected,
"Cornish.parseDurations('" + str + "') works");
deepEqual(Instapoppin.parseDurations(str), expected,
"Instapoppin.parseDurations('" + str + "') works");
}

ensureWorks("1-5", [{start: 1, end: 5}]);
Expand All @@ -41,7 +41,7 @@
});
</script>

<h1 id="qunit-header">Cornish Unit Tests</h1>
<h1 id="qunit-header">Instapoppin' Unit Tests</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
Expand Down

0 comments on commit e678d85

Please sign in to comment.