5 * Description: Theme opzimized for Tablets
7 * Author: Alex <https://friendica.pixelbits.de/profile/alex>
8 * Maintainer: Alex <https://friendica.pixelbits.de/profile/alex>
9 * Screenshot: <a href="screenshot.jpg">Screenshot</a>
12 $a->theme_info = array(
13 'extends' => 'smoothly',
15 function smoothly_init(&$a) {
16 $a->page['htmlhead'] .= <<< EOT
19 function insertFormatting(comment,BBcode,id) {
21 var tmpStr = $("#comment-edit-text-" + id).val();
22 if(tmpStr == comment) {
24 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
25 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
26 openMenu("comment-edit-submit-wrapper-" + id);
27 $("#comment-edit-text-" + id).val(tmpStr);
30 textarea = document.getElementById("comment-edit-text-" +id);
31 if (document.selection) {
33 selected = document.selection.createRange();
35 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
37 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
38 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
39 var start = textarea.selectionStart;
40 var end = textarea.selectionEnd;
42 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
44 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
49 function cmtBbOpen(id) {
50 $(".comment-edit-bb-" + id).show();
52 function cmtBbClose(comment, id) {
53 $(".comment-edit-bb-" + id).hide();
56 $(document).ready(function() {
58 $('.group-edit-icon').hover(
60 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
62 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
65 $('.sidebar-group-element').hover(
67 id = $(this).attr('id');
68 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
71 id = $(this).attr('id');
72 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
76 $('.savedsearchdrop').hover(
78 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
80 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
83 $('.savedsearchterm').hover(
85 id = $(this).attr('id');
86 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
89 id = $(this).attr('id');
90 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
98 // get resize configuration
101 $site_resize = get_config('smoothly', 'resize' );
102 if(local_user()) $resize = get_pconfig(local_user(), 'smoothly', 'resize' );
104 if ($resize===false) $resize=$site_resize;
105 if ($resize===false) $resize=0;
107 if (intval($resize) > 0) {
108 //load jquery.ae.image.resize.js
109 $imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/smoothly/js/jquery.ae.image.resize.js";
110 $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS);
111 $a->page['htmlhead'] .= '
115 $(".wall-item-content img").aeImageResize({height: '.$resize.', width: '.$resize.'});