yizhangliu commited on
Commit
949c336
·
1 Parent(s): a7d44f4

Update share_btn.py

Browse files
Files changed (1) hide show
  1. share_btn.py +9 -1
share_btn.py CHANGED
@@ -51,19 +51,27 @@ share_js = """async () => {
51
  }
52
  })
53
  );
54
-
55
  const urls = await Promise.all(files.map((f) => uploadFile(f)));
 
56
  const htmlImgs = urls.map(url => `<img src='${url}' width='400' height='400'>`);
 
57
  const descriptionMd = `<div style='display: flex; flex-wrap: wrap; column-gap: 0.75rem;'>
58
  ${htmlImgs.join(`\n`)}
59
  </div>`;
 
60
  const params = new URLSearchParams({
61
  title: promptTxt,
62
  description: descriptionMd,
63
  });
 
64
  const paramsStr = params.toString();
65
  window.open(`https://huggingface.co/spaces/yizhangliu/ImgCleaner/discussions/new?${paramsStr}`, '_blank');
 
66
  shareBtnEl.style.removeProperty('pointer-events');
 
67
  shareIconEl.style.removeProperty('display');
 
68
  loadingIconEl.style.display = 'none';
 
69
  }"""
 
51
  }
52
  })
53
  );
54
+ console.log(files);
55
  const urls = await Promise.all(files.map((f) => uploadFile(f)));
56
+ console.log('liuyz_1___');
57
  const htmlImgs = urls.map(url => `<img src='${url}' width='400' height='400'>`);
58
+ console.log('liuyz_2___');
59
  const descriptionMd = `<div style='display: flex; flex-wrap: wrap; column-gap: 0.75rem;'>
60
  ${htmlImgs.join(`\n`)}
61
  </div>`;
62
+ console.log('liuyz_3___');
63
  const params = new URLSearchParams({
64
  title: promptTxt,
65
  description: descriptionMd,
66
  });
67
+ console.log(`liuyz_4___${window.location.href}`);
68
  const paramsStr = params.toString();
69
  window.open(`https://huggingface.co/spaces/yizhangliu/ImgCleaner/discussions/new?${paramsStr}`, '_blank');
70
+ console.log('liuyz_5___');
71
  shareBtnEl.style.removeProperty('pointer-events');
72
+ console.log('liuyz_6___');
73
  shareIconEl.style.removeProperty('display');
74
+ console.log('liuyz_7___');
75
  loadingIconEl.style.display = 'none';
76
+ console.log('liuyz_8___');
77
  }"""