$(function() { $(".portletContainer").sortable({ disabled: true, connectWith: '.portletContainer' }); $(".portletContainer").addClass("ui-widget ui-widget-content") .find(".portlet-header") .addClass("ui-widget-header ui-corner-all") .prepend('', '', '') .end() .find(".portlet-content"); $(".portletSidebar").addClass("ui-widget ui-widget-content") .find(".portlet-header") .addClass("ui-widget-header ui-corner-all") .prepend('') .end() .find(".portlet-content"); $(".portletContainer_minimized_only").addClass("ui-widget ui-widget-content") .find(".portlet-header") .addClass("ui-widget-header ui-corner-all") .prepend('') .end() .find(".portlet-content"); $(".portletContainer_noIcon").addClass("ui-widget ui-widget-content") .find(".portlet-header") .addClass("ui-widget-header ui-corner-all") .prepend('') .end() .find(".portlet-content"); setIconMin( $(".portlet-header .ui-icon-minimize") ); setIconPrint( $(".portlet-header .ui-icon-print") ); setIconSave( $(".portlet-header .ui-icon-save") ); //$(".portletContainer").disableSelection(); }); function setIconMin(obj){ $(obj).click(function() { $(this).toggleClass("ui-icon-minimize").toggleClass("ui-icon-maximize"); $(this).parents(".portlet:first").find(".portlet-content").toggle(); }); } function setIconPrint(obj){ $(obj).click(portletPrint); } /* * added ajaxButtonLog("PORTLET_PRINT"); by BCT * */ function portletPrint(){ if (isLogin){ ajaxButtonLog("PORTLET_PRINT"); } getSavePrintComponent($(this), "PRINT"); } function setIconSave(obj){ $(obj).click(portletSave); } /* * added ajaxButtonLog("PORTLET_SAVE"); by BCT * */ function portletSave(){ if (isLogin){ ajaxButtonLog("PORTLET_SAVE"); } getSavePrintComponent($(this),"SAVE"); } function getSavePrintComponent(obj,actionType){ var portlet = obj.parents(".portlet:first"); if ( portlet.length == 0 ){ portlet = $("body").find(".portlet:first"); } var title = encodeURI(portlet.find(".portlet-header").text()); var content = portlet.find(".portlet-content").formhtml(); content = content.replace(/\+/g, "%2B"); content = encodeURI(content); cssNames = encodeURI(additionCssList); var toDay = new Date(); win=window.open("about:blank","win"+toDay.getTime(),"toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,height=500,width=1010"); // assign popup width as that of #wrapper in common.css.jsp createSavePrintFormAndSubmit(win.name, actionType, title, content, cssNames); //submitAndPopup(win,actionType, title, content, cssNames); } function createSavePrintFormAndSubmit(winName, actionType, title, content, cssNames){ var formObj = document.createElement('form'); $(formObj).attr("id", "savePrintForm"); $(formObj).attr("target", winName); $(formObj).attr("method", "post"); if (!isLogin){ $(formObj).attr("action","/bct/common/savePrintAjax.htm"); }else{ $(formObj).attr("action","/bct/common/savePrintUserAjax.htm"); } $(formObj).append(''); $(formObj).append(''); $(formObj).append(''); $(formObj).append(''); $(formObj).append(''); document.body.appendChild(formObj); $(formObj).submit(); formObj.parentNode.removeChild(formObj); } /* function submitAndPopup(win, actionType, title, content, cssNames){ win.document.write('
'); win.document.write("Please wait..."); win.document.write(''); win.document.write('