Skip to content
Snippets Groups Projects
Commit aab709b4 authored by srosse's avatar srosse
Browse files

OO-2217: update the url converter to make absolute / url, but cut the mapper...

OO-2217: update the url converter to make absolute / url, but cut the mapper url of images and video...
parent 1f0550de
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ import org.olat.core.gui.translator.Translator; ...@@ -43,6 +43,7 @@ import org.olat.core.gui.translator.Translator;
import org.olat.core.helpers.Settings; import org.olat.core.helpers.Settings;
import org.olat.core.logging.OLog; import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing; import org.olat.core.logging.Tracing;
import org.olat.core.util.CodeHelper;
import org.olat.core.util.Formatter; import org.olat.core.util.Formatter;
import org.olat.core.util.UserSession; import org.olat.core.util.UserSession;
import org.olat.core.util.Util; import org.olat.core.util.Util;
...@@ -629,7 +630,7 @@ public class RichTextConfiguration implements Disposable { ...@@ -629,7 +630,7 @@ public class RichTextConfiguration implements Disposable {
} else { } else {
// Add classname to the file path to remove conflicts with other // Add classname to the file path to remove conflicts with other
// usages of the same file path // usages of the same file path
mapperID = this.getClass().getSimpleName() + ":" + mapperID; mapperID = this.getClass().getSimpleName() + ":" + mapperID + ":" + CodeHelper.getRAMUniqueID();
contentMapperKey = CoreSpringFactory.getImpl(MapperService.class).register(usess, mapperID, contentMapper); contentMapperKey = CoreSpringFactory.getImpl(MapperService.class).register(usess, mapperID, contentMapper);
} }
......
...@@ -79,9 +79,12 @@ var BTinyHelper = { ...@@ -79,9 +79,12 @@ var BTinyHelper = {
// 2) http://localhost/olat/classpath/62x/org.olat.core.gui.components.form.flexible.impl.elements.richText/js/tinymce/ // 2) http://localhost/olat/classpath/62x/org.olat.core.gui.components.form.flexible.impl.elements.richText/js/tinymce/
// 3) http://localhost/olat/url/RepositoryEntry/27361280/ (REST URL and permalinks) // 3) http://localhost/olat/url/RepositoryEntry/27361280/ (REST URL and permalinks)
// 4) http://localhost/olat/auth/abc/go?xyz (old jump in URL's) // 4) http://localhost/olat/auth/abc/go?xyz (old jump in URL's)
} else { } else if(url.indexOf('/m/') == 0) {
// convert to relative path using TinyMCE standard conversion // convert media
url = editor.documentBaseURI.toRelative(url); var index = url.indexOf('/',4);
url = url.substring(index + 1, url.lengths);//remove /m/{32 characters of mapper id}/
} else if(url.indexOf('http://') == 0 || url.indexOf('https://') == 0) {
url = editor.documentBaseURI.toAbsolute(url, true);
} }
} else { } else {
// Convert to absolute // Convert to absolute
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment