%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.145.95.7
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/sale/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/sale/core_ui_fileasyncloader.js
BX.ui.fileAsyncLoader = function(opts, nf){

	this.parentConstruct(BX.ui.fileAsyncLoader, opts);

	BX.merge(this, {
		opts: { // default options
			timeout: 		800,
			url: 			'/somewhere.php',
			fileUploadTag: 	'FILE_UPLOAD'
		},
		vars: { // significant variables
			prevValue: 		''
		},
		ctrls: { // links to controls
		},
		sys: {
			code: 'file-async-loader'
		}
	});

	this.handleInitStack(nf, BX.ui.fileAsyncLoader, opts);
};
BX.extend(BX.ui.fileAsyncLoader, BX.ui.widget);

// the following functions can be overrided with inheritance
BX.merge(BX.ui.fileAsyncLoader.prototype, {

	// member of stack of initializers, must be defined even if do nothing
	init: function(){

		var sc = this.ctrls,
			sv = this.vars;

		sc.success = this.getControl('success');
		sc.fail = this.getControl('fail');
		sc.inProgress = this.getControl('in-progress');
		sc.inputContainer = this.getControl('input');

		sc.input = sc.scope.querySelector('input[type="file"]');
		sv.randomTag = this.getRandom();

		//this.pushFuncStack('buildUpDOM', BX.ui.fileAsyncLoader);
		this.pushFuncStack('bindEvents', BX.ui.fileAsyncLoader);
	},

	//buildUpDOM: function(){},

	bindEvents: function(){

		var ctx = this;

		this.startMonitor();

		BX.bindDelegate(this.ctrls.scope, 'click', {className: ctx.getControlClassName('retry')}, function(){
			ctx.upload();
		});
	},

	startMonitor: function(){

		var sc = this.ctrls,
			sv = this.vars,
			so = this.opts,
			ctx = this;

		if(sc.input.value != sv.prevValue){

			sv.prevValue = sc.input.value;

			if(sv.prevValue.length > 0)
			{
				this.upload();
				return;
			}
		}

		setTimeout(BX.proxy(this.startMonitor, this), so.timeout);
	},

	hideMessages: function(){
		var sc = this.ctrls;

		BX.hide(sc.success);
		BX.hide(sc.fail);
		BX.hide(sc.inProgress);
	},

	deSelect: function(){

		var sc = this.ctrls;

		this.hideMessages();

		var newInput = BX.clone(sc.input);
		BX.insertAfter(newInput, sc.input);
		BX.remove(sc.input);

		sc.input = newInput;
	},

	upload: function(){

		var so = this.opts,
			sv = this.vars,
			sc = this.ctrls;

		if(sc.input.value.length == 0)
			return;

		var form = BX.create('form', {
			props: {
				enctype: 'multipart/form-data',
				action: so.url,
				method: 'post',
				target: sv.randomTag
			},
			style: {
				display: 'none'
			}
		});

		var flag = BX.create('input', {
			props: {
				type: 'hidden',
				name: so.fileUploadTag,
				value: sv.randomTag
			}
		});
		form.appendChild(flag);

		var farAway = document.querySelector('body');
		farAway.appendChild(form);

		var iframe = BX.create('iframe', {
			props: {
				name: sv.randomTag
			},
			style: {
				display: 'none'
			}
		});

		farAway.appendChild(iframe);

		form.appendChild(sc.input);

		if(typeof BX[this.sys.code] == 'undefined')
			BX[this.sys.code] = {};

		BX[this.sys.code][sv.randomTag] = this;

		sc.form = form;
		sc.iframe = iframe;

		BX.hide(sc.success);
		BX.hide(sc.fail);
		BX.show(sc.inProgress);

		form.submit();
	},

	uploadSuccess: function(){

		var sc = this.ctrls;

		this.cleanUp();

		BX.show(sc.success);
		BX.hide(sc.fail);

		this.fireEvent('upload-success');
	},

	uploadFail: function(error){

		var sc = this.ctrls;

		this.cleanUp();

		BX.show(sc.fail);
		BX.hide(sc.success);

		this.fireEvent('upload-fail');
	},

	cleanUp: function(){

		var sc = this.ctrls;

		BX.hide(sc.inProgress);

		BX.remove(sc.iframe);
		sc.inputContainer.appendChild(sc.input);
		BX.remove(sc.form);

		this.startMonitor();
	}

});

Youez - 2016 - github.com/yon3zu
LinuXploit