﻿// JavaScript Document
$(document).ready(function() {
    $(function() {

        // --------------------------------------------------------------------------------
        //   TRIPOLI RESET - IMPORTANT!!!
        // --------------------------------------------------------------------------------
        $('head').prepend('<link href="/storage/css/tripoli.simple.css" rel="stylesheet" type="text/css" />');



        // --------------------------------------------------------------------------------
        //   ADDCLASS
        // --------------------------------------------------------------------------------
        // Apply ClearFix
        $('#pageBody').addClass('clearfix');
        $('#contentWrapper').addClass('clearfix');
        $('#pageFooterWrapper').addClass('clearfix');



        // --------------------------------------------------------------------------------
        //   PREPEND
        // --------------------------------------------------------------------------------
        // -- PAGE TITLES --------------------
        // Add Page Titles to Pages Without Titles or That Don't Allow for "Modify Header"
        // page title - PAGENAME
        // $('#modulePageIDNUM #content').prepend('<h1 id="pageTitle">Lifestyle</h1>');


        // --------------------------------------------------------------------------------
        //   REPLACE TEXT - jquery.ba-replacetext.js
        // --------------------------------------------------------------------------------

        // Replace default <title> seperator with straight line
        $('title').replaceText(' - ', ' | ');
        // Remove "- Emily" from ENTRIES Change Tracker
        $('#moduleContentWrapper10964824 .change-list-pt li').replaceText(' - Emily', ' ');
		$('#moduleContentWrapper10964824 .change-list-pt li').replaceText('<br>', ' ');

        // -- JOURNALS --------------------
        // ________________________________________
        // Modify SysGen "Read More" Links
        $('.journal-read-more-tag *').replaceText('Click to read more', 'More');


        // Modify "Send Email" Title
        // $('h2.document-title').replaceText("(Email)", ' ');

        // ________________________________________
        // Modify Journal Comment Area
        // Captions
        $('h3.caption').replaceText('Reader Comments', 'Comments');

        // Submit Buttons
        $('.footer input#createPostButton').attr({
            value: "Comment"
        });

        $('.footer input#previewPostButton').attr({
            value: "Preview"
        });


        // -- CONTACT FORMS --------------------
        // modify submit button
        $('.notice-box input.submit-button').attr({
            value: "Send"
        });



        // --------------------------------------------------------------------------------
        //  MISCELLANY
        // --------------------------------------------------------------------------------
        // -- TRIM EMPTY PARAGRAPH TAGS --------------------
        $("p").filter(function() {
            return $.trim($(this).html()) == '';
        }).remove()


    });
});

