ep_cursortrace
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"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 = "☹" // 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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16132
0
409
15