]> git.mxchange.org Git - friendica.git/blobdiff - include/main.js
Merge branch 'pull'
[friendica.git] / include / main.js
index 896c611d5c162d9f552115cda894fa7ae4234bcc..9929c336f0488ea7c6dec5ef18361aef553b7813 100644 (file)
                        //console.log(id);
                });
                
+               /* setup field_richtext */
+               setupFieldRichtext();
+               
                /* load tinyMCE if needed and setup field_richtext */
-               if(typeof tinyMCE == "undefined") {
+               /*if(typeof tinyMCE == "undefined") {
                        window.tinyMCEPreInit = {
                                suffix:"",
                                base: baseurl+"/library/tinymce/jscripts/tiny_mce/",
@@ -62,8 +65,8 @@
                        };
                        $.getScript(baseurl     +"/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js", setupFieldRichtext);
                } else {
-                       setupFieldRichtext();
-               }
+               }*/
+               
                
                
                /* nav update event  */
                                        $('#pause').html('');
                                }
                        }
+                       else {
+                               // any key to resume
+                               if(stopped == true) {
+                                       stopped = false;
+                                       $('#pause').html('');
+                               }
+                       }
+
                });                                     
        });
 
                if($('#live-network').length)   { src = 'network'; liveUpdate(); }
                if($('#live-profile').length)   { src = 'profile'; liveUpdate(); }
                if($('#live-community').length) { src = 'community'; liveUpdate(); }
+               if($('#live-notes').length)     { src = 'notes'; liveUpdate(); }
                if($('#live-display').length) { 
                        if(liking) {
                                liking = 0;
 
                in_progress = true;
                var udargs = ((netargs.length) ? '/' + netargs : '');
-               var update_url = 'update_' + src + udargs + '?p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0);
+               var update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0);
 
                $.get(update_url,function(data) {
                        in_progress = false;
                                else { 
 
                                        $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago')); 
-                                       $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
+                                       if($('#' + ident + ' ' + '.comment-edit-text-empty').length)
+                                               $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
                                        $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
                                        $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
                                        $('#' + ident + ' ' + '.my-comment-photo').each(function() {
                });
        }
 
+       function contactgroupChangeMember(gid,cid) {
+               $('body').css('cursor', 'wait');
+               $.get('contactgroup/' + gid + '/' + cid, function(data) {
+                               $('body').css('cursor', 'auto');
+               });
+       }
+
+
 function checkboxhighlight(box) {
   if($(box).is(':checked')) {
        $(box).addClass('checkeditem');
@@ -364,7 +385,6 @@ function setupFieldRichtext(){
        });
 }
 
-
 /** 
  * sprintf in javascript 
  *     "{0} and {1}".format('zero','uno'); 
@@ -377,3 +397,11 @@ String.prototype.format = function() {
     }
     return formatted;
 };
+// Array Remove
+Array.prototype.remove = function(item) {
+  to=undefined; from=this.indexOf(item);
+  var rest = this.slice((to || from) + 1 || this.length);
+  this.length = from < 0 ? this.length + from : from;
+  return this.push.apply(this, rest);
+};
+