mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 10:14:13 +00:00
minor changes
This commit is contained in:
parent
b67744e495
commit
f464a0af6c
5 changed files with 76 additions and 27 deletions
|
|
@ -751,6 +751,21 @@ var CloudCommander, $, Util, DOM;
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* function gets time
|
||||
*/
|
||||
DOM.getTime = function(){
|
||||
var date = new Date(),
|
||||
hours = date.getHours(),
|
||||
minutes = date.getMinutes(),
|
||||
seconds = date.getSeconds();
|
||||
|
||||
minutes = minutes < 10 ? '0' + minutes : minutes;
|
||||
seconds = seconds < 10 ? '0' + seconds : seconds;
|
||||
|
||||
return hours + ":" + minutes + ":" + seconds;
|
||||
};
|
||||
|
||||
DOM.CloudStatus = [];
|
||||
|
||||
DOM.addCloudStatus = function(pStatus){
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
var CloudCommander, _gaq;
|
||||
var CloudCommander, DOM, _gaq;
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
|
|
@ -19,5 +19,5 @@ var CloudCommander, _gaq;
|
|||
return preventErrorAlert;
|
||||
};
|
||||
|
||||
CloudCommander.Util.jsload('http://google-analytics.com/ga.js');
|
||||
DOM.jsload('http://google-analytics.com/ga.js');
|
||||
})();
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/* script, fixes ie */
|
||||
var CloudCommander, $;
|
||||
var CloudCommander, DOM, $;
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
|
@ -12,7 +12,7 @@ var CloudCommander, $;
|
|||
{name: '', src: ' ',func: '', style: '', id: '', parent: '',
|
||||
async: false, inner: 'id{color:red, }, class:'', not_append: false}
|
||||
*/
|
||||
lUtil.cssSet = function(pParams_o){
|
||||
DOM.cssSet = function(pParams_o){
|
||||
var lElement = '<style ';
|
||||
|
||||
if (pParams_o.id) lElement += 'id=' + pParams_o.id + ' ';
|
||||
|
|
@ -27,15 +27,13 @@ var CloudCommander, $;
|
|||
};
|
||||
}
|
||||
|
||||
var lUtil = CloudCommander.Util;
|
||||
|
||||
/* setting function context (this) */
|
||||
lUtil.bind = function(pFunction, pContext){
|
||||
DOM.bind = function(pFunction, pContext){
|
||||
return $.proxy(pFunction, pContext);
|
||||
};
|
||||
|
||||
if(!document.getElementsByClassName){
|
||||
lUtil.getByClass = function(pClass, pElement){
|
||||
DOM.getByClass = function(pClass, pElement){
|
||||
var lClass = '.' + pClass,
|
||||
lResult;
|
||||
|
||||
|
|
@ -48,7 +46,7 @@ var CloudCommander, $;
|
|||
}
|
||||
|
||||
/* function polyfill webkit standart function */
|
||||
lUtil.scrollIntoViewIfNeeded = function(pElement, centerIfNeeded){
|
||||
DOM.scrollIntoViewIfNeeded = function(pElement, centerIfNeeded){
|
||||
/*
|
||||
https://gist.github.com/2581101
|
||||
*/
|
||||
|
|
@ -82,35 +80,29 @@ var CloudCommander, $;
|
|||
|
||||
alignWithTop = overTop && !overBottom;
|
||||
|
||||
if ((overTop || overBottom) && centerIfNeeded) {
|
||||
if ((overTop || overBottom) && centerIfNeeded)
|
||||
parent.scrollTop =
|
||||
pElement.offsetTop -
|
||||
parent.offsetTop -
|
||||
parent.clientHeight / 2 -
|
||||
parentBorderTopWidth +
|
||||
pElement.clientHeight / 2;
|
||||
}
|
||||
|
||||
if ((overLeft || overRight) && centerIfNeeded) {
|
||||
if ((overLeft || overRight) && centerIfNeeded)
|
||||
parent.scrollLeft =
|
||||
pElement.offsetLeft -
|
||||
parent.offsetLeft -
|
||||
parent.clientWidth / 2 -
|
||||
parentBorderLeftWidth +
|
||||
pElement.clientWidth / 2;
|
||||
}
|
||||
|
||||
if (( overTop ||
|
||||
overBottom ||
|
||||
overLeft ||
|
||||
overRight) &&
|
||||
!centerIfNeeded) {
|
||||
if ( (overTop || overBottom || overLeft || overRight)
|
||||
&& !centerIfNeeded)
|
||||
pElement.scrollIntoView(alignWithTop);
|
||||
}
|
||||
};
|
||||
|
||||
if(!document.body.classList){
|
||||
lUtil.addClass = function(pElement, pClass){
|
||||
DOM.addClass = function(pElement, pClass){
|
||||
var lSpaceChar = '',
|
||||
lClassName = pElement.className,
|
||||
lRet_b = true;
|
||||
|
|
@ -123,7 +115,7 @@ var CloudCommander, $;
|
|||
lRet_b = false;
|
||||
};
|
||||
|
||||
lUtil.removeClass = function(pElement, pClass){
|
||||
DOM.removeClass = function(pElement, pClass){
|
||||
var lClassName = pElement.className;
|
||||
|
||||
if(lClassName.length > pClass.length)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue