wire/modules/Process/ProcessPageList/ProcessPageList.js
/**
			 * Given a single page, generates the list item for it
			 *
			 * @param map child
			 *
			 */
Given a single page, generates the list item for it
@param map child
Given a single page generates the list item for it @param map child
function listChild(child) {
				var $li = $("<div></div>").data('pageId', child.id).addClass('PageListItem').addClass('PageListTemplate_' + child.template); 
				var $a = $("<a></a>")
					.attr('href', '#')
					.attr('title', child.path)
					.html(child.label)
					.addClass('PageListPage label'); 
				$li.addClass(child.numChildren > 0 ? 'PageListHasChildren' : 'PageListNoChildren').addClass('PageListID' + child.id); 
				if(child.status == 0) $li.addClass('PageListStatusOff disabled');
				if(child.status & 2048) $li.addClass('PageListStatusUnpublished secondary'); 
				if(child.status & 1024) $li.addClass('PageListStatusHidden secondary'); 
				if(child.status & 512) $li.addClass('PageListStatusTemp secondary'); 
				if(child.status & 16) $li.addClass('PageListStatusSystem'); 
				if(child.status & 8) $li.addClass('PageListStatusSystem'); 
				if(child.status & 4) $li.addClass('PageListStatusLocked'); 
				if(child.addClass && child.addClass.length) $li.addClass(child.addClass); 
				if(child.type && child.type.length > 0) if(child.type == 'System') $li.addClass('PageListStatusSystem'); 
				$(options.openPageIDs).each(function(n, id) {
					id = parseInt(id);
					if(child.id == id) $li.addClass('PageListTriggerOpen'); 
				}); 
				$li.append($a); 
				setNumChildren($li, child.numChildren, child.numTotal, true);
				if(child.note && child.note.length) $li.append($("<span>" + child.note + "</span>").addClass('PageListNote detail')); 	
				var $actions = $("<ul></ul>").addClass('PageListActions actions'); 
				var links = options.rootPageID == child.id ? [] : [{ name: options.selectSelectLabel, url: options.selectSelectHref }]; 
				if(options.mode == 'actions') {
					links = child.actions; 
				} else if(options.selectAllowUnselect) {
					if(child.id == $container.val()) links = [{ name: options.selectUnselectLabel, url: options.selectUnselectHref }]; 
				}
				var $lastAction = null;
				var $extrasLink = null; 
				var extras = {}; 
				var hasExtrasLink = false; 
				if(options.useNarrowActions) {
					for(var n = 0; n < links.length; n++) {
						if(typeof links[n].extras != "undefined") hasExtrasLink = true;
					}
				}
				$(links).each(function(n, action) {
					var actionName;
					if(action.name == options.selectSelectLabel) {
						actionName = 'Select';
					} else if(action.name == options.selectUnselectLabel) {
						actionName = 'Select';
					} else {
						actionName = action.cn; 
						if(options.useNarrowActions && hasExtrasLink
							&& (actionName != 'Edit' && actionName != 'View' && actionName != 'Extras')) {
							extras[actionName] = action;
							return;
						}
					}
					var $a = $("<a></a>").html(action.name).attr('href', action.url);
					if(!isModal) {
						if(action.cn == 'Edit') {
							$a.addClass('pw-modal pw-modal-large pw-modal-longclick');
							$a.attr('data-buttons', '#ProcessPageEdit > .Inputfields > .InputfieldSubmit .ui-button');
						} else if(action.cn == 'View') {
							$a.addClass('pw-modal pw-modal-large pw-modal-longclick');
						}
					}
					if(typeof action.extras != "undefined") {
						for(var key in action.extras) {
							extras[key] = action.extras[key];
						}
						$extrasLink = $a;
					}
					var $action = $("<li></li>").addClass('PageListAction' + actionName).append($a);
					if(actionName == 'Extras') $lastAction = $action; 
						else $actions.append($action);
				});
				if($extrasLink) $extrasLink.data('extras', extras);
				if($lastAction) {
					$actions.append($lastAction);
					$lastAction.addClass('ui-priority-secondary');
				}
				$li.append($actions); 
				return $li;
			}
function listChild ( child ) { var $li = $ ( "<div></div>" ) . data ( 'pageId' , child . id ) . addClass ( 'PageListItem' ) . addClass ( 'PageListTemplate_' + child . template ) ; var $a = $ ( "<a></a>" ) . attr ( 'href' , '#' ) . attr ( 'title' , child . path ) . html ( child . label ) . addClass ( 'PageListPage label' ) ; $li . addClass ( child . numChildren > 0 ? 'PageListHasChildren' : 'PageListNoChildren' ) . addClass ( 'PageListID' + child . id ) ; if ( child . status == 0 ) $li . addClass ( 'PageListStatusOff disabled' ) ; if ( child . status & 2048 ) $li . addClass ( 'PageListStatusUnpublished secondary' ) ; if ( child . status & 1024 ) $li . addClass ( 'PageListStatusHidden secondary' ) ; if ( child . status & 512 ) $li . addClass ( 'PageListStatusTemp secondary' ) ; if ( child . status & 16 ) $li . addClass ( 'PageListStatusSystem' ) ; if ( child . status & 8 ) $li . addClass ( 'PageListStatusSystem' ) ; if ( child . status & 4 ) $li . addClass ( 'PageListStatusLocked' ) ; if ( child . addClass && child . addClass . length ) $li . addClass ( child . addClass ) ; if ( child . type && child . type . length > 0 ) if ( child . type == 'System' ) $li . addClass ( 'PageListStatusSystem' ) ; $ ( options . openPageIDs ) . each ( function ( n , id ) { id = parseInt ( id ) ; if ( child . id == id ) $li . addClass ( 'PageListTriggerOpen' ) ; } ) ; $li . append ( $a ) ; setNumChildren ( $li , child . numChildren , child . numTotal , true ) ; if ( child . note && child . note . length ) $li . append ( $ ( "<span>" + child . note + "</span>" ) . addClass ( 'PageListNote detail' ) ) ; var $actions = $ ( "<ul></ul>" ) . addClass ( 'PageListActions actions' ) ; var links = options . rootPageID == child . id ? [ ] : [ { name : options . selectSelectLabel , url : options . selectSelectHref } ] ; if ( options . mode == 'actions' ) { links = child . actions ; } else if ( options . selectAllowUnselect ) { if ( child . id == $container . val ( ) ) links = [ { name : options . selectUnselectLabel , url : options . selectUnselectHref } ] ; } var $lastAction = null ; var $extrasLink = null ; var extras = { } ; var hasExtrasLink = false ; if ( options . useNarrowActions ) { for ( var n = 0 ; n < links . length ; n ++ ) { if ( typeof links [ n ] . extras != "undefined" ) hasExtrasLink = true ; } } $ ( links ) . each ( function ( n , action ) { var actionName ; if ( action . name == options . selectSelectLabel ) { actionName = 'Select' ; } else if ( action . name == options . selectUnselectLabel ) { actionName = 'Select' ; } else { actionName = action . cn ; if ( options . useNarrowActions && hasExtrasLink && ( actionName != 'Edit' && actionName != 'View' && actionName != 'Extras' ) ) { extras [ actionName ] = action ; return ; } } var $a = $ ( "<a></a>" ) . html ( action . name ) . attr ( 'href' , action . url ) ; if ( ! isModal ) { if ( action . cn == 'Edit' ) { $a . addClass ( 'pw-modal pw-modal-large pw-modal-longclick' ) ; $a . attr ( 'data-buttons' , '#ProcessPageEdit > .Inputfields > .InputfieldSubmit .ui-button' ) ; } else if ( action . cn == 'View' ) { $a . addClass ( 'pw-modal pw-modal-large pw-modal-longclick' ) ; } } if ( typeof action . extras != "undefined" ) { for ( var key in action . extras ) { extras [ key ] = action . extras [ key ] ; } $extrasLink = $a ; } var $action = $ ( "<li></li>" ) . addClass ( 'PageListAction' + actionName ) . append ( $a ) ; if ( actionName == 'Extras' ) $lastAction = $action ; else $actions . append ( $action ) ; } ) ; if ( $extrasLink ) $extrasLink . data ( 'extras' , extras ) ; if ( $lastAction ) { $actions . append ( $lastAction ) ; $lastAction . addClass ( 'ui-priority-secondary' ) ; } $li . append ( $actions ) ; return $li ; }
Given a single page, generates the list item for it
 @param map child
Given a single page generates the list item for it @param map child
// typically combined with PageListStatusUnpublished // link that toggles extra actions // extra actions // only referenced if options.useNarrowActions // cn = className // move non-edit/view actions to extras when in narrow mode