summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorChristian Fowler <cfowler@einstein>2015-01-30 20:04:39 -0500
committerChristian Fowler <cfowler@einstein>2015-01-30 20:04:39 -0500
commit97d8e1fb5d5824be8fb9bfcdbecfa43d630855a2 (patch)
tree52ff8da1d04b1017413bbdeeb54a618afe3fd928 /templates
parent2300d776ebefbcf3f2962239b1fae317d31b6a4a (diff)
downloadckeditor-97d8e1fb5d5824be8fb9bfcdbecfa43d630855a2.tar.gz
ckeditor-97d8e1fb5d5824be8fb9bfcdbecfa43d630855a2.tar.bz2
ckeditor-97d8e1fb5d5824be8fb9bfcdbecfa43d630855a2.zip
overhaul to get working with bitweaver4; works with edit_format selector
Diffstat (limited to 'templates')
-rw-r--r--templates/footer_inc.tpl152
1 files changed, 87 insertions, 65 deletions
diff --git a/templates/footer_inc.tpl b/templates/footer_inc.tpl
index 7562bd2..abfa459 100644
--- a/templates/footer_inc.tpl
+++ b/templates/footer_inc.tpl
@@ -1,66 +1,88 @@
-{strip}
-{if $wysiwygEdit == 'true'}
- <script>
- CKEDITOR.replace( '{$smarty.const.LIBERTY_TEXT_AREA}', {
- toolbarGroups: [
- {if $gBitSystem->getConfig('ckedit_toolbars') eq 'Full'}
- { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
- { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
- { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
- { name: 'forms' },
- { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
- { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
- { name: 'links' },
- { name: 'insert' },
- { name: 'styles' },
- { name: 'colors' },
- { name: 'tools' },
- { name: 'others' },
- { name: 'about' }
- {elseif $gBitSystem->getConfig('ckedit_toolbars') eq 'Advanced'}
- { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
- { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
- { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
- { name: 'forms' },
- '/',
- { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
- { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
- '/',
- { name: 'links' },
- { name: 'insert' },
- '/',
- { name: 'styles' },
- { name: 'colors' },
- { name: 'tools' },
- { name: 'others' },
- { name: 'about' }
- {elseif $gBitSystem->getConfig('ckedit_toolbars') eq 'Intermediate'}
- { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
- { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
- { name: 'forms' },
- '/',
- { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
- '/',
- { name: 'links' },
- { name: 'insert' },
- '/',
- { name: 'styles' },
- { name: 'colors' },
- { name: 'tools' },
- { name: 'others' },
- { name: 'about' }
- {else}
- { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
- { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
- { name: 'links' }
- {/if}
- ]
- });
- </script>
+{if $gBitSystem->isPackageActive('ckeditor')}
+
+<script type="text/javascript">
+{literal}
+function createCkEditor( pTextAreaId ) {
+ if( !CKEDITOR.instances[pTextAreaId] ){
+ $('#'+pTextAreaId).attr("contenteditable", true);
+ //var config = {};
+ //editor = CKEDITOR.appendTo( pTextAreaId, config, $('#'+pTextAreaId).html() );
+ CKEDITOR.replace( '{/literal}{$smarty.const.LIBERTY_TEXT_AREA}{literal}' );
+ }
+}
+
+function destroyCkEditor( pTextAreaId ) {
+ $('#'+pTextAreaId).attr("contenteditable", true);
+ if( CKEDITOR.instances[pTextAreaId] ){
+ CKEDITOR.instances[pTextAreaId].destroy();
+
+ // Retrieve the editor contents. In an Ajax application, this data would be
+ // sent to the server or used in any other way.
+ $('#'+pTextAreaId).innerHTML = html = CKEDITOR.instances[pTextAreaId].getData();
+
+ // Destroy the editor.
+ CKEDITOR.instances[pTextAreaId].destroy();
+ CKEDITOR.instances[pTextAreaId] = null;
+ }
+}
+
+$(document).ready(function() {
+ CKEDITOR.config.toolbarGroups = [
+ {/literal}{if $gBitSystem->getConfig('ckedit_toolbars') eq 'Full'}{literal}
+ { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
+ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
+ { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
+ { name: 'forms' },
+ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
+ { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
+ { name: 'links' },
+ { name: 'insert' },
+ { name: 'styles' },
+ { name: 'colors' },
+ { name: 'tools' },
+ { name: 'others' },
+ { name: 'about' }
+ {/literal}{elseif $gBitSystem->getConfig('ckedit_toolbars') eq 'Advanced'}{literal}
+ { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
+ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
+ { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
+ { name: 'forms' },
+ '/',
+ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
+ { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
+ '/',
+ { name: 'links' },
+ { name: 'insert' },
+ '/',
+ { name: 'styles' },
+ { name: 'colors' },
+ { name: 'tools' },
+ { name: 'others' },
+ { name: 'about' }
+ {/literal}{elseif $gBitSystem->getConfig('ckedit_toolbars') eq 'Intermediate'}{literal}
+ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
+ { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
+ { name: 'forms' },
+ '/',
+ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
+ '/',
+ { name: 'links' },
+ { name: 'insert' },
+ '/',
+ { name: 'styles' },
+ { name: 'colors' },
+ { name: 'tools' },
+ { name: 'others' },
+ { name: 'about' }
+ {/literal}{else}{literal}
+ { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
+ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
+ { name: 'links' }
+ {/literal}{/if}{literal}
+];
+});
+{/literal}
+</script>
+{/if}
+
- {* if ($gBitSystem->isFeatureActive("ckeditor_ask") ||
- $gBitSystem->isFeatureActive("ckeditor_on_click"))}
- {formhelp note="Click in the textarea to activate the editor."}
- {/if *}
- {/if}
-{/strip}