LDS Scripture Tooltipper

As a member of the LDS Church who likes to blog about his thoughts on different religious topics, I found the need to create a tooltip that dynamically pulls in the scriptural sources so I can cite them as accurately as possible.

The below quote is pulled from my post “Doubting Thomas” that illustrates the tooltipper in action.

In John 11, Christ is told a friend of his, Lazarus, had gotten sick. Jesus tells his disciples that he wants to go to Judea to heal him. They told him that the last time they were there they tried to stone him, and that if they returned, they would surely succeed this time. Thomas then boldly tell the other disciples, “Let us also go, that we may die with him.”

In this example, you see as you hover over the link, it pulls in the entire scriptural source. To set this up it is very simple, the link that you want tooltipped is simple the lds.org link to the highlighted scripture. If you click on the link, the page will be pulled up.

I’ve created two versions of the tooltipper, a wordpress plugin, and a raw code plugin

WordPress Plugin

The plugin is currently pending view to be an official WordPress plugin, but can be downloaded directly here.

This will apply the tooltipper to linked within “.entry-content”

Raw Plugin

Here is a link to the files you will need to set it up.

$(document).ready(function(){
	$('#blog .a').each(function (index, value) { 
		new ldsToolTip({ el : this, root : "url/scriptures.php" });
	});
});

This will cycle through every link in an element ID’ed with “blog” and check if the link can be tooltipped.

Here are the default option settings

  • el : null,
  • href : null,
  • scripture : null,
  • book : null,
  • chapter : null,
  • verse : null,
  • speed : 400,
  • summary : true,
  • root : null,
  • prevent : false

Options

el

This option is required. The javascript object you want the effect attached to.

speed

How fast you want the tooltip to appear and disappear. The value is in milliseconds.

summary

This will grab the summary of the scriptures if you only link the chapter.

root

This option is required. This is where the magic happens. This will parse through the link and grab the text from lds.org. This value is the link to the “scriptures.php” file in the zip.

prevent

This will prevent the tooltip from running if desired,

href

This will set a custom url if you desire. The entire link is required in this option. The following 4 options also set a custom url, but all are required in order for the link to work.

scripture

This will set a custom url if you desire. This value is the entire book of scriptures, ie New Testament. If you wanted to add the value of “New Testament”, the option should be set to “nt”.

book

This will set a custom url if you desire. This value is the book of scripture, ie John. If you wanted to add the value of “John”, the option should be set to “john”.

chapter

This will set a custom url if you desire. This value is the chapter in the book, ie John Chapter 11. If you wanted to add the value of “Chapter 11”, the option should be set to “11”.

verse

This will set a custom url if you desire. This value is the verse in the book, ie John Chapter 11 verse 16. If you wanted to add the value of “Verse 16”, the option should be set to “16”.

This option is the most dynamic.

  • single verse : “16”
  • range of verses : “16-17”
  • selective verses : “16-17,19”