mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
ensure all paths are relative
This commit is contained in:
parent
ee2c8f4524
commit
973d73ebee
4 changed files with 81 additions and 85 deletions
|
@ -60,7 +60,16 @@ function randomString() {
|
|||
|
||||
function handshake()
|
||||
{
|
||||
socket = io.connect();
|
||||
var loc = document.location;
|
||||
//get the correct port
|
||||
var port = loc.port == "" ? (loc.protocol == "https:" ? 443 : 80) : loc.port;
|
||||
//create the url
|
||||
var url = loc.protocol + "//" + loc.hostname + ":" + port + "/";
|
||||
//find out in which subfolder we are
|
||||
var resource = loc.pathname.substring(0,loc.pathname.indexOf("/p/")) + "/socket.io";
|
||||
|
||||
//connect
|
||||
socket = io.connect(url, {resource: resource});
|
||||
|
||||
socket.on('connect', function(){
|
||||
var padId= document.URL.substring(document.URL.lastIndexOf("/")+1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue