Standardise codebase to WP Coding Standards

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2483336 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Ben Goldsworthy 2021-03-01 07:37:59 +00:00
parent 526cde8830
commit 6a5fcedac3
54 changed files with 8485 additions and 8467 deletions

View file

@ -1,83 +1,74 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/** /**
* Includes the Plugin Constants class to load all Plugin constant vars like Plugin name, etc. * Includes the Plugin Constants class to load all Plugin constant vars like Plugin name, etc.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 12.09.14 10:56 * @since 1.5.0
* * @date 12.09.14 10:56
* Edited for: *
* 2.0.4 add Public Plugin name for dashboard heading 2020-11-01T0452+0100 * @since 2.0.4 add Public Plugin name for dashboard heading 2020-11-01T0452+0100
* */
* Last modified: 2021-02-18T2027+0100
*/ /**
* Contains all Plugin Constants. Contains no Method or Property.
*
/** * @since 1.5.0
* Contains all Plugin Constants. Contains no Method or Property. */
* class MCI_Footnotes_Config {
* @author Stefan Herndler /**
* @since 1.5.0 * Internal Plugin name.
*/ *
class MCI_Footnotes_Config { * @since 1.5.0
* @var string
/** */
* Internal Plugin name. const C_STR_PLUGIN_NAME = 'footnotes';
*
* @author Stefan Herndler /**
* @since 1.5.0 * Public Plugin name.
* @var string *
*/ * @since 1.5.0
const C_STR_PLUGIN_NAME = "footnotes"; * @var string
*
/** * edited classes for v2.0.4
* Public Plugin name. */
* const C_STR_PLUGIN_PUBLIC_NAME = '<span class="footnotes_logo footnotes_logo_part1">foot</span><span class="footnotes_logo footnotes_logo_part2">notes</span>';
* @author Stefan Herndler
* @since 1.5.0 /**
* @var string * Public Plugin name for dashboard heading
* *
* edited classes for v2.0.4 * After properly displaying in dashboard headings until WPv5.4, the above started
*/ * in WPv5.5 being torn apart as if the headline was text-align:justify and not
const C_STR_PLUGIN_PUBLIC_NAME = '<span class="footnotes_logo footnotes_logo_part1">foot</span><span class="footnotes_logo footnotes_logo_part2">notes</span>'; * the last line. That ugly display bug badly affected the plugins communication.
* The only working solution found so far is using position:fixed in one heading
/** * that isnt translated, and dropping the logo in another, translatable heading.
* Public Plugin name for dashboard heading *
* * @since 2.0.4
* After properly displaying in dashboard headings until WPv5.4, the above started * @var string
* in WPv5.5 being torn apart as if the headline was text-align:justify and not */
* the last line. That ugly display bug badly affected the plugins communication. const C_STR_PLUGIN_HEADING_NAME = '<span class="footnotes_logo_heading footnotes_logo_part1_heading">foot</span><span class="footnotes_logo_heading footnotes_logo_part2_heading">notes</span>';
* The only working solution found so far is using position:fixed in one heading
* that isnt translated, and dropping the logo in another, translatable heading. /**
* * Html tag for the LOVE symbol.
* @since 2.0.4 *
* @var string * @since 1.5.0
*/ * @var string
const C_STR_PLUGIN_HEADING_NAME = '<span class="footnotes_logo_heading footnotes_logo_part1_heading">foot</span><span class="footnotes_logo_heading footnotes_logo_part2_heading">notes</span>'; */
const C_STR_LOVE_SYMBOL = '<span style="color:#ff6d3b; font-weight:bold;">&hearts;</span>';
/**
* Html tag for the LOVE symbol. /**
* * HTML code for the 'love' symbol used in dashboard heading
* @author Stefan Herndler *
* @since 1.5.0 * @since 2.0.4
* @var string * @var string
*/ */
const C_STR_LOVE_SYMBOL = '<span style="color:#ff6d3b; font-weight:bold;">&hearts;</span>'; const C_STR_LOVE_SYMBOL_HEADING = '<span class="footnotes_heart_heading">&hearts;</span>';
/** /**
* HTML code for the 'love' symbol used in dashboard heading * Short code to DON'T display the 'LOVE ME' slug on certain pages.
* *
* @since 2.0.4 * @since 1.5.0
* @var string * @var string
*/ */
const C_STR_LOVE_SYMBOL_HEADING = '<span class="footnotes_heart_heading">&hearts;</span>'; const C_STR_NO_LOVE_SLUG = '[[no footnotes: love]]';
}
/**
* Short code to DON'T display the 'LOVE ME' slug on certain pages.
*
* @author Stefan Herndler
* @since 1.5.0
* @var string
*/
const C_STR_NO_LOVE_SLUG = '[[no footnotes: love]]';
}

View file

@ -1,229 +1,223 @@
<?php <?php
/** /**
* Includes the Convert Class. * Includes the Convert Class.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 12.09.14 10:56 * @since 1.5.0
* * @date 12.09.14 10:56
* Edited: *
* @since 2.2.0 add lowercase Roman 2020-12-12T1540+0100 * @since 2.2.0 add lowercase Roman 2020-12-12T1540+0100
* */
* Last modified: 2020-12-12T1541+0100
*/ /**
* Converts data types and Footnotes specific values.
*
/** * @since 1.5.0
* Converts data types and Footnotes specific values. */
* class MCI_Footnotes_Convert {
* @author Stefan Herndler
* @since 1.5.0 /**
*/ * Converts a integer into the user-defined counter style for the footnotes.
class MCI_Footnotes_Convert { *
* @since 1.5.0
/** * @param int $p_int_index Index to be converted.
* Converts a integer into the user-defined counter style for the footnotes. * @param string $p_str_convert_style Style of the new/converted Index.
* * @return string Converted Index as string in the defined counter style.
* @author Stefan Herndler *
* @since 1.5.0 * Edited:
* @param int $p_int_Index Index to be converted. * @since 2.2.0 lowercase Roman numerals supported
* @param string $p_str_ConvertStyle Style of the new/converted Index. */
* @return string Converted Index as string in the defined counter style. public static function index( $p_int_index, $p_str_convert_style = 'arabic_plain' ) {
* switch ( $p_str_convert_style ) {
* Edited: case 'romanic':
* @since 2.2.0 lowercase Roman numerals supported return self::to_romanic( $p_int_index, true );
*/ case 'roman_low':
public static function Index($p_int_Index, $p_str_ConvertStyle = "arabic_plain") { return self::to_romanic( $p_int_index, false );
switch ($p_str_ConvertStyle) { case 'latin_high':
case "romanic": return self::to_latin( $p_int_index, true );
return self::toRomanic($p_int_Index, true); case 'latin_low':
case "roman_low": return self::to_latin( $p_int_index, false );
return self::toRomanic($p_int_Index, false); case 'arabic_leading':
case "latin_high": return self::to_arabic_leading( $p_int_index );
return self::toLatin($p_int_Index, true); case 'arabic_plain':
case "latin_low": default:
return self::toLatin($p_int_Index, false); return $p_int_index;
case "arabic_leading": }
return self::toArabicLeading($p_int_Index); }
case "arabic_plain":
default: /**
return $p_int_Index; * Converts an integer into latin ascii characters, either lower or upper-case.
} * Function available from A to ZZ ( means 676 footnotes at 1 page possible).
} *
* @since 1.0-gamma
/** * @param int $p_int_value Value/Index to be converted.
* Converts an integer into latin ascii characters, either lower or upper-case. * @param bool $p_bool_upper_case True to convert the value to upper case letter, otherwise to lower case.
* Function available from A to ZZ ( means 676 footnotes at 1 page possible). * @return string
* */
* @author Stefan Herndler private static function to_latin( $p_int_value, $p_bool_upper_case ) {
* @since 1.0-gamma // Output string.
* @param int $p_int_Value Value/Index to be converted. $l_str_return = '';
* @param bool $p_bool_UpperCase True to convert the value to upper case letter, otherwise to lower case. $l_int_offset = 0;
* @return string // Check if the value is higher then 26 = Z.
*/ while ( $p_int_value > 26 ) {
private static function toLatin($p_int_Value, $p_bool_UpperCase) { // Increase offset and reduce counter.
// output string $l_int_offset++;
$l_str_Return = ""; $p_int_value -= 26;
$l_int_Offset = 0; }
// check if the value is higher then 26 = Z // If offset set (more then Z), then add a new letter in front.
while ($p_int_Value > 26) { if ( $l_int_offset > 0 ) {
// increase offset and reduce counter $l_str_return = chr( $l_int_offset + 64 );
$l_int_Offset++; }
$p_int_Value -= 26; // Add the origin letter.
} $l_str_return .= chr( $p_int_value + 64 );
// if offset set (more then Z), then add a new letter in front // Return the latin character representing the integer.
if ($l_int_Offset > 0) { if ( $p_bool_upper_case ) {
$l_str_Return = chr($l_int_Offset + 64); return strtoupper( $l_str_return );
} }
// add the origin letter return strtolower( $l_str_return );
$l_str_Return .= chr($p_int_Value + 64); }
// return the latin character representing the integer
if ($p_bool_UpperCase) { /**
return strtoupper($l_str_Return); * Converts an integer to a leading-0 integer.
} *
return strtolower($l_str_Return); * @since 1.0-gamma
} * @param int $p_int_value Value/Index to be converted.
* @return string Value with a leading zero.
/** */
* Converts an integer to a leading-0 integer. private static function to_arabic_leading( $p_int_value ) {
* // Add a leading 0 if number lower then 10.
* @author Stefan Herndler if ( $p_int_value < 10 ) {
* @since 1.0-gamma return '0' . $p_int_value;
* @param int $p_int_Value Value/Index to be converted. }
* @return string Value with a leading zero. return $p_int_value;
*/ }
private static function toArabicLeading($p_int_Value) {
// add a leading 0 if number lower then 10 /**
if ($p_int_Value < 10) { * Converts an integer to a romanic letter.
return "0" . $p_int_Value; *
} * @since 1.0-gamma
return $p_int_Value; * @param int $p_int_value Value/Index to be converted.
} * @param bool $p_bool_upper_case Whether to uppercase.
* @return string
/** *
* Converts an integer to a romanic letter. * Edited:
* * @since 2.2.0 optionally lowercase (code from Latin) 2020-12-12T1538+0100
* @author Stefan Herndler */
* @since 1.0-gamma private static function to_romanic( $p_int_value, $p_bool_upper_case ) {
* @param int $p_int_Value Value/Index to be converted. // Table containing all necessary romanic letters.
* @return string $l_arr_romanic_letters = array(
* 'M' => 1000,
* Edited: 'CM' => 900,
* @since 2.2.0 optionally lowercase (code from Latin) 2020-12-12T1538+0100 'D' => 500,
*/ 'CD' => 400,
private static function toRomanic($p_int_Value, $p_bool_UpperCase) { 'C' => 100,
// table containing all necessary romanic letters 'XC' => 90,
$l_arr_RomanicLetters = array( 'L' => 50,
'M' => 1000, 'XL' => 40,
'CM' => 900, 'X' => 10,
'D' => 500, 'IX' => 9,
'CD' => 400, 'V' => 5,
'C' => 100, 'IV' => 4,
'XC' => 90, 'I' => 1,
'L' => 50, );
'XL' => 40, // Return value.
'X' => 10, $l_str_return = '';
'IX' => 9, // Iterate through integer value until it is reduced to 0.
'V' => 5, while ( $p_int_value > 0 ) {
'IV' => 4, foreach ( $l_arr_romanic_letters as $l_str_romanic => $l_int_arabic ) {
'I' => 1 if ( $p_int_value >= $l_int_arabic ) {
); $p_int_value -= $l_int_arabic;
// return value $l_str_return .= $l_str_romanic;
$l_str_Return = ''; break;
// iterate through integer value until it is reduced to 0 }
while ($p_int_Value > 0) { }
foreach ($l_arr_RomanicLetters as $l_str_Romanic => $l_int_Arabic) { }
if ($p_int_Value >= $l_int_Arabic) { // Return romanic letters as string.
$p_int_Value -= $l_int_Arabic; if ( $p_bool_upper_case ) {
$l_str_Return .= $l_str_Romanic; return strtoupper( $l_str_return );
break; }
} return strtolower( $l_str_return );
} }
}
// return romanic letters as string /**
if ($p_bool_UpperCase) { * Converts a string depending on its value to a boolean.
return strtoupper($l_str_Return); *
} * @since 1.0-beta
return strtolower($l_str_Return); * @param string $p_str_value String to be converted to boolean.
} * @return bool Boolean representing the string.
*/
/** public static function to_bool( $p_str_value ) {
* Converts a string depending on its value to a boolean. // Convert string to lower-case to make it easier.
* $p_str_value = strtolower( $p_str_value );
* @author Stefan Herndler // Check if string seems to contain a "true" value.
* @since 1.0-beta switch ( $p_str_value ) {
* @param string $p_str_Value String to be converted to boolean. case 'checked':
* @return bool Boolean representing the string. case 'yes':
*/ case 'true':
public static function toBool($p_str_Value) { case 'on':
// convert string to lower-case to make it easier case '1':
$p_str_Value = strtolower($p_str_Value); return true;
// check if string seems to contain a "true" value }
switch ($p_str_Value) { // Nothing found that says "true", so we return false.
case "checked": return false;
case "yes": }
case "true":
case "on": /**
case "1": * Get a html Array short code depending on Arrow-Array key index.
return true; *
} * @since 1.3.2
// nothing found that says "true", so we return false * @param int $p_int_index Index representing the Arrow. If empty all Arrows are specified.
return false; * @return array|string Array of all Arrows if Index is empty otherwise html tag of a specific arrow.
} */
public static function get_arrow( $p_int_index = -1 ) {
/** // Define all possible arrows.
* Get a html Array short code depending on Arrow-Array key index. $l_arr_arrows = array( '&#8593;', '&#8613;', '&#8607;', '&#8617;', '&#8626;', '&#8629;', '&#8657;', '&#8673;', '&#8679;', '&#65514;' );
* // Convert index to an integer.
* @author Stefan Herndler if ( ! is_int( $p_int_index ) ) {
* @since 1.3.2 $p_int_index = intval( $p_int_index );
* @param int $p_int_Index Index representing the Arrow. If empty all Arrows are specified. }
* @return array|string Array of all Arrows if Index is empty otherwise html tag of a specific arrow. // Return the whole arrow array.
*/ if ( $p_int_index < 0 || $p_int_index > count( $l_arr_arrows ) ) {
public static function getArrow($p_int_Index = -1) { return $l_arr_arrows;
// define all possible arrows }
$l_arr_Arrows = array("&#8593;", "&#8613;", "&#8607;", "&#8617;", "&#8626;", "&#8629;", "&#8657;", "&#8673;", "&#8679;", "&#65514;"); // Return a single arrow.
// convert index to an integer return $l_arr_arrows[ $p_int_index ];
if (!is_int($p_int_Index)) { }
$p_int_Index = intval($p_int_Index);
} // phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_var_dump
// return the whole arrow array // phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_print_r
if ($p_int_Index < 0 || $p_int_Index > count($l_arr_Arrows)) { /**
return $l_arr_Arrows; * Displays a Variable.
} *
// return a single arrow * @since 1.5.0
return $l_arr_Arrows[$p_int_Index]; * @param mixed $p_mixed_value The variable to display.
} * @return void
*/
/** public static function debug( $p_mixed_value ) {
* Displays a Variable. if ( empty( $p_mixed_value ) ) {
* var_dump( $p_mixed_value );
* @author Stefan Herndler
* @since 1.5.0 } elseif ( is_array( $p_mixed_value ) ) {
* @param mixed $p_mixed_Value printf( '<pre>' );
*/ print_r( $p_mixed_value );
public static function debug($p_mixed_Value) { printf( '</pre>' );
if (empty($p_mixed_Value)) {
var_dump($p_mixed_Value); } elseif ( is_object( $p_mixed_value ) ) {
printf( '<pre>' );
} else if (is_array($p_mixed_Value)) { print_r( $p_mixed_value );
printf("<pre>"); printf( '</pre>' );
print_r($p_mixed_Value);
printf("</pre>"); } elseif ( is_numeric( $p_mixed_value ) || is_int( $p_mixed_value ) ) {
var_dump( $p_mixed_value );
} else if (is_object($p_mixed_Value)) {
printf("<pre>"); } elseif ( is_date( $p_mixed_value ) ) {
print_r($p_mixed_Value); var_dump( $p_mixed_value );
printf("</pre>");
} else {
} else if (is_numeric($p_mixed_Value) || is_int($p_mixed_Value)) { var_dump( $p_mixed_value );
var_dump($p_mixed_Value); }
echo '<br/>';
} else if (is_date($p_mixed_Value)) { }
var_dump($p_mixed_Value); // phpcs:disable
}
} else {
var_dump($p_mixed_Value);
}
echo "<br/>";
}
}

View file

@ -1,94 +1,87 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.EscapeOutput.OutputNotEscaped
/** /**
* Handles all WordPress hooks of this Plugin. * Handles all WordPress hooks of this Plugin.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 12.09.14 10:56 * @since 1.5.0
* * @date 12.09.14 10:56
* Edited: *
* @since 2.2.0 2020-12-12T1223+0100 * @since 2.2.0 (TBD) 2020-12-12T1223+0100
*/ */
/** /**
* Registers all WordPress Hooks and executes them on demand. * Registers all WordPress Hooks and executes them on demand.
* *
* @author Stefan Herndler * @since 1.5.0
* @since 1.5.0 */
*/ class MCI_Footnotes_Hooks {
class MCI_Footnotes_Hooks {
/**
/** * Registers all WordPress hooks.
* Registers all WordPress hooks. *
* * @since 1.5.0
* @author Stefan Herndler */
* @since 1.5.0 public static function register_hooks() {
*/ register_activation_hook( dirname( __FILE__ ) . '/../footnotes.php', array( 'MCI_Footnotes_Hooks', 'activate_plugin' ) );
public static function registerHooks() { register_deactivation_hook( dirname( __FILE__ ) . '/../footnotes.php', array( 'MCI_Footnotes_Hooks', 'deactivate_plugin' ) );
register_activation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "activatePlugin")); register_uninstall_hook( dirname( __FILE__ ) . '/../footnotes.php', array( 'MCI_Footnotes_Hooks', 'uninstall_plugin' ) );
register_deactivation_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "deactivatePlugin")); }
register_uninstall_hook(dirname(__FILE__) . "/../footnotes.php", array("MCI_Footnotes_Hooks", "uninstallPlugin"));
} /**
* Executed when the Plugin gets activated.
/** *
* Executed when the Plugin gets activated. * @since 1.5.0
* */
* @author Stefan Herndler public static function activate_plugin() {
* @since 1.5.0 // Currently unused.
*/ }
public static function activatePlugin() {
// currently unused /**
} * Executed when the Plugin gets deactivated.
*
/** * @since 1.5.0
* Executed when the Plugin gets deactivated. */
* public static function deactivate_plugin() {
* @author Stefan Herndler // Currently unused.
* @since 1.5.0 }
*/
public static function deactivatePlugin() { /**
// currently unused * Executed when the Plugin gets uninstalled.
} *
* @since 1.5.0
/** *
* Executed when the Plugin gets uninstalled. * @since 2.2.0 this function is not called any longer when deleting the plugin.
* * Note: clear_all() didnt actually work.
* @author Stefan Herndler * @see class/settings.php
* @since 1.5.0 */
* public static function uninstall_plugin() {
* Edit: ClearAll didnt actually work. // WordPress User has to be logged in.
* @since 2.2.0 this function is not called any longer when deleting the plugin if ( ! is_user_logged_in() ) {
*/ wp_die( __( 'You must be logged in to run this script.', 'footnotes' ) );
public static function uninstallPlugin() { }
// WordPress User has to be logged in // WordPress User needs the permission to (un)install plugins.
if (!is_user_logged_in()) { if ( ! current_user_can( 'install_plugins' ) ) {
wp_die(__('You must be logged in to run this script.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME)); wp_die( __( 'You do not have permission to run this script.', 'footnotes' ) );
} }
// WordPress User needs the permission to (un)install plugins }
if (!current_user_can('install_plugins')) {
wp_die(__('You do not have permission to run this script.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME)); /**
} * Add Links to the Plugin in the "installed Plugins" page.
// deletes all settings and restore the default values *
// MCI_Footnotes_Settings::instance()->ClearAll(); * @since 1.5.0
} * @param array $p_arr_links Current Links.
* @param string $p_str_plugin_file_name Plugins init file name.
/** * @return array
* Add Links to the Plugin in the "installed Plugins" page. */
* public static function plugin_links( $p_arr_links, $p_str_plugin_file_name ) {
* @author Stefan Herndler // Append link to the WordPress Plugin page.
* @since 1.5.0 $p_arr_links[] = sprintf( '<a href="http://wordpress.org/support/plugin/footnotes" target="_blank">%s</a>', __( 'Support', 'footnotes' ) );
* @param array $p_arr_Links Current Links. // Append link to the settings page.
* @param string $p_str_PluginFileName Plugins init file name. $p_arr_links[] = sprintf( '<a href="%s">%s</a>', admin_url( 'admin.php?page=mfmmf-footnotes' ), __( 'Settings', 'footnotes' ) );
* @return array // Append link to the PayPal donate function.
*/ $p_arr_links[] = sprintf( '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6Z6CZDW8PPBBJ" target="_blank">%s</a>', __( 'Donate', 'footnotes' ) );
public static function PluginLinks($p_arr_Links, $p_str_PluginFileName) { // Return new links.
// append link to the WordPress Plugin page return $p_arr_links;
$p_arr_Links[] = sprintf('<a href="http://wordpress.org/support/plugin/footnotes" target="_blank">%s</a>', __('Support', MCI_Footnotes_Config::C_STR_PLUGIN_NAME)); }
// append link to the Settings page }
$p_arr_Links[] = sprintf('<a href="%s">%s</a>', admin_url('admin.php?page=mfmmf-footnotes'), __('Settings', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
// append link to the PlayPal Donate function
$p_arr_Links[] = sprintf('<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6Z6CZDW8PPBBJ" target="_blank">%s</a>', __('Donate', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
// return new links
return $p_arr_Links;
}
}

View file

@ -1,373 +1,385 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/** /**
* Includes the main Class of the Plugin. * Includes the main Class of the Plugin.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 12.09.14 10:56 * @since 1.5.0
* * @date 12.09.14 10:56
* *
* @lastmodified 2021-02-19T2031+0100 * @since 1.6.5 Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution.
* * @since 1.6.5 Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution.
* @since 1.6.5 Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution. * @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution.
* @since 1.6.5 Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution. *
* @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution. * @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100
* * @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100
* @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 * @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100
* @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 * @since 2.1.4 optionally enqueue an extra stylesheet 2020-12-04T2231+0100
* @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 *
* @since 2.1.4 optionally enqueue an extra stylesheet 2020-12-04T2231+0100 * @since 2.5.5 Update: Stylesheets: increase speed and energy efficiency by tailoring stylesheets to the needs of the instance, thanks to @docteurfitness design contribution.
* * @since 2.5.5 Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report.
* @since 2.5.5 Update: Stylesheets: increase speed and energy efficiency by tailoring stylesheets to the needs of the instance, thanks to @docteurfitness design contribution. * @since 2.5.5 Bugfix: Libraries: optimize processes by loading external and internal scripts only if needed, thanks to @docteurfitness issue report.
* @since 2.5.5 Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report. * @since 2.5.6 Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
* @since 2.5.5 Bugfix: Libraries: optimize processes by loading external and internal scripts only if needed, thanks to @docteurfitness issue report. */
* @since 2.5.6 Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
*/ /**
* Entry point of the Plugin. Loads the Dashboard and executes the Task.
/** *
* Entry point of the Plugin. Loads the Dashboard and executes the Task. * @since 1.5.0
* */
* @author Stefan Herndler class MCI_Footnotes {
* @since 1.5.0
*/ /**
class MCI_Footnotes { * Reference to the Plugin Task object.
*
/** * @since 1.5.0
* Reference to the Plugin Task object. * @var null|MCI_Footnotes_Task
* */
* @author Stefan Herndler public $a_obj_task = null;
* @since 1.5.0
* @var null|MCI_Footnotes_Task /**
*/ * Idenfifies whether tooltips are enabled. Actual value depends on settings.
public $a_obj_Task = null; *
* @contributor Patrizia Lutz @misfist
/** * @var bool
* Template process and script / stylesheet load optimization. *
* * @todo Refactor to have defines and assignments only in this class,
* - Bugfix: Templates: optimize template load and processing based on settings, thanks to @misfist code contribution. * then re-use these properties also in class/task.php (and elsewhere).
* * Account for priority level issues. These properties must be assigned before
* @since 2.4.0 * the hooks—whose priority level may be configured to 0—are called in class/task.php.
* @date 2021-01-04T1355+0100 */
* public static $a_bool_tooltips_enabled = false;
* @author Patrizia Lutz @misfist
* /**
* @link https://wordpress.org/support/topic/template-override-filter/#post-13864301 * Idenfifies whether alternative tooltips are enabled. Actual value depends
* @link https://github.com/misfist/footnotes/releases/tag/2.4.0d3 repository * on settings.
* @link https://github.com/misfist/footnotes/compare/2.4.0%E2%80%A62.4.0d3 diff *
* * @contributor Patrizia Lutz @misfist
* @var bool * @var bool
* *
* Streamline process depending on tooltip enabled status. * @todo Refactor to have defines only here, and use assignments also in class/task.php.
* Load tooltip inline script only if jQuery tooltips are enabled. */
* Actual value depends on settings. public static $a_bool_alternative_tooltips_enabled = false;
*/
public static $a_bool_TooltipsEnabled = false; /**
public static $a_bool_AlternativeTooltipsEnabled = false; * Executes the Plugin.
*
/** * @since 1.5.0
* Executes the Plugin. *
* * - Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution.
* @author Stefan Herndler *
* @since 1.5.0 * @since 1.6.5
* *
* * @contributor @felipelavinz
* - Bugfix: Improve widgets registration, thanks to @felipelavinz code contribution. * @link https://github.com/benleyjyc/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793
* * @date 2020-02-25
* @since 1.6.5 * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793
* *
* @contributor @felipelavinz * @see self::initialize_widgets()
* @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 */
* public function run() {
* @see self::initializeWidgets() // Register language.
*/ MCI_Footnotes_Language::register_hooks();
public function run() { // Register Button hooks.
// register language MCI_Footnotes_WYSIWYG::register_hooks();
MCI_Footnotes_Language::registerHooks(); // Register general hooks.
// register Button hooks MCI_Footnotes_Hooks::register_hooks();
MCI_Footnotes_WYSIWYG::registerHooks();
// register general hooks // Initialize the Plugin Dashboard.
MCI_Footnotes_Hooks::registerHooks(); $this->initialize_dashboard();
// Initialize the Plugin Task.
// initialize the Plugin Dashboard $this->initialize_task();
$this->initializeDashboard();
// initialize the Plugin Task // Register all Public Stylesheets and Scripts.
$this->initializeTask(); add_action( 'init', array( $this, 'register_public' ) );
// Enqueue all Public Stylesheets and Scripts.
// Register all Public Stylesheets and Scripts add_action( 'wp_enqueue_scripts', array( $this, 'register_public' ) );
add_action('init', array($this, 'registerPublic')); // Register all Widgets of the Plugin..
// Enqueue all Public Stylesheets and Scripts add_action( 'widgets_init', array( $this, 'initialize_widgets' ) );
add_action('wp_enqueue_scripts', array($this, 'registerPublic')); }
// Register all Widgets of the Plugin.
add_action('widgets_init', array($this, 'initializeWidgets')); /**
} * Initializes all Widgets of the Plugin.
*
/** * @since 1.5.0
* Initializes all Widgets of the Plugin. *
* * - Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution
* @author Stefan Herndler *
* @since 1.5.0 * @since 1.6.5
* *
* * @contributor @felipelavinz
* - Update: Fix for deprecated PHP function create_function(), thanks to @psykonevro @daliasued bug reports, thanks to @felipelavinz code contribution * @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793
* *
* @since 1.6.5 * @reporter @psykonevro
* * @link https://wordpress.org/support/topic/bug-function-create_function-is-deprecated/
* @contributor @felipelavinz * @link https://wordpress.org/support/topic/deprecated-function-create_function-14/
* @link https://github.com/media-competence-institute/footnotes/commit/87173d2980c7ff90e12ffee94ca7153e11163793 *
* * @reporter @daliasued
* @reporter @psykonevro * @link https://wordpress.org/support/topic/deprecated-function-create_function-14/#post-13312853
* @link https://wordpress.org/support/topic/bug-function-create_function-is-deprecated/ *
* @link https://wordpress.org/support/topic/deprecated-function-create_function-14/ * create_function() was deprecated in PHP 7.2.0 and removed in PHP 8.0.0.
* * @link https://www.php.net/manual/en/function.create-function.php
* @reporter @daliasued *
* @link https://wordpress.org/support/topic/deprecated-function-create_function-14/#post-13312853 * The fix is to move add_action() above into run(),
* * and use the bare register_widget() here.
* create_function() was deprecated in PHP 7.2.0 and removed in PHP 8.0.0. * @see self::run()
* @link https://www.php.net/manual/en/function.create-function.php *
* * Also, the visibility of initialize_widgets() is not private any longer.
* The fix is to move add_action() above into run(), */
* and use the bare register_widget() here. public function initialize_widgets() {
* @see self::run() register_widget( 'MCI_Footnotes_Widget_Reference_container' );
* }
* Also, the visibility of initializeWidgets() is not private any longer.
*/ /**
public function initializeWidgets() { * Initializes the Dashboard of the Plugin and loads them.
register_widget( "MCI_Footnotes_Widget_ReferenceContainer" ); *
} * @since 1.5.0
*/
/** private function initialize_dashboard() {
* Initializes the Dashboard of the Plugin and loads them. new MCI_Footnotes_Layout_Init();
* }
* @author Stefan Herndler
* @since 1.5.0 /**
*/ * Initializes the Plugin Task and registers the Task hooks.
private function initializeDashboard() { *
new MCI_Footnotes_Layout_Init(); * @since 1.5.0
} */
private function initialize_task() {
/** $this->a_obj_task = new MCI_Footnotes_Task();
* Initializes the Plugin Task and registers the Task hooks. $this->a_obj_task->register_hooks();
* }
* @author Stefan Herndler
* @since 1.5.0 /**
*/ * Registers and enqueues scripts and stylesheets to the public pages.
private function initializeTask() { *
$this->a_obj_Task = new MCI_Footnotes_Task(); * @since 1.5.0
$this->a_obj_Task->registerHooks(); *
} * @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution.
* @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100
/** * @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100
* Registers and enqueues scripts and stylesheets to the public pages. * @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100
* * @since 2.1.4 optionally enqueue an extra stylesheet 2020-12-04T2231+0100
* @author Stefan Herndler */
* @since 1.5.0 public function register_public() {
*
* @since 2.0.0 Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution. /**
* @since 2.0.3 add versioning of public.css for cache busting 2020-10-29T1413+0100 * Enqueues external scripts.
* @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 *
* @since 2.1.4 automate passing version number for cache busting 2020-11-30T0646+0100 * - Bugfix: Libraries: optimize processes by loading external and internal scripts only if needed, thanks to @docteurfitness issue report.
* @since 2.1.4 optionally enqueue an extra stylesheet 2020-12-04T2231+0100 *
*/ * @since 2.5.5
public function registerPublic() { * @reporter @docteurfitness
* @link https://wordpress.org/support/topic/simply-speed-optimisation/
/** *
* Enqueues external scripts. * The condition about tooltips was missing, only the not-alternative-tooltips part was present.
* */
* - Bugfix: Libraries: optimize processes by loading external and internal scripts only if needed, thanks to @docteurfitness issue report. // Set conditions re-used for stylesheet enqueuing.
* self::$a_bool_tooltips_enabled = MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ENABLED ) );
* @since 2.5.5 self::$a_bool_alternative_tooltips_enabled = MCI_Footnotes_Convert::to_bool( MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE ) );
* @reporter @docteurfitness $l_str_script_mode = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE );
* @link https://wordpress.org/support/topic/simply-speed-optimisation/
* /**
* The condition about tooltips was missing, only the not-alternative-tooltips part was present. * Enqueues the jQuery library registered by WordPress.
*/ *
// set conditions re-used for stylesheet enqueuing: * - Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
self::$a_bool_TooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ENABLED ) ); *
self::$a_bool_AlternativeTooltipsEnabled = MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTES_MOUSE_OVER_BOX_ALTERNATIVE ) ); * @since 2.5.6
$l_str_ScriptMode = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_REFERENCE_CONTAINER_SCRIPT_MODE); *
* @reporter @hopper87it
/** * @link https://wordpress.org/support/topic/footnotes-wp-rocket/
* Enqueues the jQuery library registered by WordPress. *
* * jQuery is also used for animated scrolling, so it was loaded by default.
* - Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports. * The function wp_enqueue_script() avoids loading the same library multiple times.
* * After adding the alternative reference container, jQuery has become optional,
* @since 2.5.6 * but still enabled by default.
* */
* @reporter @hopper87it if ( 'jquery' === $l_str_script_mode || ( self::$a_bool_tooltips_enabled && ! self::$a_bool_alternative_tooltips_enabled ) ) {
* @link https://wordpress.org/support/topic/footnotes-wp-rocket/
* wp_enqueue_script( 'jquery' );
* jQuery is also used for animated scrolling, so it was loaded by default.
* The function wp_enqueue_script() avoids loading the same library multiple times. }
* After adding the alternative reference container, jQuery has become optional,
* but still enabled by default. if ( self::$a_bool_tooltips_enabled && ! self::$a_bool_alternative_tooltips_enabled ) {
*/
if ( $l_str_ScriptMode == 'jquery' || ( self::$a_bool_TooltipsEnabled && ! self::$a_bool_AlternativeTooltipsEnabled ) ) { /**
* Enqueues the jQuery Tools library shipped with the plugin.
wp_enqueue_script( 'jquery' ); *
* Redacted jQuery.browser, completed minification;
} * see full header in js/jquery.tools.js.
*
if ( self::$a_bool_TooltipsEnabled && ! self::$a_bool_AlternativeTooltipsEnabled ) { * Add versioning.
*
/** * @since 2.1.2
* Enqueues the jQuery Tools library shipped with the plugin. * @date 2020-11-18T2150+0100
* *
* redacted jQuery.browser, completed minification; * No '-js' in the handle, is appended automatically.
* see full header in js/jquery.tools.js *
* added versioning 2020-11-18T2150+0100 * Deferring to the footer breaks jQuery tooltip display.
* not use '-js' in the handle, is appended automatically * @date 2021-02-23T1105+0100
*/ */
wp_enqueue_script( wp_enqueue_script(
'mci-footnotes-jquery-tools', 'mci-footnotes-jquery-tools',
plugins_url('footnotes/js/jquery.tools.min.js'), plugins_url( 'footnotes/js/jquery.tools.min.js' ),
array(), array(),
'1.2.7.redacted.2' '1.2.7.redacted.2',
); false
);
/**
* Registers jQuery UI from the JavaScript Content Delivery Network. /**
* * Enqueues some jQuery UI libraries registered by WordPress.
* - Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution. *
* * - Update: Tooltips: fix disabling bug by loading jQuery UI library, thanks to @rajinderverma @ericcorbett2 @honlapdavid @mmallett bug reports, thanks to @vonpiernik code contribution.
* @since 2.0.0 *
* Alternatively, fetch jQuery UI from cdnjs.cloudflare.com: * @since 2.0.0
* @since 2.0.0 add jQueryUI from Cloudflare 2020-10-26T1907+0100 *
* Used to add jQuery UI following @vonpiernik: * @reporter @rajinderverma
* <https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762>: * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/
* *
* * @reporter @ericcorbett2
* jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released. * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13324142
* *
* Updated for v2.0.4 by adding jQuery UI from WordPress following @check2020de: * @reporter @honlapdavid
* <https://wordpress.org/support/topic/gdpr-issue-with-jquery/> * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13355421
* See <https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui> *
* * @reporter @mmallett
* This was enabled in Footnotes v2.0.0 through v2.0.3. * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13445437
* Re-added for 2.0.9d1 / 2.1.1d0 to look whether it can fix a broken tooltip display. 2020-11-07T1601+0100/2020-11-08T2246+0100 *
*/ * Fetch jQuery UI from cdnjs.cloudflare.com.
//wp_register_script( 'jQueryUI', 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js', null, null, false ); // in header 2020-11-09T2003+0100 * @since 2.0.0
//wp_enqueue_script( 'jQueryUI' ); * @date 2020-10-26T1907+0100
/** * @contributor @vonpiernik
* This is then needed instead of the above first instance: * @link https://wordpress.org/support/topic/tooltip-hover-not-showing/#post-13456762
* Add jQuery Tools and finish adding jQueryUI: 2020-11-08T1638+0100/2020-11-08T2246+0100 *
*/ * jQueryUI re-enables the tooltip infobox disabled when WPv5.5 was released. * @since 2.1.2
//wp_enqueue_script('mci-footnotes-js-jquery-tools', plugins_url('../js/jquery.tools.min.js', __FILE__), ['jQueryUI']); *
* - Update: Libraries: Load jQuery UI from WordPress, thanks to @check2020de issue report.
/** *
* Enqueues some jQuery UI libraries registered by WordPress. * @since 2.0.4
* * @date 2020-11-01T1902+0100
* @since 2.0.4 add jQuery UI from WordPress 2020-11-01T1902+0100 * @reporter @check2020de
* If alternative tooltips are enabled, these libraries are not needed. * @link https://wordpress.org/support/topic/gdpr-issue-with-jquery/
*/ * @link https://wordpress.stackexchange.com/questions/273986/correct-way-to-enqueue-jquery-ui
wp_enqueue_script( 'jquery-ui-core' ); *
wp_enqueue_script( 'jquery-ui-widget' ); * If alternative tooltips are enabled, these libraries are not needed.
wp_enqueue_script( 'jquery-ui-position' ); */
wp_enqueue_script( 'jquery-ui-tooltip' ); wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-widget' );
} wp_enqueue_script( 'jquery-ui-position' );
wp_enqueue_script( 'jquery-ui-tooltip' );
/**
* Enables enqueuing a new-scheme stylesheet. }
*
* @since 2.5.5 /**
* @date 2021-02-14T1512+0100 * Enables enqueuing a new-scheme stylesheet.
* *
* Enables enqueuing the formatted individual stylesheets if false. * @since 2.5.5
* WARNING: This facility is designed for development and must NOT be used in production. * @date 2021-02-14T1512+0100
* *
* The Boolean may be set at the bottom of the plugins main PHP file. * Enables enqueuing the formatted individual stylesheets if false.
* @see footnotes.php * WARNING: This facility is designed for development and must NOT be used in production.
*/ *
if ( C_BOOL_CSS_PRODUCTION_MODE === true ) { * The Boolean may be set at the bottom of the plugins main PHP file.
* @see footnotes.php
/** */
* Enqueues a minified united external stylesheet in production. if ( C_BOOL_CSS_PRODUCTION_MODE === true ) {
*
* - Update: Stylesheets: increase speed and energy efficiency by tailoring stylesheets to the needs of the instance, thanks to @docteurfitness design contribution. /**
* - Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report. * Enqueues a minified united external stylesheet in production.
* *
* @since 2.5.5 * - Update: Stylesheets: increase speed and energy efficiency by tailoring stylesheets to the needs of the instance, thanks to @docteurfitness design contribution.
* @date 2021-02-14T1543+0100 * - Bugfix: Stylesheets: minify to shrink the carbon footprint, increase speed and implement best practice, thanks to @docteurfitness issue report.
* *
* @contributor @docteurfitness * @since 2.5.5
* @link https://wordpress.org/support/topic/simply-speed-optimisation/ * @date 2021-02-14T1543+0100
* *
* @reporter @docteurfitness * @contributor @docteurfitness
* @link https://wordpress.org/support/topic/simply-speed-optimisation/ * @link https://wordpress.org/support/topic/simply-speed-optimisation/
* *
* The dashboard stylesheet is minified as-is. * @reporter @docteurfitness
* @see class/dashboard/layout.php * @link https://wordpress.org/support/topic/simply-speed-optimisation/
* *
* @since 2.0.3 add versioning of public.css for cache busting. * The dashboard stylesheet is minified as-is.
* @date 2020-10-29T1413+0100 * @see class/dashboard/layout.php
* Plugin version number is needed for busting browser caches after each plugin update. *
* @since 2.1.4 automate passing version number for cache busting. * @since 2.0.3 add versioning of public.css for cache busting.
* @date 2020-11-30T0646+0100 * @date 2020-10-29T1413+0100
* The constant C_STR_FOOTNOTES_VERSION is defined at start of footnotes.php. * Plugin version number is needed for busting browser caches after each plugin update.
* * @since 2.1.4 automate passing version number for cache busting.
* The media scope argument 'all' is the default. * @date 2020-11-30T0646+0100
* No need to use '-css' in the handle, as this is appended automatically. * The constant C_STR_FOOTNOTES_VERSION is defined at start of footnotes.php.
*/ *
// set tooltip mode for use in stylesheet name: * The media scope argument 'all' is the default.
if ( self::$a_bool_TooltipsEnabled ) { * No need to use '-css' in the handle, as this is appended automatically.
if ( self::$a_bool_AlternativeTooltipsEnabled ) { */
$l_str_TooltipMode = 'al'; // Set tooltip mode for use in stylesheet name.
$l_str_TComplement = 'ternative-tooltips'; if ( self::$a_bool_tooltips_enabled ) {
} else { if ( self::$a_bool_alternative_tooltips_enabled ) {
$l_str_TooltipMode = 'jq'; $l_str_tooltip_mode_short = 'al';
$l_str_TComplement = 'uery-tooltips'; $l_str_tooltip_mode_rest = 'ternative-tooltips';
} } else {
} else { $l_str_tooltip_mode_short = 'jq';
$l_str_TooltipMode = 'no'; $l_str_tooltip_mode_rest = 'uery-tooltips';
$l_str_TComplement = '-tooltips'; }
} } else {
$l_str_tooltip_mode_short = 'no';
// set basic responsive page layout mode for use in stylesheet name: $l_str_tooltip_mode_rest = '-tooltips';
$l_str_PageLayoutOption = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT); }
switch ( $l_str_PageLayoutOption ) {
case "reference-container": $l_str_LayoutMode = '1'; break; // Set basic responsive page layout mode for use in stylesheet name.
case "entry-content" : $l_str_LayoutMode = '2'; break; $l_str_page_layout_option = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT );
case "main-content" : $l_str_LayoutMode = '3'; break; switch ( $l_str_page_layout_option ) {
case "none": default: $l_str_LayoutMode = '0'; break; case 'reference-container':
} $l_str_layout_mode = '1';
break;
// enqueue the tailored united minified stylesheet: case 'entry-content':
wp_enqueue_style( $l_str_layout_mode = '2';
'mci-footnotes-' . $l_str_TooltipMode . $l_str_TComplement . '-pagelayout-' . $l_str_PageLayoutOption, break;
plugins_url( case 'main-content':
MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/footnotes-' . $l_str_TooltipMode . 'ttbrpl' . $l_str_LayoutMode . '.min.css' $l_str_layout_mode = '3';
), break;
array(), case 'none':
C_STR_FOOTNOTES_VERSION, default:
'all' $l_str_layout_mode = '0';
); break;
}
} else {
// Enqueue the tailored united minified stylesheet.
/** wp_enqueue_style(
* Enqueues external stylesheets, ONLY in development now. 'mci-footnotes-' . $l_str_tooltip_mode_short . $l_str_tooltip_mode_rest . '-pagelayout-' . $l_str_page_layout_option,
* plugins_url(
* @since 2.1.4 optionally enqueue an extra stylesheet. MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/footnotes-' . $l_str_tooltip_mode_short . 'ttbrpl' . $l_str_layout_mode . '.min.css'
* @date 2020-12-04T2231+0100 ),
* array(),
* This optional layout fix is useful by lack of layout support. C_STR_FOOTNOTES_VERSION,
*/ 'all'
wp_enqueue_style( 'mci-footnotes-common', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-common.css' ), array(), C_STR_FOOTNOTES_VERSION ); );
wp_enqueue_style( 'mci-footnotes-tooltips', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips.css' ), array(), C_STR_FOOTNOTES_VERSION );
wp_enqueue_style( 'mci-footnotes-alternative', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips-alternative.css' ), array(), C_STR_FOOTNOTES_VERSION ); } else {
$l_str_PageLayoutOption = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT); /**
if ($l_str_PageLayoutOption != 'none') { * Enqueues external stylesheets, ONLY in development now.
wp_enqueue_style( *
'mci-footnotes-layout-' . $l_str_PageLayoutOption, * @since 2.1.4 optionally enqueue an extra stylesheet.
plugins_url( * @date 2020-12-04T2231+0100
MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-layout-' . $l_str_PageLayoutOption . '.css' *
), * This optional layout fix is useful by lack of layout support.
array(), */
C_STR_FOOTNOTES_VERSION, wp_enqueue_style( 'mci-footnotes-common', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-common.css' ), array(), C_STR_FOOTNOTES_VERSION );
'all' wp_enqueue_style( 'mci-footnotes-tooltips', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips.css' ), array(), C_STR_FOOTNOTES_VERSION );
); wp_enqueue_style( 'mci-footnotes-alternative', plugins_url( MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-tooltips-alternative.css' ), array(), C_STR_FOOTNOTES_VERSION );
}
} $l_str_page_layout_option = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_PAGE_LAYOUT_SUPPORT );
} if ( 'none' !== $l_str_page_layout_option ) {
} wp_enqueue_style(
'mci-footnotes-layout-' . $l_str_page_layout_option,
plugins_url(
MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/css/dev-layout-' . $l_str_page_layout_option . '.css'
),
array(),
C_STR_FOOTNOTES_VERSION,
'all'
);
}
}
}
}

View file

@ -1,108 +1,100 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/** /**
* Loads text domain of current or default language for localization. * Loads text domain of current or default language for localization.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 14.09.14 17:47 * @since 1.5.0
* * @date 14.09.14 17:47
* *
* @lastmodified 2021-02-18T2028+0100 * @since 2.0.0 Bugfix: Localization: correct function call apply_filters() with all required arguments after PHP 7.1 promoted warning to error, thanks to @matkus2 bug report and code contribution.
* * @since 2.1.6 Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report.
* @since 2.0.0 Bugfix: Localization: correct function call apply_filters() with all required arguments after PHP 7.1 promoted warning to error, thanks to @matkus2 bug report and code contribution. */
* @since 2.1.6 Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report.
*/ /**
* Loads text domain of current or default language for localization.
/** *
* Loads text domain of current or default language for localization. * @since 1.5.0
* */
* @author Stefan Herndler class MCI_Footnotes_Language {
* @since 1.5.0
*/ /**
class MCI_Footnotes_Language { * Register WordPress Hook.
*
/** * @since 1.5.0
* Register WordPress Hook. */
* public static function register_hooks() {
* @author Stefan Herndler add_action( 'plugins_loaded', array( 'MCI_Footnotes_Language', 'load_text_domain' ) );
* @since 1.5.0 }
*/
public static function registerHooks() { /**
add_action('plugins_loaded', array("MCI_Footnotes_Language", "loadTextDomain")); * Loads the text domain for current WordPress language if exists.
} * Otherwise fallback "en_GB" will be loaded.
*
/** * @since 1.5.0
* Loads the text domain for current WordPress language if exists. *
* Otherwise fallback "en_GB" will be loaded. *
* * - Bugfix: Correct function call apply_filters() with all required arguments after PHP 7.1 promoted warning to error, thanks to @matkus2 bug report and code contribution.
* @author Stefan Herndler *
* @since 1.5.0 * @since 2.0.0
* * @date 2020-10-26T1609+0100
* *
* - Bugfix: Correct function call apply_filters() with all required arguments after PHP 7.1 promoted warning to error, thanks to @matkus2 bug report and code contribution. * @contributor @matkus2
* * @link https://wordpress.org/support/topic/error-missing-parameter-if-using-php-7-1-or-later/
* @since 2.0.0 *
* @date 2020-10-26T1609+0100 * Add 3rd (empty) argument in apply_filters() to prevent PHP from throwing an error.
* * “Fatal error: Uncaught ArgumentCountError: Too few arguments to function apply_filters()
* @contributor @matkus2 *
* @link https://wordpress.org/support/topic/error-missing-parameter-if-using-php-7-1-or-later/ * Yet get_locale() is defined w/o parameters in wp-includes/l10n.php:30, and
* * apply_filters() is defined as apply_filters( $tag, $value ) in wp-includes/plugin.php:181.
* Add 3rd (empty) argument in apply_filters() to prevent PHP from throwing an error: * @link https://developer.wordpress.org/reference/functions/apply_filters/
* “Fatal error: Uncaught ArgumentCountError: Too few arguments to function apply_filters() *
* * But apply_filters() is defined with a 3rd parameter (and w/o the first one) in
* Yet get_locale() is defined w/o parameters in wp-includes/l10n.php:30, and * wp-includes/class-wp-hook.php:264, as public function apply_filters( $value, $args ).
* apply_filters() is defined as apply_filters( $tag, $value ) in wp-includes/plugin.php:181. *
* @link https://developer.wordpress.org/reference/functions/apply_filters/ * Taking it all together, probably the full function definition would be
* * public function apply_filters( $tag, $value, $args ).
* But apply_filters() is defined with a 3rd parameter (and w/o the first one) in * In the case of get_locale(), $args is empty.
* wp-includes/class-wp-hook.php:264, as public function apply_filters( $value, $args ). *
* * The bug was lurking in WP. PHP 7.1 promoted the warning to an error.
* Taking it all together, probably the full function definition would be: * @link https://www.php.net/manual/en/migration71.incompatible.php
* public function apply_filters( $tag, $value, $args ). * @link https://www.php.net/manual/en/migration71.incompatible.php#migration71.incompatible.too-few-arguments-exception
* In the case of get_locale(), $args is empty. */
* public static function load_text_domain() {
* The bug was lurking in WP. PHP 7.1 promoted the warning to an error.
* @link https://www.php.net/manual/en/migration71.incompatible.php // If language file with localization exists.
* @link https://www.php.net/manual/en/migration71.incompatible.php#migration71.incompatible.too-few-arguments-exception if ( self::load( apply_filters( 'plugin_locale', get_locale(), '' ) ) ) {
*/ return;
public static function loadTextDomain() { }
// Else fall back to British English.
// if language file with localization exists: self::load( 'en_GB' );
if ( self::load( apply_filters( 'plugin_locale', get_locale(), '' ) ) ) { }
return;
} /**
// else fall back to British English: * Loads a specific text domain.
self::load( "en_GB" ); *
} * @since 1.5.1
* @param string $p_str_language_code Language Code to load a specific text domain.
/** * @return bool
* Loads a specific text domain. *
* *
* @author Stefan Herndler * - Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report.
* @since 1.5.1 *
* @param string $p_str_LanguageCode Language Code to load a specific text domain. * @since 2.1.6
* @return bool * @date 2020-12-08T1931+0100
* *
* * @reporter @nikelaos
* - Bugfix: Localization: conform to WordPress plugin language file name scheme, thanks to @nikelaos bug report. * @link https://wordpress.org/support/topic/more-feature-ideas/
* *
* @since 2.1.6 * That is done by using load_plugin_textdomain().
* @date 2020-12-08T1931+0100 * “The .mo file should be named based on the text domain with a dash, and then the locale exactly.
* * @see wp-includes/l10n.php:857
* @reporter @nikelaos */
* @link https://wordpress.org/support/topic/more-feature-ideas/ private static function load( $p_str_language_code ) {
* return load_plugin_textdomain(
* That is done by using load_plugin_textdomain(): MCI_Footnotes_Config::C_STR_PLUGIN_NAME,
* “The .mo file should be named based on the text domain with a dash, and then the locale exactly. false,
* @see wp-includes/l10n.php:857 MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/languages'
*/ );
private static function load($p_str_LanguageCode) { }
return load_plugin_textdomain( }
MCI_Footnotes_Config::C_STR_PLUGIN_NAME,
// This argument only fills the gap left by a deprecated argument (since WP2.7):
false,
// The plugin basedir is provided; trailing slash would be clipped:
MCI_Footnotes_Config::C_STR_PLUGIN_NAME . '/languages'
);
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,261 +1,235 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/** /**
* Includes the Template Engine to load and handle all Template files of the Plugin. * Includes the Template Engine to load and handle all Template files of the Plugin.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 14.09.14 10:58 * @since 1.5.0
* * @date 14.09.14 10:58
* *
* @lastmodified 2021-02-18T2024+0100 * @since 2.2.6 Adding: Templates: support for custom templates in sibling folder, thanks to @misfist issue report.
* * @since 2.5.0 Adding: Templates: Enable template location stack, thanks to @misfist code contribution.
* @since 2.0.3 prettify reference container template */
* @since 2.0.3 replace tab with a space
* @since 2.0.3 replace 2 spaces with 1 /**
* @since 2.0.4 collapse multiple spaces * Handles each Template file for the Plugin Frontend (e.g. Settings Dashboard, Public pages, ...).
* @since 2.0.6 prettify other templates (footnote, tooltip script, ref container row) * Loads a template file, replaces all Placeholders and returns the replaced file content.
* @since 2.2.6 delete a space before a closing pointy bracket *
* * @since 1.5.0
* @since 2.2.6 support for custom templates in fixed location, while failing to add filter thanks to @misfist 2020-12-19T0606+0100 */
* @link https://wordpress.org/support/topic/template-override-filter/ class MCI_Footnotes_Template {
*
* @since 2.4.0 templates may be in active theme, thanks to @misfist /**
* @link https://wordpress.org/support/topic/template-override-filter/#post-13846598 * Directory name for dashboard templates.
* *
* @since 2.5.0 Enable template location stack, contributed by @misfist * @since 1.5.0
* @link https://wordpress.org/support/topic/template-override-filter/#post-13864301 * @var string
* */
* @since 2.5.4 collapse HTML comments and PHP/JS docblocks (only) const C_STR_DASHBOARD = 'dashboard';
*/
/**
* Directory name for public templates.
/** *
* Handles each Template file for the Plugin Frontend (e.g. Settings Dashboard, Public pages, ...). * @since 1.5.0
* Loads a template file, replaces all Placeholders and returns the replaced file content. * @var string
* */
* @author Stefan Herndler const C_STR_PUBLIC = 'public';
* @since 1.5.0
*/ /**
class MCI_Footnotes_Template { * Contains the content of the template after initialize.
*
/** * @since 1.5.0
* Directory name for dashboard templates. * @var string
* */
* @author Stefan Herndler private $a_str_original_content = '';
* @since 1.5.0
* @var string /**
*/ * Contains the content of the template after initialize with replaced place holders.
const C_STR_DASHBOARD = "dashboard"; *
* @since 1.5.0
/** * @var string
* Directory name for public templates. */
* private $a_str_replaced_content = '';
* @author Stefan Herndler
* @since 1.5.0 /**
* @var string * Plugin Directory
*/ *
const C_STR_PUBLIC = "public"; * @since 2.4.0d3
*
/** * @var string
* Contains the content of the template after initialize. */
* public $plugin_directory;
* @author Stefan Herndler
* @since 1.5.0 /**
* @var string * Class Constructor. Reads and loads the template file without replace any placeholder.
*/ *
private $a_str_OriginalContent = ""; * @since 1.5.0
* @param string $p_str_file_type Template file type (take a look on the Class constants).
/** * @param string $p_str_file_name Template file name inside the Template directory without the file extension.
* Contains the content of the template after initialize with replaced place holders. * @param string $p_str_extension Optional Template file extension (default: html).
* *
* @author Stefan Herndler * - Adding: Templates: support for custom templates in sibling folder, thanks to @misfist issue report.
* @since 1.5.0 *
* @var string * @since 2.2.6
*/ * @date 2020-12-19T0606+0100
private $a_str_ReplacedContent = ""; *
* @reporter @misfist
/** * @link https://wordpress.org/support/topic/template-override-filter/
* Plugin Directory */
* public function __construct( $p_str_file_type, $p_str_file_name, $p_str_extension = 'html' ) {
* @author Patrizia Lutz @misfist // No template file type and/or file name set.
* @since 2.4.0d3 if ( empty( $p_str_file_type ) || empty( $p_str_file_name ) ) {
* return;
* @var string }
*/
public $plugin_directory; /**
* Define plugin root path.
/** *
* Class Constructor. Reads and loads the template file without replace any placeholder. * @since 2.4.0d3
* */
* @author Stefan Herndler $this->plugin_directory = plugin_dir_path( dirname( __FILE__ ) );
* @since 1.5.0
* @param string $p_str_FileType Template file type (take a look on the Class constants). /**
* @param string $p_str_FileName Template file name inside the Template directory without the file extension. * Modularize functions.
* @param string $p_str_Extension Optional Template file extension (default: html) *
* * @since 2.4.0d3
* */
* @since 2.2.6 support for custom templates 2020-12-19T0606+0100 $template = $this->get_template( $p_str_file_type, $p_str_file_name, $p_str_extension );
* @link https://wordpress.org/support/topic/template-override-filter/ if ( $template ) {
* $this->process_template( $template );
* @since 2.4.0 look for custom template in the active theme first, thanks to @misfist } else {
* @link https://wordpress.org/support/topic/template-override-filter/#post-13846598 return;
*/ }
public function __construct($p_str_FileType, $p_str_FileName, $p_str_Extension = "html") {
// no template file type and/or file name set }
if (empty($p_str_FileType) || empty($p_str_FileName)) {
return; /**
} * Replace all placeholders specified in array.
*
/** * @since 1.5.0
* Define plugin root path * @param array $p_arr_placeholders Placeholders (key = placeholder, value = value).
* * @return bool True on Success, False if Placeholders invalid.
* @since 2.4.0d3 */
* public function replace( $p_arr_placeholders ) {
* @author Patrizia Lutz @misfist // No placeholders set.
*/ if ( empty( $p_arr_placeholders ) ) {
$this->plugin_directory = plugin_dir_path( dirname( __FILE__ ) ); return false;
}
/** // Template content is empty.
* Modularize functions if ( empty( $this->a_str_replaced_content ) ) {
* return false;
* @since 2.4.0d3 }
* // Iterate through each placeholder and replace it with its value.
* @author Patrizia Lutz @misfist foreach ( $p_arr_placeholders as $l_str_placeholder => $l_str_value ) {
*/ $this->a_str_replaced_content = str_replace( '[[' . $l_str_placeholder . ']]', $l_str_value, $this->a_str_replaced_content );
if( $template = $this->get_template( $p_str_FileType, $p_str_FileName, $p_str_Extension ) ) { }
$this->process_template( $template ); // Success.
} else { return true;
return; }
}
/**
} * Reloads the original content of the template file.
*
/** * @since 1.5.0
* Replace all placeholders specified in array. */
* public function reload() {
* @author Stefan Herndler $this->a_str_replaced_content = $this->a_str_original_content;
* @since 1.5.0 }
* @param array $p_arr_Placeholders Placeholders (key = placeholder, value = value).
* @return bool True on Success, False if Placeholders invalid. /**
*/ * Returns the content of the template file with replaced placeholders.
public function replace($p_arr_Placeholders) { *
// no placeholders set * @since 1.5.0
if (empty($p_arr_Placeholders)) { * @return string Template content with replaced placeholders.
return false; */
} public function get_content() {
// template content is empty return $this->a_str_replaced_content;
if (empty($this->a_str_ReplacedContent)) { }
return false;
} /**
// iterate through each placeholder and replace it with its value * Process template file.
foreach($p_arr_Placeholders as $l_str_Placeholder => $l_str_Value) { *
$this->a_str_ReplacedContent = str_replace("[[" . $l_str_Placeholder . "]]", $l_str_Value, $this->a_str_ReplacedContent); * @since 2.4.0d3
} *
// success * @param string $template The template to be processed.
return true; * @return void
} *
* @since 2.0.3 Replace tab with a space.
/** * @since 2.0.3 Replace 2 spaces with 1.
* Reloads the original content of the template file. * @since 2.0.4 Collapse multiple spaces.
* * @since 2.2.6 Delete a space before a closing pointy bracket.
* @author Stefan Herndler * @since 2.5.4 Collapse HTML comments and PHP/JS docblocks (only).
* @since 1.5.0 */
*/ public function process_template( $template ) {
public function reload() { // phpcs:disable WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
$this->a_str_ReplacedContent = $this->a_str_OriginalContent; $this->a_str_original_content = preg_replace( '#<!--.+?-->#s', '', file_get_contents( $template ) );
} // phpcs:enable
$this->a_str_original_content = preg_replace( '#/\*\*.+?\*/#s', '', $this->a_str_original_content );
/** $this->a_str_original_content = str_replace( "\n", '', $this->a_str_original_content );
* Returns the content of the template file with replaced placeholders. $this->a_str_original_content = str_replace( "\r", '', $this->a_str_original_content );
* $this->a_str_original_content = str_replace( "\t", ' ', $this->a_str_original_content );
* @author Stefan Herndler $this->a_str_original_content = preg_replace( '# +#', ' ', $this->a_str_original_content );
* @since 1.5.0 $this->a_str_original_content = str_replace( ' >', '>', $this->a_str_original_content );
* @return string Template content with replaced placeholders. $this->reload();
*/ }
public function getContent() {
return $this->a_str_ReplacedContent; /**
} * Get the template.
*
/** * - Adding: Templates: Enable template location stack, thanks to @misfist code contribution.
* Process template file *
* * @since 2.4.0d3 Contribution.
* @author Patrizia Lutz @misfist * @since 2.5.0 Release.
* *
* @since 2.4.0d3 * @contributor @misfist
* * @link https://wordpress.org/support/topic/template-override-filter/#post-13864301
* @param string $template *
* @return void * @param string $p_str_file_type The file type of the template.
* * @param string $p_str_file_name The file name of the template.
* * @param string $p_str_extension The file extension of the template.
* @since 2.0.3 replace tab with a space * @return mixed false | template path
* @since 2.0.3 replace 2 spaces with 1 */
* @since 2.0.4 collapse multiple spaces public function get_template( $p_str_file_type, $p_str_file_name, $p_str_extension = 'html' ) {
* @since 2.2.6 delete a space before a closing pointy bracket $located = false;
* @since 2.5.4 collapse HTML comments and PHP/JS docblocks (only)
*/ /**
public function process_template( $template ) { * The directory can be changed.
$this->a_str_OriginalContent = preg_replace( '#<!--.+?-->#s', "", file_get_contents( $template ) ); *
$this->a_str_OriginalContent = preg_replace( '#/\*\*.+?\*/#s', "", $this->a_str_OriginalContent ); * @usage to change location of templates to 'template_parts/footnotes/':
$this->a_str_OriginalContent = str_replace( "\n", "", $this->a_str_OriginalContent ); * add_filter( 'mci_footnotes_template_directory', function( $directory ) {
$this->a_str_OriginalContent = str_replace( "\r", "", $this->a_str_OriginalContent ); * return 'template_parts/footnotes/';
$this->a_str_OriginalContent = str_replace( "\t", " ", $this->a_str_OriginalContent ); * } );
$this->a_str_OriginalContent = preg_replace( '# +#', " ", $this->a_str_OriginalContent ); */
$this->a_str_OriginalContent = str_replace( " >", ">", $this->a_str_OriginalContent ); $template_directory = apply_filters( 'mci_footnotes_template_directory', 'footnotes/templates/' );
$this->reload(); $custom_directory = apply_filters( 'mci_footnotes_custom_template_directory', 'footnotes-custom/' );
} $template_name = $p_str_file_type . '/' . $p_str_file_name . '.' . $p_str_extension;
/** /**
* Get the template * Look in active theme.
* */
* @author Patrizia Lutz @misfist if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $template_directory . $template_name ) ) {
* $located = trailingslashit( get_stylesheet_directory() ) . $template_directory . $template_name;
* @since 2.4.0d3
* /**
* @param string $p_str_FileType * Look in parent theme in case active is child.
* @param string $p_str_FileName */
* @param string $p_str_Extension } elseif ( file_exists( trailingslashit( get_template_directory() ) . $template_directory . $template_name ) ) {
* @return mixed false | template path $located = trailingslashit( get_template_directory() ) . $template_directory . $template_name;
*/
public function get_template( $p_str_FileType, $p_str_FileName, $p_str_Extension = "html" ) { /**
$located = false; * Look in custom plugin directory.
*/
/** } elseif ( file_exists( trailingslashit( WP_PLUGIN_DIR ) . $custom_directory . 'templates/' . $template_name ) ) {
* The directory change be modified $located = trailingslashit( WP_PLUGIN_DIR ) . $custom_directory . 'templates/' . $template_name;
* @usage to change location of templates to `template_parts/footnotes/':
* add_filter( 'mci_footnotes_template_directory', function( $directory ) { /**
* return 'template_parts/footnotes/; * Fall back to the templates shipped with the plugin.
* } ); */
*/ } elseif ( file_exists( $this->plugin_directory . 'templates/' . $template_name ) ) {
$template_directory = apply_filters( 'mci_footnotes_template_directory', 'footnotes/templates/' ); $located = $this->plugin_directory . 'templates/' . $template_name;
$custom_directory = apply_filters( 'mci_footnotes_custom_template_directory', 'footnotes-custom/' ); }
$template_name = $p_str_FileType . '/' . $p_str_FileName . '.' . $p_str_Extension;
return $located;
/** }
* Look in active (child) theme
*/ }
if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $template_directory . $template_name ) ) {
$located = trailingslashit( get_stylesheet_directory() ) . $template_directory . $template_name;
/**
* Look in parent theme
*/
} elseif ( file_exists( trailingslashit( get_template_directory() ) . $template_directory . $template_name ) ) {
$located = trailingslashit( get_template_directory() ) . $template_directory . $template_name;
/**
* Look in custom directory
*/
} elseif ( file_exists( trailingslashit( WP_PLUGIN_DIR ) . $custom_directory . 'templates/' . $template_name ) ) {
$located = trailingslashit( WP_PLUGIN_DIR ) . $custom_directory . 'templates/' . $template_name;
/**
* Look in plugin
*/
} elseif ( file_exists( $this->plugin_directory . 'templates/' . $template_name ) ) {
$located = $this->plugin_directory . 'templates/' . $template_name;
}
return $located;
}
} // end of class

View file

@ -1,88 +1,87 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/** /**
* Widget base. * Widget base.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 * @since 1.5.0
* @date 14.09.14 14:30 * @date 14.09.14 14:30
* *
* @lastmodified 2021-02-18T0306+0100 * @since 1.6.4 Update: replace deprecated function WP_Widget() with recommended __construct(), thanks to @dartiss code contribution.
* @date 2021-02-18T0240+0100 */
* @since 1.6.4 Update: replace deprecated function WP_Widget() with recommended __construct(), thanks to @dartiss code contribution.
*/ /**
* Base Class for all Plugin Widgets. Registers each Widget to WordPress.
/** * The following Methods MUST be overwritten in each sub class:
* Base Class for all Plugin Widgets. Registers each Widget to WordPress. * **public function widget($args, $instance)** -> echo the Widget Content
* The following Methods MUST be overwritten in each sub class: * **public function form($instance)** -> echo the Settings of the Widget
* **public function widget($args, $instance)** -> echo the Widget Content *
* **public function form($instance)** -> echo the Settings of the Widget * @author Stefan Herndler
* * @since 1.5.0
* @author Stefan Herndler */
* @since 1.5.0 abstract class MCI_Footnotes_Widget_Base extends WP_Widget {
*/
abstract class MCI_Footnotes_WidgetBase extends WP_Widget { /**
* Returns an unique ID as string used for the Widget Base ID.
/** *
* Returns an unique ID as string used for the Widget Base ID. * @since 1.5.0
* * @return string
* @author Stefan Herndler */
* @since 1.5.0 abstract protected function get_id();
* @return string
*/ /**
abstract protected function getID(); * Returns the Public name of child Widget to be displayed in the Configuration page.
*
/** * @since 1.5.0
* Returns the Public name of child Widget to be displayed in the Configuration page. * @return string
* */
* @author Stefan Herndler abstract protected function get_name();
* @since 1.5.0
* @return string /**
*/ * Returns the Description of the child widget.
abstract protected function getName(); *
* @since 1.5.0
/** * @return string
* Returns the Description of the child widget. */
* abstract protected function get_description();
* @author Stefan Herndler
* @since 1.5.0 /**
* @return string * Returns the width of the Widget. Default width is 250 pixel.
*/ *
abstract protected function getDescription(); * @since 1.5.0
* @return int
/** */
* Returns the width of the Widget. Default width is 250 pixel. protected function get_widget_width() {
* return 250;
* @author Stefan Herndler }
* @since 1.5.0
* @return int /**
*/ * Class Constructor. Registers the child Widget to WordPress.
protected function getWidgetWidth() { *
return 250; * @since 1.5.0
} *
* - Update: replace deprecated function WP_Widget() with recommended __construct(), thanks to @dartiss code contribution.
/** *
* Class Constructor. Registers the child Widget to WordPress. * @since 1.6.4
* * @contributor @dartiss
* @author Stefan Herndler * @link https://plugins.trac.wordpress.org/browser/footnotes/trunk/class/widgets/base.php?rev=1445720
* @since 1.5.0 * “The called constructor method for WP_Widget in MCI_Footnotes_Widget_ReferenceContainer is deprecated since version 4.3.0! Use __construct() instead.
* */
* - Update: replace deprecated function WP_Widget() with recommended __construct(), thanks to @dartiss code contribution. public function __construct() {
* $l_arr_widget_options = array(
* @since 1.6.4 'classname' => __CLASS__,
* @contributor @dartiss 'description' => $this->get_description(),
* @link https://plugins.trac.wordpress.org/browser/footnotes/trunk/class/widgets/base.php?rev=1445720 );
* “The called constructor method for WP_Widget in MCI_Footnotes_Widget_ReferenceContainer is deprecated since version 4.3.0! Use __construct() instead. $l_arr_control_options = array(
*/ 'id_base' => strtolower( $this->get_id() ),
public function __construct() { 'width' => $this->get_widget_width(),
$l_arr_WidgetOptions = array("classname" => __CLASS__, "description" => $this->getDescription()); );
$l_arr_ControlOptions = array("id_base" => strtolower($this->getID()), "width" => $this->getWidgetWidth()); // Registers the Widget.
// registers the Widget parent::__construct(
parent::__construct( strtolower( $this->get_id() ), // Unique ID for the widget, has to be lowercase.
strtolower($this->getID()), // unique ID for the widget, has to be lowercase $this->get_name(), // Plugin name to be displayed.
$this->getName(), // Plugin name to be displayed $l_arr_widget_options, // Optional Widget Options.
$l_arr_WidgetOptions, // Optional Widget Options $l_arr_control_options // Optional Widget Control Options.
$l_arr_ControlOptions // Optional Widget Control Options );
); }
} }
}

View file

@ -1,85 +1,81 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.EscapeOutput.OutputNotEscaped
/** /**
* Includes the Plugin Widget to put the Reference Container to the Widget area. * Includes the Plugin Widget to put the Reference Container to the Widget area.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 14.09.14 14:26 * @since 1.5.0
* * @date 14.09.14 14:26
* Edited 2.2.0 2020-12-12T2131+0100 *
*/ * @since 2.2.0 (TBD) 2020-12-12T2131+0100
*/
/** /**
* Registers a Widget to put the Reference Container to the widget area. * Registers a Widget to put the Reference Container to the widget area.
* *
* @author Stefan Herndler * @since 1.5.0
* @since 1.5.0 */
*/ class MCI_Footnotes_Widget_Reference_Container extends MCI_Footnotes_Widget_Base {
class MCI_Footnotes_Widget_ReferenceContainer extends MCI_Footnotes_WidgetBase {
/**
/** * Returns an unique ID as string used for the Widget Base ID.
* Returns an unique ID as string used for the Widget Base ID. *
* * @since 1.5.0
* @author Stefan Herndler * @return string
* @since 1.5.0 */
* @return string protected function get_id() {
*/ return 'footnotes_widget';
protected function getID() { }
return "footnotes_widget";
} /**
* Returns the Public name of the Widget to be displayed in the Configuration page.
/** *
* Returns the Public name of the Widget to be displayed in the Configuration page. * @since 1.5.0
* * @return string
* @author Stefan Herndler */
* @since 1.5.0 protected function get_name() {
* @return string return MCI_Footnotes_Config::C_STR_PLUGIN_NAME;
*/ }
protected function getName() {
return MCI_Footnotes_Config::C_STR_PLUGIN_NAME; /**
} * Returns the Description of the child widget.
*
/** * @since 1.5.0
* Returns the Description of the child widget. * @return string
* *
* @author Stefan Herndler * Edit: curly quotes 2.2.0 2020-12-12T2130+0100
* @since 1.5.0 */
* @return string protected function get_description() {
* return __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
* Edit: curly quotes 2.2.0 2020-12-12T2130+0100 }
*/
protected function getDescription() { /**
return __('The widget defines the position of the reference container if set to “widget area”.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME); * Outputs the Settings of the Widget.
} *
* @since 1.5.0
/** * @param mixed $instance The instance of the widget.
* Outputs the Settings of the Widget. * @return void
* *
* @author Stefan Herndler * Edit: curly quotes 2.2.0 2020-12-12T2130+0100
* @since 1.5.0 */
* @param mixed $instance public function form( $instance ) {
* @return void echo __( 'The widget defines the position of the reference container if set to “widget area”.', 'footnotes' );
* }
* Edit: curly quotes 2.2.0 2020-12-12T2130+0100
*/ /**
public function form($instance) { * Outputs the Content of the Widget.
echo __('The widget defines the position of the reference container if set to “widget area”.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME); *
} * @since 1.5.0
* @param mixed $args The widget's arguments.
/** * @param mixed $instance The instance of the widget.
* Outputs the Content of the Widget. */
* public function widget( $args, $instance ) {
* @author Stefan Herndler global $g_obj_mci_footnotes;
* @since 1.5.0 // Reference container positioning is set to "widget area".
* @param mixed $args if ( 'widget' === MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION ) ) {
* @param mixed $instance // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
*/ echo $g_obj_mci_footnotes->a_obj_task->Reference_Container();
public function widget($args, $instance) { // phpcs:enable
global $g_obj_MCI_Footnotes; }
// reference container positioning is set to "widget area" }
if (MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_REFERENCE_CONTAINER_POSITION) == "widget") { }
echo $g_obj_MCI_Footnotes->a_obj_Task->ReferenceContainer();
}
}
}

View file

@ -1,83 +1,92 @@
<?php <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/** /**
* Includes the Class to handle the WYSIWYG-Buttons. * Includes the Class to handle the WYSIWYG-Buttons.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 14.09.14 17:30 * @since 1.5.0
*/ * @date 14.09.14 17:30
*/
/**
* /**
* @author Stefan Herndler * Handles the WSYIWYG-Buttons.
* @since 1.5.0 *
*/ * @since 1.5.0
class MCI_Footnotes_WYSIWYG { */
class MCI_Footnotes_WYSIWYG {
public static function registerHooks() {
add_filter("mce_buttons", array("MCI_Footnotes_WYSIWYG", "newVisualEditorButton")); /**
add_action("admin_print_footer_scripts", array("MCI_Footnotes_WYSIWYG", "newPlainTextEditorButton")); * Registers Button hooks.
*
add_filter("mce_external_plugins", array("MCI_Footnotes_WYSIWYG", "includeScripts")); * @return void
*/
add_action("wp_ajax_nopriv_footnotes_getTags", array("MCI_Footnotes_WYSIWYG", "ajaxCallback")); public static function register_hooks() {
add_action("wp_ajax_footnotes_getTags", array("MCI_Footnotes_WYSIWYG", "ajaxCallback")); add_filter( 'mce_buttons', array( 'MCI_Footnotes_WYSIWYG', 'new_visual_editor_button' ) );
} add_action( 'admin_print_footer_scripts', array( 'MCI_Footnotes_WYSIWYG', 'new_plain_text_editor_button' ) );
add_filter( 'mce_external_plugins', array( 'MCI_Footnotes_WYSIWYG', 'include_scripts' ) );
/**
* Append a new Button to the WYSIWYG editor of Posts and Pages. add_action( 'wp_ajax_nopriv_footnotes_get_tags', array( 'MCI_Footnotes_WYSIWYG', 'ajax_callback' ) );
* add_action( 'wp_ajax_footnotes_get_tags', array( 'MCI_Footnotes_WYSIWYG', 'ajax_callback' ) );
* @author Stefan Herndler }
* @since 1.5.0
* @param array $p_arr_Buttons pre defined Buttons from WordPress.
* @return array /**
*/ * Append a new Button to the WYSIWYG editor of Posts and Pages.
public static function newVisualEditorButton($p_arr_Buttons) { *
array_push($p_arr_Buttons, MCI_Footnotes_Config::C_STR_PLUGIN_NAME); * @since 1.5.0
return $p_arr_Buttons; * @param array $p_arr_buttons pre defined Buttons from WordPress.
} * @return array
*/
/** public static function new_visual_editor_button( $p_arr_buttons ) {
* Add a new button to the plain text editor. array_push( $p_arr_buttons, MCI_Footnotes_Config::C_STR_PLUGIN_NAME );
* return $p_arr_buttons;
* @author Stefan Herndler }
* @since 1.5.0
*/ /**
public static function newPlainTextEditorButton() { * Add a new button to the plain text editor.
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "editor-button"); *
echo $l_obj_Template->getContent(); * @since 1.5.0
} */
public static function new_plain_text_editor_button() {
/** $l_obj_template = new MCI_Footnotes_Template( MCI_Footnotes_Template::C_STR_DASHBOARD, 'editor-button' );
* Includes the Plugins WYSIWYG editor script. // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
* echo $l_obj_template->get_content();
* @author Stefan Herndler // phpcs:enable
* @since 1.5.0 }
* @param array $p_arr_Plugins Scripts to be included to the editor.
* @return array /**
*/ * Includes the Plugins WYSIWYG editor script.
public static function includeScripts($p_arr_Plugins) { *
$p_arr_Plugins[MCI_Footnotes_Config::C_STR_PLUGIN_NAME] = plugins_url('/../js/wysiwyg-editor.js', __FILE__); * @since 1.5.0
return $p_arr_Plugins; * @param array $p_arr_plugins Scripts to be included to the editor.
} * @return array
*/
/** public static function include_scripts( $p_arr_plugins ) {
* AJAX Callback function when the Footnotes Button is clicked. Either in the Plain text or Visual editor. $p_arr_plugins[ MCI_Footnotes_Config::C_STR_PLUGIN_NAME ] = plugins_url( '/../js/wysiwyg-editor.js', __FILE__ );
* Returns an JSON encoded array with the Footnotes start and end short code. return $p_arr_plugins;
* }
* @author Stefan Herndler
* @since 1.5.0 /**
*/ * AJAX Callback function when the Footnotes Button is clicked. Either in the Plain text or Visual editor.
public static function ajaxCallback() { * Returns an JSON encoded array with the Footnotes start and end short code.
// get start and end tag for the footnotes short code *
$l_str_StartingTag = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START); * @since 1.5.0
$l_str_EndingTag = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END); */
if ($l_str_StartingTag == "userdefined" || $l_str_EndingTag == "userdefined") { public static function ajax_callback() {
$l_str_StartingTag = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED); // Get start and end tag for the footnotes short code.
$l_str_EndingTag = MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED); $l_str_starting_tag = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START );
} $l_str_ending_tag = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END );
echo json_encode(array("start" => htmlspecialchars($l_str_StartingTag), "end" => htmlspecialchars($l_str_EndingTag))); if ( 'userdefined' === $l_str_starting_tag || 'userdefined' === $l_str_ending_tag ) {
exit; $l_str_starting_tag = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_START_USER_DEFINED );
} $l_str_ending_tag = MCI_Footnotes_Settings::instance()->get( MCI_Footnotes_Settings::C_STR_FOOTNOTES_SHORT_CODE_END_USER_DEFINED );
} }
echo wp_json_encode(
array(
'start' => htmlspecialchars( $l_str_starting_tag ),
'end' => htmlspecialchars( $l_str_ending_tag ),
)
);
exit;
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,61 +1,61 @@
/*<?php for docblocks /*<?php for docblocks
/** /**
* Created by Stefan Herndler. * Created by Stefan Herndler.
* User: Stefan * User: Stefan
* Created-Date: 15.05.14 * Created-Date: 15.05.14
* Created-Time: 16:21 * Created-Time: 16:21
* Since: 1.0 * Since: 1.0
* *
* Additional stylesheet needed when tooltips (jQuery or alternative) are enabled. * Additional stylesheet needed when tooltips (jQuery or alternative) are enabled.
* *
* @version 2.5.8 * @version 2.5.8
* @lastmodified 2021-02-28T1302+0100 * @lastmodified 2021-02-28T1302+0100
* *
* System of unified minified style sheets tailored to the instance. * System of unified minified style sheets tailored to the instance.
* @since 2.5.5 * @since 2.5.5
* @see full header in dev-common.css. * @see full header in dev-common.css.
*/ */
/** /**
* Tooltips. * Tooltips.
* *
* - Bugfix: Tooltips: set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons bug report. * - Bugfix: Tooltips: set z-index to maximum 2147483647 to address display issues with overlay content, thanks to @russianicons bug report.
* *
* @since 2.1.6 * @since 2.1.6
* @reporter @russianicons * @reporter @russianicons
* @link https://wordpress.org/support/topic/counter-styles-not-working/#post-13767299 * @link https://wordpress.org/support/topic/counter-styles-not-working/#post-13767299
* *
* - Bugfix: Layout: support right-to-left writing direction by replacing remaining CSS values 'left' with 'start', thanks to @arahmanshaalan bug report. * - Bugfix: Layout: support right-to-left writing direction by replacing remaining CSS values 'left' with 'start', thanks to @arahmanshaalan bug report.
* *
* @since 2.5.8 * @since 2.5.8
* @reporter @arahmanshaalan * @reporter @arahmanshaalan
* @link https://wordpress.org/support/topic/right-to-left-text-problem/ * @link https://wordpress.org/support/topic/right-to-left-text-problem/
*/ */
.footnote_tooltip { .footnote_tooltip {
display: none; display: none;
z-index: 2147483647 !important; z-index: 2147483647 !important;
cursor: auto; cursor: auto;
text-align: start !important; text-align: start !important;
padding: 12px; padding: 12px;
line-height: 1.2; line-height: 1.2;
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
/* /*
Read-on button Read-on button
*/ */
.footnote_tooltip_continue { .footnote_tooltip_continue {
font-style: italic; font-style: italic;
color: green; color: green;
text-decoration: none !important; text-decoration: none !important;
cursor: pointer; cursor: pointer;
white-space: nowrap; white-space: nowrap;
} }
.footnote_tooltip_continue:hover { .footnote_tooltip_continue:hover {
color: blue; color: blue;
text-decoration: underline !important; text-decoration: underline !important;
} }

View file

@ -1,282 +1,282 @@
/*<?php for docblocks /*<?php for docblocks
/** /**
* Created by Stefan Herndler. * Created by Stefan Herndler.
* User: Stefan * User: Stefan
* Created-Date: 15.05.14 * Created-Date: 15.05.14
* Created-Time: 16:21 * Created-Time: 16:21
* Since: 1.0 * Since: 1.0
* *
* @version 2.5.5 * @version 2.5.5
* @lastmodified 2021-02-18T2026+0100 * @lastmodified 2021-02-18T2026+0100
*/ */
/** /**
* MCI Footnotes logo * MCI Footnotes logo
* *
* The classes with 'heading' fix display in dashboard, * The classes with 'heading' fix display in dashboard,
* where since WordPress 5.5 settings box labels with * where since WordPress 5.5 settings box labels with
* spans are displayed as justified not last line. * spans are displayed as justified not last line.
* *
* @see class/config.php * @see class/config.php
* @see css/dev-common.css * @see css/dev-common.css
*/ */
.footnotes_logo_heading { .footnotes_logo_heading {
display: inline-block; display: inline-block;
float: left; float: left;
position: absolute; position: absolute;
text-decoration: none; text-decoration: none;
font-weight: normal; font-weight: normal;
} }
.footnotes_logo_part1_heading { .footnotes_logo_part1_heading {
left: 20px; left: 20px;
color: #2bb975; color: #2bb975;
} }
.footnotes_logo_part2_heading { .footnotes_logo_part2_heading {
left: 51px; left: 51px;
color: #545f5a; color: #545f5a;
} }
.footnotes_heart_heading { .footnotes_heart_heading {
color:#ff6d3b; color:#ff6d3b;
font-weight:bold; font-weight:bold;
position: absolute; position: absolute;
left: 96px; left: 96px;
} }
/** /**
* Metabox headings * Metabox headings
*/ */
.postbox-header { .postbox-header {
position: relative; position: relative;
padding: 0 20px; padding: 0 20px;
} }
/************************************************************ /************************************************************
Input fields Input fields
On User Request: On User Request:
Limited to a number of IDs to not affect all dashboards Limited to a number of IDs to not affect all dashboards
<https://wordpress.org/support/topic/all-input-have-width-80/> <https://wordpress.org/support/topic/all-input-have-width-80/>
*/ */
/*input[type=text], input[type=password], textarea, select*/ /*input[type=text], input[type=password], textarea, select*/
#footnote_inputfield_readon_label, #footnote_inputfield_readon_label,
#footnote_inputfield_references_label, #footnote_inputfield_references_label,
#footnote_inputfield_love { #footnote_inputfield_love {
padding-left: 8px !important; padding-left: 8px !important;
padding-right: 8px !important; padding-right: 8px !important;
width: 80% !important; width: 80% !important;
} }
#footnote_inputfield_reference_container_place { #footnote_inputfield_reference_container_place {
width: 310px; width: 310px;
} }
#footnote_inputfield_counter_style, #footnote_inputfield_counter_style,
#footnotes_inputfield_page_layout_support { #footnotes_inputfield_page_layout_support {
width: 505px; width: 505px;
} }
#footnote_inputfield_placeholder_start, #footnote_inputfield_placeholder_start,
#footnote_inputfield_placeholder_end, #footnote_inputfield_placeholder_end,
#footnote_inputfield_custom_mouse_over_box_excerpt_length { #footnote_inputfield_custom_mouse_over_box_excerpt_length {
width: 180px; width: 180px;
} }
#footnote_inputfield_placeholder_start_user_defined, #footnote_inputfield_placeholder_start_user_defined,
#footnote_inputfield_placeholder_end_user_defined { #footnote_inputfield_placeholder_end_user_defined {
width: 320px; width: 320px;
} }
#footnote_inputfield_combine_identical, #footnote_inputfield_combine_identical,
#footnotes_inputfield_scroll_offset, #footnotes_inputfield_scroll_offset,
#footnotes_inputfield_scroll_duration, #footnotes_inputfield_scroll_duration,
#footnote_inputfield_custom_mouse_over_box_excerpt_enabled, #footnote_inputfield_custom_mouse_over_box_excerpt_enabled,
#footnote_inputfield_custom_mouse_over_box_offset_x, #footnote_inputfield_custom_mouse_over_box_offset_x,
#footnote_inputfield_custom_mouse_over_box_offset_y, #footnote_inputfield_custom_mouse_over_box_offset_y,
#footnote_inputfield_custom_mouse_over_box_max_width, #footnote_inputfield_custom_mouse_over_box_max_width,
#footnotes_inputfield_alternative_mouse_over_box_offset_x, #footnotes_inputfield_alternative_mouse_over_box_offset_x,
#footnotes_inputfield_alternative_mouse_over_box_offset_y, #footnotes_inputfield_alternative_mouse_over_box_offset_y,
#footnotes_inputfield_alternative_mouse_over_box_width, #footnotes_inputfield_alternative_mouse_over_box_width,
#footnotes_inputfield_mouse_over_box_fade_in_delay, #footnotes_inputfield_mouse_over_box_fade_in_delay,
#footnotes_inputfield_mouse_over_box_fade_in_duration, #footnotes_inputfield_mouse_over_box_fade_in_duration,
#footnotes_inputfield_mouse_over_box_fade_out_delay, #footnotes_inputfield_mouse_over_box_fade_out_delay,
#footnotes_inputfield_mouse_over_box_fade_out_duration, #footnotes_inputfield_mouse_over_box_fade_out_duration,
#footnote_inputfield_custom_mouse_over_box_border_width, #footnote_inputfield_custom_mouse_over_box_border_width,
#footnote_inputfield_custom_mouse_over_box_border_radius { #footnote_inputfield_custom_mouse_over_box_border_radius {
width: 80px; width: 80px;
} }
#footnote_inputfield_custom_hyperlink_symbol, #footnote_inputfield_custom_hyperlink_symbol,
#footnotes_inputfield_backlinks_terminator_option, #footnotes_inputfield_backlinks_terminator_option,
#footnotes_inputfield_backlinks_separator_option { #footnotes_inputfield_backlinks_separator_option {
width: 230px; width: 230px;
} }
#footnotes_inputfield_reference_container_top_margin, #footnotes_inputfield_reference_container_top_margin,
#footnotes_inputfield_reference_container_bottom_margin, #footnotes_inputfield_reference_container_bottom_margin,
#footnotes_inputfield_backlinks_column_width_scalar, #footnotes_inputfield_backlinks_column_width_scalar,
#footnotes_inputfield_backlinks_column_max_width_scalar, #footnotes_inputfield_backlinks_column_max_width_scalar,
#footnotes_inputfield_mouse_over_box_font_size_scalar { #footnotes_inputfield_mouse_over_box_font_size_scalar {
width: 85px; width: 85px;
} }
#footnotes_inputfield_backlinks_column_width_unit, #footnotes_inputfield_backlinks_column_width_unit,
#footnotes_inputfield_backlinks_column_max_width_unit, #footnotes_inputfield_backlinks_column_max_width_unit,
#footnotes_inputfield_mouse_over_box_font_size_unit { #footnotes_inputfield_mouse_over_box_font_size_unit {
width: 140px; width: 140px;
} }
/************************************************************ /************************************************************
Headings and labels Headings and labels
*/ */
label { label {
display: inline-block; display: inline-block;
} }
.postbox > h3 { .postbox > h3 {
height: 32px !important; height: 32px !important;
line-height: 32px !important; line-height: 32px !important;
} }
.postbox > h3 > span { .postbox > h3 > span {
padding: 0 10px; padding: 0 10px;
} }
.postbox > .inside > table { .postbox > .inside > table {
border: none !important; border: none !important;
} }
.postbox > .inside >table > tbody > tr > td:first-child { .postbox > .inside >table > tbody > tr > td:first-child {
width: 15% !important; width: 15% !important;
font-weight: bold !important; font-weight: bold !important;
} }
.footnote_placeholder_box_container { .footnote_placeholder_box_container {
text-align: center !important; text-align: center !important;
} }
span.footnote_highlight_placeholder { span.footnote_highlight_placeholder {
font-weight: bold !important; font-weight: bold !important;
padding: 0 8px !important; padding: 0 8px !important;
} }
.footnote_placeholder_box_example { .footnote_placeholder_box_example {
border: 2px solid #2bb975 !important; border: 2px solid #2bb975 !important;
border-radius: 4px !important; border-radius: 4px !important;
padding: 16px 0 !important; padding: 16px 0 !important;
width: 50% !important; width: 50% !important;
display: block !important; display: block !important;
margin: 20px auto !important; margin: 20px auto !important;
text-align: center !important; text-align: center !important;
} }
/************************************************************ /************************************************************
Special table layout Special table layout
Hooks and priority levels: Hooks and priority levels:
initialized from style attributes in templates initialized from style attributes in templates
IE doesnt support nth child, but these are not critical IE doesnt support nth child, but these are not critical
*/ */
.expert_lookup tr th:first-child, .expert_lookup tr th:first-child,
.expert_lookup tr td:first-child { .expert_lookup tr td:first-child {
width: 170px !important; width: 170px !important;
} }
.expert_lookup tr th:nth-child(2), .expert_lookup tr th:nth-child(2),
.expert_lookup tr td:nth-child(2) { .expert_lookup tr td:nth-child(2) {
width: 65px !important; width: 65px !important;
} }
.expert_lookup tr th:nth-child(3), .expert_lookup tr th:nth-child(3),
.expert_lookup tr td:nth-child(3) { .expert_lookup tr td:nth-child(3) {
width: 200px !important; width: 200px !important;
} }
.expert_lookup tr td:nth-child(3) input { .expert_lookup tr td:nth-child(3) input {
width: 190px; width: 190px;
} }
.expert_lookup tr th:last-child, .expert_lookup tr th:last-child,
.expert_lookup tr td:last-child { .expert_lookup tr td:last-child {
white-space: nowrap; white-space: nowrap;
} }
/* /*
Custom CSS Custom CSS
The number of CSS classes recommended for customization The number of CSS classes recommended for customization
significantly increased from 4 to 18 as of v2.4.0. significantly increased from 4 to 18 as of v2.4.0.
Localized notices are dropped to ease translators task. Localized notices are dropped to ease translators task.
CSS classes are listed directly in the template CSS classes are listed directly in the template
templates/dashboard/customize-css.html templates/dashboard/customize-css.html
For better maintainability and readability of the source For better maintainability and readability of the source
list, the </p> end tags are omitted per HTML5 standard: list, the </p> end tags are omitted per HTML5 standard:
<https://stackoverflow.com/questions/8460993/p-end-tag-p-is-not-needed-in-html> <https://stackoverflow.com/questions/8460993/p-end-tag-p-is-not-needed-in-html>
The textarea has monospace font, but no other features The textarea has monospace font, but no other features
helping edit CSS, like tab support and syntactic colors. helping edit CSS, like tab support and syntactic colors.
*/ */
#customize_css_new tr td:first-child { #customize_css_new tr td:first-child {
width: 38% !important; width: 38% !important;
font-weight: normal !important; font-weight: normal !important;
} }
.customize_css_new tr td:first-child span:first-child { .customize_css_new tr td:first-child span:first-child {
font-weight: bold !important; font-weight: bold !important;
} }
.customize_css_new .list { .customize_css_new .list {
padding-top: 10px; padding-top: 10px;
} }
.customize_css_new .list p { .customize_css_new .list p {
font-family: monospace; font-family: monospace;
padding: 0 10px; padding: 0 10px;
text-indent: -10px; text-indent: -10px;
margin: .5em 0; margin: .5em 0;
} }
#footnote_inputfield_custom_css_new { #footnote_inputfield_custom_css_new {
height: 500px; height: 500px;
} }
#footnote_inputfield_custom_css, #footnote_inputfield_custom_css,
#footnote_inputfield_custom_css_new { #footnote_inputfield_custom_css_new {
width: 96%; width: 96%;
resize: both; resize: both;
overflow: scroll; overflow: scroll;
font-family: monospace; font-family: monospace;
} }
/************************************************************ /************************************************************
Notices Notices
These spans were previously formatted using the em element. These spans were previously formatted using the em element.
But the intended semantics was not emphasis. But the intended semantics was not emphasis.
In locales using boldface to emphasize, the effect is the In locales using boldface to emphasize, the effect is the
exact opposite of the intention. exact opposite of the intention.
So we must use spans with explicit italic font style. So we must use spans with explicit italic font style.
Scripts not featuring italic fonts fall back to normal, Scripts not featuring italic fonts fall back to normal,
and that is just fine, as italic is only needed here for and that is just fine, as italic is only needed here for
scripts that do have italic, and failing to use it would scripts that do have italic, and failing to use it would
look weird. look weird.
since 2.1.4 since 2.1.4
*/ */
.footnotes_notice { .footnotes_notice {
font-style: italic; font-style: italic;
display: inline-block; display: inline-block;
text-align: end; text-align: end;
} }
/************************************************************ /************************************************************
Descriptions Descriptions
padded div above or below a settings table padded div above or below a settings table
Use case: more extensive information not fitting into a brief Use case: more extensive information not fitting into a brief
notice after the end of the settings box. notice after the end of the settings box.
*/ */
.footnotes_description { .footnotes_description {
padding: 0 4%; padding: 0 4%;
} }
.footnotes_description p { .footnotes_description p {
font-size: 1.06em; font-size: 1.06em;
font-style: italic; font-style: italic;
} }

View file

@ -1,20 +1,20 @@
== Footnotes Features == == Footnotes Features ==
- Performance of the task so PHP won't throw an error when there are more than 120? Footnotes on a single page - Performance of the task so PHP won't throw an error when there are more than 120? Footnotes on a single page
- Maybe increase PHP max execution time while processing the Footnotes task - Maybe increase PHP max execution time while processing the Footnotes task
- different background for every odd table row - different background for every odd table row
- Offer a set of pre-defined styles for the footnotes.Reference.Container - Offer a set of pre-defined styles for the footnotes.Reference.Container
There should be 2 pre-defined styles for the footnotes.Reference.Container and the ability to customize or add templates. There should be 2 pre-defined styles for the footnotes.Reference.Container and the ability to customize or add templates.
the currently used one should be one of those templates and pre-defined styles offered but not the default setting. the currently used one should be one of those templates and pre-defined styles offered but not the default setting.
== Footnotes Bugs == == Footnotes Bugs ==
- Setting "Excerpt No" doesn't work - Setting "Excerpt No" doesn't work
== TODO == == TODO ==
- Statistics: How many Footnotes in each post/page - Statistics: How many Footnotes in each post/page
- Convert from other Footnote Plugins (e.g. ' ((' from Civil Footnotes) - Convert from other Footnote Plugins (e.g. ' ((' from Civil Footnotes)
- Anonymous stats to the developers - Anonymous stats to the developers

View file

@ -1,74 +1,75 @@
<?php <?php
/* /**
Plugin Name: footnotes * Plugin Name: footnotes
Plugin URI: https://wordpress.org/plugins/footnotes/ * Plugin URI: https://wordpress.org/plugins/footnotes/
Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine. * Description: time to bring footnotes to your website! footnotes are known from offline publishing and everybody takes them for granted when reading a magazine.
Author: Mark Cheret * Author: Mark Cheret
Version: 2.5.8 * Version: 2.5.9d1
Author URI: http://cheret.de/plugins/footnotes-2/ * Author URI: http://cheret.de/plugins/footnotes-2/
Text Domain: footnotes * Text Domain: footnotes
Domain Path: /languages * Domain Path: /languages
*/ *
/* * @package footnotes
* Copyright 2021 Mark Cheret (email: mark@cheret.de) * @copyright 2021 Mark Cheret (email: mark@cheret.de)
*/ */
/**
* Version number for stylesheet cache busting. /**
* * Version number for stylesheet cache busting.
* @since 2.1.4 *
* @since 2.5.3 (Hungarian) * @since 2.1.4
* @var str * @since 2.5.3 (Hungarian)
* @lastmodified 2021-02-28T1345+0100 * @var str
*/ * @lastmodified 2021-02-28T1345+0100
define( 'C_STR_FOOTNOTES_VERSION', '2.5.8' ); */
define( 'C_STR_FOOTNOTES_VERSION', '2.5.9d1' );
/*
LICENSE NOTICE /*
LICENSE NOTICE
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 3, as This program is free software; you can redistribute it and/or modify
published by the Free Software Foundation. it under the terms of the GNU General Public License, version 3, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of This program is distributed in the hope that it will be useful,
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software You should have received a copy of the GNU General Public License
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA along with this program; if not, write to the Free Software
*/ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* Plugins main PHP file. /**
* * Plugins main PHP file.
* @filesource *
* @author Stefan Herndler * @filesource
* @since 0.0.1 * @package footnotes
*/ * @since 0.0.1
*/
// Get all common classes and functions
require_once(dirname(__FILE__) . "/includes.php"); // Get all common classes and functions.
require_once dirname( __FILE__ ) . '/includes.php';
// add Plugin Links to the "installed plugins" page
$l_str_plugin_file = 'footnotes/footnotes.php'; // Add Plugin Links to the "installed plugins" page.
add_filter("plugin_action_links_{$l_str_plugin_file}", array("MCI_Footnotes_Hooks", "PluginLinks"), 10, 2); $l_str_plugin_file = 'footnotes/footnotes.php';
add_filter( "plugin_action_links_{$l_str_plugin_file}", array( 'MCI_Footnotes_Hooks', 'plugin_links' ), 10, 2 );
// initialize the Plugin
$g_obj_MCI_Footnotes = new MCI_Footnotes(); // Initialize the Plugin.
// run the Plugin $g_obj_mci_footnotes = new MCI_Footnotes();
$g_obj_MCI_Footnotes->run(); // Run the Plugin.
$g_obj_mci_footnotes->run();
/**
* Sets the stylesheet enqueuing mode for production. /**
* * Sets the stylesheet enqueuing mode for production.
* @since 2.5.5 *
* @var bool * @since 2.5.5
* @see class/init.php * @var bool
* * @see class/init.php
* In production, a minified CSS file tailored to the settings is enqueued. *
* * In production, a minified CSS file tailored to the settings is enqueued.
* Developing stylesheets is meant to be easier when this is set to false. *
* WARNING: This facility designed for development must NOT be used in production. * Developing stylesheets is meant to be easier when this is set to false.
*/ * WARNING: This facility designed for development must NOT be used in production.
define( 'C_BOOL_CSS_PRODUCTION_MODE', true ); */
define( 'C_BOOL_CSS_PRODUCTION_MODE', true );

View file

@ -1,37 +1,39 @@
<?php <?php
/** /**
* Includes all common files. * Includes all common files.
* *
* @filesource * @filesource
* @author Stefan Herndler * @package footnotes
* @since 1.5.0 14.09.14 13:40 * @since 1.5.0 14.09.14 13:40
*/ */
/** /**
* Requires (require_once) all *.php files inside a specific Directory. * Requires (`require_once`) all `*.php` files inside a specific Directory.
* *
* @author Stefan Herndler * @author Stefan Herndler
* @since 1.5.0 * @since 1.5.0
* @param string $p_str_Directory Absolute Directory path to lookup for *.php files * @param string $p_str_directory Absolute Directory path to lookup for `*.php` files.
*/ */
function MCI_Footnotes_requirePhpFiles($p_str_Directory) { function mci_footnotes_require_php_files( $p_str_directory ) {
// append slash at the end of the Directory if not exist // Append slash at the end of the Directory if not exist.
if (substr($p_str_Directory, -1) != "/") { if ( '/' !== substr( $p_str_directory, -1 ) ) {
$p_str_Directory .= "/"; $p_str_directory .= '/';
} }
// get all PHP files inside Directory // Get all PHP files inside Directory.
$l_arr_Files = scandir($p_str_Directory); $l_arr_files = scandir( $p_str_directory );
// iterate through each class // Iterate through each class.
foreach ($l_arr_Files as $l_str_FileName) { foreach ( $l_arr_files as $l_str_file_name ) {
// skip all non *.php files // Skip all non-PHP files.
if (strtolower(substr($l_str_FileName, -4)) != ".php") { if ( '.php' !== strtolower( substr( $l_str_file_name, -4 ) ) ) {
continue; continue;
} }
/** @noinspection PhpIncludeInspection */ // phpcs:disable Generic.Commenting.DocComment.MissingShort
require_once($p_str_Directory . $l_str_FileName); /** @noinspection PhpIncludeInspection */
} require_once $p_str_directory . $l_str_file_name;
} // phpcs:enable
}
MCI_Footnotes_requirePhpFiles(dirname(__FILE__) . "/class"); }
MCI_Footnotes_requirePhpFiles(dirname(__FILE__) . "/class/dashboard");
MCI_Footnotes_requirePhpFiles(dirname(__FILE__) . "/class/widgets"); mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class' );
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class/layout' );
mci_footnotes_require_php_files( dirname( __FILE__ ) . '/class/widgets' );

View file

@ -1,79 +1,79 @@
/** /**
* Created by Stefan on 24.05.14. * Created by Stefan on 24.05.14.
* *
* *
* Edit: be careful to maintain version number near EOF 2020-12-11T1225+0100 * Edit: be careful to maintain version number near EOF 2020-12-11T1225+0100
*/ */
(function() { (function() {
tinymce.create('tinymce.plugins.Footnotes', { tinymce.create('tinymce.plugins.Footnotes', {
/** /**
* Initializes the plugin, this will be executed after the plugin has been created. * Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished its initialization so use the onInit event * This call is done before the editor instance has finished its initialization so use the onInit event
* of the editor instance to intercept that event. * of the editor instance to intercept that event.
* *
* @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
* @param {string} url Absolute URL to where the plugin is located. * @param {string} url Absolute URL to where the plugin is located.
*/ */
init : function(ed, url) { init : function(ed, url) {
ed.addButton('footnotes', { ed.addButton('footnotes', {
title : 'footnotes', title : 'footnotes',
cmd : 'footnotes', cmd : 'footnotes',
image : url + '/../img/fn-wysiwyg.png' image : url + '/../img/fn-wysiwyg.png'
}); });
ed.addCommand('footnotes', function() { ed.addCommand('footnotes', function() {
jQuery.ajax({ jQuery.ajax({
type: 'POST', type: 'POST',
url: './admin-ajax.php', url: './admin-ajax.php',
data: { data: {
action: 'footnotes_getTags' action: 'footnotes_getTags'
}, },
success: function(data, textStatus, XMLHttpRequest){ success: function(data, textStatus, XMLHttpRequest){
var l_arr_Tags = JSON.parse(data); var l_arr_Tags = JSON.parse(data);
var return_text = l_arr_Tags['start'] + ed.selection.getContent() + l_arr_Tags['end']; var return_text = l_arr_Tags['start'] + ed.selection.getContent() + l_arr_Tags['end'];
ed.execCommand('insertHTML', true, return_text); ed.execCommand('insertHTML', true, return_text);
}, },
error: function(MLHttpRequest, textStatus, errorThrown){ error: function(MLHttpRequest, textStatus, errorThrown){
console.log("Error: " + errorThrown); console.log("Error: " + errorThrown);
} }
}); });
}); });
}, },
/** /**
* Creates control instances based in the incomming name. This method is normally not * Creates control instances based in the incomming name. This method is normally not
* needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
* but you sometimes need to create more complex controls like listboxes, split buttons etc then this * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
* method can be used to create those. * method can be used to create those.
* *
* @param {String} n Name of the control to create. * @param {String} n Name of the control to create.
* @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
* @return {tinymce.ui.Control} New control instance or null if no control was created. * @return {tinymce.ui.Control} New control instance or null if no control was created.
*/ */
createControl : function(n, cm) { createControl : function(n, cm) {
return null; return null;
}, },
/** /**
* Returns information about the plugin as a name/value array. * Returns information about the plugin as a name/value array.
* The current keys are longname, author, authorurl, infourl and version. * The current keys are longname, author, authorurl, infourl and version.
* *
* @return {Object} Name/value array containing information about the plugin. * @return {Object} Name/value array containing information about the plugin.
* *
* Edit: needs update the version number manually 2020-12-11T1224+0100 * Edit: needs update the version number manually 2020-12-11T1224+0100
*/ */
getInfo : function() { getInfo : function() {
return { return {
longname : 'Inserts the Footnotes short code.', longname : 'Inserts the Footnotes short code.',
author : 'Mark Cheret', author : 'Mark Cheret',
authorurl : 'https://cheret.de', authorurl : 'https://cheret.de',
infourl : 'https://wordpress.org/plugins/footnotes/', infourl : 'https://wordpress.org/plugins/footnotes/',
version : "2.1.6" version : "2.1.6"
}; };
} }
}); });
// Register plugin // Register plugin
tinymce.PluginManager.add('footnotes', tinymce.plugins.Footnotes); tinymce.PluginManager.add('footnotes', tinymce.plugins.Footnotes);
})(); })();

File diff suppressed because it is too large Load diff

1258
readme.txt

File diff suppressed because it is too large Load diff

View file

@ -1,18 +1,18 @@
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-css]]</p> <p>[[description-css]]</p>
</div> </div>
<table class="customize_css_migration widefat fixed"> <table class="customize_css_migration widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-css]]</td> <td>[[label-css]]</td>
<td>[[css]]</td> <td>[[css]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-show-legacy]]</td> <td>[[label-show-legacy]]</td>
<td>[[show-legacy]] <span class="footnotes_notice">[[notice-show-legacy]]</span></td> <td>[[show-legacy]] <span class="footnotes_notice">[[notice-show-legacy]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-show-legacy]]</p> <p>[[description-show-legacy]]</p>
</div> </div>

View file

@ -1,33 +1,33 @@
<table id="customize_css_new" class="customize_css_new widefat fixed"> <table id="customize_css_new" class="customize_css_new widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[headline]]<br /> <td>[[headline]]<br />
<div class="list"> <div class="list">
<p>.footnote_referrer = enclosing &lt;span> <p>.footnote_referrer = enclosing &lt;span>
<p>.footnote_referrer > a = optional &lt;a> enclosing the &lt;sup> <p>.footnote_referrer > a = optional &lt;a> enclosing the &lt;sup>
<p>.footnote_plugin_tooltip_text = inner &lt;sup>, not tooltip <p>.footnote_plugin_tooltip_text = inner &lt;sup>, not tooltip
<p><!--closing p tags are not mandatory--> <p><!--closing p tags are not mandatory-->
<p>.footnote_tooltip = inner &lt;span> <p>.footnote_tooltip = inner &lt;span>
<p>.footnote_tooltip_continue = nested &lt;span> <p>.footnote_tooltip_continue = nested &lt;span>
<p><!--closing p tags are not mandatory--> <p><!--closing p tags are not mandatory-->
<p>.footnotes_reference_container = enclosing &lt;div> <p>.footnotes_reference_container = enclosing &lt;div>
<p>.footnote_container_prepare = label &lt;div> <p>.footnote_container_prepare = label &lt;div>
<p>.footnote_reference_container_label = &lt;span> <p>.footnote_reference_container_label = &lt;span>
<p>.footnote_reference_container_collapse_button = sibling &lt;span> <p>.footnote_reference_container_collapse_button = sibling &lt;span>
<p><!--closing p tags are not mandatory--> <p><!--closing p tags are not mandatory-->
<p>.footnotes_table = &lt;table> <p>.footnotes_table = &lt;table>
<p>.footnotes_plugin_reference_row = &lt;tr> <p>.footnotes_plugin_reference_row = &lt;tr>
<p>.footnote_plugin_index_combi = first &lt;td> if identical footnotes are combined <p>.footnote_plugin_index_combi = first &lt;td> if identical footnotes are combined
<p>.footnote_plugin_index = first &lt;td> if identical footnotes are not combined <p>.footnote_plugin_index = first &lt;td> if identical footnotes are not combined
<p>.footnote_index = &lt;a> or &lt;span> in first &lt;td> in 3-column table <p>.footnote_index = &lt;a> or &lt;span> in first &lt;td> in 3-column table
<p>.footnote_plugin_symbol = second &lt;td> in 3-column table <p>.footnote_plugin_symbol = second &lt;td> in 3-column table
<p>.footnote_plugin_link = &lt;a> or &lt;span> if identical footnotes are not combined <p>.footnote_plugin_link = &lt;a> or &lt;span> if identical footnotes are not combined
<p>.footnote_backlink = &lt;a> or &lt;span> if identical footnotes are combined, or in second &lt;td> in 3-column table <p>.footnote_backlink = &lt;a> or &lt;span> if identical footnotes are combined, or in second &lt;td> in 3-column table
<p>.footnote_index_arrow = nested &lt;span>, symbol only <p>.footnote_index_arrow = nested &lt;span>, symbol only
<p>.footnote_plugin_text = second &lt;td>, or third &lt;td> in 3-column table <p>.footnote_plugin_text = second &lt;td>, or third &lt;td> in 3-column table
</div> </div>
</td> </td>
<td>[[css]]</td> <td>[[css]]</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,11 +1,11 @@
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-css]]</p> <p>[[description-css]]</p>
</div> </div>
<table class="customize_css widefat fixed"> <table class="customize_css widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-css]]</td> <td>[[label-css]]</td>
<td>[[css]]</td> <td>[[css]]</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,15 +1,15 @@
<table class="customize_hyperlink_arrow widefat fixed"> <table class="customize_hyperlink_arrow widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-symbol]]</td> <td>[[label-symbol]]</td>
<td> <td>
[[symbol-options]] [[symbol-options]]
[[symbol-custom]] [[symbol-custom]]
<span class="footnotes_notice">[[notice-symbol]]</span> <span class="footnotes_notice">[[notice-symbol]]</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-symbol]]</p> <p>[[description-symbol]]</p>
</div> </div>

View file

@ -1,24 +1,24 @@
<table class="customize_superscript widefat fixed"> <table class="customize_superscript widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-superscript]]</td> <td>[[label-superscript]]</td>
<td>[[superscript]]</td> <td>[[superscript]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-normalize]]</td> <td>[[label-normalize]]</td>
<td>[[normalize]] <span class="footnotes_notice">[[notice-normalize]]</span></td> <td>[[normalize]] <span class="footnotes_notice">[[notice-normalize]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-before]]</td> <td>[[label-before]]</td>
<td>[[before]]</td> <td>[[before]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-after]]</td> <td>[[label-after]]</td>
<td>[[after]]</td> <td>[[after]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-link]]</td> <td>[[label-link]]</td>
<td><span class="footnotes_notice">[[notice-link]]</span></td> <td><span class="footnotes_notice">[[notice-link]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,37 +1,37 @@
<table class="diagnostics widefat fixed"> <table class="diagnostics widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-server]]</td> <td>[[label-server]]</td>
<td>[[server]]</td> <td>[[server]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-php]]</td> <td>[[label-php]]</td>
<td>[[php]]</td> <td>[[php]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-user-agent]]</td> <td>[[label-user-agent]]</td>
<td>[[user-agent]]</td> <td>[[user-agent]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-max-execution-time]]</td> <td>[[label-max-execution-time]]</td>
<td>[[max-execution-time]]</td> <td>[[max-execution-time]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-memory-limit]]</td> <td>[[label-memory-limit]]</td>
<td>[[memory-limit]]</td> <td>[[memory-limit]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-php-extensions]]</td> <td>[[label-php-extensions]]</td>
<td>[[php-extensions]]</td> <td>[[php-extensions]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-wordpress]]</td> <td>[[label-wordpress]]</td>
<td>[[wordpress]]</td> <td>[[wordpress]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-theme]]</td> <td>[[label-theme]]</td>
<td>[[theme]]</td> <td>[[theme]]</td>
</tr> </tr>
[[plugins]] [[plugins]]
</tbody> </tbody>
</table> </table>

View file

@ -1,62 +1,62 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
* Footnote button for the Classic Editor text mode. * Footnote button for the Classic Editor text mode.
* *
* @since 1.3.0 * @since 1.3.0
* @lastmodified 2021-02-18T2043+0100 * @lastmodified 2021-02-18T2043+0100
* *
* @since 2.5.4 Bugfix: Editor button: Classic Editor text mode: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report. * @since 2.5.4 Bugfix: Editor button: Classic Editor text mode: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report.
* @since 2.5.4 Bugfix: Editor button: Classic Editor text mode: correct label to singular. * @since 2.5.4 Bugfix: Editor button: Classic Editor text mode: correct label to singular.
*/?> */?>
--> -->
<script type="text/javascript"> <script type="text/javascript">
/** /**
* Brackets the selected text with tags in the text area. * Brackets the selected text with tags in the text area.
* *
* @param string elementID * @param string elementID
* @param string openTag * @param string openTag
* @param string closeTag * @param string closeTag
*/ */
function MCI_Footnotes_wrapText(elementID, openTag, closeTag) { function MCI_Footnotes_wrapText(elementID, openTag, closeTag) {
var textArea = jQuery('#' + elementID); var textArea = jQuery('#' + elementID);
var len = textArea.val().length; var len = textArea.val().length;
var start = textArea[0].selectionStart; var start = textArea[0].selectionStart;
var end = textArea[0].selectionEnd; var end = textArea[0].selectionEnd;
var selectedText = textArea.val().substring(start, end); var selectedText = textArea.val().substring(start, end);
var replacement = openTag + selectedText + closeTag; var replacement = openTag + selectedText + closeTag;
textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
} }
/** /**
* Adds a button to the Classic Editor text mode. * Adds a button to the Classic Editor text mode.
* *
* - Bugfix: Editor button: Classic Editor text mode: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report. * - Bugfix: Editor button: Classic Editor text mode: try to fix uncaught reference error of “QTags is not defined”, thanks to @dpartridge bug report.
* *
* @reporter @dpartridge * @reporter @dpartridge
* @link https://wordpress.org/support/topic/qtags-addbutton/ * @link https://wordpress.org/support/topic/qtags-addbutton/
* *
*/ */
if ( QTags ) { if ( QTags ) {
QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnote', MCI_Footnotes_text_editor_callback ); QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnote', MCI_Footnotes_text_editor_callback );
} }
/** /**
* callback function when the button is clicked * callback function when the button is clicked
* executes a ajax call to get the start and end tag for the footnotes and * executes a ajax call to get the start and end tag for the footnotes and
* adds them in before and after the selected text * adds them in before and after the selected text
*/ */
function MCI_Footnotes_text_editor_callback() { function MCI_Footnotes_text_editor_callback() {
jQuery.ajax({ jQuery.ajax({
type: 'POST', type: 'POST',
url: '/wp-admin/admin-ajax.php', url: '/wp-admin/admin-ajax.php',
data: { data: {
action: 'footnotes_getTags' action: 'footnotes_getTags'
}, },
success: function(data, textStatus, XMLHttpRequest){ success: function(data, textStatus, XMLHttpRequest){
var l_arr_Tags = JSON.parse(data); var l_arr_Tags = JSON.parse(data);
MCI_Footnotes_wrapText("content", l_arr_Tags['start'], l_arr_Tags['end']); MCI_Footnotes_wrapText("content", l_arr_Tags['start'], l_arr_Tags['end']);
}, },
error: function(MLHttpRequest, textStatus, errorThrown){ error: function(MLHttpRequest, textStatus, errorThrown){
} }
}); });
} }
</script> </script>

View file

@ -1,50 +1,50 @@
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-1]]</p> <p>[[description-1]]</p>
<p>[[description-2]]</p> <p>[[description-2]]</p>
<p>[[description-3]]</p> <p>[[description-3]]</p>
</div> </div>
<table class="expert_lookup widefat fixed"> <table class="expert_lookup widefat fixed">
<thead> <thead>
<tr> <tr>
<th>[[head-hook]]</th> <th>[[head-hook]]</th>
<th>[[head-checkbox]]</th> <th>[[head-checkbox]]</th>
<th>[[head-numbox]]</th> <th>[[head-numbox]]</th>
<th>[[head-url]]</th> <th>[[head-url]]</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>[[label-the-title]]</td> <td>[[label-the-title]]</td>
<td>[[the-title]]</td> <td>[[the-title]]</td>
<td>[[priority-the-title]]</td> <td>[[priority-the-title]]</td>
<td><a href="[[url-the-title]]" target="_blank">[[url-the-title]]</a></td> <td><a href="[[url-the-title]]" target="_blank">[[url-the-title]]</a></td>
</tr> </tr>
<tr> <tr>
<td>[[label-the-content]]</td> <td>[[label-the-content]]</td>
<td>[[the-content]]</td> <td>[[the-content]]</td>
<td>[[priority-the-content]]</td> <td>[[priority-the-content]]</td>
<td><a href="[[url-the-content]]" target="_blank">[[url-the-content]]</a></td> <td><a href="[[url-the-content]]" target="_blank">[[url-the-content]]</a></td>
</tr> </tr>
<tr> <tr>
<td>[[label-the-excerpt]]</td> <td>[[label-the-excerpt]]</td>
<td>[[the-excerpt]]</td> <td>[[the-excerpt]]</td>
<td>[[priority-the-excerpt]]</td> <td>[[priority-the-excerpt]]</td>
<td><a href="[[url-the-excerpt]]" target="_blank">[[url-the-excerpt]]</a></td> <td><a href="[[url-the-excerpt]]" target="_blank">[[url-the-excerpt]]</a></td>
</tr> </tr>
<tr> <tr>
<td>[[label-widget-title]]</td> <td>[[label-widget-title]]</td>
<td>[[widget-title]]</td> <td>[[widget-title]]</td>
<td>[[priority-widget-title]]</td> <td>[[priority-widget-title]]</td>
<td><a href="[[url-widget-title]]" target="_blank">[[url-widget-title]]</a></td> <td><a href="[[url-widget-title]]" target="_blank">[[url-widget-title]]</a></td>
</tr> </tr>
<tr> <tr>
<td>[[label-widget-text]]</td> <td>[[label-widget-text]]</td>
<td>[[widget-text]]</td> <td>[[widget-text]]</td>
<td>[[priority-widget-text]]</td> <td>[[priority-widget-text]]</td>
<td><a href="[[url-widget-text]]" target="_blank">[[url-widget-text]]</a></td> <td><a href="[[url-widget-text]]" target="_blank">[[url-widget-text]]</a></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-4]]</p> <p>[[description-4]]</p>
</div> </div>

View file

@ -1,2 +1,2 @@
<input type="button" class="button button-primary" value="[[caption]]" <input type="button" class="button button-primary" value="[[caption]]"
onclick="window.open('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6Z6CZDW8PPBBJ');" /> onclick="window.open('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6Z6CZDW8PPBBJ');" />

View file

@ -1,17 +1,17 @@
<div class="footnote_placeholder_box_container"> <div class="footnote_placeholder_box_container">
[[label-start]]&nbsp;<b>[[start]]</b> [[label-start]]&nbsp;<b>[[start]]</b>
<br/> <br/>
[[label-end]]&nbsp;<b>[[end]]</b> [[label-end]]&nbsp;<b>[[end]]</b>
</div> </div>
<div class="footnote_placeholder_box_example"> <div class="footnote_placeholder_box_example">
<span class="footnote_highlight_placeholder">[[example-code]]</span> <span class="footnote_highlight_placeholder">[[example-code]]</span>
<br/> <br/>
[[example-string]] [[example-string]]
<br/> <br/>
[[example]] [[example]]
</div> </div>
<div style="text-align:center;"> <div style="text-align:center;">
[[information]] [[information]]
</div> </div>

View file

@ -1,11 +1,11 @@
<h1 style="margin: 0 0 18px; color: rgb(64, 64, 64); line-height: 36px; font-size: 30px; ">ManFisher</h1> <h1 style="margin: 0 0 18px; color: rgb(64, 64, 64); line-height: 36px; font-size: 30px; ">ManFisher</h1>
<div style="-webkit-print-color-adjust: exact; margin-right: 10px; padding:14px; border: 1px solid #444; background-color: #fefefe; color: rgb(115, 115, 115); font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', Arial, sans-serif;"> <div style="-webkit-print-color-adjust: exact; margin-right: 10px; padding:14px; border: 1px solid #444; background-color: #fefefe; color: rgb(115, 115, 115); font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', Arial, sans-serif;">
<p style="margin: 0 0 9px; font-size: 13px; line-height: 18px;">a note from the mastermind behind footnotes</p> <p style="margin: 0 0 9px; font-size: 13px; line-height: 18px;">a note from the mastermind behind footnotes</p>
<h2 style="margin: 0; color: rgb(64, 64, 64); line-height: 36px; font-size: 24px; ">Ideology</h2> <h2 style="margin: 0; color: rgb(64, 64, 64); line-height: 36px; font-size: 24px; ">Ideology</h2>
<p style="margin: 0 0 9px; font-size: 13px; line-height: 18px;">You know WordPress is a great community effort and boatloads of people are involved and spending their spare time to freely (free as in money) contribute to WordPress as a platform or at the very core. Our aim as developers and those gravitating around developer's halos is to give back to the community with our own ideas which we think are great and well worth our whiles to put our own time into. For some of us, it would be a huge honour to serve the WordPress core developer team.</p> <p style="margin: 0 0 9px; font-size: 13px; line-height: 18px;">You know WordPress is a great community effort and boatloads of people are involved and spending their spare time to freely (free as in money) contribute to WordPress as a platform or at the very core. Our aim as developers and those gravitating around developer's halos is to give back to the community with our own ideas which we think are great and well worth our whiles to put our own time into. For some of us, it would be a huge honour to serve the WordPress core developer team.</p>
<h2 style="margin: 0;color: rgb(64, 64, 64); line-height: 36px; font-size: 24px; ">the ManFisher menu</h2> <h2 style="margin: 0;color: rgb(64, 64, 64); line-height: 36px; font-size: 24px; ">the ManFisher menu</h2>
<p style="margin: 0 0 9px; font-size: 13px; line-height: 18px;">Will soon disappear as the company name changed and I believe it's overbearing to have that menu for such a simple function as footnotes</p> <p style="margin: 0 0 9px; font-size: 13px; line-height: 18px;">Will soon disappear as the company name changed and I believe it's overbearing to have that menu for such a simple function as footnotes</p>
</div> </div>

View file

@ -1,32 +1,32 @@
<table class="mouse_over_box_appearance widefat fixed"> <table class="mouse_over_box_appearance widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-font-size]]</td> <td>[[label-font-size]]</td>
<td>[[font-size-enable]][[font-size-scalar]][[font-size-unit]] <span class="footnotes_notice">[[notice-font-size]]</span></td> <td>[[font-size-enable]][[font-size-scalar]][[font-size-unit]] <span class="footnotes_notice">[[notice-font-size]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-color]]</td> <td>[[label-color]]</td>
<td>[[color]] <span class="footnotes_notice">[[notice-color]]</span></td> <td>[[color]] <span class="footnotes_notice">[[notice-color]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-background]]</td> <td>[[label-background]]</td>
<td>[[background]] <span class="footnotes_notice">[[notice-background]]</span></td> <td>[[background]] <span class="footnotes_notice">[[notice-background]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-border-width]]</td> <td>[[label-border-width]]</td>
<td>[[border-width]] <span class="footnotes_notice">[[notice-border-width]]</span></td> <td>[[border-width]] <span class="footnotes_notice">[[notice-border-width]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-border-color]]</td> <td>[[label-border-color]]</td>
<td>[[border-color]] <span class="footnotes_notice">[[notice-border-color]]</span></td> <td>[[border-color]] <span class="footnotes_notice">[[notice-border-color]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-border-radius]]</td> <td>[[label-border-radius]]</td>
<td>[[border-radius]] <span class="footnotes_notice">[[notice-border-radius]]</span></td> <td>[[border-radius]] <span class="footnotes_notice">[[notice-border-radius]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-box-shadow-color]]</td> <td>[[label-box-shadow-color]]</td>
<td>[[box-shadow-color]] <span class="footnotes_notice">[[notice-box-shadow-color]]</span></td> <td>[[box-shadow-color]] <span class="footnotes_notice">[[notice-box-shadow-color]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,8 +1,8 @@
<table class="mouse_over_box_dimensions widefat fixed"> <table class="mouse_over_box_dimensions widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-max-width]]</td> <td>[[label-max-width]]</td>
<td>[[max-width]] [[width]] <span class="footnotes_notice">[[notice-max-width]]</span></td> <td>[[max-width]] [[width]] <span class="footnotes_notice">[[notice-max-width]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,15 +1,15 @@
<table class="mouse_over_box_display widefat fixed"> <table class="mouse_over_box_display widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-enable]]</td> <td>[[label-enable]]</td>
<td>[[enable]] <span class="footnotes_notice">[[notice-enable]]</span></td> <td>[[enable]] <span class="footnotes_notice">[[notice-enable]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-alternative]]</td> <td>[[label-alternative]]</td>
<td>[[alternative]] <span class="footnotes_notice">[[notice-alternative]]</span></td> <td>[[alternative]] <span class="footnotes_notice">[[notice-alternative]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-alternative]]</p> <p>[[description-alternative]]</p>
</div> </div>

View file

@ -1,16 +1,16 @@
<table class="mouse_over_box_position widefat fixed"> <table class="mouse_over_box_position widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-position]]</td> <td>[[label-position]]</td>
<td>[[position]] [[position-alternative]] <span class="footnotes_notice">[[notice-position]]</span></td> <td>[[position]] [[position-alternative]] <span class="footnotes_notice">[[notice-position]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-offset-x]]</td> <td>[[label-offset-x]]</td>
<td>[[offset-x]] [[offset-x-alternative]] <span class="footnotes_notice">[[notice-offset-x]]</span></td> <td>[[offset-x]] [[offset-x-alternative]] <span class="footnotes_notice">[[notice-offset-x]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-offset-y]]</td> <td>[[label-offset-y]]</td>
<td>[[offset-y]] [[offset-y-alternative]] <span class="footnotes_notice">[[notice-offset-y]]</span></td> <td>[[offset-y]] [[offset-y-alternative]] <span class="footnotes_notice">[[notice-offset-y]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,22 +1,22 @@
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-delimiter]]</p> <p>[[description-delimiter]]</p>
</div> </div>
<table class="mouse_over_box_text widefat fixed"> <table class="mouse_over_box_text widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-delimiter]]</td> <td>[[label-delimiter]]</td>
<td>[[delimiter]] <span class="footnotes_notice">[[notice-delimiter]]</span></td> <td>[[delimiter]] <span class="footnotes_notice">[[notice-delimiter]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-mirror]]</td> <td>[[label-mirror]]</td>
<td>[[mirror]] <span class="footnotes_notice">[[notice-mirror]]</span></td> <td>[[mirror]] <span class="footnotes_notice">[[notice-mirror]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-separator]]</td> <td>[[label-separator]]</td>
<td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td> <td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-mirror]]</p> <p>[[description-mirror]]</p>
</div> </div>

View file

@ -1,20 +1,20 @@
<table class="mouse_over_box_timing widefat fixed"> <table class="mouse_over_box_timing widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-fade-in-delay]]</td> <td>[[label-fade-in-delay]]</td>
<td>[[fade-in-delay]] <span class="footnotes_notice">[[notice-fade-in-delay]]</span></td> <td>[[fade-in-delay]] <span class="footnotes_notice">[[notice-fade-in-delay]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-fade-in-duration]]</td> <td>[[label-fade-in-duration]]</td>
<td>[[fade-in-duration]] <span class="footnotes_notice">[[notice-fade-in-duration]]</span></td> <td>[[fade-in-duration]] <span class="footnotes_notice">[[notice-fade-in-duration]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-fade-out-delay]]</td> <td>[[label-fade-out-delay]]</td>
<td>[[fade-out-delay]] <span class="footnotes_notice">[[notice-fade-out-delay]]</span></td> <td>[[fade-out-delay]] <span class="footnotes_notice">[[notice-fade-out-delay]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-fade-out-duration]]</td> <td>[[label-fade-out-duration]]</td>
<td>[[fade-out-duration]] <span class="footnotes_notice">[[notice-fade-out-duration]]</span></td> <td>[[fade-out-duration]] <span class="footnotes_notice">[[notice-fade-out-duration]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,16 +1,16 @@
<table class="mouse_over_box_truncation widefat fixed"> <table class="mouse_over_box_truncation widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-truncation]]</td> <td>[[label-truncation]]</td>
<td>[[truncation]]</td> <td>[[truncation]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-max-length]]</td> <td>[[label-max-length]]</td>
<td>[[max-length]] <span class="footnotes_notice">[[notice-max-length]]</span></td> <td>[[max-length]] <span class="footnotes_notice">[[notice-max-length]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-readon]]</td> <td>[[label-readon]]</td>
<td>[[readon]]</td> <td>[[readon]]</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,91 +1,91 @@
<div class="plugin-card"> <div class="plugin-card">
<div class="plugin-card-top"> <div class="plugin-card-top">
<a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox plugin-icon"> <a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox plugin-icon">
<img src="[[plugin-icon]]"/> <img src="[[plugin-icon]]"/>
</a> </a>
<div class="name column-name"> <div class="name column-name">
<h4> <h4>
<a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox">[[plugin-title]]</a> <a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox">[[plugin-title]]</a>
</h4> </h4>
</div> </div>
<div class="action-links"> <div class="action-links">
<ul class="plugin-action-buttons"> <ul class="plugin-action-buttons">
<li> <li>
[[install-link]] [[install-link]]
</li> </li>
<li> <li>
<a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox" aria-label="More information about [[plugin-title]]" data-title="[[plugin-title]]">[[more-details-label]]</a> <a href="[[server]]/wp-admin/plugin-install.php?tab=plugin-information&plugin=[[plugin-name]]&TB_iframe=true&width=600&height=550" class="thickbox" aria-label="More information about [[plugin-title]]" data-title="[[plugin-title]]">[[more-details-label]]</a>
</li> </li>
</ul> </ul>
</div> </div>
<div class="desc column-description"> <div class="desc column-description">
<p id="manfisher-[[plugin-name]]-description"></p> <p id="manfisher-[[plugin-name]]-description"></p>
<p class="authors"> <p class="authors">
<cite id="manfisher-[[plugin-name]]-author"></cite> <cite id="manfisher-[[plugin-name]]-author"></cite>
</p> </p>
</div> </div>
</div> </div>
<div class="plugin-card-bottom"> <div class="plugin-card-bottom">
<div class="vers column-rating"> <div class="vers column-rating">
<div class="star-rating" title=""> <div class="star-rating" title="">
<span class="screen-reader-text" id="manfisher-[[plugin-name]]-rating-text"></span> <span class="screen-reader-text" id="manfisher-[[plugin-name]]-rating-text"></span>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
<div class="star"></div> <div class="star"></div>
</div> </div>
<span class="num-ratings" id="manfisher-[[plugin-name]]-rating-num"></span> <span class="num-ratings" id="manfisher-[[plugin-name]]-rating-num"></span>
</div> </div>
<div class="column-updated"> <div class="column-updated">
<strong>[[last-updated-label]]:</strong> <strong>[[last-updated-label]]:</strong>
<span id="manfisher-[[plugin-name]]-updated"></span> <span id="manfisher-[[plugin-name]]-updated"></span>
</div> </div>
<div class="column-downloaded" id="manfisher-[[plugin-name]]-downloads"></div> <div class="column-downloaded" id="manfisher-[[plugin-name]]-downloads"></div>
<div class="column-compatibility"> <div class="column-compatibility">
<!--<span class="compatibility-compatible"></span>--> <!--<span class="compatibility-compatible"></span>-->
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
jQuery.ajax({ jQuery.ajax({
type: 'POST', type: 'POST',
url: '/wp-admin/admin-ajax.php', url: '/wp-admin/admin-ajax.php',
data: { data: {
action: 'footnotes_getPluginInfo', action: 'footnotes_get_plugin_info',
plugin: '[[plugin-name]]' plugin: '[[plugin-name]]'
}, },
dataType: 'json', dataType: 'json',
success: function (data, textStatus, XMLHttpRequest) { success: function (data, textStatus, XMLHttpRequest) {
var l_obj_Description = jQuery("#manfisher-[[plugin-name]]-description"); var l_obj_Description = jQuery("#manfisher-[[plugin-name]]-description");
var l_obj_Author = jQuery("#manfisher-[[plugin-name]]-author"); var l_obj_Author = jQuery("#manfisher-[[plugin-name]]-author");
var l_obj_RatingText = jQuery("#manfisher-[[plugin-name]]-rating-text"); var l_obj_RatingText = jQuery("#manfisher-[[plugin-name]]-rating-text");
var l_obj_RatingNum = jQuery("#manfisher-[[plugin-name]]-rating-num"); var l_obj_RatingNum = jQuery("#manfisher-[[plugin-name]]-rating-num");
var l_obj_LastUpdated = jQuery("#manfisher-[[plugin-name]]-updated"); var l_obj_LastUpdated = jQuery("#manfisher-[[plugin-name]]-updated");
var l_obj_Downloads = jQuery("#manfisher-[[plugin-name]]-downloads"); var l_obj_Downloads = jQuery("#manfisher-[[plugin-name]]-downloads");
if (data == null) { if (data == null) {
l_obj_Description.text("No response received."); l_obj_Description.text("No response received.");
} else if (data.error) { } else if (data.error) {
l_obj_Description.text(data.error); l_obj_Description.text(data.error);
} else { } else {
l_obj_Description.text(data.PluginDescription); l_obj_Description.text(data.PluginDescription);
l_obj_Author.append("By " + data.PluginAuthor); l_obj_Author.append("By " + data.PluginAuthor);
l_obj_RatingText.text(data.PluginRatingText); l_obj_RatingText.text(data.PluginRatingText);
l_obj_RatingText.next().addClass(data.PluginRating1); l_obj_RatingText.next().addClass(data.PluginRating1);
l_obj_RatingText.next().next().addClass(data.PluginRating2); l_obj_RatingText.next().next().addClass(data.PluginRating2);
l_obj_RatingText.next().next().next().addClass(data.PluginRating3); l_obj_RatingText.next().next().next().addClass(data.PluginRating3);
l_obj_RatingText.next().next().next().next().addClass(data.PluginRating4); l_obj_RatingText.next().next().next().next().addClass(data.PluginRating4);
l_obj_RatingText.next().next().next().next().next().addClass(data.PluginRating5); l_obj_RatingText.next().next().next().next().next().addClass(data.PluginRating5);
l_obj_RatingNum.text("(" + data.PluginRating + ")"); l_obj_RatingNum.text("(" + data.PluginRating + ")");
l_obj_LastUpdated.text(data.PluginLastUpdated); l_obj_LastUpdated.text(data.PluginLastUpdated);
l_obj_Downloads.text(data.PluginDownloads + " downloads"); l_obj_Downloads.text(data.PluginDownloads + " downloads");
} }
}, },
error: function (MLHttpRequest, textStatus, errorThrown) { error: function (MLHttpRequest, textStatus, errorThrown) {
console.log(textStatus); console.log(textStatus);
} }
}); });
</script> </script>

View file

@ -1,11 +1,11 @@
<table class="settings_excerpts widefat fixed"> <table class="settings_excerpts widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-excerpts]]</td> <td>[[label-excerpts]]</td>
<td>[[excerpts]] <span class="footnotes_notice">[[notice-excerpts]]</span></td> <td>[[excerpts]] <span class="footnotes_notice">[[notice-excerpts]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-excerpts]]</p> <p>[[description-excerpts]]</p>
</div> </div>

View file

@ -1,12 +1,12 @@
<table class="settings_love widefat fixed"> <table class="settings_love widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-love]]</td> <td>[[label-love]]</td>
<td>[[love]]</td> <td>[[love]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-no-love]]</td> <td>[[label-no-love]]</td>
<td>[[no-love]]</td> <td>[[no-love]]</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,15 +1,15 @@
<table class="settings_numbering widefat fixed"> <table class="settings_numbering widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-counter-style]]</td> <td>[[label-counter-style]]</td>
<td>[[counter-style]]</td> <td>[[counter-style]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-identical]]</td> <td>[[label-identical]]</td>
<td>[[identical]] <span class="footnotes_notice">[[notice-identical]]</span></td> <td>[[identical]] <span class="footnotes_notice">[[notice-identical]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-identical]]</p> <p>[[description-identical]]</p>
</div> </div>

View file

@ -1,117 +1,117 @@
<table class="settings_reference_container widefat fixed"> <table class="settings_reference_container widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-name]]</td> <td>[[label-name]]</td>
<td>[[name]]</td> <td>[[name]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-element]]</td> <td>[[label-element]]</td>
<td>[[element]]</td> <td>[[element]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-border]]</td> <td>[[label-border]]</td>
<td>[[border]]</td> <td>[[border]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-collapse]]</td> <td>[[label-collapse]]</td>
<td>[[collapse]]</td> <td>[[collapse]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-script]]</td> <td>[[label-script]]</td>
<td>[[script]] <span class="footnotes_notice">[[notice-script]]</span></td> <td>[[script]] <span class="footnotes_notice">[[notice-script]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-position]]</td> <td>[[label-position]]</td>
<td>[[position]] <span class="footnotes_notice">[[notice-position]]</span></td> <td>[[position]] <span class="footnotes_notice">[[notice-position]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-shortcode]]</td> <td>[[label-shortcode]]</td>
<td>[[shortcode]] <span class="footnotes_notice">[[notice-shortcode]]</span></td> <td>[[shortcode]] <span class="footnotes_notice">[[notice-shortcode]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-startpage]]</td> <td>[[label-startpage]]</td>
<td>[[startpage]]</td> <td>[[startpage]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-margin-top]]</td> <td>[[label-margin-top]]</td>
<td>[[margin-top]] <span class="footnotes_notice">[[notice-margin-top]]</span></td> <td>[[margin-top]] <span class="footnotes_notice">[[notice-margin-top]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-margin-bottom]]</td> <td>[[label-margin-bottom]]</td>
<td>[[margin-bottom]] <span class="footnotes_notice">[[notice-margin-bottom]]</span></td> <td>[[margin-bottom]] <span class="footnotes_notice">[[notice-margin-bottom]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-page-layout]]</td> <td>[[label-page-layout]]</td>
<td>[[page-layout]] <span class="footnotes_notice">[[notice-page-layout]]</span></td> <td>[[page-layout]] <span class="footnotes_notice">[[notice-page-layout]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-url-wrap]]</td> <td>[[label-url-wrap]]</td>
<td>[[url-wrap]] <span class="footnotes_notice">[[notice-url-wrap]]</span></td> <td>[[url-wrap]] <span class="footnotes_notice">[[notice-url-wrap]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-symbol]]</td> <td>[[label-symbol]]</td>
<td>[[symbol-enable]] <span class="footnotes_notice">[[notice-symbol]]</span></td> <td>[[symbol-enable]] <span class="footnotes_notice">[[notice-symbol]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-switch]]</td> <td>[[label-switch]]</td>
<td>[[switch]]</td> <td>[[switch]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-3column]]</td> <td>[[label-3column]]</td>
<td>[[3column]] <span class="footnotes_notice">[[notice-3column]]</span></td> <td>[[3column]] <span class="footnotes_notice">[[notice-3column]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-row-borders]]</td> <td>[[label-row-borders]]</td>
<td>[[row-borders]]</td> <td>[[row-borders]]</td>
</tr> </tr>
<tr> <tr>
<td>[[label-separator]]</td> <td>[[label-separator]]</td>
<td> <td>
[[separator-enable]] [[separator-enable]]
[[separator-options]] [[separator-options]]
[[separator-custom]] [[separator-custom]]
<span class="footnotes_notice">[[notice-separator]]</span> <span class="footnotes_notice">[[notice-separator]]</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>[[label-terminator]]</td> <td>[[label-terminator]]</td>
<td> <td>
[[terminator-enable]] [[terminator-enable]]
[[terminator-options]] [[terminator-options]]
[[terminator-custom]] [[terminator-custom]]
<span class="footnotes_notice">[[notice-terminator]]</span> <span class="footnotes_notice">[[notice-terminator]]</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>[[label-width]]</td> <td>[[label-width]]</td>
<td> <td>
[[width-enable]] [[width-enable]]
[[width-scalar]] [[width-scalar]]
[[width-unit]] [[width-unit]]
<span class="footnotes_notice">[[notice-width]]</span> <span class="footnotes_notice">[[notice-width]]</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>[[label-max-width]]</td> <td>[[label-max-width]]</td>
<td> <td>
[[max-width-enable]] [[max-width-enable]]
[[max-width-scalar]] [[max-width-scalar]]
[[max-width-unit]] [[max-width-unit]]
<span class="footnotes_notice">[[notice-max-width]]</span> <span class="footnotes_notice">[[notice-max-width]]</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>[[label-line-break]]</td> <td>[[label-line-break]]</td>
<td>[[line-break]] <td>[[line-break]]
<span class="footnotes_notice">[[notice-line-break]]</span> <span class="footnotes_notice">[[notice-line-break]]</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>[[label-link]]</td> <td>[[label-link]]</td>
<td>[[link]] <span class="footnotes_notice">[[notice-link]]</span></td> <td>[[link]] <span class="footnotes_notice">[[notice-link]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-link]]</p> <p>[[description-link]]</p>
</div> </div>

View file

@ -1,36 +1,36 @@
<table class="settings_scrolling widefat fixed"> <table class="settings_scrolling widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-scroll-offset]]</td> <td>[[label-scroll-offset]]</td>
<td>[[scroll-offset]] <span class="footnotes_notice">[[notice-scroll-offset]]</span></td> <td>[[scroll-offset]] <span class="footnotes_notice">[[notice-scroll-offset]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-scroll-duration]]</td> <td>[[label-scroll-duration]]</td>
<td>[[scroll-duration]] <span class="footnotes_notice">[[notice-scroll-duration]]</span></td> <td>[[scroll-duration]] <span class="footnotes_notice">[[notice-scroll-duration]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-hard-links]]</td> <td>[[label-hard-links]]</td>
<td>[[hard-links]] <span class="footnotes_notice">[[notice-hard-links]]</span></td> <td>[[hard-links]] <span class="footnotes_notice">[[notice-hard-links]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-footnote]]</td> <td>[[label-footnote]]</td>
<td>[[footnote]] <span class="footnotes_notice">[[notice-footnote]]</span></td> <td>[[footnote]] <span class="footnotes_notice">[[notice-footnote]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-referrer]]</td> <td>[[label-referrer]]</td>
<td>[[referrer]] <span class="footnotes_notice">[[notice-referrer]]</span></td> <td>[[referrer]] <span class="footnotes_notice">[[notice-referrer]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-separator]]</td> <td>[[label-separator]]</td>
<td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td> <td>[[separator]] <span class="footnotes_notice">[[notice-separator]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-backlink-tooltips]]</td> <td>[[label-backlink-tooltips]]</td>
<td>[[backlink-tooltips]] <span class="footnotes_notice">[[notice-backlink-tooltips]]</span></td> <td>[[backlink-tooltips]] <span class="footnotes_notice">[[notice-backlink-tooltips]]</span></td>
</tr> </tr>
<tr> <tr>
<td>[[label-backlink-tooltip-text]]</td> <td>[[label-backlink-tooltip-text]]</td>
<td>[[backlink-tooltip-text]] <span class="footnotes_notice">[[notice-backlink-tooltip-text]]</span></td> <td>[[backlink-tooltip-text]] <span class="footnotes_notice">[[notice-backlink-tooltip-text]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,63 +1,63 @@
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-escapement]]</p> <p>[[description-escapement]]</p>
</div> </div>
<table class="settings_start_end widefat fixed"> <table class="settings_start_end widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-short-code-start]]</td> <td>[[label-short-code-start]]</td>
<td> <td>
<span>[[short-code-start]]</span> <span>[[short-code-start]]</span>
<span>[[short-code-start-user]]</span> <span>[[short-code-start-user]]</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>[[label-short-code-end]]</td> <td>[[label-short-code-end]]</td>
<td> <td>
<span>[[short-code-end]]</span> <span>[[short-code-end]]</span>
<span>[[short-code-end-user]]</span> <span>[[short-code-end-user]]</span>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-parentheses]]</p> <p>[[description-parentheses]]</p>
</div> </div>
<table class="settings_start_end widefat fixed"> <table class="settings_start_end widefat fixed">
<tbody> <tbody>
<tr> <tr>
<td>[[label-syntax]]</td> <td>[[label-syntax]]</td>
<td>[[syntax]] <span class="footnotes_notice">[[notice-syntax]]</span></td> <td>[[syntax]] <span class="footnotes_notice">[[notice-syntax]]</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="footnotes_description"> <div class="footnotes_description">
<p>[[description-syntax]]</p> <p>[[description-syntax]]</p>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var l_obj_ShortCodeStart = jQuery("#[[short-code-start-id]]"); var l_obj_ShortCodeStart = jQuery("#[[short-code-start-id]]");
var l_obj_ShortCodeEnd = jQuery("#[[short-code-end-id]]"); var l_obj_ShortCodeEnd = jQuery("#[[short-code-end-id]]");
var l_obj_ShortCodeStartUserDefined = jQuery("#[[short-code-start-user-id]]"); var l_obj_ShortCodeStartUserDefined = jQuery("#[[short-code-start-user-id]]");
var l_obj_ShortCodeEndUserDefined = jQuery("#[[short-code-end-user-id]]"); var l_obj_ShortCodeEndUserDefined = jQuery("#[[short-code-end-user-id]]");
function footnotes_Display_UserDefined_Placeholders() { function footnotes_Display_UserDefined_Placeholders() {
if (l_obj_ShortCodeStart.val() == "userdefined") { if (l_obj_ShortCodeStart.val() == "userdefined") {
l_obj_ShortCodeStartUserDefined.parent().show(); l_obj_ShortCodeStartUserDefined.parent().show();
l_obj_ShortCodeEndUserDefined.parent().show(); l_obj_ShortCodeEndUserDefined.parent().show();
} else { } else {
l_obj_ShortCodeStartUserDefined.parent().hide(); l_obj_ShortCodeStartUserDefined.parent().hide();
l_obj_ShortCodeEndUserDefined.parent().hide(); l_obj_ShortCodeEndUserDefined.parent().hide();
} }
} }
footnotes_Display_UserDefined_Placeholders(); footnotes_Display_UserDefined_Placeholders();
l_obj_ShortCodeStart.on('change', function() { l_obj_ShortCodeStart.on('change', function() {
var l_int_SelectedIndex = jQuery(this).prop("selectedIndex"); var l_int_SelectedIndex = jQuery(this).prop("selectedIndex");
jQuery('#[[short-code-end-id]] option:eq(' + l_int_SelectedIndex + ')').prop('selected', true); jQuery('#[[short-code-end-id]] option:eq(' + l_int_SelectedIndex + ')').prop('selected', true);
footnotes_Display_UserDefined_Placeholders(); footnotes_Display_UserDefined_Placeholders();
}); });
l_obj_ShortCodeEnd.on('change', function() { l_obj_ShortCodeEnd.on('change', function() {
var l_int_SelectedIndex = jQuery(this).prop("selectedIndex"); var l_int_SelectedIndex = jQuery(this).prop("selectedIndex");
jQuery('#[[short-code-start-id]] option:eq(' + l_int_SelectedIndex + ')').prop('selected', true); jQuery('#[[short-code-start-id]] option:eq(' + l_int_SelectedIndex + ')').prop('selected', true);
footnotes_Display_UserDefined_Placeholders(); footnotes_Display_UserDefined_Placeholders();
}); });
</script> </script>

View file

@ -1,24 +1,24 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
*/?> */?>
--> -->
<span <span
class="footnote_referrer relative" class="footnote_referrer relative"
onmouseover="footnoteTooltipShow('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')" onmouseover="footnote_tooltip_show('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')" onmouseout="footnote_tooltip_hide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
><[[link-span]] ><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');" onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
[[hard-link]] [[hard-link]]
><[[sup-span]] ><[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]" id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_tooltip_text" class="footnote_plugin_tooltip_text"
>[[before]][[index]][[after]]</[[sup-span]] >[[before]][[index]][[after]]</[[sup-span]]
></[[link-span]] ></[[link-span]]
>[[anchor-element]]<span >[[anchor-element]]<span
id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]" id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_tooltip position hidden" class="footnote_tooltip position hidden"
onmouseout="footnoteTooltipHide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')" onmouseout="footnote_tooltip_hide('footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]')"
[[style]] [[style]]
>[[text]]</span >[[text]]</span
></span ></span
> >

View file

@ -1,20 +1,20 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
*/?> */?>
--> -->
<span <span
class="footnote_referrer" class="footnote_referrer"
><[[link-span]] ><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');" onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]');"
[[hard-link]] [[hard-link]]
><[[sup-span]] ><[[sup-span]]
id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]" id="footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_tooltip_text" class="footnote_plugin_tooltip_text"
>[[before]][[index]][[after]]</[[sup-span]] >[[before]][[index]][[after]]</[[sup-span]]
></[[link-span]] ></[[link-span]]
>[[anchor-element]]<span >[[anchor-element]]<span
id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]" id="footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_tooltip" class="footnote_tooltip"
>[[text]]</span >[[text]]</span
></span ></span
> >

View file

@ -1,88 +1,88 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
* Plain JavaScript reference container start and end without scroll script. * Plain JavaScript reference container start and end without scroll script.
* *
* @since 2.5.6 * @since 2.5.6
* @type object * @type object
* @lastmodified 2021-02-20T0252+0100 * @lastmodified 2021-02-20T0252+0100
* *
* - Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports. * - Bugfix: Reference container: optional alternative expanding and collapsing without jQuery for use with hard links, thanks to @hopper87it @pkverma99 issue reports.
* *
* @since 2.5.6 * @since 2.5.6
* *
* @reporter @hopper87it * @reporter @hopper87it
* @link https://wordpress.org/support/topic/footnotes-wp-rocket/ * @link https://wordpress.org/support/topic/footnotes-wp-rocket/
* *
* @reporter @pkverma99 * @reporter @pkverma99
* @link https://wordpress.org/support/topic/footnotes-wp-rocket/#post-14076188 * @link https://wordpress.org/support/topic/footnotes-wp-rocket/#post-14076188
* *
* The heavy jQuery Core library from WordPress must not be deferred for * The heavy jQuery Core library from WordPress must not be deferred for
* the jQuery reference container to work, and is detrimental to page speed. * the jQuery reference container to work, and is detrimental to page speed.
* This alternative works with plain JS but does not support scroll animation. * This alternative works with plain JS but does not support scroll animation.
* The plugin is set to enable hard links when this option is enabled. * The plugin is set to enable hard links when this option is enabled.
*/?> */?>
--> -->
<div <div
class="speaker-mute footnotes_reference_container" class="speaker-mute footnotes_reference_container"
> >
<div <div
class="footnote_container_prepare" class="footnote_container_prepare"
><[[element]] ><[[element]]
><span ><span
id="footnotes_container_label_expand_[[post_id]]_[[container_id]]" id="footnotes_container_label_expand_[[post_id]]_[[container_id]]"
class="footnote_reference_container_label pointer" class="footnote_reference_container_label pointer"
onclick="footnote_expand_reference_container_[[post_id]]_[[container_id]]();" onclick="footnote_expand_reference_container_[[post_id]]_[[container_id]]();"
>[[name]]</span >[[name]]</span
><span ><span
id="footnotes_container_button_plus_[[post_id]]_[[container_id]]" id="footnotes_container_button_plus_[[post_id]]_[[container_id]]"
class="footnote_reference_container_collapse_button" class="footnote_reference_container_collapse_button"
style="[[button-style]]" style="[[button-style]]"
onclick="footnote_expand_reference_container_[[post_id]]_[[container_id]]();" onclick="footnote_expand_reference_container_[[post_id]]_[[container_id]]();"
>[+]</span >[+]</span
><span ><span
id="footnotes_container_label_collapse_[[post_id]]_[[container_id]]" id="footnotes_container_label_collapse_[[post_id]]_[[container_id]]"
class="footnote_reference_container_label pointer" class="footnote_reference_container_label pointer"
style="display: none;" style="display: none;"
onclick="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();" onclick="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[[name]]</span >[[name]]</span
><span ><span
id="footnotes_container_button_minus_[[post_id]]_[[container_id]]" id="footnotes_container_button_minus_[[post_id]]_[[container_id]]"
class="footnote_reference_container_collapse_button" class="footnote_reference_container_collapse_button"
style="display: none;" style="display: none;"
onclick="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();" onclick="footnote_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[]</span >[]</span
></[[element]] ></[[element]]
></div ></div
> >
<div <div
id="footnote_references_container_[[post_id]]_[[container_id]]" id="footnote_references_container_[[post_id]]_[[container_id]]"
style="[[style]]" style="[[style]]"
> >
<table <table
class="footnotes_table footnote-reference-container" class="footnotes_table footnote-reference-container"
> >
<tbody> <tbody>
[[content]] [[content]]
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function footnote_expand_reference_container_[[post_id]]_[[container_id]]() { function footnote_expand_reference_container_[[post_id]]_[[container_id]]() {
document.getElementById('footnote_references_container_[[post_id]]_[[container_id]]').style.display = "inline"; document.getElementById('footnote_references_container_[[post_id]]_[[container_id]]').style.display = "inline";
document.getElementById('footnotes_container_label_expand_[[post_id]]_[[container_id]]').style.display = "none"; document.getElementById('footnotes_container_label_expand_[[post_id]]_[[container_id]]').style.display = "none";
document.getElementById('footnotes_container_label_collapse_[[post_id]]_[[container_id]]').style.display = "inline"; document.getElementById('footnotes_container_label_collapse_[[post_id]]_[[container_id]]').style.display = "inline";
document.getElementById('footnotes_container_button_plus_[[post_id]]_[[container_id]]').style.display = "none"; document.getElementById('footnotes_container_button_plus_[[post_id]]_[[container_id]]').style.display = "none";
document.getElementById('footnotes_container_button_minus_[[post_id]]_[[container_id]]').style.display = "inline"; document.getElementById('footnotes_container_button_minus_[[post_id]]_[[container_id]]').style.display = "inline";
} }
function footnote_collapse_reference_container_[[post_id]]_[[container_id]]() { function footnote_collapse_reference_container_[[post_id]]_[[container_id]]() {
document.getElementById('footnote_references_container_[[post_id]]_[[container_id]]').style.display = "none"; document.getElementById('footnote_references_container_[[post_id]]_[[container_id]]').style.display = "none";
document.getElementById('footnotes_container_label_collapse_[[post_id]]_[[container_id]]').style.display = "none"; document.getElementById('footnotes_container_label_collapse_[[post_id]]_[[container_id]]').style.display = "none";
document.getElementById('footnotes_container_label_expand_[[post_id]]_[[container_id]]').style.display = "inline"; document.getElementById('footnotes_container_label_expand_[[post_id]]_[[container_id]]').style.display = "inline";
document.getElementById('footnotes_container_button_minus_[[post_id]]_[[container_id]]').style.display = "none"; document.getElementById('footnotes_container_button_minus_[[post_id]]_[[container_id]]').style.display = "none";
document.getElementById('footnotes_container_button_plus_[[post_id]]_[[container_id]]').style.display = "inline"; document.getElementById('footnotes_container_button_plus_[[post_id]]_[[container_id]]').style.display = "inline";
} }
function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) { function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) {
footnote_expand_reference_container_[[post_id]]_[[container_id]](); footnote_expand_reference_container_[[post_id]]_[[container_id]]();
} }
</script> </script>

View file

@ -1,29 +1,29 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
*/?> */?>
--> -->
<tr class="footnotes_plugin_reference_row"> <tr class="footnotes_plugin_reference_row">
<td <td
class="footnote_plugin_index" class="footnote_plugin_index"
><[[link-span]] ><[[link-span]]
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]" id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_index" class="footnote_index"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');" onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
[[hard-link]] [[hard-link]]
>[[index]][[terminator]]</[[link-span]] >[[index]][[terminator]]</[[link-span]]
>[[anchor-element]]</td >[[anchor-element]]</td
> >
<td <td
class="footnote_plugin_symbol" class="footnote_plugin_symbol"
><[[link-span]] ><[[link-span]]
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');" onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
class="footnote_backlink" class="footnote_backlink"
[[hard-link]] [[hard-link]]
>[[arrow]]</[[link-span]] >[[arrow]]</[[link-span]]
></td ></td
> >
<td <td
class="footnote_plugin_text" class="footnote_plugin_text"
>[[text]]</td >[[text]]</td
> >
</tr> </tr>

View file

@ -1,14 +1,14 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
*/?> */?>
--> -->
<tr class="footnotes_plugin_reference_row"> <tr class="footnotes_plugin_reference_row">
<td <td
class="footnote_plugin_index_combi[[pointer]]" class="footnote_plugin_index_combi[[pointer]]"
[[event]] [[event]]
>[[backlinks]]</td >[[backlinks]]</td
> >
<td <td
class="footnote_plugin_text" class="footnote_plugin_text"
>[[text]]</td> >[[text]]</td>
</tr> </tr>

View file

@ -1,19 +1,19 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
*/?> */?>
--> -->
<tr class="footnotes_plugin_reference_row"> <tr class="footnotes_plugin_reference_row">
<td <td
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]" id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer" class="footnote_plugin_index pointer"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');" onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
><[[link-span]] ><[[link-span]]
class="footnote_plugin_link" class="footnote_plugin_link"
[[hard-link]] [[hard-link]]
>[[index]][[terminator]][[arrow]]</[[link-span]] >[[index]][[terminator]][[arrow]]</[[link-span]]
>[[anchor-element]]</td >[[anchor-element]]</td
> >
<td <td
class="footnote_plugin_text" class="footnote_plugin_text"
>[[text]]</td> >[[text]]</td>
</tr> </tr>

View file

@ -1,24 +1,24 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
* Default table row template for uncombined footnotes * Default table row template for uncombined footnotes
* *
* @since 2.2.10 Bugfix: Reference container: add missing container ID in function name in default table row template for uncombined footnotes. * @since 2.2.10 Bugfix: Reference container: add missing container ID in function name in default table row template for uncombined footnotes.
* *
*/?> */?>
--> -->
<tr class="footnotes_plugin_reference_row"> <tr class="footnotes_plugin_reference_row">
<td <td
id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]" id="footnote_plugin_reference_[[post_id]]_[[container_id]]_[[note_id]]"
class="footnote_plugin_index pointer" class="footnote_plugin_index pointer"
onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');" onclick="footnote_moveToAnchor_[[post_id]]_[[container_id]]('footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]');"
><[[link-span]] ><[[link-span]]
class="footnote_plugin_link" class="footnote_plugin_link"
[[hard-link]] [[hard-link]]
>[[arrow]][[index]][[terminator]]</[[link-span]] >[[arrow]][[index]][[terminator]]</[[link-span]]
>[[anchor-element]]</td >[[anchor-element]]</td
> >
<td <td
class="footnote_plugin_text" class="footnote_plugin_text"
>[[text]]</td >[[text]]</td
> >
</tr> </tr>

View file

@ -1,83 +1,83 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
* Yields the reference container start and end including the scroll script. * Yields the reference container start and end including the scroll script.
* *
* @since Unknown * @since Unknown
* @type object * @type object
* *
* @lastmodified 2021-02-18T2046+0100 * @lastmodified 2021-02-18T2046+0100
* *
* *
* *
* - Bugfix: Reference container: restore expand/collapse button in the template, thanks to @ragonesi bug report. * - Bugfix: Reference container: restore expand/collapse button in the template, thanks to @ragonesi bug report.
* *
* @since 2.0.2 * @since 2.0.2
* *
* @reporter @ragonesi * @reporter @ragonesi
* @link https://wordpress.org/support/topic/hyperlink-symbol-in-reference-container/#post-13587782 * @link https://wordpress.org/support/topic/hyperlink-symbol-in-reference-container/#post-13587782
* *
* The expand/collapse button was lost @since 2.0.0 for an unknown reason. * The expand/collapse button was lost @since 2.0.0 for an unknown reason.
* The fix was about restoring the button code (only, while the script remained complete). * The fix was about restoring the button code (only, while the script remained complete).
*/?> */?>
--> -->
<div <div
class="speaker-mute footnotes_reference_container" class="speaker-mute footnotes_reference_container"
> >
<div <div
class="footnote_container_prepare" class="footnote_container_prepare"
><[[element]] ><[[element]]
><span ><span
class="footnote_reference_container_label pointer" class="footnote_reference_container_label pointer"
onclick="footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]();" onclick="footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[[name]]</span >[[name]]</span
><span ><span
class="footnote_reference_container_collapse_button" class="footnote_reference_container_collapse_button"
style="[[button-style]]" style="[[button-style]]"
onclick="footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]();" onclick="footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]();"
>[<a >[<a
id="footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]" id="footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]"
>+</a >+</a
>]</span >]</span
></[[element]] ></[[element]]
></div ></div
> >
<div <div
id="footnote_references_container_[[post_id]]_[[container_id]]" id="footnote_references_container_[[post_id]]_[[container_id]]"
style="[[style]]" style="[[style]]"
> >
<table <table
class="footnotes_table footnote-reference-container" class="footnotes_table footnote-reference-container"
> >
<tbody> <tbody>
[[content]] [[content]]
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function footnote_expand_reference_container_[[post_id]]_[[container_id]]() { function footnote_expand_reference_container_[[post_id]]_[[container_id]]() {
jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').show(); jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').show();
jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text(''); jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text('');
} }
function footnote_collapse_reference_container_[[post_id]]_[[container_id]]() { function footnote_collapse_reference_container_[[post_id]]_[[container_id]]() {
jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').hide(); jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').hide();
jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text('+'); jQuery('#footnote_reference_container_collapse_button_[[post_id]]_[[container_id]]').text('+');
} }
function footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]() { function footnote_expand_collapse_reference_container_[[post_id]]_[[container_id]]() {
if (jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').is(':hidden')) { if (jQuery('#footnote_references_container_[[post_id]]_[[container_id]]').is(':hidden')) {
footnote_expand_reference_container_[[post_id]]_[[container_id]](); footnote_expand_reference_container_[[post_id]]_[[container_id]]();
} else { } else {
footnote_collapse_reference_container_[[post_id]]_[[container_id]](); footnote_collapse_reference_container_[[post_id]]_[[container_id]]();
} }
} }
function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) { function footnote_moveToAnchor_[[post_id]]_[[container_id]](p_str_TargetID) {
footnote_expand_reference_container_[[post_id]]_[[container_id]](); footnote_expand_reference_container_[[post_id]]_[[container_id]]();
var l_obj_Target = jQuery('#' + p_str_TargetID); var l_obj_Target = jQuery('#' + p_str_TargetID);
if (l_obj_Target.length) { if (l_obj_Target.length) {
jQuery('html, body').animate({ jQuery('html, body').animate({
scrollTop: l_obj_Target.offset().top - window.innerHeight * [[scroll-offset]] scrollTop: l_obj_Target.offset().top - window.innerHeight * [[scroll-offset]]
}, },
[[scroll-duration]]); [[scroll-duration]]);
} }
} }
</script> </script>

View file

@ -1,18 +1,18 @@
<!--<?php//for docblock, @see MCI_Footnotes_Template::process_template() <!--<?php//for docblock, @see MCI_Footnotes_Template::process_template()
/** /**
*/?> */?>
--> -->
<script type="text/javascript"> <script type="text/javascript">
jQuery('#footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]').tooltip({ jQuery('#footnote_plugin_tooltip_[[post_id]]_[[container_id]]_[[note_id]]').tooltip({
tip: '#footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]', tip: '#footnote_plugin_tooltip_text_[[post_id]]_[[container_id]]_[[note_id]]',
tipClass: 'footnote_tooltip', tipClass: 'footnote_tooltip',
effect: 'fade', effect: 'fade',
predelay: [[fade-in-delay]], predelay: [[fade-in-delay]],
fadeInSpeed: [[fade-in-duration]], fadeInSpeed: [[fade-in-duration]],
delay: [[fade-out-delay]], delay: [[fade-out-delay]],
fadeOutSpeed: [[fade-out-duration]], fadeOutSpeed: [[fade-out-duration]],
position: '[[position]]', position: '[[position]]',
relative: true, relative: true,
offset: [[[offset-y]], [[offset-x]]], offset: [[[offset-y]], [[offset-x]]],
}); });
</script> </script>