]> git.uio.no Git - usit-rt.git/blobdiff - share/static/js/util.js
Master to 4.2.8
[usit-rt.git] / share / static / js / util.js
index d4a53c80e20e4eb1a774baff97e19d8cdb3efb98..b665c0e2a05ce62e834a3b7b2f869323625dac9f 100644 (file)
@@ -230,6 +230,7 @@ function textToHTML(value) {
                 .replace(/\n/g,   "\n<br />");
 };
 
+CKEDITOR_BASEPATH=RT.Config.WebPath + "/static/RichText/";
 function ReplaceAllTextareas() {
     var sAgent = navigator.userAgent.toLowerCase();
     if (!CKEDITOR.env.isCompatible ||
@@ -243,7 +244,7 @@ function ReplaceAllTextareas() {
 
     for (var i=0; i < allTextAreas.length; i++) {
         var textArea = allTextAreas[i];
-        if (jQuery(textArea).hasClass("messagebox")) {
+        if (jQuery(textArea).hasClass("messagebox richtext")) {
             // Turn the original plain text content into HTML
             var type = jQuery("#"+textArea.name+"Type");
             if (type.val() != "text/html")
@@ -253,7 +254,6 @@ function ReplaceAllTextareas() {
             type.val("text/html");
 
             CKEDITOR.replace(textArea.name,{ width: '100%', height: RT.Config.MessageBoxRichTextHeight });
-            CKEDITOR.basePath = RT.Config.WebPath + "/static/RichText/";
 
             jQuery("#" + textArea.name + "___Frame").addClass("richtext-editor");
         }
@@ -341,4 +341,5 @@ jQuery(function() {
             return true;
         });
     });
+    ReplaceAllTextareas();
 });