tml-rails 4.3.8 → 4.3.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1e5cd3f7d63afe6bc94747f3e3a23dac286636f
|
4
|
+
data.tar.gz: a134ecfc3a0c7fb242fdce6dc27769cf04206f8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9dee552fe389501fee6693e771c44583c0dafe162a632513fc16f947862f565f9e67f1aa4a73afb0f542558bacf463e74da3ebdbf21a78a3c4db01e7d8b48b19
|
7
|
+
data.tar.gz: f8fca236f36ea1d6b4759af4795637e56afd131ad1e17f028e9fb0fce8fc69e97cf2ed7c953710a4a2b9ad8efbf326e89015997f12cc3656e204ef9640fda6bc
|
@@ -33,11 +33,8 @@
|
|
33
33
|
|
34
34
|
<li role='presentation' class='divider'></li>
|
35
35
|
|
36
|
-
<div style="font-size:8px;color:#ccc;text-align: center">
|
37
|
-
<a href="http://translationexchange.com">
|
38
|
-
<img style="padding: 10px;border: 0px;background-repeat: no-repeat;background-size: 14px 17px;
|
39
|
-
background-image:url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAEMAAABQCAYAAABCiMhGAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRm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IZlEEZlEEZEZONuf0YmASLYNNGPRI1e8FFsHUjZNwAg5Zd3GHwHuw02Uw+WShCZRr0m+4zPljc9D+alpG1WMYW0zJsfgplxMGTYp1BGZRBGZRBGZRBGZRBGZRBGZRBGQxlUAZlUAZlUAZlUAZlUAZlUAZlUIbDMmyeYr3KO6OUJdMyGiyWcdS0DPV+ykMLRRwD16JuHGc60gV9Fd6KP/Vxs/hTEDvBbIT9nQLNEdp8XkpTH0/GMRl3bladJpi7EWQcB89dfLSW24EdAeOsM0T2gQkWXX4bf6P7mlTL2KFFbE97Ob4NvAO70j42UcdTbyHU2jo28Qwe7zXYb2nl6mXE3DzwF6DJ5kGrkjFv4EBP4laHBjKjZDz7zwfJgTOWi3iVG2qfVTKui//ZhMTaXmD9Hmi1XMSf4m9UMubAIfAY/Epg58t62QcuWyxhQfx37A7grvgcHKipgdU5UPWX538LuBlh8Deu+4oVS2X8BN8h4p+j1jlNMOW+5lQ8+QmpsIQpusr5vsYV8EUqNElWoKojHpYKTlIyusFtqfAkIWMA9IgDiStD/cXXIY4kjowHoE0cSlQZj8AlcSxRZDwF58XBhJGxFlgfBWfF0YSR4QXK62ZxOGFk1OtR7QlxPGFkjIBGSUHWBRgAlJNpO4bVinwAAAAASUVORK5CYII=);"/>
|
40
|
-
<br>
|
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;">
|
37
|
+
<a href="http://translationexchange.com" style="color: #888;">
|
41
38
|
Powered By Translation Exchange
|
42
39
|
</a>
|
43
40
|
</div>
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<style>
|
2
|
+
.trex-language-selector {position: relative;display: inline-block;vertical-align: middle;}
|
3
|
+
.trex-language-toggle,
|
4
|
+
.trex-language-toggle:hover,
|
5
|
+
.trex-language-toggle:focus {cursor:pointer;text-decoration:none;outline:none;}
|
6
|
+
.trex-dropup .trex-dropdown-menu {top: auto;bottom: 100%;margin-bottom: 1px;-webkit-transform: scale(0.8) translateY(10%);transform: scale(0.8) translateY(10%);}
|
7
|
+
.trex-dropleft .trex-dropdown-menu {left: auto; right: 0;}
|
8
|
+
.trex-dropdown-menu {
|
9
|
+
-webkit-transform: scale(0.8) translateY(10%);transform: scale(0.8) translateY(10%);transition: 0.13s cubic-bezier(0.3, 0, 0, 1.3);opacity: 0;pointer-events: none;
|
10
|
+
display: block;font-family:Arial, sans-serif;position: absolute;
|
11
|
+
top: 100%;left: 0;z-index: 1000;float: left;list-style: none;background-color: #FFF;height:0px;width:0px;padding:0;overflow:hidden;
|
12
|
+
}
|
13
|
+
.trex-language-selector.trex-open .trex-dropdown-menu {
|
14
|
+
opacity: 1;height:auto;width:auto;overflow:hidden;min-width: 250px;margin: 2px 0 0;font-size: 13px;
|
15
|
+
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
|
+
border-radius: 4px;color: #6D7C88;text-align: left;padding: 5px 0;
|
17
|
+
display:block;pointer-events: auto;-webkit-transform: none;transform: none;
|
18
|
+
}
|
19
|
+
.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;
|
21
|
+
}
|
22
|
+
.trex-dropdown-menu > li > a .trex-flag {margin-right:3px;width:23px;}
|
23
|
+
.trex-dropdown-menu > li.trex-language-item > a:hover,
|
24
|
+
.trex-dropdown-menu > li.trex-language-item > a:focus {text-decoration:none;background: #F0F2F4;}
|
25
|
+
.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;}
|
27
|
+
.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
|
+
</style>
|
29
|
+
|
30
|
+
|
31
|
+
<div class="trex-language-selector">
|
32
|
+
<a class="trex-language-toggle" data-toggle="language-selector" tabindex="0">
|
33
|
+
<%= tml_language_name_tag(tml_current_language, opts) %>
|
34
|
+
</a>
|
35
|
+
<ul class="trex-dropdown-menu">
|
36
|
+
<% tml_application.languages.each do |lang| %>
|
37
|
+
|
38
|
+
<li class="trex-language-item">
|
39
|
+
<%=link_to({:locale => lang.locale}) do %>
|
40
|
+
<%= tml_language_name_tag(lang, opts) %>
|
41
|
+
<% end %>
|
42
|
+
</li>
|
43
|
+
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<% if opts[:toggle] %>
|
47
|
+
<li class='trex-credit'>
|
48
|
+
<a href='javascript:void(0);' onclick='Tml.Utils.toggleInlineTranslations()'>
|
49
|
+
<%= tr(opts[:toggle_label] || 'Help Us Translate') %>
|
50
|
+
</a>
|
51
|
+
</li>
|
52
|
+
<% end %>
|
53
|
+
|
54
|
+
<li class="trex-credit">
|
55
|
+
<a href="http://translationexchange.com">
|
56
|
+
Powered by Translation Exchange
|
57
|
+
</a>
|
58
|
+
</li>
|
59
|
+
</ul>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<script>
|
64
|
+
(function() {
|
65
|
+
'use strict';
|
66
|
+
|
67
|
+
// utilities
|
68
|
+
function addEvent(evnt, elem, func) {
|
69
|
+
if (elem.addEventListener) elem.addEventListener(evnt,func,false);
|
70
|
+
else if (elem.attachEvent) elem.attachEvent("on"+evnt, func);
|
71
|
+
else elem[evnt] = func;
|
72
|
+
}
|
73
|
+
|
74
|
+
function hasClass(elem, cls) {
|
75
|
+
return elem.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
|
76
|
+
}
|
77
|
+
|
78
|
+
function addClass(elem, cls) {
|
79
|
+
if (!hasClass(elem, cls)) elem.className += " " + cls;
|
80
|
+
}
|
81
|
+
|
82
|
+
function removeClass(elem, cls) {
|
83
|
+
if (hasClass(elem, cls)) {
|
84
|
+
var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
|
85
|
+
elem.className = elem.className.replace(reg, ' ');
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
function toggleClass(elem, cls) {
|
90
|
+
if (!hasClass(elem, cls)) addClass(elem, cls);
|
91
|
+
else removeClass(elem, cls);
|
92
|
+
}
|
93
|
+
|
94
|
+
var LanguageSelector = function(element) {
|
95
|
+
this.element = element;
|
96
|
+
this.element.setAttribute('tabindex', '0');
|
97
|
+
addEvent('click', this.element, this.open.bind(this))
|
98
|
+
addEvent('blur', this.element, this.close.bind(this))
|
99
|
+
};
|
100
|
+
|
101
|
+
LanguageSelector.VERSION = "0.1.0";
|
102
|
+
LanguageSelector.prototype = {
|
103
|
+
adjustMenu: function(parent){
|
104
|
+
removeClass(parent, "trex-dropup");
|
105
|
+
removeClass(parent, "trex-dropleft");
|
106
|
+
var
|
107
|
+
menu = parent.querySelectorAll('.trex-dropdown-menu')[0],
|
108
|
+
bounds = menu.getBoundingClientRect(),
|
109
|
+
vHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
|
110
|
+
vWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
|
111
|
+
buffer = 10;
|
112
|
+
|
113
|
+
if(bounds.top + menu.offsetHeight + buffer > vHeight) addClass(parent, "trex-dropup");
|
114
|
+
if(bounds.left + menu.offsetWidth + buffer > vWidth) addClass(parent, "trex-dropleft");
|
115
|
+
},
|
116
|
+
open: function(e){
|
117
|
+
|
118
|
+
e = e || window.event;
|
119
|
+
e.stopPropagation();
|
120
|
+
e.preventDefault();
|
121
|
+
var target = e.currentTarget || e.srcElement;
|
122
|
+
if(hasClass(target.parentElement,'trex-open')) {
|
123
|
+
return this.close(e);
|
124
|
+
}
|
125
|
+
addClass(target.parentElement,'trex-open');
|
126
|
+
this.adjustMenu(target.parentElement);
|
127
|
+
return false;
|
128
|
+
},
|
129
|
+
close: function(e) {
|
130
|
+
e = e || window.event;
|
131
|
+
var target = e.currentTarget || e.srcElement;
|
132
|
+
removeClass(target.parentElement, 'trex-open');
|
133
|
+
|
134
|
+
if(e.relatedTarget && e.relatedTarget.getAttribute('data-toggle') !== 'language-selector') {
|
135
|
+
e.relatedTarget.click();
|
136
|
+
}
|
137
|
+
return false;
|
138
|
+
}
|
139
|
+
};
|
140
|
+
var selectorList = document.querySelectorAll('[data-toggle=language-selector]');
|
141
|
+
for (var i = 0, el, l = selectorList.length; i < l; i++) {
|
142
|
+
el = selectorList[i];
|
143
|
+
el.languageSelector = new LanguageSelector(el);
|
144
|
+
}
|
145
|
+
})();
|
146
|
+
</script>
|
@@ -87,7 +87,7 @@ module TmlRails
|
|
87
87
|
return unless Tml.config.enabled?
|
88
88
|
|
89
89
|
type ||= :default
|
90
|
-
unless [:bootstrap, :default, :inline, :select].include?(type.to_sym)
|
90
|
+
unless [:bootstrap, :default, :inline, :select, :popup].include?(type.to_sym)
|
91
91
|
return "Unsupported language selector #{type}"
|
92
92
|
end
|
93
93
|
|
data/lib/tml_rails/version.rb
CHANGED
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.
|
4
|
+
version: 4.3.9
|
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-
|
11
|
+
date: 2015-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- app/views/tml_rails/tags/_language_selector_default.html.erb
|
54
54
|
- app/views/tml_rails/tags/_language_selector_inline.html.erb
|
55
55
|
- app/views/tml_rails/tags/_language_selector_js.html.erb
|
56
|
+
- app/views/tml_rails/tags/_language_selector_popup.html.erb
|
56
57
|
- app/views/tml_rails/tags/_language_selector_select.html.erb
|
57
58
|
- app/views/tml_rails/tags/_language_strip.html.erb
|
58
59
|
- app/views/tml_rails/tags/_powered_by_trex.html.erb
|