Bug 36084: Add a global #messages div
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
39843c2325
commit
20528b5efc
|
|
@ -1,4 +1,6 @@
|
|||
[% INCLUDE 'blocking_errors.inc' %]
|
||||
[% IF dev_install && debug_programming_error %]
|
||||
<div class="dialog alert">Programming error: [% debug_programming_error %]</div>
|
||||
[% END %]
|
||||
<div id="messages">
|
||||
[% INCLUDE 'blocking_errors.inc' %]
|
||||
[% IF dev_install && debug_programming_error %]
|
||||
<div class="dialog alert">Programming error: [% debug_programming_error %]</div>
|
||||
[% END %]
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@
|
|||
|
||||
<h1>Quote uploader</h1>
|
||||
|
||||
<div id="messages" style="display: none;">
|
||||
[%# FIXME Remove the following div and use #message instead %]
|
||||
<div id="messages_2" style="display: none;">
|
||||
<div class="import_success dialog message" style="display: none;"></div>
|
||||
<div class="import_error dialog alert" style="display: none;"></div>
|
||||
</div>
|
||||
|
|
@ -242,7 +243,7 @@
|
|||
if ( arrData[ arrData.length - 1 ] ) {
|
||||
arrData[ arrData.length - 1 ].push( strMatchedValue );
|
||||
} else {
|
||||
$("#messages .import_error").text(_("Something went wrong, check your CSV file."));
|
||||
$("#messages_2 .import_error").text(_("Something went wrong, check your CSV file."));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -389,24 +390,24 @@
|
|||
data : JSON.stringify(data),
|
||||
dataType : "application/json",
|
||||
success : function(data) {
|
||||
$("#messages").addClass("message").show();
|
||||
var import_success = $("#messages .import_success");
|
||||
$("#messages_2").addClass("message").show();
|
||||
var import_success = $("#messages_2 .import_success");
|
||||
import_success.show();
|
||||
import_success.data("nb")
|
||||
nb_success = import_success.data("nb") || 0;
|
||||
nb_success++;
|
||||
$("#messages .import_success").text(MSG_IMPORT_SUCCESS.format(nb_success));
|
||||
$("#messages_2 .import_success").text(MSG_IMPORT_SUCCESS.format(nb_success));
|
||||
import_success.data("nb", nb_success);
|
||||
},
|
||||
error : function(xhr) {
|
||||
if (xhr.status==201) { this.success(null, "Created", xhr); return; }
|
||||
$("#messages").addClass("alert").show();
|
||||
var import_error = $("#messages .import_error");
|
||||
$("#messages_2").addClass("alert").show();
|
||||
var import_error = $("#messages_2 .import_error");
|
||||
import_error.show();
|
||||
import_error.data("nb")
|
||||
nb_error = import_error.data("nb") || 0;
|
||||
nb_error++;
|
||||
$("#messages .import_error").text(MSG_IMPORT_ERROR.format(nb_error));
|
||||
$("#messages_2 .import_error").text(MSG_IMPORT_ERROR.format(nb_error));
|
||||
import_error.data("nb", nb_error);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
background-color: #fff;
|
||||
}
|
||||
|
||||
#messages {
|
||||
#messages_2 {
|
||||
font-weight: normal;
|
||||
}
|
||||
.cover_preview {
|
||||
|
|
@ -192,7 +192,8 @@
|
|||
|
||||
<div id="filedrag">
|
||||
<a id="click_to_select" href="#">Drop files here or click to select a file</a>
|
||||
<div id="messages"></div>
|
||||
[%# FIXME Remove the following div and use #message instead %]
|
||||
<div id="messages_2"></div>
|
||||
</div>
|
||||
|
||||
<div id="uploadpanel">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ $(document).ready(function(){
|
|||
|
||||
$("#filedrag").on("click", ".cancel_image", function(){
|
||||
$("#click_to_select").show();
|
||||
$("#messages").html("");
|
||||
$("#messages_2").html("");
|
||||
$("#fileToUpload").prop( "disabled", false );
|
||||
$("#process_images, #fileuploadstatus").hide();
|
||||
return false;
|
||||
|
|
@ -78,7 +78,7 @@ $(document).ready(function(){
|
|||
|
||||
function prepUpLoad( event ){
|
||||
$("#click_to_select,#upload_results").hide();
|
||||
$("#messages").html("");
|
||||
$("#messages_2").html("");
|
||||
var file;
|
||||
if( event ){
|
||||
file = event.originalEvent.dataTransfer.files[0];
|
||||
|
|
@ -185,7 +185,7 @@ function ParseFile(file) {
|
|||
|
||||
// output information
|
||||
function Output(msg) {
|
||||
var m = document.getElementById("messages");
|
||||
var m = document.getElementById("messages_2");
|
||||
m.innerHTML = msg + m.innerHTML;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue