aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2015-12-04 10:32:14 +0100
committermrjive <mrjive@mrjive.it>2015-12-04 10:32:14 +0100
commit051346325609f5f2e78ef0deaf182c65d7823bbc (patch)
treef3660377b3daf6599623d2e4fb95b4d33c30d8cc /view/js
parent53a796afcc0cff6f9e3f51457df4506a43db1945 (diff)
parent8a9d743f6f518d3af35014130dcef8f148148113 (diff)
downloadvolse-hubzilla-051346325609f5f2e78ef0deaf182c65d7823bbc.tar.gz
volse-hubzilla-051346325609f5f2e78ef0deaf182c65d7823bbc.tar.bz2
volse-hubzilla-051346325609f5f2e78ef0deaf182c65d7823bbc.zip
Merge pull request #9 from redmatrix/master
updating from original codebase
Diffstat (limited to 'view/js')
-rw-r--r--view/js/acl.js46
-rw-r--r--view/js/autocomplete.js2
-rw-r--r--view/js/main.js21
-rw-r--r--view/js/mod_events.js34
4 files changed, 61 insertions, 42 deletions
diff --git a/view/js/acl.js b/view/js/acl.js
index 626d1a750..ed8af478a 100644
--- a/view/js/acl.js
+++ b/view/js/acl.js
@@ -25,20 +25,18 @@ function ACL(backend_url, preset) {
/*events*/
$(document).ready(function() {
-// setTimeout( function() {
that.showall.click(that.on_showall);
$(document).on('click','.acl-button-show',that.on_button_show);
$(document).on('click','.acl-button-hide',that.on_button_hide);
$("#acl-search").keypress(that.on_search);
/* startup! */
- that.get(0,100);
+ that.get(0,15000);
that.on_submit();
-// }, 5000 );
});
}
-// no longer called on submit - call to update whenever a change occurs to the acl list.
+// no longer called only on submit - call to update whenever a change occurs to the acl list.
ACL.prototype.on_submit = function() {
aclfileds = $("#acl-fields").html("");
@@ -62,11 +60,13 @@ ACL.prototype.on_submit = function() {
ACL.prototype.search = function() {
var srcstr = $("#acl-search").val();
that.list_content.html("");
- that.get(0, 100, srcstr);
+ that.get(0, 15000, srcstr);
};
ACL.prototype.on_search = function(event) {
- if (that.kp_timer) clearTimeout(that.kp_timer);
+ if (that.kp_timer) {
+ clearTimeout(that.kp_timer);
+ }
that.kp_timer = setTimeout( that.search, 1000);
};
@@ -90,15 +90,37 @@ ACL.prototype.on_showall = function(event) {
return false;
};
+ACL.prototype.on_selectall = function(event) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ /* This function has not yet been completed. */
+ /* The goal is to select all ACL "show" entries with one action. */
+
+ $('.acl-button-show').each(function(){});
+
+ if (that.showall.hasClass("btn-warning")) {
+ return false;
+ }
+ that.showall.removeClass("btn-default").addClass("btn-warning");
+
+ that.allow_cid = [];
+ that.allow_gid = [];
+ that.deny_cid = [];
+ that.deny_gid = [];
+
+ that.update_view();
+ that.on_submit();
+
+ return false;
+};
+
+
ACL.prototype.on_button_show = function(event) {
event.preventDefault();
event.stopImmediatePropagation();
event.stopPropagation();
- /*that.showall.removeClass("selected");
- $(this).siblings(".acl-button-hide").removeClass("selected");
- $(this).toggleClass("selected");*/
-
that.set_allow($(this).parent().attr('id'));
that.on_submit();
@@ -110,10 +132,6 @@ ACL.prototype.on_button_hide = function(event) {
event.stopImmediatePropagation();
event.stopPropagation();
- /*that.showall.removeClass("selected");
- $(this).siblings(".acl-button-show").removeClass("selected");
- $(this).toggleClass("selected");*/
-
that.set_deny($(this).parent().attr('id'));
that.on_submit();
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 0af27c61b..511a7f815 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -60,7 +60,7 @@ function contact_format(item) {
var desc = ((item.label) ? item.nick + ' ' + item.label : item.nick);
if(typeof desc === 'undefined') desc = '';
if(desc) desc = ' ('+desc+')';
- return "<div class='{0}' title='{4}'><img src='{1}'><span class='contactname'>{2}</span><span class='dropdown-sub-text'>{3}</span><div class='clear'></div></div>".format(item.taggable, item.photo, item.name, desc, item.link);
+ return "<div class='{0}' title='{4}'><img class='dropdown-menu-img-sm' src='{1}'><span class='contactname'>{2}</span><span class='dropdown-sub-text'>{3}</span><div class='clear'></div></div>".format(item.taggable, item.photo, item.name, desc, item.link);
}
else
return "<div>" + item.text + "</div>";
diff --git a/view/js/main.js b/view/js/main.js
index 8bd4357cc..ca7d50b90 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -247,6 +247,7 @@ var pageHasMoreContent = true;
var updateCountsOnly = false;
var divmore_height = 400;
var last_filestorage_id = null;
+var mediaPlaying = false;
$(function() {
$.ajaxSetup({cache: false});
@@ -359,7 +360,7 @@ function NavUpdate() {
if(liking)
$('.like-rotator').spin(false);
- if(! stopped) {
+ if((! stopped) && (! mediaPlaying)) {
var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
$.get(pingCmd,function(data) {
@@ -595,6 +596,24 @@ function updateConvItems(mode,data) {
$('body').css('cursor', 'auto');
}
+ $('video').off('playing');
+ $('video').off('pause');
+ $('audio').off('playing');
+ $('audio').off('pause');
+
+ $('video').on('playing', function() {
+ mediaPlaying = true;
+ });
+ $('video').on('pause', function() {
+ mediaPlaying = false;
+ });
+ $('audio').on('playing', function() {
+ mediaPlaying = true;
+ });
+ $('audio').on('pause', function() {
+ mediaPlaying = false;
+ });
+
/* autocomplete @nicknames */
$(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
diff --git a/view/js/mod_events.js b/view/js/mod_events.js
index 270bf798b..0b7b3d24c 100644
--- a/view/js/mod_events.js
+++ b/view/js/mod_events.js
@@ -2,33 +2,15 @@
* JavaScript for mod/events
*/
-$(document).ready( function() { showHideFinishDate(); });
+$(document).ready( function() {
-function showHideFinishDate() {
+ enableDisableFinishDate();
+
+});
+
+function enableDisableFinishDate() {
if( $('#id_nofinish').is(':checked'))
- $('#event-finish-wrapper').hide();
+ $('#id_finish_text').prop("disabled", true);
else
- $('#event-finish-wrapper').show();
-}
-function eventGetStart() {
- //reply = prompt("{{$expirewhen}}", $('#jot-expire').val());
- $('#startModal').modal();
- $('#start-modal-OKButton').on('click', function() {
- reply=$('#start-date').val();
- if(reply && reply.length) {
- $('#start-text').val(reply);
- $('#startModal').modal('hide');
- }
- });
+ $('#id_finish_text').prop("disabled", false);
}
-function eventGetFinish() {
- //reply = prompt("{{$expirewhen}}", $('#jot-expire').val());
- $('#finishModal').modal();
- $('#finish-modal-OKButton').on('click', function() {
- reply=$('#finish-date').val();
- if(reply && reply.length) {
- $('#finish-text').val(reply);
- $('#finishModal').modal('hide');
- }
- });
-} \ No newline at end of file