/****************************************************************** * IBM Confidential * * * * OCO Source Materials * * * * 5724-E76, 5655-R17, 5655-M44 * * * * Copyright IBM Corp. 2012 * * * * The source code for this program is not published or otherwise * * divested of its trade secrets, irrespective of what has been * * deposited with the U.S. Copyright Office. * ******************************************************************/ (function(){ /** * PznUIUtils */ // Create PznUIUtils object if it doesn't already exist var PznUIUtils = i$.fromPath("PznUIUtils",true); PznUIUtils.MSG_TYPE_ERROR="lotusError"; PznUIUtils.MSG_TYPE_WARNING="lotusWarning"; PznUIUtils.MSG_TYPE_INFO="lotusInfo"; PznUIUtils.MSG_TYPE_SUCCESS="lotusSuccess"; PznUIUtils.PATH_AUTO_CLOSE_REFRESH="wpModules.ct.pageRefresh"; PznUIUtils.EL_DIALOG_POPUP_MENU = i$.byId("pznDialogPopupMenu"); PznUIUtils.EL_DIALOG_POPUP_MENU_CONTAINER = i$.byId("pznDialogPopupMenuItemsContainer"); PznUIUtils._pznContentSettings = null; PznUIUtils._pznDialogNavigator = null; PznUIUtils._popupHelpDialog = null; PznUIUtils._portletPageId = null; PznUIUtils._portletWindowId = null; PznUIUtils._componentId = null; PznUIUtils._altPresentationTemplatePath = null; PznUIUtils.contextPath = ""; PznUIUtils.pocUrlBase = ""; PznUIUtils.ContentSelectorPOCURL = ""; PznUIUtils.ComponentSelectorPOCURL = ""; PznUIUtils.PresentationTemplateSelectorPOCURL = ""; PznUIUtils.ContentEditorPOCURL = ""; PznUIUtils.PresentationTemplateEditorPOCURL = ""; PznUIUtils.ComponentEditorPOCURL = ""; PznUIUtils._appearanceReplaceOptions = null; PznUIUtils._contentOptions = null; PznUIUtils._contentEdited = false; PznUIUtils._currentMessageId = null; PznUIUtils._isRTL = false; PznUIUtils._autoClosed = true; PznUIUtils._segFilterOptions = [{text:"All Segments"}]; PznUIUtils.escapeHTML = function(text){ if(!text){ return text; } return text.replace(/&/g, '&') .replace(/>/g, '>') .replace(//g, '>') .replace(/"); out.push(""); out.push("
"); out.push(args.mainLink); out.push(" | "); if(cl && cl.length > 0){ var l = args.controlLinks.length; for(var i = 0; i < l; i++){ out.push("");
out.push(" ");
out.push(args.controlLinks[i]);
out.push(" ");
out.push(" | ");
}
} else {
//need to put an empty cell in to get the first cell to take up the width
out.push(""); } out.push(" |
$segmentLocationLabelXML $segmentLocationXml
var desc = segGrp.description !=undefined && segGrp.description.length>0 ? segGrp.description : SegmentSelector.escapeHTML(PznUIUtils.nls['no_description']); i$.createDom("p",{"class":"pznSgmtInfoPadding", "tabindex": "0", "aria-label": desc, "role": "treeitem"}, segGrpInfoContainerDiv).innerHTML+= desc; if(segGrp.titlepath){ var titlePath=""; i$.each(segGrp.titlepath, function(pathItem){ titlePath += pathItem +"/" ; }); var locationLabel = SegmentSelector.escapeHTML(PznUIUtils.nls['location_label']); i$.createDom("p",{"class":"pznSgmtInfoPadding", "tabindex":"0", "aria-label": locationLabel + titlePath, "role": "treeitem"}, segGrpInfoContainerDiv).innerHTML+= " "+locationLabel+" "+titlePath; } }; SegmentSelector.createSgmtGrpTitleBar =function(containerDivId, segGrp){ var titlePaneId = SegmentSelector.getHtmlIdFromSgmtGrpId(segGrp.uuid) + "_TitlePane"; var sgmtGrpTitlePath = segGrp.titlepath; var sgmtGrpTitle = segGrp.title?segGrp.title : segGrp.name; var sgmtGrpContainer = i$.byId(containerDivId); var titlePane = i$.createDom("div",{ "id":titlePaneId, "tabindex" : 0, "aria-level" : 1, "role" : "treeitem", "aria-expanded" : false, "onclick" : "SegmentSelector.toggleSegmentContainer(event,'"+SegmentSelector.getHtmlIdFromSgmtGrpId(segGrp.uuid)+"')", "class" : "pznDialogSgmtGrpTitlePane pznDialogDisplayNone" },sgmtGrpContainer); i$.createDom("img",{ "id":titlePaneId+"Twistee", "class" : "pznDialogSegmentContainerHide" , "alt" : "", "src" : PznUIUtils.getContextPath()+"/images/blank.gif", },titlePane); var titleText = i$.createDom("span",{ "id" : titlePaneId+"Text", "class" : "pznSgmtTruncate" , },titlePane); var titleSeperator = i$.createDom("span",{ "id" : titlePaneId+"seperator", "class" : "pznDialogVerticalAlignMiddle", },titlePane); var titleSegCount = i$.createDom("span",{ "id" : titlePaneId+"SegCount", "class" : "pznDialogVerticalAlignMiddle", },titlePane); titleText.title = titleText.innerHTML += sgmtGrpTitle ; titleSeperator.title = titleSeperator.innerHTML = " - "; var noOfSgmts = segGrp.profiles && segGrp.profiles.length; titleSegCount.title = titleSegCount.innerHTML = noOfSgmts; titlePane.setAttribute("aria-label", sgmtGrpTitle); if(segGrp.draft){ var draftItem = i$.createDom("span",{"class" : "pznDialogSegmentSelectorSegmentDraft"},titlePane); draftItem.innerHTML += SegmentSelector.escapeHTML(PznUIUtils.nls['seg_draft']); } return titlePane; }; SegmentSelector.getRulesFromAllLibraries = function( managedRules){ var s = new Array(); i$.forEach(managedRules,function(rulesPerLib){ for(var i=0; i< rulesPerLib.rules.length; i++){ s.push(rulesPerLib.rules[i]); } }) return s; }; SegmentSelector.processSegments = function(containerDivId,pathPrefix, segmentGroup, segObjArray, areManagedSegments){ var segments = null; var segsLength =0; //var segObjArray = new Array(); var segObj = {}; segments = segmentGroup.profiles; var i = 0; segsLength = segments.length; for (; i < segsLength; i++) { var sgmtGrpName = segmentGroup.name; if(!sgmtGrpName){ sgmtGrpName = segmentGroup.title; } segObj = { "rulename": ""+sgmtGrpName, "description": ""+segmentGroup.description, "name": ""+segments[i].name, "ruleId" : ""+segmentGroup.uuid, "id" : ""+segmentGroup.uuid+"."+segments[i].name, "draft" : segmentGroup.draft }; if(areManagedSegments ){ segObj.titlepath = [].concat.apply(new Array(pathPrefix),segmentGroup.titlepath); } if(segmentGroup.draft){ segObj.draft = segmentGroup.draft; } if(areManagedSegments){ SegmentSelector.managedSegments.push(segObj); }else{ SegmentSelector.segments.push(segObj); } segObjArray.push(segObj); } }; SegmentSelector.fixDuplicates = function(segmentsByRule) { var segObjArray = []; segObjArray = segObjArray.concat.apply(segObjArray, segmentsByRule); var segArrLength=segObjArray.length; var i=0; var rulename = ""; var index = -1; for(;i