mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
logging still searching for sanity
This commit is contained in:
parent
3f8e6faec0
commit
225d2425d2
4 changed files with 7932 additions and 7 deletions
|
@ -2876,6 +2876,7 @@ function Ace2Inner(){
|
|||
|
||||
function doCreateDomLine(nonEmpty)
|
||||
{
|
||||
top.console.log("BOOOOOOBLLLBIIESS"); // never gets here..
|
||||
if (browser.msie && (!nonEmpty))
|
||||
{
|
||||
var result = {
|
||||
|
@ -5254,6 +5255,7 @@ function Ace2Inner(){
|
|||
{ /* throws an error in some IE 6 but not others! */
|
||||
}
|
||||
}
|
||||
|
||||
setClassPresence(root, "authorColors", true);
|
||||
setClassPresence(root, "doesWrap", doesWrap);
|
||||
|
||||
|
|
|
@ -305,6 +305,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
|
|||
|
||||
function _produceLineAttributesMarker(state)
|
||||
{
|
||||
console.log("STEP 3.1", state.lineAttributes);
|
||||
// TODO: This has to go to AttributeManager.
|
||||
var attributes = [
|
||||
['lmkr', '1'],
|
||||
|
@ -314,17 +315,20 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
|
|||
return [key, value];
|
||||
})
|
||||
);
|
||||
|
||||
console.log("STEP 3.2", state.lineAttributes);
|
||||
lines.appendText('*', Changeset.makeAttribsString('+', attributes , apool));
|
||||
}
|
||||
cc.startNewLine = function(state)
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
console.log("startNewLine STEP 2a", state.lineAttributes);
|
||||
var atBeginningOfLine = lines.textOfLine(lines.length() - 1).length == 0;
|
||||
if (atBeginningOfLine && !_.isEmpty(state.lineAttributes))
|
||||
{
|
||||
_produceLineAttributesMarker(state);
|
||||
console.log("startNewLine STEP 2b", state.lineAttributes);
|
||||
|
||||
}
|
||||
}
|
||||
lines.startNew();
|
||||
|
@ -371,11 +375,10 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
|
|||
if (isBlock) _ensureColumnZero(state);
|
||||
var startLine = lines.length() - 1;
|
||||
_reachBlockPoint(node, 0, state);
|
||||
if (dom.isNodeText(node))
|
||||
{
|
||||
if (dom.isNodeText(node)){
|
||||
var txt = dom.nodeValue(node);
|
||||
var tname = dom.nodeAttr(node.parentNode,"name");
|
||||
|
||||
// never calls this hook..
|
||||
var txtFromHook = hooks.callAll('collectContentLineText', {
|
||||
cc: this,
|
||||
state: state,
|
||||
|
@ -455,13 +458,30 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
|
|||
|
||||
// Below seems a bit abrupt but it's required, I dunno if I think it's a great idea though..
|
||||
delete state.lineAttributes.pastedImage;
|
||||
delete state.lineAttributes.imageWidth;
|
||||
delete state.lineAttributes.imageHeight;
|
||||
|
||||
if (tname == "img")
|
||||
{
|
||||
// Are the width and height values set?
|
||||
var width = /(?:^| )width=\"([0-9]*)/.exec(node.outerHTML);
|
||||
var height = /(?:^| )height=\"([0-9]*)/.exec(node.outerHTML);
|
||||
|
||||
// If they are then add them as line Attributes
|
||||
if(width && width[1]) state.lineAttributes.imageWidth = width[1];
|
||||
if(height && height[1]) state.lineAttributes.imageHeight = height[1];
|
||||
state.lineAttributes.pastedImage = node.outerHTML;
|
||||
console.log("CONTENT COLLETOR STATE", state);
|
||||
console.log("CONTENT COLLECTOR WIDTH", state.lineAttributes.imageWidth);
|
||||
console.log("CONTENT COLLECTOR HEIGHT", state.lineAttributes.imageHeight);
|
||||
console.log("CONTENT COLLETOR STATE", state.lineAttributes);
|
||||
isEmpty = false;
|
||||
var collectStyles = true;
|
||||
// _produceLineAttributesMarker(state);
|
||||
cc.startNewLine(state);
|
||||
}
|
||||
else if (tname == "br")
|
||||
|
||||
if (tname == "br")
|
||||
{
|
||||
this.breakLine = true;
|
||||
var tvalue = dom.nodeAttr(node, 'value');
|
||||
|
@ -474,7 +494,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class
|
|||
cls: null
|
||||
});
|
||||
var startNewLine= (typeof(induceLineBreak)=='object'&&induceLineBreak.length==0)?true:induceLineBreak[0];
|
||||
if(startNewLine){
|
||||
if(startNewLine && tname != "img"){
|
||||
cc.startNewLine(state);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
var lineClass = 'ace-line';
|
||||
result.appendSpan = function(txt, cls)
|
||||
{
|
||||
console.log("HAM I HERE!");
|
||||
var processedMarker = false;
|
||||
// Handle lineAttributeMarker, if present
|
||||
if (cls.indexOf(lineAttributeMarker) >= 0)
|
||||
|
@ -126,7 +127,9 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument)
|
|||
}
|
||||
processedMarker = true;
|
||||
}
|
||||
|
||||
|
||||
//doesn't get here..
|
||||
|
||||
_.map(hooks.callAll("aceDomLineProcessLineAttributes", {
|
||||
domline: domline,
|
||||
cls: cls
|
||||
|
|
Loading…
Reference in a new issue