ep_file_menu_toolbar 0.0.3 → 0.2.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/.eslintrc.cjs +9 -0
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/automerge.yml +30 -0
- package/.github/workflows/backend-tests.yml +71 -0
- package/.github/workflows/frontend-tests.yml +94 -0
- package/.github/workflows/npmpublish.yml +107 -0
- package/.github/workflows/test-and-release.yml +26 -0
- package/.travis.yml +69 -0
- package/CONTRIBUTING.md +133 -0
- package/LICENSE.md +14 -0
- package/README.md +7 -1
- package/demo.gif +0 -0
- package/demo.png +0 -0
- package/eejs.js +17 -10
- package/ep.json +4 -5
- package/package.json +21 -4
- package/static/js/index.js +57 -4
- package/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.css +3 -0
- package/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.js +186 -179
- package/static/js/lib/jquery-css-dropdown-plugin-master/dropdown-menu.min.js +1 -1
- package/static/js/lib/jquery-css-dropdown-plugin-master/lib/jquery-1.8.3.min.js +2 -2
- package/static/tests/frontend/specs/atest.js +74 -0
- package/templates/toolbar.ejs +60 -42
- package/.npmignore +0 -1
- package/index.js +0 -52
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
describe('File Menu Toolbar', function () {
|
|
4
|
+
// create a new pad before each test run
|
|
5
|
+
beforeEach(function (cb) {
|
|
6
|
+
helper.newPad(cb);
|
|
7
|
+
this.timeout(60000);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// Create Pad
|
|
11
|
+
// Check Highlighting text and setting it to bold works
|
|
12
|
+
// Check Highlighting text and setting it to un-bold works
|
|
13
|
+
|
|
14
|
+
it('Uses file menu to enable boldness', function (done) {
|
|
15
|
+
const inner$ = helper.padInner$;
|
|
16
|
+
const chrome$ = helper.padChrome$;
|
|
17
|
+
|
|
18
|
+
// get the first text element out of the inner iframe
|
|
19
|
+
const $firstTextElement = inner$('div').first();
|
|
20
|
+
|
|
21
|
+
// select this text element
|
|
22
|
+
$firstTextElement.sendkeys('{selectall}');
|
|
23
|
+
|
|
24
|
+
// get the bold button and click it
|
|
25
|
+
const $boldButton = chrome$('.dropdown-menu #bold > a');
|
|
26
|
+
$boldButton.click();
|
|
27
|
+
|
|
28
|
+
// ace creates a new dom element when you press a button
|
|
29
|
+
// so just get the first text element again
|
|
30
|
+
const $newFirstTextElement = inner$('div').first();
|
|
31
|
+
|
|
32
|
+
// is there a <b> element now?
|
|
33
|
+
const isBold = $newFirstTextElement.find('b').length === 1;
|
|
34
|
+
|
|
35
|
+
// expect it to be bold
|
|
36
|
+
expect(isBold).to.be(true);
|
|
37
|
+
|
|
38
|
+
// make sure the text hasn't changed
|
|
39
|
+
expect($newFirstTextElement.text()).to.eql($firstTextElement.text());
|
|
40
|
+
|
|
41
|
+
done();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('Uses file menu to disable boldness', function (done) {
|
|
45
|
+
const inner$ = helper.padInner$;
|
|
46
|
+
const chrome$ = helper.padChrome$;
|
|
47
|
+
|
|
48
|
+
// get the first text element out of the inner iframe
|
|
49
|
+
const $firstTextElement = inner$('div').first();
|
|
50
|
+
|
|
51
|
+
// select this text element
|
|
52
|
+
$firstTextElement.sendkeys('{selectall}');
|
|
53
|
+
|
|
54
|
+
// get the bold button and click it
|
|
55
|
+
const $boldButton = chrome$('.dropdown-menu #bold > a');
|
|
56
|
+
$boldButton.click();
|
|
57
|
+
|
|
58
|
+
// click it again to disable boldness
|
|
59
|
+
$boldButton.click();
|
|
60
|
+
|
|
61
|
+
const $newFirstTextElement = inner$('div').first();
|
|
62
|
+
|
|
63
|
+
// is there a <b> element now?
|
|
64
|
+
const isBold = $newFirstTextElement.find('b').length === 1;
|
|
65
|
+
|
|
66
|
+
// expect it to be bold
|
|
67
|
+
expect(isBold).to.be(false);
|
|
68
|
+
|
|
69
|
+
// make sure the text hasn't changed
|
|
70
|
+
expect($newFirstTextElement.text()).to.eql($firstTextElement.text());
|
|
71
|
+
|
|
72
|
+
done();
|
|
73
|
+
});
|
|
74
|
+
});
|
package/templates/toolbar.ejs
CHANGED
|
@@ -1,82 +1,102 @@
|
|
|
1
|
-
<ul class="dropdown-menu"
|
|
1
|
+
<ul class="dropdown-menu">
|
|
2
|
+
<% e.begin_block("dd_dropdownMenu"); %>
|
|
2
3
|
<li>
|
|
3
4
|
<a href="#">File</a>
|
|
4
5
|
<ul>
|
|
5
6
|
<li>
|
|
6
|
-
|
|
7
|
-
<li><a href="
|
|
8
|
-
<li><a href="#" data-key="
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
<% e.begin_block("dd_file"); %>
|
|
8
|
+
<li><a href target="_blank" id="newPad" data-l10n-id="index.newPad">New</a></li>
|
|
9
|
+
<li><a href="#" data-key="save" id="revisionlink" data-type="button" data-l10n-id="pad.toolbar.savedRevision.title"><u>S</u>ave</a></li>
|
|
10
|
+
<li><a href="#" id="importexportlink" data-key="import_export" class="acl-write" data-type="button" data-l10n-id="pad.impexp.importbutton">Import</a></li>
|
|
11
|
+
<li id="file_menu_exports"><a href="#" data-key="export" data-type="button" data-l10n-id="pad.importExport.export">Export</a>
|
|
12
|
+
<ul class="submenu">
|
|
12
13
|
</ul>
|
|
13
14
|
</li>
|
|
14
15
|
<hr></hr>
|
|
15
|
-
<li onclick="document.location = document.location.pathname+ '/timeslider'"><a href="#" id="timesliderlink">Timeslider</a></li>
|
|
16
|
+
<li onclick="document.location = document.location.pathname+ '/timeslider'"><a data-l10n-id="pad.toolbar.timeslider.title" href="#" id="timesliderlink">Timeslider</a></li>
|
|
16
17
|
<hr></hr>
|
|
17
|
-
<li><a href="#" data-key="settings">Pad Settings</a></li>
|
|
18
|
-
<li><a href="#" data-key="
|
|
18
|
+
<li><a href="#" id="filemenutoolbarsettings" data-key="settings" data-type="button" data-l10n-id="pad.settings.padSettings">Pad Settings</a></li>
|
|
19
|
+
<li><a href="#" data-key="print" onClick="printPad()" data-type="button" data-l10n-id="">Print</a></li>
|
|
20
|
+
<li><a href="#" id="filemenutoolbarembed" data-key="embed" id="embedlink" data-type="button" data-l10n-id="pad.toolbar.embed.title">Share & Embed</a></li>
|
|
21
|
+
<% e.end_block(); %>
|
|
19
22
|
</li>
|
|
20
23
|
</ul>
|
|
21
24
|
</li>
|
|
22
|
-
<li>
|
|
23
|
-
<a href="#">Edit</a>
|
|
25
|
+
<li class="acl-write">
|
|
26
|
+
<a href="#" data-l10n-id="">Edit</a>
|
|
24
27
|
<ul>
|
|
25
28
|
<li>
|
|
26
|
-
|
|
27
|
-
<li><a href="#" data-key="
|
|
29
|
+
<% e.begin_block("dd_edit"); %>
|
|
30
|
+
<li><a href="#" data-key="undo" data-l10n-id="pad.toolbar.undo.title">Undo</a></li>
|
|
31
|
+
<li><a href="#" data-key="redo" data-l10n-id="pad.toolbar.redo.title">Redo</a></li>
|
|
32
|
+
<% e.end_block(); %>
|
|
28
33
|
</li>
|
|
29
34
|
</ul>
|
|
30
35
|
<li>
|
|
31
|
-
<li>
|
|
36
|
+
<li class="acl-write">
|
|
32
37
|
<a href="#">Format</a>
|
|
33
38
|
<ul>
|
|
34
39
|
<li>
|
|
35
|
-
|
|
36
|
-
<li><a href="#" data-key="
|
|
37
|
-
<li><a href="#" data-key="
|
|
38
|
-
<li><a href="#" data-key="
|
|
40
|
+
<% e.begin_block("dd_format"); %>
|
|
41
|
+
<li id="bold"><a href="#" data-key="bold" data-type="button" onClick="$('.buttonicon-bold').click();"><u>B</u>old</a></li>
|
|
42
|
+
<li id="italic"><a href="#" data-key="italic" data-type="button" onClick="$('.buttonicon-italic').click();"><u>I</u>talic</a></li>
|
|
43
|
+
<li id="underline"><a href="#" data-key="underline" data-type="button" onClick="$('.buttonicon-underline').click();"><u>U</u>nderline</a></li>
|
|
44
|
+
<li id="strikethrough"><a href="#" data-key="strikethrough" data-type="button" onClick="$('.buttonicon-strikethrough').click();" data-l10n-id="pad.toolbar.strikethrough.title">Strikethrough</a></li>
|
|
39
45
|
<hr></hr>
|
|
40
|
-
<li><a href="#" data-key="insertorderedlist">Ordered List</a></li>
|
|
41
|
-
<li><a href="#" data-key="insertunorderedlist">Unordered list</a></li>
|
|
42
|
-
<li><a href="#" data-key="indent">Indent</a></li>
|
|
43
|
-
<li><a href="#" data-key="outdent">Outdent</a></li>
|
|
46
|
+
<li><a href="#" data-l10n-id="pad.toolbar.ol.title" data-key="insertorderedlist" data-type="button" onClick="$('.buttonicon-insertorderedlist').click();">Ordered List</a></li>
|
|
47
|
+
<li><a href="#" data-l10n-id="pad.toolbar.ul.title" data-key="insertunorderedlist" data-type="button" onClick="$('.buttonicon-insertunorderedlist').click();">Unordered list</a></li>
|
|
48
|
+
<li><a href="#" data-l10n-id="pad.toolbar.indent.title" data-key="indent" data-type="button" onClick="$('.buttonicon-indent').click();">Indent</a></li>
|
|
49
|
+
<li><a href="#" data-l10n-id="pad.toolbar.unindent.title" data-key="outdent" data-type="button" onClick="$('.buttonicon-outdent').click();">Outdent</a></li>
|
|
44
50
|
<hr></hr>
|
|
45
|
-
<li><a href="#" data-key="clearauthorship">Clear Authorship Colors</a></li>
|
|
51
|
+
<li><a href="#" data-l10n-id="pad.toolbar.clearAuthorship.title" data-key="clearauthorship" data-type="button" onClick="$('.buttonicon-clearauthorship').click();">Clear Authorship Colors</a></li>
|
|
52
|
+
<% e.end_block(); %>
|
|
53
|
+
|
|
46
54
|
</li>
|
|
47
55
|
</ul>
|
|
56
|
+
</li>
|
|
48
57
|
|
|
58
|
+
|
|
59
|
+
<li class="acl-write">
|
|
60
|
+
<a href="#">Insert</a>
|
|
61
|
+
<ul>
|
|
62
|
+
<li>
|
|
63
|
+
<% e.begin_block("dd_insert"); %>
|
|
64
|
+
<% e.end_block(); %>
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
49
67
|
</li>
|
|
50
68
|
|
|
69
|
+
|
|
51
70
|
<li>
|
|
52
71
|
<a href="#">View</a>
|
|
53
72
|
<ul>
|
|
54
73
|
<li>
|
|
55
|
-
|
|
74
|
+
<% e.begin_block("dd_view"); %>
|
|
75
|
+
<li><a href="#" data-l10n-id="pad.settings.colorcheck" onClick="$('#options-colorscheck').click();">Authorship colors</a></li>
|
|
76
|
+
<li><a href="#" data-l10n-id="pad.settings.linenocheck" onClick="$('#options-linenoscheck').click();">Line Numbers</a></li>
|
|
77
|
+
<li><a href="#" data-l10n-id="pad.settings.stickychat" onClick="chat.stickToScreen();">Chat Always Visible</a></li>
|
|
78
|
+
<li><a href="#" onClick="$('#timesliderlink').click();" data-l10n-id="pad.toolbar.timeslider.title">Timeslider</a></li>
|
|
79
|
+
<li><a href="#" data-l10n-id="pad.settings.rtlcheck" onClick="$('#options-rtlcheck').click();">Text Right to Left</a></li>
|
|
80
|
+
<% e.end_block(); %>
|
|
56
81
|
</li>
|
|
57
82
|
</ul>
|
|
58
83
|
|
|
59
84
|
</li>
|
|
60
85
|
<li>
|
|
61
|
-
<a href="#">Help</a>
|
|
86
|
+
<a href="#" class='dropdown-help'>Help</a>
|
|
62
87
|
<ul>
|
|
63
88
|
<li>
|
|
64
|
-
|
|
89
|
+
<% e.begin_block("dd_help"); %>
|
|
90
|
+
<li><a href="http://mclear.co.uk" target="_blank">File Menu Toolbar plugin by John McLear</a></li>
|
|
91
|
+
<% e.end_block(); %>
|
|
65
92
|
</li>
|
|
66
93
|
</ul>
|
|
67
94
|
|
|
68
95
|
</li>
|
|
69
|
-
|
|
70
|
-
|
|
96
|
+
<% e.end_block(); %>
|
|
71
97
|
</ul>
|
|
72
98
|
|
|
73
99
|
<style type="text/css">
|
|
74
|
-
#editorcontainerbox{
|
|
75
|
-
top:23px;
|
|
76
|
-
}
|
|
77
|
-
.stickyChat{
|
|
78
|
-
top:61px;
|
|
79
|
-
}
|
|
80
100
|
.dropdown-menu-sub-indicator > ul {
|
|
81
101
|
border:1px solid rgb(204, 204, 204);
|
|
82
102
|
border-radius:0px 0px 6px 6px;
|
|
@@ -84,6 +104,11 @@
|
|
|
84
104
|
background:linear-gradient(rgb(247, 247, 247), rgb(238, 238, 238)) repeat scroll 0% 0% transparent;
|
|
85
105
|
padding:10px;
|
|
86
106
|
}
|
|
107
|
+
.submenu{
|
|
108
|
+
margin:0px 0px 10px 0px;
|
|
109
|
+
padding: 0px 10px 0px 5px !important;
|
|
110
|
+
border-radius:0px 6px 6px 0px !important;
|
|
111
|
+
}
|
|
87
112
|
.dropdown-menu-sub-indicator > ul > hr{
|
|
88
113
|
margin:10px 0px 10px 0px;
|
|
89
114
|
}
|
|
@@ -91,13 +116,6 @@
|
|
|
91
116
|
.dropdown-menu{
|
|
92
117
|
display:none;
|
|
93
118
|
}
|
|
94
|
-
#editorcontainerbox{
|
|
95
|
-
top:0;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
#settings, #importexport, #embed, #connectivity, #users {
|
|
100
|
-
top:59px;
|
|
101
119
|
}
|
|
102
120
|
</style>
|
|
103
121
|
|
package/.npmignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.ep_initialized
|
package/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var settings = require('ep_etherpad-lite/node/utils/Settings');
|
|
2
|
-
|
|
3
|
-
exports.clientVars = function(hook, context, callback){
|
|
4
|
-
/*
|
|
5
|
-
var ep_prompt_for_name = {};
|
|
6
|
-
try {
|
|
7
|
-
if (settings.ep_prompt_for_name){
|
|
8
|
-
if(!settings.ep_prompt_for_name.link){
|
|
9
|
-
console.warn("No link set for ep_prompt_for_name, add ep_prompt_for_name.link to settings.json");
|
|
10
|
-
ep_prompt_for_name.link = "https://github.com/JohnMcLear/ep_prompt_for_name";
|
|
11
|
-
}else{
|
|
12
|
-
ep_prompt_for_name.link = settings.ep_prompt_for_name.link;
|
|
13
|
-
}
|
|
14
|
-
if(!settings.ep_prompt_for_name.text){
|
|
15
|
-
ep_prompt_for_name.text = "NO TEXT SET";
|
|
16
|
-
console.warn("No text set for ep_prompt_for_name, add ep_prompt_for_name.text to settings.json");
|
|
17
|
-
}else{
|
|
18
|
-
ep_prompt_for_name.text = settings.ep_prompt_for_name.text;
|
|
19
|
-
}
|
|
20
|
-
if(!settings.ep_prompt_for_name.before){
|
|
21
|
-
ep_prompt_for_name.before = "#timesliderlink";
|
|
22
|
-
console.info("No before set for ep_prompt_for_name, this may be intentional, add ep_prompt_for_name.before to settings.json");
|
|
23
|
-
}else{
|
|
24
|
-
ep_prompt_for_name.before = settings.ep_prompt_for_name.before;
|
|
25
|
-
}
|
|
26
|
-
if(!settings.ep_prompt_for_name.classes){
|
|
27
|
-
ep_prompt_for_name.classes = "grouped-left";
|
|
28
|
-
console.info("No classes set for ep_prompt_for_name, this may be intentional, add ep_prompt_for_name.classes to settings.json");
|
|
29
|
-
}else{
|
|
30
|
-
ep_prompt_for_name.classes = settings.ep_prompt_for_name.classes;
|
|
31
|
-
}
|
|
32
|
-
if(!settings.ep_prompt_for_name.after){
|
|
33
|
-
console.info("No after set for ep_prompt_for_name, this may be intentional, add ep_prompt_for_name.classes to settings.json");
|
|
34
|
-
}else{
|
|
35
|
-
ep_prompt_for_name.after = settings.ep_prompt_for_name.after;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}else{
|
|
39
|
-
ep_prompt_for_name = {};
|
|
40
|
-
ep_prompt_for_name.link = "https://github.com/JohnMcLear/ep_prompt_for_name";
|
|
41
|
-
ep_prompt_for_name.text = "NO TEXT SET";
|
|
42
|
-
ep_prompt_for_name.before = "#timesliderlink";
|
|
43
|
-
ep_prompt_for_name.classes = "grouped-right";
|
|
44
|
-
console.warn("No link set for ep_prompt_for_name, add ep_prompt_for_name.link to settings.json");
|
|
45
|
-
console.warn("No text set for ep_prompt_for_name, add ep_prompt_for_name.text to settings.json");
|
|
46
|
-
}
|
|
47
|
-
} catch (e){
|
|
48
|
-
}
|
|
49
|
-
return callback({ep_prompt_for_name: ep_prompt_for_name});
|
|
50
|
-
*/
|
|
51
|
-
return callback();
|
|
52
|
-
};
|