[svn r22157] Adding plugin glossary in fckeditor for working with terms of glossary tool - partial FS#4337

skala
Cristian Fasanando 17 years ago
parent 7efef213e0
commit 0e513d32ef
  1. 1
      main/inc/lib/fckeditor/editor/plugins/glossary/fck_glossary.js.php
  2. 56
      main/inc/lib/fckeditor/editor/plugins/glossary/fckplugin.js
  3. BIN
      main/inc/lib/fckeditor/editor/plugins/glossary/glossary.gif
  4. 7
      main/inc/lib/fckeditor/editor/plugins/glossary/lang/en.js
  5. 5
      main/inc/lib/fckeditor/editor/plugins/glossary/lang/es.js
  6. 8
      main/inc/lib/fckeditor/fckconfig.js
  7. 5
      main/inc/lib/fckeditor/fckstyles.xml
  8. 18
      main/inc/lib/fckeditor/fcktemplates.xml.php
  9. 3
      main/inc/lib/fckeditor/myconfig.php
  10. 22
      main/inc/lib/fckeditor/toolbars/documents.php

@ -0,0 +1,56 @@
// Register the command.
var FCKGlossary = function( name )
{
this.Name = name ;
this.StyleName = '_FCK_Glossary' ;
this.IsActive = false ;
this.EditMode = FCK.EditMode;
FCKStyles.AttachStyleStateChange( this.StyleName, this._OnStyleStateChange, this ) ;
}
FCKGlossary.prototype =
{
Execute : function()
{
FCKUndo.SaveUndoStep() ;
if ( this.IsActive ) {
FCKStyles.RemoveStyle(this.StyleName) ;
}
else {
FCKStyles.ApplyStyle( this.StyleName ) ;
}
FCK.Focus() ;
FCK.Events.FireEvent( 'OnSelectionChange' ) ;
},
GetState : function()
{
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
return FCK_TRISTATE_DISABLED ;
return this.IsActive ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF;
},
_OnStyleStateChange : function( styleName, isActive )
{
this.IsActive = isActive ;
}
};
FCKCommands.RegisterCommand( 'Glossary' , new FCKGlossary( 'Glossary' ) ) ;
/*FCKCommands.RegisterCommand( 'Glossary',
new FCKCoreStyleCommand( 'Italic' )
) ;*/
// Create and register the Audio toolbar button.
var oGlossaryItem = new FCKToolbarButton( 'Glossary', FCKLang['GlossaryTitle'], null, null, null, null, null );
oGlossaryItem.IconPath = FCKConfig.PluginsPath + 'glossary/glossary.gif' ;
FCKToolbarItems.RegisterItem( 'Glossary', oGlossaryItem ) ;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

@ -0,0 +1,7 @@
// Glossary.
// English language file.
// Please, use UTF-8 encoding.
FCKLang['GlossaryTitle'] = 'Glossary' ;

@ -0,0 +1,5 @@
// Glossary.
// Spanish language file.
// Please, use UTF-8 encoding.
FCKLang['GlossaryTitle'] = 'Glosario' ;

@ -229,6 +229,14 @@ FCKConfig.CoreStyles =
'h6' : { Element : 'h6' },
// Other formatting features.
'Glossary' :
{
Element : 'span',
Styles : { 'color' : '#00974A','cursor' : 'pointer','font-weight' : 'bold' },
Attributes : { 'class' : 'glossary' }
},
'FontFace' :
{
Element : 'span',

@ -55,6 +55,11 @@
<Style name="Italic" element="i">
<Override element="em" />
</Style>
<Style name="Glossary" element="span">
<Attribute name="class" value="glossary" />
</Style >
<Style name="Underline" element="u" />
<Style name="Strikethrough" element="strike" />
<Style name="Subscript" element="sub" />

@ -17,6 +17,14 @@ $IMConfig['base_url'] = $_configuration['root_web'].'main/img/gallery/';
// load a stylesheet
$css = loadCSS(api_get_setting('stylesheets'));
// load libreries js
$js = '';
if (api_get_setting('show_glossary_in_documents') != 'none') {
$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js"/>'.PHP_EOL;
$js .= '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/plugins/glossary/fck_glossary.js"/>';
}
// setting some paths
$img_dir = api_get_path(REL_CODE_PATH).'img/';
$default_course_dir = api_get_path(REL_CODE_PATH).'default_course_document/';
@ -87,7 +95,7 @@ function s2($var)
function load_platform_templates() {
// Database table definition
$table_template = Database::get_main_table('system_template');
global $css, $img_dir, $default_course_dir;
global $css, $img_dir, $default_course_dir,$js;
$sql = "SELECT title, image, comment, content FROM $table_template";
$result = api_sql_query($sql, __FILE__, __LINE__);
@ -97,7 +105,8 @@ function load_platform_templates() {
} else {
$image = api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/empty.gif';
}
$row['content'] = str_replace('{CSS}',$css, $row['content']);
$row['content'] = str_replace('{CSS}',$css.$js, $row['content']);
$row['content'] = str_replace('{IMG_DIR}',$img_dir, $row['content']);
$row['content'] = str_replace('{REL_PATH}', api_get_path(REL_PATH), $row['content']);
$row['content'] = str_replace('{COURSE_DIR}',$default_course_dir, $row['content']);
@ -176,7 +185,7 @@ function load_personal_templates($user_id=0) {
function load_empty_template()
{
global $css;
global $css,$js;
?>
<Template title="<?php echo s2('Empty'); ?>" image="<?php echo api_get_path(WEB_PATH).'home/default_platform_document/template_thumb/empty.gif'; ?>">
<Description></Description>
@ -184,7 +193,8 @@ function load_empty_template()
<![CDATA[
<html>
<head>
<?php echo $css ?>
<?php echo $css ?>
<?php echo $js ?>
<body></body>
</head>
</html>

@ -84,6 +84,9 @@ $config['LoadPlugin'][] = 'tablecommands';
// audio: Adds a dialog for inserting audio files (.mp3).
$config['LoadPlugin'][] = 'audio';
// glossary: this plugin add a term from glossary tool in dokeos
$config['LoadPlugin'][] = 'glossary';
// MP3 : This is the old plugin for inserting audio files. Probably this plugin will be removed at the next release.
// If you wish to use it, disable the "audio" plugin first.
//$config['LoadPlugin'][] = 'MP3';

@ -5,6 +5,8 @@
// For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
// This is the visible toolbar set when the editor has "normal" size.
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
$config['ToolbarSets']['Normal'] = array(
array('Save','FitWindow','PasteWord','-','Undo','Redo'),
array('Link','Unlink','Anchor'),
@ -14,8 +16,26 @@ $config['ToolbarSets']['Normal'] = array(
'/',
array('Style','FontFormat','FontName','FontSize'),
array('Bold','Italic','Underline'),
array('JustifyLeft','JustifyCenter','JustifyRight')
array('JustifyLeft','JustifyCenter','JustifyRight'),
array('Glossary')
);
} else {
$config['ToolbarSets']['Normal'] = array(
array('Save','FitWindow','PasteWord','-','Undo','Redo'),
array('Link','Unlink','Anchor'),
array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex'),
array('Table','SpecialChar'),
array('Outdent','Indent','-','TextColor','BGColor','-','OrderedList','UnorderedList','-','Source'),
'/',
array('Style','FontFormat','FontName','FontSize'),
array('Bold','Italic','Underline'),
array('JustifyLeft','JustifyCenter','JustifyRight')
);
}
// This is the visible toolbar set when the editor is maximized.
// If it has not been defined, then the toolbar set for the "normal" size is used.

Loading…
Cancel
Save