mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
minor changes
This commit is contained in:
parent
873e232e62
commit
b5df68f261
6 changed files with 28 additions and 18 deletions
|
|
@ -1166,7 +1166,7 @@ CloudClient._ajaxLoad = function(path, pNeedRefresh)
|
|||
|
||||
/* ######################## */
|
||||
try{
|
||||
$.ajax({
|
||||
Util.ajax({
|
||||
url: path,
|
||||
error: Util.Images.showError,
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ var CloudCommander, CloudFunc, CodeMirror;
|
|||
* and later will be Ace
|
||||
*/
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var Util = CloudCommander.Util;
|
||||
|
||||
CloudCommander.Editor = {
|
||||
|
|
@ -87,7 +89,7 @@ var CloudCommander, CloudFunc, CodeMirror;
|
|||
var lThis = this;
|
||||
|
||||
var initCodeMirror_f = function(pValue){
|
||||
CodeMirror(lCloudEditor,{
|
||||
new CodeMirror(lCloudEditor,{
|
||||
mode : 'javascript',
|
||||
value : pValue,
|
||||
theme : 'night',
|
||||
|
|
@ -138,7 +140,7 @@ var CloudCommander, CloudFunc, CodeMirror;
|
|||
400);
|
||||
|
||||
/* reading data from current file */
|
||||
$.ajax({
|
||||
Util.ajax({
|
||||
url:lA,
|
||||
error: (function(jqXHR, textStatus, errorThrown){
|
||||
lThis.loading = false;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,21 @@
|
|||
var CloudCommander, _gaq;
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
/* setting google analitics tracking code */
|
||||
_gaq = [['_setAccount', 'UA-33536569-2'], ['_trackPageview']];
|
||||
|
||||
var lOnError_f = window.onerror;
|
||||
window.onerror = function(msg, url, line) {
|
||||
var preventErrorAlert = true;
|
||||
_gaq.push(['_trackEvent',
|
||||
'JS Error',
|
||||
msg,
|
||||
navigator.userAgent + ' -> ' + url + " : " + line]);
|
||||
|
||||
if(typeof lOnError_f === 'function')
|
||||
lOnError_f();
|
||||
|
||||
return preventErrorAlert;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
/* script, fixes ie */
|
||||
var CloudCommander;
|
||||
var CloudCommander, $;
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
document.head = document.getElementsByTagName("head")[0];
|
||||
|
||||
document.getElementsByClassName = function(pClassName){
|
||||
|
|
@ -13,7 +15,7 @@ var CloudCommander;
|
|||
|
||||
/* setting function context (this) */
|
||||
lUtil.bind = function(pFunction, pContext){
|
||||
return jQuery.proxy(pFunction, pContext);
|
||||
return $.proxy(pFunction, pContext);
|
||||
};
|
||||
|
||||
lUtil.getByClass = function(pClass, pElement){
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ var CloudCommander, CloudFunc, $;
|
|||
* different objects)
|
||||
*/
|
||||
CloudCommander.Viewer.FancyBox.getConfig = (function(){
|
||||
var lThis = this;
|
||||
return{
|
||||
/* function do her work
|
||||
* before FauncyBox shows
|
||||
|
|
@ -105,7 +104,7 @@ var CloudCommander, CloudFunc, $;
|
|||
if (lLink.indexOf(CloudFunc.NOJS) === CloudFunc.FS.length)
|
||||
lLink = lLink.replace(CloudFunc.NOJS, '');
|
||||
|
||||
$.ajax({
|
||||
Util.ajax({
|
||||
url : lLink,
|
||||
error : (function(jqXHR, textStatus, errorThrown){
|
||||
lThis.loading = false;
|
||||
|
|
|
|||
|
|
@ -154,19 +154,19 @@ CloudFunc.getShortedSize = function(pSize){
|
|||
/* Константы размеров, что используются
|
||||
* внутри функции
|
||||
*/
|
||||
var l1BMAX=1024;
|
||||
var l1KBMAX=1048576;
|
||||
var l1MBMAX=1073741824;
|
||||
var l1GBMAX=1099511627776;
|
||||
var l1TBMAX=1125899906842624;
|
||||
var l1BMAX = 1024;
|
||||
var l1KBMAX = 1048576;
|
||||
var l1MBMAX = 1073741824;
|
||||
var l1GBMAX = 1099511627776;
|
||||
var l1TBMAX = 1125899906842624;
|
||||
|
||||
var lShorted;
|
||||
|
||||
if(pSize<l1BMAX)lShorted=pSize+'b';
|
||||
else if(pSize<l1KBMAX)lShorted=(pSize/l1BMAX) .toFixed(2)+'kb';
|
||||
else if(pSize<l1MBMAX)lShorted=(pSize/l1KBMAX).toFixed(2)+'mb';
|
||||
else if(pSize<l1GBMAX)lShorted=(pSize/l1MBMAX).toFixed(2)+'gb';
|
||||
else if(pSize<l1TBMAX)lShorted=(pSize/l1GBMAX).toFixed(2)+'tb';
|
||||
if (pSize < l1BMAX) lShorted = pSize + 'b';
|
||||
else if (pSize < l1KBMAX) lShorted = (pSize/l1BMAX) .toFixed(2) + 'kb';
|
||||
else if (pSize < l1MBMAX) lShorted = (pSize/l1KBMAX).toFixed(2) + 'mb';
|
||||
else if (pSize < l1GBMAX) lShorted = (pSize/l1MBMAX).toFixed(2) + 'gb';
|
||||
else if (pSize < l1TBMAX) lShorted = (pSize/l1GBMAX).toFixed(2) + 'tb';
|
||||
return lShorted;
|
||||
};
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ CloudFunc.checkExtension=function(pName,pExt)
|
|||
var lExtSub=lLength-lExtNum; /* длина расширения*/
|
||||
|
||||
/* если pExt - расширение pName */
|
||||
return lExtSub===pExt.length;
|
||||
return lExtSub === pExt.length;
|
||||
|
||||
}else if(typeof pExt === 'object' &&
|
||||
pExt.length){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue