]> git.mxchange.org Git - friendica.git/blob - view/theme/cleanzero/theme.php
Add title bar notifications to Smoothly
[friendica.git] / view / theme / cleanzero / theme.php
1 <?php
2 /*
3  * Name: cleanzero
4  * Description: Theme with clean design derived from the zero theme family. Including options to set color schemes, font sizes and resizing of images in posts 
5  * Version:
6  * Author: Christian Vogeley (https://christian-vogeley.de/profile/christian)
7  */
8 $a->theme_info = array(
9   'extends' => 'duepuntozero',
10 );
11 function cleanzero_init(&$a) {
12 $a->page['htmlhead'] .= <<< EOT
13 <script>
14
15 function insertFormatting(comment,BBcode,id) {
16         
17                 var tmpStr = $("#comment-edit-text-" + id).val();
18                 if(tmpStr == comment) {
19                         tmpStr = "";
20                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
21                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
22                         openMenu("comment-edit-submit-wrapper-" + id);
23                         $("#comment-edit-text-" + id).val(tmpStr);
24                 }
25
26         textarea = document.getElementById("comment-edit-text-" +id);
27         if (document.selection) {
28                 textarea.focus();
29                 selected = document.selection.createRange();
30                 if (BBcode == "url"){
31                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
32                         } else                  
33                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
34         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
35                 var start = textarea.selectionStart;
36                 var end = textarea.selectionEnd;
37                 if (BBcode == "url"){
38                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
39                         } else
40                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
41         }
42         return true;
43 }
44
45 function cmtBbOpen(id) {
46         $(".comment-edit-bb-" + id).show();
47 }
48 function cmtBbClose(comment, id) {
49         $(".comment-edit-bb-" + id).hide();
50 }
51
52 $(document).ready(function() {
53
54 $('.group-edit-icon').hover(
55         function() {
56                 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
57         function() {
58                 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
59         );
60
61 $('.sidebar-group-element').hover(
62         function() {
63                 id = $(this).attr('id');
64                 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
65
66         function() {
67                 id = $(this).attr('id');
68                 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
69         );
70
71
72 $('.savedsearchdrop').hover(
73         function() {
74                 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
75         function() {
76                 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
77         );
78
79 $('.savedsearchterm').hover(
80         function() {
81                 id = $(this).attr('id');
82                 $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
83
84         function() {
85                 id = $(this).attr('id');
86                 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
87         );
88
89 });
90
91
92 </script>
93 EOT;
94 // get resize configuration
95
96 $resize=false;
97 $site_resize = get_config('cleanzero', 'resize' );
98 if(local_user()) $resize = get_pconfig(local_user(), 'cleanzero', 'resize' );
99
100 if ($resize===false) $resize=$site_resize;
101 if ($resize===false) $resize=0;
102
103 if (intval($resize) > 0) {
104 //load jquery.ae.image.resize.js
105 $imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/cleanzero/js/jquery.ae.image.resize.js";
106 $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS);
107 $a->page['htmlhead'] .= '
108 <script>
109
110  $(function() {
111         $(".wall-item-content  img").aeImageResize({height: '.$resize.', width: '.$resize.'});
112   });
113 </script>';}
114 }