mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
closes #614
This commit is contained in:
parent
5cf74a0ad9
commit
2d5a0bb894
@ -215,7 +215,7 @@ async function UIDesktop(options){
|
|||||||
|
|
||||||
// Update matching items
|
// Update matching items
|
||||||
// set new item name
|
// set new item name
|
||||||
$(`.item[data-uid='${html_encode(item.uid)}'] .item-name`).html(html_encode(truncate_filename(item.name)).replaceAll(' ', ' '));
|
$(`.item[data-uid='${html_encode(item.uid)}'] .item-name`).html(html_encode(truncate_filename(item.name)));
|
||||||
|
|
||||||
// Set new icon
|
// Set new icon
|
||||||
const new_icon = (item.is_dir ? window.icons['folder.svg'] : (await item_icon(item)).image);
|
const new_icon = (item.is_dir ? window.icons['folder.svg'] : (await item_icon(item)).image);
|
||||||
@ -419,7 +419,7 @@ async function UIDesktop(options){
|
|||||||
|
|
||||||
// Update matching items
|
// Update matching items
|
||||||
// Set new item name
|
// Set new item name
|
||||||
$(`.item[data-uid='${html_encode(item.uid)}'] .item-name`).html(html_encode(truncate_filename(item.name)).replaceAll(' ', ' '));
|
$(`.item[data-uid='${html_encode(item.uid)}'] .item-name`).html(html_encode(truncate_filename(item.name)));
|
||||||
|
|
||||||
// Set new icon
|
// Set new icon
|
||||||
const new_icon = (item.is_dir ? window.icons['folder.svg'] : (await item_icon(item)).image);
|
const new_icon = (item.is_dir ? window.icons['folder.svg'] : (await item_icon(item)).image);
|
||||||
|
@ -162,7 +162,7 @@ function UIItem(options){
|
|||||||
h += `</div>`;
|
h += `</div>`;
|
||||||
|
|
||||||
// name
|
// name
|
||||||
h += `<span class="item-name" data-item-id="${item_id}" title="${html_encode(options.name)}">${options.is_trash ? i18n('trash') : html_encode(truncate_filename(options.name)).replaceAll(' ', ' ')}</span>`
|
h += `<pre class="item-name" data-item-id="${item_id}" title="${html_encode(options.name)}">${options.is_trash ? i18n('trash') : html_encode(truncate_filename(options.name))}</pre>`
|
||||||
// name editor
|
// name editor
|
||||||
h += `<textarea class="item-name-editor hide-scrollbar" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off" data-gramm_editor="false">${html_encode(options.name)}</textarea>`
|
h += `<textarea class="item-name-editor hide-scrollbar" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off" data-gramm_editor="false">${html_encode(options.name)}</textarea>`
|
||||||
h += `</div>`;
|
h += `</div>`;
|
||||||
@ -653,7 +653,7 @@ function UIItem(options){
|
|||||||
UIAlert(`The name ".." is not allowed, because it is a reserved name. Please choose another name.`)
|
UIAlert(`The name ".." is not allowed, because it is a reserved name. Please choose another name.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
$(el_item_name).html(html_encode(truncate_filename(options.name)).replaceAll(' ', ' '));
|
$(el_item_name).html(html_encode(truncate_filename(options.name)));
|
||||||
$(el_item_name).show();
|
$(el_item_name).show();
|
||||||
$(el_item_name_editor).val($(el_item).attr('data-name'));
|
$(el_item_name_editor).val($(el_item).attr('data-name'));
|
||||||
$(el_item_name_editor).hide();
|
$(el_item_name_editor).hide();
|
||||||
@ -1412,7 +1412,7 @@ function UIItem(options){
|
|||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
$(el_item_name_editor).on('input keypress focus', function(){
|
$(el_item_name_editor).on('input keypress focus', function(){
|
||||||
const val = $(el_item_name_editor).val();
|
const val = $(el_item_name_editor).val();
|
||||||
$('.item-name-shadow').html(html_encode(val).replaceAll(' ', ' '));
|
$('.item-name-shadow').html(html_encode(val));
|
||||||
if(val !== ''){
|
if(val !== ''){
|
||||||
const w = $('.item-name-shadow').width();
|
const w = $('.item-name-shadow').width();
|
||||||
const h = $('.item-name-shadow').height();
|
const h = $('.item-name-shadow').height();
|
||||||
|
@ -77,7 +77,10 @@
|
|||||||
font-optical-sizing: auto;
|
font-optical-sizing: auto;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-variation-settings: "slnt"0;
|
font-variation-settings: "slnt"0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre{
|
||||||
|
font-family: "Inter", "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
@ -617,8 +620,9 @@ span.header-sort-icon img {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
line-break: anywhere;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-name {
|
.item-name {
|
||||||
|
@ -2095,7 +2095,7 @@ window.rename_file = async(options, new_name, old_name, old_path, el_item, el_it
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set new item name
|
// Set new item name
|
||||||
$(`.item[data-uid='${$(el_item).attr('data-uid')}'] .item-name`).html(html_encode(truncate_filename(new_name)).replaceAll(' ', ' '));
|
$(`.item[data-uid='${$(el_item).attr('data-uid')}'] .item-name`).html(html_encode(truncate_filename(new_name)));
|
||||||
$(el_item_name).show();
|
$(el_item_name).show();
|
||||||
|
|
||||||
// Hide item name editor
|
// Hide item name editor
|
||||||
|
@ -136,7 +136,7 @@ const get_html_element_from_options = async function(options){
|
|||||||
h += `</div>`;
|
h += `</div>`;
|
||||||
|
|
||||||
// name
|
// name
|
||||||
h += `<span class="item-name" data-item-id="${item_id}" title="${html_encode(options.name)}">${html_encode(truncate_filename(options.name)).replaceAll(' ', ' ')}</span>`
|
h += `<span class="item-name" data-item-id="${item_id}" title="${html_encode(options.name)}">${html_encode(truncate_filename(options.name))}</span>`
|
||||||
// name editor
|
// name editor
|
||||||
h += `<textarea class="item-name-editor hide-scrollbar" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off" data-gramm_editor="false">${html_encode(options.name)}</textarea>`
|
h += `<textarea class="item-name-editor hide-scrollbar" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off" data-gramm_editor="false">${html_encode(options.name)}</textarea>`
|
||||||
h += `</div>`;
|
h += `</div>`;
|
||||||
|
Loading…
Reference in New Issue
Block a user