Skip to content

Instantly share code, notes, and snippets.

@SignpostMarv
Last active December 20, 2015 01:29
Show Gist options
  • Select an option

  • Save SignpostMarv/6049057 to your computer and use it in GitHub Desktop.

Select an option

Save SignpostMarv/6049057 to your computer and use it in GitHub Desktop.
Adds social buttons to SL Marketplace store pages.
// ==UserScript==
// @name Second Life Marketplace Social Stores
// @namespace https://marketplace.secondlife.com/
// @description Adds social buttons to SL Marketplace store pages.
// @include https://marketplace.secondlife.com/stores/*
// @version 1.1
// @grant none
// @updateURL https://gist.github.com/SignpostMarv/6049057/raw/Second_Life_Marketplace_Social_stores.user.js
// ==/UserScript==
//
// License and Terms of Use
//
// Copyright (c) 2013 SignpostMarv
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
if(document.body.classList.contains('stores_show')){
// store page
var
merch = document.querySelector('#merchant-box'),
addThis = document.createElement('div'),
link = document.createElement('a'),
sep = document.createElement('span'),
twitter = document.createElement('a'),
email = document.createElement('a')
;
addThis.className = 'addthis_toolbox addthis_default_style clear';
link.className = 'addthis_button_compact en-US';
sep.className = 'addthis_separator';
twitter.className = 'addthis_button_twitter';
email.className = 'addthis_button_email';
link.href = 'http://www.addthis.com/bookmark.php?v=250&pub=lindenlab1';
link.appendChild(document.createTextNode('Share this item'));
sep.appendChild(document.createTextNode('|'));
[link, sep, twitter, email].forEach(function(a){
addThis.appendChild(a);
});
window.addthis_config = window.addthis_config || {
username: "lindenlab1",
ui_cobrand: "",
data_use_flash: false,
ui_language: "en",
ui_click: true
};
if(!document.querySelector('script[src$="addthis_widget.js"]')){
var
script = document.createElement('script')
;
script.src = 'https://s7.addthis.com/js/250/addthis_widget.js';
document.querySelector('head').appendChild(script);
}
merch.appendChild(addThis);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment