From 9b4b377178bd704bfb646817eb23a014ef46b909 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 16 Oct 2012 16:35:54 +0200 Subject: [PATCH] =?utf8?q?Ajax=20Layout=20Wrapper=20f=C3=BCr=20CRM=20und?= =?utf8?q?=20LxCars?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/ajax_layout.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 js/ajax_layout.js 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); + } + } + }); +} -- 2.20.1