]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/diabook-red/theme.php
diabook-themes: bugfix (sry, necessary)
[friendica.git] / view / theme / diabook-red / theme.php
old mode 100755 (executable)
new mode 100644 (file)
index a0d5ead..1ef65d8
@@ -3,11 +3,15 @@
 /*
  * Name: Diabook-red
  * Description: Diabook-red: report bugs and request here: http://pad.toktan.org/p/diabook or contact me : thomas_bierey@friendica.eu
- * Version: (Version: 1.013)
+ * Version: (Version: 1.019)
  * Author: 
  */
 
 
+//print diabook-version for debugging
+$diabook_version = "Diabook-red (Version: 1.019)";
+$a->page['htmlhead'] .= sprintf('<script "%s" ></script>', $diabook_version);
+
 //change css on network and profilepages
 $cssFile = null;
 
@@ -17,7 +21,6 @@ $cssFile = null;
  */
 function diabook_red_community_info(){
        $a = get_app();
-       //right_aside at networkpages
 
        // last 12 users
        $aside['$lastusers_title'] = t('Last users');
@@ -32,7 +35,7 @@ function diabook_red_community_info(){
                0,
                9
        );
-       $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+       $tpl = file_get_contents( dirname(__file__).'/ch_directory_item.tpl');
        if(count($r)) {
                $photo = 'thumb';
                foreach($r as $rr) {
@@ -111,7 +114,7 @@ function diabook_red_community_info(){
                                dbesc(t('Profile Photos'))
                                );
                if(count($r)) {
-               $tpl = file_get_contents( dirname(__file__).'/directory_item.tpl');
+               $tpl = file_get_contents( dirname(__file__).'/ch_directory_item.tpl');
                foreach($r as $rr) {
                        $photo_page = $a->get_baseurl() . '/photos/' . $rr['nickname'] . '/image/' . $rr['resource-id'];
                        $photo_url = $a->get_baseurl() . '/photo/' .  $rr['resource-id'] . '-' . $rr['scale'] .'.jpg';
@@ -275,58 +278,6 @@ if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){
        }
 }
 
-
-//tabs at right_aside on settings page
-if ($a->argv[0] === "settings"){
-       
-       $tabs = array(
-               array(
-                       'label' => t('Account settings'),
-                       'url'   => $a->get_baseurl(true).'/settings',
-                       'sel'   => (($a->argc == 1)?'active':''),
-               ),      
-               array(
-                       'label' => t('Display settings'),
-                       'url'   => $a->get_baseurl(true).'/settings/display',
-                       'sel'   => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
-               ),      
-               array(
-                       'label' => t('Edit/Manage Profiles'),
-                       'url'   => $a->get_baseurl(true).'/profiles',
-               ),      
-               array(
-                       'label' => t('Connector settings'),
-                       'url'   => $a->get_baseurl(true).'/settings/connectors',
-                       'sel'   => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
-               ),
-               array(
-                       'label' => t('Plugin settings'),
-                       'url'   => $a->get_baseurl(true).'/settings/addon',
-                       'sel'   => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
-               ),
-               array(
-                       'label' => t('Connections'),
-                       'url' => $a->get_baseurl(true) . '/settings/oauth',
-                       'sel' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
-               ),
-               array(
-                       'label' => t('Export personal data'),
-                       'url' => $a->get_baseurl(true) . '/uexport',
-                       'sel' => ''
-               )
-       );
-       $tabtpl = file_get_contents(dirname(__file__).'/rs_common_tabs.tpl') ;
-       $a->page['aside'] = replace_macros($tabtpl, array(
-               '$tabs' => $tabs,
-       ));
-       
-       
-       // CUSTOM CSS
-       $cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook-red/style-settings.css";
-       
-}
-
-
 // custom css
 if (!is_null($cssFile)) $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
 
@@ -334,8 +285,28 @@ if (!is_null($cssFile)) $a->page['htmlhead'] .= sprintf('<link rel="stylesheet"
 $cookieJS = $a->get_baseurl($ssl_state)."/view/theme/diabook-red/js/jquery.cookie.js";
 $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $cookieJS);
 
+//load jquery.ae.image.resize.js
+$imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/diabook-red/js/jquery.ae.image.resize.js";
+$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS);
+
+//load jquery.autogrow-textarea.js
+$autogrowJS = $a->get_baseurl($ssl_state)."/view/theme/diabook-red/js/jquery.autogrow.textarea.js";
+$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $autogrowJS);
 
 //js scripts
+//comment-edit-wrapper on photo_view
+if ($a->argv[0].$a->argv[2] === "photos"."image"){
+
+$a->page['htmlhead'] .= '
+<script>
+       $(function(){
+       
+               $(".comment-edit-form").css("display","table");
+                       
+                       });
+    </script>';
+       
+}
 
 $a->page['htmlhead'] .= '
 
@@ -345,12 +316,60 @@ $a->page['htmlhead'] .= '
  });
   
  </script>';
+$a->page['htmlhead'] .= '
+
+<script type="text/javascript">
+
+function tautogrow(id){
+               $("textarea#comment-edit-text-" +id).autogrow();        
+       };
+ </script>';
+
+$a->page['htmlhead'] .= '
+ <script>
+$(document).ready(function() {
+    $("iframe").each(function(){
+        var ifr_source = $(this).attr("src");
+        var wmode = "wmode=transparent";
+        if(ifr_source.indexOf("?") != -1) {
+            var getQString = ifr_source.split("?");
+            var oldString = getQString[1];
+            var newString = getQString[0];
+            $(this).attr("src",newString+"?"+wmode+"&"+oldString);
+        }
+        else $(this).attr("src",ifr_source+"?"+wmode);
+    });
+      
+
+});
+
+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");
+    });
+
+       };
+  
+ </script>';
 
 
 if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname'] or $a->argv[0] === "network" && local_user()){
 $a->page['htmlhead'] .= '
 <script>
 
+ $(function() {
+       $(".oembed.photo img").aeImageResize({height: 400, width: 400});
+  });
+</script>';
+
+
+       if($ccCookie != "8") {
+$a->page['htmlhead'] .= '
+<script>
 $("right_aside").ready(function(){
        
        if($.cookie("close_pages") == "1") 
@@ -434,9 +453,10 @@ function close_lastlikes(){
  document.getElementById( "close_lastlikes" ).style.display = "none";
  $.cookie("close_lastlikes","1", { expires: 365, path: "/" });
  };
+</script>';}
 
+$a->page['htmlhead'] .= ' 
+<script>
 function restore_boxes(){
        $.cookie("close_pages","2", { expires: 365, path: "/" });
        $.cookie("close_helpers","2", { expires: 365, path: "/" });
@@ -447,5 +467,38 @@ function restore_boxes(){
        $.cookie("close_lastphotos","2", { expires: 365, path: "/" });
        $.cookie("close_lastlikes","2", { expires: 365, path: "/" });
        alert("Right-hand column was restored. Please refresh your browser");
-  };
+  }
 </script>';}
+
+$a->page['htmlhead'] .= ' 
+
+<script type="text/javascript">
+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);
+                                                                                       }
+
+       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;
+}
+</script> ';
\ No newline at end of file