Publish 7

Once again, ignore

posted by Eric on 11.15.10 at 11:48 PM





//Copyright 2010 Facebook, Inc. // //Licensed under the Apache License, Version 2.0 (the "License"); you may //not use this file except in compliance with the License. You may obtain //a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, WITHOUT //WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the //License for the specific language governing permissions and limitations //under the License. // ==UserScript== // @name Facebook Like // @namespace http://www.facebook.com // @description Like any page on the web! // @include * // ==/UserScript== //don't append the bar if it's an iframe if (window.top != window.self) { exit; } base_url = getBaseURL(); //don't display the bar on facebook.com if (base_url == 'http://www.facebook.com/' || base_url == '/') { exit; } //assigning event handlers need a timeout so they don't die setTimeout(assignClickHandler, 100); var base_url = getBaseURL(window.location); //define the HTML/CSS that needs to be prepended to the current page var output_markup = ''; output_markup = '
' + '
' + document.title.substring(0,60) + '...
' + '
' + '
' + ''; output = document.createElement('div'); output.innerHTML = output_markup; //prepend the markup to the body body = document.getElementsByTagName('body')[0]; body.appendChild(output); //buffer the top of the page so the bar doesn't overlap any content on initial load body.style.marginTop = '29px'; //toggle Recent Activity/Recommendations sidebar on and off function showExtraInfo() { obj = document.getElementById("extra-info"); if (obj.style.display == "none") { obj.style.display = ""; } else { obj.style.display = "none"; } return false; } //track the click event on the plus ([+]) button in order to toggle showExtraInfo function assignClickHandler() { var clickDiv = document.getElementById('socialInfo'); clickDiv.addEventListener("click", showExtraInfo, true); } //get the base URL of the site the user is currently on function getBaseURL () { var url = location.href; var baseURL = url.substring(0, url.indexOf('/', 14)); if (baseURL.indexOf('http://localhost') != -1) { var url = location.href; var pathname = location.pathname; var index1 = url.indexOf(pathname); var index2 = url.indexOf("/", index1 + 1); var baseLocalUrl = url.substr(0, index2); return baseLocalUrl + "/"; } else { return baseURL + "/"; } }
TrackBack

TrackBack URL for this entry:
http://classicalvalues.com/cgi-bin/pings.cgi/10339






Comments

Post a comment

You may use basic HTML for formatting.





Remember Me?

(you may use HTML tags for style)


November 2010
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

ANCIENT (AND MODERN)
WORLD-WIDE CALENDAR


Search the Site


E-mail



Classics To Go

Classical Values PDA Link



Archives



Recent Entries



Links



Site Credits