Related to 19689: It is not possible to change Role twice in a row
authorMartin Taal <martin.taal@openbravo.com>
Fri, 24 Feb 2012 09:57:14 +0100
changeset 15615 3ed18f646a6b
parent 15614 01a2cc09fc25
child 15616 e262708b03f4
Related to 19689: It is not possible to change Role twice in a row
Backout as change does not solve issue
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java
src/index.jsp
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java	Fri Feb 24 09:56:12 2012 +0100
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StaticResourceComponent.java	Fri Feb 24 09:57:14 2012 +0100
@@ -46,7 +46,7 @@
   private static final Logger log = Logger.getLogger(StaticResourceComponent.class);
 
   private static final String GEN_TARGET_LOCATION = "web/js/gen";
-  private static final String JS_INCLUDE_FUNCTION = ";(function(){var a=document.createElement('script'),b=document.head||document.getElementsByTagName('head')[0];a.type='text/javascript';a.src='@src@';b.appendChild(a);}());";
+  private static final String JS_INCLUDE_FUNCTION = "(function(){var a=document.createElement('script'),b=document.head||document.getElementsByTagName('head')[0];a.type='text/javascript';a.src='@src@';b.appendChild(a);}());";
 
   @Inject
   @Any
@@ -110,12 +110,11 @@
         OBContext.getOBContext().setNewUI(true);
       }
 
+      StringBuilder result = new StringBuilder();
       final String scriptPath = getContextUrl() + GEN_TARGET_LOCATION + "/"
           + getStaticResourceFileName() + ".js";
 
-      StringBuilder result = new StringBuilder();
       if (classicMode) {
-
         result.append("document.write(\"<LINK rel='stylesheet' type='text/css' href='"
             + getContextUrl()
             + "org.openbravo.client.kernel/OBCLKER_Kernel/StyleSheetResources?_skinVersion="
@@ -123,10 +122,8 @@
             + "'></link>\");\n");
         result
             .append("var isomorphicDir='../web/org.openbravo.userinterface.smartclient/isomorphic/';\n");
-        result.append(JS_INCLUDE_FUNCTION.replace("@src@", scriptPath));
-      } else {
-        result.append("OBCreateScriptTag('" + scriptPath + "');");
       }
+      result.append(JS_INCLUDE_FUNCTION.replace("@src@", scriptPath));
       return result.toString();
     } catch (Exception e) {
       log.error("Error generating component; " + e.getMessage(), e);
--- a/src/index.jsp	Fri Feb 24 09:56:12 2012 +0100
+++ b/src/index.jsp	Fri Feb 24 09:57:14 2012 +0100
@@ -165,15 +165,6 @@
   }
 %>
 }
-
-function OBCreateScriptTag(src) {
-  var script = document.createElement("script"),
-    body = document.body || document.getElementsByTagName("body");
-
-  script.type = 'text/javascript';
-  script.src = src;
-  body.appendChild(script);
-}
 </script>
 <script type="text/javascript" src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js"></script>
 <script type="text/javascript" src="./web/org.openbravo.userinterface.smartclient/isomorphic/ISC_History.js"></script>