Skip to content

Commit

Permalink
Fixes #13936 - Drop support for legacy browsers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tbrisker authored and dLobatog committed Sep 15, 2016
1 parent 8096335 commit bbefa32
Show file tree
Hide file tree
Showing 27 changed files with 22 additions and 99,153 deletions.
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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, [email protected] 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.
Expand Down
25 changes: 5 additions & 20 deletions app/assets/javascripts/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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;

Expand All @@ -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))
Expand Down
12 changes: 2 additions & 10 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
@import "multi-select";
@import "patternfly-sprockets";
@import "patternfly";
@import "mixin";
@import "editable/bootstrap-editable";
@import "/*";

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -564,7 +557,6 @@ table {

.pre-scrollable-xy-modal {
overflow: auto;
-ms-word-wrap: normal;
word-wrap: normal;
overflow-wrap: normal;
white-space: pre;
Expand Down
5 changes: 1 addition & 4 deletions app/assets/stylesheets/charts.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "mixin";

.stats-well {
border: 1px solid #d7d7d7;
background-size: 100%;
Expand Down Expand Up @@ -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);
}
}
}
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions app/assets/stylesheets/gridster.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "mixin";

$row-height: 340px;
$row-margin: 10px;

Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/login.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "mixin";
@import "colors";

@media (min-width: 768px){
Expand Down
10 changes: 0 additions & 10 deletions app/assets/stylesheets/mixin.scss

This file was deleted.

3 changes: 1 addition & 2 deletions app/assets/stylesheets/patternfly_and_overrides.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "mixin";
@import "colors";

$navbar-default-bg: $primary_color;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 3 additions & 4 deletions app/assets/stylesheets/topbar.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "mixin";
@import "colors";

.navbar {
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions app/assets/stylesheets/two_pane.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "mixin";
@import "colors";

.table-two-pane{
Expand All @@ -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;
Expand Down
14 changes: 3 additions & 11 deletions app/assets/stylesheets/typography.scss
Original file line number Diff line number Diff line change
@@ -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;
}
Expand All @@ -13,20 +10,15 @@
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;
}

@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;
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/unimported/email.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions app/views/home/_topbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<div class="navbar-header">
<div class="container">
<div class="navbar-brand">
<!--[if IE]><div class='logo-small'> <![endif]-->
<%= image_tag("header_logo.png") %>
<!--[if IE]></div> <![endif]-->
<%= link_to "Foreman", main_app.root_path %>
</div>
<div id="turbolinks-progress"><div class="spinner spinner-inverse"></div></div>
Expand Down
7 changes: 2 additions & 5 deletions app/views/layouts/base.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="<%= I18n.locale %>" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="<%= I18n.locale %>" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html lang="<%= I18n.locale %>" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="<%= I18n.locale %>" class="no-js"> <!--<![endif]-->
<html lang="<%= I18n.locale %>" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
Expand Down Expand Up @@ -43,7 +40,7 @@
</head>

<body>
<!--[if lt IE 8]>
<!--[if lte IE 9]>
<%= _('You are using an unsupported browser.') %>
<![endif]-->
<%= render "home/topbar" if User.current %>
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

# Precompile additional assets
config.assets.precompile << /\.(?:svg|eot|woff|gif|ttf)$/
config.assets.precompile += javascript.map { |js| js + '.js' } + stylesheets + images + %w(background-size.htc)
config.assets.precompile += javascript.map { |js| js + '.js' } + stylesheets + images

# Adds plugin assets to the application digests hash if a manifest file exists for a plugin
config.after_initialize do
Expand Down
33 changes: 0 additions & 33 deletions public/blank.html

This file was deleted.

Loading

0 comments on commit bbefa32

Please sign in to comment.