diff --git a/alouette.py b/alouette.py index cb108c5..92323cd 100644 --- a/alouette.py +++ b/alouette.py @@ -104,38 +104,48 @@ def interpolate_index(self, **kwargs): scripts = ASSET_PATH.joinpath("scripts.js").resolve() -# external_stylesheets = ['https://wet-boew.github.io/themes-dist/GCWeb/assets/favicon.ico', -# 'https://use.fontawesome.com/releases/v5.8.1/css/all.css', -# 'https://wet-boew.github.io/themes-dist/GCWeb/css/theme.min.css', -# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/css/noscript.min.css'] # Link to external CSS +external_stylesheets = [ + 'https://canada.ca/etc/designs/canada/wet-boew/css/wet-boew.min.css', + 'https://canada.ca/etc/designs/canada/wet-boew/css/theme.min.css', + 'https://use.fontawesome.com/releases/v5.8.1/css/all.css' + # 'assets/gc_theme_cdn/assets/favicon.ico', + # 'https://use.fontawesome.com/releases/v5.8.1/css/all.css', + # 'assets/gc_theme_cdn/css/theme.min.css', + # 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/css/noscript.min.css' +] # Link to external CSS + +external_scripts = [ + # 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js', + # 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/wet-boew.min.js', + # 'assets/gc_theme_cdn/js/theme.min.js', + # 'https://cdn.plot.ly/plotly-locale-de-latest.js', + '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js', + 'https://canada.ca/etc/designs/canada/wet-boew/js/wet-boew.min.js', + 'https://canada.ca/etc/designs/canada/wet-boew/js/theme.min.js', + 'assets/scripts.js' + + +] # external_stylesheets = [ -# # 'assets/gc_theme/GCWeb/assets/favicon.ico', +# # 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/assets/favicon.ico', # 'https://use.fontawesome.com/releases/v5.8.1/css/all.css', -# # 'assets/gc_theme/GCWeb/css/theme.min.css', +# 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/css/theme.min.css', +# 'assets/custom.css' # # 'assets/gc_theme/wet-boew/css/noscript.min.css', # # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js' # ] # Link to external CSS -external_stylesheets = [ - # 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/assets/favicon.ico', - 'https://use.fontawesome.com/releases/v5.8.1/css/all.css', - 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/css/theme.min.css', - 'assets/custom.css' - # 'assets/gc_theme/wet-boew/css/noscript.min.css', - # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js' - ] # Link to external CSS - -external_scripts = [ - 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js', - 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/i18n/en.min.js', - 'https://cdn.plot.ly/plotly-locale-de-latest.js', - 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/deps/jquery.magnific-popup.min.js', - 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/js/theme.min.js', - 'assets/scripts.js', - # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js', - # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/soyutils.js' -] +# external_scripts = [ +# 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js', +# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/i18n/en.min.js', +# 'https://cdn.plot.ly/plotly-locale-de-latest.js', +# 'https://wet-boew.github.io/themes-dist/GCWeb/wet-boew/js/deps/jquery.magnific-popup.min.js', +# 'https://wet-boew.github.io/themes-dist/GCWeb/GCWeb/js/theme.min.js', +# 'assets/scripts.js', +# # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/wet-en.js', +# # 'https://www.canada.ca/etc/designs/canada/cdts/gcweb/v4_0_30/cdts/compiled/soyutils.js' +# ] def get_config_dict(): config = configparser.RawConfigParser() @@ -567,9 +577,6 @@ def build_filtering(): # marks=year_dict # ), html.Div([ - html.Label( - htmlFor='date_picker_range' - ), dcc.DatePickerRange( id='date_picker_range', min_date_allowed=dt.datetime(1962, 9, 29), @@ -614,7 +621,13 @@ def build_filtering(): ), html.Div(children=html.P(id="ground_station_selection"),className="wb-inv")]), html.Div([ - dbc.Alert(color="secondary", id="pos_alert", is_open=False, fade=False, style={"margin-top":"0.5em"}), + dbc.Alert( + color="secondary", + id="pos_alert", + is_open=False, + fade=False, + style={"margin-top":"0.5em"} + ), ]), ], @@ -2059,6 +2072,8 @@ def make_viz_map(start_date, end_date, stat_selection, var_selection, lat_min, l Output("Graph_description-2", "children"), Output("stat-selection-text", "children"), Output("stat-y-axis-text", "children"), + Output("date_picker_range", "start_date_placeholder_text"), + Output("date_picker_range", "end_date_placeholder_text"), Output("ground_station_list", "options"), Output("x_axis_selection_1", "options"), Output("y_axis_selection_1", "options"), @@ -2101,6 +2116,8 @@ def translate_static(x): _("Map showing either minimum frequency or maximum depth values at each ground station. Each station is represented by a circle, the size of which depends on either the mean or median values of the variables selected. Explore the data by selecting different variables in the drop-down menu on the right."), _("Select statistic:"), _("Select plotted value:"), + _("Select start date"), + _("Select end date"), [ # Ground_station_options {'label': _('Resolute Bay, No. W. Territories'), 'value': 'Resolute Bay, No. W. Territories'}, {'label': _('Blossom Point, Maryland'), 'value': 'Blossom Point, Maryland'}, diff --git a/assets/compiled.css b/assets/compiled.css index 329d6ae..3ab1525 100644 --- a/assets/compiled.css +++ b/assets/compiled.css @@ -218,8 +218,6 @@ input[type="button"] { font-size: 13px; } - -} .button:hover, button:hover, input[type="submit"]:hover, diff --git a/assets/scripts.js b/assets/scripts.js index d6daa19..6b42c0f 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -3,6 +3,14 @@ const expected_canvas_count = 8; $(document).ready(function(){ var canvas_check = setInterval(checkForCanvases, 3000); + var css_fixer = setInterval(removeBaddCss, 3500); + + var ariaFixes = setInterval(function(){ + var dropdowns = $('.Select-input input'); + dropdowns.removeAttr('aria-owns'); + $('.Select-input').attr('role', 'option'); + }, 3000); + // Callback function to execute when mutations are observed const callback = function(mutationsList, observer) { // Use traditional 'for loops' for IE 11 @@ -17,6 +25,17 @@ $(document).ready(function(){ } }; + function removeBaddCss(){ + $("head").find('style').each(function () { + // console.log('removing css'); + html = $(this).html(); + if(html.match(/border-color:\s*transparent\s*inherit\s*transparent\s*transparent\s*!important/gm)){ + $(this).html( html.replace(/border-color:\s*transparent\s*inherit\s*transparent\s*transparent\s*!important/gm,"") ); + } + }); + + } + // Create an observer instance linked to the callback function const observer = new MutationObserver(callback); diff --git a/header_footer.py b/header_footer.py index 8a6bf75..8726ba6 100644 --- a/header_footer.py +++ b/header_footer.py @@ -448,6 +448,14 @@ ''' gc_header_en = ''' +