From 8765b9a084e8d2eb05f1691ca926986e2c353a9c Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 1 Mar 2019 10:31:52 -0700 Subject: [PATCH] Change diff colors to match github, provided by Ralf --- api/js/etemplate/et2_widget_diff.js | 4 ++-- api/templates/default/etemplate2.css | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/api/js/etemplate/et2_widget_diff.js b/api/js/etemplate/et2_widget_diff.js index 1aea479e37..24ab728b27 100644 --- a/api/js/etemplate/et2_widget_diff.js +++ b/api/js/etemplate/et2_widget_diff.js @@ -47,7 +47,7 @@ var et2_diff = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDe // included via etemplate2.css //this.egw().includeCSS('../../../vendor/bower-asset/dist/dist2html.css'); this.div = document.createElement("div"); - jQuery(this.div).addClass('diff'); + jQuery(this.div).addClass('et2_diff'); }, set_value: function(value) { @@ -100,7 +100,7 @@ var et2_diff = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDe { jQuery(this).height(jQuery(window).height() *0.7); } - jQuery(this).dialog({position: "center"}); + jQuery(this).addClass('et2_diff').dialog({position: "center"}); }, close: function(event, ui) { // Need to destroy the dialog, etemplate widget needs divs back where they were diff --git a/api/templates/default/etemplate2.css b/api/templates/default/etemplate2.css index 9bc072141d..8ac518815b 100644 --- a/api/templates/default/etemplate2.css +++ b/api/templates/default/etemplate2.css @@ -567,22 +567,22 @@ for printing /** * Diff widget */ -div.diff { +div.et2_diff { width: 100%; } -.diff thead, +.et2_diff thead, .author, .d2h-file-header, .d2h-file-info, .d2h-info, -.diff .d2h-cntx +.et2_diff .d2h-cntx { display: none; } .d2h-file-diff { white-space:normal; } -.diff .d2h-file-diff { +.et2_diff .d2h-file-diff { overflow-x: hidden; } .ui-widget-content .d2h-code-line-ctn { @@ -592,10 +592,23 @@ div.diff { overflow-x: visible; overflow-y: visible; } -.diff .ui-icon { +.et2_diff .ui-icon { margin-top: -16px; float: right; } +.et2_diff .d2h-del, .et2_diff.d2h-del.d2h-change, .et2_diff .d2h-file-diff .d2h-del.d2h-change { + background-color: #ffeef0; +} +.et2_diff .d2h-code-line del, .et2_diff .d2h-code-side-line del { + background-color: #fdb8c0; +} +.et2_diff .d2h-ins, .et2_diff.d2h-ins.d2h-change, .et2_diff .d2h-file-diff .d2h-ins.d2h-change { + background-color: #e6ffed; +} +.et2_diff .d2h-code-line ins, .et2_diff .d2h-code-side-line ins { + background-color: #acf2bd; +} + /** Display a loading icon **/ .loading { background-position: center;