Commit adb0d02d authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

Merge branch 'raos_work' of git.math.uzh.ch:typo3/qfq into raos_work

Conflicts:
	javascript/src/FileDelete.js
parents 4fb45120 a232579c
......@@ -22,13 +22,12 @@ var QfqNS = QfqNS || {};
* @param fileUploadTo {string} url used for file uploads
* @constructor
*/
n.QfqForm = function (formId, submitTo, deleteUrl, dataRefreshUrl, fileUploadTo, fileDeleteUrl) {
n.QfqForm = function (formId, submitTo, deleteUrl, dataRefreshUrl, fileUploadTo) {
this.formId = formId;
this.submitTo = submitTo;
this.deleteUrl = deleteUrl;
this.dataRefreshUrl = dataRefreshUrl;
this.fileUploadTo = fileUploadTo;
this.fileDeleteUrl = fileDeleteUrl;
this.form = new n.Form(this.formId);
// This is required when displaying validation messages, in to activate the tab, which has validation issues
......@@ -85,15 +84,6 @@ var QfqNS = QfqNS || {};
* @private
*/
n.QfqForm.prototype.fileDeleteSuccessHandler = function (obj) {
if (!obj.data.status) {
throw Error("Response on file upload missing status");
}
if (obj.data.status === "error") {
var alert = new n.Alert(obj.data.message, "error");
alert.show();
return;
}
var $button = $(obj.target);
$button.prop("disabled", true);
......
......@@ -20,7 +20,6 @@ var QfqNS = QfqNS || {};
deleteUrl: "typo3conf/ext/qfq/qfq/api/delete.php",
refreshUrl: "typo3conf/ext/qfq/qfq/api/load.php",
fileUploadTo: "typo3conf/ext/qfq/qfq/api/upload.php",
fileDeleteUrl: "typo3conf/ext/qfq/qfq/api/filedelete.php",
pageState: new n.PageState()
}, settings
);
......@@ -49,8 +48,7 @@ var QfqNS = QfqNS || {};
this.settings.submitTo,
this.settings.deleteUrl,
this.settings.refreshUrl,
this.settings.fileUploadTo,
this.settings.fileDeleteUrl);
this.settings.fileUploadTo);
this.qfqForm.setBsTabs(this.bsTabs);
this.qfqForm.on('qfqform.destroyed', this.destroyFormHandler.bind(this));
} catch (e) {
......
......@@ -45,14 +45,6 @@
</select>
</label>
<label>File Delete Url
<select name="fileDeleteUrl" id="fileDeleteUrl">
<option>404 error</option>
<option>delete_file_ok.json</option>
<option>delete_file_error.json</option>
</select>
</label>
<div class="container-fluid">
<div class="row hidden-xs">
......@@ -1021,8 +1013,7 @@
formId: 'myForm',
submitTo: 'api/' + $("#submitTo").val(),
deleteUrl: 'api/' + $("#deleteUrl").val(),
fileUploadTo: 'api/' + $("#uploadTo").val(),
fileDeleteUrl: 'api/' + $("#fileDeleteUrl").val(),
fileUploadTo: 'api/' + $("#uploadTo").val()
});
$("#submitTo").on("change", function (evt) {
......@@ -1040,11 +1031,6 @@
qfqPage.qfqForm.fileUploader.targetUrl = 'api/' + $(evt.target).val();
});
$("#fileDeleteUrl").on("change", function (evt) {
qfqPage.settings.fileDeleteUrl = 'api/' + $(evt.target).val();
qfqPage.qfqForm.fileDeleter.targetUrl = 'api/' + $(evt.target).val();
});
$('#myForm').on('invalid', function () {
console.log("Invalid event catched");
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment