[英]iBooks Widgets: Parameters and shared assets
Consider a text book made with iBooks Author, using HTML widgets for interactive features, for example a quiz at the end of every chapter. 考虑一本由iBooks Author制作的教科书,该教科书使用具有交互功能的HTML小部件,例如,每章末尾的测验。 You end up with a lot of widgets (one per chapter) that share a lot of assets (image files, javascript libraries).
最后,您会得到许多共享许多资产(图像文件,javascript库)的小部件(每章一个)。
Casual use of iBooks Author seems to indicate that every widget is its own independent bundle that gets copied into the book. 随意使用iBooks Author似乎表明每个小部件都是其自己的独立捆绑包,该捆绑包被复制到书中。 This would be horribly wasteful in this scenario.
在这种情况下,这将是非常浪费的。
Can I include the same bundle multiple times (so that is appears in many locations, but does not take up redundant disk space)? 我可以多次包含同一个包吗(这样会出现在很多位置,但不会占用冗余磁盘空间)?
Can I pass parameters to the widget (so that I can tell it which chapter's data to display)? 我可以将参数传递给窗口小部件(以便我可以告诉它显示哪个章节的数据)吗?
If 1+2 don't work, can a widget refer to assets stored in a shared location somewhere else in the same book (so that I can produce fifty lean widgets that don't have to contain images and Javascript themselves)? 如果1 + 2不起作用,那么小部件可以引用存储在同一本书中其他位置的共享位置中的资产吗(这样我就可以生成五十个不必包含图像和Javascript本身的精益小部件)?
Just have an answer for 3., still trying to figure out the other two. 只需给出3的答案,仍在尝试找出另外两个。
The ibooks file created by IBA is basically an EPUB document. 由IBA创建的ibooks文件基本上是EPUB文档。 Because this is the case, you can refer to files within the package itself with HTML from your widgets.
因为是这种情况,所以您可以使用窗口小部件中的HTML引用包本身中的文件。
IBA creates an assets
folder where it stores all the images, widgets, and other items. IBA创建一个
assets
文件夹,在其中存储所有图像,小部件和其他项目。
For example, <img src='../../images/image.jpg' />
in the HTML in your widget will display image.jpg
. 例如,小部件中HTML中的
<img src='../../images/image.jpg' />
将显示image.jpg
。
To see and add images, js, whatever to the iBook after it is generated, unzip
your iBooks file. 要在生成iBook之后查看并添加图像,js,并将其添加到iBook,请
unzip
iBooks文件。
localstorage
is shared between all the widgets, so you can store shared information there (base-64 encode the images?). localstorage
在所有小部件之间共享,因此您可以在其中存储共享信息(base-64编码图像?)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.