Coding style fixes for #321

print-window-tiddler
Jermolene 2014-01-03 10:43:08 +00:00
rodzic 307b5c7d6b
commit 1374bd9d78
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -53,7 +53,7 @@ var processRow = function(prevColumns) {
// Move to just before the `|` terminating the cell // Move to just before the `|` terminating the cell
this.parser.pos = cellRegExp.lastIndex - 1; this.parser.pos = cellRegExp.lastIndex - 1;
} else if(cellMatch[1] === "<" && prevCell) { } else if(cellMatch[1] === "<" && prevCell) {
colSpanCount = 1+$tw.utils.getAttributeValueFromParseTreeNode(prevCell, "colspan", 1); colSpanCount = 1 + $tw.utils.getAttributeValueFromParseTreeNode(prevCell,"colspan",1);
$tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount); $tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount);
colSpanCount = 1; colSpanCount = 1;
// Move to just before the `|` terminating the cell // Move to just before the `|` terminating the cell
@ -62,9 +62,9 @@ var processRow = function(prevColumns) {
// End of row // End of row
if(prevCell && colSpanCount > 1) { if(prevCell && colSpanCount > 1) {
try { try {
colSpanCount+= prevCell.attributes.colspan.value; colSpanCount += prevCell.attributes.colspan.value;
} catch (e) { } catch(e) {
colSpanCount-= 1; colSpanCount -= 1;
} }
$tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount); $tw.utils.addAttributeToParseTreeNode(prevCell,"colspan",colSpanCount);
} }
@ -77,7 +77,7 @@ var processRow = function(prevColumns) {
var spaceLeft = false, var spaceLeft = false,
chr = this.parser.source.substr(this.parser.pos,1); chr = this.parser.source.substr(this.parser.pos,1);
var vAlign = null; var vAlign = null;
if (chr === "^") { if(chr === "^") {
vAlign = "top"; vAlign = "top";
} else if(chr === ",") { } else if(chr === ",") {
vAlign = "bottom"; vAlign = "bottom";
@ -114,7 +114,7 @@ var processRow = function(prevColumns) {
if(vAlign) { if(vAlign) {
$tw.utils.addAttributeToParseTreeNode(cell,"valign",vAlign); $tw.utils.addAttributeToParseTreeNode(cell,"valign",vAlign);
} }
if(this.parser.source.substr(this.parser.pos-2,1) === " ") { // spaceRight if(this.parser.source.substr(this.parser.pos - 2,1) === " ") { // spaceRight
$tw.utils.addAttributeToParseTreeNode(cell,"align",spaceLeft ? "center" : "left"); $tw.utils.addAttributeToParseTreeNode(cell,"align",spaceLeft ? "center" : "left");
} else if(spaceLeft) { } else if(spaceLeft) {
$tw.utils.addAttributeToParseTreeNode(cell,"align","right"); $tw.utils.addAttributeToParseTreeNode(cell,"align","right");