Create the ul element that contains a batch of choices.
177109
function createChoiceUl () {
  const lis = story.currentChoices
    .map(choice => {
      const li = document.createElement('li');
      li.innerHTML = choice.text;
      createChoiceListener(li, choice.index);
      return li;
    });
  const ul = document.createElement('ul');
  Array.from(lis).forEach(li => ul.appendChild(li));
  ul.className = "choices current";
  return ul;
}
1317735
function buildConcepts(item, fullDimensions) {
  function isInitiallyActive(dimensionId, value, index) {
    if (!defined(item.selectedInitially)) {
      return index === 0;
    }
    var dimensionSelectedInitially = item.selectedInitially[dimensionId];
    if (!defined(dimensionSelectedInitially)) {
      return index === 0;
    }
    return dimensionSelectedInitially.indexOf(value.id) >= 0;
  }

  var conceptDimensions = getShownDimensions(
    item,
    fullDimensions,
    fullDimensions
  );
  fixSelectedInitially(item, conceptDimensions); // Note side-effect.
  var concepts = conceptDimensions.map(function(dimension, i) {
    var allowMultiple =
      item.allSingleValuedDimensionIds.indexOf(dimension.id) === -1;
    var concept = new DisplayVariablesConcept(dimension.name, {
      isOpen: false,
      allowMultiple: allowMultiple,
      requireSomeActive: true,
      exclusiveChildIds: getTotalValueIdsForDimensionId(item, dimension.id)
    });
    concept.id = dimension.id;
    concept.items = dimension.values.map(function(value, index) {
      return new VariableConcept(renameValue(item, value.name), {
        parent: concept,
        id: value.id,
        active: isInitiallyActive(concept.id, value, index)
      });
    });
    return concept;
  });
  if (concepts.length > 0) {
    return [new SummaryConcept(undefined, { items: concepts, isOpen: false })];
  }
  return [];
}
540700
function createList (isCollapsed) {
    var listElement = (options.orderedList) ? 'ol' : 'ul'
    var list = document.createElement(listElement)
    var classes = options.listClass +
      SPACE_CHAR + options.extraListClasses
    if (isCollapsed) {
      classes += SPACE_CHAR + options.collapsibleClass
      classes += SPACE_CHAR + options.isCollapsedClass
    }
    list.setAttribute('class', classes)
    return list
  }
931980
def filtered_elements(self, model):
        """"""
        if isinstance(model, self.element_type):
            yield model
        yield from (e for e in model.eAllContents() if isinstance(e, self.element_type))
597385
def as_ul(self, show_leaf=True, current_linkable=False, class_current="active_link"):
        
        return self.__do_menu("as_ul", show_leaf, current_linkable, class_current)
306581
public function _createElements() {

        $this->_generateId();

        $this->setElements([
            $this->createFormElement('text', 'filetypes', $this->getLabel(), [
                'id' => $this->getAttribute('id'),
            ]),

            $this->createFormElement('static', 'browser', null,
                '<span data-filetypesbrowser="'.$this->getAttribute('id').'"></span>'),

            $this->createFormElement('static', 'descriptions', null,
                '<div data-filetypesdescriptions="'.$this->getAttribute('id').'"></div>')
        ]);
    }
739470
function makeElementSelectable(element) {
      if (typeof element.onselectstart !== 'undefined') {
        element.onselectstart = null;
      }
      if (selectProp) {
        element.style[selectProp] = '';
      }
      else if (typeof element.unselectable == 'string') {
        element.unselectable = '';
      }
      return element;
    }
1030108
function renderChoices(choices, pointer) {
  var output = '';
  var separatorOffset = 0;

  choices.forEach(function(choice, i) {
    if (choice.type === 'separator') {
      separatorOffset++;
      output += ' ' + choice + '\n';
      return;
    }

    if (choice.disabled) {
      separatorOffset++;
      output += ' - ' + choice.name;
      output += ' (' + (typeof choice.disabled === 'string' ? choice.disabled : 'Disabled') + ')';
    } else {
      var isSelected = (i - separatorOffset === pointer);
      output += isSelected ? utils.chalk.cyan(utils.figures.pointer) : ' ';
      output += getCheckbox(choice.checked) + ' ' + choice.name;
    }

    output += '\n';
  });

  return output.replace(/\n$/, '');
}
1326827
def as_select(self, _items=None, **kwargs):
        
        attrs = self.extra.copy()
        attrs.update(kwargs)
        attrs['name'] = self.name
        if not self.optional:
            attrs['required'] = True
        html = [u'<select %s>' % get_html_attrs(attrs)]
        values = [self.to_string(**attrs)] or []
        items = _items or self.items

        for item in items:
            if isinstance(item, list):
                html.extend(self._render_optgroup(item, values))
            else:
                html.append(self._render_option(item, values))
        html.append(u'</select>')

        return Markup('\n'.join(html))
1302560
def create_combobox(self, text, choices, option, default=NoDefault,
                        tip=None, restart=False):
        """"""
        label = QLabel(text)
        combobox = QComboBox()
        if tip is not None:
            combobox.setToolTip(tip)
        for name, key in choices:
            if not (name is None and key is None):
                combobox.addItem(name, to_qvariant(key))
        # Insert separators
        count = 0
        for index, item in enumerate(choices):
            name, key = item
            if name is None and key is None:
                combobox.insertSeparator(index + count)
                count += 1
        self.comboboxes[combobox] = (option, default)
        layout = QHBoxLayout()
        layout.addWidget(label)
        layout.addWidget(combobox)
        layout.addStretch(1)
        layout.setContentsMargins(0, 0, 0, 0)
        widget = QWidget(self)
        widget.label = label
        widget.combobox = combobox
        widget.setLayout(layout)
        combobox.restart_required = restart
        combobox.label_text = text
        return widget
195577
function () {
            if (!this.options) {
                this.options = [];
                if (this._domElt.options) {
                    for (var i = 0, l = this._domElt.options.length; i < l; i++) {
                        var elementToPush = {
                            value : this._domElt.options[i].value,
                            label : this._domElt.options[i].label
                        };
                        this.options.push(elementToPush);
                    }
                }
            }
        }
1275226
def __createElementNS(self, root, uri, name, value):
        '''
        
        '''
        tag = root.ownerDocument.createElementNS(to_unicode(uri),
                                                 to_unicode(name))
        tag.appendChild(root.ownerDocument
                        .createCDATASection(to_unicode(value)))
        return root.appendChild(tag)
1089016
function buildOptions(i) {
        var index = (i + 1);
        var isCurrent = i === current;

        // Options for each text, arrow and image, using the base options and the index
        var text = extend({}, optionsText, {paths: '#jelly-text-' + index + ' path'});
        var arrow = extend({}, optionsArrow, {paths: '#jelly-arrow-' + index});
        var image = extend({}, isCurrent ? optionsImage : optionsCircle, {image: 'img/image-' + index + '.jpg'});

        // If not the current item, set circle in the position defined, hide text, and hide arrow
        if (!isCurrent) {
            extend(image, circlePositions[i]);
            extend(text, {hidden: true});
            extend(arrow, {hidden: true});
        }

        // Push all of these to the options array
        options.push(text);
        options.push(arrow);
        options.push(image);
    }
1369216
def build(c: Union[Text, 'Choice', Dict[Text, Any]]) -> 'Choice':
        """"""

        if isinstance(c, Choice):
            return c
        elif isinstance(c, str):
            return Choice(c, c)
        else:
            return Choice(c.get('name'),
                          c.get('value'),
                          c.get('disabled', None),
                          c.get('checked'),
                          c.get('key'))
85892
function createElement (
  context,
  tag,
  data,
  children,
  normalizationType,
  alwaysNormalize
) {
  if (Array.isArray(data) || isPrimitive(data)) {
    normalizationType = children;
    children = data;
    data = undefined;
  }
  if (alwaysNormalize) { normalizationType = ALWAYS_NORMALIZE; }
  return _createElement(context, tag, data, children, normalizationType)
}
360203
function (config) {
			
			var position, choice;
			
			position = this.getChoicePosition(config);
			
			if (position !== -1) {
				
				choice = this.choicesList[position];
				
				if (!choice.visible) {
					
					choice.visible = true;
					this.appendChoiceNode(choice.node, position);
				
				}
				
			}
			
		}
891072
function( element )
				{
					var children = element.children, child,
							listItem,   // The current processing cke:li element.
							listItemAttrs,
							listItemIndent, // Indent level of current list item.
							lastIndent,
							lastListItem, // The previous one just been added to the list.
							list, // Current staging list and it's parent list if any.
							openedLists = [],
							previousListStyleType,
							previousListType;

					// Properties of the list item are to be resolved from the list bullet.
					var bullet,
						listType,
						listStyleType,
						itemNumeric;

					for ( var i = 0; i < children.length; i++ )
					{
						child = children[ i ];

						if ( 'cke:li' == child.name )
						{
							child.name = 'li';
							listItem = child;
							listItemAttrs = listItem.attributes;
							bullet = listItemAttrs[ 'cke:listsymbol' ];
							bullet = bullet && bullet.match( /^(?:[(]?)([^\s]+?)([.)]?)$/ );
							listType = listStyleType = itemNumeric = null;

							if ( listItemAttrs[ 'cke:ignored' ] )
							{
								children.splice( i--, 1 );
								continue;
							}


							// This's from a new list root.
							listItemAttrs[ 'cke:reset' ] && ( list = lastIndent = lastListItem = null );

							// List item indent level might come from a real list indentation or
							// been resolved from a pseudo list item's margin value, even get
							// no indentation at all.
							listItemIndent = Number( listItemAttrs[ 'cke:indent' ] );

							// We're moving out of the current list, cleaning up.
							if ( listItemIndent != lastIndent )
								previousListType = previousListStyleType = null;

							// List type and item style are already resolved.
							if ( !bullet )
							{
								listType = listItemAttrs[ 'cke:listtype' ] || 'ol';
								listStyleType = listItemAttrs[ 'cke:list-style-type' ];
							}
							else
							{
								// Probably share the same list style type with previous list item,
								// give it priority to avoid ambiguous between C(Alpha) and C.(Roman).
								if ( previousListType && listMarkerPatterns[ previousListType ] [ previousListStyleType ].test( bullet[ 1 ] ) )
								{
									listType = previousListType;
									listStyleType = previousListStyleType;
								}
								else
								{
									for ( var type in listMarkerPatterns )
									{
										for ( var style in listMarkerPatterns[ type ] )
										{
											if ( listMarkerPatterns[ type ][ style ].test( bullet[ 1 ] ) )
											{
												// Small numbering has higher priority, when dealing with ambiguous
												// between C(Alpha) and C.(Roman).
												if ( type == 'ol' && ( /alpha|roman/ ).test( style ) )
												{
													var num = /roman/.test( style ) ? fromRoman( bullet[ 1 ] ) : fromAlphabet( bullet[ 1 ] );
													if ( !itemNumeric || num < itemNumeric )
													{
														itemNumeric = num;
														listType = type;
														listStyleType = style;
													}
												}
												else
												{
													listType = type;
													listStyleType = style;
													break;
												}
											}
										}
									}
								}

								// Simply use decimal/disc for the rest forms of unrepresentable
								// numerals, e.g. Chinese..., but as long as there a second part
								// included, it has a bigger chance of being a order list ;)
								!listType && ( listType = bullet[ 2 ] ? 'ol' : 'ul' );
							}

							previousListType = listType;
							previousListStyleType = listStyleType || ( listType == 'ol' ? 'decimal' : 'disc' );
							if ( listStyleType && listStyleType != ( listType == 'ol' ? 'decimal' : 'disc' ) )
								listItem.addStyle( 'list-style-type', listStyleType );

							// Figure out start numbering.
							if ( listType == 'ol' && bullet )
							{
								switch ( listStyleType )
								{
									case 'decimal' :
										itemNumeric = Number( bullet[ 1 ] );
										break;
									case 'lower-roman':
									case 'upper-roman':
										itemNumeric = fromRoman( bullet[ 1 ] );
										break;
									case 'lower-alpha':
									case 'upper-alpha':
										itemNumeric = fromAlphabet( bullet[ 1 ] );
										break;
								}

								// Always create the numbering, swipe out unnecessary ones later.
								listItem.attributes.value = itemNumeric;
							}

							// Start the list construction.
							if ( !list )
							{
								openedLists.push( list = new CKEDITOR.htmlParser.element( listType ) );
								list.add( listItem );
								children[ i ] = list;
							}
							else
							{
								if ( listItemIndent > lastIndent )
								{
									openedLists.push( list = new CKEDITOR.htmlParser.element( listType ) );
									list.add( listItem );
									lastListItem.add( list );
								}
								else if ( listItemIndent < lastIndent )
								{
									// There might be a negative gap between two list levels. (#4944)
									var diff = lastIndent - listItemIndent,
											parent;
									while ( diff-- && ( parent = list.parent ) )
										list = parent.parent;

									list.add( listItem );
								}
								else
									list.add( listItem );

								children.splice( i--, 1 );
							}

							lastListItem = listItem;
							lastIndent = listItemIndent;
						}
						else if ( list )
							list = lastIndent = lastListItem = null;
					}

					for ( i = 0; i < openedLists.length; i++ )
						postProcessList( openedLists[ i ] );

					list = lastIndent = lastListItem = previousListId = previousListItemMargin = listBaseIndent = null;
				}