]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/quattro/js/quattro.js
Merge branch 'friendica:2022.12-rc' into new_image_presentation
[friendica.git] / view / theme / quattro / js / quattro.js
index 1a532b9d55103ce27795390d5f07ab7ee1cfe564..e91794febad852969d2b6736d95692e9f03a7dba 100644 (file)
@@ -1,16 +1,24 @@
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
 $(document).ready(function(){
        $('nav').bind('nav-update', function(e,data){
                var notifCount = $(data).find('notif').attr('count');
-               var intro = $(data).find('intro').text();
-               var mail = $(data).find('mail').text();
+               var intro = parseInt($(data).find('intro').text());
+               var mail = parseInt($(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,36 +60,6 @@ $(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);
-               }
-
-       textarea = document.getElementById("comment-edit-text-" +id);
-       if (document.selection) {
-               textarea.focus();
-               selected = document.selection.createRange();
-               if (BBcode == "url"){
-                       selected.text = "["+BBcode+"]" + "http://" +  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"){
-                       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);
-       }
-       return true;
-}
-
 function showThread(id) {
        $("#collapsed-comments-" + id).show()
        $("#collapsed-comments-" + id + " .collapsed-comments").show()
@@ -140,4 +118,4 @@ $(document).ready(function() {
 
 });
 
-
+// @license-end