2010-08-03 02:06:36 +00:00
|
|
|
<script language="javascript" type="text/javascript">
|
2010-07-01 23:48:07 +00:00
|
|
|
|
2015-03-12 21:57:00 +00:00
|
|
|
var editor = false;
|
2013-05-08 08:23:17 +00:00
|
|
|
var plaintext = '{{$editselect}}';
|
2015-09-10 02:54:16 +00:00
|
|
|
var pretext = '{{$pretext}}';
|
2011-01-31 22:21:23 +00:00
|
|
|
|
2011-07-22 06:46:29 +00:00
|
|
|
function initEditor(cb){
|
|
|
|
if (editor==false){
|
2017-09-26 11:02:11 +00:00
|
|
|
$("#profile-jot-text-loading").show();
|
2016-06-30 00:53:59 +00:00
|
|
|
{{$geotag}}
|
2012-02-07 04:28:50 +00:00
|
|
|
if(plaintext == 'none') {
|
2017-09-26 11:02:11 +00:00
|
|
|
$("#profile-jot-text-loading").hide();
|
2017-03-18 16:28:46 +00:00
|
|
|
$("#profile-jot-text").css({ 'height': 200 });
|
2016-04-09 10:16:42 +00:00
|
|
|
{{if $bbco_autocomplete}}
|
|
|
|
$("#profile-jot-text").bbco_autocomplete('{{$bbco_autocomplete}}'); // autocomplete bbcode
|
|
|
|
{{/if}}
|
|
|
|
{{if $editor_autocomplete}}
|
2015-01-04 23:28:42 +00:00
|
|
|
if(typeof channelId === 'undefined')
|
2015-01-07 17:57:16 +00:00
|
|
|
$("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
|
2015-01-04 23:28:42 +00:00
|
|
|
else
|
2015-01-07 17:57:16 +00:00
|
|
|
$("#profile-jot-text").editor_autocomplete(baseurl+"/acl",[channelId]); // Also gives suggestions from current channel's connections
|
2016-04-09 10:16:42 +00:00
|
|
|
{{/if}}
|
2012-02-07 04:28:50 +00:00
|
|
|
editor = true;
|
2013-04-26 21:31:50 +00:00
|
|
|
$("a#jot-perms-icon").colorbox({
|
|
|
|
'inline' : true,
|
|
|
|
'transition' : 'elastic'
|
2012-02-27 06:04:41 +00:00
|
|
|
});
|
2012-02-17 19:49:27 +00:00
|
|
|
$(".jothidden").show();
|
2016-10-30 12:34:47 +00:00
|
|
|
$("#profile-jot-text").addClass('jot-expanded');
|
2012-02-07 04:28:50 +00:00
|
|
|
if (typeof cb!="undefined") cb();
|
2015-09-10 02:54:16 +00:00
|
|
|
if(pretext.length)
|
|
|
|
addeditortext(pretext);
|
2012-02-07 04:28:50 +00:00
|
|
|
return;
|
2015-03-12 21:57:00 +00:00
|
|
|
}
|
2011-07-22 06:46:29 +00:00
|
|
|
tinyMCE.init({
|
|
|
|
theme : "advanced",
|
|
|
|
mode : "specific_textareas",
|
2013-05-08 08:23:17 +00:00
|
|
|
editor_selector: {{$editselect}},
|
2011-07-26 03:10:21 +00:00
|
|
|
auto_focus: "profile-jot-text",
|
2012-04-18 12:55:21 +00:00
|
|
|
plugins : "bbcode,paste,autoresize, inlinepopups",
|
2011-07-22 06:46:29 +00:00
|
|
|
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
|
|
|
|
theme_advanced_buttons2 : "",
|
|
|
|
theme_advanced_buttons3 : "",
|
|
|
|
theme_advanced_toolbar_location : "top",
|
|
|
|
theme_advanced_toolbar_align : "center",
|
|
|
|
theme_advanced_blockformats : "blockquote,code",
|
2012-03-27 22:20:36 +00:00
|
|
|
gecko_spellcheck : true,
|
2011-07-22 06:46:29 +00:00
|
|
|
paste_text_sticky : true,
|
|
|
|
entity_encoding : "raw",
|
|
|
|
add_unload_trigger : false,
|
|
|
|
remove_linebreaks : false,
|
|
|
|
force_p_newlines : false,
|
|
|
|
force_br_newlines : true,
|
|
|
|
forced_root_block : '',
|
|
|
|
convert_urls: false,
|
2013-05-08 08:23:17 +00:00
|
|
|
content_css: "{{$baseurl}}/view/custom_tinymce.css",
|
2011-07-22 06:46:29 +00:00
|
|
|
theme_advanced_path : false,
|
2012-04-18 11:23:42 +00:00
|
|
|
file_browser_callback : "fcFileBrowser",
|
2011-07-22 06:46:29 +00:00
|
|
|
setup : function(ed) {
|
2011-11-04 03:40:56 +00:00
|
|
|
cPopup = null;
|
|
|
|
ed.onKeyDown.add(function(ed,e) {
|
|
|
|
if(cPopup !== null)
|
|
|
|
cPopup.onkey(e);
|
|
|
|
});
|
|
|
|
|
2011-07-22 06:46:29 +00:00
|
|
|
ed.onKeyUp.add(function(ed, e) {
|
|
|
|
var txt = tinyMCE.activeEditor.getContent();
|
2011-11-04 03:40:56 +00:00
|
|
|
match = txt.match(/@([^ \n]+)$/);
|
|
|
|
if(match!==null) {
|
|
|
|
if(cPopup === null) {
|
|
|
|
cPopup = new ACPopup(this,baseurl+"/acl");
|
|
|
|
}
|
|
|
|
if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
|
|
|
|
if(! cPopup.ready) cPopup = null;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(cPopup !== null) { cPopup.close(); cPopup = null; }
|
|
|
|
}
|
2011-07-22 06:46:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
ed.onInit.add(function(ed) {
|
|
|
|
ed.pasteAsPlainText = true;
|
2017-09-26 11:02:11 +00:00
|
|
|
$("#profile-jot-text-loading").hide();
|
2011-12-19 17:02:43 +00:00
|
|
|
$(".jothidden").show();
|
2011-07-22 06:46:29 +00:00
|
|
|
if (typeof cb!="undefined") cb();
|
|
|
|
});
|
2011-05-20 03:11:09 +00:00
|
|
|
|
2011-07-22 06:46:29 +00:00
|
|
|
}
|
|
|
|
});
|
2012-07-26 05:55:43 +00:00
|
|
|
|
2011-07-22 06:46:29 +00:00
|
|
|
editor = true;
|
|
|
|
} else {
|
|
|
|
if (typeof cb!="undefined") cb();
|
|
|
|
}
|
2011-07-20 09:08:42 +00:00
|
|
|
}
|
2011-07-20 08:00:33 +00:00
|
|
|
|
2011-12-19 17:02:43 +00:00
|
|
|
function enableOnUser(){
|
|
|
|
if (editor) return;
|
|
|
|
$(this).val("");
|
|
|
|
initEditor();
|
|
|
|
}
|
2010-07-23 03:22:03 +00:00
|
|
|
</script>
|
2017-07-14 00:04:58 +00:00
|
|
|
|
|
|
|
<script src="library/blueimp_upload/js/vendor/jquery.ui.widget.js"></script>
|
|
|
|
<script src="library/blueimp_upload/js/jquery.iframe-transport.js"></script>
|
|
|
|
<script src="library/blueimp_upload/js/jquery.fileupload.js"></script>
|
|
|
|
|
2010-07-23 03:22:03 +00:00
|
|
|
<script>
|
2017-08-09 05:55:47 +00:00
|
|
|
var activeCommentID = 0;
|
|
|
|
var activeCommentText = '';
|
|
|
|
|
2010-07-23 03:22:03 +00:00
|
|
|
$(document).ready(function() {
|
2018-01-30 02:43:20 +00:00
|
|
|
|
2011-12-19 17:02:43 +00:00
|
|
|
/* enable tinymce on focus and click */
|
|
|
|
$("#profile-jot-text").focus(enableOnUser);
|
|
|
|
$("#profile-jot-text").click(enableOnUser);
|
2015-04-16 21:26:11 +00:00
|
|
|
|
2018-01-30 02:43:20 +00:00
|
|
|
$('#id_mimetype').on('load', jotSetMime);
|
|
|
|
$('#id_mimetype').on('change', jotSetMime);
|
|
|
|
|
|
|
|
function jotSetMime() {
|
|
|
|
var mtype = $('#id_mimetype').val();
|
|
|
|
if(mtype == 'text/bbcode')
|
|
|
|
$('#profile-jot-submit-left').show();
|
|
|
|
else
|
|
|
|
$('#profile-jot-submit-left').hide();
|
|
|
|
}
|
2017-07-14 00:04:58 +00:00
|
|
|
|
|
|
|
$('#invisible-wall-file-upload').fileupload({
|
|
|
|
url: 'wall_attach/{{$nickname}}',
|
|
|
|
dataType: 'json',
|
|
|
|
dropZone: $('#profile-jot-text'),
|
|
|
|
maxChunkSize: 4 * 1024 * 1024,
|
|
|
|
add: function(e,data) {
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#profile-rotator').show();
|
2017-07-14 00:04:58 +00:00
|
|
|
data.submit();
|
|
|
|
},
|
|
|
|
done: function(e,data) {
|
|
|
|
addeditortext(data.result.message);
|
|
|
|
$('#jot-media').val($('#jot-media').val() + data.result.message);
|
|
|
|
},
|
|
|
|
stop: function(e,data) {
|
2017-08-02 01:05:04 +00:00
|
|
|
preview_post();
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#profile-rotator').hide();
|
2017-07-14 00:04:58 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#wall-file-upload').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
|
|
|
|
$('#wall-file-upload-sub').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
|
|
|
|
|
2016-07-24 21:33:34 +00:00
|
|
|
// call initialization file
|
|
|
|
if (window.File && window.FileList && window.FileReader) {
|
|
|
|
DragDropUploadInit();
|
|
|
|
}
|
2017-07-14 00:04:58 +00:00
|
|
|
|
2017-08-09 05:55:47 +00:00
|
|
|
|
|
|
|
$('#invisible-comment-upload').fileupload({
|
|
|
|
url: 'wall_attach/{{$nickname}}',
|
|
|
|
dataType: 'json',
|
|
|
|
maxChunkSize: 4 * 1024 * 1024,
|
|
|
|
add: function(e,data) {
|
|
|
|
|
|
|
|
var tmpStr = $("#comment-edit-text-" + activeCommentID).val();
|
|
|
|
if(tmpStr == activeCommentText) {
|
|
|
|
tmpStr = "";
|
|
|
|
$("#comment-edit-text-" + activeCommentID).addClass("comment-edit-text-full");
|
|
|
|
$("#comment-edit-text-" + activeCommentID).removeClass("comment-edit-text-empty");
|
|
|
|
openMenu("comment-tools-" + activeCommentID);
|
|
|
|
$("#comment-edit-text-" + activeCommentID).val(tmpStr);
|
|
|
|
}
|
|
|
|
data.submit();
|
|
|
|
},
|
|
|
|
|
|
|
|
done: function(e,data) {
|
|
|
|
textarea = document.getElementById("comment-edit-text-" + activeCommentID);
|
|
|
|
textarea.value = textarea.value + data.result.message;
|
|
|
|
},
|
|
|
|
stop: function(e,data) {
|
|
|
|
$('body').css('cursor', 'auto');
|
|
|
|
preview_comment(activeCommentID);
|
|
|
|
activeCommentID = 0;
|
|
|
|
},
|
|
|
|
});
|
2010-07-23 03:22:03 +00:00
|
|
|
});
|
|
|
|
|
2011-06-16 03:43:39 +00:00
|
|
|
function deleteCheckedItems() {
|
|
|
|
var checkedstr = '';
|
|
|
|
|
|
|
|
$('.item-select').each( function() {
|
|
|
|
if($(this).is(':checked')) {
|
2011-06-16 22:26:39 +00:00
|
|
|
if(checkedstr.length != 0) {
|
2011-06-16 03:43:39 +00:00
|
|
|
checkedstr = checkedstr + ',' + $(this).val();
|
2011-06-16 22:26:39 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-06-16 03:43:39 +00:00
|
|
|
checkedstr = $(this).val();
|
2011-06-16 22:26:39 +00:00
|
|
|
}
|
2015-03-12 21:57:00 +00:00
|
|
|
}
|
2011-06-16 03:43:39 +00:00
|
|
|
});
|
2011-06-16 07:38:41 +00:00
|
|
|
$.post('item', { dropitems: checkedstr }, function(data) {
|
|
|
|
window.location.reload();
|
|
|
|
});
|
2011-06-16 03:43:39 +00:00
|
|
|
}
|
|
|
|
|
2010-07-23 05:41:45 +00:00
|
|
|
function jotGetLink() {
|
2015-11-21 02:55:13 +00:00
|
|
|
textarea = document.getElementById('profile-jot-text');
|
|
|
|
if (textarea.selectionStart || textarea.selectionStart == "0") {
|
|
|
|
var start = textarea.selectionStart;
|
|
|
|
var end = textarea.selectionEnd;
|
|
|
|
if (end > start) {
|
|
|
|
reply = prompt("{{$linkurl}}");
|
|
|
|
if(reply && reply.length) {
|
|
|
|
textarea.value = textarea.value.substring(0, start) + "[url=" + reply + "]" + textarea.value.substring(start, end) + "[/url]" + textarea.value.substring(end, textarea.value.length);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
reply = prompt("{{$linkurl}}");
|
|
|
|
if(reply && reply.length) {
|
|
|
|
reply = bin2hex(reply);
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#profile-rotator').show();
|
2015-11-21 02:55:13 +00:00
|
|
|
$.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
|
|
|
|
addeditortext(data);
|
2017-08-02 01:05:04 +00:00
|
|
|
preview_post();
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#profile-rotator').hide();
|
2015-11-21 02:55:13 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-07-23 05:41:45 +00:00
|
|
|
}
|
|
|
|
|
2010-08-20 21:33:15 +00:00
|
|
|
function jotGetLocation() {
|
2013-05-08 08:23:17 +00:00
|
|
|
reply = prompt("{{$whereareu}}", $('#jot-location').val());
|
2010-08-20 21:33:15 +00:00
|
|
|
if(reply && reply.length) {
|
|
|
|
$('#jot-location').val(reply);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-07 08:47:50 +00:00
|
|
|
function jotGetExpiry() {
|
2013-12-22 13:21:57 +00:00
|
|
|
//reply = prompt("{{$expirewhen}}", $('#jot-expire').val());
|
|
|
|
$('#expiryModal').modal();
|
|
|
|
$('#expiry-modal-OKButton').on('click', function() {
|
2015-03-12 21:57:00 +00:00
|
|
|
reply=$('#expiration-date').val();
|
|
|
|
if(reply && reply.length) {
|
|
|
|
$('#jot-expire').val(reply);
|
|
|
|
$('#expiryModal').modal('hide');
|
|
|
|
}
|
|
|
|
})
|
2013-11-07 08:47:50 +00:00
|
|
|
}
|
|
|
|
|
2015-10-25 23:54:18 +00:00
|
|
|
function jotGetPubDate() {
|
|
|
|
//reply = prompt("{{$expirewhen}}", $('#jot-expire').val());
|
|
|
|
$('#createdModal').modal();
|
|
|
|
$('#created-modal-OKButton').on('click', function() {
|
|
|
|
reply=$('#created-date').val();
|
|
|
|
if(reply && reply.length) {
|
|
|
|
$('#jot-created').val(reply);
|
|
|
|
$('#createdModal').modal('hide');
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-09-06 01:32:37 +00:00
|
|
|
function jotShare(id,post_type) {
|
|
|
|
if(post_type == 6) {
|
|
|
|
window.location.href = 'rpost?f=&post_id='+id;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($('#jot-popup').length != 0) $('#jot-popup').show();
|
2012-02-13 08:33:20 +00:00
|
|
|
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#like-rotator-' + id).show();
|
2017-09-06 01:32:37 +00:00
|
|
|
$.get('{{$baseurl}}/share/' + id, function(data) {
|
|
|
|
if (!editor) $("#profile-jot-text").val("");
|
|
|
|
initEditor(function(){
|
|
|
|
addeditortext(data);
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#like-rotator-' + id).hide();
|
2017-09-06 01:32:37 +00:00
|
|
|
$(window).scrollTop(0);
|
|
|
|
});
|
2011-07-22 06:46:29 +00:00
|
|
|
});
|
2017-09-06 01:32:37 +00:00
|
|
|
}
|
2011-03-17 02:36:59 +00:00
|
|
|
}
|
2010-08-20 21:33:15 +00:00
|
|
|
|
2010-08-03 02:06:36 +00:00
|
|
|
function linkdropper(event) {
|
|
|
|
var linkFound = event.dataTransfer.types.contains("text/uri-list");
|
2016-09-06 00:08:48 +00:00
|
|
|
if(linkFound) {
|
2010-08-03 02:06:36 +00:00
|
|
|
event.preventDefault();
|
2016-09-06 00:08:48 +00:00
|
|
|
var editwin = '#' + event.target.id;
|
|
|
|
var commentwin = false;
|
|
|
|
if(editwin) {
|
|
|
|
commentwin = ((editwin.indexOf('comment') >= 0) ? true : false);
|
|
|
|
if(commentwin) {
|
|
|
|
var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
|
|
|
|
$('#comment-edit-text-' + commentid).addClass('hover');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function linkdropexit(event) {
|
|
|
|
var editwin = '#' + event.target.id;
|
|
|
|
var commentwin = false;
|
|
|
|
if(editwin) {
|
|
|
|
commentwin = ((editwin.indexOf('comment') >= 0) ? true : false);
|
|
|
|
if(commentwin) {
|
|
|
|
var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
|
|
|
|
$('#comment-edit-text-' + commentid).removeClass('hover');
|
|
|
|
}
|
|
|
|
}
|
2010-08-03 02:06:36 +00:00
|
|
|
}
|
2010-07-24 13:56:02 +00:00
|
|
|
|
2010-08-03 02:06:36 +00:00
|
|
|
function linkdrop(event) {
|
|
|
|
var reply = event.dataTransfer.getData("text/uri-list");
|
2017-07-14 00:04:58 +00:00
|
|
|
if(reply) {
|
|
|
|
event.preventDefault();
|
|
|
|
var editwin = '#' + event.target.id;
|
|
|
|
var commentwin = false;
|
|
|
|
if(editwin) {
|
|
|
|
commentwin = ((editwin.indexOf('comment') >= 0) ? true : false);
|
|
|
|
if(commentwin) {
|
|
|
|
var commentid = editwin.substring(editwin.lastIndexOf('-') + 1);
|
|
|
|
commentOpen(document.getElementById(event.target.id),commentid);
|
2016-09-06 00:08:48 +00:00
|
|
|
|
2017-07-14 00:04:58 +00:00
|
|
|
}
|
2016-08-10 08:35:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-03 02:06:36 +00:00
|
|
|
if(reply && reply.length) {
|
2011-11-09 08:29:14 +00:00
|
|
|
reply = bin2hex(reply);
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#profile-rotator').show();
|
2015-08-26 02:23:21 +00:00
|
|
|
$.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
|
2016-08-10 08:35:58 +00:00
|
|
|
if(commentwin) {
|
2016-08-10 05:52:14 +00:00
|
|
|
$(editwin).val( $(editwin).val() + data );
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#profile-rotator').hide();
|
2016-08-10 08:35:58 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!editor) $("#profile-jot-text").val("");
|
|
|
|
initEditor(function(){
|
|
|
|
addeditortext(data);
|
2017-09-26 11:02:11 +00:00
|
|
|
$('#profile-rotator').hide();
|
2016-08-10 08:35:58 +00:00
|
|
|
});
|
|
|
|
}
|
2010-08-03 02:06:36 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2010-07-23 05:41:45 +00:00
|
|
|
|
2011-10-24 22:47:17 +00:00
|
|
|
function itemTag(id) {
|
2013-05-08 08:23:17 +00:00
|
|
|
reply = prompt("{{$term}}");
|
2011-10-24 22:47:17 +00:00
|
|
|
if(reply && reply.length) {
|
2011-10-25 00:00:22 +00:00
|
|
|
reply = reply.replace('#','');
|
2011-10-24 22:47:17 +00:00
|
|
|
if(reply.length) {
|
2011-11-11 01:11:55 +00:00
|
|
|
|
|
|
|
commentBusy = true;
|
|
|
|
$('body').css('cursor', 'wait');
|
|
|
|
|
2013-05-08 08:23:17 +00:00
|
|
|
$.get('{{$baseurl}}/tagger/' + id + '?term=' + reply);
|
2011-11-11 01:11:55 +00:00
|
|
|
if(timer) clearTimeout(timer);
|
2018-01-04 10:31:48 +00:00
|
|
|
timer = setTimeout(updateInit,3000);
|
2011-11-11 01:11:55 +00:00
|
|
|
liking = 1;
|
2011-10-24 22:47:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-14 01:13:03 +00:00
|
|
|
function itemFiler(id) {
|
2017-03-17 13:22:10 +00:00
|
|
|
if($('#item-filer-dialog').length)
|
|
|
|
$('#item-filer-dialog').remove();
|
2015-03-12 21:57:00 +00:00
|
|
|
|
2012-03-28 08:49:34 +00:00
|
|
|
$.get('filer/', function(data){
|
2017-03-17 13:22:10 +00:00
|
|
|
$('body').append(data);
|
|
|
|
$('#item-filer-dialog').modal('show');
|
2012-03-28 08:49:34 +00:00
|
|
|
$("#filer_save").click(function(e){
|
|
|
|
e.preventDefault();
|
|
|
|
reply = $("#id_term").val();
|
|
|
|
if(reply && reply.length) {
|
|
|
|
commentBusy = true;
|
|
|
|
$('body').css('cursor', 'wait');
|
2018-01-04 10:31:48 +00:00
|
|
|
$.get('{{$baseurl}}/filer/' + id + '?term=' + reply, updateInit);
|
2012-03-28 08:49:34 +00:00
|
|
|
liking = 1;
|
2017-03-17 13:22:10 +00:00
|
|
|
$('#item-filer-dialog').modal('hide');
|
2012-03-28 08:49:34 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2012-03-14 01:13:03 +00:00
|
|
|
}
|
|
|
|
|
2014-02-05 01:12:13 +00:00
|
|
|
function itemBookmark(id) {
|
|
|
|
$.get('{{$baseurl}}/bookmarks?f=&item=' + id);
|
|
|
|
if(timer) clearTimeout(timer);
|
2018-01-04 10:31:48 +00:00
|
|
|
timer = setTimeout(updateInit,1000);
|
2014-02-05 01:12:13 +00:00
|
|
|
}
|
|
|
|
|
2014-05-30 03:09:21 +00:00
|
|
|
function itemAddToCal(id) {
|
2014-05-30 04:25:19 +00:00
|
|
|
$.get('{{$baseurl}}/events/add/' + id);
|
2014-05-30 03:09:21 +00:00
|
|
|
if(timer) clearTimeout(timer);
|
2018-01-04 10:31:48 +00:00
|
|
|
timer = setTimeout(updateInit,1000);
|
2014-05-30 03:09:21 +00:00
|
|
|
}
|
|
|
|
|
2015-02-11 03:10:18 +00:00
|
|
|
function toggleVoting() {
|
|
|
|
if($('#jot-consensus').val() > 0) {
|
|
|
|
$('#jot-consensus').val(0);
|
2016-04-30 19:59:02 +00:00
|
|
|
$('#profile-voting, #profile-voting-sub').removeClass('fa-check-square-o').addClass('fa-square-o');
|
2015-02-11 03:10:18 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#jot-consensus').val(1);
|
2016-04-30 19:59:02 +00:00
|
|
|
$('#profile-voting, #profile-voting-sub').removeClass('fa-square-o').addClass('fa-check-square-o');
|
2015-02-11 03:10:18 +00:00
|
|
|
}
|
|
|
|
}
|
2014-02-05 01:12:13 +00:00
|
|
|
|
2016-08-14 10:41:12 +00:00
|
|
|
function toggleNoComment() {
|
|
|
|
if($('#jot-nocomment').val() > 0) {
|
|
|
|
$('#jot-nocomment').val(0);
|
|
|
|
$('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments-o').addClass('fa-comments');
|
2016-08-14 10:46:48 +00:00
|
|
|
$('#profile-nocomment-wrapper').attr('title', '{{$nocomment_enabled}}');
|
2016-08-14 10:41:12 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$('#jot-nocomment').val(1);
|
|
|
|
$('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments').addClass('fa-comments-o');
|
2016-08-14 10:46:48 +00:00
|
|
|
$('#profile-nocomment-wrapper').attr('title', '{{$nocomment_disabled}}');
|
2016-08-14 10:41:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-03 05:06:19 +00:00
|
|
|
function jotReact(id,icon) {
|
|
|
|
if(id && icon) {
|
|
|
|
$.get('{{$baseurl}}/react?f=&postid=' + id + '&emoji=' + icon);
|
|
|
|
if(timer) clearTimeout(timer);
|
2018-01-04 10:31:48 +00:00
|
|
|
timer = setTimeout(updateInit,1000);
|
2016-06-03 05:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-20 07:33:17 +00:00
|
|
|
function jotClearLocation() {
|
|
|
|
$('#jot-coord').val('');
|
2014-12-09 14:09:19 +00:00
|
|
|
$('#profile-nolocation-wrapper').attr('disabled', true);
|
2010-10-20 07:33:17 +00:00
|
|
|
}
|
|
|
|
|
2016-06-13 00:10:37 +00:00
|
|
|
|
|
|
|
var initializeEmbedPhotoDialog = function () {
|
|
|
|
$('.embed-photo-selected-photo').each(function (index) {
|
|
|
|
$(this).removeClass('embed-photo-selected-photo');
|
|
|
|
});
|
|
|
|
getPhotoAlbumList();
|
|
|
|
$('#embedPhotoModalBodyAlbumDialog').off('click');
|
2017-04-13 21:20:09 +00:00
|
|
|
$('#embedPhotoModal').modal('show');
|
2016-06-13 00:10:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
var choosePhotoFromAlbum = function (album) {
|
|
|
|
$.post("embedphotos/album", {name: album},
|
|
|
|
function(data) {
|
|
|
|
if (data['status']) {
|
2016-08-16 00:18:42 +00:00
|
|
|
$('#embedPhotoModalLabel').html("{{$modalchooseimages}}");
|
2016-06-13 00:10:37 +00:00
|
|
|
$('#embedPhotoModalBodyAlbumDialog').html('\
|
2017-03-22 12:15:53 +00:00
|
|
|
<div><div class="nav nav-pills flex-column">\n\
|
|
|
|
<li class="nav-item"><a class="nav-link" href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\
|
2016-06-13 00:10:37 +00:00
|
|
|
<i class="fa fa-chevron-left"></i> \n\
|
|
|
|
{{$modaldiffalbum}}\n\
|
|
|
|
</a>\n\
|
|
|
|
</li>\n\
|
2017-03-22 12:15:53 +00:00
|
|
|
</div><br></div>')
|
2016-06-13 00:10:37 +00:00
|
|
|
$('#embedPhotoModalBodyAlbumDialog').append(data['content']);
|
|
|
|
$('#embedPhotoModalBodyAlbumDialog').click(function (evt) {
|
|
|
|
evt.preventDefault();
|
|
|
|
var image = document.getElementById(evt.target.id);
|
|
|
|
if (typeof($(image).parent()[0]) !== 'undefined') {
|
|
|
|
var imageparent = document.getElementById($(image).parent()[0].id);
|
|
|
|
$(imageparent).toggleClass('embed-photo-selected-photo');
|
2018-02-26 03:25:00 +00:00
|
|
|
var href = $(imageparent).attr('href');
|
2016-06-13 00:10:37 +00:00
|
|
|
$.post("embedphotos/photolink", {href: href},
|
|
|
|
function(ddata) {
|
|
|
|
if (ddata['status']) {
|
|
|
|
addeditortext(ddata['photolink']);
|
2017-08-02 02:02:42 +00:00
|
|
|
preview_post();
|
2016-06-13 00:10:37 +00:00
|
|
|
} else {
|
2016-08-16 00:18:42 +00:00
|
|
|
window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
|
2016-06-13 00:10:37 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
2018-02-26 03:25:00 +00:00
|
|
|
'json');
|
|
|
|
$('#embedPhotoModalBodyAlbumDialog').html('');
|
|
|
|
$('#embedPhotoModalBodyAlbumDialog').off('click');
|
|
|
|
$('#embedPhotoModal').modal('hide');
|
|
|
|
}
|
2016-06-13 00:10:37 +00:00
|
|
|
});
|
2018-02-26 03:25:00 +00:00
|
|
|
$('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
|
|
|
|
$('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
|
2016-06-13 00:10:37 +00:00
|
|
|
} else {
|
2016-08-16 00:18:42 +00:00
|
|
|
window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
|
2016-06-13 00:10:37 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
'json');
|
|
|
|
};
|
|
|
|
|
|
|
|
var getPhotoAlbumList = function () {
|
|
|
|
$.post("embedphotos/albumlist", {},
|
|
|
|
function(data) {
|
|
|
|
if (data['status']) {
|
|
|
|
var albums = data['albumlist']; //JSON.parse(data['albumlist']);
|
2016-08-16 00:18:42 +00:00
|
|
|
$('#embedPhotoModalLabel').html("{{$modalchoosealbum}}");
|
2017-03-22 12:15:53 +00:00
|
|
|
$('#embedPhotoModalBodyAlbumList').html('<ul class="nav nav-pills flex-column"></ul>');
|
2016-06-13 00:10:37 +00:00
|
|
|
for(var i=0; i<albums.length; i++) {
|
|
|
|
var albumName = albums[i].text;
|
2017-01-11 09:59:46 +00:00
|
|
|
var jsAlbumName = albums[i].jstext;
|
2017-03-22 12:15:53 +00:00
|
|
|
var albumLink = '<li class="nav-item">';
|
|
|
|
albumLink += '<a class="nav-link" href="#" onclick="choosePhotoFromAlbum(\'' + jsAlbumName + '\'); return false;">' + albumName + '</a>';
|
2016-06-13 00:10:37 +00:00
|
|
|
albumLink += '</li>';
|
|
|
|
$('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink);
|
|
|
|
}
|
2017-03-22 12:15:53 +00:00
|
|
|
$('#embedPhotoModalBodyAlbumDialog').addClass('d-none');
|
|
|
|
$('#embedPhotoModalBodyAlbumListDialog').removeClass('d-none');
|
2016-06-13 00:10:37 +00:00
|
|
|
} else {
|
2016-08-16 00:18:42 +00:00
|
|
|
window.console.log("{{$modalerrorlist}}" + ':' + data['errormsg']);
|
2016-06-13 00:10:37 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
'json');
|
|
|
|
};
|
2016-07-24 21:33:34 +00:00
|
|
|
|
|
|
|
//
|
2017-07-14 00:04:58 +00:00
|
|
|
// initialize drag-drop
|
2016-07-24 21:33:34 +00:00
|
|
|
function DragDropUploadInit() {
|
|
|
|
|
|
|
|
var filedrag = $("#profile-jot-text");
|
|
|
|
|
2017-07-14 00:04:58 +00:00
|
|
|
// file drop
|
2016-07-24 21:33:34 +00:00
|
|
|
filedrag.on("dragover", DragDropUploadFileHover);
|
|
|
|
filedrag.on("dragleave", DragDropUploadFileHover);
|
|
|
|
filedrag.on("drop", DragDropUploadFileSelectHandler);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// file drag hover
|
|
|
|
function DragDropUploadFileHover(e) {
|
|
|
|
e.target.className = (e.type == "dragover" ? "hover" : "");
|
|
|
|
}
|
|
|
|
|
|
|
|
// file selection
|
|
|
|
function DragDropUploadFileSelectHandler(e) {
|
|
|
|
|
|
|
|
// cancel event and hover styling
|
|
|
|
DragDropUploadFileHover(e);
|
2017-07-14 00:04:58 +00:00
|
|
|
// open editor if it isn't yet initialised
|
|
|
|
if (!editor) {
|
|
|
|
initEditor();
|
|
|
|
}
|
|
|
|
linkdrop(e);
|
2016-07-24 21:33:34 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-07-01 23:48:07 +00:00
|
|
|
</script>
|
|
|
|
|
2013-12-22 13:21:57 +00:00
|
|
|
<script>
|
2014-01-12 01:29:03 +00:00
|
|
|
$( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-delete-link,.block-delete-link", function(e) {
|
2013-12-22 13:21:57 +00:00
|
|
|
var link = $(this).attr("href"); // "get" the intended link in a var
|
2014-01-13 21:32:13 +00:00
|
|
|
|
2015-03-12 21:57:00 +00:00
|
|
|
if (typeof(eval($.fn.modal)) === 'function'){
|
|
|
|
e.preventDefault();
|
|
|
|
bootbox.confirm("<h4>{{$confirmdelete}}</h4>",function(result) {
|
|
|
|
if (result) {
|
|
|
|
document.location.href = link;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
return confirm("{{$confirmdelete}}");
|
|
|
|
}
|
|
|
|
});
|
2013-12-22 13:21:57 +00:00
|
|
|
</script>
|