Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,6 +29,8 @@ style="""
|
|
29 |
padding: 0 10px;
|
30 |
border-radius: 10px 10px 0 0;
|
31 |
float: right;
|
|
|
|
|
32 |
}
|
33 |
.read_btn{
|
34 |
font-size: xx-large;
|
@@ -38,6 +40,8 @@ style="""
|
|
38 |
padding: 0 10px;
|
39 |
border-radius: 10px 10px 0 0;
|
40 |
float: left;
|
|
|
|
|
41 |
}
|
42 |
.frame_class{
|
43 |
display:none;
|
@@ -46,14 +50,25 @@ style="""
|
|
46 |
|
47 |
head = """
|
48 |
<script>
|
49 |
-
function run(inn) {
|
50 |
console.log(inn);
|
51 |
var frame_on = document.getElementById("frame" + String(inn));
|
52 |
frame_on.style.display = 'block';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
function closefn(inn) {
|
55 |
console.log(inn);
|
56 |
var frame_off = document.getElementById("frame" + String(inn));
|
|
|
|
|
57 |
frame_off.style.display = 'none';
|
58 |
}
|
59 |
function readfn(inn,url) {
|
@@ -80,7 +95,7 @@ def search(q,rn,st):
|
|
80 |
html=""
|
81 |
for i,c in enumerate(cont):
|
82 |
pdflink=c['id'].replace('/abs/','/pdf/').replace('http:','https:')
|
83 |
-
html+=f"""<div class='card_div' id='id{i}' onclick="run({i})">
|
84 |
<div class='title_div'>{c['title']}</div>
|
85 |
<div style='color:white;'>{c['summary']}</div>
|
86 |
<div><a href='{pdflink}' target='_blank'>{pdflink}</a></div>
|
@@ -89,7 +104,8 @@ def search(q,rn,st):
|
|
89 |
<div id=read{i} class='read_btn' onclick="readfn('{i}','{pdflink}')">Read</div>
|
90 |
<div id=close{i} class='x_btn' onclick='closefn({i})'>X</div>
|
91 |
<div id=aud{i}></div>
|
92 |
-
<
|
|
|
93 |
return html
|
94 |
def next_show(cur):
|
95 |
new=int(cur)+10
|
|
|
29 |
padding: 0 10px;
|
30 |
border-radius: 10px 10px 0 0;
|
31 |
float: right;
|
32 |
+
cursor: pointer;
|
33 |
+
|
34 |
}
|
35 |
.read_btn{
|
36 |
font-size: xx-large;
|
|
|
40 |
padding: 0 10px;
|
41 |
border-radius: 10px 10px 0 0;
|
42 |
float: left;
|
43 |
+
cursor: pointer;
|
44 |
+
|
45 |
}
|
46 |
.frame_class{
|
47 |
display:none;
|
|
|
50 |
|
51 |
head = """
|
52 |
<script>
|
53 |
+
function run(inn,url) {
|
54 |
console.log(inn);
|
55 |
var frame_on = document.getElementById("frame" + String(inn));
|
56 |
frame_on.style.display = 'block';
|
57 |
+
var framediv = document.getElementById("framediv" + String(inn));
|
58 |
+
let api = url;
|
59 |
+
console.log(api);
|
60 |
+
framediv.innerHTML = "";
|
61 |
+
const iframediv = document.createElement('iframe');
|
62 |
+
iframediv.src = api;
|
63 |
+
iframediv.width = '100%';
|
64 |
+
iframediv.height = '1000px';
|
65 |
+
framediv.appendChild(iframediv);
|
66 |
}
|
67 |
function closefn(inn) {
|
68 |
console.log(inn);
|
69 |
var frame_off = document.getElementById("frame" + String(inn));
|
70 |
+
document.getElementById("aud" + String(inn)).innerHTML = "";
|
71 |
+
document.getElementById("framediv" + String(inn)).innerHTML = "";
|
72 |
frame_off.style.display = 'none';
|
73 |
}
|
74 |
function readfn(inn,url) {
|
|
|
95 |
html=""
|
96 |
for i,c in enumerate(cont):
|
97 |
pdflink=c['id'].replace('/abs/','/pdf/').replace('http:','https:')
|
98 |
+
html+=f"""<div class='card_div' id='id{i}' onclick="run('{i}','{pdflink}')">
|
99 |
<div class='title_div'>{c['title']}</div>
|
100 |
<div style='color:white;'>{c['summary']}</div>
|
101 |
<div><a href='{pdflink}' target='_blank'>{pdflink}</a></div>
|
|
|
104 |
<div id=read{i} class='read_btn' onclick="readfn('{i}','{pdflink}')">Read</div>
|
105 |
<div id=close{i} class='x_btn' onclick='closefn({i})'>X</div>
|
106 |
<div id=aud{i}></div>
|
107 |
+
<div id=frmdiv{i}></div>
|
108 |
+
</div>"""
|
109 |
return html
|
110 |
def next_show(cur):
|
111 |
new=int(cur)+10
|