rewrited sizing of names if they are to long thrue css, from JavaScript

This commit is contained in:
coderaiser 2012-11-04 04:45:31 -05:00
parent c034e23807
commit d0df126855
3 changed files with 15 additions and 24 deletions

View file

@ -59,6 +59,9 @@ server.js to cloudcmd.js.
* Added ability of authorithation in GitHub.
* Rewrited sizing of names if they are to
long thrue css, from JavaScript.
2012.10.01, Version 0.1.7

View file

@ -186,8 +186,15 @@ background:url(/img/panel_refresh.png) 0 -15px no-repeat;
}
/* информация о файлах и папках*/
.name{
float: left;
width: 37%;
float: left;
width: 37%;
/* если длина имени файла больше 16 символов
* отрезаем лишнее, оставляя лишь 16,
* и добавляем две точки и тайтл
*/
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.size{
float:left;

View file

@ -183,20 +183,7 @@ var CloudFunc, exports;
return lShorted;
};
/** Function gets file name and
* if it's bigger the 16 chars
* cut it and adds '..'
* @pName - file name
*/
CloudFunc.getShortedName = function(pName){
return (pName.length > CloudFunc.SHORTNAMELENGTH ?
(pName.substr(pName,
CloudFunc.SHORTNAMELENGTH) + '..'):
pName);
};
/** Функция парсит uid и имена пользователей
* из переданного в строке вычитаного файла /etc/passwd
* и возвращает массив обьектов имён и uid пользователей
@ -442,14 +429,8 @@ var CloudFunc, exports;
(files[i].size === 'dir' ?
'' : ' target="_blank"') +
/* если длина имени файла больше 16 символов
* отрезаем лишнее, оставляя лишь 16,
* и добавляем две точки и тайтл
*/
(files[i].name.length > CloudFunc.SHORTNAMELENGTH ?
' title="' + files[i].name + '">' +
CloudFunc.getShortedName(files[i].name)
: 'draggable=true>' + files[i].name) +
' title="' + files[i].name +'"' +
'draggable=true>' + files[i].name +
"</a>" +
'</span>';
/* если папка - не выводим размер */