Yang Gu commited on
Commit
49106e9
·
1 Parent(s): 07cbb01

Handle HF url

Browse files
Files changed (1) hide show
  1. main.js +5 -1
main.js CHANGED
@@ -32391,7 +32391,11 @@ function setSampleIFrame(demoInfo, search = '') {
32391
  demoContainerElem.innerHTML = '';
32392
  if (filename) {
32393
  const src = url || `${filename}${search}`;
32394
- demoContainerElem.appendChild(createElem('iframe', { src }));
 
 
 
 
32395
  demoContainerElem.style.height = '100%';
32396
  // hide intro and show demo
32397
  introElem.style.display = 'none';
 
32391
  demoContainerElem.innerHTML = '';
32392
  if (filename) {
32393
  const src = url || `${filename}${search}`;
32394
+ if (window.location.origin.includes("hf")) {
32395
+ demoContainerElem.appendChild(createElem('iframe', { `/${src}` }));
32396
+ } else {
32397
+ demoContainerElem.appendChild(createElem('iframe', { src }));
32398
+ }
32399
  demoContainerElem.style.height = '100%';
32400
  // hide intro and show demo
32401
  introElem.style.display = 'none';