End of function errBox Call this function to pop up a branded modal msgBox
545008
function modalBox(msg) {
        var boxCSS = "position:absolute;width:300px;height:150px;padding:10px;background-color:#000000;color:#ffffff;z-index:30;font-family:'Arial';font-size:12px;display:none;";
        $("#aspnetForm").parent().append("<div id='SPServices_msgBox' style=" + boxCSS + ">" + msg);
        var msgBoxObj = $("#SPServices_msgBox");
        var height = msgBoxObj.height();
        var width = msgBoxObj.width();
        var leftVal = ($(window).width() / 2) - (width / 2) + "px";
        var topVal = ($(window).height() / 2) - (height / 2) - 100 + "px";
        msgBoxObj.css({
            border: '5px #C02000 solid',
            left: leftVal,
            top: topVal
        }).show().fadeTo("slow", 0.75).click(function () {
            $(this).fadeOut("3000", function () {
                $(this).remove();
            });
        });
    }
821513
function openModal() {
  var $modal = getModal();
  _removeClass$getTopMargin$fadeIn$show$addClass.fadeIn(getOverlay(), 10);
  _removeClass$getTopMargin$fadeIn$show$addClass.show($modal);
  _removeClass$getTopMargin$fadeIn$show$addClass.addClass($modal, 'showSweetAlert');
  _removeClass$getTopMargin$fadeIn$show$addClass.removeClass($modal, 'hideSweetAlert');

  window.previousActiveElement = document.activeElement;
  var $okButton = $modal.querySelector('button.confirm');
  $okButton.focus();

  setTimeout(function () {
    _removeClass$getTopMargin$fadeIn$show$addClass.addClass($modal, 'visible');
  }, 500);

  var timer = $modal.getAttribute('data-timer');

  if (timer !== 'null' && timer !== '') {
    $modal.timeout = setTimeout(function () {
      swal.close();
    }, timer);
  }
}
75147
def _get_end_event(parser, tagName):
    """"""

    (event, node) = six.next(parser)

    if event != pulldom.END_ELEMENT or node.tagName != tagName:
        raise ParseError(
            'Expecting %s end tag, got %s %s' % (tagName, event, node.tagName))
1088516
@SuppressWarnings("deprecation")
    @Override
    public void eventCallback(String eventName, Object eventData) {
        try {
            PopupData popupData = null;
            
            if (eventData instanceof PopupData) {
                popupData = (PopupData) eventData;
            } else {
                popupData = new PopupData(eventData.toString());
            }
            
            if (popupData.isEmpty()) {
                return;
            }
            
            Page currentPage = ExecutionContext.getPage();
            Window window = getPopupWindow();
            window.setTitle(popupData.getTitle());
            window.setParent(currentPage);
            String pos = getPosition();
            window.addStyle("left", pos);
            window.addStyle("top", pos);
            window.addEventListener("close", this);
            Label label = window.findByName("messagetext", Label.class);
            label.setLabel(popupData.getMessage());
            window.setMode(Mode.POPUP);
        } catch (Exception e) {}
    }
1018887
function end () {
      sent = true;
      // next tick it to avoid express catching runtime error in the callback
      //   getting caught by express and triggering app's error handler
      process.nextTick(function () {
        res.emit('finish');
        cb(null, res);
      });
    }
962137
def msgbox(msg="(Your message goes here)", title=" ", ok_button="OK",image=None,root=None):
    
    if type(ok_button) != type("OK"):
        raise AssertionError("The 'ok_button' argument to msgbox must be a string.")

    return buttonbox(msg=msg, title=title, choices=[ok_button], image=image,root=root)
241199
function end() {
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		if (self.writable && args.length) write.apply(this, args.concat(afterWrite))
		else afterWrite()

		function afterWrite(e) {
			if (e) err = e
			destroy(afterDestroy)
		}

		function afterDestroy(e) {
			if (e && !err) err = e
			if (cb) {
				var cbArgs = []
				if (err) cbArgs.push(err)
				cb.apply(this, cbArgs)
			}
		}
	}
565891
def end_element(self, tag):
        """"""
        if tag == u'form':
            self.forms.append(self.form)
            self.form = None
1224169
function failWrapper(msg, mode) {
  gT.l.fail(msg);
  if (mode && mode.accName) {
    mode.accName = false; // eslint-disable-line no-param-reassign
  }
}
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);
          });
        }
      }
623784
function(title, message, callback, options) {
    var buttons = {};
    buttons[options?(options.buttonTitle || "OK"):"OK"] = function() {
      $(this).dialog( "close" );
    };
    var opts = $.extend(true,
                        { buttons: buttons,
                          modal: true,
                          title: title,
                          draggable: false,
                          close: function() {
                            // if there is a callback, call it
                            if ($.isFunction(callback)) {
                              callback();
                            }
                            return true;
                          }
                        },
                        options);
    $("#feedbackDialog") // find the dialog element
          .find("p") // find the p element inside
              .text(message) // set the feedback text
          .end() // go back to the #feedbackDialog element
          .dialog(opts);
  }
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);
}
356260
function announceClosed(opts) {
      var mdSelect = opts.selectCtrl;
      if (mdSelect) {
        var menuController = opts.selectEl.controller('mdSelectMenu');
        mdSelect.setLabelText(menuController ? menuController.selectedLabels() : '');
        mdSelect.triggerClose();
      }
    }
705454
function render(msg, cb, ms, level) {
    if (typeof cb === 'number') {
      ms = cb;
      cb = null;
    }

    return new Message({
      parentNode: '#msgbox',
      model: {
        msg: msg,
        close: cb,
        timeout: ms || util.TOAST_DURATION,
        level: level
      }
    }).render();
  }
889153
function onError(err) {
    // jshint validthis: true
    notifier.notify({
        title: err.plugin + ' Error',
        message: err.message
    });
    $.util.log(err.toString());
    $.util.beep();
    if (isWatching) {
        this.emit('end');
    } else {
        process.exit(1);
    }
}
543430
function() {

    // private object for Alerty object inherit
    var Dialog = {
      
      // static defaults params
      defaults: {
        okLabel: '\u786e\u5b9a',
        cancelLabel: '\u53d6\u6d88',
        time: 2000
      },

      previousCallback: null,  // for cache previous toasts callbak, to handle if call more than 1 alerty

      // html templates
      template: '<div class="alerty-overlay" tabindex="-1"></div>'+
                '<div class="alerty">'+
                  '<div class="alerty-title"></div>'+
                  '<div class="alerty-content">'+
                    '<p class="alerty-message"></p>'+
                    '<div class="alerty-prompt">'+
                      '<input type="text" placeholder="" value="">'+
                      '<div class="input-line"></div>'+
                    '</div>'+
                  '</div>'+
                  '<div class="alerty-action">'+
                    '<a class="btn-cancel"></a>'+
                    '<a class="btn-ok"></a>'+
                  '</div>'+
                '</div>',



      /** 
       * [Build the HTML contents]
       *
       * @param type {String}           -- get the dialog type to arrange the correspondent html content.
       * @param content {String}        -- the text contents dialog to users.
       * @param opts {Object}           -- options.
       * @param onOk {Function}         -- custom callback function after click ok button.
       * @param onCancel {Function}     -- custom callback function after click cancel button.
       */
      setup: function(type, content, opts, onOk, onCancel) {
        // for if argument opts is not given.
        var detect = typeof opts === 'function';
        if (detect) {
          onCancel = onOk;
          onOk = opts;
        }

        var $oldModal = document.querySelector('.alerty');


        // if previous modal is open, remove it and immediately callback
        if ($oldModal) {
          commonUse.removeElement($oldModal);
          var _callback = this.previousCallback;
          if (_callback) _callback();
        }

        var $wrapper = document.createElement('div');
        $wrapper.innerHTML = this.template;

        // append alerty to body
        while ($wrapper.firstChild) {
          document.body.appendChild($wrapper.firstChild);
        }

        // cache alerty dom for next use
        var $modal = document.querySelector('.alerty');
        var $overlay = document.querySelector('.alerty-overlay');
        var $title = $modal.querySelector('.alerty-title');
        var $message = $modal.querySelector('.alerty-message');
        var $btnArea = $modal.querySelector('.alerty-action');
        var $btnOk = $modal.querySelector('.btn-ok');
        var $btnCancel = $modal.querySelector('.btn-cancel');
        var $prompt = $modal.querySelector('.alerty-prompt');
        var $input = $prompt.querySelector('input');

        // set uid
        $modal.id = commonUse.setUid('alerty');
        $overlay.id = 'overlay-'+$modal.id;

        // animation show alerty
        commonUse.addClass($overlay, 'active');
        commonUse.addClass($modal, 'alerty-show');
        $message.innerHTML = content;  // set msg

        if (opts && opts.time) this.defaults.time = opts.time; // handle time if set

        if (type !== 'prompt') {
          commonUse.removeElement($prompt); // other type do not need
        } else {
          $input.focus(); // auto focus input if type prompt

          if(opts && opts.inputType) $input.setAttribute('type', opts.inputType); // handle input type, such as 'password'
          if(opts && opts.inputPlaceholder) $input.setAttribute('placeholder', opts.inputPlaceholder); // handle input placeholder
          if(opts && opts.inputValue) $input.setAttribute('value', opts.inputValue); // handle input default value 
        }

        if (type === 'toasts') {
          this.previousCallback = onOk;  // cache callback

          // rearrange template
          commonUse.removeElement($title);
          commonUse.removeElement($btnArea);
          commonUse.removeElement($overlay);
          commonUse.addClass($modal, 'toasts');

          if (opts && opts.place === 'top') commonUse.addClass($modal, 'place-top'); // handle toasts top place
          if (opts && opts.bgColor) $modal.style.backgroundColor = opts.bgColor;
          if (opts && opts.fontColor) $message.style.color =opts.fontColor;

        } else {
          commonUse.addClass(document.body, 'no-scrolling'); // body no scorll
          (opts && opts.title) ? $title.innerHTML = opts.title : commonUse.removeElement($title); // handle title if set
          (opts && opts.okLabel) ? $btnOk.innerHTML = opts.okLabel : $btnOk.innerHTML = this.defaults.okLabel; // handle ok text if set
          $modal.style.marginTop =  - $modal.offsetHeight / 2 + 'px'; // set the place to center using margin-top;

          if (type === 'confirm' || type === 'prompt') {
            (opts && opts.cancelLabel) ? $btnCancel.innerHTML = opts.cancelLabel : $btnCancel.innerHTML = this.defaults.cancelLabel; // handle cancel text if set
          } else {
            commonUse.removeElement($btnCancel); // toasts and alery type do not need cancel btn
          }
        }

        this.bindEvent($modal, onOk, onCancel); // see next
      },

      /** 
       * [Bind event to dialog]
       *
       * @param $modal {Object}       -- modal node.
       * @param: onOk {Function}      -- ok callback.
       * @param: onCancel {Function}  -- cancel callback.
       */
      bindEvent: 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);
          });
        }
      },

      /** 
       * [Close the actived modal and remove it]
       *
       * @param: $modal {Obejct}  -- modal element to remove.
       * @param: callback {Function}  -- callback function.
       */
      close: function($modal, callback) {
        var $input = $modal.querySelector('input');
        var $overlay = document.getElementById('overlay-'+$modal.id);

        // hide alerty with animation
        commonUse.removeClass($modal, 'alerty-show');
        commonUse.addClass($modal, 'alerty-hide');

        // remove alerty and other added elements
        setTimeout(function(){
          $overlay && commonUse.removeClass($overlay, 'active'), commonUse.removeClass(document.body, 'no-scrolling');
          
          commonUse.removeElement($modal);
          commonUse.removeElement($overlay);
          if (callback) {
            setTimeout(function(){
              !$input ? callback() : callback($input.value);  // handle prompt type, callback the input value
            }, 100);
          }
        },100);
      }
    };

    return {
      // return alerty.toasts();
      toasts: function(content, opts, callback) {
        Dialog.setup('toasts', content, opts, callback);
      },

      // return alerty.alert();
      alert: function(content, opts, onOk) {
        Dialog.setup('alert', content, opts, onOk);
      },

      // return alerty.confirm();
      confirm: function(content, opts, onOk, onCancel) {
        Dialog.setup('confirm', content, opts, onOk, onCancel);
      },

      // return alerty.prompt();
      prompt: function(content, opts, onOk, oncancel) {
        Dialog.setup('prompt', content, opts, onOk, oncancel);
      }
    };
  }
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();
		}

	}