]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/diabook/theme.php
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
[friendica.git] / view / theme / diabook / theme.php
index 269015d0a3e5fa83e90d36d2353129f044f01192..9a1ac0f68a85b8db582453feea533806291f9efe 100755 (executable)
@@ -3,23 +3,28 @@
 /*
  * Name: Diabook
  * Description: Diabook: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu
- * Version: (Version: 1.022)
+ * Version: (Version: 1.023)
  * Author: 
  */
 
 
 //print diabook-version for debugging
-$diabook_version = "Diabook (Version: 1.022)";
+$diabook_version = "Diabook (Version: 1.023)";
 $a->page['htmlhead'] .= sprintf('<script "%s" ></script>', $diabook_version);
 
 //change css on network and profilepages
 $cssFile = null;
+
 $resolution=false;
 $resolution = get_pconfig(local_user(), "diabook", "resolution");
 if ($resolution===false) $resolution="normal";
+
 $color = false;
-$color = get_pconfig(local_user(), "diabook", "color");
+$site_color = get_config("diabook", "color" );
+if (local_user()) {$color = get_pconfig(local_user(), "diabook", "color");}
+if ($color===false) $color=$site_color;
 if ($color===false) $color="diabook";
+
 if ($color=="diabook") $color_path = "/";
 if ($color=="aerith") $color_path = "/diabook-aerith/";
 if ($color=="blue") $color_path = "/diabook-blue/";
@@ -308,6 +313,20 @@ $autogrowJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.autogro
 $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $autogrowJS);
 
 //js scripts
+
+//check if community_home-plugin is activated and change css
+$nametocheck = "communityhome";
+$r = q("select id from addon where name = '%s' and installed = 1", dbesc($nametocheck));
+if(count($r) == "1") {
+       
+$a->page['htmlhead'] .= '
+<script>
+$(document).ready(function() {
+       $("div#login-submit-wrapper").attr("style","padding-top: 120px;");
+       });
+</script>';    
+}
+
 //comment-edit-wrapper on photo_view
 if ($a->argv[0].$a->argv[2] === "photos"."image"){
 
@@ -319,7 +338,6 @@ $a->page['htmlhead'] .= '
                        
                        });
     </script>';
-       
 }
 
 $a->page['htmlhead'] .= '
@@ -329,6 +347,10 @@ $a->page['htmlhead'] .= '
        $("a.lightbox").fancybox(); // Select all links with lightbox class
  });
    
+$(window).load(function() {
+       var footer_top = $(document).height() - 30;
+       $("div#footerbox").attr("style", "border-top: 1px solid #D2D2D2; width: 70%;right: 15%;position: absolute;top:"+footer_top+"px;");
+ });
  </script>';
  
  
@@ -356,25 +378,48 @@ $(document).ready(function() {
             $(this).attr("src",newString+"?"+wmode+"&"+oldString);
         }
         else $(this).attr("src",ifr_source+"?"+wmode);
+       
     });
-    
-    $("a[href=#top]").click(function() {
-                       $("html, body").animate({scrollTop:0}, "slow");
-                       return false;
-               });
       
-
 });
 
 function yt_iframe() {
 
-
        $("iframe").load(function() { 
        var ifr_src = $(this).contents().find("body iframe").attr("src");
        $("iframe").contents().find("body iframe").attr("src", ifr_src+"&wmode=transparent");
     });
 
        };
+
+function scrolldown(){
+                       $("html, body").animate({scrollTop:$(document).height()}, "slow");
+                       return false;
+               };
+               
+function scrolltop(){
+                       $("html, body").animate({scrollTop:0}, "slow");
+                       return false;
+               };
+               
+$(window).scroll(function () { 
+               
+                               
+               var scrollInfo = $(window).scrollTop();      
+               
+               if (scrollInfo <= "900"){
+      $("a#top").attr("id","down");
+      $("a#down").attr("onclick","scrolldown()");
+               $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_bottom.png");
+               } 
+                   
+      if (scrollInfo > "900"){
+      $("a#down").attr("id","top");
+      $("a#top").attr("onclick","scrolltop()");
+               $("img#scroll_top_bottom").attr("src","view/theme/diabook/icons/scroll_top.png");
+               }
+               
+    });
   
  </script>';