mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-27 18:21:50 +08:00
adds results js code in modules
This commit is contained in:
parent
a4032f5cc6
commit
81a3cb0a41
11 changed files with 302 additions and 262 deletions
|
@ -5,7 +5,6 @@
|
|||
'use strict';
|
||||
|
||||
global.Results = (function() {
|
||||
var self = this;
|
||||
var ResultTypeEnum = Object.freeze({
|
||||
FILE: 0,
|
||||
TABLE: 1,
|
||||
|
@ -14,10 +13,10 @@
|
|||
});
|
||||
|
||||
function init() {
|
||||
self.initHandsOnTables($(document));
|
||||
initHandsOnTables($(document));
|
||||
_expandAllResults();
|
||||
_initTutorial();
|
||||
self.applyCollapseLinkCallBack();
|
||||
applyCollapseLinkCallBack();
|
||||
|
||||
Comments.bindNewElement();
|
||||
Comments.initialize();
|
||||
|
@ -143,7 +142,7 @@
|
|||
var steps = [{
|
||||
element: $('#results-toolbar')[0],
|
||||
intro: I18n.t('tutorial.module_results_html')
|
||||
}, {ResultTypeEnum
|
||||
}, {
|
||||
element: samplesTab[0],
|
||||
intro: I18n.t('tutorial.module_results_click_samples_html'),
|
||||
position: 'left'
|
||||
|
@ -158,7 +157,7 @@
|
|||
$form.clearFormErrors();
|
||||
|
||||
switch(resultTypeEnum) {
|
||||
case self.ResultTypeEnum.FILE:
|
||||
case ResultTypeEnum.FILE:
|
||||
var $nameInput = $form.find('#result_name');
|
||||
var nameValid = textValidator(ev, $nameInput, 0,
|
||||
<%= Constants::NAME_MAX_LENGTH %>);
|
||||
|
@ -175,19 +174,19 @@
|
|||
|
||||
}
|
||||
break;
|
||||
case self.ResultTypeEnum.TABLE:
|
||||
case ResultTypeEnum.TABLE:
|
||||
var $nameInput = $form.find('#result_name');
|
||||
var nameValid = textValidator(ev, $nameInput, 0,
|
||||
<%= Constants::NAME_MAX_LENGTH %>);
|
||||
break;
|
||||
case self.ResultTypeEnum.TEXT:
|
||||
case ResultTypeEnum.TEXT:
|
||||
var $nameInput = $form.find('#result_name');
|
||||
var nameValid = textValidator(ev, $nameInput, 0,
|
||||
<%= Constants::NAME_MAX_LENGTH %>);
|
||||
var $textInput = TinyMCE.getContent();
|
||||
textValidator(ev, $textInput, 1, <%= Constants::TEXT_MAX_LENGTH %>, false, true);
|
||||
break;
|
||||
case self.ResultTypeEnum.COMMENT:
|
||||
case ResultTypeEnum.COMMENT:
|
||||
var $commentInput = $form.find('#comment_message');
|
||||
var commentValid = textValidator(ev, $commentInput, 1,
|
||||
<%= Constants::TEXT_MAX_LENGTH %>);
|
||||
|
|
|
@ -1,93 +1,93 @@
|
|||
(function(global) {
|
||||
'use strict';
|
||||
|
||||
var ResutlAssetHandler = (function() {
|
||||
var self = this;
|
||||
var publicAPI = Object.freeze({
|
||||
initNewResultAsset: function initNewResultAsset() {
|
||||
// New result asset behaviour
|
||||
$('#new-result-asset').on('ajax:success', function(e, data) {
|
||||
var $form = $(data.html);
|
||||
$('#results').prepend($form);
|
||||
debugger;
|
||||
self.formAjaxResultAsset($form);
|
||||
var ResutlAssets = (function() {
|
||||
// New result asset behaviour
|
||||
function initNewResultAsset() {
|
||||
$('#new-result-asset').on('ajax:success', function(e, data) {
|
||||
var $form = $(data.html);
|
||||
$('#results').prepend($form);
|
||||
|
||||
// Cancel button
|
||||
$form.find('.cancel-new').click(function () {
|
||||
$form.remove();
|
||||
toggleResultEditButtons(true);
|
||||
});
|
||||
_formAjaxResultAsset($form);
|
||||
|
||||
toggleResultEditButtons(false);
|
||||
|
||||
$('#result_name').focus();
|
||||
// Cancel button
|
||||
$form.find('.cancel-new').click(function () {
|
||||
$form.remove();
|
||||
Results.toggleResultEditButtons(true);
|
||||
});
|
||||
|
||||
$('#new-result-asset')
|
||||
.on('ajax:error', function(e, xhr, status, error) {
|
||||
animateSpinner(null, false);
|
||||
});
|
||||
},
|
||||
applyEditResultAssetCallback: function applyEditResultAssetCallback() {
|
||||
$('.edit-result-asset').on('ajax:success', function(e, data) {
|
||||
var $result = $(this).closest('.result');
|
||||
var $form = $(data.html);
|
||||
var $prevResult = $result;
|
||||
$result.after($form);
|
||||
$result.remove();
|
||||
Results.toggleResultEditButtons(false);
|
||||
|
||||
formAjaxResultAsset($form);
|
||||
$('#result_name').focus();
|
||||
}).on('ajax:error', function(e, xhr, status, error) {
|
||||
animateSpinner(null, false);
|
||||
});
|
||||
}
|
||||
|
||||
// Cancel button
|
||||
$form.find('.cancel-edit').click(function () {
|
||||
$form.after($prevResult);
|
||||
$form.remove();
|
||||
applyEditResultAssetCallback();
|
||||
toggleResultEditButtons(true);
|
||||
initPreviewModal();
|
||||
});
|
||||
function applyEditResultAssetCallback() {
|
||||
$('.edit-result-asset').on('ajax:success', function(e, data) {
|
||||
var $result = $(this).closest('.result');
|
||||
var $form = $(data.html);
|
||||
var $prevResult = $result;
|
||||
$result.after($form);
|
||||
$result.remove();
|
||||
|
||||
toggleResultEditButtons(false);
|
||||
_formAjaxResultAsset($form);
|
||||
|
||||
$('#result_name').focus();
|
||||
});
|
||||
|
||||
$('.edit-result-asset')
|
||||
.on('ajax:error', function(e, xhr, status, error) {
|
||||
animateSpinner(null, false);
|
||||
});
|
||||
},
|
||||
formAjaxResultAsset: function formAjaxResultAsset($form) {
|
||||
$form.on('ajax:success', function(e, data) {
|
||||
$form.after(data.html);
|
||||
var $newResult = $form.next();
|
||||
initFormSubmitLinks($newResult);
|
||||
$(this).remove();
|
||||
// Cancel button
|
||||
$form.find('.cancel-edit').click(function () {
|
||||
$form.after($prevResult);
|
||||
$form.remove();
|
||||
applyEditResultAssetCallback();
|
||||
Results.applyCollapseLinkCallBack();
|
||||
|
||||
toggleResultEditButtons(true);
|
||||
expandResult($newResult);
|
||||
Results.toggleResultEditButtons(true);
|
||||
initPreviewModal();
|
||||
Comments.initialize();
|
||||
}).on('ajax:error', function(e, data) {
|
||||
// This check is here only because of remotipart bug, which returns
|
||||
// HTML instead of JSON, go figure
|
||||
var errors = '';
|
||||
if (data.errors)
|
||||
errors = data.errors;
|
||||
else
|
||||
errors = data.responseJSON.errors;
|
||||
$form.renderFormErrors('result', errors, true, e);
|
||||
animateSpinner(null, false);
|
||||
});
|
||||
}
|
||||
|
||||
Results.toggleResultEditButtons(false);
|
||||
|
||||
$('#result_name').focus();
|
||||
}).on('ajax:error', function(e, xhr, status, error) {
|
||||
animateSpinner(null, false);
|
||||
});
|
||||
}
|
||||
|
||||
function _formAjaxResultAsset($form) {
|
||||
$form.on('ajax:success', function(e, data) {
|
||||
$form.after(data.html);
|
||||
var $newResult = $form.next();
|
||||
initFormSubmitLinks($newResult);
|
||||
$(this).remove();
|
||||
applyEditResultAssetCallback();
|
||||
Results.applyCollapseLinkCallBack();
|
||||
|
||||
Results.toggleResultEditButtons(true);
|
||||
Results.expandResult($newResult);
|
||||
initPreviewModal();
|
||||
Comments.initialize();
|
||||
}).on('ajax:error', function(e, data) {
|
||||
// This check is here only because of remotipart bug, which returns
|
||||
// HTML instead of JSON, go figure
|
||||
var errors = '';
|
||||
if (data.errors)
|
||||
errors = data.errors;
|
||||
else
|
||||
errors = data.responseJSON.errors;
|
||||
$form.renderFormErrors('result', errors, true, e);
|
||||
animateSpinner(null, false);
|
||||
});
|
||||
}
|
||||
|
||||
var publicAPI = Object.freeze({
|
||||
initNewResultAsset: initNewResultAsset,
|
||||
applyEditResultAssetCallback: applyEditResultAssetCallback
|
||||
});
|
||||
|
||||
return publicAPI;
|
||||
})();
|
||||
|
||||
ResutlAssetHandler.initNewResultAsset();
|
||||
ResutlAssetHandler.applyEditResultAssetCallback();
|
||||
global.initPreviewModal();
|
||||
$(document).ready(function() {
|
||||
ResutlAssets.initNewResultAsset();
|
||||
ResutlAssets.applyEditResultAssetCallback();
|
||||
global.initPreviewModal();
|
||||
});
|
||||
})(window);
|
||||
|
|
|
@ -1,111 +1,124 @@
|
|||
// Init handsontable which can be edited
|
||||
function initEditableHandsOnTable(root) {
|
||||
root.find(".editable-table").each(function() {
|
||||
var $container = $(this).find(".hot");
|
||||
var data = null;
|
||||
var contents = $(this).find('.hot-contents');
|
||||
if (contents.attr("value")) {
|
||||
data = JSON.parse(contents.attr("value")).data;
|
||||
}
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
$container.handsontable({
|
||||
data: data,
|
||||
startRows: <%= Constants::HANDSONTABLE_INIT_ROWS_CNT %>,
|
||||
startCols: <%= Constants::HANDSONTABLE_INIT_COLS_CNT %>,
|
||||
minRows: 1,
|
||||
minCols: 1,
|
||||
rowHeaders: true,
|
||||
colHeaders: true,
|
||||
contextMenu: true,
|
||||
formulas: true,
|
||||
preventOverflow: 'horizontal'
|
||||
});
|
||||
});
|
||||
}
|
||||
var ResultTables = (function() {
|
||||
// Init handsontable which can be edited
|
||||
function _initEditableHandsOnTable(root) {
|
||||
root.find('.editable-table').each(function() {
|
||||
var $container = $(this).find('.hot');
|
||||
var data = null;
|
||||
var contents = $(this).find('.hot-contents');
|
||||
if (contents.attr('value')) {
|
||||
data = JSON.parse(contents.attr('value')).data;
|
||||
}
|
||||
|
||||
function onSubmitExtractTable($form) {
|
||||
$form.submit(function(){
|
||||
var hot = $(".hot").handsontable('getInstance');
|
||||
var contents = $('.hot-contents');
|
||||
var data = JSON.stringify({data: hot.getData()});
|
||||
contents.attr("value", data);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
$container.handsontable({
|
||||
data: data,
|
||||
startRows: <%= Constants::HANDSONTABLE_INIT_ROWS_CNT %>,
|
||||
startCols: <%= Constants::HANDSONTABLE_INIT_COLS_CNT %>,
|
||||
minRows: 1,
|
||||
minCols: 1,
|
||||
rowHeaders: true,
|
||||
colHeaders: true,
|
||||
contextMenu: true,
|
||||
formulas: true,
|
||||
preventOverflow: 'horizontal'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Edit result table button behaviour
|
||||
function applyEditResultTableCallback() {
|
||||
$(".edit-result-table").on("ajax:success", function(e, data) {
|
||||
var $result = $(this).closest(".result");
|
||||
var $form = $(data.html);
|
||||
var $prevResult = $result;
|
||||
$result.after($form);
|
||||
$result.remove();
|
||||
function _onSubmitExtractTable($form) {
|
||||
$form.submit(function(){
|
||||
var hot = $('.hot').handsontable('getInstance');
|
||||
var contents = $('.hot-contents');
|
||||
var data = JSON.stringify({data: hot.getData()});
|
||||
contents.attr('value', data);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
formAjaxResultTable($form);
|
||||
initEditableHandsOnTable($form);
|
||||
onSubmitExtractTable($form);
|
||||
// Apply ajax callback to form
|
||||
function _formAjaxResultTable($form) {
|
||||
$form.on('ajax:success', function(e, data) {
|
||||
var $result;
|
||||
$form.after(data.html);
|
||||
$result = $(this).next();
|
||||
initFormSubmitLinks($result);
|
||||
$(this).remove();
|
||||
|
||||
// Cancel button
|
||||
$form.find(".cancel-edit").click(function () {
|
||||
$form.after($prevResult);
|
||||
$form.remove();
|
||||
applyEditResultTableCallback();
|
||||
toggleResultEditButtons(true);
|
||||
applyEditResultTableCallback();
|
||||
Results.applyCollapseLinkCallBack();
|
||||
Results.initHandsOnTables($result);
|
||||
Results.toggleResultEditButtons(true);
|
||||
Results.expandResult($result);
|
||||
Comments.initialize();
|
||||
});
|
||||
$form.on('ajax:error', function(e, xhr, status, error) {
|
||||
var data = xhr.responseJSON;
|
||||
$form.renderFormErrors('result', data);
|
||||
});
|
||||
}
|
||||
|
||||
// Edit result table button behaviour
|
||||
function applyEditResultTableCallback() {
|
||||
$('.edit-result-table').on('ajax:success', function(e, data) {
|
||||
var $result = $(this).closest('.result');
|
||||
var $form = $(data.html);
|
||||
var $prevResult = $result;
|
||||
$result.after($form);
|
||||
$result.remove();
|
||||
|
||||
_formAjaxResultTable($form);
|
||||
_initEditableHandsOnTable($form);
|
||||
_onSubmitExtractTable($form);
|
||||
|
||||
// Cancel button
|
||||
$form.find('.cancel-edit').click(function () {
|
||||
$form.after($prevResult);
|
||||
$form.remove();
|
||||
applyEditResultTableCallback();
|
||||
Results.toggleResultEditButtons(true);
|
||||
});
|
||||
|
||||
Results.toggleResultEditButtons(false);
|
||||
|
||||
$('#result_name').focus();
|
||||
});
|
||||
}
|
||||
|
||||
// New result text behaviour
|
||||
function initNewResultTable() {
|
||||
$('#new-result-table').on('ajax:success', function(e, data) {
|
||||
var $form = $(data.html);
|
||||
$('#results').prepend($form);
|
||||
|
||||
_formAjaxResultTable($form);
|
||||
_initEditableHandsOnTable($form);
|
||||
_onSubmitExtractTable($form);
|
||||
|
||||
// Cancel button
|
||||
$form.find('.cancel-new').click(function () {
|
||||
$form.remove();
|
||||
Results.toggleResultEditButtons(true);
|
||||
});
|
||||
|
||||
Results.toggleResultEditButtons(false);
|
||||
|
||||
$('#result_name').focus();
|
||||
});
|
||||
}
|
||||
|
||||
var publicAPI = Object.freeze({
|
||||
initNewResultTable: initNewResultTable,
|
||||
applyEditResultTableCallback: applyEditResultTableCallback
|
||||
});
|
||||
|
||||
return publicAPI;
|
||||
})();
|
||||
|
||||
$(document).ready(function() {
|
||||
ResultTables.initNewResultTable();
|
||||
ResultTables.applyEditResultTableCallback();
|
||||
});
|
||||
|
||||
toggleResultEditButtons(false);
|
||||
|
||||
$("#result_name").focus();
|
||||
});
|
||||
|
||||
$(".edit-result-table").on("ajax:error", function(e, xhr, status, error) {
|
||||
//TODO: Add error handling
|
||||
});
|
||||
}
|
||||
// New result text behaviour
|
||||
$("#new-result-table").on("ajax:success", function(e, data) {
|
||||
var $form = $(data.html);
|
||||
$("#results").prepend($form);
|
||||
|
||||
formAjaxResultTable($form);
|
||||
initEditableHandsOnTable($form);
|
||||
onSubmitExtractTable($form);
|
||||
|
||||
// Cancel button
|
||||
$form.find(".cancel-new").click(function () {
|
||||
$form.remove();
|
||||
toggleResultEditButtons(true);
|
||||
});
|
||||
|
||||
toggleResultEditButtons(false);
|
||||
|
||||
$("#result_name").focus();
|
||||
});
|
||||
|
||||
$("#new-result-table").on("ajax:error", function(e, xhr, status, error) {
|
||||
//TODO: Add error handling
|
||||
});
|
||||
|
||||
// Apply ajax callback to form
|
||||
function formAjaxResultTable($form) {
|
||||
$form.on("ajax:success", function(e, data) {
|
||||
$form.after(data.html);
|
||||
$result = $(this).next();
|
||||
initFormSubmitLinks($result);
|
||||
$(this).remove();
|
||||
|
||||
applyEditResultTableCallback();
|
||||
Results.applyCollapseLinkCallBack();
|
||||
Results.initHandsOnTables($result);
|
||||
toggleResultEditButtons(true);
|
||||
expandResult($result);
|
||||
Comments.initialize();
|
||||
});
|
||||
$form.on("ajax:error", function(e, xhr, status, error) {
|
||||
var data = xhr.responseJSON;
|
||||
$form.renderFormErrors("result", data);
|
||||
});
|
||||
}
|
||||
|
||||
applyEditResultTableCallback();
|
||||
})();
|
||||
|
|
|
@ -1,81 +1,96 @@
|
|||
// New result text behaviour
|
||||
$("#new-result-text").on("ajax:success", function(e, data) {
|
||||
var $form = $(data.html);
|
||||
$("#results").prepend($form);
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
formAjaxResultText($form);
|
||||
var ResultText = (function() {
|
||||
// New result text behaviour
|
||||
function initNewReslutText() {
|
||||
$('#new-result-text').on('ajax:success', function(e, data) {
|
||||
var $form = $(data.html);
|
||||
$('#results').prepend($form);
|
||||
|
||||
// Cancel button
|
||||
$form.find(".cancel-new").click(function () {
|
||||
$form.remove();
|
||||
toggleResultEditButtons(true);
|
||||
});
|
||||
toggleResultEditButtons(false);
|
||||
TinyMCE.refresh();
|
||||
$("#result_name").focus();
|
||||
});
|
||||
_formAjaxResultText($form);
|
||||
|
||||
$("#new-result-text").on("ajax:error", function(e, xhr, status, error) {
|
||||
//TODO: Add error handling
|
||||
});
|
||||
// Cancel button
|
||||
$form.find('.cancel-new').click(function() {
|
||||
$form.remove();
|
||||
Results.toggleResultEditButtons(true);
|
||||
});
|
||||
Results.toggleResultEditButtons(false);
|
||||
TinyMCE.refresh();
|
||||
TinyMCE.highlight();
|
||||
$('#result_name').focus();
|
||||
}).on('ajax:error', function() {
|
||||
TinyMCE.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
// Edit result text button behaviour
|
||||
function applyEditResultTextCallback() {
|
||||
$(".edit-result-text").on("ajax:success", function(e, data) {
|
||||
var $result = $(this).closest(".result");
|
||||
var $form = $(data.html);
|
||||
var $prevResult = $result;
|
||||
$result.after($form);
|
||||
$result.remove();
|
||||
|
||||
formAjaxResultText($form);
|
||||
// Edit result text button behaviour
|
||||
function applyEditResultTextCallback() {
|
||||
$('.edit-result-text').on('ajax:success', function(e, data) {
|
||||
var $result = $(this).closest('.result');
|
||||
var $form = $(data.html);
|
||||
var $prevResult = $result;
|
||||
$result.after($form);
|
||||
$result.remove();
|
||||
|
||||
// Cancel button
|
||||
$form.find(".cancel-edit").click(function () {
|
||||
$form.after($prevResult);
|
||||
$form.remove();
|
||||
applyEditResultTextCallback();
|
||||
toggleResultEditButtons(true);
|
||||
_formAjaxResultText($form);
|
||||
|
||||
// Cancel button
|
||||
$form.find('.cancel-edit').click(function () {
|
||||
$form.after($prevResult);
|
||||
$form.remove();
|
||||
applyEditResultTextCallback();
|
||||
Results.toggleResultEditButtons(true);
|
||||
});
|
||||
Results.toggleResultEditButtons(false);
|
||||
TinyMCE.refresh();
|
||||
$('#result_name').focus();
|
||||
});
|
||||
toggleResultEditButtons(false);
|
||||
TinyMCE.refresh();
|
||||
$("#result_name").focus();
|
||||
}
|
||||
|
||||
// Apply ajax callback to form
|
||||
function _formAjaxResultText($form) {
|
||||
$form.on('ajax:success', function(e, data) {
|
||||
$form.after(data.html);
|
||||
var newResult = $form.next();
|
||||
initFormSubmitLinks(newResult);
|
||||
$(this).remove();
|
||||
|
||||
applyEditResultTextCallback();
|
||||
Results.applyCollapseLinkCallBack();
|
||||
Results.toggleResultEditButtons(true);
|
||||
Results.expandResult(newResult);
|
||||
TinyMCE.destroyAll();
|
||||
Comments.initialize();
|
||||
});
|
||||
$form.on('ajax:error', function(e, xhr, status, error) {
|
||||
var data = xhr.responseJSON;
|
||||
$form.renderFormErrors('result', data);
|
||||
TinyMCE.highlight();
|
||||
if (data['result_text.text']) {
|
||||
var $el = $form.find(
|
||||
'textarea[name=result\\[result_text_attributes\\]\\[text\\]]'
|
||||
);
|
||||
|
||||
$el.closest('.form-group').addClass('has-error');
|
||||
$el.parent().append('<span class=\'help-block\'>' +
|
||||
data['result_text.text'] + '</span>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var publicAPI = Object.freeze({
|
||||
initNewReslutText: initNewReslutText,
|
||||
applyEditResultTextCallback: applyEditResultTextCallback
|
||||
});
|
||||
|
||||
$(".edit-result-text").on("ajax:error", function(e, xhr, status, error) {
|
||||
//TODO: Add error handling
|
||||
});
|
||||
}
|
||||
return publicAPI;
|
||||
})();
|
||||
|
||||
// Apply ajax callback to form
|
||||
function formAjaxResultText($form) {
|
||||
$form.on("ajax:success", function(e, data) {
|
||||
$form.after(data.html);
|
||||
var newResult = $form.next();
|
||||
initFormSubmitLinks(newResult);
|
||||
$(this).remove();
|
||||
$(document).ready(function() {
|
||||
ResultText.initNewReslutText();
|
||||
ResultText.applyEditResultTextCallback();
|
||||
});
|
||||
|
||||
applyEditResultTextCallback();
|
||||
Results.applyCollapseLinkCallBack();
|
||||
toggleResultEditButtons(true);
|
||||
expandResult(newResult);
|
||||
TinyMCE.destroyAll();
|
||||
Comments.initialize();
|
||||
});
|
||||
$form.on("ajax:error", function(e, xhr, status, error) {
|
||||
var data = xhr.responseJSON;
|
||||
$form.renderFormErrors("result", data);
|
||||
TinyMCE.highlight();
|
||||
if (data["result_text.text"]) {
|
||||
var $el = $form.find("textarea[name=result\\[result_text_attributes\\]\\[text\\]]");
|
||||
|
||||
$el.closest(".form-group").addClass("has-error");
|
||||
$el.parent().append("<span class='help-block'>" + data["result_text.text"] + "</span>");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
TinyMCE.highlight();
|
||||
});
|
||||
applyEditResultTextCallback();
|
||||
})();
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
<%= ff.file_field :file %>
|
||||
<% end %>
|
||||
<hr>
|
||||
<%= f.submit t("result_assets.edit.update"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.FILE, true);" %>
|
||||
<%= f.submit t("result_assets.edit.update"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.FILE, true);" %>
|
||||
<button type="button" class="btn btn-default cancel-edit">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
<%= f.fields_for :asset do |ff| %>
|
||||
<%= ff.file_field :file %>
|
||||
<% end %>
|
||||
<%= f.submit t("result_assets.new.create"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.FILE, false);" %>
|
||||
<%= f.submit t("result_assets.new.create"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.FILE, false);" %>
|
||||
<button type="button" class="btn btn-default cancel-new">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
single_line: true,
|
||||
hide_label: true,
|
||||
placeholder: t("general.comment_placeholder"),
|
||||
append: f.submit("+", onclick: "processResult(event, ResultTypeEnum.COMMENT, false);"),
|
||||
append: f.submit("+",
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.COMMENT, false);"),
|
||||
help: '.',
|
||||
data: { 'atwho-edit' => '' } %>
|
||||
<% end %>
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<hr>
|
||||
<%= f.submit t("result_tables.edit.update"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.TABLE, true);" %>
|
||||
<%= f.submit t("result_tables.edit.update"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TABLE, true);" %>
|
||||
<button type="button" class="btn btn-default cancel-edit">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.submit t("result_tables.new.create"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.TABLE, false);" %>
|
||||
<%= f.submit t("result_tables.new.create"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TABLE, false);" %>
|
||||
<button type="button" class="btn btn-default cancel-new">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
object_id: @result.result_text.id }) %>
|
||||
</div>
|
||||
<% end %><br />
|
||||
<%= f.submit t("result_texts.edit.update"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.TEXT, true);" %>
|
||||
<%= f.submit t("result_texts.edit.update"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TEXT, true);" %>
|
||||
<button type="button" class="btn btn-default cancel-edit">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
object_id: @result.result_text.id }) %>
|
||||
</div>
|
||||
<% end %><br />
|
||||
<%= f.submit t("result_texts.new.create"), class: 'btn btn-primary save-result', onclick: "processResult(event, ResultTypeEnum.TEXT, false);" %>
|
||||
<%= f.submit t("result_texts.new.create"),
|
||||
class: 'btn btn-primary save-result',
|
||||
onclick: "Results.processResult(event, Results.ResultTypeEnum.TEXT, false);" %>
|
||||
<button type="button" class="btn btn-default cancel-new">
|
||||
<%= t("general.cancel")%>
|
||||
</button>
|
||||
|
|
Loading…
Reference in a new issue