From b898aafe5184497387dede3f6bf441eee0b5afde Mon Sep 17 00:00:00 2001 From: David Molineus Date: Mon, 9 Oct 2017 16:05:34 +0200 Subject: [PATCH] Rearrange assets. --- .gitattributes | 1 + assets/js/.keep | 0 assets/maps/contao-leaflet.js | 1 - gulpfile.js | 4 ++-- {assets/maps/src => js}/Contao.js | 0 {assets/maps/src => js}/Mixin.Attribution.js | 0 {assets/maps/src => js}/Mixin.GeoJSON.js | 0 {assets/maps/src => js}/Mixin.Map.js | 0 {assets/maps/src => js}/OverpassLayer.js | 0 src/Listener/LoadAssetsListener.php | 2 +- 10 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 assets/js/.keep delete mode 100644 assets/maps/contao-leaflet.js rename {assets/maps/src => js}/Contao.js (100%) rename {assets/maps/src => js}/Mixin.Attribution.js (100%) rename {assets/maps/src => js}/Mixin.GeoJSON.js (100%) rename {assets/maps/src => js}/Mixin.Map.js (100%) rename {assets/maps/src => js}/OverpassLayer.js (100%) diff --git a/.gitattributes b/.gitattributes index 06d085f..618a292 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,3 +8,4 @@ build.xml export-ignore phpunit.xml.dist export-ignore /tests export-ignore /specs export-ignore +/js export-ignore diff --git a/assets/js/.keep b/assets/js/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/assets/maps/contao-leaflet.js b/assets/maps/contao-leaflet.js deleted file mode 100644 index 9414982..0000000 --- a/assets/maps/contao-leaflet.js +++ /dev/null @@ -1 +0,0 @@ -L.Contao=L.Class.extend({includes:L.Mixin.Events,statics:{ATTRIBUTION:' | netzmacht'},maps:{},icons:{},initialize:function(){L.Icon.Default.imagePath="assets/leaflet/libs/leaflet/images/",this.setGeoJsonListeners(L.GeoJSON)},addMap:function(t,o){return this.maps[t]=o,this.fire("map:added",{id:t,map:o}),this},getMap:function(t){return"undefined"==typeof this.maps[t]?null:this.maps[t]},addIcon:function(t,o){return this.icons[t]=o,this.fire("icon:added",{id:t,icon:o}),this},loadIcons:function(t){for(var o=0;o=200&&t<300||304===t}function i(){void 0===a.status||n(a.status)?o.call(a,null,a):o.call(a,a,null)}var s=!1;if("undefined"==typeof window.XMLHttpRequest)return o(Error("Browser not supported"));if("undefined"==typeof e){var r=t.match(/^\s*https?:\/\/[^\/]*/);e=r&&r[0]!==location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")}var a=new window.XMLHttpRequest;if(e&&!("withCredentials"in a)){a=new window.XDomainRequest;var p=o;o=function(){if(s)p.apply(this,arguments);else{var t=this,o=arguments;setTimeout(function(){p.apply(t,o)},0)}}}return"onload"in a?a.onload=i:a.onreadystatechange=function(){4===a.readyState&&i()},a.onerror=function(t){o.call(this,t||!0,null),o=function(){}},a.onprogress=function(){},a.ontimeout=function(t){o.call(this,t,null),o=function(){}},a.onabort=function(t){o.call(this,t,null),o=function(){}},a.open("GET",t,!0),a.send(null),s=!0,a}}); \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index cd55cd9..c2f3cd3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -5,8 +5,8 @@ var concat = require('gulp-concat'); var paths = { minified: 'contao-leaflet.js', - scripts: ['assets/maps/src/*.js'], - dest: 'assets/maps' + scripts: ['js/*.js'], + dest: 'src/Resources/public/js' }; gulp.task('clear', function() { diff --git a/assets/maps/src/Contao.js b/js/Contao.js similarity index 100% rename from assets/maps/src/Contao.js rename to js/Contao.js diff --git a/assets/maps/src/Mixin.Attribution.js b/js/Mixin.Attribution.js similarity index 100% rename from assets/maps/src/Mixin.Attribution.js rename to js/Mixin.Attribution.js diff --git a/assets/maps/src/Mixin.GeoJSON.js b/js/Mixin.GeoJSON.js similarity index 100% rename from assets/maps/src/Mixin.GeoJSON.js rename to js/Mixin.GeoJSON.js diff --git a/assets/maps/src/Mixin.Map.js b/js/Mixin.Map.js similarity index 100% rename from assets/maps/src/Mixin.Map.js rename to js/Mixin.Map.js diff --git a/assets/maps/src/OverpassLayer.js b/js/OverpassLayer.js similarity index 100% rename from assets/maps/src/OverpassLayer.js rename to js/OverpassLayer.js diff --git a/src/Listener/LoadAssetsListener.php b/src/Listener/LoadAssetsListener.php index 58535d6..6ddf39e 100644 --- a/src/Listener/LoadAssetsListener.php +++ b/src/Listener/LoadAssetsListener.php @@ -72,7 +72,7 @@ class LoadAssetsListener public function onGetJavascriptEvent(): void { $this->assets->addJavascript( - 'web/bundles/netzmachtcontaoleaflet/js/contao-leaflet.js', + 'bundles/netzmachtcontaoleaflet/js/contao-leaflet.js', ContaoAssets::TYPE_FILE );