Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ep_cursortrace

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ep_cursortrace - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

package.json
{
"name": "ep_cursortrace",
"description": "Show cursor/caret movements of other users in real time",
"version": "2.0.1",
"version": "2.0.2",
"author": "RedHog (Egil Moeller) <egil.moller@freecode.no>",

@@ -6,0 +6,0 @@ "contributors": [{

# ep_cursortrace
Etherpad plugin to trace the cursor of other users in real time. Shows the caret position of the authors on your Pad.
Shows the caret position of the authors on your Pad
## TODO

@@ -6,0 +5,0 @@

@@ -64,3 +64,3 @@ var initiated = false;

var location = {y: Y, x: X};
// Create a REQUEST message to send to the server
// Create a cursor position message to send to the server
var message = {

@@ -79,3 +79,3 @@ type : 'cursor',

// console.log("Sent message", message);
pad.collabClient.sendMessage(message); // Send the request through the server to create a tunnel to the client
pad.collabClient.sendMessage(message); // Send the cursor position message to the server
}

@@ -87,3 +87,2 @@ }

/* I NEED A REFACTOR, please */
// A huge problem with this is that it runs BEFORE the dom has been updated so edit events are always late..

@@ -94,8 +93,8 @@

var authorId = context.payload.authorId;
if(pad.getUserId() === authorId) return false; // Dont process our own caret position (yes we do get it..)
if(pad.getUserId() === authorId) return false; // Dont process our own caret position (yes we do get it..) -- This is not a bug
var authorClass = exports.getAuthorClassName(authorId);
if(action === 'cursorPosition'){ // someone has requested we approve their rtc request - we recieved an offer
if(action === 'cursorPosition'){ // an author has sent this client a cursor position, we need to show it in the dom
var authorName = escape(context.payload.authorName);
var authorName = decodeURI(escape(context.payload.authorName));
if(authorName == "null"){

@@ -164,14 +163,11 @@ var authorName = "&#9785;" // If the users username isn't set then display a smiley face

}
// This gives us our X offset :)
if(top < 0){ // If the tooltip wont be visible to the user because it's too high up
var height = $(div).height() +6;
// Get the height of the element minus the inner line height
var height = worker.height(); // the height of the worker
top = top + height - span.height(); // plus the top offset minus the actual height of our focus span
if(top <= 0){ // If the tooltip wont be visible to the user because it's too high up
stickUp = true;
top = height;
}else{
// Get the height of the element
// var height = $(worker).height();
// top = top + height;
top = top + (span.height()*2);
if(top < 0){ top = 0; } // handle case where caret is in 0,0
}

@@ -178,0 +174,0 @@ // Add the innerdocbody offset

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc