123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: cpscrn
- //
- // (C) Copyright IBM Corp. 2005, 2011
- //
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- //
- //
- // only load Dojo if it is not already loaded.
- if (typeof dojo == "undefined") {
- var nodes = document.getElementsByTagName("SCRIPT");
- var l = nodes.length;
- // Find the $WEB$ environment variable
- foundweb: for (var i = 0; i < l; i++) {
- var attrs = nodes[i].attributes;
- for (var j = 0; j < attrs.length; j++) {
- if (attrs[j].nodeName == "src") {
- if (attrs[j].nodeValue.indexOf("?web=") > 0) {
- var web = attrs[j].nodeValue.substring(attrs[j].nodeValue.indexOf("?web=")+5, attrs[j].nodeValue.length);
- break foundweb;
- }
- break;
- }
- }
- }
- // If the value of web is not passed into dojoCheck then get from _F_Config.
- if (typeof web == "undefined") {
- if (typeof _F_Config != "undefined") {
- var web = _F_Config.webContent;
- }
- else if (typeof console != "undefined") {
- console.error("Unable to find web content directory. Dojo not loaded.");
- }
- }
-
- // Make sure the web variable has been set before trying to load Dojo
- if (typeof web != "undefined") {
- // Set the djConfig once
- djConfig = {
- parseOnLoad: true,
- baseUrl: web + "/dojo16/dojo/"
- }
- // Inject the Dojo script tag into the head of the webpage.
- if (document.getElementsByTagName("head")[0] != null) {
- var head = document.getElementsByTagName("head")[0];
- var newscript= document.createElement('script');
- newscript.type = 'text/javascript';
- newscript.setAttribute("src", djConfig.baseUrl+"dojo.js");
- head.appendChild(newscript);
- }
- }
- }
|