Renders a spoiler-button-activated hidden part.
420543
public function renderHiddenSpoiler()
    {
        $options = ArrayHelper::merge([
            'id' => $this->button['id'] . '-body',
            'tag' => 'span',
            'value' => implode($this->hiddenDelimiter ?? $this->delimiter, $this->getSpoiledItems()),
            'class' => 'collapse',
            'data-spoiler-body' => true,
        ], $this->hidden);

        $this->parts['{hidden}'] = Html::tag(ArrayHelper::remove($options, 'tag'), ArrayHelper::remove($options, 'value'), $options);
    }
82326
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		XmlStringBuilder xml = renderContext.getWriter();
		WButton button = (WButton) component;
		String text = button.getText();
		String imageUrl = button.getImageUrl();
		String accessibleText = button.getAccessibleText();
		String toolTip = button.getToolTip();

		if (Util.empty(text) && imageUrl == null && Util.empty(accessibleText) && Util.empty(toolTip)) {
			throw new SystemException("WButton text or imageUrl must be specified");
		}

		xml.appendTagOpen(getTagName(button));

		String buttonId = button.getId();
		ImagePosition pos = button.getImagePosition();
		if (Util.empty(text) && Util.empty(toolTip) && Util.empty(accessibleText)) {
			// If the button has an imageUrl but no text equivalent get the text equivalent off of the image
			WImage imgHolder = button.getImageHolder();
			if (null != imgHolder) {
				toolTip = imgHolder.getAlternativeText();
			}
		}

		xml.appendAttribute("id", buttonId);
		xml.appendAttribute("name", buttonId);
		xml.appendAttribute("value", "x");
		xml.appendAttribute("type", getButtonType(button));
		xml.appendAttribute("class", geHtmlClassName(button));
		xml.appendOptionalAttribute("disabled", button.isDisabled(), "disabled");
		xml.appendOptionalAttribute("hidden", button.isHidden(), "hidden");
		xml.appendOptionalAttribute("title", toolTip);
		xml.appendOptionalAttribute("aria-label", accessibleText);
		xml.appendOptionalAttribute("aria-haspopup", button.isPopupTrigger(), "true");
		xml.appendOptionalAttribute("accesskey", Util.upperCase(button.getAccessKeyAsString()));
		xml.appendOptionalAttribute("data-wc-btnmsg", button.getMessage());

		if (button.isCancel()) {
			xml.appendAttribute("formnovalidate", "formnovalidate");
		} else {
			Action action = button.getAction();
			if (action instanceof ValidatingAction) {
				WComponent validationTarget = ((ValidatingAction) action).getComponentToValidate();
				xml.appendAttribute("data-wc-validate", validationTarget.getId());
			}
		}

		xml.appendClose();

		if (imageUrl != null) {
			xml.appendTagOpen("span");
			String imageHolderClass =  "wc_nti";
			if (pos != null) {
				StringBuffer imageHolderClassBuffer = new StringBuffer("wc_btn_img wc_btn_img");
				switch (pos) {
					case NORTH:
						imageHolderClassBuffer.append("n");
						break;
					case EAST:
						imageHolderClassBuffer.append("e");
						break;
					case SOUTH:
						imageHolderClassBuffer.append("s");
						break;
					case WEST:
						imageHolderClassBuffer.append("w");
						break;
					default:
						throw new SystemException("Unknown image position: " + pos);
				}
				imageHolderClass = imageHolderClassBuffer.toString();
			}
			xml.appendAttribute("class", imageHolderClass);
			xml.appendClose();

			if (pos != null && text != null) {
				xml.appendTag("span");
				xml.appendEscaped(text);
				xml.appendEndTag("span");
			}

			xml.appendTagOpen("img");
			xml.appendUrlAttribute("src", imageUrl);
			String alternateText = pos == null ? text : "";
			xml.appendAttribute("alt", alternateText);
			xml.appendEnd();
			xml.appendEndTag("span");
		} else if (text != null) {
			xml.appendEscaped(text);
		}

		xml.appendEndTag(getTagName(button));

		if (button.isAjax()) {
			paintAjax(button, xml);
		}
	}
327440
def render(self, name, value, attrs=None, renderer=None):
        
        html = ''
        html += '%s' % value
        html += '<input type="hidden" name="%s" value="%s">' % (escape(name), escape(value))
        return mark_safe(html)
1246231
protected function renderButton()
    {
        Html::addCssClass($this->buttonOptions, ['widget' => 'btn']);
        $label = $this->label;
        if ($this->encodeLabel) {
            $label = Html::encode($label);
        }

        if ($this->split) {
            $buttonOptions = $this->buttonOptions;
            $this->buttonOptions['data-toggle'] = 'dropdown';
            $this->buttonOptions['aria-haspopup'] = 'true';
            $this->buttonOptions['aria-expanded'] = 'false';
            Html::addCssClass($this->buttonOptions, ['toggle' => 'dropdown-toggle dropdown-toggle-split']);
            unset($buttonOptions['id']);
            $splitButton = Button::widget([
                'label' => '<span class="sr-only">Toggle Dropdown</span>',
                'encodeLabel' => false,
                'options' => $this->buttonOptions,
                'view' => $this->getView(),
            ]);
        } else {
            $buttonOptions = $this->buttonOptions;
            Html::addCssClass($buttonOptions, ['toggle' => 'dropdown-toggle']);
            $buttonOptions['data-toggle'] = 'dropdown';
            $buttonOptions['aria-haspopup'] = 'true';
            $buttonOptions['aria-expanded'] = 'false';
            $splitButton = '';
        }

        if (isset($buttonOptions['href'])) {
            if (is_array($buttonOptions['href'])) {
                $buttonOptions['href'] = Url::to($buttonOptions['href']);
            }
        } else {
            if ($this->tagName === 'a') {
                $buttonOptions['href'] = '#';
                $buttonOptions['role'] = 'button';
            }
        }

        return Button::widget([
                'tagName' => $this->tagName,
                'label' => $label,
                'options' => $buttonOptions,
                'encodeLabel' => false,
                'view' => $this->getView(),
            ]) . "\n" . $splitButton;
    }
787047
function(yasqe) {
  yasqe.cursor = $(".CodeMirror-cursor");
  if (yasqe.buttons && yasqe.buttons.is(":visible") && yasqe.cursor.length > 0) {
    if (utils.elementsOverlap(yasqe.cursor, yasqe.buttons)) {
      yasqe.buttons.find("svg").attr("opacity", "0.2");
    } else {
      yasqe.buttons.find("svg").attr("opacity", "1.0");
    }
  }
}
1255979
def before_render(self):
        
        # Render the Add button if the user has the AddClient permission
        if check_permission(AddClient, self.context):
            self.context_actions[_("Add")] = {
                "url": "createObject?type_name=Client",
                "icon": "++resource++bika.lims.images/add.png"
            }

        # Display a checkbox next to each client in the list if the user has
        # rights for ModifyPortalContent
        self.show_select_column = check_permission(ModifyPortalContent,
                                                   self.context)
430492
protected void toggleElementVisibility() {

        if (CmsDomUtil.hasClass(HIDE_ELEMENTS_CLASS, getGroupContainerWidget().getElement())) {
            getGroupContainerWidget().removeStyleName(HIDE_ELEMENTS_CLASS);
        } else {
            getGroupContainerWidget().addStyleName(HIDE_ELEMENTS_CLASS);
        }
        getGroupContainerWidget().refreshHighlighting();
    }
600007
function()
	{
		if(!this._modelBindersMap) this._initBinding();
		if(!this._collectionBinder)
		{
			this._explicitSubviewsStruct = null;

			if(this._template) this.element.innerHTML = this._template;

			if(this.render !== noop) this.render();
			this.renderSubviews();
		}
	}
229001
function() {
      webhookit.WiringEditor.superclass.renderButtons.call(this);

      var toolbar = YAHOO.util.Dom.get('toolbar');

		
      var editTemplateButton = new YAHOO.widget.Button({ label:"Edit template", id:"WiringEditor-templateButton", container: toolbar });
      editTemplateButton.on("click", webhookit.editTemplateButton, webhookit, true);

		// "Run" button
      var runButton = new YAHOO.widget.Button({ label:"Run", id:"WiringEditor-runButton", container: toolbar });
      runButton.on("click", webhookit.run, webhookit, true);

   }
866795
function ContentDialog_renderForInputPane() {
                    var rendered = this._rendered;
                    
                    if (!rendered.registeredForResize) {
                        _ElementUtilities._resizeNotifier.subscribe(this._dom.root, this._onUpdateInputPaneRenderingBound);
                        rendered.registeredForResize = true;
                    }
                    
                    if (this._shouldResizeForInputPane()) {
                        // Lay the dialog out using its normal rules but restrict it to the *visible document*
                        // rather than the *visual viewport*.
                        // Essentially, the dialog should be in the center of the part of the app that the user
                        // can see regardless of the state of the input pane.
                        
                        var top = _KeyboardInfo._KeyboardInfo._visibleDocTop + "px";
                        var bottom = _KeyboardInfo._KeyboardInfo._visibleDocBottomOffset + "px";
                        
                        if (rendered.top !== top) {
                            this._dom.root.style.top = top;
                            rendered.top = top;
                        }
                        
                        if (rendered.bottom !== bottom) {
                            this._dom.root.style.bottom = bottom;
                            rendered.bottom = bottom;
                        }
                        
                        if (!rendered.resizedForInputPane) {
                            // Put title into scroller so there's more screen real estate for the content
                            this._dom.scroller.insertBefore(this._dom.title, this._dom.content);
                            this._dom.root.style.height = "auto"; // Height will be determined by setting top & bottom
                            // Ensure activeElement is scrolled into view
                            var activeElement = _Global.document.activeElement;
                            if (activeElement && this._dom.scroller.contains(activeElement)) {
                                activeElement.scrollIntoView();
                            }
                            rendered.resizedForInputPane = true;
                        }
                    }
                }
852046
private function renderButton()
    {
        $this->params = Json::encode([
            'btnName' => $this->options['id'],
            'cookieName' => $this->cookie['name'],
            'cookieValue' => addslashes($this->getHashedCookieValue($this->cookie['value'])),
            'cookieOptions' => isset($this->cookie['options']) ? $this->cookie['options'] : null,
        ]);

        if($this->cookie($this->cookie['name'])) {
            Html::addCssClass($this->options, 'active');
        }

        echo Button::widget([
            'label' => $this->encodeLabel ? Html::encode($this->label) : $this->label,
            'encodeLabel' => $this->encodeLabel,
            'options' => ArrayHelper::merge(['data-toggle' => 'button'], $this->options),
        ]);
    }
35466
def cancelEdit( self ):
        
        
        if ( self._partsWidget.isVisible() ):
            return False
            
        self._completerTree.hide()
        self.completer().popup().hide()
        
        self.setText(self._originalText)
        return True
325660
def render(self):
        
        html = ''
        href = self.view if self.view is not None else self.href
        
        attrs = copy(self.attrs)
        if self.submodal:
            attrs['role'] = "button"
            attrs['data-toggle'] = "remote-submodal"
            if self.data_target:
                if isinstance(self.data_target, basestring):
                    attrs['data-target'] = self.data_target
                else:
                    attrs['data-target'] = "#submodal"
        elif self.modal:
            attrs['role'] = "button"
            #attrs['data-dismiss'] = "modal"
            attrs['data-toggle'] = "modal"
            #attrs['data-submodal'] = "true"
            #attrs['data-remoteinbody'] = "false"
            if self.data_target:
                if isinstance(self.data_target, basestring):
                    attrs['data-target'] = self.data_target
                else:
                    attrs['data-target'] = "#modal"
            
        if self.data_tip:
            attrs['data-tip'] = self.data_tip
        if self.target:
            attrs['target'] = self.target
        if 'css_class' not in attrs:
            attrs['css_class'] = ''
        attrs['css_class'] += ' btn ' + " ".join(self.css)
        attrs = ' '.join(['%s="%s"' % (key if key != 'css_class' else 'class', value) for key,value in attrs.iteritems()])
        
        if href:
            if self.view:
                href = reverse(self.view, args=self.view_args, kwargs=self.view_kwargs)
            if self.next:
                href += '?next=%s' % (self.next if self.next.startswith('/') else reverse(self.next))
            html += '<a href="%s" %s>' % (href, attrs)
        else:
            html += '<button type="button" %s>' % (attrs,)
        
        if hasattr(self.inner, 'render'):
            html += self.inner.render()
        else:
            html += self.inner
        
        if self.title:
            html += self.title
        
        if href:
            html += "</a>"
        else:
            html += "</button>"
        
        return html
566043
private function renderSpoiled()
    {
        if (count($this->getSpoiledItems()) === 0) {
            $this->parts['{button}'] = '';

            return;
        }

        $method = 'renderButton' . Inflector::id2camel($this->mode);
        call_user_func([$this, $method]);
    }
1256242
function reveal(el) {
      if (el.hasChildNodes()) {
        // dealing with a container try and find children
        var els = el.querySelectorAll('[data-src], [data-bkg]');
        var elsl = els.length;
        if (elsl === 0) {
          // node has children, but none have the attributes, so reveal
          // the node itself (use case: div with a background)
          doReveal(el);
        } else {
          for (var j = 0; j < elsl; j++) {
            doReveal(els[j]);
          }
        }
      } else {
        doReveal(el);
      }
    }
520089
function renderLayout( pageElement, areaHelper, layoutInfo ) {
         addClass( pageElement, layoutInfo.className );
         pageElement.innerHTML = layoutInfo.html;

         const areas = findWidgetAreas( pageElement );
         const deregisterFuncs = Object.keys( areas )
            .map( areaName => areaHelper.register( areaName, areas[ areaName ] ) );

         DEFAULT_AREAS.forEach( area => {
            if( areaHelper.exists( area.name ) ) {
               return;
            }

            const node = document.createElement( 'div' );
            if( area.hidden ) {
               node.style.display = 'none';
            }
            deregisterFuncs.push( areaHelper.register( area.name, node, area.name ) );
            pageElement.appendChild( node );
         } );

         return () => {
            deregisterFuncs.forEach( func => func() );
            removeClass( pageElement, layoutInfo.className );
         };
      }
1147617
function renderCustomTab({ key, label, active, handleClick }) {
  return (
    <Button
      key={key}
      title={label}
      type={active ? types.PRIMARY : types.SECONDARY}
      onClick={handleClick}
    />
  );
}