]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/quattro/theme.php
bbcode: rearrange shared links - can only be made standard, when all themes support...
[friendica.git] / view / theme / quattro / theme.php
index e21deb8ab536bc6fb4437e8fc7ecaf83c2b13e78..167ebc75383f1e86c13349f38c4a773273da13b5 100644 (file)
@@ -1,18 +1,49 @@
 <?php
 /**
  * Name: Quattro
- * Version: 0.5
+ * Version: 0.6
  * Author: Fabio <http://kirgroup.com/profile/fabrixxm>
  * Maintainer: Fabio <http://kirgroup.com/profile/fabrixxm>
  * Maintainer: Tobias <https://diekershoff.homeunix.net/friendica/profile/tobias>
  */
  
+function quattro_init(&$a) {
 $a->theme_info = array();
-$a->theme['template_engine'] = 'smarty3';
+set_template_engine($a, 'smarty3');
 
-function quattro_init(&$a) {
+
+$a->page['htmlhead'] .= '<script src="'.$a->get_baseurl().'/view/theme/quattro/tinycon.min.js"></script>';
 $a->page['htmlhead'] .= <<< EOT
 <script>
+$(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();
+        
+        console.log(intro,mail);
+        
+        if (notifCount > 0 ) {
+            Tinycon.setBubble(notifCount);
+        } else {
+            Tinycon.setBubble('');
+        }
+        
+        if (intro>0){
+                       $("#nav-introductions-link").addClass("on");
+               } else {
+                       $("#nav-introductions-link").removeClass("on");
+               }
+               
+        if (mail>0){
+                       $("#nav-messages-link").addClass("on");
+               } else {
+                       $("#nav-messages-link").removeClass("on");
+               }
+               
+    });
+});        
+
 function insertFormatting(comment,BBcode,id) {
        
                var tmpStr = $("#comment-edit-text-" + id).val();