diff --git a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java index 05cd65e1fa..2ba42a5645 100644 --- a/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java +++ b/source/java/org/alfresco/web/bean/wcm/AVMBrowseBean.java @@ -1225,10 +1225,6 @@ public class AVMBrowseBean implements IContextListener String query = this.searchContext.buildQuery(getMinimumSearchLength()); if (query == null) { - // failed to build a valid query, the user probably did not enter the - // minimum text required to construct a valid search - Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), - BrowseBean.MSG_SEARCH_MINIMUM), new Object[] {getMinimumSearchLength()})); this.folders = Collections.emptyList(); this.files = Collections.emptyList(); return; @@ -1987,6 +1983,14 @@ public class AVMBrowseBean implements IContextListener this.searchContext = searchContext; resetFileFolderLists(); + + if (searchContext.buildQuery(getMinimumSearchLength()) == null) + { + // failed to build a valid query, the user probably did not enter the + // minimum text required to construct a valid search + Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), + BrowseBean.MSG_SEARCH_MINIMUM), new Object[] {getMinimumSearchLength()})); + } } } diff --git a/source/web/jsp/users/email-space-users.jsp b/source/web/jsp/users/email-space-users.jsp index 81b9429fdd..a747808798 100644 --- a/source/web/jsp/users/email-space-users.jsp +++ b/source/web/jsp/users/email-space-users.jsp @@ -45,7 +45,8 @@ { if (okEnabled) { - if (document.getElementById("dialog:dialog-body:subject").value.length == 0) + if (document.getElementById("dialog:dialog-body:subject").value.trim().length == 0 || + document.getElementById("dialog:dialog-body:message").value.trim().length == 0) { document.getElementById("dialog:finish-button").disabled = true; } @@ -91,7 +92,7 @@ - + \ No newline at end of file diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index 38949fb071..f4db2f1abf 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -412,14 +412,14 @@ alfresco.xforms.Widget = new Class({ /** Returns the widget's label. */ getLabel: function() { - var result = ""; + var result = ""; var node = this._getChildXFormsNode("label"); - - if (node && node.firstChild !== null) - { - result = node.firstChild.nodeValue; - } - + + if (node && node.firstChild !== null) + { + result = node.firstChild.nodeValue; + } + if (alfresco.constants.DEBUG) { result += " [" + this.id + "]"; @@ -545,9 +545,9 @@ alfresco.xforms.FilePicker = alfresco.xforms.Widget.extend({ this._selectableTypes = "selectable_types" in params ? params["selectable_types"].split(",") : null; this._filterMimetypes = "filter_mimetypes" in params ? params["filter_mimetypes"].split(",") : []; this._folderRestriction = "folder_restriction" in params ? params["folder_restriction"] : null; - this._configSearchName = "config_search_name" in params ? params["config_search_name"] : null; - this._layout = "layout" in params ? params["layout"] : null; - }, + this._configSearchName = "config_search_name" in params ? params["config_search_name"] : null; + this._layout = "layout" in params ? params["layout"] : null; + }, ///////////////////////////////////////////////////////////////// // overridden methods @@ -558,23 +558,23 @@ alfresco.xforms.FilePicker = alfresco.xforms.Widget.extend({ this.domNode.addClass("xformsFilePicker"); attach_point.appendChild(this.domNode); //XXXarielb support readonly and disabled - - if (this._layout == "table") - { - this.widget = new alfresco.FilePickerWidgetTableLayout(this.id, - this.domNode, - this.getInitialValue(), - false, - this._filePicker_changeHandler.bindAsEventListener(this), - null /* cancel is ignored */, - this._filePicker_resizeHandler.bindAsEventListener(this), - this._selectableTypes, - this._filterMimetypes, - this._folderRestriction, - this._configSearchName); - } - else - { + + if (this._layout == "table") + { + this.widget = new alfresco.FilePickerWidgetTableLayout(this.id, + this.domNode, + this.getInitialValue(), + false, + this._filePicker_changeHandler.bindAsEventListener(this), + null /* cancel is ignored */, + this._filePicker_resizeHandler.bindAsEventListener(this), + this._selectableTypes, + this._filterMimetypes, + this._folderRestriction, + this._configSearchName); + } + else + { this.widget = new alfresco.FilePickerWidget(this.id, this.domNode, this.getInitialValue(), @@ -586,7 +586,7 @@ alfresco.xforms.FilePicker = alfresco.xforms.Widget.extend({ this._filterMimetypes, this._folderRestriction, this._configSearchName); - } + } this.widget.render(); }, @@ -667,14 +667,14 @@ alfresco.xforms.TextField = alfresco.xforms.Widget.extend({ var borderWidth = (this.widget.offsetWidth - this.widget.clientWidth); var marginRight = 2; this.widget.style.marginRight = marginRight + "px"; - if (attach_point.offsetWidth == 0) - { - this.widget.style.width = "100%"; - } - else - { + if (attach_point.offsetWidth == 0) + { + this.widget.style.width = "100%"; + } + else + { this.widget.style.width = (((attach_point.offsetWidth - borderWidth - marginRight) / attach_point.offsetWidth) * 100) + "%"; - } + } this.widget.style.minWidth = "50px"; } @@ -1306,7 +1306,7 @@ alfresco.xforms.CheckboxSelect = alfresco.xforms.AbstractSelectWidget.extend({ { this.parent(value, forceCommit); this._selectedValues = value.split(' '); - var checkboxes = this.widget.getElementsByTagName("input"); + var checkboxes = this.widget.getElementsByTagName("input"); for (var i = 0; i < checkboxes.length; i++) { checkboxes[i].checked = @@ -1388,7 +1388,7 @@ alfresco.xforms.ListSelect = alfresco.xforms.AbstractSelectWidget.extend({ { this.parent(value, forceCommit); this._selectedValues = value.split(' '); - var options = this.widget.getElementsByTagName("option"); + var options = this.widget.getElementsByTagName("option"); for (var i = 0; i < options.length; i++) { options[i].selected = @@ -2740,13 +2740,13 @@ alfresco.xforms.VGroup = alfresco.xforms.AbstractGroup.extend({ ? "0px" : "30%"); - var contentDivWidth = "100%"; - // the following does avoid devision by zero ... in contentDiv.offsetLeft / child.domContainer.offsetWidth - if (!(child instanceof alfresco.xforms.AbstractGroup) && child.domContainer.offsetWidth != 0) - { - contentDivWidth = ((1 - (contentDiv.offsetLeft / child.domContainer.offsetWidth)) * 100) + "%"; - } - contentDiv.style.width = contentDivWidth; + var contentDivWidth = "100%"; + // the following does avoid devision by zero ... in contentDiv.offsetLeft / child.domContainer.offsetWidth + if (!(child instanceof alfresco.xforms.AbstractGroup) && child.domContainer.offsetWidth != 0) + { + contentDivWidth = ((1 - (contentDiv.offsetLeft / child.domContainer.offsetWidth)) * 100) + "%"; + } + contentDiv.style.width = contentDivWidth; child.render(contentDiv); if (!(child instanceof alfresco.xforms.AbstractGroup)) { @@ -2858,14 +2858,14 @@ alfresco.xforms.VGroup = alfresco.xforms.AbstractGroup.extend({ _updateDisplay: function(recursively) { - this.domNode.style.width = "100%"; - if (!window.ie) - { + this.domNode.style.width = "100%"; + if (!window.ie) + { if (this._isIndented()) { this.domNode.style.marginLeft = 10 + "px"; this.domNode.style.marginRight = 5 + "px"; - + this.domNode.style.width = (((this.domNode.offsetWidth - 15) / this.domNode.offsetWidth) * 100) + "%"; } // var x = ((this.domNode.offsetWidth - this.domNode.clientWidth) + @@ -2890,17 +2890,17 @@ alfresco.xforms.VGroup = alfresco.xforms.AbstractGroup.extend({ contentDiv.style.left = (this._children[i] instanceof alfresco.xforms.AbstractGroup ? "0px" : "30%"); - if (this._children[i].domContainer.parentNode.offsetWidth != 0) - { + if (this._children[i].domContainer.parentNode.offsetWidth != 0) + { contentDiv.style.width = (this._children[i] instanceof alfresco.xforms.AbstractGroup ? "100%" : (1 - (contentDiv.offsetLeft / this._children[i].domContainer.parentNode.offsetWidth)) * 100 + "%"); - } - else - { - contentDiv.style.width = "100%"; - } + } + else + { + contentDiv.style.width = "100%"; + } if (recursively) { @@ -3120,12 +3120,12 @@ alfresco.xforms.SwitchGroup = alfresco.xforms.VGroup.extend({ _insertChildAt: function(child, position) { var childDomContainer = this.parent(child, position); - + if (child.id == this._selectedCaseId) { this._getCaseToggleTriggerByCaseId(this._selectedCaseId).fire(); } - + return childDomContainer; }, @@ -3562,7 +3562,7 @@ alfresco.xforms.Repeat = alfresco.xforms.VGroup.extend({ this._groupHeaderNode.repeat = this; this._groupHeaderNode.onclick = function(event) { - if ((typeof(event) != 'undefined') && (typeof(event.target) != 'undefined') && (event.target == event.currentTarget)) + if ((typeof(event) != 'undefined') && (typeof(event.target) != 'undefined') && (event.target == event.currentTarget)) { event.currentTarget.repeat.setFocusedChild(null); } @@ -4165,21 +4165,21 @@ alfresco.xforms.XForm = new Class({ " is a prototype, ignoring"); continue; } - - // fix for ETWOTWO-490, hide elements after rendering - if (xformsNode.childNodes[i].nodeName == "chiba:data" && - parentWidget instanceof alfresco.xforms.SwitchGroup) - { - var selectedCase = parentWidget._selectedCaseId; - for (var x = 0; x < parentWidget._children.length; x++) - { - if (parentWidget._children[x].id != selectedCase) - { - parentWidget._children[x].domContainer.style.display = "none"; - } - } - } - + + // fix for ETWOTWO-490, hide elements after rendering + if (xformsNode.childNodes[i].nodeName == "chiba:data" && + parentWidget instanceof alfresco.xforms.SwitchGroup) + { + var selectedCase = parentWidget._selectedCaseId; + for (var x = 0; x < parentWidget._children.length; x++) + { + if (parentWidget._children[x].id != selectedCase) + { + parentWidget._children[x].domContainer.style.display = "none"; + } + } + } + var w = this.createWidget(xformsNode.childNodes[i]); if (w != null) { @@ -4762,11 +4762,23 @@ alfresco.constants.TINY_MCE_DEFAULT_SETTINGS = add_form_submit_trigger: false, theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", - theme_advanced_buttons1: "", + theme_advanced_buttons1: "fullscreen,table", theme_advanced_buttons2: "", theme_advanced_buttons3: "", urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback", - file_browser_callback: "alfresco_TinyMCE_file_browser_callback" + file_browser_callback: "alfresco_TinyMCE_file_browser_callback", + setup : function(ed) + { + // Fix for issue in browsers where content is not saved after fullscreen mode is toggled off + ed.onSetContent.add(function(ed, o) { + //if fullscreen plugin is available and o has these values, then we're coming out of fullscreen mode only + if ((ed.settings.plugins.indexOf('fullscreen')!=-1) && o.set && o.format==='raw' && o.initial===undefined) + { + alfresco.xforms.RichTextEditor.currentInstance._commitValueChange(alfresco.xforms.RichTextEditor.currentInstance.getValue()); + } + }); + + } }; tinyMCE.init($extend({}, alfresco.constants.TINY_MCE_DEFAULT_SETTINGS));