Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Installation
Install using /admin/plugins
OR
``git clone git@github.com:JohnMcLear/ep_file_menu_toolbar.git ep_aa_file_menu_toolbar``
``git clone git@github.com:ether/ep_file_menu_toolbar.git``

## TODO
* i18n support
Expand Down
4 changes: 2 additions & 2 deletions eejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const eejs = require('ep_etherpad-lite/node/eejs/');

exports.eejsBlock_styles = (hookName, args, cb) => {
const css = eejs.require(
'ep_aa_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.css',
'ep_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.css',
{}, module,
);
args.content = `${args.content}
Expand All @@ -13,7 +13,7 @@ exports.eejsBlock_styles = (hookName, args, cb) => {
};

exports.eejsBlock_body = (hookName, args, cb) => {
args.content = eejs.require('ep_aa_file_menu_toolbar/templates/toolbar.ejs', {
args.content = eejs.require('ep_file_menu_toolbar/templates/toolbar.ejs', {
settings: false,
}) + args.content;
cb();
Expand Down
2 changes: 1 addition & 1 deletion static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports.documentReady = () => {
/* eslint-disable-next-line max-len */
$.getScript('../static/plugins/ep_aa_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.js', () => {
$.getScript('../static/plugins/ep_file_menu_toolbar/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.js', () => {
$(() => {
$('.dropdown-menu').dropdown_menu({
open_delay: 50, // Delay on menu open
Expand Down
10 changes: 8 additions & 2 deletions static/tests/frontend-new/specs/bold.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ test.describe('ep_file_menu_toolbar', () => {
// Select all the text in the pad.
await page.keyboard.press('ControlOrMeta+A');

// The bold entry lives inside the collapsed "Format" submenu, which the
// jquery-css dropdown plugin only expands on hover. dispatchEvent fires
// the click straight on the element regardless of visibility, which is
// what we want — the test asserts the menu link's onclick handler runs
// $('.buttonicon-bold').click() and toggles bold, not the dropdown's
// hover choreography.
const boldEntry = page.locator('.dropdown-menu #bold > a');
await boldEntry.click();
await boldEntry.dispatchEvent('click');
await expect(padBody.locator('div').first().locator('b')).toHaveCount(1);
await expect(padBody.locator('div').first()).toHaveText('hello world');

// Re-select and click again to disable.
await page.keyboard.press('ControlOrMeta+A');
await boldEntry.click();
await boldEntry.dispatchEvent('click');
await expect(padBody.locator('div').first().locator('b')).toHaveCount(0);
await expect(padBody.locator('div').first()).toHaveText('hello world');
});
Expand Down
Loading