ep_author_hover 0.3.55 → 1.0.2

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.
@@ -6,36 +6,11 @@ on:
6
6
  pull_request:
7
7
  branches: [ "main" ]
8
8
  schedule:
9
- - cron: "46 0 * * 6"
9
+ - cron: "48 0 * * 2"
10
+
10
11
 
11
12
  jobs:
12
13
  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
14
+ uses: ether/ether-pipelines/.github/workflows/codeql-plugins.yml@main
15
+ secrets: inherit
37
16
 
38
- - name: Perform CodeQL Analysis
39
- uses: github/codeql-action/analyze@v2
40
- with:
41
- category: "/language:${{ matrix.language }}"
@@ -0,0 +1,7 @@
1
+ name: Node.js Package
2
+ on: [push]
3
+
4
+ jobs:
5
+ backend:
6
+ uses: ether/ether-pipelines/.github/workflows/test-and-release-plugins.yml@main
7
+ secrets: inherit
@@ -0,0 +1,10 @@
1
+ {
2
+ "@metadata": {
3
+ "authors": [
4
+ "Atriwidada"
5
+ ]
6
+ },
7
+ "ep_author_hover.me": "Saya",
8
+ "ep_author_hover.unknow_author": "Penulis Tidak Diketahui",
9
+ "ep_author_hover.showHoverLabel": "Tampilkan Penulis saat Mengapung"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "@metadata": {
3
+ "authors": [
4
+ "Inabat Allanova"
5
+ ]
6
+ },
7
+ "ep_author_hover.me": "Ózim",
8
+ "ep_author_hover.unknow_author": "Belgisiz avtor",
9
+ "ep_author_hover.showHoverLabel": "Avtordı Hoverde kórsetiw"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "@metadata": {
3
+ "authors": [
4
+ "Nokeoo"
5
+ ]
6
+ },
7
+ "ep_author_hover.me": "Aš",
8
+ "ep_author_hover.unknow_author": "Nežinomas autorius",
9
+ "ep_author_hover.showHoverLabel": "Rodyti autorių užvedus pelę"
10
+ }
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "ep_author_hover",
8
8
  "description": "Adds author names to span titles (shows on hover), works as authors change their name. Hover includes author color and fast switching between author spans. Hat tip to Martyn York for the initial work on this.",
9
- "version": "0.3.55",
9
+ "version": "1.0.2",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git@github.com:JohnMcLear/ep_author_hover.git"
@@ -16,18 +16,15 @@
16
16
  "url": "https://etherpad.org/"
17
17
  },
18
18
  "devDependencies": {
19
- "eslint": "^8.11.0",
20
- "eslint-config-etherpad": "^3.0.9",
21
- "typescript": "^4.6.2"
19
+ "eslint": "^8.57.0",
20
+ "eslint-config-etherpad": "^3.0.22",
21
+ "typescript": "^5.4.2"
22
+ },
23
+ "engines": {
24
+ "node": ">=18.0.0"
22
25
  },
23
26
  "scripts": {
24
27
  "lint": "eslint .",
25
28
  "lint:fix": "eslint --fix ."
26
- },
27
- "engines": {
28
- "node": ">=12.17.0"
29
- },
30
- "peerDependencies": {
31
- "ep_etherpad-lite": ">=1.8.6"
32
29
  }
33
- }
30
+ }
@@ -1,20 +1,19 @@
1
1
  'use strict';
2
2
 
3
3
  const padcookie = require('ep_etherpad-lite/static/js/pad_cookie').padcookie;
4
+ import html10n from 'ep_etherpad-lite/static/js/vendors/html10n'
4
5
 
5
6
  let timer = 0;
6
7
 
7
8
  const showAuthor = {
8
- enable: (context) => {
9
- context.ace.callWithAce((ace) => {
10
- const doc = ace.ace_getDocument();
11
- $(doc).find('#innerdocbody').mousemove(exports.showAuthor.hover.bind(ace));
12
- }, 'showAuthor', true);
9
+ enable: () => {
10
+ $('iframe[name="ace_outer"]').contents().find('iframe')
11
+ .contents().find('#innerdocbody').on('mousemove',exports.showAuthor.hover);
13
12
  },
14
13
  disable: (context) => {
15
14
  context.ace.callWithAce((ace) => {
16
15
  const doc = ace.ace_getDocument();
17
- $(doc).find('#innerdocbody').mousemove(null.bind(ace));
16
+ $(doc).find('#innerdocbody').on('mousemove',null.bind(ace));
18
17
  }, 'showAuthor', true);
19
18
  },
20
19
  hover: (span) => {
@@ -34,7 +33,7 @@ const showAuthor = {
34
33
  if (!authorId) { return; } // Default text isn't shown
35
34
  showAuthor.destroy(); // Destroy existing
36
35
  const authorNameAndColor =
37
- showAuthor.authorNameAndColorFromAuthorId(authorId); // Get the authorName And Color
36
+ showAuthor.authorNameAndColorFromAuthorId(authorId); // Get the authorName And Color
38
37
  showAuthor.draw(span, authorNameAndColor.name, authorNameAndColor.color);
39
38
  }
40
39
  },
@@ -57,7 +56,7 @@ const showAuthor = {
57
56
  const myAuthorId = pad.myUserInfo.userId.substring(0, 14);
58
57
  if (myAuthorId === authorId) {
59
58
  return {
60
- name: window._('ep_author_hover.me'),
59
+ name: html10n.get('ep_author_hover.me'),
61
60
  color: '#fff',
62
61
  };
63
62
  }
@@ -68,7 +67,7 @@ const showAuthor = {
68
67
  if (authorId === $(this).data('authorid').substring(0, 14)) {
69
68
  $(this).find('.usertdname').each(function () {
70
69
  authorObj.name = $(this).text();
71
- if (authorObj.name === '') authorObj.name = window._('ep_author_hover.unknow_author');
70
+ if (authorObj.name === '') authorObj.name = html10n.get('ep_author_hover.unknow_author');
72
71
  });
73
72
  $(this).find('.usertdswatch > div').each(function () {
74
73
  authorObj.color = $(this).css('background-color');
@@ -83,12 +82,12 @@ const showAuthor = {
83
82
  authorObj = clientVars.collab_client_vars.historicalAuthorData[fullAuthorId];
84
83
  }
85
84
 
86
- return authorObj || {name: window._('ep_author_hover.unknow_author'), color: '#fff'};
85
+ return authorObj || {name: html10n.get('ep_author_hover.unknow_author'), color: '#fff'};
87
86
  },
88
87
  draw: (target, authorName, authorColor) => {
89
88
  if (!authorName) {
90
89
  const warning =
91
- 'No authorName, I have no idea why! Help me debug this by providing steps to replicate!';
90
+ 'No authorName, I have no idea why! Help me debug this by providing steps to replicate!';
92
91
  console.warn(warning);
93
92
  return;
94
93
  }
@@ -144,11 +143,7 @@ exports.postAceInit = (hookName, context) => {
144
143
  $('#options-author-hover').attr('checked', 'checked');
145
144
  }
146
145
 
147
- if ($('#options-author-hover').is(':checked')) {
148
- clientVars.plugins.plugins.ep_author_hover.enabled = true;
149
- } else {
150
- clientVars.plugins.plugins.ep_author_hover.enabled = false;
151
- }
146
+ clientVars.plugins.plugins.ep_author_hover.enabled = !!$('#options-author-hover').is(':checked');
152
147
 
153
148
  /* on click */
154
149
  $('#options-author-hover').on('click', () => {
@@ -1,77 +0,0 @@
1
- name: "Backend tests"
2
-
3
- # any branch is useful for testing before a PR is submitted
4
- on: [push, pull_request]
5
-
6
- jobs:
7
- withplugins:
8
- # run on pushes to any branch
9
- # run on PRs from external forks
10
- if: |
11
- (github.event_name != 'pull_request')
12
- || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
13
- name: with Plugins
14
- runs-on: ubuntu-latest
15
-
16
- steps:
17
- -
18
- name: Install libreoffice
19
- run: |
20
- sudo add-apt-repository -y ppa:libreoffice/ppa
21
- sudo apt update
22
- sudo apt install -y --no-install-recommends libreoffice libreoffice-pdfimport
23
- -
24
- name: Install etherpad core
25
- uses: actions/checkout@v3
26
- with:
27
- repository: ether/etherpad-lite
28
- -
29
- name: Checkout plugin repository
30
- uses: actions/checkout@v3
31
- with:
32
- path: ./node_modules/__tmp
33
- -
34
- name: Determine plugin name
35
- id: plugin_name
36
- run: |
37
- cd ./node_modules/__tmp
38
- npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
39
- -
40
- name: Rename plugin directory
41
- run: |
42
- mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
43
- env:
44
- PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
45
- -
46
- uses: actions/setup-node@v3
47
- with:
48
- node-version: 20
49
- cache: 'npm'
50
- cache-dependency-path: |
51
- src/package-lock.json
52
- src/bin/doc/package-lock.json
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
56
- -
57
- name: Install plugin dependencies
58
- run: |
59
- cd ./node_modules/"${PLUGIN_NAME}"
60
- npm ci
61
- env:
62
- PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
63
- # Etherpad core dependencies must be installed after installing the
64
- # plugin's dependencies, otherwise npm will try to hoist common
65
- # dependencies by removing them from src/node_modules and installing them
66
- # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
67
- # to be buggy, because it sometimes removes dependencies from
68
- # src/node_modules but fails to add them to the top-level node_modules.
69
- # Even if npm correctly hoists the dependencies, the hoisting seems to
70
- # confuse tools such as `npm outdated`, `npm update`, and some ESLint
71
- # rules.
72
- -
73
- name: Install Etherpad core dependencies
74
- run: src/bin/installDeps.sh
75
- -
76
- name: Run the backend tests
77
- run: cd src && npm test
@@ -1,101 +0,0 @@
1
- # Publicly credit Sauce Labs because they generously support open source
2
- # projects.
3
- name: "frontend tests powered by Sauce Labs"
4
-
5
- on: [push]
6
-
7
- jobs:
8
- test:
9
- runs-on: ubuntu-latest
10
- if: ${{ github.actor != 'dependabot[bot]' }}
11
- steps:
12
- -
13
- name: Generate Sauce Labs strings
14
- id: sauce_strings
15
- run: |
16
- printf %s\\n '::set-output name=name::${{github.event.repository.name}} ${{ github.workflow }} - ${{ github.job }}'
17
- printf %s\\n '::set-output name=tunnel_id::${{ github.run_id }}-${{ github.run_number }}-${{ github.job }}'
18
- -
19
- name: Check out Etherpad core
20
- uses: actions/checkout@v3
21
- with:
22
- repository: ether/etherpad-lite
23
- -
24
- uses: actions/setup-node@v3
25
- with:
26
- node-version: 20
27
- cache: 'npm'
28
- cache-dependency-path: |
29
- src/package-lock.json
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
33
- -
34
- name: Check out the plugin
35
- uses: actions/checkout@v3
36
- with:
37
- path: ./node_modules/__tmp
38
- -
39
- name: export GIT_HASH to env
40
- id: environment
41
- run: |
42
- cd ./node_modules/__tmp
43
- echo "::set-output name=sha_short::$(git rev-parse --short ${{ github.sha }})"
44
- -
45
- name: Determine plugin name
46
- id: plugin_name
47
- run: |
48
- cd ./node_modules/__tmp
49
- npx -c 'printf %s\\n "::set-output name=plugin_name::${npm_package_name}"'
50
- -
51
- name: Rename plugin directory
52
- env:
53
- PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
54
- run: |
55
- mv ./node_modules/__tmp ./node_modules/"${PLUGIN_NAME}"
56
- -
57
- name: Install plugin dependencies
58
- env:
59
- PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
60
- run: |
61
- cd ./node_modules/"${PLUGIN_NAME}"
62
- npm ci
63
- # Etherpad core dependencies must be installed after installing the
64
- # plugin's dependencies, otherwise npm will try to hoist common
65
- # dependencies by removing them from src/node_modules and installing them
66
- # in the top-level node_modules. As of v6.14.10, npm's hoist logic appears
67
- # to be buggy, because it sometimes removes dependencies from
68
- # src/node_modules but fails to add them to the top-level node_modules.
69
- # Even if npm correctly hoists the dependencies, the hoisting seems to
70
- # confuse tools such as `npm outdated`, `npm update`, and some ESLint
71
- # rules.
72
- -
73
- name: Install Etherpad core dependencies
74
- run: src/bin/installDeps.sh
75
- -
76
- name: Create settings.json
77
- run: cp settings.json.template settings.json
78
- -
79
- name: Disable import/export rate limiting
80
- run: |
81
- sed -e '/^ *"importExportRateLimiting":/,/^ *\}/ s/"max":.*/"max": 0/' -i settings.json
82
- -
83
- name: Remove standard frontend test files
84
- run: rm -rf src/tests/frontend/specs
85
- -
86
- uses: saucelabs/sauce-connect-action@v2.1.1
87
- with:
88
- username: ${{ secrets.SAUCE_USERNAME }}
89
- accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
90
- tunnelIdentifier: ${{ steps.sauce_strings.outputs.tunnel_id }}
91
- -
92
- name: Run the frontend tests
93
- shell: bash
94
- env:
95
- SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
96
- SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
97
- SAUCE_NAME: ${{ steps.sauce_strings.outputs.name }}
98
- TRAVIS_JOB_NUMBER: ${{ steps.sauce_strings.outputs.tunnel_id }}
99
- GIT_HASH: ${{ steps.environment.outputs.sha_short }}
100
- run: |
101
- src/tests/frontend/travis/runner.sh
@@ -1,126 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to the npm registry when a release is created
2
- # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- pull_request:
8
- push:
9
- branches:
10
- - main
11
- - master
12
-
13
- jobs:
14
- test:
15
- runs-on: ubuntu-latest
16
- steps:
17
- # Clone ether/etherpad-lite to ../etherpad-lite so that ep_etherpad-lite
18
- # can be "installed" in this plugin's node_modules. The checkout v2 action
19
- # doesn't support cloning outside of $GITHUB_WORKSPACE (see
20
- # https://github.com/actions/checkout/issues/197), so the repo is first
21
- # cloned to etherpad-lite then moved to ../etherpad-lite. To avoid
22
- # conflicts with this plugin's clone, etherpad-lite must be cloned and
23
- # moved out before this plugin's repo is cloned to $GITHUB_WORKSPACE.
24
- -
25
- uses: actions/checkout@v3
26
- with:
27
- repository: ether/etherpad-lite
28
- path: etherpad-lite
29
- -
30
- run: mv etherpad-lite ..
31
- # etherpad-lite has been moved outside of $GITHUB_WORKSPACE, so it is now
32
- # safe to clone this plugin's repo to $GITHUB_WORKSPACE.
33
- -
34
- uses: actions/checkout@v3
35
- # This is necessary for actions/setup-node because '..' can't be used in
36
- # cache-dependency-path.
37
- -
38
- name: Create ep_etherpad-lite symlink
39
- run: |
40
- mkdir -p node_modules
41
- ln -s ../../etherpad-lite/src node_modules/ep_etherpad-lite
42
- -
43
- uses: actions/setup-node@v3
44
- with:
45
- node-version: 20
46
- cache: 'npm'
47
- cache-dependency-path: |
48
- node_modules/ep_etherpad-lite/package-lock.json
49
- node_modules/ep_etherpad-lite/bin/doc/package-lock.json
50
- package-lock.json
51
- - run: npm install npm@6.14.18 -g
52
- name: Install legacy npm for correct dependency resolution
53
- # All of ep_etherpad-lite's devDependencies are installed because the
54
- # plugin might do `require('ep_etherpad-lite/node_modules/${devDep}')`.
55
- # Eventually it would be nice to create an ESLint plugin that prohibits
56
- # Etherpad plugins from piggybacking off of ep_etherpad-lite's
57
- # devDependencies. If we had that, we could change this line to only
58
- # install production dependencies.
59
- -
60
- run: cd ../etherpad-lite/src && npm ci
61
- -
62
- run: npm ci
63
- # This runs some sanity checks and creates a symlink at
64
- # node_modules/ep_etherpad-lite that points to ../../etherpad-lite/src.
65
- # This step must be done after `npm ci` installs the plugin's dependencies
66
- # because npm "helpfully" cleans up such symlinks. :( Installing
67
- # ep_etherpad-lite in the plugin's node_modules prevents lint errors and
68
- # unit test failures if the plugin does `require('ep_etherpad-lite/foo')`.
69
- -
70
- run: npm install --no-save ep_etherpad-lite@file:../etherpad-lite/src
71
- -
72
- run: npm test
73
- -
74
- run: npm run lint
75
-
76
- publish-npm:
77
- if: github.event_name == 'push'
78
- needs: test
79
- runs-on: ubuntu-latest
80
- steps:
81
- -
82
- uses: actions/checkout@v3
83
- with:
84
- fetch-depth: 0
85
- -
86
- uses: actions/setup-node@v3
87
- with:
88
- node-version: 20
89
- registry-url: https://registry.npmjs.org/
90
- cache: 'npm'
91
- - run: npm install npm@6.14.18 -g
92
- name: Install legacy npm for correct dependency resolution
93
- -
94
- name: Bump version (patch)
95
- run: |
96
- LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
97
- NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
98
- [ "${NEW_COMMITS}" -gt 0 ] || exit 0
99
- git config user.name 'github-actions[bot]'
100
- git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
101
- npm ci
102
- npm version patch
103
- git push --follow-tags
104
- # This is required if the package has a prepare script that uses something
105
- # in dependencies or devDependencies.
106
- -
107
- run: npm ci
108
- # `npm publish` must come after `git push` otherwise there is a race
109
- # condition: If two PRs are merged back-to-back then master/main will be
110
- # updated with the commits from the second PR before the first PR's
111
- # workflow has a chance to push the commit generated by `npm version
112
- # patch`. This causes the first PR's `git push` step to fail after the
113
- # package has already been published, which in turn will cause all future
114
- # workflow runs to fail because they will all attempt to use the same
115
- # already-used version number. By running `npm publish` after `git push`,
116
- # back-to-back merges will cause the first merge's workflow to fail but
117
- # the second's will succeed.
118
- -
119
- run: npm publish
120
- env:
121
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
122
- -
123
- name: Add package to etherpad organization
124
- run: npm access grant read-write etherpad:developers
125
- env:
126
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}