function tipwidget_nem_createqr(to,amount,name,comment){ var url =tipwidget_nem_createurl(to,amount,name,comment); var qr = "http://chart.apis.google.com/chart?chs=547x547&cht=qr&chl="+encodeURIComponent(url); return qr; } function tipwidget_nem_createurl(to,amount,name,comment){ var to = encodeURIComponent(tipwidget_nem_popup.to.value); var amount = tipwidget_nem_popup.amount.value; var name = encodeURIComponent(tipwidget_nem_popup.name.value); var comment = encodeURIComponent(tipwidget_nem_popup.comment.value); var url = "https://twitter.com/intent/tweet?text=%40tipnem%20tip%20"+to+"%20"+amount+"%20"+name+"%20"+comment+"&hashtags=tipnem"; return url; } function tipwidget_nem_show() { document.getElementById("tipwidget_nem_back").style.display="block"; document.getElementById("tipwidget_nem_widget").style.display="block"; } function tipwidget_nem_close() { document.getElementById("tipwidget_nem_back").style.display="none"; document.getElementById("tipwidget_nem_widget").style.display="none"; } function tipwidget_nem_showqr() { var to=encodeURIComponent(tipwidget_nem_popup.to.value); var amount=tipwidget_nem_popup.amount.value; var name=encodeURIComponent(tipwidget_nem_popup.name.value); var comment=encodeURIComponent(tipwidget_nem_popup.comment.value); document.getElementById("tipwidget_nem_qr").style.display="block"; tipwidget_nem_qr.src = tipwidget_nem_createqr(to, amount, name, comment); } function tipwidget_nem_tip() { tipwidget_nem_close(); var to=encodeURIComponent(tipwidget_nem_popup.to.value); var amount=tipwidget_nem_popup.amount.value; var name=encodeURIComponent(tipwidget_nem_popup.name.value); var comment=encodeURIComponent(tipwidget_nem_popup.comment.value); var url = tipwidget_nem_createurl(to, amount, name, comment); window.open(url); } var dom = document.getElementById('tipwidget_nem'); dom.insertAdjacentHTML('afterbegin',"
"); tipwidget_nem_popup.to.value=document.getElementById( 'tipwidget_nem_arg' ).getAttribute( 'to' ); tipwidget_nem_popup.amount.value=document.getElementById( 'tipwidget_nem_arg' ).getAttribute( 'amount' ); tipwidget_nem_popup.name.value=document.getElementById( 'tipwidget_nem_arg' ).getAttribute( 'name' ); tipwidget_nem_popup.comment.value=document.getElementById( 'tipwidget_nem_arg' ).getAttribute( 'comment' );