Skip to content

Commit 8a3def2

Browse files
committed
Merge pull request #2 from bradmb/panel-docking
Panel docking and improved README file
2 parents f168ee7 + 0302702 commit 8a3def2

File tree

11 files changed

+293
-133
lines changed

11 files changed

+293
-133
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,4 @@ FakesAssemblies/
211211
GeneratedArtifacts/
212212
_Pvt_Extensions/
213213
ModelManifest.xml
214+
/sl.js/release/release.zip

README.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,44 @@ You'll also need to grab your Slack token (or generate a new one) and locate the
1515
Running the script will fully display the interface, but a button binding will be coming soon. Until then, you will need to setup your own binding on a button to initialize the code.
1616

1717
To bring up the interface, simply call this:
18+
```javascript
19+
var slConfig = {
20+
token: 'SLACK-TOKEN',
21+
channel: 'SLACK-CHANNEL',
22+
element: 'PAGE-DIV-ID'
23+
};
1824

19-
var slConfig = {
20-
token: 'SLACK-TOKEN',
21-
channel: 'SLACK-CHANNEL',
22-
element: 'PAGE-DIV-ID'
23-
};
24-
25-
var sl = new SLjs.Application(slConfig);
25+
var sl = new SLjs.Application(slConfig);
26+
```
2627

2728
The configuration options listed above are the *minimum* options required. You are free to fill in additional parameters, including:
2829

29-
**visitorName** [*string*]: If filled out, the script will skip the question that asks the user for their name. Fill this in if you have some way to automatically identify a user's name
30-
31-
**visitorIcon** [*string*]: This defaults to the *:speech_balloon:* emoji in Slack, but feel free to change this to any other emoji (default or custom) from your Slack instance.
32-
33-
**applicationName** [*string*]: This will override the default application name (SL.js) with your own. It's recommended you fill this parameter out, as it will show up to the user and in your Slack channel, allowing multiple sites or pages to point at one Slack channel, while easily identifying where the visitor is coming from.
34-
35-
**supportGroupName** [*string*]: This shows in the user support interface, and will show what team the user is talking to. When the interface shows messages coming from Slack, it will attempt to show the Slack user's first name only, followed by this support group name. By default, this will show "*Support Team*".
36-
37-
**workDates** [*object*]: Allows you to specify the standard work hours that support is generally available. This will not prevent users from submitting messages, but display a notice that support may not be available. By responding to the user in Slack, this notice will be removed so the user can have a normal support conversation.
30+
Parameter | Type | Description | Options
31+
--- | --- | --- | ---
32+
visitorName | string | If filled out, the script will skip the question that asks the user for their name. Fill this in if you have some way to automatically identify a user's name | N/A
33+
visitorIcon | string | This defaults to the *:speech_balloon:* emoji in Slack, but feel free to change this to any other emoji (default or custom) from your Slack instance. | N/A
34+
applicationName | string | This will override the default application name (SL.js) with your own. It's recommended you fill this parameter out, as it will show up to the user and in your Slack channel, allowing multiple sites or pages to point at one Slack channel, while easily identifying where the visitor is coming from. | N/A
35+
supportGroupName | string | This shows in the user support interface, and will show what team the user is talking to. When the interface shows messages coming from Slack, it will attempt to show the Slack user's first name only, followed by this support group name. By default, this will show "*Support Team*". | N/A
36+
position | string | Allows for docking the support interface to the left, right, or floating it in the center of the page. By default, this will float in the center of the page.| left, right, float
37+
workDates | object | Allows you to specify the standard work hours that support is generally available. This will not prevent users from submitting messages, but display a notice that support may not be available. By responding to the user in Slack, this notice will be removed so the user can have a normal support conversation. | See Below
3838

39+
## Work Dates: How To Configure ##
3940
Start hour and stop hour must be provided using the UTC time zone. You can leave out a day of the week and it will consider that a non-working day.
4041

4142
**Example parameter configuration for work dates**
42-
43-
workDates: {
44-
monday: true,
45-
tuesday: true,
46-
wednesday: true,
47-
thursday: true,
48-
friday: true,
49-
startHourUtc: 15,
50-
startMinutes: 0,
51-
stopHourUtc: 1,
52-
stopMinutes: 30
53-
}
54-
43+
```javascript
44+
workDates: {
45+
monday: true,
46+
tuesday: true,
47+
wednesday: true,
48+
thursday: true,
49+
friday: true,
50+
startHourUtc: 15,
51+
startMinutes: 0,
52+
stopHourUtc: 1,
53+
stopMinutes: 30
54+
}
55+
```
5556

5657
----------
5758

@@ -70,7 +71,7 @@ The first message from a user sent from this interface will include a message at
7071
## To do ##
7172
- Add non-websocket backup feature
7273
- Add server-side features (id generation, traffic routing)
73-
- Add additional display methods (docking to left/right of page)
74+
- ~~Add additional display methods (docking to left/right of page)~~
7475
- Add button binding options
7576
- Add support for parsing Slack message edits
7677
- ~~Add support work hours~~

sl.js/release/sl.js

Lines changed: 64 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)