Skip to content

Commit

Permalink
Some codestyle and css fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jul 24, 2018
1 parent f34ed31 commit 65c5bee
Show file tree
Hide file tree
Showing 20 changed files with 60 additions and 64 deletions.
6 changes: 2 additions & 4 deletions buildtools/webpack.gmfapps.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const plugins = [];
const entry = {};

const filenamePrefix = process.env.DEV_SERVER ? 'contribs/gmf/apps/' : '';
const name = process.env.APP
const name = process.env.APP;

const folder = `contribs/gmf/apps/${name}`;
entry[name] = `./${folder}/Controller.js`;
Expand All @@ -17,7 +15,7 @@ plugins.push(
template: `${folder}/index.html.ejs`,
inject: false,
chunksSortMode: 'manual',
filename: filenamePrefix + name + '.html',
filename: `${filenamePrefix}${name}.html`,
chunks: ['commons', name]
})
);
Expand Down
1 change: 0 additions & 1 deletion buildtools/webpack.gmfexamples.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path');
const ls = require('ls');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const plugins = [];
Expand Down
3 changes: 1 addition & 2 deletions buildtools/webpack.ngeoexamples.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path');
const ls = require('ls');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

Expand All @@ -21,7 +20,7 @@ for (const filename of ls('examples/*.html')) {
new HtmlWebpackPlugin({
template: `examples/${name}.html`,
chunksSortMode: 'manual',
filename: exampleFilenamePrefix + name + '.html',
filename: `${exampleFilenamePrefix}${name}.html`,
chunks: ['commons', name],
})
);
Expand Down
68 changes: 34 additions & 34 deletions buildtools/webpack.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,22 @@ class SassPlugin {
}
try {
const assetUrl = url.getValue();

if (assetUrl.startsWith('~')) {
let assetName = url.getValue().substr(1);
let queryString = '';
const questionMarkIndex = assetName.indexOf('?');
if (questionMarkIndex > 0) {
queryString = assetName.substr(questionMarkIndex);
assetName = assetName.substr(0, questionMarkIndex);
} else {
const sharpIndex = assetName.indexOf('#');
if (sharpIndex > 0) {
queryString = assetName.substr(sharpIndex);
assetName = assetName.substr(0, sharpIndex);
}
let assetName = url.getValue().substr(1);
let queryString = '';
const questionMarkIndex = assetName.indexOf('?');
if (questionMarkIndex > 0) {
queryString = assetName.substr(questionMarkIndex);
assetName = assetName.substr(0, questionMarkIndex);
} else {
const sharpIndex = assetName.indexOf('#');
if (sharpIndex > 0) {
queryString = assetName.substr(sharpIndex);
assetName = assetName.substr(0, sharpIndex);
}
promises.push(new Promise((resolve, reject) => {
}

promises.push(new Promise((resolve, reject) => {
if (assetUrl.startsWith('~')) {
usedContext.resolve(usedContext.resourcePath, assetName, (err, resolvedFile) => {
if (err) {
console.log(err);
Expand All @@ -318,25 +317,26 @@ class SassPlugin {
});
}
});
}));
} else {
fs.readFile(assetName, 'utf8', (err, data) => {
if (err) {
console.log(err);
reject(err);
} else {
usedContext.resourcePath = assetName;
const name = loaderUtils.interpolateName(usedContext, pluginOptions.assetname, {
content: data
});
compilation.assets[name] = {
source: () => data,
size: () => data.length
};
replacements[assetUrl] = name + queryString;
}
});
}
} else {
fs.readFile(assetName, 'utf8', (err, data) => {
if (err) {
console.log(err);
reject(err);
} else {
usedContext.resourcePath = assetName;
const name = loaderUtils.interpolateName(usedContext, pluginOptions.assetname, {
content: data
});
compilation.assets[name] = {
source: () => data,
size: () => data.length
};
replacements[assetUrl] = name + queryString;
resolve();
}
});
}
}));
} catch (e) {
console.error(e.stack || e);
}
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/contextualdata/contextualdata.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

.popover.gmf-contextualdata {
width: 25rem;
Expand Down
10 changes: 8 additions & 2 deletions contribs/gmf/src/controllers/desktop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ $search-results-max-height: calc(100vh - $topbar-height + $map-tools-size + (2 *

$border-color: darken($brand-primary, $standard-variation) !default;

@import "~bootstrap/scss/_functions.scss";
@import "~bootstrap/scss/_variables.scss";
@import "~font-awesome/scss/_variables.scss";

@import '~gmf/sass/font.scss';
@import '~gmf/sass/base.scss';
@import '~gmf/sass/map.scss';
Expand Down Expand Up @@ -93,7 +97,7 @@ $footer-height: $input-height-base + 2 * $padding-base-vertical;
bottom: -$footer-height;
// prevent footer to be displayed on 2 lines when screen width is small
max-height: $footer-height;
background-color: fade($main-bg-color, 90%);
background-color: rgba($main-bg-color, .9);
width: 100%;
/* cancel default navbar bottom margin */
margin-bottom: 0;
Expand All @@ -112,9 +116,11 @@ $footer-height: $input-height-base + 2 * $padding-base-vertical;
position: absolute;
/* button is supposed to be .btn-sm */
bottom: $footer-height - 1;
background-color: fade($main-bg-color, 80%);
border-top-left-radius: $border-radius-base;
border-top-right-radius: $border-radius-base;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-color: rgba($main-bg-color, .8);
padding: 0;
left: 50%;
$width: 2.50rem;
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/controllers/mobile-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ main {
top: 0;
left: 0;
cursor: pointer;
background-color: fade($color, 40%);
background-color: rgba($color, .4);
visibility: hidden;
opacity: 0;

Expand Down
10 changes: 10 additions & 0 deletions contribs/gmf/src/controllers/mobile.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
/**
* Entry point for all styles required for the mobile application.
*/

$search-width: 6 * $map-tools-size !default;
$border-color: black !default;

@import '~gmf/sass/vars.scss';

@import "~bootstrap/scss/_functions.scss";
@import "~bootstrap/scss/_variables.scss";
@import "~font-awesome/scss/_variables.scss";

@import '~gmf/sass/font.scss';
@import '~gmf/sass/base.scss';
@import '~gmf/sass/map.scss';
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/import/import.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "~font-awesome/scss/_variables.scss";
@import "~gmf/sass/typeahead.scss";
@import "~gmf/sass/vars.scss";

gmf-importdatasource {
input[type=file] {
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/layertree/common.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

.gmf-layertree-root-tools {
text-align: right;
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/layertree/timeslider.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '~gmf/sass/input-range.scss';
@import '~gmf/sass/vars.scss';

.gmf-time-slider {

Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/lidarprofile/lidarprofile.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

$lidarprofile-height: 21.88rem;
$profile-legend-width: 9.38rem;
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/profile/profile.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

$profile-height: 12.50rem;
.panel.gmf-profile-container {
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/query/grid.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

$grid-height: 15.62rem;
$table-height: $grid-height - $app-margin - 2 * $map-tools-size;
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/query/window.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

$displayquerywindow-tablet-width: 8 * $map-tools-size;
$displayquerywindow-detailed-header-height: 3.12rem;
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/sass/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
@import '~gmf/css/reset.css';
@import '~bootstrap/scss/bootstrap.scss';

@import '~gmf/sass/vars.scss';

html, body {
height: 100%;
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/sass/input-range.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

$gmf-input-range-track-box-shadow : 0.06rem 0.06rem 0.06rem rgba(0, 0, 0, 0), 0 0 0.06rem rgba(13, 13, 13, 0);
$gmf-input-range-track-height: 0.31rem;
Expand Down
1 change: 0 additions & 1 deletion contribs/gmf/src/sass/typeahead.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "~gmf/sass/vars.scss";

.twitter-typeahead {
width: 100%;
Expand Down
10 changes: 2 additions & 8 deletions contribs/gmf/src/sass/vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ $map-tools-size: 2.50rem !default;
$onhover-color: darken($nav-bg, $standard-variation) !default;
$main-bg-color: #e2e3df !default; // grey light

$search-width: 6 * $map-tools-size;

// Z-indexes
$below-content-index: 1;
Expand All @@ -34,9 +33,8 @@ $above-all: 9999;

$nav-width: 20rem !default;

$border-radius-base: 0 !default;
$border-radius-small: 0 !default;
$border-color: black !default;
$border-radius-base: 2px !default;
$border-radius-small: 1px !default;
$input-border-focus: darken($brand-primary, $standard-variation) !default;

// Bootstrap 3 compatibility layer
Expand All @@ -47,7 +45,3 @@ $padding-small-horizontal: 0.72rem !default;
$input-height-base: 1.5rem !default;
$btn-default-border: #ccc !default;
$text-color: $gray-dark !default;

@import "~bootstrap/scss/_functions.scss";
@import "~bootstrap/scss/_variables.scss";
@import "~font-awesome/scss/_variables.scss";
3 changes: 2 additions & 1 deletion contribs/gmf/src/search/search.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
@import "~font-awesome/scss/_variables.scss";
@import "~gmf/sass/vars.scss";
@import "~gmf/sass/typeahead.scss";

$search-results-max-height: calc(100vh - 6 * $app-margin);

gmf-search {
top: $app-margin;
z-index: $content-index;
border-color: $border-color;
border-radius: $border-radius-base;

& > * {
display: inline-block;
Expand Down

0 comments on commit 65c5bee

Please sign in to comment.