Compare commits

...

10 Commits
0.8.0 ... 0.9.0

Author SHA1 Message Date
Colin McLeod
6ed0c0be3f Linting fix 2015-05-28 02:27:42 -07:00
Colin McLeod
acbfaaa53f Bumping Version to 0.9.0 2015-05-28 02:21:30 -07:00
Colin McLeod
91b42372fb UI & UX improvements 2015-05-28 02:21:03 -07:00
Colin McLeod
d2c6f0cf8f Use absolute path for appcache manifest 2015-05-28 02:00:34 -07:00
Colin McLeod
384d420a7f Update area chart on window resize or orientation change 2015-05-28 02:00:05 -07:00
Colin McLeod
24e9afd3bf Add Ship Diamondback and Imperial Clipper using best data available 2015-05-28 00:52:52 -07:00
Colin McLeod
39c5c724e4 Remove unused images 2015-05-28 00:00:39 -07:00
Colin McLeod
97213a4682 Improve coriolis logo svg 2015-05-28 00:00:10 -07:00
Colin McLeod
280411f35c Add appcache support for offline standalone app 2015-05-27 23:59:54 -07:00
Colin McLeod
1796b0fb46 report useragent on error page 2015-05-27 23:56:06 -07:00
42 changed files with 382 additions and 74 deletions

View File

@@ -1,8 +1,8 @@
<svg width="400" height="400" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
<rect transform="rotate(45 200,200) " height="266" width="266" y="67" x="67" stroke-width="10" stroke="#ff3b00" fill="#000000"/>
<rect height="26" width="83" y="187" x="158" fill-opacity="0" stroke-width="15" stroke="#ff3b00" fill="#000000"/>
<path stroke="#ff3b00" transform="rotate(45 314,85)" d="m181,114l134,-58l134,59l-268,0z" stroke-width="10" fill="#000000"/>
<path stroke="#ff3b00" transform="rotate(135 314,314) " d="m181,344l134,-59l134,59l-268,0z" stroke-width="10" fill="#000000"/>
<path stroke="#ff3b00" transform="rotate(-45 85,85) " d="m-49,114l134-59l134,59l-268,0z" stroke-width="10" fill="#000000"/>
<path stroke="#ff3b00" transform="rotate(-135 85,314) " d="m-49,344l134,-59l134,59l-268,0z" stroke-width="10" fill="#000000"/>
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(1,1)">
<path stroke="#ff3b00" transform="rotate(45 15 15)" d="m4,4 l 11,-4 l 11,4 l 4,11 l -4,11 l -11,4 l -11,-4 l -4,-11 l 4,-11 l 22,0 l 0,22 l -22,0 z" stroke-width="1" fill="#000000"/>
<rect height="3" width="10" y="13.5" x="10" stroke-width="1" stroke="#ff3b00" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 852 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

View File

@@ -1,5 +1,6 @@
{
"name": "Shipyard",
"name": "Coriolis.io",
"short_name": "Coriolis",
"icons": [
{
"src": "images\/logo\/android-chrome-36x36.png",

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
app/images/splash/1280x720.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
app/images/splash/200x320.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
app/images/splash/320x200.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
app/images/splash/320x480.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

BIN
app/images/splash/480x320.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
app/images/splash/480x800.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
app/images/splash/720x1280.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
app/images/splash/800x480.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -1,30 +1,69 @@
<!DOCTYPE html>
<html ng-app="app" ng-strict-di="true">
<html ng-app="app" ng-strict-di="true" manifest="/coriolis.appcache">
<head>
<title ng-bind="title">Coriolis</title>
<link rel="stylesheet" href="/app.css">
<!-- Standard headers -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="width = device-width, initial-scale = 1.0">
<link rel="manifest" href="/images/logo/manifest.json">
<link rel="icon" sizes="96x96" type="image/png" href="/images/logo/favicon-96x96.png">
<link rel="icon" sizes="194x194" type="image/png" href="/images/logo/favicon-194x194.png">
<link rel="icon" sizes="192x192" type="image/png" href="/images/logo/android-chrome-192x192.png">
<link rel="shortcut icon" href="/images/logo/favicon.ico">
<!-- Apple/iOS headers -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Coriolis">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" sizes="76x76" href="/images/logo/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/images/logo/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/logo/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/images/logo/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/logo/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/images/logo/apple-touch-icon-180x180.png">
<link rel="icon" sizes="96x96" type="image/png" href="/images/logo/favicon-96x96.png">
<link rel="icon" sizes="194x194" type="image/png" href="/images/logo/favicon-194x194.png">
<link rel="icon" sizes="192x192" type="image/png" href="/images/logo/android-chrome-192x192.png">
<link rel="manifest" href="/images/logo/manifest.json">
<link rel="shortcut icon" href="/images/logo/favicon.ico">
<!-- iPhone, iPod Touch, portrait -->
<link href="/images/splash/320x460.png" media="(device-width: 320px) and (device-height: 480px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPhone, iPod Touch, landscape -->
<link href="/images/splash/480x320.png" media="(device-width: 320px) and (device-height: 480px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPhone 4, 4S, portrait -->
<link href="/images/splash/640x920.png" media="(device-width: 320px) and (device-height: 480px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 4, 4S, landscape -->
<link href="/images/splash/960x640.png" media="(device-width: 320px) and (device-height: 480px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 5, 5S, 5C, portrait -->
<link href="/images/splash/640x1096.png" media="(device-width: 320px) and (device-height: 568px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 5, 5S, 5C, landscape -->
<link href="/images/splash/1136x640.png" media="(device-width: 320px) and (device-height: 568px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 6, portrait -->
<link href="/images/splash/750x1294.png" media="(device-width: 375px) and (device-height: 667px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 6, landscape -->
<link href="/images/splash/1334x750.png" media="(device-width: 375px) and (device-height: 667px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 6+, portrait -->
<link href="/images/splash/1242x2148.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image">
<!-- iPhone 6+, landscape -->
<link href="/images/splash/2208x1242.png" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" rel="apple-touch-startup-image">
<!-- iPad 1, 2, Mini, portrait -->
<link href="/images/splash/768x1004.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPad 1, 2, Mini, landscape -->
<link href="/images/splash/1024x748.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPad 3, 4, Air, Air 2, Mini 2, Mini 3, portrait -->
<link href="/images/splash/1536x2008.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPad 3, 4, Air, Air 2, Mini 2, Mini 3, landscape -->
<link href="/images/splash/2048x1496.png" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- Microsoft Windows Phone/Tablet headers -->
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="/images/logo/mstile-144x144.png">
<meta name="msapplication-config" content="/images/logo/browserconfig.xml">
<meta name="theme-color" content="#000000">
</head>
<body>
<body style="background-color:#000;">
<div style="height: 0; width: 0; overflow:hidden"><%= svgContent %></div>
<shipyard-header></shipyard-header>
<div id="main" ui-view ng-click="bgClicked($event)"></div>
<div ui-view="modal"></div>
<div ui-view="modal" ng-click="bgClicked($event)"></div>
<footer>
<div class="right">

View File

@@ -3,7 +3,7 @@ angular.module('app')
$rootScope.title = 'Error';
$scope.path = $location.path();
$scope.type = $p.type || 'unknown';
$scope.browser = $window.navigator.appVersion;
$scope.browser = $window.navigator.userAgent;
switch ($scope.type) {
case 404:

View File

@@ -1,4 +1,4 @@
angular.module('app').directive('areaChart', function () {
angular.module('app').directive('areaChart', ['$window', function ($window) {
return {
@@ -10,33 +10,24 @@ angular.module('app').directive('areaChart', function () {
width: '='
},
link: function(scope, element) {
var width = element[0].parentElement.offsetWidth,
height = width * 0.6,
series = scope.series,
var series = scope.series,
config = scope.config,
labels = config.labels,
margin = {top: 15, right: 15, bottom: 35, left: 50},
w = width - margin.left - margin.right,
h = height - margin.top - margin.bottom,
fmt = d3.format('.3r'),
fmtLong = d3.format('.2f');
// Create chart
var svg = d3.select(element[0]).append("svg")
.attr("width", width)
.attr("height", height)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var svg = d3.select(element[0]).append("svg");
var vis = svg.append("g").attr("transform", "translate(" + margin.left + "," + margin.top + ")");
// Define Axes
var x = d3.scale.linear().range([0, w]);
var y = d3.scale.linear().range([h, 0]);
var xAxis = d3.svg.axis().outerTickSize(0).orient("bottom").tickFormat(fmt);
var yAxis = d3.svg.axis().outerTickSize(0).orient("left").tickFormat(fmt);
// Define Area
var area = d3.svg.area().x(function(d) { return x(d[0]); }).y0(h).y1(function(d) { return y(d[1]); });
var area = d3.svg.area();
var gradient = svg.append("defs")
var gradient = vis.append("defs")
.append("linearGradient")
.attr("id", "gradient")
.attr("x1", "0%").attr("y1", "0%")
@@ -52,57 +43,69 @@ angular.module('app').directive('areaChart', function () {
.attr("stop-opacity", 1);
// Create Y Axis SVG Elements
svg.append("g").attr("class", "y axis")
var yTxt = vis.append("g").attr("class", "y axis")
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", -40)
.attr("x", -h/2)
.attr("dy", ".1em")
.style("text-anchor", "middle")
.text(labels.yAxis.title + ' (' + labels.yAxis.unit + ')');
// Create X Axis SVG Elements
svg.append("g").attr("class", "x axis").attr("transform", "translate(0," + h + ")")
.append("text")
var xLbl = vis.append("g").attr("class", "x axis");
var xTxt = xLbl.append("text")
.attr("y", 30)
.attr("x", w/2)
.attr("dy", ".1em")
.style("text-anchor", "middle")
.text(labels.xAxis.title + ' (' + labels.xAxis.unit + ')');
// Create and Add tooltip
var tip = svg.append("g").style("display", "none");
var tip = vis.append("g").style("display", "none");
tip.append("circle")
.attr("class", "marker")
.attr("r", 4);
tip.append("text").attr("class", 'label x').attr("y", -2);
tip.append("text").attr("class", 'label y').attr("y", '0.7em');
/**
* Watch for changes in the series data (mass changes, etc)
*/
scope.$watchCollection('series', render);
scope.$watchCollection('config.watch', render);
angular.element($window).bind('resize', render);
function render() {
var data = [];
var func = series.func;
var width = element[0].parentElement.offsetWidth,
height = width * 0.6,
w = width - margin.left - margin.right,
h = height - margin.top - margin.bottom,
x = d3.scale.linear().range([0, w]),
y = d3.scale.linear().range([h, 0]),
data = [],
func = series.func;
for (var d = series.xMin; d <= series.xMax; d++) {
data.push([ d, func(d) ]);
}
// Update Chart Size
svg.attr("width", width).attr("height", height);
area.x(function(d) { return x(d[0]); }).y0(h).y1(function(d) { return y(d[1]); });
// Update domain and scale for axes;
x.domain([series.xMin, series.xMax]);
xAxis.scale(x);
xLbl.attr("transform", "translate(0," + h + ")");
xTxt.attr("x", w/2);
y.domain([data[data.length - 1][1], data[0][1]]);
yAxis.scale(y);
svg.selectAll(".y.axis").call(yAxis);
svg.selectAll(".x.axis").call(xAxis);
yTxt.attr("x", -h/2);
vis.selectAll(".y.axis").call(yAxis);
vis.selectAll(".x.axis").call(xAxis);
// Remove existing elements
svg.selectAll('path.area').remove();
vis.selectAll('path.area').remove();
svg.insert("path",':first-child') // Area/Path to appear behind everything else
vis.insert("path",':first-child') // Area/Path to appear behind everything else
.datum(data)
.attr("class", "area")
.attr('fill', 'url(#gradient)')
@@ -120,4 +123,4 @@ angular.module('app').directive('areaChart', function () {
}
};
});
}]);

View File

@@ -1,14 +1,18 @@
/**
* BBCode Generator functions for embedding in the Elite Dangerous Forums
*/
angular.module('app').factory('Utils', ['$state','$http', function ($state, $http) {
angular.module('app').factory('Utils', ['$window','$state','$http', '$q', function ($window, $state, $http, $q) {
var shortenAPI = 'https://www.googleapis.com/urlshortener/v1/url?key=';
function shortenUrl(url) {
return $http.post(shortenAPI + GAPI_KEY, {longUrl:url}).then(function(response) {
return response.data.id;
});
if ($window.navigator.onLine) {
return $http.post(shortenAPI + GAPI_KEY, {longUrl:url}).then(function(response) {
return response.data.id;
});
} else {
return $q.reject({statusText: 'Not Online'});
}
}
function comparisonBBCode(facets, builds, link) {

View File

@@ -104,6 +104,8 @@
display: block;
overflow-x: hidden;
overflow-y: auto;
z-index: 0;
-webkit-overflow-scrolling: touch;
max-height: 8em;
}
}

View File

@@ -51,6 +51,8 @@ header {
background-color: @bgBlack;
font-size: 0.8em;
overflow-y: auto;
z-index: 0;
-webkit-overflow-scrolling: touch;
max-height: 400px;
&.dbl {

View File

@@ -1,10 +1,11 @@
.list {
overflow: hidden;
margin: 1em 0;
cursor: default;
font-size: 0.8em;
min-width: 21em;
min-width: 25%;
text-align: left;
.user-select-none();
box-sizing: border-box;
.header {
width: 100%;

View File

@@ -1,17 +1,15 @@
#outfit {
font-size: 1.1em;
// iPads Landscape
.tablet({
& {
font-size: 0.95em;
}
});
width: 64em;
max-width: 1200px;
margin: 0 auto;
.user-select-none();
.tablet({
min-width: 760px;
font-size: 0.8em;
});
}
#overview {
@@ -25,7 +23,7 @@
#summary {
.user-select-none();
width: 100%;
margin-top: 1em;
margin: 1em 0;
font-size: 0.8em;
border-collapse: collapse;
@@ -56,7 +54,7 @@
#hardpoints, #utility, #standard {
margin-right: 0.3em;
padding-right: 0.3em;
.slot {
clear: left;
}

View File

@@ -8,6 +8,8 @@
max-height: 300px;
overflow-y: auto;
overflow-x: hidden;
z-index: 0;
-webkit-overflow-scrolling: touch;
background-color: @bg;
border: 1px solid @primary;
white-space: nowrap;

View File

@@ -1,6 +1,8 @@
.slot-group {
margin: 1em 0;
width: 25%;
margin: 0;
box-sizing: border-box;
.user-select-none();
cursor: default;
@@ -19,7 +21,7 @@
.slot {
float: left;
text-align: left;
width: 21em;
width: 100%;
font-size: 0.75em;
margin-top: 0.5em;
position: relative;

View File

@@ -216,7 +216,7 @@
</table>
</div>
<div class="list l" style="width: 37em; margin: 0 0.5em;">
<div class="list l" style="width: 50%;padding: 0 0.5em;">
<div class="header">Jump Range</div>
<div class="cen">
<div class="chart" area-chart config="jrChart" series="jrSeries"></div>

View File

@@ -36,6 +36,80 @@
"mass": 4
}
],
"diamondback": [
{
"name": "Lightweight Alloy",
"class": 1,
"rating": "I",
"cost": 0,
"mass": 0
},
{
"name": "Reinforced Alloy",
"class": 1,
"rating": "I",
"cost": 225700,
"mass": 13
},
{
"name": "Military Grade Composite",
"class": 1,
"rating": "I",
"cost": 507900,
"mass": 26
},
{
"name": "Mirrored Surface Composite",
"class": 1,
"rating": "I",
"cost": 1185100,
"mass": 26
},
{
"name": "Reactive Surface Composite",
"class": 1,
"rating": "I",
"cost": 1330100,
"mass": 26
}
],
"imperial_courier": [
{
"name": "Lightweight Alloy",
"class": 1,
"rating": "I",
"cost": 0,
"mass": 0
},
{
"name": "Reinforced Alloy",
"class": 1,
"rating": "I",
"cost": 1017200,
"mass": 4
},
{
"name": "Military Grade Composite",
"class": 1,
"rating": "I",
"cost": 2288600,
"mass": 8
},
{
"name": "Mirrored Surface Composite",
"class": 1,
"rating": "I",
"cost": 5408800,
"mass": 8
},
{
"name": "Reactive Surface Composite",
"class": 1,
"rating": "I",
"cost": 5993700,
"mass": 8
}
],
"cobra_mk_iii": [
{
"name": "Lightweight Alloy",

View File

@@ -0,0 +1,72 @@
{
"diamondback": {
"properties": {
"grp": "ex",
"name": "Diamondback",
"manufacturer": "Lakon",
"class": 1,
"cost": 564300,
"speed": 283,
"boost": 384,
"agility": 3,
"shields": 93,
"armour": 216,
"fuelcost": 50,
"mass": 170
},
"slots": {
"common": [
4,
4,
4,
2,
3,
2,
4
],
"hardpoints": [
2,
2,
1,
1,
0,
0,
0,
0
],
"internal": [
3,
3,
3,
2
]
},
"defaults": {
"common": [
"4E",
"4E",
"4E",
"2E",
"3E",
"2E",
"4C"
],
"hardpoints": [
17,
17,
0,
0,
0,
0,
0,
0
],
"internal": [
"44",
0,
0,
"2h"
]
}
}
}

View File

@@ -0,0 +1,74 @@
{
"imperial_courier": {
"properties": {
"grp": "mp",
"name": "Imperial Courier",
"manufacturer": "Gutamaya",
"class": 1,
"cost": 2479400,
"speed": 277,
"boost": 380,
"agility": 6,
"shields": 230,
"armour": 144,
"fuelcost": 50,
"mass": 35
},
"slots": {
"common": [
4,
3,
3,
1,
3,
2,
3
],
"hardpoints": [
2,
2,
2,
0,
0,
0,
0
],
"internal": [
3,
3,
2,
2,
2,
1
]
},
"defaults": {
"common": [
"4E",
"3E",
"3E",
"1E",
"3E",
"2E",
"3C"
],
"hardpoints": [
17,
17,
0,
0,
0,
0,
0
],
"internal": [
"02",
"44",
"01",
0,
0,
"2h"
]
}
}
}

View File

@@ -1,5 +1,4 @@
var gulp = require('gulp'),
exec = require('gulp-exec'),
less = require('gulp-less'),
jshint = require('gulp-jshint'),
minifyCSS = require('gulp-minify-css'),
@@ -19,6 +18,7 @@ var gulp = require('gulp'),
svgstore = require( 'gulp-svgstore' ),
svgmin = require( 'gulp-svgmin' ),
jsonlint = require("gulp-jsonlint"),
appCache = require("gulp-manifest"),
pkg = require('./package.json');
var cdnHostStr = '';
@@ -167,11 +167,12 @@ gulp.task('serve-stop', function(cb) {
gulp.task('watch', function() {
gulp.watch(['app/index.html','app/icons/*.svg'], ['generateIndexHTML']);
gulp.watch(['app/images/**','app/fonts/**', 'app/.htaccess'], ['copy']);
gulp.watch(['app/images/**','app/fonts/**'], ['copy']);
gulp.watch('app/less/*.less', ['less']);
gulp.watch('app/views/**/*', ['html2js']);
gulp.watch('app/js/**/*.js', ['js']);
gulp.watch('data/**/*.json', ['jsonToDB']);
gulp.watch(['build/**', '!**/*.appcache'], ['appcache']);
});
gulp.task('cache-bust', function(done) {
@@ -195,6 +196,29 @@ gulp.task('cache-bust', function(done) {
stream.on('error', done);
});
gulp.task('appcache', function(done) {
// Since using a CDN manually build file list rather than using appCache mechanisms
gulp.src(['build/**', '!build/index.html', '!**/*.json', '!**/logo/*', '!**/*.map','!**/*.appcache'])
.pipe(gutil.buffer(function(err, stream) {
var files = [];
for (var i = 0; i < stream.length; i++) {
if (!stream[i].isNull()) {
files.push(cdnHostStr + '/' + stream[i].relative);
}
}
gulp.src([])
.pipe(appCache({
preferOnline: true,
cache: files,
filename: 'coriolis.appcache',
timestamp: true
}))
.pipe(gulp.dest('build'))
.on('end', done);
}));
});
gulp.task('upload', function(done) {
exec([
"rsync -e 'ssh -i ", process.env.CORIOLIS_PEM, "' -a --delete build/ ", process.env.CORIOLIS_USER, "@", process.env.CORIOLIS_HOST, ":~/www"
@@ -206,11 +230,11 @@ gulp.task('upload', function(done) {
gulp.task('lint', ['js-lint', 'json-lint']);
gulp.task('clean', function (done) { del(['build'], done); });
gulp.task('build', function (done) { runSequence('clean', ['html2js','jsonToDB'], ['generateIndexHTML','bower','js','less','copy'], done); });
gulp.task('build-cache', function (done) { runSequence('build', 'appcache', done); });
gulp.task('dev', function (done) { runSequence('build-cache', 'serve','watch', done); });
gulp.task('deploy', function (done) {
cdnHostStr = '//cdn.' + process.env.CORIOLIS_HOST;
runSequence('lint', 'build','cache-bust', 'upload', done);
runSequence('lint', 'build','cache-bust', 'appcache', 'upload', done);
});
gulp.task('dev', function (done) { runSequence('build', 'serve','watch', done); });
gulp.task('default', ['dev']);

View File

@@ -25,6 +25,7 @@ http {
image/svg+xml svg;
image/x-icon ico;
application/pdf pdf;
text/cache-manifest appcache;
}
gzip on;
@@ -41,6 +42,15 @@ http {
root ./build/;
index index.html;
location ~* \.(?:manifest|appcache|html?|xml|json|css|js|map|jpg|jpeg|gif|png|ico|svg|eot|ttf|woff|woff2)$ {
expires -1;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
access_log off;
}
location / {
try_files $uri $uri/ /index.html =404;
}

View File

@@ -1,6 +1,6 @@
{
"name": "coriolis_shipyard",
"version": "0.8.0",
"version": "0.9.0",
"repository": {
"type": "git",
"url": "https://github.com/cmmcleod/coriolis"
@@ -13,11 +13,11 @@
"gulp": "^3.8.11",
"gulp-angular-templatecache": "^1.6.0",
"gulp-concat": "^2.5.2",
"gulp-exec": "^2.1.1",
"gulp-htmlmin": "^1.1.1",
"gulp-jshint": "^1.10.0",
"gulp-jsonlint": "^1.0.2",
"gulp-less": "^3.0.2",
"gulp-manifest": "0.0.6",
"gulp-minify-css": "^1.0.0",
"gulp-rev-all": "^0.8.18",
"gulp-sourcemaps": "^1.5.1",