jQuery.extend(msnbc.document.settings, { shareServices: [ { name: "Newsvine", icon: "http://msnbcmedia.msn.com/i/MSNBC/Templates/cccTemplatesStory_v2/img/newsvine.gif", uri: "http://www.newsvine.com/_tools/seed", params: { u: "::MOD_URL::", popoff: "0" } }, { name: "Facebook", icon: "http://msnbcmedia.msn.com/i/MSNBC/Templates/cccTemplatesStory_v2/img/facebook.gif", uri: "http://www.facebook.com/share.php", params: { u: "::MOD_URL::" } }, { name: "Twitter", icon: "http://msnbcmedia.msn.com/i/MSNBC/Templates/cccTemplatesStory_v2/img/twitter.png", uri: "http://twitter.com/home", params: { status: "::MOD_URL::" + " on msnbc.com" } } ] }); msnbc.components.ShareMenu = msnbc.components.Component.extend({ setup: function(moduleTitle, cmdOrURL, dontShareList){ this.moduleTitle = moduleTitle; this.moduleURL = (cmdOrURL.toShareString) ? cmdOrURL.toShareString() : cmdOrURL; this.shareServices = msnbc.document.settings.shareServices; this.slot; // TODO: optional list to filter out services we don't want to share in this menu instance // if (dontShareList) this.filterArray(this.shareServices, dontShareList); // get the rss url for the page // this.rssURL = $(document.documentElement).find("link[rel='alternate']").attr('href'); this.type = this.moduleTitle.split(':'); if (this.type.length > 0) { this.type = this.type[0].replace(/\r\n\s/g,'').replace('Text','this story').toLowerCase(); } else { this.type = 'this story'; } }, insert: function(selectr){ var self = this; this.slot = selectr; /*add markup*/ var ss = '
'; $(selectr).append(ss); }, /*renderFlyout: function(doToggle, parent, saveToCookie, timeout){ var self = this; //build click action for links var $links = $(this.slot).find('.share-feeds a'); $links.click(function(e) { //e.stopPropagation(); var shr = $(this).text(); var val = ''; jQuery.each(self.shareServices, function(i) { if (this.name == shr) {val = i;} }); if (saveToCookie) {self.handleCookie('sh', val);} }); } }, */ getShareList: function(){ var self = this; var list = '