MDL-33041 cleanup moodlenolink plugin

AMOS BEGIN
  MOV [desc,tinymce_moodlenolink],[moodlenolink:desc,tinymce_moodlenolink]
AMOS END
This commit is contained in:
Petr Škoda
2012-08-11 15:58:50 +02:00
parent 1edb79824c
commit 383d67f80b
5 changed files with 14 additions and 18 deletions
@@ -17,11 +17,12 @@
/**
* Strings for 'no link' plugin.
*
* @package tinymce_moodlenolink
* @package tinymce_moodlenolink
* @copyright 2012 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['pluginname'] = 'Prevent automatic linking';
$string['desc'] = 'Prevent automatic linking';
/* All lang strings used from TinyMCE JavaScript code must be named 'pluginname:stringname', no need to create langs/en_dlg.js */
$string['moodlenolink:desc'] = 'Prevent automatic linking';
@@ -19,14 +19,13 @@ defined('MOODLE_INTERNAL') || die();
/**
* Plugin for Moodle 'no link' button.
*
* @package tinymce_moodlenolink
* @package tinymce_moodlenolink
* @copyright 2012 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tinymce_moodlenolink extends editor_tinymce_plugin {
protected function update_init_params(array &$params, context $context,
array $options = null) {
global $OUTPUT;
// Add button after 'unlink' in advancedbuttons3.
$this->add_button_after($params, 3, 'moodlenolink', 'unlink');
@@ -1,10 +1,9 @@
/**
* $Id: editor_plugin_src.js,v 1.2 2008/07/30 08:14:53 scyrma Exp $
* @author Mathieu Petit-Clair
*/
(function() {
// Load plugin specific language pack
tinymce.PluginManager.requireLangPack('moodlenolink');
// Do not load language pack in moodle plugins.
tinymce.create('tinymce.plugins.moodlenolinkPlugin', {
/**
@@ -16,8 +15,8 @@
* @param {string} url Absolute URL to where the plugin is located.
*/
init : function(ed, url) {
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mcemoodlenolink');
ed.addCommand('mcemoodlenolink', function() {
// Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceMoodleNolink');
ed.addCommand('mceMoodleNolink', function() {
var n, p;
n = ed.selection.getNode();
@@ -36,7 +35,7 @@
// Register moodlenolink button
ed.addButton('moodlenolink', {
title : 'moodlenolink.desc',
cmd : 'mcemoodlenolink',
cmd : 'mceMoodleNolink',
image : url + '/img/ed_nolink.gif'
});
@@ -73,6 +72,6 @@
}
});
// Register plugin
// Register plugin.
tinymce.PluginManager.add('moodlenolink', tinymce.plugins.moodlenolinkPlugin);
})();
@@ -1,3 +0,0 @@
tinyMCE.addI18n('en.moodlenolink',{
desc : 'Prevent automatic linking'
});
@@ -17,9 +17,9 @@
/**
* TinyMCE no-link marker plugin version details.
*
* @package tinymce_moodlenolink
* @package tinymce_moodlenolink
* @copyright 2012 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();