- Update: Refactored the whole source code

- 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
- Bugfix: Line up Footnotes with multiple lines in the Reference container

git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@989695 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
Aricura 2014-09-14 20:32:59 +00:00
parent 1f5e0ed500
commit 0c01b80173
50 changed files with 3070 additions and 2107 deletions

View file

@ -1,8 +0,0 @@
<div class="footnote_plugin_container">
<div class="footnote_plugin_index">[[FOOTNOTE INDEX]].</div>
<div class="footnote_plugin_text">
<a class="footnote_plugin_link" href="#footnote_plugin_tooltip_[[FOOTNOTE INDEX SHORT]]"
name="footnote_plugin_reference_[[FOOTNOTE INDEX SHORT]]"
id="footnote_plugin_reference_[[FOOTNOTE INDEX SHORT]]">[[HYPERLINK SYMBOL]]</a>&nbsp;[[FOOTNOTE TEXT]]</div>
<div class="footnote_plugin_end"></div>
</div>

View file

@ -0,0 +1,31 @@
<table class="widefat fixed">
<tbody>
<tr>
<td>[[label-css]]</td>
<td>[[css]]</td>
</tr>
<tr>
<td colspan="2">[[headline]]</td>
</tr>
<tr>
<td>[[label-class-1]]</td>
<td>[[class-1]]</td>
</tr>
<tr>
<td>[[label-class-2]]</td>
<td>[[class-2]]</td>
</tr>
<tr>
<td>[[label-class-3]]</td>
<td>[[class-3]]</td>
</tr>
<tr>
<td>[[label-class-4]]</td>
<td>[[class-4]]</td>
</tr>
<tr>
<td>[[label-class-5]]</td>
<td>[[class-1]]</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,12 @@
<table class="widefat fixed">
<tbody>
<tr>
<td>[[label-symbol]]</td>
<td>[[symbol]]</td>
</tr>
<tr>
<td>[[label-user-defined]]</td>
<td>[[user-defined]]<br/><i>[[comment]]</i></td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,12 @@
<table class="widefat fixed">
<tbody>
<tr>
<td>[[label-before]]</td>
<td>[[before]]</td>
</tr>
<tr>
<td>[[label-after]]</td>
<td>[[after]]</td>
</tr>
</tbody>
</table>

View file

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

View file

@ -0,0 +1,42 @@
<script type="text/javascript">
/**
* adds a tag in at the beginning and at the end of a selected text in the specific text area
* @param string elementID
* @param string openTag
* @param string closeTag
*/
function MCI_Footnotes_wrapText(elementID, openTag, closeTag) {
var textArea = jQuery('#' + elementID);
var len = textArea.val().length;
var start = textArea[0].selectionStart;
var end = textArea[0].selectionEnd;
var selectedText = textArea.val().substring(start, end);
var replacement = openTag + selectedText + closeTag;
textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len));
}
/**
* adds a new button to the plain text editor
*/
QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnotes', MCI_Footnotes_text_editor_callback );
/**
* callback function when the button is clicked
* executes a ajax call to get the start and end tag for the footnotes and
* adds them in before and after the selected text
*/
function MCI_Footnotes_text_editor_callback() {
jQuery.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: {
action: 'footnotes_getTags',
data: ''
},
success: function(data, textStatus, XMLHttpRequest){
var l_arr_Tags = JSON.parse(data);
MCI_Footnotes_wrapText("content", l_arr_Tags['start'], l_arr_Tags['end']);
},
error: function(MLHttpRequest, textStatus, errorThrown){
}
});
}
</script>

View file

@ -0,0 +1,2 @@
<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');" />

View file

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

View file

@ -0,0 +1,42 @@
<div class="plugin-card">
<div class="plugin-card-top">
<div>
<h4><a href="" target="_blank" class="thickbox" id="[[name]]-url">[[title]]</a></h4>
</div>
<div class="action-links">
<ul class="plugin-action-buttons">
<li><a class="install-now button" href="" id="[[name]]-website">Website</a></li>
</ul>
</div>
<div>
<p id="[[name]]-description"></p>
</div>
</div>
<div class="plugin-card-bottom">
<div class="column-updated"><p id="[[name]]-version"></p></div>
</div>
</div>
<script type="text/javascript">
jQuery.ajax({
type: 'POST',
url: '/wp-admin/admin-ajax.php',
data: {
action: 'footnotes_getPluginInfo',
plugin: '[[name]]'
},
dataType: 'json',
success: function (data, textStatus, XMLHttpRequest) {
if (data.error) {
alert(data.error);
} else {
jQuery("#[[name]]-url").attr("href", data.PluginUrl);
jQuery("#[[name]]-website").attr("href", data.PluginUrl);
jQuery("#[[name]]-description").text(data.PluginDescription);
jQuery("#[[name]]-version").text("Version: " + data.PluginVersion);
}
},
error: function (MLHttpRequest, textStatus, errorThrown) {
console.log(textStatus);
}
});
</script>

View file

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

View file

@ -0,0 +1,8 @@
<table class="widefat fixed">
<tbody>
<tr>
<td>[[label-excerpt]]</td>
<td>[[excerpt]]</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,16 @@
<table class="widefat fixed">
<tbody>
<tr>
<td>[[label-name]]</td>
<td>[[name]]</td>
</tr>
<tr>
<td>[[label-collapse]]</td>
<td>[[collapse]]</td>
</tr>
<tr>
<td>[[label-position]]</td>
<td>[[position]]</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,56 @@
<table class="widefat fixed">
<tbody>
<tr>
<td>[[label-identical]]</td>
<td>[[identical]]</td>
</tr>
<tr>
<td>[[label-short-code-start]]</td>
<td>[[short-code-start]]</td>
</tr>
<tr>
<td>[[label-short-code-end]]</td>
<td>[[short-code-end]]</td>
</tr>
<tr>
<td>[[label-short-code-start-user]]</td>
<td>[[short-code-start-user]]</td>
</tr>
<tr>
<td>[[label-short-code-end-user]]</td>
<td>[[short-code-end-user]]</td>
</tr>
<tr>
<td>[[label-counter-style]]</td>
<td>[[counter-style]]</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
var l_obj_ShortCodeStart = jQuery("#[[short-code-start-id]]");
var l_obj_ShortCodeEnd = jQuery("#[[short-code-end-id]]");
var l_obj_ShortCodeStartUserDefined = jQuery("#[[short-code-start-user-id]]");
var l_obj_ShortCodeEndUserDefined = jQuery("#[[short-code-end-user-id]]");
function footnotes_Display_UserDefined_Placeholders() {
if (l_obj_ShortCodeStart.val() == "userdefined") {
l_obj_ShortCodeStartUserDefined.parent().parent().show();
l_obj_ShortCodeEndUserDefined.parent().parent().show();
} else {
l_obj_ShortCodeStartUserDefined.parent().parent().hide();
l_obj_ShortCodeEndUserDefined.parent().parent().hide();
}
}
footnotes_Display_UserDefined_Placeholders();
l_obj_ShortCodeStart.on('change', function() {
var l_int_SelectedIndex = jQuery(this).prop("selectedIndex");
jQuery('#[[short-code-end-id]] option:eq(' + l_int_SelectedIndex + ')').prop('selected', true);
footnotes_Display_UserDefined_Placeholders();
});
l_obj_ShortCodeEnd.on('change', function() {
var l_int_SelectedIndex = jQuery(this).prop("selectedIndex");
jQuery('#[[short-code-start-id]] option:eq(' + l_int_SelectedIndex + ')').prop('selected', true);
footnotes_Display_UserDefined_Placeholders();
});
</script>

View file

@ -1,22 +0,0 @@
<a href="#footnote_plugin_reference_[[FOOTNOTE INDEX]]"
name="footnote_plugin_tooltip_[[FOOTNOTE INDEX]]"
id="footnote_plugin_tooltip_[[FOOTNOTE INDEX]]"
class="footnote_plugin_tooltip_text"
onclick="footnote_expand_reference_container('#footnote_plugin_reference_[[FOOTNOTE INDEX]]');"><sup>[[FOOTNOTE BEFORE]][[FOOTNOTE INDEX]][[FOOTNOTE AFTER]]</sup>
</a>
<span class="footnote_tooltip" id="footnote_plugin_tooltip_text_[[FOOTNOTE INDEX]]">
[[FOOTNOTE TEXT]]
</span>
<script type="text/javascript">
jQuery("#footnote_plugin_tooltip_[[FOOTNOTE INDEX]]").tooltip({
tip: "#footnote_plugin_tooltip_text_[[FOOTNOTE INDEX]]",
tipClass: "footnote_tooltip",
effect: "fade",
fadeOutSpeed: 100,
predelay: 400,
position: "top right",
relative: true,
offset: [10, 10]
});
</script>

14
templates/public/footnote.html Executable file
View file

@ -0,0 +1,14 @@
<a href="#footnote_plugin_reference_[[index]]" name="footnote_plugin_tooltip_[[index]]" id="footnote_plugin_tooltip_[[index]]" class="footnote_plugin_tooltip_text" onclick="footnote_expand_reference_container();"><sup>[[before]][[index]][[after]]</sup></a>
<span class="footnote_tooltip" id="footnote_plugin_tooltip_text_[[index]]">[[text]]</span>
<script type="text/javascript">
jQuery("#footnote_plugin_tooltip_[[index]]").tooltip({
tip: "#footnote_plugin_tooltip_text_[[index]]",
tipClass: "footnote_tooltip",
effect: "fade",
fadeOutSpeed: 100,
predelay: 400,
position: "top right",
relative: true,
offset: [10, 10]
});
</script>

View file

@ -0,0 +1,7 @@
<tr>
<td>[[index]].</td>
<td><a class="footnote_plugin_link" href="#footnote_plugin_tooltip_[[index-int]]"
name="footnote_plugin_reference_[[index-int]]"
id="footnote_plugin_reference_[[index-int]]">[[arrow]]</a></td>
<td>[[text]]</td>
</tr>

View file

@ -0,0 +1,26 @@
<div class="footnote_container_prepare">
<p><span onclick="footnote_expand_reference_container();">[[label]]</span><span>[[buttons]]</span></p>
</div>
<div id="[[id]]" class="[[class]]">
<table class="footnote-reference-container">
<tbody>
[[content]]
</tbody>
</table>
</div>
<script type="text/javascript">
function footnote_expand_reference_container() {
jQuery("#[[id]]").show();
}
function footnote_expand_collapse_reference_container() {
var l_obj_ReferenceContainer = jQuery("#[[id]]");
if (l_obj_ReferenceContainer.is(":hidden")) {
l_obj_ReferenceContainer.show();
jQuery("#footnote_reference_container_collapse_button").text("-");
} else {
l_obj_ReferenceContainer.hide();
jQuery("#footnote_reference_container_collapse_button").text("+");
}
}
</script>