Etherpad 1.5 plugin upgrade

This article is aimed at plugin developers.

When we upgrade Etherpad to 1.5 some(very few) plugins will require minor changes.

Broadcasting to all clients

If your plugin uses socket IO to broadcast a message to each client connected to your Etherpad Instance.

var clients = socketio.sockets.clients();
for(var i = 0; i < clients.length; i++) {   clients[i].json.send({type: "COLLABROOM",     data:{       type: "shoutMessage",       payload:{         message: message       }     }   }); }

Becomes

var clients = socketio.sockets.adapter.nsp.connected;
  for(var client in clients) {
    clients[client].send({type: "COLLABROOM",
      data:{
        type: "shoutMessage",
        payload:{
        message: message
      }
    }
  });
}

Browser type detection

$.browser is no longer available.

We now expose browser.

Simply removing $. should fix this however browser does behave slightly differently so you should change to browser and run your front end tests on all devices you need to support.

Leave a comment

Your email address will not be published. Required fields are marked *