!function($,scope){function _addJamCSS(size){var css='";$("#QRJ_style").length<=0&&$("head").prepend(css)}function _addButton(){var el=QR.args.buttonAppendTo?QR.args.buttonAppendTo:$("body");$(".QRJ_button").length<=0&&el.append('')}function _addModal(){$("#QRJ_jamjar").length<=0&&$("body").append(modalTemp),$modal=$("#QRJ_jamjar")}function _def(ting,def){return void 0!==ting?ting:def}function _bindings(){$(document).ready(function(){$(document.body).on("click","#QRJ_jamjar_content",function(e){e.preventDefault(),e.stopPropagation()}).on("click","#QRJ_close, #QRJ_jamjar",function(e){e.preventDefault(),QR.hide()}).on("click",".QRJ_button",function(e){e.preventDefault(),QR.show()})})}function _addQR(){QR.getQR();var shorty=QR.addShortURL||void 0===QR.shortURL?"":QR.shortURL;$("#QRJ_jamjar_content").html('QR for : '+QR.args.loc+'
'+shorty+"
")}function _reqShortURL(loc,async){void 0===QR.args.loc&&(QR.args.loc=_def(loc,window.location.href)),loc=_def(loc,QR.args.loc),async=_def(async,!1),$.ajax("https://www.googleapis.com/urlshortener/v1/url",{data:JSON.stringify({longUrl:loc}),contentType:"application/json",type:"POST",dataType:"json",async:async,success:function(d){return QR.shortURL=d.id,QR.args.addShortURL&&$("#QRJ_shortURL_wrap").length>0&&$("#QRJ_shortURL_wrap").text(QR.shortURL),QR.shortURL},error:function(e){return void 0!==window.console&&console.log(e),QR.shortURL}})}var QR={args:!1,imgSRC:void 0,shortURL:void 0,inited:!1},defaults={loc:window.location.href,size:300,addCSS:!0,addModal:!0,addButton:!0,addShortURL:!0,buttonSize:"2em",buttonClass:"QRJ_fixed-bottom-right",buttonAppendTo:!1},modalTemp='
close
',$modal=!1;return QR.show=function(){QR.inited||QR.init(),$("#QRJ_jamjar_content").children().length<=0&&_addQR(),$modal.addClass("showQR")},QR.hide=function(){$modal.removeClass("showQR")},QR.init=function(args){QR.args=_def(args,defaults),"object"==typeof args&&(QR.args.loc=_def(args.loc,defaults.loc),QR.args.size=_def(args.size,defaults.size),QR.args.addCSS=_def(args.addCSS,defaults.addCSS),QR.args.addModal=_def(args.addModal,defaults.addModal),QR.args.addButton=_def(args.addButton,defaults.addButton),QR.args.addShortURL=_def(args.addShortURL,defaults.addShortURL),QR.args.buttonSize=_def(args.buttonSize,defaults.buttonSize),QR.args.buttonClass=_def(args.buttonClass,defaults.buttonClass),QR.args.buttonAppendTo=_def(args.buttonAppendTo,defaults.buttonAppendTo)),QR.imgSRC="https://chart.googleapis.com/chart?cht=qr&chs="+QR.args.size+"x"+QR.args.size+"&chl="+escape(QR.args.loc),$(document).ready(function(){QR.args.addCSS&&_addJamCSS(QR.args.size),QR.args.addModal&&(_addModal(),QR.args.addButton&&_addButton(),_bindings()),QR.inited=!0})},QR.getQR=function(loc){return QR.inited||QR.init(),(void 0!==loc||void 0===QR.args.loc)&&(QR.args.loc=_def(loc,window.location.href)),!QR.args.addShortURL||void 0===loc&&void 0!==QR.shortURL||QR.getShortURL(QR.args.loc,!0),QR.imgSRC="https://chart.googleapis.com/chart?cht=qr&chs="+QR.args.size+"x"+QR.args.size+"&chl="+escape(QR.args.loc),QR.imgSRC},QR.getShortURL=function(loc,async){return void 0===QR.shortURL&&_reqShortURL(loc,async),QR.shortURL},scope.QRjammer=QR,QR}($||jQuery,"undefined"==typeof scope?window:scope),"function"==typeof define&&define("QRjammer",[],function(){return QRjammer});