《金融时报》如何在粘贴文本时添加免责声明?
下面是粘贴来自《金融时报》的文本时发生的情况的示例,添加了顶部段落。
提前致谢!
例子:
请尊重 FT.com 的条款与条件以及版权政策,该政策允许您: 共享链接;复制内容供>个人使用; &重新分发有限的摘录。发送电子邮件至 [email protected] 购买额外权利 >或使用此链接参考文章 - http://www.ft.com/cms/s/0/792f1aec->9600-11e0 -8256-00144feab49a.html#ixzz1PFrYZiD0
据英国《金融时报》获悉,高盛在代表利比亚主权财富基金进行亏损交易时,为利比亚一名高级官员的亲属提供了带薪实习机会。
Here is an example of what happens when pasting text from Financial Times, the top paragraph is added.
Thanks in advance!
Example:
Please respect FT.com's ts&cs and copyright policy which allow you to: share links; copy content for >personal use; & redistribute limited extracts. Email [email protected] to buy additional rights >or use this link to reference the article - http://www.ft.com/cms/s/0/792f1aec->9600-11e0-8256-00144feab49a.html#ixzz1PFrYZiD0
Goldman Sachs gave a paid internship to a top Libyan official’s relative while the bank was carrying >out lossmaking trades on behalf of the country’s sovereign wealth fund, the Financial Times has learnt.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如前所述,修改剪贴板数据要么仅限于特定浏览器,要么需要用户授予修改剪贴板的访问权限。解决此问题的方法是
oncopy
事件添加一个事件处理程序我摆弄了这个方法并创建了一个插件来做到这一点。仍然是一个初步版本,到目前为止仅在 FF4/Chrome 11/IE8 上进行了测试(IE 肯定需要完成更多工作)。使用此方法可以做的一些好事是,您可以轻松地将论坛帖子引号包含在
[quote=USER]content[/quote]
中,并根据复制的帖子分配用户。默认情况下,脚本始终选择 DOM 样式,而不是实际的 HTML,因此,如果您复制粗体内容,则如果粘贴到富文本编辑器中,它将是粗体,但如果使用,则只是文本在纯文本编辑器中(删除 html 标签)。与附加相比,使用此方法前置内容要容易得多,在这种情况下我仍然不确定它是否功能齐全。对于IE,您可以直接修改剪贴板,但存在一些问题,例如选择整个页面时,或者如果您想切换丰富的复制内容。没有机会进行任何进一步的浏览器测试,但这似乎至少是较新浏览器的可行解决方案。
示例: http://hertzen.com/experiments/jquery.plugin.clipboard/
另一个例子: http://hertzen.com/experiments/jquery.plugin.clipboard/thread.html
源代码:https://github.com/niklasvh/jquery.plugin.clipboard
As already previously mentioned, modifying the clipboard data is either restricted to specific browsers or requires the user to grant access to modifying the clipboard. A work around to this you could
oncopy
eventI fiddled about with this method and created a plugin which does just that. Still a preliminary version and only tested on FF4/Chrome 11/IE8 so far (and IE definetly needs to have some more work done). Some of the nice things you can do with this method is that you could easily for example wrap forum post quotes in
[quote=USER]content[/quote]
and assign the user based on which post is copied. By default, the script always selects the DOM styling, but not the actual HTML, so if you for example copy bold content, it would be bold if pasted into a rich text editor, but just text if used in text only editors (removing the html tags).Prepending content is significantly easier with this method, compared to appending, in which case I still am not sure whether it is fully functional. For IE, you could directly modify the clipboard, but there are some issues for example when selecting the whole page, or if you want to toggle the rich copy content. Haven't had the chance to do any further browser testing, but this appears to be at least a working solution for newer browsers.
Example: http://hertzen.com/experiments/jquery.plugin.clipboard/
Another example: http://hertzen.com/experiments/jquery.plugin.clipboard/thread.html
Source code: https://github.com/niklasvh/jquery.plugin.clipboard
您可以为
oncopy
事件实现一个处理程序。 通过操作clipboardData
对象,可以更改复制的文本。You implement a handler for the
oncopy
event. By manipulating theclipboardData
object, you can change the copied text.网站管理员使用 Javascript 来实现这一点。
检查文件 http://media.ft.com/j/FTTrack2.js
Webmaster use Javascript for that.
Check file http://media.ft.com/j/FTTrack2.js
您可以通过名为 jquery copy 的 jQuery 插件来实现这一点。这是使用 p 选择器的示例。
This is something you can achieve via a jQuery plugin named jquery copy. Here's an example using the p selector.
它们使用 JavaScript,可以在以下文件中找到:
http://media.ft.com/j /FTTrack2.js
They use JavaScript which can be found in the following file:
http://media.ft.com/j/FTTrack2.js