1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
| <?php
/*
* ------------------------------------------------------------------------
* Yt FrameWork for Joomla 3.0
* ------------------------------------------------------------------------
* Copyright (C) 2009 - 2012 The YouTech JSC. All Rights Reserved.
* @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
* Author: The YouTech JSC
* Websites: http://www.smartaddons.com - http://www.cmsportal.net
* ------------------------------------------------------------------------
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
// Add css config to <head>...</head>
$doc->addStyleDeclaration('
body.'.$yt->template.'{
background-color:'.$yt->getParam('bgcolor').' ;
color:'.$yt->getParam('textcolor').' ;
}
body a{
color:'.$yt->getParam('linkcolor').' ;
}
#yt_slideshow,
#yt_header{background-color:'.$yt->getParam('header-bgcolor').' ;}
#yt_footer{background-color:'.$yt->getParam('footer-bgcolor').' ;}
#yt_spotlight5{background-color:'.$yt->getParam('spotlight5-bgcolor').' ;}
');
// Add class pattern to element wrap
?>
<script type="text/javascript">
jQuery(document).ready(function($){
/* Begin: add class pattern for element */
var headerbgimage = '<?php echo $yt->getParam('header-bgimage');?>';
var footerbgimage = '<?php echo $yt->getParam('footer-bgimage');?>';
var spotlight5bgimage = '<?php echo $yt->getParam('spotlight5-bgimage');?>';
var bodybgimage = '<?php echo $yt->getParam('body-bgimage');?>';
if(headerbgimage){
$('#yt_header').addClass(headerbgimage);
$('#yt_slideshow').addClass(headerbgimage);
}
/*
if(footerbgimage){
$('#yt_footer').addClass(footerbgimage);
$('#yt_spotlight2').addClass(footerbgimage);
}
*/
if(spotlight5bgimage){
$('#yt_spotlight5').addClass(spotlight5bgimage);
}
if(bodybgimage){
$('#bd').addClass(bodybgimage);
}
/* End: add class pattern for element */
});
</script>
<?php
// Include cpanel
if( $yt->getParam('showCpanel') ) {
include_once (J_TEMPLATEDIR.J_SEPARATOR.'includes'.J_SEPARATOR.'cpanel.php');
$doc->addStyleSheet($yt->templateurl().'css/cpanel.css','text/css');
$doc->addStyleSheet($yt->templateurl().'asset/minicolors/jquery.miniColors.css','text/css');
$doc->addScript($yt->templateurl().'js/ytcpanel.js');
$doc->addScript($yt->templateurl().'asset/minicolors/jquery.miniColors.min.js');
?>
<script type="text/javascript">
jQuery(document).ready(function($){
/* Begin: Enabling miniColors */
//$('.color-picker').miniColors();
$('.body-backgroud-color .color-picker').miniColors({
change: function(hex, rgb) {
$('body').css('background-color', hex);
createCookie(TMPL_NAME+'_'+($(this).attr('name').match(/^ytcpanel_(.*)$/))[1], hex, 365);
}
});
$('.link-color .color-picker').miniColors({
change: function(hex, rgb) {
$('body a').css('color', hex);
createCookie(TMPL_NAME+'_'+($(this).attr('name').match(/^ytcpanel_(.*)$/))[1], hex, 365);
}
});
$('.text-color .color-picker').miniColors({
change: function(hex, rgb) {
$('body').css('color', hex);
createCookie(TMPL_NAME+'_'+($(this).attr('name').match(/^ytcpanel_(.*)$/))[1], hex, 365);
}
});
$('.header-backgroud-color .color-picker').miniColors({
change: function(hex, rgb) {
$('#yt_header').css('background-color', hex);
$('#yt_slideshow').css('background-color', hex);
createCookie(TMPL_NAME+'_'+($(this).attr('name').match(/^ytcpanel_(.*)$/))[1], hex, 365);
}
});
$('.footer-backgroud-color .color-picker').miniColors({
change: function(hex, rgb) {
$('#yt_footer').css('background-color', hex);
createCookie(TMPL_NAME+'_'+($(this).attr('name').match(/^ytcpanel_(.*)$/))[1], hex, 365);
}
});
$('.spotlight5-backgroud-color .color-picker').miniColors({
change: function(hex, rgb) {
$('#yt_spotlight5').css('background-color', hex);
createCookie(TMPL_NAME+'_'+($(this).attr('name').match(/^ytcpanel_(.*)$/))[1], hex, 365);
}
});
/* End: Enabling miniColors */
/* Begin: Set click pattern */
function patternClick(el, paramCookie, assign){
$(el).click(function(){
oldvalue = $(this).parent().find('.active').html();
$(el).removeClass('active');
$(this).addClass('active');
value = $(this).html();
if(assign.length > 0){
for($i=0; $i < assign.length; $i++){
$(assign[$i]).removeClass(oldvalue);
$(assign[$i]).addClass(value);
}
}
if(paramCookie){
$('input[name$="ytcpanel_'+paramCookie+'"]').attr('value', value);
createCookie(TMPL_NAME+'_'+paramCookie, value, 365);
}
});
}
patternClick('.header-backgroud-image .pattern', 'header-bgimage', Array('#yt_header', '#yt_slideshow'));
patternClick('.body-backgroud-image .pattern', 'body-bgimage', Array('#bd'));
patternClick('.spotlight5-backgroud-image .pattern', 'spotlight5-bgimage', Array('#yt_spotlight5'));
//patternClick('.footer-backgroud-image .pattern', 'footer-bgimage', Array('#yt_spotlight2', '#yt_footer'));
/* End: Set click pattern */
function templateSetting(array){
if(array['0']){
$('.body-backgroud-color input.miniColors').attr('value', array['0']);
$('.body-backgroud-color a.miniColors-trigger').css('background-color', array['0']);
$('input.ytcpanel_bgcolor').attr('value', array['0']);
}
if(array['1']){
$('.link-color input.miniColors').attr('value', array['1']);
$('.link-color a.miniColors-trigger').css('background-color', array['1']);
$('input.ytcpanel_linkcolor').attr('value', array['1']);
}
if(array['2']){
$('.text-color input.miniColors').attr('value', array['2']);
$('.text-color a.miniColors-trigger').css('background-color', array['2']);
$('input.ytcpanel_textcolor').attr('value', array['2']);
}
if(array['3']){
$('.header-backgroud-color input.miniColors').attr('value', array['3']);
$('.header-backgroud-color a.miniColors-trigger').css('background-color', array['3']);
$('input.ytcpanel_header-bgcolor').attr('value', array['3']);
}
if(array['4']){
$('.header-backgroud-image .pattern').removeClass('active');
$('.header-backgroud-image .pattern.'+array['4']).addClass('active');
$('input[name$="ytcpanel_header-bgimage"]').attr('value', array['4']);
}
if(array['5']){
$('.spotlight5-backgroud-color input.miniColors').attr('value', array['5']);
$('.spotlight5-backgroud-color a.miniColors-trigger').css('background-color', array['5']);
$('input.ytcpanel_spotlight5-bgcolor').attr('value', array['5']);
}
if(array['6']){
$('.footer-backgroud-color input.miniColors').attr('value', array['6']);
$('.footer-backgroud-color a.miniColors-trigger').css('background-color', array['6']);
$('input.ytcpanel_footer-bgcolor').attr('value', array['6']);
}
/*if(array['6']){
$('.footer-backgroud-image .pattern').removeClass('active');
$('.footer-backgroud-image .pattern.'+array['6']).addClass('active');
$('input[name$="ytcpanel_footer-bgimage"]').attr('value', array['6']);
}*/
}
var array = Array('bgcolor','linkcolor','textcolor','header-bgcolor','header-bgimage','spotlight5-bgcolor','footer-bgcolor');
var array_red = Array('#ffffff','#ff7b30','#909090','#FFFFFF','pattern_1','#6f0a1c','#3e000b');
var array_green = Array('#ffffff','#c0be00','#909090','#FFFFFF','pattern_1','#156100','#0f4800');
var array_brown = Array('#ffffff','#c36512','#909090','#FFFFFF','pattern_1','#725224','#5c3f15');
var array_purple = Array('#ffffff','#86cbac','#909090','#FFFFFF','pattern_1','#775a70','#5d4156');
$('.theme-color.red').click(function(){
$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
templateSetting(array_red);
onCPApply();
});
$('.theme-color.green').click(function(){
$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
templateSetting(array_green);
onCPApply();
});
$('.theme-color.brown').click(function(){
$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
templateSetting(array_brown);
onCPApply();
});
$('.theme-color.purple').click(function(){
$($(this).parent().find('.active')).removeClass('active'); $(this).addClass('active');
createCookie(TMPL_NAME+'_'+'sitestyle', $(this).html().toLowerCase(), 365);
templateSetting(array_purple);
onCPApply();
});
});
</script>
<?php
}
// Show back to top
if( $yt->getParam('showBacktotop') ) {
include_once (J_TEMPLATEDIR.J_SEPARATOR.'includes'.J_SEPARATOR.'backtotop.php');
}
?> |