[wordpress插件] Annotation注解

wordpress 插件 文章 2020-02-18 19:00 472 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

The Annotation WP plugin provides a user friendly shortcode wrapper for the jQuery UI ToolTip Widget as well as the standard UI themes.

Annotation WP插件为jQuery UI ToolTip Widget和标准UI主题提供了用户友好的短代码包装器。

Default functionality is provided out-of-the-box for those who require simple, yet aestechtically pleasing tooltips.

为那些需要简单但从技术上令人愉悦的工具提示的人提供了现成的默认功能。

For those who need more control over the look-and-feel of the tooltip, advanced customization directives are available.

对于那些需要对工具提示的外观进行更多控制的人,可以使用高级自定义指令。

Customizations can also be applied independently to each annotation.

定制也可以独立地应用于每个注释。

Both text and images can be used for anchors and HTML can be used freely in content.

文本和图像都可以用作锚点,HTML可以在内容中自由使用。

Documentation

文档

Annotation mark-up can take two forms differing only in content declaration.

注释标记可以采用两种形式,仅内容声明不同。

 [annotate id="" text="" img="" content="" theme="" style=""]

  [注释id =“” text =“” img =“” content =“” theme =“” style =“”]

or, more elegantly,

或更优雅地

 [annotate id="" text="" img="" theme="" style=""][/annotate]

  [注释id =“” text =“” img =“” theme =“” style =“”] <内容> [/ annotate]

The latter should be used if HTML mark-up is included in the content.

如果内容中包含HTML标记,则应使用后者。

Id

Id

The id provides Annotation a mechanism to distinguish between multiple annotations in content rendering.

id提供了一种注释机制,以区分内容呈现中的多个注释。

Without it, Annotation can not set a theme or style for the tooltip.

没有它,注释不能为工具提示设置主题或样式。

If included, id’s should at the very least be unique enough not to conflict in a single post.

如果包含ID,ID至少应具有足够的唯一性,以免在单个帖子中发生冲突。

Otherwise one annotation will take precedence over the other.

否则,一个注释将优先于另一个注释。

If id is not provided, theme and style are ignored and content is placed inline (using the title attribute for a text anchor, alt for image anchor), with mark-up [in content ]treated as raw text.

如果未提供id,则将忽略主题和样式,并将内容内联放置(将title属性用作文本锚,将alt用作图像锚),并将[内容中的标记]视为原始文本。

Content

内容

This is the content that will appear in the tooltip pop-up window.

这是将显示在工具提示弹出窗口中的内容。

It can be specified either as an attribute or between the shortcode delimiters.

可以将其指定为属性,也可以在短代码定界符之间指定。

It can be text, an image, or a mixture of the two.

它可以是文本,图像或两者的混合。

When using… HTML is allowed, but [in this situation,] an id is required and the content should appear between shortcode delimiters.

使用…时允许使用HTML,但[在这种情况下,]需要一个id,并且内容应显示在短码分隔符之间。

By not doing so, the HTML will appear as raw text in the pop-up.

否则,HTML将在弹出窗口中显示为原始文本。

For simple text, do keep the content as an attribute and skip specifing an id as this will yield a small gain in performance for your website.

对于简单的文本,请务必将内容保留为属性,并跳过指定id的操作,因为这样做会使您的网站的性能有所提高。

Text

文本

The text attribute sets the text used for the anchor.

文本属性设置用于锚点的文本。

CSS properties for the text should be specified outside of the annotation shortcode directives.

文本的CSS属性应在注释shortcode指令之外指定。

Typically, the following format is followed:
     

通常,遵循以下格式:
     

‘[annotation text=”archival”]’

‘[annotation text =” archival”]’

If the img attribute is provided, text is ignored.

如果提供了img属性,则忽略文本。

Either text or img must be provided, otherwise the annotation is ignored.

必须提供text或img,否则注释将被忽略。

Image

图片

Images of varying sizes can be used in place of text for the anchor.

可以使用不同大小的图像代替锚文本。

As with the text attribute, CSS can be specified outside of the annotation shortcode.

与text属性一样,可以在注释简码之外指定CSS。

If img and text are both provided, the text attribute is ignored.

如果同时提供了img和text,则忽略text属性。

If no img or text attributes are provided, the annotation is ignored.

如果未提供img或text属性,则注释将被忽略。

Themes

主题

While WordPress makes avialable the majority of the jQuery UI implementation, it fails to provide any themes.

尽管WordPress使jQuery UI实现的大部分成为可利用的,但它未能提供任何主题。

The resultant lack of these CSS files is that some of the widgets do not work as expected and/or have no default look-and-feel.

这些CSS文件的缺乏结果是某些小部件无法按预期工作和/或没有默认外观。

These CSS theme packages are included in the Annotation plugin for both the latest version of jQuery UI (1.10.3) and the targeted version of jQuery UI used by WordPress (1.9.2 as of this writing).

这些CSS主题包包含在Annotation插件中,用于最新版本的jQuery UI(1.10.3)和WordPress使用的目标版本的jQuery UI(在撰写本文时为1.9.2)。

Annotation is able to choose the correct version based on the enqueued jQuery UI JavaScript.

Annotation能够根据排队的jQuery UI JavaScript选择正确的版本。

Users should not attempt to override this behavior.

用户不应尝试覆盖此行为。

The theme defaults to cupertino when the theme attribute is not specified.

未指定主题属性时,主题默认为cupertino。

User Themes

用户主题

Users are welcome to install their own rolled themes (http://jqueryui.com/themeroller/) under the Annotation themes directory.

欢迎用户在注释主题目录下安装自己的滚动主题(http://jqueryui.com/themeroller/)。

Be sure to include css files for all working versions and choose the name carefully to avoid conflicts or malformed URLs.

确保包括所有工作版本的css文件,并仔细选择名称以避免冲突或URL格式错误。

Be aware that any updates will remove these themes, so please make back-ups as appropriate.

请注意,任何更新都会删除这些主题,因此请适当备份。

Style

样式

xxx Keep in mind that the style attribute applies to the tooltip, not the anchor.

xxx请记住,样式属性适用于工具提示,而不适用于锚点。

CSS for the anchor can be set outside of the annotation using span.

可以使用span在注释之外设置锚的CSS。

The style attribute is particularly important in that it allows you to change aspects of the container for the tooltip.

样式属性特别重要,因为它允许您更改工具提示容器的各个方面。

Most often, users will want to use this to set the maximum width of the tooltip or minor adjustments to the underlying theme.

通常,用户会希望使用它来设置工具提示的最大宽度或对基础主题进行较小的调整。

Styling for the tooltip content can be accomplished using mark-up in the content.

工具提示内容的样式可以使用内容中的标记来完成。

JQuery UI elements require JSON encoded CSS which imposes some limitations on the style properties that you can specify.

jQuery UI元素需要JSON编码的CSS,这对您可以指定的样式属性施加了一些限制。

Color names cannot be used.

不能使用颜色名称。

Instead use rgb or rgba.

而是使用rgb或rgba。

DOM names are not necessary, however.

但是,DOM名称不是必需的。

See future for more details.

有关更多详细信息,请参见将来。

Future

未来

JQuery UI Effects are not currently supported.

目前不支持JQuery UI Effects。

However, if there is sufficient interest in their usage, this may change.

但是,如果有足够的兴趣使用它们,则可能会改变。

It is also expected that interest in jQuery UI themes may result in a shortcode or option to include a specific theme for use by other jQuery UI widgets.

还可以预期,对jQuery UI主题的兴趣可能会导致短代码或选项包括特定主题,以供其他jQuery UI小部件使用。

Or, perhaps, the Annotation plugin may evolve to include all jQuery UI widgets.

或者,也许Annotation插件可能会演变为包括所有jQuery UI小部件。

Currently, a simple converter is provided for CSS text to JSON encoded CSS properties.

当前,提供了一个简单的转换器,用于将CSS文本转换为JSON编码的CSS属性。

A full conversion utility would inevitably create code bloat for this plugin and the inherit limitations are considered trivial.

完全转换实用程序将不可避免地为此插件创建代码膨胀,并且继承限制被认为是微不足道的。

For these reasons, the gains from such a conversion utility are not deemed significant enough to warrant it’s implementation.

由于这些原因,这种转换实用程序带来的收益不足以保证其实施。

安装步骤

1) Install the latest version of Annotation under the Plugin section of the Admin area
   

1)在“管理”区域的“插件”部分下安装最新版本的注释
   

or


1a) Download the latest annotation.zip file from https://wordpress.org/plugins/annotation/

1a)从https://wordpress.org/plugins/annotation/
下载最新的注解.zip文件

1b) Unzip the contents to your site’s wp-contents/plugins directory

1b)将内容解压缩到您网站的wp-contents / plugins目录

2) Activate the plugin from the Plugin section of the Admin area

2)从“管理”区域的“插件”部分激活插件

下载地址
https://downloads.wordpress.org/plugin/annotation.0.5.0.zip
-EOF-

AI助手支持GPT4.0