Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. <script type="text/javascript">
  2. document.addEventListener("DOMContentLoaded", function(event) {
  3. /* Constant vaues. You configure these. If you don't want to
  4. change a title or "Keep empty" string, then replace the quoted
  5. strong with the word "null" (without quotes). For example,
  6.  
  7. * To only change only the In Honor Of title and "keep empty...""
  8. string, change the values like this:
  9.  
  10. var IMO_TITLE = null; // "in Memory Of" stays
  11. var IMO_EMPTY = null; // "Keep blank if none" in IMO stays
  12.  
  13. * To only change only the the In Memory Of title and "keep blank..."
  14. strings, change the values like this:
  15.  
  16. var IHO_TITLE = null; // "in Honor Of" stays
  17. var IHO_EMPTY = null; // "Keep blank if none" in IHO stays
  18. */
  19.  
  20. var IMO_TITLE = 'In Loving Memory Of';
  21. var IMO_EMPTY = '(Please leave blank if none.)';
  22. var IHO_TITLE = 'In Grateful Honor Of';
  23. var IHO_EMPTY = '(Please leave empty if none.)';
  24.  
  25. /*
  26. * Function to change the head for an IMO or IHO in `p`.
  27. *
  28. * @param [Object] p Element containing the IMO/IHO text
  29. * @param [String] title New title text (in `<strong>`)
  30. * @param [String] emptyText new empty text (in `<em>`)
  31. *
  32. * @note Provide a null in `title` or `emptyText` to leave the
  33. * part of the IMO/IHO title unchanged.
  34. *
  35. */
  36.  
  37. function changeHeader(p, title, emptyText) {
  38. if (title != null) {
  39. var list = p.getElementsByTagName('strong');
  40. if (list.length > 0) {
  41. list[0].textContent = title;
  42. }
  43. }
  44. if (emptyText != null) {
  45. var list = p.getElementsByTagName('em');
  46. if (list.length > 0) {
  47. list[0].textContent = emptyText;
  48. }
  49. }
  50.  
  51. }
  52. var fsHonorOf = document.getElementById('honorof');
  53. if (fsHonorOf != null) {
  54. var pList = fsHonorOf.getElementsByTagName('p');
  55. if (pList.length > 1) {
  56. pList[0].id = 'imo_banner';
  57. pList[1].id = 'iho_banner';
  58. changeHeader(pList[0], IMO_TITLE, IMO_EMPTY);
  59. changeHeader(pList[1], IHO_TITLE, IHO_EMPTY);
  60. }
  61. }
  62. });
  63. </script>
  64.  
  65. <style type="text/css">
  66. /* CSS to change the IMO and IHO content and style. Style changes are for
  67. * both the title (in <strong> tag) and the "leave blank if" part (in the
  68. * <em> tag).
  69. */
  70.  
  71. /* Remove these two rules to leave the CSS for the In Honor Of fields
  72. * unmodified. Change the contents to change the way that the In Honor
  73. * Of fields are displayed.
  74. */
  75. #iho_banner strong {
  76. font-family: "Times New Roman,serif";
  77. color: darkblue;
  78. }
  79. #iho_banner em {
  80. font-family: "Times New Roman,serif";
  81. font-size: smaller;
  82. }
  83.  
  84. /* Remove these two rules to leave the CSS for the In Memory Of fields
  85. * unmodified. Change the contents to change the way that the In Memory
  86. * Of fields are displayed.
  87. */
  88. #imo_banner strong {
  89. font-family: "Times New Roman,serif";
  90. color: darkblue;
  91. }
  92. #imo_banner em {
  93. font-family: "Times New Roman,serif";
  94. color: darkred;
  95. font-size: smaller;
  96. }
  97. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement