- Add: List with Features

- Add: Hyperlink to manfisher.eu in the "other plugins" page
- Bugfix: Load text domain
- Bugfix: Display the Footnotes button in the plain text editor of posts/pages

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@997524 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-09-27 07:56:40 +00:00
parent 5a6cf06525
commit 14cda8a316
7 changed files with 70 additions and 17 deletions

View file

@ -141,6 +141,23 @@ class MCI_Footnotes_Layout_Init {
* @since 1.5.0 * @since 1.5.0
*/ */
public function displayOtherPlugins() { public function displayOtherPlugins() {
printf("<br/>");
printf("<h3>%s</h3>", __('Take a look on other Plugins we have developed.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
printf('<em><a href="http://manfisher.net/" target="_blank">visit ManFisher Medien ManuFaktur</a></em>');
printf("<br/><br/>");
/*
// collect plugin list as JSON
$l_arr_Response = wp_remote_get("http://herndler.org/wordpress/plugins/get.json");
// check if response is valid
if (is_wp_error($l_arr_Response)) {
printf(__("Error loading other WordPress Plugins from Manfisher. Sorry!", MCI_Footnotes_Config::C_STR_PLUGIN_NAME));
return;
}
// get the body of the response
$l_str_Response = $l_arr_Response["body"];
// convert the body to a json string
$l_arr_Plugins = json_decode($l_str_Response, true);
*/
$l_arr_Plugins = array( $l_arr_Plugins = array(
array("name" => "identity", "title" => "Identity"), array("name" => "identity", "title" => "Identity"),
array("name" => "google-keyword-suggest", "title" => "Google Keyword Suggest"), array("name" => "google-keyword-suggest", "title" => "Google Keyword Suggest"),
@ -151,9 +168,7 @@ class MCI_Footnotes_Layout_Init {
// load template file // load template file
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "other-plugins"); $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "other-plugins");
echo sprintf("<br/><h3>%s</h3><br/>", __('Take a look on other Plugins we have developed.', MCI_Footnotes_Config::C_STR_PLUGIN_NAME)); printf('<div id="the-list">');
echo '<div id="the-list">';
// iterate through each Plugin // iterate through each Plugin
foreach($l_arr_Plugins as $l_arr_PluginInfo) { foreach($l_arr_Plugins as $l_arr_PluginInfo) {
// replace Plugin information // replace Plugin information
@ -168,7 +183,7 @@ class MCI_Footnotes_Layout_Init {
// reload template // reload template
$l_obj_Template->reload(); $l_obj_Template->reload();
} }
echo '</div>'; printf('</div>');
} }
/** /**

View file

@ -30,19 +30,29 @@ class MCI_Footnotes_Language {
* @since 1.5.0 * @since 1.5.0
*/ */
public static function loadTextDomain() { public static function loadTextDomain() {
$l_str_LanguagePath = dirname(__FILE__) . "/../languages/" . MCI_Footnotes_Config::C_STR_PLUGIN_NAME - "-";
// language file with localization exists // language file with localization exists
$l_bool_DomainLoaded = load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . apply_filters('plugin_locale', get_locale(), MCI_Footnotes_Config::C_STR_PLUGIN_NAME) . '.mo'); if (self::load(apply_filters('plugin_locale', get_locale()))) {
if (!empty($l_bool_DomainLoaded)) {
return; return;
} }
// language file without localization exists // language file without localization exists
$l_bool_DomainLoaded = load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . self::getLanguageCode() . '.mo'); if (self::load(self::getLanguageCode())) {
if (!empty($l_bool_DomainLoaded)) {
return; return;
} }
// fallback to english // fallback to english
load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME, $l_str_LanguagePath . '-en.mo'); self::load("en");
}
/**
* Loads a specific text domain.
*
* @author Stefan Herndler
* @since 1.5.1
* @param string $p_str_LanguageCode Language Code to load a specific text domain.
* @return bool
*/
private static function load($p_str_LanguageCode) {
return load_textdomain(MCI_Footnotes_Config::C_STR_PLUGIN_NAME,
dirname(__FILE__) . "/../languages/" . MCI_Footnotes_Config::C_STR_PLUGIN_NAME . "-" . $p_str_LanguageCode . '.mo');
} }
/** /**
@ -54,7 +64,7 @@ class MCI_Footnotes_Language {
*/ */
private static function getLanguageCode() { private static function getLanguageCode() {
// read current WordPress language // read current WordPress language
$l_str_locale = apply_filters('plugin_locale', get_locale(), MCI_Footnotes_Config::C_STR_PLUGIN_NAME); $l_str_locale = apply_filters('plugin_locale', get_locale());
// check if WordPress language has a localization (e.g. "en_US" or "de_AT") // check if WordPress language has a localization (e.g. "en_US" or "de_AT")
if (strpos($l_str_locale, "_") !== false) { if (strpos($l_str_locale, "_") !== false) {
// remove localization code // remove localization code

View file

@ -7,6 +7,11 @@
* @since 1.5.0 14.09.14 17:30 * @since 1.5.0 14.09.14 17:30
*/ */
/**
*
* @author Stefan Herndler
* @since 1.5.0
*/
class MCI_Footnotes_WYSIWYG { class MCI_Footnotes_WYSIWYG {
public static function registerHooks() { public static function registerHooks() {
@ -41,7 +46,7 @@ class MCI_Footnotes_WYSIWYG {
*/ */
public static function newPlainTextEditorButton() { public static function newPlainTextEditorButton() {
$l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "editor-button"); $l_obj_Template = new MCI_Footnotes_Template(MCI_Footnotes_Template::C_STR_DASHBOARD, "editor-button");
$l_obj_Template->getContent(); echo $l_obj_Template->getContent();
} }
/** /**

22
features.txt Normal file
View file

@ -0,0 +1,22 @@
== List of other Plugins ==
- Add downloads (real time from WordPress API)
- Add image (from JSON string)
- Add rating (display the stars)
- Add "Compatible up to" WordPress Version
- Add last updated timestamp
== Diagnostics ==
- Add current WordPress Theme (Name, Version, Author, Url)
== Footnotes ==
- Add public css file to the "How to" tab
- Add setting to customize the mouse-over box
- Add setting to disable the mouse-over box
- Display the mouse-over box to the left if near the right margin
- Abbreviate the mouse-over text if more than XXX characters (ending with "...")
- Performance of the task so PHP won't throw an error when there are more than 120? Footnotes
- Maybe increase PHP max execution time while processing the Footnotes task

View file

@ -29,7 +29,6 @@
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'];
console.log(return_text);
ed.execCommand('insertHTML', true, return_text); ed.execCommand('insertHTML', true, return_text);
}, },
error: function(MLHttpRequest, textStatus, errorThrown){ error: function(MLHttpRequest, textStatus, errorThrown){

View file

@ -73,11 +73,14 @@ Visit this swift write-up from a **footnotes** user by the name of **Southwest**
== Changelog == == Changelog ==
= 1.5.0 = = 1.5.0 =
- Update: Refactored the whole source code
- Add: Grouped the Plugin Settings into a new Menu Page called "ManFisher Plugins" - Add: Grouped the Plugin Settings into a new Menu Page called "ManFisher Plugins"
- Update: Moved the Diagnostics Sections to into a new Sub Page called "Diagnostics"
- Add: Sub Page to list all other Plugins of the Contributors - Add: Sub Page to list all other Plugins of the Contributors
- Add: Hyperlink to manfisher.eu in the "other plugins" page
- Update: Refactored the whole source code
- Update: Moved the Diagnostics Sections to into a new Sub Page called "Diagnostics"
- Bugfix: Line up Footnotes with multiple lines in the Reference container - Bugfix: Line up Footnotes with multiple lines in the Reference container
- Bugfix: Load text domain
- Bugfix: Display the Footnotes button in the plain text editor of posts/pages
= 1.4.0 = = 1.4.0 =
- Feature: WPML Config XML file for easy multi language string translation (WPML String Translation Support File) - Feature: WPML Config XML file for easy multi language string translation (WPML String Translation Support File)

View file

@ -28,8 +28,7 @@
type: 'POST', type: 'POST',
url: '/wp-admin/admin-ajax.php', url: '/wp-admin/admin-ajax.php',
data: { data: {
action: 'footnotes_getTags', action: 'footnotes_getTags'
data: ''
}, },
success: function(data, textStatus, XMLHttpRequest){ success: function(data, textStatus, XMLHttpRequest){
var l_arr_Tags = JSON.parse(data); var l_arr_Tags = JSON.parse(data);