《金融时报》如何在粘贴文本时添加免责声明?

发布于 2024-11-15 03:44:47 字数 558 浏览 1 评论 0原文

下面是粘贴来自《金融时报》的文本时发生的情况的示例,添加了顶部段落。

提前致谢!

例子:

请尊重 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

情何以堪。 2024-11-22 03:44:47

如前所述,修改剪贴板数据要么仅限于特定浏览器,要么需要用户授予修改剪贴板的访问权限。解决此问题的方法是

  1. oncopy 事件添加一个事件处理程序
  2. 查找选择
  3. 将内容添加到内容前面
  4. 修改选择范围以包含添加/添加的内容
  5. 等待复制操作推送通过
  6. 删除附加/前置内容

我摆弄了这个方法并创建了一个插件来做到这一点。仍然是一个初步版本,到目前为止仅在 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

  1. Add an event handler to the oncopy event
  2. Find the selection
  3. Prepend/append content to the content
  4. Modify the selection range to include the appended/prepended content
  5. Wait for the copy action to push through
  6. Remove the appended/prepended content

I 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

末が日狂欢 2024-11-22 03:44:47

您可以为 oncopy 事件实现一个处理程序。 通过操作 clipboardData 对象,可以更改复制的文本。

You implement a handler for the oncopy event. By manipulating the clipboardData object, you can change the copied text.

猫烠⑼条掵仅有一顆心 2024-11-22 03:44:47

网站管理员使用 Javascript 来实现这一点。

检查文件 http://media.ft.com/j/FTTrack2.js

FT.Tynt={
    initTynt:function(){
        var Tynt=Tynt||[];
        Tynt.push('cqolxGrS4r34rIadbiUt4I');
        Tynt.i={
            "cc":"0",
            "b":true,
            "ap":"Please respect FT.com's <a href='http://www.ft.com/servicestools/help/terms'>ts&cs</a> and <a href='http://www.ft.com/servicestools/help/copyright'>copyright policy</a> 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 -",
            "t":true
        }

Webmaster use Javascript for that.

Check file http://media.ft.com/j/FTTrack2.js

FT.Tynt={
    initTynt:function(){
        var Tynt=Tynt||[];
        Tynt.push('cqolxGrS4r34rIadbiUt4I');
        Tynt.i={
            "cc":"0",
            "b":true,
            "ap":"Please respect FT.com's <a href='http://www.ft.com/servicestools/help/terms'>ts&cs</a> and <a href='http://www.ft.com/servicestools/help/copyright'>copyright policy</a> 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 -",
            "t":true
        }
拥抱影子 2024-11-22 03:44:47

您可以通过名为 jquery copy 的 jQuery 插件来实现这一点。这是使用 p 选择器的示例。

$("p").click(function() {
    $.copy($(this).text() + " Disclaimer goes here!");
});

This is something you can achieve via a jQuery plugin named jquery copy. Here's an example using the p selector.

$("p").click(function() {
    $.copy($(this).text() + " Disclaimer goes here!");
});
我一直都在从未离去 2024-11-22 03:44:47

它们使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文