diff --git a/web/index.html b/web/index.html index 479163e44..0d0e1635a 100644 --- a/web/index.html +++ b/web/index.html @@ -187,7 +187,7 @@
diff --git a/web/js/actions.js b/web/js/actions.js index c5fee8776..45a0ac9ed 100644 --- a/web/js/actions.js +++ b/web/js/actions.js @@ -89,16 +89,20 @@ App.Actions.save_form = function(evt) { // do_action_edit App.Actions.edit = function(evt) { - var elm = $(evt.target); - elm = elm.hasClass('row') ? elm : elm.parents('.row'); - - var options = elm.find('.source').val(); - var build_method = App.Env.getWorldName() + '_form'; - var tpl = App.HTML.Build[build_method](options); - elm.replaceWith(tpl); - - App.Helpers.disbleNotEditable(); - //App.Helpers.updateScreen(); + if ('undefined' != typeof App.Pages[App.Env.world].edit) { + App.Pages[App.Env.world].edit(evt); + } else { + var elm = $(evt.target); + elm = elm.hasClass('row') ? elm : elm.parents('.row'); + + var options = elm.find('.source').val(); + var build_method = App.Env.getWorldName() + '_form'; + var tpl = App.HTML.Build[build_method](options); + elm.replaceWith(tpl); + + App.Helpers.disbleNotEditable(); + //App.Helpers.updateScreen(); + } } // do_cancel_form @@ -334,3 +338,16 @@ App.Actions.view_full_ns_list = function(evt) var elm = $(evt.target); App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html()); } + +App.Actions.view_template_info = function(evt) +{ + var elm = $(evt.target); + ref = elm.hasClass('row') ? elm : elm.parents('.row'); + + var options = ref.find('.source').val(); + App.Ajax.request('DNS.getTemplateInfo', {spell: options}, function(reply) { + if (reply.result) { + App.Helpers.openInnerPopup(elm, reply.data); + } + }); +} diff --git a/web/js/pages.js b/web/js/pages.js index f400d6aeb..f42832888 100644 --- a/web/js/pages.js +++ b/web/js/pages.js @@ -22,6 +22,7 @@ App.Pages.prepareHTML = function() else { App.Model[App.Env.world].loadList(); } + $('#new-entry-keyword').text(App.Env.world.toLowerCase().replace('_', ' ')); } App.Pages.DNS.showSubform = function(ref) @@ -49,3 +50,13 @@ App.Pages.DNS.edit = function(elm) { elm.replaceWith(tpl); } +App.Pages.USER.new_entry = function(evt) +{ + var form_id = App.Constants[App.Env.world + '_FORM_ID']; + $('#'+form_id).remove(); + var build_method = App.Env.getWorldName() + '_form'; + var tpl = App.HTML.Build[build_method]({}, form_id); + App.Ref.CONTENT.prepend(tpl); + App.Helpers.updateScreen(); + $('#'+form_id).find('.ns-entry, .additional-ns-add').addClass('hidden'); +} diff --git a/web/js/templates.js b/web/js/templates.js index 25d4fbf02..bee8b499f 100644 --- a/web/js/templates.js +++ b/web/js/templates.js @@ -110,7 +110,7 @@ App.Templates.html = { ~!:IP~!\ \ template:\ - ~!:TPL~!\ + ~!:TPL~!\ \ \ \ @@ -126,7 +126,7 @@ App.Templates.html = { \ \ '], - SUBFORM: ['