- Registro, activación y entrada de usuarios git-svn-id: https://192.168.0.254/svn/Rodax.factuges_web/trunk@2 e455b18d-f7fe-5245-9c43-e2c35af70a32
63 lines
2.2 KiB
JavaScript
63 lines
2.2 KiB
JavaScript
var FormFileUpload = function () {
|
|
|
|
|
|
return {
|
|
//main function to initiate the module
|
|
init: function () {
|
|
|
|
// Initialize the jQuery File Upload widget:
|
|
$('#fileupload').fileupload({
|
|
// Uncomment the following to send cross-domain cookies:
|
|
//xhrFields: {withCredentials: true},
|
|
url: 'assets/plugins/jquery-file-upload/server/php/'
|
|
});
|
|
|
|
// Load existing files:
|
|
// Demo settings:
|
|
$.ajax({
|
|
// Uncomment the following to send cross-domain cookies:
|
|
//xhrFields: {withCredentials: true},
|
|
url: $('#fileupload').fileupload('option', 'url'),
|
|
dataType: 'json',
|
|
context: $('#fileupload')[0],
|
|
maxFileSize: 5000000,
|
|
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
|
|
process: [{
|
|
action: 'load',
|
|
fileTypes: /^image\/(gif|jpeg|png)$/,
|
|
maxFileSize: 20000000 // 20MB
|
|
}, {
|
|
action: 'resize',
|
|
maxWidth: 1440,
|
|
maxHeight: 900
|
|
}, {
|
|
action: 'save'
|
|
}
|
|
]
|
|
}).done(function (result) {
|
|
$(this).fileupload('option', 'done')
|
|
.call(this, null, {
|
|
result: result
|
|
});
|
|
});
|
|
|
|
// Upload server status check for browsers with CORS support:
|
|
if ($.support.cors) {
|
|
$.ajax({
|
|
url: 'assets/plugins/jquery-file-upload/server/php/',
|
|
type: 'HEAD'
|
|
}).fail(function () {
|
|
$('<span class="alert alert-error"/>')
|
|
.text('Upload server currently unavailable - ' +
|
|
new Date())
|
|
.appendTo('#fileupload');
|
|
});
|
|
}
|
|
|
|
// initialize uniform checkboxes
|
|
App.initUniform('.fileupload-toggle-checkbox');
|
|
}
|
|
|
|
};
|
|
|
|
}(); |