Skip to content
Snippets Groups Projects
Commit ff6d7e11 authored by Odran PHILIBERT's avatar Odran PHILIBERT
Browse files

Modification en JQuery pour le module Note

parent 4e1e09d7
No related branches found
No related tags found
No related merge requests found
......@@ -2,41 +2,38 @@ function showNotesForm(path, width, height) {
if(typeof(width)==='undefined'){
var width = '800';
}
}
if(typeof(height)==='undefined'){
var height = '480';
}
new Ajax.Request(path,
{
method:'post',
parameters: { url : path
},
onSuccess: function(answer) {
eval("response = "+answer.responseText);
$j.ajax({
url: path,
type: 'POST',
success: function (answer) {
eval("response = "+answer);
if(response.status == 0){
var modal_content = convertToTextVisibleNewLine(response.content);
createModal(modal_content, 'form_notes', height, width);
} else {
window.top.$('main_error').innerHTML = response.error;
window.top.$j('main_error').html( response.error);
}
},
error: function (error) {
alert(error);
}
});
}
function validNotesForm (path, form_id) {
new Ajax.Request(path,
{
asynchronous:false,
method:'post',
parameters: Form.serialize(form_id),
encoding: 'UTF-8',
onSuccess: function(answer){
eval("response = "+answer.responseText);
$j.ajax({
url: path,
type: 'POST',
data : Form.serialize(form_id),
success: function (answer) {
eval("response = "+answer);
if(response.status == 0){
if (typeof window.parent['angularSignatureBookComponent'] != "undefined") {
window.parent.angularSignatureBookComponent.componentAfterNotes();
......@@ -46,28 +43,35 @@ function validNotesForm (path, form_id) {
} else {
alert(response.error);
}
},
error: function (error) {
alert(error);
}
});
}
function addTemplateToNote(templateNotes, path)
{
new Ajax.Request(path,
{
method:'post',
parameters: {
templateId : templateNotes
},
onSuccess: function(answer) {
eval("response = "+answer.responseText);
$j.ajax({
url: path,
type: 'POST',
data : {templateId : templateNotes},
success: function (answer) {
eval("response = "+answer);
if (response.status == 0) {
var strContent = response.content;
var reg = new RegExp(/\\n/gi);
var strContentReplace = strContent.replace(reg, '\n');
$('notes').value = $('notes').value + ' ' + strContentReplace;
$j('#notes').val($j('#notes').val() + ' ' + strContentReplace) ;
} else {
window.top.$('main_error').innerHTML = response.error;
window.top.$j('main_error').html(response.error);
}
},
error: function (error) {
alert(error);
}
});
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment