summaryrefslogtreecommitdiff
path: root/js/dynamic.js
blob: 0e6fc0c33ead41906a3c3fe8e6a1e8d2a44e7d56 (plain)
  1. jQuery(function($) {
  2. // Append ?print to the URL to trigger print preview mode
  3. if ((location.href.split('?')[1] || '').indexOf('print') > -1) {
  4. $('link[media=print]').attr('media', '');
  5. }
  6. $('.gmap').each(function(){
  7. var apiArguments = $(this).find('dt');
  8. var apiValues = $(this).find('dd');
  9. if(apiArguments.length) {
  10. var queryString = 'http://maps.google.com/staticmap?';
  11. for(i = 0; i < apiArguments.length; i++) {
  12. queryString = queryString + $(apiArguments[i]).text() + '=' + encodeURIComponent($(apiValues[i]).text()) + '&';
  13. }
  14. queryString = queryString + 'size=241x370';
  15. $(this).append('<img src="'+queryString+'" alt="map">');
  16. $(this).find('dl').hide();
  17. }
  18. });
  19. });