mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
fixed bug with keyboard not responding when click on file
This commit is contained in:
parent
0d44a51931
commit
8e08a28213
3 changed files with 16 additions and 5 deletions
|
|
@ -44,6 +44,7 @@ running
|
|||
in offline mode (if connection suddenly lost, all visited
|
||||
directories would be cached).
|
||||
|
||||
* fixed bug with keyboard not responding when click on file.
|
||||
|
||||
2012.08.24, Version 0.1.6
|
||||
|
||||
|
|
|
|||
|
|
@ -969,7 +969,7 @@ CloudClient._setCurrent=(function(){
|
|||
*/
|
||||
if(Util.getCurrentFile() === lParent)
|
||||
CloudClient._editFileName(lParent);
|
||||
},400);
|
||||
},1000);
|
||||
}
|
||||
else{
|
||||
/* устанавливаем курсор на файл,
|
||||
|
|
|
|||
18
server.js
18
server.js
|
|
@ -222,6 +222,8 @@ CloudServer.start = function () {
|
|||
*/
|
||||
CloudServer.generateHeaders = function(pName, pGzip){
|
||||
var lType='';
|
||||
var lCacheControl = 0;
|
||||
var lContentEncoding = '';
|
||||
/* высылаем заголовок в зависимости от типа файла */
|
||||
/* если расширение у файла css -
|
||||
* загружаем стили
|
||||
|
|
@ -241,8 +243,10 @@ CloudServer.generateHeaders = function(pName, pGzip){
|
|||
lType = 'text/html';
|
||||
else if(CloudFunc.checkExtension(pName,'woff'))
|
||||
lType = 'font/woff';
|
||||
else if(CloudFunc.checkExtension(pName,'appcache'))
|
||||
else if(CloudFunc.checkExtension(pName,'appcache')){
|
||||
lType = 'text/cache-manifest';
|
||||
lCacheControl = 1;
|
||||
}
|
||||
else if(CloudFunc.checkExtension(pName,'mp3'))
|
||||
lType = 'audio/mpeg';
|
||||
|
||||
|
|
@ -258,13 +262,19 @@ CloudServer.generateHeaders = function(pName, pGzip){
|
|||
|
||||
console.log(pName + lQuery);
|
||||
}
|
||||
|
||||
|
||||
if(!lCacheControl)
|
||||
lCacheControl = 31337 * 21;
|
||||
|
||||
if(lType.indexOf('img') < 0)
|
||||
lContentEncoding = '; charset=UTF-8';
|
||||
|
||||
return {
|
||||
/* if type of file any, but img -
|
||||
* then we shoud specify charset
|
||||
*/
|
||||
'Content-Type': lType + (lType.indexOf('img') < 0 ? '; charset=UTF-8' : ''),
|
||||
'cache-control': 'max-age='+(31337*21),
|
||||
'Content-Type': lType + lContentEncoding,
|
||||
'cache-control': 'max-age=' + lCacheControl,
|
||||
'last-modified': new Date().toString(),
|
||||
'content-encoding': pGzip?'gzip':'',
|
||||
/* https://developers.google.com/speed/docs/best-practices
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue