aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-01-18 01:51:19 +0000
committerScott González <scott.gonzalez@gmail.com>2009-01-18 01:51:19 +0000
commitbf73f8c5bec7c097fe0cf36c000328c40423641d (patch)
treeb3a85fb2c5284067ced73868c479ea544c0bf0eb
parentf375f053f439b30438f214066d7444d5ef29e66b (diff)
downloadjquery-ui-bf73f8c5bec7c097fe0cf36c000328c40423641d.tar.gz
jquery-ui-bf73f8c5bec7c097fe0cf36c000328c40423641d.zip
Demos: Fixed #3852: Add in extra directory level for href and src attributes when demos are loaded from demos/index.html.
-rw-r--r--demos/index.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/demos/index.html b/demos/index.html
index 9680fe787..64cb6a1a6 100644
--- a/demos/index.html
+++ b/demos/index.html
@@ -150,6 +150,7 @@
}
function loadDemo(path) {
+ var directory = path.match(/([^\/]+)\/[^\/\.]+\.html$/)[1];
$.get(path, function(data) {
data = data.replace(/<script.*>.*<\/script>/ig,""); // Remove script tags
@@ -159,6 +160,7 @@
data = data.replace(/<\/?head.*>/ig,""); //Remove head tag
data = data.replace(/<\/?!doctype.*>/ig,""); //Remove doctype
data = data.replace(/<title.*>.*<\/title>/ig,""); // Remove title tags
+ data = data.replace(/((href|src)=["'])(?!(http|#))/ig, "$1" + directory + "/");
$('#demo-frame').empty().html(data);
$('#demo-link a').attr('href', path);