Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function QuoteText(postId,element){
- if(document.getElementById){
- var username=document.getElementById('a'+postId).firstChild.nodeValue;
- var text=getSel();
- if(!text){
- var temp=document.getElementById('p'+postId);
- if(typeof temp.textContent!='undefined') text=temp.textContent;
- else if(typeof temp.innerText!='undefined') text=temp.innerText;
- else if(temp.innerHTML) {
- text=temp.innerHTML.replace(/<br>\n?/gi,"\n").replace(/<[^>]*>/gi,'').replace(/</g,'<').replace(/>/g,'>');
- }
- }
- console.log(element);
- if(text){
- // Detta var det enda som behövde fixas, selectorn för hur Jquery hittar textarean för att pastea in den text som ska quoteas
- let cont=$("#composeform textarea#message");
- cont[0].value+='<quote author="'+username+'">'+text.trim()+'</quote>';
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement