aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
Diffstat (limited to 'view/js')
-rw-r--r--view/js/autocomplete.js34
-rw-r--r--view/js/main.js34
-rw-r--r--view/js/mod_connedit.js1
-rw-r--r--view/js/mod_mail.js4
-rw-r--r--view/js/mod_photos.js19
-rw-r--r--view/js/mod_poke.js2
-rw-r--r--view/js/mod_rpost.js1
-rw-r--r--view/js/mod_settings.js8
8 files changed, 74 insertions, 29 deletions
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index e077dc88d..0af27c61b 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -88,6 +88,14 @@ function basic_replace(item) {
return '$1'+item.name+' ';
}
+function trim_replace(item) {
+ if(typeof item.replace !== 'undefined')
+ return '$1'+item.replace;
+
+ return '$1'+item.name;
+}
+
+
function submit_form(e) {
$(e).parents('form').submit();
}
@@ -162,4 +170,30 @@ function submit_form(e) {
if(typeof onselect !== 'undefined')
a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
};
+})( jQuery );
+
+
+(function( $ ) {
+ $.fn.name_autocomplete = function(backend_url, typ, autosubmit, onselect) {
+ if(typeof typ === 'undefined') typ = '';
+ if(typeof autosubmit === 'undefined') autosubmit = false;
+
+ // Autocomplete contacts
+ names = {
+ match: /(^)([^\n]+)$/,
+ index: 2,
+ search: function(term, callback) { contact_search(term, callback, backend_url, typ,[], spinelement=false); },
+ replace: trim_replace,
+ template: contact_format,
+ };
+
+ this.attr('autocomplete','off');
+ var a = this.textcomplete([names], {className:'acpopup', zIndex:1020});
+
+ if(autosubmit)
+ a.on('textComplete:select', function(e,value,strategy) { submit_form(this); });
+
+ if(typeof onselect !== 'undefined')
+ a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
+ };
})( jQuery ); \ No newline at end of file
diff --git a/view/js/main.js b/view/js/main.js
index a60b47541..8bd4357cc 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -112,12 +112,12 @@ function insertbbcomment(comment, BBcode, id) {
return true;
}
-function inserteditortag(BBcode) {
+function inserteditortag(BBcode, id) {
// allow themes to override this
if(typeof(insertEditorFormatting) != 'undefined')
return(insertEditorFormatting(BBcode));
- textarea = document.getElementById('profile-jot-text');
+ textarea = document.getElementById(id);
if (document.selection) {
textarea.focus();
selected = document.selection.createRange();
@@ -135,7 +135,7 @@ function insertCommentURL(comment, id) {
if(reply && reply.length) {
reply = bin2hex(reply);
$('body').css('cursor', 'wait');
- $.get('parse_url?binurl=' + reply, function(data) {
+ $.get('linkinfo?f=&binurl=' + reply, function(data) {
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == comment) {
tmpStr = "";
@@ -616,11 +616,12 @@ function updateConvItems(mode,data) {
function collapseHeight() {
$(".wall-item-content, .directory-collapse").each(function() {
- var orgHeight = $(this).height();
+ var orgHeight = $(this).outerHeight(true);
if(orgHeight > divmore_height + 10) {
if(! $(this).hasClass('divmore')) {
$(this).readmore({
speed: 0,
+ heightMargin: 50,
collapsedHeight: divmore_height,
moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>',
lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>',
@@ -745,12 +746,12 @@ function justifyPhotos() {
margins: 3,
border: 0,
sizeRangeSuffixes: {
- 'lt100': '-2',
- 'lt240': '-2',
- 'lt320': '-2',
- 'lt500': '',
- 'lt640': '-1',
- 'lt1024': '-0'
+ 'lt100': '-3',
+ 'lt240': '-3',
+ 'lt320': '-3',
+ 'lt500': '-2',
+ 'lt640': '-2',
+ 'lt1024': '-1'
}
}).on('jg.complete', function(e){ justifiedGalleryActive = false; });
}
@@ -835,10 +836,20 @@ function dropItem(url, object) {
function dosubthread(ident) {
unpause();
$('#like-rotator-' + ident.toString()).spin('tiny');
- $.get('subthread/' + ident.toString(), NavUpdate );
+ $.get('subthread/sub/' + ident.toString(), NavUpdate );
liking = 1;
}
+
+function dounsubthread(ident) {
+ unpause();
+ $('#like-rotator-' + ident.toString()).spin('tiny');
+ $.get('subthread/unsub/' + ident.toString(), NavUpdate );
+ liking = 1;
+}
+
+
+
function dostar(ident) {
ident = ident.toString();
$('#like-rotator-' + ident).spin('tiny');
@@ -1155,7 +1166,6 @@ $(document).ready(function() {
numbers : aStr['t17'],
};
- $(".autotime").timeago();
$("#toc").toc();
});
diff --git a/view/js/mod_connedit.js b/view/js/mod_connedit.js
index d6cc42175..84fff5ed1 100644
--- a/view/js/mod_connedit.js
+++ b/view/js/mod_connedit.js
@@ -25,7 +25,6 @@ function connectFullShare() {
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
- $('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_contacts').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
diff --git a/view/js/mod_mail.js b/view/js/mod_mail.js
index 16e06e6f5..561df7229 100644
--- a/view/js/mod_mail.js
+++ b/view/js/mod_mail.js
@@ -1,6 +1,6 @@
$(document).ready(function() {
- $("#recip").contact_autocomplete(baseurl + '/acl', '', false, function(data) {
+ $("#recip").name_autocomplete(baseurl + '/acl', '', false, function(data) {
$("#recip-complete").val(data.xid);
});
-
+ $(".autotime").timeago()
});
diff --git a/view/js/mod_photos.js b/view/js/mod_photos.js
index b254370c1..d371c3f2f 100644
--- a/view/js/mod_photos.js
+++ b/view/js/mod_photos.js
@@ -6,10 +6,9 @@
var ispublic = aStr.everybody;
$(document).ready(function() {
- $(document).ready(function() {
- $("#photo-edit-newtag").contact_autocomplete(baseurl + '/acl', 'p', false, function(data) {
- $("#photo-edit-newtag").val('@' + data.name);
- });
+
+ $("#photo-edit-newtag").contact_autocomplete(baseurl + '/acl', 'p', false, function(data) {
+ $("#photo-edit-newtag").val('@' + data.name);
});
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
@@ -24,4 +23,14 @@ $(document).ready(function() {
$('#jot-public').show();
}
}).trigger('change');
-}); \ No newline at end of file
+
+ showHideBodyTextarea();
+
+});
+
+function showHideBodyTextarea() {
+ if( $('#id_visible').is(':checked'))
+ $('#body-textarea').slideDown();
+ else
+ $('#body-textarea').slideUp();
+}
diff --git a/view/js/mod_poke.js b/view/js/mod_poke.js
index 58e50588f..221cbbb31 100644
--- a/view/js/mod_poke.js
+++ b/view/js/mod_poke.js
@@ -1,5 +1,5 @@
$(document).ready(function() {
- $("#poke-recip").contact_autocomplete(baseurl + '/acl', 'a', false, function(data) {
+ $("#poke-recip").name_autocomplete(baseurl + '/acl', 'a', false, function(data) {
$("#poke-recip-complete").val(data.id);
});
});
diff --git a/view/js/mod_rpost.js b/view/js/mod_rpost.js
new file mode 100644
index 000000000..06b67136b
--- /dev/null
+++ b/view/js/mod_rpost.js
@@ -0,0 +1 @@
+$(document).ready(function() { initEditor(); });
diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js
index 5dac96940..e28a18b9f 100644
--- a/view/js/mod_settings.js
+++ b/view/js/mod_settings.js
@@ -46,7 +46,6 @@ function channel_privacy_macro(n) {
if(n == 0) {
$('#id_view_stream option').eq(0).attr('selected','selected');
$('#id_view_profile option').eq(0).attr('selected','selected');
- $('#id_view_photos option').eq(0).attr('selected','selected');
$('#id_view_contacts option').eq(0).attr('selected','selected');
$('#id_view_storage option').eq(0).attr('selected','selected');
$('#id_view_pages option').eq(0).attr('selected','selected');
@@ -54,7 +53,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(0).attr('selected','selected');
$('#id_post_comments option').eq(0).attr('selected','selected');
$('#id_post_mail option').eq(0).attr('selected','selected');
- $('#id_post_photos option').eq(0).attr('selected','selected');
$('#id_tag_deliver option').eq(0).attr('selected','selected');
$('#id_chat option').eq(0).attr('selected','selected');
$('#id_write_storage option').eq(0).attr('selected','selected');
@@ -69,7 +67,6 @@ function channel_privacy_macro(n) {
if(n == 1) {
$('#id_view_stream option').eq(1).attr('selected','selected');
$('#id_view_profile option').eq(1).attr('selected','selected');
- $('#id_view_photos option').eq(1).attr('selected','selected');
$('#id_view_contacts option').eq(1).attr('selected','selected');
$('#id_view_storage option').eq(1).attr('selected','selected');
$('#id_view_pages option').eq(1).attr('selected','selected');
@@ -77,7 +74,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(1).attr('selected','selected');
$('#id_post_comments option').eq(1).attr('selected','selected');
$('#id_post_mail option').eq(1).attr('selected','selected');
- $('#id_post_photos option').eq(1).attr('selected','selected');
$('#id_tag_deliver option').eq(1).attr('selected','selected');
$('#id_chat option').eq(1).attr('selected','selected');
$('#id_write_storage option').eq(1).attr('selected','selected');
@@ -92,7 +88,6 @@ function channel_privacy_macro(n) {
if(n == 2) {
$('#id_view_stream option').eq(7).attr('selected','selected');
$('#id_view_profile option').eq(7).attr('selected','selected');
- $('#id_view_photos option').eq(7).attr('selected','selected');
$('#id_view_contacts option').eq(7).attr('selected','selected');
$('#id_view_storage option').eq(7).attr('selected','selected');
$('#id_view_pages option').eq(7).attr('selected','selected');
@@ -100,7 +95,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(1).attr('selected','selected');
$('#id_post_comments option').eq(2).attr('selected','selected');
$('#id_post_mail option').eq(1).attr('selected','selected');
- $('#id_post_photos option').eq(0).attr('selected','selected');
$('#id_tag_deliver option').eq(1).attr('selected','selected');
$('#id_chat option').eq(1).attr('selected','selected');
$('#id_write_storage option').eq(0).attr('selected','selected');
@@ -115,7 +109,6 @@ function channel_privacy_macro(n) {
if(n == 3) {
$('#id_view_stream option').eq(7).attr('selected','selected');
$('#id_view_profile option').eq(7).attr('selected','selected');
- $('#id_view_photos option').eq(7).attr('selected','selected');
$('#id_view_contacts option').eq(7).attr('selected','selected');
$('#id_view_storage option').eq(7).attr('selected','selected');
$('#id_view_pages option').eq(7).attr('selected','selected');
@@ -123,7 +116,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(5).attr('selected','selected');
$('#id_post_comments option').eq(5).attr('selected','selected');
$('#id_post_mail option').eq(5).attr('selected','selected');
- $('#id_post_photos option').eq(2).attr('selected','selected');
$('#id_tag_deliver option').eq(1).attr('selected','selected');
$('#id_chat option').eq(5).attr('selected','selected');
$('#id_write_storage option').eq(2).attr('selected','selected');