- **IMPORTANT**: Improved performance. You need to Activate the Plugin again. (Settings won't change!)
- Add: Translation: United States - Add: Translation: Austria - Add: Translation: Spanish (many thanks to Pablo L.) - Update: Translations (de_DE and en_GB) - Update: Changed Plugins init file name to improve performance (Re-activation of the Plugin is required) - Bugfix: Avoid multiple IDs for footnotes when multiple reference containers are displayed git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@1009510 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
3ad7787a33
commit
56a6264f0b
21 changed files with 2053 additions and 163 deletions
|
@ -22,9 +22,9 @@ class MCI_Footnotes_Hooks {
|
|||
* @since 1.5.0
|
||||
*/
|
||||
public static function registerHooks() {
|
||||
register_activation_hook(dirname(__FILE__) . "/../index.php", array("MCI_Footnotes_Hooks", "activatePlugin"));
|
||||
register_deactivation_hook(dirname(__FILE__) . "/../index.php", array("MCI_Footnotes_Hooks", "deactivatePlugin"));
|
||||
register_uninstall_hook(dirname(__FILE__) . "/../index.php", array("MCI_Footnotes_Hooks", "uninstallPlugin"));
|
||||
register_activation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "activatePlugin"));
|
||||
register_deactivation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "deactivatePlugin"));
|
||||
register_uninstall_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "uninstallPlugin"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,14 +45,10 @@ class MCI_Footnotes {
|
|||
// initialize the Plugin Task
|
||||
$this->initializeTask();
|
||||
|
||||
// Register all Public Stylesheets
|
||||
add_action('init', array($this, 'registerPublicStyling'));
|
||||
// Register all Public Scripts
|
||||
add_action('init', array($this, 'registerPublicScripts'));
|
||||
// Enqueue all Public Stylesheets
|
||||
add_action('wp_enqueue_scripts', array($this, 'registerPublicStyling'));
|
||||
// Enqueue all Public Scripts
|
||||
add_action('wp_enqueue_scripts', array($this, 'registerPublicScripts'));
|
||||
// Register all Public Stylesheets and Scripts
|
||||
add_action('init', array($this, 'registerPublic'));
|
||||
// Enqueue all Public Stylesheets and Scripts
|
||||
add_action('wp_enqueue_scripts', array($this, 'registerPublic'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,25 +83,15 @@ class MCI_Footnotes {
|
|||
}
|
||||
|
||||
/**
|
||||
* Registers and enqueue scripts to the public pages.
|
||||
* Registers and enqueue scripts and stylesheets to the public pages.
|
||||
*
|
||||
* @author Stefan Herndler
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public function registerPublicScripts() {
|
||||
public function registerPublic() {
|
||||
wp_enqueue_style('mci-footnotes-css-public', plugins_url('../css/public.css', __FILE__));
|
||||
// add the jQuery plugin (already registered by WordPress)
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_script('mci_footnotes_js_jquery_tools', plugins_url('../js/jquery.tools.min.js', __FILE__), array());
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers and enqueue stylesheets to the public pages.
|
||||
*
|
||||
* @author Stefan Herndler
|
||||
* @since 1.5.0
|
||||
*/
|
||||
public function registerPublicStyling() {
|
||||
wp_register_style('mci_footnotes_css_public', plugins_url('../css/public.css', __FILE__));
|
||||
wp_enqueue_style('mci_footnotes_css_public');
|
||||
wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__));
|
||||
}
|
||||
}
|
|
@ -34,6 +34,15 @@ class MCI_Footnotes_Task {
|
|||
*/
|
||||
public static $a_bool_AllowLoveMe = true;
|
||||
|
||||
/**
|
||||
* Prefix for the Footnote html element ID.
|
||||
*
|
||||
* @author Stefan Herndler
|
||||
* @since 1.5.8
|
||||
* @var string
|
||||
*/
|
||||
public static $a_str_Prefix = "";
|
||||
|
||||
/**
|
||||
* Register WordPress Hooks to replace Footnotes in the content of a public page.
|
||||
*
|
||||
|
@ -360,6 +369,7 @@ class MCI_Footnotes_Task {
|
|||
// fill the footnotes template
|
||||
$l_obj_Template->replace(
|
||||
array(
|
||||
"id" => self::$a_str_Prefix . $l_str_Index,
|
||||
"index" => $l_str_Index,
|
||||
"text" => MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED)) ? $l_str_ExcerptText : "",
|
||||
"before" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_STYLING_BEFORE),
|
||||
|
@ -374,7 +384,7 @@ class MCI_Footnotes_Task {
|
|||
$l_int_OffsetX = intval(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_INT_FOOTNOTES_MOUSE_OVER_BOX_OFFSET_X));
|
||||
$l_obj_TemplateTooltip->replace(
|
||||
array(
|
||||
"index" => $l_str_Index,
|
||||
"id" => self::$a_str_Prefix . $l_str_Index,
|
||||
"position" => MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_POSITION),
|
||||
"offset-y" => !empty($l_int_OffsetY) ? $l_int_OffsetY : 0,
|
||||
"offset-x" => !empty($l_int_OffsetX) ? $l_int_OffsetX : 0
|
||||
|
@ -458,7 +468,7 @@ class MCI_Footnotes_Task {
|
|||
$l_obj_Template->replace(
|
||||
array(
|
||||
"index" => $l_str_FootnoteIndex,
|
||||
"index-int" => MCI_Footnotes_Convert::Index($l_str_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
|
||||
"id" => self::$a_str_Prefix . MCI_Footnotes_Convert::Index($l_str_FirstFootnoteIndex, MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_COUNTER_STYLE)),
|
||||
"arrow" => $l_str_Arrow,
|
||||
"text" => $l_str_FootnoteText
|
||||
)
|
||||
|
@ -481,6 +491,7 @@ class MCI_Footnotes_Task {
|
|||
|
||||
// free all found footnotes if reference container will be displayed
|
||||
self::$a_arr_Footnotes = array();
|
||||
self::$a_str_Prefix = rand(1000, 9999) . "_";
|
||||
return $l_obj_TemplateContainer->getContent();
|
||||
}
|
||||
}
|
Reference in a new issue