This method uses a mixture of DOM scripting, and a small ammount of perl (or any other backend language) to send SMS from the catalog.
When testing this, try it on your 'test' server first
In order for this method to work, we need to put some 'landmarks' or 'ids' in your wwwoptions file. We'll use javascript later to access these.
TABLEPARAM_BIB_DETAIL=id='bib_detail' width="100%" border="0" cellspacing="1"
TABLEPARAM_BIB_ITEMS=id='bib_items' width="100%" border="3" cellspacing="1"
#info, #sms {
border:1px solid #36647b; position:absolute; top:250; left:50; z-index:1000; background:#fff; padding:10px; margin:10px; background:#efefcf; }
#sms .eg { font-style:italic; font-size:80%; }
#info {top:500}
#sms {font-size:70%}
add the following line to your TOPLOGO.html
<script type="text/javascript" src='/screens/sms.js'> </script>
<!-- this div starts hidden and is just a note -->
<div style='visibility:hidden' id='info'>You could get out a piece of paper, find a pencil, and write down this call number so that you can find it in the stacks. Or you could text it to your phone! The text message will contain the location, call number, and title of the item on this page. Be careful if you don't have a text messaging plan for your phone - carrier charges may apply.<br><a href="#here" onClick="document.getElementById('info').style.visibility='hidden';return false" style='text-align:center'>close</a></div> <!-- this is the button set we'll hide it if the BIB has no items --> <div id=smsfeatures>
<a href="#here" name=smsbutton id=smsbutton onClick="showsms();return false;"><img src="/screens/smsbutton.gif" border=0></a> <a href="#here" onClick="findPos(document.getElementById('smsbutton'),document.getElementById('info'),-350,-100);document.getElementById('info').style.visibility='visible';return false;"><img src='/screens/smsq.gif' border=0></a><br>
</div> <!-- a quick script to hide the SMS menu if there are no items. same as the javascript in the SMS form, but it's really just to see if the items exist. If they don't, we hide the buttons --> <script> var f = document.getElementById('bib_detail'); try { var itms = document.getElementById('bib_items'); var tr = itms.getElementsByTagName('TR'); for(i = 1; i < tr.length; i++) { var x=tr[i].getElementsByTagName('TD'); if (x.length == 3) { var loc = x[0].innerHTML.replace(/(<([^>]+)>| )/ig,""); var call = x[1].innerHTML.replace(/(<([^>]+)>| )/ig,""); var status = x[2].innerHTML.replace(/(<([^>]+)>| )/ig,""); } } } catch (e) { document.getElementById('smsfeatures').style.visibility='hidden'; }</script> </div> <!-- just a placeholder for the sms form --> <div id='sms' style="visibility:hidden;display:none">
</div>
Download the following ZIP file and add the images / javascript file / perl. http://trilogy.brynmawr.edu/trico/sys/sms.zip
load a record in your catalog