Merge branch multi-file-upload.

Adds multi-file upload dialog to version -> settings -> documents
tab allowing multiple files to be uploaded in a single operation.

Maximum files per upload can be configured in
administration -> server config.

Squashed commit of the following:

commit 607ca73925f7bd3b3bf1540f83c3de383d2c5acf
Author: David Mason <drdmason@gmail.com>
Date:   Fri Aug 8 14:08:33 2014 +1000

    fix grammar and broken link output in multi-file upload

commit 3c1013d432f01e12155d880f614130a606739890
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 17:51:18 2014 +1000

    use canonical supported file types for project types

commit 23ee9cb16f957f47e5a9c3a066670824a04a896e
Merge: a6bb99c 9be4de8
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 17:49:59 2014 +1000

    Merge branch 'master' into multi-file-upload

commit a6bb99c385abde9d36cb4e85a17210f7e1904596
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 13:54:20 2014 +1000

    use proper formatting for multi-file-upload.xhtml

commit 9f098868d79a60ad344cb961cd72f319559a4dab
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 13:20:14 2014 +1000

    remove unused parts of jQuery File Upload library

commit d339f86ef38a168bf77b6535f54b5f0bcc43fbf9
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 12:59:35 2014 +1000

    remove unused parts of JavaScript Templates library

commit 51870f54df53bc51ab89f08191b947324a914f23
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 12:55:14 2014 +1000

    remove excess jquery import

commit dadbcabe2e066d4688dbe9df2238df23adccdb92
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 12:40:01 2014 +1000

    remove unused file

commit b4718fe362da0396cc9de88d314771c6e9c2d286
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 12:38:58 2014 +1000

    use Slf4j for logging in MultiFileUploadServlet

commit d79e64419e08f07e088f5fe48c32d38e954b3bd3
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 12:36:53 2014 +1000

    use DocumentType constant to compare types

commit 413f33307f5a8a361dab854e3c22d44d9509d197
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 12:28:30 2014 +1000

    Use static LocaleId field for en-US

commit 3d6ee66dc4dea788cb22d4ee84ce400a0b2f5c4c
Author: David Mason <drdmason@gmail.com>
Date:   Thu Aug 7 12:23:36 2014 +1000

    indicate where inline templates are processed

commit a7c6f67393820fd760de96c1ff619c4233a8863f
Author: David Mason <drdmason@gmail.com>
Date:   Wed Aug 6 14:29:36 2014 +1000

    add server config option for max files per upload

commit 1bc23580933ac4105701bee1ff45b03f1c84d487
Merge: ed23803 d82b111
Author: David Mason <drdmason@gmail.com>
Date:   Wed Aug 6 12:35:58 2014 +1000

    Merge branch 'master' into multi-file-upload

commit ed23803361c13d28c3294673c5609768c1f90b6b
Author: David Mason <drdmason@gmail.com>
Date:   Mon Aug 4 11:59:49 2014 +1000

    prevent invalid upload file extensions being seen as valid

commit fa8d238c76e6539f82849bb0921566e179b3cb7f
Author: David Mason <drdmason@gmail.com>
Date:   Mon Aug 4 07:59:14 2014 +1000

    Use translatable strings for multi-file upload script.

    Strings are included in the DOM of the multi-file upload widget so they
    can be translated through the same mechanism as the other UI strings in
    JSF. The script looks up the list of strings in the DOM and populates
    the messages object.

commit c0773c82d75392e7fc94d38bf3574ae5dfbdaf05
Author: Damian Jansen <djansen@redhat.com>
Date:   Fri Aug 1 15:22:33 2014 +1000

    Fix document upload functional tests

commit 152acc670a67f9044e8af7883c670471a3fdd670
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 31 17:13:21 2014 +1000

    use translatable strings for multi-file-upload template

commit 99d41d6b3918cb476210ba9ee05c73f24df24df9
Merge: 276bc67 7da217e
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 31 15:30:12 2014 +1000

    Merge branch 'master' into merge-multi-file-upload

commit 276bc67ef484dc06df96444bcd8ad372abbf6823
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 31 14:07:28 2014 +1000

    WIP: using localizable messages in multi file upload

commit 1306648616408eb1b65499ebf6e44076e571f170
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 31 11:07:21 2014 +1000

    fix compile errors caused by merge conflict resolution

commit 861de99121a5515eb7521722c76c7083e696f2cc
Merge: 0e66e8f 708a3a9
Author: David Mason <drdmason@gmail.com>
Date:   Wed Jul 30 17:21:12 2014 +1000

    Merge branch 'multi-file-upload-tests' into merge-multi-file-upload

    Conflicts:
    	functional-test/src/test/java/org/zanata/feature/editor/TranslateHTMLTest.java
    	functional-test/src/test/java/org/zanata/feature/editor/TranslateIdmlTest.java
    	functional-test/src/test/java/org/zanata/feature/editor/TranslateOdsTest.java
    	functional-test/src/test/java/org/zanata/feature/editor/TranslateOpenOfficeTest.java
    	functional-test/src/test/java/org/zanata/feature/editor/TranslateTextTest.java

        Resolved all using --ours option (keeping version from master).
        Intend to manually apply necessary changes in these files in a subsequent commit,
        rather than risk overwriting the newer code.

commit 0e66e8fba241ab2d8b4a8b67ebeeecef3d82f325
Merge: 05e31c2 8b2bd46
Author: David Mason <drdmason@gmail.com>
Date:   Wed Jul 30 16:42:19 2014 +1000

    Merge branch 'multi-file-upload' into merge-multi-file-upload

    Conflicts:
    	zanata-war/src/main/webapp/WEB-INF/layout/version/settings-tab.xhtml
          had conflict where multi-file-upload element was added, same location
          had "messages" changed to "msgs". Kept chunk from multi-file-upload
          but changed "messages" in that chunk to "msgs".

commit 708a3a910d5beb56c3a35f396819eb46f93073b2
Author: Damian Jansen <djansen@redhat.com>
Date:   Fri Jun 27 13:51:19 2014 +1000

    Multiple file upload test

commit 8b2bd4615be9fd6782313e764ee0c1a6df52da09
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jul 28 12:23:45 2014 +1000

    Use format strings for UI text

    All strings for display are wrapped in i18n function.
    At the moment this only replaces placeholders since I have not provided
    a way to make translated strings available. The simplest approach I can
    think of to make translated strings available would be to output them as
    text in hidden DOM elements of the component, since that would allow
    translations to be handled through the existing page translation workflow.

commit 7370f5335025d8f5c5f19f4823a7d20bbe61a8aa
Author: Damian Jansen <djansen@redhat.com>
Date:   Fri Jun 27 00:24:10 2014 +1000

    Fix testing of uploading files

    Also remove a number of unnecessary steps in the upload tests.

commit a65b0d2418b1fb2438ce3f7913bfc4ad1e43f818
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jul 25 11:39:02 2014 +1000

    SQUASH some cleanup

commit dd25056f29a1f8bf4de39d3eda5c124ce9392d60
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 24 17:00:29 2014 +1000

    Needs Cleanup: WIP different upload stages being recorded, not used for count display yet

commit e8e054739036b4b75690f1764842cff80a7da998
Author: David Mason <drdmason@gmail.com>
Date:   Wed Jul 23 15:23:10 2014 +1000

    make custom file parameters collapsed by default for multi-file upload

commit 7b38ddc62c9537cbe81cef4b1466ab35986ccc06
Author: David Mason <drdmason@gmail.com>
Date:   Wed Jul 23 14:34:45 2014 +1000

    Add help for custom document parameters field in multi-file upload

commit db43a80276cf8a17188a1572179ed6cd5648611d
Author: David Mason <drdmason@gmail.com>
Date:   Wed Jul 23 10:54:42 2014 +1000

    hide advanced settings when multi-file-upload starts

commit f629abc459bcf194575727e06e224a5929e631c8
Author: David Mason <drdmason@gmail.com>
Date:   Tue Jul 22 17:33:55 2014 +1000

    update error message for users with multiple concurrent uploads

commit b11d4fda15f3e3f8e82746bd753ea1444463e2db
Author: David Mason <drdmason@gmail.com>
Date:   Tue Jul 22 17:31:43 2014 +1000

    Ensure multi-file-upload dialog always responds to finished uploads

commit 78d45e844976d09405bc16ac62ac7d3a37695353
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jul 14 12:37:38 2014 +1000

    Use change in filename emphasis to indicate which files have uploaded.

    This replaces the green circle icon that was indicating upload completion
    previously.

commit caf560632fb7b4e445518bfdb8091c832a27fa77
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jul 14 12:35:59 2014 +1000

    Ensure loader reserves space in multi-file upload dialog.

    This will prevent layout changes for long filenames during upload,
    but only when the .is-reserve-space css class is implemented in the
    assets.

commit 4980b1ed86f949da72c79d1edc5c978873c06672
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jul 14 11:41:43 2014 +1000

    Ensure uploading file items display with consistent height.

    During multi-file upload, file items were changing size slightly
    when they finished uploading, due to the loader widget changing the
    height. This is a workaround until the loader widget is updated to
    work better in inline mode - it just adds a hidden loader to the
    uploaded template to force it to the same height.

commit cddd1bd3665b36063e3e4fe13175af22d41e6359
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jul 14 11:40:04 2014 +1000

    Warn user when closing page during multiple file upload

    This adds a modal dialog when a user is currently uploading source
    files and they attempt to close or navigate away from the page.

commit e39be2a7148219c70ee298e4ef4eedddfcf18674
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jul 11 19:32:21 2014 +1000

    Add confirmation to all operations that cancel an upload.

    Makes sure the event 'hide.zanata.modal' is triggered in all cases that
    close the modal, then add the check to that event.
    Also incidentally fixed some cases in which the modal could be closed
    without refreshing the document list by attaching an event on
    'hide.zanata.modal' to refresh the statistics.

commit b7e6606cc5c1d14cae574936561057cdf98f9cce
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jul 11 14:09:56 2014 +1000

    Prevent file upload progress bar incrementing before files are uploaded.

    This is just a workaround that delays the increment until the next
    progress event, which seems sufficient without a complete overhaul
    of the progress system (which seems to have something really wrong with it).

commit 27e7359daebeafe33d986f563922a8dac150eb45
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jul 11 14:09:44 2014 +1000

    clean up leftover comment

commit 5004bd4302106063812f4905760d9212ac2075e0
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jul 11 13:01:31 2014 +1000

    User throbber instead of progress bar for uploading files.

    Individual file items in multi-file upload dialog show a throbber
    when they are uploading. The overall progress for all the files
    still uses a progress bar.

commit 92d587a812b740caf4ebff5182555ab15e63e889
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 10 14:08:26 2014 +1000

    ensure file count indicator resets when multi file upload form resets

commit edf2f3d926b52340b63862a5f7ad3669fda9416a
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 10 13:43:01 2014 +1000

    clear errors when retrying upload of multiple files

commit 43822c0525936fcfb77e516627d0c057797ce73d
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jul 10 13:42:29 2014 +1000

    Clean up fileupload ui code

commit 2613787fb772f3a7e889b8cb5a413cf83c594f4f
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jul 7 16:02:56 2014 +1000

    SPLIT: check logged in and not already uploading before initiating upload

        Upload button now changes to "Try Again" if user is not logged in or has an upload
        going in another tab/window/computer.

        Still needs to display errors upon failure, and the code is messy,
        but it works so I'm making a commit in case I break it.

    Squashed commits:

    SQUASH clean up code for GET on MultiFileUploadServlet

    SQUASH clean up code for POST on MultiFileUploadServlet

    Display appropriate error when transaction times out for uploaded file persistence.

    Show appropriate error when concurrent uploads reach the database.

    log id properly for a user who is already uploading

    change error text for timed-out file upload

    SQUASH update error message in MultiFileUploadServlet

commit df239c4a5eab567ee628242895b0cb4a249ffe8e
Author: David Mason <drdmason@gmail.com>
Date:   Wed Jul 2 11:42:09 2014 +1000

    Prevent opening of file select dialog when clicking outside the intended click target.

    The dialog was opening when clicking anywhere in a region to the right of and below
    the "browse files" text that is the intended click target. This change limits the
    target to just the "browse files" text.
    Wrapping of the "browse files" text is prevented since the transparent file upload
    button must overlay all of the text for the dialog to open properly (plus it looks
    better with the whole link on the next line than split across lines).

commit 5a0828a74a36fbe0d10dd75cc9f450bf4b0d138b
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jun 27 18:17:47 2014 +1000

    Limit file uploads to 100 files at a time.

        This adds a hard-coded limit of 100 files, with the intention to replace the limit with a
        configurable value.

commit 3231d731793aa727285d6cfb97f89104219e975a
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jun 27 15:40:16 2014 +1000

    Remove cancel button from files while upload is in progress.

commit bb694a125d56113f992c9f8d421b9c2e2ecb1a4f
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jun 27 12:58:27 2014 +1000

    Prevent advanced settings being retained after closing upload dialog.

        Prevents both file path and custom upload parameters from remaining
        when the multi-file-upload dialog is closed and re-opened.

commit 0f977a13487cd668bb1af1c0de2e82af921e4e58
Author: David Mason <drdmason@gmail.com>
Date:   Fri Jun 27 12:16:47 2014 +1000

    Make 'browse files' link vertically centred.

commit 749ad6ed977e7d3cc0b5382b356f74e3f2deda91
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jun 23 12:46:53 2014 +1000

    Update file upload test to work with new component.

commit 4779e62d61ca6d372504424c3e59518bfe989795
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jun 23 11:20:00 2014 +1000

    Remove org.json as a used dependency for maven-dependency-plugin

commit 5be8be5b6b1e7e96ec0f738eb729639568613bc5
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jun 23 10:34:21 2014 +1000

    Remove source language selector from multi file upload dialog.

      Source language is ignored by the server at the moment, so there is
      no value in having a user select it.

commit f306a8c056d184b4a933fe1a52ccbaab327ea600
Author: David Mason <drdmason@gmail.com>
Date:   Mon Jun 23 10:26:27 2014 +1000

    Use multi-file upload component on settings tab.

commit a1e784e47b3beb4ee34bb56a5e5cdd08fd64afe4
Merge: 308bfc3 abab959
Author: David Mason <drdmason@gmail.com>
Date:   Thu Jun 19 13:01:26 2014 +1000

    Merge branch 'master' into multi-file-upload

    Conflicts:
    	zanata-war/src/main/webapp-jboss/WEB-INF/web.xml

        A servlet mapping is added at the same position on each branch.
        Merge keeps both mappings.

commit 308bfc35bd905ad6820c01b0d75580405c70bf9e
Author: David Mason <dr.d.mason@gmail.com>
Date:   Tue May 20 09:55:02 2014 +1000

    WIP: getting json libraries working properly

commit 361cc8c962dcddff13dcd2174a10ac55d2ed19ad
Author: David Mason <dr.d.mason@gmail.com>
Date:   Thu May 1 10:54:14 2014 +1000

    show intelligible error when uploading multiple files after session timeout

commit aad070027301c34ea19f87fd21ccfb841590d68f
Author: David Mason <dr.d.mason@gmail.com>
Date:   Thu May 1 10:52:13 2014 +1000

    improve inline file upload error style

commit a2cec76491d9b3623cd09157c7d80532bff80683
Author: David Mason <dr.d.mason@gmail.com>
Date:   Wed Apr 30 15:55:57 2014 +1000

    show uploaded documents when multi-file-upload dialog is closed

commit dbad9ba98cc655a0fd5cad8ca0d06cdc7362acf7
Author: David Mason <dr.d.mason@gmail.com>
Date:   Thu Apr 3 08:42:28 2014 +1000

    SQUASH add style classes to multi file upload widget

commit 93ca7569adf4e0d18d6c4738a5fee0e099ee14b4
Author: David Mason <dr.d.mason@gmail.com>
Date:   Thu Apr 3 08:42:00 2014 +1000

    SQUASH hide files panel when no files are shown

commit 7f34125fe2bffbbd5ab0d8f2c4ecf4637ecf07c3
Author: David Mason <dr.d.mason@gmail.com>
Date:   Wed Apr 2 09:56:08 2014 +1000

    show and hide portions of the form when upload is not supported

commit e757dee5f3538efc60eb8a96285b8215514ee334
Author: David Mason <dr.d.mason@gmail.com>
Date:   Mon Mar 31 13:58:49 2014 +1000

    ensure that .pot extensions are handled properly in uploaded source files.

commit 0e62035fb75f2a9338bc2fb155d33dd5d0af1716
Author: David Mason <dr.d.mason@gmail.com>
Date:   Fri Mar 28 11:53:02 2014 +1000

    add 'accepted' attribute to multi-file-upload widget

commit 60986fef16d811122d4dd13fc8617b45509c2958
Author: David Mason <dr.d.mason@gmail.com>
Date:   Fri Mar 28 11:46:07 2014 +1000

    limit individual file size to 200MB

commit 3abb78bcc52f6575c73277d09015add0a3aaa775
Author: David Mason <dr.d.mason@gmail.com>
Date:   Fri Mar 28 15:29:17 2014 +1000

    Various display behaviour tweaks to file upload dialog.

        - when there is an error adding a file, just show an error and do not add it
        - show number of queued and uploading files
        - change drop zone style when files are dragged over it
        - reset dialog when it is reopened
        - close dialog when any of the cancel buttons are pressed
        - disable adding more files when upload has started

commit 7b6ca7cf07328abd348f07eb1186eed61b6614bd
Author: David Mason <dr.d.mason@gmail.com>
Date:   Thu Mar 20 14:24:37 2014 +1000

    prepend modal dialogs to body to prevent automatic cloning

commit 40cbd4704472265498a6f19c41e130264d4e350f
Author: David Mason <dr.d.mason@gmail.com>
Date:   Mon Mar 17 09:44:12 2014 +1000

    limit uploads to accepted file types

commit 816627108433efd44ce4bfe8c27934bea9ece856
Author: David Mason <dr.d.mason@gmail.com>
Date:   Sun Mar 16 19:11:56 2014 +1000

    create multi file upload widget

commit 19d99e4efcdbf3cdef5ad1c29ac7d6b5bee0deb8
Author: David Mason <dr.d.mason@gmail.com>
Date:   Sun Mar 16 21:36:38 2014 +1000

    strip CDATA from template strings

commit d8bcac50beef58b29dd2e6e0e640e2f559c3933e
Author: David Mason <dr.d.mason@gmail.com>
Date:   Sun Mar 16 21:43:15 2014 +1000

    modify main script for fileupload to work with multi-file-upload widget

commit 9a25e0bcad4546ccf38d3aa78ebb30391d4bb86e
Author: David Mason <dr.d.mason@gmail.com>
Date:   Sun Mar 16 23:38:44 2014 +1000

    add javascript templates library

commit 5c1271daec3aae626f40013eb319f2e8916d520e
Author: David Mason <dr.d.mason@gmail.com>
Date:   Sun Mar 16 19:10:35 2014 +1000

    add jquery file upload library

commit e9fc692195fd9b6ad0d00ee1291e8bf3e4f360ae
Author: David Mason <dr.d.mason@gmail.com>
Date:   Sun Mar 16 19:06:53 2014 +1000

    add upload servlet for multiple files

commit 083ce607eca235845bf95cc1259be28426b5454f
Author: David Mason <dr.d.mason@gmail.com>
Date:   Mon Mar 17 18:15:40 2014 +1000

    Add method to allow uploads without provided hash
Merge branch 'integration/master' into rhbz1104015

Conflicts:
	zanata-war/src/main/java/org/zanata/action/VersionHome.java