Spaces:
Running
Running
CRITICAL: bdpOpen uses native setter + setTimeout for button click
Browse files
app.py
CHANGED
|
@@ -963,9 +963,18 @@ window.bdpOpen=function(url,aid,sl){
|
|
| 963 |
window.location.hash='#/'+sl+'/'+aid;
|
| 964 |
try{localStorage.setItem('bdp_url_'+aid,url);}catch(e){}
|
| 965 |
var el=document.getElementById('article-url-input');
|
| 966 |
-
if(el){
|
| 967 |
-
|
| 968 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 969 |
window.scrollTo({top:0,behavior:'smooth'});
|
| 970 |
};
|
| 971 |
|
|
|
|
| 963 |
window.location.hash='#/'+sl+'/'+aid;
|
| 964 |
try{localStorage.setItem('bdp_url_'+aid,url);}catch(e){}
|
| 965 |
var el=document.getElementById('article-url-input');
|
| 966 |
+
if(el){
|
| 967 |
+
var ta=el.querySelector('textarea')||el.querySelector('input');
|
| 968 |
+
if(ta){
|
| 969 |
+
var d=Object.getOwnPropertyDescriptor(ta.tagName==='TEXTAREA'?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,'value');
|
| 970 |
+
if(d&&d.set)d.set.call(ta,url);else ta.value=url;
|
| 971 |
+
ta.dispatchEvent(new Event('input',{bubbles:true}));
|
| 972 |
+
}
|
| 973 |
+
}
|
| 974 |
+
setTimeout(function(){
|
| 975 |
+
var btn=document.getElementById('btn-read-article');
|
| 976 |
+
if(btn){var b=btn.querySelector('button');if(b)b.click();else btn.click();}
|
| 977 |
+
},100);
|
| 978 |
window.scrollTo({top:0,behavior:'smooth'});
|
| 979 |
};
|
| 980 |
|