Skip to content

Commit

Permalink
Dev Putting in CKEditor - check out 'Edit text elements' to get a pre…
Browse files Browse the repository at this point in the history
…view

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ck@10108 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed May 20, 2011
1 parent cdc299a commit 6e2fab5
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 132 deletions.
18 changes: 13 additions & 5 deletions admin/htmleditor-functions.php
Expand Up @@ -20,13 +20,21 @@
function PrepareEditorScript()
{
global $clang,$imageurl,$homeurl;
global $sCKEditorURL, $js_admin_includes;

global $sCKEditorURL, $js_admin_includes, $defaulthtmleditormode;
$sHTMLEditorMode=$_SESSION['htmleditormode'];
if ($sHTMLEditorMode=='default') {
$sHTMLEditorMode=$defaulthtmleditormode;
}

$js_admin_includes[]=$sCKEditorURL.'/ckeditor.js';
$js_admin_includes[]=$sCKEditorURL.'/adapters/jquery.js';
$js_admin_includes[]='scripts/editor.js';

return '';
$sReturnScrip="<script type=\"text/javascript\">\n"
."sHTMLEditorMode='".$sHTMLEditorMode."';"
."</script>";

return $sReturnScrip;
}


Expand Down Expand Up @@ -144,7 +152,7 @@ function getInlineEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=n
$fieldtype == 'email-rem' )
{
$htmlformatoption = "$oFCKeditorVarName.Config[\"FullPage\"]=true;\n"
. "$oFCKeditorVarName.Height = \"500\"\n";
. "$oFCKeditorVarName.Height = \"500\"\n";
}


Expand All @@ -171,7 +179,7 @@ function getInlineEditor($fieldtype,$fieldname,$fieldtext, $surveyID=null,$gID=n

$htmlcode .= ""
. "$oFCKeditorVarName.ToolbarSet = '".$toolbarname."';\n";

if ( $fieldtype == 'email-inv' ||
$fieldtype == 'email-reg' ||
$fieldtype == 'email-conf'||
Expand Down
57 changes: 57 additions & 0 deletions admin/scripts/ckeditor.36/limesurvey-config.js
@@ -0,0 +1,57 @@
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.skin = 'office2003';
config.toolbarCanCollapse = false;

config.toolbar_popup =
[
['Maximize'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat','Source'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
[ 'ShowBlocks','Templates']
];

config.toolbar_inline =
[
['Maximize'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat','Source'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
[ 'ShowBlocks','Templates']
];


/* for a later time when CKEditor can change the toolbar on maximize
config.toolbar_inline =
[
['Maximize'],
['Bold','Italic','Underline'],
['NumberedList','BulletedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Link','Unlink','Image'],
['Source']
];*/
};
4 changes: 3 additions & 1 deletion admin/scripts/editor.js
@@ -1,5 +1,7 @@
// $Id: labels.js 8649 2010-04-28 21:38:53Z c_schmitz $

$(document).ready(function(){
$('textarea.fulledit').ckeditor();

$('textarea.fulledit').ckeditor(function() { /* callback code */ }, { toolbar : sHTMLEditorMode,
customConfig : 'limesurvey-config.js' });
});

0 comments on commit 6e2fab5

Please sign in to comment.