This is a small HTML widget designed to make it easy to post to Twitter, Facebook, and Google+ from an iBook. It can be embedded in iBooks created with iBooks Author. The iBooks Social Widget is based on Trevor Burnham's iBooks HTML Widget Boilerplate
Because the Tweet button, Like button, and Google +1 button don't work in an iBook out of the box. An iBook HTML widget will not load external JavaScript or an iframe, so the methods for sharing things on Twitter, Facebook, and Google+ that work for web sites won't work for an iBook. The iBooks Social Widget approach is based on sharing bookmarklets that submit what will be shared to special Twitter, Facebook, or Google+ URLs.
The recommended approach for creating an HTML widget for iBooks Author is currently to create a Dashboard widget in Dashcode. This adds a lot of distracting cruft, and things that work fine in Dashcode have a tendency to stop working in iBooks. In short, it's better to treat an iBooks widget as a web page rather than as a Dashboard widget.
-
Download or clone this repository.
-
Update the TODOs in
main.html
to share the content you want on Twitter, Facebook, and Google+. -
(Optional) Change the look & feel of things in
style.css
. -
Rename the entire directory to end in
.wdgt
:ibooks-social-widget
=>ibooks-social-widget.wdgt
-
Drag the
.wdgt
file into iBooks Author.
Notice that when you drag the .wdgt
into iBooks Author, you just get a small preview image. iBooks doesn't load anything from your HTML widget other than Default.png
until the user taps it. To show a different image, replace Default.png
Open up Info.plist
to set the appropriate width and height for your widget. When opened on the iPad, the widget will be scaled to fit the screen but will maintain the correct width/height proportion. Also note that 1px in your markup refers to 1px according to the Info.plist
dimensions, not the actual pixels on the device screen.
http://trevorburnham.mit-license.org/ The included 3-clause BSD license (BSD_LICENSE.txt)