Callback for opening the modal form.
330016
public function openModalForm($visit_date, $member_campaign_id, $top_term_id) {
    $response = new AjaxResponse();
    $memberCampaignStorage = $this->entityTypeManager->getStorage('openy_campaign_member_campaign');

    // Get the modal form using the form builder.
    $activityTrackingModalForm = $this->formBuilder->getForm('Drupal\openy_campaign\Form\ActivityTrackingModalForm', $visit_date, $member_campaign_id, $top_term_id);

    $memberCampaign = $memberCampaignStorage->load($member_campaign_id);
    /** @var \Drupal\node\Entity\Node $campaign */
    $campaign = $memberCampaign->getCampaign();
    // If member logged in.
    if (MemberCampaign::isLoggedIn($campaign->id())) {
      // Add an AJAX command to open a modal dialog with the form as the content.
      $response->addCommand(new OpenModalDialogCommand(t('Track activity'), $activityTrackingModalForm, ['width' => '800']));
    }

    return $response;
  }
911177
public function init()
	{
		if (!isset($this->htmlOptions['id'])) {
			$this->htmlOptions['id'] = $this->getId();
		}

		if ($this->autoOpen === false && !isset($this->options['show'])) {
			$this->options['show'] = false;
		}

		$classes = array('modal');

		if ($this->fade === true) {
			$classes[] = 'fade';
		}

		if (!empty($classes)) {
			$classes = implode(' ', $classes);
			if (isset($this->htmlOptions['class'])) {
				$this->htmlOptions['class'] .= ' ' . $classes;
			} else {
				$this->htmlOptions['class'] = $classes;
			}
		}
		echo CHtml::openTag('div', $this->htmlOptions);
	}
337544
function(near) {
			if(this.modal){//Modal dialog should only appear once unless they are chain dialog
				this._makeModal();
				if(modalDialogManager.dialog) {//There is already modal dialog opened
					if(!modalDialogManager.dialog._inModalExclusion(this)) {//The dialog is NOT a child dialog of the exisitng dialog
						this.hide(true);
						return;
					}
				} else {
					modalDialogManager.dialog = this;
				}
			}
			if (typeof this._beforeShowing === "function") { //$NON-NLS-0$
				this._beforeShowing();
			}
			lib.setFramesEnabled(false);
			var rect = lib.bounds(this.$frame);
			var totalRect = lib.bounds(document.documentElement);
			var left, top;
			if (near) {
				var refRect = lib.bounds(near);
				top = refRect.top + refRect.height + 4;  // a little below
				left = refRect.left + 4; // a little offset from the left
				if (top + rect.height > totalRect.height) {
					top = Math.max(0, totalRect.height - rect.height - 4);  
				}
				if (left + rect.width > totalRect.width) {
					left = Math.max(0, totalRect.width - rect.width - 4);  
				}
			} else {
				// centered
				left = Math.max(0, (totalRect.width - rect.width) / 2);
				top = Math.max(0, (totalRect.height - rect.height) / 2);
			}
			this.$lastFocusedElement = this.$originalFocus = document.activeElement;
			this.$frame.style.top = top + "px"; //$NON-NLS-0$
			this.$frame.style.left = left + "px"; //$NON-NLS-0$ 
			this.$frame.style["max-width"] = "calc(100% - " + left + "px)";
			this.$frame.classList.add("dialogShowing"); //$NON-NLS-0$
			if (typeof this._afterShowing === "function") { //$NON-NLS-0$
				this._afterShowing();
			}
			if (!this.customFocus) {
				// We should set the focus.  Pick the first tabbable content field, otherwise use default button.
				// If neither, find any button at all.
				var focusField = this._getFirstFocusField();
				focusField.focus();
			}
		}
569430
function() {
    
    var obj;
    
    // not that the modal viewer is no longer active
    DataSaver.updateValue('modalActive', 'false');
    modalViewer.active = false;
    
    //Add active class to modal
    $('#sg-modal-container').removeClass('active');
    
    // remove the active class from all of the checkbox items
    $('.sg-checkbox').removeClass('active');
    
    // hide the modal
    modalViewer.hide();
    
    // update the wording
    $('#sg-t-patterninfo').html("Show Pattern Info");
    
    // tell the styleguide to close
    obj = JSON.stringify({ 'event': 'patternLab.patternModalClose' });
    document.getElementById('sg-viewport').contentWindow.postMessage(obj, modalViewer.targetOrigin);
    
  }
1091327
function(component, data, opts) {
					var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
					opts = _setOpts(opts);

					return $uibModal.open({
						component : component,
						keyboard : opts.kb,
						backdrop : opts.bd,
						backdropClass: opts.bdc,
						windowClass: opts.wc,
						size: opts.ws,
						animation: opts.anim,
						resolve : {
							data : function() {
								if(copy)
									return angular.copy(data);
								else
									return data;
							}
						}
					}); // end modal.open
				}
439133
function(action) {
			var self = this;

			if (action == 'show') {
				// Modal is open so update scope
				self.scope.is_open = true;

				// set body to overflow hidden if background_scroll is false
				if (! self.options.background_scroll) {
					self.dom.addClass('modaal-noscroll');
				}

				// append modaal overlay
				if ($('#' + self.scope.id + '_overlay').length < 1) {
					self.dom.append('<div class="modaal-overlay" id="' + self.scope.id + '_overlay"></div>');
				}

				// now show
				$('#' + self.scope.id + '_overlay').css('background', self.options.background).stop().animate({
					opacity: self.options.overlay_opacity
				}, self.options.animation_speed, function(){
					// now open the modal
					self.modaal_open();
				});

			} else if (action == 'hide') {

				// now hide the overlay
				$('#' + self.scope.id + '_overlay').stop().animate({
					opacity: 0
				}, self.options.animation_speed, function(){
					// remove overlay from dom
					$(this).remove();

					// remove body overflow lock
					self.dom.removeClass('modaal-noscroll');
				});
			}
		}
741062
protected void open() {

        m_oldValue = m_selectionInput.m_textbox.getValue();
        CmsEmbeddedDialogHandler handler = new CmsEmbeddedDialogHandler();
        handler.setPrincipleSelectHandler(new I_CmsPrincipalSelectHandler() {

            public void selectPrincipal(String principal) {

                if (!getFormValue().equals(principal)) {
                    setFormValueAsString(principal);
                    fireValueChange(principal);
                }
            }
        });
        handler.openDialog(DIALOG_ID, null, null, m_configuration);
    }
140970
function() {
      if (!this.openAsModal_) { return; }
      if (this.dialog_.hasAttribute('open') &&
          document.body.contains(this.dialog_)) { return; }

      this.openAsModal_ = false;
      this.dialog_.style.zIndex = '';

      // This won't match the native <dialog> exactly because if the user set
      // top on a centered polyfill dialog, that top gets thrown away when the
      // dialog is closed. Not sure it's possible to polyfill this perfectly.
      if (this.replacedStyleTop_) {
        this.dialog_.style.top = '';
        this.replacedStyleTop_ = false;
      }

      // Optimistically clear the modal part of this <dialog>.
      this.backdrop_.removeEventListener('click', this.backdropClick_);
      if (this.backdrop_.parentElement) {
        this.backdrop_.parentElement.removeChild(this.backdrop_);
      }
      dialogPolyfill.dm.removeDialog(this);
    }
1193300
function Modal(opts) {
    var that = this;

    var body = $.div();
    body.addEventListener("scroll", onScroll.bind(this, body));
    const
        laterScroll = function() {
            window.setTimeout(function() {
                onScroll(body);
            });
        },
        header = $.tag('header', 'thm-fg', 'thm-ele8', 'thm-bgPD'),
        footer = $.tag('footer', "thm-bg0"),
        cell = $.div('cell', 'thm-ele24', 'thm-bg1', [header, body, footer]),
        elem = $.elem(this, 'div', 'wdg-modal', [$.div([cell])]);
    $.on(elem, function(evt) {
        if (evt.target.parentElement !== elem) return;
        that.visible = false;
    });

    DB.prop(this, 'content')(function(v) {
        $.clear(body);
        if (Array.isArray(v)) {
            v.forEach(function(itm) {
                $.add(body, itm);
            });
        } else if (typeof v !== 'undefined' && v !== null) {
            $.add(body, v);
        }
        laterScroll();
    });
    DB.prop(this, 'header')(function(v) {
        if (!v || (typeof v === 'string' && v.trim().length === 0)) {
            $.addClass(header, "hide");
            return;
        }
        $.removeClass(header, "hide");
        $.clear(header);
        if (Array.isArray(v)) {
            v.forEach(function(itm) {
                $.add(header, itm);
            });
        } else if (typeof v !== 'undefined' && v !== null) {
            $.add(header, v);
        }
        laterScroll();
    });
    DB.prop(this, 'footer')(function(v) {
        if (!v || (typeof v === 'string' && v.trim().length === 0)) {
            $.addClass(footer, "hide");
            return;
        }
        $.removeClass(footer, "hide");
        $.clear(footer);
        if (Array.isArray(v)) {
            v.forEach(function(itm) {
                $.add(footer, itm);
            });
        } else {
            $.add(footer, v);
        }
        laterScroll();
    });
    DB.propString(this, 'width')(function(v) {
        $.css(body, {
            'max-width': v
        });
        laterScroll();
    });
    DB.propAddClass(this, 'fullscreen');
    DB.propAddClass(this, 'padding');
    DB.propAddClass(this, 'scroll');
    DB.propAddClass(this, 'wide');
    DB.propBoolean(this, 'visible')(function(v) {
        if (v) {
            that.attach();
        } else {
            that.detach();
        }
    });

    opts = DB.extend({
        visible: false,
        header: null,
        content: [],
        footer: null,
        padding: true,
        scroll: true,
        wide: false,
        fullscreen: false,
        width: 'auto'
    }, opts, this);
}
1343195
private void notifyWidgetsOfOpen() {

        for (Map.Entry<String, I_CmsFormField> fieldEntry : m_form.getFields().entrySet()) {
            fieldEntry.getValue().getWidget().setAutoHideParent(this);
        }
    }
462372
def link_to_modal(*args, &block)
      if block_given?
        options      = args.first || {}
        html_options = args.second
        block_result = capture(&block)
        link_to_modal(block_result, options, html_options)
      else
        name         = args[0]
        options      = args[1] || {}
        html_options = args[2] || {}

        # extend the html_options
        html_options[:rel] = "modal:open"
        if (html_options.has_key?(:remote))
          if (html_options[:remote] == true)
            html_options[:rel] = "modal:open:ajaxpost"
          end

          # remove the remote tag
          html_options.delete(:remote)
        end

        # check if we have an id
        html_options[:id] = UUIDTools::UUID.random_create().to_s unless html_options.has_key?(:id)

        # perform the normal link_to operation
        html_link = link_to(name, options, html_options)

        # emit both
        html_link.html_safe
      end
    end
1019358
function btnOnClick(e, opts, callback, target, k) {
        var that = void 0;
        if (e.srcElement) e.target = e.srcElement;

        target = U.findParentNode(e.target, function (target) {
          if (target.getAttribute("data-modal-header-btn")) {
            return true;
          }
        });

        if (target) {
          k = target.getAttribute("data-modal-header-btn");

          that = {
            self: this,
            key: k,
            value: opts.header.btns[k],
            dialogId: opts.id,
            btnTarget: target
          };

          if (opts.header.btns[k].onClick) {
            opts.header.btns[k].onClick.call(that, k);
          }
        }

        that = null;
        opts = null;
        callback = null;
        target = null;
        k = null;
      }
1286179
def form_invalid(self, form):
        
        context = self.get_context_data(form=form)

        #noinspection PyUnresolvedReferences
        return render_modal_workflow(
            self.request,
            '{0}/chooser.html'.format(self.template_dir),
            '{0}/chooser.js'.format(self.template_dir),
            context
        )
1046961
function ($triggerEl, options) {
    options = $.extend({}, this.options, options);
    this.modal = this.getModal(
        options['confirm-message'],
        options['confirm-yes'],
        options['confirm-no']
    );
    this.$triggerEl = $triggerEl;
    this.callback = options.callback;
  }
1012765
private function open() {
         if (!is_resource($this->handler)) {
             $this->handler = fsockopen($this->options['host'], $this->options['port'], $_, $_, $this->options['timeout']);
         }
     }
419462
function renderRevertModal() {
    var modal = null;
    if (this.state.revertModalIsOpen) {
      modal = React.createElement(_RevertModal2.default, {
        tabWindow: this.state.revertTabWindow,
        onClose: this.closeRevertModal,
        onSubmit: this.doRevert,
        appComponent: this
      });
    }

    return modal;
  }
336418
protected void openEditDialog(boolean isNew, String mode) {

        // create a form to submit a post request to the editor JSP
        Map<String, String> formValues = new HashMap<String, String>();
        if (m_editableData.getSitePath() != null) {
            formValues.put("resource", m_editableData.getSitePath());
        }
        if (m_editableData.getElementLanguage() != null) {
            formValues.put("elementlanguage", m_editableData.getElementLanguage());
        }
        if (m_editableData.getElementName() != null) {
            formValues.put("elementname", m_editableData.getElementName());
        }
        String backlink = CmsCoreProvider.get().getUri();
        if (Window.Location.getPath().endsWith(backlink)) {
            // CmsCoreProvider.get().getUri() is the request context uri from the time the direct edit provider
            // includes are generated. In case the template has changed the request context uri before that point,
            // we don't append the request parameters, as they may be inappropriate for the new URI.
            backlink += Window.Location.getQueryString();
        }
        formValues.put("backlink", backlink);
        formValues.put("redirect", "true");
        formValues.put("directedit", "true");
        formValues.put("nofoot", "1");
        formValues.put("editcontext", CmsCoreProvider.get().getUri());
        String postCreateHandler = m_editableData.getPostCreateHandler();
        if (postCreateHandler != null) {
            formValues.put(CmsEditorConstants.PARAM_POST_CREATE_HANDLER, postCreateHandler);
        }
        if (mode != null) {
            formValues.put(CmsEditorConstants.PARAM_MODE, mode);
        }

        if (isNew) {
            formValues.put("newlink", m_editableData.getNewLink());
            formValues.put("editortitle", m_editableData.getNewTitle());
        }
        FormElement formElement = CmsDomUtil.generateHiddenForm(
            CmsCoreProvider.get().link(CmsCoreProvider.get().getContentEditorUrl()),
            Method.post,
            Target.TOP,
            formValues);
        getMarkerTag().appendChild(formElement);
        formElement.submit();
    }