[Filter:keyword] Brian Mucha's post body matched "fixed", board "LuminateOnline".

Options



[Filter:keyword] Brian Mucha's post body matched "fixed", board "LuminateOnline".



Post Subject: Re: How to create "Share on Facebook" and "Share on Twitter" links for Email mes



Post Body:



I just fixed this for our org.



 


[[?x42x::x[[S4]]x::
<!--MessageViewer-->
[[?[[S8]]::MessageViewer/FaceBook::
<!--Share on FaceBook-->
<script type="text/javascript">
window.location='http://www.facebook.com/share.php?u=[[T1:http://[[S29:smileyvery-happy:OMAIN]]/site/MessageViewer?em_id=[[S334:em_id]]]]';
</script>
<noscript>
<meta http-equiv="refresh" content="0;url=http://www.facebook.com/share.php?u=[[T1:http://[[S29:smileyvery-happy:OMAIN]]/site/MessageViewer?em_id=[[S334:em_id]]]]">
</noscript>
::
[[?[[S8]]::MessageViewer/Twitter::
<!--Share on Twitter-->
<style type="text/css">
body { display: none; }
</style>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('jquery','1.7.1');
google.setOnLoadCallback(function(){
// Set the bit.ly login and API key
// Get yours at http://bit.ly/account/your_api_key
var bitlyLogin='yourBitlyLogin';
var bitlyAPIKey='R_12345678901234567890';
// Set your organization's twitter name to be appended to tweets as "(via @org)"
// Leave blank if you wish not to use this feature
var orgTwitterName='';
// No need to change anything below
$.ajax({
dataType:'xml',
url:
'http://[S29:smileyvery-happy:OMAIN]]/site/AjaxProxy?cnv_url='+
encodeURIComponent('http://api.bit.ly/shorten?version=2.0.1&longUrl=http://[[S29:smileyvery-happy:OMAIN]]/site/MessageViewer?em_id=[[S334:em_id]]&login='+bitlyLogin+'&apiKey='+bitlyAPIKey+'&format=xml')+
'&auth=[[S86:true]]',
success:function(data){
window.location =
'http://twitter.com/?status=' +
encodeURIComponent(document.title) + ' - ' +
$(data).find('bitly').find('results').find('nodeKeyVal').find('shortUrl').text() +
(orgTwitterName != '' ? (' (via @' + orgTwitterName + ')') : '');
}
});
});
</script>
<noscript>
<meta http-equiv="refresh" content="0;url=http://twitter.com/home?status=[[T1:http://[[S29:smileyvery-happy:OMAIN]]/site/MessageViewer?em_id=[[S334:em_id]]]]">
</noscript>
::
]]]]
::
]]



 There was a few problems with Twitter...



 

  • The biggie was that google.load does not support jquery 1.8.
  • The relative path to AjaxProxy was incorrect from the MessaageViewer, so I use the full URL.
  • JS escape() is depreciated, using encodeURIComponent() instead.
  • I'm not sure why it was trying to split the document title on 'Email - '. That returned undefined for me. What that injected into email titles at some point?



 



This can now be added to the email stationary, rather than the PageWrapper. This addresses the no-wrapper setting for MessageViewer that Peter Kaizer mentioned.



Body text "fixed" matched filter pattern "fixed".



Post by User[id=11326,login=Brian Mucha] has message uid 85651.



Link to post: Re: How to create "Share on Facebook" and "Share on Twitter" links for Email mes

Categories