rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
last.width == l.width && last.height == l.height
last.width == l.width && l.width !== undefined && last.height == l.height && l.height !== undefined
flowPositionView: function(idx, item, x, y) { var spacing = item._scfl_cachedFlowSpacing, size = item._scfl_cachedCalculatedFlowSize; var last = this._scfl_itemLayouts[SC.guidFor(item)]; var l = { left: x + spacing.left, top: y + spacing.top, width: size.width, height: size.height }; // we must set this first, or it will think it has to update layout again, and again, and again // and we get a crash. this._scfl_itemLayouts[SC.guidFor(item)] = l; // Also, never set if the same. We only want to compare layout properties, though if (last && last.left == l.left && last.top == l.top && last.width == l.width && last.height == l.height ) { return; } item.set('layout', l); },
item.set('layout', l);
item.adjust(l);
flowPositionView: function(idx, item, x, y) { var spacing = item._scfl_cachedFlowSpacing, size = item._scfl_cachedCalculatedFlowSize; var last = this._scfl_itemLayouts[SC.guidFor(item)]; var l = { left: x + spacing.left, top: y + spacing.top, width: size.width, height: size.height }; // we must set this first, or it will think it has to update layout again, and again, and again // and we get a crash. this._scfl_itemLayouts[SC.guidFor(item)] = l; // Also, never set if the same. We only want to compare layout properties, though if (last && last.left == l.left && last.top == l.top && last.width == l.width && last.height == l.height ) { return; } item.set('layout', l); },
var spacing = item._scfl_cachedFlowSpacing, size = item._scfl_cachedFlowSize;
var spacing = item._scfl_cachedFlowSpacing, size = item._scfl_cachedCalculatedFlowSize;
flowPositionView: function(idx, item, x, y) { var spacing = item._scfl_cachedFlowSpacing, size = item._scfl_cachedFlowSize; var last = this._scfl_itemLayouts[SC.guidFor(item)]; var l = { left: x + spacing.left, top: y + spacing.top, width: size.width, height: size.height }; // we must set this first, or it will think it has to update layout again, and again, and again // and we get a crash. this._scfl_itemLayouts[SC.guidFor(item)] = l; // Also, never set if the same. We only want to compare layout properties, though if (last && last.left == l.left && last.top == l.top && last.width == l.width && last.height == l.height ) { return; } item.set("layout", l); },
item.set("layout", l);
item.adjust(l);
flowPositionView: function(idx, item, x, y) { var spacing = item._scfl_cachedFlowSpacing, size = item._scfl_cachedFlowSize; var last = this._scfl_itemLayouts[SC.guidFor(item)]; var l = { left: x + spacing.left, top: y + spacing.top, width: size.width, height: size.height }; // we must set this first, or it will think it has to update layout again, and again, and again // and we get a crash. this._scfl_itemLayouts[SC.guidFor(item)] = l; // Also, never set if the same. We only want to compare layout properties, though if (last && last.left == l.left && last.top == l.top && last.width == l.width && last.height == l.height ) { return; } item.set("layout", l); },
item.updateLayout();
flowPositionView: function(idx, item, x, y) { var spacing = item._scfl_cachedFlowSpacing, size = item._scfl_cachedFlowSize; var last = this._scfl_itemLayouts[SC.guidFor(item)]; var l = { left: x + spacing.left, top: y + spacing.top, width: size.width, height: size.height }; // we must set this first, or it will think it has to update layout again, and again, and again // and we get a crash. this._scfl_itemLayouts[SC.guidFor(item)] = l; // Also, never set if the same. We only want to compare layout properties, though if (last && last.left == l.left && last.top == l.top && last.width == l.width && last.height == l.height ) { return; } item.set("layout", l); item.updateLayout(); },
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary];
flowRow: function(row, rowOffset, rowSize, availableRowLength, padding, primary, secondary, align) {
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (primary === 'left') availableRowLength -= padding['left'] + padding['right']; else availableRowLength -= padding['top'] + padding['bottom'];
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace;
spacePerUnit = (availableRowLength - rowLength) / totalSpaceUnits; rowLength = availableRowLength;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
var x, y, itemOffset = 0;
var x = padding['left'], y = padding['top'], width, height, itemSize = 0; if (primary === 'left') y = rowOffset; else x = rowOffset;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2;
if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) x = (availableRowLength - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) x = (availableRowLength - rowLength) / 2;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top;
width = undefined; height = undefined; if (!this.get('canWrap') && item.get("fillHeight") && primary === "left") { height = rowSize - item._scfl_cachedSpacedSize.height; } if (!this.get('canWrap') && item.get("fillWidth") && primary === "top") { width = rowSize - item._scfl_cachedSpacedSize.width;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (item.get("isSpacer")) {
if (item.get('isSpacer')) {
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"];
itemSize = item._scfl_cachedSpacedSize[primary === 'left' ? 'width' : 'height'];
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); itemOffset += spacerSize;
itemSize = Math.max(itemSize, spacePerUnit * (item.get('spaceUnits') || 1));
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize;
if (primary === "left") { width = itemSize; } else { height = itemSize; }
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize;
if (primary === "left") { itemSize = item._scfl_cachedSpacedSize.width; } else { itemSize = item._scfl_cachedSpacedSize.height; }
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
this.flowPositionView(idx, item, x, y);
this.flowPositionView(idx, item, x, y, width, height); if (primary === 'left') x += itemSize; else y += itemSize;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit;
if (align === SC.ALIGN_JUSTIFY) x += spacePerUnit;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (primary === 'left') return x; return y;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"];
else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"];
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
item._scfl_cachedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedFlowSize[secondary === "left" ? "width" : "height"] = rowSize;
item._scfl_cachedCalculatedFlowSize = {}; item._scfl_cachedCalculatedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedCalculatedFlowSize[secondary === "left" ? "width" : "height"] = rowSize;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
item._scfl_cachedCalculatedFlowSize = item._scfl_cachedFlowSize;
flowRow: function(row, rowSpace, padding, rowOffset, rowSize, primary, secondary, align) { rowOffset += padding[secondary]; // if it is justified, we'll add padding between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (rowSpace - rowLength) / totalSpaceUnits; rowLength = rowSpace; } // prepare var x, y, itemOffset = 0; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) itemOffset = (rowSpace - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) itemOffset = (rowSpace - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; // now update flow position if (primary == "left") { x = itemOffset + padding.left; y = rowOffset + padding.top; } else { x = rowOffset + padding.left; y = itemOffset + padding.top; } // handle auto size if (item.get("fillHeight") && secondary === "top") item._scfl_cachedFlowSize["height"] = rowSize; if (item.get("fillWidth") && secondary === "left") item._scfl_cachedFlowSize["width"] = rowSize; // update offset if (item.get("isSpacer")) { // the cached size is the minimum size for the spacer var spacerSize = item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; // get the spacer size spacerSize = Math.max(spacerSize, spacePerUnit * (item.get("spaceUnits") || 1)); // add to item offset itemOffset += spacerSize; // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) item._scfl_cachedFlowSize[primary === "left" ? "width" : "height"] = spacerSize; item._scfl_cachedFlowSize[secondary === "left" ? "width" : "height"] = rowSize; } else { itemOffset += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } this.flowPositionView(idx, item, x, y); // update justification if (align === SC.ALIGN_JUSTIFY) itemOffset += spacePerUnit; } },
if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) x = (availableRowLength - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) x = (availableRowLength - rowLength) / 2;
if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) { if (primary === 'left') x = (availableRowLength - rowLength - padding.right); else y = (availableRowLength - rowLength - padding.bottom); } else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) { if (primary === 'left') x = (availableRowLength - padding.top - padding.bottom) / 2 - rowLength / 2; else y = (availableRowLength - padding.top - padding.bottom) / 2 - rowLength / 2; }
flowRow: function(row, rowOffset, rowSize, availableRowLength, padding, primary, secondary, align) { // we deal with values already offset for padding // therefore, we must adjust availableRowLength if (primary === 'left') availableRowLength -= padding['left'] + padding['right']; else availableRowLength -= padding['top'] + padding['bottom']; // if it is justified, we'll add spacing between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are // this width includes spacing for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification // when justifying, we give one space unit between each item if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (availableRowLength - rowLength) / totalSpaceUnits; rowLength = availableRowLength; } // prepare. // we will setup x, y // we _may_ set up width and/or height, if the view is a spacer or has // fillHeight/fillWidth. var x = padding['left'], y = padding['top'], width, height, itemSize = 0; if (primary === 'left') y = rowOffset; else x = rowOffset; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) x = (availableRowLength - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) x = (availableRowLength - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; width = undefined; height = undefined; // sometimes a view wants to fill the row; that is, if we flow horizontally, // be the full height, and vertically, fill the width. This only applies if // we are not wrapping... // // Since we still position with spacing, we have to set the width to the total row // size minus the spacing. The spaced size holds only the spacing because the // flow size method returns 0. if (!this.get('canWrap') && item.get("fillHeight") && primary === "left") { height = rowSize - item._scfl_cachedSpacedSize.height; } if (!this.get('canWrap') && item.get("fillWidth") && primary === "top") { width = rowSize - item._scfl_cachedSpacedSize.width; } // update offset if (item.get('isSpacer')) { // the cached size is the minimum size for the spacer itemSize = item._scfl_cachedSpacedSize[primary === 'left' ? 'width' : 'height']; // get the spacer size itemSize = Math.max(itemSize, spacePerUnit * (item.get('spaceUnits') || 1)); // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) // spacers include if (primary === "left") { width = itemSize; } else { height = itemSize; } } else { if (primary === "left") { itemSize = item._scfl_cachedSpacedSize.width; } else { itemSize = item._scfl_cachedSpacedSize.height; } } this.flowPositionView(idx, item, x, y, width, height); if (primary === 'left') x += itemSize; else y += itemSize; // update justification if (align === SC.ALIGN_JUSTIFY) x += spacePerUnit; } if (primary === 'left') return x; return y; },
if (!this.get('canWrap') && item.get("fillHeight") && primary === "left") {
if (item.get("fillHeight") && primary === "left") {
flowRow: function(row, rowOffset, rowSize, availableRowLength, padding, primary, secondary, align) { // we deal with values already offset for padding // therefore, we must adjust availableRowLength if (primary === 'left') availableRowLength -= padding['left'] + padding['right']; else availableRowLength -= padding['top'] + padding['bottom']; // if it is justified, we'll add spacing between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are // this width includes spacing for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification // when justifying, we give one space unit between each item if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (availableRowLength - rowLength) / totalSpaceUnits; rowLength = availableRowLength; } // prepare. // we will setup x, y // we _may_ set up width and/or height, if the view is a spacer or has // fillHeight/fillWidth. var x = padding['left'], y = padding['top'], width, height, itemSize = 0; if (primary === 'left') y = rowOffset; else x = rowOffset; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) x = (availableRowLength - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) x = (availableRowLength - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; width = undefined; height = undefined; // sometimes a view wants to fill the row; that is, if we flow horizontally, // be the full height, and vertically, fill the width. This only applies if // we are not wrapping... // // Since we still position with spacing, we have to set the width to the total row // size minus the spacing. The spaced size holds only the spacing because the // flow size method returns 0. if (!this.get('canWrap') && item.get("fillHeight") && primary === "left") { height = rowSize - item._scfl_cachedSpacedSize.height; } if (!this.get('canWrap') && item.get("fillWidth") && primary === "top") { width = rowSize - item._scfl_cachedSpacedSize.width; } // update offset if (item.get('isSpacer')) { // the cached size is the minimum size for the spacer itemSize = item._scfl_cachedSpacedSize[primary === 'left' ? 'width' : 'height']; // get the spacer size itemSize = Math.max(itemSize, spacePerUnit * (item.get('spaceUnits') || 1)); // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) // spacers include if (primary === "left") { width = itemSize; } else { height = itemSize; } } else { if (primary === "left") { itemSize = item._scfl_cachedSpacedSize.width; } else { itemSize = item._scfl_cachedSpacedSize.height; } } this.flowPositionView(idx, item, x, y, width, height); if (primary === 'left') x += itemSize; else y += itemSize; // update justification if (align === SC.ALIGN_JUSTIFY) x += spacePerUnit; } if (primary === 'left') return x; return y; },
if (!this.get('canWrap') && item.get("fillWidth") && primary === "top") {
if (item.get("fillWidth") && primary === "top") {
flowRow: function(row, rowOffset, rowSize, availableRowLength, padding, primary, secondary, align) { // we deal with values already offset for padding // therefore, we must adjust availableRowLength if (primary === 'left') availableRowLength -= padding['left'] + padding['right']; else availableRowLength -= padding['top'] + padding['bottom']; // if it is justified, we'll add spacing between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are // this width includes spacing for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification // when justifying, we give one space unit between each item if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (availableRowLength - rowLength) / totalSpaceUnits; rowLength = availableRowLength; } // prepare. // we will setup x, y // we _may_ set up width and/or height, if the view is a spacer or has // fillHeight/fillWidth. var x = padding['left'], y = padding['top'], width, height, itemSize = 0; if (primary === 'left') y = rowOffset; else x = rowOffset; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) x = (availableRowLength - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) x = (availableRowLength - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; width = undefined; height = undefined; // sometimes a view wants to fill the row; that is, if we flow horizontally, // be the full height, and vertically, fill the width. This only applies if // we are not wrapping... // // Since we still position with spacing, we have to set the width to the total row // size minus the spacing. The spaced size holds only the spacing because the // flow size method returns 0. if (!this.get('canWrap') && item.get("fillHeight") && primary === "left") { height = rowSize - item._scfl_cachedSpacedSize.height; } if (!this.get('canWrap') && item.get("fillWidth") && primary === "top") { width = rowSize - item._scfl_cachedSpacedSize.width; } // update offset if (item.get('isSpacer')) { // the cached size is the minimum size for the spacer itemSize = item._scfl_cachedSpacedSize[primary === 'left' ? 'width' : 'height']; // get the spacer size itemSize = Math.max(itemSize, spacePerUnit * (item.get('spaceUnits') || 1)); // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) // spacers include if (primary === "left") { width = itemSize; } else { height = itemSize; } } else { if (primary === "left") { itemSize = item._scfl_cachedSpacedSize.width; } else { itemSize = item._scfl_cachedSpacedSize.height; } } this.flowPositionView(idx, item, x, y, width, height); if (primary === 'left') x += itemSize; else y += itemSize; // update justification if (align === SC.ALIGN_JUSTIFY) x += spacePerUnit; } if (primary === 'left') return x; return y; },
if (align === SC.ALIGN_JUSTIFY) x += spacePerUnit;
if (align === SC.ALIGN_JUSTIFY) { if (primary === 'left') x += spacePerUnit; else y += spacePerUnit; }
flowRow: function(row, rowOffset, rowSize, availableRowLength, padding, primary, secondary, align) { // we deal with values already offset for padding // therefore, we must adjust availableRowLength if (primary === 'left') availableRowLength -= padding['left'] + padding['right']; else availableRowLength -= padding['top'] + padding['bottom']; // if it is justified, we'll add spacing between ALL views. var item, len = row.length, idx, layout, rowLength = 0, totalSpaceUnits = 0, spacePerUnit = 0; // first, determine the width of all items, and find out how many virtual spacers there are // this width includes spacing for (idx = 0; idx < len; idx++) { item = row[idx]; if (item.get("isSpacer")) totalSpaceUnits += item.get("spaceUnits") || 1; else rowLength += item._scfl_cachedSpacedSize[primary === "left" ? "width" : "height"]; } // add space units for justification // when justifying, we give one space unit between each item if (len > 1 && align === SC.ALIGN_JUSTIFY) { totalSpaceUnits += len - 1; } // calculate space per unit if needed if (totalSpaceUnits > 0) { spacePerUnit = (availableRowLength - rowLength) / totalSpaceUnits; rowLength = availableRowLength; } // prepare. // we will setup x, y // we _may_ set up width and/or height, if the view is a spacer or has // fillHeight/fillWidth. var x = padding['left'], y = padding['top'], width, height, itemSize = 0; if (primary === 'left') y = rowOffset; else x = rowOffset; // handle align if (align === SC.ALIGN_RIGHT || align === SC.ALIGN_BOTTOM) x = (availableRowLength - rowLength); else if (align === SC.ALIGN_CENTER || align === SC.ALIGN_MIDDLE) x = (availableRowLength - rowLength) / 2; // position for (idx = 0; idx < len; idx++) { item = row[idx]; width = undefined; height = undefined; // sometimes a view wants to fill the row; that is, if we flow horizontally, // be the full height, and vertically, fill the width. This only applies if // we are not wrapping... // // Since we still position with spacing, we have to set the width to the total row // size minus the spacing. The spaced size holds only the spacing because the // flow size method returns 0. if (!this.get('canWrap') && item.get("fillHeight") && primary === "left") { height = rowSize - item._scfl_cachedSpacedSize.height; } if (!this.get('canWrap') && item.get("fillWidth") && primary === "top") { width = rowSize - item._scfl_cachedSpacedSize.width; } // update offset if (item.get('isSpacer')) { // the cached size is the minimum size for the spacer itemSize = item._scfl_cachedSpacedSize[primary === 'left' ? 'width' : 'height']; // get the spacer size itemSize = Math.max(itemSize, spacePerUnit * (item.get('spaceUnits') || 1)); // and finally, set back the cached flow size value-- // not including spacing (this is the view size for rendering) // spacers include if (primary === "left") { width = itemSize; } else { height = itemSize; } } else { if (primary === "left") { itemSize = item._scfl_cachedSpacedSize.width; } else { itemSize = item._scfl_cachedSpacedSize.height; } } this.flowPositionView(idx, item, x, y, width, height); if (primary === 'left') x += itemSize; else y += itemSize; // update justification if (align === SC.ALIGN_JUSTIFY) x += spacePerUnit; } if (primary === 'left') return x; return y; },
var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { var frame = this.get("frame"), padding = this.get('_scfl_validFlowPadding'), spacing = this.flowSpacingForView(idx, view); var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; if(fs.width < 0 || fs.height < 0) throw "error calculating frame for row"; return fs; }
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get('_scfl_validFlowPadding'), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; if(fs.width < 0 || fs.height < 0) throw "error calculating frame for row"; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) { calc.width = cw; } else { // if the width is not calculated, we can't just use the frame because // we may have altered the frame. _scfl_cachedFlowSize is valid, however, // if the frame width is equal to _scfl_cachedCalculatedFlowSize.width, as // that means the width has not been recomputed. // // Keep in mind that if we are the ones who recomputed it, we can use our // original value. If it was recomputed by the view itself, then its value // should be ok and unmanipulated by us, in theory. if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.width == f.width) { calc.width = view._scfl_cachedFlowSize.width } else { calc.width = f.width; } } // same for calculated height if (ch) { calc.height = ch; } else { if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.height == f.height) { calc.height = view._scfl_cachedFlowSize.height } else { calc.height = f.height; } } // return return calc; },
if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.width == f.width) { calc.width = view._scfl_cachedFlowSize.width } else { calc.width = f.width; }
calc.width = f.width;
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get('_scfl_validFlowPadding'), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; if(fs.width < 0 || fs.height < 0) throw "error calculating frame for row"; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) { calc.width = cw; } else { // if the width is not calculated, we can't just use the frame because // we may have altered the frame. _scfl_cachedFlowSize is valid, however, // if the frame width is equal to _scfl_cachedCalculatedFlowSize.width, as // that means the width has not been recomputed. // // Keep in mind that if we are the ones who recomputed it, we can use our // original value. If it was recomputed by the view itself, then its value // should be ok and unmanipulated by us, in theory. if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.width == f.width) { calc.width = view._scfl_cachedFlowSize.width } else { calc.width = f.width; } } // same for calculated height if (ch) { calc.height = ch; } else { if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.height == f.height) { calc.height = view._scfl_cachedFlowSize.height } else { calc.height = f.height; } } // return return calc; },
if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.height == f.height) { calc.height = view._scfl_cachedFlowSize.height } else { calc.height = f.height; }
calc.height = f.height;
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get('_scfl_validFlowPadding'), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; if(fs.width < 0 || fs.height < 0) throw "error calculating frame for row"; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) { calc.width = cw; } else { // if the width is not calculated, we can't just use the frame because // we may have altered the frame. _scfl_cachedFlowSize is valid, however, // if the frame width is equal to _scfl_cachedCalculatedFlowSize.width, as // that means the width has not been recomputed. // // Keep in mind that if we are the ones who recomputed it, we can use our // original value. If it was recomputed by the view itself, then its value // should be ok and unmanipulated by us, in theory. if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.width == f.width) { calc.width = view._scfl_cachedFlowSize.width } else { calc.width = f.width; } } // same for calculated height if (ch) { calc.height = ch; } else { if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.height == f.height) { calc.height = view._scfl_cachedFlowSize.height } else { calc.height = f.height; } } // return return calc; },
if (view.get('isSpacer')) { if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) calc.width = 0; else calc.height = 0; } if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL && view.get('fillHeight') ) { calc.height = 0; } else if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_VERTICAL && view.get('fillWidth') ) { calc.width = 0; }
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get('_scfl_validFlowPadding'), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; if(fs.width < 0 || fs.height < 0) throw "error calculating frame for row"; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) { calc.width = cw; } else { // if the width is not calculated, we can't just use the frame because // we may have altered the frame. _scfl_cachedFlowSize is valid, however, // if the frame width is equal to _scfl_cachedCalculatedFlowSize.width, as // that means the width has not been recomputed. // // Keep in mind that if we are the ones who recomputed it, we can use our // original value. If it was recomputed by the view itself, then its value // should be ok and unmanipulated by us, in theory. if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.width == f.width) { calc.width = view._scfl_cachedFlowSize.width } else { calc.width = f.width; } } // same for calculated height if (ch) { calc.height = ch; } else { if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.height == f.height) { calc.height = view._scfl_cachedFlowSize.height } else { calc.height = f.height; } } // return return calc; },
if (view.get("isSpacer")) return { width: 0, height: 0 };
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } if (view.get("isSpacer")) return { width: 0, height: 0 }; // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); if (!SC.none(cw) && !SC.none("calculatedHeight")) return { width: cw, height: ch }; // finally, use frame var f = view.get("frame"); return { width: f.width, height: f.height }; },
var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view);
var frame = this.get("frame"), padding = this.get('_scfl_validFlowPadding'), spacing = this.flowSpacingForView(idx, view);
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) calc.width = cw; else calc.width = f.width; // same for calculated height if (ch) calc.height = ch; else calc.height = f.height; // return return calc; },
if (cw) calc.width = cw; else calc.width = f.width;
if (cw) { calc.width = cw; } else { if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.width == f.width) { calc.width = view._scfl_cachedFlowSize.width } else { calc.width = f.width; } }
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) calc.width = cw; else calc.width = f.width; // same for calculated height if (ch) calc.height = ch; else calc.height = f.height; // return return calc; },
if (ch) calc.height = ch; else calc.height = f.height;
if (ch) { calc.height = ch; } else { if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.height == f.height) { calc.height = view._scfl_cachedFlowSize.height } else { calc.height = f.height; } }
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) calc.width = cw; else calc.width = f.width; // same for calculated height if (ch) calc.height = ch; else calc.height = f.height; // return return calc; },
if (ch) cal.height = ch;
if (ch) calc.height = ch;
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. if (cw) calc.width = cw; else calc.width = f.width; // same for calculated height if (ch) cal.height = ch; else calc.height = f.height; // return return calc; },
var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight");
var cw = view.get('calculatedWidth'), ch = view.get('calculatedHeight');
flowSizeForView: function(idx, view) { var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); view._scfl_lastFrame = f; // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. This is the practice in other views. if (cw) { calc.width = cw; } else { calc.width = f.width; } // same for calculated height if (ch) { calc.height = ch; } else { calc.height = f.height; } // if it is a spacer, we must set the dimension that it // expands in to 0. if (view.get('isSpacer')) { if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) calc.width = 0; else calc.height = 0; } // if it has a fillWidth/Height, clear it for later if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL && view.get('fillHeight') ) { calc.height = 0; } else if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_VERTICAL && view.get('fillWidth') ) { calc.width = 0; } // return return calc; },
var calc = {}, f = view.get("frame");
var calc = {}, f = view.get('frame');
flowSizeForView: function(idx, view) { var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); view._scfl_lastFrame = f; // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. This is the practice in other views. if (cw) { calc.width = cw; } else { calc.width = f.width; } // same for calculated height if (ch) { calc.height = ch; } else { calc.height = f.height; } // if it is a spacer, we must set the dimension that it // expands in to 0. if (view.get('isSpacer')) { if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) calc.width = 0; else calc.height = 0; } // if it has a fillWidth/Height, clear it for later if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL && view.get('fillHeight') ) { calc.height = 0; } else if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_VERTICAL && view.get('fillWidth') ) { calc.width = 0; } // return return calc; },
!this.get('canWrap') &&
flowSizeForView: function(idx, view) { var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); var calc = {}, f = view.get("frame"); view._scfl_lastFrame = f; // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. This is the practice in other views. if (cw) { calc.width = cw; } else { calc.width = f.width; } // same for calculated height if (ch) { calc.height = ch; } else { calc.height = f.height; } // if it is a spacer, we must set the dimension that it // expands in to 0. if (view.get('isSpacer')) { if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) calc.width = 0; else calc.height = 0; } // if it has a fillWidth/Height, clear it for later if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL && view.get('fillHeight') ) { calc.height = 0; } else if ( !this.get('canWrap') && this.get('layoutDirection') === SC.LAYOUT_VERTICAL && view.get('fillWidth') ) { calc.width = 0; } // return return calc; },
if (!SC.none(cw) && !SC.none("calculatedHeight")) return { width: cw, height: ch };
if (!SC.none(cw) && !SC.none(ch)) return { width: cw, height: ch };
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); if (!SC.none(cw) && !SC.none("calculatedHeight")) return { width: cw, height: ch }; // finally, use frame var f = view.get("frame"); return { width: f.width, height: f.height }; },
if (!SC.none(cw) && !SC.none(ch)) return { width: cw, height: ch };
var calc = {}, f = view.get("frame");
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); if (!SC.none(cw) && !SC.none(ch)) return { width: cw, height: ch }; // finally, use frame var f = view.get("frame"); return { width: f.width, height: f.height }; },
var f = view.get("frame"); return { width: f.width, height: f.height };
if (cw) calc.width = cw; else calc.width = f.width; if (ch) cal.height = ch; else calc.height = f.height; return calc;
flowSizeForView: function(idx, view) { // first try flowSize var fs = SC.clone(view.get("flowSize")); if (!SC.none(fs)) { // if we have a flow size, adjust for a) width/heightPercentage and b) missing params. var frame = this.get("frame"), padding = this.get("flowPadding"), spacing = this.flowSpacingForView(idx, view); // you can't set it w/percentage for the expand direction var expandsHorizontal = (this.get("layoutDirection") === SC.LAYOUT_HORIZONTAL && !this.get("canWrap")) || (this.get("layoutDirection") === SC.LAYOUT_VERTICAL && this.get("canWrap")); if (!SC.none(fs.widthPercentage) && !expandsHorizontal) { fs.width = (frame.width - padding.left - padding.right) * fs.widthPercentage - spacing.left - spacing.right; } if (!SC.none(fs.heightPercentage) && expandsHorizontal) { fs.height = (frame.height - padding.top - padding.bottom) * fs.heightPercentage - spacing.top - spacing.bottom; } if (SC.none(fs.width)) fs.width = view.get("frame").width; if (SC.none(fs.height)) fs.height = view.get("frame").height; return fs; } // then calculated size var cw = view.get("calculatedWidth"), ch = view.get("calculatedHeight"); if (!SC.none(cw) && !SC.none(ch)) return { width: cw, height: ch }; // finally, use frame var f = view.get("frame"); return { width: f.width, height: f.height }; },
calc.width = f.width;
if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.width == f.width) { calc.width = view._scfl_cachedFlowSize.width; } else { calc.width = f.width; }
flowSizeForView: function(idx, view) { var cw = view.get('calculatedWidth'), ch = view.get('calculatedHeight'); var calc = {}, f = view.get('frame'); view._scfl_lastFrame = f; // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. This is the practice in other views. if (cw) { calc.width = cw; } else { calc.width = f.width; } // same for calculated height if (ch) { calc.height = ch; } else { calc.height = f.height; } // if it is a spacer, we must set the dimension that it // expands in to 0. if (view.get('isSpacer')) { if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) calc.width = 0; else calc.height = 0; } // if it has a fillWidth/Height, clear it for later if ( this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL && view.get('fillHeight') ) { calc.height = 0; } else if ( this.get('layoutDirection') === SC.LAYOUT_VERTICAL && view.get('fillWidth') ) { calc.width = 0; } // return return calc; },
calc.height = f.height;
if (view._scfl_cachedCalculatedFlowSize && view._scfl_cachedCalculatedFlowSize.height == f.height) { calc.height = view._scfl_cachedFlowSize.height; } else { calc.height = f.height; }
flowSizeForView: function(idx, view) { var cw = view.get('calculatedWidth'), ch = view.get('calculatedHeight'); var calc = {}, f = view.get('frame'); view._scfl_lastFrame = f; // if there is a calculated width, use that. NOTE: if calculatedWidth === 0, // it is invalid. This is the practice in other views. if (cw) { calc.width = cw; } else { calc.width = f.width; } // same for calculated height if (ch) { calc.height = ch; } else { calc.height = f.height; } // if it is a spacer, we must set the dimension that it // expands in to 0. if (view.get('isSpacer')) { if (this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL) calc.width = 0; else calc.height = 0; } // if it has a fillWidth/Height, clear it for later if ( this.get('layoutDirection') === SC.LAYOUT_HORIZONTAL && view.get('fillHeight') ) { calc.height = 0; } else if ( this.get('layoutDirection') === SC.LAYOUT_VERTICAL && view.get('fillWidth') ) { calc.width = 0; } // return return calc; },
if (view.get("isSpacer")) return {left:0,top:0,right:0,bottom:0}; var fm = view.get("flowSpacing"); if (!SC.none(fm)) return fm; return this.get("defaultFlowSpacing");
var spacing = view.get("flowSpacing"); if (SC.none(spacing)) spacing = this.get("defaultFlowSpacing"); if (SC.typeOf(spacing) === SC.T_NUMBER) { spacing = { left: spacing, right: spacing, bottom: spacing, top: spacing }; } else { spacing['left'] = spacing['left'] || 0; spacing['right'] = spacing['right'] || 0; spacing['top'] = spacing['top'] || 0; spacing['bottom'] = spacing['bottom'] || 0; } return spacing;
flowSpacingForView: function(idx, view) { if (view.get("isSpacer")) return {left:0,top:0,right:0,bottom:0}; var fm = view.get("flowSpacing"); if (!SC.none(fm)) return fm; return this.get("defaultFlowSpacing"); },
for ( i=0; i<l; i++ ) {
for ( var i=0; i<len; i++ ) {
flush: function(object) { // flush any observers that we tried to setup but didn't have a path yet var oldQueue = this.queue ; if (oldQueue && oldQueue.length > 0) { var newQueue = (this.queue = []) ; for ( var i=0,l=oldQueue.length; i<l; i++ ) { var item = oldQueue[i]; if ( !item ) continue; var tuple = SC.tupleForPropertyPath( item[0], item[3] ); if( tuple ) { tuple[0].addObserver( tuple[1], item[1], item[2] ); } else { newQueue.push( item ); } } } // if this object needsRangeObserver then see if any pending range // observers need it. if ( object._kvo_needsRangeObserver ) { var set = this.rangeObservers, len = set ? set.get('length') : 0, out = this._TMP_OUT, ro; for ( i=0; i<l; i++ ) { ro = set[i]; // get the range observer if ( ro.setupPending(object) ) { out.push(ro); // save to remove later } } // remove any that have setup if ( out.length > 0 ) set.removeEach(out); out.length = 0; // reset object._kvo_needsRangeObserver = false ; } },
if ( queue && queue.members.length ) {
if ( queue && queue.getMembers().length ) {
flushApplicationQueues: function() { var hadContent = NO, // execute any methods in the invokeQueue. queue = this._invokeQueue; if ( queue && queue.members.length ) { this._invokeQueue = null; // reset so that a new queue will be created hadContent = YES ; // needs to execute again queue.invokeMethods(); } // flush any pending changed bindings. This could actually trigger a // lot of code to execute. return SC.Binding.flushPendingChanges() || hadContent ; },
fnContentChange: function(el) { thisRef.tasksTableContent_change(el) },
fnContentChange: function(el) { thisRef.subsTableContent_change(el) },
fnContentChange: function(el) { thisRef.tasksTableContent_change(el) },
fnERClose: function(dataID) { thisRef.taskClose_click(dataID) },
fnERClose: function(dataID) { thisRef.erClose_click(dataID) },
fnERClose: function(dataID) { thisRef.taskClose_click(dataID) },
fnERContent:function(dataID){ return thisRef.taskExpand_click(dataID) },
fnERContent:function(dataID){ return thisRef.expand_click(dataID) },
fnERContent:function(dataID){ return thisRef.taskExpand_click(dataID) },
fnTableSorting: function(el) { thisRef.tableSorting_click(el,thisRef.tasksTable[0]) },
fnTableSorting: function(el) { thisRef.tableSorting_click(el,thisRef.subsTable[0]) },
fnTableSorting: function(el) { thisRef.tableSorting_click(el,thisRef.tasksTable[0]) },
services.focus.setFocus(elem, flags || Ci.nsIFocusManager.FLAG_BYMOUSE|Ci.nsIFocusManager.FLAG_BYMOVEFOCUS);
services.focus.setFocus(elem, flags || Ci.nsIFocusManager.FLAG_BYMOUSE);
focus: function (elem, flags) { try { if (elem instanceof Document) elem = elem.defaultView; if (elem instanceof Window) services.focus.clearFocus(elem); else services.focus.setFocus(elem, flags || Ci.nsIFocusManager.FLAG_BYMOUSE|Ci.nsIFocusManager.FLAG_BYMOVEFOCUS); } catch (e) { util.dump(elem); util.reportError(e); } },
node.focus();
dactyl.focus(node);
focus: function () { if (this.lastRange) var node = util.evaluateXPath(RangeFind.selectNodePath, this.range.document, this.lastRange.commonAncestorContainer).snapshotItem(0); if (node) { node.focus(); // Re-highlight collapsed selection this.selectedRange = this.lastRange; } },
this.search(null, false);
this.selectedRange = this.lastRange;
focus: function() { if(this.lastRange) var node = util.evaluateXPath(RangeFind.selectNodePath, this.range.document, this.lastRange.commonAncestorContainer).snapshotItem(0); if(node) { node.focus(); this.search(null, false); // Rehighlight collapsed range } },
selection:function(){this.focusIfIE();return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.focusIfIE();this.editor.reindentSelection(null)},focusIfIE:function(){this.win.select.ie_selection&&this.focus()},focus:function(){this.win.focus();this.editor.selectionSnapshot&&this.win.select.setBookmark(this.win.document.body,this.editor.selectionSnapshot)},replaceSelection:function(e){this.focus();this.editor.replaceSelection(e);return true},replaceChars:function(e,
selection:function(){this.focusIfIE();return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.focusIfIE();this.editor.reindentSelection(null)},focusIfIE:function(){this.win.select.ie_selection&&this.focus()},focus:function(){this.win.focus();this.editor.selectionSnapshot&&this.win.select.setBookmark(this.win.document.body,this.editor.selectionSnapshot)},replaceSelection:function(a){this.focus();this.editor.replaceSelection(a);return true},replaceChars:function(a,
selection:function(){this.focusIfIE();return this.editor.selectedText()},reindent:function(){this.editor.reindent()},reindentSelection:function(){this.focusIfIE();this.editor.reindentSelection(null)},focusIfIE:function(){this.win.select.ie_selection&&this.focus()},focus:function(){this.win.focus();this.editor.selectionSnapshot&&this.win.select.setBookmark(this.win.document.body,this.editor.selectionSnapshot)},replaceSelection:function(e){this.focus();this.editor.replaceSelection(e);return true},replaceChars:function(e,
focus: function(element) { $(element).focus(); return element; },
var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\
focus: function(element) { $(element).focus(); return element; },
services.focus.setFocus(elem, flags || services.focus.FLAG_BYMOUSE);
services.focus.setFocus(elem, flags);
focus: function (elem, flags) { try { if (elem instanceof Document) elem = elem.defaultView; if (elem instanceof Window) services.focus.clearFocus(elem); else services.focus.setFocus(elem, flags || services.focus.FLAG_BYMOUSE); } catch (e) { util.dump(elem); util.reportError(e); } },
if (elem instanceof Window && !Editor.getEditor(window)) return true;
focusAllowed: function (elem) { let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; return !options["strictfocus"] || win.dactylFocusAllowed; },
focusChange: function () {
focusChange: function (win) {
focusChange: function () { // Switch to -- PLAYER -- mode for Songbird Media Player. if (config.isPlayerWindow) dactyl.mode = modes.PLAYER; else dactyl.mode = modes.NORMAL; },
dactyl.mode = modes.PLAYER;
modes.set(modes.PLAYER);
focusChange: function () { // Switch to -- PLAYER -- mode for Songbird Media Player. if (config.isPlayerWindow) dactyl.mode = modes.PLAYER; else dactyl.mode = modes.NORMAL; },
dactyl.mode = modes.NORMAL;
if (modes.main == modes.PLAYER) modes.pop();
focusChange: function () { // Switch to -- PLAYER -- mode for Songbird Media Player. if (config.isPlayerWindow) dactyl.mode = modes.PLAYER; else dactyl.mode = modes.NORMAL; },
let elem = config.mainWidget || window.content;
let elem = config.mainWidget || content;
focusContent: function (clearFocusedElement) { if (window != services.windowWatcher.activeWindow) return; let win = document.commandDispatcher.focusedWindow; let elem = config.mainWidget || window.content; // TODO: make more generic try { if (this.has("mail") && !config.isComposeWindow) { let i = gDBView.selection.currentIndex; if (i == -1 && gDBView.rowCount >= 0) i = 0; gDBView.selection.select(i); } else { let frame = buffer.focusedFrame; if (frame && frame.top == window.content && !Editor.getEditor(frame)) elem = frame; } } catch (e) {} if (clearFocusedElement) if (dactyl.focus) dactyl.focus.blur(); else if (win && Editor.getEditor(win)) { win.blur(); if (win.frameElement) win.frameElement.blur(); } if (elem instanceof Window && Editor.getEditor(elem)) elem = window; if (elem && elem != dactyl.focus) elem.focus(); },
if (frame && frame.top == window.content && !Editor.getEditor(frame))
if (frame && frame.top == content && !Editor.getEditor(frame))
focusContent: function (clearFocusedElement) { if (window != services.windowWatcher.activeWindow) return; let win = document.commandDispatcher.focusedWindow; let elem = config.mainWidget || window.content; // TODO: make more generic try { if (this.has("mail") && !config.isComposeWindow) { let i = gDBView.selection.currentIndex; if (i == -1 && gDBView.rowCount >= 0) i = 0; gDBView.selection.select(i); } else { let frame = buffer.focusedFrame; if (frame && frame.top == window.content && !Editor.getEditor(frame)) elem = frame; } } catch (e) {} if (clearFocusedElement) if (dactyl.focus) dactyl.focus.blur(); else if (win && Editor.getEditor(win)) { win.blur(); if (win.frameElement) win.frameElement.blur(); } if (elem instanceof Window && Editor.getEditor(elem)) elem = window; if (elem && elem != dactyl.focus) elem.focus(); },
else if (this.has("tabs")) {
else {
focusContent: function (clearFocusedElement) { if (window != services.get("windowWatcher").activeWindow) return; let elem = config.mainWidget || window.content; // TODO: make more generic try { if (this.has("mail") && !config.isComposeWindow) { let i = gDBView.selection.currentIndex; if (i == -1 && gDBView.rowCount >= 0) i = 0; gDBView.selection.select(i); } else if (this.has("tabs")) { let frame = buffer.focusedFrame; if (frame && frame.top == window.content) elem = frame; } } catch (e) {} if (clearFocusedElement && dactyl.focus) dactyl.focus.blur(); if (elem && elem != dactyl.focus) elem.focus(); },
if (frame && frame.top == window.content)
if (frame && frame.top == window.content && !Editor.getEditor(frame))
focusContent: function (clearFocusedElement) { if (window != services.get("windowWatcher").activeWindow) return; let elem = config.mainWidget || window.content; // TODO: make more generic try { if (this.has("mail") && !config.isComposeWindow) { let i = gDBView.selection.currentIndex; if (i == -1 && gDBView.rowCount >= 0) i = 0; gDBView.selection.select(i); } else if (this.has("tabs")) { let frame = buffer.focusedFrame; if (frame && frame.top == window.content) elem = frame; } } catch (e) {} if (clearFocusedElement && dactyl.focus) dactyl.focus.blur(); if (elem && elem != dactyl.focus) elem.focus(); },
if (clearFocusedElement && dactyl.focus) dactyl.focus.blur();
if (clearFocusedElement) if (dactyl.focus) dactyl.focus.blur(); else if (win) { win.blur(); if (win.frameElement) win.frameElement.blur(); } if (elem instanceof Window && Editor.getEditor(elem)) elem = window;
focusContent: function (clearFocusedElement) { if (window != services.get("windowWatcher").activeWindow) return; let elem = config.mainWidget || window.content; // TODO: make more generic try { if (this.has("mail") && !config.isComposeWindow) { let i = gDBView.selection.currentIndex; if (i == -1 && gDBView.rowCount >= 0) i = 0; gDBView.selection.select(i); } else if (this.has("tabs")) { let frame = buffer.focusedFrame; if (frame && frame.top == window.content) elem = frame; } } catch (e) {} if (clearFocusedElement && dactyl.focus) dactyl.focus.blur(); if (elem && elem != dactyl.focus) elem.focus(); },
if (clearFocusedElement) if (dactyl.focus) dactyl.focus.blur(); else if (win && Editor.getEditor(win)) {
if (clearFocusedElement) { services.focus.clearFocus(window); if (win && Editor.getEditor(win)) {
focusContent: function (clearFocusedElement) { if (window != services.windowWatcher.activeWindow) return; let win = document.commandDispatcher.focusedWindow; let elem = config.mainWidget || content; // TODO: make more generic try { if (this.has("mail") && !config.isComposeWindow) { let i = gDBView.selection.currentIndex; if (i == -1 && gDBView.rowCount >= 0) i = 0; gDBView.selection.select(i); } else { let frame = buffer.focusedFrame; if (frame && frame.top == content && !Editor.getEditor(frame)) elem = frame; } } catch (e) {} if (clearFocusedElement) if (dactyl.focus) dactyl.focus.blur(); else if (win && Editor.getEditor(win)) { win.blur(); if (win.frameElement) win.frameElement.blur(); } if (elem instanceof Window && Editor.getEditor(elem)) elem = window; if (elem && elem != dactyl.focus) elem.focus(); },
if (elem && elem != dactyl.focus) elem.focus(); },
if (elem && elem != dactyl.focusedElement) dactyl.focus(elem); },
focusContent: function (clearFocusedElement) { if (window != services.windowWatcher.activeWindow) return; let win = document.commandDispatcher.focusedWindow; let elem = config.mainWidget || content; // TODO: make more generic try { if (this.has("mail") && !config.isComposeWindow) { let i = gDBView.selection.currentIndex; if (i == -1 && gDBView.rowCount >= 0) i = 0; gDBView.selection.select(i); } else { let frame = buffer.focusedFrame; if (frame && frame.top == content && !Editor.getEditor(frame)) elem = frame; } } catch (e) {} if (clearFocusedElement) if (dactyl.focus) dactyl.focus.blur(); else if (win && Editor.getEditor(win)) { win.blur(); if (win.frameElement) win.frameElement.blur(); } if (elem instanceof Window && Editor.getEditor(elem)) elem = window; if (elem && elem != dactyl.focus) elem.focus(); },
elem.contentWindow.focus(); else if (elem instanceof HTMLInputElement && elem.type == "file") {
elem = elem.contentWindow; elem.dactylFocusAllowed = true; if (elem instanceof HTMLInputElement && elem.type == "file") {
focusElement: function (elem) { let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; win.dactylFocusAllowed = true; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) elem.contentWindow.focus(); else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); buffer.lastInputField = elem; } else { elem.focus(); // for imagemap if (elem instanceof HTMLAreaElement) { try { let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat); elem.dispatchEvent(events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y })); } catch (e) {} } } },
if (elem instanceof Window && elem.getSelection() && !elem.getSelection().rangeCount) elem.getSelection().addRange(RangeFind.endpoint( RangeFind.nodeRange(elem.document.body || elem.document.documentElement), true));
focusElement: function (elem) { let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; win.dactylFocusAllowed = true; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) elem.contentWindow.focus(); else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); buffer.lastInputField = elem; } else { elem.focus(); // for imagemap if (elem instanceof HTMLAreaElement) { try { let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat); elem.dispatchEvent(events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y })); } catch (e) {} } } },
elem.focus();
dactyl.focus(elem);
focusElement: function (elem) { let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; win.dactylFocusAllowed = true; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) elem = elem.contentWindow; elem.dactylFocusAllowed = true; if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); buffer.lastInputField = elem; } else { elem.focus(); if (elem instanceof Window) { let sel = elem.getSelection(); if (sel && !sel.rangeCount) sel.addRange(RangeFind.endpoint( RangeFind.nodeRange(elem.document.body || elem.document.documentElement), true)); } else { let range = RangeFind.nodeRange(elem); let sel = (elem.ownerDocument || elem).defaultView.getSelection(); if (!sel.rangeCount || !RangeFind.intersects(range, sel.getRangeAt(0))) { range.collapse(true); sel.removeAllRanges(); sel.addRange(range); } } // for imagemap if (elem instanceof HTMLAreaElement) { try { let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat); events.dispatch(elem, events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y })); } catch (e) {} } } },
elem.contentWindow.focus();
Buffer.focusedWindow = elem.contentWindow;
focusElement: function (elem) { let doc = window.content.document; if (elem instanceof HTMLFrameElement || elem instanceof HTMLIFrameElement) elem.contentWindow.focus(); else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); buffer.lastInputField = elem; } else { elem.focus(); // for imagemap if (elem instanceof HTMLAreaElement) { try { let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat); elem.dispatchEvent(events.create(doc, "mouseover", { screenX: x, screenY: y })); } catch (e) {} } } },
elem.dispatchEvent(events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y }));
events.dispatch(elem, events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y }));
focusElement: function (elem) { let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; win.dactylFocusAllowed = true; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) elem = elem.contentWindow; elem.dactylFocusAllowed = true; if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); buffer.lastInputField = elem; } else { elem.focus(); if (elem instanceof Window && elem.getSelection() && !elem.getSelection().rangeCount) elem.getSelection().addRange(RangeFind.endpoint( RangeFind.nodeRange(elem.document.body || elem.document.documentElement), true)); // for imagemap if (elem instanceof HTMLAreaElement) { try { let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat); elem.dispatchEvent(events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y })); } catch (e) {} } } },
dactyl.focus(elem);
if (isinstance(elem, [HTMLInputElement, XULTextBoxElement])) var flags = services.focus.FLAG_BYMOUSE; else flags = services.focus.FLAG_SHOWRING; dactyl.focus(elem, flags);
focusElement: function (elem) { let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; win.document.dactylFocusAllowed = true; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) elem = elem.contentWindow; if (elem.document) elem.document.dactylFocusAllowed = true; if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); buffer.lastInputField = elem; } else { dactyl.focus(elem); if (elem instanceof Window) { let sel = elem.getSelection(); if (sel && !sel.rangeCount) sel.addRange(RangeFind.endpoint( RangeFind.nodeRange(elem.document.body || elem.document.documentElement), true)); } else { let range = RangeFind.nodeRange(elem); let sel = (elem.ownerDocument || elem).defaultView.getSelection(); if (!sel.rangeCount || !RangeFind.intersects(range, sel.getRangeAt(0))) { range.collapse(true); sel.removeAllRanges(); sel.addRange(range); } } // for imagemap if (elem instanceof HTMLAreaElement) { try { let [x, y] = elem.getAttribute("coords").split(",").map(parseFloat); events.dispatch(elem, events.create(elem.ownerDocument, "mouseover", { screenX: x, screenY: y })); } catch (e) {} } } },
focusFirstElement: function(form) { form = $(form); form.findFirstElement().activate(); return form; },
var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\
focusFirstElement: function(form) { form = $(form); form.findFirstElement().activate(); return form; },
ret = Array.some(window.content.frames, followFrame);
ret = Array.some(buffer.allFrames.frames, followFrame);
followDocumentRelationship: function (rel) { let regexes = options.get(rel + "pattern").values .map(function (re) RegExp(re, "i")); function followFrame(frame) { function iter(elems) { for (let i = 0; i < elems.length; i++) if (elems[i].rel.toLowerCase() == rel || elems[i].rev.toLowerCase() == rel) yield elems[i]; } // <link>s have higher priority than normal <a> hrefs let elems = frame.document.getElementsByTagName("link"); for (let elem in iter(elems)) { dactyl.open(elem.href); return true; } // no links? ok, look for hrefs elems = frame.document.getElementsByTagName("a"); for (let elem in iter(elems)) { buffer.followLink(elem, dactyl.CURRENT_TAB); return true; } let res = util.evaluateXPath(options.get("hinttags").defaultValue, frame.document); for (let [, regex] in Iterator(regexes)) { for (let i in util.range(res.snapshotLength, 0, -1)) { let elem = res.snapshotItem(i); if (regex.test(elem.textContent) || regex.test(elem.title) || Array.some(elem.childNodes, function (child) regex.test(child.alt))) { buffer.followLink(elem, dactyl.CURRENT_TAB); return true; } } } return false; } let ret = followFrame(window.content); if (!ret) // only loop through frames if the main content didn't match ret = Array.some(window.content.frames, followFrame); if (!ret) dactyl.beep(); },
ret = Array.some(window.content.frames, followFrame);
ret = Array.some(buffer.allFrames.slice(1), followFrame);
followDocumentRelationship: function (rel) { let regexes = options.get(rel + "pattern").values .map(function (re) RegExp(re, "i")); function followFrame(frame) { function iter(elems) { for (let i = 0; i < elems.length; i++) if (elems[i].rel.toLowerCase() == rel || elems[i].rev.toLowerCase() == rel) yield elems[i]; } // <link>s have higher priority than normal <a> hrefs let elems = frame.document.getElementsByTagName("link"); for (let elem in iter(elems)) { liberator.open(elem.href); return true; } // no links? ok, look for hrefs elems = frame.document.getElementsByTagName("a"); for (let elem in iter(elems)) { buffer.followLink(elem, liberator.CURRENT_TAB); return true; } let res = util.evaluateXPath(options.get("hinttags").defaultValue, frame.document); for (let [, regex] in Iterator(regexes)) { for (let i in util.range(res.snapshotLength, 0, -1)) { let elem = res.snapshotItem(i); if (regex.test(elem.textContent) || regex.test(elem.title) || Array.some(elem.childNodes, function (child) regex.test(child.alt))) { buffer.followLink(elem, liberator.CURRENT_TAB); return true; } } } return false; } let ret = followFrame(window.content); if (!ret) // only loop through frames if the main content didn't match ret = Array.some(window.content.frames, followFrame); if (!ret) liberator.beep(); },
let res = util.evaluateXPath(options.get("hinttags").defaultValue, frame.document);
let res = util.evaluateXPath(options.get("hinttags").defaultValues, frame.document);
followDocumentRelationship: function (rel) { let regexes = options[rel + "pattern"].map(function (re) RegExp(re, "i")); function followFrame(frame) { function iter(elems) { for (let i = 0; i < elems.length; i++) if (elems[i].rel.toLowerCase() == rel || elems[i].rev.toLowerCase() == rel) yield elems[i]; } // <link>s have higher priority than normal <a> hrefs let elems = frame.document.getElementsByTagName("link"); for (let elem in iter(elems)) { dactyl.open(elem.href); return true; } // no links? ok, look for hrefs elems = frame.document.getElementsByTagName("a"); for (let elem in iter(elems)) { buffer.followLink(elem, dactyl.CURRENT_TAB); return true; } let res = util.evaluateXPath(options.get("hinttags").defaultValue, frame.document); for (let [, regex] in Iterator(regexes)) { for (let i in util.range(res.snapshotLength, 0, -1)) { let elem = res.snapshotItem(i); if (regex.test(elem.textContent) || regex.test(elem.title) || Array.some(elem.childNodes, function (child) regex.test(child.alt))) { buffer.followLink(elem, dactyl.CURRENT_TAB); return true; } } } return false; } let ret = followFrame(window.content); if (!ret) // only loop through frames if the main content didn't match ret = Array.some(buffer.allFrames().frames, followFrame); if (!ret) dactyl.beep(); },
let res = util.evaluateXPath(options.get("hinttags").defaultValue, frame.document);
let res = util.evaluateXPath(options.get("hinttags").defaultValues, frame.document);
function followFrame(frame) { function iter(elems) { for (let i = 0; i < elems.length; i++) if (elems[i].rel.toLowerCase() == rel || elems[i].rev.toLowerCase() == rel) yield elems[i]; } // <link>s have higher priority than normal <a> hrefs let elems = frame.document.getElementsByTagName("link"); for (let elem in iter(elems)) { dactyl.open(elem.href); return true; } // no links? ok, look for hrefs elems = frame.document.getElementsByTagName("a"); for (let elem in iter(elems)) { buffer.followLink(elem, dactyl.CURRENT_TAB); return true; } let res = util.evaluateXPath(options.get("hinttags").defaultValue, frame.document); for (let [, regex] in Iterator(regexes)) { for (let i in util.range(res.snapshotLength, 0, -1)) { let elem = res.snapshotItem(i); if (regex.test(elem.textContent) || regex.test(elem.title) || Array.some(elem.childNodes, function (child) regex.test(child.alt))) { buffer.followLink(elem, dactyl.CURRENT_TAB); return true; } } } return false; }
if (isinstance(elem [HTMLFrameElement, HTMLIFrameElement])) {
if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) {
followLink: function (elem, where) { let doc = elem.ownerDocument; let view = doc.defaultView; let offsetX = 1; let offsetY = 1; if (isinstance(elem [HTMLFrameElement, HTMLIFrameElement])) { buffer.focusElement(elem); return; } else if (elem instanceof HTMLAreaElement) { // for imagemap let coords = elem.getAttribute("coords").split(","); offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); return; } let ctrlKey = false, shiftKey = false; switch (where) { case dactyl.NEW_TAB: case dactyl.NEW_BACKGROUND_TAB: ctrlKey = true; shiftKey = (where != dactyl.NEW_BACKGROUND_TAB); break; case dactyl.NEW_WINDOW: shiftKey = true; break; case dactyl.CURRENT_TAB: break; default: dactyl.log("Invalid where argument for followLink()", 0); } buffer.focusElement(elem); options.withContext(function () { options.setPref("browser.tabs.loadInBackground", true); ["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); },
["mousedown", "mouseup", "click"].slice(0, util.haveGecko("2.0") ? 2 : 3)
["mousedown", "mouseup", "click"].slice(0, util.haveGecko("2b") ? 2 : 3)
followLink: function (elem, where) { let doc = elem.ownerDocument; let view = doc.defaultView; let { left: offsetX, top: offsetY } = elem.getBoundingClientRect(); if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) return buffer.focusElement(elem); if (isinstance(elem, HTMLLinkElement)) return dactyl.open(elem.href, where); if (elem instanceof HTMLAreaElement) { // for imagemap let coords = elem.getAttribute("coords").split(","); offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); return; } let ctrlKey = false, shiftKey = false; switch (where) { case dactyl.NEW_TAB: case dactyl.NEW_BACKGROUND_TAB: ctrlKey = true; shiftKey = (where != dactyl.NEW_BACKGROUND_TAB); break; case dactyl.NEW_WINDOW: shiftKey = true; break; case dactyl.CURRENT_TAB: break; default: dactyl.log("Invalid where argument for followLink()", 0); } buffer.focusElement(elem); prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup", "click"].slice(0, util.haveGecko("2.0") ? 2 : 3) .forEach(function (event) { events.dispatch(elem, events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); },
ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: false
ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey
followLink: function (elem, where) { let doc = elem.ownerDocument; let view = doc.defaultView; let { left: offsetX, top: offsetY } = elem.getBoundingClientRect(); if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) return buffer.focusElement(elem); if (isinstance(elem, HTMLLinkElement)) return dactyl.open(elem.href, where); if (elem instanceof HTMLAreaElement) { // for imagemap let coords = elem.getAttribute("coords").split(","); offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); return; } let ctrlKey = false, shiftKey = false; switch (where) { case dactyl.NEW_TAB: case dactyl.NEW_BACKGROUND_TAB: ctrlKey = true; shiftKey = (where != dactyl.NEW_BACKGROUND_TAB); break; case dactyl.NEW_WINDOW: shiftKey = true; break; case dactyl.CURRENT_TAB: break; default: dactyl.log("Invalid where argument for followLink()", 0); } buffer.focusElement(elem); prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup"].forEach(function (event) { events.dispatch(elem, events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: false })); }); }); },
["mousedown", "mouseup"].forEach(function (event) {
["mousedown", "mouseup", "click"].slice(0, util.haveGecko("2.0") ? 2 : 3) .forEach(function (event) {
followLink: function (elem, where) { let doc = elem.ownerDocument; let view = doc.defaultView; let { left: offsetX, top: offsetY } = elem.getBoundingClientRect(); if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) return buffer.focusElement(elem); if (isinstance(elem, HTMLLinkElement)) return dactyl.open(elem.href, where); if (elem instanceof HTMLAreaElement) { // for imagemap let coords = elem.getAttribute("coords").split(","); offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); return; } let ctrlKey = false, shiftKey = false; switch (where) { case dactyl.NEW_TAB: case dactyl.NEW_BACKGROUND_TAB: ctrlKey = true; shiftKey = (where != dactyl.NEW_BACKGROUND_TAB); break; case dactyl.NEW_WINDOW: shiftKey = true; break; case dactyl.CURRENT_TAB: break; default: dactyl.log("Invalid where argument for followLink()", 0); } buffer.focusElement(elem); prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup"].forEach(function (event) { events.dispatch(elem, events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); },
let offsetX = 1; let offsetY = 1;
let { left: offsetX, top: offsetY } = elem.getBoundingClientRect();
followLink: function (elem, where) { let doc = elem.ownerDocument; let view = doc.defaultView; let offsetX = 1; let offsetY = 1; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) return buffer.focusElement(elem); if (isinstance(elem, HTMLLinkElement)) return dactyl.open(elem.href, where); if (elem instanceof HTMLAreaElement) { // for imagemap let coords = elem.getAttribute("coords").split(","); offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); return; } let ctrlKey = false, shiftKey = false; switch (where) { case dactyl.NEW_TAB: case dactyl.NEW_BACKGROUND_TAB: ctrlKey = true; shiftKey = (where != dactyl.NEW_BACKGROUND_TAB); break; case dactyl.NEW_WINDOW: shiftKey = true; break; case dactyl.CURRENT_TAB: break; default: dactyl.log("Invalid where argument for followLink()", 0); } buffer.focusElement(elem); prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); },
["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, {
["mousedown", "mouseup"].forEach(function (event) { events.dispatch(elem, events.create(doc, event, {
followLink: function (elem, where) { let doc = elem.ownerDocument; let view = doc.defaultView; let offsetX = 1; let offsetY = 1; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) return buffer.focusElement(elem); if (isinstance(elem, HTMLLinkElement)) return dactyl.open(elem.href, where); if (elem instanceof HTMLAreaElement) { // for imagemap let coords = elem.getAttribute("coords").split(","); offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); return; } let ctrlKey = false, shiftKey = false; switch (where) { case dactyl.NEW_TAB: case dactyl.NEW_BACKGROUND_TAB: ctrlKey = true; shiftKey = (where != dactyl.NEW_BACKGROUND_TAB); break; case dactyl.NEW_WINDOW: shiftKey = true; break; case dactyl.CURRENT_TAB: break; default: dactyl.log("Invalid where argument for followLink()", 0); } buffer.focusElement(elem); prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); },
ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey
ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: false
followLink: function (elem, where) { let doc = elem.ownerDocument; let view = doc.defaultView; let offsetX = 1; let offsetY = 1; if (isinstance(elem, [HTMLFrameElement, HTMLIFrameElement])) return buffer.focusElement(elem); if (isinstance(elem, HTMLLinkElement)) return dactyl.open(elem.href, where); if (elem instanceof HTMLAreaElement) { // for imagemap let coords = elem.getAttribute("coords").split(","); offsetX = Number(coords[0]) + 1; offsetY = Number(coords[1]) + 1; } else if (elem instanceof HTMLInputElement && elem.type == "file") { Buffer.openUploadPrompt(elem); return; } let ctrlKey = false, shiftKey = false; switch (where) { case dactyl.NEW_TAB: case dactyl.NEW_BACKGROUND_TAB: ctrlKey = true; shiftKey = (where != dactyl.NEW_BACKGROUND_TAB); break; case dactyl.NEW_WINDOW: shiftKey = true; break; case dactyl.CURRENT_TAB: break; default: dactyl.log("Invalid where argument for followLink()", 0); } buffer.focusElement(elem); prefs.withContext(function () { prefs.set("browser.tabs.loadInBackground", true); ["mousedown", "mouseup", "click"].forEach(function (event) { elem.dispatchEvent(events.create(doc, event, { screenX: offsetX, screenY: offsetY, ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey })); }); }); },
if (self.self !== window && self.self !== self) {
if ((! self.ignoreThis) && self.self !== window && self.self !== self) {
self.formatCall = function () { var s = ''; if (self.self !== window && self.self !== self) { s += doctest.repr(self.self) + '.'; } s += self._name; if (self.args === null) { return s + ':never called'; } s += '('; for (var i=0; i<self.args.length; i++) { if (i) { s += ', '; } s += doctest.repr(self.args[i], true); } s += ')'; return s; };
s += self.name;
s += self._name;
self.formatCall = function () { var s = ''; if (self.self !== window && self.self !== self) { s += doctest.repr(self.self) + '.'; } s += self.name; if (self.args === null) { return s + ':never called'; } s += '('; for (var i=0; i<self.args.length; i++) { if (i) { s += ', '; } s += doctest.repr(self.args[i], true); } s += ')'; return s; };
warnings.push(buildHtml(child.format));
var warning = buildHtml(child.format);
function formatChildren(children, opt_grand) { if (!children) { return null; } var warnings = []; for (var i = 0; i < children.length; ++i) { var child = children[i]; warnings.push(buildHtml(child.format)); if (child.children) { warnings.push(formatChildren(child.children, true)); } } if (opt_grand) { return PAGESPEED.Utils.formatWarnings(warnings, /*allow-raw-html*/true); } else { return warnings.join('\n<p>\n'); }}
warnings.push(formatChildren(child.children, true));
warning += ' ' + formatChildren(child.children, true);
function formatChildren(children, opt_grand) { if (!children) { return null; } var warnings = []; for (var i = 0; i < children.length; ++i) { var child = children[i]; warnings.push(buildHtml(child.format)); if (child.children) { warnings.push(formatChildren(child.children, true)); } } if (opt_grand) { return PAGESPEED.Utils.formatWarnings(warnings, /*allow-raw-html*/true); } else { return warnings.join('\n<p>\n'); }}
warnings.push(warning);
function formatChildren(children, opt_grand) { if (!children) { return null; } var warnings = []; for (var i = 0; i < children.length; ++i) { var child = children[i]; warnings.push(buildHtml(child.format)); if (child.children) { warnings.push(formatChildren(child.children, true)); } } if (opt_grand) { return PAGESPEED.Utils.formatWarnings(warnings, /*allow-raw-html*/true); } else { return warnings.join('\n<p>\n'); }}
return warnings.join('\n');
return warnings.join('\n<p>\n');
function formatChildren(children, opt_grand) { if (!children) { return null; } var warnings = []; for (var i = 0; i < children.length; ++i) { var child = children[i]; warnings.push(buildHtml(child.format)); if (child.children) { warnings.push(formatChildren(child.children, true)); } } if (opt_grand) { return PAGESPEED.Utils.formatWarnings(warnings, /*allow-raw-html*/true); } else { return warnings.join('\n'); }}
continue; } if (stack[i].indexOf('@') == -1) { lines.push(stack[i]);
doctest.formatTraceback = function (e, skipFrames) { skipFrames = skipFrames || 0; var lines = []; if (typeof e == 'undefined' || !e) { var caughtErr = null; try { (null).foo; } catch (caughtErr) { e = caughtErr; } skipFrames++; } if (e.stack) { var stack = e.stack.split('\n'); for (var i=skipFrames; i<stack.length; i++) { if (stack[i] == '@:0' || ! stack[i]) { continue; } var parts = stack[i].split('@'); var context = parts[0]; parts = parts[1].split(':'); var filename = parts[parts.length-2].split('/'); filename = filename[filename.length-1]; var lineno = parts[parts.length-1]; context = context.replace('\\n', '\n'); if (context != '' && filename != 'doctest.js') { lines.push(' ' + context + ' -> ' + filename + ':' + lineno); } } } if (lines.length) { return lines; } else { return null; }};
}
},changePanel: function(mainPanel,changePanel,no){
formsFailureBox: function(form){ if(!form.isValid()){ Ext.Msg.show({ icon: Ext.Msg.WARNING, title: 'Bad Request', msg: 'Please confirm the input value' }); }else{ Ext.Msg.show({ icon: Ext.Msg.ERROR, title: 'Bad Request', msg: 'Sysytem Error' }); } }
"string")e=document.getElementById(e);return function(c){e.parentNode.replaceChild(c,e)}};o.fromTextArea=function(e,c){if(typeof e=="string")e=document.getElementById(e);c=c||{};if(e.style.width&&c.width==null)c.width=e.style.width;if(e.style.height&&c.height==null)c.height=e.style.height;if(c.content==null)c.content=e.value;if(e.form){var a=function(){e.value=f.getCode()};typeof e.form.addEventListener=="function"?e.form.addEventListener("submit",a,false):e.form.attachEvent("onsubmit",a);var b=e.form.submit, d=function(){a();e.form.submit=b;e.form.submit();e.form.submit=d};e.form.submit=d}e.style.display="none";var f=new o(function(g){e.nextSibling?e.parentNode.insertBefore(g,e.nextSibling):e.parentNode.appendChild(g)},c);f.toTextArea=function(){a();e.parentNode.removeChild(f.wrapping);e.style.display="";if(e.form){e.form.submit=b;typeof e.form.removeEventListener=="function"?e.form.removeEventListener("submit",a,false):e.form.detachEvent("onsubmit",a)}};return f};o.isProbablySupported=function(){var e;
"string")a=document.getElementById(a);return function(b){a.parentNode.replaceChild(b,a)}};s.fromTextArea=function(a,b){if(typeof a=="string")a=document.getElementById(a);b=b||{};if(a.style.width&&b.width==null)b.width=a.style.width;if(a.style.height&&b.height==null)b.height=a.style.height;if(b.content==null)b.content=a.value;if(a.form){var c=function(){a.value=d.getCode()};typeof a.form.addEventListener=="function"?a.form.addEventListener("submit",c,false):a.form.attachEvent("onsubmit",c);var e=a.form.submit, g=function(){c();a.form.submit=e;a.form.submit();a.form.submit=g};a.form.submit=g}a.style.display="none";var d=new s(function(f){a.nextSibling?a.parentNode.insertBefore(f,a.nextSibling):a.parentNode.appendChild(f)},b);d.toTextArea=function(){c();a.parentNode.removeChild(d.wrapping);a.style.display="";if(a.form){a.form.submit=e;typeof a.form.removeEventListener=="function"?a.form.removeEventListener("submit",c,false):a.form.detachEvent("onsubmit",c)}};return d};s.isProbablySupported=function(){var a;
"string")e=document.getElementById(e);return function(c){e.parentNode.replaceChild(c,e)}};o.fromTextArea=function(e,c){if(typeof e=="string")e=document.getElementById(e);c=c||{};if(e.style.width&&c.width==null)c.width=e.style.width;if(e.style.height&&c.height==null)c.height=e.style.height;if(c.content==null)c.content=e.value;if(e.form){var a=function(){e.value=f.getCode()};typeof e.form.addEventListener=="function"?e.form.addEventListener("submit",a,false):e.form.attachEvent("onsubmit",a);var b=e.form.submit,d=function(){a();e.form.submit=b;e.form.submit();e.form.submit=d};e.form.submit=d}e.style.display="none";var f=new o(function(g){e.nextSibling?e.parentNode.insertBefore(g,e.nextSibling):e.parentNode.appendChild(g)},c);f.toTextArea=function(){a();e.parentNode.removeChild(f.wrapping);e.style.display="";if(e.form){e.form.submit=b;typeof e.form.removeEventListener=="function"?e.form.removeEventListener("submit",a,false):e.form.detachEvent("onsubmit",a)}};return f};o.isProbablySupported=function(){var e;
this.Data.noreload = false;
this.fromTill_Change = function(el) { if( !this.Data.changeFromTill(el.id, ($.datepicker.formatDate('@',$(el).datepicker( "getDate" )))) ) { if (this.Data[el.id] == 0) $(el).datepicker( "setDate", null ); else $(el).datepicker( "setDate", $.datepicker.parseDate('@',(this.Data[el.id])) ); } this.Data.timeRange = ''; $('.tablePlus').attr('src', 'media/images/table_plus.png'); this.Data.or = []; this.setupURL(); };
g1 = arg1 ; g2 = arg2 ; fired = YES ;
g1 = arg1 ; g2 = arg2 ; fired = YES ; target = this ;
func: function(arg1, arg2) { g1 = arg1 ; g2 = arg2 ; fired = YES ; }
function f(){for(;!c.lookAhead("?>")&&!c.endOfLine();)c.next();return{type:"comment",style:"php-comment"}}function g(l){var m="/*";for(l=l=="*";;){if(c.endOfLine())break;var r=c.next();if(r=="/"&&l){m=null;break}l=r=="*"}a(m);return{type:"comment",style:"php-comment"}}function h(l){for(var m=l,r=false;;){if(c.endOfLine())break;var u=c.next();if(u==l&&!r){m=null;break}r=u=="\\"&&!r}a(m);return{type:m==null?"string":"string_not_terminated",style:l=="'"?"php-string-single-quoted":"php-string-double-quoted"}}
r=f.addEventHandler(f,"resize",h,true);x=function(){o();r();if(k.updateNumbers==h)k.updateNumbers=null};h()}function g(){function h(n,z){q||(q=j.appendChild(document.createElement("DIV")));H&&H(q,z,n);t.push(q);t.push(n);A=q.offsetHeight+q.offsetTop;q=q.nextSibling}function o(){for(var n=0;n<t.length;n+=2)t[n].innerHTML=t[n+1];t=[]}function r(){if(!(!j.parentNode||j.parentNode!=k.lineNumbers)){for(var n=(new Date).getTime()+k.options.lineNumberTime;l;){for(h(B++,l.previousSibling);l&&!f.isBR(l);l= l.nextSibling)for(var z=l.offsetTop+l.offsetHeight;j.offsetHeight&&z-3>A;)h("&nbsp;");if(l)l=l.nextSibling;if((new Date).getTime()>n){o();u=setTimeout(r,k.options.lineNumberDelay);return}}for(;q;)h(B++);o();b()}}function v(n){b();c(n);l=p.firstChild;q=j.firstChild;A=0;B=k.options.firstLineNumber;r()}function w(){u&&clearTimeout(u);if(k.editor.allClean())v();else u=setTimeout(w,200)}var l,q,B,A,t=[],H=k.options.styleNumbers;v(true);var u=null;k.updateNumbers=w;var J=f.addEventHandler(f,"scroll",b, true),K=f.addEventHandler(f,"resize",w,true);x=function(){u&&clearTimeout(u);if(k.updateNumbers==w)k.updateNumbers=null;J();K()}}var d=this.frame,f=d.contentWindow,m=f.document,p=m.body,i=this.lineNumbers,j=i.firstChild,k=this,y=null,x=function(){};a();var I=setInterval(a,500);(this.options.textWrapping||this.options.styleNumbers?g:e)()},setDynamicHeight:function(){function a(){for(var p=0,i=g.lastChild,j;i&&e.isBR(i);){i.hackBR||p++;i=i.previousSibling}if(i){d=i.offsetHeight;j=i.offsetTop+(1+p)*
function f(){for(;!c.lookAhead("?>")&&!c.endOfLine();)c.next();return{type:"comment",style:"php-comment"}}function g(l){var m="/*";for(l=l=="*";;){if(c.endOfLine())break;var r=c.next();if(r=="/"&&l){m=null;break}l=r=="*"}a(m);return{type:"comment",style:"php-comment"}}function h(l){for(var m=l,r=false;;){if(c.endOfLine())break;var u=c.next();if(u==l&&!r){m=null;break}r=u=="\\"&&!r}a(m);return{type:m==null?"string":"string_not_terminated",style:l=="'"?"php-string-single-quoted":"php-string-double-quoted"}}
id: 'taberareloo_background'
id: 'taberareloo_background', style: TBRL.styles.div
general: function(ev){ // fix stack overflow => reset stack callLater(0, function(){ if(TBRL.field_shown){ TBRL.field_delete(); } else { if(!TBRL.field){ TBRL.field = $N('div', { id: 'taberareloo_background' }); TBRL.ol = $N('ol', { id: 'taberareloo_list' }); TBRL.field.appendChild(TBRL.ol); } TBRL.field_shown = true; TBRL.field.addEventListener('click', TBRL.field_clicked, true); var ctx = TBRL.createContext(); var exts = Extractors.check(ctx); TBRL.ctx = ctx; TBRL.exts = exts; TBRL.buttons = exts.map(function(ext, index){ var button = $N('button', { 'type' : 'button', 'class': 'taberareloo_button' }, [$N('img', { src: ext.ICON }), $N('span', null, ext.name)]); var li = $N('li', { 'class': 'taberareloo_item' }, button); TBRL.ol.appendChild(li); return button; }); (document.body || document.documentElement).appendChild(TBRL.field); TBRL.buttons[0].focus(); } }); },
id: 'taberareloo_list'
id: 'taberareloo_list', style: TBRL.styles.ol
general: function(ev){ // fix stack overflow => reset stack callLater(0, function(){ if(TBRL.field_shown){ TBRL.field_delete(); } else { if(!TBRL.field){ TBRL.field = $N('div', { id: 'taberareloo_background' }); TBRL.ol = $N('ol', { id: 'taberareloo_list' }); TBRL.field.appendChild(TBRL.ol); } TBRL.field_shown = true; TBRL.field.addEventListener('click', TBRL.field_clicked, true); var ctx = TBRL.createContext(); var exts = Extractors.check(ctx); TBRL.ctx = ctx; TBRL.exts = exts; TBRL.buttons = exts.map(function(ext, index){ var button = $N('button', { 'type' : 'button', 'class': 'taberareloo_button' }, [$N('img', { src: ext.ICON }), $N('span', null, ext.name)]); var li = $N('li', { 'class': 'taberareloo_item' }, button); TBRL.ol.appendChild(li); return button; }); (document.body || document.documentElement).appendChild(TBRL.field); TBRL.buttons[0].focus(); } }); },