Omnibus commited on
Commit
3edcdca
·
1 Parent(s): 0f54052

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -93,7 +93,7 @@ def details_fn(query):
93
  link_list.append(img['src'])
94
  image_out += f"""
95
  <div class='im_each'>
96
- <img src={img['src']}>
97
  </div>
98
  """
99
  print (img['src'])
@@ -101,7 +101,7 @@ def details_fn(query):
101
  except Exception as e:
102
  format_out = "None"
103
  print (e)
104
- return out,format_out,link_list,link_list
105
 
106
  def first():
107
  out = '''<h1>Loading'''
@@ -166,12 +166,16 @@ def format_t(inp):
166
  </body>
167
  </html>'''
168
  return out
169
- ab=0
170
- def up_im():
171
- out=[]
172
- for ea in range(10):
173
- out.append(gr.Image())
174
- return out
 
 
 
 
175
  with gr.Blocks() as app:
176
  gr.HTML("""<h1>Interactive Social Media Card Maker</h1>""")
177
  gr.HTML("""<h3><b>Step 1:</b> Enter a URL with Iframe capability</h3>""")
@@ -190,5 +194,5 @@ with gr.Blocks() as app:
190
  link_list=gr.Textbox()
191
 
192
  search_btn.click(search_fn,[search_box,num_return],output)
193
- btn.click(first,None,output).then(test,input,output).then(details_fn,input,[details,images,im_list,link_list])
194
  app.launch()
 
93
  link_list.append(img['src'])
94
  image_out += f"""
95
  <div class='im_each'>
96
+ <img onclick="func1({img['src']})" src={img['src']}>
97
  </div>
98
  """
99
  print (img['src'])
 
101
  except Exception as e:
102
  format_out = "None"
103
  print (e)
104
+ return out,format_out
105
 
106
  def first():
107
  out = '''<h1>Loading'''
 
166
  </body>
167
  </html>'''
168
  return out
169
+
170
+ load_js = """
171
+ const func1 = function(this) {
172
+ console.log(this);
173
+ return [this];
174
+ }
175
+ """
176
+
177
+
178
+
179
  with gr.Blocks() as app:
180
  gr.HTML("""<h1>Interactive Social Media Card Maker</h1>""")
181
  gr.HTML("""<h3><b>Step 1:</b> Enter a URL with Iframe capability</h3>""")
 
194
  link_list=gr.Textbox()
195
 
196
  search_btn.click(search_fn,[search_box,num_return],output)
197
+ btn.click(first,None,output).then(test,input,output).then(details_fn,input,[details,images,im_list,link_list],_js=load_js)
198
  app.launch()