Various UI improvement (#4017)

This commit is contained in:
Sebastian Castro 2020-06-02 11:25:43 +02:00 committed by GitHub
parent f45d85f615
commit 7aa7e02e27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 66 additions and 101 deletions

View file

@ -156,15 +156,6 @@ function Ace2Inner(){
var scheduler = parent; // hack for opera required
var textFace = 'monospace';
var textSize = 12;
function textLineHeight()
{
return Math.round(textSize * 4 / 3);
}
var dynamicCSS = null;
var outerDynamicCSS = null;
var parentDynamicCSS = null;
@ -312,25 +303,6 @@ function Ace2Inner(){
return ".authorColors ." + oneClassName;
}
function setUpTrackingCSS()
{
if (dynamicCSS)
{
var backgroundHeight = lineMetricsDiv.offsetHeight;
var lineHeight = textLineHeight();
var extraBodding = 0;
var extraTodding = 0;
if (backgroundHeight < lineHeight)
{
extraBodding = Math.ceil((lineHeight - backgroundHeight) / 2);
extraTodding = lineHeight - backgroundHeight - extraBodding;
}
var spanStyle = dynamicCSS.selectorStyle("#innerdocbody span");
spanStyle.paddingTop = extraTodding + "px";
spanStyle.paddingBottom = extraBodding + "px";
}
}
function fadeColor(colorCSS, fadeFrac)
{
var color = colorutils.css2triple(colorCSS);
@ -623,26 +595,8 @@ function Ace2Inner(){
function setTextFace(face)
{
textFace = face;
root.style.fontFamily = textFace;
lineMetricsDiv.style.fontFamily = textFace;
scheduler.setTimeout(function()
{
setUpTrackingCSS();
}, 0);
}
function setTextSize(size)
{
textSize = size;
root.style.fontSize = textSize + "px";
root.style.lineHeight = textLineHeight() + "px";
sideDiv.style.lineHeight = textLineHeight() + "px";
lineMetricsDiv.style.fontSize = textSize + "px";
scheduler.setTimeout(function()
{
setUpTrackingCSS();
}, 0);
root.style.fontFamily = face;
lineMetricsDiv.style.fontFamily = face;
}
function recreateDOM()
@ -962,7 +916,6 @@ function Ace2Inner(){
},
styled: setStyled,
textface: setTextFace,
textsize: setTextSize,
rtlistrue: function(value) {
setClassPresence(root, "rtl", value)
setClassPresence(root, "ltr", !value)
@ -984,7 +937,6 @@ function Ace2Inner(){
};
editorInfo.ace_setBaseAttributedText = function(atxt, apoolJsonObj)
{
setUpTrackingCSS();
changesetTracker.setBaseAttributedText(atxt, apoolJsonObj);
};
editorInfo.ace_applyChangesToBase = function(c, optAuthor, apoolJsonObj)