支持线上活动相册!修改douban helper和Greased Lightbox看大图
今天发现了线上活动,这两个脚本看活动相册的功能失效了,因为原本代码判断url没有包括线上活动的页面。
Firefox->工具->GreaseMonkey->管理用户脚本->选择脚本->编辑->选择编辑器->修改。
1.针对douban helper,查找“return (this.match(/^photos\/album\/\w+/i)”
将
return (this.match(/^photos\/album\/\w+/i)
|| this.match(/^event\/album\/\w+/i));
修改为
return (this.match(/^photos\/album\/\w+/i)
|| this.match(/^event\/album\/\w+/i)
|| this.match(/^online\/\w+\/album\/\w+/i));
2.针对豆瓣插件小组的修改版的Greased Lightbox(已支持douban),查找“// doubanphoto”
在doubanphoto和doubanevent这几段附近,添加下面这段:
// doubanonline
{
name : 'doubanonline',
includeRegExp : /^http:\/\/www\.douban\.com\/online\/[0-9]+\/album\/[0-9]+\//i,
linkRegExp : /^\/online\/[0-9]+\/photo\/([0-9]+)\/$/i,
replaceString : 'http://otho.douban.com/view/photo/photo/public/p$1.jpg',
showFunction : function(event) { greasedLightbox.showFrom(event, 'doubanonline'); return false; }
}, // doubanonline
修改完之后保存刷新页面即可
Firefox->工具->GreaseMonkey->管理用户脚本->选择脚本->编辑->选择编辑器->修改。
1.针对douban helper,查找“return (this.match(/^photos\/album\/\w+/i)”
将
return (this.match(/^photos\/album\/\w+/i)
|| this.match(/^event\/album\/\w+/i));
修改为
return (this.match(/^photos\/album\/\w+/i)
|| this.match(/^event\/album\/\w+/i)
|| this.match(/^online\/\w+\/album\/\w+/i));
2.针对豆瓣插件小组的修改版的Greased Lightbox(已支持douban),查找“// doubanphoto”
在doubanphoto和doubanevent这几段附近,添加下面这段:
// doubanonline
{
name : 'doubanonline',
includeRegExp : /^http:\/\/www\.douban\.com\/online\/[0-9]+\/album\/[0-9]+\//i,
linkRegExp : /^\/online\/[0-9]+\/photo\/([0-9]+)\/$/i,
replaceString : 'http://otho.douban.com/view/photo/photo/public/p$1.jpg',
showFunction : function(event) { greasedLightbox.showFrom(event, 'doubanonline'); return false; }
}, // doubanonline
修改完之后保存刷新页面即可