This repository has been archived by the owner on Apr 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
157 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pinpoint", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"authors": [ | ||
"ejb <[email protected]>" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
This is included because PhantomJS doesn't support .bind() | ||
*/ | ||
|
||
if (!Function.prototype.bind) { | ||
Function.prototype.bind = function(oThis) { | ||
if (typeof this !== 'function') { | ||
// closest thing possible to the ECMAScript 5 | ||
// internal IsCallable function | ||
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); | ||
} | ||
|
||
var aArgs = Array.prototype.slice.call(arguments, 1), | ||
fToBind = this, | ||
fNOP = function() {}, | ||
fBound = function() { | ||
return fToBind.apply(this instanceof fNOP | ||
? this | ||
: oThis, | ||
aArgs.concat(Array.prototype.slice.call(arguments))); | ||
}; | ||
|
||
fNOP.prototype = this.prototype; | ||
fBound.prototype = new fNOP(); | ||
|
||
return fBound; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Test</title> | ||
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.16.0.css"> | ||
<link rel="stylesheet" href="../dist/pinpoint.css"> | ||
</head> | ||
<body> | ||
|
||
<div class="test-map"></div> | ||
|
||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> | ||
<script src="http://code.jquery.com/qunit/qunit-1.16.0.js"></script> | ||
<script src="bind-polyfill.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="../dist/pinpoint.js" type="text/javascript" charset="utf-8"></script> | ||
|
||
<script> | ||
|
||
QUnit.test( "Basic map", function( assert ) { | ||
|
||
var data = { | ||
"hed": "The U.K. and France", | ||
"dek": "This is a test map.", | ||
"lat": 51.5049378, | ||
"lon": - 0.0870377, | ||
"zoom": 4, | ||
"minimap": false, | ||
"aspect-ratio": "tall", | ||
"minimap-zoom-offset": - 5, | ||
"note": "This is a note.", | ||
"markers": [{ | ||
"lat": 51.5049378, | ||
"lon": - 0.0870377, | ||
"text": "", | ||
"icon": "square", | ||
"label-direction": "north", | ||
"labelDirection": "north", | ||
"label": "plain" | ||
}] | ||
}; | ||
|
||
data.el = '.test-map'; | ||
assert.throws(function(){ | ||
var p = new Pinpoint(data); | ||
}, /Leaflet/); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Test</title> | ||
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.16.0.css"> | ||
<link rel="stylesheet" href="../dist/pinpoint.css"> | ||
</head> | ||
<body> | ||
|
||
<div class="test-map"></div> | ||
|
||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> | ||
<script src="http://code.jquery.com/qunit/qunit-1.16.0.js"></script> | ||
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" /> | ||
<script src="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script> | ||
<script src="bind-polyfill.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="../dist/pinpoint.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="pinpoint.test.js" type="text/javascript" charset="utf-8"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
QUnit.test( "Most basic map", function( assert ) { | ||
|
||
var data = { | ||
"lat": 51.5049378, | ||
"lon": - 0.0870377, | ||
"zoom": 4, | ||
"aspect-ratio": "tall", | ||
"markers": [] | ||
}; | ||
|
||
data.el = '.test-map'; | ||
var p = new Pinpoint(data); | ||
|
||
assert.ok( p instanceof Pinpoint ); | ||
}); |