mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 05:35:12 +00:00
save notes every ten seconds while focused, then save them once more on focusout
This commit is contained in:
parent
78d7425a1d
commit
6ba32d714d
3 changed files with 19 additions and 5 deletions
|
@ -1133,14 +1133,13 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body,
|
|||
|
||||
if($r) {
|
||||
$r = q("UPDATE photo SET allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s'
|
||||
WHERE resource_id = '%s' AND uid = %d AND album = '%s' ",
|
||||
WHERE resource_id = '%s' AND uid = %d ",
|
||||
dbesc($str_contact_allow),
|
||||
dbesc($str_group_allow),
|
||||
dbesc($str_contact_deny),
|
||||
dbesc($str_group_deny),
|
||||
dbesc($image_uri),
|
||||
intval($uid),
|
||||
dbesc( t('Wall Photos'))
|
||||
intval($uid)
|
||||
);
|
||||
|
||||
// also update the linked item (which is probably invisible)
|
||||
|
|
|
@ -1 +1 @@
|
|||
2014-03-31.633
|
||||
2014-04-01.634
|
||||
|
|
|
@ -1,8 +1,23 @@
|
|||
<div class="widget">
|
||||
<script>
|
||||
var noteSaveTimer = null;
|
||||
$(document).on('focusout',"#note-text",function(e){
|
||||
$.post('notes', { 'note_text' : $('#note-text').val() });
|
||||
if(noteSaveTimer)
|
||||
clearTimeout(noteSaveTimer);
|
||||
noteSaveChanges();
|
||||
if(noteSaveTimer)
|
||||
clearTimeout(noteSaveTimer);
|
||||
noteSaveTimer = null;
|
||||
});
|
||||
|
||||
$(document).on('focusin',"#note-text",function(e){
|
||||
noteSaveTimer = setTimeout(noteSaveChanges,10000);
|
||||
});
|
||||
|
||||
function noteSaveChanges() {
|
||||
$.post('notes', { 'note_text' : $('#note-text').val() });
|
||||
noteSaveTimer = setTimeout(noteSaveChanges,10000);
|
||||
}
|
||||
</script>
|
||||
|
||||
<h3>{{$banner}}</h3>
|
||||
|
|
Loading…
Reference in a new issue