MODAL CLASS DEFINITION ======================
18868
function (element, options) {
			this.options = options;
			this.$body = $(document.body);
			this.$element = $(element);
			this.$dialog = this.$element.find(".modal-dialog");
			this.$backdrop = null;
			this.isShown = null;
			this.originalBodyPad = null;
			this.scrollbarWidth = 0;
			this.ignoreBackdropClick = false;

			if (this.options.remote) {
				this.$element
					.find(".modal-content")
					.load(this.options.remote, $.proxy(function () {
						this.$element.trigger("loaded.bs.modal");
					}, this));
			}
		}
97134
function(message, callback) {

						if (!F2.isInit()) {
							F2.log('F2.init() must be called before F2.UI.Modals.alert()');
							return;
						}

						if (F2.Rpc.isRemote(_appConfig.instanceId)) {
							F2.Rpc.call(
								_appConfig.instanceId,
								F2.Constants.Sockets.UI_RPC,
								'Modals.alert',
								[].slice.call(arguments)
							);
						} else {
							// display the alert
							jQuery(_renderAlert(message))
								.on('show.bs.modal', function() {
									var modal = this;
									jQuery(modal).find('.btn-primary').on('click', function() {
										jQuery(modal).modal('hide').remove();
										(callback || jQuery.noop)();
									});
								})
								.modal({backdrop:true});
						}
					}
825083
public function modal($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'debug'    => false,
            'selector' => '[data-k-modal]',
            'data'     => 'k-modal',
            'options_callback' => null,
            'options'  => array('type' => 'image')
        ));

        $html = '';

        if(!static::isLoaded('modal'))
        {
            $html .= $this->jquery();
            $html .= '<ktml:script src="assets://js/'.($config->debug ? 'build/' : 'min/').'jquery.magnific-popup.js" />';

            static::setLoaded('modal');
        }

        if(!static::isLoaded('modal-select2-fix'))
        {
            $html .= "<script>

                // WORKAROUND FOR ISSUE: #873

                kQuery(function($)
                {
                    $.magnificPopup.instance._onFocusIn = function(e)
                    {
                        // Do nothing if target element is select2 input
                        if( $(e.target).hasClass('select2-search__field') ) {
                            return true;
                        }
            
                        // Else call parent method
                        $.magnificPopup.proto._onFocusIn.call(this,e);
                    };
                });
            </script>";

            static::setLoaded('modal-select2-fix');
        }

        $options   = (string)$config->options;
        $signature = md5('modal-'.$config->selector.$config->options_callback.$options);

        if (!static::isLoaded($signature))
        {
            if ($config->options_callback) {
                $options = $config->options_callback.'('.$options.')';
            }

            $html .= "<script>
            kQuery(function($){
                $('$config->selector').each(function(idx, el) {
                    var el = $(el);
                    var data = el.data('$config->data');
                    var options = ".$options.";
                    if (data) {
                        $.extend(true, options, data);
                    }
                    el.magnificPopup(options);
                });
            });
            </script>";

            static::setLoaded($signature);
        }

        return $html;
    }
1339599
function toggleShepherdModalClass(currentElement) {
  const shepherdModal = document.querySelector(`${classNames.modalTarget}`);

  if (shepherdModal) {
    shepherdModal.classList.remove(classNames.modalTarget);
  }

  currentElement.classList.add(classNames.modalTarget);
}
411283
function () {

		// make sure the listener for checkpanels is set-up
		Dispatcher.addListener('insertPanels', modalViewer.insert);

		// add the info/code panel onclick handler
		$('.pl-js-pattern-info-toggle').click(function (e) {
			modalViewer.toggle();
		});

		// make sure the close button handles the click
		$('.pl-js-modal-close-btn').on('click', function (e) {

			// hide any open annotations
			obj = JSON.stringify({
				'event': 'patternLab.annotationsHighlightHide'
			});
			document.querySelector('.pl-js-iframe').contentWindow.postMessage(obj, modalViewer.targetOrigin);

			// hide the viewer
			modalViewer.close();

		});

		// see if the modal is already active, if so update attributes as appropriate
		if (DataSaver.findValue('modalActive') === 'true') {
			modalViewer.active = true;
			$('.pl-js-pattern-info-toggle').html("Hide Pattern Info");
		}

		// make sure the modal viewer is not viewable, it's always hidden by default. the pageLoad event determines when it actually opens
		modalViewer.hide();

		// review the query strings in case there is something the modal viewer is supposed to handle by default
		var queryStringVars = urlHandler.getRequestVars();

		// show the modal if code view is called via query string
		if ((queryStringVars.view !== undefined) && ((queryStringVars.view === 'code') || (queryStringVars.view === 'c'))) {
			modalViewer.queryPattern();
		}

		// show the modal if the old annotations view is called via query string
		if ((queryStringVars.view !== undefined) && ((queryStringVars.view === 'annotations') || (queryStringVars.view === 'a'))) {
			modalViewer.queryPattern();
		}

	}
630864
function() {
			var self = this;
			var content;

			content = '<div class="modaal-content-container">' +
					'<h1 id="modaal-title">' + self.options.confirm_title + '</h1>' +
					'<div class="modaal-confirm-content">' + self.options.confirm_content + '</div>' +
						'<div class="modaal-confirm-wrap">' +
							'<button type="button" class="modaal-confirm-btn modaal-ok" aria-label="Confirm">' + self.options.confirm_button_text + '</button>' +
							'<button type="button" class="modaal-confirm-btn modaal-cancel" aria-label="Cancel">' + self.options.confirm_cancel_button_text + '</button>' +
						'</div>' +
					'</div>' +
				'</div>';

			// now push content into markup
			self.build_modal(content);
		}
178772
private void pauseAndTrainModal(List<FormInput> formInputs) {

		/* If we are doing a training crawl, allow the user to edit remaining forms. */
		WebDriver driver = browser.getWebDriver();
		driver.manage().timeouts().setScriptTimeout(180, TimeUnit.SECONDS);

		String js = "";

		/* Inject the modal notification. */
		js += "function addStyleString(str) {";
		js += "	var node = document.createElement('style');";
		js += "	node.innerHTML = str;";
		js += "	document.body.appendChild(node);";
		js += "}";

		js += "function addHTMLString(str) {";
		js += "	var modal = document.createElement('div');";
		js += "	modal.setAttribute('id', 'myModal');";
		js += "	modal.setAttribute('class', 'modal');";
		js +=
				" modal.setAttribute('style', 'display:none;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)');";
		js += "	modal.innerHTML = str;";
		js += "	document.body.appendChild(modal);";
		js += "}";

		js += "addHTMLString(\"" + MODAL_HTML + "\");";

		js += "var modal = document.getElementById('myModal');";
		js += "var span = document.getElementsByClassName('close')[0];";

		js += "span.onclick = function() {";
		js += "	modal.style.display = 'none';";
		js += "};";

		js += "window.onclick = function(event) {";
		js += "	if (event.target == modal) {";
		js += "		modal.style.display = 'none';";
		js += "	}";
		js += "};";

		js += "modal.style.display = 'block';";

		/* Inject the callback and continuation keys. */
		js += "var callback = arguments[arguments.length - 1];";
		js += "var title = document.title;";
		js += "document.onkeydown = function(e) {";
		js += "if(e.keyCode === 112) {";
		js += "document.title = title;";
		js += "setTimeout(callback, 1);";
		js += "}";
		js += "}";

		JavascriptExecutor executor = (JavascriptExecutor) driver;
		executor.executeAsyncScript(js);

		/*
		 * Save each FormInput element so the user does not have to enter them again.
		 */
		for (FormInput input : formInputs) {

			/* Create the InputValue for this element. */
			InputValue inputValue = getInputValue(input);

			/* Read the value from the DOM. */
			Set<InputValue> inputValues = new HashSet<>();
			inputValues.add(inputValue);

			/* The DOM value is the new input value. */
			input.inputValues(inputValues);

			/* Label the element as visited. */
			visited.add(input.getIdentification());

			/* Add this input value to the set. */
			formInputValueHelper.addTrainingInput(input.getIdentification(), input);

		}

	}
1253896
private function renderForm()
    {
        /** @var ActiveRecord $model */
        $model = new $this->modelClass;

        echo <<<HTML
<div class="modal" id="{$this->id}-new-node-modal" tabindex="-1" role="dialog" aria-labelledby="newNodeModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
HTML;
        /** @var ActiveForm $form */
        $form = ActiveForm::begin([
            'id' => $this->id . '-new-node-form'
        ]);

        echo <<<HTML
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="newNodeModalLabel">New node</h4>
      </div>
      <div class="modal-body">
HTML;

        echo call_user_func($this->formFieldsCallable, $form, $model);

        echo <<<HTML
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary">Create node</button>
      </div>
HTML;
        $form->end();
        echo <<<HTML
    </div>
  </div>
</div>
HTML;
    }
889497
private function set_modal_config() {

		if ( ! empty( $this->struct['config'] ) ) {
			$attributes = array();
			foreach ( $this->struct['config'] as $att => $value ) {
				$attributes[ 'data-' . $att ] = $value;
			}
			$this->attributes['data-config'] = json_encode( $attributes );

		}
	}
1107938
function (settings) {
        var self = this;

        self._super(settings);
        self._eventsRoot = self;

        self.classes.add('floatpanel');

        // Hide floatpanes on click out side the root button
        if (settings.autohide) {
          bindDocumentClickHandler();
          bindWindowResizeHandler();
          visiblePanels.push(self);
        }

        if (settings.autofix) {
          bindDocumentScrollHandler();

          self.on('move', function () {
            repositionPanel(this);
          });
        }

        self.on('postrender show', function (e) {
          if (e.control == self) {
            var $modalBlockEl, prefix = self.classPrefix;

            if (self.modal && !hasModal) {
              $modalBlockEl = $('#' + prefix + 'modal-block', self.getContainerElm());
              if (!$modalBlockEl[0]) {
                $modalBlockEl = $(
                  '<div id="' + prefix + 'modal-block" class="' + prefix + 'reset ' + prefix + 'fade"></div>'
                ).appendTo(self.getContainerElm());
              }

              Delay.setTimeout(function () {
                $modalBlockEl.addClass(prefix + 'in');
                $(self.getEl()).addClass(prefix + 'in');
              });

              hasModal = true;
            }

            addRemove(true, self);
          }
        });

        self.on('show', function () {
          self.parents().each(function (ctrl) {
            if (ctrl.state.get('fixed')) {
              self.fixed(true);
              return false;
            }
          });
        });

        if (settings.popover) {
          self._preBodyHtml = '<div class="' + self.classPrefix + 'arrow"></div>';
          self.classes.add('popover').add('bottom').add(self.isRtl() ? 'end' : 'start');
        }

        self.aria('label', settings.ariaLabel);
        self.aria('labelledby', self._id);
        self.aria('describedby', self.describedBy || self._id + '-none');
      }
1292079
public static boolean isModal(Component component) {
	synchronized (modals) {
	  Iterator<Entry<RootPaneContainer, Modal>> it =
		  modals.entrySet().iterator();
	  while (it.hasNext()) {
		Entry<RootPaneContainer, Modal> entry = it.next();
		if (entry.getValue().components.contains(component)) {
		  return true;
		}
	  }
	  return false;
	}
  }
1027333
private static Modal getModal(RootPaneContainer rootPane) {
	synchronized (modals) {
	  Modal modal = modals.get(rootPane);
	  if (modal == null) {
		modal = new Modal(rootPane);
		modals.put(rootPane, modal);
	  }
	  return modal;
	}
  }
1234433
function destroy() {
        Modal._count--;
        this._removeEventHandlers();
        this.el.removeAttribute('style');
        this.$overlay.remove();
        this.el.M_Modal = undefined;
      }
1196704
function render(name, data) {
    var template;

    if (name !== 'login') {
      template = this.template(name, data || {});

      template.where('name').is('username').use('username').as('value');
      template.where('name').is('password').use('password').as('value');

      if (data && data.error) {
        template.className('error').use('error');
      } else {
        template.className('error').remove();
      }

      if (data && data.success) {
        template.className('success').use('success');
      } else {
        template.className('success').remove();
      }
    } else if (data && data.error) {
      // Hide the spinner and show the close button.
      $('.modal .close').removeClass('gone');
      $('.modal .spinner').addClass('gone');

      // Login request, but with data.. so the login failed
      $('.modal input[name="username"], .modal input[name="password"]').set(
        'readOnly',
        false
      );

      $('.modal button[type="submit"]')
        .removeClass('disabled loading')
        .set('innerHTML', 'Log in')
        .set('disabled', '');

      $('.modal .error').removeClass('gone').set('innerHTML', data.error);
    }

    Cortex.app('modal')
      .render(template)
      .once('done', this.close.bind(this, name));

    //
    // Check if we need to create a hidden input field with a redirect directive.
    //
    if (this.redirect) {
      $('.modal form input[name="redirect"]').set('value', this.redirect);
    }

    return this;
  }
1012992
private ModalPanel getModalPanel() {
	if (modalPanel == null) {
	  modalPanel = new ModalPanel();
	  modalPanel.setLayout(new ModalLayout());
	}
	return modalPanel;
  }
15617
public function render_modal_template() {
		unset( $this->struct['label'] );
		$output = '<script data-height="' . esc_attr( $this->attributes['data-height'] ) . '" data-width="' . esc_attr( $this->attributes['data-width'] ) . '" type="text/html" id="' . esc_attr( $this->id() ) . '-tmpl">';
		$output .= $this->modal_template();
		$output .= '</script>';
		$output .= $this->render_footer_template();

		return $output;
	}
1016066
function() {

      var id, cssClass, href, target, title, link;

      // get selected link
      hashedit.currLink = hashedit.getLinkFromSelection();

      // populate link values
      if (hashedit.currLink !== null) {

        // get  attributes
        id = hashedit.currLink.getAttribute('id') || '';
        cssClass = hashedit.currLink.getAttribute('class') || '';
        href = hashedit.currLink.getAttribute('href') || '';
        target = hashedit.currLink.getAttribute('target') || '';
        title = hashedit.currLink.getAttribute('title') || '';

        // show the link dialog
        link = document.querySelector('#hashedit-link-settings-modal');
        link.setAttribute('visible', '');

        // sets start values
        document.getElementById('hashedit-link-id').value = id;
        document.getElementById('hashedit-link-cssclass').value =
          cssClass;
        document.getElementById('hashedit-link-href').value = href;
        document.getElementById('hashedit-link-target').value = target;
        document.getElementById('hashedit-link-title').value = title;

      }

    }