Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed Sep 10, 2018
1 parent 5d6df07 commit 9a650aa
Show file tree
Hide file tree
Showing 10 changed files with 1,833 additions and 159 deletions.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/dist/d3-custom.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/dist/html/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
</div>
<script src="static/vendor/bootstrap-native3.mod.min.js"></script>
<script src="static/vendor/opentip-native.min.js"></script>
<script src="static/dist/vendor.58f107.js"></script>
<script src="static/dist/vendor.e3dcf1.js"></script>
<script src="static/dist/d3-custom.min.js"></script>
<script src="static/dist/app.58f107.js"></script>
<script src="static/dist/app.e3dcf1.js"></script>
</body>
</html>
File renamed without changes.
401 changes: 260 additions & 141 deletions client/js/legend.js

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions client/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@ Promise.config({
// };
// };
global.i18next = i18next;
global._tr = function(...args) { return i18next.t(...args); };
global.encodeId = layer_name => (layer_name !== '')
global._tr = (...args) => i18next.t(...args);
global.encodeId = layer_name => ((layer_name !== '')
? `L_${layer_name.replace(/[^a-zA-Z0-9_-]/g, match => `_${match[0].charCodeAt(0).toString(16)}_`)}`
: 'L_';
// global.encodeId = function(s) {
// if (s === '') return 'L_';
// return `L_${s.replace(/[^a-zA-Z0-9_-]/g, match => `_${match[0].charCodeAt(0).toString(16)}_`)}`;
// }
: 'L_');

global._app = {
current_functionnality: undefined,
Expand All @@ -64,7 +60,7 @@ global._app = {
id_to_layer: new Map([[encodeId('World'), 'World'], [encodeId('Graticule'), 'Graticule']]),
targeted_layer_added: false,
to_cancel: undefined,
version: MAGRIT_VERSION,
version: MAGRIT_VERSION, // eslint-disable-line no-undef
};

global.w = Mround(window.innerWidth - 361);
Expand Down Expand Up @@ -134,7 +130,7 @@ function getEpsgProjection() {
return xhrequest('GET', 'static/json/epsg.json', undefined, false);
}

(function () {
(() => {
Object.assign(global, makeSvgMap());
// const { map_div, map, svg_map, defs } = makeSvgMap();
// global.map_div = map_div;
Expand Down
6 changes: 3 additions & 3 deletions client/js/map_export.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ function patchSvgForFonts() {
const fonts_definitions = Array.prototype.filter.call(
document.styleSheets,
i => (i.href && i.href.indexOf('style-fonts.css') > -1 ? i : null),
)[0].cssRules;
const fonts_to_add = needed_definitions.map(
name => String(fonts_definitions[custom_fonts.indexOf(name)].cssText));
)[0].cssRules;
const fonts_to_add = needed_definitions
.map(name => String(fonts_definitions[custom_fonts.indexOf(name)].cssText));
const style_elem = document.createElement('style');
style_elem.innerHTML = fonts_to_add.join(' ');
svg_map.querySelector('defs').appendChild(style_elem);
Expand Down
722 changes: 722 additions & 0 deletions magrit_app/static/dist/app.e3dcf1.js

Large diffs are not rendered by default.

836 changes: 836 additions & 0 deletions magrit_app/static/dist/vendor.e3dcf1.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions magrit_app/static/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
</div>
<script src="static/vendor/bootstrap-native3.mod.min.js"></script>
<script src="static/vendor/opentip-native.min.js"></script>
<script src="static/dist/vendor.58f107.js"></script>
<script src="static/dist/vendor.e3dcf1.js"></script>
<script src="static/dist/d3-custom.min.js"></script>
<script src="static/dist/app.58f107.js"></script>
<script src="static/dist/app.e3dcf1.js"></script>
</body>
</html>

0 comments on commit 9a650aa

Please sign in to comment.