Skip to content

Commit

Permalink
Misc changes (#5117)
Browse files Browse the repository at this point in the history
* Remove unused images

- css/lib/images/tablesorter/asc.gif
- css/lib/images/tablesorter/bg.gif
- css/lib/images/tablesorter/desc.gif
- images/tvm-header-logo.png
- images/menu/menu-icons-black.png
- images/menu/menu-icons-white.png
- images/tablesorter/asc.gif
- images/tablesorter/bg.gif
- images/tablesorter/desc.gif
- images/glyphicons-config-black.png
- images/glyphicons-config-white.png
- images/glyphicons-halflings.png
- images/changelog16.png
- images/cancel32.png
- images/loading16_333333.gif
- images/loading16_dddddd.gif

* Remove `fix-broken-ie.js` shim

* Make `apiBuilder.mako` more like `main.mako`

Also:
- Remove unused `browserconfig.xml`
- Remove unused `sbThemeName`

* Update `restart.mako`

* Update webpack.config.js

* Remove unused meta tags

* Re add `theme-color` meta tag
  • Loading branch information
sharkykh authored and medariox committed Sep 7, 2018
1 parent 368b112 commit d1e7f87
Show file tree
Hide file tree
Showing 65 changed files with 416 additions and 537 deletions.
1 change: 0 additions & 1 deletion medusa/server/web/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def __init__(self, rh, filename):
'sbHttpsPort': app.WEB_PORT,
'sbHttpsEnabled': app.ENABLE_HTTPS,
'sbHandleReverseProxy': app.HANDLE_REVERSE_PROXY,
'sbThemeName': app.THEME_NAME,
'sbDefaultPage': app.DEFAULT_PAGE,
'loggedIn': rh.get_current_user(),
'sbStartTime': rh.startTime,
Expand Down
11 changes: 0 additions & 11 deletions themes-default/slim/static/css/browserconfig.xml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed themes-default/slim/static/images/cancel32.png
Binary file not shown.
Binary file removed themes-default/slim/static/images/changelog16.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed themes-default/slim/static/images/tablesorter/asc.gif
Binary file not shown.
Binary file removed themes-default/slim/static/images/tablesorter/bg.gif
Binary file not shown.
Binary file removed themes-default/slim/static/images/tablesorter/desc.gif
Binary file not shown.
Binary file not shown.
11 changes: 0 additions & 11 deletions themes-default/slim/static/js/lib/fix-broken-ie.js

This file was deleted.

270 changes: 129 additions & 141 deletions themes-default/slim/views/apiBuilder.mako

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions themes-default/slim/views/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- These values come from css/dark.css and css/light.css -->
% if app.THEME_NAME == "dark":
<meta name="theme-color" content="#333333">
% elif app.THEME_NAME == "light":
<meta name="theme-color" content="#333333">
% endif
<title>Medusa${(' - ' + title) if title and title != 'FixME' else ''}</title>
<base href="${base_url}">
<%block name="metas" />
Expand Down Expand Up @@ -95,7 +90,6 @@

<script type="text/javascript" src="js/vender${('.min', '')[app.DEVELOPER]}.js?${sbPID}"></script>
<script type="text/javascript" src="js/lib/bootstrap-formhelpers.min.js?${sbPID}"></script>
<script type="text/javascript" src="js/lib/fix-broken-ie.js?${sbPID}"></script>
<script type="text/javascript" src="js/lib/formwizard.js?${sbPID}"></script>
<script type="text/javascript" src="js/lib/lazyload.js?${sbPID}"></script>
<script type="text/javascript" src="js/lib/date_fns.min.js?${sbPID}"></script>
Expand Down
12 changes: 3 additions & 9 deletions themes-default/slim/views/restart.mako
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,22 @@ window.app = new Vue({
</style>
</%block>
<%block name="content">
<%
try:
themeSpinner = sbThemeName
except NameError:
themeSpinner = app.THEME_NAME
%>
<h2>{{ $route.meta.header }}</h2>
<div default-page="${sbDefaultPage}" current-pid="${sbPID}" class="messages">
<div id="shut_down_message">
Waiting for Medusa to shut down:
<img src="images/loading16-${themeSpinner}.gif" height="16" width="16" id="shut_down_loading" />
<img src="images/loading16-${app.THEME_NAME}.gif" height="16" width="16" id="shut_down_loading" />
<img src="images/yes16.png" height="16" width="16" id="shut_down_success" style="display: none;" />
</div>
<div id="restart_message" style="display: none;">
Waiting for Medusa to start again:
<img src="images/loading16-${themeSpinner}.gif" height="16" width="16" id="restart_loading" />
<img src="images/loading16-${app.THEME_NAME}.gif" height="16" width="16" id="restart_loading" />
<img src="images/yes16.png" height="16" width="16" id="restart_success" style="display: none;" />
<img src="images/no16.png" height="16" width="16" id="restart_failure" style="display: none;" />
</div>
<div id="refresh_message" style="display: none;">
Loading the default page:
<img src="images/loading16-${themeSpinner}.gif" height="16" width="16" id="refresh_loading" />
<img src="images/loading16-${app.THEME_NAME}.gif" height="16" width="16" id="refresh_loading" />
</div>
<div id="restart_fail_message" style="display: none;">
Error: The restart has timed out, perhaps something prevented Medusa from starting again?
Expand Down
22 changes: 20 additions & 2 deletions themes-default/slim/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ const VueLoaderPlugin = require('vue-loader/lib/plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const FileManagerPlugin = require('filemanager-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

const pkg = require('./package.json');

const { cssThemes } = pkg.config;

/**
* Helper function to queue actions for each theme.
*
* @param {function} action - Receives the `theme` object as a parameter. Should return an object.
* @returns {Object[]} - The actions for each theme.
*/
Expand All @@ -19,6 +21,7 @@ const perTheme = action => Object.values(cssThemes).map(theme => action(theme));
/**
* Helper function to simplify FileManagerPlugin configuration when copying assets from `./dist`.
* To be used in-conjunction-with `perTheme`.
*
* @param {string} type - Asset type (e.g. `js`, `css`, `fonts`). Must be the same as the folder name in `./dist`.
* @param {string} [search] - Glob-like string to match files. (default: `**`)
* @returns {function} - A function that receives the theme object from `perTheme` as a parameter.
Expand All @@ -32,6 +35,7 @@ const copyAssets = (type, search = '**') => {

/**
* Make a `package.json` for a theme.
*
* @param {string} themeName - Theme name
* @param {string} currentContent - Current package.json contents
* @returns {string} - New content
Expand All @@ -45,7 +49,14 @@ const makeThemeMetadata = (themeName, currentContent) => {
}, undefined, 2);
};

const webpackConfig = mode => ({
/**
* Generate the Webpack configuration object.
*
* @param {*} env - The environment data, as passed from the `--env` command line argument.
* @param {*} mode - The mode, as passed from the `--mode` command line argument.
* @returns {Object} Webpack configuration object.
*/
const webpackConfig = (env, mode) => ({
devtool: mode === 'production' ? 'source-map' : 'eval',
entry: {
// Exports all window. objects for mako files
Expand Down Expand Up @@ -222,4 +233,11 @@ const webpackConfig = mode => ({
]
});

module.exports = (_env, argv) => webpackConfig(argv.mode);
/**
* See: https://webpack.js.org/configuration/configuration-types/#exporting-a-function
*
* @param {*} env - An environment. See the environment options CLI documentation for syntax examples.
* @param {*} argv - An options map (argv). This describes the options passed to webpack, with keys such as output-filename and optimize-minimize.
* @returns {Object} - Webpack configuration object.
*/
module.exports = (env = {}, argv = {}) => webpackConfig(env, argv.mode || process.env.NODE_ENV);
11 changes: 0 additions & 11 deletions themes/dark/assets/css/browserconfig.xml

This file was deleted.

Binary file removed themes/dark/assets/css/lib/images/tablesorter/asc.gif
Binary file not shown.
Binary file removed themes/dark/assets/css/lib/images/tablesorter/bg.gif
Binary file not shown.
Binary file removed themes/dark/assets/css/lib/images/tablesorter/desc.gif
Binary file not shown.
Binary file removed themes/dark/assets/img/cancel32.png
Binary file not shown.
Binary file removed themes/dark/assets/img/changelog16.png
Binary file not shown.
Binary file removed themes/dark/assets/img/glyphicons-config-black.png
Binary file not shown.
Binary file removed themes/dark/assets/img/glyphicons-config-white.png
Binary file not shown.
Binary file removed themes/dark/assets/img/glyphicons-halflings.png
Binary file not shown.
Binary file removed themes/dark/assets/img/loading16_333333.gif
Binary file not shown.
Binary file removed themes/dark/assets/img/loading16_dddddd.gif
Diff not rendered.
Binary file removed themes/dark/assets/img/menu/menu-icons-black.png
Diff not rendered.
Binary file removed themes/dark/assets/img/menu/menu-icons-white.png
Diff not rendered.
Binary file removed themes/dark/assets/img/tablesorter/asc.gif
Diff not rendered.
Binary file removed themes/dark/assets/img/tablesorter/bg.gif
Diff not rendered.
Binary file removed themes/dark/assets/img/tablesorter/desc.gif
Diff not rendered.
Binary file removed themes/dark/assets/img/tvm-header-logo.png
Diff not rendered.
11 changes: 0 additions & 11 deletions themes/dark/assets/js/lib/fix-broken-ie.js

This file was deleted.

Loading

0 comments on commit d1e7f87

Please sign in to comment.