403Webshell
Server IP : 27.254.152.13  /  Your IP : 216.73.217.38
Web Server : Apache/2
System : Linux ns1-252017.dragonhispeed.com 5.2.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64
User : coloflew ( 1072)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coloflew/public_html/cdn/tinymce/themes/inlite/src/test/js/browser/core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/coloflew/public_html/cdn/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js
test('browser/core/LayoutTest', [
	'ephox/tinymce',
	'tinymce/inlite/core/Layout'
], function (tinymce, Layout) {
	// TODO: Move this to atomic test when we can require parts of tinymce core using bolt

	var rect = function (x, y, w, h) {
		return {x: x, y: y, w: w, h: h};
	};

	var clientRect = function (x, y, w, h) {
		return {left: x, top: y, width: w, height: h, bottom: y + h, right: x + w};
	};

	var assertLayout = function (expected, rects) {
		var result;

		result = Layout.calc(
			rects.targetRect,
			rects.contentAreaRect,
			rects.panelRect
		);

		assert.eq(expected, result);
	};

	var testCalcPanelAtBottomLeft = function () {
		assertLayout({
			rect: rect(0, 10, 20, 10),
			position: 'bl-tl'
		}, {
			contentAreaRect: rect(0, 0, 100, 100),
			targetRect: rect(0, 0, 10, 10),
			panelRect: rect(0, 0, 20, 10)
		});
	};

	var testCalcPanelAtBottomRight = function () {
		assertLayout({
			rect: rect(80, 10, 20, 10),
			position: 'br-tr'
		}, {
			contentAreaRect: rect(0, 0, 100, 100),
			targetRect: rect(90, 0, 10, 10),
			panelRect: rect(0, 0, 20, 10)
		});
	};

	var testCalcPanelAtTopLeft = function () {
		assertLayout({
			rect: rect(0, 10, 20, 10),
			position: 'tl-bl'
		}, {
			contentAreaRect: rect(0, 0, 100, 100),
			targetRect: rect(0, 20, 10, 10),
			panelRect: rect(0, 0, 20, 10)
		});
	};

	var testCalcPanelAtTopRight = function () {
		assertLayout({
			rect: rect(80, 10, 20, 10),
			position: 'tr-br'
		}, {
			contentAreaRect: rect(0, 0, 100, 100),
			targetRect: rect(90, 20, 10, 10),
			panelRect: rect(0, 0, 20, 10)
		});
	};

	var testCalcPanelAtTopCenter = function () {
		assertLayout({
			rect: rect(35, 10, 20, 10),
			position: 'tc-bc'
		}, {
			contentAreaRect: rect(0, 0, 100, 100),
			targetRect: rect(40, 20, 10, 10),
			panelRect: rect(0, 0, 20, 10)
		});
	};

	var testCalcPanelAtBottomCenter = function () {
		assertLayout({
			rect: rect(35, 10, 20, 10),
			position: 'bc-tc'
		}, {
			contentAreaRect: rect(0, 0, 100, 100),
			targetRect: rect(40, 0, 10, 10),
			panelRect: rect(0, 0, 20, 10)
		});
	};

	var testUserConstrain = function () {
		var targetRect, contentAreaRect, panelRect, userConstrainedPanelRect, handler;

		contentAreaRect = rect(0, 0, 100, 100);
		targetRect = rect(40, 0, 10, 10);
		panelRect = rect(0, 0, 20, 10);

		handler = function (rects) {
			assert.eq(rects.elementRect, clientRect(40, 0, 10, 10));
			assert.eq(rects.contentAreaRect, clientRect(0, 0, 100, 100));
			assert.eq(rects.panelRect, clientRect(0, 0, 20, 10));
			return clientRect(1, 2, 3, 4);
		};

		userConstrainedPanelRect = Layout.userConstrain(handler, targetRect, contentAreaRect, panelRect);
		assert.eq(userConstrainedPanelRect, rect(1, 2, 3, 4));
	};

	testCalcPanelAtBottomLeft();
	testCalcPanelAtBottomRight();
	testCalcPanelAtTopLeft();
	testCalcPanelAtTopRight();
	testCalcPanelAtTopCenter();
	testCalcPanelAtBottomCenter();
	testUserConstrain();
});

Youez - 2016 - github.com/yon3zu
LinuXploit