Skip to content

Commit

Permalink
Issue #6: Invoking CKEditor the same way Sendy does
Browse files Browse the repository at this point in the history
I copied/pasted the `<script>` calls from within Sendy's create.php
file into all the pages that use the editor. I also removed the
javascript that toggled HTML, since CKEditor can take care of that
for us.
  • Loading branch information
ElliotFriend committed Oct 23, 2014
1 parent 4d32266 commit 921b837
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 39 deletions.
33 changes: 3 additions & 30 deletions template/create-template.php
@@ -1,3 +1,6 @@
<script src="<?php echo get_app_info('path');?>/js/ckeditor/ckeditor.js?7"></script>
<script src="<?php echo get_app_info('path');?>/js/create/editor.js?7"></script>

<div class="row-fluid">
<h2>Create Templates</h2><br/>
<form action="<?php echo get_app_info('path')?>/template/save-template.php?i=<?php echo get_app_info('app')?>" method="POST" accept-charset="utf-8" class="form-vertical" id="create-template" enctype="multipart/form-data">
Expand All @@ -15,36 +18,6 @@
</div>
<div class="span9">
<p>
<label class="control-label" for="html"><?php echo _('HTML code');?></label>
<div class="btn-group">
<span class="wysiwyg-note">The HTML may look odd in this editor, open it in the campaign to see how it actually looks.</span>
<script type="text/javascript">
$("#toggle-wysiwyg").click(function(e){
e.preventDefault();

$('<input>').attr({
type: 'hidden',
id: 'wysiwyg',
name: 'wysiwyg',
value: '0',
}).appendTo("#edit-form");

$('<input>').attr({
type: 'hidden',
id: 'w_clicked',
name: 'w_clicked',
value: '1',
}).appendTo("#edit-form");

$("#subject").rules("remove");
$("#html").rules("remove");
if($("#subject").val()=="") $("#subject").val("Untitled");

$("#edit-form").submit();
});
</script>
</div>
<br/>
<div class="control-group">
<div class="controls">
<textarea class="input-xlarge" id="html" name="html" rows="10" placeholder="Email content"></textarea>
Expand Down
2 changes: 0 additions & 2 deletions template/edit-template.php
Expand Up @@ -35,8 +35,6 @@
</div>
<div class="span9">
<p>
<label class="control-label" for="html"><?php echo _('HTML code');?></label>
<br/>
<div class="control-group">
<div class="controls">
<textarea class="input-xlarge" id="html" name="html" rows="10" placeholder="Email content"><?php echo $tbody; ?></textarea>
Expand Down
9 changes: 2 additions & 7 deletions template_create.php
Expand Up @@ -24,13 +24,8 @@
}
?>

<script src="<?php echo get_app_info('path');?>/js/redactor/redactor.min.js?5"></script>
<script src="<?php echo get_app_info('path');?>/js/redactor/fontcolor.js?5"></script>
<script src="<?php echo get_app_info('path');?>/js/redactor/fontsize.js?5"></script>
<script src="<?php echo get_app_info('path');?>/js/redactor/fontfamily.js?5"></script>
<script src="<?php echo get_app_info('path');?>/js/redactor/personalizationtags.js?5"></script>
<link rel="stylesheet" href="<?php echo get_app_info('path');?>/js/redactor/redactor.css?5" />
<script src="<?php echo get_app_info('path');?>/js/create/editor.js?2"></script>
<script src="<?php echo get_app_info('path');?>/js/ckeditor/ckeditor.js?7"></script>
<script src="<?php echo get_app_info('path');?>/js/create/editor.js?7"></script>

<!-- Validation -->
<script type="text/javascript" src="<?php echo get_app_info('path');?>/js/validate.js"></script>
Expand Down

0 comments on commit 921b837

Please sign in to comment.