1 function load_layout(baseURL){
3 url: baseURL + 'controller.pl?action=Layout/empty&format=json',
6 success: function (data) {
7 if (data["stylesheets"]) {
8 $.each(data["stylesheets"], function(i, e){
9 $('head').append('<link rel="stylesheet" href="' + baseURL + e + '" type="text/css" title="Stylesheet">');
12 if (data["stylesheets_inline"] && data["stylesheets_inline"].size) {
13 var style = "<style type='text/css'>";
14 $.each(data["stylesheets_inline"], function(i, e){
18 $('head').append(style);
20 if (data["start_content"]) {
21 $('body').wrapInner(data["start_content"]);
23 if (data["pre_content"]) {
24 $('body').prepend(data["pre_content"]);
26 if (data["post_content"]) {
27 $('body').append(data["post_content"]);
29 if (data["javascripts"]) {
30 $.each(data["javascripts"], function(i, e){
31 $('head').append('<script type="text/javascript" src="' + baseURL + e + '">');
34 if (data["javascripts_inline"]) {
35 var script = "<script type='text/javascript'>";
36 $.each(data["javascripts_inline"], function(i, e){
39 script += '</script>';
40 $('head').append(script);