Root Panel - Dynamic Workspace Load

HTML

<script src="http://www.chilipeppr.com/js/require.js"></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<div id="pnlHeader"></div>
<div id="pnlBody">
    <div class="container-fluid">
        <div class="row">
            <!-- Flash Message -->
            <div id="com-chilipeppr-flash"></div>
            <!-- Main Workspace Area -->
            <div id="pnlWorkspace" class="pnlWorkspaceRtSidebarCollapsed col-xs-12">Workspace area</div>
            <!-- Right Sidebar (Workspace Picker, etc) Area -->
            <div id="pnlRtSidebar" class=""></div>
        </div>
    </div>
</div>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-51962619-1', 'chilipeppr.com');
  ga('send', 'pageview');

</script>

CSS

#pnlBody .container-fluid {
}
#pnlBody .pnlWorkspaceRtSidebarCollapsed {
    /* padding-right: 45px; */
    padding-right: 10px;
}
#pnlBody .pnlWorkspaceRtSidebarExpanded {
    padding-right: 0;
}
#pnlRtSidebar {
    position: relative;
}
#pnlWorkspace {
    padding-left: 10px;
}

JavaScript

// Make sure ChiliPeppr is ready to run and fully instantiated
// including all of its dependencies like jquery, bootstrap, etc.
cprequire(["chilipeppr_ready"], function () {

    // Element / Flash Message
    // http://jsfiddle.net/jlauer/qp7Em/
    // "inline:com-chilipeppr-elem-flashmsg"
    chilipeppr.load("#com-chilipeppr-flash",
        "http://fiddle.jshell.net/chilipeppr/90698kax/show/light/",

    function () {
        console.log("mycallback got called after loading flash msg module");
        console.log(chilipeppr);
        require(["inline:com-chilipeppr-elem-flashmsg"], function (fm) {
            //console.log("inside require of " + fm.id);
            fm.init();
            //console.log(fm.publish);
            //chilipeppr.publish(fm.subscribe, "Loaded", "The ChiliPeppr Hardware Fiddle main app is loaded.");
            //chilipeppr.publish(fm.subscribe, "", "The ChiliPeppr Hardware Fiddle main app is loaded.");
            //chilipeppr.publish(fm.subscribe, "", "Third time is a charm");
            //console.log(fm);
            
            // Panel / Header
            //http://jsfiddle.net/chilipeppr/7aX6x/
            chilipeppr.load(
                "#pnlHeader",
                "http://fiddle.jshell.net/chilipeppr/7aX6x/show/light/",
        
            function () {
                //setTimeout(function() {
                cprequire(
                ["inline:com-chilipeppr-hdr"],
        
                function (hdr) {
                    console.log("running of " + hdr.id);
                    hdr.init();
                    
                    // LOAD THE WORKSPACE NOW
                    // Now analyze the window.location URL and load the base boot Javascript
                    // for this particular url from the data storage
                    console.log("window.location", window.location.pathname);
                    var path = window.location.pathname;
                    if (path == "/_display/") {
                       ...