mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
Various UI improvement (#4017)
This commit is contained in:
parent
f45d85f615
commit
7aa7e02e27
19 changed files with 66 additions and 101 deletions
|
@ -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)
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
// Timeslider controller would probably be more appropriate.
|
||||
var _ = require('./underscore');
|
||||
var padmodals = require('./pad_modals').padmodals;
|
||||
var colorutils = require('./colorutils').colorutils;
|
||||
|
||||
function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
|
||||
{
|
||||
|
@ -151,10 +152,11 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded)
|
|||
if (author.name)
|
||||
{
|
||||
if (numNamed !== 0) authorsList.append(', ');
|
||||
|
||||
var textColor = colorutils.textColorFromBackgroundColor(authorColor, clientVars.skinName)
|
||||
$('<span />')
|
||||
.text(author.name || "unnamed")
|
||||
.css('background-color', authorColor)
|
||||
.css('color', textColor)
|
||||
.addClass('author')
|
||||
.appendTo(authorsList);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue