diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/config.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/config.js index 91694f2200b2644bfb499b07c7c3ecbe0715ce78..6077e3794194e70b78a16ed12b2ab1bb47768a4c 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/config.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/config.js @@ -1,8 +1,17 @@ -//<PROFILE_PLACEHOLDER> -var profile = new StandardProfile(); -//</PROFILE_PLACEHOLDER> +var loadJSResorce = function(pathToResource, onLoad) { + var head = document.getElementsByTagName('head')[0]; + var script= document.createElement('script'); + script.type= 'text/javascript'; + var src = pathToResource; + script.src= src; + script.onreadystatechange= function () { + if (this.readyState == 'complete') onLoad(); + } + script.onload = onLoad; + + head.appendChild(script); +} -// -// Global variables -// -var mainController = new MainController(profile); \ No newline at end of file +//<PROFILE_PLACEHOLDER> +loadJSResorce("./js/config/StandardProfile.js", function() { profile = new StandardProfile(); }); +//</PROFILE_PLACEHOLDER> \ No newline at end of file diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html index a3d4cebe1bdc395cb9eb0464def0b099bb3b69b5..9af96fb82b705a9d40492a51c04602e093598f19 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/index.html @@ -78,10 +78,6 @@ <script type="text/javascript" src="./js/config/Profile.js"></script> <script type="text/javascript" src="./js/config/StandardProfile.js"></script> - <!-- <PROFILE_JS_PLACEHOLDER>--> - - <!--</PROFILE_JS_PLACEHOLDER>--> - <script type="text/javascript" src="./js/server/ServerFacade.js"></script> <script type="text/javascript" src="./js/util/Util.js"></script> @@ -210,10 +206,15 @@ <script type="text/javascript" src="./config.js"></script> <script type="text/javascript"> + // // Application Startup // - $(document).ready(function() { + var profile = null; + var mainController = null; + + var startELNLIMS = function() { + mainController = new MainController(profile); // Global links handler - This function avoid normal link behaviour for javascript enabled links that will use ajax calls for left clicks, allowing to open them on a new tab with right click. $(document).click(function(e) { var elementClasses = $(e.target).attr('class'); @@ -296,6 +297,19 @@ $( window ).resize(function() { dragContainerFunc({ pageX : parseInt($('#dragContainer').css("left").replace("px","")) }); }); + } + + $(document).ready(function() { + var wait = null; + wait = function() { + var condition = profile !== null; + if (!condition){ + setTimeout(wait,100); + } else { + startELNLIMS(); + } + } + wait(); }); </script> </head>