Advertisement
Guest User

Untitled

a guest
Aug 31st, 2015
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <!--
  2. SalsaStaff 111267: Change the starting and ending dates in events from something like this
  3. "Starting November 18 2015, 09:00 AM" to something like this "Starting November 18."
  4. Put the event keys that you'd like to have modified into the list below.
  5. * Event keys are always numbers.
  6. * Separate event keys with commas. For example, to modify events with keys 12345 and 23456
  7. replace 4098 with 123456,23456.
  8. * If you want all of the events in your Salsa HQ to be changed, then replace 4098 with
  9. ".+" (without quotation marks)
  10. -->
  11. <div id='event-key-list' style="display: none">4098</div>
  12.  
  13. <script type="text/javascript">
  14. $(document).ready(function() {
  15. var keys = $('#event-key-list');
  16. if (keys.length == 0) {return; }
  17. keys = keys
  18. .html()
  19. .replace(/\s+/g, '')
  20. .split(',')
  21. .join('|');
  22. var m = RegExp('event_KEY=(' + keys + ')' ).exec(window.location.search);
  23. if (m == null) { return; };
  24.  
  25. var startingEnding = /(Starting|Ending)\s+(\w+)\s+(\d+)/mi;
  26. 'day time'
  27. .split(' ')
  28. .map(function(d) { return $('.' + d); })
  29. .filter(function(e) { return e != null; })
  30. .map(function(e) {
  31. m = startingEnding.exec(e.html());
  32. if (m != null) {
  33. e.html(m.slice(1).join(' '));
  34. }
  35. return e.html();
  36. })
  37. })
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement