X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/57041b345ca24bde1c6e5b24bbc888db35bd8b99..bbc0bb7c3658a020da0a291249cc3da71a57bf9a:/src/redakcja/static/js/wiki/xslt.js

diff --git a/src/redakcja/static/js/wiki/xslt.js b/src/redakcja/static/js/wiki/xslt.js
index 9da4e116..b1adc8ec 100644
--- a/src/redakcja/static/js/wiki/xslt.js
+++ b/src/redakcja/static/js/wiki/xslt.js
@@ -17,21 +17,20 @@ function withStylesheets(code_block, onError)
     if (!xml2htmlStylesheet) {
     	$.blockUI({message: 'Ładowanie arkuszy stylów...'});
     	$.ajax({
-        	url: STATIC_URL + 'xsl/wl2html_client.xsl?20201110',
-        	dataType: 'xml',
-        	timeout: 10000,
-        	success: function(data) {
+            url: STATIC_URL + 'xsl/wl2html_client.xsl?210129',
+            dataType: 'xml',
+            timeout: 10000,
+            success: function(data) {
             	xml2htmlStylesheet = createXSLT(data);
                 $.unblockUI();
-				code_block();
-
+		code_block();
             },
-			error: onError
+	    error: onError
         })
     }
-	else {
-		code_block();
-	}
+    else {
+	code_block();
+    }
 }
 
 
@@ -61,6 +60,20 @@ function xml2html(options) {
             source.text('');
             options.error(error.text(), source_text);
         } else {
+            let galleryUrl = new URL(
+                options.base,
+                window.location.href
+            );
+            $("img", $(doc.childNodes)).each(function() {
+                $(this).attr(
+                    'src',
+                    new URL(
+                        $(this).attr('src'),
+                        galleryUrl
+                    )
+                );
+            })
+
             options.success(doc.childNodes);
 
             $.themes.withCanon(function(canonThemes) {