diff --git a/ChangeLog b/ChangeLog index b21640fe..611e20d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ file not just like Linux. * Added ability to update thrue git. +* Added ability to change charset on terminal only if +it's build in command on win32. + 2012.10.01, Version 0.1.7 diff --git a/client.js b/client.js index 794e5c94..a4e2a1ee 100644 --- a/client.js +++ b/client.js @@ -350,9 +350,9 @@ CloudClient.Util = (function(){ };*/ /* ie */ /* if object - then onload or onerror */ - }else if (typeof lFunc === 'object') { + }else if ( this.isObject(lFunc) ) { if(lFunc.onload && - typeof lFunc.onload === 'function'){ + this.isFunction(lFunc.onload)){ element.onload = lFunc.onload; /* element.onreadystatechange = function(){ @@ -403,9 +403,8 @@ CloudClient.Util = (function(){ if(typeof lFunc === 'function') lFunc(); - else if(typeof lFunc === 'object' && - typeof lFunc.onload === 'function') - lFunc.onload(); + else if( this.isObject(lFunc) && this.isFunction(lFunc.onload) ) + lFunc.onload(); } return element; @@ -728,6 +727,22 @@ CloudClient.Util = (function(){ return ( lCurrentFileClass.indexOf(lCurrentClass) >= 0 ); }; + /** + * functions check is pObject is object + * @param pObject + */ + this.isObject = function(pObject){ + return typeof pObject === 'object'; + }; + + /** + * functions check is pFunction is function + * @param pFunction + */ + this.isFunction = function(pFunction){ + return typeof pFunction === 'function'; + }; + this.getCurrentLink = function(pCurrentFile){ var lLink; if(pCurrentFile) @@ -1510,7 +1525,7 @@ CloudClient._getJSONfromFileTable=function() */ i=2; /* пропускам Path и Header*/ - for(;i 0 ) + pCommand = 'chcp 65001 |' + pCommand; + } if(!ClientFuncs[pConnNum]) ClientFuncs[pConnNum] = getExec(pSocket); @@ -95,3 +101,21 @@ function getExec(pSocket){ console.log(lExec); }; } + + +/* windows commands thet require + * unicode charset on locales + * different then English + */ +var Win32Commands = ['ASSOC', 'AT', 'ATTRIB', 'BREAK', 'CACLS', 'CALL', + 'CD', 'CHCP', 'CHDIR', 'CHKDSK', 'CHKNTFS', 'CLS', + 'CMD', 'COLOR', 'COMP', 'COMPACT', 'CONVERT', 'COPY', + 'DATE', 'DEL', 'DIR', 'DISKCOMP', 'DISKCOPY', 'DOSKEY', + 'ECHO', 'ENDLOCAL', 'ERASE', 'EXIT', 'FC', 'FIND', + 'FINDSTR', 'FOR', 'FORMAT', 'FTYPE', 'GOTO', 'GRAFTABL', + 'HELP', 'IF', 'LABEL', 'MD', 'MKDIR', 'MODE', 'MORE', + 'MOVE', 'PATH', 'PAUSE', 'POPD', 'PRINT', 'PROMPT', + 'PUSHD', 'RD', 'RECOVER', 'REM', 'REN', 'RENAME', + 'REPLACE', 'RMDIR', 'SET', 'SETLOCAL', 'SHIFT', 'SORT', + 'START', 'SUBST', 'TIME', 'TITLE', 'TREE', 'TYPE', + 'VER', 'VERIFY', 'VOL', 'XCOPY']; \ No newline at end of file