Resets DropdownCellEditor UI to initial state.

@method resetForm
16676
function() {
    var allOptions = this.dropdown.options,
        i=0, j=allOptions.length;

    // Look for multi-select selections
    if(lang.isArray(this.value)) {
        var allValues = this.value,
            m=0, n=allValues.length,
            hash = {};
        // Reset all selections and stash options in a value hash
        for(; i<j; i++) {
            allOptions[i].selected = false;
            hash[allOptions[i].value] = allOptions[i];
        }
        for(; m<n; m++) {
            if(hash[allValues[m]]) {
                hash[allValues[m]].selected = true;
            }
        }
    }
    // Only need to look for a single selection
    else {
        for(; i<j; i++) {
            if(this.value === allOptions[i].value) {
                allOptions[i].selected = true;
            }
        }
    }
}
1319135
function() {
			var children = this.parent.children,
				index = CKEDITOR.tools.indexOf( children, this ),
				previous = this.previous,
				next = this.next;

			previous && ( previous.next = next );
			next && ( next.previous = previous );
			children.splice( index, 1 );
			this.parent = null;
		}
248840
function() {
      var t = this,
          val = t.editor.val();
      if (val) {
       try {
          // Throw away parse errors while typing
          t.model.set(JSON.parse(val));
        } catch (e) {
          return false;
        }
      } else {
        // Confirm deletion if user removes everything in the JSON window
        if (t.deletePage()) {
         return false;
        } else {
          // Reset source data
          t.fillSourceData();
        }
      }
      return true;
    }
788423
function() {

                    // Used to make sure the dropdown becomes focused (fixes IE issue)
                    self.dropdown.trigger("focus", true);

                    // The `click` handler logic will only be applied if the dropdown list is enabled
                    if (!self.originalElem.disabled) {

                        // Triggers the `click` event on the original select box
                        self.triggerEvent("click");

                        if(!nativeMousedown && !customShowHideEvent) {

                            self.toggle();

                        }

                    }

                }
189242
private void resetComponents() {
        defineGroupsLayout.resetComponents();
        editRolloutEnabled = false;
        rolloutName.clear();
        targetFilterQuery.clear();
        resetFields();
        enableFields();
        populateDistributionSet();
        populateTargetFilterQuery();
        setDefaultSaveStartGroupOption();
        groupsLegendLayout.reset();
        groupSizeLabel.setVisible(false);
        noOfGroups.setVisible(true);
        removeComponent(1, 2);
        addComponent(targetFilterQueryCombo, 1, 2);
        addGroupsLegendLayout();
        addGroupsDefinitionTabs();

        actionTypeOptionGroupLayout.selectDefaultOption();
        autoStartOptionGroupLayout.selectDefaultOption();
        totalTargetsCount = 0L;
        rollout = null;
        groupsDefinitionTabs.setVisible(true);
        groupsDefinitionTabs.setSelectedTab(0);

        approvalLabel.setVisible(false);
        approvalButtonsLayout.setVisible(false);
        approveButtonsGroup.clear();
        approvalRemarkField.clear();
        approveButtonsGroup.removeAllValidators();
    }
43127
final function onFormInitialized() {
		parent::onFormInitialized();
		$this->addClass('df-google-font');
		df_fe_init($this, __CLASS__, df_asset_third_party('Select2/main.css'), [
			'dataSource' => df_url_frontend('df-google-font')
			,'value' => $this['value'] // 2015-12-07 It is the selected value.
		]);
	}
158986
function () {
        var self = this, settings = self.settings, id = self.id, suffix = self.suffix;

        function readyHandler() {
          DOM.unbind(window, 'ready', readyHandler);
          self.render();
        }

        // Page is not loaded yet, wait for it
        if (!Event.domLoaded) {
          DOM.bind(window, 'ready', readyHandler);
          return;
        }

        // Element not found, then skip initialization
        if (!self.getElement()) {
          return;
        }

        // No editable support old iOS versions etc
        if (!Env.contentEditable) {
          return;
        }

        // Hide target element early to prevent content flashing
        if (!settings.inline) {
          self.orgVisibility = self.getElement().style.visibility;
          self.getElement().style.visibility = 'hidden';
        } else {
          self.inline = true;
        }

        var form = self.getElement().form || DOM.getParent(id, 'form');
        if (form) {
          self.formElement = form;

          // Add hidden input for non input elements inside form elements
          if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) {
            DOM.insertAfter(DOM.create('input', { type: 'hidden', name: id }), id);
            self.hasHiddenInput = true;
          }

          // Pass submit/reset from form to editor instance
          self.formEventDelegate = function (e) {
            self.fire(e.type, e);
          };

          DOM.bind(form, 'submit reset', self.formEventDelegate);

          // Reset contents in editor when the form is reset
          self.on('reset', function () {
            self.setContent(self.startContent, { format: 'raw' });
          });

          // Check page uses id="submit" or name="submit" for it's submit button
          if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
            form._mceOldSubmit = form.submit;
            form.submit = function () {
              self.editorManager.triggerSave();
              self.setDirty(false);

              return form._mceOldSubmit(form);
            };
          }
        }

        /**
         * Window manager reference, use this to open new windows and dialogs.
         *
         * @property windowManager
         * @type tinymce.WindowManager
         * @example
         * // Shows an alert message
         * tinymce.activeEditor.windowManager.alert('Hello world!');
         *
         * // Opens a new dialog with the file.htm file and the size 320x240
         * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
         * tinymce.activeEditor.windowManager.open({
         *    url: 'file.htm',
         *    width: 320,
         *    height: 240
         * }, {
         *    custom_param: 1
         * });
         */
        self.windowManager = new WindowManager(self);

        /**
         * Notification manager reference, use this to open new windows and dialogs.
         *
         * @property notificationManager
         * @type tinymce.NotificationManager
         * @example
         * // Shows a notification info message.
         * tinymce.activeEditor.notificationManager.open({text: 'Hello world!', type: 'info'});
         */
        self.notificationManager = new NotificationManager(self);

        if (settings.encoding == 'xml') {
          self.on('GetContent', function (e) {
            if (e.save) {
              e.content = DOM.encode(e.content);
            }
          });
        }

        if (settings.add_form_submit_trigger) {
          self.on('submit', function () {
            if (self.initialized) {
              self.save();
            }
          });
        }

        if (settings.add_unload_trigger) {
          self._beforeUnload = function () {
            if (self.initialized && !self.destroyed && !self.isHidden()) {
              self.save({ format: 'raw', no_events: true, set_dirty: false });
            }
          };

          self.editorManager.on('BeforeUnload', self._beforeUnload);
        }

        // Load scripts
        function loadScripts() {
          var scriptLoader = ScriptLoader.ScriptLoader;

          if (settings.language && settings.language != 'en' && !settings.language_url) {
            settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js';
          }

          if (settings.language_url) {
            scriptLoader.add(settings.language_url);
          }

          if (settings.theme && typeof settings.theme != "function" &&
            settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) {
            var themeUrl = settings.theme_url;

            if (themeUrl) {
              themeUrl = self.documentBaseURI.toAbsolute(themeUrl);
            } else {
              themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js';
            }

            ThemeManager.load(settings.theme, themeUrl);
          }

          if (Tools.isArray(settings.plugins)) {
            settings.plugins = settings.plugins.join(' ');
          }

          each(settings.external_plugins, function (url, name) {
            PluginManager.load(name, url);
            settings.plugins += ' ' + name;
          });

          each(settings.plugins.split(/[ ,]/), function (plugin) {
            plugin = trim(plugin);

            if (plugin && !PluginManager.urls[plugin]) {
              if (plugin.charAt(0) == '-') {
                plugin = plugin.substr(1, plugin.length);

                var dependencies = PluginManager.dependencies(plugin);

                each(dependencies, function (dep) {
                  var defaultSettings = {
                    prefix: 'plugins/',
                    resource: dep,
                    suffix: '/plugin' + suffix + '.js'
                  };

                  dep = PluginManager.createUrl(defaultSettings, dep);
                  PluginManager.load(dep.resource, dep);
                });
              } else {
                PluginManager.load(plugin, {
                  prefix: 'plugins/',
                  resource: plugin,
                  suffix: '/plugin' + suffix + '.js'
                });
              }
            }
          });

          scriptLoader.loadQueue(function () {
            if (!self.removed) {
              self.init();
            }
          }, self, function (urls) {
            ErrorReporter.pluginLoadError(self, urls[0]);

            if (!self.removed) {
              self.init();
            }
          });
        }

        self.editorManager.add(self);
        loadScripts();
      }
1210451
def reset_placeholder_dropdown(cls, input_el):
        
        text = cls.get_placeholder_text(input_el)
        cls.set_placeholder_text(
            input_el=input_el,
            text=text.replace(cls._dropdown_text, "")
        )
1186128
function() {
			var key, fn, callbacks = {
				'initialize'      : 'onInitialize',
				'change'          : 'onChange',
				'item_add'        : 'onItemAdd',
				'item_remove'     : 'onItemRemove',
				'clear'           : 'onClear',
				'option_add'      : 'onOptionAdd',
				'option_remove'   : 'onOptionRemove',
				'option_clear'    : 'onOptionClear',
				'optgroup_add'    : 'onOptionGroupAdd',
				'optgroup_remove' : 'onOptionGroupRemove',
				'optgroup_clear'  : 'onOptionGroupClear',
				'dropdown_open'   : 'onDropdownOpen',
				'dropdown_close'  : 'onDropdownClose',
				'type'            : 'onType',
				'load'            : 'onLoad',
				'focus'           : 'onFocus',
				'blur'            : 'onBlur'
			};
	
			for (key in callbacks) {
				if (callbacks.hasOwnProperty(key)) {
					fn = this.settings[callbacks[key]];
					if (fn) this.on(key, fn);
				}
			}
		}
734556
function destroy() {

            resetErrors();
            node.find('[' + _data.validation + '],[' + _data.regex + ']').off(delegateSuffix + ' ' + resetSuffix);

            node.find(options.submit.settings.button).off(delegateSuffix).on('click' + delegateSuffix, function () {
                $(this).closest('form')[0].submit();
            });

            //delete window.Validation.form[node.selector];

            return true;

        }
1092438
function() {
      var self = this;
      // Start by removing all old bindings and falling back to the initialized binding contents
      this.bindings = _.extend({}, this._bindings);

      // Stickit model two-way bindings
      _.each(this.$('[data-model]'), function(element) {
        var attr = $(element).data('model'),
            options = self.__getFieldOptions(attr),
            fieldBinding = self.__generateModelFieldBinding(attr, options);

        //add select options
        if ($(element).is('select')) {
          fieldBinding.selectOptions = self.__generateSelectOptions(element, options);
        }

        self.bindings['[data-model="' + attr + '"]'] = fieldBinding;
      });
    }
705592
function () {
      var drag, select, start, end;

      autofill.handle.isDragged = 0;

      drag = autofill.fillBorder.corners;
      if (!drag) {
        return;
      }

      autofill.fillBorder.disappear();

      if (selection.isMultiple()) {
        select = priv.selectionBorder.corners;
      }
      else {
        select = priv.currentBorder.corners;
      }

      if (drag.TL.row === select.TL.row && drag.TL.col < select.TL.col) {
        start = drag.TL;
        end = {
          row: drag.BR.row,
          col: select.TL.col - 1
        };
      }
      else if (drag.TL.row === select.TL.row && drag.BR.col > select.BR.col) {
        start = {
          row: drag.TL.row,
          col: select.BR.col + 1
        };
        end = drag.BR;
      }
      else if (drag.TL.row < select.TL.row && drag.TL.col === select.TL.col) {
        start = drag.TL;
        end = {
          row: select.TL.row - 1,
          col: drag.BR.col
        };
      }
      else if (drag.BR.row > select.BR.row && drag.TL.col === select.TL.col) {
        start = {
          row: select.BR.row + 1,
          col: drag.TL.col
        };
        end = drag.BR;
      }

      if (start) {
        grid.populateFromArray(start, SheetClip.parse(priv.editProxy.val()), end, 'autofill');

        selection.setRangeStart(self.view.getCellAtCoords(drag.TL));
        selection.setRangeEnd(self.view.getCellAtCoords(drag.BR));
      }
      else {
        //reset to avoid some range bug
        selection.refreshBorders();
      }
    }
164502
function() {

            Dialog.superclass.setFirstLastFocusable.call(this);

            var i, l, el, elements = this.focusableElements;

            this.firstFormElement = null;
            this.lastFormElement = null;

            if (this.form && elements && elements.length > 0) {
                l = elements.length;

                for (i = 0; i < l; ++i) {
                    el = elements[i];
                    if (this.form === el.form) {
                        this.firstFormElement = el;
                        break;
                    }
                }

                for (i = l-1; i >= 0; --i) {
                    el = elements[i];
                    if (this.form === el.form) {
                        this.lastFormElement = el;
                        break;
                    }
                }
            }
        }
498024
function (event) {
            var domUtil = ariaUtilsDom;

            var inputField = this.getTextInputField();
            var inputFieldValue = inputField.value;
            var inputFieldIsEmpty = (ariaUtilsString.trim(inputFieldValue) === "");

            switch (event.keyCode) {

                case event.KC_ARROW_LEFT :
                    if (this.hasInsertedOptions()) {

                        if (this.isInputFieldFocused()) {
                            var position = ariaUtilsCaret.getPosition(inputField);
                            if (position.start === 0 && position.end === 0) {
                                event.preventDefault();

                                // Close the dropdown in order not to mess with focus events and so on
                                this._closeDropdown();

                                // Highlight last option
                                this.highlightOption(this.insertedOptionsCount());
                                break;
                            }
                        }

                        if (this.isInHighlightedMode()) {
                            event.preventDefault();

                            this.__navigateLeftInHighlightedMode();
                            break;
                        }
                    }

                    break;

                case event.KC_ARROW_RIGHT :
                    if (this.isInHighlightedMode()) {
                        event.preventDefault();

                        this.__navigateRightInHighlightedMode();
                    }

                    break;

                case event.KC_TAB :
                    if (this.isInputFieldFocused()) {
                        if (inputFieldIsEmpty) {
                            if (inputField.nextSibling != null) {
                                event.preventDefault();

                                this._makeInputFieldLastChild();
                                this.setHelpText(false);
                                inputField.focus();
                            }
                        }
                    }

                    break;

                case event.KC_BACKSPACE :
                    if (inputFieldIsEmpty) {
                        var highlightedElementIndex = this.getHighlightedOptionIndex();
                        var highlightedElement = this.getHighlightedOption();

                        if (highlightedElement) {
                            var highlightedElementLabel = highlightedElement.textContent
                                    || highlightedElement.innerText;
                            domUtil.removeElement(highlightedElement);

                            var newIndex = highlightedElementIndex - 1;
                            if (newIndex >= 1) {
                                this.highlightOption(newIndex);
                            } else {
                                if (this.insertedOptionsCount() > 0) {
                                    this.highlightOption(1);
                                } else {
                                    this._enterInputField();
                                }
                            }

                            this._removeValue(highlightedElementLabel);
                        } else {
                            var previousSiblingElement = domUtil.getPreviousSiblingElement(inputField);
                            if (previousSiblingElement) {
                                var previousSiblingLabel = previousSiblingElement.firstChild.textContent
                                        || previousSiblingElement.firstChild.innerText;
                                domUtil.removeElement(previousSiblingElement);
                                this._removeValue(previousSiblingLabel);
                            }
                        }
                        event.preventDefault();
                    }

                    break;

                case event.KC_DELETE :
                    if (inputFieldIsEmpty) {
                        var highlightedElementIndex = this.getHighlightedOptionIndex();
                        var highlightedElement = this.getHighlightedOption();

                        if (highlightedElement) {
                            var highlightedElementLabel = highlightedElement.textContent
                                    || highlightedElement.innerText;
                            domUtil.removeElement(highlightedElement);

                            if (highlightedElementIndex <= this.insertedOptionsCount()) {
                                this.highlightOption(highlightedElementIndex);
                            } else {
                                this._enterInputField();
                            }

                            this._removeValue(highlightedElementLabel);
                        }
                    }

                    break;
            }

            if (this.isInputFieldFocused()) {
                this.$AutoComplete._dom_onkeydown.call(this, event);
            }
        }
1139658
function() {
            var cid = this.containerId,
                scroll = "scroll." + cid,
                resize = "resize."+cid,
                orient = "orientationchange."+cid,
                mask, maskCss;

            this.container.addClass("select2-dropdown-open").addClass("select2-container-active");

            this.clearDropdownAlignmentPreference();

            if(this.dropdown[0] !== this.body().children().last()[0]) {
                this.dropdown.detach().appendTo(this.body());
            }

            // create the dropdown mask if doesnt already exist
            mask = $("#select2-drop-mask");
            if (mask.length == 0) {
                mask = $(document.createElement("div"));
                mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");
                mask.hide();
                mask.appendTo(this.body());
                mask.on("mousedown touchstart click", function (e) {
                    var dropdown = $("#select2-drop"), self;
                    if (dropdown.length > 0) {
                        self=dropdown.data("select2");
                        if (self.opts.selectOnBlur) {
                            self.selectHighlighted({noFocus: true});
                        }
                        self.close({focus:false});
                        e.preventDefault();
                        e.stopPropagation();
                    }
                });
            }

            // ensure the mask is always right before the dropdown
            if (this.dropdown.prev()[0] !== mask[0]) {
                this.dropdown.before(mask);
            }

            // move the global id to the correct dropdown
            $("#select2-drop").removeAttr("id");
            this.dropdown.attr("id", "select2-drop");

            // show the elements
            mask.show();

            this.positionDropdown();
            this.dropdown.show();
            this.positionDropdown();

            this.dropdown.addClass("select2-drop-active");

            // attach listeners to events that can change the position of the container and thus require
            // the position of the dropdown to be updated as well so it does not come unglued from the container
            var that = this;
            this.container.parents().add(window).each(function () {
                $(this).on(resize+" "+scroll+" "+orient, function (e) {
                    that.positionDropdown();
                });
            });


        }
169479
function() {
    // Attach Cell Editor container element as first child of body
    var elCellEditor = document.createElement("div");
    elCellEditor.id = this._sId + "-celleditor";
    elCellEditor.style.display = "none";
    elCellEditor.tabIndex = 0;
    Dom.addClass(elCellEditor, DT.CLASS_EDITOR);
    var elFirstChild = Dom.getFirstChild(document.body);
    if(elFirstChild) {
        elCellEditor = Dom.insertBefore(elCellEditor, elFirstChild);
    }
    else {
        elCellEditor = document.body.appendChild(elCellEditor);
    }
    
    // Internal tracker of Cell Editor values
    var oCellEditor = {};
    oCellEditor.container = elCellEditor;
    oCellEditor.value = null;
    oCellEditor.isActive = false;
    this._oCellEditor = oCellEditor;
}
543493
function cleanupDropdown() {
        $("html").off("click", closeDropdown);
        $("#project-files-container").off("scroll", closeDropdown);
        $("#titlebar .nav").off("click", closeDropdown);
        $dropdown = null;

        MainViewManager.focusActivePane();

        $(window).off("keydown", keydownHook);
    }