From c25bf935be54df16e25ed6278b0fa4bcfdfcf24e Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Wed, 7 Aug 2013 11:02:16 +0200
Subject: [PATCH] OO-531: fix error message in browsers console related to the
 glossary css file

---
 .../generic/iframe/IFrameDeliveryMapper.java       | 14 +++++++-------
 .../static/js/openolat/glossaryhighlighter.css     |  1 +
 src/main/webapp/static/js/openolat/iframe.js       |  4 ++++
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/olat/core/gui/control/generic/iframe/IFrameDeliveryMapper.java b/src/main/java/org/olat/core/gui/control/generic/iframe/IFrameDeliveryMapper.java
index 102c673f365..bc21b8a0430 100644
--- a/src/main/java/org/olat/core/gui/control/generic/iframe/IFrameDeliveryMapper.java
+++ b/src/main/java/org/olat/core/gui/control/generic/iframe/IFrameDeliveryMapper.java
@@ -310,7 +310,7 @@ public class IFrameDeliveryMapper implements Mapper, Serializable {
 			}
 			if (customCssURL != null) {
 				// add the custom  CSS, e.g. the course css that overrides the standard content css
-				sb.appendCss(customCssURL);				
+				sb.appendCss(customCssURL, "customcss");				
 			}
 		}
 		
@@ -560,7 +560,7 @@ public class IFrameDeliveryMapper implements Mapper, Serializable {
 			appendStaticJs("js/jquery/jquery-1.9.1.min.js");
 			appendStaticJs("js/jshashtable-2.1_src.js");
 			appendStaticJs("js/jquery/ui/jquery-ui-1.10.2.custom.min.js");
-		  appendStaticCss("js/jquery/ui/jquery-ui-1.10.2.custom.min.css");
+		  appendStaticCss("js/jquery/ui/jquery-ui-1.10.2.custom.min.css", "jqueryuicss");
 		  jqueryLoaded = true;
 		}
 
@@ -578,7 +578,7 @@ public class IFrameDeliveryMapper implements Mapper, Serializable {
 		
 		public void appendGlossary() {
 			appendStaticJs("js/openolat/glossaryhighlighter.js");
-			appendStaticJs("js/openolat/glossaryhighlighter.css");
+			appendStaticCss("js/openolat/glossaryhighlighter.css", "textmarkercss");
 		}
 
 		public void appendStaticJs(String javascript) {
@@ -587,16 +587,16 @@ public class IFrameDeliveryMapper implements Mapper, Serializable {
 			append("\"></script>\n");
 		}
 		
-		public void appendStaticCss(String css) {
-			append("\n<link rel=\"stylesheet\" type=\"text/css\" id=\"textmarkercss\" href=\"");
+		public void appendStaticCss(String css, String id) {
+			append("\n<link rel=\"stylesheet\" type=\"text/css\" id=\"").append(id).append("\" href=\"");
 		  StaticMediaDispatcher.renderStaticURI(this, css);
 		  append("\"");
 			if (docType != null && docType.indexOf("XHTML") > 0) append("/"); // close tag only when xhtml to validate
 			append(">\n");
 		}
 		
-		public void appendCss(String css) {
-			append("\n<link rel=\"stylesheet\" type=\"text/css\" id=\"textmarkercss\" href=\"").append(css).append("\"");
+		public void appendCss(String css, String id) {
+			append("\n<link rel=\"stylesheet\" type=\"text/css\" id=\"").append(id).append("\" href=\"").append(css).append("\"");
 			if (docType != null && docType.indexOf("XHTML") > 0) append("/"); // close tag only when xhtml to validate
 			append(">\n");
 		}
diff --git a/src/main/webapp/static/js/openolat/glossaryhighlighter.css b/src/main/webapp/static/js/openolat/glossaryhighlighter.css
index 358629ca75f..51ca6270460 100644
--- a/src/main/webapp/static/js/openolat/glossaryhighlighter.css
+++ b/src/main/webapp/static/js/openolat/glossaryhighlighter.css
@@ -1,3 +1,4 @@
+@charset "UTF-8";
 .o_tm_glossary { border-bottom: 1px dotted #666699; }
 .o_tm_yellow { background-color: #FFFF66; }
 .o_tm_blue { background-color: #33FFFF; }
diff --git a/src/main/webapp/static/js/openolat/iframe.js b/src/main/webapp/static/js/openolat/iframe.js
index e19dcb3314e..f1ca2b047de 100644
--- a/src/main/webapp/static/js/openolat/iframe.js
+++ b/src/main/webapp/static/js/openolat/iframe.js
@@ -32,6 +32,10 @@ function b_getMainWindow(mywin) {
 	return b_getMainWindow(mywin.parent);
 }
 
+function b_hideExtMessageBox() {
+	//for compatibility
+}
+
 function b_sizeIframe() {
 //console.log("b_sizeIframe window.name=" + window.name + " b_iframeid=" + b_iframeid);
 	try {
-- 
GitLab