From be827bac728efe1212c2818967fb4d0511ee7b12 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 22 Jun 2014 00:06:08 +0200 Subject: [PATCH 1/7] Set version to 0.25.0+ --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8043b0f9..dfaddb65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ **h5ai** uses [semantic versioning](http://semver.org/). +## develop branch + +* ... + + ## v0.25.0 - *2014-06-22* * adds sidebar diff --git a/package.json b/package.json index dc99766c..e10af6ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "h5ai", - "version": "0.25.0", + "version": "0.25.0+", "description": "a modern HTTP web server index", "url": "http://larsjung.de/h5ai/", "author": "Lars Jung", From 99d59ee9ad881dd5bf60392af3907517cc56f3c6 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Tue, 24 Jun 2014 03:07:35 +0200 Subject: [PATCH 2/7] Fix file type check. --- src/_h5ai/client/js/inc/core/types.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/client/js/inc/core/types.js b/src/_h5ai/client/js/inc/core/types.js index b4d765e7..eb86704b 100644 --- a/src/_h5ai/client/js/inc/core/types.js +++ b/src/_h5ai/client/js/inc/core/types.js @@ -14,7 +14,7 @@ modulejs.define('core/types', ['config', '_'], function (config, _) { _.each(types, function (patterns, type) { - var pattern = '^' + _.map(patterns, function (p) { return escapeRegExp(p).replace(/\*/g, '.*'); }).join('|') + '$'; + var pattern = '^(' + _.map(patterns, function (p) { return '(' + escapeRegExp(p).replace(/\*/g, '.*') + ')'; }).join('|') + ')$'; regexps[type] = new RegExp(pattern, 'i'); }); }, From 0c804cdf24f3bea4617e9bace242475215d22cb9 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Tue, 24 Jun 2014 23:10:34 +0200 Subject: [PATCH 3/7] Fix Google Universal Analytics. --- "\033" | 80 +++++++++++++++++++ .../client/js/inc/ext/google-analytics.js | 27 ++++--- src/_h5ai/conf/options.json | 8 +- 3 files changed, 99 insertions(+), 16 deletions(-) create mode 100644 "\033" diff --git "a/\033" "b/\033" new file mode 100644 index 00000000..8f1db12f --- /dev/null +++ "b/\033" @@ -0,0 +1,80 @@ +diff --git a/src/_h5ai/client/js/inc/ext/google-analytics.js b/src/_h5ai/client/js/inc/ext/google-analytics.js +index e9d4cfe..c82c3ed 100644 +--- a/src/_h5ai/client/js/inc/ext/google-analytics.js ++++ b/src/_h5ai/client/js/inc/ext/google-analytics.js +@@ -28,24 +28,25 @@ modulejs.define('ext/google-analytics-ga', ['_', 'core/settings'], function (_, + }); +  +  +-modulejs.define('ext/google-analytics-ua', ['_', 'core/settings'], function (_, allsettings) { ++modulejs.define('ext/google-analytics-ua', ['_', 'core/settings', 'core/event'], function (_, allsettings, event) { +  + var settings = _.extend({ + enabled: false, +- calls: [] ++ id: 'UA-000000-0' + }, allsettings['google-analytics-ua']), +  ++ win = window, ++ doc = document, ++ scriptLiteral = 'script', ++ id = 'h5ai-ga', ++ + init = function () { +  + if (!settings.enabled) { + return; + } +  +- var win = window, +- doc = document, +- scriptLiteral = 'script', +- id = 'ga', +- el, firstScriptElement; ++ var el, firstScriptElement; +  + win.GoogleAnalyticsObject = id; + win[id] = win[id] || function () { +@@ -60,8 +61,16 @@ modulejs.define('ext/google-analytics-ua', ['_', 'core/settings'], function (_, + firstScriptElement = doc.getElementsByTagName(scriptLiteral)[0]; + firstScriptElement.parentNode.insertBefore(el, firstScriptElement); +  +- _.each(settings.calls, function (call) { +- win[id].apply(win, call); ++ win[id]('create', settings.id, 'auto'); ++ ++ event.sub('location.changed', function (item) { ++ ++ var loc = win.location; ++ win[id]('send', 'pageview', { ++ location: loc.protocol + '//' + loc.hostname + item.absHref, ++ page: loc.protocol + '//' + loc.host + item.absHref, ++ title: _.pluck(item.getCrumb(), 'label').join(' > ') ++ }); + }); + }; +  +diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json +index be3dea5..5169e34 100644 +--- a/src/_h5ai/conf/options.json ++++ b/src/_h5ai/conf/options.json +@@ -155,17 +155,11 @@ Options + /* + Adds Google Universial Analytics asynchronous tracking code. +  +- for example: +- "calls": [ +- ['create', 'UA-XXXX-Y', 'auto'], +- ['send', 'pageview'] +- ] +- + see: https://developers.google.com/analytics/devguides/collection/analyticsjs/ + */ + "google-analytics-ua": { +- "enabled": false, +- "calls": [] ++ "enabled": true, ++ "id": "UA-000000-0" + }, +  + /* diff --git a/src/_h5ai/client/js/inc/ext/google-analytics.js b/src/_h5ai/client/js/inc/ext/google-analytics.js index e9d4cfe3..c82c3ed2 100644 --- a/src/_h5ai/client/js/inc/ext/google-analytics.js +++ b/src/_h5ai/client/js/inc/ext/google-analytics.js @@ -28,24 +28,25 @@ modulejs.define('ext/google-analytics-ga', ['_', 'core/settings'], function (_, }); -modulejs.define('ext/google-analytics-ua', ['_', 'core/settings'], function (_, allsettings) { +modulejs.define('ext/google-analytics-ua', ['_', 'core/settings', 'core/event'], function (_, allsettings, event) { var settings = _.extend({ enabled: false, - calls: [] + id: 'UA-000000-0' }, allsettings['google-analytics-ua']), + win = window, + doc = document, + scriptLiteral = 'script', + id = 'h5ai-ga', + init = function () { if (!settings.enabled) { return; } - var win = window, - doc = document, - scriptLiteral = 'script', - id = 'ga', - el, firstScriptElement; + var el, firstScriptElement; win.GoogleAnalyticsObject = id; win[id] = win[id] || function () { @@ -60,8 +61,16 @@ modulejs.define('ext/google-analytics-ua', ['_', 'core/settings'], function (_, firstScriptElement = doc.getElementsByTagName(scriptLiteral)[0]; firstScriptElement.parentNode.insertBefore(el, firstScriptElement); - _.each(settings.calls, function (call) { - win[id].apply(win, call); + win[id]('create', settings.id, 'auto'); + + event.sub('location.changed', function (item) { + + var loc = win.location; + win[id]('send', 'pageview', { + location: loc.protocol + '//' + loc.hostname + item.absHref, + page: loc.protocol + '//' + loc.host + item.absHref, + title: _.pluck(item.getCrumb(), 'label').join(' > ') + }); }); }; diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index be3dea5b..e8a1ee99 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -155,17 +155,11 @@ Options /* Adds Google Universial Analytics asynchronous tracking code. - for example: - "calls": [ - ['create', 'UA-XXXX-Y', 'auto'], - ['send', 'pageview'] - ] - see: https://developers.google.com/analytics/devguides/collection/analyticsjs/ */ "google-analytics-ua": { "enabled": false, - "calls": [] + "id": "UA-000000-0" }, /* From f56a67af9edd362bcaeb95c79589a667fa9aba8d Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Tue, 24 Jun 2014 23:11:47 +0200 Subject: [PATCH 4/7] Update changelog. --- "\033" | 80 ---------------------------------------------------- CHANGELOG.md | 3 +- 2 files changed, 2 insertions(+), 81 deletions(-) delete mode 100644 "\033" diff --git "a/\033" "b/\033" deleted file mode 100644 index 8f1db12f..00000000 --- "a/\033" +++ /dev/null @@ -1,80 +0,0 @@ -diff --git a/src/_h5ai/client/js/inc/ext/google-analytics.js b/src/_h5ai/client/js/inc/ext/google-analytics.js -index e9d4cfe..c82c3ed 100644 ---- a/src/_h5ai/client/js/inc/ext/google-analytics.js -+++ b/src/_h5ai/client/js/inc/ext/google-analytics.js -@@ -28,24 +28,25 @@ modulejs.define('ext/google-analytics-ga', ['_', 'core/settings'], function (_, - }); -  -  --modulejs.define('ext/google-analytics-ua', ['_', 'core/settings'], function (_, allsettings) { -+modulejs.define('ext/google-analytics-ua', ['_', 'core/settings', 'core/event'], function (_, allsettings, event) { -  - var settings = _.extend({ - enabled: false, -- calls: [] -+ id: 'UA-000000-0' - }, allsettings['google-analytics-ua']), -  -+ win = window, -+ doc = document, -+ scriptLiteral = 'script', -+ id = 'h5ai-ga', -+ - init = function () { -  - if (!settings.enabled) { - return; - } -  -- var win = window, -- doc = document, -- scriptLiteral = 'script', -- id = 'ga', -- el, firstScriptElement; -+ var el, firstScriptElement; -  - win.GoogleAnalyticsObject = id; - win[id] = win[id] || function () { -@@ -60,8 +61,16 @@ modulejs.define('ext/google-analytics-ua', ['_', 'core/settings'], function (_, - firstScriptElement = doc.getElementsByTagName(scriptLiteral)[0]; - firstScriptElement.parentNode.insertBefore(el, firstScriptElement); -  -- _.each(settings.calls, function (call) { -- win[id].apply(win, call); -+ win[id]('create', settings.id, 'auto'); -+ -+ event.sub('location.changed', function (item) { -+ -+ var loc = win.location; -+ win[id]('send', 'pageview', { -+ location: loc.protocol + '//' + loc.hostname + item.absHref, -+ page: loc.protocol + '//' + loc.host + item.absHref, -+ title: _.pluck(item.getCrumb(), 'label').join(' > ') -+ }); - }); - }; -  -diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json -index be3dea5..5169e34 100644 ---- a/src/_h5ai/conf/options.json -+++ b/src/_h5ai/conf/options.json -@@ -155,17 +155,11 @@ Options - /* - Adds Google Universial Analytics asynchronous tracking code. -  -- for example: -- "calls": [ -- ['create', 'UA-XXXX-Y', 'auto'], -- ['send', 'pageview'] -- ] -- - see: https://developers.google.com/analytics/devguides/collection/analyticsjs/ - */ - "google-analytics-ua": { -- "enabled": false, -- "calls": [] -+ "enabled": true, -+ "id": "UA-000000-0" - }, -  - /* diff --git a/CHANGELOG.md b/CHANGELOG.md index dfaddb65..9863e45b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ ## develop branch -* ... +* fixes Google Universal Analytics +* fixes file type check ## v0.25.0 - *2014-06-22* From 61301b3f98e058d94ebefee1504f8d15279fcfa2 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 25 Jun 2014 02:47:46 +0200 Subject: [PATCH 5/7] Fix path normalization (broke paths containing '+' characters). --- src/_h5ai/server/php/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_h5ai/server/php/index.php b/src/_h5ai/server/php/index.php index 3b4dcace..b5459e9c 100644 --- a/src/_h5ai/server/php/index.php +++ b/src/_h5ai/server/php/index.php @@ -2,7 +2,7 @@ function normalize_path($path, $trailing_slash = false) { - $path = preg_replace("#\\+|/+#", "/", $path); + $path = preg_replace("#\\\\+|/+#", "/", $path); return preg_match("#^(\w:)?/$#", $path) ? $path : (rtrim($path, "/") . ($trailing_slash ? "/" : "")); } From 113c7bb6f0f5d5a7544bd0344c1b0d4808bd9d4b Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 25 Jun 2014 02:52:44 +0200 Subject: [PATCH 6/7] Update changelog. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9863e45b..bc8e428e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## develop branch +* fixes broken paths for filenames containing '+' characters * fixes Google Universal Analytics * fixes file type check From 9ee54a008aa7f28f1c87176beda79178ebfb074f Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Wed, 25 Jun 2014 02:55:13 +0200 Subject: [PATCH 7/7] Prepare release. --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8e428e..b0b1bb3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ **h5ai** uses [semantic versioning](http://semver.org/). -## develop branch +## v0.25.1 - *2014-06-25* * fixes broken paths for filenames containing '+' characters * fixes Google Universal Analytics diff --git a/package.json b/package.json index e10af6ac..b0b7053e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "h5ai", - "version": "0.25.0+", + "version": "0.25.1", "description": "a modern HTTP web server index", "url": "http://larsjung.de/h5ai/", "author": "Lars Jung",