Initial commit
This commit is contained in:
commit
28e6ddf404
1083 changed files with 191734 additions and 0 deletions
8
plugins/wysiwyg-inline-code-command/devnotes.txt
Normal file
8
plugins/wysiwyg-inline-code-command/devnotes.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
== Making Releases ==
|
||||
|
||||
1. readme.txt: update "Tested up to", "Stable tag", Changelog.
|
||||
2. If you feel like it, validate the readme at http://wordpress.org/extend/plugins/about/validator/
|
||||
3. wysiwyg-inline-code-command.php: update Version
|
||||
4. Note: WordPress SVN password is unusual; see email archives
|
||||
5. Commit changes
|
||||
6. `svn cp . http://plugins.svn.wordpress.org/wysiwyg-inline-code-command/tags/X.Y`
|
85
plugins/wysiwyg-inline-code-command/readme.txt
Normal file
85
plugins/wysiwyg-inline-code-command/readme.txt
Normal file
|
@ -0,0 +1,85 @@
|
|||
=== WYSIWYG Inline Code Command ===
|
||||
Contributors: pkgw
|
||||
Tags: editor, wysiwyg, code, plugin, visual, inline code, code tag, code button, tinymce, custom button, button
|
||||
Requires at least: 3.0
|
||||
Tested up to: 4.1
|
||||
Stable tag: trunk
|
||||
License: GPLv2
|
||||
|
||||
Adds a button and keybinding to the WYSIWYG (visual) editor to mark
|
||||
text as inline code.
|
||||
|
||||
== Description ==
|
||||
|
||||
The WYSIWYG Inline Code Command plugin adds an "inline code" command to the
|
||||
WYSIWYG (visual) post and page editor. It's just like the "Bold" or "Italics"
|
||||
commands, except that it makes your text look like code -- usually, this means
|
||||
that it's drawn in a monospace font `like this`. The comand is accessible as a
|
||||
button and with the keybinding `Alt-Shift-C`.
|
||||
|
||||
The unmodified editor does provide a `pre` style that's somewhat similar, but
|
||||
it's a *block* style, which means that you can only apply it to whole
|
||||
paragraphs. I wrote this plugin because I found that I often want to apply
|
||||
code styling to shorter pieces of computer-y content, such as the
|
||||
`Alt-Shift-C` above.
|
||||
|
||||
I encourage you to provide feedback about this plugin. Entries on the
|
||||
compatibility matrix are especially helpful so that people can feel confident
|
||||
installing it. Thanks!
|
||||
|
||||
The WYSIWIG Inline Code Command plugin provides precisely this one feature, so
|
||||
don't expect it to be updated very often. One issue that I'm aware but don't
|
||||
know quite how to fix is that the user-visible text describing the command in
|
||||
the editor isn't internationalized.
|
||||
|
||||
== Installation ==
|
||||
|
||||
Installation is as simple as possible:
|
||||
|
||||
1. Upload the plugin files to the `wysiwyg-inline-code-command` directory
|
||||
in your `/wp-content/plugins/` directory.
|
||||
1. Activate the plugin through the 'Plugins' menu in WordPress.
|
||||
1. Edit a post or a page. Select some text, and either hit the new button
|
||||
that looks like "</>", or press `Alt-Shift-C`.
|
||||
1. That's all there is to it!
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
I haven't made any screenshots yet. Let me know if you'd like to see one.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 2.0 =
|
||||
* Released on October 29, 2013.
|
||||
* No code changes; just mark "trunk" as stable so I don't have to keep on
|
||||
tagging new versions to update the compatibility info.
|
||||
|
||||
= 1.6 =
|
||||
* Released on August 10, 2013.
|
||||
* No code changes; just update the readme about compatibility.
|
||||
|
||||
= 1.5 =
|
||||
* Released on December 11, 2012.
|
||||
* No code changes; just update the readme about compatibility.
|
||||
|
||||
= 1.4 =
|
||||
* Released on June 19, 2012.
|
||||
* Mark that the license is GPLv2.
|
||||
* No code changes; just update the readme about compatibility.
|
||||
|
||||
= 1.3 =
|
||||
* Released on December 18, 2011.
|
||||
* Add some tags suggested by WordPress.org user jsherk.
|
||||
* Update compatibility info after testing with WordPress 3.3.
|
||||
|
||||
= 1.2 =
|
||||
* Released on August 29, 2011.
|
||||
* No code changes; just update the readme about compatibility.
|
||||
|
||||
= 1.1 =
|
||||
* Released on July 15, 2011.
|
||||
* No code changes; just update the readme to be more helpful.
|
||||
|
||||
= 1.0 =
|
||||
* Released on June 29, 2011.
|
||||
* This is the initial release.
|
BIN
plugins/wysiwyg-inline-code-command/wicc-button.png
Normal file
BIN
plugins/wysiwyg-inline-code-command/wicc-button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 282 B |
52
plugins/wysiwyg-inline-code-command/wicc-mce-plugin.php
Normal file
52
plugins/wysiwyg-inline-code-command/wicc-mce-plugin.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/*
|
||||
Copyright 2011, 2012 Peter Williams (email: peter@newton.cx)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
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
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
header('Content-type: application/x-javascript');
|
||||
/* Start wicc-mce-plugin.js */
|
||||
?>
|
||||
(function () {
|
||||
tinymce.create('tinymce.plugins.WICCPlugin', {
|
||||
init: function(ed, url) {
|
||||
ed.addCommand('mceWICC', function() {
|
||||
ed.formatter.toggle ('inlinecode');
|
||||
});
|
||||
|
||||
ed.addButton('wicc', {title: 'Inline Code (Alt-Shift-C)',
|
||||
cmd: 'mceWICC',
|
||||
image: url + '/wicc-button.png'});
|
||||
|
||||
ed.addShortcut ('alt+shift+c', 'Inline Code', 'mceWICC');
|
||||
|
||||
ed.onInit.add (function () {
|
||||
ed.formatter.register ('inlinecode', {inline: 'code', remove: 'all'});
|
||||
});
|
||||
},
|
||||
|
||||
getInfo: function() {
|
||||
return {
|
||||
longname : 'WYSIWYG Inline Code Command',
|
||||
author : 'Peter Williams',
|
||||
authorurl : 'http://newton.cx/~peter/',
|
||||
infourl : 'http://wordpress.org/extend/plugins/wysiwyg-inline-code-command/',
|
||||
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tinymce.PluginManager.add('wicc', tinymce.plugins.WICCPlugin);
|
||||
})();
|
||||
<?php /* End wicc-mce-plugin.js */ ?>
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: WYSIWYG Inline Code Command
|
||||
Plugin URI: http://wordpress.org/extend/plugins/wysiwyg-inline-code-command/
|
||||
Description: Add a command to the visual editor to mark text as inline code
|
||||
Version: 2.0
|
||||
Author: Peter Williams
|
||||
Author URI: http://newton.cx/~peter/
|
||||
License: GPL2
|
||||
|
||||
Copyright 2011, 2012, 2013 Peter Williams (email: peter@newton.cx)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
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
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
function wicc_tinymce_activate() {
|
||||
global $pagenow;
|
||||
|
||||
if (!current_user_can ('edit_posts') && !current_user_can ('edit_pages'))
|
||||
return;
|
||||
|
||||
if (get_user_option('rich_editing') != 'true')
|
||||
return;
|
||||
|
||||
if (in_array ($pagenow, array('post.php', 'post-new.php', 'page.php', 'page-new.php'))) {
|
||||
add_filter ('mce_external_plugins', 'wicc_tinymce_addplugin' );
|
||||
add_filter ('mce_buttons', 'wicc_tinymce_registerbutton' );
|
||||
}
|
||||
}
|
||||
|
||||
function wicc_tinymce_addplugin ($plugin_array) {
|
||||
$plugin_array['wicc'] = plugins_url ('wicc-mce-plugin.php', __FILE__);
|
||||
return $plugin_array;
|
||||
}
|
||||
|
||||
function wicc_tinymce_registerbutton ($buttons) {
|
||||
array_push ($buttons, 'separator', 'wicc');
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
add_action ('init', 'wicc_tinymce_activate');
|
||||
?>
|
Reference in a new issue