From bbefa32cd3908d08712a78588a5cf2c04130791c Mon Sep 17 00:00:00 2001 From: Tomer Brisker Date: Thu, 1 Sep 2016 16:21:40 +0300 Subject: [PATCH] Fixes #13936 - Drop support for legacy browsers This patch removes various workarounds needed to get legacy browsers to work. Mostly stuff needed for IE<10, but also some other vendor prefixes that are no longer needed. --- LICENSE | 1 - app/assets/javascripts/editor.js | 25 +- app/assets/stylesheets/application.scss | 12 +- app/assets/stylesheets/charts.scss | 5 +- app/assets/stylesheets/gridster.scss | 2 - app/assets/stylesheets/login.scss | 1 - app/assets/stylesheets/mixin.scss | 10 - .../stylesheets/patternfly_and_overrides.scss | 3 +- app/assets/stylesheets/topbar.scss | 7 +- app/assets/stylesheets/two_pane.scss | 3 +- app/assets/stylesheets/typography.scss | 14 +- app/assets/stylesheets/unimported/email.css | 2 +- app/views/home/_topbar.html.erb | 2 - app/views/layouts/base.html.erb | 7 +- config/initializers/assets.rb | 2 +- public/blank.html | 33 - vendor/assets/fonts/AllBullets.svg | 98084 ---------------- vendor/assets/fonts/AllBullets.ttf | Bin 1569164 -> 0 bytes vendor/assets/fonts/overpass_bold-web.eot | Bin 32369 -> 0 bytes vendor/assets/fonts/overpass_bold-web.svg | 470 - vendor/assets/fonts/overpass_bold-web.ttf | Bin 63656 -> 0 bytes vendor/assets/fonts/overpass_regular-web.eot | Bin 31030 -> 0 bytes vendor/assets/fonts/overpass_regular-web.svg | 470 - vendor/assets/fonts/overpass_regular-web.ttf | Bin 61808 -> 0 bytes vendor/assets/javascripts/background-size.htc | 7 - vendor/assets/stylesheets/jquery.jnotify.scss | 7 - vendor/assets/stylesheets/multi-select.scss | 8 +- 27 files changed, 22 insertions(+), 99153 deletions(-) delete mode 100644 app/assets/stylesheets/mixin.scss delete mode 100644 public/blank.html delete mode 100644 vendor/assets/fonts/AllBullets.svg delete mode 100644 vendor/assets/fonts/AllBullets.ttf delete mode 100755 vendor/assets/fonts/overpass_bold-web.eot delete mode 100755 vendor/assets/fonts/overpass_bold-web.svg delete mode 100755 vendor/assets/fonts/overpass_bold-web.ttf delete mode 100755 vendor/assets/fonts/overpass_regular-web.eot delete mode 100755 vendor/assets/fonts/overpass_regular-web.svg delete mode 100755 vendor/assets/fonts/overpass_regular-web.ttf delete mode 100644 vendor/assets/javascripts/background-size.htc diff --git a/LICENSE b/LICENSE index 0dcc7023e62..59831763891 100644 --- a/LICENSE +++ b/LICENSE @@ -23,7 +23,6 @@ If not, see [GNU licenses](http://www.gnu.org/licenses/). The following files and directories are exceptions: * app/views/unattended/ztp/provision.erb is (c) 2013, Juniper Networks under 2-clause BSD license. -* public/blank.html is (c) 2005, Brad Neuberg, bkn3@columbia.edu under MIT license. * lib/tasks/convert.rake is (c) 2008, Matson Systems, Inc. under Revised BSD license. * extras/noVNC/websockify is (c) 2011, Joel Martin under LGPL v3 license. * vendor/assets/fonts/ is (c) 2011-2016, Red Hat Inc. under SIL Open Font License v1.1 or LGPL v2.1 licenses. diff --git a/app/assets/javascripts/editor.js b/app/assets/javascripts/editor.js index 041b18d2b4f..4c8bfd472ba 100644 --- a/app/assets/javascripts/editor.js +++ b/app/assets/javascripts/editor.js @@ -27,18 +27,12 @@ $(document).on('change','#mode', function(){ function onEditorLoad(){ var editor_source = $(".editor_source"); - if ($.browser && $.browser.msie && $.browser.version.slice(0,1) < 10) { + if (editor_source.exists()){ + create_editor(); if ($('.diffMode').exists()) { - IE_diff_mode(editor_source); - } - }else{ - if (editor_source.exists()){ - create_editor(); - if ($('.diffMode').exists()) { - set_diff_mode(editor_source); - } else { - set_edit_mode(editor_source); - } + set_diff_mode(editor_source); + } else { + set_edit_mode(editor_source); } } } @@ -232,12 +226,6 @@ function submit_code() { } } -function IE_diff_mode(item){ - var patch = JsDiff.createPatch(item.attr('data-file-name'), $('#old').val(), $('#new').val()); - item.val(patch); - item.attr('readOnly', true); -} - function revert_template(item){ if (!confirm(__("You are about to override the editor content with a previous version, are you sure?"))) return; @@ -252,9 +240,6 @@ function revert_template(item){ if ($('#new').length) { $('#new').val(res.responseText); set_edit_mode($('.editor_source')); - } else { - // IE < 10 - $('.editor_source').val(res.responseText); } var time = $(item).closest('div.row').find('h6 span').attr('data-original-title'); $('#provisioning_template_audit_comment').text(Jed.sprintf(__("Revert to revision from: %s"), time)) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index de143399b8e..af3c01c930f 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -10,7 +10,6 @@ @import "multi-select"; @import "patternfly-sprockets"; @import "patternfly"; -@import "mixin"; @import "editable/bootstrap-editable"; @import "/*"; @@ -287,7 +286,7 @@ table { min-width: 720px; min-height: 400px; border: solid #222222 1px; - @include box-shadow(5px 5px 5px rgba(0, 0, 0, 0.2)); + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2); border-radius: 10px; } @@ -505,13 +504,7 @@ table { } .break-me { - white-space: -moz-pre-wrap; /* Mozilla */ - white-space: -hp-pre-wrap; /* HP printers */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: pre-wrap; /* CSS 2.1 */ - white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ - word-wrap: break-word; /* IE */ + white-space: pre-line; word-break: break-all; } @@ -564,7 +557,6 @@ table { .pre-scrollable-xy-modal { overflow: auto; - -ms-word-wrap: normal; word-wrap: normal; overflow-wrap: normal; white-space: pre; diff --git a/app/assets/stylesheets/charts.scss b/app/assets/stylesheets/charts.scss index 9358732da78..ae41de6aa23 100644 --- a/app/assets/stylesheets/charts.scss +++ b/app/assets/stylesheets/charts.scss @@ -1,5 +1,3 @@ -@import "mixin"; - .stats-well { border: 1px solid #d7d7d7; background-size: 100%; @@ -43,7 +41,7 @@ margin: 0 0 20px 20px; &:hover{ border-color:#0069d6; - @include box-shadow(0 1px 4px rgba(0, 105, 214, 0.25)); + box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); } } } @@ -125,7 +123,6 @@ .statistics-pie.small .overlay { background: image-url('pie_overlay.png') no-repeat; background-size: cover; - -ms-behavior: asset-url('background-size.htc'); z-index: 1; } diff --git a/app/assets/stylesheets/gridster.scss b/app/assets/stylesheets/gridster.scss index 8311fce4823..9107c567158 100644 --- a/app/assets/stylesheets/gridster.scss +++ b/app/assets/stylesheets/gridster.scss @@ -1,5 +1,3 @@ -@import "mixin"; - $row-height: 340px; $row-margin: 10px; diff --git a/app/assets/stylesheets/login.scss b/app/assets/stylesheets/login.scss index fac6d822032..8ecb94ed662 100644 --- a/app/assets/stylesheets/login.scss +++ b/app/assets/stylesheets/login.scss @@ -1,4 +1,3 @@ -@import "mixin"; @import "colors"; @media (min-width: 768px){ diff --git a/app/assets/stylesheets/mixin.scss b/app/assets/stylesheets/mixin.scss deleted file mode 100644 index 89dbee4a05c..00000000000 --- a/app/assets/stylesheets/mixin.scss +++ /dev/null @@ -1,10 +0,0 @@ -@mixin box-shadow($shadow...) { - -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1 - box-shadow: $shadow; -} - -@mixin linear_gradient($start_color, $end_color) { - background: $start_color; /* fallback for older browsers */ - background: -webkit-linear-gradient(top, $start_color 0%,$end_color 100%); - background: linear-gradient(to bottom, $start_color 0%,$end_color 100%); -} diff --git a/app/assets/stylesheets/patternfly_and_overrides.scss b/app/assets/stylesheets/patternfly_and_overrides.scss index ff4e09a24ed..c4ac5d5fc0e 100644 --- a/app/assets/stylesheets/patternfly_and_overrides.scss +++ b/app/assets/stylesheets/patternfly_and_overrides.scss @@ -1,4 +1,3 @@ -@import "mixin"; @import "colors"; $navbar-default-bg: $primary_color; @@ -172,7 +171,7 @@ a { padding: 19px; min-height: 460px; border: 1px solid $primary_gradient_start; - @include box-shadow(-2px 0 5px 0px rgba(0, 0, 0, 0.2)); + box-shadow: -2px 0 5px 0px rgba(0, 0, 0, 0.2); } .nav.nav-pills.nav-stacked .btn.btn-success:hover{ background-color: #47a447; diff --git a/app/assets/stylesheets/topbar.scss b/app/assets/stylesheets/topbar.scss index a12ee3c153f..f132bd7c2bf 100644 --- a/app/assets/stylesheets/topbar.scss +++ b/app/assets/stylesheets/topbar.scss @@ -1,4 +1,3 @@ -@import "mixin"; @import "colors"; .navbar { @@ -22,7 +21,7 @@ } .active > a, .open > a { - @include linear-gradient($hover_gradient_start, $hover_gradient_end); + background: linear-gradient(to bottom, $hover_gradient_start, $hover_gradient_end); } .navbar-header { @@ -119,7 +118,7 @@ top: 0; padding: 0 40px; - @include linear-gradient($primary_gradient_start, $primary_gradient_end); + background: linear-gradient(to bottom, $primary_gradient_start, $primary_gradient_end); .menu_tab_dropdown > a { padding-top: 10px; @@ -156,7 +155,7 @@ } .navbar-collapse.in{ - @include linear-gradient($primary_gradient_start, $primary_gradient_end); + background: linear-gradient(to bottom, $primary_gradient_start, $primary_gradient_end); margin-bottom: 0; margin-top: 0; diff --git a/app/assets/stylesheets/two_pane.scss b/app/assets/stylesheets/two_pane.scss index 79ec8d10459..2c2e0c35599 100644 --- a/app/assets/stylesheets/two_pane.scss +++ b/app/assets/stylesheets/two_pane.scss @@ -1,4 +1,3 @@ -@import "mixin"; @import "colors"; .table-two-pane{ @@ -23,7 +22,7 @@ background-color: #ffffff; border: 1px solid $primary_gradient_start; border-radius: 0; - @include box-shadow(-2px 0 5px 0px rgba(0, 0, 0, 0.2)); + box-shadow: -2px 0 5px 0px rgba(0, 0, 0, 0.2); } .tab-pane{ min-height: 300px; diff --git a/app/assets/stylesheets/typography.scss b/app/assets/stylesheets/typography.scss index 27611bce53e..dac18259631 100644 --- a/app/assets/stylesheets/typography.scss +++ b/app/assets/stylesheets/typography.scss @@ -1,10 +1,7 @@ @font-face { font-family: 'Overpass'; src: local("Overpass"), - font-url('overpass_regular-web.eot?#iefix') format("eot"), - font-url('overpass_regular-web.woff') format("woff"), - font-url('overpass_regular-web.ttf') format("truetype"), - font-url('overpass_regular-web.svg#webfontLTZe4IYH') format("svg"); + font-url('overpass_regular-web.woff') format("woff"); font-weight: normal; font-style: normal; } @@ -13,10 +10,7 @@ font-family: 'Overpass'; src: local("Overpass Bold"), local("OverpassBold"), - font-url('overpass_bold-web.eot?#iefix') format("eot"), - font-url('overpass_bold-web.woff') format("woff"), - font-url('overpass_bold-web.ttf') format("truetype"), - font-url('overpass_bold-web.svg#webfontzAU82Ltw') format("svg"); + font-url('overpass_bold-web.woff') format("woff"); font-weight: bold; font-style: normal; } @@ -24,9 +18,7 @@ @font-face { font-family: 'AllBullets'; src: local("AllBullets"), - font-url('AllBullets.woff') format("woff"), - font-url('AllBullets.ttf') format("truetype"), - font-url('AllBullets.svg') format("svg"); + font-url('AllBullets.woff') format("woff"); font-weight: normal; font-style: normal; } diff --git a/app/assets/stylesheets/unimported/email.css b/app/assets/stylesheets/unimported/email.css index f08485c7090..1f4ee50c4e4 100644 --- a/app/assets/stylesheets/unimported/email.css +++ b/app/assets/stylesheets/unimported/email.css @@ -23,7 +23,7 @@ th { text-align: left; border-collapse: collapse; background: #f5f5f5; - background-image: linear-gradient(#f5f5f5, #e8e8e8); + background-image: linear-gradient(to bottom, #f5f5f5, #e8e8e8); padding: 4px; border: 1px solid #cccccc; } diff --git a/app/views/home/_topbar.html.erb b/app/views/home/_topbar.html.erb index f12593e86bf..b8de79e29d7 100644 --- a/app/views/home/_topbar.html.erb +++ b/app/views/home/_topbar.html.erb @@ -2,9 +2,7 @@