Google Language Translator - Version 5.0.43

Version Description

Download this release

Release Info

Developer rm2773
Plugin Icon wp plugin Google Language Translator
Version 5.0.43
Comparing to
See all releases

Code changes from version 5.0.42 to 5.0.43

Files changed (6) hide show
  1. css/style.php +19 -0
  2. css/toolbar.css +172 -169
  3. google-language-translator.php +32 -10
  4. js/scripts-admin.js +6 -6
  5. js/scripts.js +17 -39
  6. readme.txt +4 -1
css/style.php CHANGED
@@ -3,6 +3,7 @@
3
  $glt_css = get_option("googlelanguagetranslator_css");
4
  $language_switcher_width = get_option('glt_language_switcher_width');
5
  $glt_display = get_option('googlelanguagetranslator_display');
 
6
 
7
  echo '<style type="text/css">';
8
  echo $glt_css;
@@ -88,6 +89,24 @@ elseif (get_option('googlelanguagetranslator_toolbar')=='No'):
88
  endif;
89
  endif;
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  if (!empty($language_switcher_width) && isset($language_switcher_width) && $glt_display != 'Horizontal'):
92
  echo '.goog-te-gadget .goog-te-combo { width:'.$language_switcher_width.'; }';
93
  endif;
3
  $glt_css = get_option("googlelanguagetranslator_css");
4
  $language_switcher_width = get_option('glt_language_switcher_width');
5
  $glt_display = get_option('googlelanguagetranslator_display');
6
+ $floating_widget_position = get_option ('glt_floating_widget_position');
7
 
8
  echo '<style type="text/css">';
9
  echo $glt_css;
89
  endif;
90
  endif;
91
 
92
+ if ($floating_widget_position == 'bottom_left'):
93
+ echo '#glt-translate-trigger { left:20px; right:auto; }';
94
+ elseif ($floating_widget_position == 'top_right'):
95
+ echo '#glt-translate-trigger { bottom:auto; top:0; border-top-left-radius:0; border-top-right-radius:0; -webkit-border-top-left-radius:0; -webkit-border-top-right-radius:0; -moz-border-top-left-radius:0; -moz-border-top-right-radius:0; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-bottom-left-radius: 5px; -moz-border-bottom-right-radius: 5px;}';
96
+ echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }';
97
+ echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }';
98
+ elseif ($floating_widget_position == 'top_left'):
99
+ echo '#glt-translate-trigger { bottom:auto; top:0; left:20px; right:auto; border-top-left-radius:0; border-top-right-radius:0; -webkit-border-top-left-radius:0; -webkit-border-top-right-radius:0; -moz-border-top-left-radius:0; -moz-border-top-right-radius:0; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-bottom-left-radius: 5px; -moz-border-bottom-right-radius: 5px;}';
100
+ echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }';
101
+ echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }';
102
+ elseif ($floating_widget_position == 'top_center'):
103
+ echo '#glt-translate-trigger { bottom:auto; top:0; left:50%; margin-left:-63px; right:auto; border-top-left-radius:0; border-top-right-radius:0; -webkit-border-top-left-radius:0; -webkit-border-top-right-radius:0; -moz-border-top-left-radius:0; -moz-border-top-right-radius:0; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; -moz-border-bottom-left-radius: 5px; -moz-border-bottom-right-radius: 5px;}';
104
+ echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }';
105
+ echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }';
106
+ elseif ($floating_widget_position == 'bottom_center'):
107
+ echo '#glt-translate-trigger { left:50%; margin-left:-63px; right:auto; }';
108
+ endif;
109
+
110
  if (!empty($language_switcher_width) && isset($language_switcher_width) && $glt_display != 'Horizontal'):
111
  echo '.goog-te-gadget .goog-te-combo { width:'.$language_switcher_width.'; }';
112
  endif;
css/toolbar.css CHANGED
@@ -1,169 +1,172 @@
1
- #glt-toolbar { display:none; }
2
- #glt-translate-trigger {
3
- position:fixed;
4
- bottom:0px;
5
- top:auto;
6
- right: 20px;
7
- z-index:200002;
8
- padding:6px 20px 3px;
9
- font-size:16px;
10
- font-family:Arial;
11
- font-weight:700;
12
- color:#fff;
13
- text-shadow:0px -1px 0px rgba(0,0,0,0.25);
14
- text-decoration:none;
15
- text-align:center;
16
- border-top-left-radius:5px;
17
- border-top-right-radius:5px;
18
- -webkit-border-top-left-radius:5px;
19
- -webkit-border-top-right-radius:5px;
20
- -moz-border-top-left-radius:5px;
21
- -moz-border-top-right-radius:5px;
22
- box-shadow:0px 0px 9px rgba(0,0,0,0.3)
23
- -webkit-box-shadow:0px 0px 9px rgba(0,0,0,0.3);
24
- -moz-box-shadow:0px 0px 9px rgba(0,0,0,0.3);
25
- box-sizing:content-box !important;
26
- -webkit-box-sizing:content-box !important;
27
- -moz-box-sizing:content-box !important;
28
- background:linear-gradient(center top, #fbb450, #f89406);
29
- background: -webkit-gradient(linear, center top, center bottom, from(#fbb450), to(#f89406));
30
- background: -webkit-linear-gradient(#fbb450, #f89406);
31
- background: -moz-linear-gradient(#fbb450, #f89406);
32
- background: -o-linear-gradient(#fbb450, #f89406);
33
- background: -ms-linear-gradient(#fbb450, #f89406);
34
- background: linear-gradient(#fbb450, #f89406);
35
- background: -o-linear-gradientcenter (center top, #fbb450, #f89406); /* For Opera 11.1 to 12.0 */
36
- }
37
-
38
- .tool-container {
39
- background-color: #d0cbcb;
40
- background: -webkit-gradient(linear, left top, left bottom, color-stop(14%, #d0cbcb), color-stop(100%, #e9e5e5));
41
- background: -moz-linear-gradient(top, #d0cbcb 14%, #e9e5e5 100%);
42
- background: -ms-linear-gradient(top, #d0cbcb 14%,#e9e5e5 100%);
43
- background: linear-gradient(to bottom, #d0cbcb 14%,#e9e5e5 100%);
44
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxNCUiIHN0b3AtY29sb3I9IiNkMGNiY2IiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZTllNWU1IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
45
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d0cbcb', endColorstr='#e9e5e5',GradientType=0 );
46
- background-size: 100% 100%;
47
- border-radius: 3px;
48
- box-shadow: 0px 0px 15px #000;
49
- position: absolute;
50
- }
51
-
52
- .tool-container.tool-top, .tool-container.tool-bottom {
53
- border-bottom: 1px solid #beb8b8 ; /* #B1A9A9 */
54
- }
55
-
56
- .tool-items {
57
- height: 100%;
58
- }
59
-
60
- .tool-top .tool-item, .tool-bottom .tool-item {
61
- float: left;
62
- /*border-right: 1px solid #e2dfdf;
63
- border-left: 1px solid #9f9898;*/
64
- }
65
-
66
- .tool-left .tool-item, .tool-right .tool-item {
67
- height: 34px;
68
- border-top: 1px solid #e2dfdf;
69
- border-bottom: 1px solid #9f9898;
70
- }
71
-
72
-
73
- .tool-item {
74
- height: 100%;
75
- display: block;
76
- width: 34px;
77
- text-align: center;
78
- }
79
-
80
- .tool-item:first-child {
81
- border-left: none;
82
- }
83
-
84
- .tool-left .tool-item:first-child, .tool-right .tool-item:first-child {
85
- border-top: 1px solid transparent;
86
- }
87
-
88
- .tool-item:last-child {
89
- border-right: none;
90
- border-bottom: none;
91
- }
92
-
93
- .tool-item.selected, .tool-item:hover {
94
- background: #a79f9f;
95
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #a79f9f), color-stop(93%, #e2dfdf));
96
- background: -moz-linear-gradient(top, #a79f9f 0%, #e2dfdf 93%);
97
- background: -ms-linear-gradient(top, #a79f9f 0%, #e2dfdf 93%);
98
- background: linear-gradient(to bottom, #a79f9f 0%, #e2dfdf 93%);
99
- background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2E3OWY5ZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkzJSIgc3RvcC1jb2xvcj0iI2UyZGZkZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
100
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a79f9f', endColorstr='#e2dfdf',GradientType=0 );
101
- }
102
-
103
- .tool-top .tool-item:last-child:hover, .tool-bottom .tool-item:last-child:hover {
104
- border-top-right-radius: 4px;
105
- border-bottom-right-radius: 4px;
106
- }
107
-
108
- .tool-top .tool-item:first-child:hover, .tool-bottom .tool-item:first-child:hover {
109
- border-top-left-radius: 4px;
110
- border-bottom-left-radius: 4px;
111
- }
112
-
113
- .tool-left .tool-item:last-child:hover, .tool-right .tool-item:last-child:hover {
114
- border-bottom-right-radius: 4px;
115
- border-bottom-left-radius: 4px;
116
- }
117
-
118
- .tool-left .tool-item:first-child:hover, .tool-right .tool-item:first-child:hover {
119
- border-top-right-radius: 4px;
120
- border-top-left-radius: 4px;
121
- }
122
-
123
- .tool-container .arrow {
124
- width:0;
125
- height:0;
126
- position: absolute;
127
- border-width:7px;
128
- border-style:solid;
129
- }
130
-
131
- .tool-container.tool-top .arrow {
132
- border-color: #e9e5e5 transparent transparent;
133
- left: 50%;
134
- bottom: -14px;
135
- margin-left: -7px;
136
- }
137
-
138
- .tool-container.tool-bottom .arrow {
139
- border-color: transparent transparent #e9e5e5;
140
- left: 50%;
141
- top: -14px;
142
- margin-left: -7px;
143
- }
144
-
145
- .tool-container.tool-left .arrow {
146
- border-color: transparent transparent transparent #E9E5E5;
147
- top: 50%;
148
- right: -14px;
149
- margin-top: -7px;
150
- }
151
-
152
- .tool-container.tool-right .arrow {
153
- border-color: transparent #E9E5E5 transparent transparent;
154
- top: 50%;
155
- left: -14px;
156
- margin-top: -7px;
157
- }
158
-
159
- .demo-link {
160
- color: #89CDE4;
161
- text-decoration: underline;
162
- cursor: pointer;
163
- margin-left: 30px;
164
- }
165
-
166
- .demo-link:hover {
167
- text-decoration: none;
168
- cursor: pointer;
169
- }
 
 
 
1
+ #glt-toolbar {
2
+ display:none;
3
+ }
4
+
5
+ #glt-translate-trigger {
6
+ position:fixed;
7
+ bottom:0px;
8
+ top:auto;
9
+ right: 20px;
10
+ z-index:200002;
11
+ padding:6px 20px 3px;
12
+ font-size:16px;
13
+ font-family:Arial;
14
+ font-weight:700;
15
+ color:#fff;
16
+ text-shadow:0px -1px 0px rgba(0,0,0,0.25);
17
+ text-decoration:none;
18
+ text-align:center;
19
+ border-top-left-radius:5px;
20
+ border-top-right-radius:5px;
21
+ -webkit-border-top-left-radius:5px;
22
+ -webkit-border-top-right-radius:5px;
23
+ -moz-border-top-left-radius:5px;
24
+ -moz-border-top-right-radius:5px;
25
+ box-shadow:0px 0px 9px rgba(0,0,0,0.3);
26
+ -webkit-box-shadow:0px 0px 9px rgba(0,0,0,0.3);
27
+ -moz-box-shadow:0px 0px 9px rgba(0,0,0,0.3);
28
+ box-sizing:content-box !important;
29
+ -webkit-box-sizing:content-box !important;
30
+ -moz-box-sizing:content-box !important;
31
+ background:linear-gradient(center top, #fbb450, #f89406);
32
+ background: -webkit-gradient(linear, center top, center bottom, from(#fbb450), to(#f89406));
33
+ background: -webkit-linear-gradient(#fbb450, #f89406);
34
+ background: -moz-linear-gradient(#fbb450, #f89406);
35
+ background: -o-linear-gradient(#fbb450, #f89406);
36
+ background: -ms-linear-gradient(#fbb450, #f89406);
37
+ background: linear-gradient(#fbb450, #f89406);
38
+ background: -o-linear-gradientcenter(center top, #fbb450, #f89406);
39
+ }
40
+
41
+ .tool-container {
42
+ background-color: #d0cbcb;
43
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(14%, #d0cbcb), color-stop(100%, #e9e5e5));
44
+ background: -moz-linear-gradient(top, #d0cbcb 14%, #e9e5e5 100%);
45
+ background: -ms-linear-gradient(top, #d0cbcb 14%,#e9e5e5 100%);
46
+ background: linear-gradient(to bottom, #d0cbcb 14%,#e9e5e5 100%);
47
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxNCUiIHN0b3AtY29sb3I9IiNkMGNiY2IiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZTllNWU1IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
48
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d0cbcb', endColorstr='#e9e5e5',GradientType=0 );
49
+ background-size: 100% 100%;
50
+ border-radius: 3px;
51
+ box-shadow: 0px 0px 15px #000;
52
+ position: absolute;
53
+ }
54
+
55
+ .tool-container.tool-top, .tool-container.tool-bottom {
56
+ border-bottom: 1px solid #beb8b8 ; /* #B1A9A9 */
57
+ }
58
+
59
+ .tool-items {
60
+ height: 100%;
61
+ }
62
+
63
+ .tool-top .tool-item, .tool-bottom .tool-item {
64
+ float: left;
65
+ /*border-right: 1px solid #e2dfdf;
66
+ border-left: 1px solid #9f9898;*/
67
+ }
68
+
69
+ .tool-left .tool-item, .tool-right .tool-item {
70
+ height: 34px;
71
+ border-top: 1px solid #e2dfdf;
72
+ border-bottom: 1px solid #9f9898;
73
+ }
74
+
75
+
76
+ .tool-item {
77
+ height: 100%;
78
+ display: block;
79
+ width: 34px;
80
+ text-align: center;
81
+ }
82
+
83
+ .tool-item:first-child {
84
+ border-left: none;
85
+ }
86
+
87
+ .tool-left .tool-item:first-child, .tool-right .tool-item:first-child {
88
+ border-top: 1px solid transparent;
89
+ }
90
+
91
+ .tool-item:last-child {
92
+ border-right: none;
93
+ border-bottom: none;
94
+ }
95
+
96
+ .tool-item.selected, .tool-item:hover {
97
+ background: #a79f9f;
98
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #a79f9f), color-stop(93%, #e2dfdf));
99
+ background: -moz-linear-gradient(top, #a79f9f 0%, #e2dfdf 93%);
100
+ background: -ms-linear-gradient(top, #a79f9f 0%, #e2dfdf 93%);
101
+ background: linear-gradient(to bottom, #a79f9f 0%, #e2dfdf 93%);
102
+ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2E3OWY5ZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjkzJSIgc3RvcC1jb2xvcj0iI2UyZGZkZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
103
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a79f9f', endColorstr='#e2dfdf',GradientType=0 );
104
+ }
105
+
106
+ .tool-top .tool-item:last-child:hover, .tool-bottom .tool-item:last-child:hover {
107
+ border-top-right-radius: 4px;
108
+ border-bottom-right-radius: 4px;
109
+ }
110
+
111
+ .tool-top .tool-item:first-child:hover, .tool-bottom .tool-item:first-child:hover {
112
+ border-top-left-radius: 4px;
113
+ border-bottom-left-radius: 4px;
114
+ }
115
+
116
+ .tool-left .tool-item:last-child:hover, .tool-right .tool-item:last-child:hover {
117
+ border-bottom-right-radius: 4px;
118
+ border-bottom-left-radius: 4px;
119
+ }
120
+
121
+ .tool-left .tool-item:first-child:hover, .tool-right .tool-item:first-child:hover {
122
+ border-top-right-radius: 4px;
123
+ border-top-left-radius: 4px;
124
+ }
125
+
126
+ .tool-container .arrow {
127
+ width:0;
128
+ height:0;
129
+ position: absolute;
130
+ border-width:7px;
131
+ border-style:solid;
132
+ }
133
+
134
+ .tool-container.tool-top .arrow {
135
+ border-color: #e9e5e5 transparent transparent;
136
+ left: 50%;
137
+ bottom: -14px;
138
+ margin-left: -7px;
139
+ }
140
+
141
+ .tool-container.tool-bottom .arrow {
142
+ border-color: transparent transparent #e9e5e5;
143
+ left: 50%;
144
+ top: -14px;
145
+ margin-left: -7px;
146
+ }
147
+
148
+ .tool-container.tool-left .arrow {
149
+ border-color: transparent transparent transparent #E9E5E5;
150
+ top: 50%;
151
+ right: -14px;
152
+ margin-top: -7px;
153
+ }
154
+
155
+ .tool-container.tool-right .arrow {
156
+ border-color: transparent #E9E5E5 transparent transparent;
157
+ top: 50%;
158
+ left: -14px;
159
+ margin-top: -7px;
160
+ }
161
+
162
+ .demo-link {
163
+ color: #89CDE4;
164
+ text-decoration: underline;
165
+ cursor: pointer;
166
+ margin-left: 30px;
167
+ }
168
+
169
+ .demo-link:hover {
170
+ text-decoration: none;
171
+ cursor: pointer;
172
+ }
google-language-translator.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Google Language Translator
5
  Plugin URI: http://wp-studio.net/
6
- Version: 5.0.42
7
  Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
8
  Author: Rob Myrick
9
  Author URI: http://wp-studio.net/
@@ -634,9 +634,7 @@ class google_language_translator {
634
  public function initialize_settings() {
635
  add_settings_section('glt_settings','Settings','','google_language_translator');
636
 
637
- $settings_name_array = array (
638
- 'googlelanguagetranslator_active','googlelanguagetranslator_language','language_display_settings','googlelanguagetranslator_flags','googlelanguagetranslator_translatebox','googlelanguagetranslator_display','glt_language_switcher_width','googlelanguagetranslator_toolbar','googlelanguagetranslator_showbranding','googlelanguagetranslator_flags_alignment','googlelanguagetranslator_analytics','googlelanguagetranslator_analytics_id','googlelanguagetranslator_css','googlelanguagetranslator_multilanguage','googlelanguagetranslator_floating_widget','googlelanguagetranslator_flag_size','googlelanguagetranslator_flags_order','googlelanguagetranslator_english_flag_choice','googlelanguagetranslator_spanish_flag_choice','googlelanguagetranslator_portuguese_flag_choice','googlelanguagetranslator_floating_widget_text','googlelanguagetranslator_floating_widget_text_allow_translation'
639
- );
640
 
641
  foreach ($settings_name_array as $setting) {
642
  add_settings_field( $setting,'',$setting.'_cb','google_language_translator','glt_settings');
@@ -796,6 +794,27 @@ $('.languages').find('input:checkbox').prop('checked', false); }); }); </script>
796
  echo $html;
797
  }
798
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799
  public function glt_language_switcher_width_cb() {
800
 
801
  $option_name = 'glt_language_switcher_width' ;
@@ -1191,22 +1210,25 @@ $('.languages').find('input:checkbox').prop('checked', false); }); }); </script>
1191
  <div class="postbox glt-floating-widget-settings" style="width: 100%">
1192
  <h3 class="notranslate">Floating Widget Settings</h3>
1193
  <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1194
- <tr class="floating_widget notranslate">
1195
- <td>Show floating translation widget?<br/>
1196
- <span>("All Languages" option <strong><u>must</u></strong> be chosen to show widget.)</span>
1197
- </td>
1198
  <td><?php $this->googlelanguagetranslator_floating_widget_cb(); ?></td>
1199
  </tr>
1200
 
1201
- <tr class="floating_widget_text notranslate">
1202
  <td>Custom text for the floating widget:</td>
1203
  <td><?php $this->googlelanguagetranslator_floating_widget_text_cb(); ?></td>
1204
  </tr>
1205
 
1206
- <tr class="floating_widget_text notranslate">
1207
  <td>Allow floating widget text to translate?:</td>
1208
  <td><?php $this->googlelanguagetranslator_floating_widget_text_allow_translation_cb(); ?></td>
1209
  </tr>
 
 
 
 
 
1210
  </table>
1211
  </div> <!-- .postbox -->
1212
 
3
  /*
4
  Plugin Name: Google Language Translator
5
  Plugin URI: http://wp-studio.net/
6
+ Version: 5.0.43
7
  Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
8
  Author: Rob Myrick
9
  Author URI: http://wp-studio.net/
634
  public function initialize_settings() {
635
  add_settings_section('glt_settings','Settings','','google_language_translator');
636
 
637
+ $settings_name_array = array ('googlelanguagetranslator_active','googlelanguagetranslator_language','language_display_settings','googlelanguagetranslator_flags','googlelanguagetranslator_translatebox','googlelanguagetranslator_display','glt_language_switcher_width','googlelanguagetranslator_toolbar','googlelanguagetranslator_showbranding','googlelanguagetranslator_flags_alignment','googlelanguagetranslator_analytics','googlelanguagetranslator_analytics_id','googlelanguagetranslator_css','googlelanguagetranslator_multilanguage','googlelanguagetranslator_floating_widget','googlelanguagetranslator_flag_size','googlelanguagetranslator_flags_order','googlelanguagetranslator_english_flag_choice','googlelanguagetranslator_spanish_flag_choice','googlelanguagetranslator_portuguese_flag_choice','googlelanguagetranslator_floating_widget_text','googlelanguagetranslator_floating_widget_text_allow_translation','glt_floating_widget_position');
 
 
638
 
639
  foreach ($settings_name_array as $setting) {
640
  add_settings_field( $setting,'',$setting.'_cb','google_language_translator','glt_settings');
794
  echo $html;
795
  }
796
 
797
+ public function glt_floating_widget_position_cb() {
798
+ $option_name = 'glt_floating_widget_position';
799
+ $new_value = '';
800
+
801
+ if (get_option($option_name) === false):
802
+ update_option($option_name, $new_value);
803
+ endif;
804
+
805
+ $options = get_option(''.$option_name.''); ?>
806
+
807
+ <select name="glt_floating_widget_position" id="glt_floating_widget_position" style="width:170px">
808
+ <option value="bottom_left" <?php if($options=='bottom_left'){echo "selected";}?>>Bottom left</option>
809
+ <option value="bottom_center" <?php if($options=='bottom_center'){echo "selected";}?>>Bottom center</option>
810
+ <option value="bottom_right" <?php if($options=='bottom_right'){echo "selected";}?>>Bottom right</option>
811
+ <option value="top_left" <?php if($options=='top_left'){echo "selected";}?>>Top left</option>
812
+ <option value="top_center" <?php if($options=='top_center'){echo "selected";}?>>Top center</option>
813
+ <option value="top_right" <?php if($options=='top_right'){echo "selected";}?>>Top right</option>
814
+ </select>
815
+ <?php
816
+ }
817
+
818
  public function glt_language_switcher_width_cb() {
819
 
820
  $option_name = 'glt_language_switcher_width' ;
1210
  <div class="postbox glt-floating-widget-settings" style="width: 100%">
1211
  <h3 class="notranslate">Floating Widget Settings</h3>
1212
  <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1213
+ <tr class="floating_widget_show notranslate">
1214
+ <td>Show floating translation widget?</td>
 
 
1215
  <td><?php $this->googlelanguagetranslator_floating_widget_cb(); ?></td>
1216
  </tr>
1217
 
1218
+ <tr class="floating-widget floating-widget-custom-text notranslate hidden">
1219
  <td>Custom text for the floating widget:</td>
1220
  <td><?php $this->googlelanguagetranslator_floating_widget_text_cb(); ?></td>
1221
  </tr>
1222
 
1223
+ <tr class="floating-widget floating-widget-text-translate notranslate hidden">
1224
  <td>Allow floating widget text to translate?:</td>
1225
  <td><?php $this->googlelanguagetranslator_floating_widget_text_allow_translation_cb(); ?></td>
1226
  </tr>
1227
+
1228
+ <tr class="floating-widget floating-widget-position notranslate hidden">
1229
+ <td>Floating Widget Position: <strong style="color:red">NEW!</strong></td>
1230
+ <td><?php $this->glt_floating_widget_position_cb(); ?></td>
1231
+ </tr>
1232
  </table>
1233
  </div> <!-- .postbox -->
1234
 
js/scripts-admin.js CHANGED
@@ -3,11 +3,11 @@ jQuery(document).ready(function($){
3
  var display = $('select[name=googlelanguagetranslator_display] option:selected').val();
4
  var flag_display = $('input[name=googlelanguagetranslator_flags]:checked').val();
5
  var floating_widget_display = $('select[name=googlelanguagetranslator_floating_widget] option:selected').val();
6
-
7
  if(floating_widget_display == 'yes') {
8
- $('.floating_widget_text').css('display','');
9
  } else {
10
- $('.floating_widget_text').css('display','none');
11
  }
12
 
13
  $('input[name=googlelanguagetranslator_flags]').change(function(){
@@ -18,12 +18,12 @@ jQuery(document).ready(function($){
18
  }
19
  });
20
 
21
- //FadeIn and FadeOut Floating Widget Text option
22
  $('select[name=googlelanguagetranslator_floating_widget]').change(function() {
23
  if($(this).val()=='yes') {
24
- $('.floating_widget_text').fadeIn("slow");
25
  } else {
26
- $('.floating_widget_text').fadeOut("slow");
27
  }
28
  });
29
 
3
  var display = $('select[name=googlelanguagetranslator_display] option:selected').val();
4
  var flag_display = $('input[name=googlelanguagetranslator_flags]:checked').val();
5
  var floating_widget_display = $('select[name=googlelanguagetranslator_floating_widget] option:selected').val();
6
+
7
  if(floating_widget_display == 'yes') {
8
+ $('.floating-widget').removeClass('hidden');
9
  } else {
10
+ $('.floating-widget').addClass('hidden');
11
  }
12
 
13
  $('input[name=googlelanguagetranslator_flags]').change(function(){
18
  }
19
  });
20
 
21
+ //FadeIn and FadeOut Floating Widget Text setting
22
  $('select[name=googlelanguagetranslator_floating_widget]').change(function() {
23
  if($(this).val()=='yes') {
24
+ $('.floating-widget').removeClass('hidden');
25
  } else {
26
+ $('.floating-widget').addClass('hidden');
27
  }
28
  });
29
 
js/scripts.js CHANGED
@@ -117,6 +117,7 @@ if ( typeof Object.create !== 'function' ) {
117
 
118
  overrideOptions: function() {
119
  var self = this;
 
120
  $.each( self.options, function( $option ) {
121
  if (typeof(self.$elem.data('toolbar-'+$option)) != "undefined") {
122
  self.options[$option] = self.$elem.data('toolbar-'+$option);
@@ -133,39 +134,13 @@ if ( typeof Object.create !== 'function' ) {
133
 
134
  setTrigger: function() {
135
  var self = this;
136
-
137
- if (self.options.event != 'click') {
138
-
139
- var moveTime;
140
- function decideTimeout () {
141
- if (self.$elem.hasClass('pressed')) {
142
- moveTime = setTimeout(function() {
143
- self.hide();
144
- }, 150);
145
- } else {
146
- clearTimeout(moveTime);
147
- };
148
- };
149
-
150
- self.$elem.on({
151
- mouseenter: function(event) {
152
- if (self.$elem.hasClass('pressed')) {
153
- clearTimeout(moveTime);
154
- } else {
155
- self.show();
156
- }
157
- }
158
- });
159
-
160
- self.$elem.parent().on({
161
- mouseleave: function(event){ decideTimeout(); }
162
- });
163
-
164
- $('.tool-container').on({
165
- mouseenter: function(event){ clearTimeout(moveTime); },
166
- mouseleave: function(event){ decideTimeout(); }
167
  });
168
- }
169
 
170
  if (self.options.event == 'click') {
171
  self.$elem.on('click', function(event) {
@@ -224,6 +199,7 @@ if ( typeof Object.create !== 'function' ) {
224
 
225
  $(window).resize(function( event ) {
226
  event.stopPropagation();
 
227
  if ( self.toolbar.is(":visible") ) {
228
  self.toolbarCss = self.getCoordinates(self.options.position, 20);
229
  self.collisionDetection();
@@ -237,6 +213,7 @@ if ( typeof Object.create !== 'function' ) {
237
  var self = this;
238
  var location = self.toolbar.find('.tool-items');
239
  var content = $(self.options.content).clone( true ).find('a').addClass('tool-item');
 
240
  location.html(content);
241
  location.find('.tool-item').on('click', function(event) {
242
  event.preventDefault();
@@ -257,6 +234,7 @@ if ( typeof Object.create !== 'function' ) {
257
 
258
  getCoordinates: function( position, adjustment ) {
259
  var self = this;
 
260
  self.coordinates = self.$elem.offset();
261
 
262
  if (self.options.adjustment && self.options.adjustment[self.options.position]) {
@@ -270,18 +248,21 @@ if ( typeof Object.create !== 'function' ) {
270
  top: self.coordinates.top-self.$elem.outerHeight()-adjustment,
271
  right: 'auto'
272
  };
 
273
  case 'left':
274
  return {
275
  left: self.coordinates.left-(self.toolbar.width()/2)-(self.$elem.outerWidth()/2)-adjustment,
276
  top: self.coordinates.top-(self.toolbar.height()/2)+(self.$elem.outerHeight()/2),
277
  right: 'auto'
278
  };
 
279
  case 'right':
280
  return {
281
  left: self.coordinates.left+(self.toolbar.width()/2)+(self.$elem.outerWidth()/2)+adjustment,
282
  top: self.coordinates.top-(self.toolbar.height()/2)+(self.$elem.outerHeight()/2),
283
  right: 'auto'
284
  };
 
285
  case 'bottom':
286
  return {
287
  left: self.coordinates.left-(self.toolbar.width()/2)+(self.$elem.outerWidth()/2),
@@ -294,12 +275,14 @@ if ( typeof Object.create !== 'function' ) {
294
  collisionDetection: function() {
295
  var self = this;
296
  var edgeOffset = 20;
 
297
  if(self.options.position == 'top' || self.options.position == 'bottom') {
298
  self.arrowCss = {left: '50%', right: '50%'};
299
  if( self.toolbarCss.left < edgeOffset ) {
300
  self.toolbarCss.left = edgeOffset;
301
  self.arrowCss.left = self.$elem.offset().left + self.$elem.width()/2-(edgeOffset);
302
  }
 
303
  else if(($(window).width() - (self.toolbarCss.left + self.toolbarWidth)) < edgeOffset) {
304
  self.toolbarCss.right = edgeOffset;
305
  self.toolbarCss.left = 'auto';
@@ -316,13 +299,11 @@ if ( typeof Object.create !== 'function' ) {
316
  self.toolbar.show().css({'opacity': 1}).addClass('animate-'+self.options.animation);
317
  self.$elem.trigger('toolbarShown');
318
  },
319
-
320
- hide: function() {
321
  var self = this;
322
  var animation = {'opacity': 0};
323
-
324
  self.$elem.removeClass('pressed');
325
-
326
  switch(self.options.position) {
327
  case 'top':
328
  animation.top = '+=20';
@@ -337,11 +318,9 @@ if ( typeof Object.create !== 'function' ) {
337
  animation.top = '-=20';
338
  break;
339
  }
340
-
341
  self.toolbar.animate(animation, 200, function() {
342
  self.toolbar.hide();
343
  });
344
-
345
  self.$elem.trigger('toolbarHidden');
346
  },
347
 
@@ -374,7 +353,6 @@ if ( typeof Object.create !== 'function' ) {
374
  animation: 'standard',
375
  adjustment: 10
376
  };
377
-
378
  }) ( jQuery, window, document );
379
 
380
  jQuery(function($) {
117
 
118
  overrideOptions: function() {
119
  var self = this;
120
+
121
  $.each( self.options, function( $option ) {
122
  if (typeof(self.$elem.data('toolbar-'+$option)) != "undefined") {
123
  self.options[$option] = self.$elem.data('toolbar-'+$option);
134
 
135
  setTrigger: function() {
136
  var self = this;
137
+
138
+ if (self.options.event == 'onload') {
139
+ $(window).load(function(event) {
140
+ event.preventDefault();
141
+ self.show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  });
143
+ }
144
 
145
  if (self.options.event == 'click') {
146
  self.$elem.on('click', function(event) {
199
 
200
  $(window).resize(function( event ) {
201
  event.stopPropagation();
202
+
203
  if ( self.toolbar.is(":visible") ) {
204
  self.toolbarCss = self.getCoordinates(self.options.position, 20);
205
  self.collisionDetection();
213
  var self = this;
214
  var location = self.toolbar.find('.tool-items');
215
  var content = $(self.options.content).clone( true ).find('a').addClass('tool-item');
216
+
217
  location.html(content);
218
  location.find('.tool-item').on('click', function(event) {
219
  event.preventDefault();
234
 
235
  getCoordinates: function( position, adjustment ) {
236
  var self = this;
237
+
238
  self.coordinates = self.$elem.offset();
239
 
240
  if (self.options.adjustment && self.options.adjustment[self.options.position]) {
248
  top: self.coordinates.top-self.$elem.outerHeight()-adjustment,
249
  right: 'auto'
250
  };
251
+
252
  case 'left':
253
  return {
254
  left: self.coordinates.left-(self.toolbar.width()/2)-(self.$elem.outerWidth()/2)-adjustment,
255
  top: self.coordinates.top-(self.toolbar.height()/2)+(self.$elem.outerHeight()/2),
256
  right: 'auto'
257
  };
258
+
259
  case 'right':
260
  return {
261
  left: self.coordinates.left+(self.toolbar.width()/2)+(self.$elem.outerWidth()/2)+adjustment,
262
  top: self.coordinates.top-(self.toolbar.height()/2)+(self.$elem.outerHeight()/2),
263
  right: 'auto'
264
  };
265
+
266
  case 'bottom':
267
  return {
268
  left: self.coordinates.left-(self.toolbar.width()/2)+(self.$elem.outerWidth()/2),
275
  collisionDetection: function() {
276
  var self = this;
277
  var edgeOffset = 20;
278
+
279
  if(self.options.position == 'top' || self.options.position == 'bottom') {
280
  self.arrowCss = {left: '50%', right: '50%'};
281
  if( self.toolbarCss.left < edgeOffset ) {
282
  self.toolbarCss.left = edgeOffset;
283
  self.arrowCss.left = self.$elem.offset().left + self.$elem.width()/2-(edgeOffset);
284
  }
285
+
286
  else if(($(window).width() - (self.toolbarCss.left + self.toolbarWidth)) < edgeOffset) {
287
  self.toolbarCss.right = edgeOffset;
288
  self.toolbarCss.left = 'auto';
299
  self.toolbar.show().css({'opacity': 1}).addClass('animate-'+self.options.animation);
300
  self.$elem.trigger('toolbarShown');
301
  },
302
+
303
+ hide: function() {
304
  var self = this;
305
  var animation = {'opacity': 0};
 
306
  self.$elem.removeClass('pressed');
 
307
  switch(self.options.position) {
308
  case 'top':
309
  animation.top = '+=20';
318
  animation.top = '-=20';
319
  break;
320
  }
 
321
  self.toolbar.animate(animation, 200, function() {
322
  self.toolbar.hide();
323
  });
 
324
  self.$elem.trigger('toolbarHidden');
325
  },
326
 
353
  animation: 'standard',
354
  adjustment: 10
355
  };
 
356
  }) ( jQuery, window, document );
357
 
358
  jQuery(function($) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin link: http://wp-studio.net/how-it-works
5
  Tags: language translator, google translator, language translate, translate wordpress, google language translator, translation, translate, multi language
6
  Requires at least: 2.9
7
  Tested up to: 4.9.2
8
- Stable tag: 5.0.42
9
 
10
  Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
 
@@ -46,6 +46,9 @@ A: Yes! Add the "notranslate" class to the HTML element containing your text. Fo
46
 
47
  == Changelog ==
48
 
 
 
 
49
  5.0.42
50
  - Added new setting: langauge switcher width.
51
  - Removed most javascript away from the document body, and into an external javascript file, scripts.js.
5
  Tags: language translator, google translator, language translate, translate wordpress, google language translator, translation, translate, multi language
6
  Requires at least: 2.9
7
  Tested up to: 4.9.2
8
+ Stable tag: 5.0.43
9
 
10
  Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
 
46
 
47
  == Changelog ==
48
 
49
+ 5.0.43
50
+ - Added new setting: Floating Widget position.
51
+
52
  5.0.42
53
  - Added new setting: langauge switcher width.
54
  - Removed most javascript away from the document body, and into an external javascript file, scripts.js.