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(comment, id) {
46 if($(comment).hasClass('comment-edit-text-full')) {
47 $(".comment-edit-bb-" + id).show();
52 function cmtBbClose(comment, id) {
53 // if($(comment).hasClass('comment-edit-text-empty')) {
54 // $(".comment-edit-bb-" + id).hide();
61 $(document).ready(function() {
63 $('.group-edit-icon').hover(
65 $(this).addClass('icon'); $(this).removeClass('iconspacer');},
67 $(this).removeClass('icon'); $(this).addClass('iconspacer');}
70 $('.sidebar-group-element').hover(
72 id = $(this).attr('id');
73 $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
76 id = $(this).attr('id');
77 $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
81 $('.savedsearchdrop').hover(
83 $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
85 $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
88 $('.savedsearchterm').hover(
90 id = $(this).attr('id');
91 $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
94 id = $(this).attr('id');
95 $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
103 // get resize configuration
106 $site_resize = get_config('cleanzero', 'resize' );
107 if(local_user()) $resize = get_pconfig(local_user(), 'cleanzero', 'resize' );
109 if ($resize===false) $resize=$site_resize;
110 if ($resize===false) $resize=0;
112 if (intval($resize) > 0) {
113 //load jquery.ae.image.resize.js
114 $imageresizeJS = $a->get_baseurl($ssl_state)."/view/theme/cleanzero/js/jquery.ae.image.resize.js";
115 $a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s" ></script>', $imageresizeJS);
116 $a->page['htmlhead'] .= '
120 $(".wall-item-content img").aeImageResize({height: '.$resize.', width: '.$resize.'});