Author: vmolotkov
Date: 2007-11-27 13:10:13 -0500 (Tue, 27 Nov 2007)
New Revision: 4293
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
last changes for OL
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-11-27
16:43:53 UTC (rev 4292)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-11-27
18:10:13 UTC (rev 4293)
@@ -69,8 +69,9 @@
var tgtElemBorderWidth = LayoutManager.getBorderWidth(tgtElem, "lr");
var tgtElemPaddingWidth = LayoutManager.getPaddingWidth(tgtElem, "lr");
var tgtElemMarginWidth = LayoutManager.getMarginWidth(tgtElem, "lr");
-
+ //alert("srcElemBorderWidth:" + srcElemBorderWidth +
"srcElemPaddingWidth:" + srcElemPaddingWidth + "srcElemMarginWidth:" +
srcElemMarginWidth + "tgtElemBorderWidth:" + tgtElemBorderWidth +
"tgtElemPaddingWidth:" + tgtElemPaddingWidth + "tgtElemMarginWidth:" +
tgtElemMarginWidth);
var srcWidth = srcElem.offsetWidth - srcElemBorderWidth - srcElemPaddingWidth -
srcElemMarginWidth;
+ //alert(tgtElem.style.width + "|" + srcElem.offsetWidth);
return {srcWidth : srcWidth, colWidth : (srcWidth + (srcElemBorderWidth -
tgtElemBorderWidth)
+ (srcElemPaddingWidth - tgtElemPaddingWidth)
+ (srcElemMarginWidth - tgtElemMarginWidth))};
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-27
16:43:53 UTC (rev 4292)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-27
18:10:13 UTC (rev 4293)
@@ -1,4 +1,18 @@
if(!window.Richfaces) window.Richfaces = {};
+Richfaces.disableSelectionText = function(target) {
+ target.onselectstart = function(e) {
+ e = window.event||e;
+ if (e.srcElement) {
+ if (e.srcElement.tagName) {
+ var tagName = e.srcElement.tagName.toUpperCase();
+
+ if (tagName != "INPUT" && tagName != "TEXTAREA" /* any
items more? */) {
+ return false;
+ }
+ }
+ }
+ }
+}
Richfaces.ListBase = Class.create();
@@ -22,8 +36,10 @@
onclickControlId) {
this.selectedItems = new Array();
+ //this.layoutManager = layoutManager;
this.container = $(containerId);
this.shuttleTable = $(contentTableId);
+ Richfaces.disableSelectionText(this.shuttleTable);
this.valueKeeper = $(valueKeeperId);
this.focusKeeper = $(focusKeeperId);
this.focusKeeper.focused = false;
@@ -127,6 +143,7 @@
Richfaces.SelectItems.doActive(this.activeItem);
this.setFocus();
+ //this.layoutManager.widthSynchronization();
}
},
@@ -176,6 +193,7 @@
}
this.autoScrolling(action, event);
+ //this.layoutManager.widthSynchronization();
},
changeActiveItems : function(newItem, item) {
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-27
16:43:53 UTC (rev 4292)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/SelectItem.js 2007-11-27
18:10:13 UTC (rev 4293)
@@ -10,10 +10,11 @@
NORMAL : "rich-ordering-list-row"
},
CELL : {
- ACTIVE : "rich-ordering-list-cell-active",
- SELECTED : "rich-ordering-list-cell-selected",
- DISABLED : "rich-ordering-list-cell-disabled",
- NORMAL : "rich-ordering-list-cell"
+ ACTIVE : "ol_cell ol_cell_active rich-ordering-list-cell-active",
+ SELECTED : "ol_cell ol_cell_selected rich-ordering-list-cell-selected",
+ DISABLED : "ol_cell ol_cell_disabled rich-ordering-list-cell-disabled",
+ NORMAL : "ol_cell ol_cell_normal rich-ordering-list-cell",
+ LAST_CELL: "ol_endcol"
}
},
@@ -49,7 +50,13 @@
doChange : function(row, classNameRow, classNameCell) {
Richfaces.SelectItems.doChangeNode(row, classNameRow);
var cells = row.cells;
- for (var cell in cells) {
+ for (var i = 0; i < cells.length; i++) {
+ var cell = cells[i];
+ if (i == (cells.length - 1)) {
+ var classes = classNameCell.split(' ');
+ classes[0] = Richfaces.SelectItems.CLASSES.CELL.LAST_CELL;
+ classNameCell = classes.join(' ');
+ }
Richfaces.SelectItems.doChangeNode(cell, classNameCell);
}
},
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2007-11-27
16:43:53 UTC (rev 4292)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2007-11-27
18:10:13 UTC (rev 4293)
@@ -33,3 +33,4 @@
}
}
+
Modified:
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-27
16:43:53 UTC (rev 4292)
+++
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-27
18:10:13 UTC (rev 4293)
@@ -11,21 +11,21 @@
<h:styles>css/orderingList.xcss</h:styles>
- <h:scripts>
+ <h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/extend.js,
scripts/ShuttleUtils.js,
scripts/SelectItem.js,
scripts/LayoutManager.js
scripts/Control.js,
- scripts/ListBase.js,
- scripts/OrderingList.js
+ scripts/ListBase.js,
+ scripts/OrderingList.js
</h:scripts>
- <f:clientId var="clientId"/>
-
+ <f:clientId var="clientId"/>
+
<div id="#{clientId}" class="rich-ordering-list-ds"
x:passThruWithExclusions="id,class">
- <input id="#{clientId}focusKeeper" type="button"
value="" name="focusKeeper"
+ <input id="#{clientId}focusKeeper" type="button"
value="" name="focusKeeper"
class="rich-ordering-list-fk" />
<input id="#{clientId}valueKeeper" type="hidden"
name="#{clientId}" value="#{component.submittedString}"/>
@@ -38,26 +38,26 @@
</tr>
<tr>
<td>
- <div id="#{clientId}headerBox"
class="rich-ordering-list-output">
- <jsp:scriptlet><![CDATA[
- String contentContainerStyle = "";
- if (component.getAttributes().get("listWidth") != null) {
- contentContainerStyle =
contentContainerStyle.concat("width:").concat(component.getAttributes().get("listWidth").toString()).concat("px;");
- variables.setVariable("contentContainerStyle",
contentContainerStyle);
- }
+ <div id="#{clientId}headerBox"
class="richorderinglist-output">
+ <jsp:scriptlet><![CDATA[
+ String contentContainerStyle = "";
+ if (component.getAttributes().get("listWidth") != null) {
+ contentContainerStyle =
contentContainerStyle.concat("width:").concat(component.getAttributes().get("listWidth").toString()).concat("px;");
+ variables.setVariable("contentContainerStyle",
contentContainerStyle);
+ }
]]></jsp:scriptlet>
- <div class="rich-ordering-list-header" style="width:
#{component.attributes['listWidth']}px;">
+ <div class="rich-ordering-list-header"
style="#{contentContainerStyle}">
<table id="#{clientId}internal_header_tab"
class="rich-ordering-list-items" cellpadding="0"
cellspacing="0">
<f:call name="encodeHeader"/>
</table>
</div>
- <jsp:scriptlet><![CDATA[
- if (component.getAttributes().get("listHeight") != null) {
- contentContainerStyle =
contentContainerStyle.concat("height:").concat(component.getAttributes().get("listHeight").toString()).concat("px;");
- variables.setVariable("contentContainerStyle",
contentContainerStyle);
- }
- ]]></jsp:scriptlet>
- <div id="#{clientId}contentBox"
class="rich-ordering-list-content" style="width:
#{component.attributes['listWidth']}px;
height:#{component.attributes['listHeight']}px;">
+ <jsp:scriptlet><![CDATA[
+ if (component.getAttributes().get("listHeight") != null) {
+ contentContainerStyle =
contentContainerStyle.concat("height:").concat(component.getAttributes().get("listHeight").toString()).concat("px;");
+ variables.setVariable("contentContainerStyle",
contentContainerStyle);
+ }
+ ]]></jsp:scriptlet>
+ <div id="#{clientId}contentBox"
class="rich-ordering-list-content"
style="#{contentContainerStyle}">
<table id="#{clientId}internal_tab"
class="rich-ordering-list-items" cellpadding="0"
cellspacing="0">
<tbody id="#{clientId}tbody">
<vcp:body>