Jetpack Gallery
Jetpacks
Contributors
About
Register
Log In
View Source Code for “
SNS All in One
”
/* * SNS All in One - Get SNS services easier.
* Copyright (C) 2009 xiaogaozi
* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see
. */ // ==Jetpack== // @name SNS All in One // @description Get SNS services easier. // @author xiaogaozi
// @version 0.0.3 // @license GPLv3 // ==/Jetpack== jetpack.future.import("slideBar"); var slider = { /* * 豆瓣 (http://www.douban.com/) */ addDouban: function() { jetpack.slideBar.append({ icon: "http://t.douban.com/favicon.ico", width: 350, onClick: function(slider) { slider.contentDocument.reload(); /* * Get broadcast. */ $.get("http://www.douban.com/contacts/", function(data) { var doc = $(data, slider.contentDocument); var a = doc.find(".article").clone(); /* * Delete some divisions. */ a.find(".xbar").remove(); a.find(".paginator").remove(); /* * Fix all links. */ a.find("a").each(function() { var h = $(this).attr("href"); if (h.match(/http:\/\//) == null) $(this).attr("href", "http://www.douban.com" + h); }); /* * Add to slidebar's content. */ var aa = $(slider.contentDocument).find("#article"); aa.empty(); a.appendTo(aa); }, "html"); }, html: <>