From a41693b4b68a03fd20a6c83585c9ac451b175132 Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 28 Dec 2020 15:16:23 -0800 Subject: [PATCH] Removed snippets from bootstrap3 theme. Fix for line-endings issue in cache tests. --- e107_plugins/tinymce4/plugins/e107/plugin.js | 34 +++++++++++++------ e107_tests/tests/unit/e_formTest.php | 4 +-- e107_tests/tests/unit/ecacheTest.php | 2 +- .../bootstrap3/snippets/form_checkbox.html | 4 --- .../bootstrap3/snippets/form_radio.html | 4 --- 5 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 e107_themes/bootstrap3/snippets/form_checkbox.html delete mode 100644 e107_themes/bootstrap3/snippets/form_radio.html diff --git a/e107_plugins/tinymce4/plugins/e107/plugin.js b/e107_plugins/tinymce4/plugins/e107/plugin.js index 9abea0926..2b9841217 100644 --- a/e107_plugins/tinymce4/plugins/e107/plugin.js +++ b/e107_plugins/tinymce4/plugins/e107/plugin.js @@ -15,11 +15,14 @@ init : function(ed,url) { - var t = this, dialect = ed.getParam('bbcode_dialect', 'e107').toLowerCase(); + var t = this; + + console.log('Initializing e107 TinyMce Plugin'); + + ed.on('beforeSetContent', function(e) + { + e.content = t['_e107_bbcode2html'](e.content, url); - - ed.on('beforeSetContent', function(e) { - e.content = t['_' + dialect + '_bbcode2html'](e.content, url); }); ed.on('change', function(e) { @@ -39,11 +42,11 @@ // alert(e.content); // remove comment to test. if (e.set) { - e.content = t['_' + dialect + '_bbcode2html'](e.content, url); + e.content = t['_e107_bbcode2html'](e.content, url); } if (e.get) { - e.content = t['_' + dialect + '_html2bbcode'](e.content, url); + e.content = t['_e107_html2bbcode'](e.content, url); } @@ -79,7 +82,10 @@ dataType: 'html', success: function(html) { return html; - } + }, + error: function (request, status, error) { + console.log(request.responseText); + } }).responseText; html = '' + html + ' ' ; @@ -202,12 +208,15 @@ type: "POST", url: url + "/parser.php", data: { content: s, mode: 'tobbcode' }, - async : false, + async: false, dataType: "html", success: function(html) { return html; - } + }, + error: function (request, status, error) { + console.log(request.responseText); + } }).responseText; return p; @@ -227,12 +236,15 @@ type: "POST", url: url + "/parser.php", data: { content: s, mode: 'tohtml' }, - async : false, + async: false, dataType: "html", success: function(html) { return html; - } + }, + error: function (request, status, error) { + console.log(request.responseText); + } }).responseText; return p; diff --git a/e107_tests/tests/unit/e_formTest.php b/e107_tests/tests/unit/e_formTest.php index c3c928cc6..a471ed934 100644 --- a/e107_tests/tests/unit/e_formTest.php +++ b/e107_tests/tests/unit/e_formTest.php @@ -1143,7 +1143,7 @@ class e_formTest extends \Codeception\Test\Unit /** * Loads snipper from e107_themes/bootstrap/snippets/form_checkbox.html - */ + *//* public function testSnippet() { $this->_frm->_snippets = true; @@ -1158,7 +1158,7 @@ class e_formTest extends \Codeception\Test\Unit $this->_frm->_snippets = false; - } + }*/ } diff --git a/e107_tests/tests/unit/ecacheTest.php b/e107_tests/tests/unit/ecacheTest.php index e93f1ba42..438d92b32 100644 --- a/e107_tests/tests/unit/ecacheTest.php +++ b/e107_tests/tests/unit/ecacheTest.php @@ -82,7 +82,7 @@ class ecacheTest extends \Codeception\Test\Unit $this->cache->setMD5('hash'); // set a consistent hash value: ie. 0800fc577294c34e0b28ad2839435945 - $clean = ["\t", "\n", " "]; + $clean = ["\t", "\n", "\r", " "]; foreach($tests as $var) { diff --git a/e107_themes/bootstrap3/snippets/form_checkbox.html b/e107_themes/bootstrap3/snippets/form_checkbox.html deleted file mode 100644 index d23e0d3bd..000000000 --- a/e107_themes/bootstrap3/snippets/form_checkbox.html +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/e107_themes/bootstrap3/snippets/form_radio.html b/e107_themes/bootstrap3/snippets/form_radio.html deleted file mode 100644 index 27e18ac3a..000000000 --- a/e107_themes/bootstrap3/snippets/form_radio.html +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file