Skip to content

Commit

Permalink
Transform main code to ES6 modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gberaudo committed May 6, 2019
1 parent 1655829 commit 96acb46
Show file tree
Hide file tree
Showing 133 changed files with 1,644 additions and 1,249 deletions.
12 changes: 8 additions & 4 deletions geoportailv3/static/js/activetool.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/**
* @module app.Activetool
*/
/**
* @fileoverview This file provides an Angular service to share which tool is
* active.
*/
goog.module('app.Activetool');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');
import appModule from './module.js';

/**
* @param {app.draw.SelectedFeatures} appSelectedFeatures Selected features service.
* @constructor
* @ngInject
*/
exports = function(appSelectedFeatures) {
const exports = function(appSelectedFeatures) {

/**
* @type {ol.Collection<ol.Feature>}
Expand Down Expand Up @@ -46,3 +47,6 @@ exports.prototype.isActive = function() {
};

appModule.service('appActivetool', exports);


export default exports;
13 changes: 8 additions & 5 deletions geoportailv3/static/js/askredirect/askredirectcontroller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
goog.module('app.askredirect.AskredirectController');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');
/**
* @module app.askredirect.AskredirectController
*/
import appModule from '../module.js';

/**
* @constructor
Expand All @@ -10,7 +10,7 @@ const appModule = goog.require('app.module');
* @export
* @ngInject
*/
exports = function($window, ngeoLocation) {
const exports = function($window, ngeoLocation) {
/**
* @type {angular.$window}
* @private
Expand Down Expand Up @@ -44,3 +44,6 @@ exports.prototype.redirect = function() {

appModule.controller('AppAskredirectController',
exports);


export default exports;
14 changes: 9 additions & 5 deletions geoportailv3/static/js/askredirect/askredirectdirective.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
goog.module('app.askredirect.askredirectDirective');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');
/**
* @module app.askredirect.askredirectDirective
*/
import appModule from '../module.js';

/**
* @param {string} appAskredirectTemplateUrl URL to directive template.
* @return {angular.Directive} The Directive Definition Object.
* @ngInject
*/
exports = function(appAskredirectTemplateUrl) {
const exports = function(appAskredirectTemplateUrl) {
return {
restrict: 'E',
scope: {
Expand All @@ -20,4 +20,8 @@ exports = function(appAskredirectTemplateUrl) {
templateUrl: appAskredirectTemplateUrl
};
};

appModule.directive('appAskredirect', exports);


export default exports;
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
goog.module('app.authentication.AuthenticationController');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');

/**
* @module app.authentication.AuthenticationController
*/
import appModule from '../module.js';

/**
* @param {app.UserManager} appUserManager The usermanager service.
* @constructor
* @export
* @ngInject
*/
exports = function(appUserManager) {
const exports = function(appUserManager) {

/**
* @type {app.UserManager}
Expand Down Expand Up @@ -91,3 +90,6 @@ exports.prototype.getUsername = function() {

appModule.controller('AppAuthenticationController',
exports);


export default exports;
14 changes: 8 additions & 6 deletions geoportailv3/static/js/authentication/authenticationdirective.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
goog.module('app.authentication.authenticationDirective');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');

/**
* @module app.authentication.authenticationDirective
*/
import appModule from '../module.js';

/**
* @param {string} appAuthenticationTemplateUrl URL to directive template.
* @return {angular.Directive} The Directive Definition Object.
* @ngInject
*/
exports = function(appAuthenticationTemplateUrl) {
const exports = function(appAuthenticationTemplateUrl) {
return {
restrict: 'E',
scope: {
Expand All @@ -24,3 +23,6 @@ exports = function(appAuthenticationTemplateUrl) {
};

appModule.directive('appAuthentication', exports);


export default exports;
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @module app.backgroundlayer.BackgroundlayerController
*/
/**
* @fileoverview This file provides the "backgroundlayer" directive. This
* directive is used to create a dropdown for selecting the map's background
Expand All @@ -13,12 +16,9 @@
* One-time binding is used because we know the map is not going to change
* during the lifetime of the application.
*/
goog.module('app.backgroundlayer.BackgroundlayerController');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');
const olEvents = goog.require('ol.events');

import appModule from '../module.js';
import olEvents from 'ol/events.js';

/**
* @constructor
Expand All @@ -28,7 +28,7 @@ const olEvents = goog.require('ol.events');
* @export
* @ngInject
*/
exports = function(ngeoBackgroundLayerMgr, appThemes) {
const exports = function(ngeoBackgroundLayerMgr, appThemes) {

/**
* @type {ngeo.map.BackgroundLayerMgr}
Expand Down Expand Up @@ -65,3 +65,6 @@ exports.prototype.setLayer = function(layer) {

appModule.controller('AppBackgroundlayerController',
exports);


export default exports;
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @module app.backgroundlayer.backgroundlayerDirective
*/
/**
* @fileoverview This file provides the "backgroundlayer" directive. This
* directive is used to create a dropdown for selecting the map's background
Expand All @@ -13,19 +16,16 @@
* One-time binding is used because we know the map is not going to change
* during the lifetime of the application.
*/
goog.module('app.backgroundlayer.backgroundlayerDirective');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');

import appModule from '../module.js';

/**
* @param {string} appBackgroundlayerTemplateUrl URL to backgroundlayer
* template.
* @return {angular.Directive} The Directive Definition Object.
* @ngInject
*/
exports = function(appBackgroundlayerTemplateUrl) {
const exports = function(appBackgroundlayerTemplateUrl) {
return {
restrict: 'E',
scope: {
Expand All @@ -40,3 +40,6 @@ exports = function(appBackgroundlayerTemplateUrl) {


appModule.directive('appBackgroundlayer', exports);


export default exports;
15 changes: 9 additions & 6 deletions geoportailv3/static/js/backgroundlayer/blanklayer.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/**
* @module app.backgroundlayer.BlankLayer
*/
/**
* @fileoverview This file defines the Blank Layer service. This service
* creates an empty layer and the corresponding spec.
*/
goog.module('app.backgroundlayer.BlankLayer');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');
const olLayerTile = goog.require('ol.layer.Tile');

import appModule from '../module.js';
import olLayerTile from 'ol/layer/Tile.js';

/**
* @constructor
* @param {angularGettext.Catalog} gettextCatalog Gettext service.
* @ngInject
*/
exports = function(gettextCatalog) {
const exports = function(gettextCatalog) {

/**
* @typedef {ol.layer.Tile}
Expand All @@ -35,3 +35,6 @@ exports.prototype.getLayer = function() {
};

appModule.service('appBlankLayer', exports);


export default exports;
21 changes: 12 additions & 9 deletions geoportailv3/static/js/catalog/catalogcontroller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @module app.catalog.CatalogController
*/
/**
* @fileoverview This file provides the "catalog" directive. That directive is
* used to create the catalog tree in the page. It is based on the
Expand All @@ -13,15 +16,12 @@
* One-time binding is used because we know the map is not going to change
* during the lifetime of the application.
*/
goog.module('app.catalog.CatalogController');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');
const appEventsThemesEventType = goog.require('app.events.ThemesEventType');
const olEvents = goog.require('ol.events');
const olProj = goog.require('ol.proj');
const olView = goog.require('ol.View');

import appModule from '../module.js';
import appEventsThemesEventType from '../events/ThemesEventType.js';
import olEvents from 'ol/events.js';
import olProj from 'ol/proj.js';
import olView from 'ol/View.js';

/**
* @constructor
Expand All @@ -36,7 +36,7 @@ const olView = goog.require('ol.View');
* @export
* @ngInject
*/
exports = function($scope, appThemes, appTheme,
const exports = function($scope, appThemes, appTheme,
appGetLayerForCatalogNode, appScalesService, maxExtent, appStateManager) {
/**
* @type {app.StateManager}
Expand Down Expand Up @@ -175,3 +175,6 @@ exports.prototype.toggle = function(node) {


appModule.controller('AppCatalogController', exports);


export default exports;
13 changes: 8 additions & 5 deletions geoportailv3/static/js/catalog/catalogdirective.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @module app.catalog.catalogDirective
*/
/**
* @fileoverview This file provides the "catalog" directive. That directive is
* used to create the catalog tree in the page. It is based on the
Expand All @@ -13,16 +16,13 @@
* One-time binding is used because we know the map is not going to change
* during the lifetime of the application.
*/
goog.module('app.catalog.catalogDirective');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');

import appModule from '../module.js';

/**
* @return {angular.Directive} The Directive Definition Object.
*/
exports = function() {
const exports = function() {
return {
restrict: 'E',
scope: {
Expand All @@ -40,3 +40,6 @@ exports = function() {


appModule.directive('appCatalog', exports);


export default exports;
19 changes: 12 additions & 7 deletions geoportailv3/static/js/coordinatestringservice.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/**
* @module app.CoordinateStringService
*/
let exports = {};

/**
* @fileoverview Provides a coordinate string output service, useful for
* correctly formatted coordinate strings in different projections.
*/

goog.module('app.CoordinateStringService');

goog.module.declareLegacyNamespace();
const appModule = goog.require('app.module');
const olCoordinate = goog.require('ol.coordinate');
const olProj = goog.require('ol.proj');
const olString = goog.require('ol.string');
import appModule from './module.js';
import olCoordinate from 'ol/coordinate.js';
import olProj from 'ol/proj.js';
import olString from 'ol/string.js';


/**
Expand Down Expand Up @@ -136,3 +138,6 @@ function service() {


appModule.service('appCoordinateString', service);


export default exports;
Loading

0 comments on commit 96acb46

Please sign in to comment.