',
@@ -462,7 +520,7 @@ $LANG['vi'] = array(
'Confirm Password' => 'Xác nhận mật khẩu',
'Reset' => 'Thiết lập lại',
'Reset Code' => 'Thiết lập lại mã',
- 'RESET_NOTICE' => '',
+ 'RESET_NOTICE' => '', // should we add something here?
'RESET_CODE_SENT' => 'Mã thiết lập lại mật khẩu đã được gửi đến địa chỉ email ',
'MAIL_RESET_SUBJECT' => 'Khôi phục mật khẩu tại %s',
'PASSWORD_RESET_REQUEST' => "Để thiết lập lại mật khẩu quản trị, vui lòng truy cập vào địa chỉ:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, you may go to https://%s/reset/?action=code&user=%s và nhập mã sau:\n%s\n\nNếu bạn không thực hiện khôi phục mật khẩu, vui lòng bỏ qua email này.\n\n--\nVesta Control Panel\n",
@@ -479,11 +537,34 @@ $LANG['vi'] = array(
'Oct' => 'Tháng 10',
'Nov' => 'Tháng 11',
'Dec' => 'Tháng 12',
-
+
'Configuring Server' => 'Cài đặt máy chủ',
'Hostname' => 'Tên miền',
'Time Zone' => 'Múi giờ',
'Default Language' => 'Ngôn ngữ mặc đinhk',
+ 'Proxy Server' => 'Proxy Server',
+ 'Web Server' => 'Web Server',
+ 'Backend Server' => 'Backend Server',
+ 'Backend Pool Mode' => 'Backend Pool Mode',
+ 'DNS Server' => 'DNS Server',
+ 'DNS Cluster' => 'DNS Cluster',
+ 'MAIL Server' => 'MAIL Server',
+ 'Antivirus' => 'Antivirus',
+ 'AntiSpam' => 'AntiSpam',
+ 'Webmail URL' => 'Webmail URL',
+ 'MySQL Support' => 'MySQL Support',
+ 'phpMyAdmin URL' => 'phpMyAdmin URL',
+ 'PostgreSQL Support' => 'PostgreSQL Support',
+ 'phpPgAdmin URL' => 'phpPgAdmin URL',
+ 'Maximum Number Of Databases' => 'Maximum Number Of Databases',
+ 'Current Number Of Databases' => 'Current Number Of Databases',
+ 'Local backup' => 'Local backup',
+ 'Compression level' => 'Compression level',
+ 'Directory' => 'Directory',
+ 'Remote backup' => 'Remote backup',
+ 'ftp' => 'FTP',
+ 'sftp' => 'SFTP',
+ 'SFTP Chroot' => 'SFTP Chroot',
'FileSystem Disk Quota' => 'Hạn mức dung lượng đĩa hệ thống',
'Vesta Control Panel Plugins' => 'Vesta Control Panel Plugins',
'preview' => 'xem trước',
@@ -493,14 +574,14 @@ $LANG['vi'] = array(
'Backup Migration Manager' => 'Quản lý tích hợp sao lưu',
'FileManager' => 'FileManager',
'show: CPU / MEM / NET / DISK' => 'hiển thị: CPU / MEM / NET / DISK',
-
+
'sort by' => 'xếp theo',
'Date' => 'Ngày',
'Starred' => 'Đánh dấu',
'Name' => 'Tên',
+
'File Manager' => 'Quản lý tệp',
- 'type' => 'loại',
'size' => 'size',
'date' => 'ngày',
'name' => 'tên',
@@ -515,6 +596,7 @@ $LANG['vi'] = array(
'ARCHIVE' => 'Nén',
'EXTRACT' => 'Giải nén',
'DOWNLOAD' => 'Tải về',
+ 'Are you sure?' => 'Are you sure?', // unused?
'Hit' => 'Lượt',
'to reload the page' => 'để tải lại trang',
'Directory name cannot be empty' => 'Tên thư mục không thể để trống',
@@ -535,6 +617,10 @@ $LANG['vi'] = array(
'Create' => 'Tạo mới',
'Compress' => 'Nén',
'OK' => 'OK',
+ 'YOU ARE COPYING' => 'YOU ARE COPYING', // unused?
+ 'YOU ARE REMOVING' => 'YOU ARE REMOVING',
+ 'Delete items' => 'Delete items',
+ 'Copy files' => 'Copy files',
'Are you sure you want to copy' => 'Bạn có chắc chắn muốn sao chép',
'Are you sure you want to delete' => 'Bạn có chắc chắn muốn xóa',
'into' => 'into',
@@ -554,6 +640,7 @@ $LANG['vi'] = array(
'write by others' => 'write by others',
'execute/search by others' => 'execute/search by others',
+ 'Shortcuts' => 'Shortcuts',
'Add New object' => 'Thêm đối tượng mới',
'Save Form' => 'Lưu form',
'Cancel saving form' => 'Hủy lưu form',
@@ -576,24 +663,21 @@ $LANG['vi'] = array(
'New File' => 'Tạo tệp',
'New Folder' => 'Tạo thư mục',
'Download' => 'Tải về',
- 'Rename' => 'Đổi tên',
- 'Copy' => 'Sao chép',
'Archive' => 'Lưu trữ',
- 'Delete' => 'Xóa',
'Save File (in text editor)' => 'Lưu tệp (Trong trình chỉnh sửa văn bản)',
'Close Popup / Cancel' => 'Đóng Popup / Hủy',
'Move Cursor Up' => 'Di chuyển chuột lên',
- 'Move Cursor Dow' => 'Di chuyển chuột xuống',
+ 'Move Cursor Down' => 'Di chuyển chuột xuống',
'Switch to Left Tab' => 'Chuyển sang tab trái',
'Switch to Right Tab' => 'Chuyển sang tab phải',
'Switch Tab' => 'Chuyển đổi Tab',
- 'Go to the Top of File List' => 'Lên đầu danh sách tệp',
+ 'Go to the Top of the File List' => 'Lên đầu danh sách tệp',
'Go to the Last File' => 'Di chuyển đến tệp cuối cùng',
- 'Open File/Enter Directory' => 'Mở tệp/Truy cập thư mục',
+ 'Open File / Enter Directory' => 'Mở tệp/Truy cập thư mục',
'Go to Parent Directory' => 'Về thư mục cha',
'Select Current File' => 'Chọn tệp hiện tại',
'Select Bunch of Files' => 'Chọn nhiều tệp',
- 'Append File to the Current Selection' => 'Thêm tệp vào lựa chọn hiện tại',
+ 'Add File to the Current Selection' => 'Thêm tệp vào lựa chọn hiện tại',
'Select All Files' => 'Chọn tất cả các tệp',
'shortcuts are inspired by magnificent GNU Midnight Commander file manager' => 'shortcuts are inspired by magnificent GNU Midnight Commander file manager',
@@ -610,9 +694,6 @@ $LANG['vi'] = array(
'Minutes' => 'Minutes',
'Hourly' => 'Hourly',
- 'Daily' => 'Daily',
- 'Weekly' => 'Weekly',
- 'Monthly' => 'Monthly',
'Run Command' => 'Run Command',
'every month' => 'every month',
'every odd month' => 'every odd month',
@@ -634,7 +715,9 @@ $LANG['vi'] = array(
'every minute' => 'every minute',
'every two minutes' => 'every two minutes',
'every' => 'every',
- 'Hour' => 'Hour',
- 'Minute' => 'Minute'
+ 'Generate' => 'Generate',
+
+ 'webalizer' => 'webalizer',
+ 'awstats' => 'awstats',
);
diff --git a/web/inc/main.php b/web/inc/main.php
index 03446849..931bf7f2 100644
--- a/web/inc/main.php
+++ b/web/inc/main.php
@@ -3,6 +3,8 @@
session_start();
define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
+define('JS_LATEST_UPDATE', '1467758417');
+
$i = 0;
require_once(dirname(__FILE__).'/i18n.php');
@@ -95,12 +97,9 @@ function check_return_code($return_var,$output) {
}
}
-function insert_scripts() {
- @include_once(dirname(__DIR__) . '/templates/scripts.html');
-}
-
function render_page($user, $TAB, $page) {
$__template_dir = dirname(__DIR__) . '/templates/';
+ $__pages_js_dir = dirname(__DIR__) . '/js/pages/';
// Header
include($__template_dir . 'header.html');
@@ -126,6 +125,12 @@ function render_page($user, $TAB, $page) {
@include($__template_dir . "admin/$page.html");
}
+ // Including common js files
+ @include_once(dirname(__DIR__) . '/templates/scripts.html');
+ // Including page specific js file
+ if(file_exists($__pages_js_dir.$page.'.js'))
+ echo '';
+
// Footer
include($__template_dir . 'footer.html');
}
diff --git a/web/js/app.js b/web/js/app.js
index a15cc4ae..9df62a10 100644
--- a/web/js/app.js
+++ b/web/js/app.js
@@ -668,14 +668,6 @@ var _DEBUG_LEVEL = 'ALL';
// possible levels: ALL, IMPORTANT
var Error = {FATAL: 1, WARNING: 0, NORMAL: -1};
-//
-// GLOBAL SETTINGS
-//
-GLOBAL = {};
-GLOBAL.FTP_USER_PREFIX = 'admin_';
-GLOBAL.DB_USER_PREFIX = 'admin_';
-GLOBAL.DB_DBNAME_PREFIX = 'admin_';
-GLOBAL.AJAX_URL = '';
/**
* Init debug, grabs console object if accessible, or makes dummy debugger
@@ -1069,615 +1061,8 @@ function doSearch(url) {
}
-
-$(document).ready(function(){
- if($('.body-login')[0]){
- $('input').first().focus();
- }
-
- $(".submenu-select-dropdown").each(function(){
- $(this).wrap("");
- $(this).after(" ");
- });
- $(".submenu-select-dropdown").change(function(){
- var selectedOption = $(this).find(":selected").text();
- $(this).next(".holder").text(selectedOption);
- }).trigger('change');
- $('.to-top').bind('click', function(evt) {
- $("html, body").animate({ scrollTop: 0 }, "normal");
- });
-
-
- var isMobile = false; //initiate as false
- // device detection
- if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
- || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))){
- isMobile = true;
- $('body').addClass('mobile');
- }
-
- $(window).scroll(function(){hover_menu()});
-
- $('.l-sort-toolbar .sort-by').click(function(){
- $('.context-menu.sort-order').toggle().css({left: $(this).position().left - 10});
- });
-
-
- // CREATE BUTTON
-
- $('.l-sort__create-btn').hover(function(){
- $(".l-sort__create-btn").append("
");
- $(".l-sort__create-btn").append(""+$('.l-sort__create-btn').attr('title').replace(' ',' ')+"
");
- }, function(){
- $("#add-icon").remove();
- $("#tooltip").remove();
- });
-
-
- // SEARCH BOX
-
- $('.l-sort-toolbar__search, .l-sort-toolbar__search-box .search-input').hover(function(){
- clearTimeout(VE.tmp.search_display_interval);
- clearTimeout(VE.tmp.search_hover_interval);
- VE.tmp.search_display_interval = setTimeout(function(){$('.search-input').addClass('activated');}, 150);
- }, function(){
- clearTimeout(VE.tmp.search_display_interval);
- clearTimeout(VE.tmp.search_hover_interval);
- VE.tmp.search_hover_interval = setTimeout(function(){
- if(!VE.tmp.search_activated && !$(".search-input").val().length){
- $(".search-input").removeClass('activated');
- }
- }, 600);
- });
-
- $('.search-input').focus(function(){
- VE.tmp.search_activated = 1;
- clearTimeout(VE.tmp.search_hover_interval);
- });
- $('.search-input').blur(function(){
- VE.tmp.search_activated = 0;
- clearTimeout(VE.tmp.search_hover_interval);
- VE.tmp.search_hover_interval = setTimeout(function(){
- if(!$(".search-input").val().length){
- $(".search-input").removeClass('activated');
- }
- }, 600);
- });
-
-
- // TIMER
-
- if($('.movement.left').length){
- VE.helpers.refresh_timer.right = $('.movement.right');
- VE.helpers.refresh_timer.left = $('.movement.left');
- VE.helpers.refresh_timer.start();
-
- $('.pause').click(function(){
- VE.helpers.refresh_timer.stop();
- $('.pause').addClass('hidden');
- $('.play').removeClass('hidden');
- $('.refresh-timer').addClass('paused');
- });
-
- $('.play').click(function(){
- VE.helpers.refresh_timer.start();
- $('.pause').removeClass('hidden');
- $('.play').addClass('hidden');
- $('.refresh-timer').removeClass('paused');
- });
- }
-
-
- // SORTING
-
- $('#vstobjects input, #vstobjects select, #vstobjects textarea').change(function(){VE.tmp.form_changed=1});
-
- $('.sort-order span').click(function(){
- $('.context-menu.sort-order').toggle();
- if($(this).hasClass('active'))
- return;
-
- $('.sort-order span').removeClass('active');
- $(this).addClass('active');
- VE.tmp.sort_par = $(this).parent('li').attr('entity');
- VE.tmp.sort_as_int = $(this).parent('li').attr('sort_as_int');
- VE.tmp.sort_direction = $(this).hasClass('up')*1 || -1;
-
- $('.l-sort .sort-by span b').html($(this).parent('li').find('.name').html());
- $('.l-sort .sort-by i').removeClass('l-icon-up-arrow l-icon-down-arrow');
- $(this).hasClass('up') ? $('.l-sort .sort-by i').addClass('l-icon-up-arrow') : $('.l-sort .sort-by i').addClass('l-icon-down-arrow');
- $('.units .l-unit').sort(function (a, b) {
- if(VE.tmp.sort_as_int)
- return parseInt($(a).attr(VE.tmp.sort_par)) >= parseInt($(b).attr(VE.tmp.sort_par)) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
- else
- return $(a).attr(VE.tmp.sort_par) <= $(b).attr(VE.tmp.sort_par) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
- }).appendTo(".l-center.units");
- });
-
-
-
- // STARS
-
- $('.l-unit .l-icon-star').click(function(){
- var l_unit = $(this).parents('.l-unit');
-
- if(l_unit.hasClass('l-unit--starred')){
- // removing star
-
- $.ajax({
- method: "POST",
- url: "/delete/favorite/index.php",
- data: { v_section: l_unit.attr('v_section'), v_unit_id: l_unit.attr('v_unit_id') }
- });
-
- l_unit.attr({'sort-star': 0});
- l_unit.removeClass('l-unit--starred');
- }
- else{
- $.ajax({
- method: "POST",
- url: "/add/favorite/index.php",
- data: { v_unit_id: l_unit.attr('v_unit_id'), v_section: l_unit.attr('v_section') }
- });
-
- l_unit.attr({'sort-star': 1});
- l_unit.addClass('l-unit--starred');
- }
- });
-
-
-
- // Shortcuts
-
- shortcut.add("Ctrl+Enter", function(){
- $('form#vstobjects').submit();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': false,
- 'target': document
- }
- );
-
- shortcut.add("Ctrl+Backspace", function(){
- if(VE.tmp.form_changed && $('form#vstobjects .button.cancel')[0]){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'",""));
- } else if($('form#vstobjects .button.cancel')[0]){
- location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","");
- } else if($('#vstobjects a.button.cancel')[0]){
- location.href=$('#vstobjects a.button.cancel').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': false,
- 'target': document
- }
- );
-
-
- shortcut.add("f", function(){
- $('.search-input').addClass('activated').focus();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- $(window).bind('keypress', function(evt) {
- var tag = evt.target.tagName.toLowerCase();
- if (evt.charCode == 97 && tag != 'input' && tag != 'textarea' && tag != 'selectbox') {
- evt.preventDefault();
- if (!evt.ctrlKey && !evt.shiftKey) {
- if ($('.l-sort__create-btn')[0]) {
- location.href=$('.l-sort__create-btn').attr('href');
- }
- }
- else {
- if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
- $('.l-unit').removeClass('selected');
- $('.l-unit .ch-toggle').attr('checked', false);
- }
- else {
- $('.l-unit').addClass('selected');
- $('.l-unit .ch-toggle').attr('checked', true);
- }
- }
- }
- });
-
- shortcut.add("1", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(1) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("2", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(2) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(2) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("3", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(3) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(3) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("4", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(4) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(4) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("5", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(5) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(5) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("6", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(6) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(6) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("7", function(){
- if(VE.tmp.form_changed){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(7) a').attr('href'));
- } else {
- location.href=$('.l-stat .l-stat__col:nth-of-type(7) a').attr('href');
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("h", function(){
- $('.shortcuts').toggle();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("Esc", function(){
- $('.shortcuts').hide();
- $('input, checkbox, textarea, select').blur();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': false,
- 'target': document
- }
- );
-
- shortcut.add("Left", function(){
- VE.navigation.move_focus_left();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("Right", function(){
- VE.navigation.move_focus_right();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
-
-
- shortcut.add("down", function(){
- VE.navigation.move_focus_down();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("up", function(){
- VE.navigation.move_focus_up();
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("l", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-l');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("s", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-s');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("w", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-w');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("d", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-d');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("r", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-r');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("n", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-n');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("u", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-u');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
-
- shortcut.add("Delete", function(){
- var elm = $('.units.active .l-unit.focus .shortcut-delete');
- if(elm.length){
- VE.navigation.shortcut(elm);
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
- shortcut.add("Enter", function(){
- if(VE.tmp.form_changed){
- if(!$('.ui-dialog').is(':visible')){
- VE.helpers.createConfirmationDialog($('.confirmation-text-redirect')[0], '', $(VE.navigation.state.menu_selector + '.focus a').attr('href'));
- } else { // if dialog is opened - submitting confirm box by "enter" shortcut
- $('.ui-dialog button.submit').click();
- }
- } else {
- if(!$('.ui-dialog').is(':visible')){
- var elm = $('.units.active .l-unit.focus .shortcut-enter');
- if(elm.length){
- VE.navigation.shortcut(elm);
- } else {
- VE.navigation.enter_focused();
- }
- } else { // if dialog is opened - submitting confirm box by "enter" shortcut
- $('.ui-dialog button.submit').click();
- }
- }
- }, {
- 'type': 'keydown',
- 'propagate': false,
- 'disable_in_input': true,
- 'target': document
- }
- );
-
-
-
- $('.shortcuts .close').click(function(){
- $('.shortcuts').hide();
- });
-
- $('.to-shortcuts').click(function(){
- $('.shortcuts').toggle();
- });
-
- $(document).click(function(evt){
- //close notification popup
- if(!$(evt.target).hasClass('l-profile__notifications') && $(evt.target).parents('ul.notification-container').length == 0){
- $('.notification-container').hide();
- $('.l-profile__notifications').removeClass('active');
- }
- });
-
-
- // focusing on the first input at form
- if( location.href.indexOf('lead=') == -1 && !$('.ui-dialog').is(':visible') ){
- $('#vstobjects .vst-input:not([disabled]), #vstobjects .vst-list:not([disabled])').first().focus();
- }
-
- $('.l-profile__notifications').click(function(){
- if(!$('.l-profile__notifications').hasClass('active')){
- VE.notifications.get_list();
- $('.l-profile__notifications').addClass('active');
- left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
- $('.notification-container').css({left: left+'px'});
-
- } else {
- $('.notification-container').hide();
- $('.l-profile__notifications').removeClass('active');
- }
- });
-
- VE.navigation.init();
-
- VE.core.register();
- if (location.href.search(/list/) != -1) {
- var shift_select_ref = $('body').finderSelect({
- children: '.l-unit',
- 'onFinish': function(evt) {
- var ref = $(evt.target);
- $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
- $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
-
-
- if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
- $('.toggle-all').addClass('clicked-on');
- }
-
- },
- 'toggleAllHook': function() {
- if ($('.l-unit').length == $('.ch-toggle:checked').length) {
- $('.l-unit.selected').removeClass('selected');
- $('.ch-toggle').attr('checked', false);
- $('#toggle-all').attr('checked', false);
- }
- else {
- $('.ch-toggle').attr('checked', true);
- $('#toggle-all').attr('checked', true);
- }
- }
- });
-
- $('table').on('mousedown', 'td', function(e) {
- if (e.ctrlKey) {
- e.preventDefault();
- }
- });
- }
-
- //
- $('form#objects').bind('submit', function(evt) {
- $('.l-unit.selected').find('.ch-toggle').attr('checked', true);
- });
-
-
- // CRON HELPER
- $( "#tabs" ).tabs();
- $('.context-helper').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');
-
- return false;
- });
-
-
-
-
- });
+function elementHideShow(elementToHideOrShow){
+ var el = document.getElementById(elementToHideOrShow);
+ el.style.display = el.style.display === 'none' ? 'block' : 'none';
+}
diff --git a/web/js/init.js b/web/js/init.js
new file mode 100644
index 00000000..5692048d
--- /dev/null
+++ b/web/js/init.js
@@ -0,0 +1,591 @@
+$(document).ready(function(){
+ if($('.body-login')[0]){
+ $('input').first().focus();
+ }
+
+ $(".submenu-select-dropdown").each(function(){
+ $(this).wrap("");
+ $(this).after(" ");
+ });
+ $(".submenu-select-dropdown").change(function(){
+ var selectedOption = $(this).find(":selected").text();
+ $(this).next(".holder").text(selectedOption);
+ }).trigger('change');
+ $('.to-top').bind('click', function(evt) {
+ $("html, body").animate({ scrollTop: 0 }, "normal");
+ });
+
+
+ var isMobile = false; //initiate as false
+ // device detection
+ if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
+ || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))){
+ isMobile = true;
+ $('body').addClass('mobile');
+ }
+
+ $(window).scroll(function(){hover_menu()});
+
+ $('.l-sort-toolbar .sort-by').click(function(){
+ $('.context-menu.sort-order').toggle().css({left: $(this).position().left - 10});
+ });
+
+
+ // CREATE BUTTON
+
+ $('.l-sort__create-btn').hover(function(){
+ $(".l-sort__create-btn").append("
");
+ $(".l-sort__create-btn").append(""+$('.l-sort__create-btn').attr('title').replace(' ',' ')+"
");
+ }, function(){
+ $("#add-icon").remove();
+ $("#tooltip").remove();
+ });
+
+
+ // SEARCH BOX
+
+ $('.l-sort-toolbar__search, .l-sort-toolbar__search-box .search-input').hover(function(){
+ clearTimeout(VE.tmp.search_display_interval);
+ clearTimeout(VE.tmp.search_hover_interval);
+ VE.tmp.search_display_interval = setTimeout(function(){$('.search-input').addClass('activated');}, 150);
+ }, function(){
+ clearTimeout(VE.tmp.search_display_interval);
+ clearTimeout(VE.tmp.search_hover_interval);
+ VE.tmp.search_hover_interval = setTimeout(function(){
+ if(!VE.tmp.search_activated && !$(".search-input").val().length){
+ $(".search-input").removeClass('activated');
+ }
+ }, 600);
+ });
+
+ $('.search-input').focus(function(){
+ VE.tmp.search_activated = 1;
+ clearTimeout(VE.tmp.search_hover_interval);
+ });
+ $('.search-input').blur(function(){
+ VE.tmp.search_activated = 0;
+ clearTimeout(VE.tmp.search_hover_interval);
+ VE.tmp.search_hover_interval = setTimeout(function(){
+ if(!$(".search-input").val().length){
+ $(".search-input").removeClass('activated');
+ }
+ }, 600);
+ });
+
+
+ // TIMER
+
+ if($('.movement.left').length){
+ VE.helpers.refresh_timer.right = $('.movement.right');
+ VE.helpers.refresh_timer.left = $('.movement.left');
+ VE.helpers.refresh_timer.start();
+
+ $('.pause').click(function(){
+ VE.helpers.refresh_timer.stop();
+ $('.pause').addClass('hidden');
+ $('.play').removeClass('hidden');
+ $('.refresh-timer').addClass('paused');
+ });
+
+ $('.play').click(function(){
+ VE.helpers.refresh_timer.start();
+ $('.pause').removeClass('hidden');
+ $('.play').addClass('hidden');
+ $('.refresh-timer').removeClass('paused');
+ });
+ }
+
+
+ // SORTING
+
+ $('#vstobjects input, #vstobjects select, #vstobjects textarea').change(function(){VE.tmp.form_changed=1});
+
+ $('.sort-order span').click(function(){
+ $('.context-menu.sort-order').toggle();
+ if($(this).hasClass('active'))
+ return;
+
+ $('.sort-order span').removeClass('active');
+ $(this).addClass('active');
+ VE.tmp.sort_par = $(this).parent('li').attr('entity');
+ VE.tmp.sort_as_int = $(this).parent('li').attr('sort_as_int');
+ VE.tmp.sort_direction = $(this).hasClass('up')*1 || -1;
+
+ $('.l-sort .sort-by span b').html($(this).parent('li').find('.name').html());
+ $('.l-sort .sort-by i').removeClass('l-icon-up-arrow l-icon-down-arrow');
+ $(this).hasClass('up') ? $('.l-sort .sort-by i').addClass('l-icon-up-arrow') : $('.l-sort .sort-by i').addClass('l-icon-down-arrow');
+ $('.units .l-unit').sort(function (a, b) {
+ if(VE.tmp.sort_as_int)
+ return parseInt($(a).attr(VE.tmp.sort_par)) >= parseInt($(b).attr(VE.tmp.sort_par)) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
+ else
+ return $(a).attr(VE.tmp.sort_par) <= $(b).attr(VE.tmp.sort_par) ? VE.tmp.sort_direction : VE.tmp.sort_direction * -1;
+ }).appendTo(".l-center.units");
+ });
+
+
+
+ // STARS
+
+ $('.l-unit .l-icon-star').click(function(){
+ var l_unit = $(this).parents('.l-unit');
+
+ if(l_unit.hasClass('l-unit--starred')){
+ // removing star
+
+ $.ajax({
+ method: "POST",
+ url: "/delete/favorite/index.php",
+ data: { v_section: l_unit.attr('v_section'), v_unit_id: l_unit.attr('v_unit_id') }
+ });
+
+ l_unit.attr({'sort-star': 0});
+ l_unit.removeClass('l-unit--starred');
+ }
+ else{
+ $.ajax({
+ method: "POST",
+ url: "/add/favorite/index.php",
+ data: { v_unit_id: l_unit.attr('v_unit_id'), v_section: l_unit.attr('v_section') }
+ });
+
+ l_unit.attr({'sort-star': 1});
+ l_unit.addClass('l-unit--starred');
+ }
+ });
+
+
+
+ // Shortcuts
+
+ shortcut.add("Ctrl+Enter", function(){
+ $('form#vstobjects').submit();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': false,
+ 'target': document
+ }
+ );
+
+ shortcut.add("Ctrl+Backspace", function(){
+ if(VE.tmp.form_changed && $('form#vstobjects .button.cancel')[0]){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'",""));
+ } else if($('form#vstobjects .button.cancel')[0]){
+ location.href=$('form#vstobjects input.cancel').attr('onclick').replace("location.href='", "").replace("'","");
+ } else if($('#vstobjects a.button.cancel')[0]){
+ location.href=$('#vstobjects a.button.cancel').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': false,
+ 'target': document
+ }
+ );
+
+
+ shortcut.add("f", function(){
+ $('.search-input').addClass('activated').focus();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ $(window).bind('keypress', function(evt) {
+ var tag = evt.target.tagName.toLowerCase();
+ if (evt.charCode == 97 && tag != 'input' && tag != 'textarea' && tag != 'selectbox') {
+ evt.preventDefault();
+ if (!evt.ctrlKey && !evt.shiftKey) {
+ if ($('.l-sort__create-btn')[0]) {
+ location.href=$('.l-sort__create-btn').attr('href');
+ }
+ }
+ else {
+ if ($('.l-unit .ch-toggle:eq(0)').attr('checked')) {
+ $('.l-unit').removeClass('selected');
+ $('.l-unit .ch-toggle').attr('checked', false);
+ }
+ else {
+ $('.l-unit').addClass('selected');
+ $('.l-unit .ch-toggle').attr('checked', true);
+ }
+ }
+ }
+ });
+
+ shortcut.add("1", function(){
+ if(VE.tmp.form_changed){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(1) a').attr('href'));
+ } else {
+ location.href=$('.l-stat .l-stat__col:nth-of-type(1) a').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("2", function(){
+ if(VE.tmp.form_changed){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(2) a').attr('href'));
+ } else {
+ location.href=$('.l-stat .l-stat__col:nth-of-type(2) a').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("3", function(){
+ if(VE.tmp.form_changed){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(3) a').attr('href'));
+ } else {
+ location.href=$('.l-stat .l-stat__col:nth-of-type(3) a').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("4", function(){
+ if(VE.tmp.form_changed){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(4) a').attr('href'));
+ } else {
+ location.href=$('.l-stat .l-stat__col:nth-of-type(4) a').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("5", function(){
+ if(VE.tmp.form_changed){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(5) a').attr('href'));
+ } else {
+ location.href=$('.l-stat .l-stat__col:nth-of-type(5) a').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("6", function(){
+ if(VE.tmp.form_changed){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(6) a').attr('href'));
+ } else {
+ location.href=$('.l-stat .l-stat__col:nth-of-type(6) a').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("7", function(){
+ if(VE.tmp.form_changed){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect'), '', $('.l-stat .l-stat__col:nth-of-type(7) a').attr('href'));
+ } else {
+ location.href=$('.l-stat .l-stat__col:nth-of-type(7) a').attr('href');
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("h", function(){
+ $('.shortcuts').toggle();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("Esc", function(){
+ $('.shortcuts').hide();
+ $('input, checkbox, textarea, select').blur();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': false,
+ 'target': document
+ }
+ );
+
+ shortcut.add("Left", function(){
+ VE.navigation.move_focus_left();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("Right", function(){
+ VE.navigation.move_focus_right();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+
+
+ shortcut.add("down", function(){
+ VE.navigation.move_focus_down();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("up", function(){
+ VE.navigation.move_focus_up();
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("l", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-l');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("s", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-s');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("w", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-w');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("d", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-d');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("r", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-r');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("n", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-n');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("u", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-u');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+
+ shortcut.add("Delete", function(){
+ var elm = $('.units.active .l-unit.focus .shortcut-delete');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+ shortcut.add("Enter", function(){
+ if(VE.tmp.form_changed){
+ if(!$('.ui-dialog').is(':visible')){
+ VE.helpers.createConfirmationDialog($('.confirmation-text-redirect')[0], '', $(VE.navigation.state.menu_selector + '.focus a').attr('href'));
+ } else { // if dialog is opened - submitting confirm box by "enter" shortcut
+ $('.ui-dialog button.submit').click();
+ }
+ } else {
+ if(!$('.ui-dialog').is(':visible')){
+ var elm = $('.units.active .l-unit.focus .shortcut-enter');
+ if(elm.length){
+ VE.navigation.shortcut(elm);
+ } else {
+ VE.navigation.enter_focused();
+ }
+ } else { // if dialog is opened - submitting confirm box by "enter" shortcut
+ $('.ui-dialog button.submit').click();
+ }
+ }
+ }, {
+ 'type': 'keydown',
+ 'propagate': false,
+ 'disable_in_input': true,
+ 'target': document
+ }
+ );
+
+
+
+ $('.shortcuts .close').click(function(){
+ $('.shortcuts').hide();
+ });
+
+ $('.to-shortcuts').click(function(){
+ $('.shortcuts').toggle();
+ });
+
+ $(document).click(function(evt){
+ //close notification popup
+ if(!$(evt.target).hasClass('l-profile__notifications') && $(evt.target).parents('ul.notification-container').length == 0){
+ $('.notification-container').hide();
+ $('.l-profile__notifications').removeClass('active');
+ }
+ });
+
+
+ // focusing on the first input at form
+ if( location.href.indexOf('lead=') == -1 && !$('.ui-dialog').is(':visible') ){
+ $('#vstobjects .vst-input:not([disabled]), #vstobjects .vst-list:not([disabled])').first().focus();
+ }
+
+ $('.l-profile__notifications').click(function(){
+ if(!$('.l-profile__notifications').hasClass('active')){
+ VE.notifications.get_list();
+ $('.l-profile__notifications').addClass('active');
+ left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
+ $('.notification-container').css({left: left+'px'});
+
+ } else {
+ $('.notification-container').hide();
+ $('.l-profile__notifications').removeClass('active');
+ }
+ });
+
+ VE.navigation.init();
+
+ VE.core.register();
+ if (location.href.search(/list/) != -1) {
+ var shift_select_ref = $('body').finderSelect({
+ children: '.l-unit',
+ 'onFinish': function(evt) {
+ var ref = $(evt.target);
+ $('.l-content').find('.l-unit .ch-toggle').attr('checked', false);
+ $('.l-content').find('.l-unit.selected .ch-toggle').attr('checked', true);
+
+
+ if ($('.l-content').find('.l-unit.selected').length == $('.l-content').find('.l-unit').length) {
+ $('.toggle-all').addClass('clicked-on');
+ }
+
+ },
+ 'toggleAllHook': function() {
+ if ($('.l-unit').length == $('.ch-toggle:checked').length) {
+ $('.l-unit.selected').removeClass('selected');
+ $('.ch-toggle').attr('checked', false);
+ $('#toggle-all').attr('checked', false);
+ }
+ else {
+ $('.ch-toggle').attr('checked', true);
+ $('#toggle-all').attr('checked', true);
+ }
+ }
+ });
+
+ $('table').on('mousedown', 'td', function(e) {
+ if (e.ctrlKey) {
+ e.preventDefault();
+ }
+ });
+ }
+
+ //
+ $('form#objects').bind('submit', function(evt) {
+ $('.l-unit.selected').find('.ch-toggle').attr('checked', true);
+ });
+ });
+
diff --git a/web/js/pages/add_cron.js b/web/js/pages/add_cron.js
new file mode 100644
index 00000000..1ee6a5b7
--- /dev/null
+++ b/web/js/pages/add_cron.js
@@ -0,0 +1,16 @@
+$(document).ready(function(){
+ $( "#tabs" ).tabs();
+ $('.context-helper').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');
+
+ return false;
+ });
+})
+
diff --git a/web/js/pages/add.db.js b/web/js/pages/add_db.js
similarity index 85%
rename from web/js/pages/add.db.js
rename to web/js/pages/add_db.js
index c0f36fc9..b2e1c999 100644
--- a/web/js/pages/add.db.js
+++ b/web/js/pages/add_db.js
@@ -68,3 +68,14 @@ App.Listeners.DB.keypress_db_databasename = function() {
// Trigger listeners
App.Listeners.DB.keypress_db_username();
App.Listeners.DB.keypress_db_databasename();
+
+randomString = function() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var randomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ randomstring += chars.substr(rnum, 1);
+ }
+ document.v_add_db.v_password.value = randomstring;
+}
diff --git a/web/js/pages/add_dns.js b/web/js/pages/add_dns.js
new file mode 100644
index 00000000..c4a0df42
--- /dev/null
+++ b/web/js/pages/add_dns.js
@@ -0,0 +1,27 @@
+$(document).ready(function(){
+ $('.add-ns-button').click(function(){
+ var n = $('input[name^=v_ns]').length;
+ if(n < 8){
+ var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
+ t.find('input').attr({value:'', name:'v_ns'+(n+1)});
+ t.find('span').show();
+ $('tr.add-ns').before(t);
+ }
+ if( n == 7 ) {
+ $('.add-ns').hide();
+ }
+ });
+
+ $('.remove-ns').click(function(){
+ $(this).parents('tr')[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();
+ })
+ $('.add-ns').show()
+ });
+
+ $('input[name^=v_ns]').each(function(i, ns){
+ i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
+ });
+});
diff --git a/web/js/pages/add.dns.record.js b/web/js/pages/add_dns_rec.js
similarity index 100%
rename from web/js/pages/add.dns.record.js
rename to web/js/pages/add_dns_rec.js
diff --git a/web/js/pages/add.mail_acc.js b/web/js/pages/add_mail_acc.js
similarity index 63%
rename from web/js/pages/add.mail_acc.js
rename to web/js/pages/add_mail_acc.js
index 19d1e192..d96d0158 100644
--- a/web/js/pages/add.mail_acc.js
+++ b/web/js/pages/add_mail_acc.js
@@ -77,3 +77,41 @@ $('form[name="v_quota"]').bind('submit', function(evt) {
});
+randomString = function() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var randomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ randomstring += chars.substr(rnum, 1);
+ }
+ document.v_add_mail_acc.v_password.value = randomstring;
+
+ if($('input[name=v_password]').attr('type') == 'text')
+ $('#v_password').text(randomstring);
+ else
+ $('#v_password').text(Array(randomstring.length+1).join('*'));
+}
+
+$(document).ready(function() {
+ $('#v_account').text($('input[name=v_account]').val());
+ $('#v_password').text($('input[name=v_password]').val());
+
+ $('input[name=v_account]').change(function(){
+ $('#v_account').text($(this).val());
+ });
+
+ $('input[name=v_password]').change(function(){
+ if($('input[name=v_password]').attr('type') == 'text')
+ $('#v_password').text($(this).val());
+ else
+ $('#v_password').text(Array($(this).val().length+1).join('*'));
+ });
+
+ $('.toggle-psw-visibility-icon').click(function(){
+ if($('input[name=v_password]').attr('type') == 'text')
+ $('#v_password').text($('input[name=v_password]').val());
+ else
+ $('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
+ });
+});
diff --git a/web/js/pages/add.package.js b/web/js/pages/add_package.js
similarity index 72%
rename from web/js/pages/add.package.js
rename to web/js/pages/add_package.js
index beb5fe4d..a0dfd67f 100644
--- a/web/js/pages/add.package.js
+++ b/web/js/pages/add_package.js
@@ -77,3 +77,30 @@ $('form[name="v_add_package"]').bind('submit', function(evt) {
});
+$(document).ready(function(){
+ $('.add-ns-button').click(function(){
+ var n = $('input[name^=v_ns]').length;
+ if(n < 8){
+ var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
+ t.find('input').attr({value:'', name:'v_ns'+(n+1)});
+ t.find('span').show();
+ $('tr.add-ns').before(t);
+ }
+ if( n == 7 ) {
+ $('.add-ns').hide();
+ }
+ });
+
+ $('.remove-ns').click(function(){
+ $(this).parents('tr')[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();
+ });
+ $('.add-ns').show();
+ });
+
+ $('input[name^=v_ns]').each(function(i, ns){
+ i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
+ });
+});
diff --git a/web/js/pages/add_user.js b/web/js/pages/add_user.js
new file mode 100644
index 00000000..510ed167
--- /dev/null
+++ b/web/js/pages/add_user.js
@@ -0,0 +1,17 @@
+$(function() {
+ $('#v_email').change(function() {
+ document.getElementById('v_notify').value = document.getElementById('v_email').value;
+ });
+});
+
+
+randomString = function() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var randomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ randomstring += chars.substr(rnum, 1);
+ }
+ document.v_add_user.v_password.value = randomstring;
+}
diff --git a/web/js/pages/add.web.js b/web/js/pages/add_web.js
similarity index 81%
rename from web/js/pages/add.web.js
rename to web/js/pages/add_web.js
index 7a01f746..084540f0 100644
--- a/web/js/pages/add.web.js
+++ b/web/js/pages/add_web.js
@@ -156,3 +156,39 @@ App.Actions.WEB.toggle_additional_ftp_accounts = function(elm) {
App.Listeners.WEB.keypress_ftp_username();
App.Listeners.WEB.keypress_ftp_path();
App.Listeners.WEB.keypress_domain_name();
+
+
+$(function() {
+ $('#v_domain').change(function() {
+ var prefix = 'www.';
+ document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
+ });
+});
+
+function WEBrandom() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var webrandom = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ webrandom += chars.substr(rnum, 1);
+ }
+ document.v_add_web.v_stats_password.value = webrandom;
+}
+
+function FTPrandom(elm) {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var ftprandomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ ftprandomstring += chars.substr(rnum, 1);
+ }
+ $(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
+}
+
+$('#vstobjects').bind('submit', function(evt) {
+ $('input[disabled]').each(function(i, elm) {
+ $(elm).removeAttr('disabled');
+ });
+});
diff --git a/web/js/pages/edit_cron.js b/web/js/pages/edit_cron.js
new file mode 100644
index 00000000..1ee6a5b7
--- /dev/null
+++ b/web/js/pages/edit_cron.js
@@ -0,0 +1,16 @@
+$(document).ready(function(){
+ $( "#tabs" ).tabs();
+ $('.context-helper').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');
+
+ return false;
+ });
+})
+
diff --git a/web/js/pages/edit.db.js b/web/js/pages/edit_db.js
similarity index 85%
rename from web/js/pages/edit.db.js
rename to web/js/pages/edit_db.js
index c0f36fc9..8f30c278 100644
--- a/web/js/pages/edit.db.js
+++ b/web/js/pages/edit_db.js
@@ -68,3 +68,15 @@ App.Listeners.DB.keypress_db_databasename = function() {
// Trigger listeners
App.Listeners.DB.keypress_db_username();
App.Listeners.DB.keypress_db_databasename();
+
+randomString = function() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var randomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ randomstring += chars.substr(rnum, 1);
+ }
+ document.v_edit_db.v_password.value = randomstring;
+}
+
\ No newline at end of file
diff --git a/web/js/pages/edit.mail_acc.js b/web/js/pages/edit_mail_acc.js
similarity index 65%
rename from web/js/pages/edit.mail_acc.js
rename to web/js/pages/edit_mail_acc.js
index 19d1e192..43220c71 100644
--- a/web/js/pages/edit.mail_acc.js
+++ b/web/js/pages/edit_mail_acc.js
@@ -77,3 +77,36 @@ $('form[name="v_quota"]').bind('submit', function(evt) {
});
+randomString = function() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var randomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ randomstring += chars.substr(rnum, 1);
+ }
+ document.v_edit_mail_acc.v_password.value = randomstring;
+}
+
+$(document).ready(function() {
+ $('#v_account').text($('input[name=v_account]').val());
+ $('#v_password').text($('input[name=v_password]').val());
+
+ $('input[name=v_account]').change(function(){
+ $('#v_account').text($(this).val());
+ });
+
+ $('input[name=v_password]').change(function(){
+ if($('input[name=v_password]').attr('type') == 'text')
+ $('#v_password').text($(this).val());
+ else
+ $('#v_password').text(Array($(this).val().length+1).join('*'));
+ });
+
+ $('.toggle-psw-visibility-icon').click(function(){
+ if($('input[name=v_password]').attr('type') == 'text')
+ $('#v_password').text($('input[name=v_password]').val());
+ else
+ $('#v_password').text(Array($('input[name=v_password]').val().length+1).join('*'));
+ });
+});
diff --git a/web/js/pages/edit.package.js b/web/js/pages/edit_package.js
similarity index 72%
rename from web/js/pages/edit.package.js
rename to web/js/pages/edit_package.js
index 301a9182..b38cf0d9 100644
--- a/web/js/pages/edit.package.js
+++ b/web/js/pages/edit_package.js
@@ -77,3 +77,30 @@ $('form[name="v_edit_package"]').bind('submit', function(evt) {
});
+$(document).ready(function(){
+ $('.add-ns-button').click(function(){
+ var n = $('input[name^=v_ns]').length;
+ if(n < 8){
+ var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
+ t.find('input').attr({value:'', name:'v_ns'+(n+1)});
+ t.find('span').show();
+ $('tr.add-ns').before(t);
+ }
+ if( n == 7 ) {
+ $('.add-ns').hide();
+ }
+ });
+
+ $('.remove-ns').click(function(){
+ $(this).parents('tr')[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();
+ });
+ $('.add-ns').show();
+ });
+
+ $('input[name^=v_ns]').each(function(i, ns){
+ i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
+ });
+});
\ No newline at end of file
diff --git a/web/js/pages/edit_server.js b/web/js/pages/edit_server.js
new file mode 100644
index 00000000..205c1fd4
--- /dev/null
+++ b/web/js/pages/edit_server.js
@@ -0,0 +1,17 @@
+$(document).ready(function(){
+ $('select[name=v_filemanager]').change(function(){
+ if($(this).val() == 'yes'){
+ $('.filemanager.description').show();
+ } else {
+ $('.filemanager.description').hide();
+ }
+ });
+
+ $('select[name=v_sftp]').change(function(){
+ if($(this).val() == 'yes'){
+ $('.sftp.description').show();
+ } else {
+ $('.sftp.description').hide();
+ }
+ });
+});
diff --git a/web/js/pages/edit_user.js b/web/js/pages/edit_user.js
new file mode 100644
index 00000000..439aeab0
--- /dev/null
+++ b/web/js/pages/edit_user.js
@@ -0,0 +1,39 @@
+function randomString() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var randomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ randomstring += chars.substr(rnum, 1);
+ }
+ document.v_edit_user.v_password.value = randomstring;
+}
+
+$(document).ready(function(){
+ $('.add-ns-button').click(function(){
+ var n = $('input[name^=v_ns]').length;
+ if(n < 8){
+ var t = $($('input[name=v_ns1]').parents('tr')[0]).clone(true, true);
+ t.find('input').attr({value:'', name:'v_ns'+(n+1)});
+ t.find('span').show();
+ $('tr.add-ns').before(t);
+ }
+ if( n == 7 ) {
+ $('.add-ns').hide();
+ }
+ });
+
+ $('.remove-ns').click(function(){
+ $(this).parents('tr')[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();
+ });
+ $('.add-ns').show();
+ });
+
+ $('input[name^=v_ns]').each(function(i, ns){
+ i < 2 ? $(ns).parent().find('span').hide() : $(ns).parent().find('span').show();
+ });
+
+});
\ No newline at end of file
diff --git a/web/js/pages/edit.web.js b/web/js/pages/edit_web.js
similarity index 79%
rename from web/js/pages/edit.web.js
rename to web/js/pages/edit_web.js
index 1406d9d0..3c41f938 100644
--- a/web/js/pages/edit.web.js
+++ b/web/js/pages/edit_web.js
@@ -163,3 +163,42 @@ $('.v-ftp-user-psw').on('keypress', function(evt) {
var elm = $(evt.target);
App.Actions.WEB.passwordChanged(elm);
});
+
+
+function WEBrandom() {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var webrandom = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ webrandom += chars.substr(rnum, 1);
+ }
+ document.v_edit_web.v_stats_password.value = webrandom;
+}
+
+function FTPrandom(elm) {
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
+ var string_length = 10;
+ var ftprandomstring = '';
+ for (var i = 0; i < string_length; i++) {
+ var rnum = Math.floor(Math.random() * chars.length);
+ ftprandomstring += chars.substr(rnum, 1);
+ }
+
+ $(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
+ App.Actions.WEB.randomPasswordGenerated && App.Actions.WEB.randomPasswordGenerated(elm);
+}
+
+function elementHideShow(elementToHideOrShow){
+ var el = document.getElementById(elementToHideOrShow);
+ el.style.display = el.style.display === 'none' ? 'block' : 'none';
+}
+
+$('#vstobjects').bind('submit', function(evt) {
+ $('input[disabled]').each(function(i, elm) {
+ var copy_elm = $(elm).clone(true);
+ $(copy_elm).attr('type', 'hidden');
+ $(copy_elm).removeAttr('disabled');
+ $(elm).after(copy_elm);
+ });
+});
diff --git a/web/phpinfo.php b/web/phpinfo.php
deleted file mode 100644
index e974c40d..00000000
--- a/web/phpinfo.php
+++ /dev/null
@@ -1 +0,0 @@
-
$value) {
- echo "\n\t\t\t\t\t\t\t\t\t\t".htmlentities($key)." ";
+ foreach ($db_hosts as $value) {
+ echo "\n\t\t\t\t\t\t\t\t\t\t".htmlentities($value)." ";
}
?>
@@ -187,25 +187,7 @@
-
-
diff --git a/web/templates/admin/add_dns.html b/web/templates/admin/add_dns.html
index 10285e23..aeff5432 100644
--- a/web/templates/admin/add_dns.html
+++ b/web/templates/admin/add_dns.html
@@ -177,41 +177,4 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/add_dns_rec.html b/web/templates/admin/add_dns_rec.html
index ddee3a00..0ebc0552 100644
--- a/web/templates/admin/add_dns_rec.html
+++ b/web/templates/admin/add_dns_rec.html
@@ -120,8 +120,6 @@
-
-
diff --git a/web/templates/admin/add_firewall.html b/web/templates/admin/add_firewall.html
index 710ae297..d1b81f58 100644
--- a/web/templates/admin/add_firewall.html
+++ b/web/templates/admin/add_firewall.html
@@ -48,8 +48,8 @@
- >
- >
+ >=__('DROP')?>
+ >=__('ACCEPT')?>
@@ -61,9 +61,9 @@
- >
- >
- >
+ >=__('TCP')?>
+ >=__('UDP')?>
+ >=__('ICMP')?>
@@ -116,12 +116,4 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/add_firewall_banlist.html b/web/templates/admin/add_firewall_banlist.html
index ed06693e..e244cabd 100644
--- a/web/templates/admin/add_firewall_banlist.html
+++ b/web/templates/admin/add_firewall_banlist.html
@@ -48,19 +48,19 @@
- >
- >
- >
- >
- >
- >
- >
+ >=__('SSH')?>
+ >=__('WEB')?>
+ >=__('FTP')?>
+ >=__('DNS')?>
+ >=__('MAIL')?>
+ >=__('DB')?>
+ >=__('VESTA')?>
- ()
+ =__('IP address')?> (=__('CIDR format is supported')?>)
@@ -84,11 +84,3 @@
-
-
-
diff --git a/web/templates/admin/add_ip.html b/web/templates/admin/add_ip.html
index 4c3b0be0..a62eebbd 100644
--- a/web/templates/admin/add_ip.html
+++ b/web/templates/admin/add_ip.html
@@ -144,12 +144,4 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/add_mail_acc.html b/web/templates/admin/add_mail_acc.html
index 08aaf74d..70f2d5bc 100644
--- a/web/templates/admin/add_mail_acc.html
+++ b/web/templates/admin/add_mail_acc.html
@@ -133,44 +133,44 @@
- Username:
+ =__('Username')?>:
william.cage @=htmlentities($v_domain)?>
- Password:
+ =__('Password')?>:
******
- IMAP hostname:
+ =__('IMAP hostname')?>:
=htmlentities($v_domain)?>
- IMAP port:
+ =__('IMAP port')?>:
143
- IMAP security:
- STARTTLS
+ =__('IMAP security')?>:
+ =__('STARTTLS')?>
- IMAP auth method:
- Normal password
+ =__('IMAP auth method')?>:
+ =__('Normal password')?>
- SMTP hostname
+ =__('SMTP hostname')?>
=htmlentities($v_domain)?>
- SMTP port:
+ =__('SMTP port')?>:
587
- SMTP security:
- STARTTLS
+ =__('SMTP security')?>:
+ =__('STARTTLS')?>
- SMTP auth method:
- Normal password
+ =__('SMTP auth method')?>:
+ =__('Normal password')?>
@@ -179,52 +179,4 @@
-
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/add_package.html b/web/templates/admin/add_package.html
index 72b9bfd1..e4e36a3a 100644
--- a/web/templates/admin/add_package.html
+++ b/web/templates/admin/add_package.html
@@ -92,7 +92,7 @@
if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
echo 'selected' ;
}
- echo ">".$value."\n";
+ echo ">".htmlentities($value)."\n";
}
?>
@@ -300,20 +300,20 @@
>
- delete
+ =__('delete')?>
>
- delete
+ =__('delete')?>
if($v_ns3)
echo '
- delete
+ '.__('delete').'
';
@@ -321,7 +321,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -329,7 +329,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -337,7 +337,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -345,7 +345,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -353,13 +353,13 @@
echo '
- delete
+ '.__('delete').'
';
?>
>
- Add one more Name Server
+ =__('Add one more Name Server')?>
@@ -377,36 +377,4 @@
-
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/add_user.html b/web/templates/admin/add_user.html
index aafdf253..e469a4dc 100644
--- a/web/templates/admin/add_user.html
+++ b/web/templates/admin/add_user.html
@@ -169,23 +169,3 @@
-
-
-
diff --git a/web/templates/admin/add_web.html b/web/templates/admin/add_web.html
index 5b9ecf47..b5549b01 100644
--- a/web/templates/admin/add_web.html
+++ b/web/templates/admin/add_web.html
@@ -113,7 +113,7 @@
-
+
@@ -389,49 +389,7 @@
-
-
diff --git a/web/templates/admin/edit_cron.html b/web/templates/admin/edit_cron.html
index 91baee27..ef54e9df 100644
--- a/web/templates/admin/edit_cron.html
+++ b/web/templates/admin/edit_cron.html
@@ -442,4 +442,4 @@
-
+
\ No newline at end of file
diff --git a/web/templates/admin/edit_db.html b/web/templates/admin/edit_db.html
index 1b27ab38..7f72444e 100644
--- a/web/templates/admin/edit_db.html
+++ b/web/templates/admin/edit_db.html
@@ -125,25 +125,7 @@
-
-
diff --git a/web/templates/admin/edit_firewall.html b/web/templates/admin/edit_firewall.html
index 1b6bf359..79938265 100644
--- a/web/templates/admin/edit_firewall.html
+++ b/web/templates/admin/edit_firewall.html
@@ -54,8 +54,8 @@
- >
- >
+ >=__('DROP')?>
+ >=__('ACCEPT')?>
@@ -67,9 +67,9 @@
- >
- >
- >
+ >=__('TCP')?>
+ >=__('UDP')?>
+ >=__('ICMP')?>
@@ -119,11 +119,3 @@
-
-
-
diff --git a/web/templates/admin/edit_ip.html b/web/templates/admin/edit_ip.html
index 811457b3..c9ea2c72 100644
--- a/web/templates/admin/edit_ip.html
+++ b/web/templates/admin/edit_ip.html
@@ -142,11 +142,3 @@
-
-
-
diff --git a/web/templates/admin/edit_mail_acc.html b/web/templates/admin/edit_mail_acc.html
index 52b66d7b..b3746db5 100644
--- a/web/templates/admin/edit_mail_acc.html
+++ b/web/templates/admin/edit_mail_acc.html
@@ -41,7 +41,7 @@
=$v_time?>
-
+ =__($v_status)?>
@@ -140,24 +140,4 @@
-
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/edit_package.html b/web/templates/admin/edit_package.html
index 8db16864..81a85651 100644
--- a/web/templates/admin/edit_package.html
+++ b/web/templates/admin/edit_package.html
@@ -35,7 +35,7 @@
=$v_time?>
-
+ =__($v_status)?>
@@ -92,7 +92,7 @@
if ((!empty($v_backend_template)) && ( $value == $_POST['v_backend_template'])){
echo ' selected' ;
}
- echo ">".$value."\n";
+ echo ">".htmlentities($value)."\n";
}
?>
@@ -298,13 +298,13 @@
>
- delete
+ =__('delete')?>
>
- delete
+ =__('delete')?>
@@ -312,7 +312,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -320,7 +320,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -328,7 +328,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -336,7 +336,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -344,7 +344,7 @@
echo '
- delete
+ '.__('delete').'
';
@@ -352,14 +352,14 @@
echo '
- delete
+ '.__('delete').'
';
?>
>
- Add one more Name Server
+ =__('Add one more Name Server')?>
@@ -378,37 +378,4 @@
-
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/edit_server.html b/web/templates/admin/edit_server.html
index 5272750c..b2187218 100644
--- a/web/templates/admin/edit_server.html
+++ b/web/templates/admin/edit_server.html
@@ -325,7 +325,7 @@
$value) {
+ foreach ($v_mysql_hosts as $value) {
$i++;
?>
@@ -335,7 +335,7 @@
-
+
@@ -405,7 +405,7 @@
$value) {
+ foreach ($v_pgsql_hosts as $value) {
$i++;
?>
@@ -415,7 +415,7 @@
-
+
@@ -766,30 +766,4 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/edit_user.html b/web/templates/admin/edit_user.html
index aa017d41..8009d5b0 100644
--- a/web/templates/admin/edit_user.html
+++ b/web/templates/admin/edit_user.html
@@ -250,47 +250,4 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/web/templates/admin/edit_web.html b/web/templates/admin/edit_web.html
index f8593186..afa34174 100644
--- a/web/templates/admin/edit_web.html
+++ b/web/templates/admin/edit_web.html
@@ -129,7 +129,7 @@
if ((empty($v_backend_template)) && ($value == 'default')){
echo ' selected' ;
}
- echo ">".$value."\n";
+ echo ">".htmlentities($value)."\n";
}
?>
@@ -450,47 +450,6 @@
-
-
-
diff --git a/web/templates/admin/list_backup_detail.html b/web/templates/admin/list_backup_detail.html
index cabcec76..abdb28d0 100644
--- a/web/templates/admin/list_backup_detail.html
+++ b/web/templates/admin/list_backup_detail.html
@@ -389,7 +389,7 @@
?>
diff --git a/web/templates/admin/list_backup_exclusions.html b/web/templates/admin/list_backup_exclusions.html
index 2593510f..28d07574 100644
--- a/web/templates/admin/list_backup_exclusions.html
+++ b/web/templates/admin/list_backup_exclusions.html
@@ -107,7 +107,7 @@
diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html
index 00b7be54..f43cad2a 100644
--- a/web/templates/admin/list_dns_rec.html
+++ b/web/templates/admin/list_dns_rec.html
@@ -135,7 +135,7 @@ v_unit_id="=$key?>" v_section="dns_rec">
?>
diff --git a/web/templates/admin/list_firewall.html b/web/templates/admin/list_firewall.html
index ab24069a..8f00ed11 100644
--- a/web/templates/admin/list_firewall.html
+++ b/web/templates/admin/list_firewall.html
@@ -117,11 +117,11 @@ sort-ip="=str_replace('.', '', $data[$key]['IP'])?>" sort-comment="=$data[$k
-
=$data[$key]['ACTION'] ?>
-
=$data[$key]['PROTOCOL']?>
+
=__($data[$key]['ACTION'])?>
+
=__($data[$key]['PROTOCOL'])?>
if(!empty($data[$key]['COMMENT'])) echo '/ ' . $data[$key]['COMMENT']; else echo " "; ?>
-
=$data[$key]['PORT'] ?>
-
=$data[$key]['IP'] ?>
+
=$data[$key]['PORT']?>
+
=$data[$key]['IP']?>
diff --git a/web/templates/admin/list_firewall_banlist.html b/web/templates/admin/list_firewall_banlist.html
index 40193198..cac651a1 100644
--- a/web/templates/admin/list_firewall_banlist.html
+++ b/web/templates/admin/list_firewall_banlist.html
@@ -79,7 +79,7 @@
=$data[$key]['DATE']?> =$data[$key]['TIME']?>
-
=$value['CHAIN']?>
+
=__($value['CHAIN'])?>
=$ip?>
@@ -114,7 +114,7 @@
?>
diff --git a/web/templates/admin/list_ip.html b/web/templates/admin/list_ip.html
index 1875f7bb..3d4c78fc 100644
--- a/web/templates/admin/list_ip.html
+++ b/web/templates/admin/list_ip.html
@@ -58,8 +58,8 @@
" sort-interface="=__($data[$key]['INTERFACE'])?>" sort-domains="=$data[$key]['U_WEB_DOMAINS']?>"
-sort-owner="=__($data[$key]['OWNER'])?>" sort-star=" if($_SESSION['favourites']['IP'][$key] == 1) echo '1'; else echo '0'; ?>">
+sort-netmask="=str_replace('.', '', $data[$key]['NETMASK'])?>" sort-interface="=$data[$key]['INTERFACE']?>" sort-domains="=$data[$key]['U_WEB_DOMAINS']?>"
+sort-owner="=$data[$key]['OWNER']?>" sort-star=" if($_SESSION['favourites']['IP'][$key] == 1) echo '1'; else echo '0'; ?>">
diff --git a/web/templates/admin/list_packages.html b/web/templates/admin/list_packages.html
index 1812bd84..8980b3c8 100644
--- a/web/templates/admin/list_packages.html
+++ b/web/templates/admin/list_packages.html
@@ -106,7 +106,7 @@ sort-star="
=__('Web Template')?>:
- =__($data[$key]['WEB_TEMPLATE'])?>
+ =$data[$key]['WEB_TEMPLATE']?>
@@ -122,7 +122,7 @@ sort-star="
=__('Backups')?>:
- =__($data[$key]['BACKUPS'])?>
+ =$data[$key]['BACKUPS']?>
@@ -134,7 +134,7 @@ sort-star="
=__('Proxy Template')?>:
- =__($data[$key]['PROXY_TEMPLATE'])?>
+ =$data[$key]['PROXY_TEMPLATE']?>
} ?>
@@ -151,7 +151,12 @@ sort-star="
=__('Bandwidth')?>:
+
+ =__($data[$key]['BANDWIDTH'])?>
+
=humanize_usage_size($data[$key]['BANDWIDTH'])?> =humanize_usage_measure($data[$key]['BANDWIDTH'])?>
+
+
@@ -162,7 +167,7 @@ sort-star="
=__('DNS Template')?>:
- =__($data[$key]['DNS_TEMPLATE'])?>
+ =$data[$key]['DNS_TEMPLATE']?>
@@ -178,7 +183,12 @@ sort-star="
=__('Disk')?>:
+
+ =__($data[$key]['DISK_QUOTA'])?>
+
=humanize_usage_size($data[$key]['DISK_QUOTA'])?> =humanize_usage_measure($data[$key]['DISK_QUOTA'])?>
+
+
@@ -189,7 +199,7 @@ sort-star="
=__('SSH Access')?>:
- =__($data[$key]['SHELL'])?>
+ =$data[$key]['SHELL']?>
diff --git a/web/templates/admin/list_search.html b/web/templates/admin/list_search.html
index 6aa243e9..a9e28944 100644
--- a/web/templates/admin/list_search.html
+++ b/web/templates/admin/list_search.html
@@ -36,28 +36,28 @@
foreach ($data as $key => $value) {
++$i;
- if ($data[$key]['SUSPENDED'] == 'yes') {
+ if ($value['SUSPENDED'] == 'yes') {
$status = 'suspended';
- $spnd_action = 'unsuspend' ;
+ $spnd_action = 'unsuspend';
} else {
$status = 'active';
$spnd_action = 'suspend';
}
- if ($data[$key]['TYPE'] == 'db') {
+ if ($value['TYPE'] == 'db') {
$object = 'database';
} else {
- $object = strtolower($data[$key]['TYPE']." ".$data[$key]['KEY']);
+ $object = strtolower($value['TYPE'] . ' ' . $value['KEY']);
}
- $uniq_id = $data[$key]['TYPE'].'-';
- if($data[$key]['KEY'] == 'ACCOUNT'){
+ $uniq_id = $value['TYPE'] . '-';
+ if ($value['KEY'] == 'ACCOUNT'){
$uniq_id .= 'acc-';
}
- $uniq_id .= sha1($data[$key]['RESULT']);
+ $uniq_id .= sha1($value['RESULT']);
?>
-
+
-
-
diff --git a/web/templates/user/list_dns_rec.html b/web/templates/user/list_dns_rec.html
index 71b15abd..ec3f2936 100644
--- a/web/templates/user/list_dns_rec.html
+++ b/web/templates/user/list_dns_rec.html
@@ -132,7 +132,7 @@
?>
diff --git a/web/templates/user/list_mail_acc.html b/web/templates/user/list_mail_acc.html
index a7ff6e7a..f7678779 100644
--- a/web/templates/user/list_mail_acc.html
+++ b/web/templates/user/list_mail_acc.html
@@ -200,7 +200,7 @@ sort-star=" if($_SESSION['favourites']['MAIL_ACC'][$key."@".$_GET['domain']] =
?>
diff --git a/web/templates/user/list_search.html b/web/templates/user/list_search.html
index 889cd094..d8c677fe 100644
--- a/web/templates/user/list_search.html
+++ b/web/templates/user/list_search.html
@@ -36,27 +36,27 @@
foreach ($data as $key => $value) {
++$i;
- if ($data[$key]['SUSPENDED'] == 'yes') {
+ if ($value['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'unsuspend' ;
} else {
$status = 'active';
$spnd_action = 'suspend';
}
- if ($data[$key]['TYPE'] == 'db') {
+ if ($value['TYPE'] == 'db') {
$object = 'database';
} else {
- $object = strtolower($data[$key]['TYPE']." ".$data[$key]['KEY']);
+ $object = strtolower($value['TYPE']." ".$value['KEY']);
}
- $uniq_id = $data[$key]['TYPE'].'-';
- if($data[$key]['KEY'] == 'ACCOUNT'){
+ $uniq_id = $value['TYPE'].'-';
+ if($value['KEY'] == 'ACCOUNT'){
$uniq_id .= 'acc-';
}
- $uniq_id .= sha1($data[$key]['RESULT']);
+ $uniq_id .= sha1($value['RESULT']);
?>
-