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
6 * Author: Christian Vogeley (https://christian-vogeley.de/profile/christian)
8 $a->theme_info = array(
9 'extends' => 'duepuntozero',
11 function cleanzero_init(&$a) {
12 $a->page['htmlhead'] .= <<< EOT
15 function insertFormatting(comment,BBcode,id) {
17 var tmpStr = $("#comment-edit-text-" + id).val();
18 if(tmpStr == comment) {
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);
26 textarea = document.getElementById("comment-edit-text-" +id);
27 if (document.selection) {
29 selected = document.selection.createRange();
31 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
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;
38 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
40 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
45 function cmtBbOpen(id) {
46 $(".comment-edit-bb-" + id).show();
48 function cmtBbClose(comment, id) {
49 $(".comment-edit-bb-" + id).hide();
52 $(document).ready(function() {
54 $('.group-edit-icon').hover(
56 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
58 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
61 $('.sidebar-group-element').hover(
63 id = $(this).attr('id');
64 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
67 id = $(this).attr('id');
68 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
72 $('.savedsearchdrop').hover(
74 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
76 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
79 $('.savedsearchterm').hover(
81 id = $(this).attr('id');
82 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
85 id = $(this).attr('id');
86 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
94 // get resize configuration
97 $site_resize = get_config('cleanzero', 'resize' );
98 if(local_user()) $resize = get_pconfig(local_user(), 'cleanzero', 'resize' );
100 if ($resize===false) $resize=$site_resize;
101 if ($resize===false) $resize=0;
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'] .= '
111 $(".wall-item-content img").aeImageResize({height: '.$resize.', width: '.$resize.'});