(function(c){vark={container:".urlive-container",target:"_blank",imageSize:"auto",render:!0,disableClick:!1,regexp:/((https?:\/\/)?[\w-@]+(\.[a-z]+)+\.?(:\d+)?(\/\S*)?)/i,yqlSelect:"*",callbacks:{onStart:function(){},onSuccess:function(){},onFail:function(){},noData:function(){},onLoadEnd:function(){},imgError:function(){},onClick:function(){}}},l=function(a){vare=RegExp(window.location.protocol+"//"+window.location.hostname),g="http"+(/^https/.test(window.location.protocol)?"s":"")+"://query.yahooapis.com/v1/public/yql?callback=?";returnfunction(d){varb=/^https?:\/\//i.test(d.url)?d.url:window.location.protocol+"//"+d.url;/get/i.test(d.type)&&!/json/i.test(d.dataType)&&!e.test(b)&&/:\/\//.test(b)&&(d.url=g,d.dataType="json",d.data={q:'select {SELECT} from html where url="{URL}" and xpath="*" and compat="html5"'.replace("{SELECT}",d.yqlSelect).replace("{URL}",b+(d.data?(/\?/.test(b)?"&":"?")+c.param(d.data):"")),format:"xml"},!d.success&&d.complete&&(d.success=d.complete,deleted.complete),d.success=function(c){returnfunction(e){c&&c.call(this,{responseText:(e.results[0]||"").replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi,"")},"success")}}(d.success));returna.apply(this,arguments)}}(c.ajax),g=function(){vara=c(this).data("urlive-container")||c(this);returnc(a).find(".urlive-link")},h={init:function(a){vare=c.extend(!0,k,a);returnthis.each(function(){functiona(f){l({url:f,type:"GET",yqlSelect:e.yqlSelect,beforeSend:e.callbacks.onStart}).done(function(a){c.isEmptyObject(a.results)?(e.callbacks.noData(),c.error("YQL request succeeded but with empty results",a)):(a=a.results[0],html=c("<div/>",{html:a}),get=function(a){returnhtml.find('[property="'+a+'"]').attr("content")||html.find('[name="'+a+'"]').attr("content")||html.find(a).html()||html.find(a).attr("src")},set={image:b.data("image")||get("og:image")||get("img"),title:b.data("title")||get("og:title")||get("title"),description:b.data("description")||get("og:description")||get("description"),url:b.data("url")||get("og:url")||f,type:b.data("type")||get("og:type"),sitename:b.data("site_name")||get("og:site_name")},e.callbacks.onSuccess(set),e.render&&d(set))}).fail(function(a,d,b){e.callbacks.onFail();c.error("YQL request error: ",d,b)})}functiond(a){outer=c("<a/>",{"class":"urlive-link",href:a.url,target:e.target});imgWrapper=c("<div/>",{"class":"urlive-img-wrapper"});textWrapper=c("<div/>",{"class":"urlive-text-wrapper"});c.each(a,function(d,b){b&&("image"==d?(/^(?:[a-z]+:)?\/\//i.test(b)||(b=/^https?:\/\//i.test(a.url)?a.url+b:window.location.protocol+"//"+a.url+b),img=c("<img/>",{src:b}),img.error(e.callbacks.imgError),img.appendTo(imgWrapper),img.hide().load(function(){vara=c(this).width(),b=c(this).closest(".urlive-link");c(this).addClass("urlive-"+d).show();"auto"==e.imageSize?a>=b.width()?b.addClass("urlive-img-large"):b.addClass("urlive-img-small"):"large"==e.imageSize?b.addClass("urlive-img-large"):"small"==e.imageSize&&b.addClass("urlive-img-small");e.callbacks.onLoadEnd()})):(elem=c("<span/>",{"class":"urlive-"+d,text:b}),elem.appendTo(textWrapper)))});outer.append(imgWrapper,textWrapper).appendTo(b.data("urlive-container"));outer.on("click",e.callbacks.onClick);if(e.disableClick)outer.on("click",function(a){a.preventDefault()})}varb=c(this),f=void0;b.data("urlive-container",e.container);if(b.is("a"))f=b.attr("href");elsevarf=b.val()||b.text(),g=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,f=(f=e.regexp.exec(f))&&!g.test(f[0])?f[0]:null;f&&(/\.(?:jpe?g|gif|png)/.test(f)?(g=f.substr(f.lastIndexOf("/")+1),d({image:f,title:g,url:f})):a(f))})},close:function(a){g.apply(this).fadeOut(a)},remove:function(a){varc=g.apply(this);a?c.fadeOut(a,function(){c.remove()}):c.remove()},open:function(a){g.apply(this).fadeIn(a)},disable:function(){g.apply(this).on("click",function(a){a.preventDefault()})},enable:function(){g.apply(this).off("click")}};c.fn.urlive=function(a){if(h[a])returnh[a].apply(this,Array.prototype.slice.call(arguments,1)