source: extensions/Subscribe_to_comments/template/form_outside.tpl @ 29531

Last change on this file since 29531 was 26173, checked in by mistic100, 10 years ago

improve lisiblity

File size: 2.8 KB
Line 
1{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
2{combine_css id='colorbox' path='themes/default/js/plugins/colorbox/style2/colorbox.css'}
3
4{html_style}
5#stc_comment input, #stc_standalone input { margin:0 5px !important; }
6{/html_style}
7
8{footer_script require='jquery,jquery.colorbox'}
9(function($){
10  $('#open_stc_standalone').colorbox({
11    inline: true
12  });
13  $('#close_stc_standalone').on('click', function(e) {
14    $('#open_stc_standalone').colorbox.close();
15    e.preventDefault();
16  });
17
18  var bg_color = 'white';
19  $.each(['#the_page #content', 'body'], function(i, selector) {
20    var color = $(selector).css('background-color');
21    if (color && color!='transparent') {
22      bg_color = color;
23      return false;
24    }
25  });
26  $('#stc_standalone').css('background-color', bg_color);
27
28{if !isset($STC_SUBSCRIBED) and $STC.ASK_MAIL}
29        var $stc_email_input = $("#addComment input[name='email']");
30  var stc_bordercolor = $stc_email_input.css('border-color');
31
32  $("#addComment input[name='stc_mode']").change(function() {
33    if ($(this).val() != "-1") {
34      if ($stc_email_input.val()=="") {
35        $stc_email_input.css("border-color", "red");
36      }
37    }
38    else {
39      $stc_email_input.css("border-color", stc_bordercolor);
40    }
41  });
42  $stc_email_input.change(function() {
43    $(this).css('border-color', stc_bordercolor);
44  });
45{/if}
46}(jQuery));
47{/footer_script}
48
49<div style="display:none">
50  <form method="post" action="{$comment_add.F_ACTION}" id="stc_standalone" style="padding:10px;min-width:350px;">
51  {if $STC.ON_PICTURE}
52    {if $STC.ALLOW_GLOBAL}
53      <label><input type="radio" name="stc_mode" value="image"> {'this picture'|translate|ucfirst}</label><br>
54      {if $STC.ALLOW_ALBUM_IMAGES}<label><input type="radio" name="stc_mode" value="album-images"> {'all pictures of this album'|translate|ucfirst}</label><br>{/if}
55      <label><input type="radio" name="stc_mode" value="all-images"> {'all pictures of the gallery'|translate|ucfirst}</label><br>
56    {else}
57      <input type="hidden" name="stc_mode" value="image">
58    {/if}
59  {else if $STC.ON_ALBUM}
60    {if $STC.ALLOW_GLOBAL}
61      <label><input type="radio" name="stc_mode" value="album"> {'this album'|translate|ucfirst}</label><br>
62      <label><input type="radio" name="stc_mode" value="all-albums"> {'all albums of the gallery'|translate|ucfirst}</label><br>
63    {else}
64      <input type="hidden" name="stc_mode" value="album">
65    {/if}
66  {/if}
67  {if $STC.ASK_MAIL}
68    <label>{'Email'|translate} <input type="text" name="stc_mail" size="30"></label>
69  {/if}
70    <div style="margin-top:0.5em;">
71      <label><input type="submit" name="stc_submit" value="{'Subscribe'|translate}"></label>
72      <a href="#" id="close_stc_standalone">&#10006; {'Cancel'|translate}</a>
73    </div>
74  </form>
75</div>
Note: See TracBrowser for help on using the repository browser.