mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Better redirect with QRcode
This commit is contained in:
@@ -28,7 +28,7 @@ var Channel = {
|
||||
var no_socket = true;
|
||||
|
||||
chan = Helper.decodeChannelName(Helper.html("#chan"));
|
||||
|
||||
|
||||
mobile_beginning = Helper.mobilecheck();
|
||||
var side = Helper.mobilecheck() ? "left" : "right";
|
||||
|
||||
@@ -186,7 +186,7 @@ var Channel = {
|
||||
|
||||
|
||||
if(!client) {
|
||||
var shareCodeUrl = window.location.protocol + "//client."+window.location.hostname+"/"+encodeURIComponent(chan.toLowerCase());
|
||||
var shareCodeUrl = window.location.protocol + "//client."+window.location.hostname+"/r/"+btoa(encodeURIComponent(chan.toLowerCase()));
|
||||
document.getElementById("share-join-qr").setAttribute("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+shareCodeUrl);
|
||||
Helper.setHtml("#channel-name-join", "client." + window.location.hostname + "/" + encodeURIComponent(chan.toLowerCase()));
|
||||
} else {
|
||||
|
||||
@@ -41,6 +41,11 @@ router.route('/:channel_name').get(function(req, res, next){
|
||||
channel(req, res, next);
|
||||
});
|
||||
|
||||
router.route('/r/:base64data').get(function(req, res, next){
|
||||
var channelToRedirect = Buffer.from(req.params.base64data, 'base64');
|
||||
res.redirect('/' + channelToRedirect);
|
||||
});
|
||||
|
||||
router.route('/').get(function(req, res, next){
|
||||
root(req, res, next);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user