Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -85,6 +85,7 @@ def details_fn(query):
|
|
85 |
border-width: medium;
|
86 |
}
|
87 |
</style>
|
|
|
88 |
<div class='im_container'>
|
89 |
"""
|
90 |
images = soup.findAll('img')
|
@@ -172,12 +173,17 @@ load_js = """
|
|
172 |
func = function(a,b) {
|
173 |
console.log(a);
|
174 |
console.log(b);
|
175 |
-
var vv = document.getElementById(
|
176 |
-
vv.
|
177 |
-
return[ab];
|
178 |
}
|
179 |
"""
|
180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
182 |
|
183 |
with gr.Blocks() as app:
|
@@ -196,8 +202,9 @@ with gr.Blocks() as app:
|
|
196 |
inp_im=gr.Textbox(scale=1, label="Drag Image Here")
|
197 |
images = gr.HTML("""""")
|
198 |
with gr.Row() as im_row:
|
199 |
-
|
200 |
link_list=gr.Textbox()
|
|
|
201 |
app.load(None,None,link_list,js=load_js)
|
202 |
images.change(None,None,link_list)
|
203 |
search_btn.click(search_fn,[search_box,num_return],output)
|
|
|
85 |
border-width: medium;
|
86 |
}
|
87 |
</style>
|
88 |
+
<div id='txt_box'></div>
|
89 |
<div class='im_container'>
|
90 |
"""
|
91 |
images = soup.findAll('img')
|
|
|
173 |
func = function(a,b) {
|
174 |
console.log(a);
|
175 |
console.log(b);
|
176 |
+
var vv = document.getElementById("txt_box");
|
177 |
+
vv.innerHTML=a;
|
|
|
178 |
}
|
179 |
"""
|
180 |
+
link_js="""
|
181 |
+
function() {
|
182 |
+
const link_url = document.getElementById('txt_box').innerHTML;
|
183 |
+
console.log(link_url);
|
184 |
+
return [link_url];
|
185 |
+
}
|
186 |
+
"""
|
187 |
|
188 |
|
189 |
with gr.Blocks() as app:
|
|
|
202 |
inp_im=gr.Textbox(scale=1, label="Drag Image Here")
|
203 |
images = gr.HTML("""""")
|
204 |
with gr.Row() as im_row:
|
205 |
+
txt_btn=gr.Button("Link")
|
206 |
link_list=gr.Textbox()
|
207 |
+
txt_btn.click(None,None,link_list,js=link_js)
|
208 |
app.load(None,None,link_list,js=load_js)
|
209 |
images.change(None,None,link_list)
|
210 |
search_btn.click(search_fn,[search_box,num_return],output)
|