]> git.mxchange.org Git - friendica.git/blob - view/theme/darkzero-NS/theme.php
Merge pull request #262 from tomtom84/master
[friendica.git] / view / theme / darkzero-NS / theme.php
1 <?php
2
3 /*
4  * Name: Darkzero-NS
5  * Description: Darkzero theme with posts that do not scroll
6  * Version: 1.0
7  * Author: Mike Macgirvin <mike@macgirvin.com>
8  */
9
10 $a->theme_info = array(
11   'extends' => 'duepuntozero',
12 );
13
14 function darkzero_NS_init(&$a) {
15 $a->page['htmlhead'] .= <<< EOT
16 <script>
17 function insertFormatting(comment,BBcode,id) {
18         
19                 var tmpStr = $("#comment-edit-text-" + id).val();
20                 if(tmpStr == comment) {
21                         tmpStr = "";
22                         $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
23                         $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
24                         openMenu("comment-edit-submit-wrapper-" + id);
25                                                                 }
26
27         textarea = document.getElementById("comment-edit-text-" +id);
28         if (document.selection) {
29                 textarea.focus();
30                 selected = document.selection.createRange();
31                 if (BBcode == "url"){
32                         selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
33                         } else                  
34                 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
35         } else if (textarea.selectionStart || textarea.selectionStart == "0") {
36                 var start = textarea.selectionStart;
37                 var end = textarea.selectionEnd;
38                 if (BBcode == "url"){
39                         textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
40                         } else
41                 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
42         }
43         return true;
44 }
45
46 function cmtBbOpen(id) {
47         $(".comment-edit-bb-" + id).show();
48 }
49 function cmtBbClose(id) {
50         $(".comment-edit-bb-" + id).hide();
51 }
52 $(document).ready(function() {
53
54 $('html').click(function() { $("#nav-notifications-menu" ).hide(); });
55
56 $('.group-edit-icon').hover(
57         function() {
58                 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
59         function() {
60                 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
61         );
62
63 $('.sidebar-group-element').hover(
64         function() {
65                 id = $(this).attr('id');
66                 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
67
68         function() {
69                 id = $(this).attr('id');
70                 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
71         );
72
73
74 $('.savedsearchdrop').hover(
75         function() {
76                 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
77         function() {
78                 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
79         );
80
81 $('.savedsearchterm').hover(
82         function() {
83                 id = $(this).attr('id');
84                 $('#drop-' + id).addClass('icon');      $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
85
86         function() {
87                 id = $(this).attr('id');
88                 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
89         );
90
91 });
92
93
94 </script>
95 EOT;
96 }