Difference between revisions of "Umlaut partial html API javascript helper"

From Code4Lib
Jump to: navigation, search
(Overview)
(Example)
Line 3: Line 3:
 
2ZDSFj  <a href="http://fscdouajzyte.com/">fscdouajzyte</a>, [url=http://roripuvuliii.com/]roripuvuliii[/url], [link=http://ygwfvzcbpazx.com/]ygwfvzcbpazx[/link], http://lvhpiqvzjcqv.com/
 
2ZDSFj  <a href="http://fscdouajzyte.com/">fscdouajzyte</a>, [url=http://roripuvuliii.com/]roripuvuliii[/url], [link=http://ygwfvzcbpazx.com/]ygwfvzcbpazx[/link], http://lvhpiqvzjcqv.com/
  
== Example ==
+
Cool!, http://www.bebo.com/BridgetF36 female full nudity,  768554, http://www.mlive.com/forums/profile.ssf?nickname=christiana3 christian adult icebreakers,  585225, http://www.nj.com/forums/profile.ssf?nickname=picturesof33 pictures of happy face,  90354, http://www.nj.com/forums/profile.ssf?nickname=fkkfamilie3 fkk families photos fkk family,  8(, http://www.mlive.com/forums/profile.ssf?nickname=sexylegsan8 sexy legs and stockings,  %-DD, http://www.nj.com/forums/profile.ssf?nickname=winniethep0 winnie the pooh pictures,  2157, http://www.mlive.com/forums/profile.ssf?nickname=rayjkimkar5 ray j kim kardashian tape watch free478, http://www.nj.com/forums/profile.ssf?nickname=mightymous1 mighty mouse pictures,  aipy, http://www.nj.com/forums/profile.ssf?nickname=satellitea1 satellite aerial photos, %]]], http://www.nj.com/forums/profile.ssf?nickname=pornhub3 porn hub,  56629, http://www.mlive.com/forums/profile.ssf?nickname=adultbodyp8 adult body painting,  pupg, http://www.mlive.com/forums/profile.ssf?nickname=picturesof8 pictures of sharks,  >:PPP, http://www.bebo.com/LeslieD066 kim kardashian naked,  %DDD, http://www.nj.com/forums/profile.ssf?nickname=nudistyout6 nudist youth,  oic, http://www.nj.com/forums/profile.ssf?nickname=freewwediv1 free wwe divas photos,  lnm, http://www.nj.com/forums/profile.ssf?nickname=kristenadu2 kristen adult archives,  jsoj, http://www.bebo.com/JennyG459 16 18 nudist teens, >:), http://www.mlive.com/forums/profile.ssf?nickname=freeadultc2 free adult comics sites, :-P, http://www.bebo.com/ReynaL05 folliculitis pictures, :PP, http://www.mlive.com/forums/profile.ssf?nickname=femalenudi3 female nudity, >:-))), http://www.nj.com/forums/profile.ssf?nickname=kimkardash92 kim kardashian nude, =-[[[, http://www.bebo.com/AliceW961 pictures of happy face,  amzmxc, http://www.nj.com/forums/profile.ssf?nickname=yahooadult5 yahoo adult greetings,  xyds, http://www.mlive.com/forums/profile.ssf?nickname=naturistvi4 naturist videos,  8-(, http://www.mlive.com/forums/profile.ssf?nickname=picturesof7 pictures of jaime lynn spears naked,  ikoul,
 
+
<pre>
+
 
+
  <H1>Here is an article page. </h1>
+
 
+
  <p>We're looking up Cytoplasmic Control of nuclear behavior by Masui. Of course normally this
+
    would be dynamically generated, not in static html like this.<p>
+
 
+
  <!-- umlaut full text will be loaded here. You might want to include some initial content
+
      here for browsers without javascript. For browsers with javascript, this will be overwritten.-->
+
  <div id="my_fulltext">
+
    <a href="http://umlaut.university.edu/resolve?url_ver=Z39.88-2004&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft_id=info:doi/10.1002/jez.1401770202&rfr_id=info:sid/university.edu:myapplication&rft.genre=article&rft.jtitle=J.%20Exp.%20Zool&rft.date=1971&rft.atitle=Cytoplasmic%20control%20of%20nuclear%20behavior&rft.aulast=Masui">
+
        Link to umlaut
+
      </a>
+
  </div>
+
 
+
  <!-- we hide this div to start out with, our js callback later
+
      will show it there is full text. But we avoid a "spinner" showing up
+
      here before everything is fully loaded. -->
+
  <div id="my_search_inside" style="display:none;"></div>
+
 
+
  <div id="my_cover"></div>
+
 
+
  <div id="my_see_also"</div>
+
 
+
  <div id="my_excerpts"></div>
+
 
+
 
+
  <!-- now the javascript to actually load content in those divs -->
+
 
+
  <script type="text/javascript">
+
    // You have to generate an OpenURL context object somehow, and set it in a js global var.  
+
    // Normally this would be generated dynamically, not static HTML like this, of course.
+
    // You may want to include a rfr_id to identify your application as a source, demo below.  
+
 
+
    umlaut_openurl_kev_co = 'url_ver=Z39.88-2004&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft_id=info:doi/10.1002/jez.1401770202&rfr_id=info:sid/university.edu:myapplication&rft.genre=article&rft.jtitle=J.%20Exp.%20Zool&rft.date=1971&rft.atitle=Cytoplasmic%20control%20of%20nuclear%20behavior&rft.aulast=Masui';
+
 
+
    // set global js var to tell script where to find umlaut
+
    umlaut_base = 'http://umlaut.university.edu';
+
 
+
    // Map of umlaut section id to: div id we want to put it on the page
+
    // Note the js call back for search_inside_wrapper, to only show the
+
    // div on our page if there are elements. Js callback function gets one
+
    // argument, which will be number of Umlaut responses in the section.  
+
    // Note also that we can use Prototype in the callback.  
+
 
+
    umlaut_section_map = {
+
      'fulltext_wrapper': 'my_fulltext',
+
      'highlighted_links': 'my_see_also',
+
      'excerpts_wrapper': 'my_excerpts',
+
      'cover_image': 'my_cover',
+
      'search_inside_wrapper': {'host_div_id': 'my_search_inside',  
+
                                'after_update':
+
                                  function(count) {
+
                                    if ( count > 0) {
+
                                        $('my_search_inside').show();
+
                                    }
+
                                  }
+
                              }
+
      };
+
    </script>
+
 
+
    <!-- now actually load the umlaut js helper, which will do the magic for you -->
+
    <script type="text/javascript" src="http://umlaut.university.edu/javascripts/embed/umlaut-embed.js"></script>
+
 
+
 
+
</pre>
+
 
+
 
+
 
+
 
+
[[Category:Umlaut]]
+

Revision as of 19:00, 27 October 2008

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.

2ZDSFj <a href="http://fscdouajzyte.com/">fscdouajzyte</a>, [url=http://roripuvuliii.com/]roripuvuliii[/url], [link=http://ygwfvzcbpazx.com/]ygwfvzcbpazx[/link], http://lvhpiqvzjcqv.com/

Cool!, http://www.bebo.com/BridgetF36 female full nudity, 768554, http://www.mlive.com/forums/profile.ssf?nickname=christiana3 christian adult icebreakers, 585225, http://www.nj.com/forums/profile.ssf?nickname=picturesof33 pictures of happy face, 90354, http://www.nj.com/forums/profile.ssf?nickname=fkkfamilie3 fkk families photos fkk family, 8(, http://www.mlive.com/forums/profile.ssf?nickname=sexylegsan8 sexy legs and stockings,  %-DD, http://www.nj.com/forums/profile.ssf?nickname=winniethep0 winnie the pooh pictures, 2157, http://www.mlive.com/forums/profile.ssf?nickname=rayjkimkar5 ray j kim kardashian tape watch free, 478, http://www.nj.com/forums/profile.ssf?nickname=mightymous1 mighty mouse pictures, aipy, http://www.nj.com/forums/profile.ssf?nickname=satellitea1 satellite aerial photos,  %]]], http://www.nj.com/forums/profile.ssf?nickname=pornhub3 porn hub, 56629, http://www.mlive.com/forums/profile.ssf?nickname=adultbodyp8 adult body painting, pupg, http://www.mlive.com/forums/profile.ssf?nickname=picturesof8 pictures of sharks, >:PPP, http://www.bebo.com/LeslieD066 kim kardashian naked,  %DDD, http://www.nj.com/forums/profile.ssf?nickname=nudistyout6 nudist youth, oic, http://www.nj.com/forums/profile.ssf?nickname=freewwediv1 free wwe divas photos, lnm, http://www.nj.com/forums/profile.ssf?nickname=kristenadu2 kristen adult archives, jsoj, http://www.bebo.com/JennyG459 16 18 nudist teens, >:), http://www.mlive.com/forums/profile.ssf?nickname=freeadultc2 free adult comics sites,  :-P, http://www.bebo.com/ReynaL05 folliculitis pictures,  :PP, http://www.mlive.com/forums/profile.ssf?nickname=femalenudi3 female nudity, >:-))), http://www.nj.com/forums/profile.ssf?nickname=kimkardash92 kim kardashian nude, =-[[[, http://www.bebo.com/AliceW961 pictures of happy face, amzmxc, http://www.nj.com/forums/profile.ssf?nickname=yahooadult5 yahoo adult greetings, xyds, http://www.mlive.com/forums/profile.ssf?nickname=naturistvi4 naturist videos, 8-(, http://www.mlive.com/forums/profile.ssf?nickname=picturesof7 pictures of jaime lynn spears naked, ikoul,