mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
remove font checker
This commit is contained in:
parent
033ef5f8b2
commit
9607e4a0d3
@ -201,7 +201,7 @@
|
||||
System Default
|
||||
</div>
|
||||
</label>
|
||||
<label class="selectgroup" v-for="f in availableFonts" :key="f">
|
||||
<label class="selectgroup" v-for="f in fonts" :key="f">
|
||||
<input type="radio" name="font" :value="f" v-model="theme.font">
|
||||
<div class="selectgroup-label appearance-option":style="{'font-family': f}">
|
||||
{{ f }}
|
||||
|
@ -7,28 +7,11 @@ var FONTS = [
|
||||
"Courier New",
|
||||
"Georgia",
|
||||
"Helvetica Neue",
|
||||
"Segoe UI",
|
||||
"Tahoma",
|
||||
"Times New Roman",
|
||||
"Verdana",
|
||||
]
|
||||
|
||||
// adapted from https://github.com/darkwing/FontChecker
|
||||
function fontAvailable(desiredFont) {
|
||||
var element = document.createElement('span')
|
||||
element.style.setProperty('position', 'absolute')
|
||||
element.style.setProperty('top', '-10')
|
||||
element.style.setProperty('right', '-10')
|
||||
element.style.setProperty('font-family', '__RUBBISH_FONT__')
|
||||
element.innerHTML = 'abcdefghijklmnopqrstuvwxyz'
|
||||
document.body.appendChild(element)
|
||||
var width = element.offsetWidth;
|
||||
element.style.setProperty('font-family', desiredFont);
|
||||
var new_width = element.offsetWidth;
|
||||
element.remove();
|
||||
return (width !== new_width);
|
||||
}
|
||||
|
||||
DOMPurify.addHook('afterSanitizeAttributes', function (node) {
|
||||
// set all elements owning target to target=_blank
|
||||
if ('target' in node) {
|
||||
@ -165,7 +148,7 @@ var vm = new Vue({
|
||||
'newfeed': false,
|
||||
'items': false,
|
||||
},
|
||||
'availableFonts': FONTS.filter(fontAvailable),
|
||||
'fonts': FONTS,
|
||||
'feedStats': {},
|
||||
'theme': {
|
||||
'name': 'light',
|
||||
|
Loading…
x
Reference in New Issue
Block a user