Update share_btn.py
Browse files- share_btn.py +2 -5
share_btn.py
CHANGED
@@ -55,14 +55,11 @@ share_js = """async () => {
|
|
55 |
});
|
56 |
}
|
57 |
const gradioEl = document.querySelector("gradio-app").shadowRoot || document.querySelector('body > gradio-app');
|
|
|
58 |
const inputImgEl = gradioEl.querySelector('#input-img img');
|
59 |
const outputSound = gradioEl.querySelector('#sound-output video');
|
60 |
const outputSound_src = gradioEl.querySelector('#sound-output video').src;
|
61 |
const outputSound_name = outputSound_src.split('/').pop();
|
62 |
-
let titleTxt = outputSound_name;
|
63 |
-
//if(titleTxt.length > 100){
|
64 |
-
// titleTxt = titleTxt.slice(0, 100) + ' ...';
|
65 |
-
//}
|
66 |
const shareBtnEl = gradioEl.querySelector('#share-btn');
|
67 |
const shareIconEl = gradioEl.querySelector('#share-btn-share-icon');
|
68 |
const loadingIconEl = gradioEl.querySelector('#share-btn-loading-icon');
|
@@ -85,7 +82,7 @@ share_js = """async () => {
|
|
85 |
|
86 |
`;
|
87 |
const params = new URLSearchParams({
|
88 |
-
title:
|
89 |
description: descriptionMd,
|
90 |
});
|
91 |
const paramsStr = params.toString();
|
|
|
55 |
});
|
56 |
}
|
57 |
const gradioEl = document.querySelector("gradio-app").shadowRoot || document.querySelector('body > gradio-app');
|
58 |
+
const captionTxt = gradioEl.querySelector('#text-caption input').value;
|
59 |
const inputImgEl = gradioEl.querySelector('#input-img img');
|
60 |
const outputSound = gradioEl.querySelector('#sound-output video');
|
61 |
const outputSound_src = gradioEl.querySelector('#sound-output video').src;
|
62 |
const outputSound_name = outputSound_src.split('/').pop();
|
|
|
|
|
|
|
|
|
63 |
const shareBtnEl = gradioEl.querySelector('#share-btn');
|
64 |
const shareIconEl = gradioEl.querySelector('#share-btn-share-icon');
|
65 |
const loadingIconEl = gradioEl.querySelector('#share-btn-loading-icon');
|
|
|
82 |
|
83 |
`;
|
84 |
const params = new URLSearchParams({
|
85 |
+
title: captionTxt,
|
86 |
description: descriptionMd,
|
87 |
});
|
88 |
const paramsStr = params.toString();
|