Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- document.addEventListener("DOMContentLoaded", function(event) {
- /* Constant vaues. You configure these. If you don't want to
- change a title or "Keep empty" string, then replace the quoted
- strong with the word "null" (without quotes). For example,
- * To only change only the In Honor Of title and "keep empty...""
- string, change the values like this:
- var IMO_TITLE = null; // "in Memory Of" stays
- var IMO_EMPTY = null; // "Keep blank if none" in IMO stays
- * To only change only the the In Memory Of title and "keep blank..."
- strings, change the values like this:
- var IHO_TITLE = null; // "in Honor Of" stays
- var IHO_EMPTY = null; // "Keep blank if none" in IHO stays
- */
- var IMO_TITLE = 'In Loving Memory Of';
- var IMO_EMPTY = '(Please leave blank if none.)';
- var IHO_TITLE = 'In Grateful Honor Of';
- var IHO_EMPTY = '(Please leave empty if none.)';
- /*
- * Function to change the head for an IMO or IHO in `p`.
- *
- * @param [Object] p Element containing the IMO/IHO text
- * @param [String] title New title text (in `<strong>`)
- * @param [String] emptyText new empty text (in `<em>`)
- *
- * @note Provide a null in `title` or `emptyText` to leave the
- * part of the IMO/IHO title unchanged.
- *
- */
- function changeHeader(p, title, emptyText) {
- if (title != null) {
- var list = p.getElementsByTagName('strong');
- if (list.length > 0) {
- list[0].textContent = title;
- }
- }
- if (emptyText != null) {
- var list = p.getElementsByTagName('em');
- if (list.length > 0) {
- list[0].textContent = emptyText;
- }
- }
- }
- var fsHonorOf = document.getElementById('honorof');
- if (fsHonorOf != null) {
- var pList = fsHonorOf.getElementsByTagName('p');
- if (pList.length > 1) {
- pList[0].id = 'imo_banner';
- pList[1].id = 'iho_banner';
- changeHeader(pList[0], IMO_TITLE, IMO_EMPTY);
- changeHeader(pList[1], IHO_TITLE, IHO_EMPTY);
- }
- }
- });
- </script>
- <style type="text/css">
- /* CSS to change the IMO and IHO content and style. Style changes are for
- * both the title (in <strong> tag) and the "leave blank if" part (in the
- * <em> tag).
- */
- /* Remove these two rules to leave the CSS for the In Honor Of fields
- * unmodified. Change the contents to change the way that the In Honor
- * Of fields are displayed.
- */
- #iho_banner strong {
- font-family: "Times New Roman,serif";
- color: darkblue;
- }
- #iho_banner em {
- font-family: "Times New Roman,serif";
- font-size: smaller;
- }
- /* Remove these two rules to leave the CSS for the In Memory Of fields
- * unmodified. Change the contents to change the way that the In Memory
- * Of fields are displayed.
- */
- #imo_banner strong {
- font-family: "Times New Roman,serif";
- color: darkblue;
- }
- #imo_banner em {
- font-family: "Times New Roman,serif";
- color: darkred;
- font-size: smaller;
- }
- </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement