Files
ROC/src/kernel/form/cms_editor_ckeditor.e
Jocelyn Fiat b54fd85172 Added files module, with for now, a focus on upload files facility.
Contribution from Fabian Murer, as part of an ETH student project.
Supervised, refactorized and merged by Jocelyn Fiat.

Signed-off-by: Fabian Murer <fmurer@student.ethz.ch>
Signed-off-by: Jocelyn Fiat <git@djoce.net>
2016-02-17 12:03:24 +01:00

45 lines
1.2 KiB
Plaintext

note
description: "Summary description for {CMS_EDITOR_CKEDITOR}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
CMS_EDITOR_CKEDITOR
inherit
CMS_EDITOR
feature -- Initialisation
load_assets: STRING
-- <Precursor>
do
Result := "<script src=%"//cdn.ckeditor.com/4.4.7/standard/ckeditor.js%"></script>"
end
feature -- Javascript
javascript_replace_textarea (a_textarea: WSF_FORM_TEXTAREA): STRING
-- <Precursor>
do
-- Replaces the textarea with an editor instance.
-- Save the instance in a variable.
Result := "$(%"textarea[name="+ a_textarea.name +"]%").each(function() {"
Result.append (editor_variable (a_textarea) + " = CKEDITOR.replace(this);")
Result.append ("});")
end
javascript_restore_textarea (a_textarea: WSF_FORM_TEXTAREA): STRING
-- <Precursor>
do
-- Replaces the textarea with an editor instance.
-- Save the instance in a variable.
Result := "if (" + editor_variable (a_textarea) + " != undefined) " + editor_variable (a_textarea) + ".destroy();"
end
note
copyright: "2011-2016, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end