Setups the file element.  @param {CKEDITOR.ui.dialog.file} fileInput The file element used during file upload. @param {Object} filebrowser Object containing filebrowser settings assigned to the fileButton associated with this file element.
336875
function setupFileElement( editor, fileInput, filebrowser ) {
		var params = filebrowser.params || {};
		params.CKEditor = editor.name;
		params.CKEditorFuncNum = editor._.filebrowserFn;
		if ( !params.langCode )
			params.langCode = editor.langCode;

		fileInput.action = addQueryString( filebrowser.url, params );
		fileInput.filebrowser = filebrowser;
	}
614303
function () {
        var self = this;

        var input = DomUtils.create('input', {
          type: 'file',
          id: self._id + '-browse',
          accept: self.settings.accept
        });

        self._super();

        $(input).on('change', function (e) {
          var files = e.target.files;

          self.value = function () {
            if (!files.length) {
              return null;
            } else if (self.settings.multiple) {
              return files;
            } else {
              return files[0];
            }
          };

          e.preventDefault();

          if (files.length) {
            self.fire('change', e);
          }
        });

        // ui.Button prevents default on click, so we shouldn't let the click to propagate up to it
        $(input).on('click', function (e) {
          e.stopPropagation();
        });

        $(self.getEl('button')).on('click', function (e) {
          e.stopPropagation();
          input.click();
        });

        // in newer browsers input doesn't have to be attached to dom to trigger browser dialog
        // however older IE11 (< 11.1358.14393.0) still requires this
        self.getEl().appendChild(input);
      }
1037493
function _fnFeatureHtmlFilter ( oSettings )
		{
			var oPreviousSearch = oSettings.oPreviousSearch;
			
			var sSearchStr = oSettings.oLanguage.sSearch;
			sSearchStr = (sSearchStr.indexOf('_INPUT_') !== -1) ?
			  sSearchStr.replace('_INPUT_', '<input type="text" />') :
			  sSearchStr==="" ? '<input type="text" />' : sSearchStr+' <input type="text" />';
			
			var nFilter = document.createElement( 'div' );
			nFilter.className = oSettings.oClasses.sFilter;
			nFilter.innerHTML = '<label>'+sSearchStr+'</label>';
			if ( !oSettings.aanFeatures.f )
			{
				nFilter.id = oSettings.sTableId+'_filter';
			}
			
			var jqFilter = $('input[type="text"]', nFilter);
		
			// Store a reference to the input element, so other input elements could be
			// added to the filter wrapper if needed (submit button for example)
			nFilter._DT_Input = jqFilter[0];
		
			jqFilter.val( oPreviousSearch.sSearch.replace('"','&quot;') );
			jqFilter.bind( 'keyup.DT', function(e) {
				/* Update all other filter input elements for the new display */
				var n = oSettings.aanFeatures.f;
				var val = this.value==="" ? "" : this.value; // mental IE8 fix :-(
		
				for ( var i=0, iLen=n.length ; i<iLen ; i++ )
				{
					if ( n[i] != $(this).parents('div.dataTables_filter')[0] )
					{
						$(n[i]._DT_Input).val( val );
					}
				}
				
				/* Now do the filter */
				if ( val != oPreviousSearch.sSearch )
				{
					_fnFilterComplete( oSettings, { 
						"sSearch": val, 
						"bRegex": oPreviousSearch.bRegex,
						"bSmart": oPreviousSearch.bSmart ,
						"bCaseInsensitive": oPreviousSearch.bCaseInsensitive 
					} );
				}
			} );
		
			jqFilter
				.attr('aria-controls', oSettings.sTableId)
				.bind( 'keypress.DT', function(e) {
					/* Prevent form submission */
					if ( e.keyCode == 13 )
					{
						return false;
					}
				}
			);
			
			return nFilter;
		}
973772
private void openUploadWithFiles(JavaScriptObject files) {

        JsArray<CmsFileInfo> cmsFiles = files.cast();
        List<CmsFileInfo> fileObjects = new ArrayList<CmsFileInfo>();
        for (int i = 0; i < cmsFiles.length(); ++i) {
            fileObjects.add(cmsFiles.get(i));
        }
        CmsDialogUploadButtonHandler buttonHandler = new CmsDialogUploadButtonHandler(
            new Supplier<I_CmsUploadContext>() {

                /**
                 * @see com.google.common.base.Supplier#get()
                 */
                public I_CmsUploadContext get() {

                    return new I_CmsUploadContext() {

                        public void onUploadFinished(List<String> uploadedFiles) {

                            uploadFinished(uploadedFiles);
                        }

                    };
                }
            });
        buttonHandler.setIsTargetRootPath(true);
        buttonHandler.setTargetFolder(getState().getTargetFolderRootPath());
        buttonHandler.openDialogWithFiles(fileObjects);
    }
779666
public void setFile(File file) throws FileNotFoundException{
		this.setInputStream(new BufferedInputStream(new FileInputStream(file)), file.length());
		this.isUploadFile = true;
	}
1054526
function(options) {
		inputEx.FileField.superclass.setOptions.call(this, options);
		this.options.size = options.size;
		this.options.accept = options.accept;
	}
3743
protected function initEditor(): void
    {
        $view = $this->getView();

        CKEditorAsset::register($view);
        CKEditorAssetAddition::register($view);

        $id = $this->options['id'];

        $clientOptions = !empty($this->clientOptions) ? Json::encode($this->clientOptions) : '{}';

        $js = [];

        $js[] = "CKEDITOR.replace('$id', $clientOptions);";
        $js[] = "initItstructureOnChangeHandler('$id');";

        if (array_key_exists('filebrowserUploadUrl', $this->clientOptions) ||
            array_key_exists('filebrowserImageUploadUrl', $this->clientOptions)) {
            $js[] = "initItstructureCsrfHandler();";
        }

        $view->registerJs(implode("\n", $js));
    }
1305100
function(id) {
            // If the edit filename feature is enabled, mark the filename element as "editable" and the associated edit icon
            if (this._isEditFilenameEnabled()) {
                this._templating.markFilenameEditable(id);
                this._templating.showEditIcon(id);

                // If the focusin event is not supported, we must add a focus handler to the newly create edit filename text input
                if (!this._focusinEventSupported) {
                    this._filenameInputFocusHandler.addHandler(this._templating.getEditInput(id));
                }
            }
        }
477413
public void setInput(INDArray input) {
        this.input = input;
        if (this.layers == null) {
            init();
        }
        if (input != null) {
            if (input.length() == 0)
                throw new IllegalArgumentException(
                        "Invalid input: length 0 (shape: " + Arrays.toString(input.shape()) + ")");

            // FIXME: int cast
            setInputMiniBatchSize((int) input.size(0));
        }
    }
234786
function clearInputFile(f){
    if(f.value){
        try{
            f.value = ''; //for IE11, latest Chrome/Firefox/Opera...
        }catch(err){ }
        if(f.value){ //for IE5 ~ IE10
            var form = document.createElement('form'),
                parentNode = f.parentNode, ref = f.nextSibling;
            form.appendChild(f);
            form.reset();
            parentNode.insertBefore(f,ref);
        }
    }
}
1227265
public void setFile(Element el, String key, File value) {
	setFile(el, key, ResourceUtil.toResource(value));
    }
69999
function(selector, filename, done) {
    this.debug('Upload ' + filename + ' to ' + selector);
    getPage(function(page) {
      page.uploadFile(selector, filename, done);
    });
      done();
  }
140715
function setupFields() {
			this.foreach( function( field ) {
				// Exclude layout container elements
				if ( /^(?!vbox|hbox)/.test( field.type ) ) {
					if ( !field.setup ) {
						// Read the dialog fields values from the specified
						// element attributes.
						field.setup = function( element ) {
							field.setValue( element.getAttribute( field.id ) || '', 1 );
						};
					}
					if ( !field.commit ) {
						// Set element attributes assigned by the dialog
						// fields.
						field.commit = function( element ) {
							var fieldValue = this.getValue();
							// ignore default element attribute values
							if ( 'dir' == field.id && element.getComputedStyle( 'direction' ) == fieldValue )
								return;

							if ( fieldValue )
								element.setAttribute( field.id, fieldValue );
							else
								element.removeAttribute( field.id );
						};
					}
				}
			} );
		}
1046508
public function init() {
		$htmlId = $this->fileUploadControl->getHtmlId();
		
		foreach($this->elements as $type => $value) {
			if($type == "input") {
				$element = Html::el("input type='file' multiple='multiple'")->addAttributes([
					"id" => $htmlId,
					"name" => $this->fileUploadControl->getHtmlName(),
					"data-upload-component" => $htmlId
				]);
			} else if($type == "delete") {
				$element = Html::el("button type='button'")->addAttributes([
					"data-upload-component" => sprintf($this->idTemplate, $htmlId, $type)
				]);
			} else if($type == "imagePreview") {
				$element = Html::el("img")->addAttributes([
					"data-upload-component" => sprintf($this->idTemplate, $htmlId, $type)
				]);
			} else {
				$element = Html::el("div")->addAttributes([
					"data-upload-component" => sprintf($this->idTemplate, $htmlId, $type)
				]);
			}
			
			$this->elements[ $type ] = $element;
		}
	}
1300557
async function init({ options = { config: {} }, handleInsert } = {}) {
  const { publicKey, ...globalConfig } = options.config;
  const baseConfig = { ...defaultConfig, ...globalConfig };

  window.UPLOADCARE_PUBLIC_KEY = publicKey;

  /**
   * Register the effects tab by default because the effects tab is awesome. Can
   * be disabled via config.
   */
  uploadcare.registerTab('preview', uploadcareTabEffects);

  return {
    /**
     * On show, create a new widget, cache it in the widgets object, and open.
     * No hide method is provided because the widget doesn't provide it.
     */
    show: ({ value, config: instanceConfig = {}, allowMultiple, imagesOnly = false } = {}) => {
      const config = { ...baseConfig, imagesOnly, ...instanceConfig };
      const multiple = allowMultiple === false ? false : !!config.multiple;
      const resolvedConfig = { ...config, multiple };
      const files = getFiles(value);

      /**
       * Resolve the promise only if it's ours. Only the jQuery promise objects
       * from the Uploadcare library will have a `state` method.
       */
      if (files && !files.state) {
        return files.then(result => openDialog(result, resolvedConfig, handleInsert));
      } else {
        return openDialog(files, resolvedConfig, handleInsert);
      }
    },

    /**
     * Uploadcare doesn't provide a "media library" widget for viewing and
     * selecting existing files, so we return `false` here so Netlify CMS only
     * opens the Uploadcare widget when called from an editor control. This
     * results in the "Media" button in the global nav being hidden.
     */
    enableStandalone: () => false,
  };
}
1296212
public void setFileFromAJar(String fileName) {
        InputStream is = this.getClass().getResourceAsStream(fileName);
        if(is != null) {
            this.fileName = fileName;
            reader = new InputStreamReader(is);
        }
    }
30990
function openFileClicked() {
  var inputElement = document.createElement('input');
  inputElement['type'] = 'file';
  inputElement['multiple'] = true;
  inputElement['accept'] = [
    '.wtf-trace,application/x-extension-wtf-trace',
    '.wtf-json,application/x-extension-wtf-json',
    '.wtf-calls,application/x-extension-wtf-calls',
    '.cpuprofile,application/x-extension-cpuprofile',
    '.part,application/x-extension-part'
  ].join(',');
  inputElement.onchange = function(e) {
    _gaq.push(['_trackEvent', 'popup', 'open_file']);

    var fileEntries = [];
    for (var n = 0; n < inputElement.files.length; n++) {
      var file = inputElement.files[n];
      var blob = new Blob([file], {
        type: 'application/octet-stream'
      });
      var blobUrl = URL.createObjectURL(blob);
      fileEntries.push({
        name: file.name,
        url: blobUrl,
        size: blob.size
      });
    }

    port.postMessage({
      command: 'show_files',
      files: fileEntries
    });
    window.close();
  };
  inputElement.click();
}