close current modal box
769289
function () {
            var t = this,
                prefix = t.o.prefix;

            t.$btnPane.removeClass(prefix + 'disable');
            t.$overlay.off();

            // Find the modal box
            var $modalBox = $('.' + prefix + 'modal-box', $(t.doc.body));

            $modalBox.animate({
                top: '-' + $modalBox.height()
            }, 100, function () {
                $modalBox.parent().remove();
                t.hideOverlay();
            });

            t.restoreRange();
        }
1094658
function (title, content) {
            var t = this,
                prefix = t.o.prefix;

            // No open a modal box when exist other modal box
            if ($('.' + prefix + 'modal-box', t.$box).length > 0) {
                return false;
            }
            if (t.o.autogrowOnEnter) {
                t.autogrowOnEnterDontClose = true;
            }

            t.saveRange();
            t.showOverlay();

            // Disable all btnPane btns
            t.$btnPane.addClass(prefix + 'disable');

            // Build out of ModalBox, it's the mask for animations
            var $modal = $('<div/>', {
                class: prefix + 'modal ' + prefix + 'fixed-top'
            }).css({
                top: t.$box.offset().top + t.$btnPane.height(),
                zIndex: 99999
            }).appendTo($(t.doc.body));

            // Click on overlay close modal by cancelling them
            t.$overlay.one('click', function () {
                $modal.trigger(CANCEL_EVENT);
                return false;
            });

            // Build the form
            var $form = $('<form/>', {
                action: '',
                html: content
            })
                .on('submit', function () {
                    $modal.trigger(CONFIRM_EVENT);
                    return false;
                })
                .on('reset', function () {
                    $modal.trigger(CANCEL_EVENT);
                    return false;
                })
                .on('submit reset', function () {
                    if (t.o.autogrowOnEnter) {
                        t.autogrowOnEnterDontClose = false;
                    }
                });


            // Build ModalBox and animate to show them
            var $box = $('<div/>', {
                class: prefix + 'modal-box',
                html: $form
            })
                .css({
                    top: '-' + t.$btnPane.outerHeight() + 'px',
                    opacity: 0
                })
                .appendTo($modal)
                .animate({
                    top: 0,
                    opacity: 1
                }, 100);


            // Append title
            $('<span/>', {
                text: title,
                class: prefix + 'modal-title'
            }).prependTo($box);

            $modal.height($box.outerHeight() + 10);


            // Focus in modal box
            $('input:first', $box).focus();


            // Append Confirm and Cancel buttons
            t.buildModalBtn('submit', $box);
            t.buildModalBtn('reset', $box);


            $(window).trigger('scroll');

            return $modal;
        }
777125
function() {
    
    // make sure the modal viewer and other options are off just in case
    modalViewer.close();

    // note it's turned on in the viewer
    DataSaver.updateValue('modalActive', 'true');
    modalViewer.active = true;

    // add an active class to the button that matches this template
    $('#sg-t-'+modalViewer.template+' .sg-checkbox').addClass('active');

    //Add active class to modal
    $('#sg-modal-container').addClass('active');
    
    // show the modal
    modalViewer.show();
    
  }
400165
def closePanel(self):
        
        # make sure we can close all the widgets in the view first
        for i in range(self.count()):
            if not self.widget(i).canClose():
                return False

        container = self.parentWidget()
        viewWidget = self.viewWidget()

        # close all the child views
        for i in xrange(self.count() - 1, -1, -1):
            self.widget(i).close()

        self.tabBar().clear()

        if isinstance(container, XSplitter):
            parent_container = container.parentWidget()
            
            if container.count() == 2:
                if isinstance(parent_container, XSplitter):
                    sizes = parent_container.sizes()
                    widget = container.widget(int(not container.indexOf(self)))
                    index = parent_container.indexOf(container)
                    parent_container.insertWidget(index, widget)
                    
                    container.setParent(None)
                    container.close()
                    container.deleteLater()
                    
                    parent_container.setSizes(sizes)
                
                elif parent_container.parentWidget() == viewWidget:
                    widget = container.widget(int(not container.indexOf(self)))
                    widget.setParent(viewWidget)
                    
                    if projexui.QT_WRAPPER == 'PySide':
                        _ = viewWidget.takeWidget()
                    else:
                        old_widget = viewWidget.widget()
                        old_widget.setParent(None)
                        old_widget.close()
                        old_widget.deleteLater()
                        QtGui.QApplication.instance().processEvents()
                    
                    viewWidget.setWidget(widget)
            else:
                container.setParent(None)
                container.close()
                container.deleteLater()
        else:
            self.setFocus()

        self._hintLabel.setText(self.hint())
        self._hintLabel.show()

        return True
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);

		}

	}
819764
function(keepCurrentModal) {
			lib.returnFocus(this.$frameParent, this.$originalFocus, function() {
				if(!keepCurrentModal && modalDialogManager.dialog === this) {
					modalDialogManager.dialog = null;
				}
				if (typeof this._beforeHiding === "function") { //$NON-NLS-0$
					this._beforeHiding();
				}
				if (this._modalListener) {
					this.$frameParent.removeEventListener("focus", this._modalListener, true);  //$NON-NLS-0$
					this.$frameParent.removeEventListener("click", this._modalListener, true);  //$NON-NLS-0$
				}
	
				this.$frame.classList.remove("dialogShowing"); //$NON-NLS-0$
				lib.setFramesEnabled(true);
				if (typeof this._afterHiding === "function") { //$NON-NLS-0$
					this._afterHiding();
				}
			}.bind(this));
			var self = this;
			if (!this.keepAlive) {
				window.setTimeout(function() { self.destroy(); }, 0);
			}
		}
445879
static void close(SpanFunction spanFunction) {
    SpanContext current = CURRENT_SPAN.get();
    while (current != null) {
      spanFunction.apply(current.span);
      current = removeCurrentSpanInternal(current.parent);
      if (current == null || !current.autoClose) {
        return;
      }
    }
  }
184867
protected function closeConfirmBox()
    {
        try {
            $elem = $this->getSession()->getPage()->find('css', '.ez-view-confirmboxview');
            if ($elem && $elem->isVisible()) {
                $elem->find('css', '.ez-confirmbox-close-icon')->click();
                $this->sleep();
            }
        } catch (\Exception $e) {
        }
    }
530609
function($modal, onOk, onCancel) {
        var that = this;
        var $btnOk = $modal.querySelector('.btn-ok');
        var $btnCancel = $modal.querySelector('.btn-cancel');

        // toasts delay hide
        if (commonUse.hasClass($modal, 'toasts')) {
          setTimeout(function() {
            // if toasts has been removed
            if (document.getElementById($modal.id) === null) return;
            that.close($modal, onOk);
          }, that.defaults.time);
        }
        // click ok button
        if ($btnOk) {
          commonUse.addEvent($btnOk, 'click', function() {
            that.close($modal, onOk);
          });
        }
        // click cancel button
        if ($btnCancel) {
          commonUse.addEvent($btnCancel, 'click', function() {
            that.close($modal, onCancel);
          });
        }
      }
1025181
function()
              {
                container.find('td.Radio input').unbind('click', radioClicked);
                currentPreview.unbind('click', currentClicked);
                cancelButton.unbind('click', cancelClicked);
                okButton.unbind('click', okClicked);
                if (settings.window.expandable)
                {
                  iconImage.unbind('click', iconImageClicked);
                  moveBar.unbind('mousedown', moveBarMouseDown);
                  $this.icon = null;
                }
                container.find('.QuickColor').unbind('click', quickPickClicked);
                colorMapDiv = null;
                colorBarDiv = null;
                colorMapL1 = null;
                colorMapL2 = null;
                colorMapL3 = null;
                colorBarL1 = null;
                colorBarL2 = null;
                colorBarL3 = null;
                colorBarL4 = null;
                colorBarL5 = null;
                colorBarL6 = null;
                colorMap.destroy();
                colorMap = null;
                colorBar.destroy();
                colorBar = null;
                colorPicker.destroy();
                colorPicker = null;
                activePreview = null;
                currentPreview = null;
                okButton = null;
                cancelButton = null;
                grid = null;
                commitCallback = null;
                cancelCallback = null;
                liveCallback = null;
                container.html('');
                for (i = 0; i < List.length; i++) if (List[i] == $this) List.splice(i, 1);
              }
96894
function ( content, options ) {
    this.settings = $.extend({}, $.fn.modal.defaults)
    this.$element = $(content)
      .delegate('.close', 'click.modal', $.proxy(this.hide, this))

    if ( options ) {
      $.extend( this.settings, options )

      if ( options.show ) {
        this.show()
      }
    }

    return this
  }
34195
function handleConfirm(modal, params) {
  var callbackValue = true;

  if (_hasClass$isDescendant.hasClass(modal, 'show-input')) {
    callbackValue = modal.querySelector('input').value;

    if (!callbackValue) {
      callbackValue = '';
    }
  }

  params.doneFunction(callbackValue);

  if (params.closeOnConfirm) {
    sweetAlert.close();
  }
}
1200447
private static void closeAllModals_(RootPaneContainer rootPane) {
	synchronized (modals) {
	  Modal modal = modals.get(rootPane);
	  if (modal != null) {
		modal.closeAll();
		modals.remove(rootPane);
	  }
	}
  }
884374
function(ev) {
    if (ev) {
      ev.preventDefault();
      ev.stopPropagation();
    }
    if (this.model.get("visibility")) {
       this.model.set("visibility", false);
       this.trigger('close');
    }
  }
829559
protected void close() {

        if (!m_enabled) {
            return;
        }
        m_openClose.setDown(false);
        m_popup.hide();
        m_selectBoxState.setValue(I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());
    }
1089756
function handleCancel(modal, params) {
  // Check if callback function expects a parameter (to track cancel actions)
  var functionAsStr = String(params.doneFunction).replace(/\s/g, '');
  var functionHandlesCancel = functionAsStr.substring(0, 9) === 'function(' && functionAsStr.substring(9, 10) !== ')';

  if (functionHandlesCancel) {
    params.doneFunction(false);
  }

  if (params.closeOnCancel) {
    sweetAlert.close();
  }
}
236233
function (popup) {
                var openedPopups = this.openedPopups;
                utilsArray.remove(openedPopups, popup);
                if (popup.modalMaskDomElement) {
                    this.modalPopups -= 1;
                    if (this.modalPopups === 0) {
                        this.disconnectModalEvents();
                        this.$raiseEvent("modalPopupAbsent");
                        this._viewportNavigationInterceptor.destroyElements();
                    }
                }
                if (utilsArray.isEmpty(openedPopups)) {
                    this.disconnectEvents();
                }
                var curZIndex = popup.getZIndex();
                if (curZIndex === this.currentZIndex) {
                    this.currentZIndex -= 10;
                }

                this.$raiseEvent({
                    name : "popupClose",
                    popup : popup
                });
            }