<commit_before>---
layout: post
title: 2014-03-27-FILE_UPLOAD_SUPPORT_ON_MOBILE.md
---

{% highlight javascript %}

// Detect file input support
var isFileInputSupported = (function () {
 // Handle devices which falsely report support
 if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) {
   return false;
 }
 // Create test element
 var el = document.createElement("input");
 el.type = "file";
 return !el.disabled;
})();

// Add 'fileinput' class to html element if supported
if (isFileInputSupported) {
 document.documentElement.className += " fileinput";
}

{% endhighlight %}


<table cellspacing="0" cellpadding="0">
  <thead>
    <tr>
      <th>
        OS
      </th>
      <th>
        Supported?
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        Android 1.0—2.1
      </td>
      <td style="color:red">
        No
      </td>
    </tr>
    <tr>
      <td>
        Android 2.2+
      </td>
      <td style="color:green"><commit_msg>change highlight JavaScript method !<commit_after>---
layout: post
title: 2014-03-27-FILE_UPLOAD_SUPPORT_ON_MOBILE.md
---

{% highlight javascript %}
// Detect file input support
var isFileInputSupported = (function () {
 // Handle devices which falsely report support
 if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) {
   return false;
 }
 // Create test element
 var el = document.createElement("input");
 el.type = "file";
 return !el.disabled;
})();

// Add 'fileinput' class to html element if supported
if (isFileInputSupported) {
 document.documentElement.className += " fileinput";
}
{% endhighlight %}


<table cellspacing="0" cellpadding="0">
  <thead>
    <tr>
      <th>
        OS
      </th>
      <th>
        Supported?
      </th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>
        Android 1.0—2.1
      </td>
      <td style="color:red">
        No
      </td>
    </tr>
    <tr>
      <td>
        Android 2.2+
      </td>
      <td style="color:green">
{'fraction_non_alphanumeric': 0.18311151904543368, 'fraction_numerical': 0.03579623680587425, 'mean_word_length': 2.5914332784184513, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3747492', 'n_tokens_mistral': 838, 'n_tokens_neox': 795, 'n_words': 167}