Fixes for news and preparing for weather

This commit is contained in:
Martin Donnelly 2018-03-06 12:03:36 +00:00
parent 80e5b25caf
commit 3ba1739c7b
21 changed files with 118 additions and 57 deletions

View File

@ -9,6 +9,7 @@ const sourcemaps = require('gulp-sourcemaps');
const gutil = require('gulp-util');
const rename = require('gulp-rename');
const stripDebug = require('gulp-strip-debug');
var bump = require('gulp-bump');
gulp.task('bundleBackbone', function () {
// set up the browserify instance on a task basis
@ -31,7 +32,13 @@ gulp.task('bundleBackbone', function () {
.pipe(gulp.dest('./live/js'));
});
gulp.task('buildBackbone', ['bundleBackbone'], function() {
gulp.watch('src/v1/js/**/*.js', ['bundleBackbone']);
gulp.task('bump', function() {
gulp.src('src/service-worker.js')
.pipe(bump({ 'key': 'version' }))
.pipe(gulp.dest('src'));
});
gulp.task('buildBackbone', ['bump', 'bundleBackbone'], function() {
gulp.watch('src/v1/js/**/*.js', ['bump', 'bundleBackbone']);
});

151
package-lock.json generated
View File

@ -459,8 +459,7 @@
"array-find-index": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
"integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
"dev": true
"integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E="
},
"array-flatten": {
"version": "1.1.1",
@ -1080,14 +1079,22 @@
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8="
},
"builtin-status-codes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
"integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug="
},
"bump-regex": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bump-regex/-/bump-regex-3.1.0.tgz",
"integrity": "sha512-pgiPDUHh6bT/MDBU/nA1dU67337qD4MbrpQHmpDMiBChEsPEZwNelO25GenJrRYUXbWZuvsIZGLBChtN8Nxb+g==",
"requires": {
"semver": "5.5.0",
"xtend": "4.0.1"
}
},
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
@ -1158,14 +1165,12 @@
"camelcase": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
"integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
"dev": true
"integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8="
},
"camelcase-keys": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
"integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
"dev": true,
"requires": {
"camelcase": "2.1.1",
"map-obj": "1.0.1"
@ -1907,7 +1912,6 @@
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
"integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=",
"dev": true,
"requires": {
"array-find-index": "1.0.2"
}
@ -2323,7 +2327,6 @@
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",
"integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=",
"dev": true,
"requires": {
"is-arrayish": "0.2.1"
}
@ -3052,7 +3055,6 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"dev": true,
"requires": {
"path-exists": "2.1.0",
"pinkie-promise": "2.0.1"
@ -4234,8 +4236,7 @@
"get-stdin": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
"integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
"dev": true
"integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4="
},
"get-uri": {
"version": "2.0.1",
@ -4704,6 +4705,64 @@
}
}
},
"gulp-bump": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/gulp-bump/-/gulp-bump-3.1.0.tgz",
"integrity": "sha512-v5FN3TGstRqkqWTPrp1jcUyCM4YbUIvYzJy/lG2YWFXk5HvFgTucBcVhhpH1nJcnI9Y3skPnpTzYoaBQO1qBzA==",
"requires": {
"bump-regex": "3.1.0",
"plugin-error": "0.1.2",
"plugin-log": "0.1.0",
"semver": "5.5.0",
"through2": "2.0.3"
},
"dependencies": {
"arr-diff": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz",
"integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=",
"requires": {
"arr-flatten": "1.1.0",
"array-slice": "0.2.3"
}
},
"arr-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz",
"integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0="
},
"array-slice": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz",
"integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU="
},
"extend-shallow": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz",
"integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=",
"requires": {
"kind-of": "1.1.0"
}
},
"kind-of": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
"integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ="
},
"plugin-error": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz",
"integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=",
"requires": {
"ansi-cyan": "0.1.1",
"ansi-red": "0.1.1",
"arr-diff": "1.1.0",
"arr-union": "2.1.0",
"extend-shallow": "1.1.4"
}
}
}
},
"gulp-cache": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/gulp-cache/-/gulp-cache-1.0.2.tgz",
@ -5414,8 +5473,7 @@
"hosted-git-info": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
"integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==",
"dev": true
"integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg=="
},
"html-comment-regex": {
"version": "1.1.1",
@ -5600,7 +5658,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
"integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
"dev": true,
"requires": {
"repeating": "2.0.1"
}
@ -5841,8 +5898,7 @@
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
"dev": true
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
},
"is-binary-path": {
"version": "1.0.1",
@ -5862,7 +5918,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"dev": true,
"requires": {
"builtin-modules": "1.1.1"
}
@ -5917,7 +5972,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
"dev": true,
"requires": {
"number-is-nan": "1.0.1"
}
@ -6094,8 +6148,7 @@
"is-utf8": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
"dev": true
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
},
"is-windows": {
"version": "1.0.2",
@ -6345,7 +6398,6 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"parse-json": "2.2.0",
@ -6357,14 +6409,12 @@
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
"dev": true
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
},
"strip-bom": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
"dev": true,
"requires": {
"is-utf8": "0.2.1"
}
@ -6775,7 +6825,6 @@
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
"integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=",
"dev": true,
"requires": {
"currently-unhandled": "0.4.1",
"signal-exit": "3.0.2"
@ -6902,8 +6951,7 @@
"map-obj": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
"integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
"dev": true
"integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0="
},
"map-stream": {
"version": "0.1.0",
@ -6974,7 +7022,6 @@
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
"dev": true,
"requires": {
"camelcase-keys": "2.1.0",
"decamelize": "1.2.0",
@ -7689,7 +7736,6 @@
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
"dev": true,
"requires": {
"hosted-git-info": "2.5.0",
"is-builtin-module": "1.0.0",
@ -7750,8 +7796,7 @@
"number-is-nan": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
},
"o-stream": {
"version": "0.2.2",
@ -8126,7 +8171,6 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"dev": true,
"requires": {
"error-ex": "1.3.1"
}
@ -8165,7 +8209,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"dev": true,
"requires": {
"pinkie-promise": "2.0.1"
}
@ -8231,7 +8274,6 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"pify": "2.3.0",
@ -8241,8 +8283,7 @@
"graceful-fs": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
"dev": true
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
}
}
},
@ -8301,6 +8342,26 @@
"extend-shallow": "3.0.2"
}
},
"plugin-log": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/plugin-log/-/plugin-log-0.1.0.tgz",
"integrity": "sha1-hgSc9qsQgzOYqTHzaJy67nteEzM=",
"requires": {
"chalk": "1.1.3",
"dateformat": "1.0.12"
},
"dependencies": {
"dateformat": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz",
"integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=",
"requires": {
"get-stdin": "4.0.1",
"meow": "3.7.0"
}
}
}
},
"pluralize": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
@ -9489,7 +9550,6 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
"dev": true,
"requires": {
"load-json-file": "1.1.0",
"normalize-package-data": "2.4.0",
@ -9500,7 +9560,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
"dev": true,
"requires": {
"find-up": "1.1.2",
"read-pkg": "1.1.0"
@ -9553,7 +9612,6 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
"integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=",
"dev": true,
"requires": {
"indent-string": "2.1.0",
"strip-indent": "1.0.1"
@ -9664,7 +9722,6 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
"integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
"dev": true,
"requires": {
"is-finite": "1.0.2"
}
@ -10455,7 +10512,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
"integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=",
"dev": true,
"requires": {
"spdx-license-ids": "1.2.2"
}
@ -10463,14 +10519,12 @@
"spdx-expression-parse": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz",
"integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=",
"dev": true
"integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw="
},
"spdx-license-ids": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz",
"integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=",
"dev": true
"integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc="
},
"split": {
"version": "0.3.3",
@ -10763,7 +10817,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
"integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
"dev": true,
"requires": {
"get-stdin": "4.0.1"
}
@ -11122,8 +11175,7 @@
"trim-newlines": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
"integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=",
"dev": true
"integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM="
},
"true-case-path": {
"version": "1.0.2",
@ -11536,7 +11588,6 @@
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz",
"integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=",
"dev": true,
"requires": {
"spdx-correct": "1.0.2",
"spdx-expression-parse": "1.0.4"

View File

@ -20,6 +20,7 @@
"feedme": "^1.1.2",
"geolocation": "^0.2.0",
"gulp-autoprefixer": "^4.1.0",
"gulp-bump": "^3.1.0",
"gulp-cache": "^1.0.2",
"gulp-concat": "^2.6.1",
"gulp-cssnano": "^2.1.2",

View File

@ -105,7 +105,7 @@ app.get('/news', cache('15 minutes'), (req, res) => {
});
});
app.get('/article', (req, res) => {
app.get('/article', cache('1 hour'), (req, res) => {
if (req.query.hasOwnProperty('guid')) {
logger.debug('Beofre', req.query.guid);

View File

@ -25,7 +25,9 @@ function reduceArticle(body = '') {
html.push($(this).html());
});
const outputHTML = html.join('').replace(htmlTidy, '');
html.push('<div class="endbumper"></div>');
// const outputHTML = html.join('').replace(htmlTidy, '');
const outputHTML = html.join('');
obj.title = title;
obj.image = image;

BIN
src/gfx/bg_evening.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
src/gfx/bg_morning.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
src/gfx/clear_d.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
src/gfx/clear_n.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
src/gfx/cloudy_d.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
src/gfx/cloudy_n.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
src/gfx/foggy_d.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
src/gfx/foggy_n.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
src/gfx/rain_d.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
src/gfx/rain_n.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
src/gfx/snow_d.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

BIN
src/gfx/snow_n.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
src/gfx/storm_d.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
src/gfx/storm_n.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
const CACHE_VERSION = 10;
const CACHE_VERSION = { 'version': '0.0.12' };
const dataCacheName = 'jubileeData-v1';
const cacheName = 'jubilee-final-1';
const filesToCache = [

View File

@ -52,7 +52,7 @@ const NewsCardView = Backbone.View.extend({
'template': _.template(`
<div class="newsarticle">
<div><img src="<%= image %>"></div>
<div class="mui-container">
<div class="mui-container" style="margin-bottom: 50px;">
<div><h1><%= title %></h1></div>
<div><%= html %></div>
</div>
@ -71,7 +71,7 @@ const NewsCardView = Backbone.View.extend({
this.$el.empty();
this.$newPanel.show();
if (prevGuid === guid)
if (prevGuid === guid)
this.doRender();
},
'events': {