Commit cac2b421 authored by sun's avatar sun

#323855 by Rob Loach, sun: Added jWYSIWYG support.

parent 81a2754f
tinymce*
fckeditor*
\ No newline at end of file
fckeditor*
jwysiwyg*
\ No newline at end of file
......@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
Wysiwyg 6.x-x.x, xxxx-xx-xx
---------------------------
#323855 by Rob Loach, sun: Added jWYSIWYG support.
#327100 by sun: Associate editors/profiles with input formats. Major milestone.
#325980 by markus_petrux: Added Spanish/Catalan translation for Break plugin.
#323795 by sun: Removed obsolete Wysiwyg Editor module files.
......
// $Id$
/**
* Attach this editor to a target element.
*/
Drupal.wysiwyg.editor.attach.jwysiwyg = function(context, params, editorSettings) {
// Attach editor control if default is on.
if (Drupal.settings.wysiwyg.status) {
$('#' + params.field).wysiwyg();
}
};
/**
* Detach a single or all editors.
*/
Drupal.wysiwyg.editor.detach.jwysiwyg = function(context, params) {
var $field = $('#' + params.field);
var editor = $field.data('wysiwyg');
if (typeof editor != 'undefined') {
editor.saveContent();
editor.element.remove();
}
$field.removeData('wysiwyg');
$field.show();
};
<?php
// $Id$
/**
* Plugin implementation of hook_editor().
*/
function wysiwyg_jwysiwyg_editor() {
$editor = array();
$editor['jwysiwyg'] = array(
// Required properties
'title' => 'jWYSIWYG',
'vendor url' => 'http://code.google.com/p/jwysiwyg/',
'download url' => 'http://code.google.com/p/jwysiwyg/downloads/list',
'library path' => wysiwyg_get_path('jwysiwyg'),
'libraries' => array(
'' => array(
'title' => 'Source',
'files' => array('jquery.wysiwyg.js'),
),
'pack' => array(
'title' => 'Packed',
'files' => array('jquery.wysiwyg.pack.js'),
),
),
'version callback' => 'wysiwyg_jwysiwyg_version',
'css path' => wysiwyg_get_path('jwysiwyg'),
'versions' => array(
'0.4' => array(
'js files' => array('jwysiwyg.js'),
'css files' => array('jquery.wysiwyg.css'),
),
),
);
return $editor;
}
/**
* Detect editor version.
*
* @param $editor
* An array containing editor properties as returned from hook_editor().
*
* @return
* The installed editor version.
*/
function wysiwyg_jwysiwyg_version($editor) {
$script = wysiwyg_get_path('jwysiwyg') . '/jquery.wysiwyg.js';
$script = fopen($script, 'r');
fgets($script);
$line = fgets($script);
if (preg_match('@([0-9\.]+)$@', $line, $version)) {
fclose($script);
return $version[1];
}
}
......@@ -564,7 +564,7 @@ function wysiwyg_get_all_editors() {
}
}
if (!$version) {
$editors[$editor]['error'] = t('The installed version of %editor is not supported.', array('%editor' => $properties['title']));
$editors[$editor]['error'] = t('The installed version %version of %editor is not supported.', array('%version' => $editors[$editor]['installed version'], '%editor' => $properties['title']));
$editors[$editor]['installed'] = FALSE;
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment