'+data[i]+'
Get Domain
';} document.getElementById('results').innerHTML=outputs;removeLoader('.main #submit');isProcessing=false;}catch(error){console.error(error);removeLoader('.main #submit');isProcessing=false;}} function ai(prompt){return new Promise((resolve,reject)=>{fetch("/ai",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt})}).then(response=>response.json()).then(data=>{let taskStatus="PENDING";const{task_id}=data;const interval=setInterval(()=>{fetch(`/task_status/${task_id}`).then(response=>response.json()).then(statusData=>{taskStatus=statusData.state;if(taskStatus!=="PENDING"){clearInterval(interval);if(taskStatus==="SUCCESS"){const result=statusData.result;resolve(result);}else{reject(new Error(`Task failed with status ${taskStatus}`));}}}).catch(error=>{clearInterval(interval);reject(error);});},1000);}).catch(error=>{reject(error);});});} $('#passwordless').submit(function(e){e.preventDefault();var email=$('#passwordless input[name="email"]').val();loader('#passwordless button');if(email.indexOf('@')==-1||email.indexOf('.')==-1){trayAlert('Please enter a valid email address.');removeLoader('#passwordless button');return;} $.ajax({url:"/passwordless",method:"POST",data:{email:email},success:function(data){if(data.status=='success'){$('#passwordless').hide();$('.form-flash').html('Click the link in your email to login.');$('.form-flash').addClass('preauth');}else{formFlash(data.error,'error');} removeLoader('#passwordless button');}});});function formFlash(message,type){var formFlashElement=$('.form-flash');formFlashElement.addClass(type);formFlashElement.html(message);formFlashElement.show();setTimeout(function(){formFlashElement.fadeOut(400,function(){formFlashElement.removeClass(type);});},2500);} function logout(){$.ajax({url:"/logout",method:"POST",success:function(data){getUser();}});};function closeModal(){var modal=document.getElementById("loginModal");modal.style.display="none";$('.form-flash').html('');$('#passwordless').show();$('.form-flash').removeClass('preauth');} function loginModal(){var modal=document.getElementById("loginModal");modal.style.display="block";window.onclick=function(event){if(event.target==modal){modal.style.display="none";$('.form-flash').html('');$('#passwordless').show();$('.form-flash').removeClass('preauth');}}} function search(){$('.faves-container').html('');$('.favorites').hide();$('.search').show();$('.results').html('');} function getUser(){return fetch('/get-user').then(response=>response.json()).then(user=>{if(user.email){window.user.logged_in=user.logged_in;window.user.verified=user.verified;$('.account').hide();$('.logout').show();$('.showfaves').show();$('.search-nav').show();}else{window.user.logged_in=false;window.user.verified=false;$('.account').show();$('.logout').hide();$('.showfaves').hide();$('.search-nav').hide();$('.favorites').hide();$('.search').show();$('.results').html('');}});} function trayAlert(message){var trayAlert=$('#trayAlert');trayAlert.html(message);trayAlert.addClass('show');setTimeout(function(){trayAlert.removeClass('show');},2500);} function showFaves(){$('.search').hide();$('.favorites').show();loader('.faves-container');$.ajax({url:"/get-favorites",method:"get",success:function(data){var html='';var favorites=data.favorites;if(favorites.length==0){html+='
You have no favorites yet.
';} for(var i=0;i
'+favorites[i]+'
Get Domain
';} removeLoader('.faves-container');$('.faves-container').html(html);}});} $(document).on('click','.fave',async function(e){e.preventDefault();if(window.user.logged_in!==true){await getUser();if(window.user.logged_in!==true){$('#loginModal').show();trayAlert('Please login to save favorites','message');return;}} var url=$(this).parent().attr('data-url');var fave=$(this);if(fave.hasClass('selected')){var action='remove';fave.removeClass('selected');}else{var action='add';fave.addClass('selected');} $.ajax({url:"/toggle-favorite",method:"POST",data:{url:url},success:function(data){if(data.success){}else{trayAlert(data.error);}}});});if(""){trayAlert("");} getUser(); 主站蜘蛛池模板: 日韩欧美一区二区三区在线播放 | 日韩三区在线观看 | 成年免费在线观看 | 亚洲精品99 | 国产小视频在线 | 亚洲成人免费视频 | 欧美一区 | 国产一区二区三区 | 日本特黄a级高清免费大片 成年人黄色小视频 | 国产极品车模吞精高潮呻吟 | 成人av播放 | 蜜臀网 | 午夜大片| 久久久在线视频 | av网站在线播放 | 精品91久久| 婷婷丁香在线视频 | 午夜影视大全 | 中文字幕第一页在线 | 精品国产综合 | 一本综合久久 | 欧美一区二区三区在线播放 | 欧美日韩在线一区二区 | 精品国产伦一区二区三区观看体验 | 欧美精品 在线观看 | 久久精品亚洲一区二区三区浴池 | 日本小视频网站 | 欧美在线视频一区二区 | 一个色在线 | 国产精品区一区二区三 | 国产精品高潮呻吟久久av黑人 | 国产成在线观看免费视频 | 91精品国产综合久久久动漫日韩 | 久久精品视频99 | 久久福利 | 国产日韩欧美精品 | 精品96久久久久久中文字幕无 | 91在线色视频 | 国产精品一区二区免费 | 麻豆久久久| 色婷婷久久久久swag精品 |