@Ghazascanner
_2019runbot
Ghazascanner File Manager
server :Linux www.thesweb.ru 4.19.0-22-amd64 #1 SMP Debian 4.19.260-1 (2022-09-29) x86_64
Current Path :
/
var
/
www
/
www-root
/
data
/
www
/
new.labinform.ru
/
pub
/
js
/
Path :
Upload File :
New :
File
Dir
/var/www/www-root/data/www/new.labinform.ru/pub/js/funcs.js
/************************************************** * Вспомогательные функции для облегчения работы *************************************************/ /************************************************** * Аналог функции PHP *************************************************/ function explode(delimiter, string ){ var emptyArray = { 0: '' }; if ( arguments.length != 2 || typeof arguments[0] == 'undefined' || typeof arguments[1] == 'undefined' ) { return null; } if ( delimiter === '' || delimiter === false || delimiter === null ) { return false; } if ( typeof delimiter == 'function' || typeof delimiter == 'object' || typeof string == 'function' || typeof string == 'object' ) { return emptyArray; } if ( delimiter === true ) { delimiter = '1'; } return string.toString().split(delimiter.toString()); } /************************************************** * Аналог функции PHP *************************************************/ function implode(glue, pieces) { return ((pieces instanceof Array) ? pieces.join(glue) : pieces); } /************************************************** * функция кроссбраузерного вычисления размеров рабочего окна браузера *************************************************/ function getClientSize(){ if(document.compatMode=='CSS1Compat') return [document.documentElement.clientWidth, document.documentElement.clientHeight]; else return [document.body.clientWidth, document.body.clientHeight]; } /************************************************** * функция кроссбраузерного вычисления значений скроллинга *************************************************/ function getDocumentScroll(){ return [ self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft), self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop) ]; } /************************************************** * получение центра экрана *************************************************/ function getClientCenter(){ var sizes = getClientSize(); var scrl = getDocumentScroll(); return [parseInt(sizes[0]/2)+scrl[0], parseInt(sizes[1]/2)+scrl[1]]; } /************************************************** * Синхронный вызов аджакса * type = {text, xml} *************************************************/ function loadHref(myurl, type) { type = type || 'text'; req = $.ajax({ url: myurl, type: "post", async: false }) if (type == 'text') { return req.responseText; } else if (type == 'xml') { return req.responseXML; } else { return req; } } /************************************************** * Синхронный вызов аджакса с передачей данных * type = {text, xml} *************************************************/ function loadForm(myurl, pdata, type) { type = type || 'text'; req = $.ajax({ url: myurl, type: "post", data: pdata, async: false }) if (type == 'text') { return req.responseText; } else if (type == 'xml') { return req.responseXML; } else { return req; } }