User page functionality merger (80%)

This commit is contained in:
Dima Malishev 2011-07-23 17:34:27 +03:00
parent 2b06ef5faa
commit 43dffa3fbe
11 changed files with 826 additions and 208 deletions

View file

@ -44,91 +44,3 @@ App.Pages.DNS.edit = function(elm) {
var tpl = App.HTML.Build.dns_form(options);
elm.replaceWith(tpl);
}
/*
//
// DNS
App.Pages.DNS.saveForm = function(evt, params){
var elm = $(evt.target);
elm = elm.parents('.b-new-entry');
if (elm.attr('id') == App.Constants.DNS_FORM_ID) {
var values = App.Helpers.getFormValues(elm);
if(App.Validate.dnsForm(values)) {
App.Model.DNS.update(values, source);
var tpl = App.HTML.Build.dns_entry(values);
$('#' + App.Constants.DNS_FORM_ID).replaceWith(tpl);
}
}
else {
var source = $(elm).find('.source').val();
var values = App.Helpers.getFormValues(elm);
if(App.Validate.dnsForm(values)) {
App.Model.DNS.update(values, source);
var tpl = App.HTML.Build.dns_entry(values);
elm.replaceWith(tpl);
}
}
App.Helpers.updateScreen();
}
//
// IP
App.Pages.IP.prepareHTML = function(){
App.Model.IP.loadList();
}
App.Pages.IP.saveForm = function(evt, params){
var elm = $(evt.target);
elm = elm.parents('.b-new-entry');
if (elm.attr('id') == App.Constants.IP_FORM_ID) {
var values = App.Helpers.getFormValues(elm);
if(App.Validate.ipForm(values)) {
App.Model.IP.update(values, source);
var tpl = App.HTML.Build.ip_entry(values);
$('#' + App.Constants.IP_FORM_ID).replaceWith(tpl);
}
}
else {
var source = $(elm).find('.source').val();
var values = App.Helpers.getFormValues(elm);
if(App.Validate.ipForm(values)) {
App.Model.IP.update(values, source);
var tpl = App.HTML.Build.ip_entry(values);
elm.replaceWith(tpl);
}
}
App.Helpers.updateScreen();
}
*/
/*
App.Pages.IP.edit = function(elm) {
var options = elm.find('.source').val();
fb.warn(elm);
fb.warn(options);
var tpl = App.HTML.Build.ip_form(options);
elm.replaceWith(tpl);
}
App.Pages.IP.ipNotSaved = function(reply) {
return App.Helpers.alert(reply.message);
}
App.Pages.IP.remove = function(evt) {
var confirmed = confirm('Are you sure?');
if (!confirmed) {
return;
}
var elm = $(evt.target);
elm.parents('.ip-details-row');
var values = elm.find('.source').val();
App.Model.IP.remove(values, elm);
}
*/