2014-09-06 00:14:25 +02:00
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
|
|
|
|
<script language="javascript" type="text/javascript">
|
|
|
|
|
2017-01-27 04:50:27 +01:00
|
|
|
var editor = false;
|
2013-04-23 13:47:57 +02:00
|
|
|
var textlen = 0;
|
|
|
|
|
2017-01-27 04:50:27 +01:00
|
|
|
function initEditor(callback) {
|
|
|
|
if (editor == false) {
|
2016-02-03 14:03:00 +01:00
|
|
|
var colorbox_options = {
|
2020-12-23 09:25:55 +01:00
|
|
|
{{if $is_mobile}}
|
2016-02-03 14:03:00 +01:00
|
|
|
'width' : '100%',
|
|
|
|
'height' : '100%',
|
|
|
|
{{/if}}
|
|
|
|
'inline' : true,
|
|
|
|
'transition' : 'elastic'
|
|
|
|
}
|
2013-04-23 13:47:57 +02:00
|
|
|
|
2017-01-27 04:50:27 +01:00
|
|
|
$("#profile-jot-text-loading").show();
|
|
|
|
$("#profile-jot-text-loading").hide();
|
|
|
|
$("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
|
2019-10-04 04:40:42 +02:00
|
|
|
$("#profile-jot-text").editor_autocomplete(baseurl + '/search/acl');
|
2017-01-27 04:50:27 +01:00
|
|
|
$("#profile-jot-text").bbco_autocomplete('bbcode');
|
|
|
|
$("a#jot-perms-icon").colorbox(colorbox_options);
|
|
|
|
$(".jothidden").show();
|
2013-04-23 13:47:57 +02:00
|
|
|
|
2021-10-03 14:55:21 +02:00
|
|
|
$("#profile-jot-text").keyup(function(){
|
|
|
|
var textlen = $(this).val().length;
|
|
|
|
$('#character-counter').text(textlen);
|
|
|
|
});
|
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
editor = true;
|
2017-01-27 04:50:27 +01:00
|
|
|
}
|
|
|
|
if (typeof callback != "undefined") {
|
|
|
|
callback();
|
2013-04-23 13:47:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function enableOnUser(){
|
2017-01-27 04:50:27 +01:00
|
|
|
if (editor) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
$(this).val('');
|
2013-04-23 13:47:57 +02:00
|
|
|
initEditor();
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
2021-05-19 23:47:15 +02:00
|
|
|
<script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
|
2013-04-23 13:47:57 +02:00
|
|
|
<script>
|
2019-02-15 04:11:00 +01:00
|
|
|
var ispublic = '{{$ispublic nofilter}}';
|
2013-04-23 13:47:57 +02:00
|
|
|
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
$(document).ready(function() {
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2017-01-27 04:50:27 +01:00
|
|
|
/* enable editor on focus and click */
|
2013-04-23 13:47:57 +02:00
|
|
|
$("#profile-jot-text").focus(enableOnUser);
|
|
|
|
$("#profile-jot-text").click(enableOnUser);
|
|
|
|
|
2015-07-28 17:20:40 +02:00
|
|
|
/* show images / file browser window
|
2015-11-08 12:01:19 +01:00
|
|
|
*
|
2015-07-28 17:20:40 +02:00
|
|
|
**/
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2015-07-28 17:20:40 +02:00
|
|
|
/* callback */
|
2015-07-29 11:55:26 +02:00
|
|
|
$('body').on('fbrowser.image.main', function(e, filename, embedcode, id) {
|
2015-07-28 17:20:40 +02:00
|
|
|
$.colorbox.close();
|
|
|
|
addeditortext(embedcode);
|
|
|
|
});
|
2015-07-29 11:55:26 +02:00
|
|
|
$('body').on('fbrowser.file.main', function(e, filename, embedcode, id) {
|
2015-07-28 17:20:40 +02:00
|
|
|
$.colorbox.close();
|
|
|
|
addeditortext(embedcode);
|
|
|
|
});
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2015-07-28 17:20:40 +02:00
|
|
|
$('#wall-image-upload').on('click', function(){
|
2015-11-08 12:01:19 +01:00
|
|
|
Dialog.doImageBrowser("main");
|
2015-07-28 17:20:40 +02:00
|
|
|
});
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2015-07-28 17:20:40 +02:00
|
|
|
$('#wall-file-upload').on('click', function(){
|
2015-11-08 12:01:19 +01:00
|
|
|
Dialog.doFileBrowser("main");
|
2015-07-28 17:20:40 +02:00
|
|
|
});
|
2013-04-23 13:47:57 +02:00
|
|
|
});
|
|
|
|
|
2015-07-28 17:20:40 +02:00
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
function deleteCheckedItems() {
|
|
|
|
if(confirm('{{$delitems}}')) {
|
|
|
|
var checkedstr = '';
|
|
|
|
|
|
|
|
$("#item-delete-selected").hide();
|
|
|
|
$('#item-delete-selected-rotator').show();
|
|
|
|
|
|
|
|
$('.item-select').each( function() {
|
|
|
|
if($(this).is(':checked')) {
|
|
|
|
if(checkedstr.length != 0) {
|
|
|
|
checkedstr = checkedstr + ',' + $(this).val();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
checkedstr = $(this).val();
|
|
|
|
}
|
2015-06-03 20:57:30 +02:00
|
|
|
}
|
2013-04-23 13:47:57 +02:00
|
|
|
});
|
|
|
|
$.post('item', { dropitems: checkedstr }, function(data) {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function jotGetLink() {
|
|
|
|
reply = prompt("{{$linkurl}}");
|
|
|
|
if(reply && reply.length) {
|
|
|
|
reply = bin2hex(reply);
|
|
|
|
$('#profile-rotator').show();
|
2021-02-16 16:20:51 +01:00
|
|
|
$.get('parseurl?binurl=' + reply, function(data) {
|
2013-04-23 13:47:57 +02:00
|
|
|
addeditortext(data);
|
|
|
|
$('#profile-rotator').hide();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function jotVideoURL() {
|
|
|
|
reply = prompt("{{$vidurl}}");
|
|
|
|
if(reply && reply.length) {
|
|
|
|
addeditortext('[video]' + reply + '[/video]');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function jotAudioURL() {
|
|
|
|
reply = prompt("{{$audurl}}");
|
|
|
|
if(reply && reply.length) {
|
|
|
|
addeditortext('[audio]' + reply + '[/audio]');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function jotGetLocation() {
|
|
|
|
reply = prompt("{{$whereareu}}", $('#jot-location').val());
|
|
|
|
if(reply && reply.length) {
|
|
|
|
$('#jot-location').val(reply);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function jotShare(id) {
|
|
|
|
if ($('#jot-popup').length != 0) $('#jot-popup').show();
|
|
|
|
|
|
|
|
$('#like-rotator-' + id).show();
|
2022-11-04 18:01:25 +01:00
|
|
|
$.get('post/' + id + '/share', function(data) {
|
2013-04-23 13:47:57 +02:00
|
|
|
if (!editor) $("#profile-jot-text").val("");
|
|
|
|
initEditor(function(){
|
|
|
|
addeditortext(data);
|
|
|
|
$('#like-rotator-' + id).hide();
|
|
|
|
$(window).scrollTop(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function linkdropper(event) {
|
|
|
|
var linkFound = event.dataTransfer.types.contains("text/uri-list");
|
|
|
|
if(linkFound)
|
|
|
|
event.preventDefault();
|
|
|
|
}
|
|
|
|
|
|
|
|
function linkdrop(event) {
|
|
|
|
var reply = event.dataTransfer.getData("text/uri-list");
|
|
|
|
event.target.textContent = reply;
|
|
|
|
event.preventDefault();
|
|
|
|
if(reply && reply.length) {
|
|
|
|
reply = bin2hex(reply);
|
|
|
|
$('#profile-rotator').show();
|
2021-02-16 16:20:51 +01:00
|
|
|
$.get('parseurl?binurl=' + reply, function(data) {
|
2013-04-23 13:47:57 +02:00
|
|
|
if (!editor) $("#profile-jot-text").val("");
|
|
|
|
initEditor(function(){
|
|
|
|
addeditortext(data);
|
|
|
|
$('#profile-rotator').hide();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function itemTag(id) {
|
|
|
|
reply = prompt("{{$term}}");
|
|
|
|
if(reply && reply.length) {
|
|
|
|
reply = reply.replace('#','');
|
|
|
|
if(reply.length) {
|
|
|
|
|
|
|
|
commentBusy = true;
|
|
|
|
$('body').css('cursor', 'wait');
|
|
|
|
|
2022-11-04 03:26:48 +01:00
|
|
|
$.post('post/' + id + '/tag/add', {term: reply});
|
2013-04-23 13:47:57 +02:00
|
|
|
if(timer) clearTimeout(timer);
|
|
|
|
timer = setTimeout(NavUpdate,3000);
|
|
|
|
liking = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function itemFiler(id) {
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
var bordercolor = $("input").css("border-color");
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
$.get('filer/', function(data){
|
|
|
|
$.colorbox({html:data});
|
|
|
|
$("#id_term").keypress(function(){
|
|
|
|
$(this).css("border-color",bordercolor);
|
|
|
|
})
|
|
|
|
$("#select_term").change(function(){
|
|
|
|
$("#id_term").css("border-color",bordercolor);
|
|
|
|
})
|
2015-11-08 12:01:19 +01:00
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
$("#filer_save").click(function(e){
|
|
|
|
e.preventDefault();
|
|
|
|
reply = $("#id_term").val();
|
|
|
|
if(reply && reply.length) {
|
|
|
|
commentBusy = true;
|
|
|
|
$('body').css('cursor', 'wait');
|
|
|
|
$.get('filer/' + id + '?term=' + reply, NavUpdate);
|
|
|
|
// if(timer) clearTimeout(timer);
|
|
|
|
// timer = setTimeout(NavUpdate,3000);
|
|
|
|
liking = 1;
|
2021-08-12 07:28:47 +02:00
|
|
|
force_update = true;
|
2013-04-23 13:47:57 +02:00
|
|
|
$.colorbox.close();
|
|
|
|
} else {
|
|
|
|
$("#id_term").css("border-color","#FF0000");
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
2015-06-03 20:57:30 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-04-23 13:47:57 +02:00
|
|
|
function jotClearLocation() {
|
|
|
|
$('#jot-coord').val('');
|
|
|
|
$('#profile-nolocation-wrapper').hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
function addeditortext(data) {
|
2017-01-27 04:50:27 +01:00
|
|
|
var currentText = $("#profile-jot-text").val();
|
|
|
|
$("#profile-jot-text").val(currentText + data);
|
2015-11-08 12:01:19 +01:00
|
|
|
}
|
2013-04-23 13:47:57 +02:00
|
|
|
|
2019-01-24 17:23:25 +01:00
|
|
|
{{$geotag nofilter}}
|
2013-04-23 13:47:57 +02:00
|
|
|
|
|
|
|
</script>
|
|
|
|
|