Your options have been updated.
';
}
?>
$default_style
), $annie_attributes ) );
$hilight_text = ''. $annieText .'';
$annie_highlightText[] = $annieText;
// Take care of any nested shortcodes
$hilight_text = do_shortcode($hilight_text);
$annie_showToolbox = true;
return $hilight_text;
}
}
if (! function_exists('annie_footnote_shortcode')) {
// Keep track of how many footnotes we've added
$annie_footcount = 1;
$annie_footnoteText = array();
function annie_footnote_shortcode($annie_attributes, $annieText = '')
{
global $annie_footcount, $annie_footnoteText, $annie_showToolbox, $post;
// Store the text in our array
$annie_footnoteText[$annie_footcount] = $annieText;
// No attributes for footnotes; just the text.
$annie_cleanText = strip_tags($annieText);
// Format the footnote reference
if (function_exists(tippy_formatLink) && get_option('annie_footnoteDisplay', 'link') == 'tooltip')
{
$annie_returnLink = tippy_formatLink("no", $annie_footcount, "#foot_text_". $post->ID . "_". $annie_footcount, $annie_cleanText, "annie_footnoteRef annie_custom", "foot_tip_". $post->ID . "_". $annie_footcount);
$annie_returnLink = str_replace('';
}
$annie_footcount++;
$annie_showToolbox = true;
return $annie_returnLink;
}
}
if (! function_exists('annie_footnote_display_shortcode')) {
$annie_footnotesShowing = false;
function annie_footnote_display_shortcode($annie_attributes = '', $annie_text = '')
{
global $annie_footnotesShowing;
$annie_returnText = annie_process_content('');
$annie_footnotesShowing = true;
return $annie_returnText;
}
}
if (! function_exists('annie_process_content')) {
// Handle extras when showing content
function annie_process_content($content)
{
global $annie_footnotesShowing, $annie_footnoteText, $annie_footcount, $post;
if (!$annie_footnotesShowing && get_option('annie_footnoteShowNotes', 'show') == 'show' && sizeof($annie_footnoteText) > 0)
{
$footnoteHeader = get_option('annie_footnoteNotesHeader', 'Notes:');
$content .= '';
foreach ($annie_footnoteText as $footnoteIndex => $footnoteText)
{
$content .= "\n";
$content .= '
'. $footnoteIndex .'. '. $footnoteText;
$content .= "\n";
}
$content .= '
';
}
$annie_footnoteText = array();
$annie_footcount = 1;
return $content;
}
}
if (! function_exists('annie_toolbox')) {
function annie_toolbox()
{
global $annie_highlightText;
if (sizeof($annie_highlightText) > 0)
{
annie_show_toolbox();
echo '';
// Output the div with highlights
foreach ($annie_highlightText as $discard => $annie_text)
{
// echo $annie_text ."
";
}
echo '
';
}
}
}
if (! function_exists('annie_show_toolbox')) {
$annie_toolboxShowing = false;
function annie_show_toolbox()
{
global $annie_toolboxShowing, $annie_highlightText;
if (!$annie_toolboxShowing && get_option('annie_showToolbox', 'true') == "true")
{
// Toolbox code
$annie_toolboxMarkup = '
';
echo $annie_toolboxMarkup;
$annie_toolboxShowing = true;
}
}
}
if (! function_exists('annie_load_scripts')) {
function annie_load_scripts()
{
// Load jQuery, if not already present
wp_enqueue_script('jquery');
// Load the Tippy script
wp_register_script('Annie', plugins_url() .'/annie/annie.js', array('jquery'));
wp_enqueue_script('Annie');
}
}
if (! function_exists('annie_load_styles')) {
function annie_load_styles()
{
wp_register_style('Annie', plugins_url() .'/annie/annie.css');
wp_enqueue_style('Annie');
}
}
if (! function_exists('annie_load_for_admin'))
{
function annie_load_for_admin()
{
echo '';
}
}
add_action('wp_print_styles', 'annie_load_styles');
add_action('wp_print_scripts', 'annie_load_scripts');
add_shortcode( 'hi', 'annie_highlight_shortcode' );
add_shortcode( 'foot', 'annie_footnote_shortcode' );
add_shortcode( 'footnotes', 'annie_footnote_display_shortcode' );
add_filter( 'the_content', 'annie_process_content', 20 );
add_action('wp_footer', 'annie_toolbox');
add_action('admin_menu', 'annie_addoptions');
add_action('admin_head', 'annie_load_for_admin');
?>