Sun, 12 May 2019 19:24:34 +0200
Version 0.2.0 merged with default.
297 | 1 | /***************************************************************************** |
2 | * Copyright (C) 2019 | |
3 | * | |
4 | * Michiel Broek <mbroek at mbse dot eu> | |
5 | * | |
6 | * This file is part of BMS | |
7 | * | |
8 | * This is free software; you can redistribute it and/or modify it | |
9 | * under the terms of the GNU General Public License as published by the | |
10 | * Free Software Foundation; either version 2, or (at your option) any | |
11 | * later version. | |
12 | * | |
13 | * BrewCloud is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with ThermFerm; see the file COPYING. If not, write to the Free | |
20 | * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | |
21 | *****************************************************************************/ | |
22 | ||
23 | ||
24 | $(document).ready(function () { | |
25 | ||
26 | $('#jqxFileUpload').jqxFileUpload({ | |
27 | width: 300, | |
28 | browseTemplate: 'success', | |
29 | cancelTemplate: 'inverse', | |
30 | uploadTemplate: 'primary', | |
31 | theme: theme, | |
32 | multipleFilesUpload: false, | |
33 | accept: 'application/json', | |
34 | uploadUrl: 'upl_brew.php', | |
35 | fileInputName: 'fileToUpload' | |
36 | }); | |
37 | $('#eventsPanel').jqxPanel({ | |
38 | width: 800, | |
39 | height: 200, | |
40 | theme: theme | |
41 | }); | |
42 | $('#jqxFileUpload').on('select', function (event) { | |
43 | var args = event.args; | |
44 | var fileName = args.file; | |
45 | var fileSize = args.size; | |
46 | $('#eventsPanel').jqxPanel('clearcontent'); | |
47 | $('#eventsPanel').jqxPanel('append', '<strong>' + event.type + ':</strong> ' + fileName + ' size: ' + fileSize + '<br />'); | |
48 | }); | |
49 | $('#jqxFileUpload').on('uploadEnd', function (event) { | |
50 | var args = event.args; | |
51 | var fileName = args.file; | |
52 | var serverResponce = args.response; | |
53 | $('#eventsPanel').jqxPanel('append', '<strong>' + event.type + ':</strong> ontvangen ' + fileName + '<br />' + serverResponce + '<br />'); | |
54 | }); | |
55 | ||
56 | }); |