Merged V3.1 to HEAD

13304: Final part of I18N fixes for Share. TinyMCE editor lang packs: fr, de, jp, es. Added Spanish (es) to web-client TinyMCE integration also which was missing it.
   13316: Liferay Portal 4.3.X fixes for JSF Client portlet:
           - Tested deployment instructions for Alfresco and Liferay 4.3.X - still work as per wiki page http://wiki.alfresco.com/wiki/Deploying_2.1WAR_Liferay4.3
           - Upload is working (tested from Add Content, Upload New Version and Update)
           - Fixed bug raised in ETHREEOH-1170
          NOTE: there are still issues with the other Ajax Mootools powered portlets...
   13333: Fix for ETHREEOH-1410, ETHREEOH-1402, ETHREEOH-1396, ETHREEOH-1393, ETHREEOH-1380, ETHREEOH-1274, ETHREEOH-1266, ETHREEOH-1257 - Paging control submit box now correctly handles enter key press without submitting parent form.
   13348: Fix for ETHREEOH-980 - a user home space can no longer be set directly to User Homes.
          So they are not accidently given full permissions to that folder or the ability to rename it later.
   13349: Fix for ETHREEOH-980 - a user home space can no longer be set directly to User Homes [missed files]
   13350: Fix for ETHREEOH-971. CIFS and WebDav online edit modes fixed to work in IE as best as possible in FF.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13590 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2009-03-12 11:19:13 +00:00
parent 2bc702e125
commit b906c50cdf
27 changed files with 995 additions and 123 deletions

View File

@@ -108,7 +108,7 @@ public class UIDataPager extends UICommand
String beginTag = "<span";
String endTag = "</span>";
String divStyle = "";
String inputStyle = "height:18px;";
String inputStyle = "height:13px;";
String imageVericalAlign = null;
String imageStyle = "margin-top:0px;";
StringBuilder inputPageNumber = new StringBuilder(128);
@@ -126,14 +126,20 @@ public class UIDataPager extends UICommand
beginTag = "<div";
endTag = "</div>";
divStyle = "padding:1px;";
inputStyle = "height:18px; vertical-align:middle;";
inputStyle = "height:13px; vertical-align:middle;";
imageVericalAlign = "middle";
imageStyle = "margin-top:0px;";
inputPageNumber.append("<input type=\"text\" maxlength=\"3\" value=\"").append(currentPage + 1).append("\" style=\"width: 24px; margin-left: 4px;").append(inputStyle).append("\" ");
inputPageNumber.append("onkeydown=\"").append(generateIE6InputOnkeydownScript()).append("\" ");
inputPageNumber.append("id=\"").append(getPageInputId()).append("\" />");
}
else
{
inputPageNumber.append("<input type=\"text\" maxlength=\"3\" value=\"").append(currentPage + 1).append("\" style=\"width: 24px; margin-left: 4px;").append(inputStyle).append("\" ");
inputPageNumber.append("onkeyup=\"").append(generateInputOnkeyupScript()).append("\" ");
inputPageNumber.append("onkeydown=\"").append(generateInputOnkeydownScript()).append("\" ");
inputPageNumber.append("id=\"").append(getPageInputId()).append("\" />");
}
inputPageNumber.append("<input type=\"text\" maxlength=\"3\" value=\"").append(currentPage + 1).append("\" style=\"width: 24px; margin-left: 4px;").append(inputStyle).append("\" ");
inputPageNumber.append("onkeyup=\"").append(generateInputOnkeyupScript()).append("\" ");
inputPageNumber.append("onkeydown=\"").append(generateInputOnkeydownScript()).append("\" ");
inputPageNumber.append("id=\"").append(getPageInputId()).append("\" />");
}
buf.append(beginTag);
@@ -584,7 +590,9 @@ public class UIDataPager extends UICommand
script.append(" else if (e) keycode = e.which;");
script.append(" if (keycode == 13)");
script.append(" {");
script.append(" var inputControl = document.getElementById('").append(getPageInputId()).append("');");
script.append(" var inputControl = $('").append(getPageInputId()).append("');");
script.append(" var dialogForm = $('dialog');");
script.append(" if (dialogForm) {dialogForm.removeProperty('onsubmit');}");
script.append(" var val = parseInt(inputControl.value);");
script.append(" if (val == 'NaN' || document.forms['").append(formClientId).append("']['").append(getHiddenFieldName()).append("']==undefined)");
script.append(" { inputControl.value = 1; return false; }");
@@ -614,6 +622,43 @@ public class UIDataPager extends UICommand
script.append(" else if (e) keycode = e.which;");
script.append(" var keychar = String.fromCharCode(keycode);");
script.append(" var numcheck = /\\d/;");
script.append(" var dialogForm = $('dialog');");
script.append(" if (dialogForm && keycode==13) { ");
script.append(" dialogForm.setProperty('onsubmit','return false;')");
script.append(" }");
script.append(" return keycode==13 || keycode==8 || keycode==37 || keycode==39 || keycode==46 || (keycode>=96 && keycode<=105) || numcheck.test(keychar);");
script.append("}; return onlyDigits(event);");
return script.toString();
}
/**
* Output the JavaScript event script to handle onkeydown event in the Page Number input (For IE6 browser).
* It handles only digits and some 'useful' keys.
* @return JavaScript code
*/
private String generateIE6InputOnkeydownScript()
{
final String formClientId = Utils.getParentForm(getFacesContext(), this).getClientId(getFacesContext());
final StringBuilder script = new StringBuilder(128);
script.append("function onlyDigits(e)");
script.append("{");
script.append(" var keycode;");
script.append(" if (window.event) keycode = window.event.keyCode;");
script.append(" else if (e) keycode = e.which;");
script.append(" var keychar = String.fromCharCode(keycode);");
script.append(" var numcheck = /\\d/;");
script.append(" if (keycode == 13)");
script.append(" {");
script.append(" var inputControl = $('").append(getPageInputId()).append("');");
script.append(" var val = parseInt(inputControl.value);");
script.append(" if (val == 'NaN' || document.forms['").append(formClientId).append("']['").append(getHiddenFieldName()).append("']==undefined)");
script.append(" { inputControl.value = 1; return false; }");
script.append(" else");
script.append(" { val = (val-1)>=0 ? val-1 : 0; ");
script.append(" document.forms['").append(formClientId).append("']['").append(getHiddenFieldName()).append("'].value=val;");
script.append(" document.forms['").append(formClientId).append("'].submit(); return false;");
script.append(" }");
script.append(" }");
script.append(" return keycode==13 || keycode==8 || keycode==37 || keycode==39 || keycode==46 || (keycode>=96 && keycode<=105) || numcheck.test(keychar);");
script.append("}; return onlyDigits(event);");
return script.toString();