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