Author: hoang_to
Date: 2010-08-24 12:49:43 -0400 (Tue, 24 Aug 2010)
New Revision: 3916
Modified:
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js
exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/form/UISearchForm.gtmpl
Log:
EXOGTN-26: Search form in User/Group management does not support 'Enter' as key
assist
Modified:
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js
===================================================================
---
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js 2010-08-24
16:45:50 UTC (rev 3915)
+++
exo/portal/branches/3.1.x/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js 2010-08-24
16:49:43 UTC (rev 3916)
@@ -58,21 +58,31 @@
}
};
-UIPortalControl.prototype.onEnterPress = function(e) {
- var e = window.event || e;
- var uiPortalLoginFormAction =
document.getElementById("UIPortalLoginFormAction");
- if(uiPortalLoginFormAction) {
- var code;
- if(!e) e = window.event;
- if(e.keyCode) code = e.keyCode;
- else if (e.which) code = e.which;
- if(code ==13) {
- if(this.t != 13) {
- uiPortalLoginFormAction.onclick() ;
- }
- this.t = code;
- }
- }
+/**
+ * Process enter key press
+ * @param {Event} e this event
+ * @param {String} executeScript javascript command to execute if enter key was pressed
+ */
+UIPortalControl.prototype.onEnterPress = function(e, executeScript) {
+ var e = window.event || e;
+ var code;
+ if(!e) e = window.event;
+ if(e.keyCode) code = e.keyCode;
+ else if (e.which) code = e.which;
+ if(code ==13) {
+ if(this.t != 13) {
+ var uiPortalLoginFormAction =
document.getElementById("UIPortalLoginFormAction");
+ if(uiPortalLoginFormAction) {
+ uiPortalLoginFormAction.onclick() ;
+ }
+ else
+ {
+ if(executeScript)
+ eval(executeScript);
+ }
+ }
+ this.t = code;
+ }
};
/*********** Scroll Manager *************/
Modified:
exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/form/UISearchForm.gtmpl
===================================================================
---
exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/form/UISearchForm.gtmpl 2010-08-24
16:45:50 UTC (rev 3915)
+++
exo/portal/branches/3.1.x/web/portal/src/main/webapp/groovy/webui/form/UISearchForm.gtmpl 2010-08-24
16:49:43 UTC (rev 3916)
@@ -6,19 +6,21 @@
<div class="MiddleBar">
<div class="UISearchForm">
<%uiform.begin()%>
- <div class="QuickSet">
+ <%String quickSearchlink = uicomponent.event("QuickSearch") ;%>
+ <script type="text/javascript">
+ var executeScript = "<%=quickSearchlink%>";
+ </script>
+ <div class="QuickSet"
onkeypress="eXo.portal.UIPortalControl.onEnterPress(event, executeScript)">
<div
class="SearchTitle"><%=_ctx.appRes("UISearch.label.Search")%>:</div>
<%
QuickSearchInputSet = uiform.getQuickSearchInputSet();
for(field in QuickSearchInputSet.getChildren()) {
uiform.renderField(field)
}
- String quickSearchlink = uicomponent.event("QuickSearch");
%>
<a class="SimpleSearchIcon" href="$quickSearchlink"
title="<%= _ctx.appRes("UISearch.label.QuickSearch") %>">
<span></span>
</a>
-
</div>
<%uiform.end()%>
</div>
Show replies by date