Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,6 +28,11 @@ function run(inn) {
|
|
| 28 |
var frame_on = document.getElementById("frame" + String(inn));
|
| 29 |
frame_on.style.display = 'block';
|
| 30 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
</script>
|
| 32 |
""".replace("/abs/","/pdf/")
|
| 33 |
def search(q,rn):
|
|
@@ -37,12 +42,14 @@ def search(q,rn):
|
|
| 37 |
html=""
|
| 38 |
for i,c in enumerate(cont):
|
| 39 |
pdflink=c['id'].replace('/abs/','/pdf/')
|
| 40 |
-
html+=f"""<div class='card_div' id='id{i}' onclick="run({i})">
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
|
|
|
| 46 |
return(json.dumps(cont,indent=4)),html
|
| 47 |
with gr.Blocks(css=style,head=head) as b:
|
| 48 |
with gr.Group():
|
|
|
|
| 28 |
var frame_on = document.getElementById("frame" + String(inn));
|
| 29 |
frame_on.style.display = 'block';
|
| 30 |
}
|
| 31 |
+
function closefn(inn) {
|
| 32 |
+
console.log(inn);
|
| 33 |
+
var frame_off = document.getElementById("frame" + String(inn));
|
| 34 |
+
frame_off.style.display = 'none';
|
| 35 |
+
}
|
| 36 |
</script>
|
| 37 |
""".replace("/abs/","/pdf/")
|
| 38 |
def search(q,rn):
|
|
|
|
| 42 |
html=""
|
| 43 |
for i,c in enumerate(cont):
|
| 44 |
pdflink=c['id'].replace('/abs/','/pdf/')
|
| 45 |
+
html+=f"""<div class='card_div' id='id{i}' onclick="run({i})">
|
| 46 |
+
<div class='title_div'>{c['title']}</div>
|
| 47 |
+
<div style='color:white;'>{c['summary']}</div>
|
| 48 |
+
<div><a href='{pdflink}' target='_blank'>{pdflink}</a></div>
|
| 49 |
+
</div>
|
| 50 |
+
<div id=frame{i} class='frame_class'>
|
| 51 |
+
<div id=close{i} class='x_btn' onclick='closefn({i})'>X</div>
|
| 52 |
+
<iframe src="https://docs.google.com/viewer?url={c['id'].replace('/abs/','/pdf/')}&embedded=true" frameborder="0" height="1200px" width="100%"></iframe></div>"""
|
| 53 |
return(json.dumps(cont,indent=4)),html
|
| 54 |
with gr.Blocks(css=style,head=head) as b:
|
| 55 |
with gr.Group():
|