This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* global document, window, setTimeout*/ | ||
/* exported addScrollback */ | ||
|
||
(function(win, doc, jQuery) { | ||
|
||
// Open Scrollback upon button click | ||
$('.scrollback-button').on('click', function() { | ||
var $this = $(this); | ||
|
||
addScrollback($this.attr('data-room'), $this.attr('data-username')); | ||
}); | ||
|
||
// Functionality for opening the Scrollback widget | ||
function addScrollback(roomName, suggestedNick) { | ||
|
||
var host = 'https://scrollback.io/'; | ||
|
||
if(!win.scrollback) { | ||
win.scrollback = { | ||
room: roomName, | ||
form: 'toast', | ||
titlebarColor: '#00539f', | ||
minimize: false, | ||
nick: suggestedNick || 'guest' | ||
}; | ||
|
||
$.getScript(host + 'client.min.js'); | ||
} | ||
else { | ||
$('.scrollback-stream').attr('src', function() { | ||
return $(this).attr('src').replace(host, '') + roomName; | ||
}); | ||
} | ||
} | ||
|
||
})(window, document, jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters