From 124a7a8d87c4f91d8d9d67b24258048a33c4717a Mon Sep 17 00:00:00 2001 From: srosse <none@none> Date: Mon, 1 Feb 2016 12:11:14 +0100 Subject: [PATCH] OO-1870: remove onclick and change target for download links in wiki --- .../wiki/gui/components/wikiToHtml/WikiMarkupRenderer.java | 2 +- src/main/webapp/static/js/openolat/wiki.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/olat/modules/wiki/gui/components/wikiToHtml/WikiMarkupRenderer.java b/src/main/java/org/olat/modules/wiki/gui/components/wikiToHtml/WikiMarkupRenderer.java index 85d1d0cee06..2db789b8f2d 100644 --- a/src/main/java/org/olat/modules/wiki/gui/components/wikiToHtml/WikiMarkupRenderer.java +++ b/src/main/java/org/olat/modules/wiki/gui/components/wikiToHtml/WikiMarkupRenderer.java @@ -93,7 +93,7 @@ public class WikiMarkupRenderer extends DefaultComponentRenderer { uri = URLDecoder.decode(uri, "utf-8"); input.setVirtualWiki(uri.substring(1, uri.length()-1)); if (iframePostEnabled) { - String targetUrl = " onclick='o_XHREvent(jQuery(this).attr(\"href\"),false,true); return false;'"; + String targetUrl = " onclick=\"o_XHREvent(jQuery(this).attr('href'),false,true); return false;\""; input.setURLTarget(targetUrl); } sb.append("<div style=\"min-height:"+ wikiComp.getMinHeight() +"px\" id=\""); diff --git a/src/main/webapp/static/js/openolat/wiki.js b/src/main/webapp/static/js/openolat/wiki.js index 8abde178882..43383f118c8 100644 --- a/src/main/webapp/static/js/openolat/wiki.js +++ b/src/main/webapp/static/js/openolat/wiki.js @@ -35,6 +35,7 @@ function changeAnchorTargets(id) { var pre = href.substr(0, href.indexOf(":1/")); var post = href.substr(href.indexOf(":1/")+3, href.length); anchor.attr("href", pre+":0/"+post); + anchor.prop('onclick', null).off('click'); } } else if (anchor.attr("class") == "edit" && anchor.attr("title").indexOf("Media:") != -1) { //media file not found href = href.substr(0, href.indexOf("Edit:topic")); -- GitLab