Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95195ec

Browse files
committed
fix(app): remove Zepto.js dependency
Closes #1416
1 parent 981df45 commit 95195ec

File tree

5 files changed

+38
-30
lines changed

5 files changed

+38
-30
lines changed

docs/README.md

+19-17
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
- svg-pan-zoom: 3.6.1
2020
- tablesort: 5.4.0
2121
- vis: 4.21.0
22-
- zepto: 1.2.0
2322
- lunr: 2.3.9
2423

2524
## Entry files
@@ -59,26 +58,26 @@ npm run test
5958
npm install selenium-standalone@latest -g
6059
```
6160

62-
1. Configure `selenium-standalone`:
63-
61+
2. Configure `selenium-standalone`:
62+
6463
```shell
6564
selenium-standalone install
6665
```
6766

68-
1. Start `selenium-standalone`:
67+
3. Start `selenium-standalone`:
6968

7069
```shell
7170
selenium-standalone start
7271
```
7372

74-
1. Start local documentation generation in another terminal tab:
73+
4. Start local documentation generation in another terminal tab:
7574

7675
```shell
7776
npm run test:simple-doc
7877
```
7978

80-
1. Start local E2E testing:
81-
79+
5. Start local E2E testing:
80+
8281
```shell
8382
npm run local-test-e2e-mocha
8483
```
@@ -91,24 +90,26 @@ npm run test
9190
npm i
9291
```
9392

94-
1. Init
93+
2. Init
9594

9695
```shell
9796
npm run build
9897
```
9998

100-
1. Link
99+
3. Link
101100

102101
```shell
103102
npm link
104103
```
104+
105105
This will make `compodoc` command available everywhere.
106106

107-
1. Start
107+
4. Start
108108

109109
```shell
110110
npm start
111111
```
112+
112113
Launch watch process for source files and rollup build.
113114

114115
## Node.js inspecting
@@ -119,7 +120,7 @@ npm run test
119120
npm i sleep
120121
```
121122

122-
1. Add these lines in `index-cli.ts`, after `--files` check:
123+
2. Add these lines in `index-cli.ts`, after `--files` check:
123124

124125
```JavaScript
125126
const sleep = require('sleep');
@@ -130,18 +131,19 @@ npm run test
130131
}
131132
```
132133
133-
1. Open one terminal and run inside `compodoc` folder:
134+
3. Open one terminal and run inside `compodoc` folder:
134135
135136
```shell
136137
npm run start
137138
```
138139
139-
1. Add `debugger` statement where you want to debug your code.
140-
1. Open Chrome and this url: `chrome://inspect`.
141-
1. Open another terminal with the source code of the [demo project](https://github.com/compodoc/compodoc-demo-todomvc-angular), and run:
140+
4. Add `debugger` statement where you want to debug your code.
141+
5. Open Chrome and this url: `chrome://inspect`.
142+
6. Open another terminal with the source code of the [demo project](https://github.com/compodoc/compodoc-demo-todomvc-angular), and run:
142143
143144
```shell
144145
node --inspect ../compodoc/bin/index-cli.js -p tsconfig.json -a screenshots -n 'TodoMVC Angular documentation' --includes additional-doc --toggleMenuItems "'all'" -s
145146
```
146-
1. Compodoc will wait 10s before starting when it detects `--inspect` flag.
147-
1. Open the debug window in Chrome, and click `inspect`.
147+
148+
7. Compodoc will wait 10s before starting when it detects `--inspect` flag.
149+
8. Open the debug window in Chrome, and click `inspect`.

src/resources/js/menu.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -150,31 +150,30 @@ document.addEventListener('DOMContentLoaded', function () {
150150
faAngleUpClass = 'ion-ios-arrow-up',
151151
faAngleDownClass = 'ion-ios-arrow-down',
152152
toggleItemMenu = function (e) {
153-
var element = $(e.target),
154-
parent = element[0].parentNode,
153+
var element = e.target,
154+
parent = element.parentNode,
155155
parentLink,
156156
elementIconChild;
157157
if (parent) {
158-
if (!$(parent).hasClass('linked')) {
158+
if (!parent.classList.contains('linked')) {
159159
e.preventDefault();
160160
} else {
161161
parentLink = parent.parentNode;
162-
if (parentLink && element.hasClass('link-name')) {
163-
$(parentLink).trigger('click');
162+
if (parentLink && element.classList.contains('link-name')) {
163+
parentLink.trigger('click');
164164
}
165165
}
166166
elementIconChild = parent.getElementsByClassName(faAngleUpClass)[0];
167167
if (!elementIconChild) {
168168
elementIconChild = parent.getElementsByClassName(faAngleDownClass)[0];
169169
}
170170
if (elementIconChild) {
171-
elementIconChild = $(elementIconChild);
172-
if (elementIconChild.hasClass(faAngleUpClass)) {
173-
elementIconChild.addClass(faAngleDownClass);
174-
elementIconChild.removeClass(faAngleUpClass);
171+
if (elementIconChild.classList.contains(faAngleUpClass)) {
172+
elementIconChild.classList.add(faAngleDownClass);
173+
elementIconChild.classList.remove(faAngleUpClass);
175174
} else {
176-
elementIconChild.addClass(faAngleUpClass);
177-
elementIconChild.removeClass(faAngleDownClass);
175+
elementIconChild.classList.add(faAngleUpClass);
176+
elementIconChild.classList.remove(faAngleDownClass);
178177
}
179178
}
180179
}

src/resources/js/search/search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
$li.appendChild($groupTitle);
9696

9797
var $ulResults = document.createElement('ul');
98-
$ulResults.classList.add('search-results-lit');
98+
$ulResults.classList.add('search-results-list');
9999

100100
groups[property].results.forEach(function (res) {
101101
var link = '';

test/wdio/tests.js

+7
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@ describe('Compodoc page', () => {
2323
await expect(color.value).toEqual('rgba(33,33,33,1)');
2424
}
2525
});
26+
27+
it('should open menu for specific page', async () => {
28+
await browser.url('http://localhost:4000/modules.html');
29+
await browser.pause(3000);
30+
const menuModulesItem = await $('.d-md-block.menu .menu-toggler');
31+
await expect(menuModulesItem).toHaveElementClass('linked');
32+
});
2633
});

wdio.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ exports.config = {
6060
{
6161
browserName: 'firefox',
6262
'moz:firefoxOptions': {
63-
binary: `/Applications/FirefoxNightly.app/Contents/MacOS/firefox`
63+
binary: `/Applications/Firefox.app/Contents/MacOS/firefox`
6464
}
6565
}
6666
],

0 commit comments

Comments
 (0)