/********************************************* FORM CHECKER OBJECT CREAT *********************************************/ /*** COMMON ***/ /*** isNotEnterKey() {{{ ***/ function isNotEnterKey(event) { if (navigator.appName.indexOf("Microsoft") != -1) event = window.event; if (event.keyCode==13) { //alert('enter!'); return false; } else { return true; } } /*** }}} ***/ function changeLanguage(lang) {//{{{ // set cookie $.cookie('language', lang, {expires: 365, domain:'dnsever.com', path:'/'}); langPage = lang; if (lang == 'en') { langPage = 'www'; } return langPage; }//}}} function selectLanguage(lang, parameter) {//{{{ var langPage = changeLanguage(lang); // redirect url = "http://%s.dnsever.com"; url = url.replace('%s', langPage); if (parameter) { url += parameter; } document.location.href = url; }//}}} /*** selectDomain() {{{ ***/ /********************************************* * when changed domain select box , set 'viewzone' to selected_menu *********************************************/ function selectDomain() { setSelectedMenu('viewzone'); var thisForm = document.form; var skey = thisForm.skey.value; var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; goURL = "/start.html?user_domain=" + userDomain + "&selected_menu=viewzone&dig_again=1" + "&skey=" + skey; document.location.href = goURL; return; } /*** }}} ***/ /*** selectDomainInList() {{{ ***/ /********************************************* * check body/show_domain_list.html *********************************************/ function selectDomainInList(domain) { setSelectedMenu('viewzone'); var thisForm = document.form; var skey = thisForm.skey.value; goURL = "/start.html?user_domain=" + domain + "&selected_menu=viewzone&dig_again=1" + "&skey=" + skey; document.location.href = goURL; return; } /*** }}} ***/ /*** setSelectedMenu() {{{ ***/ /********************************************* * set menuStr to selected_menu * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function setSelectedMenu(menuStr) { document.form.selected_menu.value = menuStr; } /*** }}} ***/ /*** goMenu() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function goMenu(selectedMenu) { var thisForm = document.form; var skey = thisForm.skey.value; var lang = thisForm.lang.value; if (thisForm.user_domain) { var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; } else { var userDomain = ''; } if (selectedMenu == 'addzone' || selectedMenu == 'addptrzone' || selectedMenu == 'addsubzone' || selectedMenu == 'home' || selectedMenu == 'showdomainlist') userDomain = ''; goURL = "/start.html?user_domain=" + userDomain + "&selected_menu=" + selectedMenu + "&skey=" + skey; document.location.href = goURL; return; //return true; } /*** }}} ***/ /*** goMenuWithZone() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function goMenuWithZone(selectedMenu, zone) { var thisForm = document.form; var skey = thisForm.skey.value; var lang = thisForm.lang.value; goURL = "/start.html?user_domain=" + zone + "&selected_menu=" + selectedMenu + "&skey=" + skey; document.location.href = goURL; return true; } /*** }}} ***/ /*** goMenuWithArgument() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function goMenuWithArgument(selectedMenu, subArgument) { var thisForm = document.form; var skey = thisForm.skey.value; var lang = thisForm.lang.value; if (thisForm.user_domain) { var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; } else { var userDomain = ''; } goURL = "/start.html?user_domain=" + userDomain + "&selected_menu=" + selectedMenu + "&skey=" + skey + subArgument; document.location.href = goURL; return true; } /*** }}} ***/ /*** goRegister() {{{ ***/ /********************************************* * go menu *********************************************/ function goRegister() { var thisForm = document.form; for (var i=0; i < thisForm.pref_language.length; i++) { if (thisForm.pref_language[i].checked) { var lang = thisForm.pref_language[i].value; } } if (lang == null || lang == "") { alert(LANG['EmptyLanguage']); return false; } var langPage = changeLanguage(lang); url = "http://%s.dnsever.com/index.html?selected_menu=registeragree"; url = url.replace('%s', langPage); document.location.href = url; } /*** }}} ***/ /*** goLoginPage() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function goLoginPage() { // clear cookie $.cookie('PHPSESSID', null, {domain:'dnsever.com', path:'/'}); goURL = "/index.html"; document.location.href = goURL; return; } /*** }}} ***/ /*** goIndexMenu() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function goIndexMenu(selectedMenu) { var thisForm = document.form; var lang = thisForm.lang.value; goURL = "/index.html?selected_menu=" + selectedMenu; document.location.href = goURL; return; } /*** }}} ***/ /*** goIndexMenuWithArgument() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx * @param string subArgument ex) &name=micheol&id=xman , must need & *********************************************/ function goIndexMenuWithArgument(selectedMenu, subArgument) { var thisForm = document.form; var lang = thisForm.lang.value; goURL = "/index.html?selected_menu=" + selectedMenu + subArgument; document.location.href = goURL; return; } /*** }}} ***/ /*** goMyInfoMenu() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function goMyInfoMenu(selectedMenu) { var thisForm = document.form; var skey = thisForm.skey.value; var lang = thisForm.lang.value; goURL = "/myinfo.html?selected_menu=" + selectedMenu + "&skey=" + skey; document.location.href = goURL; return; } /*** }}} ***/ /*** goCommonMenu() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ function goCommonMenu(selectedMenu) { var thisForm = document.form; var skey = thisForm.skey.value; var lang = thisForm.lang.value; if (thisForm.user_domain) { var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; } else { var userDomain = ''; } if (selectedMenu == 'addzone' || selectedMenu == 'addptrzone' || selectedMenu == 'addsubzone' || selectedMenu == 'home') userDomain = ''; if ( document.form.action.match('myinfo.html$') == 'myinfo.html' || document.form.action.match('partner/egloos') == 'partner/egloos' ) { document.form.action = '/index.html'; } goURL = document.form.action + "?user_domain=" + userDomain + "&selected_menu=" + selectedMenu + "&skey=" + skey; document.location.href = goURL; return; //return true; } /*** }}} ***/ /*** setCommand() {{{ ***/ /********************************************* @param string command ex)change_a, add_a, delete_a *********************************************/ function setCommand(command) { var thisForm = document.form; if (command == null) { return false; } thisForm.command.value = command; return true; } /*** }}} ***/ /*** isSelectedCheckBox() {{{ ***/ function isSelectedCheckBox(checkBoxName) { var checkBox = document.form.elements[checkBoxName]; var length = checkBox.length; var checkNumber = 0; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) checkNumber++; } if (checkNumber == 0) return false; else return true; } /*** }}} ***/ /*** isSelectedRadioButton() {{{ ***/ function isSelectedRadioButton(radioButtonName) { radioButton = document.form.elements[radioButtonName]; var length = radioButton.length; if (!length) { return radioButton.checked; } else { for (var i = 0; i < length; i++) { if(radioButton[i].checked == true) { return true; } } } return false; } /*** }}} ***/ /*** openHelpWindow() {{{ ***/ /********************************************* * open help window * *********************************************/ var helpWindow = null; function openHelpWindow(pageURL) { var windowWidth = 900; var windowHeight = 600; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (helpWindow != null) { helpWindow.close(); } helpWindow = window.open(pageURL, "dnseverhelp", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=yes"); helpWindow.focus(); } /*** }}} ***/ /*** openBoardWindow() {{{ ***/ /********************************************* * open help window * *********************************************/ var boardWindow = null; function openBoardWindow(pageURL) { var windowWidth = 650; var windowHeight = 550; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (boardWindow != null) { boardWindow.close(); } boardWindow = window.open(pageURL, "dnseverboard", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=yes"); boardWindow.focus(); } /*** }}} ***/ /*** openConfirmWindow() {{{ ***/ /********************************************* * open confirm window * *********************************************/ var confirmWindow = null; function openConfirmWindow(thisForm) { var windowWidth = 570; var windowHeight = 430; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (confirmWindow != null) { confirmWindow.close(); } var command = document.form.command.value; confirmWindow = window.open("/confirm.html?command="+command, "confirmWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=no, status=no, scrollbars=yes"); confirmWindow.focus(); } /*** }}} ***/ /*** openConfirmWindow_old() XXX {{{ ***/ /********************************************* * open confirm window * *********************************************/ var confirmWindow = null; function openConfirmWindow_old() { var windowWidth = 500; var windowHeight = 350; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (confirmWindow != null) { confirmWindow.close(); } confirmWindow = window.open("/confirm.html", "confirmWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=no, status=no, scrollbars=yes"); confirmWindow.focus(); } /*** }}} ***/ /*** openCheckSubDomainWindow() {{{ ***/ /********************************************* * open confirm window * *********************************************/ var checkSubDomain = null; function openCheckSubDomain(command) { var thisForm = document.form; result = eval('check_'+command+'_form(thisForm)'); if (result == false) return false; //SET COMMAND setCommand(command); var windowWidth = 400; var windowHeight = 300; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (checkSubDomain != null) { checkSubDomain.close(); } //var command = document.form.command.value; var userID = document.form.user_id.value; var subDomain = document.form.new_sub_domain.value; var zone = document.form.zone.value; checkSubDomain = window.open("/check_sub_domain.html?command="+command+"&user_id="+userID +"&new_sub_domain="+subDomain+"&zone="+zone, "checkSubDomain", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=no"); checkSubDomain.focus(); } /*** }}} ***/ /*** openIDTestWindow() {{{ ***/ /********************************************* * open IDTest window * *********************************************/ var IDTestWindow = null; function openIDTestWindow() { var thisForm = document.form; var newID = thisForm.user_id.value; var windowWidth = 300; var windowHeight = 200; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (IDTestWindow != null) { IDTestWindow.close(); } /*** Form Checking ID ***/ var formChecker = new FormChecker(); var res; res = formChecker.isEmpty(newID); if (res == true) { alert(LANG['EmptyID']); thisForm.user_id.focus(); return false; } IDTestWindow = window.open("/id_test.html?id=" + newID, "IDTestWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=no, status=no, scrollbars=no"); IDTestWindow.focus(); } /*** }}} ***/ /*** openPunycodeWindow() {{{ ***/ /********************************************* * open punycode window * *********************************************/ var punycodeWindow = null; function openPunycodeWindow() { var thisForm = document.form; //var newZone = thisForm.new_zone.value; //var newID = thisForm.user_id.value; var windowWidth = 300; var windowHeight = 200; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (punycodeWindow != null) { punycodeWindow.close(); } //?new_zone=" + newZone, punycodeWindow = window.open("/punycode.html", "punycodeWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=no, status=no, scrollbars=no"); punycodeWindow.focus(); } /*** }}} ***/ /*** openFindPostNumberWindow() {{{ ***/ /********************************************* * open FindPostNumber window * *********************************************/ var FindPostNumberWindow = null; function openFindPostNumberWindow() { var windowWidth = 500; var windowHeight = 250; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (FindPostNumberWindow != null) { FindPostNumberWindow.close(); } FindPostNumberWindow = window.open("/postman/search_post_number.html", "FindPostNumberWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=no, status=no, scrollbars=no"); FindPostNumberWindow.focus(); } /*** }}} ***/ /*** openWhoisWindow() {{{ ***/ /********************************************* * open IDTest window * *********************************************/ var WhoisWindow = null; function openWhoisWindow(whoisDomain) { var thisForm = document.form; var skey = thisForm.skey.value; var windowWidth = 700; var windowHeight = 600; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (WhoisWindow != null) { WhoisWindow.close(); } WhoisWindow = window.open("/whois.html?whois_domain=" + whoisDomain + "&skey=" + skey, "WhoisWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=yes"); WhoisWindow.focus(); } /*** }}} ***/ /*** openTransferWaitWindow() {{{ ***/ /********************************************* * open IDTest window * *********************************************/ var transferWindow = null; function openTransferWaitWindow() { var windowWidth = 700; var windowHeight = 450; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (transferWindow != null) { transferWindow.close(); } var command = document.form.command.value; transferWindow = window.open("transfer_wait_popup.html", "transferWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=no, status=no, scrollbars=no"); transferWindow.focus(); } /*** }}} ***/ /*** confirmSubmit() {{{ ***/ function confirmSubmit(command) { var thisForm = document.form; var result; //FORM CHECK // if command is 'add_zone' // call check_add_zone_form(thisForm) function result = eval('check_'+command+'_form(thisForm)'); if (result == false) return false; //SET COMMAND setCommand(command); var isPopupNeed = checkIsPopupNeed(command, thisForm); if (isPopupNeed == true) { openConfirmWindow(); } else { thisForm.submit(); } return true; } /*** }}} ***/ function checkIsPopupNeed(command, thisForm) {//{{{ if ( command == "add_a" || command == "add_ddns" || command == "add_webforward" || command == "add_webparking" ) { var existWWW = thisForm.exist_www.value; var existNonWWW = thisForm.exist_non_www.value; var subDomain = thisForm.subname.value; thisForm.subname.value = thisForm.subname.value.toLowerCase(); if ((existWWW == 'n' && existNonWWW == 'n') && (trim(subDomain) == '' || trim(subDomain) == 'www')) { return true; } else { return false; } } else if ( command == "add_cname" || command == "add_ptr_cname" || command == "add_ptr" || command == "add_mx" || command == "add_mailforward" || command == "add_txt" || command == "add_srv" || command == "add_aaaa" || command == "add_ns" || command == "add_multiple_record" ) { return false; } else { return true; } }//}}} /*** checkAll() {{{ ***/ function checkAll(withNext) { var checkbox = document.form.elements['check[]']; var length = checkbox.length; var checkValue; for (i = 1; i < length; i++) { if (checkbox[0].checked == true) checkValue = true; else checkValue = false; checkbox[i].checked = checkValue; checkedColorRow(checkbox[i], withNext); } } /*** }}} ***/ /*** checkedColorRow() {{{ ***/ function checkedColorRow(pTarget, withNext) { var pTR = pTarget.parentNode.parentNode; if(pTR.nodeName.toLowerCase() != 'tr') { return; } var newClassName = 'checkedtr'; if(pTarget.checked == true) { $(pTR).addClass(newClassName); if (withNext == true) { $(pTR).next().addClass(newClassName); } } else { $(pTR).removeClass(newClassName); if (withNext == true) { $(pTR).next().removeClass(newClassName); } } } /*** }}} ***/ /*** checkAllNamed(target) {{{ ***/ function checkAllNamed(target) { var $table = $('#' + target); var checkValue = $table.find('#checkAll').attr("checked"); $table.find("input[type='checkbox']").attr("checked", checkValue); if (checkValue == true) { $table.find("input[type='checkbox']").parent().parent().addClass('checkedtr'); } else { $table.find("input[type='checkbox']").parent().parent().removeClass('checkedtr'); } } /*** }}} ***/ /*** changeInputCnameList(form) {{{ ***/ function changeInputCnameList(form) { if(form.cname_list.value != "direct") { form.direct_cname.value = form.cname_list.value; // form.direct_cname.style.display = "none"; document.getElementById( "direct_cname_div" ).style.display = "none"; } else { form.direct_cname.value = ""; //form.direct_cname.style.display = "inline"; document.getElementById( "direct_cname_div" ).style.display = "inline"; } } /*** }}} ***/ /*** directInputCNAME() {{{ ***/ function directInputCNAME() { var cname = document.form.cname.value; var windowWidth = 300; var windowHeight = 200; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (cname == "direct") window.open("/direct_input.html?type=cname","directInput","width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top ); } /*** }}} ***/ /*** showMailForwardMsg() {{{ ***/ function showMailForwardMsg(subArgs, type) { var windowWidth = 570; var windowHeight = 550; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (type == "false") { subArgs = encodeURI(subArgs); window.open("/confirm/show_false_mf_msg.html" + subArgs,"showFalseMsg","width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top ); } else if (type == "reject") window.open("/confirm/show_reject_mf_msg.html" + subArgs,"showRejectMsg","width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top ); } /*** }}} ***/ /*** openErrorWindow() {{{ ***/ /********************************************* * when MX, NS Record doesn't have A Record *********************************************/ var errorWindow = null; function openErrorWindow(type, hostname, record) { var windowWidth = 500; var windowHeight = 500; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (errorWindow != null) { errorWindow.close(); } errorWindow = window.open("body/error_window.html?type="+type+"&hostname="+hostname+"&record="+record, "errorWindow", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=no"); errorWindow.focus(); } /*** }}} ***/ /*** sprintf() {{{ ***/ /********************************************* * this Function is Like PHP's printf * http://jan.moesen.nu/code/javascript/sprintf-and-printf-in-javascript/ *********************************************/ function sprintf() { if (!arguments || arguments.length < 1 || !RegExp) { return; } var str = arguments[0]; var re = /([^%]*)%(\'.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/; var a = b = [], numSubstitutions = 0, numMatches = 0; while (a = re.exec(str)) { var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4]; var pPrecision = a[5], pType = a[6], rightPart = a[7]; //alert(a + '\n' + [a[0], leftpart, pPad, pJustify, pMinLength, pPrecision); numMatches++; if (pType == '%') { subst = '%'; } else { numSubstitutions++; if (numSubstitutions >= arguments.length) { alert('Error! Not enough function arguments (' + (arguments.length - 1) + ', excluding the string)\nfor the number of substitution parameters in string (' + numSubstitutions + ' so far).'); } var param = arguments[numSubstitutions]; var pad = ''; if (pPad && pPad.substr(0,1) == "'") pad = leftpart.substr(1,1); else if (pPad) pad = pPad; var justifyRight = true; if (pJustify && pJustify === "-") justifyRight = false; var minLength = -1; if (pMinLength) minLength = parseInt(pMinLength); var precision = -1; if (pPrecision && pType == 'f') precision = parseInt(pPrecision.substring(1)); var subst = param; if (pType == 'b') subst = parseInt(param).toString(2); else if (pType == 'c') subst = String.fromCharCode(parseInt(param)); else if (pType == 'd') subst = parseInt(param) ? parseInt(param) : 0; else if (pType == 'u') subst = Math.abs(param); else if (pType == 'f') subst = (precision > -1) ? Math.round(parseFloat(param) * Math.pow(10, precision)) / Math.pow(10, precision): parseFloat(param); else if (pType == 'o') subst = parseInt(param).toString(8); else if (pType == 's') subst = param; else if (pType == 'x') subst = ('' + parseInt(param).toString(16)).toLowerCase(); else if (pType == 'X') subst = ('' + parseInt(param).toString(16)).toUpperCase(); } str = leftpart + subst + rightPart; } return str; } /*** }}} ***/ /*** openSubDomainListWindow() {{{ ***/ /********************************************* * open confirm window * *********************************************/ var subDomainList = null; function openSubDomainListWindow() { var windowWidth = 700; var windowHeight = 350; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (subDomainList != null) { subDomainList.close(); } subDomainList = window.open("/sub_domain_list.html", "subDomainList", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=no"); subDomainList.focus(); } /*** }}} ***/ /*** nextSubmit() {{{ ***/ function nextSubmit(command) { var thisForm = document.form; var result; //FORM CHECK // if command is 'add_zone' // call check_add_zone_form(thisForm) function result = eval('check_'+command+'_form(thisForm)'); if (result == false) return false; //SET COMMAND setCommand(command); thisForm.submit(); return true; } /*** }}} ***/ /*** goSubmit() {{{ ***/ function goSubmit(command) { var thisForm = document.form; var result; //SET COMMAND setCommand(command); thisForm.submit(); return true; } /*** }}} ***/ /*** goMenuSubmit() {{{ ***/ function goMenuSubmit(menu, command) { var thisForm = document.form; var result; //SET COMMAND setSelectedMenu(menu); setCommand(command); thisForm.submit(); return true; } /*** }}} ***/ /*** CHECK FORM : Call from confirmSubmit() ***/ /*** check_add_zone_form() {{{ ***/ function check_add_zone_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var newZone = trim(thisForm.new_zone.value); newZone = toPuny(newZone); var res; res = formChecker.isEmpty(newZone); if (res == true) { alert(LANG['EmptyDomain']); thisForm.new_zone.focus(); return false; } res = formChecker.isZone(newZone); if (res == false) { alert(LANG['InvalidDomain']); thisForm.new_zone.focus(); return false; } res = formChecker.isEmpty(thisForm.security_code.value); if (res == true) { alert(LANG['EmptyCaptcha']); thisForm.security_code.focus(); return false; } return true; } /*** }}} ***/ /*** check_add_bulk_zone_form() {{{ ***/ function check_add_bulk_zone_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var res; res = formChecker.isEmpty(thisForm.new_bulk_zone.value); if (res == true) { alert(LANG['EmptyDomain']); thisForm.new_bulk_zone.focus(); return false; } return true; } /*** }}} ***/ /*** check_submit_bulk_zone_form() {{{ ***/ function check_submit_bulk_zone_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); res = formChecker.isEmpty(thisForm.security_code.value); if (res == true) { alert(LANG['EmptyCaptcha']); thisForm.security_code.focus(); return false; } return true; } /*** }}} ***/ /*** check_delete_zone_form() {{{ ***/ function check_delete_zone_form(aForm) { return true; } /*** }}} ***/ /*** check_download_zone_form() {{{ ***/ function check_download_zone_form(aForm) { return true; } /*** }}} ***/ /*** check_delete_bulk_zone_form() {{{ ***/ function check_delete_bulk_zone_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteDomain']); return false; } return true; } /*** }}} ***/ /*** check_add_sub_zone_form() {{{ ***/ function check_add_sub_zone_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var newSubDomain = trim(thisForm.new_sub_domain.value); var newZone = newSubDomain + '.' + trim(thisForm.zone.value); var res; res = formChecker.isEmpty(newSubDomain); if (res == true) { alert(LANG['EmptySubDomain']); thisForm.new_sub_domain.focus(); return false; } res = formChecker.isEmpty(thisForm.zone.value); if (res == true) { alert(LANG['ChooseDomain']); thisForm.zone.focus(); return false; } res = formChecker.isValidSubDomain(newSubDomain); if (res == true) { alert(LANG['InvalidDomain']); thisForm.new_sub_domain.focus(); return false; } res = formChecker.isDomain(newZone); if (res == false) { alert(LANG['InvalidDomain']); thisForm.new_sub_domain.focus(); return false; } res = formChecker.isEmpty(thisForm.security_code.value); if (res == true) { alert(LANG['EmptyCaptcha']); thisForm.security_code.focus(); return false; } /* res = formChecker.isValidSubDomainLength(newSubDomain, 1); if (res == false) { alert(LANG['InvalidDomain']); thisForm.new_sub_domain.focus(); return false; } */ return true; } /*** }}} ***/ /*** check_delete_sub_zone_form() {{{ ***/ function check_delete_sub_zone_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteDomain']); return false; } return true; } /*** }}} ***/ /*** check_add_a_form() {{{ ***/ function check_add_a_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var newIP = thisForm.new_ip; newIP.value = trim(newIP.value); if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; var res; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } res = ValueChecker.checkA(newIP, newIP.value); if (res == false) return false; newIP.value = normailzeIP(newIP.value); return true; } /*** }}} ***/ /*** check_change_a_form() {{{ ***/ function check_change_a_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } // IP validation check var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { //get ip var ip = thisForm.elements['ip_'+i]; var ipvalue = trim(ip.value); res = ValueChecker.checkA(ip, ipvalue); if (res == false) return false; ip.value = normailzeIP(ip.value); } } return true; } /*** }}} ***/ /*** check_delete_a_form() {{{ ***/ function check_delete_a_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_www_alt_form() {{{ ***/ function check_www_alt_form(aForm) { return true; } /*** }}} ***/ /*** check_edit_auth_code_form() {{{ ***/ function check_edit_auth_code_form(aForm) { var thisForm = document.form; var formChecker = new FormChecker(); res = formChecker.isValidAuthcode(thisForm.new_auth_code.value); if (res == false) { alert(LANG['InvalidAuthCode']); thisForm.new_auth_code.focus(); return false; } return true; } /*** }}} ***/ /*** check_add_ddns_form() {{{ ***/ function check_add_ddns_form(ddnsForm) { var thisForm = ddnsForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var newIP = thisForm.new_ip; newIP.value = trim(newIP.value); if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; var res; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } res = ValueChecker.checkDDNS(newIP, newIP.value); if (res == false) return false; newIP.value = normailzeIP(newIP.value); return true; } /*** }}} ***/ /*** check_change_ddns_form() {{{ ***/ function check_change_ddns_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } var allowOffline = $(document.form).find('input.status:checked').val(); if (allowOffline == undefined || allowOffline == '') { return false; } else if (allowOffline == 'f') { // IP validation check newIP = thisForm.ip; res = ValueChecker.checkDDNS(newIP, newIP.value); if (res == false) return false; newIP.value = normailzeIP(newIP.value); } return true; } /*** }}} ***/ /*** check_delete_ddns_form() {{{ ***/ function check_delete_ddns_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_mx_form() {{{ ***/ function check_add_mx_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subdomain_for_mx.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var domain; if (trim(subDomain) == '') domain = userDomain; else domain = subDomain + '.' + userDomain; var newMX = thisForm.new_mx; newMX.value = trim(newMX.value); newMX.value = rtrimDot(newMX.value); var newMXRank = thisForm.new_mx_rank; newMXRank.value = trim(newMXRank.value); var res; res = formChecker.isEmpty(domain); if (res == true) { alert(LANG['EmptyDomain']); thisForm.subdomain_for_mx.focus(); return false; } res = formChecker.isDomain(domain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subdomain_for_mx.focus(); return false; } res = ValueChecker.checkMX(newMX, newMX.value); if (res == false) return false; res = ValueChecker.checkMXRank(newMXRank, newMXRank.value); if (res == false) return false; return true; } /*** }}} ***/ /*** check_change_mx_form() {{{ ***/ function check_change_mx_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var newMX = thisForm.elements['mx_' + i]; newMX.value = trim(newMX.value); newMX.value = rtrimDot(newMX.value) var newMXRank = thisForm.elements['mx_rank_' + i]; newMXRank.value = trim(newMXRank.value); res = ValueChecker.checkMX(newMX, newMX.value); if (res == false) return false; res = ValueChecker.checkMXRank(newMXRank, newMXRank.value); if (res == false) return false; } } return true; } /*** }}} ***/ /*** check_delete_mx_form() {{{ ***/ function check_delete_mx_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_cname_form() {{{ ***/ function check_add_cname_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selectedCNAMEIndex = thisForm.cname_list.selectedIndex; var selectedDomainIndex = thisForm.user_domain.selectedIndex; var alias = trim(thisForm.alias.value); var userDomain = thisForm.user_domain.options[selectedDomainIndex].value; var aliasDomain = alias + '.' + userDomain; var res; res = formChecker.isEmpty(alias); if (res == true) { alert(LANG['EmptyCNAMESubDomain']); thisForm.alias.focus(); return false; } res = formChecker.isDomain(aliasDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.alias.focus(); return false; } cname = thisForm.direct_cname; cname.value = rtrimDot(cname.value); cname.value = trim(cname.value); if ( thisForm.cname_list.value == "") { alert(LANG['SelectActualDomain']); thisForm.cname_list.focus(); return false; } return ValueChecker.checkCNAME(cname, cname.value); } /*** }}} ***/ /*** check_change_cname_form() {{{ ***/ function check_change_cname_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var cname = thisForm.elements['cname_'+i]; cname.value = rtrimDot(cname.value); cname.value = trim(cname.value); res = ValueChecker.checkCNAME(cname, cname.value); if (res == false) return false; // memo length check TODO } } return true; } /*** }}} ***/ /*** check_delete_cname_form() {{{ ***/ function check_delete_cname_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_webforward_form() {{{ ***/ function check_add_webforward_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; //var newDomain = subDomain + '.' + userDomain; var toURL = thisForm.to_url; toURL.value = trim(toURL.value); if (trim(subDomain) == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; var res; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } return ValueChecker.checkWebForward(toURL, toURL.value); } /*** }}} ***/ /*** check_change_webforward_form() {{{ ***/ function check_change_webforward_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } // IP validation check var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var toURL = thisForm.elements['to_url_'+i]; toURL.value = trim(toURL.value); res = ValueChecker.checkWebForward(toURL, toURL.value); if (res == false) return false; } } return true; } /*** }}} ***/ /*** check_delete_webforward_form() {{{ ***/ function check_delete_webforward_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_webparking_form() {{{ ***/ function check_add_webparking_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var masterEmail = thisForm.master_email; masterEmail.value = trim(masterEmail.value); if (trim(subDomain) == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; var res; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } if (masterEmail.value) { res = ValueChecker.checkWebParkingEmail(masterEmail, masterEmail.value); if (res == false) return false; } return true; } /*** }}} ***/ /*** check_change_webparking_form() {{{ ***/ function check_change_webparking_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var masterEmail = thisForm.elements['master_email_'+i]; if (masterEmail.value) { res = ValueChecker.checkWebParkingEmail(masterEmail, masterEmail.value); if (res == false) return false; } } } return true; } /*** }}} ***/ /*** check_delete_webparking_form() {{{ ***/ function check_delete_webparking_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_mailforward_form() {{{ ***/ function check_add_mailforward_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var fromAddr = trim(thisForm.from_addr.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; //var newDomain = subDomain + '.' + userDomain; var toAddr = trim(thisForm.to_addr.value); if ( (trim(fromAddr) == '') || (trim(fromAddr) == '*')) newMail = userDomain; else newMail = fromAddr + '@' + userDomain; var res; /* res = formChecker.isEmpty(subDomain); if (res == true) { alert(LANG['EmptyDomain']); thisForm.subname.focus(); return false; } */ res = formChecker.isEmpty(toAddr); if (res == true) { alert(LANG['EmptyEmail']); thisForm.to_addr.focus(); return false; } res = formChecker.isValidEmail(toAddr); if (res == false) { alert(LANG['InvalidEmail']); thisForm.to_addr.focus(); return false; } res = formChecker.isValidMailForward(userDomain, toAddr); if (res == true) { alert(LANG['InvalidMailForward']); thisForm.to_addr.focus(); return false; } if (newMail != userDomain) { res = formChecker.isValidEmail(newMail); if (res == false) { alert(LANG['InvalidEmail']); thisForm.from_addr.focus(); return false; } } return true; } /*** }}} ***/ /*** check_delete_mailforward_form() {{{ ***/ function check_delete_mailforward_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteEmail']); return false; } return true; } /*** }}} ***/ /*** check_change_mailforward_form() {{{ ***/ function check_change_mailforward_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeEmail']); return false; } // IP validation check var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { //get fromURL var fromAddr = thisForm.elements['from_addr_'+i]; var fromAddr_value = trim(fromAddr.value); //get toURL var toAddr = thisForm.elements['to_addr_'+i]; var toAddr_value = trim(toAddr.value); //form check if (formChecker.isEmpty(toAddr_value) == true) { alert(LANG['EmptyEmail']); toAddr.focus(); return false; } if (formChecker.isValidEmail(toAddr_value) == false) { alert(LANG['InvalidEmail']); toAddr.focus(); return false; } if (formChecker.isValidMailForward(userDomain, toAddr_value) == true) { alert(LANG['InvalidMailForward']); thisForm.to_addr.focus(); return false; } } } return true; } /*** }}} ***/ /*** check_add_auth_mail_form() {{{ ***/ function check_add_auth_mail_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var authMail = trim(thisForm.auth_mail.value); var selectedIndex = thisForm.user_domain.selectedIndex; //var newDomain = subDomain + '.' + userDomain; var userName = trim(thisForm.user_name.value); var res; /* res = formChecker.isEmpty(subDomain); if (res == true) { alert(LANG['EmptyDomain']); thisForm.subname.focus(); return false; } */ res = formChecker.isEmpty(authMail); if (res == true) { alert(LANG['EmptyEmail']); thisForm.auth_mail.focus(); return false; } res = formChecker.isValidEmail(authMail); if (res == false) { alert(LANG['InvalidEmail']); thisForm.auth_mail.focus(); return false; } return true; } /*** }}} ***/ /*** check_delete_auth_mail_form() {{{ ***/ function check_delete_auth_mail_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteEmail']); return false; } return true; } /*** }}} ***/ /*** check_change_soa_form() {{{ ***/ function check_change_soa_form(aForm) { var thisForm = aForm; if ((thisForm.old_soa_refresh.value == thisForm.soa_refresh.value) && (thisForm.old_soa_retry.value == thisForm.soa_retry.value) && (thisForm.old_soa_expire.value == thisForm.soa_expire.value) && (thisForm.old_soa_minimum.value == thisForm.soa_minimum.value)) { alert(LANG['SameSOAValues']); return false; } return true; } /*** }}} ***/ /*** check_change_ttl_form() {{{ ***/ function check_change_ttl_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeHostname']); return false; } return true; } /*** }}} ***/ /*** check_change_properties_form() {{{ ***/ function check_change_properties_form(aForm) { return true; } /*** }}} ***/ /*** check_add_txt_form() {{{ ***/ function check_add_txt_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectIndex].value; var newTXT = thisForm.new_txt.value; if (subDomain == '*' || subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; var res; res = formChecker.isTxtDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } return ValueChecker.checkTXT(thisForm.new_txt, newTXT); // return true; } /*** }}} ***/ /*** check_change_txt_form() {{{ ***/ function check_change_txt_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; var res; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var txt = thisForm.elements['txt_'+i]; res = ValueChecker.checkTXT(txt, txt.value); if (res == false) return false; } } return true; } /*** }}} ***/ /*** check_delete_txt_form() {{{ ***/ function check_delete_txt_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_srv_form() {{{ ***/ function check_add_srv_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var serviceName = trim(thisForm.service_name.value); var protocolName = trim(thisForm.protocol_name.value); var subDomain = trim(thisForm.subname.value); var selectIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectIndex].value; var priority = trim(thisForm.new_priority.value); var weight = trim(thisForm.new_weight.value); var port = trim(thisForm.new_port.value); var target = trim(thisForm.new_target.value); if (subDomain == '*' || subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; var res; res = formChecker.isEmpty(serviceName); if (res == true) { alert(LANG['SelectServiceName']); thisForm.service_name.focus(); return false; } if (serviceName == 'direct_input_service') { var userServiceName = thisForm.user_service_name.value; if (userServiceName.substring(0,1) != '_') { alert(LANG['InvalidServiceName']); thisForm.user_service_name.focus(); return false; } } res = formChecker.isEmpty(protocolName); if (res == true) { alert(LANG['SelectProtocolName']); thisForm.protocol_name.focus(); return false; } if (protocolName == 'direct_input_protocol') { var userProtocolName = thisForm.user_protocol_name.value; if (userProtocolName.substring(0,1) != '_') { alert(LANG['InvalidProtocolName']); thisForm.user_protocol_name.focus(); return false; } } res = formChecker.isSrvDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } res = formChecker.isEmpty(priority); if (res == true) { alert(LANG['EmptyPriority']); thisForm.new_priority.focus(); return false; } res = formChecker.isWithinRange(priority, 0, 65535); if (res == false) { alert(LANG['InvalidPriority']); thisForm.new_priority.focus(); return false; } res = formChecker.isEmpty(weight); if (res == true) { alert(LANG['EmptyWeight']); thisForm.new_weight.focus(); return false; } res = formChecker.isWithinRange(weight, 0, 65535); if (res == false) { alert(LANG['InvalidWeight']); thisForm.new_weight.focus(); return false; } res = formChecker.isEmpty(port); if (res == true) { alert(LANG['EmptyPort']); thisForm.new_port.focus(); return false; } res = formChecker.isWithinRange(port, 0, 65535); if (res == false) { alert(LANG['InvalidPort']); thisForm.new_port.focus(); return false; } res = formChecker.isEmpty(target); if (res == true) { alert(LANG['EmptyDomain']); thisForm.new_target.focus(); return false; } if (target != '.') { if (target.lastIndexOf('.') == (target.length -1)) { target = target.substring(0, target.length -1); thisForm.new_target.value = target; } res = formChecker.isDomain(target); if (res == false) { alert(LANG['InvalidDomain']); thisForm.new_target.focus(); return false; } } return true; } /*** }}} ***/ /*** check_delete_srv_form() {{{ ***/ function check_delete_srv_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_aaaa_form() {{{ ***/ function check_add_aaaa_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var ipv6 = thisForm.new_ipv6; ipv6.value = trim(ipv6.value); if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } return ValueChecker.checkAAAA(ipv6, ipv6.value); } /*** }}} ***/ /*** check_change_aaaa_form() {{{ ***/ function check_change_aaaa_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } // IP validation check var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { //get ipv6 var ipv6 = thisForm.elements['ipv6_'+i]; res = ValueChecker.checkAAAA(ipv6, ipv6.value); if (res == false) return false; } } return true; } /*** }}} ***/ /*** check_delete_aaaa_form() {{{ ***/ function check_delete_aaaa_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_ns_form() {{{ ***/ function check_add_ns_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; var res; var newNS = thisForm.new_ns; newNS.value = trim(newNS.value); newNS.value = rtrimDot(newNS.value); if (subDomain == '*' || subDomain[0] == '*') { alert(LANG['InvalidWildcardNS']); thisForm.subname.focus(); return false; } res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } return ValueChecker.checkNS(newNS, newNS.value); } /*** }}} ***/ /*** check_change_ns_form() {{{ ***/ function check_change_ns_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } // validation check var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var ns = thisForm.elements['ns_'+i]; ns.value = trim(ns.value); ns.value = rtrimDot(ns.value); res = ValueChecker.checkNS(ns, ns.value); if (res == false) return false; } } return true; } /*** }}} ***/ /*** check_delete_ns_form() {{{ ***/ function check_delete_ns_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_ptr_way1_form() {{{ ***/ function check_add_ptr_way1_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var newPTRZone = trim(thisForm.new_ptr_zone.value)+'.in-addr.arpa'; var res; res = formChecker.isEmpty(newPTRZone); if (res == true) { alert(LANG['EmptyDomain']); thisForm.new_ptr_zone.focus(); return false; } res = formChecker.isPTRZone(newPTRZone); if (res == false) { alert(LANG['InvalidDomain']); thisForm.new_ptr_zone.focus(); return false; } if (thisForm.input_way[0].checked) { thisForm.detailWay1Type.value = 'input_network'; } else { thisForm.detailWay1Type.value = 'input_ptr_zone'; } return true; } /*** }}} ***/ /*** check_add_ptr_way2_form() {{{ ***/ function check_add_ptr_way2_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var networkStart = trim(thisForm.network_start_1.value); for (var x=2; x<5; x++) { networkStart += '.'+ eval('trim(thisForm.network_start_'+x+'.value)'); } var networkEnd = trim(thisForm.network_end_1.value); for (var x=2; x<5; x++) { networkEnd += '.'+ eval('trim(thisForm.network_end_'+x+'.value)'); } var networkSubnet = trim(thisForm.network_subnet.value); var res; res = formChecker.isEmpty(networkStart); if (res == true) { alert(LANG['EmptyNetworkStart']); thisForm.network_start_4.focus(); return false; } res = formChecker.isValidIP(networkStart); if (res == false) { alert(LANG['InvalidIP']); thisForm.network_start_4.focus(); return false; } res = formChecker.isEmpty(networkEnd); if (res == true) { alert(LANG['EmptyNetworkEnd']); thisForm.network_start_4.focus(); return false; } res = formChecker.isValidIP(networkEnd); if (res == false) { alert(LANG['InvalidIP']); thisForm.network_start_4.focus(); return false; } res = formChecker.isEmpty(networkSubnet); if (res == true) { alert(LANG['EmptyNetworkSubnet']); thisForm.network_subnet.focus(); return false; } res = formChecker.isValidSubnet(networkSubnet); if (res == false) { alert(LANG['InvalidSubnet']); thisForm.network_subnet.focus(); return false; } thisForm.network_start.value = networkStart; thisForm.network_end.value = networkEnd; return true; } /*** }}} ***/ /*** check_add_ptr_zone_form() {{{ ***/ function check_add_ptr_zone_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var newZone = trim(thisForm.new_zone.value); var res; res = formChecker.isEmpty(newZone); if (res == true) { alert(LANG['EmptyDomain']); return false; } res = formChecker.isPTRZone(newZone); if (res == false) { alert(LANG['InvalidDomain']); return false; } return true; } /*** }}} ***/ /*** check_add_ptr_form() {{{ ***/ function check_add_ptr_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var hostName = trim(thisForm.new_hostname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var ip = trim(thisForm.new_ip.value); var ipArray = ip.split('.'); var i=0; var res; res = formChecker.isEmpty(ip); if (res == true) { alert(LANG['EmptyIP']); thisForm.new_ip.focus(); return false; } res = formChecker.isEmpty(hostName); if (res == true) { alert(LANG['EmptyHostname']); thisForm.new_hostname.focus(); return false; } for (i=0; i < ipArray.length; i++) { if (isNaN(ipArray[i])) { alert(LANG['PTRIPRange']); thisForm.new_ip.focus(); return false; } if ((ipArray[i] < 0) || (ipArray[i] > 255)) { alert(LANG['PTRIPRange']); thisForm.new_ip.focus(); return false; } } newIP = ip + '.' + userDomain; res = formChecker.isPTRZone(newIP); if (res == false) { alert(LANG['InvalidPTRZone']); thisForm.new_ip.focus(); return false; } res = formChecker.isDomain(hostName); if (res == false) { alert(LANG['InvalidDomain']); thisForm.new_hostname.focus(); return false; } return true; } /*** }}} ***/ /*** check_change_ptr_form() {{{ ***/ function check_change_ptr_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { //get hostName var hostName = thisForm.elements['hostName_'+i]; //form check var hostNameValue = trim(hostName.value); //alert(test); if (formChecker.isEmpty(hostNameValue) == true) { alert(LANG['EmptyHostname']); hostName.focus(); return false; } if (formChecker.isDomain(hostNameValue) == false) { alert(LANG['InvalidDomain']); hostName.focus(); return false; } } } return true; } /*** }}} ***/ /*** check_delete_ptr_form() {{{ ***/ function check_delete_ptr_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_ptr_cname_form() {{{ ***/ function check_add_ptr_cname_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selectedCNAMEIndex = thisForm.cname_list.selectedIndex; var selectedDomainIndex = thisForm.user_domain.selectedIndex; var alias = trim(thisForm.alias.value); var userDomain = thisForm.user_domain.options[selectedDomainIndex].value; var aliasDomain = alias + '.' + userDomain; var res; var cname = thisForm.direct_cname; cname.value = trim(cname.value); cname.value = rtrimDot(cname.value); res = formChecker.isPTRZone(aliasDomain); if (res == false) { alert(LANG['InvalidPTRZone']); thisForm.alias.focus(); return false; } if ( thisForm.cname_list.value == "") { alert(LANG['SelectActualDomain']); thisForm.cname_list.focus(); return false; } return ValueChecker.checkCNAME(cname, cname.value); } /*** }}} ***/ /*** check_change_ptr_cname_form() {{{ ***/ function check_change_ptr_cname_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var cname = thisForm.elements['cname_'+i]; cname.value = rtrimDot(cname.value); cname.value = trim(cname.value); res = ValueChecker.checkCNAME(cname, cname.value); if (res == false) return false; // memo length check TODO } } return true; } /*** }}} ***/ /*** check_delete_ptr_cname_form() {{{ ***/ function check_delete_ptr_cname_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_add_ptr_ns_form() {{{ ***/ function check_add_ptr_ns_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var ns = trim(thisForm.new_ns.value); if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; //var newDomain = subDomain + '.' + userDomain; var res; res = formChecker.isEmpty(ns); if (res == true) { alert(LANG['EmptyNS']); thisForm.new_ns.focus(); return false; } // res1 = formChecker.isValidIP(ns); res = formChecker.isDomain(ns); if (res == false) { alert(LANG['InvalidNS']); thisForm.new_ns.focus(); return false; } res = formChecker.isPTRZone(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } return true; } /*** }}} ***/ /*** check_change_ptr_ns_form() {{{ ***/ function check_change_ptr_ns_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectChangeRecord']); return false; } // validation check var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { //get ip var ns = thisForm.elements['ns_'+i]; //form check var nsvalue = trim(ns.value); //alert(test); if (formChecker.isEmpty(nsvalue) == true) { alert(LANG['EmptyNS']); ns.focus(); return false; } if (formChecker.isDomain(nsvalue) == false) { alert(LANG['InvalidNS']); ns.focus(); return false; } } } return true; } /*** }}} ***/ /*** check_delete_ptr_ns_form() {{{ ***/ function check_delete_ptr_ns_form(aForm) { selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectDeleteRecord']); return false; } return true; } /*** }}} ***/ /*** check_transfer_method_select_form() {{{ ***/ function check_transfer_method_select_form(aForm) { var thisForm = aForm; var selected = isSelectedRadioButton('transfermethod'); if (selected == false) { alert(LANG['SelectTransferMethod']); return false; } setSelectedMenu('transferzonerequest'); return true; } /*** }}} ***/ /*** check_transfer_request_form() {{{ ***/ function check_transfer_request_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var targetDomain = trim(thisForm.reqDomain.value); targetDomain = toPuny(targetDomain); var res; res = formChecker.isEmpty(targetDomain); if (res == true) { alert(LANG['EmptyDomain']); thisForm.new_zone.focus(); return false; } res = formChecker.isZone(targetDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.new_zone.focus(); return false; } return true; } /*** }}} ***/ /*** check_transfer_request_email_form() {{{ ***/ function check_transfer_request_email_form(aForm) { var selected = isSelectedRadioButton('targetEmail'); if (selected == false) { alert(LANG['SelectEmail']); return false; } return true; } /*** }}} ***/ /*** check_transfer_grant_select_form() {{{ ***/ function check_transfer_grant_select_form(aForm) { var selected = isSelectedCheckBox('targetDomain[]'); if (selected == false) { alert(LANG['SelectGrantTransfer']); return false; } document.form.selected_menu.value = 'transferzonegrant'; document.form.user_domain.value = ''; return true; } /*** }}} ***/ /*** check_transfer_grant_user_form() {{{ ***/ function check_transfer_grant_user_form(aForm) { var result; var formChecker = new FormChecker(); result = formChecker.isValidID(form.targetID.value); if (result == false) { alert(LANG['InvalidID']); form.targetID.focus(); return false; } if (form.targetID.value != form.targetID_again.value) { alert(LANG['FailIDConfirm']); form.targetID.focus(); return false; } return true; } /*** }}} ***/ /*** check_transfer_grant_verify_form() {{{ ***/ function check_transfer_confirm_form(aForm) { var result; var formChecker = new FormChecker(); result = formChecker.isEmpty(form.check_password.value); if (result == true) { alert(LANG['EmptyPassword']); form.check_password.focus(); return false; } result = formChecker.isValidPassword(form.check_password.value); if (result == false) { alert(LANG['InvalidPassword']); form.check_password.focus(); return false; } return true; } /*** }}} ***/ /*** check_transfer_accept_form() {{{ ***/ function check_transfer_accept_form(aForm) { if ($("#transferPopup :checked").size() == 0) { alert(LANG['SelectAcceptTransfer']); return false; } $("form").append($("#transferPopup :input").clone()); return true; } /*** }}} ***/ /*** check_transfer_reject_form() {{{ ***/ function check_transfer_reject_form(aForm) { if ($("#transferPopup :checked").size() == 0) { alert(LANG['SelectRejectTransfer']); return false; } $("form").append($("#transferPopup :input").clone()); return true; } /*** }}} ***/ /*** check_transfer_cancel_form() {{{ ***/ function check_transfer_cancel_form(aForm) { selected = isSelectedCheckBox('transfer_check[]'); if (selected == false) { alert(LANG['SelectCancelTransfer']); return false; } return true; } /*** }}} ***/ /*** check_transfer_grant_cancel_form() {{{ ***/ function check_transfer_grant_cancel_form(aForm) { return true; } /*** }}} ***/ // external /*** check_external_confirm_form() {{{ ***/ function check_external_confirm_form(aForm) { return true; } /*** }}} ***/ // webmail /*** check_start_webmail_form() {{{ ***/ function check_start_webmail_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } return true; } /*** }}} ***/ /*** check_change_webmail_form() {{{ ***/ function check_change_webmail_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } return true; } /*** }}} ***/ /*** check_cancel_webmail_form() {{{ ***/ function check_cancel_webmail_form(aForm) { /* var thisForm = aForm; var formChecker = new FormChecker(); var subDomain = trim(thisForm.subname.value); var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; if (subDomain == '') newDomain = userDomain; else newDomain = subDomain + '.' + userDomain; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.subname.focus(); return false; } */ return true; } /*** }}} ***/ /*** check functions for PORT_SCAN ***/ /*** check_port_scan_form() {{{ ***/ function check_port_scan_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['SelectPortNum']); return false; } var checkBox = thisForm.elements['check[]']; var length = checkBox.length; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { if (checkBox[i].value == 'self') { if(!isNaN(thisForm.self_port_num.value) && thisForm.self_port_num.value){ if (thisForm.self_port_num.value < 0 || thisForm.self_port_num.value > 65535) { alert(LANG['InvalidPortNum']); thisForm.self_port_num.focus(); return false; } } else { alert(LANG['InvalidPortNum']); thisForm.self_port_num.focus(); return false; } } } } return true; } /*** }}} ***/ /*** Template support ***/ /*** start_template() {{{ ***/ function start_template() { var thisForm = document.form; var formChecker = new FormChecker(); var recordType = thisForm.recordType; var recordData = thisForm.recordData; var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['ChooseDomain']); return false; } var checkBox = document.form.elements['check[]']; var length = checkBox.length; var checkNumber = 0; for (i = 1; i < length; i++) { var is_ptr = document.getElementById("is_ptr_" + i); if (checkBox[i].checked == true && is_ptr != null && is_ptr.value == 'y') { alert(LANG['UnavailablePTR']); checkBox[i].focus(); return false; } } if (!$('#chooseTemplate').find('input:checked').val()) { alert(LANG['selectTemplate']); return false; } setSelectedMenu('applytemplate'); thisForm.submit(); } /*** }}} ***/ /*** start_template_one() {{{ ***/ function start_template_one() { var thisForm = document.form; if (!$('#chooseTemplate').find('input:checked').val()) { alert(LANG['selectTemplate']); return false; } setSelectedMenu('applytemplate'); thisForm.submit(); } /*** }}} ***/ /*** check_confirm_template_form() {{{ ***/ function check_confirm_template_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var recordType = thisForm.recordType; var recordData = thisForm.recordData; var selected; selected = isSelectedCheckBox('check[]'); if (selected == false) { alert(LANG['ChooseRecord']); return false; } var checkBox = document.form.elements['check[]']; var length = checkBox.length; var res; var multipleA = false; for (i = 1; i < length; i++) { if (checkBox[i].checked == true) { var host = thisForm.elements['host_' + i]; var type = thisForm.elements['type_' + i]; var data = thisForm.elements['data_' + i]; host.value = host.value.toLowerCase(); // check hostname // we don't need to care about domains' validities here... // TODO if (host.value == '') newDomain = 'domain.com'; else newDomain = host.value + '.' + 'domain.com'; res = formChecker.isDomain(newDomain); if (res == false) { alert(LANG['InvalidDomain']); host.focus(); return false; } // remove trailing dots (except TXT) if (type.value != 'TXT') { data.value = rtrimDot(data.value); data.value = trim(data.value); } // check data if (type.value == "A") { res = ValueChecker.checkA(data, data.value); checkMultiple = thisForm.elements['host_multiple_' + i]; if (checkMultiple && checkMultiple.value == 'true' && (host.value == '' || host.value == 'www')) { multipleA = true; } if (res == false) return false; } else if (type.value == "DDNS") { res = ValueChecker.checkDDNS(data, data.value); if (res == false) return false; } else if (type.value == "MX") { res = ValueChecker.checkMX(data, data.value); if (res == false) return false; data = thisForm.elements['data2_' + i]; res = ValueChecker.checkMXRank(data, data.value); if (res == false) return false; } else if (type.value == "CNAME") { res = ValueChecker.checkCNAME(data, data.value); if (res == false) return false; } else if (type.value == "TXT") { res = ValueChecker.checkTXT(data, data.value); if (res == false) return false; } else { alert("Unknown Type"); return false; } } } setSelectedMenu('confirmtemplate'); if (multipleA == true) { document.form.command.value = 'confirm_template'; openConfirmWindow(); return false; } return true; } /*** }}} ***/ /*** partner ***/ function goPartnerMenu(selectedMenu, arg) {//{{{ var thisForm = document.form; var domain = thisForm.domain.value; var ip = thisForm.ip.value; var otp = thisForm.otp.value; var url = thisForm.url.value; goURL = "/partner/egloos/start.html?domain=" + domain + "&selected_menu=" + selectedMenu + "&otp=" + otp + "&ip=" + ip + "&url=" + url; if (arg) { goURL += arg; } document.location.href = goURL; return; //return true; }//}}} function submitPartnerLogin(loginForm) {//{{{ var result = ValueChecker.checkLogin(loginForm); if (result == false) return false; loginForm.selected_menu.value="login"; loginForm.command.value="login"; loginForm.action.value="start.html"; loginForm.submit(); }//}}} function submitPartnerRegister() {//{{{ var thisForm = document.form; var result = check_register_user_form(thisForm, false); if (result == false) return; thisForm.command.value = "register"; thisForm.submit(); return; }//}}} /*** temp password ***/ function submitTempPassword() {//{{{ var thisForm = document.form; var formChecker = new FormChecker(); var res; res = formChecker.isEmpty(thisForm.new_password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.new_password.focus(); return false; } res = formChecker.isEmpty(thisForm.new_password_confirm.value); if (res == true) { alert(LANG['EmptyPasswordConfirm']); thisForm.new_password_confirm.focus(); return false; } res = formChecker.isValidPassword(thisForm.new_password.value); if (res == false) { alert(LANG['InvalidPassword']); thisForm.new_password.focus(); return false; } if (thisForm.new_password.value != thisForm.new_password_confirm.value) { alert(LANG['FailPasswordConfirm']); thisForm.new_password_confirm.focus(); return false; } thisForm.command.value = "change"; thisForm.submit(); return; }//}}} /*** login & logout ***/ /*** submitLogin() {{{ ***/ function submitLogin(loginForm) { var result = ValueChecker.checkLogin(loginForm); if (result == false) return false; loginForm.selected_menu.value="login"; loginForm.action.value="index.html"; return true; } /*** }}} ***/ /*** submitLogout() {{{ ***/ function submitLogout() { var thisForm = document.form; thisForm.action = 'logout.php'; thisForm.submit(); return; } /*** }}} ***/ /*** submitRegister() {{{ ***/ function submitRegister() { var thisForm = document.form; var result = check_register_user_form(thisForm, true); if (result == false) return; thisForm.selected_menu.value = "confirmregister"; // thisForm.action = "http://dnsever4" + thisForm.pref_language.value + ".opengen.com/index.html"; // thisForm.action = "http://" + thisForm.pref_language.value + ".dnsever.com/index.html"; thisForm.submit(); return; } /*** }}} ***/ /*** submitUnregister() {{{ ***/ function submitUnregister() { var thisForm = document.form; var result; if (confirm(LANG['ConfirmUnregister'])) { thisForm.command.value = "unregister"; thisForm.submit(); } return; } /*** }}} ***/ /*** submitEditMyInfo() {{{ ***/ function submitEditMyInfo() { var thisForm = document.form; var result; result = check_edit_myinfo_form(thisForm); if (result == false) return; thisForm.command.value = "edit_myinfo"; if (confirm(LANG['ConfirmEdit'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** submitChangeProperties() {{{ ***/ function submitChangeProperties() { var thisForm = document.form; var result; var msg = thisForm.zone_memo.value; if (msg.length > 65000) { alert(LANG['InvalidZoneMemo']); thisForm.zone_memo.focus(); return false; } thisForm.command.value = "change_properties"; if (confirm(LANG['ConfirmEdit'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** submitChangePassword() {{{ ***/ function submitChangePassword() { var thisForm = document.form; var formChecker = new FormChecker(); var res; res = formChecker.isEmpty(thisForm.old_password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.old_password.focus(); return false; } res = formChecker.isEmpty(thisForm.new_password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.new_password.focus(); return false; } res = formChecker.isEmpty(thisForm.new_password_confirm.value); if (res == true) { alert(LANG['EmptyPasswordConfirm']); thisForm.new_password_confirm.focus(); return false; } res = formChecker.isValidPassword(thisForm.old_password.value); if (res == false) { alert(LANG['InvalidPassword']); thisForm.old_password.focus(); return false; } res = formChecker.isValidPassword(thisForm.new_password.value); if (res == false) { alert(LANG['InvalidPassword']); thisForm.new_password.focus(); return false; } if (thisForm.new_password.value != thisForm.new_password_confirm.value) { alert(LANG['FailPasswordConfirm']); thisForm.new_password_confirm.focus(); return false; } thisForm.command.value = "change_password"; if (confirm(LANG['ConfirmChangePassword'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** submitChangeEmail() {{{ ***/ function submitChangeEmail() { var thisForm = document.form; var formChecker = new FormChecker(); var res; res = formChecker.isEmpty(thisForm.password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.password.focus(); return false; } res = formChecker.isEmpty(thisForm.new_email.value); if (res == true) { alert(LANG['EmptyEmail']); thisForm.new_email.focus(); return false; } res = formChecker.isValidEmail(thisForm.new_email.value); if (res == false) { alert(LANG['InvalidEmail']); thisForm.new_email.focus(); return false; } if (thisForm.new_email.value != thisForm.new_email_verify.value) { alert(LANG['InvalidEmailVerify']); thisForm.new_email.focus(); return false; } thisForm.command.value = "change_email"; if (confirm(LANG['ConfirmEdit'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** submitChangeQuestion() {{{ ***/ function submitChangeQuestion() { var thisForm = document.form; var formChecker = new FormChecker(); var res; var selectedQuestionIndex = thisForm.riddle_question_select.selectedIndex; var selectedValue = thisForm.riddle_question_select.options[selectedQuestionIndex].value; if (selectedValue == 0) { alert(LANG['SelectRiddleQuestion']); thisForm.riddle_question.focus(); return false; } else if (selectedValue == 'direct') { if (thisForm.riddle_question_direct.value == '') { alert(LANG['SelectRiddleQuestion']); return false; } else { thisForm.riddle_question.value = thisForm.riddle_question_direct.value; } } else { thisForm.riddle_question.value = selectedValue; } res = formChecker.isEmpty(thisForm.riddle_answer.value); if (res == true) { alert(LANG['EmptyRiddleAnswer']); thisForm.riddle_answer.focus(); return false; } res = formChecker.isEmpty(thisForm.password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.password.focus(); return false; } thisForm.command.value = "change_question"; if (confirm(LANG['ConfirmEdit'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** submitChangeLanguage() {{{ ***/ function submitChangeLanguage() { var thisForm = document.form; var formChecker = new FormChecker(); var res; thisForm.command.value = "change_language"; for (var i=0; i < thisForm.pref_language.length; i++) { if (thisForm.pref_language[i].checked) { var lang = thisForm.pref_language[i].value; } } if (lang == null || lang == "") { alert(LANG['EmptyLanguage']); return false; } if (confirm(LANG['ConfirmEdit'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** submitEnterMyInfo() {{{ ***/ function submitEnterMyInfo() { var thisForm = document.form; var formChecker = new FormChecker(); var res; res = formChecker.isEmpty(thisForm.check_password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.check_password.focus(); return false; } res = formChecker.isValidPassword(thisForm.check_password.value); if (res == false) { alert(LANG['InvalidPassword']); thisForm.check_password.focus(); return false; } thisForm.command.value = "enter_myinfo"; thisForm.submit(); return true; } /*** }}} ***/ /*** submitFindID() {{{ ***/ function submitFindID(type) { var thisForm = document.form; var result; result = checkFindIDForm(thisForm, type); if (result == true) { thisForm.selected_menu.value = 'findid'; thisForm.command.value = type; thisForm.submit(); } else { return false; } } /*** }}} ***/ /*** checkFindIDForm() {{{ ***/ function checkFindIDForm(aForm, type) { var res; var formChecker = new FormChecker(); var thisForm = aForm; if (type == 'email') { res = formChecker.isEmpty(trim(thisForm.email.value)); if (res == true) { alert(LANG['EmptyName']); thisForm.email.focus(); return false; } res = formChecker.isValidEmail(trim(thisForm.email.value)); if (res == false) { alert(LANG['InvalidEmail']); thisForm.email.focus(); return false; } } else if (type == 'domain') { var domain = trim(thisForm.domain.value); domain = toPuny(domain); res = formChecker.isEmpty(domain); if (res == true) { alert(LANG['EmptyDomain']); thisForm.domain.focus(); return false; } res = formChecker.isZone(domain); if (res == false) { alert(LANG['InvalidDomain']); thisForm.domain.focus(); return false; } } else return false; return true; } /*** }}} ***/ /*** submitFindPassword() {{{ ***/ function submitFindPassword() { var result; var formChecker = new FormChecker(); var thisForm = document.form; thisForm.selected_menu.value = 'findpwd'; //or find_password thisForm.submit(); return; } /*** }}} ***/ /*** submitResetPassword() {{{ ***/ function submitResetPassword() { var thisForm = document.form; var result; result = check_reset_user_form(thisForm); if (result == false) return; thisForm.selected_menu.value = "resetpwd"; thisForm.submit(); return; } /*** }}} ***/ /*** check_register_user_form() {{{ ***/ function check_register_user_form(aForm, checkCaptcha) { var thisForm = aForm; var formChecker = new FormChecker(); var res; /*** check empty {{{ ***/ res = formChecker.isEmpty(thisForm.user_id.value); if (res == true) { alert(LANG['EmptyID']); thisForm.user_id.focus(); return false; } res = formChecker.isEmpty(thisForm.id_checked.value); if (res == true) { alert(LANG['IDNotChecked']); thisForm.user_id.focus(); return false; } res = formChecker.isEmpty(thisForm.password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.password.focus(); return false; } res = formChecker.isEmpty(thisForm.password_confirm.value); if (res == true) { alert(LANG['EmptyPasswordConfirm']); thisForm.password_confirm.focus(); return false; } res = formChecker.isEmpty(thisForm.user_name.value); if (res == true) { alert(LANG['EmptyName']); thisForm.user_name.focus(); return false; } res = formChecker.isEmpty(thisForm.email.value); if (res == true) { alert(LANG['EmptyEmail']); thisForm.email.focus(); return false; } /* useMultiLanguage var selectedLanguageIndex = thisForm.pref_language.selectedIndex; var selectedValue = thisForm.pref_language.options[selectedLanguageIndex].value; if (selectedValue == 0) { alert(LANG['SelectLanguage']); thisForm.pref_language.focus(); return false; } */ var selectedQuestionIndex = thisForm.riddle_question_select.selectedIndex; var selectedValue = thisForm.riddle_question_select.options[selectedQuestionIndex].value; if (selectedValue == 0) { alert(LANG['SelectRiddleQuestion']); thisForm.riddle_question.focus(); return false; } else if (selectedValue == 'direct') { if (thisForm.riddle_question_direct.value == '') { alert(LANG['SelectRiddleQuestion']); return false; } else { thisForm.riddle_question.value = thisForm.riddle_question_direct.value; } } else { thisForm.riddle_question.value = selectedValue; } res = formChecker.isEmpty(thisForm.riddle_answer.value); if (res == true) { alert(LANG['EmptyRiddleAnswer']); thisForm.riddle_answer.focus(); return false; } if (checkCaptcha == true) { res = formChecker.isEmpty(thisForm.security_code.value); if (res == true) { alert(LANG['EmptyCaptcha']); thisForm.security_code.focus(); return false; } } /*** }}} ***/ /*** check validation {{{ ***/ res = formChecker.isValidID(thisForm.user_id.value); if (res == false) { alert(LANG['InvalidID']); thisForm.user_id.focus(); return false; } res = formChecker.isValidPassword(thisForm.password.value); if (res == false) { alert(LANG['InvalidPassword']); thisForm.password.focus(); return false; } if (thisForm.password.value != thisForm.password_confirm.value) { alert(LANG['FailPasswordConfirm']); thisForm.password_confirm.focus(); return false; } res = formChecker.isValidEmail(trim(thisForm.email.value)); if (res == false) { alert(LANG['InvalidEmail']); thisForm.email.focus(); return false; } if (trim(thisForm.email.value) != trim(thisForm.emailVerify.value)) { alert(LANG['InvalidEmailVerify']); thisForm.email.focus(); return false; } /*** }}} ***/ return true; } /*** }}} ***/ /*** check_edit_myinfo_form() {{{ ***/ function check_edit_myinfo_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var res; /*** check empty {{{ ***/ res = formChecker.isEmpty(thisForm.user_id.value); if (res == true) { alert(LANG['EmptyID']); thisForm.user_id.focus(); return false; } res = formChecker.isEmpty(thisForm.password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.password.focus(); return false; } res = formChecker.isEmpty(thisForm.user_name.value); if (res == true) { alert(LANG['EmptyName']); thisForm.user_name.focus(); return false; } res = formChecker.isEmpty(thisForm.email.value); if (res == true) { alert(LANG['EmptyEmail']); thisForm.email.focus(); return false; } /* useMultiLanguage var selectedLanguageIndex = thisForm.pref_language.selectedIndex; var selectedValue = thisForm.pref_language.options[selectedLanguageIndex].value; if (selectedValue == 0) { alert(LANG['SelectLanguage']); thisForm.pref_language.focus(); return false; } */ /*** }}} ***/ /*** check validation {{{ ***/ res = formChecker.isValidID(thisForm.user_id.value); if (res == false) { alert(LANG['InvalidID']); thisForm.user_id.focus(); return false; } res = formChecker.isValidPassword(thisForm.password.value); if (res == false) { alert(LANG['InvalidPassword']); thisForm.password.focus(); return false; } res = formChecker.isValidEmail(thisForm.email.value); if (res == false) { alert(LANG['InvalidEmail']); thisForm.email.focus(); return false; } res = formChecker.isValidAuthcode(thisForm.authcode.value); if (res == false) { alert(LANG['InvalidAuthCode']); thisForm.auth_code.focus(); return false; } /*** }}} ***/ return true; } /*** }}} ***/ /*** check_reset_user_form() {{{ ***/ function check_reset_user_form(aForm) { var thisForm = aForm; var formChecker = new FormChecker(); var res; /*** check empty {{{ ***/ res = formChecker.isEmpty(thisForm.new_password.value); if (res == true) { alert(LANG['EmptyPassword']); thisForm.new_password.focus(); return false; } res = formChecker.isEmpty(thisForm.new_password_confirm.value); if (res == true) { alert(LANG['EmptyPasswordConfirm']); thisForm.new_password_confirm.focus(); return false; } /*** }}} ***/ /*** check validation {{{ ***/ res = formChecker.isValidPassword(thisForm.new_password.value); if (res == false) { alert(LANG['InvalidPassword']); thisForm.new_password.focus(); return false; } if (thisForm.new_password.value != thisForm.new_password_confirm.value) { alert(LANG['FailPasswordConfirm']); thisForm.new_password_confirm.focus(); return false; } if (thisForm.new_password.value != thisForm.new_password_confirm.value) { alert(LANG['FailPasswordConfirm']); thisForm.new_password_confirm.focus(); return false; } /*** }}} ***/ return true; } /*** }}} ***/ ///*** XXX changeManageMode() {{{ ***/ ///********************************************* //* @param string manageMode easy or advanced //*********************************************/ //function changeManageMode(manageMode) //{ // var thisForm = document.form; // // var selectedIndex = thisForm.user_domain.selectedIndex; // var userDomain = thisForm.user_domain.options[selectedIndex].value; // var selectedMenu = thisForm.selected_menu.value; // // goURL = "/www/start.html?manage_mode=" + manageMode + "&user_domain=" + userDomain + "&selected_menu=" + selectedMenu; // document.location.href = goURL; // //document.form.submit(); // return; //} ///*** }}} ***/ /*** AuthMail ***/ /*** addAuthMailInSelectbox() {{{ ***/ function addAuthMailInSelectbox() { var to_addr = document.form.to_addr.value; if (to_addr == "add") goMenu('editauthmail'); return true; } /*** }}} ***/ /*** Edit DDNS ***/ ///*** XXX selectOfflineCheckTime() {{{ ***/ ///********************************************* //* when changed offline check time //*********************************************/ //function selectOfflineCheckTime(position) //{ // var thisForm = document.form; // var selectedIndex = thisForm.check_time[position].selectedIndex; // var selectedTime = thisForm.check_time[position].options[selectedIndex].value; // // goMenuWithArgument('editddns', '&form_position='+position+'&selected_time='+selectedTime); // return true; //} ///*** }}} ***/ /*** XXX editOfflineMsg() {{{ ***/ /********************************************* * when changed offline check time *********************************************/ /* var editDDNSMsgWindow = null; function editOfflineMsg(position,record_id) { var thisForm = document.form; var selectedIndex = thisForm.check_time[position].selectedIndex; var selectedTime = thisForm.check_time[position].options[selectedIndex].value; if (selectedTime == '-1') { alert(LANG['OfflineNoUse']); thisForm.check_time[position].focus(); } var windowWidth = 600; var windowHeight = 530; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (editDDNSMsgWindow != null) { editDDNSMsgWindow.close(); } editDDNSMsgWindow = window.open("ddns/edit_ddns_msg.html?record_id="+record_id+"&selected_time="+selectedTime, "editddnsmsg", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=no"); editDDNSMsgWindow.focus(); } */ /*** }}} ***/ /*** editDDNSConf() {{{ ***/ /********************************************* * when changed offline check time *********************************************/ var editDDNSConfWindow = null; function editDDNSConf(userdomain, hostname, ip, menu) { var thisForm = document.form; var windowWidth = 820; var windowHeight = 630; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (editDDNSConfWindow != null) { editDDNSConfWindow.close(); } editDDNSConfWindow = window.open("/ddns/edit_ddns_conf.html?user_domain="+userdomain+"&hostname="+hostname+"&ip="+ip+ "&menu="+menu, "editddnsconf", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=no, status=no, scrollbars=auto"); editDDNSConfWindow.focus(); } /*** }}} ***/ /*** submitChangeDDNSConf() {{{ ***/ function submitChangeDDNSConf() { var thisForm = document.form; var result; var formChecker = new FormChecker(); var chooseOffline = $(document.form).find('input[name=chooseOffline]:checked').val() if (chooseOffline == 'wf') { var res; var toURL = trim(thisForm.to_url.value); res = formChecker.isEmpty(toURL); if (res == true) { alert(LANG['EmptyURL']); thisForm.to_url.focus(); return false; } res = formChecker.isURL(toURL); if (res == false) { alert(LANG['InvalidURL']); thisForm.to_url.focus(); return false; } } else { var msg = thisForm.offline_msg.value; if (msg.length > 65000) { alert(LANG['InvalidOfflineMsgLength']); thisForm.offline_msg.focus(); return false; } res = formChecker.isValidOfflineMsg(msg) if (res == true) { alert(LANG['InvalidOfflineMsg']); thisForm.offline_msg.focus(); return false; } } thisForm.command.value = "change_conf"; if (confirm(LANG['ConfirmEdit'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** goDDNSActiveOrNot() {{{ ***/ /********************************************* * when changed offline check time *********************************************/ var ddnsActiveWindow = null; function goDDNSActiveOrNot(userDomain) { var windowWidth = 600; var windowHeight = 500; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (ddnsActiveWindow != null) { ddnsActiveWindow.close(); } ddnsActiveWindow = window.open("ddns/ddns_active.html?user_domain="+userDomain, "ddnsactive", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=no"); ddnsActiveWindow.focus(); } /*** }}} ***/ /*** submitActiveDDNS() {{{ ***/ function submitActiveDDNS(allowDDNSHostnameList) { var thisForm = document.form; var result; thisForm.command.value = "active_ddns"; thisForm.allow_DDNSHostname_Str.value = allowDDNSHostnameList; if (confirm(LANG['ConfirmEdit'])) { thisForm.submit(); } return; } /*** }}} ***/ /*** goDDNSAuthPass() {{{ ***/ /********************************************* * when changed offline check time *********************************************/ var ddnsAuthPassWindow = null; function goDDNSAuthPass() { var windowWidth = 550; var windowHeight = 450; var left = (screen.width/2) - (windowWidth/2); var top = (screen.height/2) - (windowHeight/2); if (ddnsAuthPassWindow != null) { ddnsAuthPassWindow.close(); } ddnsAuthPassWindow = window.open("ddns/ddns_auth_pass.html", "ddnsactive", "width=" + windowWidth + ", height=" + windowHeight + ", left=" + left + ", top=" + top + ", location=no, toolbar=no, resizable=yes, status=no, scrollbars=no"); ddnsAuthPassWindow.focus(); } /*** }}} ***/ /*** authCodeSubmit() {{{ ***/ function authCodeSubmit(command) { var thisForm = document.form; var formChecker = new FormChecker(); if (command == 'show_auth_code') { if (thisForm.mode.value == 'client') { result = formChecker.isEmpty(thisForm.security_code.value); if (result == true) { alert(LANG['EmptyCaptcha']); thisForm.security_code.focus(); return false; } result = formChecker.isEmpty(thisForm.user_id.value); if (result == true) { alert(LANG['EmptyID']); thisForm.user_id.focus(); return false; } } result = formChecker.isEmpty(thisForm.input_real_pass.value); if (result == true) { alert(LANG['EmptyPassword']); thisForm.input_real_pass.focus(); return false; } } if (command == 'edit_auth_code') { res = formChecker.isValidAuthcode(thisForm.new_auth_code.value); if (res == false) { alert(LANG['InvalidAuthCode']); thisForm.command.value = 'show_auth_code2'; thisForm.new_auth_code.focus(); return false; } } //SET COMMAND thisForm.command.value = command; thisForm.submit(); return; } /*** }}} ***/ /*** openerGoMenu() {{{ ***/ /********************************************* * go menu TODO,FIXME different action in IE 6, 5 * * @param string menuStr viewzone, edit_a, edit_mx *********************************************/ var pageFocus; function openerGoMenu(selectedMenu, pageFocus) { var thisForm = document.form; var openerForm = opener.document.form; var userDomain = openerForm.user_domain.value; var skey = openerForm.skey.value; goURL = "/start.html?user_domain=" + userDomain + "&selected_menu=" + selectedMenu + "&skey="+skey; if (pageFocus) goURL += "#"+pageFocus; opener.document.location.href = goURL; return true; } /*** }}} ***/ /*** selectEditDDNSDomain() {{{ ***/ /********************************************* * when changed domain select box in EditDDNSAll page, set 'editddns domain' to selected_menu *********************************************/ function selectEditDDNSDomain() { setSelectedMenu('editddns'); var thisForm = document.form; var skey = thisForm.skey.value; var selectedIndex = thisForm.edit_ddns_domain.selectedIndex; var userDomain = thisForm.edit_ddns_domain.options[selectedIndex].value; goURL = "/start.html?user_domain=" + userDomain + "&selected_menu=editddns" + "&skey=" + skey; document.location.href = goURL; return; } /*** }}} ***/ /*** Edit SRV ***/ /*** makeSRVNewRecord() {{{ ***/ /********************************************* * User input record element, then make record string * * need form value * - service_name * - protocol_name * - subname * - new_priority * - new_weight * - new_port * - new_target *********************************************/ function makeSRVNewRecord() { var thisForm = document.form; var recordString = ''; var serviceName = thisForm.service_name.value; var protocolName = thisForm.protocol_name.value; var subName = thisForm.subname.value; var selectedIndex = thisForm.user_domain.selectedIndex; var userDomain = thisForm.user_domain.options[selectedIndex].value; var priority = thisForm.new_priority.value; var weight = thisForm.new_weight.value; var port = thisForm.new_port.value; var target = thisForm.new_target.value; if (serviceName) { if (serviceName == 'direct_input_service') { document.getElementById( "user_service_name_div" ).style.display = ""; if (thisForm.user_service_name.value) { if (thisForm.user_service_name.value.substring(0,1) != '_') { thisForm.user_service_name.value = '_' + thisForm.user_service_name.value; } recordString += thisForm.user_service_name.value + '.'; } } else { document.getElementById( "user_service_name_div" ).style.display = "none"; recordString += thisForm.service_name.value + '.'; } } if (protocolName) { if (protocolName == 'direct_input_protocol') { document.getElementById( "user_protocol_name_div" ).style.display = ""; if (thisForm.user_protocol_name.value) { if (thisForm.user_protocol_name.value.substring(0,1) != '_') { thisForm.user_protocol_name.value = '_' + thisForm.user_protocol_name.value; } recordString += thisForm.user_protocol_name.value + '.'; } } else { document.getElementById( "user_protocol_name_div" ).style.display = "none"; recordString += thisForm.protocol_name.value + '.'; } //recordString += protocolName + '.'; } if (subName == '*' || subName == '') { recordString += userDomain + '.'; } else { recordString += subName + '.' + userDomain + '.'; } recordString += ' IN SRV'; if (priority) recordString += ' ' + priority; if (weight) recordString += ' ' + weight; if (port) recordString += ' ' + port; if (target) { if (target.lastIndexOf('.') == (target.length -1)) { recordString += ' ' + target; } else { recordString += ' ' + target + '.'; } } thisForm.new_record.value = recordString; return; } /*** }}} ***/ /*** Domain Search ***/ function enterForSearch(myfield, e) {//{{{ var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { search(); return false; } else return true; }//}}} /* VIM SETTING {{{ vim600:fdm=marker }}}*/