From: Sven Schöling Date: Tue, 16 Oct 2012 14:35:54 +0000 (+0200) Subject: Ajax Layout Wrapper für CRM und LxCars X-Git-Tag: release-3.0.0beta1~117 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9b4b377178bd704bfb646817eb23a014ef46b909;p=kivitendo-erp.git Ajax Layout Wrapper für CRM und LxCars --- diff --git a/js/ajax_layout.js b/js/ajax_layout.js new file mode 100644 index 000000000..694e1c5fe --- /dev/null +++ b/js/ajax_layout.js @@ -0,0 +1,44 @@ +function load_layout(baseURL){ + $.ajax({ + url: baseURL + 'controller.pl?action=Layout/empty&format=json', + method: 'GET', + dataType: 'json', + success: function (data) { + if (data["stylesheets"]) { + $.each(data["stylesheets"], function(i, e){ + $('head').append(''); + }); + } + if (data["stylesheets_inline"] && data["stylesheets_inline"].size) { + var style = "'; + $('head').append(style); + } + if (data["start_content"]) { + $('body').wrapInner(data["start_content"]); + } + if (data["pre_content"]) { + $('body').prepend(data["pre_content"]); + } + if (data["post_content"]) { + $('body').append(data["post_content"]); + } + if (data["javascripts"]) { + $.each(data["javascripts"], function(i, e){ + $('head').append(''; + $('head').append(script); + } + } + }); +}