autosave only when the content changed
This commit is contained in:
parent
62bcc0be74
commit
ce3b22e3b9
|
@ -47,7 +47,7 @@ $numberOfPages = count($listOfFilesByPage);
|
||||||
|
|
||||||
<!-- Progress bar -->
|
<!-- Progress bar -->
|
||||||
<div class="progress mt-2">
|
<div class="progress mt-2">
|
||||||
<div id="jsbluditProgressBar" class="progress-bar bg-info" role="progressbar" style="width:0%"></div>
|
<div id="jsbluditProgressBar" class="progress-bar bg-primary" role="progressbar" style="width:0%"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -115,7 +115,7 @@ function displayFiles(files) {
|
||||||
'<div>'+
|
'<div>'+
|
||||||
'<button type="button" class="btn btn-primary btn-sm mr-2" onClick="editorInsertMedia(\''+image+'\'); closeMediaManager();"><?php $L->p('Insert') ?><\/button>'+
|
'<button type="button" class="btn btn-primary btn-sm mr-2" onClick="editorInsertMedia(\''+image+'\'); closeMediaManager();"><?php $L->p('Insert') ?><\/button>'+
|
||||||
'<button type="button" class="btn btn-primary btn-sm" onClick="setCoverImage(\''+filename+'\'); closeMediaManager();"><?php $L->p('Set as cover image') ?><\/button>'+
|
'<button type="button" class="btn btn-primary btn-sm" onClick="setCoverImage(\''+filename+'\'); closeMediaManager();"><?php $L->p('Set as cover image') ?><\/button>'+
|
||||||
'<button type="button" class="btn btn-secondary btn-sm float-right" onClick="deleteMedia(\''+filename+'\')"><?php $L->p('Delete') ?><\/button>'+
|
'<button type="button" class="btn btn-danger btn-sm float-right" onClick="deleteMedia(\''+filename+'\')"><?php $L->p('Delete') ?><\/button>'+
|
||||||
'<\/div>'+
|
'<\/div>'+
|
||||||
'<\/td>'+
|
'<\/td>'+
|
||||||
'<\/tr>';
|
'<\/tr>';
|
||||||
|
|
|
@ -474,15 +474,20 @@ $(document).ready(function() {
|
||||||
$("#jsform").submit();
|
$("#jsform").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Autosave interval
|
// Autosave
|
||||||
// Autosave works when the content of the page is bigger than 100 characters
|
// Autosave works when the content of the page is bigger than 100 characters
|
||||||
|
var currentContent = editorGetContent();
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
var uuid = $("#jsuuid").val();
|
var uuid = $("#jsuuid").val();
|
||||||
var title = $("#jstitle").val();
|
var title = $("#jstitle").val();
|
||||||
var content = editorGetContent();
|
var content = editorGetContent();
|
||||||
var ajax = new bluditAjax();
|
// Call autosave only when the user change the content
|
||||||
// showAlert is the function to display an alert defined in alert.php
|
if (currentContent!=content) {
|
||||||
ajax.autosave(uuid, title, content, showAlert);
|
currentContent = content;
|
||||||
|
var ajax = new bluditAjax();
|
||||||
|
// showAlert is the function to display an alert defined in alert.php
|
||||||
|
ajax.autosave(uuid, title, content, showAlert);
|
||||||
|
}
|
||||||
},1000*60*AUTOSAVE_INTERVAL);
|
},1000*60*AUTOSAVE_INTERVAL);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -418,7 +418,7 @@ $(document).ready(function() {
|
||||||
$("#jsform").submit();
|
$("#jsform").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Autosave interval
|
// Autosave
|
||||||
// Autosave works when the content of the page is bigger than 100 characters
|
// Autosave works when the content of the page is bigger than 100 characters
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
var uuid = $("#jsuuid").val();
|
var uuid = $("#jsuuid").val();
|
||||||
|
|
|
@ -96,7 +96,7 @@ define('SESSION_COOKIE_LIFE_TIME', 0);
|
||||||
$GLOBALS['ALERT_DISSAPEAR_IN'] = 3; // Seconds
|
$GLOBALS['ALERT_DISSAPEAR_IN'] = 3; // Seconds
|
||||||
|
|
||||||
// Number of images to show in the media manager per page
|
// Number of images to show in the media manager per page
|
||||||
$GLOBALS['MEDIA_MANAGER_NUMBER_OF_FILES'] = 5;
|
$GLOBALS['MEDIA_MANAGER_NUMBER_OF_FILES'] = 2;
|
||||||
|
|
||||||
// Sort the image by date
|
// Sort the image by date
|
||||||
$GLOBALS['MEDIA_MANAGER_SORT_BY_DATE'] = true;
|
$GLOBALS['MEDIA_MANAGER_SORT_BY_DATE'] = true;
|
||||||
|
|
|
@ -359,9 +359,9 @@
|
||||||
"good-morning": "Buenos días",
|
"good-morning": "Buenos días",
|
||||||
"good-afternoon": "Buenas tardes",
|
"good-afternoon": "Buenas tardes",
|
||||||
"good-evening": "Buenas noches",
|
"good-evening": "Buenas noches",
|
||||||
"good-night": "Good night",
|
"good-night": "Buenas noches",
|
||||||
"hello": "Hola",
|
"hello": "Hola",
|
||||||
"there-are-no-images-for-the-page": "There are no images for the page.",
|
"there-are-no-images-for-the-page": "No hay imágenes para la página.",
|
||||||
"select-cover-image": "Select cover image",
|
"select-cover-image": "Seleccionar imagen de portada",
|
||||||
"this-plugin-depends-on-the-following-plugins": "This plugin depends on the following plugins."
|
"this-plugin-depends-on-the-following-plugins": "Este plugin depende de los siguientes plugins."
|
||||||
}
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"plugin-data":
|
||||||
|
{
|
||||||
|
"name": "Contador de visitas",
|
||||||
|
"description": "Muestre el número de visitas o visitantes únicos en la barra lateral de su sitio."
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue