ep_cursortrace
Advanced tools
Comparing version 2.0.5 to 2.0.8
{ | ||
"name": "ep_cursortrace", | ||
"description": "Show cursor/caret movements of other users in real time", | ||
"version": "2.0.5", | ||
"version": "2.0.8", | ||
"author": "RedHog (Egil Moeller) <egil.moller@freecode.no>", | ||
@@ -6,0 +6,0 @@ "contributors": [{ |
@@ -110,2 +110,3 @@ var initiated = false; | ||
var div = $('iframe[name="ace_outer"]').contents().find('iframe').contents().find('#innerdocbody').find("div:nth-child("+y+")"); | ||
var divWidth = div.width(); | ||
@@ -137,3 +138,3 @@ // Is the line visible yet? | ||
// A load of fugly HTML that can prolly be moved ot CSS | ||
var newLine = "<span id='" + authorWorker + "' class='ghettoCursorXPos'>"+newText+"</span>"; | ||
var newLine = "<span style='width:"+divWidth+"px' id='" + authorWorker + "' class='ghettoCursorXPos'>"+newText+"</span>"; | ||
@@ -159,5 +160,4 @@ // Set the globalKey to 0, we use this when we wrap the objects in a datakey | ||
var left = span.position().left; | ||
left = left + span.width(); // Remember the span here is the stealth span not teh parent span | ||
}else{ | ||
var left = $(worker).width(); | ||
var left = 0; | ||
} | ||
@@ -177,7 +177,19 @@ | ||
// Also add any margin on the div; | ||
var divMargin = $(div).css("margin-left") | ||
// Add support for page view margins | ||
var divMargin = $(div).css("margin-left"); | ||
var innerdocbodyMargin = $(div).parent().css("margin-left"); | ||
if(innerdocbodyMargin){ | ||
innerdocbodyMargin = innerdocbodyMargin.replace("px", ""); | ||
innerdocbodyMargin = parseInt(innerdocbodyMargin); | ||
}else{ | ||
innerdocbodyMargin = 0; | ||
} | ||
if(divMargin){ | ||
divMargin = divMargin.replace("px", ""); | ||
left = left + parseInt(divMargin); | ||
console.log("Margin is ", divMargin); | ||
divMargin = parseInt(divMargin); | ||
if((divMargin + innerdocbodyMargin) > 0){ | ||
console.log("divMargin", divMargin); | ||
left = left + divMargin; | ||
} | ||
} | ||
@@ -184,0 +196,0 @@ |
17371
435