You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-30Lines changed: 31 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,43 +15,44 @@ You'll also need to grab your Slack token (or generate a new one) and locate the
15
15
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.
16
16
17
17
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
+
};
18
24
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 =newSLjs.Application(slConfig);
26
+
```
26
27
27
28
The configuration options listed above are the *minimum* options required. You are free to fill in additional parameters, including:
28
29
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
38
38
39
+
## Work Dates: How To Configure ##
39
40
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.
40
41
41
42
**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
+
```
55
56
56
57
----------
57
58
@@ -70,7 +71,7 @@ The first message from a user sent from this interface will include a message at
70
71
## To do ##
71
72
- Add non-websocket backup feature
72
73
- 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)~~
0 commit comments