Просмотр исходного кода

Switch to single quotes for JS

Jakob Bouchard 3 лет назад
Родитель
Сommit
41eabdc4d3

+ 10 - 10
.eslintrc.cjs

@@ -1,23 +1,23 @@
 module.exports = {
 module.exports = {
 	root: true,
 	root: true,
 	parserOptions: {
 	parserOptions: {
-		ecmaVersion: "latest",
+		ecmaVersion: 'latest',
 	},
 	},
-	extends: ["eslint:recommended", "plugin:editorconfig/noconflict", "prettier"],
-	plugins: ["editorconfig"],
-	ignorePatterns: ["*.cjs"],
+	extends: ['eslint:recommended', 'plugin:editorconfig/noconflict', 'prettier'],
+	plugins: ['editorconfig'],
+	ignorePatterns: ['*.cjs'],
 	env: {
 	env: {
 		browser: true,
 		browser: true,
 		es2021: true,
 		es2021: true,
 	},
 	},
 	globals: {
 	globals: {
-		$: "readonly",
-		jQuery: "readonly",
-		App: "readonly",
+		$: 'readonly',
+		jQuery: 'readonly',
+		App: 'readonly',
 	},
 	},
 	rules: {
 	rules: {
-		"no-unused-vars": "off",
-		"no-undef": "off",
-		"no-redeclare": "off",
+		'no-unused-vars': 'off',
+		'no-undef': 'off',
+		'no-redeclare': 'off',
 	},
 	},
 };
 };

+ 3 - 3
.lintstagedrc.cjs

@@ -1,8 +1,8 @@
 module.exports = {
 module.exports = {
 	// Run Stylelint on CSS files
 	// Run Stylelint on CSS files
-	"*.css": "stylelint --fix",
+	'*.css': 'stylelint --fix',
 	// Run ESLint on TS, TSX, JS, JSX files
 	// Run ESLint on TS, TSX, JS, JSX files
-	"*.{ts,js}?(x)": "eslint --fix",
+	'*.{ts,js}?(x)': 'eslint --fix',
 	// Run Prettier everywhere
 	// Run Prettier everywhere
-	"*": "prettier --write --ignore-unknown",
+	'*': 'prettier --write --ignore-unknown',
 };
 };

+ 18 - 11
.prettierrc.cjs

@@ -1,29 +1,36 @@
 module.exports = {
 module.exports = {
 	// Plugins
 	// Plugins
 	plugins: [
 	plugins: [
-		"@prettier/plugin-php",
-		"prettier-plugin-nginx",
-		"prettier-plugin-sh",
-		"prettier-plugin-sql",
+		'@prettier/plugin-php',
+		'prettier-plugin-nginx',
+		'prettier-plugin-sh',
+		'prettier-plugin-sql',
 	],
 	],
-	pluginSearchDirs: ["."],
+	pluginSearchDirs: ['.'],
 	// PHP Settings
 	// PHP Settings
-	phpVersion: "8.1",
-	braceStyle: "1tbs",
+	phpVersion: '8.1',
+	braceStyle: '1tbs',
 	// Overrides for some files
 	// Overrides for some files
 	overrides: [
 	overrides: [
+		// JavaScript files
+		{
+			files: ['*.{js,cjs}'],
+			options: {
+				singleQuote: true,
+			},
+		},
 		// Hestia CLI
 		// Hestia CLI
 		{
 		{
-			files: ["bin/v-*", "src/deb/*/{postinst,preinst,hestia,postrm}", "install/common/api/*"],
+			files: ['bin/v-*', 'src/deb/*/{postinst,preinst,hestia,postrm}', 'install/common/api/*'],
 			options: {
 			options: {
-				parser: "sh",
+				parser: 'sh',
 			},
 			},
 		},
 		},
 		// Nginx config
 		// Nginx config
 		{
 		{
-			files: ["**/nginx/*.inc", "**/nginx/*.conf"],
+			files: ['**/nginx/*.inc', '**/nginx/*.conf'],
 			options: {
 			options: {
-				parser: "nginx",
+				parser: 'nginx',
 			},
 			},
 		},
 		},
 	],
 	],

+ 7 - 7
.stylelintrc.cjs

@@ -1,12 +1,12 @@
 module.exports = {
 module.exports = {
-	extends: ["stylelint-config-standard", "stylelint-config-prettier"],
+	extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
 	rules: {
 	rules: {
-		"selector-class-pattern": null,
-		"no-descending-specificity": null,
-		"block-no-empty": null,
+		'selector-class-pattern': null,
+		'no-descending-specificity': null,
+		'block-no-empty': null,
 
 
-		"max-line-length": null,
-		"declaration-block-no-shorthand-property-overrides": null,
-		"selector-id-pattern": null,
+		'max-line-length': null,
+		'declaration-block-no-shorthand-property-overrides': null,
+		'selector-id-pattern': null,
 	},
 	},
 };
 };

+ 5 - 5
postcss.config.js

@@ -1,11 +1,11 @@
 module.exports = {
 module.exports = {
 	plugins: [
 	plugins: [
-		require("postcss-import"),
-		require("postcss-size"),
-		require("cssnano"),
-		require("postcss-preset-env")({
+		require('postcss-import'),
+		require('postcss-size'),
+		require('cssnano'),
+		require('postcss-preset-env')({
 			autoprefixer: {
 			autoprefixer: {
-				flexbox: "no-2009",
+				flexbox: 'no-2009',
 			},
 			},
 			stage: 1,
 			stage: 1,
 		}),
 		}),

+ 323 - 323
web/js/app.js

@@ -1,5 +1,5 @@
 $.fn.scrollTo = function (target, options, callback) {
 $.fn.scrollTo = function (target, options, callback) {
-	if (typeof options == "function" && arguments.length == 2) {
+	if (typeof options == 'function' && arguments.length == 2) {
 		callback = options;
 		callback = options;
 		options = target;
 		options = target;
 	}
 	}
@@ -8,16 +8,16 @@ $.fn.scrollTo = function (target, options, callback) {
 			scrollTarget: target,
 			scrollTarget: target,
 			offsetTop: 50,
 			offsetTop: 50,
 			duration: 10,
 			duration: 10,
-			easing: "swing",
+			easing: 'swing',
 		},
 		},
 		options
 		options
 	);
 	);
 	return this.each(function () {
 	return this.each(function () {
 		var scrollPane = $(this);
 		var scrollPane = $(this);
 		var scrollTarget =
 		var scrollTarget =
-			typeof settings.scrollTarget == "number" ? settings.scrollTarget : $(settings.scrollTarget);
+			typeof settings.scrollTarget == 'number' ? settings.scrollTarget : $(settings.scrollTarget);
 		var scrollY =
 		var scrollY =
-			typeof scrollTarget == "number"
+			typeof scrollTarget == 'number'
 				? scrollTarget
 				? scrollTarget
 				: scrollTarget.offset().top + scrollPane.scrollTop() - parseInt(settings.offsetTop);
 				: scrollTarget.offset().top + scrollPane.scrollTop() - parseInt(settings.offsetTop);
 		scrollPane.animate(
 		scrollPane.animate(
@@ -25,7 +25,7 @@ $.fn.scrollTo = function (target, options, callback) {
 			parseInt(settings.duration),
 			parseInt(settings.duration),
 			settings.easing,
 			settings.easing,
 			function () {
 			function () {
-				if (typeof callback == "function") {
+				if (typeof callback == 'function') {
 					callback.call(this);
 					callback.call(this);
 				}
 				}
 			}
 			}
@@ -55,7 +55,7 @@ var dateFormat = (function () {
 		pad = function (val, len) {
 		pad = function (val, len) {
 			val = String(val);
 			val = String(val);
 			len = len || 2;
 			len = len || 2;
-			while (val.length < len) val = "0" + val;
+			while (val.length < len) val = '0' + val;
 			return val;
 			return val;
 		};
 		};
 
 
@@ -66,7 +66,7 @@ var dateFormat = (function () {
 		// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
 		// You can't provide utc if you skip other args (use the "UTC:" mask prefix)
 		if (
 		if (
 			arguments.length == 1 &&
 			arguments.length == 1 &&
-			Object.prototype.toString.call(date) == "[object String]" &&
+			Object.prototype.toString.call(date) == '[object String]' &&
 			!/\d/.test(date)
 			!/\d/.test(date)
 		) {
 		) {
 			mask = date;
 			mask = date;
@@ -75,25 +75,25 @@ var dateFormat = (function () {
 
 
 		// Passing date through Date applies Date.parse, if necessary
 		// Passing date through Date applies Date.parse, if necessary
 		date = date ? new Date(date) : new Date();
 		date = date ? new Date(date) : new Date();
-		if (isNaN(date)) throw SyntaxError("invalid date");
+		if (isNaN(date)) throw SyntaxError('invalid date');
 
 
-		mask = String(dF.masks[mask] || mask || dF.masks["default"]);
+		mask = String(dF.masks[mask] || mask || dF.masks['default']);
 
 
 		// Allow setting the utc argument via the mask
 		// Allow setting the utc argument via the mask
-		if (mask.slice(0, 4) == "UTC:") {
+		if (mask.slice(0, 4) == 'UTC:') {
 			mask = mask.slice(4);
 			mask = mask.slice(4);
 			utc = true;
 			utc = true;
 		}
 		}
 
 
-		var _ = utc ? "getUTC" : "get",
-			d = date[_ + "Date"](),
-			D = date[_ + "Day"](),
-			m = date[_ + "Month"](),
-			y = date[_ + "FullYear"](),
-			H = date[_ + "Hours"](),
-			M = date[_ + "Minutes"](),
-			s = date[_ + "Seconds"](),
-			L = date[_ + "Milliseconds"](),
+		var _ = utc ? 'getUTC' : 'get',
+			d = date[_ + 'Date'](),
+			D = date[_ + 'Day'](),
+			m = date[_ + 'Month'](),
+			y = date[_ + 'FullYear'](),
+			H = date[_ + 'Hours'](),
+			M = date[_ + 'Minutes'](),
+			s = date[_ + 'Seconds'](),
+			L = date[_ + 'Milliseconds'](),
 			o = utc ? 0 : date.getTimezoneOffset(),
 			o = utc ? 0 : date.getTimezoneOffset(),
 			flags = {
 			flags = {
 				d: d,
 				d: d,
@@ -116,13 +116,13 @@ var dateFormat = (function () {
 				ss: pad(s),
 				ss: pad(s),
 				l: pad(L, 3),
 				l: pad(L, 3),
 				L: pad(L > 99 ? Math.round(L / 10) : L),
 				L: pad(L > 99 ? Math.round(L / 10) : L),
-				t: H < 12 ? "a" : "p",
-				tt: H < 12 ? "am" : "pm",
-				T: H < 12 ? "A" : "P",
-				TT: H < 12 ? "AM" : "PM",
-				Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
-				o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + (Math.abs(o) % 60), 4),
-				S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (((d % 100) - (d % 10) != 10) * d) % 10],
+				t: H < 12 ? 'a' : 'p',
+				tt: H < 12 ? 'am' : 'pm',
+				T: H < 12 ? 'A' : 'P',
+				TT: H < 12 ? 'AM' : 'PM',
+				Z: utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''),
+				o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + (Math.abs(o) % 60), 4),
+				S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (((d % 100) - (d % 10) != 10) * d) % 10],
 			};
 			};
 
 
 		return mask.replace(token, function ($0) {
 		return mask.replace(token, function ($0) {
@@ -133,16 +133,16 @@ var dateFormat = (function () {
 
 
 // Some common format strings
 // Some common format strings
 dateFormat.masks = {
 dateFormat.masks = {
-	default: "ddd mmm dd yyyy HH:MM:ss",
-	shortDate: "m/d/yy",
-	mediumDate: "mmm d, yyyy",
-	longDate: "mmmm d, yyyy",
-	fullDate: "dddd, mmmm d, yyyy",
-	shortTime: "h:MM TT",
-	mediumTime: "h:MM:ss TT",
-	longTime: "h:MM:ss TT Z",
-	isoDate: "yyyy-mm-dd",
-	isoTime: "HH:MM:ss",
+	default: 'ddd mmm dd yyyy HH:MM:ss',
+	shortDate: 'm/d/yy',
+	mediumDate: 'mmm d, yyyy',
+	longDate: 'mmmm d, yyyy',
+	fullDate: 'dddd, mmmm d, yyyy',
+	shortTime: 'h:MM TT',
+	mediumTime: 'h:MM:ss TT',
+	longTime: 'h:MM:ss TT Z',
+	isoDate: 'yyyy-mm-dd',
+	isoTime: 'HH:MM:ss',
 	isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
 	isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
 	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
 	isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
 };
 };
@@ -150,46 +150,46 @@ dateFormat.masks = {
 // Internationalization strings
 // Internationalization strings
 dateFormat.i18n = {
 dateFormat.i18n = {
 	dayNames: [
 	dayNames: [
-		"Sun",
-		"Mon",
-		"Tue",
-		"Wed",
-		"Thu",
-		"Fri",
-		"Sat",
-		"Sunday",
-		"Monday",
-		"Tuesday",
-		"Wednesday",
-		"Thursday",
-		"Friday",
-		"Saturday",
+		'Sun',
+		'Mon',
+		'Tue',
+		'Wed',
+		'Thu',
+		'Fri',
+		'Sat',
+		'Sunday',
+		'Monday',
+		'Tuesday',
+		'Wednesday',
+		'Thursday',
+		'Friday',
+		'Saturday',
 	],
 	],
 	monthNames: [
 	monthNames: [
-		"Jan",
-		"Feb",
-		"Mar",
-		"Apr",
-		"May",
-		"Jun",
-		"Jul",
-		"Aug",
-		"Sep",
-		"Oct",
-		"Nov",
-		"Dec",
-		"January",
-		"February",
-		"March",
-		"April",
-		"May",
-		"June",
-		"July",
-		"August",
-		"September",
-		"October",
-		"November",
-		"December",
+		'Jan',
+		'Feb',
+		'Mar',
+		'Apr',
+		'May',
+		'Jun',
+		'Jul',
+		'Aug',
+		'Sep',
+		'Oct',
+		'Nov',
+		'Dec',
+		'January',
+		'February',
+		'March',
+		'April',
+		'May',
+		'June',
+		'July',
+		'August',
+		'September',
+		'October',
+		'November',
+		'December',
 	],
 	],
 };
 };
 
 
@@ -239,15 +239,15 @@ Date.prototype.dateFormat = function (format, ignore_offset) {
 };
 };
 
 
 Date.createNewFormat = function (format) {
 Date.createNewFormat = function (format) {
-	var funcName = "format" + Date.formatFunctions.count++;
+	var funcName = 'format' + Date.formatFunctions.count++;
 	Date.formatFunctions[format] = funcName;
 	Date.formatFunctions[format] = funcName;
-	var code = "Date.prototype." + funcName + " = function(){return ";
+	var code = 'Date.prototype.' + funcName + ' = function(){return ';
 	var special = false;
 	var special = false;
-	var ch = "";
+	var ch = '';
 	for (var i = 0; i < format.length; ++i) {
 	for (var i = 0; i < format.length; ++i) {
 		ch = format.charAt(i);
 		ch = format.charAt(i);
 		// escape character start
 		// escape character start
-		if (!special && ch == "\\") {
+		if (!special && ch == '\\') {
 			special = true;
 			special = true;
 		}
 		}
 		// escaped string
 		// escaped string
@@ -267,69 +267,69 @@ Date.createNewFormat = function (format) {
 			code += Date.getFormatCode(ch);
 			code += Date.getFormatCode(ch);
 		}
 		}
 	}
 	}
-	eval(code.substring(0, code.length - 3) + ";}");
+	eval(code.substring(0, code.length - 3) + ';}');
 };
 };
 
 
 Date.getFormatCode = function (character) {
 Date.getFormatCode = function (character) {
 	switch (character) {
 	switch (character) {
-		case "d":
+		case 'd':
 			return "String.leftPad(this.getDate(), 2, '0') + ";
 			return "String.leftPad(this.getDate(), 2, '0') + ";
-		case "D":
-			return "Date.dayNames[this.getDay()].substring(0, 3) + ";
-		case "j":
-			return "this.getDate() + ";
-		case "l":
-			return "Date.dayNames[this.getDay()] + ";
-		case "S":
-			return "this.getSuffix() + ";
-		case "w":
-			return "this.getDay() + ";
-		case "z":
-			return "this.getDayOfYear() + ";
-		case "W":
-			return "this.getWeekOfYear() + ";
-		case "F":
-			return "Date.monthNames[this.getMonth()] + ";
-		case "m":
+		case 'D':
+			return 'Date.dayNames[this.getDay()].substring(0, 3) + ';
+		case 'j':
+			return 'this.getDate() + ';
+		case 'l':
+			return 'Date.dayNames[this.getDay()] + ';
+		case 'S':
+			return 'this.getSuffix() + ';
+		case 'w':
+			return 'this.getDay() + ';
+		case 'z':
+			return 'this.getDayOfYear() + ';
+		case 'W':
+			return 'this.getWeekOfYear() + ';
+		case 'F':
+			return 'Date.monthNames[this.getMonth()] + ';
+		case 'm':
 			return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
 			return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
-		case "M":
-			return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
-		case "n":
-			return "(this.getMonth() + 1) + ";
-		case "t":
-			return "this.getDaysInMonth() + ";
-		case "L":
-			return "(this.isLeapYear() ? 1 : 0) + ";
-		case "Y":
-			return "this.getFullYear() + ";
-		case "y":
+		case 'M':
+			return 'Date.monthNames[this.getMonth()].substring(0, 3) + ';
+		case 'n':
+			return '(this.getMonth() + 1) + ';
+		case 't':
+			return 'this.getDaysInMonth() + ';
+		case 'L':
+			return '(this.isLeapYear() ? 1 : 0) + ';
+		case 'Y':
+			return 'this.getFullYear() + ';
+		case 'y':
 			return "('' + this.getFullYear()).substring(2, 4) + ";
 			return "('' + this.getFullYear()).substring(2, 4) + ";
-		case "a":
+		case 'a':
 			return "(this.getHours() < 12 ? 'am' : 'pm') + ";
 			return "(this.getHours() < 12 ? 'am' : 'pm') + ";
-		case "A":
+		case 'A':
 			return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
 			return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
-		case "g":
-			return "((this.getHours() %12) ? this.getHours() % 12 : 12) + ";
-		case "G":
-			return "this.getHours() + ";
-		case "h":
+		case 'g':
+			return '((this.getHours() %12) ? this.getHours() % 12 : 12) + ';
+		case 'G':
+			return 'this.getHours() + ';
+		case 'h':
 			return "String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";
 			return "String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";
-		case "H":
+		case 'H':
 			return "String.leftPad(this.getHours(), 2, '0') + ";
 			return "String.leftPad(this.getHours(), 2, '0') + ";
-		case "i":
+		case 'i':
 			return "String.leftPad(this.getMinutes(), 2, '0') + ";
 			return "String.leftPad(this.getMinutes(), 2, '0') + ";
-		case "s":
+		case 's':
 			return "String.leftPad(this.getSeconds(), 2, '0') + ";
 			return "String.leftPad(this.getSeconds(), 2, '0') + ";
-		case "X":
+		case 'X':
 			return "String.leftPad(this.getMilliseconds(), 3, '0') + ";
 			return "String.leftPad(this.getMilliseconds(), 3, '0') + ";
-		case "O":
-			return "this.getGMTOffset() + ";
-		case "T":
-			return "this.getTimezone() + ";
-		case "Z":
-			return "(this.getTimezoneOffset() * -60) + ";
-		case "q": // quarter num, Q for name?
-			return "this.getQuarter() + ";
+		case 'O':
+			return 'this.getGMTOffset() + ';
+		case 'T':
+			return 'this.getTimezone() + ';
+		case 'Z':
+			return '(this.getTimezoneOffset() * -60) + ';
+		case 'q': // quarter num, Q for name?
+			return 'this.getQuarter() + ';
 		default:
 		default:
 			return "'" + String.escape(character) + "' + ";
 			return "'" + String.escape(character) + "' + ";
 	}
 	}
@@ -344,31 +344,31 @@ Date.parseDate = function (input, format) {
 };
 };
 
 
 Date.createParser = function (format) {
 Date.createParser = function (format) {
-	var funcName = "parse" + Date.parseFunctions.count++;
+	var funcName = 'parse' + Date.parseFunctions.count++;
 	var regexNum = Date.parseRegexes.length;
 	var regexNum = Date.parseRegexes.length;
 	var currentGroup = 1;
 	var currentGroup = 1;
 	Date.parseFunctions[format] = funcName;
 	Date.parseFunctions[format] = funcName;
 
 
 	var code =
 	var code =
-		"Date." +
+		'Date.' +
 		funcName +
 		funcName +
-		" = function(input){\n" +
-		"var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, ms = -1, z = 0;\n" +
-		"var d = new Date();\n" +
-		"y = d.getFullYear();\n" +
-		"m = d.getMonth();\n" +
-		"d = d.getDate();\n" +
-		"var results = input.match(Date.parseRegexes[" +
+		' = function(input){\n' +
+		'var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, ms = -1, z = 0;\n' +
+		'var d = new Date();\n' +
+		'y = d.getFullYear();\n' +
+		'm = d.getMonth();\n' +
+		'd = d.getDate();\n' +
+		'var results = input.match(Date.parseRegexes[' +
 		regexNum +
 		regexNum +
-		"]);\n" +
-		"if (results && results.length > 0) {";
-	var regex = "";
+		']);\n' +
+		'if (results && results.length > 0) {';
+	var regex = '';
 
 
 	var special = false;
 	var special = false;
-	var ch = "";
+	var ch = '';
 	for (var i = 0; i < format.length; ++i) {
 	for (var i = 0; i < format.length; ++i) {
 		ch = format.charAt(i);
 		ch = format.charAt(i);
-		if (!special && ch == "\\") {
+		if (!special && ch == '\\') {
 			special = true;
 			special = true;
 		} else if (special) {
 		} else if (special) {
 			special = false;
 			special = false;
@@ -384,130 +384,130 @@ Date.createParser = function (format) {
 	}
 	}
 
 
 	code +=
 	code +=
-		"if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0)\n" +
-		"{return new Date(y, m, d, h, i, s, ms).applyOffset(z);}\n" +
-		"if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n" +
-		"{return new Date(y, m, d, h, i, s).applyOffset(z);}\n" +
-		"else if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n" +
-		"{return new Date(y, m, d, h, i).applyOffset(z);}\n" +
-		"else if (y > 0 && m >= 0 && d > 0 && h >= 0)\n" +
-		"{return new Date(y, m, d, h).applyOffset(z);}\n" +
-		"else if (y > 0 && m >= 0 && d > 0)\n" +
-		"{return new Date(y, m, d).applyOffset(z);}\n" +
-		"else if (y > 0 && m >= 0)\n" +
-		"{return new Date(y, m).applyOffset(z);}\n" +
-		"else if (y > 0)\n" +
-		"{return new Date(y).applyOffset(z);}\n" +
-		"}return null;}";
-
-	Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$");
+		'if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0 && ms >= 0)\n' +
+		'{return new Date(y, m, d, h, i, s, ms).applyOffset(z);}\n' +
+		'if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n' +
+		'{return new Date(y, m, d, h, i, s).applyOffset(z);}\n' +
+		'else if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n' +
+		'{return new Date(y, m, d, h, i).applyOffset(z);}\n' +
+		'else if (y > 0 && m >= 0 && d > 0 && h >= 0)\n' +
+		'{return new Date(y, m, d, h).applyOffset(z);}\n' +
+		'else if (y > 0 && m >= 0 && d > 0)\n' +
+		'{return new Date(y, m, d).applyOffset(z);}\n' +
+		'else if (y > 0 && m >= 0)\n' +
+		'{return new Date(y, m).applyOffset(z);}\n' +
+		'else if (y > 0)\n' +
+		'{return new Date(y).applyOffset(z);}\n' +
+		'}return null;}';
+
+	Date.parseRegexes[regexNum] = new RegExp('^' + regex + '$');
 	eval(code);
 	eval(code);
 };
 };
 
 
 Date.formatCodeToRegex = function (character, currentGroup) {
 Date.formatCodeToRegex = function (character, currentGroup) {
 	switch (character) {
 	switch (character) {
-		case "D":
-			return { g: 0, c: null, s: "(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)" };
-		case "j":
-		case "d":
-			return { g: 1, c: "d = parseInt(results[" + currentGroup + "], 10);\n", s: "(\\d{1,2})" };
-		case "l":
-			return { g: 0, c: null, s: "(?:" + Date.dayNames.join("|") + ")" };
-		case "S":
-			return { g: 0, c: null, s: "(?:st|nd|rd|th)" };
-		case "w":
-			return { g: 0, c: null, s: "\\d" };
-		case "z":
-			return { g: 0, c: null, s: "(?:\\d{1,3})" };
-		case "W":
-			return { g: 0, c: null, s: "(?:\\d{2})" };
-		case "F":
+		case 'D':
+			return { g: 0, c: null, s: '(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)' };
+		case 'j':
+		case 'd':
+			return { g: 1, c: 'd = parseInt(results[' + currentGroup + '], 10);\n', s: '(\\d{1,2})' };
+		case 'l':
+			return { g: 0, c: null, s: '(?:' + Date.dayNames.join('|') + ')' };
+		case 'S':
+			return { g: 0, c: null, s: '(?:st|nd|rd|th)' };
+		case 'w':
+			return { g: 0, c: null, s: '\\d' };
+		case 'z':
+			return { g: 0, c: null, s: '(?:\\d{1,3})' };
+		case 'W':
+			return { g: 0, c: null, s: '(?:\\d{2})' };
+		case 'F':
 			return {
 			return {
 				g: 1,
 				g: 1,
-				c: "m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
-				s: "(" + Date.monthNames.join("|") + ")",
+				c: 'm = parseInt(Date.monthNumbers[results[' + currentGroup + '].substring(0, 3)], 10);\n',
+				s: '(' + Date.monthNames.join('|') + ')',
 			};
 			};
-		case "M":
+		case 'M':
 			return {
 			return {
 				g: 1,
 				g: 1,
-				c: "m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
-				s: "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",
+				c: 'm = parseInt(Date.monthNumbers[results[' + currentGroup + ']], 10);\n',
+				s: '(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)',
 			};
 			};
-		case "n":
-		case "m":
-			return { g: 1, c: "m = parseInt(results[" + currentGroup + "], 10) - 1;\n", s: "(\\d{1,2})" };
-		case "t":
-			return { g: 0, c: null, s: "\\d{1,2}" };
-		case "L":
-			return { g: 0, c: null, s: "(?:1|0)" };
-		case "Y":
-			return { g: 1, c: "y = parseInt(results[" + currentGroup + "], 10);\n", s: "(\\d{4})" };
-		case "y":
+		case 'n':
+		case 'm':
+			return { g: 1, c: 'm = parseInt(results[' + currentGroup + '], 10) - 1;\n', s: '(\\d{1,2})' };
+		case 't':
+			return { g: 0, c: null, s: '\\d{1,2}' };
+		case 'L':
+			return { g: 0, c: null, s: '(?:1|0)' };
+		case 'Y':
+			return { g: 1, c: 'y = parseInt(results[' + currentGroup + '], 10);\n', s: '(\\d{4})' };
+		case 'y':
 			return {
 			return {
 				g: 1,
 				g: 1,
 				c:
 				c:
-					"var ty = parseInt(results[" +
+					'var ty = parseInt(results[' +
 					currentGroup +
 					currentGroup +
-					"], 10);\n" +
-					"y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
-				s: "(\\d{1,2})",
+					'], 10);\n' +
+					'y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n',
+				s: '(\\d{1,2})',
 			};
 			};
-		case "a":
+		case 'a':
 			return {
 			return {
 				g: 1,
 				g: 1,
 				c:
 				c:
-					"if (results[" +
+					'if (results[' +
 					currentGroup +
 					currentGroup +
 					"] == 'am') {\n" +
 					"] == 'am') {\n" +
-					"if (h == 12) { h = 0; }\n" +
-					"} else { if (h < 12) { h += 12; }}",
-				s: "(am|pm)",
+					'if (h == 12) { h = 0; }\n' +
+					'} else { if (h < 12) { h += 12; }}',
+				s: '(am|pm)',
 			};
 			};
-		case "A":
+		case 'A':
 			return {
 			return {
 				g: 1,
 				g: 1,
 				c:
 				c:
-					"if (results[" +
+					'if (results[' +
 					currentGroup +
 					currentGroup +
 					"] == 'AM') {\n" +
 					"] == 'AM') {\n" +
-					"if (h == 12) { h = 0; }\n" +
-					"} else { if (h < 12) { h += 12; }}",
-				s: "(AM|PM)",
+					'if (h == 12) { h = 0; }\n' +
+					'} else { if (h < 12) { h += 12; }}',
+				s: '(AM|PM)',
 			};
 			};
-		case "g":
-		case "G":
-		case "h":
-		case "H":
-			return { g: 1, c: "h = parseInt(results[" + currentGroup + "], 10);\n", s: "(\\d{1,2})" };
-		case "i":
-			return { g: 1, c: "i = parseInt(results[" + currentGroup + "], 10);\n", s: "(\\d{2})" };
-		case "s":
-			return { g: 1, c: "s = parseInt(results[" + currentGroup + "], 10);\n", s: "(\\d{2})" };
-		case "X":
-			return { g: 1, c: "ms = parseInt(results[" + currentGroup + "], 10);\n", s: "(\\d{3})" };
-		case "O":
-		case "P":
+		case 'g':
+		case 'G':
+		case 'h':
+		case 'H':
+			return { g: 1, c: 'h = parseInt(results[' + currentGroup + '], 10);\n', s: '(\\d{1,2})' };
+		case 'i':
+			return { g: 1, c: 'i = parseInt(results[' + currentGroup + '], 10);\n', s: '(\\d{2})' };
+		case 's':
+			return { g: 1, c: 's = parseInt(results[' + currentGroup + '], 10);\n', s: '(\\d{2})' };
+		case 'X':
+			return { g: 1, c: 'ms = parseInt(results[' + currentGroup + '], 10);\n', s: '(\\d{3})' };
+		case 'O':
+		case 'P':
 			return {
 			return {
 				g: 1,
 				g: 1,
-				c: "z = Date.parseOffset(results[" + currentGroup + "], 10);\n",
-				s: "(Z|[+-]\\d{2}:?\\d{2})",
+				c: 'z = Date.parseOffset(results[' + currentGroup + '], 10);\n',
+				s: '(Z|[+-]\\d{2}:?\\d{2})',
 			}; // "Z", "+05:00", "+0500" all acceptable.
 			}; // "Z", "+05:00", "+0500" all acceptable.
-		case "T":
-			return { g: 0, c: null, s: "[A-Z]{3}" };
-		case "Z":
-			return { g: 1, c: "s = parseInt(results[" + currentGroup + "], 10);\n", s: "([+-]\\d{1,5})" };
+		case 'T':
+			return { g: 0, c: null, s: '[A-Z]{3}' };
+		case 'Z':
+			return { g: 1, c: 's = parseInt(results[' + currentGroup + '], 10);\n', s: '([+-]\\d{1,5})' };
 		default:
 		default:
 			return { g: 0, c: null, s: String.escape(character) };
 			return { g: 0, c: null, s: String.escape(character) };
 	}
 	}
 };
 };
 
 
 Date.parseOffset = function (str) {
 Date.parseOffset = function (str) {
-	if (str == "Z") {
+	if (str == 'Z') {
 		return 0;
 		return 0;
 	} // UTC, no offset.
 	} // UTC, no offset.
 	var seconds;
 	var seconds;
 	seconds = parseInt(str[0] + str[1] + str[2]) * 3600; // e.g., "+05" or "-08"
 	seconds = parseInt(str[0] + str[1] + str[2]) * 3600; // e.g., "+05" or "-08"
-	if (str[3] == ":") {
+	if (str[3] == ':') {
 		// "+HH:MM" is preferred iso8601 format ("O")
 		// "+HH:MM" is preferred iso8601 format ("O")
 		seconds += parseInt(str[4] + str[5]) * 60;
 		seconds += parseInt(str[4] + str[5]) * 60;
 	} else {
 	} else {
@@ -535,16 +535,16 @@ Date.prototype.applyOffset = function (offset_seconds) {
 
 
 Date.prototype.getTimezone = function () {
 Date.prototype.getTimezone = function () {
 	return this.toString()
 	return this.toString()
-		.replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/, "$1")
-		.replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, "$1$2$3")
-		.replace(/^.*?[0-9]{4} \(([A-Z]{3})\)/, "$1");
+		.replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/, '$1')
+		.replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, '$1$2$3')
+		.replace(/^.*?[0-9]{4} \(([A-Z]{3})\)/, '$1');
 };
 };
 
 
 Date.prototype.getGMTOffset = function () {
 Date.prototype.getGMTOffset = function () {
 	return (
 	return (
-		(this.getTimezoneOffset() > 0 ? "-" : "+") +
-		String.leftPad(Math.floor(this.getTimezoneOffset() / 60), 2, "0") +
-		String.leftPad(this.getTimezoneOffset() % 60, 2, "0")
+		(this.getTimezoneOffset() > 0 ? '-' : '+') +
+		String.leftPad(Math.floor(this.getTimezoneOffset() / 60), 2, '0') +
+		String.leftPad(this.getTimezoneOffset() % 60, 2, '0')
 	);
 	);
 };
 };
 
 
@@ -564,7 +564,7 @@ Date.prototype.getWeekOfYear = function () {
 	var jan1 = new Date(this.getFullYear(), 0, 1);
 	var jan1 = new Date(this.getFullYear(), 0, 1);
 	var then = 7 - jan1.getDay() + 4;
 	var then = 7 - jan1.getDay() + 4;
 	document.write(then);
 	document.write(then);
-	return String.leftPad((now - then) / 7 + 1, 2, "0");
+	return String.leftPad((now - then) / 7 + 1, 2, '0');
 };
 };
 
 
 Date.prototype.isLeapYear = function () {
 Date.prototype.isLeapYear = function () {
@@ -595,26 +595,26 @@ Date.prototype.getSuffix = function () {
 		case 1:
 		case 1:
 		case 21:
 		case 21:
 		case 31:
 		case 31:
-			return "st";
+			return 'st';
 		case 2:
 		case 2:
 		case 22:
 		case 22:
-			return "nd";
+			return 'nd';
 		case 3:
 		case 3:
 		case 23:
 		case 23:
-			return "rd";
+			return 'rd';
 		default:
 		default:
-			return "th";
+			return 'th';
 	}
 	}
 };
 };
 
 
 String.escape = function (string) {
 String.escape = function (string) {
-	return string.replace(/('|\\)/g, "\\$1");
+	return string.replace(/('|\\)/g, '\\$1');
 };
 };
 
 
 String.leftPad = function (val, size, ch) {
 String.leftPad = function (val, size, ch) {
 	var result = new String(val);
 	var result = new String(val);
 	if (ch == null) {
 	if (ch == null) {
-		ch = " ";
+		ch = ' ';
 	}
 	}
 	while (result.length < size) {
 	while (result.length < size) {
 		result = ch + result;
 		result = ch + result;
@@ -625,20 +625,20 @@ String.leftPad = function (val, size, ch) {
 Date.quarterFromMonthNum = [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4];
 Date.quarterFromMonthNum = [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4];
 Date.daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
 Date.daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
 Date.monthNames = [
 Date.monthNames = [
-	"January",
-	"February",
-	"March",
-	"April",
-	"May",
-	"June",
-	"July",
-	"August",
-	"September",
-	"October",
-	"November",
-	"December",
+	'January',
+	'February',
+	'March',
+	'April',
+	'May',
+	'June',
+	'July',
+	'August',
+	'September',
+	'October',
+	'November',
+	'December',
 ];
 ];
-Date.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
+Date.dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
 Date.y2kYear = 50;
 Date.y2kYear = 50;
 Date.monthNumbers = {
 Date.monthNumbers = {
 	Jan: 0,
 	Jan: 0,
@@ -655,17 +655,17 @@ Date.monthNumbers = {
 	Dec: 11,
 	Dec: 11,
 };
 };
 Date.patterns = {
 Date.patterns = {
-	ISO8601LongPattern: "Y\\-m\\-d\\TH\\:i\\:sO",
-	ISO8601ShortPattern: "Y\\-m\\-d",
-	ShortDatePattern: "n/j/Y",
-	LongDatePattern: "l, F d, Y",
-	FullDateTimePattern: "l, F d, Y g:i:s A",
-	MonthDayPattern: "F d",
-	ShortTimePattern: "g:i A",
-	LongTimePattern: "g:i:s A",
-	SortableDateTimePattern: "Y-m-d\\TH:i:s",
-	UniversalSortableDateTimePattern: "Y-m-d H:i:sO",
-	YearMonthPattern: "F, Y",
+	ISO8601LongPattern: 'Y\\-m\\-d\\TH\\:i\\:sO',
+	ISO8601ShortPattern: 'Y\\-m\\-d',
+	ShortDatePattern: 'n/j/Y',
+	LongDatePattern: 'l, F d, Y',
+	FullDateTimePattern: 'l, F d, Y g:i:s A',
+	MonthDayPattern: 'F d',
+	ShortTimePattern: 'g:i A',
+	LongTimePattern: 'g:i:s A',
+	SortableDateTimePattern: 'Y-m-d\\TH:i:s',
+	UniversalSortableDateTimePattern: 'Y-m-d H:i:sO',
+	YearMonthPattern: 'F, Y',
 };
 };
 
 
 /**
 /**
@@ -673,7 +673,7 @@ Date.patterns = {
  * @author: Malishev Dmitry <dima.malishev@gmail.com>
  * @author: Malishev Dmitry <dima.malishev@gmail.com>
  */
  */
 var _DEBUG = true;
 var _DEBUG = true;
-var _DEBUG_LEVEL = "ALL";
+var _DEBUG_LEVEL = 'ALL';
 // possible levels: ALL, IMPORTANT
 // possible levels: ALL, IMPORTANT
 var Error = { FATAL: 1, WARNING: 0, NORMAL: -1 };
 var Error = { FATAL: 1, WARNING: 0, NORMAL: -1 };
 
 
@@ -681,7 +681,7 @@ var Error = { FATAL: 1, WARNING: 0, NORMAL: -1 };
  * Init debug, grabs console object if accessible, or makes dummy debugger
  * Init debug, grabs console object if accessible, or makes dummy debugger
  */
  */
 var fb =
 var fb =
-	_DEBUG && "undefined" != typeof console
+	_DEBUG && 'undefined' != typeof console
 		? console
 		? console
 		: {
 		: {
 				log: function () {},
 				log: function () {},
@@ -704,7 +704,7 @@ var fb =
 		  };
 		  };
 
 
 var checked = false;
 var checked = false;
-var frmname = "";
+var frmname = '';
 
 
 //
 //
 var App = {
 var App = {
@@ -716,8 +716,8 @@ var App = {
 	Core: {},
 	Core: {},
 	// CONSTANT VALUES
 	// CONSTANT VALUES
 	Constants: {
 	Constants: {
-		UNLIM_VALUE: "unlimited", // overritten in i18n.js.php
-		UNLIM_TRANSLATED_VALUE: "unlimited", // overritten in i18n.js.php
+		UNLIM_VALUE: 'unlimited', // overritten in i18n.js.php
+		UNLIM_TRANSLATED_VALUE: 'unlimited', // overritten in i18n.js.php
 	},
 	},
 	// Actions. More widly used funcs
 	// Actions. More widly used funcs
 	Actions: {
 	Actions: {
@@ -783,16 +783,16 @@ Array.prototype.get = function (key) {
 };
 };
 Array.prototype.finalize = function () {
 Array.prototype.finalize = function () {
 	this.shift();
 	this.shift();
-	this[0] = this[0].join("");
+	this[0] = this[0].join('');
 	return this[0];
 	return this[0];
 };
 };
 Array.prototype.done = function () {
 Array.prototype.done = function () {
-	return this.join("");
+	return this.join('');
 };
 };
 
 
 String.prototype.wrapperize = function (key, ns) {
 String.prototype.wrapperize = function (key, ns) {
 	var tpl = App.Templates.get(key, ns);
 	var tpl = App.Templates.get(key, ns);
-	tpl.set(":content", this);
+	tpl.set(':content', this);
 
 
 	return tpl.finalize();
 	return tpl.finalize();
 };
 };
@@ -806,36 +806,36 @@ App.Ajax.request = function (method, data, callback, onError) {
 	//App.Helpers.setAjaxBusy(method, data);
 	//App.Helpers.setAjaxBusy(method, data);
 	data = data || {};
 	data = data || {};
 
 
-	var prgs = $(".progress-container");
+	var prgs = $('.progress-container');
 
 
 	switch (method) {
 	switch (method) {
-		case "cd":
-			prgs.find("title").text("Opening dir");
+		case 'cd':
+			prgs.find('title').text('Opening dir');
 			prgs.show();
 			prgs.show();
 			break;
 			break;
-		case "delete_files":
-			prgs.find("title").text("Deleting");
+		case 'delete_files':
+			prgs.find('title').text('Deleting');
 			prgs.show();
 			prgs.show();
 			break;
 			break;
-		case "unpack_item":
-			prgs.find("title").text("Unpacking");
+		case 'unpack_item':
+			prgs.find('title').text('Unpacking');
 			prgs.show();
 			prgs.show();
 			break;
 			break;
-		case "create_file":
-			prgs.find("title").text("Creating file");
+		case 'create_file':
+			prgs.find('title').text('Creating file');
 			prgs.show();
 			prgs.show();
 			break;
 			break;
-		case "create_dir":
-			prgs.find("title").text("Creating directory");
+		case 'create_dir':
+			prgs.find('title').text('Creating directory');
 			prgs.show();
 			prgs.show();
 			break;
 			break;
-		case "rename_file":
-			prgs.find("title").text("Renaming file");
+		case 'rename_file':
+			prgs.find('title').text('Renaming file');
 			prgs.show();
 			prgs.show();
 			break;
 			break;
-		case "copy_file":
-		case "copy_directory":
-			prgs.find("title").text("Copying files");
+		case 'copy_file':
+		case 'copy_directory':
+			prgs.find('title').text('Copying files');
 			prgs.show();
 			prgs.show();
 			break;
 			break;
 		default:
 		default:
@@ -845,11 +845,11 @@ App.Ajax.request = function (method, data, callback, onError) {
 	jQuery.ajax({
 	jQuery.ajax({
 		url: GLOBAL.ajax_url,
 		url: GLOBAL.ajax_url,
 		global: false,
 		global: false,
-		type: data.request_method || "GET",
+		type: data.request_method || 'GET',
 		data: jQuery.extend(data, { action: method }),
 		data: jQuery.extend(data, { action: method }),
-		dataType: "text boost",
+		dataType: 'text boost',
 		converters: {
 		converters: {
-			"text boost": function (value) {
+			'text boost': function (value) {
 				value = value.trim();
 				value = value.trim();
 				return $.parseJSON(value);
 				return $.parseJSON(value);
 			},
 			},
@@ -859,7 +859,7 @@ App.Ajax.request = function (method, data, callback, onError) {
 		error: function (jqXHR, textStatus, errorThrown) {
 		error: function (jqXHR, textStatus, errorThrown) {
 			prgs.hide();
 			prgs.hide();
 			onError && onError();
 			onError && onError();
-			if ("undefined" != typeof onError) {
+			if ('undefined' != typeof onError) {
 				fb.error(textStatus);
 				fb.error(textStatus);
 			}
 			}
 		},
 		},
@@ -873,7 +873,7 @@ App.Ajax.request = function (method, data, callback, onError) {
 			try {
 			try {
 				callback && callback(reply);
 				callback && callback(reply);
 			} catch (e) {
 			} catch (e) {
-				fb.error("GENERAL ERROR with ajax method: " + data.request_method + " " + e);
+				fb.error('GENERAL ERROR with ajax method: ' + data.request_method + ' ' + e);
 				//App.Helpers.generalError();
 				//App.Helpers.generalError();
 			}
 			}
 		},
 		},
@@ -894,12 +894,12 @@ jQuery.extend({
 });
 });
 
 
 App.Core.create_hidden_form = function (action) {
 App.Core.create_hidden_form = function (action) {
-	var form = jQuery("<form>", {
-		id: "hidden-form",
-		method: "post",
+	var form = jQuery('<form>', {
+		id: 'hidden-form',
+		method: 'post',
 		action: action,
 		action: action,
 	});
 	});
-	jQuery("body").append(form);
+	jQuery('body').append(form);
 
 
 	return form;
 	return form;
 };
 };
@@ -910,10 +910,10 @@ App.Core.extend_from_json = function (elm, data, prefix) {
 	var keys = jQuery.keys(data);
 	var keys = jQuery.keys(data);
 	for (var i = 0, cnt = keys.length; i < cnt; i++) {
 	for (var i = 0, cnt = keys.length; i < cnt; i++) {
 		elm.append(
 		elm.append(
-			jQuery("<input>", {
+			jQuery('<input>', {
 				name: keys[i],
 				name: keys[i],
 				value: data[keys[i]],
 				value: data[keys[i]],
-				type: "hidden",
+				type: 'hidden',
 			})
 			})
 		);
 		);
 	}
 	}
@@ -925,22 +925,22 @@ App.Core.flatten_json = function (data, prefix) {
 	var keys = jQuery.keys(data);
 	var keys = jQuery.keys(data);
 	var result = {};
 	var result = {};
 
 
-	prefix || (prefix = "");
+	prefix || (prefix = '');
 
 
 	if (keys.length) {
 	if (keys.length) {
 		for (var i = 0, cnt = keys.length; i < cnt; i++) {
 		for (var i = 0, cnt = keys.length; i < cnt; i++) {
 			var value = data[keys[i]];
 			var value = data[keys[i]];
 			switch (typeof value) {
 			switch (typeof value) {
-				case "function":
+				case 'function':
 					break;
 					break;
-				case "object":
+				case 'object':
 					result = jQuery.extend(
 					result = jQuery.extend(
 						result,
 						result,
-						App.Core.flatten_json(value, prefix + "[" + keys[i] + "]")
+						App.Core.flatten_json(value, prefix + '[' + keys[i] + ']')
 					);
 					);
 					break;
 					break;
 				default:
 				default:
-					result[prefix + "[" + keys[i] + "]"] = value;
+					result[prefix + '[' + keys[i] + ']'] = value;
 			}
 			}
 		}
 		}
 		return result;
 		return result;
@@ -980,12 +980,12 @@ timer.stop = function (msg) {
 
 
 timer.print = function (msg) {
 timer.print = function (msg) {
 	var passed = timer.stop_time - timer.start_time;
 	var passed = timer.stop_time - timer.start_time;
-	fb.info(msg || "" + passed / 1000);
+	fb.info(msg || '' + passed / 1000);
 };
 };
 
 
 String.prototype.trim = function () {
 String.prototype.trim = function () {
 	var str = this;
 	var str = this;
-	str = str.replace(/^\s+/, "");
+	str = str.replace(/^\s+/, '');
 	for (var i = str.length - 1; i >= 0; i--) {
 	for (var i = str.length - 1; i >= 0; i--) {
 		if (/\S/.test(str.charAt(i))) {
 		if (/\S/.test(str.charAt(i))) {
 			str = str.substring(0, i + 1);
 			str = str.substring(0, i + 1);
@@ -996,45 +996,45 @@ String.prototype.trim = function () {
 };
 };
 
 
 set_sticky_class = function () {
 set_sticky_class = function () {
-	var toolbar = $(".toolbar");
-	var tableHeader = $(".table-header");
+	var toolbar = $('.toolbar');
+	var tableHeader = $('.table-header');
 	var toolbarOffset = toolbar.offset().top;
 	var toolbarOffset = toolbar.offset().top;
-	var headerHeight = $(".top-bar").outerHeight();
+	var headerHeight = $('.top-bar').outerHeight();
 
 
 	if ($(window).scrollTop() > toolbarOffset - headerHeight) {
 	if ($(window).scrollTop() > toolbarOffset - headerHeight) {
-		toolbar.addClass("active");
-		tableHeader.addClass("active");
+		toolbar.addClass('active');
+		tableHeader.addClass('active');
 	} else {
 	} else {
-		toolbar.removeClass("active");
-		tableHeader.removeClass("active");
+		toolbar.removeClass('active');
+		tableHeader.removeClass('active');
 	}
 	}
 };
 };
 
 
 function checkedAll(frmname) {
 function checkedAll(frmname) {
-	if ($("input#toggle-all").prop("checked")) {
-		$(".l-unit:not(.header)").addClass("selected");
-		$(".ch-toggle").prop("checked", true);
-		$(".toggle-all").addClass("clicked-on");
+	if ($('input#toggle-all').prop('checked')) {
+		$('.l-unit:not(.header)').addClass('selected');
+		$('.ch-toggle').prop('checked', true);
+		$('.toggle-all').addClass('clicked-on');
 	} else {
 	} else {
-		$(".l-unit:not(.header)").removeClass("selected");
-		$(".ch-toggle").prop("checked", false);
-		$(".toggle-all").removeClass("clicked-on");
+		$('.l-unit:not(.header)').removeClass('selected');
+		$('.ch-toggle').prop('checked', false);
+		$('.toggle-all').removeClass('clicked-on');
 	}
 	}
 }
 }
 
 
 function doSearch(url) {
 function doSearch(url) {
-	var url = url || "/search/";
-	var loc = url + "?q=" + $(".js-search-input").val() + "&token=" + $('input[name="token"]').val();
+	var url = url || '/search/';
+	var loc = url + '?q=' + $('.js-search-input').val() + '&token=' + $('input[name="token"]').val();
 	location.href = loc;
 	location.href = loc;
 	return false;
 	return false;
 }
 }
 
 
 function elementHideShow(elementToHideOrShow, trigger) {
 function elementHideShow(elementToHideOrShow, trigger) {
 	var el = document.getElementById(elementToHideOrShow);
 	var el = document.getElementById(elementToHideOrShow);
-	el.style.display = el.style.display === "none" ? "block" : "none";
+	el.style.display = el.style.display === 'none' ? 'block' : 'none';
 
 
-	if (typeof trigger !== "undefined") {
-		trigger.querySelector(".js-section-toggle-icon").classList.toggle("fa-square-minus");
-		trigger.querySelector(".js-section-toggle-icon").classList.toggle("fa-square-plus");
+	if (typeof trigger !== 'undefined') {
+		trigger.querySelector('.js-section-toggle-icon').classList.toggle('fa-square-minus');
+		trigger.querySelector('.js-section-toggle-icon').classList.toggle('fa-square-plus');
 	}
 	}
 }
 }

+ 111 - 111
web/js/events.js

@@ -5,8 +5,8 @@ var VE = {
 	navigation: {
 	navigation: {
 		state: {
 		state: {
 			active_menu: 1,
 			active_menu: 1,
-			menu_selector: ".main-menu-item",
-			menu_active_selector: ".active",
+			menu_selector: '.main-menu-item',
+			menu_active_selector: '.active',
 		},
 		},
 	}, // menu and element navigation functions
 	}, // menu and element navigation functions
 	notifications: {},
 	notifications: {},
@@ -19,7 +19,7 @@ var VE = {
 	},
 	},
 	helpers: {}, // simple handy methods
 	helpers: {}, // simple handy methods
 	tmp: {
 	tmp: {
-		sort_par: "sort-name",
+		sort_par: 'sort-name',
 		sort_direction: -1,
 		sort_direction: -1,
 		sort_as_int: 0,
 		sort_as_int: 0,
 		form_changed: 0,
 		form_changed: 0,
@@ -35,8 +35,8 @@ var VE = {
  * @param event_type (eg: click, mouseover etc..)
  * @param event_type (eg: click, mouseover etc..)
  */
  */
 VE.core.register = function (root, event_type) {
 VE.core.register = function (root, event_type) {
-	var root = !root ? "body" : root; // if elm is not passed just bind events to body DOM Element
-	var event_type = !event_type ? "click" : event_type; // set event type to "click" by default
+	var root = !root ? 'body' : root; // if elm is not passed just bind events to body DOM Element
+	var event_type = !event_type ? 'click' : event_type; // set event type to "click" by default
 	$(root).bind(event_type, function (evt) {
 	$(root).bind(event_type, function (evt) {
 		var elm = $(evt.target);
 		var elm = $(evt.target);
 		VE.core.dispatch(evt, elm, event_type); // dispatch captured event
 		VE.core.dispatch(evt, elm, event_type); // dispatch captured event
@@ -50,7 +50,7 @@ VE.core.register = function (root, event_type) {
  * @param event_type (eg: click, mouseover etc..)
  * @param event_type (eg: click, mouseover etc..)
  */
  */
 VE.core.dispatch = function (evt, elm, event_type) {
 VE.core.dispatch = function (evt, elm, event_type) {
-	if ("undefined" == typeof VE.callbacks[event_type]) {
+	if ('undefined' == typeof VE.callbacks[event_type]) {
 		return VE.helpers.warn(
 		return VE.helpers.warn(
 			'There is no corresponding object that should contain event callbacks for "' +
 			'There is no corresponding object that should contain event callbacks for "' +
 				event_type +
 				event_type +
@@ -58,7 +58,7 @@ VE.core.dispatch = function (evt, elm, event_type) {
 		);
 		);
 	}
 	}
 	// get class of element
 	// get class of element
-	var classes = $(elm).attr("class");
+	var classes = $(elm).attr('class');
 	// if no classes are attached, then just stop any further processings
 	// if no classes are attached, then just stop any further processings
 	if (!classes) {
 	if (!classes) {
 		return; // no classes assigned
 		return; // no classes assigned
@@ -77,44 +77,44 @@ VE.core.dispatch = function (evt, elm, event_type) {
  * Suspend action
  * Suspend action
  */
  */
 VE.callbacks.click.do_suspend = function (evt, elm) {
 VE.callbacks.click.do_suspend = function (evt, elm) {
-	var ref = elm.hasClass("actions-panel") ? elm : elm.parents(".actions-panel");
+	var ref = elm.hasClass('actions-panel') ? elm : elm.parents('.actions-panel');
 	var url = $('input[name="suspend_url"]', ref).val();
 	var url = $('input[name="suspend_url"]', ref).val();
-	var dialog_elm = ref.find(".js-confirm-dialog-suspend");
-	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr("title"), url);
+	var dialog_elm = ref.find('.js-confirm-dialog-suspend');
+	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr('title'), url);
 };
 };
 
 
 /*
 /*
  * Unsuspend action
  * Unsuspend action
  */
  */
 VE.callbacks.click.do_unsuspend = function (evt, elm) {
 VE.callbacks.click.do_unsuspend = function (evt, elm) {
-	var ref = elm.hasClass("actions-panel") ? elm : elm.parents(".actions-panel");
+	var ref = elm.hasClass('actions-panel') ? elm : elm.parents('.actions-panel');
 	var url = $('input[name="unsuspend_url"]', ref).val();
 	var url = $('input[name="unsuspend_url"]', ref).val();
-	var dialog_elm = ref.find(".js-confirm-dialog-suspend");
-	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr("title"), url);
+	var dialog_elm = ref.find('.js-confirm-dialog-suspend');
+	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr('title'), url);
 };
 };
 
 
 /*
 /*
  * Delete action
  * Delete action
  */
  */
 VE.callbacks.click.do_delete = function (evt, elm) {
 VE.callbacks.click.do_delete = function (evt, elm) {
-	var ref = elm.hasClass("actions-panel") ? elm : elm.parents(".actions-panel");
+	var ref = elm.hasClass('actions-panel') ? elm : elm.parents('.actions-panel');
 	var url = $('input[name="delete_url"]', ref).val();
 	var url = $('input[name="delete_url"]', ref).val();
-	var dialog_elm = ref.find(".js-confirm-dialog-delete");
-	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr("title"), url);
+	var dialog_elm = ref.find('.js-confirm-dialog-delete');
+	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr('title'), url);
 };
 };
 
 
 VE.callbacks.click.do_servicerestart = function (evt, elm) {
 VE.callbacks.click.do_servicerestart = function (evt, elm) {
-	var ref = elm.hasClass("actions-panel") ? elm : elm.parents(".actions-panel");
+	var ref = elm.hasClass('actions-panel') ? elm : elm.parents('.actions-panel');
 	var url = $('input[name="servicerestart_url"]', ref).val();
 	var url = $('input[name="servicerestart_url"]', ref).val();
-	var dialog_elm = ref.find(".js-confirm-dialog-servicerestart");
-	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr("title"), url);
+	var dialog_elm = ref.find('.js-confirm-dialog-servicerestart');
+	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr('title'), url);
 };
 };
 
 
 VE.callbacks.click.do_servicestop = function (evt, elm) {
 VE.callbacks.click.do_servicestop = function (evt, elm) {
-	var ref = elm.hasClass("actions-panel") ? elm : elm.parents(".actions-panel");
+	var ref = elm.hasClass('actions-panel') ? elm : elm.parents('.actions-panel');
 	var url = $('input[name="servicestop_url"]', ref).val();
 	var url = $('input[name="servicestop_url"]', ref).val();
-	var dialog_elm = ref.find(".js-confirm-dialog-servicestop");
-	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr("title"), url);
+	var dialog_elm = ref.find('.js-confirm-dialog-servicestop');
+	VE.helpers.createConfirmationDialog(dialog_elm, $(elm).parent().attr('title'), url);
 };
 };
 
 
 /*
 /*
@@ -138,20 +138,20 @@ VE.helpers.createConfirmationDialog = function (
 		width: 360,
 		width: 360,
 		title: dialog_title,
 		title: dialog_title,
 		close: function () {
 		close: function () {
-			$(this).dialog("destroy");
+			$(this).dialog('destroy');
 		},
 		},
 		buttons: {
 		buttons: {
 			OK: function (event, ui) {
 			OK: function (event, ui) {
 				location.href = confirmed_location_url;
 				location.href = confirmed_location_url;
 			},
 			},
 			Cancel: function () {
 			Cancel: function () {
-				$(this).dialog("close");
+				$(this).dialog('close');
 			},
 			},
 		},
 		},
 		create: function () {
 		create: function () {
-			var buttonGroup = $(this).closest(".ui-dialog").find(".ui-dialog-buttonset");
-			buttonGroup.find("button:first").addClass("button submit");
-			buttonGroup.find("button:last").addClass("button button-secondary cancel");
+			var buttonGroup = $(this).closest('.ui-dialog').find('.ui-dialog-buttonset');
+			buttonGroup.find('button:first').addClass('button submit');
+			buttonGroup.find('button:last').addClass('button button-secondary cancel');
 		},
 		},
 	};
 	};
 
 
@@ -164,11 +164,11 @@ VE.helpers.createConfirmationDialog = function (
  * Simple debug output
  * Simple debug output
  */
  */
 VE.helpers.warn = function (msg) {
 VE.helpers.warn = function (msg) {
-	alert("WARNING: " + msg);
+	alert('WARNING: ' + msg);
 };
 };
 
 
 VE.helpers.extendPasswordFields = function () {
 VE.helpers.extendPasswordFields = function () {
-	var references = [".js-password-input"];
+	var references = ['.js-password-input'];
 
 
 	$(document).ready(function () {
 	$(document).ready(function () {
 		$(references).each(function (i, ref) {
 		$(references).each(function (i, ref) {
@@ -178,37 +178,37 @@ VE.helpers.extendPasswordFields = function () {
 };
 };
 
 
 VE.helpers.initAdditionalPasswordFieldElements = function (ref) {
 VE.helpers.initAdditionalPasswordFieldElements = function (ref) {
-	var enabled = $.cookie("hide_passwords") == "1" ? true : false;
+	var enabled = $.cookie('hide_passwords') == '1' ? true : false;
 	if (enabled) {
 	if (enabled) {
 		VE.helpers.hidePasswordFieldText(ref);
 		VE.helpers.hidePasswordFieldText(ref);
 	}
 	}
 
 
-	$(ref).prop("autocomplete", "off");
+	$(ref).prop('autocomplete', 'off');
 
 
-	var enabled_html = enabled ? "" : "show-passwords-enabled-action";
+	var enabled_html = enabled ? '' : 'show-passwords-enabled-action';
 	var html =
 	var html =
 		'<span class="toggle-password"><i class="toggle-psw-visibility-icon fas fa-eye-slash ' +
 		'<span class="toggle-password"><i class="toggle-psw-visibility-icon fas fa-eye-slash ' +
 		enabled_html +
 		enabled_html +
 		'" onclick="VE.helpers.toggleHiddenPasswordText(\'' +
 		'" onclick="VE.helpers.toggleHiddenPasswordText(\'' +
 		ref +
 		ref +
-		"', this)\"></i></span>";
+		'\', this)"></i></span>';
 	$(ref).after(html);
 	$(ref).after(html);
 };
 };
 
 
 VE.helpers.hidePasswordFieldText = function (ref) {
 VE.helpers.hidePasswordFieldText = function (ref) {
-	$.cookie("hide_passwords", "1", { expires: 365, path: "/" });
-	$(ref).prop("type", "password");
+	$.cookie('hide_passwords', '1', { expires: 365, path: '/' });
+	$(ref).prop('type', 'password');
 };
 };
 
 
 VE.helpers.revealPasswordFieldText = function (ref) {
 VE.helpers.revealPasswordFieldText = function (ref) {
-	$.cookie("hide_passwords", "0", { expires: 365, path: "/" });
-	$(ref).prop("type", "text");
+	$.cookie('hide_passwords', '0', { expires: 365, path: '/' });
+	$(ref).prop('type', 'text');
 };
 };
 
 
 VE.helpers.toggleHiddenPasswordText = function (ref, triggering_elm) {
 VE.helpers.toggleHiddenPasswordText = function (ref, triggering_elm) {
-	$(triggering_elm).toggleClass("show-passwords-enabled-action");
+	$(triggering_elm).toggleClass('show-passwords-enabled-action');
 
 
-	if ($(ref).prop("type") == "text") {
+	if ($(ref).prop('type') == 'text') {
 		VE.helpers.hidePasswordFieldText(ref);
 		VE.helpers.hidePasswordFieldText(ref);
 	} else {
 	} else {
 		VE.helpers.revealPasswordFieldText(ref);
 		VE.helpers.revealPasswordFieldText(ref);
@@ -216,11 +216,11 @@ VE.helpers.toggleHiddenPasswordText = function (ref, triggering_elm) {
 };
 };
 
 
 var reloadTimer = 150;
 var reloadTimer = 150;
-var reloadFunction = "";
+var reloadFunction = '';
 
 
 //$(document).ready(startTime);
 //$(document).ready(startTime);
 function startTime() {
 function startTime() {
-	if ($(".spinner")[0]) {
+	if ($('.spinner')[0]) {
 		reloadFunction = setInterval(updateInterval, 100);
 		reloadFunction = setInterval(updateInterval, 100);
 	}
 	}
 }
 }
@@ -236,87 +236,87 @@ function stopTimer() {
 	if (reloadFunction) {
 	if (reloadFunction) {
 		clearInterval(reloadFunction);
 		clearInterval(reloadFunction);
 		reloadFunction = false;
 		reloadFunction = false;
-		$(".spinner").addClass("paused");
-		$(".pause-stop i").removeClass("fa-pause");
-		$(".pause-stop i").addClass("fa-play");
+		$('.spinner').addClass('paused');
+		$('.pause-stop i').removeClass('fa-pause');
+		$('.pause-stop i').addClass('fa-play');
 	} else {
 	} else {
 		reloadFunction = setInterval(updateInterval, 100);
 		reloadFunction = setInterval(updateInterval, 100);
-		$(".spinner").removeClass("paused");
-		$(".pause-stop i").removeClass("fa-play");
-		$(".pause-stop i").addClass("fa-pause");
+		$('.spinner').removeClass('paused');
+		$('.pause-stop i').removeClass('fa-play');
+		$('.pause-stop i').addClass('fa-pause');
 	}
 	}
 }
 }
 
 
 VE.navigation.enter_focused = function () {
 VE.navigation.enter_focused = function () {
-	if ($(".units").hasClass("active")) {
-		location.href = $(".units.active .l-unit.focus .actions-panel__col.actions-panel__edit a").attr(
-			"href"
+	if ($('.units').hasClass('active')) {
+		location.href = $('.units.active .l-unit.focus .actions-panel__col.actions-panel__edit a').attr(
+			'href'
 		);
 		);
 	} else {
 	} else {
-		if ($(VE.navigation.state.menu_selector + ".focus a").attr("href")) {
-			location.href = $(VE.navigation.state.menu_selector + ".focus a").attr("href");
+		if ($(VE.navigation.state.menu_selector + '.focus a').attr('href')) {
+			location.href = $(VE.navigation.state.menu_selector + '.focus a').attr('href');
 		}
 		}
 	}
 	}
 };
 };
 
 
 VE.navigation.move_focus_left = function () {
 VE.navigation.move_focus_left = function () {
 	var index = parseInt(
 	var index = parseInt(
-		$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_selector + ".focus"))
+		$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_selector + '.focus'))
 	);
 	);
 	if (index == -1)
 	if (index == -1)
 		index = parseInt(
 		index = parseInt(
 			$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_active_selector))
 			$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_active_selector))
 		);
 		);
 
 
-	if ($(".units").hasClass("active")) {
-		$(".units").removeClass("active");
+	if ($('.units').hasClass('active')) {
+		$('.units').removeClass('active');
 		index++;
 		index++;
 	}
 	}
 
 
-	$(VE.navigation.state.menu_selector).removeClass("focus");
+	$(VE.navigation.state.menu_selector).removeClass('focus');
 
 
 	if (index > 0) {
 	if (index > 0) {
-		$($(VE.navigation.state.menu_selector)[index - 1]).addClass("focus");
+		$($(VE.navigation.state.menu_selector)[index - 1]).addClass('focus');
 	} else {
 	} else {
-		VE.navigation.switch_menu("last");
+		VE.navigation.switch_menu('last');
 	}
 	}
 };
 };
 
 
 VE.navigation.move_focus_right = function () {
 VE.navigation.move_focus_right = function () {
 	var max_index = $(VE.navigation.state.menu_selector).length - 1;
 	var max_index = $(VE.navigation.state.menu_selector).length - 1;
 	var index = parseInt(
 	var index = parseInt(
-		$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_selector + ".focus"))
+		$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_selector + '.focus'))
 	);
 	);
 	if (index == -1)
 	if (index == -1)
 		index =
 		index =
 			parseInt(
 			parseInt(
 				$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_active_selector))
 				$(VE.navigation.state.menu_selector).index($(VE.navigation.state.menu_active_selector))
 			) || 0;
 			) || 0;
-	$(VE.navigation.state.menu_selector).removeClass("focus");
+	$(VE.navigation.state.menu_selector).removeClass('focus');
 
 
-	if ($(".units").hasClass("active")) {
-		$(".units").removeClass("active");
+	if ($('.units').hasClass('active')) {
+		$('.units').removeClass('active');
 		index--;
 		index--;
 	}
 	}
 
 
 	if (index < max_index) {
 	if (index < max_index) {
-		$($(VE.navigation.state.menu_selector)[index + 1]).addClass("focus");
+		$($(VE.navigation.state.menu_selector)[index + 1]).addClass('focus');
 	} else {
 	} else {
-		VE.navigation.switch_menu("first");
+		VE.navigation.switch_menu('first');
 	}
 	}
 };
 };
 
 
 VE.navigation.move_focus_down = function () {
 VE.navigation.move_focus_down = function () {
-	var max_index = $(".units .l-unit:not(.header)").length - 1;
-	var index = parseInt($(".units .l-unit").index($(".units .l-unit.focus")));
+	var max_index = $('.units .l-unit:not(.header)').length - 1;
+	var index = parseInt($('.units .l-unit').index($('.units .l-unit.focus')));
 
 
 	if (index < max_index) {
 	if (index < max_index) {
-		$(".units .l-unit.focus").removeClass("focus");
-		$($(".units .l-unit:not(.header)")[index + 1]).addClass("focus");
+		$('.units .l-unit.focus').removeClass('focus');
+		$($('.units .l-unit:not(.header)')[index + 1]).addClass('focus');
 
 
-		$("html, body").animate(
+		$('html, body').animate(
 			{
 			{
-				scrollTop: $(".units .l-unit.focus").offset().top - 200,
+				scrollTop: $('.units .l-unit.focus').offset().top - 200,
 			},
 			},
 			200
 			200
 		);
 		);
@@ -324,17 +324,17 @@ VE.navigation.move_focus_down = function () {
 };
 };
 
 
 VE.navigation.move_focus_up = function () {
 VE.navigation.move_focus_up = function () {
-	var index = parseInt($(".units .l-unit:not(.header)").index($(".units .l-unit.focus")));
+	var index = parseInt($('.units .l-unit:not(.header)').index($('.units .l-unit.focus')));
 
 
 	if (index == -1) index = 0;
 	if (index == -1) index = 0;
 
 
 	if (index > 0) {
 	if (index > 0) {
-		$(".units .l-unit.focus").removeClass("focus");
-		$($(".units .l-unit:not(.header)")[index - 1]).addClass("focus");
+		$('.units .l-unit.focus').removeClass('focus');
+		$($('.units .l-unit:not(.header)')[index - 1]).addClass('focus');
 
 
-		$("html, body").animate(
+		$('html, body').animate(
 			{
 			{
-				scrollTop: $(".units .l-unit.focus").offset().top - 200,
+				scrollTop: $('.units .l-unit.focus').offset().top - 200,
 			},
 			},
 			200
 			200
 		);
 		);
@@ -342,18 +342,18 @@ VE.navigation.move_focus_up = function () {
 };
 };
 
 
 VE.navigation.switch_menu = function (position) {
 VE.navigation.switch_menu = function (position) {
-	position = position || "first"; // last
+	position = position || 'first'; // last
 
 
 	if (VE.navigation.state.active_menu == 0) {
 	if (VE.navigation.state.active_menu == 0) {
 		VE.navigation.state.active_menu = 1;
 		VE.navigation.state.active_menu = 1;
-		VE.navigation.state.menu_selector = ".main-menu-item";
-		VE.navigation.state.menu_active_selector = ".active";
+		VE.navigation.state.menu_selector = '.main-menu-item';
+		VE.navigation.state.menu_active_selector = '.active';
 
 
-		if (position == "first") {
-			$($(VE.navigation.state.menu_selector)[0]).addClass("focus");
+		if (position == 'first') {
+			$($(VE.navigation.state.menu_selector)[0]).addClass('focus');
 		} else {
 		} else {
 			var max_index = $(VE.navigation.state.menu_selector).length - 1;
 			var max_index = $(VE.navigation.state.menu_selector).length - 1;
-			$($(VE.navigation.state.menu_selector)[max_index]).addClass("focus");
+			$($(VE.navigation.state.menu_selector)[max_index]).addClass('focus');
 		}
 		}
 	}
 	}
 };
 };
@@ -361,64 +361,64 @@ VE.navigation.switch_menu = function (position) {
 VE.notifications.get_list = function () {
 VE.notifications.get_list = function () {
 	/// TODO get notifications only once
 	/// TODO get notifications only once
 	$.ajax({
 	$.ajax({
-		url: "/list/notifications/?ajax=1&token=" + $("#token").attr("token"),
-		dataType: "json",
+		url: '/list/notifications/?ajax=1&token=' + $('#token').attr('token'),
+		dataType: 'json',
 	}).done(function (data) {
 	}).done(function (data) {
 		var acc = [];
 		var acc = [];
 
 
 		$.each(data, function (i, elm) {
 		$.each(data, function (i, elm) {
-			var tpl = Tpl.get("notification", "WEB");
-			if (elm.ACK == "no") tpl.set(":UNSEEN", "unseen");
-			else tpl.set(":UNSEEN", "");
-
-			tpl.set(":ID", elm.ID);
-			tpl.set(":TYPE", elm.TYPE);
-			tpl.set(":TOPIC", elm.TOPIC);
-			tpl.set(":NOTICE", elm.NOTICE);
-			tpl.set(":TIME", elm.TIME);
-			tpl.set(":DATE", elm.DATE);
+			var tpl = Tpl.get('notification', 'WEB');
+			if (elm.ACK == 'no') tpl.set(':UNSEEN', 'unseen');
+			else tpl.set(':UNSEEN', '');
+
+			tpl.set(':ID', elm.ID);
+			tpl.set(':TYPE', elm.TYPE);
+			tpl.set(':TOPIC', elm.TOPIC);
+			tpl.set(':NOTICE', elm.NOTICE);
+			tpl.set(':TIME', elm.TIME);
+			tpl.set(':DATE', elm.DATE);
 			acc.push(tpl.finalize());
 			acc.push(tpl.finalize());
 		});
 		});
 
 
 		if (!Object.keys(data).length) {
 		if (!Object.keys(data).length) {
-			var tpl = Tpl.get("notification_empty", "WEB");
+			var tpl = Tpl.get('notification_empty', 'WEB');
 			acc.push(tpl.finalize());
 			acc.push(tpl.finalize());
 		}
 		}
 
 
-		$(".notification-container").html(acc.done()).removeClass("u-hidden");
+		$('.notification-container').html(acc.done()).removeClass('u-hidden');
 
 
-		$(".notification-container .mark-seen").click(function (event) {
-			VE.notifications.delete($(event.target).attr("id").replace("notification-", ""));
+		$('.notification-container .mark-seen').click(function (event) {
+			VE.notifications.delete($(event.target).attr('id').replace('notification-', ''));
 		});
 		});
 	});
 	});
 };
 };
 
 
 VE.notifications.delete = function (id) {
 VE.notifications.delete = function (id) {
-	$("#notification-" + id)
-		.parent("li")
+	$('#notification-' + id)
+		.parent('li')
 		.hide();
 		.hide();
 	$.ajax({
 	$.ajax({
 		url:
 		url:
-			"/delete/notification/?delete=1&notification_id=" +
+			'/delete/notification/?delete=1&notification_id=' +
 			id +
 			id +
-			"&token=" +
-			$("#token").attr("token"),
+			'&token=' +
+			$('#token').attr('token'),
 	});
 	});
-	if ($(".notification-container li:visible").length == 0) {
-		$(".js-notifications .status-icon").removeClass("status-icon");
-		$(".js-notifications").removeClass("updates").removeClass("active");
+	if ($('.notification-container li:visible').length == 0) {
+		$('.js-notifications .status-icon').removeClass('status-icon');
+		$('.js-notifications').removeClass('updates').removeClass('active');
 	}
 	}
 };
 };
 
 
 VE.navigation.shortcut = function (elm) {
 VE.navigation.shortcut = function (elm) {
-	var action = elm.attr("key-action");
+	var action = elm.attr('key-action');
 
 
-	if (action == "js") {
-		var e = elm.find(".data-controls");
-		VE.core.dispatch(true, e, "click");
+	if (action == 'js') {
+		var e = elm.find('.data-controls');
+		VE.core.dispatch(true, e, 'click');
 	}
 	}
-	if (action == "href") {
-		location.href = elm.find("a").attr("href");
+	if (action == 'href') {
+		location.href = elm.find('a').attr('href');
 	}
 	}
 };
 };
 
 

+ 42 - 42
web/js/floating_layer.js

@@ -11,16 +11,16 @@
 		var ref = {};
 		var ref = {};
 		var customConfig = params;
 		var customConfig = params;
 		var config = {
 		var config = {
-			bgcolor: "#333",
+			bgcolor: '#333',
 			opacity: 0.6,
 			opacity: 0.6,
-			id: "floating-box",
-			className: "floating-box-class",
+			id: 'floating-box',
+			className: 'floating-box-class',
 			zIndex: 5000,
 			zIndex: 5000,
 			beforeStart: function () {},
 			beforeStart: function () {},
 			beforeEnd: function () {},
 			beforeEnd: function () {},
 			afterStart: function () {},
 			afterStart: function () {},
 			close: null,
 			close: null,
-			closeClass: "close-floating-layer",
+			closeClass: 'close-floating-layer',
 			outerClose: false,
 			outerClose: false,
 			returnParent: jQuery(elm).parent(),
 			returnParent: jQuery(elm).parent(),
 		};
 		};
@@ -34,26 +34,26 @@
 		}
 		}
 
 
 		function start_ovservers() {
 		function start_ovservers() {
-			jQuery(window).bind("scroll.fl", function () {
+			jQuery(window).bind('scroll.fl', function () {
 				setTimeout(function () {
 				setTimeout(function () {
 					reposition();
 					reposition();
 				}, 5);
 				}, 5);
 			});
 			});
 
 
-			jQuery(window).bind("resize.fl", function () {
+			jQuery(window).bind('resize.fl', function () {
 				setTimeout(function () {
 				setTimeout(function () {
 					reposition();
 					reposition();
 				}, 5);
 				}, 5);
 			});
 			});
 
 
-			jQuery(ref.container).bind("click.fl", function (evt) {
+			jQuery(ref.container).bind('click.fl', function (evt) {
 				jQuery(evt.target).hasClass(config.closeClass) ? flayer_destroy() : -1;
 				jQuery(evt.target).hasClass(config.closeClass) ? flayer_destroy() : -1;
-				if (config.outerClose) jQuery(evt.target).hasClass("fl-cloud") ? flayer_destroy() : -1;
+				if (config.outerClose) jQuery(evt.target).hasClass('fl-cloud') ? flayer_destroy() : -1;
 			});
 			});
 
 
 			// todo:
 			// todo:
 			config.outerClose
 			config.outerClose
-				? jQuery(window).bind("keypress.fl", function (evt) {
+				? jQuery(window).bind('keypress.fl', function (evt) {
 						evt.keyCode == 27 ? flayer_destroy() : -1;
 						evt.keyCode == 27 ? flayer_destroy() : -1;
 				  })
 				  })
 				: -1;
 				: -1;
@@ -66,11 +66,11 @@
 			viewport.height = window.innerHeight ? window.innerHeight : jQuery(window).height(); //jQuery(document.body).height();
 			viewport.height = window.innerHeight ? window.innerHeight : jQuery(window).height(); //jQuery(document.body).height();
 			viewport.width = jQuery(window).width(); //jQuery(document.body).width();
 			viewport.width = jQuery(window).width(); //jQuery(document.body).width();
 
 
-			var had = jQuery("<div>")
-				.attr("id", "truth-is-out-there")
-				.css({ position: "absolute", left: "-50000px" });
-			var dolly = jQuery(elm).clone(true).addClass("dolly");
-			jQuery(had).append(jQuery(dolly).removeClass("u-hidden"));
+			var had = jQuery('<div>')
+				.attr('id', 'truth-is-out-there')
+				.css({ position: 'absolute', left: '-50000px' });
+			var dolly = jQuery(elm).clone(true).addClass('dolly');
+			jQuery(had).append(jQuery(dolly).removeClass('u-hidden'));
 			jQuery(document.body).prepend(had);
 			jQuery(document.body).prepend(had);
 			var dims = { width: jQuery(dolly).width(), height: jQuery(dolly).height() };
 			var dims = { width: jQuery(dolly).width(), height: jQuery(dolly).height() };
 			jQuery(had).remove();
 			jQuery(had).remove();
@@ -112,11 +112,11 @@
 
 
 		function flayer_destroy() {
 		function flayer_destroy() {
 			config.beforeEnd(elm);
 			config.beforeEnd(elm);
-			jQuery(window).unbind("scroll.fl");
-			jQuery(window).unbind("resize.fl");
-			jQuery(ref.container).unbind("click.fl");
-			config.outerClose ? jQuery(window).unbind("keypress.fl") : -1;
-			jQuery(config.returnParent).append(jQuery(elm).addClass("u-hidden"));
+			jQuery(window).unbind('scroll.fl');
+			jQuery(window).unbind('resize.fl');
+			jQuery(ref.container).unbind('click.fl');
+			config.outerClose ? jQuery(window).unbind('keypress.fl') : -1;
+			jQuery(config.returnParent).append(jQuery(elm).addClass('u-hidden'));
 			jQuery(ref.container).remove();
 			jQuery(ref.container).remove();
 			jQuery.browser.msie && jQuery.browser.version.substr(0, 1) < 7 ? show_selects() : -1;
 			jQuery.browser.msie && jQuery.browser.version.substr(0, 1) < 7 ? show_selects() : -1;
 
 
@@ -124,48 +124,48 @@
 		}
 		}
 
 
 		function embed() {
 		function embed() {
-			ref.container = jQuery("<div>");
-			jQuery(ref.container).addClass(config.className + "-container");
+			ref.container = jQuery('<div>');
+			jQuery(ref.container).addClass(config.className + '-container');
 			jQuery(ref.container)
 			jQuery(ref.container)
 				.css({
 				.css({
-					position: "absolute",
-					left: "0",
-					top: "0",
-					display: "none",
+					position: 'absolute',
+					left: '0',
+					top: '0',
+					display: 'none',
 					zIndex: config.zIndex,
 					zIndex: config.zIndex,
 				})
 				})
-				.addClass("fl-cloud")
-				.addClass("u-hidden");
+				.addClass('fl-cloud')
+				.addClass('u-hidden');
 
 
-			ref.overlay = jQuery("<div>").addClass(config.className + "-layer");
+			ref.overlay = jQuery('<div>').addClass(config.className + '-layer');
 			jQuery(ref.overlay)
 			jQuery(ref.overlay)
 				.css({
 				.css({
-					position: "absolute",
+					position: 'absolute',
 					zIndex: config.zIndex,
 					zIndex: config.zIndex,
 					backgroundColor: config.bgcolor,
 					backgroundColor: config.bgcolor,
 					opacity: config.opacity,
 					opacity: config.opacity,
 					zoom: 1,
 					zoom: 1,
 				})
 				})
-				.addClass("fl-cloud");
+				.addClass('fl-cloud');
 
 
-			ref.content = jQuery("<div>").addClass(config.className);
-			jQuery(ref.content).attr("id", config.id);
+			ref.content = jQuery('<div>').addClass(config.className);
+			jQuery(ref.content).attr('id', config.id);
 			jQuery(ref.content)
 			jQuery(ref.content)
 				.css({
 				.css({
-					position: "absolute",
+					position: 'absolute',
 					zIndex: config.zIndex + 1,
 					zIndex: config.zIndex + 1,
 				})
 				})
-				.addClass("fl-cloud");
+				.addClass('fl-cloud');
 
 
-			if (null == config.close || typeof config.close == "undefined") {
-				ref.close = jQuery("<div>").addClass(config.className);
-				jQuery(ref.close).attr("id", config.closeClass);
+			if (null == config.close || typeof config.close == 'undefined') {
+				ref.close = jQuery('<div>').addClass(config.className);
+				jQuery(ref.close).attr('id', config.closeClass);
 				jQuery(ref.close)
 				jQuery(ref.close)
 					.css({
 					.css({
-						position: "absolute",
+						position: 'absolute',
 						zIndex: config.zIndex + 1,
 						zIndex: config.zIndex + 1,
-						color: "white",
-						cursor: "pointer",
+						color: 'white',
+						cursor: 'pointer',
 					})
 					})
 					.addClass(config.closeClass);
 					.addClass(config.closeClass);
 				//jQuery(ref.close).text('[X]Close');
 				//jQuery(ref.close).text('[X]Close');
@@ -206,9 +206,9 @@
 			init();
 			init();
 			embed();
 			embed();
 			position();
 			position();
-			jQuery(ref.content).append(jQuery(elm).removeClass("u-hidden"));
+			jQuery(ref.content).append(jQuery(elm).removeClass('u-hidden'));
 			start_ovservers();
 			start_ovservers();
-			jQuery(ref.container).removeClass("u-hidden").css({ display: "block" });
+			jQuery(ref.container).removeClass('u-hidden').css({ display: 'block' });
 			config.afterStart(elm);
 			config.afterStart(elm);
 		}
 		}
 		//
 		//

+ 42 - 42
web/js/hotkeys.js

@@ -9,7 +9,7 @@ shortcut = {
 	add: function (shortcut_combination, callback, opt) {
 	add: function (shortcut_combination, callback, opt) {
 		//Provide a set of default options
 		//Provide a set of default options
 		var default_options = {
 		var default_options = {
-			type: "keydown",
+			type: 'keydown',
 			propagate: false,
 			propagate: false,
 			disable_in_input: false,
 			disable_in_input: false,
 			target: document,
 			target: document,
@@ -18,26 +18,26 @@ shortcut = {
 		if (!opt) opt = default_options;
 		if (!opt) opt = default_options;
 		else {
 		else {
 			for (var dfo in default_options) {
 			for (var dfo in default_options) {
-				if (typeof opt[dfo] == "undefined") opt[dfo] = default_options[dfo];
+				if (typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo];
 			}
 			}
 		}
 		}
 
 
 		var ele = opt.target;
 		var ele = opt.target;
-		if (typeof opt.target == "string") ele = document.getElementById(opt.target);
+		if (typeof opt.target == 'string') ele = document.getElementById(opt.target);
 		shortcut_combination = shortcut_combination.toLowerCase();
 		shortcut_combination = shortcut_combination.toLowerCase();
 
 
 		//The function to be called at keypress
 		//The function to be called at keypress
 		var func = function (e) {
 		var func = function (e) {
 			e = e || window.event;
 			e = e || window.event;
 
 
-			if (opt["disable_in_input"]) {
+			if (opt['disable_in_input']) {
 				//Don't enable shortcut keys in Input, Textarea fields
 				//Don't enable shortcut keys in Input, Textarea fields
 				var element;
 				var element;
 				if (e.target) element = e.target;
 				if (e.target) element = e.target;
 				else if (e.srcElement) element = e.srcElement;
 				else if (e.srcElement) element = e.srcElement;
 				if (element.nodeType == 3) element = element.parentNode;
 				if (element.nodeType == 3) element = element.parentNode;
 
 
-				if (element.tagName == "INPUT" || element.tagName == "TEXTAREA") return;
+				if (element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
 			}
 			}
 
 
 			//Find Which key is pressed
 			//Find Which key is pressed
@@ -45,34 +45,34 @@ shortcut = {
 			else if (e.which) code = e.which;
 			else if (e.which) code = e.which;
 			var character = String.fromCharCode(code).toLowerCase();
 			var character = String.fromCharCode(code).toLowerCase();
 
 
-			if (code == 188) character = ","; //If the user presses , when the type is onkeydown
-			if (code == 190) character = "."; //If the user presses , when the type is onkeydown
+			if (code == 188) character = ','; //If the user presses , when the type is onkeydown
+			if (code == 190) character = '.'; //If the user presses , when the type is onkeydown
 
 
-			var keys = shortcut_combination.split("+");
+			var keys = shortcut_combination.split('+');
 			//Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
 			//Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
 			var kp = 0;
 			var kp = 0;
 
 
 			//Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
 			//Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
 			var shift_nums = {
 			var shift_nums = {
-				"`": "~",
-				1: "!",
-				2: "@",
-				3: "#",
-				4: "$",
-				5: "%",
-				6: "^",
-				7: "&",
-				8: "*",
-				9: "(",
-				0: ")",
-				"-": "_",
-				"=": "+",
-				";": ":",
+				'`': '~',
+				1: '!',
+				2: '@',
+				3: '#',
+				4: '$',
+				5: '%',
+				6: '^',
+				7: '&',
+				8: '*',
+				9: '(',
+				0: ')',
+				'-': '_',
+				'=': '+',
+				';': ':',
 				"'": '"',
 				"'": '"',
-				",": "<",
-				".": ">",
-				"/": "?",
-				"\\": "|",
+				',': '<',
+				'.': '>',
+				'/': '?',
+				'\\': '|',
 			};
 			};
 			//Special Keys - and their codes
 			//Special Keys - and their codes
 			var special_keys = {
 			var special_keys = {
@@ -143,23 +143,23 @@ shortcut = {
 
 
 			for (var i = 0; (k = keys[i]), i < keys.length; i++) {
 			for (var i = 0; (k = keys[i]), i < keys.length; i++) {
 				//Modifiers
 				//Modifiers
-				if (k == "ctrl" || k == "control") {
+				if (k == 'ctrl' || k == 'control') {
 					kp++;
 					kp++;
 					modifiers.ctrl.wanted = true;
 					modifiers.ctrl.wanted = true;
-				} else if (k == "shift") {
+				} else if (k == 'shift') {
 					kp++;
 					kp++;
 					modifiers.shift.wanted = true;
 					modifiers.shift.wanted = true;
-				} else if (k == "alt") {
+				} else if (k == 'alt') {
 					kp++;
 					kp++;
 					modifiers.alt.wanted = true;
 					modifiers.alt.wanted = true;
-				} else if (k == "meta") {
+				} else if (k == 'meta') {
 					kp++;
 					kp++;
 					modifiers.meta.wanted = true;
 					modifiers.meta.wanted = true;
 				} else if (k.length > 1) {
 				} else if (k.length > 1) {
 					//If it is a special key
 					//If it is a special key
 					if (special_keys[k] == code) kp++;
 					if (special_keys[k] == code) kp++;
-				} else if (opt["keycode"]) {
-					if (opt["keycode"] == code) kp++;
+				} else if (opt['keycode']) {
+					if (opt['keycode'] == code) kp++;
 				} else {
 				} else {
 					//The special keys did not match
 					//The special keys did not match
 					if (character == k) kp++;
 					if (character == k) kp++;
@@ -182,7 +182,7 @@ shortcut = {
 			) {
 			) {
 				callback(e);
 				callback(e);
 
 
-				if (!opt["propagate"]) {
+				if (!opt['propagate']) {
 					//Stop the event
 					//Stop the event
 					//e.cancelBubble is supported by IE - this will kill the bubbling process.
 					//e.cancelBubble is supported by IE - this will kill the bubbling process.
 					e.cancelBubble = true;
 					e.cancelBubble = true;
@@ -200,12 +200,12 @@ shortcut = {
 		this.all_shortcuts[shortcut_combination] = {
 		this.all_shortcuts[shortcut_combination] = {
 			callback: func,
 			callback: func,
 			target: ele,
 			target: ele,
-			event: opt["type"],
+			event: opt['type'],
 		};
 		};
 		//Attach the function with the event
 		//Attach the function with the event
-		if (ele.addEventListener) ele.addEventListener(opt["type"], func, false);
-		else if (ele.attachEvent) ele.attachEvent("on" + opt["type"], func);
-		else ele["on" + opt["type"]] = func;
+		if (ele.addEventListener) ele.addEventListener(opt['type'], func, false);
+		else if (ele.attachEvent) ele.attachEvent('on' + opt['type'], func);
+		else ele['on' + opt['type']] = func;
 	},
 	},
 
 
 	//Remove the shortcut - just specify the shortcut and I will remove the binding
 	//Remove the shortcut - just specify the shortcut and I will remove the binding
@@ -214,12 +214,12 @@ shortcut = {
 		var binding = this.all_shortcuts[shortcut_combination];
 		var binding = this.all_shortcuts[shortcut_combination];
 		delete this.all_shortcuts[shortcut_combination];
 		delete this.all_shortcuts[shortcut_combination];
 		if (!binding) return;
 		if (!binding) return;
-		var type = binding["event"];
-		var ele = binding["target"];
-		var callback = binding["callback"];
+		var type = binding['event'];
+		var ele = binding['target'];
+		var callback = binding['callback'];
 
 
-		if (ele.detachEvent) ele.detachEvent("on" + type, callback);
+		if (ele.detachEvent) ele.detachEvent('on' + type, callback);
 		else if (ele.removeEventListener) ele.removeEventListener(type, callback, false);
 		else if (ele.removeEventListener) ele.removeEventListener(type, callback, false);
-		else ele["on" + type] = false;
+		else ele['on' + type] = false;
 	},
 	},
 };
 };

Разница между файлами не показана из-за своего большого размера
+ 225 - 225
web/js/init.js


+ 23 - 23
web/js/pages/add_cron.js

@@ -1,30 +1,30 @@
 $(document).ready(function () {
 $(document).ready(function () {
-	$("#tabs").tabs();
-	$(".context-helper").click(function () {
-		$("#tabs").toggle();
-		$(".context-helper").toggle();
+	$('#tabs').tabs();
+	$('.context-helper').click(function () {
+		$('#tabs').toggle();
+		$('.context-helper').toggle();
 	});
 	});
-	$(".context-helper-close").click(function () {
-		$("#tabs").toggle();
-		$(".context-helper").toggle();
+	$('.context-helper-close').click(function () {
+		$('#tabs').toggle();
+		$('.context-helper').toggle();
 	});
 	});
 
 
-	$(".helper-container form").submit(function () {
-		$("#vstobjects input[name=v_min]")
-			.val($(this).find(":input[name=h_min]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_hour]")
-			.val($(this).find(":input[name=h_hour]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_day]")
-			.val($(this).find(":input[name=h_day]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_month]")
-			.val($(this).find(":input[name=h_month]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_wday]")
-			.val($(this).find(":input[name=h_wday]").val())
-			.effect("highlight");
+	$('.helper-container form').submit(function () {
+		$('#vstobjects input[name=v_min]')
+			.val($(this).find(':input[name=h_min]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_hour]')
+			.val($(this).find(':input[name=h_hour]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_day]')
+			.val($(this).find(':input[name=h_day]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_month]')
+			.val($(this).find(':input[name=h_month]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_wday]')
+			.val($(this).find(':input[name=h_wday]').val())
+			.effect('highlight');
 
 
 		return false;
 		return false;
 	});
 	});

+ 13 - 13
web/js/pages/add_db.js

@@ -2,12 +2,12 @@
 //
 //
 // Updates database username dynamically, showing its prefix
 // Updates database username dynamically, showing its prefix
 App.Actions.DB.update_db_username_hint = function (elm, hint) {
 App.Actions.DB.update_db_username_hint = function (elm, hint) {
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").text("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').text('');
 	}
 	}
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(GLOBAL.DB_USER_PREFIX + hint);
 		.text(GLOBAL.DB_USER_PREFIX + hint);
 };
 };
 
 
@@ -15,12 +15,12 @@ App.Actions.DB.update_db_username_hint = function (elm, hint) {
 //
 //
 // Updates database name dynamically, showing its prefix
 // Updates database name dynamically, showing its prefix
 App.Actions.DB.update_db_databasename_hint = function (elm, hint) {
 App.Actions.DB.update_db_databasename_hint = function (elm, hint) {
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").text("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').text('');
 	}
 	}
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(GLOBAL.DB_DBNAME_PREFIX + hint);
 		.text(GLOBAL.DB_DBNAME_PREFIX + hint);
 };
 };
 
 
@@ -29,11 +29,11 @@ App.Actions.DB.update_db_databasename_hint = function (elm, hint) {
 App.Listeners.DB.keypress_db_username = function () {
 App.Listeners.DB.keypress_db_username = function () {
 	var ref = $('input[name="v_dbuser"]');
 	var ref = $('input[name="v_dbuser"]');
 	var current_val = ref.val();
 	var current_val = ref.val();
-	if (current_val.trim() != "") {
+	if (current_val.trim() != '') {
 		App.Actions.DB.update_db_username_hint(ref, current_val);
 		App.Actions.DB.update_db_username_hint(ref, current_val);
 	}
 	}
 
 
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -47,11 +47,11 @@ App.Listeners.DB.keypress_db_username = function () {
 App.Listeners.DB.keypress_db_databasename = function () {
 App.Listeners.DB.keypress_db_databasename = function () {
 	var ref = $('input[name="v_database"]');
 	var ref = $('input[name="v_database"]');
 	var current_val = ref.val();
 	var current_val = ref.val();
-	if (current_val.trim() != "") {
+	if (current_val.trim() != '') {
 		App.Actions.DB.update_db_databasename_hint(ref, current_val);
 		App.Actions.DB.update_db_databasename_hint(ref, current_val);
 	}
 	}
 
 
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_dbn_tmt);
 		clearTimeout(window.frp_dbn_tmt);
 		window.frp_dbn_tmt = setTimeout(function () {
 		window.frp_dbn_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -80,12 +80,12 @@ App.Actions.DB.update_password_meter = function () {
 	if (min_num.test(password)) {
 	if (min_num.test(password)) {
 		score = score + 1;
 		score = score + 1;
 	}
 	}
-	$(".password-meter").val(score);
+	$('.password-meter').val(score);
 };
 };
 
 
 App.Listeners.DB.keypress_v_password = function () {
 App.Listeners.DB.keypress_v_password = function () {
 	var ref = $('input[name="v_password"]');
 	var ref = $('input[name="v_password"]');
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -103,6 +103,6 @@ App.Listeners.DB.keypress_db_username();
 App.Listeners.DB.keypress_db_databasename();
 App.Listeners.DB.keypress_db_databasename();
 
 
 applyRandomString = function (min_length = 16) {
 applyRandomString = function (min_length = 16) {
-	$("input[name=v_password]").val(randomString2(min_length));
+	$('input[name=v_password]').val(randomString2(min_length));
 	App.Actions.DB.update_password_meter();
 	App.Actions.DB.update_password_meter();
 };
 };

+ 15 - 15
web/js/pages/add_dns.js

@@ -1,27 +1,27 @@
 $(document).ready(function () {
 $(document).ready(function () {
-	$(".js-add-ns-button").click(function () {
-		var n = $("input[name^=v_ns]").length;
+	$('.js-add-ns-button').click(function () {
+		var n = $('input[name^=v_ns]').length;
 		if (n < 8) {
 		if (n < 8) {
-			var t = $($("input[name=v_ns1]").parents("div")[0]).clone(true, true);
-			t.find("input").attr({ value: "", name: "v_ns" + (n + 1) });
-			t.find("span").show();
-			$(".js-add-ns").before(t);
+			var t = $($('input[name=v_ns1]').parents('div')[0]).clone(true, true);
+			t.find('input').attr({ value: '', name: 'v_ns' + (n + 1) });
+			t.find('span').show();
+			$('.js-add-ns').before(t);
 		}
 		}
 		if (n == 7) {
 		if (n == 7) {
-			$(".js-add-ns").addClass("u-hidden");
+			$('.js-add-ns').addClass('u-hidden');
 		}
 		}
 	});
 	});
 
 
-	$(".js-remove-ns").click(function () {
-		$(this).parents("div")[0].remove();
-		$("input[name^=v_ns]").each(function (i, ns) {
-			$(ns).attr({ name: "v_ns" + (i + 1) });
-			i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('.js-remove-ns').click(function () {
+		$(this).parents('div')[0].remove();
+		$('input[name^=v_ns]').each(function (i, ns) {
+			$(ns).attr({ name: 'v_ns' + (i + 1) });
+			i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 		});
 		});
-		$(".js-add-ns").removeClass("u-hidden");
+		$('.js-add-ns').removeClass('u-hidden');
 	});
 	});
 
 
-	$("input[name^=v_ns]").each(function (i, ns) {
-		i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('input[name^=v_ns]').each(function (i, ns) {
+		i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 	});
 	});
 });
 });

+ 11 - 11
web/js/pages/add_dns_rec.js

@@ -3,28 +3,28 @@
 // Updates database dns record dynamically, showing its full domain path
 // Updates database dns record dynamically, showing its full domain path
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 	// clean hint
 	// clean hint
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").text("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').text('');
 	}
 	}
 
 
 	// set domain name without rec in case of @ entries
 	// set domain name without rec in case of @ entries
-	if (hint == "@") {
-		hint = "";
+	if (hint == '@') {
+		hint = '';
 	}
 	}
 
 
 	// dont show pregix if domain name = rec value
 	// dont show pregix if domain name = rec value
-	if (hint == GLOBAL.DNS_REC_PREFIX + ".") {
-		hint = "";
+	if (hint == GLOBAL.DNS_REC_PREFIX + '.') {
+		hint = '';
 	}
 	}
 
 
 	// add dot at the end if needed
 	// add dot at the end if needed
-	if (hint != "" && hint.slice(-1) != ".") {
-		hint += ".";
+	if (hint != '' && hint.slice(-1) != '.') {
+		hint += '.';
 	}
 	}
 
 
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(hint + GLOBAL.DNS_REC_PREFIX);
 		.text(hint + GLOBAL.DNS_REC_PREFIX);
 };
 };
 
 
@@ -33,11 +33,11 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 App.Listeners.DB.keypress_dns_rec_entry = function () {
 App.Listeners.DB.keypress_dns_rec_entry = function () {
 	var ref = $('input[name="v_rec"]');
 	var ref = $('input[name="v_rec"]');
 	var current_rec = ref.val();
 	var current_rec = ref.val();
-	if (current_rec.trim() != "") {
+	if (current_rec.trim() != '') {
 		App.Actions.DB.update_dns_record_hint(ref, current_rec);
 		App.Actions.DB.update_dns_record_hint(ref, current_rec);
 	}
 	}
 
 
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);

+ 81 - 81
web/js/pages/add_mail_acc.js

@@ -1,32 +1,32 @@
 App.Actions.MAIL_ACC.enable_unlimited = function (elm, source_elm) {
 App.Actions.MAIL_ACC.enable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", true);
-	$(elm).data("prev_value", $(elm).val()); // save prev value in order to restore if needed
+	$(elm).data('checked', true);
+	$(elm).data('prev_value', $(elm).val()); // save prev value in order to restore if needed
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
-	$(elm).attr("disabled", true);
-	$(source_elm).css("opacity", "1");
+	$(elm).attr('disabled', true);
+	$(source_elm).css('opacity', '1');
 };
 };
 
 
 App.Actions.MAIL_ACC.disable_unlimited = function (elm, source_elm) {
 App.Actions.MAIL_ACC.disable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", false);
-	if ($(elm).data("prev_value") && $(elm).data("prev_value").trim() != "") {
-		var prev_value = $(elm).data("prev_value").trim();
+	$(elm).data('checked', false);
+	if ($(elm).data('prev_value') && $(elm).data('prev_value').trim() != '') {
+		var prev_value = $(elm).data('prev_value').trim();
 		$(elm).val(prev_value);
 		$(elm).val(prev_value);
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	} else {
 	} else {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	}
 	}
-	$(elm).attr("disabled", false);
-	$(source_elm).css("opacity", "0.5");
+	$(elm).attr('disabled', false);
+	$(source_elm).css('opacity', '0.5');
 };
 };
 
 
 App.Actions.MAIL_ACC.toggle_unlimited_feature = function (evt) {
 App.Actions.MAIL_ACC.toggle_unlimited_feature = function (evt) {
 	var elm = $(evt.target);
 	var elm = $(evt.target);
-	var ref = elm.prev(".form-control");
-	if (!$(ref).data("checked")) {
+	var ref = elm.prev('.form-control');
+	if (!$(ref).data('checked')) {
 		App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 		App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 	} else {
 	} else {
 		App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
 		App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
@@ -34,16 +34,16 @@ App.Actions.MAIL_ACC.toggle_unlimited_feature = function (evt) {
 };
 };
 
 
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature = function () {
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature = function () {
-	$(".unlim-trigger").on("click", App.Actions.MAIL_ACC.toggle_unlimited_feature);
+	$('.unlim-trigger').on('click', App.Actions.MAIL_ACC.toggle_unlimited_feature);
 };
 };
 
 
 App.Listeners.MAIL_ACC.init = function () {
 App.Listeners.MAIL_ACC.init = function () {
-	$(".unlim-trigger").each(function (i, elm) {
-		var ref = $(elm).prev(".form-control");
+	$('.unlim-trigger').each(function (i, elm) {
+		var ref = $(elm).prev('.form-control');
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 			App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 			App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 		} else {
 		} else {
-			$(ref).data("prev_value", $(ref).val());
+			$(ref).data('prev_value', $(ref).val());
 			App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
 			App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
 		}
 		}
 	});
 	});
@@ -63,19 +63,19 @@ App.Helpers.isUnlimitedValue = function (value) {
 // Trigger listeners
 // Trigger listeners
 App.Listeners.MAIL_ACC.init();
 App.Listeners.MAIL_ACC.init();
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature();
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature();
-$("#v_blackhole").on("click", function (evt) {
-	if ($("#v_blackhole").is(":checked")) {
-		$("#v_fwd").prop("disabled", true);
-		$("#v_fwd_for").prop("checked", true);
-		$("#id_fwd_for").hide();
+$('#v_blackhole').on('click', function (evt) {
+	if ($('#v_blackhole').is(':checked')) {
+		$('#v_fwd').prop('disabled', true);
+		$('#v_fwd_for').prop('checked', true);
+		$('#id_fwd_for').hide();
 	} else {
 	} else {
-		$("#v_fwd").prop("disabled", false);
-		$("#id_fwd_for").show();
+		$('#v_fwd').prop('disabled', false);
+		$('#id_fwd_for').show();
 	}
 	}
 });
 });
-$('form[name="v_quota"]').on("submit", function (evt) {
-	$("input:disabled").each(function (i, elm) {
-		$(elm).attr("disabled", false);
+$('form[name="v_quota"]').on('submit', function (evt) {
+	$('input:disabled').each(function (i, elm) {
+		$(elm).attr('disabled', false);
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 			$(elm).val(App.Constants.UNLIM_VALUE);
 			$(elm).val(App.Constants.UNLIM_VALUE);
 		}
 		}
@@ -102,12 +102,12 @@ App.Actions.MAIL_ACC.update_password_meter = function () {
 	if (min_num.test(password)) {
 	if (min_num.test(password)) {
 		score = score + 1;
 		score = score + 1;
 	}
 	}
-	$(".password-meter").val(score);
+	$('.password-meter').val(score);
 };
 };
 
 
 App.Listeners.MAIL_ACC.keypress_v_password = function () {
 App.Listeners.MAIL_ACC.keypress_v_password = function () {
 	var ref = $('input[name="v_password"]');
 	var ref = $('input[name="v_password"]');
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -120,82 +120,82 @@ App.Listeners.MAIL_ACC.keypress_v_password();
 
 
 applyRandomString = function (min_length = 16) {
 applyRandomString = function (min_length = 16) {
 	var randomString = randomString2(min_length);
 	var randomString = randomString2(min_length);
-	$("input[name=v_password]").val(randomString);
-	if ($("input[name=v_password]").attr("type") == "text")
-		$(".js-password-output").text(randomString);
-	else $(".js-password-output").text(Array(randomString.length + 1).join("*"));
+	$('input[name=v_password]').val(randomString);
+	if ($('input[name=v_password]').attr('type') == 'text')
+		$('.js-password-output').text(randomString);
+	else $('.js-password-output').text(Array(randomString.length + 1).join('*'));
 	App.Actions.MAIL_ACC.update_password_meter();
 	App.Actions.MAIL_ACC.update_password_meter();
 	generate_mail_credentials();
 	generate_mail_credentials();
 };
 };
 
 
 generate_mail_credentials = function () {
 generate_mail_credentials = function () {
-	var div = $(".mail-infoblock").clone();
-	div.find("#mail_configuration").remove();
-	var pass = $(".js-password-output").text();
+	var div = $('.mail-infoblock').clone();
+	div.find('#mail_configuration').remove();
+	var pass = $('.js-password-output').text();
 	var output = div.text();
 	var output = div.text();
-	output = output.replace(/(?:\r\n|\r|\n|\t)/g, "|");
-	output = output.replace(/ {2}/g, "");
-	output = output.replace(/\|\|/g, "|");
-	output = output.replace(/\|\|/g, "|");
-	output = output.replace(/\|\|/g, "|");
-	output = output.replace(/^\|+/g, "");
-	output = output.replace(/\|$/, "");
-	output = output.replace(/ $/, "");
-	output = output.replace(/:\|/g, ": ");
-	output = output.replace(/\|/g, "\n");
-	$(".js-hidden-credentials").val(output);
+	output = output.replace(/(?:\r\n|\r|\n|\t)/g, '|');
+	output = output.replace(/ {2}/g, '');
+	output = output.replace(/\|\|/g, '|');
+	output = output.replace(/\|\|/g, '|');
+	output = output.replace(/\|\|/g, '|');
+	output = output.replace(/^\|+/g, '');
+	output = output.replace(/\|$/, '');
+	output = output.replace(/ $/, '');
+	output = output.replace(/:\|/g, ': ');
+	output = output.replace(/\|/g, '\n');
+	$('.js-hidden-credentials').val(output);
 };
 };
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	$(".js-account-output").text($("input[name=v_account]").val());
-	$(".js-password-output").text($("input[name=v_password]").val());
+	$('.js-account-output').text($('input[name=v_account]').val());
+	$('.js-password-output').text($('input[name=v_password]').val());
 	generate_mail_credentials();
 	generate_mail_credentials();
 
 
-	$("input[name=v_account]").change(function () {
-		$(".js-account-output").text($(this).val());
+	$('input[name=v_account]').change(function () {
+		$('.js-account-output').text($(this).val());
 		generate_mail_credentials();
 		generate_mail_credentials();
 	});
 	});
 
 
-	$("input[name=v_password]").change(function () {
-		if ($("input[name=v_password]").attr("type") == "text")
-			$(".js-password-output").text($(this).val());
-		else $(".js-password-output").text(Array($(this).val().length + 1).join("*"));
+	$('input[name=v_password]').change(function () {
+		if ($('input[name=v_password]').attr('type') == 'text')
+			$('.js-password-output').text($(this).val());
+		else $('.js-password-output').text(Array($(this).val().length + 1).join('*'));
 		generate_mail_credentials();
 		generate_mail_credentials();
 	});
 	});
 
 
-	$(".toggle-psw-visibility-icon").click(function () {
-		$(".js-password-output").text($("input[name=v_password]").val());
+	$('.toggle-psw-visibility-icon').click(function () {
+		$('.js-password-output').text($('input[name=v_password]').val());
 		generate_mail_credentials();
 		generate_mail_credentials();
 	});
 	});
 
 
-	$("#mail_configuration").change(function (evt) {
-		var opt = $(evt.target).find("option:selected");
+	$('#mail_configuration').change(function (evt) {
+		var opt = $(evt.target).find('option:selected');
 
 
-		switch (opt.attr("v_type")) {
-			case "hostname":
-				$("#td_imap_hostname").text(opt.attr("domain"));
-				$("#td_smtp_hostname").text(opt.attr("domain"));
+		switch (opt.attr('v_type')) {
+			case 'hostname':
+				$('#td_imap_hostname').text(opt.attr('domain'));
+				$('#td_smtp_hostname').text(opt.attr('domain'));
 				break;
 				break;
-			case "starttls":
-				$("#td_imap_port").text("143");
-				$("#td_imap_encryption").text("STARTTLS");
-				$("#td_smtp_port").text("587");
-				$("#td_smtp_encryption").text("STARTTLS");
+			case 'starttls':
+				$('#td_imap_port').text('143');
+				$('#td_imap_encryption').text('STARTTLS');
+				$('#td_smtp_port').text('587');
+				$('#td_smtp_encryption').text('STARTTLS');
 				break;
 				break;
-			case "ssl":
-				$("#td_imap_port").text("993");
-				$("#td_imap_encryption").text("SSL / TLS");
-				$("#td_smtp_port").text("465");
-				$("#td_smtp_encryption").text("SSL / TLS");
+			case 'ssl':
+				$('#td_imap_port').text('993');
+				$('#td_imap_encryption').text('SSL / TLS');
+				$('#td_smtp_port').text('465');
+				$('#td_smtp_encryption').text('SSL / TLS');
 				break;
 				break;
-			case "no_encryption":
-				$("#td_imap_hostname").text(opt.attr("domain"));
-				$("#td_smtp_hostname").text(opt.attr("domain"));
-
-				$("#td_imap_port").text("143");
-				$("#td_imap_encryption").text(opt.attr("no_encryption"));
-				$("#td_smtp_port").text("25");
-				$("#td_smtp_encryption").text(opt.attr("no_encryption"));
+			case 'no_encryption':
+				$('#td_imap_hostname').text(opt.attr('domain'));
+				$('#td_smtp_hostname').text(opt.attr('domain'));
+
+				$('#td_imap_port').text('143');
+				$('#td_imap_encryption').text(opt.attr('no_encryption'));
+				$('#td_smtp_port').text('25');
+				$('#td_smtp_encryption').text(opt.attr('no_encryption'));
 				break;
 				break;
 		}
 		}
 		generate_mail_credentials();
 		generate_mail_credentials();

+ 35 - 35
web/js/pages/add_package.js

@@ -1,33 +1,33 @@
 App.Actions.PACKAGE.enable_unlimited = function (elm, source_elm) {
 App.Actions.PACKAGE.enable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", true);
-	$(elm).data("prev_value", $(elm).val()); // save prev value in order to restore if needed
+	$(elm).data('checked', true);
+	$(elm).data('prev_value', $(elm).val()); // save prev value in order to restore if needed
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
-	$(elm).attr("disabled", true);
-	$(source_elm).css("opacity", "1");
+	$(elm).attr('disabled', true);
+	$(source_elm).css('opacity', '1');
 };
 };
 
 
 App.Actions.PACKAGE.disable_unlimited = function (elm, source_elm) {
 App.Actions.PACKAGE.disable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", false);
-	if ($(elm).data("prev_value") && $(elm).data("prev_value").trim() != "") {
-		var prev_value = $(elm).data("prev_value").trim();
+	$(elm).data('checked', false);
+	if ($(elm).data('prev_value') && $(elm).data('prev_value').trim() != '') {
+		var prev_value = $(elm).data('prev_value').trim();
 		$(elm).val(prev_value);
 		$(elm).val(prev_value);
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	} else {
 	} else {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	}
 	}
-	$(elm).attr("disabled", false);
-	$(source_elm).css("opacity", "0.5");
+	$(elm).attr('disabled', false);
+	$(source_elm).css('opacity', '0.5');
 };
 };
 
 
 //
 //
 App.Actions.PACKAGE.toggle_unlimited_feature = function (evt) {
 App.Actions.PACKAGE.toggle_unlimited_feature = function (evt) {
 	var elm = $(evt.target);
 	var elm = $(evt.target);
-	var ref = elm.prev(".form-control");
-	if (!$(ref).data("checked")) {
+	var ref = elm.prev('.form-control');
+	if (!$(ref).data('checked')) {
 		App.Actions.PACKAGE.enable_unlimited(ref, elm);
 		App.Actions.PACKAGE.enable_unlimited(ref, elm);
 	} else {
 	} else {
 		App.Actions.PACKAGE.disable_unlimited(ref, elm);
 		App.Actions.PACKAGE.disable_unlimited(ref, elm);
@@ -35,16 +35,16 @@ App.Actions.PACKAGE.toggle_unlimited_feature = function (evt) {
 };
 };
 
 
 App.Listeners.PACKAGE.checkbox_unlimited_feature = function () {
 App.Listeners.PACKAGE.checkbox_unlimited_feature = function () {
-	$(".unlim-trigger").on("click", App.Actions.PACKAGE.toggle_unlimited_feature);
+	$('.unlim-trigger').on('click', App.Actions.PACKAGE.toggle_unlimited_feature);
 };
 };
 
 
 App.Listeners.PACKAGE.init = function () {
 App.Listeners.PACKAGE.init = function () {
-	$(".unlim-trigger").each(function (i, elm) {
-		var ref = $(elm).prev(".form-control");
+	$('.unlim-trigger').each(function (i, elm) {
+		var ref = $(elm).prev('.form-control');
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 			App.Actions.PACKAGE.enable_unlimited(ref, elm);
 			App.Actions.PACKAGE.enable_unlimited(ref, elm);
 		} else {
 		} else {
-			$(ref).data("prev_value", $(ref).val());
+			$(ref).data('prev_value', $(ref).val());
 			App.Actions.PACKAGE.disable_unlimited(ref, elm);
 			App.Actions.PACKAGE.disable_unlimited(ref, elm);
 		}
 		}
 	});
 	});
@@ -64,9 +64,9 @@ App.Helpers.isUnlimitedValue = function (value) {
 // Trigger listeners
 // Trigger listeners
 App.Listeners.PACKAGE.init();
 App.Listeners.PACKAGE.init();
 App.Listeners.PACKAGE.checkbox_unlimited_feature();
 App.Listeners.PACKAGE.checkbox_unlimited_feature();
-$('form[name="v_add_package"]').on("submit", function (evt) {
-	$("input:disabled").each(function (i, elm) {
-		$(elm).attr("disabled", false);
+$('form[name="v_add_package"]').on('submit', function (evt) {
+	$('input:disabled').each(function (i, elm) {
+		$(elm).attr('disabled', false);
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 			$(elm).val(App.Constants.UNLIM_VALUE);
 			$(elm).val(App.Constants.UNLIM_VALUE);
 		}
 		}
@@ -74,29 +74,29 @@ $('form[name="v_add_package"]').on("submit", function (evt) {
 });
 });
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	$(".js-add-ns-button").click(function () {
-		var n = $("input[name^=v_ns]").length;
+	$('.js-add-ns-button').click(function () {
+		var n = $('input[name^=v_ns]').length;
 		if (n < 8) {
 		if (n < 8) {
-			var t = $($("input[name=v_ns1]").parents("div")[0]).clone(true, true);
-			t.find("input").attr({ value: "", name: "v_ns" + (n + 1) });
-			t.find("span").show();
-			$(".js-add-ns").before(t);
+			var t = $($('input[name=v_ns1]').parents('div')[0]).clone(true, true);
+			t.find('input').attr({ value: '', name: 'v_ns' + (n + 1) });
+			t.find('span').show();
+			$('.js-add-ns').before(t);
 		}
 		}
 		if (n == 7) {
 		if (n == 7) {
-			$(".js-add-ns").addClass("u-hidden");
+			$('.js-add-ns').addClass('u-hidden');
 		}
 		}
 	});
 	});
 
 
-	$(".js-remove-ns").click(function () {
-		$(this).parents("div")[0].remove();
-		$("input[name^=v_ns]").each(function (i, ns) {
-			$(ns).attr({ name: "v_ns" + (i + 1) });
-			i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('.js-remove-ns').click(function () {
+		$(this).parents('div')[0].remove();
+		$('input[name^=v_ns]').each(function (i, ns) {
+			$(ns).attr({ name: 'v_ns' + (i + 1) });
+			i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 		});
 		});
-		$(".js-add-ns").removeClass("u-hidden");
+		$('.js-add-ns').removeClass('u-hidden');
 	});
 	});
 
 
-	$("input[name^=v_ns]").each(function (i, ns) {
-		i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('input[name^=v_ns]').each(function (i, ns) {
+		i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 	});
 	});
 });
 });

+ 10 - 10
web/js/pages/add_user.js

@@ -1,20 +1,20 @@
 $(function () {
 $(function () {
-	$("#v_email").change(function () {
-		if ($("#v_email_notify").prop("checked")) {
-			document.getElementById("v_notify").value = document.getElementById("v_email").value;
+	$('#v_email').change(function () {
+		if ($('#v_email_notify').prop('checked')) {
+			document.getElementById('v_notify').value = document.getElementById('v_email').value;
 		}
 		}
 	});
 	});
-	$("#v_email_notify").change(function () {
-		if ($("#v_email_notify").prop("checked")) {
-			document.getElementById("v_notify").value = document.getElementById("v_email").value;
+	$('#v_email_notify').change(function () {
+		if ($('#v_email_notify').prop('checked')) {
+			document.getElementById('v_notify').value = document.getElementById('v_email').value;
 		} else {
 		} else {
-			document.getElementById("v_notify").value = "";
+			document.getElementById('v_notify').value = '';
 		}
 		}
 	});
 	});
 });
 });
 
 
 applyRandomString = function (min_length = 16) {
 applyRandomString = function (min_length = 16) {
-	$("input[name=v_password]").val(randomString2(min_length));
+	$('input[name=v_password]').val(randomString2(min_length));
 	App.Actions.WEB.update_password_meter();
 	App.Actions.WEB.update_password_meter();
 };
 };
 
 
@@ -38,12 +38,12 @@ App.Actions.WEB.update_password_meter = function () {
 	if (min_num.test(password)) {
 	if (min_num.test(password)) {
 		score = score + 1;
 		score = score + 1;
 	}
 	}
-	$(".password-meter").val(score);
+	$('.password-meter').val(score);
 };
 };
 
 
 App.Listeners.WEB.keypress_v_password = function () {
 App.Listeners.WEB.keypress_v_password = function () {
 	var ref = $('input[name="v_password"]');
 	var ref = $('input[name="v_password"]');
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);

+ 35 - 35
web/js/pages/add_web.js

@@ -4,29 +4,29 @@ App.Listeners.DB.keypress_custom_folder();
 App.Listeners.DB.change_custom_doc();
 App.Listeners.DB.change_custom_doc();
 
 
 App.Actions.WEB.update_ftp_username_hint = function (elm, hint) {
 App.Actions.WEB.update_ftp_username_hint = function (elm, hint) {
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").text("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').text('');
 	}
 	}
 
 
-	hint = hint.replace(/[^\w\d]/gi, "");
+	hint = hint.replace(/[^\w\d]/gi, '');
 
 
-	$(elm).parent().find(".v-ftp-user").val(hint);
+	$(elm).parent().find('.v-ftp-user').val(hint);
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(GLOBAL.FTP_USER_PREFIX + hint);
 		.text(GLOBAL.FTP_USER_PREFIX + hint);
 };
 };
 
 
 App.Listeners.WEB.keypress_ftp_username = function () {
 App.Listeners.WEB.keypress_ftp_username = function () {
-	var ftp_user_inputs = $(".v-ftp-user");
+	var ftp_user_inputs = $('.v-ftp-user');
 	$.each(ftp_user_inputs, function (i, ref) {
 	$.each(ftp_user_inputs, function (i, ref) {
 		var ref = $(ref);
 		var ref = $(ref);
 		var current_val = ref.val();
 		var current_val = ref.val();
-		if (current_val.trim() != "") {
+		if (current_val.trim() != '') {
 			App.Actions.WEB.update_ftp_username_hint(ref, current_val);
 			App.Actions.WEB.update_ftp_username_hint(ref, current_val);
 		}
 		}
 
 
-		ref.bind("keypress input", function (evt) {
+		ref.bind('keypress input', function (evt) {
 			clearTimeout(window.frp_usr_tmt);
 			clearTimeout(window.frp_usr_tmt);
 			window.frp_usr_tmt = setTimeout(function () {
 			window.frp_usr_tmt = setTimeout(function () {
 				var elm = $(evt.target);
 				var elm = $(evt.target);
@@ -37,34 +37,34 @@ App.Listeners.WEB.keypress_ftp_username = function () {
 };
 };
 
 
 App.Listeners.WEB.keypress_domain_name = function () {
 App.Listeners.WEB.keypress_domain_name = function () {
-	$("#v_domain").bind("keypress input", function (evt) {
+	$('#v_domain').bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			//var elm = $(evt.target);
 			//var elm = $(evt.target);
 			//App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val());
 			//App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val());
-			var domain = $(".js-ftp-path-prefix").text(
-				GLOBAL.FTP_USER_PREPATH + "/" + $("#v_domain").val()
+			var domain = $('.js-ftp-path-prefix').text(
+				GLOBAL.FTP_USER_PREPATH + '/' + $('#v_domain').val()
 			);
 			);
-			$("#v-custom-doc-domain-main").text($("#v_domain").val());
-			$("#v-custom-doc-domain-main").val($("#v_domain").val());
+			$('#v-custom-doc-domain-main').text($('#v_domain').val());
+			$('#v-custom-doc-domain-main').val($('#v_domain').val());
 			App.Actions.WEB.update_custom_doc_root(13, 12);
 			App.Actions.WEB.update_custom_doc_root(13, 12);
 		}, 100);
 		}, 100);
 	});
 	});
 };
 };
 
 
 App.Actions.WEB.toggle_letsencrypt = function (elm) {
 App.Actions.WEB.toggle_letsencrypt = function (elm) {
-	if ($(elm).prop("checked")) {
+	if ($(elm).prop('checked')) {
 		$(
 		$(
-			"#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]"
-		).attr("disabled", "disabled");
-		$("#generate-csr").hide();
-		$(".lets-encrypt-note").show();
+			'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
+		).attr('disabled', 'disabled');
+		$('#generate-csr').hide();
+		$('.lets-encrypt-note').show();
 	} else {
 	} else {
 		$(
 		$(
-			"#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]"
-		).removeAttr("disabled");
-		$("#generate-csr").show();
-		$(".lets-encrypt-note").hide();
+			'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
+		).removeAttr('disabled');
+		$('#generate-csr').show();
+		$('.lets-encrypt-note').hide();
 	}
 	}
 };
 };
 
 
@@ -75,24 +75,24 @@ App.Listeners.WEB.keypress_ftp_path();
 App.Listeners.WEB.keypress_domain_name();
 App.Listeners.WEB.keypress_domain_name();
 
 
 $(function () {
 $(function () {
-	$("#v_domain").change(function () {
-		var prefix = "www.";
-		if (document.getElementById("v_domain").value.split(".").length > 2) {
-			document.getElementById("v_aliases").value = "";
+	$('#v_domain').change(function () {
+		var prefix = 'www.';
+		if (document.getElementById('v_domain').value.split('.').length > 2) {
+			document.getElementById('v_aliases').value = '';
 		} else {
 		} else {
-			document.getElementById("v_aliases").value =
-				prefix + document.getElementById("v_domain").value;
+			document.getElementById('v_aliases').value =
+				prefix + document.getElementById('v_domain').value;
 		}
 		}
 	});
 	});
-	App.Actions.WEB.toggle_letsencrypt($("input[name=v_letsencrypt]"));
+	App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]'));
 
 
 	$('select[name="v_stats"]').change(function (evt) {
 	$('select[name="v_stats"]').change(function (evt) {
 		var select = $(evt.target);
 		var select = $(evt.target);
 
 
-		if (select.val() == "none") {
-			$(".stats-auth").hide();
+		if (select.val() == 'none') {
+			$('.stats-auth').hide();
 		} else {
 		} else {
-			$(".stats-auth").show();
+			$('.stats-auth').show();
 		}
 		}
 	});
 	});
 });
 });
@@ -101,8 +101,8 @@ function WEBrandom() {
 	document.v_add_web.v_stats_password.value = randomString2(16);
 	document.v_add_web.v_stats_password.value = randomString2(16);
 }
 }
 
 
-$("#vstobjects").on("submit", function (evt) {
-	$("input[disabled]").each(function (i, elm) {
-		$(elm).removeAttr("disabled");
+$('#vstobjects').on('submit', function (evt) {
+	$('input[disabled]').each(function (i, elm) {
+		$(elm).removeAttr('disabled');
 	});
 	});
 });
 });

+ 23 - 23
web/js/pages/edit_cron.js

@@ -1,30 +1,30 @@
 $(document).ready(function () {
 $(document).ready(function () {
-	$("#tabs").tabs();
-	$(".context-helper").click(function () {
-		$("#tabs").toggle();
-		$(".context-helper").toggle();
+	$('#tabs').tabs();
+	$('.context-helper').click(function () {
+		$('#tabs').toggle();
+		$('.context-helper').toggle();
 	});
 	});
-	$(".context-helper-close").click(function () {
-		$("#tabs").toggle();
-		$(".context-helper").toggle();
+	$('.context-helper-close').click(function () {
+		$('#tabs').toggle();
+		$('.context-helper').toggle();
 	});
 	});
 
 
-	$(".helper-container form").submit(function () {
-		$("#vstobjects input[name=v_min]")
-			.val($(this).find(":input[name=h_min]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_hour]")
-			.val($(this).find(":input[name=h_hour]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_day]")
-			.val($(this).find(":input[name=h_day]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_month]")
-			.val($(this).find(":input[name=h_month]").val())
-			.effect("highlight");
-		$("#vstobjects input[name=v_wday]")
-			.val($(this).find(":input[name=h_wday]").val())
-			.effect("highlight");
+	$('.helper-container form').submit(function () {
+		$('#vstobjects input[name=v_min]')
+			.val($(this).find(':input[name=h_min]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_hour]')
+			.val($(this).find(':input[name=h_hour]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_day]')
+			.val($(this).find(':input[name=h_day]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_month]')
+			.val($(this).find(':input[name=h_month]').val())
+			.effect('highlight');
+		$('#vstobjects input[name=v_wday]')
+			.val($(this).find(':input[name=h_wday]').val())
+			.effect('highlight');
 
 
 		return false;
 		return false;
 	});
 	});

+ 13 - 13
web/js/pages/edit_db.js

@@ -2,12 +2,12 @@
 //
 //
 // Updates database username dynamically, showing its prefix
 // Updates database username dynamically, showing its prefix
 App.Actions.DB.update_db_username_hint = function (elm, hint) {
 App.Actions.DB.update_db_username_hint = function (elm, hint) {
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").text("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').text('');
 	}
 	}
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(GLOBAL.DB_USER_PREFIX + hint);
 		.text(GLOBAL.DB_USER_PREFIX + hint);
 };
 };
 
 
@@ -15,12 +15,12 @@ App.Actions.DB.update_db_username_hint = function (elm, hint) {
 //
 //
 // Updates database name dynamically, showing its prefix
 // Updates database name dynamically, showing its prefix
 App.Actions.DB.update_db_databasename_hint = function (elm, hint) {
 App.Actions.DB.update_db_databasename_hint = function (elm, hint) {
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").text("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').text('');
 	}
 	}
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(GLOBAL.DB_DBNAME_PREFIX + hint);
 		.text(GLOBAL.DB_DBNAME_PREFIX + hint);
 };
 };
 
 
@@ -29,11 +29,11 @@ App.Actions.DB.update_db_databasename_hint = function (elm, hint) {
 App.Listeners.DB.keypress_db_username = function () {
 App.Listeners.DB.keypress_db_username = function () {
 	var ref = $('input[name="v_dbuser"]');
 	var ref = $('input[name="v_dbuser"]');
 	var current_val = ref.val();
 	var current_val = ref.val();
-	if (current_val.trim() != "") {
+	if (current_val.trim() != '') {
 		App.Actions.DB.update_db_username_hint(ref, current_val);
 		App.Actions.DB.update_db_username_hint(ref, current_val);
 	}
 	}
 
 
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -51,11 +51,11 @@ App.Listeners.DB.keypress_db_databasename = function () {
 		current_val = current_val.slice(GLOBAL.DB_DBNAME_PREFIX.length, current_val.length);
 		current_val = current_val.slice(GLOBAL.DB_DBNAME_PREFIX.length, current_val.length);
 		ref.val(current_val);
 		ref.val(current_val);
 	}
 	}
-	if (current_val.trim() != "") {
+	if (current_val.trim() != '') {
 		App.Actions.DB.update_db_username_hint(ref, current_val);
 		App.Actions.DB.update_db_username_hint(ref, current_val);
 	}
 	}
 
 
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_dbn_tmt);
 		clearTimeout(window.frp_dbn_tmt);
 		window.frp_dbn_tmt = setTimeout(function () {
 		window.frp_dbn_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -84,12 +84,12 @@ App.Actions.DB.update_password_meter = function () {
 	if (min_num.test(password)) {
 	if (min_num.test(password)) {
 		score = score + 1;
 		score = score + 1;
 	}
 	}
-	$(".password-meter").val(score);
+	$('.password-meter').val(score);
 };
 };
 
 
 App.Listeners.DB.keypress_v_password = function () {
 App.Listeners.DB.keypress_v_password = function () {
 	var ref = $('input[name="v_password"]');
 	var ref = $('input[name="v_password"]');
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -107,6 +107,6 @@ App.Listeners.DB.keypress_db_username();
 App.Listeners.DB.keypress_db_databasename();
 App.Listeners.DB.keypress_db_databasename();
 
 
 applyRandomString = function (min_length = 16) {
 applyRandomString = function (min_length = 16) {
-	$("input[name=v_password]").val(randomString2(min_length));
+	$('input[name=v_password]').val(randomString2(min_length));
 	App.Actions.DB.update_password_meter();
 	App.Actions.DB.update_password_meter();
 };
 };

+ 11 - 11
web/js/pages/edit_dns_rec.js

@@ -3,28 +3,28 @@
 // Updates database dns record dynamically, showing its full domain path
 // Updates database dns record dynamically, showing its full domain path
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 	// clean hint
 	// clean hint
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").text("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').text('');
 	}
 	}
 
 
 	// set domain name without rec in case of @ entries
 	// set domain name without rec in case of @ entries
-	if (hint == "@") {
-		hint = "";
+	if (hint == '@') {
+		hint = '';
 	}
 	}
 
 
 	// dont show prefix if domain name = rec value
 	// dont show prefix if domain name = rec value
-	if (hint == GLOBAL.DNS_REC_PREFIX + ".") {
-		hint = "";
+	if (hint == GLOBAL.DNS_REC_PREFIX + '.') {
+		hint = '';
 	}
 	}
 
 
 	// add dot at the end if needed
 	// add dot at the end if needed
-	if (hint != "" && hint.slice(-1) != ".") {
-		hint += ".";
+	if (hint != '' && hint.slice(-1) != '.') {
+		hint += '.';
 	}
 	}
 
 
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(hint + GLOBAL.DNS_REC_PREFIX);
 		.text(hint + GLOBAL.DNS_REC_PREFIX);
 };
 };
 
 
@@ -33,11 +33,11 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 App.Listeners.DB.keypress_dns_rec_entry = function () {
 App.Listeners.DB.keypress_dns_rec_entry = function () {
 	var ref = $('input[name="v_rec"]');
 	var ref = $('input[name="v_rec"]');
 	var current_rec = ref.val();
 	var current_rec = ref.val();
-	if (current_rec.trim() != "") {
+	if (current_rec.trim() != '') {
 		App.Actions.DB.update_dns_record_hint(ref, current_rec);
 		App.Actions.DB.update_dns_record_hint(ref, current_rec);
 	}
 	}
 
 
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);

+ 16 - 16
web/js/pages/edit_mail.js

@@ -1,37 +1,37 @@
 App.Actions.MAIL.toggle_letsencrypt = function (elm) {
 App.Actions.MAIL.toggle_letsencrypt = function (elm) {
-	if ($(elm).prop("checked")) {
+	if ($(elm).prop('checked')) {
 		$(
 		$(
-			"#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]"
-		).attr("disabled", "disabled");
-		$("#generate-csr").hide();
-		if (!$(".lets-encrypt-note").hasClass("enabled")) {
-			$(".lets-encrypt-note").show();
+			'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
+		).attr('disabled', 'disabled');
+		$('#generate-csr').hide();
+		if (!$('.lets-encrypt-note').hasClass('enabled')) {
+			$('.lets-encrypt-note').show();
 		}
 		}
 	} else {
 	} else {
 		$(
 		$(
-			"#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]"
-		).removeAttr("disabled");
-		$("#generate-csr").show();
-		$(".lets-encrypt-note").hide();
+			'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
+		).removeAttr('disabled');
+		$('#generate-csr').show();
+		$('.lets-encrypt-note').hide();
 	}
 	}
 };
 };
 
 
 //
 //
 // Page entry point
 // Page entry point
 $(function () {
 $(function () {
-	App.Actions.MAIL.toggle_letsencrypt($("input[name=v_letsencrypt]"));
+	App.Actions.MAIL.toggle_letsencrypt($('input[name=v_letsencrypt]'));
 });
 });
 
 
 function elementHideShow(elementToHideOrShow) {
 function elementHideShow(elementToHideOrShow) {
 	var el = document.getElementById(elementToHideOrShow);
 	var el = document.getElementById(elementToHideOrShow);
-	el.style.display = el.style.display === "none" ? "block" : "none";
+	el.style.display = el.style.display === 'none' ? 'block' : 'none';
 }
 }
 
 
-$("#vstobjects").on("submit", function (evt) {
-	$("input[disabled]").each(function (i, elm) {
+$('#vstobjects').on('submit', function (evt) {
+	$('input[disabled]').each(function (i, elm) {
 		var copy_elm = $(elm).clone(true);
 		var copy_elm = $(elm).clone(true);
-		$(copy_elm).attr("type", "hidden");
-		$(copy_elm).removeAttr("disabled");
+		$(copy_elm).attr('type', 'hidden');
+		$(copy_elm).removeAttr('disabled');
 		$(elm).after(copy_elm);
 		$(elm).after(copy_elm);
 	});
 	});
 });
 });

+ 81 - 81
web/js/pages/edit_mail_acc.js

@@ -1,33 +1,33 @@
 App.Actions.MAIL_ACC.enable_unlimited = function (elm, source_elm) {
 App.Actions.MAIL_ACC.enable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", true);
-	$(elm).data("prev_value", $(elm).val()); // save prev value in order to restore if needed
+	$(elm).data('checked', true);
+	$(elm).data('prev_value', $(elm).val()); // save prev value in order to restore if needed
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
-	$(elm).attr("disabled", true);
-	$(source_elm).css("opacity", "1");
+	$(elm).attr('disabled', true);
+	$(source_elm).css('opacity', '1');
 };
 };
 
 
 App.Actions.MAIL_ACC.disable_unlimited = function (elm, source_elm) {
 App.Actions.MAIL_ACC.disable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", false);
-	if ($(elm).data("prev_value") && $(elm).data("prev_value").trim() != "") {
-		var prev_value = $(elm).data("prev_value").trim();
+	$(elm).data('checked', false);
+	if ($(elm).data('prev_value') && $(elm).data('prev_value').trim() != '') {
+		var prev_value = $(elm).data('prev_value').trim();
 		$(elm).val(prev_value);
 		$(elm).val(prev_value);
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	} else {
 	} else {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	}
 	}
-	$(elm).attr("disabled", false);
-	$(source_elm).css("opacity", "0.5");
+	$(elm).attr('disabled', false);
+	$(source_elm).css('opacity', '0.5');
 };
 };
 
 
 //
 //
 App.Actions.MAIL_ACC.toggle_unlimited_feature = function (evt) {
 App.Actions.MAIL_ACC.toggle_unlimited_feature = function (evt) {
 	var elm = $(evt.target);
 	var elm = $(evt.target);
-	var ref = elm.prev(".form-control");
-	if (!$(ref).data("checked")) {
+	var ref = elm.prev('.form-control');
+	if (!$(ref).data('checked')) {
 		App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 		App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 	} else {
 	} else {
 		App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
 		App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
@@ -35,16 +35,16 @@ App.Actions.MAIL_ACC.toggle_unlimited_feature = function (evt) {
 };
 };
 
 
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature = function () {
 App.Listeners.MAIL_ACC.checkbox_unlimited_feature = function () {
-	$(".unlim-trigger").on("click", App.Actions.MAIL_ACC.toggle_unlimited_feature);
+	$('.unlim-trigger').on('click', App.Actions.MAIL_ACC.toggle_unlimited_feature);
 };
 };
 
 
 App.Listeners.MAIL_ACC.init = function () {
 App.Listeners.MAIL_ACC.init = function () {
-	$(".unlim-trigger").each(function (i, elm) {
-		var ref = $(elm).prev(".form-control");
+	$('.unlim-trigger').each(function (i, elm) {
+		var ref = $(elm).prev('.form-control');
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 			App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 			App.Actions.MAIL_ACC.enable_unlimited(ref, elm);
 		} else {
 		} else {
-			$(ref).data("prev_value", $(ref).val());
+			$(ref).data('prev_value', $(ref).val());
 			App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
 			App.Actions.MAIL_ACC.disable_unlimited(ref, elm);
 		}
 		}
 	});
 	});
@@ -82,12 +82,12 @@ App.Actions.MAIL_ACC.update_password_meter = function () {
 	if (min_num.test(password)) {
 	if (min_num.test(password)) {
 		score = score + 1;
 		score = score + 1;
 	}
 	}
-	$(".password-meter").val(score);
+	$('.password-meter').val(score);
 };
 };
 
 
 App.Listeners.MAIL_ACC.keypress_v_password = function () {
 App.Listeners.MAIL_ACC.keypress_v_password = function () {
 	var ref = $('input[name="v_password"]');
 	var ref = $('input[name="v_password"]');
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -96,14 +96,14 @@ App.Listeners.MAIL_ACC.keypress_v_password = function () {
 	});
 	});
 };
 };
 
 
-$("#v_blackhole").on("click", function (evt) {
-	if ($("#v_blackhole").is(":checked")) {
-		$("#v_fwd").prop("disabled", true);
-		$("#v_fwd_for").prop("checked", true);
-		$("#id_fwd_for").hide();
+$('#v_blackhole').on('click', function (evt) {
+	if ($('#v_blackhole').is(':checked')) {
+		$('#v_fwd').prop('disabled', true);
+		$('#v_fwd_for').prop('checked', true);
+		$('#id_fwd_for').hide();
 	} else {
 	} else {
-		$("#v_fwd").prop("disabled", false);
-		$("#id_fwd_for").show();
+		$('#v_fwd').prop('disabled', false);
+		$('#id_fwd_for').show();
 	}
 	}
 });
 });
 
 
@@ -111,86 +111,86 @@ App.Listeners.MAIL_ACC.keypress_v_password();
 
 
 applyRandomString = function (min_length = 16) {
 applyRandomString = function (min_length = 16) {
 	var randomString = randomString2(min_length);
 	var randomString = randomString2(min_length);
-	$("input[name=v_password]").val(randomString);
-	if ($("input[name=v_password]").attr("type") == "text")
-		$(".js-password-output").text(randomString);
-	else $(".js-password-output").text(Array(randomString.length + 1).join("*"));
+	$('input[name=v_password]').val(randomString);
+	if ($('input[name=v_password]').attr('type') == 'text')
+		$('.js-password-output').text(randomString);
+	else $('.js-password-output').text(Array(randomString.length + 1).join('*'));
 	App.Actions.MAIL_ACC.update_password_meter();
 	App.Actions.MAIL_ACC.update_password_meter();
 	generate_mail_credentials();
 	generate_mail_credentials();
 };
 };
 
 
 generate_mail_credentials = function () {
 generate_mail_credentials = function () {
-	var div = $(".mail-infoblock").clone();
-	div.find("#mail_configuration").remove();
-	var pass = div.find(".js-password-output").text();
-	if (pass == "") div.find(".js-password-output").text(" ");
+	var div = $('.mail-infoblock').clone();
+	div.find('#mail_configuration').remove();
+	var pass = div.find('.js-password-output').text();
+	if (pass == '') div.find('.js-password-output').text(' ');
 	var output = div.text();
 	var output = div.text();
-	output = output.replace(/(?:\r\n|\r|\n|\t)/g, "|");
-	output = output.replace(/ {2}/g, "");
-	output = output.replace(/\|\|/g, "|");
-	output = output.replace(/\|\|/g, "|");
-	output = output.replace(/\|\|/g, "|");
-	output = output.replace(/^\|+/g, "");
-	output = output.replace(/\|$/, "");
-	output = output.replace(/ $/, "");
-	output = output.replace(/:\|/g, ": ");
-	output = output.replace(/\|/g, "\n");
-	$(".js-hidden-credentials").val(output);
+	output = output.replace(/(?:\r\n|\r|\n|\t)/g, '|');
+	output = output.replace(/ {2}/g, '');
+	output = output.replace(/\|\|/g, '|');
+	output = output.replace(/\|\|/g, '|');
+	output = output.replace(/\|\|/g, '|');
+	output = output.replace(/^\|+/g, '');
+	output = output.replace(/\|$/, '');
+	output = output.replace(/ $/, '');
+	output = output.replace(/:\|/g, ': ');
+	output = output.replace(/\|/g, '\n');
+	$('.js-hidden-credentials').val(output);
 };
 };
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	$(".js-account-output").text($("input[name=v_account]").val());
-	$(".js-password-output").text($("input[name=v_password]").val());
+	$('.js-account-output').text($('input[name=v_account]').val());
+	$('.js-password-output').text($('input[name=v_password]').val());
 	generate_mail_credentials();
 	generate_mail_credentials();
 
 
-	$("input[name=v_account]").change(function () {
-		$(".js-account-output").text($(this).val());
+	$('input[name=v_account]').change(function () {
+		$('.js-account-output').text($(this).val());
 		generate_mail_credentials();
 		generate_mail_credentials();
 	});
 	});
 
 
-	$("input[name=v_password]").change(function () {
-		if ($("input[name=v_password]").attr("type") == "text")
-			$(".js-password-output").text($(this).val());
-		else $(".js-password-output").text(Array($(this).val().length + 1).join("*"));
+	$('input[name=v_password]').change(function () {
+		if ($('input[name=v_password]').attr('type') == 'text')
+			$('.js-password-output').text($(this).val());
+		else $('.js-password-output').text(Array($(this).val().length + 1).join('*'));
 		generate_mail_credentials();
 		generate_mail_credentials();
 	});
 	});
 
 
-	$(".toggle-psw-visibility-icon").click(function () {
-		if ($("input[name=v_password]").attr("type") == "text")
-			$(".js-password-output").text($("input[name=v_password]").val());
+	$('.toggle-psw-visibility-icon').click(function () {
+		if ($('input[name=v_password]').attr('type') == 'text')
+			$('.js-password-output').text($('input[name=v_password]').val());
 		else
 		else
-			$(".js-password-output").text(Array($("input[name=v_password]").val().length + 1).join("*"));
+			$('.js-password-output').text(Array($('input[name=v_password]').val().length + 1).join('*'));
 		generate_mail_credentials();
 		generate_mail_credentials();
 	});
 	});
 
 
-	$("#mail_configuration").change(function (evt) {
-		var opt = $(evt.target).find("option:selected");
+	$('#mail_configuration').change(function (evt) {
+		var opt = $(evt.target).find('option:selected');
 
 
-		switch (opt.attr("v_type")) {
-			case "hostname":
-				$("#td_imap_hostname").text(opt.attr("domain"));
-				$("#td_smtp_hostname").text(opt.attr("domain"));
+		switch (opt.attr('v_type')) {
+			case 'hostname':
+				$('#td_imap_hostname').text(opt.attr('domain'));
+				$('#td_smtp_hostname').text(opt.attr('domain'));
 				break;
 				break;
-			case "starttls":
-				$("#td_imap_port").text("143");
-				$("#td_imap_encryption").text("STARTTLS");
-				$("#td_smtp_port").text("587");
-				$("#td_smtp_encryption").text("STARTTLS");
+			case 'starttls':
+				$('#td_imap_port').text('143');
+				$('#td_imap_encryption').text('STARTTLS');
+				$('#td_smtp_port').text('587');
+				$('#td_smtp_encryption').text('STARTTLS');
 				break;
 				break;
-			case "ssl":
-				$("#td_imap_port").text("993");
-				$("#td_imap_encryption").text("SSL / TLS");
-				$("#td_smtp_port").text("465");
-				$("#td_smtp_encryption").text("SSL / TLS");
+			case 'ssl':
+				$('#td_imap_port').text('993');
+				$('#td_imap_encryption').text('SSL / TLS');
+				$('#td_smtp_port').text('465');
+				$('#td_smtp_encryption').text('SSL / TLS');
 				break;
 				break;
-			case "no_encryption":
-				$("#td_imap_hostname").text(opt.attr("domain"));
-				$("#td_smtp_hostname").text(opt.attr("domain"));
-
-				$("#td_imap_port").text("143");
-				$("#td_imap_encryption").text(opt.attr("no_encryption"));
-				$("#td_smtp_port").text("25");
-				$("#td_smtp_encryption").text(opt.attr("no_encryption"));
+			case 'no_encryption':
+				$('#td_imap_hostname').text(opt.attr('domain'));
+				$('#td_smtp_hostname').text(opt.attr('domain'));
+
+				$('#td_imap_port').text('143');
+				$('#td_imap_encryption').text(opt.attr('no_encryption'));
+				$('#td_smtp_port').text('25');
+				$('#td_smtp_encryption').text(opt.attr('no_encryption'));
 				break;
 				break;
 		}
 		}
 		generate_mail_credentials();
 		generate_mail_credentials();

+ 35 - 35
web/js/pages/edit_package.js

@@ -1,33 +1,33 @@
 App.Actions.PACKAGE.enable_unlimited = function (elm, source_elm) {
 App.Actions.PACKAGE.enable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", true);
-	$(elm).data("prev_value", $(elm).val()); // save prev value in order to restore if needed
+	$(elm).data('checked', true);
+	$(elm).data('prev_value', $(elm).val()); // save prev value in order to restore if needed
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
 	$(elm).val(App.Constants.UNLIM_TRANSLATED_VALUE);
-	$(elm).attr("disabled", true);
-	$(source_elm).css("opacity", "1");
+	$(elm).attr('disabled', true);
+	$(source_elm).css('opacity', '1');
 };
 };
 
 
 App.Actions.PACKAGE.disable_unlimited = function (elm, source_elm) {
 App.Actions.PACKAGE.disable_unlimited = function (elm, source_elm) {
-	$(elm).data("checked", false);
-	if ($(elm).data("prev_value") && $(elm).data("prev_value").trim() != "") {
-		var prev_value = $(elm).data("prev_value").trim();
+	$(elm).data('checked', false);
+	if ($(elm).data('prev_value') && $(elm).data('prev_value').trim() != '') {
+		var prev_value = $(elm).data('prev_value').trim();
 		$(elm).val(prev_value);
 		$(elm).val(prev_value);
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
 		if (App.Helpers.isUnlimitedValue(prev_value)) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	} else {
 	} else {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
-			$(elm).val("0");
+			$(elm).val('0');
 		}
 		}
 	}
 	}
-	$(elm).attr("disabled", false);
-	$(source_elm).css("opacity", "0.5");
+	$(elm).attr('disabled', false);
+	$(source_elm).css('opacity', '0.5');
 };
 };
 
 
 //
 //
 App.Actions.PACKAGE.toggle_unlimited_feature = function (evt) {
 App.Actions.PACKAGE.toggle_unlimited_feature = function (evt) {
 	var elm = $(evt.target);
 	var elm = $(evt.target);
-	var ref = elm.prev(".form-control");
-	if (!$(ref).data("checked")) {
+	var ref = elm.prev('.form-control');
+	if (!$(ref).data('checked')) {
 		App.Actions.PACKAGE.enable_unlimited(ref, elm);
 		App.Actions.PACKAGE.enable_unlimited(ref, elm);
 	} else {
 	} else {
 		App.Actions.PACKAGE.disable_unlimited(ref, elm);
 		App.Actions.PACKAGE.disable_unlimited(ref, elm);
@@ -35,16 +35,16 @@ App.Actions.PACKAGE.toggle_unlimited_feature = function (evt) {
 };
 };
 
 
 App.Listeners.PACKAGE.checkbox_unlimited_feature = function () {
 App.Listeners.PACKAGE.checkbox_unlimited_feature = function () {
-	$(".unlim-trigger").on("click", App.Actions.PACKAGE.toggle_unlimited_feature);
+	$('.unlim-trigger').on('click', App.Actions.PACKAGE.toggle_unlimited_feature);
 };
 };
 
 
 App.Listeners.PACKAGE.init = function () {
 App.Listeners.PACKAGE.init = function () {
-	$(".unlim-trigger").each(function (i, elm) {
-		var ref = $(elm).prev(".form-control");
+	$('.unlim-trigger').each(function (i, elm) {
+		var ref = $(elm).prev('.form-control');
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 		if (App.Helpers.isUnlimitedValue($(ref).val())) {
 			App.Actions.PACKAGE.enable_unlimited(ref, elm);
 			App.Actions.PACKAGE.enable_unlimited(ref, elm);
 		} else {
 		} else {
-			$(ref).data("prev_value", $(ref).val());
+			$(ref).data('prev_value', $(ref).val());
 			App.Actions.PACKAGE.disable_unlimited(ref, elm);
 			App.Actions.PACKAGE.disable_unlimited(ref, elm);
 		}
 		}
 	});
 	});
@@ -64,9 +64,9 @@ App.Helpers.isUnlimitedValue = function (value) {
 // Trigger listeners
 // Trigger listeners
 App.Listeners.PACKAGE.init();
 App.Listeners.PACKAGE.init();
 App.Listeners.PACKAGE.checkbox_unlimited_feature();
 App.Listeners.PACKAGE.checkbox_unlimited_feature();
-$('form[name="v_edit_package"]').on("submit", function (evt) {
-	$("input:disabled").each(function (i, elm) {
-		$(elm).attr("disabled", false);
+$('form[name="v_edit_package"]').on('submit', function (evt) {
+	$('input:disabled').each(function (i, elm) {
+		$(elm).attr('disabled', false);
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 		if (App.Helpers.isUnlimitedValue($(elm).val())) {
 			$(elm).val(App.Constants.UNLIM_VALUE);
 			$(elm).val(App.Constants.UNLIM_VALUE);
 		}
 		}
@@ -74,29 +74,29 @@ $('form[name="v_edit_package"]').on("submit", function (evt) {
 });
 });
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	$(".js-add-ns-button").click(function () {
-		var n = $("input[name^=v_ns]").length;
+	$('.js-add-ns-button').click(function () {
+		var n = $('input[name^=v_ns]').length;
 		if (n < 8) {
 		if (n < 8) {
-			var t = $($("input[name=v_ns1]").parents("div")[0]).clone(true, true);
-			t.find("input").attr({ value: "", name: "v_ns" + (n + 1) });
-			t.find("span").show();
-			$(".js-add-ns").before(t);
+			var t = $($('input[name=v_ns1]').parents('div')[0]).clone(true, true);
+			t.find('input').attr({ value: '', name: 'v_ns' + (n + 1) });
+			t.find('span').show();
+			$('.js-add-ns').before(t);
 		}
 		}
 		if (n == 7) {
 		if (n == 7) {
-			$(".js-add-ns").addClass("u-hidden");
+			$('.js-add-ns').addClass('u-hidden');
 		}
 		}
 	});
 	});
 
 
-	$(".js-remove-ns").click(function () {
-		$(this).parents("div")[0].remove();
-		$("input[name^=v_ns]").each(function (i, ns) {
-			$(ns).attr({ name: "v_ns" + (i + 1) });
-			i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('.js-remove-ns').click(function () {
+		$(this).parents('div')[0].remove();
+		$('input[name^=v_ns]').each(function (i, ns) {
+			$(ns).attr({ name: 'v_ns' + (i + 1) });
+			i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 		});
 		});
-		$(".js-add-ns").removeClass("u-hidden");
+		$('.js-add-ns').removeClass('u-hidden');
 	});
 	});
 
 
-	$("input[name^=v_ns]").each(function (i, ns) {
-		i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('input[name^=v_ns]').each(function (i, ns) {
+		i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 	});
 	});
 });
 });

+ 18 - 18
web/js/pages/edit_server.js

@@ -1,26 +1,26 @@
-$("#backup_type").change(function () {
-	if (this.value == "b2") {
-		$("#backup_bucket").show();
-		$("#backup_sftp").hide();
-		$("#backup_rclone").hide();
-	} else if (this.value == "rclone") {
-		$("#backup_bucket").hide();
-		$("#backup_sftp").hide();
-		$("#backup_rclone").show();
+$('#backup_type').change(function () {
+	if (this.value == 'b2') {
+		$('#backup_bucket').show();
+		$('#backup_sftp').hide();
+		$('#backup_rclone').hide();
+	} else if (this.value == 'rclone') {
+		$('#backup_bucket').hide();
+		$('#backup_sftp').hide();
+		$('#backup_rclone').show();
 	} else {
 	} else {
-		$("#backup_bucket").hide();
-		$("#backup_sftp").show();
-		$("#backup_rclone").hide();
+		$('#backup_bucket').hide();
+		$('#backup_sftp').show();
+		$('#backup_rclone').hide();
 	}
 	}
 });
 });
 
 
-$("#api, #api-system").change(function () {
-	var api = $("#api").val();
-	var apiSystem = $("#api-system").val();
+$('#api, #api-system').change(function () {
+	var api = $('#api').val();
+	var apiSystem = $('#api-system').val();
 
 
-	if (api === "yes" || apiSystem > 0) {
-		$("#security_ip").show();
+	if (api === 'yes' || apiSystem > 0) {
+		$('#security_ip').show();
 	} else {
 	} else {
-		$("#security_ip").hide();
+		$('#security_ip').hide();
 	}
 	}
 });
 });

+ 24 - 24
web/js/pages/edit_server_mysql.js

@@ -1,41 +1,41 @@
 function toggleOptions() {
 function toggleOptions() {
-	if ($("#advanced-options").is(":visible")) {
-		$.removeCookie("advanced");
-		$("#advanced-options").hide();
-		$("#basic-options").show();
+	if ($('#advanced-options').is(':visible')) {
+		$.removeCookie('advanced');
+		$('#advanced-options').hide();
+		$('#basic-options').show();
 	} else {
 	} else {
-		$.cookie("advanced", 1);
-		$("#advanced-options").show();
-		$("#basic-options").hide();
+		$.cookie('advanced', 1);
+		$('#advanced-options').show();
+		$('#basic-options').hide();
 
 
-		var advance_options = $("#advanced-options textarea");
+		var advance_options = $('#advanced-options textarea');
 
 
-		$("#vstobjects input[type=text]").each(function (i, elm) {
-			var search = $(elm).attr("regexp");
-			var prev_value = $(elm).attr("prev_value");
-			$(elm).attr("prev_value", $(elm).val());
-			var regexp = new RegExp("^(" + search + ")(.+)(" + prev_value + ")", "m");
-			advance_options.val(advance_options.val().replace(regexp, "$1$2" + $(elm).val()));
+		$('#vstobjects input[type=text]').each(function (i, elm) {
+			var search = $(elm).attr('regexp');
+			var prev_value = $(elm).attr('prev_value');
+			$(elm).attr('prev_value', $(elm).val());
+			var regexp = new RegExp('^(' + search + ')(.+)(' + prev_value + ')', 'm');
+			advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
 		});
 		});
 	}
 	}
 }
 }
 
 
-$("#vstobjects").submit(function () {
-	if ($("#basic-options").is(":visible")) {
-		var advance_options = $("#advanced-options textarea");
+$('#vstobjects').submit(function () {
+	if ($('#basic-options').is(':visible')) {
+		var advance_options = $('#advanced-options textarea');
 
 
-		$("#vstobjects input[type=text]").each(function (i, elm) {
-			var search = $(elm).attr("regexp");
-			var prev_value = $(elm).attr("prev_value");
-			$(elm).attr("prev_value", $(elm).val());
-			var regexp = new RegExp("^(" + search + ")(.+)(" + prev_value + ")", "m");
-			advance_options.val(advance_options.val().replace(regexp, "$1$2" + $(elm).val()));
+		$('#vstobjects input[type=text]').each(function (i, elm) {
+			var search = $(elm).attr('regexp');
+			var prev_value = $(elm).attr('prev_value');
+			$(elm).attr('prev_value', $(elm).val());
+			var regexp = new RegExp('^(' + search + ')(.+)(' + prev_value + ')', 'm');
+			advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
 		});
 		});
 	}
 	}
 });
 });
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	if ($.cookie("advanced")) {
+	if ($.cookie('advanced')) {
 		toggleOptions();
 		toggleOptions();
 	}
 	}
 });
 });

+ 24 - 24
web/js/pages/edit_server_nginx.js

@@ -1,41 +1,41 @@
 function toggleOptions() {
 function toggleOptions() {
-	if ($("#advanced-options").is(":visible")) {
-		$.removeCookie("advanced");
-		$("#advanced-options").hide();
-		$("#basic-options").show();
+	if ($('#advanced-options').is(':visible')) {
+		$.removeCookie('advanced');
+		$('#advanced-options').hide();
+		$('#basic-options').show();
 	} else {
 	} else {
-		$.cookie("advanced", 1);
-		$("#advanced-options").show();
-		$("#basic-options").hide();
+		$.cookie('advanced', 1);
+		$('#advanced-options').show();
+		$('#basic-options').hide();
 
 
-		var advance_options = $("#advanced-options textarea");
+		var advance_options = $('#advanced-options textarea');
 
 
-		$("#vstobjects input[type=text]").each(function (i, elm) {
-			var search = $(elm).attr("regexp");
-			var prev_value = $(elm).attr("prev_value");
-			$(elm).attr("prev_value", $(elm).val());
-			var regexp = new RegExp("(" + search + ")(.+)(" + prev_value + ")");
-			advance_options.val(advance_options.val().replace(regexp, "$1$2" + $(elm).val()));
+		$('#vstobjects input[type=text]').each(function (i, elm) {
+			var search = $(elm).attr('regexp');
+			var prev_value = $(elm).attr('prev_value');
+			$(elm).attr('prev_value', $(elm).val());
+			var regexp = new RegExp('(' + search + ')(.+)(' + prev_value + ')');
+			advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
 		});
 		});
 	}
 	}
 }
 }
 
 
-$("#vstobjects").submit(function () {
-	if ($("#basic-options").is(":visible")) {
-		var advance_options = $("#advanced-options textarea");
+$('#vstobjects').submit(function () {
+	if ($('#basic-options').is(':visible')) {
+		var advance_options = $('#advanced-options textarea');
 
 
-		$("#vstobjects input[type=text]").each(function (i, elm) {
-			var search = $(elm).attr("regexp");
-			var prev_value = $(elm).attr("prev_value");
-			$(elm).attr("prev_value", $(elm).val());
-			var regexp = new RegExp("(" + search + ")(.+)(" + prev_value + ")");
-			advance_options.val(advance_options.val().replace(regexp, "$1$2" + $(elm).val()));
+		$('#vstobjects input[type=text]').each(function (i, elm) {
+			var search = $(elm).attr('regexp');
+			var prev_value = $(elm).attr('prev_value');
+			$(elm).attr('prev_value', $(elm).val());
+			var regexp = new RegExp('(' + search + ')(.+)(' + prev_value + ')');
+			advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
 		});
 		});
 	}
 	}
 });
 });
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	if ($.cookie("advanced")) {
+	if ($.cookie('advanced')) {
 		toggleOptions();
 		toggleOptions();
 	}
 	}
 });
 });

+ 24 - 24
web/js/pages/edit_server_php.js

@@ -1,41 +1,41 @@
 function toggleOptions() {
 function toggleOptions() {
-	if ($("#advanced-options").is(":visible")) {
-		$.removeCookie("advanced");
-		$("#advanced-options").hide();
-		$("#basic-options").show();
+	if ($('#advanced-options').is(':visible')) {
+		$.removeCookie('advanced');
+		$('#advanced-options').hide();
+		$('#basic-options').show();
 	} else {
 	} else {
-		$.cookie("advanced", 1);
-		$("#advanced-options").show();
-		$("#basic-options").hide();
+		$.cookie('advanced', 1);
+		$('#advanced-options').show();
+		$('#basic-options').hide();
 
 
-		var advance_options = $("#advanced-options textarea");
+		var advance_options = $('#advanced-options textarea');
 
 
-		$("#vstobjects input[type=text]").each(function (i, elm) {
-			var search = $(elm).attr("regexp");
-			var prev_value = $(elm).attr("prev_value");
-			$(elm).attr("prev_value", $(elm).val());
-			var regexp = new RegExp("^(" + search + ")(.+)(" + prev_value + ")", "m");
-			advance_options.val(advance_options.val().replace(regexp, "$1$2" + $(elm).val()));
+		$('#vstobjects input[type=text]').each(function (i, elm) {
+			var search = $(elm).attr('regexp');
+			var prev_value = $(elm).attr('prev_value');
+			$(elm).attr('prev_value', $(elm).val());
+			var regexp = new RegExp('^(' + search + ')(.+)(' + prev_value + ')', 'm');
+			advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
 		});
 		});
 	}
 	}
 }
 }
 
 
-$("#vstobjects").submit(function () {
-	if ($("#basic-options").is(":visible")) {
-		var advance_options = $("#advanced-options textarea");
+$('#vstobjects').submit(function () {
+	if ($('#basic-options').is(':visible')) {
+		var advance_options = $('#advanced-options textarea');
 
 
-		$("#vstobjects input[type=text]").each(function (i, elm) {
-			var search = $(elm).attr("regexp");
-			var prev_value = $(elm).attr("prev_value");
-			$(elm).attr("prev_value", $(elm).val());
-			var regexp = new RegExp("^(" + search + ")(.+)(" + prev_value + ")", "m");
-			advance_options.val(advance_options.val().replace(regexp, "$1$2" + $(elm).val()));
+		$('#vstobjects input[type=text]').each(function (i, elm) {
+			var search = $(elm).attr('regexp');
+			var prev_value = $(elm).attr('prev_value');
+			$(elm).attr('prev_value', $(elm).val());
+			var regexp = new RegExp('^(' + search + ')(.+)(' + prev_value + ')', 'm');
+			advance_options.val(advance_options.val().replace(regexp, '$1$2' + $(elm).val()));
 		});
 		});
 	}
 	}
 });
 });
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	if ($.cookie("advanced")) {
+	if ($.cookie('advanced')) {
 		toggleOptions();
 		toggleOptions();
 	}
 	}
 });
 });

+ 18 - 18
web/js/pages/edit_user.js

@@ -1,5 +1,5 @@
 applyRandomString = function (min_length = 16) {
 applyRandomString = function (min_length = 16) {
-	$("input[name=v_password]").val(randomString2(min_length));
+	$('input[name=v_password]').val(randomString2(min_length));
 	App.Actions.WEB.update_password_meter();
 	App.Actions.WEB.update_password_meter();
 };
 };
 
 
@@ -22,12 +22,12 @@ App.Actions.WEB.update_password_meter = function () {
 	if (min_num.test(password)) {
 	if (min_num.test(password)) {
 		score = score + 1;
 		score = score + 1;
 	}
 	}
-	$(".password-meter").val(score);
+	$('.password-meter').val(score);
 };
 };
 
 
 App.Listeners.WEB.keypress_v_password = function () {
 App.Listeners.WEB.keypress_v_password = function () {
 	var ref = $('input[name="v_password"]');
 	var ref = $('input[name="v_password"]');
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -38,29 +38,29 @@ App.Listeners.WEB.keypress_v_password = function () {
 App.Listeners.WEB.keypress_v_password();
 App.Listeners.WEB.keypress_v_password();
 
 
 $(document).ready(function () {
 $(document).ready(function () {
-	$(".js-add-ns-button").click(function () {
-		var n = $("input[name^=v_ns]").length;
+	$('.js-add-ns-button').click(function () {
+		var n = $('input[name^=v_ns]').length;
 		if (n < 8) {
 		if (n < 8) {
-			var t = $($("input[name=v_ns1]").parents("div")[0]).clone(true, true);
-			t.find("input").attr({ value: "", name: "v_ns" + (n + 1) });
-			t.find("span").show();
-			$(".js-add-ns").before(t);
+			var t = $($('input[name=v_ns1]').parents('div')[0]).clone(true, true);
+			t.find('input').attr({ value: '', name: 'v_ns' + (n + 1) });
+			t.find('span').show();
+			$('.js-add-ns').before(t);
 		}
 		}
 		if (n == 7) {
 		if (n == 7) {
-			$(".js-add-ns").addClass("u-hidden");
+			$('.js-add-ns').addClass('u-hidden');
 		}
 		}
 	});
 	});
 
 
-	$(".js-remove-ns").click(function () {
-		$(this).parents("div")[0].remove();
-		$("input[name^=v_ns]").each(function (i, ns) {
-			$(ns).attr({ name: "v_ns" + (i + 1) });
-			i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('.js-remove-ns').click(function () {
+		$(this).parents('div')[0].remove();
+		$('input[name^=v_ns]').each(function (i, ns) {
+			$(ns).attr({ name: 'v_ns' + (i + 1) });
+			i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 		});
 		});
-		$(".js-add-ns").removeClass("u-hidden");
+		$('.js-add-ns').removeClass('u-hidden');
 	});
 	});
 
 
-	$("input[name^=v_ns]").each(function (i, ns) {
-		i < 2 ? $(ns).parent().find("span").hide() : $(ns).parent().find("span").show();
+	$('input[name^=v_ns]').each(function (i, ns) {
+		i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
 	});
 	});
 });
 });

+ 100 - 100
web/js/pages/edit_web.js

@@ -3,14 +3,14 @@ App.Actions.WEB.update_custom_doc_root = function (elm, hint) {
 	var domain = $('select[name="v-custom-doc-domain"]').val();
 	var domain = $('select[name="v-custom-doc-domain"]').val();
 	var folder = $('input[name="v-custom-doc-folder"]').val();
 	var folder = $('input[name="v-custom-doc-folder"]').val();
 
 
-	$(".custom_docroot_hint").html(prepath + domain + "/public_html/" + folder);
+	$('.custom_docroot_hint').html(prepath + domain + '/public_html/' + folder);
 };
 };
 App.Listeners.DB.keypress_custom_folder = function () {
 App.Listeners.DB.keypress_custom_folder = function () {
 	var ref = $('input[name="v-custom-doc-folder"]');
 	var ref = $('input[name="v-custom-doc-folder"]');
 	var current_rec = ref.val();
 	var current_rec = ref.val();
 	App.Actions.WEB.update_custom_doc_root(ref, current_rec);
 	App.Actions.WEB.update_custom_doc_root(ref, current_rec);
 
 
-	ref.bind("keypress input", function (evt) {
+	ref.bind('keypress input', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -22,7 +22,7 @@ App.Listeners.DB.keypress_custom_folder = function () {
 App.Listeners.DB.change_custom_doc = function () {
 App.Listeners.DB.change_custom_doc = function () {
 	var ref = $('select[name="v-custom-doc-domain"]');
 	var ref = $('select[name="v-custom-doc-domain"]');
 	var current_rec = ref.val();
 	var current_rec = ref.val();
-	ref.bind("change select", function (evt) {
+	ref.bind('change select', function (evt) {
 		clearTimeout(window.frp_usr_tmt);
 		clearTimeout(window.frp_usr_tmt);
 		window.frp_usr_tmt = setTimeout(function () {
 		window.frp_usr_tmt = setTimeout(function () {
 			var elm = $(evt.target);
 			var elm = $(evt.target);
@@ -37,29 +37,29 @@ App.Listeners.DB.keypress_custom_folder();
 App.Listeners.DB.change_custom_doc();
 App.Listeners.DB.change_custom_doc();
 
 
 App.Actions.WEB.update_ftp_username_hint = function (elm, hint) {
 App.Actions.WEB.update_ftp_username_hint = function (elm, hint) {
-	if (hint.trim() == "") {
-		$(elm).parent().find(".hint").html("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.hint').html('');
 	}
 	}
 
 
-	hint = hint.replace(/[^\w\d]/gi, "");
+	hint = hint.replace(/[^\w\d]/gi, '');
 
 
-	$(elm).parent().find(".v-ftp-user").val(hint);
+	$(elm).parent().find('.v-ftp-user').val(hint);
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
-		.find(".hint")
+		.find('.hint')
 		.text(GLOBAL.FTP_USER_PREFIX + hint);
 		.text(GLOBAL.FTP_USER_PREFIX + hint);
 };
 };
 
 
 App.Listeners.WEB.keypress_ftp_username = function () {
 App.Listeners.WEB.keypress_ftp_username = function () {
-	var ftp_user_inputs = $(".v-ftp-user");
+	var ftp_user_inputs = $('.v-ftp-user');
 	$.each(ftp_user_inputs, function (i, ref) {
 	$.each(ftp_user_inputs, function (i, ref) {
 		var ref = $(ref);
 		var ref = $(ref);
 		var current_val = ref.val();
 		var current_val = ref.val();
-		if (current_val.trim() != "") {
+		if (current_val.trim() != '') {
 			App.Actions.WEB.update_ftp_username_hint(ref, current_val);
 			App.Actions.WEB.update_ftp_username_hint(ref, current_val);
 		}
 		}
 
 
-		ref.bind("keypress input", function (evt) {
+		ref.bind('keypress input', function (evt) {
 			clearTimeout(window.frp_usr_tmt);
 			clearTimeout(window.frp_usr_tmt);
 			window.frp_usr_tmt = setTimeout(function () {
 			window.frp_usr_tmt = setTimeout(function () {
 				var elm = $(evt.target);
 				var elm = $(evt.target);
@@ -73,29 +73,29 @@ App.Listeners.WEB.keypress_ftp_username = function () {
 //
 //
 
 
 App.Actions.WEB.update_ftp_path_hint = function (elm, hint) {
 App.Actions.WEB.update_ftp_path_hint = function (elm, hint) {
-	if (hint.trim() == "") {
-		$(elm).parent().find(".js-ftp-path-hint").html("");
+	if (hint.trim() == '') {
+		$(elm).parent().find('.js-ftp-path-hint').html('');
 	}
 	}
 
 
-	if (hint[0] != "/") {
-		hint = "/" + hint;
+	if (hint[0] != '/') {
+		hint = '/' + hint;
 	}
 	}
 
 
-	hint = hint.replace(/\/(\/+)/g, "/");
+	hint = hint.replace(/\/(\/+)/g, '/');
 
 
-	$(elm).parent().find(".js-ftp-path-hint").text(hint);
+	$(elm).parent().find('.js-ftp-path-hint').text(hint);
 };
 };
 
 
 App.Listeners.WEB.keypress_ftp_path = function () {
 App.Listeners.WEB.keypress_ftp_path = function () {
-	var ftp_path_inputs = $(".js-ftp-path");
+	var ftp_path_inputs = $('.js-ftp-path');
 	$.each(ftp_path_inputs, function (i, ref) {
 	$.each(ftp_path_inputs, function (i, ref) {
 		var ref = $(ref);
 		var ref = $(ref);
 		var current_val = ref.val();
 		var current_val = ref.val();
-		if (current_val.trim() != "") {
+		if (current_val.trim() != '') {
 			App.Actions.WEB.update_ftp_path_hint(ref, current_val);
 			App.Actions.WEB.update_ftp_path_hint(ref, current_val);
 		}
 		}
 
 
-		ref.bind("keypress input", function (evt) {
+		ref.bind('keypress input', function (evt) {
 			clearTimeout(window.frp_usr_tmt);
 			clearTimeout(window.frp_usr_tmt);
 			window.frp_usr_tmt = setTimeout(function () {
 			window.frp_usr_tmt = setTimeout(function () {
 				var elm = $(evt.target);
 				var elm = $(evt.target);
@@ -108,108 +108,108 @@ App.Listeners.WEB.keypress_ftp_path = function () {
 //
 //
 //
 //
 App.Actions.WEB.add_ftp_user_form = function () {
 App.Actions.WEB.add_ftp_user_form = function () {
-	var ref = $("#templates").find(".js-ftp-account-nrm").clone(true);
-	var index = $(".form-container .js-ftp-account").length + 1;
+	var ref = $('#templates').find('.js-ftp-account-nrm').clone(true);
+	var index = $('.form-container .js-ftp-account').length + 1;
 
 
-	ref.find("input").each(function (i, elm) {
-		var name = $(elm).attr("name");
-		var id = $(elm).attr("id");
-		$(elm).attr("name", name.replace("%INDEX%", index));
+	ref.find('input').each(function (i, elm) {
+		var name = $(elm).attr('name');
+		var id = $(elm).attr('id');
+		$(elm).attr('name', name.replace('%INDEX%', index));
 		if (id) {
 		if (id) {
-			$(elm).attr("id", id.replace("%INDEX%", index));
+			$(elm).attr('id', id.replace('%INDEX%', index));
 		}
 		}
 	});
 	});
 
 
 	ref
 	ref
-		.find("input")
-		.prev("label")
+		.find('input')
+		.prev('label')
 		.each(function (i, elm) {
 		.each(function (i, elm) {
-			var for_attr = $(elm).attr("for");
-			$(elm).attr("for", for_attr.replace("%INDEX%", index));
+			var for_attr = $(elm).attr('for');
+			$(elm).attr('for', for_attr.replace('%INDEX%', index));
 		});
 		});
 
 
-	ref.find(".ftp-user-number").text(index);
+	ref.find('.ftp-user-number').text(index);
 
 
-	$("#ftp_users").append(ref);
+	$('#ftp_users').append(ref);
 
 
 	var index = 1;
 	var index = 1;
-	$(".form-container .ftp-user-number:visible").each(function (i, o) {
+	$('.form-container .ftp-user-number:visible').each(function (i, o) {
 		$(o).text(index);
 		$(o).text(index);
 		index += 1;
 		index += 1;
 	});
 	});
 };
 };
 
 
 App.Actions.WEB.remove_ftp_user = function (elm) {
 App.Actions.WEB.remove_ftp_user = function (elm) {
-	var ref = $(elm).parents(".js-ftp-account");
-	ref.find(".v-ftp-user-deleted").val("1");
-	if (ref.find(".v-ftp-user-is-new").val() == 1) {
+	var ref = $(elm).parents('.js-ftp-account');
+	ref.find('.v-ftp-user-deleted').val('1');
+	if (ref.find('.v-ftp-user-is-new').val() == 1) {
 		ref.remove();
 		ref.remove();
 		return true;
 		return true;
 	}
 	}
-	ref.removeClass("js-ftp-account-nrm");
+	ref.removeClass('js-ftp-account-nrm');
 	ref.hide();
 	ref.hide();
 
 
 	var index = 1;
 	var index = 1;
-	$(".form-container .ftp-user-number:visible").each(function (i, o) {
+	$('.form-container .ftp-user-number:visible').each(function (i, o) {
 		$(o).text(index);
 		$(o).text(index);
 		index += 1;
 		index += 1;
 	});
 	});
 
 
-	if ($(".js-ftp-account-nrm:visible").length == 0) {
-		$(".js-add-new-ftp-user-button").hide();
-		$('input[name="v_ftp"]').prop("checked", false);
+	if ($('.js-ftp-account-nrm:visible').length == 0) {
+		$('.js-add-new-ftp-user-button').hide();
+		$('input[name="v_ftp"]').prop('checked', false);
 	}
 	}
 };
 };
 
 
 App.Actions.WEB.toggle_additional_ftp_accounts = function (elm) {
 App.Actions.WEB.toggle_additional_ftp_accounts = function (elm) {
-	if ($(elm).prop("checked")) {
-		$(".js-ftp-account-nrm, .v-add-new-user, .js-add-new-ftp-user-button").show();
-		$(".js-ftp-account-nrm").each(function (i, elm) {
-			var login = $(elm).find(".v-ftp-user");
-			if (login.val().trim() != "") {
-				$(elm).find(".v-ftp-user-deleted").val(0);
+	if ($(elm).prop('checked')) {
+		$('.js-ftp-account-nrm, .v-add-new-user, .js-add-new-ftp-user-button').show();
+		$('.js-ftp-account-nrm').each(function (i, elm) {
+			var login = $(elm).find('.v-ftp-user');
+			if (login.val().trim() != '') {
+				$(elm).find('.v-ftp-user-deleted').val(0);
 			}
 			}
 		});
 		});
 	} else {
 	} else {
-		$(".js-ftp-account-nrm, .v-add-new-user, .js-add-new-ftp-user-button").hide();
-		$(".js-ftp-account-nrm").each(function (i, elm) {
-			var login = $(elm).find(".v-ftp-user");
-			if (login.val().trim() != "") {
-				$(elm).find(".v-ftp-user-deleted").val(1);
+		$('.js-ftp-account-nrm, .v-add-new-user, .js-add-new-ftp-user-button').hide();
+		$('.js-ftp-account-nrm').each(function (i, elm) {
+			var login = $(elm).find('.v-ftp-user');
+			if (login.val().trim() != '') {
+				$(elm).find('.v-ftp-user-deleted').val(1);
 			}
 			}
 		});
 		});
 	}
 	}
 };
 };
 
 
 App.Actions.WEB.toggle_ssl = function (elm) {
 App.Actions.WEB.toggle_ssl = function (elm) {
-	elementHideShow("ssltable");
+	elementHideShow('ssltable');
 	if (
 	if (
-		$("#ssl_crt").val().length > 0 ||
-		$("#ssl_hsts").prop("checked") ||
-		$("#letsencrypt").prop("checked")
+		$('#ssl_crt').val().length > 0 ||
+		$('#ssl_hsts').prop('checked') ||
+		$('#letsencrypt').prop('checked')
 	) {
 	) {
 		return false;
 		return false;
 	}
 	}
-	$("#v_ssl_forcessl").prop("checked", true);
+	$('#v_ssl_forcessl').prop('checked', true);
 };
 };
 
 
 App.Actions.WEB.toggle_letsencrypt = function (elm) {
 App.Actions.WEB.toggle_letsencrypt = function (elm) {
-	if ($(elm).prop("checked")) {
-		$("#ssl-details").hide();
+	if ($(elm).prop('checked')) {
+		$('#ssl-details').hide();
 		$(
 		$(
-			"#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]"
-		).attr("disabled", "disabled");
-		$("#generate-csr").hide();
-		if (!$(".lets-encrypt-note").hasClass("enabled")) {
-			$(".lets-encrypt-note").show();
+			'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
+		).attr('disabled', 'disabled');
+		$('#generate-csr').hide();
+		if (!$('.lets-encrypt-note').hasClass('enabled')) {
+			$('.lets-encrypt-note').show();
 		}
 		}
 	} else {
 	} else {
 		$(
 		$(
-			"#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]"
-		).removeAttr("disabled");
-		$("#generate-csr").show();
-		$("#ssl-details").show();
-		$(".lets-encrypt-note").hide();
+			'#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
+		).removeAttr('disabled');
+		$('#generate-csr').show();
+		$('#ssl-details').show();
+		$('.lets-encrypt-note').hide();
 	}
 	}
 };
 };
 
 
@@ -218,11 +218,11 @@ App.Actions.WEB.randomPasswordGenerated = function (elm) {
 };
 };
 
 
 App.Actions.WEB.passwordChanged = function (elm) {
 App.Actions.WEB.passwordChanged = function (elm) {
-	var ref = $(elm).parents(".js-ftp-account");
-	if (ref.find(".js-email-alert-on-psw").length == 0) {
-		var inp_name = ref.find(".v-ftp-user-is-new").prop("name");
-		inp_name = inp_name.replace("is_new", "v_ftp_email");
-		ref.find("div:last").after(
+	var ref = $(elm).parents('.js-ftp-account');
+	if (ref.find('.js-email-alert-on-psw').length == 0) {
+		var inp_name = ref.find('.v-ftp-user-is-new').prop('name');
+		inp_name = inp_name.replace('is_new', 'v_ftp_email');
+		ref.find('div:last').after(
 			'<div class="u-pl30 u-mb10">\
 			'<div class="u-pl30 u-mb10">\
                                       <label for="' +
                                       <label for="' +
 				inp_name +
 				inp_name +
@@ -243,54 +243,54 @@ App.Listeners.WEB.keypress_ftp_username();
 App.Listeners.WEB.keypress_ftp_path();
 App.Listeners.WEB.keypress_ftp_path();
 
 
 $(function () {
 $(function () {
-	$(".v-ftp-user-psw").on("keypress", function (evt) {
+	$('.v-ftp-user-psw').on('keypress', function (evt) {
 		var elm = $(evt.target);
 		var elm = $(evt.target);
 		App.Actions.WEB.passwordChanged(elm);
 		App.Actions.WEB.passwordChanged(elm);
 	});
 	});
-	App.Actions.WEB.toggle_letsencrypt($("input[name=v_letsencrypt]"));
+	App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]'));
 
 
 	$('select[name="v_stats"]').change(function (evt) {
 	$('select[name="v_stats"]').change(function (evt) {
 		var select = $(evt.target);
 		var select = $(evt.target);
 
 
-		if (select.val() == "none") {
-			$(".stats-auth").hide();
+		if (select.val() == 'none') {
+			$('.stats-auth').hide();
 		} else {
 		} else {
-			$(".stats-auth").show();
+			$('.stats-auth').show();
 		}
 		}
 	});
 	});
 
 
 	$('select[name="v_nginx_cache"]').change(function (evt) {
 	$('select[name="v_nginx_cache"]').change(function (evt) {
 		var select = $(evt.target);
 		var select = $(evt.target);
 
 
-		if (select.val() != "yes") {
-			$("#v-clear-cache").hide();
-			$("#v_nginx_cache_length").hide();
+		if (select.val() != 'yes') {
+			$('#v-clear-cache').hide();
+			$('#v_nginx_cache_length').hide();
 		} else {
 		} else {
-			$("#v-clear-cache").show();
-			$("#v_nginx_cache_length").show();
+			$('#v-clear-cache').show();
+			$('#v_nginx_cache_length').show();
 		}
 		}
 	});
 	});
 
 
 	$('select[name="v_proxy_template"]').change(function (evt) {
 	$('select[name="v_proxy_template"]').change(function (evt) {
 		var select = $(evt.target);
 		var select = $(evt.target);
 
 
-		if (select.val() != "caching") {
-			const re = new RegExp("caching-");
+		if (select.val() != 'caching') {
+			const re = new RegExp('caching-');
 			if (re.test(select.val())) {
 			if (re.test(select.val())) {
-				$("#v-clear-cache").show();
+				$('#v-clear-cache').show();
 			} else {
 			} else {
-				$("#v-clear-cache").hide();
+				$('#v-clear-cache').hide();
 			}
 			}
 		} else {
 		} else {
-			$("#v-clear-cache").show();
+			$('#v-clear-cache').show();
 		}
 		}
 	});
 	});
 
 
-	$("#vstobjects").on("submit", function (evt) {
-		$("input[disabled]").each(function (i, elm) {
+	$('#vstobjects').on('submit', function (evt) {
+		$('input[disabled]').each(function (i, elm) {
 			var copy_elm = $(elm).clone(true);
 			var copy_elm = $(elm).clone(true);
-			$(copy_elm).attr("type", "hidden");
-			$(copy_elm).removeAttr("disabled");
+			$(copy_elm).attr('type', 'hidden');
+			$(copy_elm).removeAttr('disabled');
 			$(elm).after(copy_elm);
 			$(elm).after(copy_elm);
 		});
 		});
 	});
 	});
@@ -301,21 +301,21 @@ function WEBrandom() {
 }
 }
 
 
 function FTPrandom(elm) {
 function FTPrandom(elm) {
-	$(elm).parents(".js-ftp-account").find(".v-ftp-user-psw").val(randomString2(16));
+	$(elm).parents('.js-ftp-account').find('.v-ftp-user-psw').val(randomString2(16));
 	App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
 	App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
 }
 }
 
 
 function elementHideShow(element) {
 function elementHideShow(element) {
 	if (document.getElementById(element)) {
 	if (document.getElementById(element)) {
 		var el = document.getElementById(element);
 		var el = document.getElementById(element);
-		el.style.display = el.style.display === "none" ? "block" : "none";
+		el.style.display = el.style.display === 'none' ? 'block' : 'none';
 	}
 	}
 }
 }
 
 
-$(".v-redirect-custom-value").change(function () {
-	if (this.value == "custom") {
-		$("#custom_redirect").show();
+$('.v-redirect-custom-value').change(function () {
+	if (this.value == 'custom') {
+		$('#custom_redirect').show();
 	} else {
 	} else {
-		$("#custom_redirect").hide();
+		$('#custom_redirect').hide();
 	}
 	}
 });
 });

+ 7 - 7
web/js/pages/list_rrd.js

@@ -1,13 +1,13 @@
 // Default max of 3 lines are drawn for memory. Colors need to be update to work better
 // Default max of 3 lines are drawn for memory. Colors need to be update to work better
-colors = ["rgba(255,52,120,0.5)", "rgba(255,52,0,0.5)", "rgba(255,255,120,0.5)"];
+colors = ['rgba(255,52,120,0.5)', 'rgba(255,52,0,0.5)', 'rgba(255,255,120,0.5)'];
 // Other markups are working see https://www.chartjs.org/docs/latest/
 // Other markups are working see https://www.chartjs.org/docs/latest/
 
 
 //todo make charts reponsive
 //todo make charts reponsive
 $(document).ready(function () {
 $(document).ready(function () {
-	$("canvas").each(function () {
+	$('canvas').each(function () {
 		$.post(
 		$.post(
-			"/list/rrd/ajax.php",
-			{ service: $(this).attr("id"), period: $(this).attr("period") },
+			'/list/rrd/ajax.php',
+			{ service: $(this).attr('id'), period: $(this).attr('period') },
 			function (response) {
 			function (response) {
 				labels = [];
 				labels = [];
 				//data is stored as start, end time and step between each step
 				//data is stored as start, end time and step between each step
@@ -25,9 +25,9 @@ $(document).ready(function () {
 					datasets.push(dataset);
 					datasets.push(dataset);
 				}
 				}
 				//draw chart
 				//draw chart
-				const ctx = document.getElementById(response.service).getContext("2d");
+				const ctx = document.getElementById(response.service).getContext('2d');
 				const myChart = new Chart(ctx, {
 				const myChart = new Chart(ctx, {
-					type: "line",
+					type: 'line',
 					data: {
 					data: {
 						labels: labels,
 						labels: labels,
 						datasets: datasets,
 						datasets: datasets,
@@ -41,7 +41,7 @@ $(document).ready(function () {
 					},
 					},
 				});
 				});
 			},
 			},
-			"json"
+			'json'
 		);
 		);
 	});
 	});
 });
 });

+ 4 - 4
web/js/pages/list_ssl.js

@@ -1,9 +1,9 @@
 function saveTextToBlob(file, element) {
 function saveTextToBlob(file, element) {
 	var text = document.getElementById(element).value;
 	var text = document.getElementById(element).value;
-	var textFileAsBlob = new Blob([text], { type: "text/plain" });
-	var downloadLink = document.createElement("a");
+	var textFileAsBlob = new Blob([text], { type: 'text/plain' });
+	var downloadLink = document.createElement('a');
 	downloadLink.download = file;
 	downloadLink.download = file;
-	downloadLink.innerHTML = "Download File";
+	downloadLink.innerHTML = 'Download File';
 	if (window.webkitURL != null) {
 	if (window.webkitURL != null) {
 		// Chrome allows the link to be clicked
 		// Chrome allows the link to be clicked
 		// without actually adding it to the DOM.
 		// without actually adding it to the DOM.
@@ -13,7 +13,7 @@ function saveTextToBlob(file, element) {
 		// before it can be clicked.
 		// before it can be clicked.
 		downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
 		downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
 		downloadLink.onclick = destroyClickedElement;
 		downloadLink.onclick = destroyClickedElement;
-		downloadLink.style.display = "none";
+		downloadLink.style.display = 'none';
 		document.body.appendChild(downloadLink);
 		document.body.appendChild(downloadLink);
 	}
 	}
 
 

+ 6 - 6
web/js/templates.js

@@ -4,7 +4,7 @@
  */
  */
 App.Templates.html = {
 App.Templates.html = {
 	WEB: {
 	WEB: {
-		hint: [""],
+		hint: [''],
 		notification: [
 		notification: [
 			'<li class="~!:UNSEEN~!"><span class="unselectable mark-seen" id="notification-~!:ID~!">&nbsp;</span>\
 			'<li class="~!:UNSEEN~!"><span class="unselectable mark-seen" id="notification-~!:ID~!">&nbsp;</span>\
                         <span class="notification-title"><span class="unselectable icon ~!:TYPE~!">&nbsp;</span>~!:TOPIC~!</span>\
                         <span class="notification-title"><span class="unselectable icon ~!:TYPE~!">&nbsp;</span>~!:TOPIC~!</span>\
@@ -16,7 +16,7 @@ App.Templates.html = {
 			'<li class="empty"><span><i class="fas fa-bell-slash status-icon dim" style="font-size: 4rem;"></i><br><br>\
 			'<li class="empty"><span><i class="fas fa-bell-slash status-icon dim" style="font-size: 4rem;"></i><br><br>\
                     ' +
                     ' +
 				App.Constants.NOTIFICATIONS_EMPTY +
 				App.Constants.NOTIFICATIONS_EMPTY +
-				"</span></li>",
+				'</span></li>',
 		],
 		],
 	},
 	},
 };
 };
@@ -38,7 +38,7 @@ var Templator = function () {
 			//try{
 			//try{
 			var tpls = App.Templates.html[o];
 			var tpls = App.Templates.html[o];
 			jQuery.each(tpls, function (t) {
 			jQuery.each(tpls, function (t) {
-				tpls[t] = tpls[t][0].split("~!");
+				tpls[t] = tpls[t][0].split('~!');
 			});
 			});
 			//}catch(e){fb.error('%o %o', o, e);}
 			//}catch(e){fb.error('%o %o', o, e);}
 		});
 		});
@@ -64,15 +64,15 @@ var Templator = function () {
 		 * Set the indexes
 		 * Set the indexes
 		 */
 		 */
 		(Templator.catchIndex = function (key, ref_key, tpl) {
 		(Templator.catchIndex = function (key, ref_key, tpl) {
-			"undefined" == typeof App.Templates._indexes[key]
+			'undefined' == typeof App.Templates._indexes[key]
 				? (App.Templates._indexes[key] = {})
 				? (App.Templates._indexes[key] = {})
 				: false;
 				: false;
-			"undefined" == typeof App.Templates._indexes[key][ref_key]
+			'undefined' == typeof App.Templates._indexes[key][ref_key]
 				? (App.Templates._indexes[key][ref_key] = {})
 				? (App.Templates._indexes[key][ref_key] = {})
 				: false;
 				: false;
 
 
 			jQuery(tpl).each(function (index, o) {
 			jQuery(tpl).each(function (index, o) {
-				if (":" == o.charAt(0)) {
+				if (':' == o.charAt(0)) {
 					App.Templates._indexes[key][ref_key][o.toString()] = index;
 					App.Templates._indexes[key][ref_key][o.toString()] = index;
 				}
 				}
 			});
 			});

Некоторые файлы не были показаны из-за большого количества измененных файлов