Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
private_message-3099166
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
private_message-3099166
Commits
8c5bc640
Commit
8c5bc640
authored
6 years ago
by
Jay Friendly
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2947739
by Jaypan: Updating documentation on nodeJS integration
parent
ce8c559f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/private_message_nodejs/README.md
+37
-23
37 additions, 23 deletions
modules/private_message_nodejs/README.md
modules/private_message_nodejs/private_message_nodejs.info.yml
+2
-2
2 additions, 2 deletions
...es/private_message_nodejs/private_message_nodejs.info.yml
with
39 additions
and
25 deletions
modules/private_message_nodejs/README.md
+
37
−
23
View file @
8c5bc640
...
...
@@ -23,44 +23,58 @@ use of polling,by integration with Nodejs, which handles updates in realtime.
*
No ajax polling means less work for the browser.
*
No ajax polling means less work for the server.
*
Message threads immediately show new messages
*
In-page browser notifications when new messages are received (optional).
## Requirements
*
[
Private Message module
](
https://www.drupal.org/project/private_message
)
*
[
Nodejs
module
](
https://
www.drupal.org/project/
nodejs
)
*
[
Node
.
js
](
https://nodejs
.org/
)
##
Hooking into a notification (JavaScript)
##
Installation
Add a listener for the
`pm:threads:poll`
on the
`window`
object as follows:
### 1. Install Node.js
```
JavaScript
$(window).on('pm:threads:poll', function(event, data) {
// Add your functionality here.
});
```
Instructions on Node.js installation are not provided here, as they differ per
system, and instructions are outside the scope of this document. Please see
the
[
Node.js homepage
](
https://nodejs.org/en/
)
for more information.
## Installation
### 2. Install the module
Install the private_message_nodejs module as you would any Drupal module.
### 3. Install the nodeJS dependendencies
On the command line, navigate to [PRIVATE_MESSAGE_MODULE_ROOT]/modules/private_message_nodejs/nodejs and run the
following command:
`npm install`
### 4. Confirm the Nodejs server is working
On the command line, navigate to [PRIVATE_MESSAGE_MODULE_ROOT]/modules/private_message_nodejs/nodejs and run the
following command:
`node app.js`
### 1. Install the module
Note: Leave this open and running, as closing the server will stop it from
working.
Install the module as you would any Drupal module.
### 5. Enter the URL to the node.js server in the private message configuration
### 2. Set up the Nodejs module
In the web browser, navigate to /admin/config/private_message/config. Expand the
Private Message Nodejs settings section, and enter the URL to the node JS app.
It should be found at [your domain]:8080. Save.
See the documentation on the
[
Nodejs module page
](
https://www.drupal.org/project/nodejs
)
for directions on
setting up Drupal to work with Nodejs.
### 6. Test
### 3. Confirm the Nodejs server is working
Open up the private message page and check that there has been some output in
the command line, indicating that connections have been made to the Nodejs
server.
Check the status reports page at
`/admin/reports/status`
and ensure that the
Nodejs server is running. If you do not get a positive result, refer to the
documentation for that module, and/or open a ticket in the Nodejs issue queue
(linked to in step 2 above).
## Authors
The Private Message Nodejs module was by
[
Jeremy Graham
](
http://jez.me
)
, and
integrated into the Private Message module as a submodule by
[
Jaypan
](
https://www.drupal.org/u/jaypan
)
.
The Private Message Nodejs module was first written by
[
Jeremy Graham
](
http://jez.me
)
, integrating with the Drupal Node.js module.
A custom implementation that does not depend on that module was then written
by
[
Jay Friendly
](
https://www.jaypan.com
)
.
This diff is collapsed.
Click to expand it.
modules/private_message_nodejs/private_message_nodejs.info.yml
+
2
−
2
View file @
8c5bc640
name
:
Private Message Node
JS
description
:
Utilize Node
JS
for instant message notifications without polling.
name
:
Private Message Node
.js
description
:
Utilize
s
Node
.js
for instant message notifications without polling.
type
:
module
core
:
'
8.x'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment