1 <script src="{{$baseurl}}/view/theme/quattro/jquery.tools.min.js"></script>
2 <script type="text/javascript" src="{{$baseurl}}/view/js/ajaxupload.js" ></script>
4 {{include file="field_select.tpl" field=$scheme}}
6 {{if $nav_bg}}{{include file="field_input.tpl" field=$share_string}}{{/if}}
7 {{if $nav_bg}}{{include file="field_colorinput.tpl" field=$nav_bg}}{{/if}}
8 {{if $nav_icon_color}}{{include file="field_colorinput.tpl" field=$nav_icon_color}}{{/if}}
9 {{if $link_color}}{{include file="field_colorinput.tpl" field=$link_color}}{{/if}}
11 {{if $background_color}}{{include file="field_colorinput.tpl" field=$background_color}}{{/if}}
13 {{* The slider for the content opacity - We use no template for this since it is only used at this page *}}
14 {{if $contentbg_transp}}
15 <div class="form-group field input color">
16 <label for="id_{{$contentbg_transp.0}}" id="label_{{$contentbg_transp.0}}">{{$contentbg_transp.1}}</label>
19 <div class="col-xs-9">
20 <input type="range" class="form-control color" id="{{$contentbg_transp.0}}_range" min="0" max="100" step="1" value="{{$contentbg_transp.2}}" onchange="{{$contentbg_transp.0}}.value = this.value" oninput="{{$contentbg_transp.0}}.value = this.value">
22 <div class="col-xs-3">
23 <div class="input-group">
24 <input type="text" class="form-control input-sm" name="{{$contentbg_transp.0}}" id="{{$contentbg_transp.0}}" value="{{$contentbg_transp.2}}" onchange="{{$contentbg_transp.0}}_range.value = this.value" oninput="{{$contentbg_transp.0}}_range.value = this.value" aria-describedby="{{$contentbg_transp.0}}_tip">
25 <span class="input-group-addon image-select">%</span>
30 <span id="{{$contentbg_transp.0}}_tip" class="help-block" role="tooltip">{{$contentbg_transp.3}}</span>
31 <div id="end_{{$contentbg_transp.0}}" class="field_end"></div>
35 {{if $background_image}}{{include file="field_fileinput.tpl" field=$background_image}}{{/if}}
37 <div id="frio_bg_image_options" style="display: none;">
38 <label>{{$bg_image_options_title}}:</label>
39 {{foreach $bg_image_options as $options}}
40 {{include file="field_radio.tpl" field=$options}}
44 {{if $login_bg_image}}{{include file="field_fileinput.tpl" field=$login_bg_image}}{{/if}}
45 {{if $login_bg_color}}{{include file="field_colorinput.tpl" field=$login_bg_color}}{{/if}}
47 <script type="text/javascript">
48 $(document).ready(function() {
50 function GenerateShareString() {
52 // Parse initial share_string
53 if ($("#id_frio_nav_bg").length) {
54 theme.nav_bg = $("#id_frio_nav_bg").val();
57 if ($("#id_frio_nav_icon_color").length) {
58 theme.nav_icon_color = $("#id_frio_nav_icon_color").val();
61 if ($("#id_frio_link_color").length) {
62 theme.link_color = $("#id_frio_link_color").val();
65 if ($("#id_frio_background_color").length) {
66 theme.background_color = $("#id_frio_background_color").val();
69 if ($("#id_frio_background_image").length) {
70 theme.background_image = $("#id_frio_background_image").val();
72 if (theme.background_image.length > 0) {
73 if ($("#id_frio_bg_image_option_stretch").is(":checked") == true) {
74 theme.background_image_option = "stretch";
76 if ($("#id_frio_bg_image_option_cover").is(":checked") == true) {
77 theme.background_image_option = "cover";
79 if ($("#id_frio_bg_image_option_contain").is(":checked") == true) {
80 theme.background_image_option = "contain";
82 if ($("#id_frio_bg_image_option_repeat").is(":checked") == true) {
83 theme.background_image_option = "repeat";
88 if ($("#frio_contentbg_transp").length) {
89 theme.contentbg_transp = $("#frio_contentbg_transp").val();
92 if ($("#id_frio_login_bg_image").length) {
93 theme.login_bg_image = $("#id_frio_login_bg_image").val();
96 if ($("#id_frio_login_bg_color").length) {
97 theme.login_bg_color = $("#id_frio_login_bg_color").val();
99 if (!($("#id_frio_share_string").is(":focus"))){
100 var share_string = JSON.stringify(theme);
101 $("#id_frio_share_string").val(share_string);
105 // interval because jquery.val does not trigger events
106 window.setInterval(GenerateShareString, 500);
107 GenerateShareString();
109 // Take advantage of the effects of previous comment
110 $(document).on("input", "#id_frio_share_string", function() {
111 theme = JSON.parse($("#id_frio_share_string").val());
113 if ($("#id_frio_nav_bg").length) {
114 $("#id_frio_nav_bg").val(theme.nav_bg);
117 if ($("#id_frio_nav_icon_color").length) {
118 $("#id_frio_nav_icon_color").val(theme.nav_icon_color);
121 if ($("#id_frio_link_color").length) {
122 $("#id_frio_link_color").val(theme.link_color);
125 if ($("#id_frio_background_color").length) {
126 $("#id_frio_background_color").val(theme.background_color);
129 if ($("#id_frio_background_image").length) {
130 $("#id_frio_background_image").val(theme.background_image);
131 var elText = theme.background_image;
132 if(elText.length !== 0) {
133 $("#frio_bg_image_options").show();
135 $("#frio_bg_image_options").hide();
138 switch (theme.background_image_option) {
140 $("#id_frio_bg_image_option_stretch").prop("checked", true);
143 $("#id_frio_bg_image_option_cover").prop("checked", true);
146 $("#id_frio_bg_image_option_contain").prop("checked", true);
149 $("#id_frio_bg_image_option_repeat").prop("checked", true);
154 if ($("#frio_contentbg_transp").length) {
155 $("#frio_contentbg_transp").val(theme.contentbg_transp);
158 if ($("#id_frio_login_bg_image").length) {
159 $("#id_frio_login_bg_image").val(theme.login_bg_image);
162 if ($("#id_frio_login_bg_color").length) {
163 $("#id_frio_login_bg_color").val(theme.login_bg_color);
166 // Create colorpickers
167 $("#frio_nav_bg, #frio_nav_icon_color, #frio_background_color, #frio_link_color, #frio_login_bg_color").colorpicker({format: 'hex', align: 'left'});
169 // show image options when user user starts to type the address of the image
170 $("#id_frio_background_image").keyup(function(){
171 var elText = $(this).val();
172 if(elText.length !== 0) {
173 $("#frio_bg_image_options").show();
175 $("#frio_bg_image_options").hide();
179 // show the image options is there is allready an image
180 if($("#id_frio_background_image").val().length != 0) {
181 $("#frio_bg_image_options").show();
186 <div class="form-group">
187 {{include file="field_checkbox.tpl" field=$enable_compose}}
190 <div class="settings-submit-wrapper form-group pull-right">
191 <button type="submit" value="{{$submit}}" class="settings-submit btn btn-primary" name="frio-settings-submit">{{$submit}}</button>
193 <div class="clearfix"></div>