From e3dd6cc8e894bb1ed140beec5bca5caace09591e Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 30 Mar 2017 14:44:54 +0200 Subject: [PATCH 1/3] Committed missing change for the cms formats administration. --- examples/demo/roc.cfg | 2 +- .../format/cms_admin_formats_handler.e | 462 ++++++++++++++++++ .../content/format/cms_content_filters.e | 66 +++ 3 files changed, 529 insertions(+), 1 deletion(-) create mode 100644 modules/admin/handler/format/cms_admin_formats_handler.e create mode 100644 src/kernel/content/format/cms_content_filters.e diff --git a/examples/demo/roc.cfg b/examples/demo/roc.cfg index 47ebe37..f44a5c3 100644 --- a/examples/demo/roc.cfg +++ b/examples/demo/roc.cfg @@ -22,7 +22,7 @@ "taxonomy": { "location": "../../modules/taxonomy" }, "files": { "location": "../../modules/files" }, "custom_block": { "location": "../../modules/custom_block" }, - "embedded_video": { "location": "../../modules/embedded_video" }, + "embedded_video": { "location": "../../modules/embedded_video" }, "wikitext": { "location": "../../modules/wikitext" }, "messaging": { "location": "../../modules/messaging" }, "comments": { "location": "../../modules/comments" } diff --git a/modules/admin/handler/format/cms_admin_formats_handler.e b/modules/admin/handler/format/cms_admin_formats_handler.e new file mode 100644 index 0000000..1f4c5e9 --- /dev/null +++ b/modules/admin/handler/format/cms_admin_formats_handler.e @@ -0,0 +1,462 @@ +note + description: "Summary description for {CMS_ADMIN_FORMATS_HANDLER}." + date: "$Date$" + revision: "$Revision$" + +class + CMS_ADMIN_FORMATS_HANDLER + +inherit + CMS_HANDLER + + CMS_API_ACCESS + + WSF_URI_HANDLER + rename + execute as uri_execute, + new_mapping as new_uri_mapping + end + + WSF_URI_TEMPLATE_HANDLER + rename + execute as uri_template_execute, + new_mapping as new_uri_template_mapping + select + new_uri_template_mapping + end + + WSF_RESOURCE_HANDLER_HELPER + redefine + do_get, + do_post + end + + REFACTORING_HELPER + +create + make + +feature -- execute + + execute (req: WSF_REQUEST; res: WSF_RESPONSE) + -- Execute request handler + do + execute_methods (req, res) + end + + uri_execute (req: WSF_REQUEST; res: WSF_RESPONSE) + -- Execute request handler + do + execute (req, res) + end + + uri_template_execute (req: WSF_REQUEST; res: WSF_RESPONSE) + -- Execute request handler + do + execute (req, res) + end + +feature -- HTTP Methods + + do_get (req: WSF_REQUEST; res: WSF_RESPONSE) + do + if attached {WSF_STRING} req.path_parameter ("format-id") as p_format_id then + -- "/formats/-/add" is used to create a new format! + if + api.has_permission ("admin formats") and then + p_format_id.same_string ("-") and then + req.percent_encoded_path_info.ends_with_general ("/add") + then + do_get_format (Void, req, res) -- New format form! + else + do_get_format (p_format_id.value, req, res) + end + else + do_get_formats (req, res) + end + end + + do_post (req: WSF_REQUEST; res: WSF_RESPONSE) + do + if api.has_permission ("admin formats") then + if attached {WSF_STRING} req.path_parameter ("format-id") as p_format_id then + do_post_format (p_format_id.value, req, res) + else + do_post_format (Void, req, res) -- New format! + end + else + send_access_denied (req, res) + end + end + +feature -- View/edit Format + + new_format_web_form (a_path: READABLE_STRING_8; f: detachable CMS_FORMAT; a_response: CMS_RESPONSE): CMS_FORM + local + l_name: READABLE_STRING_8 + cb: WSF_FORM_CHECKBOX_INPUT + hf: WSF_FORM_HIDDEN_INPUT +-- nf: WSF_FORM_NUMBER_INPUT + ftxt: WSF_FORM_TEXT_INPUT + ftb: WSF_WIDGET_TABLE + ftb_row: WSF_WIDGET_TABLE_ROW + i: INTEGER + fset: WSF_FORM_FIELD_SET + l_all_filters: STRING_TABLE [CONTENT_FILTER] + + do + create Result.make (a_path, Void) + create ftxt.make ("name") + ftxt.set_is_required (True) + ftxt.set_validation_action (agent (fd: WSF_FORM_DATA) + do + if attached fd.string_item ("name") as v_name then + if v_name.is_whitespace then + fd.report_invalid_field ("name", "Blank value `name` !") + elseif not v_name.is_valid_as_string_8 then + fd.report_invalid_field ("name", "Value `name` should not contain any unicode character !") + elseif v_name.same_string_general ("-") then + fd.report_invalid_field ("name", "Value `name` can not be `-` !") + end + else + fd.report_invalid_field ("name", "Missing required value `name` !") + end + end + ) + ftxt.set_label ("Name") + if f /= Void then + ftxt.set_text_value (f.name) + end + Result.extend (ftxt) + + create ftxt.make ("title") + if f /= Void then + ftxt.set_text_value (f.title) + end + ftxt.set_label ("Title") + Result.extend (ftxt) + + create fset.make + fset.set_legend ("Filters") + Result.extend (fset) + + create l_all_filters.make_caseless (10) + fset.extend_html_text ("Included filters:") + i := 0 + create ftb.make + fset.extend (ftb) + if f /= Void then + across + f.filters as f_ic + loop + i := i + 1 + l_name := f_ic.item.name + l_all_filters.force (f_ic.item, l_name) + create cb.make_with_value ("filters[" + l_name + "]", l_name) + cb.set_title (f_ic.item.title) + cb.set_checked (True) + + create hf.make_with_text ("filter_weight[" + l_name + "]", i.out) +-- nf.set_maxlength (4) +-- nf.add_css_style ("width: 30px") +-- nf.set_label ("Order") + + create ftb_row.make (3) + ftb.add_row (ftb_row) + ftb_row.add_widget (cb) +-- ftb_row.add_widget (nf) + ftb_row.add_widget (hf) + ftb_row.add_widget (create {WSF_WIDGET_RAW_TEXT}.make_with_text (f_ic.item.description)) + end + end + fset.extend_html_text ("Available filters:") + create ftb.make + fset.extend (ftb) + across + api.content_filters as f_ic + loop + l_name := f_ic.item.name + if l_all_filters.has (l_name) then + else + create cb.make_with_value ("filters[" + l_name + "]", l_name) + cb.set_title (f_ic.item.title) + create ftb_row.make (2) + ftb.add_row (ftb_row) + ftb_row.add_widget (cb) + ftb_row.add_widget (create {WSF_WIDGET_RAW_TEXT}.make_with_text (f_ic.item.description)) + l_all_filters.force (f_ic.item, f_ic.item.name) + end + end + + create fset.make + fset.set_legend ("Content types") + Result.extend (fset) + across + api.content_types as ct_ic + loop + l_name := ct_ic.item.name + create cb.make_with_value ("content_types[]", l_name) + cb.set_title (l_name) + if f /= Void and then ct_ic.item.has_format (f.name) then + cb.set_checked (True) + end + fset.extend (cb) + end + if a_response.has_permission ("admin formats") then + Result.extend (create {WSF_FORM_SUBMIT_INPUT}.make_with_text ("op", "Update")) + Result.extend (create {WSF_FORM_RESET_INPUT}.make ("Cancel")) + end + end + + do_get_format (a_format_id: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE) + local + l_response: CMS_RESPONSE + s: STRING + form: CMS_FORM + do + if a_format_id = Void then + create {GENERIC_VIEW_CMS_RESPONSE} l_response.make (req, res, api) + l_response.add_to_primary_tabs (l_response.administration_link ("All formats", "formats")) + l_response.set_title ("Create a new format") + form := new_format_web_form (api.administration_path ("formats/"), Void, l_response) + create s.make_empty + form.append_to_html (l_response.wsf_theme, s) + l_response.set_main_content (s) + elseif attached api.format (a_format_id) as f then + create {GENERIC_VIEW_CMS_RESPONSE} l_response.make (req, res, api) + l_response.add_to_primary_tabs (l_response.administration_link ("All formats", "formats")) + update_response_title (l_response, f, False) + form := new_format_web_form (api.administration_path ("formats/" + f.name), f, l_response) + create s.make_empty + form.append_to_html (l_response.wsf_theme, s) + l_response.set_main_content (s) + else + create {NOT_FOUND_ERROR_CMS_RESPONSE} l_response.make (req, res, api) + end + l_response.execute + end + + do_post_format (a_format_id: detachable READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE) + local + f: detachable CMS_FORMAT + l_response: CMS_RESPONSE + s: STRING + form: CMS_FORM + lst_to_add, + lst_to_remove: ARRAYED_LIST [READABLE_STRING_GENERAL] + l_is_creation: BOOLEAN + do + if a_format_id /= Void then + f := api.format (a_format_id) + else + l_is_creation := True + create f.make ("-", "") + end + if f /= Void then + create {GENERIC_VIEW_CMS_RESPONSE} l_response.make (req, res, api) + l_response.add_to_primary_tabs (l_response.administration_link ("All formats", "formats")) + if a_format_id /= Void then + l_response.add_to_primary_tabs (l_response.administration_link ("View", "formats/" + a_format_id)) + end + update_response_title (l_response, f, l_is_creation) + if a_format_id /= Void then + form := new_format_web_form (api.administration_path ("formats/" + a_format_id), f, l_response) + else + form := new_format_web_form (api.administration_path ("formats/"), f, l_response) + end +-- form.prepare (l_response) + form.process (l_response) + if attached form.last_data as fd then + if l_is_creation then + if + attached fd.string_item ("name") as v_name and then + not v_name.is_whitespace and then v_name.is_valid_as_string_8 and then + not v_name.same_string ("-") -- Excluded value! + then + create f.make (v_name.to_string_8, Void) + else + fd.report_invalid_field ("name", "Bad name value (should not be empty, be blank or contain unicode character)") + end + end + if + attached fd.string_item ("title") as v_title and then + not v_title.is_whitespace and then + v_title.is_valid_as_string_8 + then + f.set_title (v_title.to_string_8) + else + f.set_title (Void) + end + + if + attached fd.table_item ("filters") as tb_filters +-- and then +-- attached fd.table_item ("filter_weight") as tb_weight + then + create lst_to_remove.make (0) + create lst_to_add.make (0) + across + f.filters as ic + loop + if attached tb_filters.value (ic.item.name) then + -- Keep + else + lst_to_remove.extend (ic.item.name) + end + end + across + tb_filters.values as ic + loop + if attached {WSF_STRING} ic.item as l_string then + if f.filter (l_string.value) = Void then + lst_to_add.extend (l_string.value) + end + end + end + across + lst_to_add as ic + loop +-- if attached f.filter (ic.item) then +-- -- already there + if attached api.content_filters.item (ic.item) as l_filter then + check has_not_filter: f.filter (ic.item) = Void end + f.add_filter (l_filter) + end + end + across + lst_to_remove as ic + loop + f.remove_filter_by_name (ic.item) + end + end + if + attached fd.table_item ("content_types") as tb_content_types + then + across + api.content_types as ic + loop + ic.item.remove_format (f) + end + across + tb_content_types as ic + loop + if + attached {WSF_STRING} ic.item as s_ct and then + attached api.content_type (s_ct.value) as ct and then + not ct.has_format (f.name) + then + ct.extend_format (f) + end + end + end + if fd.has_error then + fd.apply_to_associated_form + else + if l_is_creation then + if api.formats.item (f.name) /= Void then + api.formats.remove (f.name) + end + api.formats.extend (f) + l_response.add_to_primary_tabs (l_response.administration_link ("View", "formats/" + f.name)) + update_response_title (l_response, f, False) + end + api.save_formats + form := new_format_web_form (api.administration_path ("formats/" + f.name), f, l_response) + end + else + form := new_format_web_form (api.administration_path ("formats/" + f.name), f, l_response) + end + create s.make_empty + form.append_to_html (l_response.wsf_theme, s) + l_response.set_main_content (s) + else + create {NOT_FOUND_ERROR_CMS_RESPONSE} l_response.make (req, res, api) + end + + l_response.execute + end + + update_response_title (a_response: CMS_RESPONSE; f: CMS_FORMAT; is_creation: BOOLEAN) + do + if is_creation then + a_response.set_title ("Create a new CMS content format...") + else + if f.name.same_string_general (f.title) then + a_response.set_title ("CMS content format: " + api.html_encoded (f.name)) + else + a_response.set_title ("CMS content format: " + api.html_encoded (f.name) + " %"" + api.html_encoded (f.title) + "%"") + end + end + end + +feature -- All formats + + do_get_formats (req: WSF_REQUEST; res: WSF_RESPONSE) + local + l_response: CMS_RESPONSE + s: STRING + f: CMS_FORMAT + l_count: INTEGER + l_is_first: BOOLEAN + do + l_count := api.formats.count + + create {GENERIC_VIEW_CMS_RESPONSE} l_response.make (req, res, api) + + create s.make_empty + l_response.set_title ("CMS content formats") + + s.append ("%N") + + if l_response.has_permission ("admin formats") then + s.append (l_response.link ("Create new format", api.administration_path_location ("formats/-/add"), Void)) + end + + l_response.set_main_content (s) + l_response.execute + end +end + diff --git a/src/kernel/content/format/cms_content_filters.e b/src/kernel/content/format/cms_content_filters.e new file mode 100644 index 0000000..a9ceba1 --- /dev/null +++ b/src/kernel/content/format/cms_content_filters.e @@ -0,0 +1,66 @@ +note + description: "Summary description for {CMS_CONTENT_FILTERS}." + date: "$Date$" + revision: "$Revision$" + +class + CMS_CONTENT_FILTERS + +inherit + TABLE_ITERABLE [CONTENT_FILTER, READABLE_STRING_GENERAL] + +create + make + +feature {NONE} -- Initialization + + make (nb: INTEGER) + do + create items.make_caseless (5) + end + +feature -- Access + + item (a_name: detachable READABLE_STRING_GENERAL): detachable CONTENT_FILTER + do + if a_name /= Void then + Result := items.item (a_name) + end + end + +feature -- Element change + + extend (f: CONTENT_FILTER) + -- Add format `f' to available formats. + do + items.force (f, f.name) + ensure + has_format: item (f.name) = f + end + +feature -- Access + + new_cursor: TABLE_ITERATION_CURSOR [CONTENT_FILTER, READABLE_STRING_GENERAL] + -- Fresh cursor associated with current structure + do + Result := items.new_cursor + end + +feature {NONE} -- Implementation + + items: STRING_TABLE [CONTENT_FILTER] + +invariant + items /= Void + +note + copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" + source: "[ + Eiffel Software + 5949 Hollister Ave., Goleta, CA 93117 USA + Telephone 805-685-1006, Fax 805-685-6869 + Website http://www.eiffel.com + Customer support http://support.eiffel.com + ]" +end From 0d5630bb5848a50e88e44fca9cbf49f6b95c7e63 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 30 Mar 2017 14:47:02 +0200 Subject: [PATCH 2/3] allow copy error during install --- tools/install.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/install.bat b/tools/install.bat index d395033..78effb9 100644 --- a/tools/install.bat +++ b/tools/install.bat @@ -1,7 +1,7 @@ @echo off setlocal set TMP_EXCLUDE=%~dp0.install_ROC-copydir-exclude -set COPYCMD= xcopy /EXCLUDE:%TMP_EXCLUDE% /I /E /Y +set COPYCMD= xcopy /EXCLUDE:%TMP_EXCLUDE% /I /E /Y /C set TMP_DIR=%~dp0.. set SAFE_RMDIR=rd /q/s set SAFE_RM=del @@ -63,7 +63,7 @@ echo Install ROC as CMS ewf %COPYCMD% %TMP_DIR%\doc %TMP_UNSTABLE_DIR%\library\web\cms\doc %COPYCMD% %TMP_DIR%\modules %TMP_UNSTABLE_DIR%\library\web\cms\modules %COPYCMD% %TMP_DIR%\examples %TMP_UNSTABLE_DIR%\library\web\cms\examples - +echo TOOLS %COPYCMD% %TMP_DIR%\tools %TMP_UNSTABLE_DIR%\library\web\cms\tools %SAFE_RM% %TMP_UNSTABLE_DIR%\library\web\cms\tools\install.bat %SAFE_RM% %TMP_UNSTABLE_DIR%\library\web\cms\tools\safe_md.bat From a01d161864492f108df073960eb666f93a20c014 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Thu, 30 Mar 2017 15:41:04 +0200 Subject: [PATCH 3/3] Improved video content filter to be more flexible, and allow custom template. --- .../embedded_video/src/video_content_filter.e | 129 ++++++++++++++---- .../test/test_content_filter_set.e | 105 +++++++------- modules/embedded_video/test/testing-safe.ecf | 3 - modules/embedded_video/test/testing.ecf | 15 +- 4 files changed, 162 insertions(+), 90 deletions(-) delete mode 100644 modules/embedded_video/test/testing-safe.ecf diff --git a/modules/embedded_video/src/video_content_filter.e b/modules/embedded_video/src/video_content_filter.e index 8498abe..c445aed 100644 --- a/modules/embedded_video/src/video_content_filter.e +++ b/modules/embedded_video/src/video_content_filter.e @@ -24,8 +24,8 @@ feature {NONE} -- Initialization default_create do Precursor - width := 420 - height := 315 + default_width := 420 + default_height := 315 end feature -- Access @@ -38,6 +38,36 @@ feature -- Access help: STRING = "Embed video using the following pattern: [video:url width:X height:Y], width and height are optionals." +feature -- Settings + + default_width: INTEGER; + -- Specifies the width of an " + +feature -- Settings change + + set_default_width (w: like default_width) + do + default_width := w + end + + set_default_height (h: like default_height) + do + default_height := h + end + + set_template (tpl: like template) + do + template := tpl + end + feature -- Conversion filter (a_text: STRING_8) @@ -77,10 +107,10 @@ feature -- Conversion local i,j,n: INTEGER s,k,v: STRING_8 - l_url: STRING_8 - l_width, l_height: detachable STRING + l_url, l_att: STRING_8 + l_width, l_height, l_extra: detachable STRING do - s := a_text.substring (a_lower + 1, a_upper - 1) + s := a_text.substring (a_lower + 7, a_upper - 1) s.left_adjust i := next_space_position (s, 1) if i > 0 then @@ -96,6 +126,8 @@ feature -- Conversion j := s.index_of (':', i) if j > 0 then k := s.head (j - 1) + k.left_adjust + k.right_adjust s.remove_head (j) s.left_adjust i := 1 @@ -103,10 +135,14 @@ feature -- Conversion j := next_space_position (s, 1) if j > 0 then v := s.head (j - 1) + v.left_adjust + v.right_adjust s.remove_head (j) s.left_adjust else v := s.substring (i, n) + v.left_adjust + v.right_adjust s.wipe_out end n := s.count @@ -116,41 +152,69 @@ feature -- Conversion elseif k.is_case_insensitive_equal ("height") then l_height := v else - check supported: False end + -- Ignore end else + s.left_adjust + s.right_adjust + if not s.is_whitespace then + l_extra := s + end i := n + 1 end end else - s.remove_head (6) l_url := s end if not l_url.is_whitespace then - create Result.make_from_string ("") end - Result.append ("frameborder=%"0%" allowfullscreen>") end end @@ -171,12 +235,23 @@ feature -- Conversion end end -feature {NONE} -- Implementation + next_non_space_position (a_text: STRING; a_start_index: INTEGER): INTEGER + local + n: INTEGER + do + from + Result := a_start_index + n := a_text.count + until + not a_text[Result].is_space or Result > n + loop + Result := Result + 1 + end + if Result > n then + Result := 0 + end + end - width: INTEGER; - -- Specifies the width of an " + expected_text := "" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end - test_video_filter_2 + test_video_filter_02 -- New test routine local f: VIDEO_CONTENT_FILTER text: STRING expected_text: STRING do - text := "[ video : https://www.youtube.com/embed/jBMOSSnCMCk ]" - expected_text := "" + text := "[video: https://www.youtube.com/embed/jBMOSSnCMCk ]" + expected_text := "" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end - test_video_filter_3 + test_video_filter_03 -- New test routine local f: VIDEO_CONTENT_FILTER text: STRING expected_text: STRING do - text := "[ video :https://www.youtube.com/embed/jBMOSSnCMCk ]" - expected_text := "" + text := "[video:https://www.youtube.com/embed/jBMOSSnCMCk ]" + expected_text := "" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end - test_video_filter_4 + test_video_filter_04 -- New test routine local f: VIDEO_CONTENT_FILTER text: STRING expected_text: STRING do - text := "[ video :https://www.youtube.com/embed/jBMOSSnCMCk height:425]" - expected_text := "" + text := "[video:https://www.youtube.com/embed/jBMOSSnCMCk height:425]" + expected_text := "" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end - test_video_filter_5 + test_video_filter_05 -- New test routine local f: VIDEO_CONTENT_FILTER text: STRING expected_text: STRING do - text := "[ video :https://www.youtube.com/embed/jBMOSSnCMCk height : 425]" - expected_text := "" + text := "[video:https://www.youtube.com/embed/jBMOSSnCMCk height : 425]" + expected_text := "" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end - test_video_filter_6 + test_video_filter_06 -- New test routine local f: VIDEO_CONTENT_FILTER text: STRING expected_text: STRING do - text := "[ video :https://www.youtube.com/embed/jBMOSSnCMCk height : 425 width: 425]" - expected_text := "" + text := "[video:https://www.youtube.com/embed/jBMOSSnCMCk height : 425 width: 425]" + expected_text := "" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end - test_video_filter_7 + test_video_filter_07 -- New test routine local f: VIDEO_CONTENT_FILTER @@ -112,43 +112,13 @@ feature -- Test routines expected_text: STRING do text := "[video:https://www.youtube.com/embed/jBMOSSnCMCk height:425 width:425]" - expected_text := "" + expected_text := "" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end - - test_video_filter_8 - -- New test routine - local - f: VIDEO_CONTENT_FILTER - text: STRING - expected_text: STRING - do - text := "[height:425 width:425 video:https://www.youtube.com/embed/jBMOSSnCMCk ]" - expected_text := "" - create f - f.filter (text) - assert ("expected iframe with video", text.same_string (expected_text)) - end - - - test_video_filter_9 - -- New test routine - local - f: VIDEO_CONTENT_FILTER - text: STRING - expected_text: STRING - do - text := "[ width:425 video:https://www.youtube.com/embed/jBMOSSnCMCk height:425]" - expected_text := "" - create f - f.filter (text) - assert ("expected iframe with video", text.same_string (expected_text)) - end - - test_video_filter_10 + test_video_filter_08 -- New test routine local f: VIDEO_CONTENT_FILTER @@ -156,14 +126,27 @@ feature -- Test routines expected_text: STRING do text := "[ wrong:425 video:https://www.youtube.com/embed/jBMOSSnCMCk height:425]" - expected_text := "" + expected_text := "[ wrong:425 video:https://www.youtube.com/embed/jBMOSSnCMCk height:425]" create f f.filter (text) assert ("expected iframe with video", text.same_string (expected_text)) end + test_video_filter_09 + -- New test routine + local + f: VIDEO_CONTENT_FILTER + text: STRING + expected_text: STRING + do + text := "[video:https://www.youtube.com/embed/jBMOSSnCMCk height:425 foo:bar foo=bar foobar frameborder=%"0%" allowfullscreen]" + expected_text := "" + create f + f.filter (text) + assert ("expected iframe with video", text.same_string (expected_text)) + end - test_video_filter_11 + test_video_filter_10 -- New test routine local f: VIDEO_CONTENT_FILTER @@ -177,6 +160,24 @@ feature -- Test routines assert ("expected iframe with video", text.same_string (expected_text)) end + test_video_filter_tpl_01 + -- New test routine + local + f: VIDEO_CONTENT_FILTER + text: STRING + expected_text: STRING + do + text := "[video:https://www.youtube.com/embed/jBMOSSnCMCk height:425 foo:bar foo=bar foobar]" + create f + f.set_template ("") + f.set_default_width (500) + f.set_default_height (400) + + expected_text := "" + + f.filter (text) + assert ("expected iframe with video", text.same_string (expected_text)) + end end diff --git a/modules/embedded_video/test/testing-safe.ecf b/modules/embedded_video/test/testing-safe.ecf deleted file mode 100644 index cf818e4..0000000 --- a/modules/embedded_video/test/testing-safe.ecf +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/modules/embedded_video/test/testing.ecf b/modules/embedded_video/test/testing.ecf index 8d9b47c..8504468 100644 --- a/modules/embedded_video/test/testing.ecf +++ b/modules/embedded_video/test/testing.ecf @@ -1,7 +1,9 @@ - + + /.git$ /.svn$ @@ -9,13 +11,10 @@ - - - - - - - + + + +