Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Tilley committed Feb 3, 2014
1 parent cfb0593 commit 5e807f5
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.1.0 (2014/02/03)
-------------------

* Add `stop` method to Planet API

v1.0.3 (2014/01/23)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "planetary.js",
"version": "1.0.3",
"version": "1.1.0",
"main": "dist/planetaryjs.min.js",
"description": "Awesome interactive globes for the web",
"homepage": "http://planetaryjs.com",
Expand Down
29 changes: 24 additions & 5 deletions dist/planetaryjs-noplugins.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*! Planetary.js v1.0.3
/*! Planetary.js v1.1.0
* Copyright (c) 2013 Brandon Tilley
*
* Released under the MIT license
* Date: 2014-01-23T04:43:43.546Z
* Date: 2014-02-03T08:15:07.064Z
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
Expand All @@ -21,6 +21,10 @@

var doDrawLoop = function(planet, canvas, hooks) {
d3.timer(function() {
if (planet.stopped) {
return true;
}

planet.context.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 0; i < hooks.onDraw.length; i++) {
hooks.onDraw[i]();
Expand Down Expand Up @@ -76,11 +80,14 @@
};

var startDraw = function(planet, canvas, localPlugins, hooks) {
initPlugins(planet, localPlugins);

planet.canvas = canvas;
planet.context = canvas.getContext('2d');

if (planet.stopped !== true) {
initPlugins(planet, localPlugins);
}

planet.stopped = false;
runOnInitHooks(planet, canvas, hooks);
};

Expand All @@ -100,7 +107,8 @@
var localPlugins = [];
var hooks = {
onInit: [],
onDraw: []
onDraw: [],
onStop: []
};

var planet = {
Expand All @@ -118,10 +126,21 @@
hooks.onDraw.push(fn);
},

onStop: function(fn) {
hooks.onStop.push(fn);
},

loadPlugin: function(plugin) {
localPlugins.push(plugin);
},

stop: function() {
planet.stopped = true;
for (var i = 0; i < hooks.onStop.length; i++) {
hooks.onStop[i](planet);
}
},

withSavedContext: function(fn) {
if (!this.context) {
throw new Error("No canvas to fetch context for");
Expand Down
4 changes: 2 additions & 2 deletions dist/planetaryjs-noplugins.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 24 additions & 5 deletions dist/planetaryjs.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*! Planetary.js v1.0.3
/*! Planetary.js v1.1.0
* Copyright (c) 2013 Brandon Tilley
*
* Released under the MIT license
* Date: 2014-01-23T04:43:43.371Z
* Date: 2014-02-03T08:15:06.913Z
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
Expand All @@ -21,6 +21,10 @@

var doDrawLoop = function(planet, canvas, hooks) {
d3.timer(function() {
if (planet.stopped) {
return true;
}

planet.context.clearRect(0, 0, canvas.width, canvas.height);
for (var i = 0; i < hooks.onDraw.length; i++) {
hooks.onDraw[i]();
Expand Down Expand Up @@ -76,11 +80,14 @@
};

var startDraw = function(planet, canvas, localPlugins, hooks) {
initPlugins(planet, localPlugins);

planet.canvas = canvas;
planet.context = canvas.getContext('2d');

if (planet.stopped !== true) {
initPlugins(planet, localPlugins);
}

planet.stopped = false;
runOnInitHooks(planet, canvas, hooks);
};

Expand All @@ -100,7 +107,8 @@
var localPlugins = [];
var hooks = {
onInit: [],
onDraw: []
onDraw: [],
onStop: []
};

var planet = {
Expand All @@ -118,10 +126,21 @@
hooks.onDraw.push(fn);
},

onStop: function(fn) {
hooks.onStop.push(fn);
},

loadPlugin: function(plugin) {
localPlugins.push(plugin);
},

stop: function() {
planet.stopped = true;
for (var i = 0; i < hooks.onStop.length; i++) {
hooks.onStop[i](planet);
}
},

withSavedContext: function(fn) {
if (!this.context) {
throw new Error("No canvas to fetch context for");
Expand Down
4 changes: 2 additions & 2 deletions dist/planetaryjs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "planetary.js",
"version": "1.0.3",
"version": "1.1.0",
"description": "Awesome interactive globes for the web",
"main": "dist/planetaryjs",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion site/public/download/_data.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"stable": {
"latest": {
"version": "v1.0.3"
"version": "v1.1.0"
}
},
"unstable": {
Expand Down
Loading

0 comments on commit 5e807f5

Please sign in to comment.