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 set_template_engine($a, 'smarty3');
13 function cleanzero_init(&$a) {
14 $a->page['htmlhead'] .= <<< EOT
17 function insertFormatting(comment,BBcode,id) {
19 var tmpStr = $("#comment-edit-text-" + id).val();
20 if(tmpStr == comment) {
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 $("#comment-edit-text-" + id).val(tmpStr);
28 textarea = document.getElementById("comment-edit-text-" +id);
29 if (document.selection) {
31 selected = document.selection.createRange();
33 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
35 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
36 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
37 var start = textarea.selectionStart;
38 var end = textarea.selectionEnd;
40 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
42 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
47 function cmtBbOpen(comment, id) {
48 if($(comment).hasClass('comment-edit-text-full')) {
49 $(".comment-edit-bb-" + id).show();
54 function cmtBbClose(comment, id) {
55 // if($(comment).hasClass('comment-edit-text-empty')) {
56 // $(".comment-edit-bb-" + id).hide();
63 $(document).ready(function() {
65 $('.group-edit-icon').hover(
67 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
69 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
72 $('.sidebar-group-element').hover(
74 id = $(this).attr('id');
75 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
78 id = $(this).attr('id');
79 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
83 $('.savedsearchdrop').hover(
85 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
87 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
90 $('.savedsearchterm').hover(
92 id = $(this).attr('id');
93 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
96 id = $(this).attr('id');
97 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
105 // get resize configuration
108 $site_resize = get_config('cleanzero', 'resize' );
109 if(local_user()) $resize = get_pconfig(local_user(), 'cleanzero', 'resize' );
111 if ($resize===false) $resize=$site_resize;
112 if ($resize===false) $resize=0;
114 if (intval($resize) > 0) {
115 //load jquery.ae.image.resize.js
116 $imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/cleanzero/js/jquery.ae.image.resize.js";
117 $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS);
118 $a->page['htmlhead'] .= '
122 $(".wall-item-content img").aeImageResize({height: '.$resize.', width: '.$resize.'});