aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-12-01 14:10:47 +0100
committerMax Kostikov <max@kostikov.co>2019-12-01 14:10:47 +0100
commit7dcb0cc11b8909b8ac32a6eeedc9927180e9c371 (patch)
tree4593a6982a8f31edb16a6eeb09ed202b11d42534 /view/js/main.js
parent837d9a4df0dd80a94ce8d1b7e4747047ab2c9ecf (diff)
downloadvolse-hubzilla-7dcb0cc11b8909b8ac32a6eeedc9927180e9c371.tar.gz
volse-hubzilla-7dcb0cc11b8909b8ac32a6eeedc9927180e9c371.tar.bz2
volse-hubzilla-7dcb0cc11b8909b8ac32a6eeedc9927180e9c371.zip
Add pinning processing
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 8dd9d5b80..ac5daa771 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1121,6 +1121,30 @@ function doscrollback(pos) {
$(window).scrollTop(pos);
}
+function dopin(id) {
+ id = id.toString();
+ $('#like-rotator-' + id).show();
+ $.post('pin', { 'id' : id } )
+ .done(function() {
+ var i = $('#wall-item-pinned-' + id);
+ var me = $('#item-pinnable-' + id);
+ $('#pinned-wrapper-' + id).fadeOut(function() { this.remove() });
+ $('.wall-item-pinned').remove();
+ if(i.length)
+ me.html(me.html().replace(aStr['unpin_item'],aStr['pin_item']));
+ else {
+ $('<span class="float-right wall-item-pinned" title="' + aStr['pinned'] + '" id="wall-item-pinned-' + id + '"><i class="fa fa-thumb-tack">&nbsp;</i></span>')
+ me.html(me.html().replace(aStr['pin_item'],aStr['unpin_item']));
+ };
+ })
+ .fail(function() {
+ location.reload();
+ })
+ .always(function() {
+ $('#like-rotator-' + id).hide();
+ });
+}
+
function dropItem(url, object) {
var confirm = confirmDelete();