Skip to content

Commit 86ff738

Browse files
committed
OXDEV-10119 Fix minor issues
1 parent b3d3bf5 commit 86ff738

4 files changed

Lines changed: 80 additions & 6 deletions

File tree

assets/out/src/js/summernote-cleaner.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
/* https://github.com/DiemenDesign/summernote-cleaner */
2-
/* Version: 1.1.0 */
1+
/*!
2+
* summernote-cleaner v1.1.0
3+
* Copyright (c) 2018 Diemen Design (https://github.com/DiemenDesign/summernote-cleaner)
4+
* Licensed under the MIT License
5+
*/
36
(function (factory) {
47
if (typeof define === 'function' && define.amd) {
58
define(['jquery'], factory);

assets/out/src/js/summernote-ext-print.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*!
2+
* summernote-ext-print
3+
* Copyright (c) lqez (https://github.com/lqez/summernote-ext-print)
4+
* Licensed under the MIT License
5+
*/
16
(function (factory) {
27
/* global define */
38
if (typeof define === 'function' && define.amd) {
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
/**
4+
* Copyright © . All rights reserved.
5+
* See LICENSE file for license details.
6+
*/
7+
8+
declare(strict_types=1);
9+
10+
namespace OxidEsales\ExamplesModule\Tests\Codeception\Acceptance;
11+
12+
use OxidEsales\ExamplesModule\Tests\Codeception\Support\AcceptanceTester;
13+
14+
/**
15+
* @group oe_examples_module
16+
* @group oe_examples_module_summernote_extension
17+
*/
18+
final class SummernoteExtensionCest
19+
{
20+
private const string TOOLBAR = '//div[contains(@class,"note-toolbar")]';
21+
private const string FORMATTING = self::TOOLBAR . '//div[contains(@class,"note-formatting")]';
22+
private const string FONT = self::TOOLBAR . '//div[contains(@class,"note-font")]';
23+
private const string MISC = self::TOOLBAR . '//div[contains(@class,"note-misc")]';
24+
private const string DROPDOWN = self::FONT . '//div[contains(@class,"dropdown-fontname")]';
25+
26+
public function testModuleCanOverrideSummernoteOptions(AcceptanceTester $I): void
27+
{
28+
$I->wantToTest('Module can override Summernote toolbar and font names');
29+
30+
$adminPanel = $I->loginAdmin();
31+
$adminPanel->openProducts();
32+
$I->selectEditFrame();
33+
34+
$I->waitForElement('.note-editor', 15);
35+
$I->wait(3);
36+
37+
// toolbar groups
38+
$I->seeNumberOfElements(self::TOOLBAR . '/div[contains(@class,"note-btn-group")]', 4);
39+
40+
// formatting
41+
$I->seeElement(self::FORMATTING . '//button[contains(@class,"note-btn-bold")]');
42+
$I->seeElement(self::FORMATTING . '//button[contains(@class,"note-btn-italic")]');
43+
$I->seeNumberOfElements(self::FORMATTING . '//button[contains(@class,"note-btn")]', 2);
44+
45+
// font
46+
$I->seeElement(self::FONT . '//*[@aria-label="Font Family"]');
47+
$I->seeElement(self::FONT . '//*[@aria-label="Font Size"]');
48+
$I->seeNumberOfElements(self::FONT . '//button[contains(@class,"note-btn")]', 2);
49+
50+
// misc
51+
$I->seeElement(self::MISC . '//*[@aria-label="Cleaner"]');
52+
$I->seeElement(self::MISC . '//*[@aria-label="Print"]');
53+
$I->seeElement(self::MISC . '//button[contains(@class,"btn-codeview")]');
54+
$I->seeNumberOfElements(self::MISC . '//button[contains(@class,"note-btn")]', 3);
55+
56+
// font names dropdown
57+
$I->click(self::FONT . '//button[@aria-label="Font Family"]');
58+
$I->wait(1);
59+
60+
$I->seeNumberOfElements(self::DROPDOWN . '//a[contains(@class,"dropdown-item")]', 3);
61+
$I->see('Arial', self::DROPDOWN);
62+
$I->see('Courier New', self::DROPDOWN);
63+
$I->see('Custom Font', self::DROPDOWN);
64+
}
65+
}

views/twig/extensions/modules/ddoewysiwyg/ddoewysiwyg.html.twig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
{% block ddoe_wysiwyg_plugins %}
44
{{ parent() }}
5-
{{ script({ include: oViewConf.getModuleUrl('oe_examples_module', 'out/src/js/summernote-ext-print.js'), priority: 0, dynamic: __oxid_include_dynamic }) }}
6-
{{ script({ include: oViewConf.getModuleUrl('oe_examples_module', 'out/src/js/summernote-cleaner.js'), priority: 0, dynamic: __oxid_include_dynamic }) }}
5+
{{ script({ include: oViewConf.getModuleUrl('oe_examples_module', 'out/src/js/summernote-ext-print.js'), priority: 1, dynamic: __oxid_include_dynamic }) }}
6+
{{ script({ include: oViewConf.getModuleUrl('oe_examples_module', 'out/src/js/summernote-cleaner.js'), priority: 1, dynamic: __oxid_include_dynamic }) }}
77
{% endblock %}
88

99
{% block ddoe_wysiwyg_summernote_options %}
1010
{{ parent() }}
1111
Object.assign(summernoteOptions, {
1212
fontNames: [
13-
'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New', 'Custom Font'
13+
'Arial', 'Courier New', 'Custom Font'
1414
],
1515
fontNamesIgnoreCheck: ['Custom Font'],
16+
addDefaultFonts: false,
1617
toolbar: [
1718
['formatting', ['bold', 'italic']],
18-
['fontname', ['fontname', 'fontsize']],
19+
['font', ['fontname', 'fontsize']],
1920
['misc', ['cleaner', 'print', 'codeview']]
2021
],
2122
});

0 commit comments

Comments
 (0)