diff --git a/index.php b/index.php index e8fb486..9299b8f 100644 --- a/index.php +++ b/index.php @@ -65,7 +65,7 @@ define('CONN', (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "")?'http':'ht


Loading..


Give it a try! - + diff --git a/js/http2pic.js b/js/http2pic.js index 91dfd48..d0f5e2c 100644 --- a/js/http2pic.js +++ b/js/http2pic.js @@ -1,20 +1,30 @@ -function web2pic() -{ - $("#showcase_button").attr("disabled","true"); - var url = $("#showcase_url").val(); - var urlenc = encodeURIComponent(url); - var imageURL = "api.php?js=no&token=0e316498db6211f940951e"+(urlenc)+"8be8cdf7089770&type=$type&viewport=1200x330&url="+urlenc; - //$("#intro-header").css('background-image', 'url(\'/img/loading.gif\')'); - - $("#loading").show(); - - - $("#preloader").attr('src',imageURL); - $("#preloader").load(function() { - $("#intro-header").css('background-image', 'url(\'' + imageURL + '\')'); - $("#loading").hide(); - }); - console.log(imageURL); +$(function() { + function web2pic(url) + { + $("#showcase_button").attr("disabled","true"); + var urlenc = encodeURIComponent(url); + var imageURL = "api.php?js=no&token=0e316498db6211f940951e"+(urlenc)+"8be8cdf7089770&type=$type&viewport=1200x330&url="+urlenc; + //$("#intro-header").css('background-image', 'url(\'/img/loading.gif\')'); + + $("#loading").show(); - setTimeout(function(){$("#showcase_button").removeAttr("disabled");},2000); -} \ No newline at end of file + console.log(imageURL); + + $("#preloader").attr('src',imageURL); + $("#preloader").load(function() { + $("#intro-header").css('background-image', 'url(\'' + imageURL + '\')'); + $("#loading").hide(); + $("#showcase_button").removeAttr("disabled"); + }); + } + + $("#showcase_button").click(function() { + web2pic($('#showcase_url').val()); + }); + + $("#showcase_url").keypress(function(e) { + if(e.keyCode === 13) { + web2pic($("#showcase_url").val()); + } + }); +}); \ No newline at end of file