Google Docs Viewer 在线阅读

普遍适用的规则分享、讨论

版主: phoenix

Google Docs Viewer 在线阅读

帖子phoenix » 12月 19 2009, 23:35

如下规则将给 Google Docs Viewer 支持的文档类型的链接增加一个在线阅读的链接。

代码: 全选
[Patterns]
Name = "Add Google Docs Viewer 2009.11.02 [phoenix]"
Active = TRUE
Bounds = "<a\s*</a>"
Limit = 256
Match = "\1&*href=$AV((http://(^docs.google.com)*.(pdf|ppt|tiff))\2)"
Replace = "\1 <a title="Google Docs Viewer" href="http://docs.google.com/viewer?url=$ESC(\2)"><img src="http://docs.google.com/favicon.ico"></a>"


示例页面: http://www.catonmat.net/projects/cheat-sheets
附件
google_docs_viewer.png
google_docs_viewer.png (20.79 KiB) 被浏览 784 次
头像
phoenix
Site Admin
 
帖子: 437
注册: 12月 29 2007, 16:27

Re: Google Docs Viewer 在线阅读

帖子不夜侯 » 1月 06 2010, 15:35

像源代码中href地址没有给出 http://www.cninfo.com.cn/ 前缀的,能否自动补全?
代码:
代码: 全选
<a href='../../finalpage/2009-03-27/50630322.PDF' target=_top>上海建工:2008年年度报告摘要</a>

示例地址:
http://www.cninfo.com.cn/gszx/dqbg600170.html
不夜侯
 
帖子: 62
注册: 7月 29 2009, 16:22

Re: Google Docs Viewer 在线阅读

帖子ddbb » 1月 06 2010, 16:54

我觉得如果你真要做的话 还是用JS来写比较方便

PROX我只会写一种情况的...如果考虑别的情况 我就不会写了.... :cry:
ddbb
Moderator
 
帖子: 375
注册: 1月 07 2008, 13:30

Re: Google Docs Viewer 在线阅读

帖子不夜侯 » 1月 06 2010, 17:44

我用opera,对于那种情况修改右键更方便些。
代码: 全选
Copy link & Go to page, "http://docs.google.com/viewer?url=%c"
不夜侯
 
帖子: 62
注册: 7月 29 2009, 16:22

Re: Google Docs Viewer 在线阅读

帖子phoenix » 1月 07 2010, 11:36

不夜侯 写道:像源代码中href地址没有给出 http://www.cninfo.com.cn/ 前缀的,能否自动补全?
代码:
代码: 全选
<a href='../../finalpage/2009-03-27/50630322.PDF' target=_top>上海建工:2008年年度报告摘要</a>

示例地址:
http://www.cninfo.com.cn/gszx/dqbg600170.html

jjoe 写过这种规则,见附件。
附件
funcRelativePathtoFull.zip
(2.66 KiB) 被下载 82 次
头像
phoenix
Site Admin
 
帖子: 437
注册: 12月 29 2007, 16:27


回到 通用规则讨论

在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客

cron