http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore
2012-08-24T15:44:33.424-04:00
Contains demo libapps and packages for developers
LibX Team
http://libx.org/
libx.editions@gmail.com
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/103
LibX Developer Showcase
2012-07-13T13:37:10-04:00
LibX Team
http://libx.org/
libx.editions@gmail.com
Contains demo LibApps and Packages for Developers
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/105
Autolink "Libya" on NYTimes.com
2012-04-15T16:23:47-04:00
LibX Team
http://libx.org/
libx.editions@gmail.com
Auto-links all instances of Libya to search the user's primary catalog.
/nytimes\.com.*/
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/106
Find Terms on Page
2012-04-15T16:23:20-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Searches for all instances of a term on a page
/.*/
/\b(${searchterm})\b/ig
All instances of this term will be manipulated.
// -- Create Node
var newNode = textNode.ownerDocument.createTextNode(match[0]);
// -- Search Catalog, Get URL
var cat = libx.edition.catalogs.primary;
var url = cat.makeSearch('Y', match[0]);
var name = cat.name;
/* Postcondition:
* Produce a tuple containing the new node 'node' that we want linked, the
* 'url' to link to, and a tooltip object.
*/
var output =
{
node: newNode,
url: url,
tooltip:
{
ondemand: false,
value: "Search " + cat.name + ' for "' + match[0] + '"'
},
catalog: name
};
return [ newNode, function () { libx.space.write(output); } ];
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/107
Alert users to ACM digital library subscription
2012-08-24T15:44:33-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Adds an icon to ACM that plays a tutorial video when clicked.
/dl\.acm\.org.*/
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/108
Display a Help icon that plays a video when clicked.
2012-08-24T15:27:06-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Given a YouTube ID and jQuery selector, writes a tuple specifying an icon to display the notification.
/.*/
jquery
Id of Youtube video to play, see http://www.youtube.com/watch?v=ehkfEcQ5YnQ
jQuery selector describing element next to which cue will be placed
// Place the current edition's icon into the ACM portal page, next to the
// current search button. When the user clicks on the icon, show a youtube video
// -----------------------------------------------------------------------
libx.space.write ( {
needsuserbutton: selector,
image: libx.edition.options.icon,
text: "Click for a short tutorial",
action: function () {
libx.space.write ( { youtube: youtubeid } );
}
} );
"needsuserbutton,action"
"youtube"
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/109
Place a clickable image into a page
2012-04-15T16:35:37-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Creates an icon on the page, performing the given action when clicked.
/.*/
jquery
{ needsuserbutton: libx.space.WILDCARD, action: libx.space.WILDCARD }
// Create a link with an embedded image
var a = $("<a href='javascript:void(0);'>" + tuple.text + "</a>");
var a = $('<a href="javascript:void(0);"><img border="0" width="16" src="' + tuple.image + '"/></a>');
a.attr( 'title', tuple.text || "");
// Insert link after element where a 'user button' is wanted
$(tuple.needsuserbutton).after(a);
// Associate onclick handler and animate
$(a).click(function (e) {
if (e.layerY < 0) // fake event (observed on jstor)
return;
tuple.action(e);
return false;
}).fadeOut("slow").fadeIn("slow");
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/110
Create a notification to play a YouTube video, based on Video ID
2012-08-24T15:26:07-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Given a YouTube ID, write a notification that shows the corresponding video.
/.*/
{ youtube: libx.space.WILDCARD }
// Create HTML based on tuple.youtube
libx.space.write ( {
notify : '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'+tuple.youtube+'&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+tuple.youtube+'&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>',
options: { width: '450px' }
} );
"notify"
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/111
Point All About Explorers to NYT
2012-04-15T16:41:56-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Shows a NYT video on All About Explorers.
/allaboutexplorers\.com\//
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/112
Inject 21st Century Librarian NYT Video
2012-04-15T16:40:19-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Writes a video ID to the tuple space.
/allaboutexplorers\.com\//
libx.space.write({
nyt_video_id: "1194837851726",
nyt_video_desc: "This web site was recently mentioned in a video on the New York Times website. <a target='_top' href='http://www.nytimes.com/2009/02/16/books/16libr.html?scp=2&sq=library&st=cse'>Click here to read more ...</a>"
});
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/113
Play A New York Times Video
2012-04-15T16:40:46-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Given a NYT video ID, display the video notification on the page.
/.*/
{ nyt_video_id: libx.space.WILDCARD }
/** Insert a NYT Video into the notification area */
// videoId=1194837851726
var htmlMsg = '<div>' + tuple.nyt_video_desc + '</div><iframe height="375" frameborder="0" width="318" scrolling="no" style="margin-left: -1px;" marginheight="0" marginwidth="0" id="nyt_video_player" name="nyt_video_player" title="New York Times Video - article player" src="http://graphics8.nytimes.com/bcvideo/1.0/iframe/bcArtIframe.html?z=0&videoId=' + tuple.nyt_video_id + '" />';
libx.space.write({ notify : htmlMsg, options : { width : 318 }});
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/114
Spruce Up IMDB Visits
2012-04-15T16:44:03-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Alerts the user of IMDb LibApp functionality, and creates cues linking to DVDs.
/imdb\.com/
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/115
Extract Actor from Actor Page on IMDB.com
2012-06-25T11:53:55-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Writes a tuple containing the actor name and position of the node.
/imdb\.com\/name\/nm/
jquery
/* Main Heading on Actor page in imdb */
/* Either of these selectors have been found */
var mainHeading = $("div#tn15title h1");
if (mainHeading.length == 0)
var mainHeading = $("h1.header");
var mainHeadingNode = mainHeading[0];
var actorName = libx.utils.string.trim(mainHeadingNode.firstChild.data);
libx.space.write({
imdbactor: actorName,
position: mainHeadingNode.firstChild
});
"imdbactor"
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/116
Link to DVDs based on actor
2012-04-15T18:45:27-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Given an actor, creates a cue linked to DVDs starring the actor.
/.*/
legacy-cues
{ imdbactor: libx.space.WILDCARD }
// advanced search for 'field: other'
var cue = new libx.cues.CatalogCue('X', 'N:(' + tuple.imdbactor + ')');
// type=DVD
cue.cue.href += '&q=m';
cue.cue.title += ' for DVDs with ' + tuple.imdbactor;
cue.image.setAttribute('width', '16');
cue.insertBefore(tuple.position);
cue.animate();
cue.onClick(function(){
libx.libapp.track({
actiontype:"click"
});
});
http://libx.org/libx2/libapps/libx.editions@gmail.com/developercore/117
IMDB Alert
2012-04-15T16:43:46-04:00
LibX Team
http://libx.org
libx.org@gmail.com
Writes an IMDb notification to the tuple space.
/imdb\.com.*/
/imdb\.com\/images/
libx.space.write({
notify:
"<a href='" + libx.edition.links.primary.href + "'>" + libx.edition.links.primary.label + "</a>"
+ " has many DVDs and other audio-visual material available. Click where you see the "
+ "<img src='" + libx.edition.options.icon + "' style='height: 16px;'/> icon."
});