]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/quattro/js/quattro.js
Merge remote-tracking branch 'upstream/develop' into develop
[friendica.git] / view / theme / quattro / js / quattro.js
index 1a532b9d55103ce27795390d5f07ab7ee1cfe564..9ef66e220e42b4139e5cf2cb3668f3583b94d165 100644 (file)
@@ -4,13 +4,20 @@ $(document).ready(function(){
                var intro = $(data).find('intro').text();
                var mail = $(data).find('mail').text();
 
-               $("tool notify").removeClass("on");
+               $(".tool .notify").removeClass("on");
                $(data).find("group").each(function() {
                        var gid = this.id;
                        var gcount = this.innerHTML;
                        $(".group-"+gid+" .notify").addClass("on").text(gcount);
                });
 
+               $(".forum-widget-entry .notify").removeClass("on");
+               $(data).find("forum").each(function() {
+                       var fid = this.id;
+                       var fcount = this.innerHTML;
+                       $(".forum-"+fid+" .notify").addClass("on").text(fcount);
+               });
+
                console.log(intro,mail);
 
                if (notifCount > 0 ) {
@@ -52,33 +59,33 @@ $(document).ready(function(){
        });
 });
 
-function insertFormatting(comment,BBcode,id) {
-
-               var tmpStr = $("#comment-edit-text-" + id).val();
-               if(tmpStr == comment) {
-                       tmpStr = "";
-                       $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
-                       $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
-                       openMenu("comment-edit-submit-wrapper-" + id);
-                       $("#comment-edit-text-" + id).val(tmpStr);
-               }
+function insertFormatting(BBcode, id) {
+       var tmpStr = $("#comment-edit-text-" + id).val();
+       if (tmpStr == "") {
+               $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+               openMenu("comment-edit-submit-wrapper-" + id);
+       }
 
        textarea = document.getElementById("comment-edit-text-" +id);
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
-                       } else
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }