<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://sja.asistenciasacerdotal.eu/index.php?action=history&amp;feed=atom&amp;title=File_upload</id>
	<title>File upload - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://sja.asistenciasacerdotal.eu/index.php?action=history&amp;feed=atom&amp;title=File_upload"/>
	<link rel="alternate" type="text/html" href="https://sja.asistenciasacerdotal.eu/index.php?title=File_upload&amp;action=history"/>
	<updated>2026-04-17T14:22:22Z</updated>
	<subtitle>Historial de revisiones de esta página en la wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://sja.asistenciasacerdotal.eu/index.php?title=File_upload&amp;diff=405&amp;oldid=prev</id>
		<title>Juancc: Página creada con «//Reference:  //https://www.onextrapixel.com/2012/12/10/how-to-create-a-custom-file-input-with-jquery-css3-and-php/ ;(function($) {        // Browser supports HTML5 multiple file?       var multipleSupport = typeof $('&lt;input/&gt;')[0].multiple !== 'undefined',           isIE = /msie/i.test( navigator.userAgent );        $.fn.customFile = function() {          return this.each(function() {            var $file = $(this).addClass('custom-file-upload-hidden'), // the origin…»</title>
		<link rel="alternate" type="text/html" href="https://sja.asistenciasacerdotal.eu/index.php?title=File_upload&amp;diff=405&amp;oldid=prev"/>
		<updated>2022-02-25T15:32:11Z</updated>

		<summary type="html">&lt;p&gt;Página creada con «//Reference:  //https://www.onextrapixel.com/2012/12/10/how-to-create-a-custom-file-input-with-jquery-css3-and-php/ ;(function($) {        // Browser supports HTML5 multiple file?       var multipleSupport = typeof $(&amp;#039;&amp;lt;input/&amp;gt;&amp;#039;)[0].multiple !== &amp;#039;undefined&amp;#039;,           isIE = /msie/i.test( navigator.userAgent );        $.fn.customFile = function() {          return this.each(function() {            var $file = $(this).addClass(&amp;#039;custom-file-upload-hidden&amp;#039;), // the origin…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;//Reference: &lt;br /&gt;
//https://www.onextrapixel.com/2012/12/10/how-to-create-a-custom-file-input-with-jquery-css3-and-php/&lt;br /&gt;
;(function($) {&lt;br /&gt;
&lt;br /&gt;
      // Browser supports HTML5 multiple file?&lt;br /&gt;
      var multipleSupport = typeof $('&amp;lt;input/&amp;gt;')[0].multiple !== 'undefined',&lt;br /&gt;
          isIE = /msie/i.test( navigator.userAgent );&lt;br /&gt;
&lt;br /&gt;
      $.fn.customFile = function() {&lt;br /&gt;
&lt;br /&gt;
        return this.each(function() {&lt;br /&gt;
&lt;br /&gt;
          var $file = $(this).addClass('custom-file-upload-hidden'), // the original file input&lt;br /&gt;
              $wrap = $('&amp;lt;div class=&amp;quot;file-upload-wrapper&amp;quot;&amp;gt;'),&lt;br /&gt;
              $input = $('&amp;lt;input type=&amp;quot;text&amp;quot; class=&amp;quot;file-upload-input&amp;quot; /&amp;gt;'),&lt;br /&gt;
              // Button that will be used in non-IE browsers&lt;br /&gt;
              $button = $('&amp;lt;button type=&amp;quot;button&amp;quot; class=&amp;quot;file-upload-button&amp;quot;&amp;gt;Select a File&amp;lt;/button&amp;gt;'),&lt;br /&gt;
              // Hack for IE&lt;br /&gt;
              $label = $('&amp;lt;label class=&amp;quot;file-upload-button&amp;quot; for=&amp;quot;'+ $file[0].id +'&amp;quot;&amp;gt;Select a File&amp;lt;/label&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
          // Hide by shifting to the left so we&lt;br /&gt;
          // can still trigger events&lt;br /&gt;
          $file.css({&lt;br /&gt;
            position: 'absolute',&lt;br /&gt;
            left: '-9999px'&lt;br /&gt;
          });&lt;br /&gt;
&lt;br /&gt;
          $wrap.insertAfter( $file )&lt;br /&gt;
            .append( $file, $input, ( isIE ? $label : $button ) );&lt;br /&gt;
&lt;br /&gt;
          // Prevent focus&lt;br /&gt;
          $file.attr('tabIndex', -1);&lt;br /&gt;
          $button.attr('tabIndex', -1);&lt;br /&gt;
&lt;br /&gt;
          $button.click(function () {&lt;br /&gt;
            $file.focus().click(); // Open dialog&lt;br /&gt;
          });&lt;br /&gt;
&lt;br /&gt;
          $file.change(function() {&lt;br /&gt;
&lt;br /&gt;
            var files = [], fileArr, filename;&lt;br /&gt;
&lt;br /&gt;
            // If multiple is supported then extract&lt;br /&gt;
            // all filenames from the file array&lt;br /&gt;
            if ( multipleSupport ) {&lt;br /&gt;
              fileArr = $file[0].files;&lt;br /&gt;
              for ( var i = 0, len = fileArr.length; i &amp;lt; len; i++ ) {&lt;br /&gt;
                files.push( fileArr[i].name );&lt;br /&gt;
              }&lt;br /&gt;
              filename = files.join(', ');&lt;br /&gt;
&lt;br /&gt;
            // If not supported then just take the value&lt;br /&gt;
            // and remove the path to just show the filename&lt;br /&gt;
            } else {&lt;br /&gt;
              filename = $file.val().split('\\').pop();&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            $input.val( filename ) // Set the value&lt;br /&gt;
              .attr('title', filename) // Show filename in title tootlip&lt;br /&gt;
              .focus(); // Regain focus&lt;br /&gt;
&lt;br /&gt;
          });&lt;br /&gt;
&lt;br /&gt;
          $input.on({&lt;br /&gt;
            blur: function() { $file.trigger('blur'); },&lt;br /&gt;
            keydown: function( e ) {&lt;br /&gt;
              if ( e.which === 13 ) { // Enter&lt;br /&gt;
                if ( !isIE ) { $file.trigger('click'); }&lt;br /&gt;
              } else if ( e.which === 8 || e.which === 46 ) { // Backspace &amp;amp; Del&lt;br /&gt;
                // On some browsers the value is read-only&lt;br /&gt;
                // with this trick we remove the old input and add&lt;br /&gt;
                // a clean clone with all the original events attached&lt;br /&gt;
                $file.replaceWith( $file = $file.clone( true ) );&lt;br /&gt;
                $file.trigger('change');&lt;br /&gt;
                $input.val('');&lt;br /&gt;
              } else if ( e.which === 9 ){ // TAB&lt;br /&gt;
                return;&lt;br /&gt;
              } else { // All other keys&lt;br /&gt;
                return false;&lt;br /&gt;
              }&lt;br /&gt;
            }&lt;br /&gt;
          });&lt;br /&gt;
&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
      };&lt;br /&gt;
&lt;br /&gt;
      // Old browser fallback&lt;br /&gt;
      if ( !multipleSupport ) {&lt;br /&gt;
        $( document ).on('change', 'input.customfile', function() {&lt;br /&gt;
&lt;br /&gt;
          var $this = $(this),&lt;br /&gt;
              // Create a unique ID so we&lt;br /&gt;
              // can attach the label to the input&lt;br /&gt;
              uniqId = 'customfile_'+ (new Date()).getTime(),&lt;br /&gt;
              $wrap = $this.parent(),&lt;br /&gt;
&lt;br /&gt;
              // Filter empty input&lt;br /&gt;
              $inputs = $wrap.siblings().find('.file-upload-input')&lt;br /&gt;
                .filter(function(){ return !this.value }),&lt;br /&gt;
&lt;br /&gt;
              $file = $('&amp;lt;input type=&amp;quot;file&amp;quot; id=&amp;quot;'+ uniqId +'&amp;quot; name=&amp;quot;'+ $this.attr('name') +'&amp;quot;/&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
          // 1ms timeout so it runs after all other events&lt;br /&gt;
          // that modify the value have triggered&lt;br /&gt;
          setTimeout(function() {&lt;br /&gt;
            // Add a new input&lt;br /&gt;
            if ( $this.val() ) {&lt;br /&gt;
              // Check for empty fields to prevent&lt;br /&gt;
              // creating new inputs when changing files&lt;br /&gt;
              if ( !$inputs.length ) {&lt;br /&gt;
                $wrap.after( $file );&lt;br /&gt;
                $file.customFile();&lt;br /&gt;
              }&lt;br /&gt;
            // Remove and reorganize inputs&lt;br /&gt;
            } else {&lt;br /&gt;
              $inputs.parent().remove();&lt;br /&gt;
              // Move the input so it's always last on the list&lt;br /&gt;
              $wrap.appendTo( $wrap.parent() );&lt;br /&gt;
              $wrap.find('input').focus();&lt;br /&gt;
            }&lt;br /&gt;
          }, 1);&lt;br /&gt;
&lt;br /&gt;
        });&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
}(jQuery));&lt;br /&gt;
&lt;br /&gt;
$('input[type=file]').customFile();&lt;br /&gt;
Run Pen&lt;/div&gt;</summary>
		<author><name>Juancc</name></author>
	</entry>
</feed>