Bind release form fields data from local storage on submit/resett form

@param String targetFormIdAndName	a form identifier consists of its id and name glued
@param Object fieldsToProtect		jQuery object contains form fields to protect

@return void
511405
function( targetFormIdAndName, fieldsToProtect ) {
					var released = false;
					var self = this;

					// Released form, are not started anymore. Fix for ajax loaded forms.
					params.started[ self.getInstanceIdentifier() ] = false;

					fieldsToProtect.each( function() {
						if ( $.inArray( this, self.options.excludeFields ) !== -1 ) {
							// Returning non-false is the same as a continue statement in a for loop; it will skip immediately to the next iteration.
							return true;
						}
						var field = $( this );
						var prefix = (self.options.locationBased ? self.href : "") + targetFormIdAndName + getElementIdentifier( field ) + self.options.customKeySuffix;
						self.browserStorage.remove( prefix );
						released = true;
					} );

					if ( released ) {
						self.options.onRelease.call( self );
					}
				}
911195
function( target, inst ) {
            var divSpan = $( target );
            if ( divSpan.hasClass( this.markerClassName ) ) {
                return;
            }
            divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
            $.data( target, "datepicker", inst );
            this._setDate( inst, this._getDefaultDate( inst ), true );
            this._updateDatepicker( inst );
            this._updateAlternate( inst );

            //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
            if ( inst.settings.disabled ) {
                this._disableDatepicker( target );
            }

            // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
            // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
            inst.dpDiv.css( "display", "block" );
        }
101639
public function onBind(FormEvent $event)
    {
        // BC prevention for class extending this one.
        if (self::class !== \get_called_class()) {
            @trigger_error(
                __METHOD__.' is deprecated since 2.3 and will be renamed in 4.0.'
                .' Use '.__CLASS__.'::onSubmit instead.',
                E_USER_DEPRECATED
            );
        }

        $this->onSubmit($event);
    }
298529
public static void populateForm(Form form, Object bean)
            throws IllegalAccessException, InvocationTargetException {

        // input tag
        try {
            for (Input input : form.getDescendants(Input.class)) {
                // name属性が指定されていない場合はスルーする。
                if (M2StringUtils.isBlank(input.getName())) {
                    continue;
                }

                switch (input.getType()) {
                case RADIO:
                    // radioは同じnameで複数個ありうるが、ひとつしか選択できない
                    String beanValue = BeanUtils.getProperty(bean,
                            input.getName());
                    if (input.getValue() != null
                            && input.getValue().equals(beanValue)) {
                        input.setChecked("checked");
                    } else {
                        input.setChecked(null);
                    }
                    break;
                case CHECKBOX:
                    // checkboxは同じnameで複数個ありうるし、複数選択できる
                    String[] beanValues = BeanUtils.getArrayProperty(bean,
                            input.getName());
                    boolean matchBean = false;
                    for (String value : beanValues) {
                        if (value.equals(input.getValue())) {
                            input.setChecked("checked");
                            matchBean = true;
                            continue;
                        }
                    }
                    // inputタグのvalueが、beanの配列の値のどれにもマッチしてない場合には
                    // チェックをはずす
                    if (!matchBean) {
                        input.setChecked(null);
                    }
                    break;
                default:
                    // radio,checkbox以外
                    input.setValue(BeanUtils.getProperty(bean, input.getName()));
                }
            }
        } catch (NoSuchMethodException e) {
            log.debug("bean property not found that match the input tag in form.");
        }

        // textarea
        try {
            for (Textarea textarea : form.getDescendants(Textarea.class)) {
                // name属性が指定されていない場合はスルーする。
                if (M2StringUtils.isBlank(textarea.getName())) {
                    continue;
                } else {
                    textarea.setContent(BeanUtils.getProperty(bean,
                            textarea.getName()));
                }
            }
        } catch (NoSuchMethodException e) {
            log.debug("bean property not found that match the textarea tag in form.");
        }

        // select
        try {
            for (Select select : form.getDescendants(Select.class)) {
                // name属性が指定されていない場合はスルーする。
                if (M2StringUtils.isBlank(select.getName())) {
                    continue;
                } else {
                    for (Option option : select.getDescendants(Option.class)) {
                        boolean matchBean = false;
                        for (String value : BeanUtils.getArrayProperty(bean,
                                select.getName())) {
                            if (value.equals(option.getValue())) {
                                option.setSelected("selected");
                                matchBean = true;
                            }
                        }
                        // optionタグのvalueが、beanの配列の値のどれにも
                        // マッチしてない場合にはチェックをはずす
                        if (!matchBean) {
                            option.setSelected(null);
                        }
                    }
                }
            }
        } catch (NoSuchMethodException e) {
            log.debug("bean property not found that match the option tag in select tag.");
        }
    }
999018
function (target, name, value) {
			var inst = this._getInst(target);
			if (!inst) {
				return FALSE;
			}
			//TODO check name
			inst[name] = value;
			$.data(target, PROP_NAME, inst);
		}
846971
function(target, propertyName, eventName) {
		var self = this,
			handler;


		// This is objects that can be bound to with can.bind.
		handler = function () {
			self.updater(self._get(), self.value);
		};
		this._get = function() {
			return getObject(target, propertyName);
		};
		this._set = function(value) {
			// allow setting properties n levels deep, if separated with dot syntax
			var properties = propertyName.split("."),
				leafPropertyName = properties.pop();

			if(properties.length) {
				var targetProperty = getObject(target, properties.join('.'));
				targetProperty[leafPropertyName] = value;
			} else {
				target[propertyName] = value;
			}
		};

		this._on = function(update) {
			eventQueue.on.call(target, eventName || propertyName, handler);
			// Set the cached value
			this.value = this._get();
		};
		this._off = function() {
			return eventQueue.off.call( target, eventName || propertyName, handler);
		};
	}
1166645
function attributable(form, c, name) {
  if (form._vals == null)
    form._vals = {};
  if (form._update == null)
    form._update = function () {
      for (var p in form._vals)
        form._vals[p].data == form._data[p];
    }
  form._vals[name] = c;
  c.on('change', function () {
    form._data[name] = c.data;
    form.emit('change');
  });
}
288267
public function MoodleQuickForm($formName, $method, $action, $target='', $attributes=null) {
        debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
        self::__construct($formName, $method, $action, $target, $attributes);
    }
254312
public void updateTarget() {
        /* save updated entity */
        final Target target = targetManagement.update(entityFactory.target().update(controllerId)
                .name(nameTextField.getValue()).description(descTextArea.getValue()));
        /* display success msg */
        uINotification.displaySuccess(i18n.getMessage("message.update.success", target.getName()));
        // publishing through event bus
        eventBus.publish(this, new TargetTableEvent(BaseEntityEventType.UPDATED_ENTITY, target));
    }
119590
function popinClose(name) {
            var id = null, $el = null;
            if ( typeof(name) == 'string' && name != '' ) {
                if (name !== $popin.name)
                    throw new Error('Popin `'+name+'` not found !');
            }
            // by default
            id = $popin.id;

            $el = $popin.target;

            if ( $el != null && /gina-popin-is-active/.test($el.className) ) {
                instance.target.firstChild.className  = instance.target.firstChild.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/, '');
                $el.className           = $el.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/, '');
                $el.innerHTML = '';

                // removing from FormValidator instance
                var i = 0, formsLength = $popin['$forms'].length;
                if ($validator['$forms'] && formsLength > 0) {
                    for (; i < formsLength; ++i) {
                        if ( typeof($validator['$forms'][ $popin['$forms'][i] ]) != 'undefined' )
                            $validator['$forms'][ $popin['$forms'][i] ].destroy();

                        $popin['$forms'].splice( i, 1);
                    }
                }
                // remove listeners
                removeListener(gina, $popin.target, 'loaded.' + $popin.id);




                $popin.isOpen = false;

                // restore toolbar
                if ( gina && typeof(window.ginaToolbar) == "object" )
                    ginaToolbar.restore();

                triggerEvent(gina, $popin.target, 'close.'+ id, $popin);
            }
        }
1074923
protected void addFormParam(Form formData, String name, Object value) throws IllegalArgumentException {
        addFormParam(formData, name, value, false);
    }
1128844
function isFieldStillValidTarget(fieldOrPageIdToCheck, pages, cb) {
      var fieldExistsInForm = false;
      var invalidPages = _.filter(pages, function(page) {
        var currentPageId = page._id.toString();

        if (currentPageId === fieldOrPageIdToCheck) {
          fieldExistsInForm = true;
        }
        var invalidFieldList = _.filter(page.fields, function(field) {
          var currentFieldId = field._id.toString();
          if (currentFieldId === fieldOrPageIdToCheck) {
            //Current field exists
            fieldExistsInForm = true;

            //Field is admin only, therefore it is an invalid target for a rule.
            if (field.adminOnly) {
              return true;
            } else {
              return false;
            }
          } else {
            return false;
          }
        });

        //If the invalidFieldList is > 0, it means that one of the fields was invalid.
        return invalidFieldList.length > 0;
      });

      var invalidField = invalidPages.length > 0;

      //Invalid if either the field is invalid, or it does not exist in the form.
      if (invalidField === true || !fieldExistsInForm) {
        return cb(true);
      } else {
        return cb();
      }
    }
568923
function(record,target){
		var targetNode = target.childNodes[0];
		
		// Only if the row has an id && isn't already being removed
		if( !lang.isUndefined(record.getData('id')) && this.deleteLinkNode != targetNode ){

         if (confirm(inputEx.messages.confirmDeletion)) {
				this.deleteLinkNode = targetNode;		
				this.deleteLinkNode.innerHTML = '';
				Dom.addClass(this.deleteLinkNode,'inputEx-dtInPlaceEdit-deleteLinkSpinner');
				this.itemRemovedEvt.fire( record );            
         }
		}
	}
146573
public function postSetData(FormEvent $event)
    {
        $collection = $event->getData();
        $form = $event->getForm();

        if ($collection instanceof PersistentCollection){
            foreach ($collection as $key => $file){
                if ($file instanceof MultiFileInterface){
                    try {
                        $this->fileManager->copyFileToTemporaryDirectory($file);
                    } catch (\Gaufrette\Exception\FileNotFound $e) {
                        $form->remove($key);
                        $collection->removeElement($file);
                    }
                }
            }
        }
    }
354150
function(target, inst) {
		var divSpan = $(target);
		if (divSpan.hasClass(this.markerClassName))
			return;
		divSpan.addClass(this.markerClassName).append(inst.dpDiv).
			bind("setData.datepicker", function(event, key, value){
				inst.settings[key] = value;
			}).bind("getData.datepicker", function(event, key){
				return this._get(inst, key);
			});
		$.data(target, PROP_NAME, inst);
		this._setDate(inst, this._getDefaultDate(inst), true);
		this._updateDatepicker(inst);
		this._updateAlternate(inst);
		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
		if( inst.settings.disabled ) {
			this._disableDatepicker( target );
		}
		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
		inst.dpDiv.css( "display", "block" );
	}
834501
function (tooltip, target) {
            if (!(tooltip instanceof Tooltip)) {
                tooltip = this.getTooltipByNameAndTarget(tooltip, target);
            }
            if (tooltip) {
                var i = this.$tooltips.indexOf(tooltip);
                this.$tooltips.splice(i, 1);
                this.$container.removeChild(tooltip);
            }
        }
142040
function bindData(target, key, selector) {
    return state_1.State.select(selector).subscribe(function (args) {
        if (typeof target.setState === 'function') {
            var state = {};
            state[key] = args;
            target.setState(state);
        }
        if (typeof target[key] === 'function')
            return target[key].call(target, args);
        target[key] = args;
    });
}