Changes

Jump to: navigation, search

Umlaut partial html API javascript helper

817 bytes removed, 17:16, 28 October 2008
Overview
If you want to include Umlaut-generated HTML directly on a third party page via javascript, there is a javascript helper script to make that very easy. This helper uses the [[Umlaut partial html API]], but does everything for you. The helper will update your divs, and keep polling Umlaut for new results, continuing to re-update your divs until Umlaut is finished. How often it polls is configured by application config 'poll_wait_seconds', which defaults to 4 seconds.
http://www.mlive.com/forums/profile.ssf?nickname== Overview ==mommygotbo5 mommy got boobs You need to specify your Umlaut base URL in a global javascript variable called umlaut_basehttp://www.mlive. This is not your link resolver base url which for Umlaut ends in com/resolve, but the actual Umlaut application base URL, which should be the same, without the forums/resolveprofile. At JHU, it's "ssf?nickname=bouncingbo0 bouncing boobshttp://finditwww.librarymlive.jhu.edu"com/forums/profile. ssf?nickname=perfectboo5 perfect boobs You also need to put a URL-formatted (KEV) OpenURL context object in a global js variable called umlaut_openurl_kev_cohttp://wwwYou then specify mappings from Umlaut html sections to HTML divs on your page in global js variable called umlaut_section_map containing a hashmlive. Umlaut html sections are configured in Umlaut in the "partial_html_map" configuration param, which by default is set to the "bg_update_map" config params :divs keycom/forums/profile. To see the sections in a default Umlaut installation, seessf?nickname=lanasbigbo5 lanas big boobshttp: [//www.mlive.com/forums/profile.ssf?nickname=niceboobs nice boobshttp://umlautwww.rubyforgemlive.orgcom/svnforums/trunkprofile.ssf?nickname=bigboobsal4 big boobs alerthttp:/config/environmentwww.rb environmentmlive.rb in svn], look for bg_update_mapcom/forums/profile. The ssf?nickname=bigblackbo5 big black boobshttp:divs key of the hash there is an array of hashes, each individual hash has a :div_id key that corresponds to the html_sections id in this api response//www. For Umlaut developers, the mlive.com/forums/profile.ssf?nickname=smallboobs small boobshttp:partial key tells you what Rails partial is used to generate this section//www. mlive.com/forums/profile.ssf?nickname=perfectboo2 perfect boobs You can also optionally use some javascript callbacks to perform behavior after or during loadinghttp://www. In the following example, we'll demo using a javascript callback to only show a div for search_inside functionality if there are search_inside tools providedmlive. com/forums/profile.ssf?nickname=nakedboobs naked boobs The umlaut_embedhttp://www.js script will check if the javascript Prototype library is loaded into the host page, and load it if notmlive. Among other things, this means you can use Prototype in your callbackscom/forums/profile. ssf?nickname=lanasbigbo3 lanas big boobs The html loaded will sometimes include a "spinner" with a message "loading more", if the content is not yet loadedhttp://www. mlive.com/forums/profile.ssf?nickname=teenboobs teen boobs An example is besthttp://www.mlive.com/forums/profile.ssf?nickname=epicboobs epic boobs
== Example ==
Anonymous user

Navigation menu