diff --git a/commons-exo-extension/pom.xml b/commons-exo-extension/pom.xml index beb6c985..8bc214df 100644 --- a/commons-exo-extension/pom.xml +++ b/commons-exo-extension/pom.xml @@ -21,7 +21,7 @@ org.exoplatform.commons-exo commons-exo - 7.1.x-SNAPSHOT + 7.1.x-meeds-qaui-SNAPSHOT commons-exo-extension diff --git a/exo.core.component.database/pom.xml b/exo.core.component.database/pom.xml index b9e0b062..76bc88aa 100644 --- a/exo.core.component.database/pom.xml +++ b/exo.core.component.database/pom.xml @@ -27,7 +27,7 @@ org.exoplatform.commons-exo commons-exo - 7.1.x-SNAPSHOT + 7.1.x-meeds-qaui-SNAPSHOT exo.core.component.database diff --git a/exo.kernel.component.command/pom.xml b/exo.kernel.component.command/pom.xml index ee92cb5d..91247abd 100644 --- a/exo.kernel.component.command/pom.xml +++ b/exo.kernel.component.command/pom.xml @@ -27,7 +27,7 @@ org.exoplatform.commons-exo commons-exo - 7.1.x-SNAPSHOT + 7.1.x-meeds-qaui-SNAPSHOT exo.kernel.component.command diff --git a/exo.kernel.component.ext.cache.impl.infinispan.v8/pom.xml b/exo.kernel.component.ext.cache.impl.infinispan.v8/pom.xml index 3dcc246b..8f0b9fe9 100644 --- a/exo.kernel.component.ext.cache.impl.infinispan.v8/pom.xml +++ b/exo.kernel.component.ext.cache.impl.infinispan.v8/pom.xml @@ -25,7 +25,7 @@ org.exoplatform.commons-exo commons-exo - 7.1.x-SNAPSHOT + 7.1.x-meeds-qaui-SNAPSHOT exo.kernel.component.ext.cache.impl.infinispan.v8 Meeds:: PLF:: Kernel :: Cache Extension :: Infinispan Implementation diff --git a/pom.xml b/pom.xml index ac606fb4..9c385b2f 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ org.exoplatform.commons-exo commons-exo - 7.1.x-SNAPSHOT + 7.1.x-meeds-qaui-SNAPSHOT pom eXo PLF:: eXo Platform Commons @@ -29,7 +29,7 @@ - 24.x-SNAPSHOT + 24.x-meeds-qaui-SNAPSHOT exoplatform diff --git a/web/eXoResources/pom.xml b/web/eXoResources/pom.xml index 549df354..68a192d9 100644 --- a/web/eXoResources/pom.xml +++ b/web/eXoResources/pom.xml @@ -20,7 +20,7 @@ org.exoplatform.commons-exo commons-exo.portal.web - 7.1.x-SNAPSHOT + 7.1.x-meeds-qaui-SNAPSHOT 4.0.0 diff --git a/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml b/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml index eac2ee0a..26d89604 100644 --- a/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/web/eXoResources/src/main/webapp/WEB-INF/gatein-resources.xml @@ -121,23 +121,6 @@ - - uiPopupMessages - webuiGRP - - - jquery - - - uiPopupWindow - - - bts_collapse - - - iphoneStyleCheckbox @@ -171,29 +154,6 @@ - - upload - webuiExtGRP - - - base - - - jquery - - - uiMaskLayer - - - portalRequest - - - bts_tooltip - - - CalDateTimePicker de diff --git a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UINotification.js b/web/eXoResources/src/main/webapp/javascript/eXo/webui/UINotification.js deleted file mode 100644 index c866c69b..00000000 --- a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UINotification.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -function UINotification(){ - this.timerlen = 5; - this.slideAniLen = 1000; - this.timerID = new Array(); - this.startTime = new Array(); - this.object = new Array(); - this.endHeight = new Array(); - this.moving = new Array(); - this.endSlideUpCallback = new Array(); - this.dir = new Array(); - this.importantNoti = new Array(); - this.flagNoti = new Array(); - this.totalCurrentMessage = 0; - this.numberMessageRecepted = 0; - this.numImptNoti = 0; - if (eXo.core.Topic != null) { - eXo.core.Topic.subscribe("/eXo/portal/notification", function(event){ - eXo.webui.UINotification.addMessage(event.message); - }) - } -} -/** - * Display notification on sliding down - * @param {String} objectName identifier of notification object - */ -UINotification.prototype.slideDown = function(objectName){ - if(this.moving[objectName]) return; - if(document.getElementById(objectName).style.display != "none") return; - this.moving[objectName] = true; - this.dir[objectName] = "down"; - this.startSlide(objectName); -} -/** - * Set sliding down and up - */ -UINotification.prototype.slideDownUp = function(objectName, endSlideUpCallback){ - this.slideDown(objectName); - this.endSlideUpCallback[objectName] = endSlideUpCallback; - if(this.flagNoti[objectName]) setTimeout("eXo.webui.UINotification.slideUp('" + objectName + "')", 3000); -} -/** - * Event when user click "x" close button on the notification - * If notify content is important, immediately it will not be close and uses closing timeout - */ -UINotification.prototype.closeNotification = function() { - for(var i = 0; i < this.importantNoti.length; i ++) { - this.flagNoti[this.importantNoti[i]] = true; - setTimeout("eXo.webui.UINotification.slideUp('" + this.importantNoti[i] + "')", 100); - } -} -/** - * Display (hide) notification as sliding up - */ -UINotification.prototype.slideUp = function(objectName){ - if(this.moving[objectName]) return; - if(document.getElementById(objectName).style.display == "none") return; - this.moving[objectName] = true; - this.dir[objectName] = "up"; - this.startSlide(objectName); -} -/** - * Start slide animation - * @param {String} objectName identifier of notification object - */ -UINotification.prototype.startSlide = function(objectName){ - this.object[objectName] = document.getElementById(objectName); - this.endHeight[objectName] = parseInt(this.object[objectName].style.height); - this.startTime[objectName] = (new Date()).getTime(); - if(this.dir[objectName] == "down"){ - this.object[objectName].style.height = "1px"; - } - this.object[objectName].style.display = "block"; - this.timerID[objectName] = setInterval('eXo.webui.UINotification.slideTick(\'' + objectName + '\');',this.timerlen); -} -/** - * Calculate height property every tick time - * @param {String} objectName name of object - */ -UINotification.prototype.slideTick = function(objectName){ - var elapsed = (new Date()).getTime() - this.startTime[objectName]; - if (elapsed > this.slideAniLen) - this.endSlide(objectName); - else { - var d =Math.round(elapsed / this.slideAniLen * this.endHeight[objectName]); - if(this.dir[objectName] == "up") - d = this.endHeight[objectName] - d; - this.object[objectName].style.height = d + "px"; - } - return; -} -/** - * Remove notification from page body - */ -UINotification.prototype.destroyUINotification = function(){ - var UINotification = document.getElementById("UINotification"); - document.getElementsByTagName("body")[0].removeChild(UINotification); -} -/** - * End sliding, clean and destroy resource - */ -UINotification.prototype.endSlide = function(objectName){ - clearInterval(this.timerID[objectName]); - if(this.dir[objectName] == "up") { - this.object[objectName].style.display = "none"; - if(this.endSlideUpCallback[objectName]) { - this.endSlideUpCallback[objectName](objectName); - this.totalCurrentMessage --; - if(this.totalCurrentMessage == 0) { - this.destroyUINotification(); - return; - } - } - } - this.object[objectName].style.height = this.endHeight[objectName] + "px"; - delete(this.moving[objectName]); - delete(this.timerID[objectName]); - delete(this.startTime[objectName]); - delete(this.endHeight[objectName]); - delete(this.object[objectName]); - delete(this.dir[objectName]); - delete(this.flagNoti[objectName]); - return; -} -/** - * Remove object from document - * @param {String} objectName identifier of Object - */ -UINotification.prototype.deleteBox = function(objectName) { - var el = document.getElementById(objectName); - el.parentNode.removeChild(el); -} -/** - * Create frame that contains whole notification content - * @return {String} htmlString html string - */ -UINotification.prototype.createFrameForMessages = function() { - var htmlString = ""; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "Notification"; - htmlString += ""; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - htmlString += "
"; - return htmlString; -} -/** - * Add message content to notification - * @param {String} messageContent content to notify - * @param {boolean} flag - */ -UINotification.prototype.addMessage = function(messageContent, flag) { - var currMessageBoxId = "UIMessageBox_" + this.numberMessageRecepted++; - var UIMessageContent = document.createElement('div'); - this.totalCurrentMessage++; - - this.flagNoti[currMessageBoxId] = !flag; - if(flag) { - this.importantNoti[this.numImptNoti] = currMessageBoxId; - this.numImptNoti++; - } - UIMessageContent.id = currMessageBoxId; - UIMessageContent.style.height = "35px"; - UIMessageContent.style.display = "none"; - UIMessageContent.className = "Item"; - UIMessageContent.innerHTML = "
" + messageContent + "
"; - var UINotification = document.getElementById("UINotification"); - if (UINotification == null) { - document.body.appendChild(document.createElement('div')).id = "UINotification"; - UINotification = document.getElementById("UINotification"); - UINotification.className = 'UINotification'; - UINotification.innerHTML=this.createFrameForMessages(); - } - var msPanel = document.getElementById("UINotificationContent"); - msPanel.appendChild(UIMessageContent); - eXo.webui.UINotification.slideDownUp(currMessageBoxId, this.deleteBox); -} \ No newline at end of file diff --git a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopup.js b/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopup.js deleted file mode 100644 index eec1f008..00000000 --- a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopup.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -/* TODO: need to manage zIndex for all popup */ -/** - * Main class to manage popups - */ - -(function($, base) { - eXo.webui.UIPopup = { - - zIndex : 2000, - - /** - * Inits the popup . calls changezIndex when the users presses the popup - */ - init : function(popup, containerId) { - if (typeof (popup) == "string") - popup = document.getElementById(popup); - if (containerId) - popup.containerId = containerId; - popup.onmousedown = this.changezIndex; - }, - /** - * Increments the current zIndex value and sets this popup's zIndex property - * to this value - */ - changezIndex : function() { - this.style.zIndex = ++eXo.webui.UIPopup.zIndex; - }, - /** - * Creates and returns a div element with the following style properties . - * position: relative . display: none - */ - create : function() { - var popup = document.createElement("div"); - popup.style.position = "relative"; - popup.style.display = "none"; - return popup; - }, - /** - * Sets the size of the popup with the given width and height parameters - */ - setSize : function(popup, w, h) { - popup.style.width = w + "px"; - popup.style.height = h + "px"; - }, - /** - * Shows (display: block) the popup - */ - show : function(popup) { - if (typeof (popup) == "string") { - popup = document.getElementById(popup); - } - - var uiMaskWS = document.getElementById("UIMaskWorkspace"); - if (uiMaskWS) { - uiMaskWSzIndex = $(uiMaskWS).css("zIndex"); - if (uiMaskWSzIndex && (uiMaskWSzIndex > eXo.webui.UIPopup.zIndex)) { - eXo.webui.UIPopup.zIndex = uiMaskWSzIndex; - } - } - - popup.style.zIndex = ++eXo.webui.UIPopup.zIndex; - popup.style.display = "block"; - }, - /** - * Shows (display: none) the popup - */ - hide : function(popup) { - if (typeof (popup) == "string") { - popup = document.getElementById(popup); - } - - popup.style.display = "none"; - }, - /** - * Sets the position of the popup to x and y values changes the style - * properties : . position: absolute . top and left to y and x respectively if - * the popup has a container, set its position: relative too - */ - setPosition : function(popup, x, y, isRTL) { - if (popup.containerId) { - var container = document.getElementById(popup.containerId); - container.style.position = "relative"; - } - popup.style.position = "absolute"; - popup.style.top = y + "px"; - if (isRTL) { - popup.style.right = x + "px"; - popup.style.left = ""; - } else { - popup.style.left = x + "px"; - popup.style.right = ""; - } - }, - /** - * Aligns the popup according to the following values : 1 : top left 2 : top - * right 3 : bottom left 4 : bottom right other : center - */ - setAlign : function(popup, pos, hozMargin, verMargin) { - if (typeof (popup) == 'string') - popup = document.getElementById(popup); - var stdLeft = $(window).width() - - base.Browser.findPosX(document - .getElementById("UIWorkingWorkspace")); - var intTop = 0; - var intLeft = 0; - if (!hozMargin) - hozMargin = 0; - if (!verMargin) - verMargin = 0; - - var browserHeight = $(window).height(); - switch (pos) { - case 1: // Top Left - intTop = verMargin; - intLeft = hozMargin; - break; - case 2: // Top Right - intTop = verMargin; - intLeft = (stdLeft - popup.offsetWidth) - hozMargin; - break; - case 3: // Bottom Left - intTop = (browserHeight - popup.offsetHeight) - - verMargin; - intLeft = hozMargin; - break; - case 4: // Bottom Right - intTop = (browserHeight - popup.offsetHeight) - - verMargin; - intLeft = (stdLeft - popup.offsetWidth) - hozMargin; - break; - default: - intTop = (browserHeight - popup.offsetHeight) / 2; - intLeft = (uiWorkingWS.offsetWidth - popup.offsetWidth) / 2; - break; - } - - this.setPosition(popup, intLeft, intTop, eXo.core.I18n.isRT()); - }, - /** - * Inits the DragDrop class with empty values - */ - initDND : function(evt) { - var DragDrop = eXo.core.DragDrop; - - var clickBlock = this; - var dragBlock = $(clickBlock).parent().closest(".UIDragObject")[0]; - DragDrop.init(clickBlock, dragBlock); - } - }; - return eXo.webui.UIPopup; -})($, base); diff --git a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupMessages.js b/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupMessages.js deleted file mode 100644 index 9c131cc0..00000000 --- a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupMessages.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright (C) 2013 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it under the - * terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF - * site: http://www.fsf.org. - */ -(function($, uiPopupWindow) { - var uiPopupMessages = { - init : function(popupId) { - var collapsible = $("#" + popupId + " *[data-toggle='collapse']"); - collapsible.parent().on("show hide", function() { - $(this).find("i").toggleClass("uiIconArrowRight uiIconArrowDown"); - }); - }, - - show : function(popupId, isShowMask) { - uiPopupWindow.show(popupId, isShowMask); - }, - - hide : function(popupId, isShowMask) { - uiPopupWindow.hide(popupId, isShowMask); - } - }; - return uiPopupMessages; -})($, uiPopupWindow); \ No newline at end of file diff --git a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js b/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js deleted file mode 100644 index cfaf01dd..00000000 --- a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupWindow.js +++ /dev/null @@ -1,333 +0,0 @@ -/** - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - -/** - * A class that manages a popup window - */ -(function($, base, common, uiMaskLayer, uiPopup) { - var popupWindow = { - superClass : uiPopup, - - // TODO: manage zIndex properties - /** - * Shows the popup window passed in parameter gets the highest z-index - * property of the elements in the page : . gets the z-index of the maskLayer . - * gets all the other popup windows . gets the highest z-index from these, if - * it's still at 0, set an arbitrary value of 2000 sets the position of the - * popup on the page (top and left properties) - */ - show : function(popupId, isShowMask, middleBrowser, height) { - var popup = document.getElementById(popupId); - if (popup == null) return; - - // TODO Lambkin: this statement create a bug in select box component in - // Firefox - // this.superClass.init(popup) ; - var popupBar = $(popup).find("span.PopupTitle")[0]; - - if (isShowMask) - popupWindow.showMask(popup, true); - popup.style.visibility = "hidden"; - this.superClass.show(popup); - - popupWindow.addToWrapper(popup); - - var resizeBtn = $(popup).find(".ResizeButton, .uiIconResize").last(); - if (resizeBtn.length) { - resizeBtn.show(); - resizeBtn.off().on("mousedown touchstart", this.startResizeEvt); - } - this.initDND(popupBar, popup); - if ($(popup).find("iframe").length > 0) { - setTimeout(function() {popupWindow.setupWindow(popup, middleBrowser, height);}, 500); - } else { - this.setupWindow(popup, middleBrowser, height); - } - }, - - setupWindow : function(popup, middleBrowser, height) { - var jPopup = $(popup); - var vrez = popupWindow.getResizeBlock(jPopup); - if (height) { - vrez.css("max-height", height); - } - var browserHeight = $(window).height(); - if (browserHeight < jPopup[0].offsetHeight) { - vrez.css("max-height", ""); - var vrezHeight = browserHeight - jPopup[0].offsetHeight + vrez.height() - 20; - vrez.height(vrezHeight >= 10 ? vrezHeight : 10); - } - - var scrollY = 0, offsetParent = popup.offsetParent; - if (window.pageYOffset != undefined) - scrollY = window.pageYOffset; - else if (document.documentElement && document.documentElement.scrollTop) - scrollY = document.documentElement.scrollTop; - else - scrollY = document.body.scrollTop; - // reference - if (offsetParent) { - var middleWindow = $(offsetParent).is(".UIPopupWindow,.UIWindow"); - if (middleWindow) { - popup.style.top = Math.ceil((offsetParent.offsetHeight - popup.offsetHeight) / 2) + "px"; - } - if (middleBrowser || !middleWindow) { - popup.style.top = Math.ceil((browserHeight - popup.offsetHeight) / 2) + scrollY + "px"; - } - // Todo: set popup of UIPopup always display in the center browsers in case UIMaskWorkspace - if ($(offsetParent).hasClass("UIMaskWorkspace")) { - popup.style.top = Math.ceil((offsetParent.offsetHeight - popup.offsetHeight) / 2) + "px"; - } - - // hack for position popup alway top in IE6. - var checkHeight = popup.offsetHeight > 300; - - if (document.getElementById("UIDockBar") && checkHeight) { - popup.style.top = "6px"; - } - popup.style.left = Math.ceil((offsetParent.offsetWidth - popup.offsetWidth) / 2) + "px"; - } - if ($(popup).offset().top < 0) - popup.style.top = scrollY + "px"; - - popup.style.visibility = "visible"; - }, - - hide : function(popupId, isShowMask) { - var popup = document.getElementById(popupId); - if (popup == null) return; - popupWindow.removeFromWrapper(popup); - this.superClass.hide(popup); - if (isShowMask) popupWindow.showMask(popup, false); - }, - - showMask : function(popup, isShowPopup) { - var mask = popup.previousSibling; - // Make sure mask is not TextNode because of previousSibling property - if (mask && mask.className != "MaskLayer") { - mask = null; - } - if (isShowPopup) { - // Modal if popup is portal component - if ($(popup).parents(".PORTLET-FRAGMENT").length < 1){ - if (!mask) - uiMaskLayer.createMask(popup.parentNode, popup, 1); - } else { - // If popup is portlet's component, modal with just its parent - if (!mask) - uiMaskLayer.createMaskForFrame(popup.parentNode, popup, 1); - } - } else { - if (mask) - uiMaskLayer.removeMask(mask); - } - }, - - addToWrapper : function(popup) { - var $popup = $(popup); - if ($popup.parent().hasClass('uiPopupWrapper')) return; - - var $wrapper = $('
'); - $wrapper.css({ - 'zIndex' : ++eXo.webui.UIPopup.zIndex - }); - $wrapper.insertAfter($popup); - $wrapper.append($popup); - - $wrapper.on('click', function(e) { - var $target = $(e.target); - if ($target.hasClass('uiPopupWrapper')) { - $wrapper.find('.uiIconClose').first().click(); - return false; - } - }); - - $('body').addClass('modal-open'); - }, - - removeFromWrapper : function(popup) { - var $popup = $(popup); - if ($popup.css('display') == 'none' || !$popup.parent().hasClass('uiPopupWrapper')) - return; - - var $wrapper = $popup.parent(); - - $wrapper.replaceWith($popup); - if (!$('.uiPopupWrapper').length) { - $('body').removeClass('modal-open'); - } - }, - - /** - * Called when the window starts being resized sets the onmousemove and - * onmouseup events on the portal application (not the popup) associates these - * events with UIPopupWindow.resize and UIPopupWindow.endResizeEvt - * respectively - */ - startResizeEvt : function(evt) { - //disable select text - popupWindow.backupEvent = null; - if (navigator.userAgent.indexOf("MSIE") >= 0) { - //Need to check if we have remove resizedPopup after last mouseUp - //IE bug: not call endResizeEvt when mouse moved out of page - if (!popupWindow.resizedPopup && document.onselectstart) { - popupWindow.backupEvent = document.onselectstart; - } - document.onselectstart = function() {return false}; - } else { - if (document.onmousedown) { - popupWindow.backupEvent = document.onmousedown; - } - $(document).on("mousedown touchstart", function() {return false}); - } - - var targetPopup = $(this).parents(".UIPopupWindow, .uiPopup")[0]; - popupWindow.resizedPopup = targetPopup; - popupWindow.vresized = popupWindow.getResizeBlock($(targetPopup)); - popupWindow.backupPointerY = base.Browser.findMouseRelativeY(targetPopup, evt) ; - - var jDoc = $(document); - jDoc.on("mousemove touchmove", popupWindow.resize); - jDoc.on("mouseup touchend", popupWindow.endResizeEvt); - }, - - /** - * Function called when the window is being resized . gets the position of the - * mouse . calculates the height and the width of the window from this - * position . sets these values to the window - */ - resize : function(evt) { - var targetPopup = popupWindow.resizedPopup ; - var content = popupWindow.vresized; - var isRTL = eXo.core.I18n.isRT(); - var pointerX = base.Browser.findMouseRelativeX(targetPopup, evt, isRTL); - var pointerY = base.Browser.findMouseRelativeY(targetPopup, evt); - var delta = pointerY - popupWindow.backupPointerY; - - var height = 0; - content.each(function() { - if ($(this).height()) { - height = $(this).height(); - return; - } - }); - if (height + delta > 0) { - popupWindow.backupPointerY = pointerY; - content.height(height + delta); - content.css("max-height", ""); - } - targetPopup.style.height = "auto"; - - if (isRTL) { - pointerX = (-1) * pointerX; - } - - if (pointerX > 230) - targetPopup.style.width = (pointerX + 10) + "px"; - }, - - /** - * Called when the window stops being resized cancels the mouse events on the - * portal app inits the scroll managers active on this page (in case there is - * one in the popup) - */ - endResizeEvt : function(evt) { - popupWindow.resizedPopup = null; - popupWindow.vresized = null; - $(this).off("mousemove touchmove mouseup touchstop"); - - //enable select text - if (navigator.userAgent.indexOf("MSIE") >= 0) { - document.onselectstart = popupWindow.backupEvent; - } else { - $(document).off("mousedown touchstart").on("mousedown touchstart", popupWindow.backupEvent); - } - popupWindow.backupEvent = null; - }, - - /** - * Init the Drag&Drop infrastructure using DragDrop - * - * @param popupBar - * @param popup - */ - initDND : function(popupBar, popup) - { - common.DragDrop.init(popupBar, popup); - - popup.onDragStart = function(x, y, last_x, last_y, e) - { - if (base.Browser.isFF() && popup.uiWindowContent) - { - popup.uiWindowContent.style.overflow = "auto"; - $(popup.uiWindowContent).find("ul.PopupMessageBox").css("overflow", "auto"); - } - }; - - popup.onDrag = function(nx, ny, ex, ey, e) - { - }; - - popup.onDragEnd = function(x, y, clientX, clientY) - { - if (base.Browser.isFF() && popup.uiWindowContent) - { - popup.uiWindowContent.style.overflow = "auto"; - $(popup.uiWindowContent).find("ul.PopupMessageBox").css("overflow", "auto"); - } - var offsetParent = popup.offsetParent; - if (offsetParent) - { - if (clientY < 0) - { - popup.style.top = (0 - offsetParent.offsetTop) + "px"; - } - } - else - { - popup.style.top = "0px"; - } - }; - - popup.onCancel = function(e) - { - }; - }, - - getResizeBlock : function(jPopup) { - var filterPopup = function() { - return $(this).closest(".uiPopup").attr("id") === jPopup.attr("id"); - }; - - jPopup.find(".resizable .resizable").filter(filterPopup).removeClass("resizable"); - var innerRez = jPopup.find(".resizable").filter(filterPopup); - var contentBlock = jPopup.find("div.PopupContent, .popupContent").filter(filterPopup); - - var vrez; - if (innerRez.length) { - vrez = innerRez; - } else { - vrez = contentBlock; - } - return vrez; - } - }; - - return popupWindow; -})($, base, common, uiMaskLayer, uiPopup); diff --git a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVirtualList.js b/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVirtualList.js deleted file mode 100644 index 47dc1745..00000000 --- a/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVirtualList.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it under the - * terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF - * site: http://www.fsf.org. - */ - -(function($, base) { - var virtualList = { - - init : function(componentId, hasNext, autoAdjustHeight, loadNextUrl) { - var uiVirtualList = document.getElementById(componentId); - if (uiVirtualList == null) - return; - - $(uiVirtualList).on("scroll", function() { - virtualList.onScroll(this, loadNextUrl); - }); - - if (!hasNext) { - uiVirtualList.isFinished = true; - } - - var virtualHeight = $(uiVirtualList).height(); - - if (virtualHeight == 0) { - virtualHeight = 300; - } - - uiVirtualList.style.height = virtualHeight + "px"; - - if (autoAdjustHeight) { - uiVirtualList.autoAdjustHeight = autoAdjustHeight; - base.Browser.fillUpFreeSpace(uiVirtualList); - } - - uiVirtualList.scrollTop = 0; - - this.loadIfNeeded(uiVirtualList); - }, - - loadIfNeeded : function(uiVirtualList) { - if (uiVirtualList.clientHeight == uiVirtualList.scrollHeight) { - if (uiVirtualList.isFinished) { - if (uiVirtualList.autoAdjustHeight) { - uiVirtualList.style.height = "auto"; - } - } else { - $(uiVirtualList).trigger("scroll"); - } - } - $(uiVirtualList).find('a[rel="tooltip"]').tooltip(); - }, - - getFeedBox : function(componentId) { - var uiVirtualList = $("#" + componentId); - var feedBox = uiVirtualList.find("div.FeedBox"); - if(!feedBox || feedBox.length < 1) - { - feedBox = uiVirtualList.find("tbody.FeedBox"); - } - return feedBox[0]; - }, - - onScroll : function(uiVirtualList, url) { - $(uiVirtualList).find('a[rel="tooltip"]').tooltip('hide'); - if (uiVirtualList.isFinished || uiVirtualList.inProgress) - return; - var componentHeight = uiVirtualList.offsetHeight; - var scrollPosition = uiVirtualList.scrollTop; - var scrollerHeight = uiVirtualList.scrollHeight; - var scrollable_gap = scrollerHeight - (scrollPosition + componentHeight); - // if scrollbar reaches bottom - if (scrollable_gap <= 1) { - var feedBox = this.getFeedBox(uiVirtualList.id); - var html = feedBox.innerHTML; - uiVirtualList.backupHTML = html; - uiVirtualList.inProgress = true; - ajaxGet(url); - } - }, - - updateList : function(componentId, hasNext) { - var uiVirtualList = document.getElementById(componentId); - if (uiVirtualList == null) - return; - - if (!hasNext) { - uiVirtualList.isFinished = true; - } - - var feedBox = this.getFeedBox(uiVirtualList.id); - var loadedContent = uiVirtualList.backupHTML; - - if (!base.Browser.isIE()) { - feedBox.innerHTML = loadedContent + feedBox.innerHTML; - } else { - var index = uiVirtualList.innerHTML.indexOf(feedBox.className); - index = uiVirtualList.innerHTML.indexOf(">", index) + 1; - var firstSec = uiVirtualList.innerHTML.substring(0, index); - var secondSec = uiVirtualList.innerHTML.substring(index); - uiVirtualList.innerHTML = firstSec + loadedContent + secondSec; - } - uiVirtualList.inProgress = false; - - this.loadIfNeeded(uiVirtualList); - } - }; - - return virtualList; -})($, base); diff --git a/web/eXoResources/src/main/webapp/javascript/eXo/webui/Upload.js b/web/eXoResources/src/main/webapp/javascript/eXo/webui/Upload.js deleted file mode 100644 index e09389b2..00000000 --- a/web/eXoResources/src/main/webapp/javascript/eXo/webui/Upload.js +++ /dev/null @@ -1,627 +0,0 @@ -/** - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it under the - * terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This software is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF - * site: http://www.fsf.org. - */ - -(function($, base, uiMaskLayer) { - var uiUploadInput = { - listUpload : [], - refreshTime : 1000, - delayTime : 0, - - /** - * Initialize upload and create a upload request to server - * - * @param {String} - * uploadId identifier upload - */ - initUploadEntry : function(id, uploadId, limited) { - if (!uiUploadInput.progressURL) { - var context = eXo.env.server.context; - uiUploadInput.progressURL = context - + "/upload?action=progress&uploadId="; - uiUploadInput.uploadURL = context + "/upload?action=upload&uploadId="; - uiUploadInput.abortURL = context + "/upload?action=abort&uploadId="; - uiUploadInput.deleteURL = context + "/upload?action=delete&uploadId="; - } - - var uiInput = $("#" + id); - if (uploadId.length) { - uiInput.data("inputs", uploadId); - if (limited) { - uiInput.data("limited", uploadId.length); - } - } - - for ( var i = 0; i < uploadId.length; i++) { - var url = uiUploadInput.progressURL + uploadId[i]; - var responseText = ajaxAsyncGetRequest(url, false); - try { - eval("var response = " + responseText); - } catch (err) { - return; - } - - if (response.upload[uploadId[i]] - && response.upload[uploadId[i]].percent == 100) { - var jCont = uiUploadInput.cloneContainer(id, uploadId[i]); - jCont.data("fileName", response.upload[uploadId[i]].fileName); - uiUploadInput.showUploaded(uploadId[i]); - } - } - uiUploadInput.createEntryUpload(id); - uiUploadInput.fileSelectedStatus(id); - }, - - createEntryUpload : function(id) { - var uiInput = $("#" + id); - var inputs = uiInput.data("inputs"); - var limited = uiInput.data("limited"); - var uploadBtn = uiInput.find(".uploadButton"); - - var uploadId = null; - for ( var i = 0; i < inputs.length; i++) { - var jCont = $("#uploadContainer" + inputs[i]); - if (!jCont.length) { - uploadId = inputs[i]; - break; - } - } - - if (!uploadId) { - if (inputs.length === limited) { - uploadBtn.hide(); - return; - } - - var createURL = uiInput.children(".createUploadURL").text(); - ajaxAsyncGetRequest(createURL, false); - var uploadId = inputs[inputs.length - 1]; - var idx = uploadId.search(/-\d+$/) + 1; - uploadId = uploadId.substring(0, idx) - + (parseInt(uploadId.substring(idx)) + 1); - inputs.push(uploadId); - uiInput.data("inputs", inputs); - } - - var uploadCont = uiUploadInput.cloneContainer(id, uploadId); - var input = uploadCont.find("input"); - if (base.Browser.isIE()) { - uploadBtn.find("label").attr("for", input.attr("id")); - input.css({ - "position" : "absolute", - "left" : "-5000px" - }).show(); - } else { - uploadBtn.off("click").click(function() { - input.click(); - }) - } - uploadBtn.show(); - }, - - cloneContainer : function(id, uploadId) { - var uiInput = $("#" + id); - var template = uiInput.children("script[type='text/template']"); - var uploadCont = $(template.html()); - uploadCont.attr("id", "uploadContainer" + uploadId); - uploadCont.on("click", ".deleteFileLabel, .removeFile", function() { - if ($(this).hasClass("removeFile")) { - uiUploadInput.deleteUpload(uploadId); - } else { - uiUploadInput.abortUpload(uploadId); - } - return false; - }); - - var file = uploadCont.find("input"); - file.attr("id", "file" + uploadId); - file.on("change", function() { - uiUploadInput.upload(uploadId); - }); - - var iframe = uploadCont.find("iframe"); - if (base.Browser.isIE7()) { - var tmp = iframe[0].outerHTML; - tmp = tmp.replace("name=uploadIFrame", "name=uploadIFrame" + uploadId); - iframe.replaceWith($(tmp)); - } else { - iframe.attr("name", "uploadIFrame" + uploadId); - } - template.before(uploadCont); - uploadCont.show(); - uploadCont.find("*[rel='tooltip']").tooltip(); - return uploadCont; - }, - - showUploaded : function(id) { - uiUploadInput.remove(id); - var jCont = $('#uploadContainer' + id); - jCont.find(".progressBarFrame").hide(); - - var selectFileFrame = jCont.find(".selectFileFrame"); - selectFileFrame.show(); - - selectFileFrame.find(".fileNameLabel").html( - uiUploadInput.processFileInfo(id)); - }, - - processFileInfo : function(uploadId) { - var jCont = $("#uploadContainer" + uploadId); - var selectFileFrame = jCont.find(".selectFileFrame"); - var delIcon = selectFileFrame.find(".removeFile"); - - var fileName = jCont.data("fileName") || ""; - fileName = decodeURIComponent(fileName); - - if (selectFileFrame.css("display") !== "none") { - var tmp = $("" + fileName + "") - .css("visibility", "hidden"); - $(document.body).append(tmp); - if (tmp.width() > selectFileFrame.width() - delIcon.width()) { - fileName = fileName.substring(0, 51) + "..."; - } - tmp.remove(); - } else if (fileName.length > 20) { - fileName = fileName.substring(0, 21) + "..."; - } - return fileName; - }, - - refreshProgress : function() { - var list = uiUploadInput.listUpload; - if (list.length < 1) - return; - var url = uiUploadInput.progressURL; - - for ( var i = 0; i < list.length; i++) { - url = url + "&uploadId=" + list[i]; - } - var responseText = ajaxAsyncGetRequest(url, false); - - try { - eval("var response = " + responseText); - } catch (err) { - return; - } - - for (id in response.upload) { - var jCont = $("#uploadContainer" + id); - if (response.upload[id].status == "failed") { - var message = jCont.siblings(".limitMessage").html(); - uiUploadInput.abortUpload(id); - message = message.replace("{0}", response.upload[id].size); - message = message.replace("{1}", response.upload[id].unit); - alert(message); - continue; - } - - var percent = response.upload[id].percent; - var bar = jCont.find(".bar").first(); - bar.css("width", percent + "%"); - var label = jCont.find(".percent").first(); - label.html(percent + "%"); - - if (percent == 100) { - uiUploadInput.showUploaded(id); - $("#calendar-event-attachment-Save").prop("disabled", false); - } - } - - setTimeout(uiUploadInput.refreshProgress, uiUploadInput.refreshTime); - }, - - deleteUpload : function(id) { - uiMaskLayer.removeMasks($("#MaskLayer")[0]); - var url = uiUploadInput.deleteURL + id; - ajaxAsyncGetRequest(url, false); - - var jCont = $('#uploadContainer' + id); - var uiInput = jCont.closest(".uiUploadInput"); - var inputs = uiInput.data("inputs"); - if (inputs.length > 1) { - var rmInput = uiInput.children(".removeInputUrl").text(); - ajaxAsyncGetRequest(rmInput + "&objectId=" + id, false); - - var uiInput = jCont.closest(".uiUploadInput"); - inputs.splice($.inArray(id, inputs), 1); - uiInput.data("inputs", inputs); - } - - jCont.remove(); - if (uiInput.find(".uploadButton").css("display") == "none") { - uiUploadInput.createEntryUpload(uiInput.attr("id")); - } - uiUploadInput.fileSelectedStatus(uiInput.attr("id")); - }, - - abortUpload : function(id) { - uiMaskLayer.removeMasks($("#MaskLayer")[0]); - uiUploadInput.remove(id); - var url = uiUploadInput.abortURL + id; - ajaxAsyncGetRequest(url, false); - - var jCont = $('#uploadContainer' + id); - var uiInput = jCont.closest(".uiUploadInput"); - jCont.remove(); - if (uiInput.find(".uploadButton").css("display") == "none") { - uiUploadInput.createEntryUpload(uiInput.attr("id")); - } - uiUploadInput.fileSelectedStatus(uiInput.attr("id")); - }, - - /** - * Start upload file - * - * @param {Object} - * clickEle - * @param {String} - * id - */ - upload : function(id) { - $("#calendar-event-attachment-Save").prop("disabled", true); - var jCont = $('#uploadContainer' + id); - var uiInput = jCont.closest(".uiUploadInput"); - uiUploadInput.createEntryUpload(uiInput.attr("id")); - - var file = document.getElementById('file' + id); - if (file == null || file == undefined) - return; - if (file.value == null || file.value == '') - return; - var temp = file.value; - - if (file.files && file.files.length) { - jCont.data("fileName", file.files[0].name); - } else { - jCont.data("fileName", temp.split(/(\\|\/)/g).pop()); - } - - var progressBarFrame = jCont.find(".progressBarFrame").first(); - progressBarFrame.show(); - progressBarFrame.find(".fileNameLabel").html( - uiUploadInput.processFileInfo(id)); - - var bar = jCont.find(".bar").first(); - bar.css("width", "0%"); - var label = bar.children(".percent").first(); - label.html("0%"); - - uiUploadInput.fileSelectedStatus(uiInput.attr("id")); - - var uploadAction = uiUploadInput.uploadURL + id; - var formHTML = "
"; - var div = document.createElement("div"); - div.innerHTML = formHTML; - var form = div.firstChild; - - form.appendChild(file); - document.body.appendChild(div); - form.submit(); - document.body.removeChild(div); - - if (uiUploadInput.listUpload.length == 0) { - setTimeout(function() { - uiUploadInput.refreshProgress(id); - }, uiUploadInput.refreshTime); - } - uiUploadInput.listUpload.push(id); - }, - - fileSelectedStatus : function(id) { - var uiUploadInput = $("#" + id); - var frames = uiUploadInput.find(".uploadContainer").find( - ".selectFileFrame, .progressBarFrame"); - var hasFile = false; - frames.each(function() { - if ($(this).css("display") == "block") { - hasFile = true; - return false; - } - ; - }); - var uploadButton = uiUploadInput.find(".uploadButton"); - var noFile = uploadButton.find(".noFile"); - var moreFiles = uploadButton.find(".moreFiles"); - if (hasFile) { - noFile.hide(); - moreFiles.show(); - } else { - noFile.show(); - moreFiles.hide(); - } - }, - - remove : function(id) { - var idx = $.inArray(id, uiUploadInput.listUpload); - if (idx !== -1) { - uiUploadInput.listUpload.splice(idx, 1); - } - } - }; - - var uiUpload = { - listUpload : [], - refreshTime : 1000, - - /** - * Initialize upload and create a upload request to server - * - * @param {String} - * uploadId identifier upload - */ - initUploadEntry : function(id, uploadId) { - if (!uiUpload.progressURL) { - var context = eXo.env.server.context; - uiUpload.progressURL = context + "/upload?action=progress&uploadId="; - uiUpload.uploadURL = context + "/upload?action=upload&uploadId="; - uiUpload.abortURL = context + "/upload?action=abort&uploadId="; - uiUpload.deleteURL = context + "/upload?action=delete&uploadId="; - } - - var uiInput = $("#" + id); - uiInput.data("uploadId", uploadId); - - var url = uiUpload.progressURL + uploadId; - var responseText = ajaxAsyncGetRequest(url, false); - try { - eval("var response = " + responseText); - } catch (err) { - return; - } - - if (response.upload[uploadId] == undefined - || response.upload[uploadId].percent == undefined) { - uiUpload.createEntryUpload(id); - } else if (response.upload[uploadId] - && response.upload[uploadId].percent == 100) { - var jCont = uiUpload.cloneContainer(id, uploadId); - jCont.data("fileName", response.upload[uploadId].fileName); - uiUpload.showUploaded(uploadId); - } - }, - - createEntryUpload : function(id) { - var uiInput = $("#" + id); - var uploadId = uiInput.data("uploadId"); - var uploadBtn = uiInput.find(".uploadButton"); - - var uploadCont = uiUpload.cloneContainer(id, uploadId); - var input = uploadCont.find("input"); - if (base.Browser.isIE()) { - uploadBtn.find("label").attr("for", input.attr("id")); - input.css({ - "position" : "absolute", - "left" : "-5000px" - }).show(); - } else { - uploadBtn.off("click").click(function() { - input.click(); - }); - } - uploadBtn.show(); - uiInput.children("input[type='hidden']").val(false); - }, - - cloneContainer : function(id, uploadId) { - var uiInput = $("#" + id); - var template = uiInput.children("script[type='text/template']"); - var uploadCont = $(template.html()); - uploadCont.attr("id", "uploadContainer" + uploadId); - uploadCont.on("click", ".deleteFileLabel, .removeFile", function() { - if ($(this).hasClass("removeFile")) { - uiUpload.deleteUpload(uploadId); - } else { - uiUpload.abortUpload(uploadId); - } - return false; - }); - - var file = uploadCont.find("input"); - file.attr("id", "file" + uploadId); - file.on("change", function() { - uiUpload.upload(uploadId); - }); - - var iframe = uploadCont.find("iframe"); - if (base.Browser.isIE7()) { - var tmp = iframe[0].outerHTML; - tmp = tmp.replace("name=uploadIFrame", "name=uploadIFrame" + uploadId); - iframe.replaceWith($(tmp)); - } else { - iframe.attr("name", "uploadIFrame" + uploadId); - } - template.before(uploadCont); - uploadCont.show(); - uploadCont.find("*[rel='tooltip']").tooltip(); - return uploadCont; - }, - - showUploaded : function(id) { - uiUpload.remove(id); - var jCont = $('#uploadContainer' + id); - jCont.find(".progressBarFrame").hide(); - - var selectFileFrame = jCont.find(".selectFileFrame"); - selectFileFrame.show(); - - selectFileFrame.find(".fileNameLabel").html(uiUpload.processFileInfo(id)); - jCont.siblings(".uploadButton").hide(); - - jCont.siblings("input[type='hidden']").val(true); - }, - - processFileInfo : function(uploadId) { - var jCont = $("#uploadContainer" + uploadId); - var selectFileFrame = jCont.find(".selectFileFrame"); - var delIcon = selectFileFrame.find(".removeFile"); - - var fileName = jCont.data("fileName") || ""; - fileName = decodeURIComponent(fileName); - - if (selectFileFrame.css("display") !== "none") { - var tmp = $("" + fileName + "") - .css("visibility", "hidden"); - $(document.body).append(tmp); - if (tmp.width() > selectFileFrame.width() - delIcon.width()) { - fileName = fileName.substring(0, 51) + "..."; - } - tmp.remove(); - } else if (fileName.length > 20) { - fileName = fileName.substring(0, 21) + "..."; - } - return fileName; - }, - - refreshProgress : function() { - var list = uiUpload.listUpload; - if (list.length < 1) - return; - var url = uiUpload.progressURL; - - for ( var i = 0; i < list.length; i++) { - url = url + "&uploadId=" + list[i]; - } - var responseText = ajaxAsyncGetRequest(url, false); - - try { - eval("var response = " + responseText); - } catch (err) { - return; - } - - for (id in response.upload) { - var jCont = $("#uploadContainer" + id); - if (response.upload[id].status == "failed") { - var message = jCont.siblings(".limitMessage").html(); - uiUpload.abortUpload(id); - message = message.replace("{0}", response.upload[id].size); - message = message.replace("{1}", response.upload[id].unit); - alert(message); - continue; - } - var percent = response.upload[id].percent; - var bar = jCont.find(".bar").first(); - bar.css("width", percent + "%"); - var label = jCont.find(".percent").first(); - label.html(percent + "%"); - - if (percent == 100) { - uiUpload.showUploaded(id); - $("#calendar-event-attachment-Save").prop("disabled", false); - } - } - - setTimeout(uiUpload.refreshProgress, uiUpload.refreshTime); - }, - - deleteUpload : function(id) { - var url = uiUpload.deleteURL + id; - ajaxAsyncGetRequest(url, false); - - var jCont = $('#uploadContainer' + id); - var uiInput = jCont.closest(".uiUploadInput"); - jCont.remove(); - uiUpload.createEntryUpload(uiInput.attr("id")); - }, - - abortUpload : function(id) { - uiUpload.remove(id); - var url = uiUpload.abortURL + id; - ajaxAsyncGetRequest(url, false); - - var jCont = $('#uploadContainer' + id); - var uiInput = jCont.closest(".uiUploadInput"); - jCont.remove(); - uiUpload.createEntryUpload(uiInput.attr("id")); - }, - - /** - * Start upload file - * - * @param {Object} - * clickEle - * @param {String} - * id - */ - upload : function(id) { - var jCont = $('#uploadContainer' + id); - jCont.siblings(".uploadButton").hide(); - - var file = document.getElementById('file' + id); - if (file == null || file == undefined) - return; - if (file.value == null || file.value == '') - return; - var temp = file.value; - - if (file.files && file.files.length) { - jCont.data("fileName", file.files[0].name); - } else { - jCont.data("fileName", temp.split(/(\\|\/)/g).pop()); - } - - var progressBarFrame = jCont.find(".progressBarFrame").first(); - progressBarFrame.show(); - progressBarFrame.find(".fileNameLabel") - .html(uiUpload.processFileInfo(id)); - - var bar = jCont.find(".bar").first(); - bar.css("width", "0%"); - var label = bar.children(".percent").first(); - label.html("0%"); - - var uploadAction = uiUpload.uploadURL + id; - var formHTML = "
"; - var div = document.createElement("div"); - div.innerHTML = formHTML; - var form = div.firstChild; - - form.appendChild(file); - document.body.appendChild(div); - form.submit(); - document.body.removeChild(div); - - if (uiUpload.listUpload.length == 0) { - setTimeout(function() { - uiUpload.refreshProgress(id); - }, uiUpload.refreshTime); - } - uiUpload.listUpload.push(id); - }, - - remove : function(id) { - var idx = $.inArray(id, uiUpload.listUpload); - if (idx !== -1) { - uiUpload.listUpload.splice(idx, 1); - } - } - }; - - return { - UIUpload : uiUpload, - UIUploadInput : uiUploadInput - }; -})($, base, uiMaskLayer); \ No newline at end of file diff --git a/web/eXoSkin/pom.xml b/web/eXoSkin/pom.xml index bf93b5f1..2d0014ce 100644 --- a/web/eXoSkin/pom.xml +++ b/web/eXoSkin/pom.xml @@ -21,7 +21,7 @@ org.exoplatform.commons-exo commons-exo.portal.web - 7.1.x-SNAPSHOT + 7.1.x-meeds-qaui-SNAPSHOT commons-exo.portal.web.eXoSkin diff --git a/web/eXoSkin/src/main/webapp/WEB-INF/gatein-resources.xml b/web/eXoSkin/src/main/webapp/WEB-INF/gatein-resources.xml index 3f84e22f..4115eaf7 100644 --- a/web/eXoSkin/src/main/webapp/WEB-INF/gatein-resources.xml +++ b/web/eXoSkin/src/main/webapp/WEB-INF/gatein-resources.xml @@ -48,200 +48,6 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. /skin/css/platform/portlets/welcome-screens/unlockTrial.css - - - Simple - - SimpleBlue - - - SimpleViolet - - - SimpleOrange - - - SimplePink - - - SimpleGreen - - - - - - RoundConer - - RoundConerBlue - - - RoundConerViolet - - - RoundConerOrange - - - RoundConerPink - - - RoundConerGreen - - - - - - Shadow - - ShadowBlue - - - ShadowViolet - - - ShadowOrange - - - ShadowPink - - - ShadowGreen - - - - - - MacStyle - - MacTheme - - - MacGray - - - MacBlueSteel - - - - - - VistaStyle - - VistaTheme - - - - - - bts_button - bts - - - jquery - - - - - - bts_collapse - bts - - - jquery - - - - - - bts_dropdown - bts - - - jquery - - - - - - bts_modal - bts - - - jquery - - - - - - - bts_popover - bts - - - bts_tooltip - - - jquery - - - - - - bts_tab - bts - - - jquery - - - bts_tooltip @@ -260,22 +66,4 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - - bts_typeahead - bts - - - jquery - - - diff --git a/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-button.js b/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-button.js deleted file mode 100644 index 4b2a90ab..00000000 --- a/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-button.js +++ /dev/null @@ -1,105 +0,0 @@ -/* ============================================================ - * bootstrap-button.js v2.3.2 - * http://getbootstrap.com/2.3.2/javascript.html#buttons - * ============================================================ - * Copyright 2013 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* BUTTON PUBLIC CLASS DEFINITION - * ============================== */ - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.button.defaults, options) - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - , $el = this.$element - , data = $el.data() - , val = $el.is('input') ? 'val' : 'html' - - state = state + 'Text' - data.resetText || $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d) - }, 0) - } - - Button.prototype.toggle = function () { - var $parent = this.$element.closest('[data-toggle="buttons-radio"]') - - $parent && $parent - .find('.active') - .removeClass('active') - - this.$element.toggleClass('active') - } - - - /* BUTTON PLUGIN DEFINITION - * ======================== */ - - var old = $.fn.button - - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('button') - , options = typeof option == 'object' && option - if (!data) $this.data('button', (data = new Button(this, options))) - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.defaults = { - loadingText: 'loading...' - } - - $.fn.button.Constructor = Button - - - /* BUTTON NO CONFLICT - * ================== */ - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - /* BUTTON DATA-API - * =============== */ - - $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - }) - -}(window.jQuery); \ No newline at end of file diff --git a/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-collapse.js b/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-collapse.js deleted file mode 100644 index ae3e4c63..00000000 --- a/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-collapse.js +++ /dev/null @@ -1,167 +0,0 @@ -/* ============================================================= - * bootstrap-collapse.js v2.3.2 - * http://getbootstrap.com/2.3.2/javascript.html#collapse - * ============================================================= - * Copyright 2013 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* COLLAPSE PUBLIC CLASS DEFINITION - * ================================ */ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, $.fn.collapse.defaults, options) - - if (this.options.parent) { - this.$parent = $(this.options.parent) - } - - this.options.toggle && this.toggle() - } - - Collapse.prototype = { - - constructor: Collapse - - , dimension: function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - , show: function () { - var dimension - , scroll - , actives - , hasData - - if (this.transitioning || this.$element.hasClass('in')) return - - dimension = this.dimension() - scroll = $.camelCase(['scroll', dimension].join('-')) - actives = this.$parent && this.$parent.find('> .accordion-group > .in') - - if (actives && actives.length) { - hasData = actives.data('collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('collapse', null) - } - - this.$element[dimension](0) - this.transition('addClass', $.Event('show'), 'shown') - $.support.transition && this.$element[dimension](this.$element[0][scroll]) - } - - , hide: function () { - var dimension - if (this.transitioning || !this.$element.hasClass('in')) return - dimension = this.dimension() - this.reset(this.$element[dimension]()) - this.transition('removeClass', $.Event('hide'), 'hidden') - this.$element[dimension](0) - } - - , reset: function (size) { - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - [dimension](size || 'auto') - [0].offsetWidth - - this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') - - return this - } - - , transition: function (method, startEvent, completeEvent) { - var that = this - , complete = function () { - if (startEvent.type == 'show') that.reset() - that.transitioning = 0 - that.$element.trigger(completeEvent) - } - - this.$element.trigger(startEvent) - - if (startEvent.isDefaultPrevented()) return - - this.transitioning = 1 - - this.$element[method]('in') - - $.support.transition && this.$element.hasClass('collapse') ? - this.$element.one($.support.transition.end, complete) : - complete() - } - - , toggle: function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - } - - - /* COLLAPSE PLUGIN DEFINITION - * ========================== */ - - var old = $.fn.collapse - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('collapse') - , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) - if (!data) $this.data('collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.defaults = { - toggle: true - } - - $.fn.collapse.Constructor = Collapse - - - /* COLLAPSE NO CONFLICT - * ==================== */ - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - /* COLLAPSE DATA-API - * ================= */ - - $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - , target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - , option = $(target).data('collapse') ? 'toggle' : $this.data() - $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - $(target).collapse(option) - }) - -}(window.jQuery); \ No newline at end of file diff --git a/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-dropdown.js b/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-dropdown.js deleted file mode 100644 index d04da5d7..00000000 --- a/web/eXoSkin/src/main/webapp/skin/bootstrap/js/bootstrap-dropdown.js +++ /dev/null @@ -1,169 +0,0 @@ -/* ============================================================ - * bootstrap-dropdown.js v2.3.2 - * http://getbootstrap.com/2.3.2/javascript.html#dropdowns - * ============================================================ - * Copyright 2013 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* DROPDOWN CLASS DEFINITION - * ========================= */ - - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - if ('ontouchstart' in document.documentElement) { - // if mobile we we use a backdrop because click events don't delegate - $('