tml-rails 4.3.9 → 4.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1e5cd3f7d63afe6bc94747f3e3a23dac286636f
4
- data.tar.gz: a134ecfc3a0c7fb242fdce6dc27769cf04206f8d
3
+ metadata.gz: a2e58f3865d0520142d3e1feb1b5d133c913e13a
4
+ data.tar.gz: 558ab7892b1c672979b71a17e755b36e884d8ef5
5
5
  SHA512:
6
- metadata.gz: 9dee552fe389501fee6693e771c44583c0dafe162a632513fc16f947862f565f9e67f1aa4a73afb0f542558bacf463e74da3ebdbf21a78a3c4db01e7d8b48b19
7
- data.tar.gz: f8fca236f36ea1d6b4759af4795637e56afd131ad1e17f028e9fb0fce8fc69e97cf2ed7c953710a4a2b9ad8efbf326e89015997f12cc3656e204ef9640fda6bc
6
+ metadata.gz: c9cfbdda944dd9adac6cf2d830b197fa898ef90e5ca4430f08094072e7bc88641ee0e3d9eb3bbbb79a1ec08639320ee0c5839102f89d2ebb3f4466dc738befe0
7
+ data.tar.gz: 0aa45bac7a54cd230d056091cb8183c9563c29f3b16eb77387bb9cbe9e9d6bb1df138b0a498030b326a3c646053abe458ea0d049e7ff35de3056481da7ff7bdc
@@ -3,20 +3,43 @@
3
3
  opts[:class] ||= 'dropdown'
4
4
  %>
5
5
 
6
- <<%= opts[:element] %> class="<%= opts[:class] %>" style="<%= opts[:style] %>">
7
- <a href="#" role="button" class="<%= opts[:class] || 'dropdown' %>-toggle" data-toggle="dropdown">
6
+
7
+ <style>
8
+ .trex-dropdown {
9
+ text-align:<%= tml_current_language.align("left") %>;
10
+ }
11
+
12
+ .trex-dropdown .trex-dropdown-menu {
13
+ min-width:200px;
14
+ }
15
+
16
+ .trex-dropdown .trex-dropdown-footer {
17
+ font-size:10px;
18
+ color:#ccc;
19
+ text-align: center;
20
+ background: #f5f5f5;
21
+ padding:5px;
22
+ margin-top: -10px;
23
+ margin-bottom: -5px;
24
+ border-bottom-left-radius: 5px;
25
+ border-bottom-right-radius: 5px;
26
+ }
27
+
28
+ </style>
29
+
30
+
31
+ <<%= opts[:element] %> class="trex-dropdown <%= opts[:class] %>" style="<%= opts[:style] %>">
32
+ <a href="#" role="button" class="<%= opts[:class] || 'dropdown' %>-toggle" data-toggle="dropdown" dir="<%= tml_current_language.dir %>">
8
33
  <%= tml_language_name_tag(tml_current_language, opts) %>
9
34
  </a>
10
35
 
11
- <ul class="dropdown-menu" role="menu">
36
+ <ul class="dropdown-menu trex-dropdown-menu">
12
37
 
13
38
  <% tml_application.languages.each do |lang| %>
14
39
 
15
- <li role="presentation">
40
+ <li dir="<%= tml_current_language.dir %>">
16
41
  <%=link_to({:locale => lang.locale}) do %>
17
-
18
42
  <%= tml_language_name_tag(lang, opts) %>
19
-
20
43
  <% end %>
21
44
  </li>
22
45
 
@@ -33,9 +56,9 @@
33
56
 
34
57
  <li role='presentation' class='divider'></li>
35
58
 
36
- <div style="font-size:8px;color:#ccc;text-align: center; background: #eee; padding:8px; margin-top: -10px; margin-bottom: -5px; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px;">
59
+ <div class="trex-dropdown-footer">
37
60
  <a href="http://translationexchange.com" style="color: #888;">
38
- Powered By Translation Exchange
61
+ <%= tr("Powered By {brand}", brand: "Translation Exchange") %>
39
62
  </a>
40
63
  </div>
41
64
  </ul>
@@ -1,3 +1,9 @@
1
+ <%
2
+ opts[:element] ||= 'div'
3
+ opts[:class] ||= 'dropdown'
4
+ %>
5
+
6
+
1
7
  <style>
2
8
  .trex-language-selector {position: relative;display: inline-block;vertical-align: middle;}
3
9
  .trex-language-toggle,
@@ -10,54 +16,59 @@
10
16
  display: block;font-family:Arial, sans-serif;position: absolute;
11
17
  top: 100%;left: 0;z-index: 1000;float: left;list-style: none;background-color: #FFF;height:0px;width:0px;padding:0;overflow:hidden;
12
18
  }
19
+ .trex-language-selector[dir=rtl] .trex-dropdown-menu {left: auto; right: 0;}
20
+ .trex-language-selector.trex-dropleft[dir=rtl] .trex-dropdown-menu {left:0; right:auto;}
13
21
  .trex-language-selector.trex-open .trex-dropdown-menu {
14
22
  opacity: 1;height:auto;width:auto;overflow:hidden;min-width: 250px;margin: 2px 0 0;font-size: 13px;
15
23
  background-clip: padding-box;border: 1px solid rgba(0, 0, 0, 0.15);box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
16
24
  border-radius: 4px;color: #6D7C88;text-align: left;padding: 5px 0;
17
25
  display:block;pointer-events: auto;-webkit-transform: none;transform: none;
18
26
  }
27
+ .trex-dropdown-menu > li {
28
+ text-align:<%= tml_current_language.align("left") %>;
29
+ }
19
30
  .trex-dropdown-menu > li > a {
20
- display: block;padding: 3px 10px;margin:0 5px;clear: both;font-weight: normal;line-height: 1.42857143;color: #333;border-radius:3px;white-space: nowrap;cursor:pointer;
31
+ display: block;padding: 3px 10px;margin:0 5px;clear: both;font-weight: normal;line-height: 1.42857143;color: #333;border-radius:3px;white-space: nowrap;cursor:pointer;
21
32
  }
22
33
  .trex-dropdown-menu > li > a .trex-flag {margin-right:3px;width:23px;}
23
34
  .trex-dropdown-menu > li.trex-language-item > a:hover,
24
35
  .trex-dropdown-menu > li.trex-language-item > a:focus {text-decoration:none;background: #F0F2F4;}
25
36
  .trex-dropdown-menu > li.trex-language-item > a .trex-native-name {font-size: 11px;color: #A9AFB8;margin-left: 3px;}
26
- .trex-dropdown-menu > li.trex-selected a:after {content: "\2713";float: right;font-weight: bold;font-size: 16px;margin: 0px 5px 0 0;color: #13CF80;}
37
+ .trex-dropdown-menu > li.trex-selected a:after {content: "\2713";float: <%= tml_current_language.align(:right) %>;font-weight: bold;font-size: 16px;margin: 0px 5px 0 0;color: #13CF80;}
27
38
  .trex-dropdown-menu .trex-credit a {border-top: solid 1px #DDD;font-size: 13px;padding: 7px 0 0;margin: 5px 15px 5px;color: #9FA7AE;font-weight: 400;}
28
39
  </style>
29
40
 
30
41
 
31
- <div class="trex-language-selector">
32
- <a class="trex-language-toggle" data-toggle="language-selector" tabindex="0">
42
+ <<%= opts[:element] %> class="trex-language-selector" dir="<%= tml_current_language.dir %>">
43
+ <a class="trex-language-toggle" data-toggle="language-selector" tabindex="0" dir="<%= tml_current_language.dir %>">
33
44
  <%= tml_language_name_tag(tml_current_language, opts) %>
34
45
  </a>
35
46
  <ul class="trex-dropdown-menu">
36
47
  <% tml_application.languages.each do |lang| %>
37
48
 
38
- <li class="trex-language-item">
49
+ <li class="trex-language-item <%='trex-selected' if tml_current_language.locale == lang.locale %>" dir="<%= tml_current_language.dir %>">
39
50
  <%=link_to({:locale => lang.locale}) do %>
40
- <%= tml_language_name_tag(lang, opts) %>
51
+ <%= tml_language_name_tag(lang, opts.merge(:language => :both)) %>
41
52
  <% end %>
42
53
  </li>
43
54
 
44
55
  <% end %>
45
56
 
46
57
  <% if opts[:toggle] %>
47
- <li class='trex-credit'>
58
+ <li class='trex-credit' dir="<%= tml_current_language.dir %>">
48
59
  <a href='javascript:void(0);' onclick='Tml.Utils.toggleInlineTranslations()'>
49
60
  <%= tr(opts[:toggle_label] || 'Help Us Translate') %>
50
61
  </a>
51
62
  </li>
52
63
  <% end %>
53
64
 
54
- <li class="trex-credit">
65
+ <li class="trex-credit" dir="<%= tml_current_language.dir %>">
55
66
  <a href="http://translationexchange.com">
56
67
  Powered by Translation Exchange
57
68
  </a>
58
69
  </li>
59
70
  </ul>
60
- </div>
71
+ </<%= opts[:element] %>>
61
72
 
62
73
 
63
74
  <script>
@@ -64,21 +64,28 @@ module TmlRails
64
64
 
65
65
  def tml_language_name_tag(lang = tml_current_language, opts = {})
66
66
  show_flag = opts[:flag].nil? ? true : opts[:flag]
67
- name_type = opts[:language].nil? ? :english : opts[:language] # :full, :native, :english, :locale
67
+ name_type = opts[:language].nil? ? :english : opts[:language] # :full, :native, :english, :locale, :both
68
68
 
69
69
  html = []
70
70
  html << "<span style='white-space: nowrap'>"
71
71
  html << tml_language_flag_tag(lang, opts) if show_flag
72
72
  html << "<span dir='ltr'>"
73
73
 
74
- name = case name_type
75
- when :native then lang.native_name
76
- when :full then lang.full_name
77
- when :locale then lang.locale
78
- else lang.english_name
74
+ if name_type == :both
75
+ html << lang.english_name.to_s
76
+ html << '<span class="trex-native-name">'
77
+ html << lang.native_name
78
+ html << '</span>'
79
+ else
80
+ name = case name_type
81
+ when :native then lang.native_name
82
+ when :full then lang.full_name
83
+ when :locale then lang.locale
84
+ else lang.english_name
85
+ end
86
+ html << name.to_s
79
87
  end
80
88
 
81
- html << name.to_s
82
89
  html << '</span></span>'
83
90
  html.join().html_safe
84
91
  end
@@ -30,5 +30,5 @@
30
30
  #++
31
31
 
32
32
  module TmlRails
33
- VERSION = '4.3.9'
33
+ VERSION = '4.3.10'
34
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tml-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.9
4
+ version: 4.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Berkovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-13 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails