ep_table_of_contents 0.3.63 → 0.3.67

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.
@@ -0,0 +1,41 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ pull_request:
7
+ branches: [ "master" ]
8
+ schedule:
9
+ - cron: "46 6 * * 3"
10
+
11
+ jobs:
12
+ analyze:
13
+ name: Analyze
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ actions: read
17
+ contents: read
18
+ security-events: write
19
+
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ language: [ javascript ]
24
+
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@v3
28
+
29
+ - name: Initialize CodeQL
30
+ uses: github/codeql-action/init@v2
31
+ with:
32
+ languages: ${{ matrix.language }}
33
+ queries: +security-and-quality
34
+
35
+ - name: Autobuild
36
+ uses: github/codeql-action/autobuild@v2
37
+
38
+ - name: Perform CodeQL Analysis
39
+ uses: github/codeql-action/analyze@v2
40
+ with:
41
+ category: "/language:${{ matrix.language }}"
@@ -83,7 +83,7 @@ jobs:
83
83
  name: Remove standard frontend test files
84
84
  run: rm -rf src/tests/frontend/specs
85
85
  -
86
- uses: saucelabs/sauce-connect-action@v2.1.1
86
+ uses: saucelabs/sauce-connect-action@v2.3.4
87
87
  with:
88
88
  username: ${{ secrets.SAUCE_USERNAME }}
89
89
  accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ep_table_of_contents",
3
- "version": "0.3.63",
3
+ "version": "0.3.67",
4
4
  "description": "View a table of contents for your pad",
5
5
  "author": {
6
6
  "name": "John McLear",
@@ -29,8 +29,8 @@
29
29
  "url": "https://etherpad.org/"
30
30
  },
31
31
  "devDependencies": {
32
- "eslint": "^8.35.0",
33
- "eslint-config-etherpad": "^3.0.9",
32
+ "eslint": "^8.46.0",
33
+ "eslint-config-etherpad": "^3.0.13",
34
34
  "typescript": "^4.9.5"
35
35
  },
36
36
  "scripts": {
@@ -11,16 +11,17 @@ exports.postAceInit = () => {
11
11
  class_name: 'error',
12
12
  });
13
13
  }
14
+ const optionToc = $('#options-toc');
14
15
  /* on click */
15
- $('#options-toc').on('click', () => {
16
- if ($('#options-toc').is(':checked')) {
16
+ optionToc.on('click', () => {
17
+ if (optionToc.is(':checked')) {
17
18
  tableOfContents.enable(); // enables line tocping
18
19
  } else {
19
- $('#options-toc').attr('checked', false);
20
+ optionToc.attr('checked', false);
20
21
  tableOfContents.disable(); // disables line tocping
21
22
  }
22
23
  });
23
- if ($('#options-toc').is(':checked')) {
24
+ if (optionToc.is(':checked')) {
24
25
  tableOfContents.enable();
25
26
  } else {
26
27
  tableOfContents.disable();
@@ -28,10 +29,7 @@ exports.postAceInit = () => {
28
29
 
29
30
  const urlContainstocTrue = tableOfContents.getParam('toc'); // if the url param is set
30
31
  if (urlContainstocTrue) {
31
- $('#options-toc').attr('checked', 'checked');
32
+ optionToc.attr('checked', 'checked');
32
33
  tableOfContents.enable();
33
- } else {
34
- $('#options-toc').attr('checked', false);
35
- tableOfContents.disable();
36
34
  }
37
35
  };
package/static/js/toc.js CHANGED
@@ -131,10 +131,8 @@ const tableOfContents = {
131
131
  },
132
132
 
133
133
  getParam: (sname) => {
134
- let sval = true;
135
- const urlParams = new URLSearchParams(location.href);
136
- if (urlParams.get(sname) === 'false') sval = false;
137
- return sval;
134
+ const urlParams = new URLSearchParams(window.location.search);
135
+ return urlParams.has(sname);
138
136
  },
139
137
 
140
138
  };