Expand/Collapse All Scroll To Current Section Test

This is a test using the ew expand_all and collapse_all callbacks to automatically scroll to the section currently being viewed. The issue is that when expand/collapse all is clicked, large amounts of content is suddenly added to–or removed from–the page. This new page length will often re-flow the page, causing the user to loose their place in the currently viewed content.

The Idea is to implement the following:
1. Create ‘section headers’ that will automatically update when the users scrolls past them.

<h2 id="section-1" class="section">Section Title</h2>


2. Add some javascript that will saved the currently viewed section id to a variable.

 jQuery(document).ready(function () {
        jQuery(document).on("scroll", onScroll);
        var currSection = null;
 });

function onScroll(event){
        var scrollPos = jQuery(document).scrollTop();
        jQuery('.section').each(function () {
            var currElement = jQuery(this);
            if (currElement.position().top <= scrollPos && currElement.position().top + currElement.height() > scrollPos) {
               currSection = currElement.attr("id");
            }
        });
    }

3. After expand/collapse/set all is triggered, all call back will be created that will scroll the page automatically to the section header that was last viewed.

if(typeof currSection !== 'undefined' && jQuery('#' + currSection).length ){
   setTimeout(function(){
      scrollTarget = jQuery('#' + currSection).offset().top;
      if(typeof colomatoffset !== 'undefined'){
         scrollTarget = scrollTarget + colomatoffset
      }
      jQuery('html, body').animate({scrollTop:scrollTarget});
   }, 700);
}

Demonstration:

Scroll down a bit and then click the Expand All link placed in the header at the end of the menu. All ‘read more’ content should be expanded and then the page should scroll back to the section that was being viewed. The effect is more dramatic the further down the page is scrolled.

Section 1: Aaeton

Aaeton was a planet of the Aaeton system, in the Core Worlds region. During the Cold War between the Galactic Republic and the Sith Empire, an Imperial bioweapon activated on the planet. During the last days of the Republic, the government of Aaeton had authorization to allow its citizens to visit the generally off-limits neighboring world of Ragoon VI.

more
I’m from the planet Aaeton, only half-day’s journey from here. Young people from my planet often go on survival camping trips on Ragoon-6 when we reach fourteen years of age. We have a special allowance from the Senate because we gave the elders of Ragoon refuge when they handed the planet over to the Senate.
―Floria

Section 2: Aaghra

Aaghra was the first planet from the star Zug in the Zug system of the galaxy’s Core Worlds region, not far from Coruscant,[1] the most politically important planet in galactic history.[2] It was a moonless world of molten rock.[1]

more
Aaghra was first mentioned briefly in part one of the Planet Hoppers article Aargau: For All Your Banking Needs, which was written by Cory J. Herndon and published on the Wizards.com website in 2003.[1]

Section 3: Aar

Aar was a planet[3] in the Aar system[1] of the Nijune sector,[2] part of the Outer Rim Territories.[1] It was homeworld to the Aar’aa species, reptilian sentients often employed as enforcers by the Hutts, a species known for its many crime lords.[3]

more
Aar was first mentioned in the 1997 novel The Paradise Snare, written by A. C. Crispin, and was also mentioned eleven years later in the 2008 The Complete Star Wars Encyclopedia.

Section 4: Aargau

Aargau (pronounced /är-‘gou/)[5] was a planet in the Zug system of the Core Worlds region, not far from Coruscant and the Corellian Run. It was run by and served as the headquarters for the Bank of Aargau, which was part of the InterGalactic Banking Clan. Numerous other banks and corporations were also based on Aargau, including the Z-Gomot Ternbuell Guppat Corporation. Aargau was an exceptionally wealthy world, due both to its status as a financial center, as well as the planet’s vast reserves of rare and precious metals.

more
Aargau was a member of the Galactic Republic from its discovery until the end of that galactic power. After the fall of the Galactic Empire, it was considered a New Republic stronghold. The region of space occupied by the planet would later fall under the hegemony of first the Galactic Federation of Free Alliances, and then subsequently Darth Krayt’s Galactic Empire. Despite this, Aargau took a neutral approach to politics, which meant that warring factions were mutually welcome to conduct business on the planet. The planetary government imposed only three laws on citizens and visitors, called the Three Statutes of Aargau. These laws focused on the export of Aargau’s natural resources, the absolute ban on weapons for visitors—and, conversely, the requirement to bear arms for Aargauuns—as well as maintaining the integrity of the Bank of Aargau. Breaking any of these rules was punishable by immediate execution.

Section 5: Aargonar

Aargonar was a dusty, desert-climate planet located in the Borderland Regions of the Mid Rim.

more
Aargonar was an insignificant desert world with few population.[2] The terrain was reminiscent of Tatooine for Jedi Knight Anakin Skywalker, with rock arches and stone spires dotting the once watery-planet.[3] The planet had several moons, including Aargonar 3.[2]

The planet was known to house numerous Sarlacc.[2] It was also home to Hrumphs and Gouka dragons.[3]


Collapse-O-Matic and Easy Footnotes Test

This is a test of how collapse-o-matic and easy footnotes can work togher. We have modified the Easy Footnotes[note]Easy Footnotes on the WordPress Plugin Repo at:  https://wordpress.org/plugins/easy-footnotes/[/note] plugin to allow for filtering before and after the footnote content. The modified plugin is available at Github [note]https://github.com/baden03/easy-footnotes [/note]

The filters used as follows:


add_filter( 'before_footnote', 'pre_footnote', 1);
function pre_footnote($footnote_content) {
	$footnote_content .= 'content to place before the footnotes';
	return $footnote_content;
}

add_filter( 'after_footnote', 'post_footnote', 1 );
function post_footnote($footnote_content) {
	$footnote_content .= 'content to place after the footnoes';
	return $footnote_content;
}


Peanuts Character 555 95472

555 95472, or 5 for short, debuted in the September 30, 1963, strip, and appeared occasionally until the 1980s. A boy close in age to Charlie Brown and Linus van Pelt, 5 had brown spiky hair, and he wore an orange shirt with the number 5 on it. 5 was given a numerical name by his father, who was upset over the preponderance of numbers in people’s lives; when questioned, 5 clarified that this was not his father’s way of protesting, it was his way of “giving in.” His last name, 95472 (the accent is on the 4), was taken from the family’s ZIP code; it is also the zip code for Sebastopol, California, where Schulz lived at the time.

"5"
“5”

Column-Matic Responsive CSS

This is a quick demo on how to set up responsive columns with Column-Matic. In this demo will will display three columns that will then stack vertically once the screen size drops below a certain width.

The CSS

.my_column {
    width: 23%;
    margin-left: 5%;
    padding-left: 5%;
}

@media (max-width: 450px) {
    .my_column {
        width: 95%;
        margin: 0 auto;
                padding: 3px;
        clear: both;
        border: none;
    }
}

Shortcode

[[column class="my_column"]...[/column]][[column class="my_column"]...[/column]][[column class="my_column"]...[/column]][[end_columns]]

Result

[column class=”my_column”]Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.[/column][column class=”my_column”]Ex cum quas aeque, alii constituto nam in. Id vocibus mandamus suscipiantur vim, mel ad ipsum convenire maluisset. His vocent accusata torquatos an, ei dicat tation pro, et suavitate definitiones pro. Mei perfecto tincidunt ea, omnesque efficiendi interesset in mei.[/column][column class=”my_column”]Lorem ipsum dolor Cu eam probo phaedrum philosophia, sed eu iisque persius repudiandae. An ferri mollis deseruisse qui, te dicit mnesarchum est, nonumy docendi tincidunt sit cu. Mei at munere admodum.[/column]
[end_columns]