ep_set_title_on_pad 0.5.51 → 0.6.1

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.
@@ -22,12 +22,12 @@ jobs:
22
22
  sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
23
23
  -
24
24
  name: Install etherpad core
25
- uses: actions/checkout@v3
25
+ uses: actions/checkout@v4
26
26
  with:
27
27
  repository: ether/etherpad-lite
28
28
  -
29
29
  name: Checkout plugin repository
30
- uses: actions/checkout@v3
30
+ uses: actions/checkout@v4
31
31
  with:
32
32
  path: ./node_modules/__tmp
33
33
  -
@@ -45,12 +45,14 @@ jobs:
45
45
  -
46
46
  uses: actions/setup-node@v3
47
47
  with:
48
- node-version: 12
48
+ node-version: 20
49
49
  cache: 'npm'
50
50
  cache-dependency-path: |
51
51
  src/package-lock.json
52
52
  src/bin/doc/package-lock.json
53
53
  node_modules/${{ steps.plugin_name.outputs.plugin_name }}/package-lock.json
54
+ - run: npm install npm@6.14.18 -g
55
+ name: Install legacy npm for correct dependency resolution
54
56
  -
55
57
  name: Install plugin dependencies
56
58
  run: |
@@ -0,0 +1,41 @@
1
+ name: "CodeQL"
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+ schedule:
9
+ - cron: "41 16 * * 0"
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@v4
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 }}"
@@ -7,19 +7,8 @@ on: [push]
7
7
  jobs:
8
8
  test:
9
9
  runs-on: ubuntu-latest
10
-
10
+ if: ${{ github.actor != 'dependabot[bot]' }}
11
11
  steps:
12
- -
13
- name: Fail if Dependabot
14
- if: github.actor == 'dependabot[bot]'
15
- run: |
16
- cat <<EOF >&2
17
- Frontend tests skipped because Dependabot can't access secrets.
18
- Manually re-run the jobs to run the frontend tests.
19
- For more information, see:
20
- https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
21
- EOF
22
- exit 1
23
12
  -
24
13
  name: Generate Sauce Labs strings
25
14
  id: sauce_strings
@@ -28,20 +17,22 @@ jobs:
28
17
  printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}'
29
18
  -
30
19
  name: Check out Etherpad core
31
- uses: actions/checkout@v3
20
+ uses: actions/checkout@v4
32
21
  with:
33
22
  repository: ether/etherpad-lite
34
23
  -
35
24
  uses: actions/setup-node@v3
36
25
  with:
37
- node-version: 12
26
+ node-version: 20
38
27
  cache: 'npm'
39
28
  cache-dependency-path: |
40
29
  src/package-lock.json
41
30
  src/bin/doc/package-lock.json
31
+ - run: npm install npm@6.14.18 -g
32
+ name: Install legacy npm for correct dependency resolution
42
33
  -
43
34
  name: Check out the plugin
44
- uses: actions/checkout@v3
35
+ uses: actions/checkout@v4
45
36
  with:
46
37
  path: ./node_modules/__tmp
47
38
  -
@@ -92,7 +83,7 @@ jobs:
92
83
  name: Remove standard frontend test files
93
84
  run: rm -rf src/tests/frontend/specs
94
85
  -
95
- uses: saucelabs/sauce-connect-action@v2.1.1
86
+ uses: saucelabs/sauce-connect-action@v2.3.4
96
87
  with:
97
88
  username: ${{ secrets.SAUCE_USERNAME }}
98
89
  accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
@@ -22,7 +22,7 @@ jobs:
22
22
  # conflicts with this plugin's clone, etherpad-lite must be cloned and
23
23
  # moved out before this plugin's repo is cloned to $GITHUB_WORKSPACE.
24
24
  -
25
- uses: actions/checkout@v3
25
+ uses: actions/checkout@v4
26
26
  with:
27
27
  repository: ether/etherpad-lite
28
28
  path: etherpad-lite
@@ -31,7 +31,7 @@ jobs:
31
31
  # etherpad-lite has been moved outside of $GITHUB_WORKSPACE, so it is now
32
32
  # safe to clone this plugin's repo to $GITHUB_WORKSPACE.
33
33
  -
34
- uses: actions/checkout@v3
34
+ uses: actions/checkout@v4
35
35
  # This is necessary for actions/setup-node because '..' can't be used in
36
36
  # cache-dependency-path.
37
37
  -
@@ -42,12 +42,14 @@ jobs:
42
42
  -
43
43
  uses: actions/setup-node@v3
44
44
  with:
45
- node-version: 12
45
+ node-version: 20
46
46
  cache: 'npm'
47
47
  cache-dependency-path: |
48
48
  node_modules/ep_etherpad-lite/package-lock.json
49
49
  node_modules/ep_etherpad-lite/bin/doc/package-lock.json
50
50
  package-lock.json
51
+ - run: npm install npm@6.14.18 -g
52
+ name: Install legacy npm for correct dependency resolution
51
53
  # All of ep_etherpad-lite's devDependencies are installed because the
52
54
  # plugin might do `require('ep_etherpad-lite/node_modules/${devDep}')`.
53
55
  # Eventually it would be nice to create an ESLint plugin that prohibits
@@ -77,7 +79,7 @@ jobs:
77
79
  runs-on: ubuntu-latest
78
80
  steps:
79
81
  -
80
- uses: actions/checkout@v3
82
+ uses: actions/checkout@v4
81
83
  with:
82
84
  fetch-depth: 0
83
85
  -
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ep_set_title_on_pad",
3
3
  "description": "Set the title on a pad in Etherpad, also includes real time updates to the UI",
4
- "version": "0.5.51",
4
+ "version": "0.6.1",
5
5
  "license": "Apache-2.0",
6
6
  "author": "johnyma22 (John McLear) <john@mclear.co.uk>",
7
7
  "keywords": [
@@ -26,9 +26,9 @@
26
26
  "url": "https://etherpad.org/"
27
27
  },
28
28
  "devDependencies": {
29
- "eslint": "^8.11.0",
30
- "eslint-config-etherpad": "^3.0.9",
31
- "typescript": "^4.6.2"
29
+ "eslint": "^8.51.0",
30
+ "eslint-config-etherpad": "^3.0.22",
31
+ "typescript": "^4.9.5"
32
32
  },
33
33
  "scripts": {
34
34
  "lint": "eslint .",
@@ -3,11 +3,14 @@
3
3
  exports.handleClientMessage_CUSTOM = (hook, context, cb) => {
4
4
  if (context.payload.action === 'recieveTitleMessage') {
5
5
  const message = context.payload.message;
6
- if (!$('#input_title').is(':visible')) { // if we're not editing..
6
+ const padTitleElement = $('#input_title');
7
+ const titleTag = $('#title > h1 > a');
8
+ if (!padTitleElement.is(':visible')) { // if we're not editing..
7
9
  if (message) {
8
10
  window.document.title = message;
9
- $('#title > h1 > a').text(message);
10
- $('#input_title').val(message);
11
+ titleTag.text(message);
12
+ titleTag.removeAttr('data-l10n-id');
13
+ padTitleElement.val(message);
11
14
  clientVars.ep_set_title_on_pad = {};
12
15
  clientVars.ep_set_title_on_pad.title = message;
13
16
  }
@@ -39,6 +42,7 @@ exports.documentReady = () => {
39
42
 
40
43
  if (!clientVars.ep_set_title_on_pad) {
41
44
  $('#title > h1 > a').text(clientVars.padId);
45
+ $('#title > h1 > a').removeAttr('data-l10n-id');
42
46
  }
43
47
 
44
48
  if (!$('#editorcontainerbox').hasClass('flex-layout')) {
@@ -46,7 +50,7 @@ exports.documentReady = () => {
46
50
  title: 'Error',
47
51
  text: 'ep_set_title_on_pad: Upgrade to etherpad 1.8.3+ for this plugin to work correctly',
48
52
  sticky: true,
49
- class_name: 'error',
53
+ class_name: 'error', // eslint-disable-line camelcase
50
54
  });
51
55
  }
52
56
 
@@ -62,12 +66,21 @@ exports.documentReady = () => {
62
66
  sendTitle();
63
67
  window.document.title = $('#input_title').val();
64
68
  $('#title > h1 > a').text($('#input_title').val());
69
+ $('#title > h1 > a').removeAttr('data-l10n-id');
65
70
  $('#title, #edit_title').show();
66
71
  $('#input_title, #save_title').hide();
67
72
  });
68
73
 
74
+ function debounce(func, timeout = 300) {
75
+ let timer;
76
+ return (...args) => {
77
+ clearTimeout(timer);
78
+ timer = setTimeout(() => { func.apply(this, args); }, timeout);
79
+ };
80
+ }
81
+
69
82
  $('#input_title').keyup((e) => {
70
- sendTitle();
83
+ debounce(sendTitle);
71
84
  window.document.title = $('#input_title').val();
72
85
  $('#title > h1').text($('#input_title').val());
73
86
  if (e.keyCode === 13) {