mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
Flatta and Diman fixes
This commit is contained in:
commit
3bed87ba15
98 changed files with 5260 additions and 3031 deletions
49
web/js/pages/add_dns_rec.js
Normal file
49
web/js/pages/add_dns_rec.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
//
|
||||
// Updates database dns record dynamically, showing its full domain path
|
||||
App.Actions.DB.update_dns_record_hint = function(elm, hint) {
|
||||
// clean hint
|
||||
if (hint.trim() == '') {
|
||||
$(elm).parent().find('.hint').html('');
|
||||
}
|
||||
|
||||
// set domain name without rec in case of @ entries
|
||||
if (hint == '@') {
|
||||
hint = '';
|
||||
}
|
||||
|
||||
// dont show pregix if domain name = rec value
|
||||
if (hint == GLOBAL.DNS_REC_PREFIX + '.') {
|
||||
hint = '';
|
||||
}
|
||||
|
||||
// add dot at the end if needed
|
||||
if (hint != '' && hint.slice(-1) != '.') {
|
||||
hint += '.';
|
||||
}
|
||||
|
||||
$(elm).parent().find('.hint').text(hint + GLOBAL.DNS_REC_PREFIX);
|
||||
}
|
||||
|
||||
//
|
||||
// listener that triggers dns record name hint updating
|
||||
App.Listeners.DB.keypress_dns_rec_entry = function() {
|
||||
var ref = $('input[name="v_rec"]');
|
||||
var current_rec = ref.val();
|
||||
if (current_rec.trim() != '') {
|
||||
App.Actions.DB.update_dns_record_hint(ref, current_rec);
|
||||
}
|
||||
|
||||
ref.bind('keypress input', function(evt) {
|
||||
clearTimeout(window.frp_usr_tmt);
|
||||
window.frp_usr_tmt = setTimeout(function() {
|
||||
var elm = $(evt.target);
|
||||
App.Actions.DB.update_dns_record_hint(elm, $(elm).val());
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Page entry point
|
||||
// Trigger listeners
|
||||
App.Listeners.DB.keypress_dns_rec_entry();
|
Loading…
Add table
Add a link
Reference in a new issue