Set type, text and actions on popup

@param params
@returns {boolean}
4551
function setParameters(params) {
  // Use default `inputValidator` for supported input types if not provided
  if (!params.inputValidator) {
    Object.keys(defaultInputValidators).forEach(function (key) {
      if (params.input === key) {
        params.inputValidator = params.expectRejections ? defaultInputValidators[key] : Swal.adaptInputValidator(defaultInputValidators[key]);
      }
    });
  } // params.extraParams is @deprecated


  if (params.validationMessage) {
    if (_typeof(params.extraParams) !== 'object') {
      params.extraParams = {};
    }

    params.extraParams.validationMessage = params.validationMessage;
  } // Determine if the custom target element is valid


  if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) {
    warn('Target parameter is not valid, defaulting to "body"');
    params.target = 'body';
  } // Animation


  if (typeof params.animation === 'function') {
    params.animation = params.animation.call();
  }

  var popup;
  var oldPopup = getPopup();
  var targetElement = typeof params.target === 'string' ? document.querySelector(params.target) : params.target; // If the model target has changed, refresh the popup

  if (oldPopup && targetElement && oldPopup.parentNode !== targetElement.parentNode) {
    popup = init(params);
  } else {
    popup = oldPopup || init(params);
  } // Set popup width


  if (params.width) {
    popup.style.width = typeof params.width === 'number' ? params.width + 'px' : params.width;
  } // Set popup padding


  if (params.padding) {
    popup.style.padding = typeof params.padding === 'number' ? params.padding + 'px' : params.padding;
  } // Set popup background


  if (params.background) {
    popup.style.background = params.background;
  }

  var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color');
  var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix');

  for (var i = 0; i < successIconParts.length; i++) {
    successIconParts[i].style.backgroundColor = popupBackgroundColor;
  }

  var container = getContainer();
  var closeButton = getCloseButton();
  var footer = getFooter(); // Title

  renderTitle(params); // Content

  renderContent(params); // Backdrop

  if (typeof params.backdrop === 'string') {
    getContainer().style.background = params.backdrop;
  } else if (!params.backdrop) {
    addClass([document.documentElement, document.body], swalClasses['no-backdrop']);
  }

  if (!params.backdrop && params.allowOutsideClick) {
    warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');
  } // Position


  if (params.position in swalClasses) {
    addClass(container, swalClasses[params.position]);
  } else {
    warn('The "position" parameter is not valid, defaulting to "center"');
    addClass(container, swalClasses.center);
  } // Grow


  if (params.grow && typeof params.grow === 'string') {
    var growClass = 'grow-' + params.grow;

    if (growClass in swalClasses) {
      addClass(container, swalClasses[growClass]);
    }
  } // Close button


  if (params.showCloseButton) {
    closeButton.setAttribute('aria-label', params.closeButtonAriaLabel);
    show(closeButton);
  } else {
    hide(closeButton);
  } // Default Class


  popup.className = swalClasses.popup;

  if (params.toast) {
    addClass([document.documentElement, document.body], swalClasses['toast-shown']);
    addClass(popup, swalClasses.toast);
  } else {
    addClass(popup, swalClasses.modal);
  } // Custom Class


  if (params.customClass) {
    addClass(popup, params.customClass);
  } // Progress steps


  renderProgressSteps(params); // Icon

  renderIcon(params); // Image

  renderImage(params); // Actions (buttons)

  renderActions(params); // Footer

  parseHtmlToContainer(params.footer, footer); // CSS animation

  if (params.animation === true) {
    removeClass(popup, swalClasses.noanimation);
  } else {
    addClass(popup, swalClasses.noanimation);
  } // showLoaderOnConfirm && preConfirm


  if (params.showLoaderOnConfirm && !params.preConfirm) {
    warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request');
  }
}
428943
function onPopupRedirectAddCustomParam(event) {
  // Form container.
  var html = '<form class="customParamItem form form-bordered no-submit">';
  // OAuth parameter key input.
  html += '<input type="text" class="form-control customParamKey" ' +
      'placeholder="OAuth Parameter Key"/>';
  // OAuth parameter value input.
  html += '<input type="text" class="form-control customParamValue" ' +
      'placeholder="OAuth Parameter Value"/>';
  // Button to remove current key/value pair.
  html += '<button class="btn btn-block btn-primary">Remove</button>';
  html += '</form>';
  // Create jQuery node.
  var $node = $(html);
  // Add button click event listener to remove item.
  $node.find('button').on('click', function(e) {
    // Remove button click event listener.
    $(this).off('click');
    // Get row container and remove it.
    $(this).closest('form.customParamItem').remove();
    e.preventDefault();
  });
  // Append constructed row to parameter list container.
  $("#popup-redirect-custom-parameters").append($node);
}
244325
function(params, options) {
      var t = this;

      // If raw text was sent to the template, compile and return
      if (t.get('text')) {
        t.compile();
        return;
      }

      // Watch for changes in the text element
      t.on('change:text', t.compile, t);

      // Process a file template
      var path = t.get('path');
      if (path) {
        // Load the file
        if (t.asyncLoad) {
          FS.readFile(path, function(err, text) {
            if (err) {
              return console.error('Error reading file: ' + path, err);
            }
            t.set({text: text.toString()});
          });
        } else {
          t.set({text: FS.readFileSync(path).toString()});
        }

        // Watch the file for changes
        if (t.get('watchFile')) {
          t._watchFile();
        }
      }
    }
527225
function SettingsSelect( params, node ){
		makeLocalSelect(params);
		Select.apply(this, arguments);
		this.mylabel = lib.$(".setting-label", this.node); //$NON-NLS-0$
	}
719065
function CallTextAction(props) {
    var state = props.state, actions = props.actions, event = props.event, args = props.args, error = props.error;
    return (h("div", { class: "call-text-action" },
        error ? h("div", { class: "call-text-error" }, error) : h("div", null),
        h("button", { onclick: function () {
                actions.execute({
                    type: event.type,
                    name: event.name,
                    runId: state.selectedEvent.runId,
                    args: args
                });
            }, disabled: !!error }, "Execute")));
}
975192
function (params) {
		var pointerEventsSpec = params.pointerEventsSpec || "all", renderer = {};

		_jp.jsPlumbUIComponent.apply(this, params.originalArgs);
		this.canvas = null;
		this.path = null;
		this.svg = null;
		this.bgCanvas = null;

		var clazz = params.cssClass + " " + (params.originalArgs[0].cssClass || ""),
			svgParams = {
				"style": "",
				"width": 0,
				"height": 0,
				"pointer-events": pointerEventsSpec,
				"position": "absolute"
			};

		this.svg = _node("svg", svgParams);

		if (params.useDivWrapper) {
			this.canvas = jsPlumb.createElement("div", { position : "absolute" });
			_ju.sizeElement(this.canvas, 0, 0, 1, 1);
			this.canvas.className = clazz;
		}
		else {
			_attr(this.svg, { "class": clazz });
			this.canvas = this.svg;
		}

		params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);
		if (params.useDivWrapper) this.canvas.appendChild(this.svg);

		var displayElements = [ this.canvas ];
		this.getDisplayElements = function () {
			return displayElements;
		};

		this.appendDisplayElement = function (el) {
			displayElements.push(el);
		};

		this.paint = function (style, anchor, extents) {
			if (style != null) {

				var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;
				if (extents != null) {
					if (extents.xmin < 0) xy[0] += extents.xmin;
					if (extents.ymin < 0) xy[1] += extents.ymin;
					wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);
					wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);
				}

				if (params.useDivWrapper) {
					_ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);
					xy[0] = 0;
					xy[1] = 0;
					p = _pos([ 0, 0 ]);
				}
				else
					p = _pos([ xy[0], xy[1] ]);

				renderer.paint.apply(this, arguments);

				_attr(this.svg, {
					"style": p,
					"width": wh[0] || 0,
					"height": wh[1] || 0
				});
			}
		};

		return {
			renderer: renderer
		};
	}
226625
function () {
            /*  determine parameters  */
            var params = $cs.params("touch", arguments, {
                name: { pos: 0, req: true, valid: "string" }
            });

            /*  simply force value to same value in order to trigger event  */
            this.value({
                name:     params.name,
                value:    this.value(params.name),
                injected: true,
                force:    true
            });
        }
1348560
function(params){
        var allDataMatches = true;
        for(var k = 0; k < query[params.name].length; k++){
          var data = query[params.name][k];
          var operator = data.operator;
          var value = data.value;
          var field = data.field;
          var matches;
          
          if( operator != null && value != null ){
            
            var fieldVal = params.fieldValue(field);
            var fieldStr = !$$.is.string(fieldVal) && !$$.is.number(fieldVal) ? '' : '' + fieldVal;
            var valStr = '' + value;
            
            var caseInsensitive = false;
            if( operator.charAt(0) == '@' ){
              fieldStr = fieldStr.toLowerCase();
              valStr = valStr.toLowerCase();
              
              operator = operator.substring(1);
              caseInsensitive = true;
            }
            
            // if we're doing a case insensitive comparison, then we're using a STRING comparison
            // even if we're comparing numbers
            if( caseInsensitive ){
              value = valStr.toLowerCase();
              fieldVal = fieldStr.toLowerCase();
            }

            switch(operator){
            case '*=':
              matches = fieldStr.search(valStr) >= 0;
              break;
            case '$=':
              matches = new RegExp(valStr + '$').exec(fieldStr) != null;
              break;
            case '^=':
              matches = new RegExp('^' + valStr).exec(fieldStr) != null;
              break;
            case '=':
              matches = fieldVal === value;
              break;
            case '!=':
              matches = fieldVal !== value;
              break;
            case '>':
              matches = fieldVal > value;
              break;
            case '>=':
              matches = fieldVal >= value;
              break;
            case '<':
              matches = fieldVal < value;
              break;
            case '<=':
              matches = fieldVal <= value;
              break;
            default:
              matches = false;
              break;
              
            }
          } else if( operator != null ){
            switch(operator){
            case '?':
              matches = params.fieldTruthy(field);
              break;
            case '!':
              matches = !params.fieldTruthy(field);
              break;
            case '^':
              matches = params.fieldUndefined(field);
              break;
            }
          } else {   
            matches = !params.fieldUndefined(field);
          }
          
          if( !matches ){
            allDataMatches = false;
            break;
          }
        } // for
        
        return allDataMatches;
      }
1290542
function action_submit ($param = null)
  {
    if (!isset($this->model))
      throw new FlashMessageException('Can\'t insert/update a NULL model.', FlashType::ERROR);

    throw new FlashMessageException('Can\'t automatically insert/update an object of type ' . gettype ($this->model),
      FlashType::ERROR);
  }
37022
function(params) {
        var data = {
          type: params.type
        };

        if (params.trackerId) {
          data.trackerId = params.trackerId;
        }

        sendPingTimeout && clearTimeout(sendPingTimeout);
        sendPingTimeout = setTimeout(function() {
          ping();
        }, connectionCheckTimeout);

        try {
          if (params.content) {
            data.content = JSON.stringify(params.content);
          }

          if (socket.readyState === 1) {
            socket.send(JSON.stringify(data));
          }
        } catch (error) {
          eventCallback["customError"]({
            errorCode: 4004,
            errorMessage: "Error in Socket sendData!",
            errorEvent: error
          });
        }
      }
630402
function( params ){
      var defaults = { 
        field: 'data',
        event: 'data',
        triggerFnName: 'trigger',
        triggerEvent: false,
        immutableKeys: {} // key => true if immutable
      };
      params = $$.util.extend({}, defaults, params);

      return function removeDataImpl( names ){
        var p = params;
        var self = this;
        var selfIsArrayLike = self.length !== undefined;
        var all = selfIsArrayLike ? self : [self]; // put in array if not array-like
        var single = selfIsArrayLike ? self[0] : self;
        
        // .removeData('foo bar')
        if( $$.is.string(names) ){ // then get the list of keys, and delete them
          var keys = names.split(/\s+/);
          var l = keys.length;

          for( var i = 0; i < l; i++ ){ // delete each non-empty key
            var key = keys[i];
            if( $$.is.emptyString(key) ){ continue; }

            var valid = !p.immutableKeys[ key ]; // not valid if immutable
            if( valid ){
              for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
                delete all[ i_a ]._private[ p.field ][ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }

        // .removeData()
        } else if( names === undefined ){ // then delete all keys

          for( var i_a = 0, l_a = all.length; i_a < l_a; i_a++ ){
            var _privateFields = all[ i_a ]._private[ p.field ];
            
            for( var key in _privateFields ){
              var validKeyToDelete = !p.immutableKeys[ key ];

              if( validKeyToDelete ){
                delete _privateFields[ key ];
              }
            }
          }

          if( p.triggerEvent ){
            self[ p.triggerFnName ]( p.event );
          }
        }

        return self; // maintain chaining
      }; // function
    }
1222116
function(selector, params) {
      var t = this;
      UI.pauseTour();
      $(selector).css({display:'none'}).centerBox().css({top:40}).modal('show');
      setTimeout(function(){
        // $(selector).centerBox().css({top:40}).modal('show');
      }, 0);

      // Set the cursor when the dialog fades in
      setTimeout(function(){
        $(selector + ' input').first().focus();
      }, 500);
    }
219953
function (eventType, params) {
    params = params || {
        bubbles: false,
        cancelable: false,
        ctrlKey: false,
        altKey: false,
        shiftKey: false,
        metaKey: false
      };
    var mouseEvent = document.createEvent('MouseEvent');
    mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window, 0, 0, 0, 0, 0, params.ctrlKey, params.altKey, params.shiftKey, params.metaKey, 0, null);

    return mouseEvent;
  }
121366
function allowOptionalParams(params, callback) {
    if (!callback) {
        callback = params;
        params = { };
    }
    return {
        params: params,
        callback: callback,
    };
}
34380
function _setParams(params){

    if(params){

        // set the data collection params
        if(params.defaultEvents){

            for (let i = 0; i < params.defaultEvents.length; i++){

                dataCollector.configureEventCollection(
                    params.defaultEvents[i].name,
                    params.defaultEvents[i].status,
                    params.defaultEvents[i].timePeriod
                );

            }

        }

        // set the session Info
        if(params.sessionInfo){

            for(let i = 0; i < params.sessionInfo.length; i++){

                dataManager.addSessionExtra(
                    params.sessionInfo[i].key,
                    params.sessionInfo[i].value
                );

            }
            
        }

        // set pauseOnHeadsetRemove
        if('pauseOnHeadsetRemove' in params){

            timeManager.setRemoveHeadsetPausesPlay(!!params['pauseOnHeadsetRemove']);

        }

    }

}
1243268
public function previsualisationActualitePopup($params = array())
    {
        $html  = "";
        $html .= "<script  >";
        $html .= "titreBalisesAvant=\"<div align=center><h2>\";";
        $html .= "titreBalisesApres=\"</h2></div>\";";
        $html .= "sousTitreBalisesAvant=\"<div align=center><h3>\";";
        $html .= "sousTitreBalisesApres=\"</h3></div>\";";
        $html .= "document.write(titreBalisesAvant+parent.document.getElementById('titre').value+titreBalisesApres+'<br>');";
        $html .= "document.write(sousTitreBalisesAvant+parent.document.getElementById('sousTitre').value+sousTitreBalisesApres+'<br>');";
        $html .= "document.write(parent.document.getElementById('texte').value);";
        $html .= "</script>";
        return $html;
    }
294143
public RuleUpdate setParameters(Map<String, String> params) {
    checkCustomRule();
    this.parameters.clear();
    this.parameters.putAll(params);
    this.changeParameters = true;
    return this;
  }