mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-04-07 14:04:30 +08:00
[AI] Fix styles for custom providers window
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js"></script>
|
||||
<script type="text/javascript" src="components/Tooltip/script.js"></script>
|
||||
<script type="text/javascript" src="components/ListView/script.js"></script>
|
||||
<script src="vendor/jquery/jquery-3.7.1.min.js"></script>
|
||||
<link rel="stylesheet" href="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css">
|
||||
<link rel="stylesheet" href="./resources/styles/common.css">
|
||||
<link rel="stylesheet" href="./resources/styles/customProviders.css">
|
||||
|
||||
@ -52,6 +52,7 @@ body {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#buttons-block {
|
||||
|
||||
@ -132,6 +132,10 @@ window.Asc.plugin.onTranslate = function () {
|
||||
});
|
||||
};
|
||||
|
||||
window.addEventListener("resize", onResize);
|
||||
onResize();
|
||||
|
||||
|
||||
function handlerChangeFileInput(files) {
|
||||
let pendingFiles = files.length;
|
||||
let hasError = false;
|
||||
@ -203,4 +207,30 @@ function onThemeChanged(theme) {
|
||||
let newSrc = src.replace(/(icons\/)([^\/]+)(\/)/, '$1' + themeType + '$3');
|
||||
icon.setAttribute('src', newSrc);
|
||||
}
|
||||
}
|
||||
|
||||
function getZoomSuffixForImage() {
|
||||
var ratio = Math.round(window.devicePixelRatio / 0.25) * 0.25;
|
||||
ratio = Math.max(ratio, 1);
|
||||
ratio = Math.min(ratio, 2);
|
||||
if(ratio == 1) return ''
|
||||
else {
|
||||
return '@' + ratio + 'x';
|
||||
}
|
||||
}
|
||||
|
||||
function onResize () {
|
||||
$('img').each(function() {
|
||||
var el = $(this);
|
||||
var src = $(el).attr('src');
|
||||
if(!src.includes('resources/icons/')) return;
|
||||
|
||||
var srcParts = src.split('/');
|
||||
var fileNameWithRatio = srcParts.pop();
|
||||
var clearFileName = fileNameWithRatio.replace(/@\d+(\.\d+)?x/, '');
|
||||
var newFileName = clearFileName;
|
||||
newFileName = clearFileName.replace(/(\.[^/.]+)$/, getZoomSuffixForImage() + '$1');
|
||||
srcParts.push(newFileName);
|
||||
el.attr('src', srcParts.join('/'));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user