Version Description
- Bumped minimum WordPress version to 4.1
- Some optimisation of transient caching
- Fixed hash table settings bug
Download this release
Release Info
Developer | timwhitlock |
Plugin | Loco Translate |
Version | 2.0.9 |
Comparing to | |
See all releases |
Code changes from version 2.0.8 to 2.0.9
- languages/loco.pot +5 -5
- loco.php +2 -2
- pub/js/min/admin.js +187 -183
- readme.txt +7 -2
- src/admin/bundle/ViewController.php +3 -3
- src/config/CustomSaved.php +1 -1
- src/data/Serializable.php +68 -8
- src/data/Settings.php +9 -5
- src/data/Transient.php +2 -2
- src/gettext/Metadata.php +3 -6
- src/test/DummyFtpConnect.php +6 -0
languages/loco.pot
CHANGED
@@ -3,7 +3,7 @@ msgid ""
|
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: PACKAGE VERSION\n"
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
-
"POT-Creation-Date: 2016-10-
|
7 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: \n"
|
@@ -201,7 +201,7 @@ msgid "Other"
|
|
201 |
msgstr ""
|
202 |
|
203 |
#. Shows total string count at top of editor
|
204 |
-
#: src/gettext/Metadata.php:
|
205 |
#, php-format
|
206 |
msgid "1 string"
|
207 |
msgid_plural "%s strings"
|
@@ -209,19 +209,19 @@ msgstr[0] ""
|
|
209 |
msgstr[1] ""
|
210 |
|
211 |
#. Shows percentage translated at top of editor
|
212 |
-
#: src/gettext/Metadata.php:
|
213 |
#, php-format
|
214 |
msgid "%s%% translated"
|
215 |
msgstr ""
|
216 |
|
217 |
#. Shows number of fuzzy strings at top of editor
|
218 |
-
#: src/gettext/Metadata.php:
|
219 |
#, php-format
|
220 |
msgid "%s fuzzy"
|
221 |
msgstr ""
|
222 |
|
223 |
#. Shows number of untranslated strings at top of editor
|
224 |
-
#: src/gettext/Metadata.php:
|
225 |
#, php-format
|
226 |
msgid "%s untranslated"
|
227 |
msgstr ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: PACKAGE VERSION\n"
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
+
"POT-Creation-Date: 2016-10-23 09:48+0000\n"
|
7 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: \n"
|
201 |
msgstr ""
|
202 |
|
203 |
#. Shows total string count at top of editor
|
204 |
+
#: src/gettext/Metadata.php:188 src/js/Strings.php:35
|
205 |
#, php-format
|
206 |
msgid "1 string"
|
207 |
msgid_plural "%s strings"
|
209 |
msgstr[1] ""
|
210 |
|
211 |
#. Shows percentage translated at top of editor
|
212 |
+
#: src/gettext/Metadata.php:198 src/js/Strings.php:38
|
213 |
#, php-format
|
214 |
msgid "%s%% translated"
|
215 |
msgstr ""
|
216 |
|
217 |
#. Shows number of fuzzy strings at top of editor
|
218 |
+
#: src/gettext/Metadata.php:200 src/js/Strings.php:41
|
219 |
#, php-format
|
220 |
msgid "%s fuzzy"
|
221 |
msgstr ""
|
222 |
|
223 |
#. Shows number of untranslated strings at top of editor
|
224 |
+
#: src/gettext/Metadata.php:203 src/js/Strings.php:44
|
225 |
#, php-format
|
226 |
msgid "%s untranslated"
|
227 |
msgstr ""
|
loco.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Loco Translate
|
|
4 |
Plugin URI: https://wordpress.org/plugins/loco-translate/
|
5 |
Description: Translate themes and plugins directly in WordPress
|
6 |
Author: Tim Whitlock
|
7 |
-
Version: 2.0.
|
8 |
Author URI: https://localise.biz/wordpress/plugin
|
9 |
Text Domain: loco
|
10 |
Domain Path: /languages/
|
@@ -45,7 +45,7 @@ function loco_plugin_file(){
|
|
45 |
* @return string
|
46 |
*/
|
47 |
function loco_plugin_version(){
|
48 |
-
return '2.0.
|
49 |
}
|
50 |
|
51 |
|
4 |
Plugin URI: https://wordpress.org/plugins/loco-translate/
|
5 |
Description: Translate themes and plugins directly in WordPress
|
6 |
Author: Tim Whitlock
|
7 |
+
Version: 2.0.9
|
8 |
Author URI: https://localise.biz/wordpress/plugin
|
9 |
Text Domain: loco
|
10 |
Domain Path: /languages/
|
45 |
* @return string
|
46 |
*/
|
47 |
function loco_plugin_version(){
|
48 |
+
return '2.0.9';
|
49 |
}
|
50 |
|
51 |
|
pub/js/min/admin.js
CHANGED
@@ -1,41 +1,41 @@
|
|
1 |
-
(function(p,w,h,U){var n=function(){var f={};return{register:function(
|
2 |
-
""}b=l(b);var a={};return{_:function(a){return g(a,a,0)},_x:function(a,e){return g(e+"\u0004"+a,a,0)},_n:function(a,e,k){k=Number(b(k));isNaN(k)&&(k=0);return g(a,i?e:a,k)},load:function(
|
3 |
-
b!=b?b=0:0!=b&&Infinity!=b&&-Infinity!=b&&(b=(0<b||-1)*Math.floor(Math.abs(b))));if(b>=a)return-1;for(b=0<=b?b:Math.max(a-Math.abs(b),0);b<a;b++)if(b in g&&g[b]===
|
4 |
-
e)return"%";g=a[b++];return String(g)||""})};return f}({},p,w));n.register("$34",function(f,
|
5 |
-
".google-analytics.com/ga.js";var e=h.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}return f};f.event=function(a,e,b,g){return l(["_trackEvent",a||"",e||"",b||"",g||0])};f.page=function(a,e){return l(["_trackPageview",{page:a||location.pathname+location.hash,title:e||h.title}])};return f}({},p,w));n.register("$35",function(f,
|
6 |
-
function(){(a[
|
7 |
-
function(a,
|
8 |
-
var b,g=location.hostname,a="/help"===location.pathname.substr(0,5);f.init=function(a){!b&&a&&(g=a.host||(a.host=g),b=a.legacy?n.require("$34","legacy.js"):n.require("$35","universal.js"),b._init(a));return f};f.link=function(
|
9 |
-
|
10 |
-
clearTimeout(t);t=null;
|
11 |
-
|
12 |
-
|
13 |
-
function(f,
|
14 |
-
k=h('<div class="overlay-container"></div>');
|
15 |
-
|
16 |
-
return f};f.html=function(a){
|
17 |
-
e||"icon").attr("lang",b);
|
18 |
-
[f]);return f};f.listen=function(a){
|
19 |
-
f.text=function(a,
|
20 |
-
e=
|
21 |
-
g.charAt(1)?
|
22 |
-
a.attr("title")||"").removeAttr("title")},getTitle:function(){var a,
|
23 |
if(this.$tip)this.$tip.find(".tipsy-inner")[this.options.html?"html":"text"](a)},tip:function(){this.$tip||(this.$tip=h('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0]));return this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.options=this.$element=null)},enable:function(){this.enabled=!0},disable:function(){this.hide();this.enabled=!1},toggleEnabled:function(){this.enabled=
|
24 |
-
!this.enabled}};h.fn.tipsy=function(a){function
|
25 |
-
if("manual"!=a.trigger){var g=a.live?"live":"bind",
|
26 |
-
h(this).remove()})};h.fn.tipsy.elementOptions=function(a,
|
27 |
-
h(
|
28 |
-
f.errorData=function(b,g,a){var
|
29 |
-
"ga.js");g=k.shift();)b.trigger(g,[a]),
|
30 |
-
a.responseText),
|
31 |
-
b.statusText||l[a.status]||"Unknown Error");"function"===typeof g&&!1===g(a&&a.data?a.data:a,null,
|
32 |
-
|
33 |
-
|
34 |
-
"get";e||(e=b.split("/").slice(1,4).join("-"));t(b,g,
|
35 |
-
"get",data:g||"",url:
|
36 |
-
f.back=function(){if(previous=m.pop())return r=m[m.length-2],t.apply(null,previous),!0};f.reload=function(){r&&t.apply(null,r)};f.initLink=function(a){a.click(e)};f.initForm=function(a){h(a).submit(e)};f.replace=function(
|
37 |
-
f.script=function(a,
|
38 |
-
f.getAttribute("placeholder"),r=1===Number(f.size),t=h('<a href="#clear" tabindex="-1" class="icon clear"><span>clear</span></a>').click(function(a){f.value="";e();return!1});a(f.value);h(f).on("input blur focus",function(){e();return!0}).after(t);g();return{delay:function(a){
|
39 |
a)}}};return f}({},p,w));n.register("$19",{"\u00e1":"a","\u00e0":"a","\u0103":"a","\u1eaf":"a","\u1eb1":"a","\u1eb5":"a","\u1eb3":"a","\u00e2":"a","\u1ea5":"a","\u1ea7":"a","\u1eab":"a","\u1ea9":"a","\u01ce":"a","\u00e5":"a","\u01fb":"a","\u00e4":"a","\u01df":"a","\u00e3":"a","\u0227":"a","\u01e1":"a","\u0105":"a","\u0101":"a","\u1ea3":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1eb7":"a","\u1ead":"a","\u1e01":"a","\u01fd":"\u00e6","\u01e3":"\u00e6","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0107":"c",
|
40 |
"\u0109":"c","\u010d":"c","\u010b":"c","\u00e7":"c","\u1e09":"c","\u010f":"d","\u1e0b":"d","\u1e11":"d","\u0111":"d","\u1e0d":"d","\u1e13":"d","\u1e0f":"d","\u00f0":"d","\ua77a":"d","\u01c6":"\u01f3","\u00e9":"e","\u00e8":"e","\u0115":"e","\u00ea":"e","\u1ebf":"e","\u1ec1":"e","\u1ec5":"e","\u1ec3":"e","\u011b":"e","\u00eb":"e","\u1ebd":"e","\u0117":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u0113":"e","\u1e17":"e","\u1e15":"e","\u1ebb":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u1e19":"e",
|
41 |
"\u1e1b":"e","\u1e1f":"f","\ua77c":"f","\u01f5":"g","\u011f":"g","\u011d":"g","\u01e7":"g","\u0121":"g","\u0123":"g","\u1e21":"g","\ua7a1":"g","\u1d79":"g","\u0125":"h","\u021f":"h","\u1e27":"h","\u1e23":"h","\u1e29":"h","\u0127":"h","\u210f":"h","\u1e25":"h","\u1e2b":"h","\u1e96":"h","\u00ed":"i","\u00ec":"i","\u012d":"i","\u00ee":"i","\u01d0":"i","\u00ef":"i","\u1e2f":"i","\u0129":"i","\u012f":"i","\u012b":"i","\u1ec9":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u1e2d":"i","\u0135":"j","\u01f0":"j",
|
@@ -48,149 +48,153 @@ a)}}};return f}({},p,w));n.register("$19",{"\u00e1":"a","\u00e0":"a","\u0103":"a
|
|
48 |
"\u1fc2":"\u03b7","\u1fc6":"\u03b7","\u1fc7":"\u03b7","\u1fc3":"\u03b7","\u1f30":"\u03b9","\u1f34":"\u03b9","\u1f32":"\u03b9","\u1f36":"\u03b9","\u1f31":"\u03b9","\u1f35":"\u03b9","\u1f33":"\u03b9","\u1f37":"\u03b9","\u03af":"\u03b9","\u1f77":"\u03b9","\u1f76":"\u03b9","\u1fd0":"\u03b9","\u1fd6":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u1fd3":"\u03b9","\u1fd2":"\u03b9","\u1fd7":"\u03b9","\u1fd1":"\u03b9","\u1f40":"\u03bf","\u1f44":"\u03bf","\u1f42":"\u03bf","\u1f41":"\u03bf","\u1f45":"\u03bf",
|
49 |
"\u1f43":"\u03bf","\u03cc":"\u03bf","\u1f79":"\u03bf","\u1f78":"\u03bf","\u1fe4":"\u03c1","\u1fe5":"\u03c1","\u1f50":"\u03c5","\u1f54":"\u03c5","\u1f52":"\u03c5","\u1f56":"\u03c5","\u1f51":"\u03c5","\u1f55":"\u03c5","\u1f53":"\u03c5","\u1f57":"\u03c5","\u03cd":"\u03c5","\u1f7b":"\u03c5","\u1f7a":"\u03c5","\u1fe0":"\u03c5","\u1fe6":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u1fe3":"\u03c5","\u1fe2":"\u03c5","\u1fe7":"\u03c5","\u1fe1":"\u03c5","\u1f60":"\u03c9","\u1f64":"\u03c9","\u1fa4":"\u03c9",
|
50 |
"\u1f62":"\u03c9","\u1fa2":"\u03c9","\u1f66":"\u03c9","\u1fa6":"\u03c9","\u1fa0":"\u03c9","\u1f61":"\u03c9","\u1f65":"\u03c9","\u1fa5":"\u03c9","\u1f63":"\u03c9","\u1fa3":"\u03c9","\u1f67":"\u03c9","\u1fa7":"\u03c9","\u1fa1":"\u03c9","\u03ce":"\u03c9","\u1f7d":"\u03c9","\u1ff4":"\u03c9","\u1f7c":"\u03c9","\u1ff2":"\u03c9","\u1ff6":"\u03c9","\u1ff7":"\u03c9","\u1ff3":"\u03c9","\u0491":"\u0433","\u0450":"\u0435","\u0451":"\u0435","\u04c2":"\u0436","\u045d":"\u0438","\u04e3":"\u0438","\u04ef":"\u0443"});
|
51 |
-
n.register("$7",function(f,
|
52 |
-
e){var k=[],
|
53 |
-
[],b=n.require("$7","fulltext.js").init();return{add:function(g,a){b.add(
|
54 |
-
function
|
55 |
-
|
56 |
-
|
57 |
-
p=h('<div class="auto-comp-drop"></div>');F&&(F=new l(F));I&&
|
58 |
-
n.require("$8","LocoTextListener.js").listen(
|
59 |
-
function(b,a){if(!b)return a&&a([]),this.dead={},this;var
|
60 |
-
p,w));n.register("$9",function(f,
|
61 |
-
e.name||"";this.prefix=e.getAttribute("data-prefix");for(this.defaultIcon=e.getAttribute("data-icon")||"icon no-icon";++r<t;)
|
62 |
-
a.attr("tabindex")||"").append(this.icon).append(this.selection);
|
63 |
-
else r=e.selectedIndex,null!=r&&0<=r&&this.selectIndex(r)}}f.create=function(a){return new g(a)};f.extend=function(a){a.parent=g;a.prototype=new g};
|
64 |
-
|
65 |
-
l(a);case 13:if(-1!=this.hover)return this.selectIndex(this.hover,!0),this.hoverItem(-1),this.close(),l(a)}return!0};
|
66 |
-
this.wrapper,
|
67 |
-
|
68 |
-
a),r=h("<li></li>").append(f).append(r).appendTo(this.list);
|
69 |
-
|
70 |
-
b.idx=a;
|
71 |
-
this.val(),
|
72 |
-
this.getElement(
|
73 |
-
|
74 |
-
f.create=function(b){return new l(b)};n.require("$9","LocoSelector.js").extend(l);
|
75 |
-
|
76 |
-
var a=n.require("$28","ga.js"),
|
77 |
-
|
78 |
-
f.$(a).replaceAll(
|
79 |
-
f.h=function(){function b(){e=/[<>&]/g;
|
80 |
-
b.removeClass("placeheld"));return!0}function e(){""===a.value&&(a.value=
|
81 |
-
|
82 |
-
this.placehold&&this.placehold();return this});var k="";a.find('[type="submit"]').click(function(a){a&&a.target&&a.target.name&&(k=encodeURIComponent(a.target.name)+"="+encodeURIComponent(a.target.value));return!0});a.submit(function(b){if(b&&b.isDefaultPrevented&&b.isDefaultPrevented()||e&&!1===e(b))return!1;var
|
83 |
-
n.require("$21","http.js"),
|
84 |
-
if("."===
|
85 |
-
a.getAttribute("data-icon");if(
|
86 |
-
|
87 |
-
f;h('<button type="button" class="notice-dismiss" href="#"> </a>').prependTo(a).click(e);h(
|
88 |
-
g(
|
89 |
-
a),
|
90 |
-
""));
|
91 |
-
"json";f.error=m;f.success=function(a,
|
92 |
-
|
93 |
-
hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});n.register("$6",function(f,
|
94 |
-
(g=/[-_+]/,b=/^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?(?:-([0-9][a-z0-9]{3,8}|[a-z0-9]{5,8}))?(?:-([a-z]-[-a-z]+))?$/i);a=String(a).split(g).join("-");if(!b.exec(a))return null;var e=new l;e.lang=RegExp.$1.toLowerCase();if(a=RegExp.$2)e.script=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();if(a=RegExp.$3)e.region=a.toUpperCase();if(a=RegExp.$4)e.variant=a.toLowerCase();if(a=RegExp.$5)e.extension=a;return e};
|
95 |
-
this.lang;return!(!a||"zxx"===a)};
|
96 |
-
p,w));n.register("$32",function(f,
|
97 |
-
new g;return f};f.validate=function(a){var b=/function (\w+)\(/.exec(a.toString())?RegExp.$1:"";a.prototype._validate(b||"Object")};return f}({},p,w));n.register("$40",function(f,
|
98 |
-
timeToCall);g=nextTime;return timerId},b=function(a){clearTimeout(a)});var
|
99 |
-
a.stopPropagation();return!1}var g,a=!!
|
100 |
-
|
101 |
-
function(a,b){var
|
102 |
-
b+"px)",
|
103 |
-
b.pointerType&&
|
104 |
-
a.charCodeAt(0).toString(16)+'">'+a+"</span>"}var d
|
105 |
-
m=h.length;++
|
106 |
-
4E3),r=h.createElement("script");r.setAttribute("src",a);r.setAttribute("async","true");r.onreadystatechange=
|
107 |
-
a.on("change",function(a,
|
108 |
-
{token:"printf",regex:"%(?:\\d+\\$)?[-,'+#0 (]*\\d*(?:\\.\\d+|\\.\\*)?[sScCuidoxXfFeEgGaAbBpn%@]"},{defaultToken:"text"}]}}function
|
109 |
-
|
110 |
-
disable:function(){
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
function(){
|
115 |
-
|
116 |
-
a&&b.
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
[b,a
|
124 |
-
|
125 |
-
|
126 |
-
function(a
|
127 |
-
this.
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
c.
|
141 |
-
|
142 |
-
|
143 |
-
function(
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
""
|
152 |
-
|
153 |
-
function(){
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
(
|
161 |
-
|
162 |
-
[
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
this.
|
168 |
-
this.
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
e
|
177 |
-
|
178 |
-
function(b){
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
(
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
c){
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
|
1 |
+
(function(p,w,h,U){var n=function(){var f={};return{register:function(d,h){f[d]=h},require:function(d,h){var l=f[d];if(!l)throw Error('CommonJS error: failed to require("'+h+'")');return l}}}();n.register("$1",function(f,d,h){function l(b){var g=typeof b;if("string"===g)if(/[^ <>!=()%^&|?:n0-9]/.test(b))console.error("Invalid plural: "+b);else return new Function("n","return "+b);"function"!==g&&(b=function(a){return 1!=a});return b}f.init=function(b){function g(c,e,b){return(c=a[c])&&c[b]?c[b]:e||
|
2 |
+
""}b=l(b);var a={};return{_:function(a){return g(a,a,0)},_x:function(a,e){return g(e+"\u0004"+a,a,0)},_n:function(a,e,k){k=Number(b(k));isNaN(k)&&(k=0);return g(a,i?e:a,k)},load:function(c){a=c||{};return this},pluraleq:function(a){b=l(a);return this}}};return f}({},p,w));n.register("$2",function(f,d,h){Array.prototype.indexOf||(Array.prototype.indexOf=function(d){if(null==this)throw new TypeError;var b,g=Object(this),a=g.length>>>0;if(0===a)return-1;b=0;1<arguments.length&&(b=Number(arguments[1]),
|
3 |
+
b!=b?b=0:0!=b&&Infinity!=b&&-Infinity!=b&&(b=(0<b||-1)*Math.floor(Math.abs(b))));if(b>=a)return-1;for(b=0<=b?b:Math.max(a-Math.abs(b),0);b<a;b++)if(b in g&&g[b]===d)return b;return-1});return f}({},p,w));n.register("$3",function(f,d,h){f.trim=function(d,b){for(b||(b=" \n");d&&-1!==b.indexOf(d.substr(0,1));)d=d.substr(1);for(;d&&-1!==b.indexOf(d.substr(-1));)d=d.substr(0,d.length-1);return d};f.sprintf=function(d){var b=0,g,a=[].slice.call(arguments,1);return d.replace(/%(s|u|%)/g,function(c,e){if("%"===
|
4 |
+
e)return"%";g=a[b++];return String(g)||""})};return f}({},p,w));n.register("$34",function(f,d,h){function l(c){a||d._gat&&(a=_gat._createTracker(b,"loco"));if(a){var e=c.shift();a[e].apply(a,c)}else g&&g.push(c);return f}var b,g,a;f._init=function(a){if(b=a.code){g=d._gaq||(d._gaq=[]);g.push(["_setAccount",b]);g.push(["_trackPageview"]);g.push(["_setDomainName",a.host]);a=h.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"==h.location.protocol?"https://ssl":"http://www")+
|
5 |
+
".google-analytics.com/ga.js";var e=h.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}return f};f.event=function(a,e,b,g){return l(["_trackEvent",a||"",e||"",b||"",g||0])};f.page=function(a,e){return l(["_trackPageview",{page:a||location.pathname+location.hash,title:e||h.title}])};return f}({},p,w));n.register("$35",function(f,d,h){function l(a,c){if(b)b[a](c);else d.ga&&ga(a,c);return f}var b,g;f._init=function(a){a.code&&(function(a,e,b,g,q,m,r){a.GoogleAnalyticsObject=q;a[q]=a[q]||
|
6 |
+
function(){(a[q].q=a[q].q||[]).push(arguments)};a[q].l=1*new Date;m=e.createElement(b);r=e.getElementsByTagName(b)[0];m.async=1;m.src=g;r.parentNode.insertBefore(m,r)}(d,h,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",a.code,{alwaysSendReferrer:!0,userId:a.user}),a.custom&&l("set",a.custom),f.page(),ga(function(a){b=a}));return f};f.event=function(a,c,e,b){return l("send",{hitType:"event",eventCategory:a||"",eventAction:c||"",eventLabel:e||"",eventValue:Number(b||0)})};f.page=
|
7 |
+
function(a,c){var e={hitType:"pageview",page:a||location.pathname+location.hash,title:c||h.title};e.location=location.protocol+"//"+location.hostname+e.page;g&&l("set",{referrer:g});g=e.location;return l("send",e)};f.reset=function(){g=location.href;l("set",{page:location.pathname+location.hash,title:h.title,location:g});return f};return f}({},p,w));n.register("$28",function(f,d,M){function l(a,e){h(a).click(function(a){b&&b.event(e,"click",this.getAttribute("href")||"");return!0});a=null;return f}
|
8 |
+
var b,g=location.hostname,a="/help"===location.pathname.substr(0,5);f.init=function(a){!b&&a&&(g=a.host||(a.host=g),b=a.legacy?n.require("$34","legacy.js"):n.require("$35","universal.js"),b._init(a));return f};f.link=function(c){for(var e=c.getAttribute("href");e&&"#"!==e;){if(0===e.indexOf("#"))return l(c,"anchor");if("/help"===e.substr(0,5)&&!a)c.setAttribute("target","_blank");else if(0===e.indexOf("http")||0===e.indexOf("//")){if(-1!==e.indexOf(g)&&/^(https?:)*\/\/([^\/]+)/.exec(e)&&g===RegExp.$2)break;
|
9 |
+
c.setAttribute("target","_blank");l(c,"external")}break}return f};f.page=function(){b&&b.page.apply(b,arguments);return f};f.event=function(){b&&b.event.apply(b,arguments);return f};f.reset=function(){b&&b.reset&&b.reset();return f};return f}({},p,w));n.register("$31",function(f,d,n){function l(a,c,e,b,d){function q(){t&&clearTimeout(t);s&&s.fadeOut(400,function(){h(this).remove();s=null});return!1}function m(){r();-1!==b&&(t=setTimeout(q,b||2E3));s.off("mouseleave").on("mouseenter",r)}function r(){t&&
|
10 |
+
clearTimeout(t);t=null;s.off("mouseenter").on("mouseleave",m)}var t;g||(g=n.createElement("div"),g.id="growls",n.body.appendChild(g));var s=h('<div class="growl growl-'+e+'"><div><a class="close" href="#"><span>X</span></a><span class="badge"></span><p class="message"></p><small class="caption"></small></div></div>');s.find("p").text(a||"Empty message");c?s.find("small").text(c):s.find("small").remove();if(d.length){d.push({label:"Cancel",callback:q,css:"cancel"});var v,A=h('<form action="#" class="dialog"></form>');
|
11 |
+
c=function(a,c){v=h('<input type="button" value="'+c.label+'" class="butt '+(c.css||"")+'" />');v.click(function(a){"function"===typeof c.callback&&c.callback(a,{close:q})});A.append(v);return v};for(a=0;a<d.length;a++)c(a,d[a]);s.append(A)}h(g).prepend(s.hide().fadeIn(400));s.find("a").click(q);m()}var b,g;f.init=function(){if(!b)return b=d.alert,d.alert=function(a){a=String(a).split("\n");var c=a[1]&&a.slice(1).join("\n");f.alert(a[0],c)},f};f.debug=function(a){b(a);return f};f.alert=function(a,
|
12 |
+
c,e,k,g){try{return l(a,c||"",e||"alert",k||4E3,g||[]),!0}catch(q){return a+="\n\n--\n"+(q.message||q),b.call(d,a),!1}};f.success=function(a,c,e){return f.alert(a,c,"success",e||2E3)};f.dialog=function(a,c,e,b){return f.alert(a,c,b||"alert",-1,e)};f.login=function(a,c,e,b){f.dialog(c||"You're not logged in",e||"Please log in to continue",[{label:b||"Log in",callback:function(c,e){location.assign(a||"/session/auth/login?r="+encodeURIComponent(location.href))}}])};return f}({},p,w));n.register("$36",
|
13 |
+
function(f,d,n){function l(a){return 27===a.keyCode&&s&&v?(F(),a.preventDefault(),!1):!0}function b(a){if(s){a=d.innerWidth;var c=d.innerHeight;a!==C&&(C=a,H(u));c!==z&&(z=c,t&&g())}return!0}function g(){var a=e.outerHeight(!0)-t.clientHeight;t.style.maxHeight=String(z-a)+"px"}function a(a){a?(q.show(),k.addClass("has-title")):(q.hide(),k.removeClass("has-title"))}var c,e,k,y,q,m,r,t,s=!1,v=!1,A=!1,D,E,C,u,z,B=f.init=function(){if(!c){c=h('<div id="overlay"></div>');e=h('<div class="overlay-frame"></div>');
|
14 |
+
k=h('<div class="overlay-container"></div>');q=h('<div class="overlay-title"><span class="icon"></span><span class="title">Untitled</span></div>');m=h("<nav></nav>");r=h('<a class="overlay-close" href="#"><span>x</span></a>');y=h('<div class="overlay-bg"></div>');c.append(e.append(k)).append(y).prependTo(n.body);h(n).on("keydown",l);h(d).resize(b);C=d.innerWidth;z=d.innerHeight;E=k.outerWidth(!0)-k.width()+(e.innerWidth()-e.width());D=parseInt(k.css("width"));if(!D||isNaN(D))D=k.width();m.hide().prependTo(e);
|
15 |
+
q.append(r.hide()).hide().prependTo(e);c.hide()}return c},H=f.width=function(a){var c=B();if(null===a)e.css("width",""),k.css("width","");else{a=a||D||640;x=a+E;u=a;var b=C;x>b?(x=b,a=x-E,c.addClass("spill")):c.removeClass("spill");e.css("width",x+"px");k.css("width",a+"px")}return f};f.autoSize=function(){var a=B(),c=D||0;k.children().each(function(a,e){c=Math.max(c,h(e).outerWidth(!0))});H(c);if(t=a.find("div.overlay-scroll")[0])z=d.innerHeight,g();return f};f.css=function(a){B().attr("class",a);
|
16 |
+
return f};f.html=function(a){B();d.innerShiv&&(a=innerShiv(a,!1));return k.html(a)};f.append=function(a){B();a instanceof jQuery||(a=h(a));k.append(a);return f};var F=f.close=function(a){if(s){var e=function(){B().hide();h(n.body).removeClass("has-overlay");s=!1;k.html("");s=null;c.trigger("overlayClosed",[f])};null==a&&(a=300);c.trigger("overlayClosing",[f]);a?c.fadeOut(a,e):e()}return f};f.title=function(c,e){B();var b="",s=q.find("span");e&&/^lang lang-(\w+)/.exec(e)&&(b=RegExp.$1);s.eq(0).attr("class",
|
17 |
+
e||"icon").attr("lang",b);A=c||"";s.eq(1).text(A);null!=c?a(!0):v||a(!1);return f};f.enableClose=function(){B();v=!0;r.off("click").on("click",function(a){F();return!1});a(!0);r.show();return f};f.disableClose=function(){B();v=!1;r.hide();s&&A||a(!1);return f};f.enableNav=function(a){m.append(a);m.show();return f};f.disableNav=function(){m.html("").hide();return f};f.open=function(){B();k.html("");H(D);c.attr("class","");h(n.body).addClass("has-overlay");B().show();s=!0;f.title(null);v&&a(!0);c.trigger("overlayOpened",
|
18 |
+
[f]);return f};f.listen=function(a){B().on("overlayClosed",a);return f};f.unlisten=function(a){B().off("overlayClosed",a);return f};return f}({},p,w));n.register("$20",function(f,d,n){function l(a,c){this.$element=h(a);this.options=c;this.enabled=!0;this.fixTitle()}f.init=function(a,c){var e={fade:!0,offset:5,delayIn:b,delayOut:g,anchor:a.attr("data-anchor"),gravity:a.attr("data-gravity")||"s"};c&&(e=h.extend({},e,c));a.tipsy(e)};f.delays=function(a,c){b=a||150;g=c||100};f.kill=function(){h("div.tipsy").remove()};
|
19 |
+
f.text=function(a,c){c.data("tipsy").setTitle(a)};var b,g;f.delays();h(n.body).on("overlayOpened overlayClosing",function(a){f.kill();return!0});l.prototype={show:function(){var a=this.getTitle();if(a&&this.enabled){var c=this.tip();c.find(".tipsy-inner")[this.options.html?"html":"text"](a);c[0].className="tipsy";c.remove().css({top:0,left:0}).prependTo(n.body);var a=(a=this.options.anchor)?this.$element.find(a):this.$element,a=h.extend({},a.offset(),{width:a[0].offsetWidth,height:a[0].offsetHeight}),
|
20 |
+
e=c[0].offsetWidth,b=c[0].offsetHeight,g="function"==typeof this.options.gravity?this.options.gravity.call(this.$element[0]):this.options.gravity,q;switch(g.charAt(0)){case "n":q={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-e/2};break;case "s":q={top:a.top-b-this.options.offset,left:a.left+a.width/2-e/2};break;case "e":q={top:a.top+a.height/2-b/2,left:a.left-e-this.options.offset};break;case "w":q={top:a.top+a.height/2-b/2,left:a.left+a.width+this.options.offset}}2==g.length&&("w"==
|
21 |
+
g.charAt(1)?q.left=a.left+a.width/2-15:q.left=a.left+a.width/2-e+15);c.css(q).addClass("tipsy-"+g);c.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+g.charAt(0);this.options.className&&c.addClass("function"==typeof this.options.className?this.options.className.call(this.$element[0]):this.options.className);c.addClass("in")}},hide:function(){this.tip().remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("original-title"))&&a.attr("original-title",
|
22 |
+
a.attr("title")||"").removeAttr("title")},getTitle:function(){var a,c=this.$element,e=this.options;this.fixTitle();e=this.options;"string"==typeof e.title?a=c.attr("title"==e.title?"original-title":e.title):"function"==typeof e.title&&(a=e.title.call(c[0]));return(a=(""+a).replace(/(^\s*|\s*$)/,""))||e.fallback},setTitle:function(a){var c=this.$element;c.attr("default-title")||c.attr("default-title",this.getTitle());null==a&&(a=c.attr("default-title")||this.getTitle());c.attr("original-title",a);
|
23 |
if(this.$tip)this.$tip.find(".tipsy-inner")[this.options.html?"html":"text"](a)},tip:function(){this.$tip||(this.$tip=h('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0]));return this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.options=this.$element=null)},enable:function(){this.enabled=!0},disable:function(){this.hide();this.enabled=!1},toggleEnabled:function(){this.enabled=
|
24 |
+
!this.enabled}};h.fn.tipsy=function(a){function c(c){var e=h.data(c,"tipsy");e||(e=new l(c,h.fn.tipsy.elementOptions(c,a)),h.data(c,"tipsy",e));return e}function e(){var e=c(this),b=a.delayIn;e.hoverState="in";0==b?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},b))}function b(){var e=c(this),k=a.delayOut;e.hoverState="out";0==k?e.hide():(e.tip().removeClass("in"),setTimeout(function(){"out"==e.hoverState&&e.hide()},k))}a=h.extend({},h.fn.tipsy.defaults,a);a.live||this.each(function(){c(this)});
|
25 |
+
if("manual"!=a.trigger){var g=a.live?"live":"bind",q="hover"==a.trigger?"mouseleave":"blur";this[g]("hover"==a.trigger?"mouseenter":"focus",e)[g](q,b)}return this};h.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:0.8,title:"title",trigger:"hover",anchor:null};h.fn.tipsy.revalidate=function(){h(".tipsy").each(function(){var a=h.data(this,"tipsy-pointee"),c;if(!(c=!a)){a:{for(;a=a.parentNode;)if(a==n){a=!0;break a}a=!1}c=!a}c&&
|
26 |
+
h(this).remove()})};h.fn.tipsy.elementOptions=function(a,c){return h.metadata?h.extend({},c,h(a).metadata()):c};h.fn.tipsy.autoNS=function(){return h(this).offset().top>h(n).scrollTop()+h(d).height()/2?"s":"n"};h.fn.tipsy.autoWE=function(){return h(this).offset().left>h(n).scrollLeft()+h(d).width()/2?"e":"w"};h.fn.tipsy.autoBounds=function(a,c){return function(){var e=c[0],b=1<c.length?c[1]:!1,g=h(n).scrollTop()+a,q=h(n).scrollLeft()+a,m=h(this);m.offset().top<g&&(e="n");m.offset().left<q&&(b="w");
|
27 |
+
h(d).width()+h(n).scrollLeft()-m.offset().left<a&&(b="e");h(d).height()+h(n).scrollTop()-m.offset().top<a&&(e="s");return e+(b?b:"")}};return f}({},p,w));n.register("$21",function(f,d,M){var l={401:"You've been logged out",422:"Invalid data sent to server",404:"Not Found",500:"Server Error",502:"Bad Gateway",503:"Service unavailable",504:"Gateway timeout"};f.getErrors=function(){return l};f.jsonLink=function(b){if(!b)return"";b=b.split("?");b[0]=b[0].replace(/(\.[a-z0-9]{1,4})?$/i,".json");return b.join("?")};
|
28 |
+
f.errorData=function(b,g,a){var c,e;a=b.responseText;g=b.status;if(!a&&0===g)return null;try{c=h.parseJSON(a)||{}}catch(k){c={},e=l[b.status]||k.message||k}c.error=e||c.error||c.statusText||b.statusText||l[g]||"Unknown Error";return c};f.ajax=function(b,g,a,c){function e(){a&&a()}function k(a){a.alert&&alert(a.alert);var b=a.success;b&&n.require("$31","growl.js").success.apply(this,b.push?b:[b]);b=c||h(M.body);b.trigger("locoAjaxSuccess",[a]);var k=a.events;if(k&&k.length)for(var g,s=n.require("$28",
|
29 |
+
"ga.js");g=k.shift();)b.trigger(g,[a]),s.event("ajax",g);if(b=a.download)d.location.assign(b);else if(b=a.redirect)if(0===b.indexOf("/modal/"))a.modal={url:b};else return d.location.assign(b),!1;else if(a.reload)return d.location.reload(),!1;(b=a.modal)&&n.require("$29","modal.js").replace(b);e();return!0}function y(a,c,b){if("abort"!==c){var t=a.status,s;if(401===t)n.require("$31","growl.js").login(),g&&!1===g(null,l[t],t,a)&&e();else{if("parsererror"===c)d.console&&console.error&&console.error(t,
|
30 |
+
a.responseText),s=404===t?"Ajax service not found":/^\s+Fatal error/.test(a.responseText)?"Fatal server error from Ajax request":"Bad Ajax response";else{var v=f.errorData(a,c,b);v&&v.error&&(s=v.error)}"function"===typeof g&&!1===g(null,s,t,a)?e():v&&v.data&&!k(v.data)||(alert(s||"Unknown Ajax error"),e())}}}(b.headers||(b.headers={}))["X-Loco-Csrf"]=d.loco&&G.csrf||"";b.error=y;b.success=function(a,c,b){if(!a||"object"!==typeof a)return y(b,"unknown");(a.status||a.error)&&alert(a.error||a.statusText||
|
31 |
+
b.statusText||l[a.status]||"Unknown Error");"function"===typeof g&&!1===g(a&&a.data?a.data:a,null,c,b)?e():a&&a.data?k(a.data):e()};-1!==b.url.indexOf(".json")&&(b.dataType="json");return h.ajax(b)};return f}({},p,w));n.register("$29",function(f,d,M){function l(a){a.stopPropagation();a.preventDefault();return!1}function b(){k||(k=n.require("$36","overlay.js"),k.listen(c));return k}function g(){var a=m.length-1,c=m[a],e=h('<a class="has-icon icon-back" data-gravity="w">Back</a>').attr("href",c[0]).attr("title",
|
32 |
+
c[1]).click(function(e){if(m[a]===c&&v())return l(e)});k.enableNav(e);n.require("$20","tooltip.js").init(e)}function a(a,c){b().autoSize();var e=k.init();n.require("$16","html.js").init(e);m.length&&g();e.find("[data-script]").each(function(a,e){e=h(e);for(var b=-1,s,k=e.attr("data-script").split(" ");++b<k.length;)s=k[b],q[s]?q[s](e,c||{}):alert("Unknown script "+s)});e.trigger("locoModalLoaded",[k,a||"",c||{}]);var s,r=e.find("form")[0],d;if(r)a:for(e=0;e<r.elements.length;e++)switch(s=r.elements[e],
|
33 |
+
s.type){case "text":case "email":case "textarea":d=Number(s.getAttribute("tabindex"));if(isNaN(d)||100>d)continue a;h(s).focus();break a}}function c(){r=null;m=[];return!0}function e(a){var c=h(a.currentTarget),e=c.attr("data-modal");if("back"===e){if(v())return l(a);e="close"}if("close"===e){s();var b=c.attr("href");if(b&&-1!==b.indexOf("#!"))return!0}else{var k="submit"===a.type,g=c.attr("title")||c.attr("data-title"),b=c.attr("href")||c.attr("action"),r=k?c.serialize():"",c=k?c.attr("method"):
|
34 |
+
"get";e||(e=b.split("/").slice(1,4).join("-"));t(b,g,c,r,"modal "+e)}return l(a)}var k,y=n.require("$28","ga.js"),q={},m=[],r,t=f.load=function(c,e,s,g,d){var v=r;r=[].slice.call(arguments);v&&c!==v[0]&&(m.push(v),c+=-1===c.indexOf("?")?"?":"&",c+="r="+encodeURIComponent(v[0]));b().open().title("Loading ..").disableClose().disableNav().css("modal").html('<div class="loading"></div>');d&&k.width(null).css(d).autoSize();var v=c.split("#"),q=v[1];q&&(c=v[0]);var v=n.require("$21","http.js"),l={type:s||
|
35 |
+
"get",data:g||"",url:v.jsonLink(c)};v.ajax(l,function(b,v,f){var z=b&&b.html;if(!z)return b&&b.redirect?(r=m.pop()||null,t(b.redirect,e,s,g,d)):(b=h('<h3 class="error"></h3>').text(v||"Unknown error"),k.enableClose().title("Error "+f||"?").html("").append(b)),!1;e=b.title||e||"Untitled";r&&(r[1]=e);k.enableClose().title(e,b.icon).html(z);f=b.js||{};q&&(f["#"]=q);a(c,f);y.page(c,e);k.init().one("overlayClosed",function(){y.reset()});return!0});return f},s=f.close=function(){b().close();return f},v=
|
36 |
+
f.back=function(){if(previous=m.pop())return r=m[m.length-2],t.apply(null,previous),!0};f.reload=function(){r&&t.apply(null,r)};f.initLink=function(a){a.click(e)};f.initForm=function(a){h(a).submit(e)};f.replace=function(c){b();var e=c&&c.html,s=c&&c.url,g=c&&c.title,r=c&&c.action;if(s)c=c&&c.css||s.split("/").slice(1,4).join("-"),t(s,g,"","",c);else if(e)k.open().html(e),g&&k.enableClose().title(g),a("",c&&c.js);else if("function"===typeof f[r])f[r]()};f.find=function(a){return b().init().find(a)};
|
37 |
+
f.script=function(a,c){if(c){if("function"!==typeof c.run)throw Error(a+" macro has no run function");q[a]=c.run;return f}return q[a]};return f}({},p,w));n.register("$8",function(f,d,n){f.listen=function(f,b){function g(){t[k?"show":"hide"]()}function a(a){r&&f.setAttribute("size",a.length||1);k=a;g();return a}function c(){y=null;b(k)}function e(){var e=f.value;m&&e===m&&(e="");e!==k&&(y&&clearTimeout(y),a(e),q?y=setTimeout(c,q):c())}var k,y;f=f instanceof jQuery?f[0]:f;var q=150,m=d.attachEvent&&
|
38 |
+
f.getAttribute("placeholder"),r=1===Number(f.size),t=h('<a href="#clear" tabindex="-1" class="icon clear"><span>clear</span></a>').click(function(a){f.value="";e();return!1});a(f.value);h(f).on("input blur focus",function(){e();return!0}).after(t);g();return{delay:function(a){q=a},ping:function(b){b?(y&&clearTimeout(y),b=f.value,m&&b===m&&(b=""),a(b),c(),b=void 0):b=e();return b},val:function(c){if(null==c)return k;y&&clearTimeout(y);f.value=a(c);g()},el:function(){return f},blur:function(a){return h(f).on("blur",
|
39 |
a)}}};return f}({},p,w));n.register("$19",{"\u00e1":"a","\u00e0":"a","\u0103":"a","\u1eaf":"a","\u1eb1":"a","\u1eb5":"a","\u1eb3":"a","\u00e2":"a","\u1ea5":"a","\u1ea7":"a","\u1eab":"a","\u1ea9":"a","\u01ce":"a","\u00e5":"a","\u01fb":"a","\u00e4":"a","\u01df":"a","\u00e3":"a","\u0227":"a","\u01e1":"a","\u0105":"a","\u0101":"a","\u1ea3":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1eb7":"a","\u1ead":"a","\u1e01":"a","\u01fd":"\u00e6","\u01e3":"\u00e6","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0107":"c",
|
40 |
"\u0109":"c","\u010d":"c","\u010b":"c","\u00e7":"c","\u1e09":"c","\u010f":"d","\u1e0b":"d","\u1e11":"d","\u0111":"d","\u1e0d":"d","\u1e13":"d","\u1e0f":"d","\u00f0":"d","\ua77a":"d","\u01c6":"\u01f3","\u00e9":"e","\u00e8":"e","\u0115":"e","\u00ea":"e","\u1ebf":"e","\u1ec1":"e","\u1ec5":"e","\u1ec3":"e","\u011b":"e","\u00eb":"e","\u1ebd":"e","\u0117":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u0113":"e","\u1e17":"e","\u1e15":"e","\u1ebb":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u1e19":"e",
|
41 |
"\u1e1b":"e","\u1e1f":"f","\ua77c":"f","\u01f5":"g","\u011f":"g","\u011d":"g","\u01e7":"g","\u0121":"g","\u0123":"g","\u1e21":"g","\ua7a1":"g","\u1d79":"g","\u0125":"h","\u021f":"h","\u1e27":"h","\u1e23":"h","\u1e29":"h","\u0127":"h","\u210f":"h","\u1e25":"h","\u1e2b":"h","\u1e96":"h","\u00ed":"i","\u00ec":"i","\u012d":"i","\u00ee":"i","\u01d0":"i","\u00ef":"i","\u1e2f":"i","\u0129":"i","\u012f":"i","\u012b":"i","\u1ec9":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u1e2d":"i","\u0135":"j","\u01f0":"j",
|
48 |
"\u1fc2":"\u03b7","\u1fc6":"\u03b7","\u1fc7":"\u03b7","\u1fc3":"\u03b7","\u1f30":"\u03b9","\u1f34":"\u03b9","\u1f32":"\u03b9","\u1f36":"\u03b9","\u1f31":"\u03b9","\u1f35":"\u03b9","\u1f33":"\u03b9","\u1f37":"\u03b9","\u03af":"\u03b9","\u1f77":"\u03b9","\u1f76":"\u03b9","\u1fd0":"\u03b9","\u1fd6":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u1fd3":"\u03b9","\u1fd2":"\u03b9","\u1fd7":"\u03b9","\u1fd1":"\u03b9","\u1f40":"\u03bf","\u1f44":"\u03bf","\u1f42":"\u03bf","\u1f41":"\u03bf","\u1f45":"\u03bf",
|
49 |
"\u1f43":"\u03bf","\u03cc":"\u03bf","\u1f79":"\u03bf","\u1f78":"\u03bf","\u1fe4":"\u03c1","\u1fe5":"\u03c1","\u1f50":"\u03c5","\u1f54":"\u03c5","\u1f52":"\u03c5","\u1f56":"\u03c5","\u1f51":"\u03c5","\u1f55":"\u03c5","\u1f53":"\u03c5","\u1f57":"\u03c5","\u03cd":"\u03c5","\u1f7b":"\u03c5","\u1f7a":"\u03c5","\u1fe0":"\u03c5","\u1fe6":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u1fe3":"\u03c5","\u1fe2":"\u03c5","\u1fe7":"\u03c5","\u1fe1":"\u03c5","\u1f60":"\u03c9","\u1f64":"\u03c9","\u1fa4":"\u03c9",
|
50 |
"\u1f62":"\u03c9","\u1fa2":"\u03c9","\u1f66":"\u03c9","\u1fa6":"\u03c9","\u1fa0":"\u03c9","\u1f61":"\u03c9","\u1f65":"\u03c9","\u1fa5":"\u03c9","\u1f63":"\u03c9","\u1fa3":"\u03c9","\u1f67":"\u03c9","\u1fa7":"\u03c9","\u1fa1":"\u03c9","\u03ce":"\u03c9","\u1f7d":"\u03c9","\u1ff4":"\u03c9","\u1f7c":"\u03c9","\u1ff2":"\u03c9","\u1ff6":"\u03c9","\u1ff7":"\u03c9","\u1ff3":"\u03c9","\u0491":"\u0433","\u0450":"\u0435","\u0451":"\u0435","\u04c2":"\u0436","\u045d":"\u0438","\u04e3":"\u0438","\u04ef":"\u0443"});
|
51 |
+
n.register("$7",function(f,d,h){f.init=function(){function d(a){return f[a]||a}function b(a){return String(a||"").toLowerCase().replace(e,d)}function g(a,c,e){for(var b=a.split(k),s=b.length;0!==s--;)(a=b[s])&&null==e[a]&&(c.push(a),e[a]=!0);return c}function a(a,e){for(var k=[],d={},s,f=e.length;0!==f--;)(s=e[f])&&g(b(s),k,d);c[a]=k}var c=[],e=/[^a-z0-9]/g,k=/[\-_\s.?!;:,*^+=~`"(){}<>\[\]\/\\\u00a0\u1680\u180e\u2000-\u206f\u2e00-\u2e7f\u3000-\u303f]+/,f=n.require("$19","flatten.json");return{find:function(a,
|
52 |
+
e){var k=[],d=-1,s=c,f=s.length,y,h,l,n,u,z,B=g(b(a),[],{}),H=B.length,F=e?!0:!1;a:for(;++d<f;)if(l=s[d],null!=l&&(n=l.length)){u=0;b:for(;u<H;u++){z=B[u];for(y=0;y<n;y++)if(h=l[y],0===h.indexOf(z))continue b;continue a}k.push(F?e[d]:d)}return k},add:function(a,e){c[a]=g(b(e),[],{})},push:function(e){a(c.length,e)},index:function(c,e){a(c,e)},size:function(){return c.length},clear:function(){c=[]},remove:function(a){c[a]=null}}};return f}({},p,w));n.register("$22",function(f,d,h){f.create=function(){var d=
|
53 |
+
[],b=n.require("$7","fulltext.js").init();return{add:function(g,a){b.add(d.length,a);d.push(g);return this},find:function(g){return b.find(g,d)},clear:function(){d=[];b.clear();return this}}};return f}({},p,w));n.register("$10",function(f,d,p){function l(b){-1===b.indexOf("?")&&(b="/auto/"+b+".json?q=");this.url=b;this.dead={}}function b(){this.dict=n.require("$22","dict.js").create()}f.init=function(g){function a(){if("hint"!==H){var a=z.val()&&!(I&&I.val())&&null==C&&!A;V[a?"addClass":"removeClass"]("error")}}
|
54 |
+
function c(a){I&&I.val(a)}function e(){p.show();var a=z.outerWidth(!1),c=z.outerHeight(!1),e=z.css("margin-top");e&&(e=parseInt(e),isNaN(e)||(c+=e));a-=2;p.css("top",c+"px").css("width",a+"px");A=!0}function k(){p.hide();A=!1}function d(){p.html("");k();v=0;u=C=null}function f(c){d();var b;for(b=0;b<c.length;b++){var s=b,k=c[b],g=k.value,t=k.lang||g.lang,z=h('<span class="label"></span>').text(k.label),A=h('<div class="auto-comp-result"></div>'),q=void 0,B=void 0;if(B=k.icon)q=h("<span></span>").attr("class",
|
55 |
+
B).appendTo(A),t?(q.attr("lang",t),k.lang=t):-1!==B.indexOf("lang-"+g)&&(q.attr("lang",g),k.lang=g);for(B in k)A.data(B,k[B]);A.append(z);m(s,A)}(v=c.length)?(D&&e(),r(0)):(r(null),a(),V.trigger("locoAutonone",[]))}function m(a,c){p.append(c);c.click(function(e){e.stopPropagation();r(a,c);s();return!1});return c}function r(a,e){u&&(u.removeClass("selected"),u=null);C=null;null==a?c(""):(e||(e=p.find("div.auto-comp-result").eq(a)),e.length&&(e.addClass("selected"),C=a,u=e))}function t(a){if(v){var c=
|
56 |
+
v-1;null==C?a=0<a?0:c:(a=C+a,0>a?a=c:a>c&&(a=0));return r(a)}}function s(){if(null==C)w.val(""),c("");else{var e=p.find("div.auto-comp-result").eq(C),b=e.data()||{label:"Error"},s=b.value,g=b.label;c(s);w.val(g);k();e=e.clone();e.data(b);d();m(0,e);v=1;r(0,e);a();e.trigger("locoAutocomp",[s,g,e])}}var v=0,A=!1,D=!1,E=g.form,C=null,u=null,z=h(g),B=z.attr("name"),H=z.attr("data-mode"),F=z.attr("data-provider"),I="hint"!==H&&h('<input type="hidden" value="" name="'+B+'" />').appendTo(E),V=h('<div class="auto-comp-wrap"></div>').replaceAll(z),
|
57 |
+
p=h('<div class="auto-comp-drop"></div>');F&&(F=new l(F));I&&z.attr("name","_"+B);z.attr("autocomplete")||z.attr("autocomplete","off");V.append(z).append(p);k();z.focus(function(a){D=!0;1<v&&e()}).blur(function(c){D=!1;a()}).keydown(function(a){function c(){a.preventDefault();a.stopPropagation();return!1}switch(a.keyCode){case 27:A&&(a.stopPropagation(),k(),z.blur());break;case 40:v&&(A?t(1):e());break;case 38:A&&t(-1);break;case 13:if(A)return s(),c();if(!C&&"hint"!==H)return c()}return!0});var w=
|
58 |
+
n.require("$8","LocoTextListener.js").listen(z,function(a){F&&F.fetch(a,f)});(E=z.attr("data-pre"))&&(E=h.parseJSON(E))&&E.value&&E.label?(f([E]),s()):!g.value||I&&I.val()||!F||F.fetch(g.value,function(a){f(a);s()});return{$:z,val:function(){return I&&I.val()},clear:d,reset:function(){d();z.val("");c("");w.ping()},force:function(a,e){d();c(e||"");w.val(a)},preload:function(a){v&&d();F=new b;var c,e;for(c in a)e=a[c],F.add(e)},mode:function(a){H=a},provide:function(a){F=new l(a)}}};l.prototype.fetch=
|
59 |
+
function(b,a){if(!b)return a&&a([]),this.dead={},this;var c,e=this.dead;for(c in e)if(0===b.indexOf(c))return a&&a([]),this;c={dataType:"json",url:this.url+encodeURIComponent(b)};n.require("$21","http.js").ajax(c,function(c){var d=c&&c.results;d&&(a&&c.query&&c.query===b&&a(c.results),d.length||(e[b]=0));return!0});return this};b.prototype.add=function(b){var a=b.fulltext||b.label||b.value;a&&this.dict.add(b,a)};b.prototype.fetch=function(b,a){var c=b?this.dict.find(b):[];a&&a(c);return this};return f}({},
|
60 |
+
p,w));n.register("$9",function(f,d,p){function l(a){a.stopPropagation();a.preventDefault();return!1}function b(a,c,e){if(e=e||a.getElement(c))e.off().mouseup(function(e){e.stopPropagation();a.selectIndex(c,!0);return!1}).mouseover(function(){h(this).addClass("over");a.hover=c;return!0}).mouseout(function(){h(this).removeClass("over");a.hover=-1;return!0}),e=null;return a}function g(a){if(a){var c,e=a[0],b=e.id,g=e.title,d=[],f=[],r=-1,t=e.options.length,s,v=this.selectedIcon||"";this.id=b||"";this.name=
|
61 |
+
e.name||"";this.prefix=e.getAttribute("data-prefix");for(this.defaultIcon=e.getAttribute("data-icon")||"icon no-icon";++r<t;)c=e.options[r],s=c.disabled,c.selected&&d.push(r),c=h(c),f.push([c.val(),c.text(),c.attr("data-icon")||v,s,c.attr("lang")]);this.hidden||(this.hidden=h('<input type="hidden" name="'+this.name+'" value="" />').appendTo(e.form));this.list=h('<ul class="clearfix"></ul>');this.icon=h('<span class="icon"> </span>');this.selection=h('<span class="label"></span>');this.handle=h('<a class="handle" href="#"></a>').attr("tabindex",
|
62 |
+
a.attr("tabindex")||"").append(this.icon).append(this.selection);c=h('<div class="selector"></div>').addClass(e.className).append(this.handle).append(this.list).replaceAll(e);b&&c.attr("id",b);g&&a.hasClass("hastip")&&(c.attr("title",g),n.require("$20","tooltip.js").init(c,{gravity:a.attr("data-gravity")||"s",anchor:a.attr("data-anchor")}));this.wrapper=c;for(this.clearOptions();c=f.shift();)this.addOption.apply(this,c);this.enable();this.close();if(t=d.length)for(r=0;r<t;r++)this.selectIndex(d[r]);
|
63 |
+
else r=e.selectedIndex,null!=r&&0<=r&&this.selectIndex(r)}}f.create=function(a){return new g(a)};f.extend=function(a){a.parent=g;a.prototype=new g};d=g.prototype;d.enable=function(){var a=this;a.handle.click(function(a){a.preventDefault();return!1}).mouseover(function(c){return a.onRollover(c)}).mouseout(function(c){return a.onRollout(c)}).mousedown(function(c){return a.onPress(c)}).keydown(function(c){return a.onKeydown(c)});h(p).mouseup(function(c){return a.onRelease(c)}).keydown(function(c){return a.onGlobalKeydown(c)})};
|
64 |
+
d.onRollover=function(a){return this.over=!0};d.onRollout=function(a){this.over=!1;return!0};d.onPress=function(a){return this.active?this.over?(this.close(),a.stopPropagation(),a.preventDefault(),!1):!0:(this.open(),a.stopPropagation(),a.preventDefault(),this.handle.focus(),!1)};d.onRelease=function(a){this.active&&!this.over&&this.close();return!0};d.onGlobalKeydown=function(a){if(this.active)switch(a.keyCode){case 27:return this.close(),l(a);case 40:return this.hoverNext(1),l(a);case 38:return this.hoverNext(-1),
|
65 |
+
l(a);case 13:if(-1!=this.hover)return this.selectIndex(this.hover,!0),this.hoverItem(-1),this.close(),l(a)}return!0};d.onKeydown=function(a){return this.active||40!==a.keyCode?!0:(this.open(),l(a))};d.open=function(){var a=this.list,c=this.wrapper,e=c.data("tipsy"),b=this.handle,g=b.outerHeight()||0;this.active=!0;this.hover=-1;c.addClass("active");a.show().css("top",g+"px");e&&e.disable();c=b.outerWidth()||0;e=a.outerWidth()||0;c>e&&(e-=a.width(),a.css("min-width",String(c-e)+"px"))};d.close=function(){var a=
|
66 |
+
this.wrapper,c=a.data("tipsy");this.list.hide();this.active=!1;-1!==this.hover&&(this.getElement(this.hover).removeClass("over"),this.hover=-1);a.removeClass("active");c&&c.enable()};d.hoverItem=function(a,c){-1!==this.hover&&this.getElement(this.hover).removeClass("over");this.hover=a;-1!==a&&(c=c||this.getElement(a),c.addClass("over"))};d.hoverNext=function(a){var c=this.options.length;if(c){c-=1;if(-1==this.hover)a=0<a?0:c;else{a=this.hover+a;if(0>a){this.close();return}a>c&&(a=0)}this.hoverItem(a)}};
|
67 |
+
d.enableChange=function(a){this.eventName=a;this.eventData=[].slice.call(arguments,1);return this};d.enableConfirm=function(a){this.confirm=a;return this};d.clearOptions=function(){this.index={};this.length=0;this.options=[];this.list.html("");this.hidden.val("");this.idx=this.hover=-1;return this};d.destroy=function(){this.clearOptions();this.hidden.remove()};d.addOption=function(a,c,e,k,g){var d=this.options.length,f=h("<span></span>").addClass(e||"icon no-icon"),r=h('<span class="label"></span>').text(c||
|
68 |
+
a),r=h("<li></li>").append(f).append(r).appendTo(this.list);g?g=g.split("-").shift():e&&-1!==e.indexOf("lang-"+a)&&(g=a);g&&f.attr("lang",g);r.attr("data-option",d);this.options[d]={value:a,text:c,lang:g||"",icon:e};this.index[a]=d;this.length=d+1;k?this.disableIndex(d):b(this,d,r);return d};d.disableOption=function(a){return this.disableIndex(this.index[a])};d.disableIndex=function(a){(a=this.getElement(a))&&a.addClass("disabled").off();return this};d.enableOption=function(a){return this.enableIndex(this.index[a])};
|
69 |
+
d.enableIndex=function(a){return b(this,a)};d.reIndex=function(){this.index={};this.length=0;for(var a=this.options.length;0!==a--;)this.index[this.options[a].value]=a,this.length++};d.selectValue=function(a,c){return this.selectIndex(this.index[a],c)};d.selectIndex=function(a,c){var e=this.options[a];if(e){var b=this,g=b.idx,d=e.value,f=e.icon||b.defaultIcon,r=function(){null!=g&&b.getElement(g).removeClass("active");b.getElement(a).addClass("active");b.setLabel(e.text).setIcon(f,e.lang);b.hidden.val(d);
|
70 |
+
b.idx=a;c&&b.change()};g===a?b.hidden.val(d):c?"function"===typeof b.confirm?b.confirm.call(null,e,function(a){a&&r()}):b.beforeChange(d)&&r():r();b.active&&b.close()}return this};d.setLabel=function(a){this.selection.text(a);this.prefix&&this.selection.prepend(h('<span class="prefix"></span>').text(this.prefix));return this};d.setIcon=function(a,c){this.icon.attr("class",a).attr("lang",c||"");return this};d.val=function(){var a=this.options[this.idx];return a&&a.value};d.change=function(){var a=
|
71 |
+
this.val(),c=this.save,e=this.eventName||"change",b=[a].concat(this.eventData||[]);this.wrapper.trigger(e,b);c&&c(a);return this};d.beforeChange=function(a){var c=h.Event("locoBeforeSelect");this.wrapper.trigger(c,[a]);return!c.isDefaultPrevented()};d.renameOption=function(a,c){var e=this.index[a],b=this.options[e];b&&(b.text=c,this.getElement(e).find("span.label").text(c),e===this.idx&&this.setLabel(c));return this};d.removeOption=function(a){var c=this.index[a],e=this.options[c];e&&(a=this.val(),
|
72 |
+
this.getElement(c).remove(),this.options.splice(c,1),this.reIndex(),a===e.value?this.selectIndex(0,!0):this.selectValue(a,!1))};d.getElement=function(a){return this.list.find("li").eq(a)};d.persist=function(a){var c=this.id||this.name,e=a.fetch(c);null!=e&&this.selectValue(e,!0);this.save=function(e){a.store(c,e)};return this};d.listen=function(a){return this.on(this.eventName||"change",a)};d.on=function(a,c){this.wrapper.on(a,c);return this};d=null;return f}({},p,w));n.register("$30",function(f,
|
73 |
+
d,p){function l(b){var g=[],a=h([]);this.hidden=a;this.selected=g;this.selectedIcon="icon icon-checkbox";this.constructor.call(this,b);this.wrapper.addClass("multi");for(var c,e,k,d=h('<input type="checkbox" name="'+this.name+'[]" />')[0],f=this.options,m=f.length,r=-1;++r<m;)c=this.getElement(r)[0],k=d.cloneNode(!0),g[r]&&(k.checked=!0),k.setAttribute("value",f[r].value),a.push(c.appendChild(k));(e=this.defaultIcon)&&this.setIcon(e);(e=b.attr("title"))?this.setLabel(e):this.wrapper.addClass("no-title")}
|
74 |
+
f.create=function(b){return new l(b)};n.require("$9","LocoSelector.js").extend(l);d=l.prototype;d.selectIndex=function(b,g){return this.setIndexState(b,!this.selected[b],g)};d.setIndexState=function(b,g,a){var c=this.options[b],e=this.getElement(b),k=this.hidden[b],d=this.selected;c&&g!==d[b]&&(d[b]=g,e[g?"addClass":"removeClass"]("checked"),k&&(k.checked=g),a&&this.change());return this};d.selectValue=function(b,g){if(null==b.pop)return l.parent.prototype.selectValue.call(this,b,g);for(var a=this.selected.slice(),
|
75 |
+
c=this.options.length,e=!1,k=-1,d=-1;++k<c;)a[k]&&(e=!0),a[k]=!1;if(c=b.length)for(;++d<c;)k=this.index[b[d]],!1===a[k]&&(e=a[k]=!0);if(e){for(k in a)this.setIndexState(k,a[k]);g&&this.change()}return this};d.val=function(){for(var b=[],g=this.options,a=this.selected,c=a.length,e=-1;++e<c;)a[e]&&b.push(g[e].value);return b};d=null;return f}({},p,w));n.register("$16",function(f,d,p){var l=d.ieVersion;f.ie=function(b){return b?l<=b:l};var b=f.init=function(g){g?g instanceof jQuery||(g=h(g)):g=h(p.body);
|
76 |
+
var a=n.require("$28","ga.js"),c=n.require("$17","forms.js"),e=n.require("$29","modal.js"),k=n.require("$10","LocoAutoComplete.js"),d=n.require("$9","LocoSelector.js"),q=n.require("$30","LocoMultiSelector.js"),m=n.require("$20","tooltip.js");g.find("form").each(function(a,b){var s=h(b);l&&10>l&&c.placeholders(s);b.getAttribute("data-modal")?e.initForm(b):b.action&&0!==s.attr("action").indexOf("#")&&!b.target&&c.jsonify(b);s.hasClass("hasreveal")&&c.revealify(s);s.find("input.auto-comp").each(function(a,
|
77 |
+
c){k.init(c)});s.find("select.selector").each(function(a,c){c.hasAttribute("multiple")?q.create(h(c)):d.create(h(c))});s.find("button.hastip").each(function(a,c){m.init(h(c))})});g.find("a").each(function(c,k){-1!==k.className.indexOf("hastip")&&m.init(h(k));if(-1!==k.href.indexOf("/modal/")||k.getAttribute("data-modal"))e.initLink(h(k));else{a.link(k);var s=k.getAttribute("data-ajax-target");s&&(s=h("#"+s),h(k).click(function(a){a.preventDefault();s.addClass("loading");h.get(k.href,function(a){a=
|
78 |
+
f.$(a).replaceAll(s);b(a);a.trigger("locoAhah")});return!1}))}});c=e=k=g=null;return f};f.$=function(b){return h(d.innerShiv?innerShiv(b,!1):b)};h.fn._html=function(g){return null!=g?(g=this.html(d.innerShiv?innerShiv(g,!1):g),b(this),g):j.html()};h.fn.macro=function(b,a){if("function"!==typeof b.run)throw Error("macro has no run function");b.run(this,a||{});return this};f.el=function(b,a){var c=p.createElement(b||"div");a&&(c.className=a);return c};f.txt=function(b){return p.createTextNode(b||"")};
|
79 |
+
f.h=function(){function b(){e=/[<>&]/g;k=/(\r\n|\n|\r)/g;d=/(?:https?):\/\/([a-zA-Z0-9\-_\.\?%~&;=\/]+(?:#.*)?)/g;b=null}function a(a){return"&#"+a.charCodeAt(0)+";"}function c(a,c){return'<a href="'+a+'">'+c+"</a>"}var e,k,d;return function(f,m){b&&b();var r=f.replace(e,a);m&&(r=r.replace(k,"<br />").replace(d,c));return r}}();f.noop=function(b){b.preventDefault();b.stopPropagation();return!1};return f}({},p,w));n.register("$17",function(f,d,p){function l(a){function c(){a.value===d&&(a.value="",
|
80 |
+
b.removeClass("placeheld"));return!0}function e(){""===a.value&&(a.value=d,b.addClass("placeheld"));return!0}var b=h(a);if(!b.hasClass("auto-comp")){var d=b.attr("placeholder");if(d)return b.focus(c).blur(e),e(),{kill:function(){c();b.off("focus",c).off("blur",e)}}}}var b=f.enable=function(a){function c(a,c){c.getAttribute("data-was-disabled")||(c.disabled=!1)}a.find(".button").removeClass("loading");a.find("button").each(c);a.find("input").each(c);a.find("select").each(c);a.find("textarea").each(c);
|
81 |
+
d.attachEvent&&a.hasClass("has-placeholders")&&f.placeholders(a);delete a._disabled},g=f.disable=function(a){function c(a,c){c.disabled?c.setAttribute("data-was-disabled","true"):c.disabled=!0}a._disabled||(a.find(".button").addClass("loading"),a.find("button").each(c),a.find("input").each(c),a.find("select").each(c),a.find("textarea").each(c),a._disabled=!0)};f.jsonify=function(a,c,e){a instanceof jQuery||(a=h(a));a.disable||(h.fn.disable=function(){g(this);return this},h.fn.enable=function(){b(this);
|
82 |
+
this.placehold&&this.placehold();return this});var k="";a.find('[type="submit"]').click(function(a){a&&a.target&&a.target.name&&(k=encodeURIComponent(a.target.name)+"="+encodeURIComponent(a.target.value));return!0});a.submit(function(b){if(b&&b.isDefaultPrevented&&b.isDefaultPrevented()||e&&!1===e(b))return!1;var g=d.tinyMCE;g&&a.find("textarea.editor").each(function(a,c){var e=g.get(c.id);e&&e.save()});var f=a.serialize(),f=f.replace(/%0D%0A/g,"%0A");k&&(f&&(f+="&"),f+=k,k="");a.disable();var s=
|
83 |
+
n.require("$21","http.js"),f={url:s.jsonLink(a.attr("action")),type:a.attr("method"),data:f};s.ajax(f,c,function(){a.enable()},a);b.preventDefault();b.stopPropagation();return!1});if(a.hasClass("autopost")){var f,q=Number(a.attr("data-autopost-delay")||500);a.find('input[type="checkbox"]').change(function(){f&&clearTimeout(f);f=setTimeout(function(){a.submit()},q);return!0})}};f.revealify=function(a){a=a.closest("form");a.find("div[data-reveal-if]").each(function(c,e){function b(a){var c;A=A||a.target;
|
84 |
+
if("."===s)c=Boolean(A&&A[v]),r&&(c=!c);else{var e,k=h(A.form).serializeArray();for(e in k)k[e].name===t&&(c=k[e].value);c=r?v!==c:v===c}if(c!==f)if(f=c,a)d[f?"slideDown":"slideUp"](200);else d[f?"show":"hide"]();return!0}var d=h(e),g=/^(\!?)([_\w\-\[\]]+)(\.|!?=)(.*)$/.exec(d.attr("data-reveal-if"));if(g){var f,r=g[1],t=g[2],s=g[3],v=g[4],g=a[0][t];if(g.type||null==g.length)g=[g];c=g.length;for(var A;0!==c--;)A=g[c],b(),h(A).change(b).removeClass("jshide");g=g=A=null}});a=null};f.linkify=function(a){var c=
|
85 |
+
a.getAttribute("data-icon");if(c){var e=h(a),b=h("<a> </a>");b.attr("href",a.form.action);b.attr("class",e.attr("class"));b.attr("tabindex",e.attr("tabindex"));e.attr("tabindex","-1");b.text(e.val());c&&h("<span></span>").prependTo(b).addClass(c);e.hide().after(b);b.click(function(a){e.click();return!1})}};f.placeholders=function(a){var c,b=[];a.find("input[placeholder]").each(function(a,d){"password"!==d.type&&(c=l(d))&&b.push(c)});b.length&&(a.submit(function(){for(var a in b)b[a].kill()}),a.addClass("has-placeholders"),
|
86 |
+
c=i=null)};return f}({},p,w));n.register("$4",function(f,d,p){function l(a,c,b){function e(){d();g=setTimeout(c,b)}function d(){g&&clearTimeout(g);g=null}var g;e();h(a).mouseenter(d).mouseleave(e);return{die:function(){d();h(a).off("mouseenter mouseleave")}}}function b(a,c){a.fadeTo(c,0,function(){a.slideUp(c,function(){a.remove();h(d).triggerHandler("resize")})})}function g(a,c){function e(c){k[f]=null;b(h(a),250);g&&g.die();var d;if(d=c)c.stopPropagation(),c.preventDefault(),d=!1;return d}var g,
|
87 |
+
f;h('<button type="button" class="notice-dismiss" href="#"> </a>').prependTo(a).click(e);h(d).triggerHandler("resize");y();f=k.length;k.push(e);c&&(g=l(a,e,c))}function a(a,c,b){var e=n.require("$16","html.js");a=h('<div class="notice notice-'+a+'" loco-notice inline></div>').prependTo(h("#loco-notices"));var d=h(e.el("p"));b=h(e.el("span")).text(b);c=h(e.el("strong","has-icon")).text(c+": ");d.append(c).append(b).appendTo(a);return a}function c(c,b,e,k){c=a(e,b,c).hide().fadeIn(500);h(d).triggerHandler("resize");
|
88 |
+
g(c,k);return f}function e(){h("#loco-notices").find("div.notice").each(function(a,c){g(c,!1)})}var k=[],y=Date.now||function(){return(new Date).getTime()},q,m,r,t;f.error=function(a){return c(a,q,"error")};f.warning=function(a){return c(a,m,"warning")};f.info=function(a){return c(a,r,"info")};f.success=function(a){return c(a,t,"success",5E3)};f.log=function(){d.console&&console.log&&console.log.apply(console,arguments)};f.debug=function(a,c){d.console&&console.error&&(console.error("Loco Error: "+
|
89 |
+
a),c&&console.debug&&console.debug(c))};f.clear=function(){for(var a=-1,c,b=k,e=b.length;++a<e;)(c=b[a])&&c();k=[];return f};f.create=a;f.raise=function(a){var c=f;(c[a.type]||c.error).call(c,a.message)};f.init=function(a){q=a._("Error");m=a._("Warning");r=a._("Notice");t=a._("OK");setTimeout(e,1E3);return f};return f}({},p,w));n.register("$5",function(f,d,p){function l(c,b,d,f){function m(a,b,k){var f=g||{_:function(a){return a}},m=a.responseText,q=h("<pre>"+m+"</pre>").text();q&&(q=q.replace(/(^\s+|\s+$)/g,
|
90 |
+
""));q||(q=m);r.debug("Ajax failure for "+c,{status:a.status,error:b,message:k,output:m});r.log(f._("Provide the following text when reporting a problem")+":\n--8<--\n",q,"\n------");"parsererror"===b?(m=f._("Check console output for debugging information"),(q=q.split(/[\r\n]/)[0])?(q=q.replace(/ +in +\S+ on line \d+/,""),q=q.replace(/^[()! ]+Fatal error:\s*/,""),r.error(q+".\n"+m)):r.error(f._("Server returned invalid data")+". "+m)):r.error(k||f._("Unknown error"));d&&d(a,b,k)}f.url=a;f.dataType=
|
91 |
+
"json";f.error=m;f.success=function(a,c,e){var d=a&&a.data,g=a&&a.notices,f=g&&g.length;for(!d||a.error?m(e,c,a&&a.error&&a.error.message):b&&b(d,c,e);f--;)r.raise(g[f])};var r=n.require("$4","notices.js").clear();return h.ajax(f)}var b={},g,a=d.ajaxurl||"/wp-admin/admin-ajax.php",c=d.encodeURIComponent;f.init=function(a){b=a.nonces||b;return f};f.localise=function(a){g=a;return f};f.submit=function(a,c,b){function d(){g.removeClass("loading");n.require("$17","forms.js").enable(g)}var g=h(a),f=g.serialize();
|
92 |
+
g.addClass("loading");n.require("$17","forms.js").disable(g);return l(a.route.value,function(a,b,e){d();c&&c(a,b,e)},function(a,c,e){d();b&&b(a,c,e)},{type:a.method,data:f})};f.post=function(a,g,f,q){var m;(m=b[a])||(d.console&&console.debug&&console.debug('No nonce for "'+a+'"'),m="");m="action=loco_json&route="+c(a)+"&loco-nonce="+c(m);(g=g?h.param(g):"")&&(m+="&"+g);return l(a,f,q,{type:"post",data:m})};f.setNonce=function(a,c){b[a]=c;return f};return f}({},p,w));n.register("$18",{arab:1,aran:1,
|
93 |
+
hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});n.register("$6",function(f,d,h){function l(){}var b,g,a=n.require("$18","rtl.json");f.init=function(){return new l};f.cast=function(a){return a instanceof l?a:"string"===typeof a?f.parse(a):f.clone(a)};f.clone=function(a){var b,g=new l;for(b in a)g[b]=a[b];return g};f.parse=function(a){b||
|
94 |
+
(g=/[-_+]/,b=/^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?(?:-([0-9][a-z0-9]{3,8}|[a-z0-9]{5,8}))?(?:-([a-z]-[-a-z]+))?$/i);a=String(a).split(g).join("-");if(!b.exec(a))return null;var e=new l;e.lang=RegExp.$1.toLowerCase();if(a=RegExp.$2)e.script=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();if(a=RegExp.$3)e.region=a.toUpperCase();if(a=RegExp.$4)e.variant=a.toLowerCase();if(a=RegExp.$5)e.extension=a;return e};d=l.prototype;d.isValid=function(){return!!this.lang};d.isKnown=function(){var a=
|
95 |
+
this.lang;return!(!a||"zxx"===a)};d.toString=function(a){a=a||"-";var b,g=this.lang||"zxx";if(b=this.script)g+=a+b;if(b=this.region)g+=a+b;if(b=this.variant)g+=a+b;if(b=this.extension)g+=a+b;return g};d.getIcon=function(){for(var a=4,b,g,d=["variant","region","script","lang"],f=[];0!==a--;)if(b=d[a],g=this[b])1===a&&3===g.length?f.push("region-m49"):f=f.concat([b,b+"-"+g.toLowerCase()]);return f.join(" ")};d.isRTL=function(){return!!a[String(this.script||this.lang).toLowerCase()]};d=null;return f}({},
|
96 |
+
p,w));n.register("$32",function(f,d,h){function l(a){d.console&&console.error&&console.error(a)}function b(){l("Method not implemented")}function g(){}function a(a){}g.prototype.toString=function(){return"[Undefined]"};a.prototype._validate=function(a){var e,d,f=!0;for(e in this)d=this[e],d===b?(l(a+"."+e+"() must be implemented"),f=!1):d instanceof g&&(l(a+"."+e+" must be defined"),f=!1);return f};f.init=function(c,e){var d,f=new a;if(c)for(d=c.length;0!==d--;)f[c[d]]=b;if(e)for(d=e.length;0!==d--;)f[e[d]]=
|
97 |
+
new g;return f};f.validate=function(a){var b=/function (\w+)\(/.exec(a.toString())?RegExp.$1:"";a.prototype._validate(b||"Object")};return f}({},p,w));n.register("$40",function(f,d,h){var l=d.requestAnimationFrame,b=d.cancelAnimationFrame,g=0;if(!l||!b)for(var a in{ms:1,moz:1,webkit:1,o:1})if(l=d[a+"RequestAnimationFrame"])if(b=d[a+"CancelAnimationFrame"]||d[a+"CancelRequestAnimationFrame"])break;l&&b||(l=function(a){var b=c();timeToCall=Math.max(0,16-(b-g));nextTime=b+timeToCall;timerId=d.setTimeout(function(){a(nextTime)},
|
98 |
+
timeToCall);g=nextTime;return timerId},b=function(a){clearTimeout(a)});var c=Date.now||function(){return(new Date).getTime()};f.loop=function(a,c){function g(){f=l(g,c);a(d++)}var d=0,f;g();return{stop:function(){f&&b(f);f=null}}};return f}({},p,w));n.register("$37",function(f,d,h){function l(b,c,e,g){if(a){var d=e;e=function(a){if((a.MSPOINTER_TYPE_TOUCH||"touch")===a.pointerType)return d(a)}}b.addEventListener(c,e,g);return{unbind:function(){b.removeEventListener(c,e,g)}}}function b(a){a.preventDefault();
|
99 |
+
a.stopPropagation();return!1}var g,a=!!d.navigator.msPointerEnabled,c=a?"MSPointerDown":"touchstart",e=a?"MSPointerMove":"touchmove",k=a?"MSPointerUp":"touchend";f.ok=function(a){null==g&&(g="function"===typeof h.body.addEventListener);g&&a&&a(f);return g};f.ms=function(){return a};f.dragger=function(a,g){function d(b){a.addEventListener(b,v[b],!1)}function f(b){a.removeEventListener(b,v[b],!1)}var v={};v[c]=function(a){y(a,function(b,e){e.type=c;g(a,e,h)});d(e);d(k);return!0};v[k]=function(a){f(e);
|
100 |
+
f(k);y(a,function(b,c){c.type=k;g(a,c,h)});return!0};v[e]=function(a){y(a,function(b,c){c.type=e;g(a,c,h)});return b(a)};d(c);var h={kill:function(){f(c);f(e);f(k);a=h=g=null}};return h};f.swiper=function(g,d,f){function s(a){g.addEventListener(a,u[a],!1)}function v(a){g.removeEventListener(a,u[a],!1)}function h(){D&&D.stop();D=null}var D,l,p,u={},z=[],B=[],H=[];u[c]=function(a){l=!1;h();var b=q();y(a,function(a,c){z[a]=b;B[a]=c.clientX;H[a]=c.clientY});p=g.scrollLeft;return!0};u[k]=function(a){y(a,
|
101 |
+
function(a,b){var c=q()-z[a],e=B[a]-b.clientX,c=Math.abs(e)/c;d(c,e?0>e?-1:1:0)});p=null;return!0};u[e]=function(a){var c,e;null==p||y(a,function(a,b){c=B[a]-b.clientX;e=H[a]-b.clientY});if(e&&Math.abs(e)>Math.abs(c))return l=!0;c&&(l=!0,g.scrollLeft=Math.max(0,p+c));return b(a)};if(!a||f)s(c),s(e),s(k),a&&(g.className+=" mstouch");return{kill:function(){v(c);v(e);v(k);h()},swiped:function(){return l},ms:function(){return a},snap:function(b){a&&!f&&(g.style["-ms-scroll-snap-points-x"]="snapInterval(0px,"+
|
102 |
+
b+"px)",g.style["-ms-scroll-snap-type"]="mandatory",g.style["-ms-scroll-chaining"]="none")},scroll:function(a,b,c){h();var e=g.scrollLeft,d=a>e?1:-1,f=Math[1===d?"min":"max"],s=Math.round(16*b*d);return D=n.require("$40","fps.js").loop(function(b){b&&(e=Math.max(0,f(a,e+s)),g.scrollLeft=e,a===e&&(h(),c&&c(e)))},g)}}};f.start=function(a,b){return l(a,c,b,!1)};f.move=function(a,b){return l(a,e,b,!1)};f.end=function(a,b){return l(a,k,b,!1)};var y=f.each=function(b,c){if(a)(b.MSPOINTER_TYPE_TOUCH||"touch")===
|
103 |
+
b.pointerType&&c(0,b);else for(var e=-1,g=(b.originalEvent||b).changedTouches||[];++e<g.length;)c(e,g[e])},q=Date.now||function(){return(new Date).getTime()};return f}({},p,w));n.register("$41",function(f,d,n){f.init=function(d){function b(){e.style.top=String(-d.scrollTop)+"px";return!0}function g(){var b=e;b.textContent=d.value;b.innerHTML=b.innerHTML.replace(/[ \t]/g,a).split(/(?:\r\n|\r|\n)/).join('<span class="eol crlf"></span>\r\n')+'<span class="eol eof"></span>';return!0}function a(a,b){return'<span class="x'+
|
104 |
+
a.charCodeAt(0).toString(16)+'">'+a+"</span>"}var c=d.parentNode,e=c.insertBefore(n.createElement("div"),d);h(d).on("input",g).on("scroll",b);h(c).addClass("has-mirror");e.className="ta-mirror";var f=d.offsetWidth-d.clientWidth;2<f&&(e.style.marginRight=String(f-2)+"px");g();b();return{kill:function(){h(d).off("input",g).off("scroll",b);c.removeChild(e);e=null;h(c).removeClass("has-mirror")}}};return f}({},p,w));n.register("$44",function(f,d,h){function l(a,c){for(var e=0,g=-1,f=c&&d[c],h=b[a]||[],
|
105 |
+
m=h.length;++g<m;)callback=h[g],"function"===typeof callback&&(callback(f),e++);return e}var b={},g;f.load=function(a,c,e){function g(){m&&(clearTimeout(m),m=null);r&&(r.onreadystatechange=null,r=r=r.onload=null);a&&(delete b[a],a=null)}function f(b,c){var d=r&&r.readyState;if(c||!d||"loaded"===d||"complete"===d)c||l(a,e),g()}function q(){if(0===l(a))throw Error('Failed to load "'+(e||a)+'"');g()}if(e&&d[e])"function"===typeof c&&c(d[e]);else if(null!=b[a])b[a].push(c);else{b[a]=[c];var m=setTimeout(q,
|
106 |
+
4E3),r=h.createElement("script");r.setAttribute("src",a);r.setAttribute("async","true");r.onreadystatechange=f;r.onload=f;r.onerror=q;r.onabort=g;h.getElementsByTagName("head")[0].appendChild(r)}};f.stat=function(a){var b;if(!(b=g)){for(var e,d,f=h.getElementsByTagName("script"),q=-1,m=f.length;++q<m;)if(b=f[q].getAttribute("src"))if(e=b.indexOf("/static/"),-1!==e){d=b.substr(0,e+7);break}b=g=d||"/static"}return b+a};return f}({},p,w));n.register("$42",function(f,d,p){function l(a,b){a.setReadOnly(!1);
|
107 |
+
a.on("change",function(a,c){return b.val(c.getValue())});a.on("focus",function(a,c){return b.focus()});a.on("blur",function(a,c){return b.blur()})}function b(a){a.off("change");a.off("focus");a.off("blur")}function g(a){b(a);a.setReadOnly(!0);a.setHighlightGutterLine(!1);a.setHighlightActiveLine(!1)}function a(a){function b(){this.$rules={start:[{token:"empty_line",regex:"^$"},{token:"constant.language",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{token:"printf",regex:"%(?:\\d+\\$)?[-+]?(?:'.)?[ 0]*-?\\d*(?:\\.d+)?[bcdeEfFgGosuxX%]"},
|
108 |
+
{token:"printf",regex:"%(?:\\d+\\$)?[-,'+#0 (]*\\d*(?:\\.\\d+|\\.\\*)?[sScCuidoxXfFeEgGaAbBpn%@]"},{defaultToken:"text"}]}}function g(){this.HighlightRules=b}a=a.require;var d=a("ace/lib/oop");d.inherits(b,a("ace/mode/text_highlight_rules").TextHighlightRules);d.inherits(g,a("ace/mode/text").Mode);return new g}f.init=function(c,e){var d,f=!1,q=c.parentNode,m=q.appendChild(p.createElement("div"));n.require("$44","remote.js").load("https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.5/ace.js",function(b){if(m){if(!b)throw Error("Failed to load code editor");
|
109 |
+
d=b.edit(m);var t=d.session,s=d.renderer;d.$blockScrolling=Infinity;d.setShowInvisibles(f);d.setWrapBehavioursEnabled(!1);d.setBehavioursEnabled(!1);d.setHighlightActiveLine(!1);t.setUseSoftTabs(!1);s.setShowGutter(!0);s.setPadding(10);s.setScrollMargin(8);t.setMode(a(b));h(q).addClass("has-proxy has-ace");d.setValue(c.value,-1);t.setUseWrapMode(!0);e?l(d,e):g(d)}},"ace");return{kill:function(){d&&(b(d),d.destroy(),d=null);m&&(q.removeChild(m),h(q).removeClass("has-proxy has-ace"),m=null);return this},
|
110 |
+
disable:function(){d&&g(d);e=null;return this},enable:function(a){e=a;d&&l(d,a);return this},resize:function(){d&&d.resize();return this},val:function(a){d&&d.setValue(a,-1);return this},invs:function(a){a=a||!1;f!==a&&(f=a,d&&d.setShowInvisibles(a));return this}}};return f}({},p,w));n.register("$43",function(f,d,p){function l(b,a){b.on("change",function(c){return a.val(b.getContent())});b.on("focus",function(b){return a.focus()});b.on("blur",function(b){return a.blur()});b.setMode("design")}function b(b){b.off("change");
|
111 |
+
b.off("focus");b.off("blur")}f.load=function(b){var a=n.require("$44","remote.js");a.load(a.stat("/lib/tinymce/tinymce.min.js"),b,"tinymce");return f};f.init=function(d,a){function c(c){e=c;a?l(c,a):(b(c),c.setMode("readonly"))}var e,k=d.parentNode,y=k.appendChild(p.createElement("div"));h(k).addClass("has-proxy has-mce");y.innerHTML=d.value;f.load(function(a){if(!a)throw Error("Failed to load HTML editor");y&&a.init({inline:!0,target:y,hidden_input:!1,theme:"modern",skin:"loco",plugins:"link",browser_spellcheck:!0,
|
112 |
+
toolbar:"formatselect | bold italic link unlink | bullist numlist outdent indent",block_formats:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h4;Heading 4=h4;Heading 5=h5;Heading 6=h6;",forced_root_block:"p",relative_urls:!1,convert_urls:!1,remove_script_host:!1,document_base_url:"",allow_script_urls:!1,formats:{alignleft:{classes:"alignleft"},alignright:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"alignright"},aligncenter:{selector:"p,h1,h2,h3,h4,span,strong,em,a",classes:"aligncenter"},
|
113 |
+
strikethrough:{inline:"del"}},fix_list_elements:!0,entities:"38,amp,60,lt,62,gt",entity_encoding:"raw",keep_styles:!1,setup:c})},"tinymce");return{val:function(a){e&&e.setContent(a);return this},kill:function(){e&&(e.destroy(),b(e),e=null);y&&(k.removeChild(y),h(k).removeClass("has-proxy has-mce"),y=null);return this},enable:function(b){a=b;e.setMode("design");l(e,b);return this},disable:function(){if(e){var c=e;b(c);c.setMode("readonly")}a=null;return this}}};return f}({},p,w));n.register("$38",
|
114 |
+
function(f,d,p){function l(a){function b(){q&&m.off("input",e);q=!1;return!0}function e(){var b=a.value;b!==t&&(m.trigger("changing",[b,t]),t=b)}function d(){g=a;s=t;q||m.on("input",e);q=!0;m.trigger("editFocus");r.addClass("has-focus");return!0}function f(){g===a&&(g=null);m.trigger("editBlur");r.removeClass("has-focus");b();e();s!==t&&m.trigger("changed",[t]);return!0}var q=!1,m=h(a),r=h(a.parentNode),t=a.value,s;m.blur(f).focus(d);return{val:function(b){t!==b&&(a.value=b,m.triggerHandler("input"),
|
115 |
+
t=b);return!0},kill:function(){b();m.off("blur",f).off("focus",d)},fire:function(){t=null;e()},ping:e,blur:f,focus:d}}function b(a){this.e=a}var g;f.init=function(a){var c=new b(a);a.disabled?c.disable():c.enable();return c};TextAreaPrototype=b.prototype;TextAreaPrototype.destroy=function(){this.unlisten();this.e=null};TextAreaPrototype.reload=function(a,b){b?this.l||this.enable():this.l&&this.disable();return this.val(a||"")};TextAreaPrototype.val=function(a){var b=this.e;if(null==a)return b.value;
|
116 |
+
var e=this.p||this.l;e?e.val(a):b.value!==a&&(b.value=a,h(b).triggerHandler("input"));return this};TextAreaPrototype.fire=function(){this.l&&this.l.fire();return this};TextAreaPrototype.focus=function(){return h(this.e).focus()};TextAreaPrototype.focused=function(){return g&&g===this.el};TextAreaPrototype.parent=function(){return this.e.parentNode};TextAreaPrototype.attr=function(a,b){var e=this.e;if(1===arguments.length)return e.getAttribute(a);null==b?e.removeAttribute(a):e.setAttribute(a,b);return this};
|
117 |
+
TextAreaPrototype.editable=function(){return!!this.l};TextAreaPrototype.enable=function(){var a=this.p;this.e.removeAttribute("disabled");this.listen();a&&a.enable&&a.enable(this.l);return this};TextAreaPrototype.disable=function(){var a=this.p;this.e.setAttribute("disabled",!0);this.unlisten();a&&a.disable&&a.disable();return this};TextAreaPrototype.listen=function(){var a=this.l;a&&a.kill();this.l=l(this.e);return this};TextAreaPrototype.unlisten=function(){this.l&&this.l.kill();this.l=null;return this};
|
118 |
+
TextAreaPrototype.setInvs=function(a,b){var e=this.i||!1;if(b||e!==a)this._i&&(this._i.kill(),delete this._i),(e=this.p)?e.invs&&e.invs(a):a&&(this._i=n.require("$41","mirror.js").init(this.e)),this.i=a;return this};TextAreaPrototype.getInvs=function(){return this.i||!1};TextAreaPrototype.setMode=function(a){var b=this.p;a!==(this.m||"")&&(this.m=a,b&&b.kill(),this.p=b="code"===a?n.require("$42","ace.js").init(this.e,this.l):"html"===a?n.require("$43","mce.js").init(this.e,this.l):null,this.setInvs(this.i,
|
119 |
+
!0));return this};TextAreaPrototype.redraw=function(a){var b=this.p;b&&b.resize&&!a&&b.resize()};TextAreaPrototype=null;return f}({},p,w));n.register("$39",function(f,d,n){function l(a){var b=d.console;b&&b.error&&b.error(a)}function b(a){var b=n.createElement("div");a&&b.setAttribute("class",a);return b}function g(a){return function(){a.resize();return this}}function a(a){return function(b){var c=b.target.$r;if(null==c)return!0;a.select(c);b.stopPropagation();b.preventDefault();return!1}}function c(a){return function(){a.redrawDirty()&&
|
120 |
+
a.redraw();return!0}}function e(a){return function(b){var c;c=b.keyCode;if(40===c)c=1;else if(38===c)c=-1;else return!0;if(b.shiftKey||b.ctrlKey||b.metaKey||b.altKey)return!0;a.selectNext(c);b.stopPropagation();b.preventDefault();return!1}}function k(a){this.w=a}function y(a,b,c){var e=n.createElement("div");e.className=c||"";this._=e;this.d=b;this.i=a;this.length=b.length}function q(a){this.live=a;this.rows=[]}f.create=function(a){return new k(a)};var m=k.prototype;m.init=function(d){var f=this.w,
|
121 |
+
s=f.id,k=f.splity(s+"-thead",s+"-tbody"),m=k[0],k=k[1],q=[],l=[];m.css.push("wg-thead");k.css.push("wg-tbody");d.eachCol(function(a,b){q.push(s+"-col"+a);l.push(b)});for(var n=b(),u=-1,z=q.length,B=b("wg-cols"),H=m.splitx.apply(m,q);++u<z;)H[u].header(l[u]),B.appendChild(n.cloneNode(!1));var F=[];d.eachRow(function(a,b,c){F[a]=new y(a,b,c)});d=k.body;this.rows=F;this.cols=B;this.root=d;m.redraw=g(this);m=k.fixed=H[0].bodyY()||20;f.lock().resize(m,k);f.css.push("is-table");f.restyle();this.redrawDirty();
|
122 |
+
this.render();h(d).attr("tabindex","-1").on("keydown",e(this)).on("mousedown",a(this)).on("scroll",c(this));return this};m.clear=function(){for(var a=this.pages||[],b=a.length;0!==b--;)a[b].destroy();this.pages=[];this.sy=this.mx=this.mn=this.vh=null;void 0;return this};m.render=function(){for(var a,b,c=[],e=-1,d=this.rows||[],g=this.f,f=g?!0:!1,k=f?g.length:d.length,h=this.r,z=this._r,m=this.root,y=this.cols;++e<k;)0===e%100&&(b=y.cloneNode(!0),b=new q(b),b.h=2200,b.insert(m),c.push(b)),a=f?g[e]:
|
123 |
+
e,a=d[a],a.page=b,b.rows.push(a);b&&100!==b.size()&&b.sleepH(22);this.pages=c;this.mx=this.mn=null;this.redrawDirty();this.redraw();null==h?null!=z&&(a=d[z])&&a.page&&(delete this._r,this.select(z,!0)):(a=d[h])&&a.page?this.select(h,!0):(this.deselect(),this._r=h);return this};m.resize=function(){var a=-1,b=this.ww||(this.ww=[]),c=this.w,e=c.cells[0],d=e.body.childNodes,g=d.length,f=this.pages||[],k=f.length;for(c.redraw.call(e);++a<g;)b[a]=d[a].style.width;if(k){c=this.mx;for(a=this.mn;a<=c;a++)f[a].widths(b);
|
124 |
+
this.redrawDirty()&&this.redraw()}};m.redrawDirty=function(){var a=!1,b=this.root,c=b.scrollTop,b=b.clientHeight;this.sy!==c&&(a=!0,this.sy=c);this.vh!==b&&(a=!0,this.vh=b);return a};m.redraw=function(){for(var a=0,b=-1,c=null,e=null,d=this.ww,g=this.sy,f=this.vh,k=this.mn,h=this.mx,z=Math.max(0,g-100),g=f+g+100,m=this.pages||[],q=m.length;++b<q&&!(a>g);)f=m[b],a+=f.height(),a<z||(null===c&&(c=b),e=b,f.rendered||f.render(d));if(k!==c){if(null!==k&&c>k)for(b=k;b<c;b++){f=m[b];if(!f)throw Error("Shit!");
|
125 |
+
f.rendered&&f.sleep()}this.mn=c}if(h!==e){if(null!==h&&e<h)for(b=h;b>e;b--)f=m[b],f.rendered&&f.sleep();this.mx=e}};m.selected=function(){return this.r};m.thead=function(){return this.w.cells[0]};m.tbody=function(){return this.w.cells[1]};m.tr=function(a){return(a=this.rows[a])?a.cells():[]};m.td=function(a,b){return this.tr(a)[b]};m.next=function(a,b,c){null==c&&(c=this.r);for(var e,d=this.rows,g=c,f=d.length;c!==(g+=a);)if(0<=g&&f>g){if(e=d[g],e.page)break}else if(b&&f)g=1===a?-1:f,b=!1;else{g=
|
126 |
+
null;break}return g};m.selectNext=function(a,b,c){a=this.next(a,b);null!=a&&this.r!==a&&this.select(a,c);return this};m.deselect=function(a){var b=this.r;null!=b&&(this.r=null,h(this.tr(b)).removeClass("selected"),this.w.fire("wgRowDeselect",[b,a]));return this};m.select=function(a,b){var c=this.rows[a],e=c&&c.page;if(!e)return this.deselect(!1),l("Row is filtered out"),this;this.deselect(!0);var d,g=this.w.cells[1];e.rendered||(d=e.top(),g.scrollY(d),this.redrawDirty()&&this.redraw());if(!c.rendered)return e.rendered||
|
127 |
+
l("Failed to render page"),l("Row ["+a+"] not rendered"),this;e=c.cells();h(e).addClass("selected");this.r=a;b||(d=g.scrollY(),h(this.root).focus(),d!==g.scrollY()&&g.scrollY(d));g.scrollTo(e[0],!0);this.w.fire("wgRowSelect",[a,c.data()]);return this};m.unfilter=function(){this.f&&(this.f=null,this.clear().render());return this};m.filter=function(a){this.f=a;return this.clear().render()};m=null;m=y.prototype;m.render=function(a){var b,c=[],e=this._,d=this.d,g=this.length,f=this.i;if(e){for(;0!==g--;)c[g]=
|
128 |
+
b=e.cloneNode(!1),b.textContent=d[g]||"\u00a0",b.$r=f,a[g].appendChild(b);this._=null;this.c=c}else for(c=this.c;0!==g--;)a[g].appendChild(c[g]);this.rendered=!0;return this};m.cells=function(){return this.c||[]};m.data=function(){return this.d||[]};m.destroy=function(){this.page=null;this.rendered=!1};m=null;m=q.prototype;m.size=function(){return this.rows.length};m.insert=function(a){var c=this.h,e=b("wg-dead");e.style.height=String(c)+"px";a.appendChild(e);return this.dead=e};m.top=function(){return(this.rendered?
|
129 |
+
this.live:this.dead).offsetTop};m.height=function(){var a=this.h;null==a&&(this.h=a=this.rendered?this.live.firstChild.offsetHeight:this.dead.offsetHight);a||l("row has zero height");return a};m.render=function(a){for(var b,c=-1,e=this.rows,d=e.length,g=this.dead,f=this.live,k=f.childNodes;++c<d;)b=e[c],b.rendered||b.render(k);d=a.length;for(c=0;c<d;c++)k[c].style.width=a[c];g.parentNode.replaceChild(f,g);this.rendered=!0;this.h=null;return this};m.sleep=function(){var a=this.height(),b=this.live,
|
130 |
+
c=this.dead;c.style.height=String(a)+"px";b.parentNode.replaceChild(c,b);this.rendered=!1;this.h=a;return this};m.sleepH=function(a){a*=this.rows.length;var b=this.dead;b&&(b.style.height=String(a)+"px");this.rendered||(this.h=a);return this};m.widths=function(a){for(var b=this.live.childNodes,c=a.length;0!==c--;)b[c].style.width=a[c];return this};m.destroy=function(){var a=this.rendered?this.live:this.dead,b=this.rows,c=b.length;for(a.parentNode.removeChild(a);0!==c--;)b[c].destroy()};m=null;return f}({},
|
131 |
+
p,w));n.register("$33",function(f,d,p){function l(a,b){var d=a.id,g=d&&r[d],f=g&&g.parent();if(!g||!f)return null;var k=f.dir===m,d=k?"X":"Y",h="page"+d,k=k?c:e,z=k(f.el),d=b["offset"+d],q=f.el,y=q.className;null==d&&(d=b[h]-k(a));d&&(z+=d);q.className=y+" is-resizing";return{done:function(){q.className=y},move:function(a){f.resize(a[h]-z,g);return!0}}}function b(b,c){function e(){h(p).off("mousemove",d);t&&(t.done(),t=null);return!0}function d(a){t?t.move(a):e();return!0}if(t)return!0;t=l(b.target,
|
132 |
+
b);if(!t)return!0;h(p).one("mouseup",e).on("mousemove",d);return a(b)}function g(a,b){var c=b.type;"touchmove"===c?t&&t.move(b):"touchstart"===c?t=l(a.target,b):"touchend"===c&&t&&(t.done(),t=null)}function a(a){a.stopPropagation();a.preventDefault();return!1}function c(a,b){b||(b=p.body);for(var c=a.offsetLeft||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetLeft||0;return c}function e(a,b){b||(b=p.body);for(var c=a.offsetTop||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetTop||0;return c}function k(a,b){var c=
|
133 |
+
h(b).on("editFocus",function(b){c.trigger("wgFocus",[a])}).on("editBlur",function(a){c.trigger("wgBlur")})}function y(a){var b=this.id=a.id;this.el=a;this.pos=this.index=0;this.css=["wg-cell"];r[b]=this;this.clear()}var q=n.require("$16","html.js"),m=1,r={},t=!1;f.init=function(a){var c=new y(a);c.css.push("wg-root");c.redraw();n.require("$37","touch.js").ok(function(b){b.dragger(a,g)});h(a).mousedown(b);return c};d=y.prototype;d.fire=function(a,b){var c=h.Event(a);c.cell=this;h(this.el).trigger(c,
|
134 |
+
b);return this};d.each=function(a){for(var b=-1,c=this.cells,e=c.length;++b<e;)a(c[b],b);return this};d.on=function(){return this.$("on",arguments)};d.off=function(){return this.$("off",arguments)};d.find=function(a){return h(this.el).find(a)};d.$=function(a,b){h.fn[a].apply(h(this.el),b);return this};d.parent=function(){return this.pid&&r[this.pid]};d.splitx=function(){return this._split(m,arguments)};d.splity=function(){return this._split(2,arguments)};d._split=function(a,b){(this.length||this.field)&&
|
135 |
+
this.clear();for(var c=-1,e,d=b.length,g=1/d,f=0;++c<d;){e=q.el();this.body.appendChild(e);for(var k=e,h=b[c],m=h,l=1;r[h];)h=m+"-"+ ++l;k.id=h;e=new y(e);e.index=c;e.pid=this.id;e.pos=f;f+=g;this.cells.push(e);this.length++}this.dir=a;this.redraw();return this.cells};d.destroy=function(){this.clear();delete r[this.id];var a=this.el;a.innerHTML="";h(a).off();return this};d.exists=function(){return this===r[this.id]};d.clear=function(){for(var a=this.el,b=this.cells,c=this.field,e=this.body,d=this.nav,
|
136 |
+
g=this.length||0;0!==g--;)delete r[b[g].destroy().id];this.cells=[];this.length=0;d&&(a.removeChild(d),this.nav=null);e&&(c&&(q.ie()&&h(e).triggerHandler("blur"),c.destroy(),this.field=null),this.table&&(this.table=null),a.removeChild(e));this.body=a.appendChild(q.el("","wg-body"));return this};d.resize=function(a,b){if(!b&&(b=this.cells[1],!b))return;var c=b.index,e=this.cells;this.parent();var d=h(this.el)[this.dir===m?"width":"height"](),g=e[c+1],c=e[c-1];pad=(b.body||b.el.firstChild).offsetTop||
|
137 |
+
0;max=(g?g.pos*d:d)-pad;min=c?c.pos*d:0;b.pos=Math.min(max,Math.max(min,a))/d;this.redraw();return this};d.distribute=function(a){for(var b,c=0,e=this.cells,d=a.length;c<d;)b=a[c],e[++c].pos=Math.max(0,Math.min(1,b));this.redraw();return this};d.distribution=function(){for(var a=[],b=0,c=this.cells,e=c.length-1;b<e;)a[b]=c[++b].pos;return a};d.restyle=function(){var a=this.css.concat();0===this.index?a.push("first"):a.push("not-first");this.dir&&(a.push("wg-split"),2===this.dir?a.push("wg-split-y"):
|
138 |
+
a.push("wg-split-x"));this.t&&a.push("has-title");this.nav&&a.push("has-nav");this.field&&(a.push("is-field"),this.field.editable()?a.push("is-editable"):a.push("is-readonly"));a=a.join(" ");a!==this._css&&(this._css=this.el.className=a);return this};d.redraw=function(a){this.restyle();var b=this.el,c=this.body,e=this.field;if(c){var d=b.clientHeight||0,g=c.offsetTop||0;g<d&&(d-=g);c.style.height=String(d)+"px";e&&e.redraw(a)}for(var c=this.length,g=1,f=this.nav,k=2===this.dir?"height":"width";0!==
|
139 |
+
c--;)e=this.cells[c],f?d=1:(e.fixed&&(e.pos=e.fixed/h(b)[k]()),d=g-e.pos,g=e.pos),e.el.style[k]=String(100*d)+"%",e.redraw(a);return this};d.contents=function(a){var b=this.el,c=this.body;if(null==a)return c.innerHTML;this.length?this.clear():c&&(b.removeChild(c),c=null);c||(this.body=c=b.appendChild(q.el("","wg-content")),(b=this.lang)&&this._locale(b,this.rtl,!0));"string"===typeof a?h(c)._html(a):a&&this.append(a);this.redraw();return this};d.textarea=function(a,b){var c=this.field;if(c){var e=
|
140 |
+
c.editable();c.reload(a,b);e!==b&&this.restyle()}else this.length&&this.clear(),e=q.el("textarea","wg-field"),e.setAttribute("wrap","virtual"),e.disabled=!b,e.value=a,e.name=this.id,this.contents(e),c=n.require("$38","field.js").init(e),k(this,e),this.field=c,this.restyle();this.lang||this.locale("en");return c};d.locale=function(a){a=n.require("$6","locale.js").cast(a);return this._locale(String(a),a.isRTL())};d._locale=function(a,b,c){var e=this.body;if(c||a!==this.lang)this.lang=a,e&&e.setAttribute("lang",
|
141 |
+
a);if(c||b!==this.rtl)this.rtl=b,e&&e.setAttribute("dir",b?"RTL":"LTR");return this};d.editable=function(){var a=this.field;if(!a||!a.editable())for(var b=-1,c=this.length;++b<c&&!(a=this.cells[b].editable()););return a};d.eachTextarea=function(a){var b=this.field;b?a(b):this.each(function(b){b.eachTextarea(a)});return this};d.append=function(a){a&&(a.nodeType?q.init(this.body.appendChild(a)):q.init(h(a).appendTo(this.body)));return this};d.prepend=function(a){var b=this.body;if(a.nodeType){var c=
|
142 |
+
b.firstChild;q.init(c?b.insertBefore(a,c):b.appendChild(a))}else q.init(h(a).prependTo(b));return this};d.header=function(a,b){if(null==a&&null==b)return this.el.getElementsByTagName("h2")[0];var c=["wg-title"];b&&c.push(b);this.t=q.txt(a||"");this.el.insertBefore(q.el("h2",c.join(" ")),this.body).appendChild(this.t);this.redraw();return this};d.title=function(a){var b=this.t;if(b)return b.nodeValue=a||"",b;this.header(a);return this.t};d.titled=function(){var a=this.t;return a&&a.nodeValue};d.bodyY=
|
143 |
+
function(){return e(this.body,this.el)};d.scrollY=function(a){if(U===a)return this.body.scrollTop;this.body.scrollTop=a};d.tabulate=function(a){return this.table=n.require("$39","wgtable.js").create(this).init(a)};d.lock=function(){this.body.className+=" locked";return this};d.scrollTo=function(a,b){var c,d=this.body;c=d.scrollTop;var g=e(a,d);if(c>g)c=g;else{var f=d.clientHeight,g=g+h(a).outerHeight();if(f+c<g)c=g-f;else return}b?d.scrollTop=c:h(d).stop(!0).animate({scrollTop:c},250)};d.navigize=
|
144 |
+
function(b,c){function e(a){var b=g[a],c=z[a],d=h(b.el).show();c.addClass("active");k=a;m.data("idx",a);b.fire("wgTabSelect",[a]);return d}var d=this,g=d.cells,f=d.nav,k,z=[];f&&d.el.removeChild(f);var f=d.nav=d.el.insertBefore(q.el("nav","wg-tabs"),d.body),m=h(f).on("click",function(b){var c=h(b.target).data("idx");if(null==c)return!0;if(null!=k){var f=z[k];h(g[k].el).hide();f.removeClass("active")}e(c);d.redraw();return a(b)});null==c&&(c=m.data("idx")||0);d.each(function(a,c){z[c]=h('<a href="#'+
|
145 |
+
a.id+'"></a>').data("idx",c).text(b[c]).appendTo(m);a.pos=0;h(a.el).hide()});e(g[c]?c:0);d.lock();d.redraw();return d};d.navigated=function(){var a=this.nav;if(a)return h(a).data("idx")};d=null;return f}({},p,w));n.register("$24",function(f,d,h){function l(b){this.reIndex([]);if(b)for(var d in b)this.add(d,b[d])}f.init=function(b){return new l(b)};d=l.prototype;d.reIndex=function(b){for(var d={},a=-1,c=b.length;++a<c;)d[b[a]]=a;this.keys=b;this.length=a;this.ords=d};d.key=function(b,d){if(null==d)return this.keys[b];
|
146 |
+
var a=this.keys[b],c=this.ords[d];if(d!==a){if(null!=c)throw Error("Clash with item at ["+c+"]");this.keys[b]=d;delete this.ords[a];this.ords[d]=b}return b};d.indexOf=function(b){b=this.ords[b];return null==b?-1:b};d.add=function(b,d){var a=this.ords[b];null==a&&(this.keys[this.length]=b,a=this.ords[b]=this.length++);this[a]=d;return a};d.get=function(b){return this[this.ords[b]]};d.has=function(b){return null!=this.ords[b]};d.del=function(b){this.cut(this.ords[b],1)};d.cut=function(b,d){d=d||1;var a=
|
147 |
+
[].splice.call(this,b,d);this.keys.splice(b,d);this.reIndex(this.keys);return a};d.each=function(b){for(var d=-1,a=this.keys,c=this.length;++d<c;)b(a[d],this[d],d);return this};d.sort=function(b){for(var d=-1,a=this.length,c,e=this.keys,f=this.ords,h=[];++d<a;)h[d]=[this[d],e[d]];h.sort(function(a,c){return b(a[0],c[0])});for(d=0;d<a;d++)c=h[d],this[d]=c[0],c=c[1],e[d]=c,f[c]=d;return this};d=null;return f}({},p,w));n.register("$23",function(f,d,p){function l(a){var b=[];a&&(a.saved()||b.push("po-unsaved"),
|
148 |
+
a.fuzzy()?b.push("po-fuzzy"):a.flagged()&&(b.push("po-flagged"),b.push("po-flag-"+a.flags().join(" po-flag-"))),a.translation()||b.push("po-empty"),a.comment()&&b.push("po-comment"));return b.join(" ")}function b(a,b,c){b=h(a.title(b).parentNode);var e=b.find("span.lang");c?(c=n.require("$6","locale.js").cast(c),e.length||(e=h("<span></span>").prependTo(b)),e.attr("lang",c.lang).attr("class",c.getIcon()||"lang region region-"+(c.region||"zz").toLowerCase())):(e.remove(),c="en");a.locale(c);return b}
|
149 |
+
function g(){this.dirty=0}var a="poUpdate",c="changing",e="changed",k=0,y=1,q=2,m=3,r=4,t=5,s=/^[ \t\n\r]/,v,A,w=n.require("$3","string.js").sprintf,E=n.require("$16","html.js");f.extend=function(a){return a.prototype=new g};f.localise=function(a){A=a;return f};var C=function(){var a=p.createElement("p");return function(b){a.innerHTML=b;return a.textContent}}(),u=g.prototype=n.require("$32","abstract.js").init(["getListColumns","getListHeadings","getListEntry"],["editable","t"]);u.init=function(){this.localise();
|
150 |
+
this.editable={source:!0,target:!0};this.ide=this._ide="";return this};u.localise=function(a){a||(a=A||n.require("$1","t.js").init());var b=[];b[k]=a._x("Source text","Editor")+":";b[m]=a._x("%s translation","Editor")+":";b[r]=a._x("Context","Editor")+":";b[t]=a._x("Comments","Editor")+":";b[y]=a._x("Single","Editor")+":";b[q]=a._x("Plural","Editor")+":";this.labels=b;this.t=a;return this};u.setRootCell=function(a){function b(a){c.redraw(!0,a);return!0}var c=n.require("$33","wingrid.js").init(a);
|
151 |
+
h(d).on("resize",b);this.redraw=b;h(a).on("wgFocus wgBlur",function(a,b){v=b});this.destroy=function(){c.destroy();h(d).off("resize",b)};this.rootDiv=a;return c};g.prototype.$=function(){return h(this.rootDiv)};u.on=function(a,b){return h(this.rootDiv).on(a,b)};u.setListCell=function(a){var b=this;b.listCell=a;a.on("wgRowSelect",function(a,c){b.loadMessage(b.po.row(c));return!0}).on("wgRowDeselect",function(a,c,e){e||b.loadNothing();return!0})};u.setSourceCell=function(a){this.sourceCell=a;var b=
|
152 |
+
a.find("p.notes");b.length||(b=h('<p class="notes"></p>').insertAfter(a.header()).hide());this.notesPara=b};u.setTargetCell=function(a){this.targetCell=a};u.next=function(a,b,c){for(var e=this.listTable,d=e.selected(),f=d,g,k=this.po;null!=(d=e.next(a,c,d));){if(f===d){d=null;break}if(b&&(g=k.row(d),g.translated(0)))continue;break}null!=d&&e.select(d,!0);return d};u.current=function(a){var b=this.active;if("undefined"===typeof a)return b;a?a.is(b)?this.pasteMessage(a):this.loadMessage(a):this.unloadActive();
|
153 |
+
return this};u.getTargetEditable=function(){return this.editable.target&&this.targetCell&&this.targetCell.editable()};u.getSourceEditable=function(){return this.editable.source&&this.sourceCell&&this.sourceCell.editable()};u.getContextEditable=function(){return this.editable.context&&this.contextCell&&this.contextCell.editable()};u.getFirstEditable=function(){return this.getTargetEditable()||this.getSourceEditable()||this.getContextEditable()};u.searchable=function(a){a&&(this.dict=a,this.po&&this.rebuildSearch());
|
154 |
+
return this.dict&&!0};u.rebuildSearch=function(){var a=-1,b=this.po.rows,c=b.length,e=this.dict;for(e.clear();++a<c;)e.add(a,b[a].toText());this.lastSearch="";this.lastFound=c};u.filtered=function(){return this.lastSearch||""};u.filter=function(a,b){var c,e=this.listTable,d=this.lastFound,f=this.lastSearch;if(a){if(f===a)return d||0;if(f&&!d&&0===a.indexOf(f))return 0;c=this.dict.find(a)}f=this.lastSearch=a;d=this.lastFound=c?c.length:this.po.length;c?e.filter(c):e.unfilter();b||this.fire("poFilter",
|
155 |
+
[f,d]);return d};u.unsave=function(a,b){var c=!1;if(a=a||self.active){if(c=a.saved(b))this.dirty++,a.unsave(b),this.fire("poUnsaved",[a,b]);this.markUnsaved(a)}return c};u.markUnsaved=function(a){var b=this.po.indexOf(a),b=this.listTable.tr(b),c=b[0].className;changedStyle=c.replace(/(?:^| +)po-[a-z]+/g,"")+" "+l(a);changedStyle!==c&&h(b).attr("class",changedStyle)};u.save=function(a){var b=this.po;if(this.dirty||a)b.each(function(a,b){b.save()}),this.listCell.find("div.po-unsaved").removeClass("po-unsaved"),
|
156 |
+
this.dirty=0,this.fire("poSave");return b};u.fire=function(a,b){var c=this.on;if(c&&c[a]&&(c=c[a].apply(this,b||[]),!1===c))return!1;c=h.Event(a);h(this.rootDiv).trigger(c,b);return!c.isDefaultPrevented()};u.reload=function(){var a=this,b,c=a.listCell,e=a.listTable,d=a.po,f=d&&d.locale(),g=f&&f.isRTL(),k=d&&d.length||0;if(d&&d.row)return a.lastSearch&&(a.lastSearch="",a.lastFound=k,a.fire("poFilter",[a.lastSearch,a.lastFound])),e&&(b=e.thead().distribution()),e=a.listTable=c.tabulate({length:k,getRow:function(b){return a.getListEntry(d.row(b))},
|
157 |
+
getCss:function(b){return a.getListEntry(d.row(b))},eachCol:function(b){for(var c=-1,e=a.getListHeadings(),d=e.length;++c<d;)b(c,e[c])},eachRow:function(b){var c=0;d.each(function(e,d){b(c++,a.getListEntry(d),l(d))})}}),b&&e.thead().distribute(b),e.tbody().$(g?"addClass":"removeClass",["is-rtl"]),a.targetLocale=f,a.fire("poLoad"),!!d.length;c&&c.clear().header("Error").contents("Invalid messages list")};u.load=function(a,b){this.po=a;this.dict&&this.rebuildSearch();this.reload()&&(-1!==b?this.listTable.select(b||
|
158 |
+
0):this.active&&this.unloadActive())};u.pasteMessage=function(a){var b,c=0;if(b=this.sourceCell)b.eachTextarea(function(b){b.val(a.source(null,c++))}),this.updateListCell(a,"source");(b=this.contextCell)&&b.eachTextarea(function(b){b.val(a.context())});if(b=this.targetCell)c=0,b.eachTextarea(function(b){b.val(a.translation(c++))}),this.updateListCell(a,"target");return this};u.loadMessage=function(d){function f(g){var h,m=g,l=g.id,m=!1;h=L[k];g.off();O&&(R?(R=E.h(R,!0),O.html(R).show(),E.init(O),
|
159 |
+
m=!0):O.text()&&(m=!0,O.text("").hide()));g.titled()!==h&&b(g,h,p.sourceLocale||"en");m&&g.clear();S?(h=g.splity(l+"-singular",l+"-plural"),m=h[0],h=h[1],m.header(L[y]).textarea(Y,T).setMode(u).setInvs(A),h.header(L[q]).textarea(S,T).setMode(u).setInvs(A),g.lock()):g.textarea(Y,T).setMode(u).setInvs(A);T&&g.on(c,function(a,b){S&&a.target.name===l+"-plural"?d.plural(b):(d.source(b),p.updateListCell(d,"source"));p.unsave(d,N)}).on(e,function(b){S&&b.target.name===l+"-plural"||p.po.reIndex(d);p.dict&&
|
160 |
+
p.rebuildSearch();p.fire(a,[d])})}function g(f,k,h){f.off();var q=k.isKnown()&&k.label||"Target",q=w(L[m],q);f.titled()!==q&&b(f,q,k);if(d.pluralized()){var y=[],l=k.plurals||["One","Other"],r=n.require("$24","collection.js").init();for(d.each(function(a,b,c){if(c||l[a])y.push(l[a]||"Form "+a),r.add("plural-"+a,c)});(q=y.length)<k.nplurals;)y.push(l[q]||"Form "+r.length),r.add("plural-"+q,d.translation(q));children=f.splitx.apply(f,r.keys);f.each(function(a,b){var c=K&&!d.disabled(b);a.textarea(r[b],
|
161 |
+
c).setMode(u).setInvs(A)});f.navigize(y,h||null).on("wgTabSelect",function(a,b){var c=K&&a.cell.editable();c&&c.focus();h=b;p.fire("poTab",[b])})}else h=0,K=K&&!d.disabled(0),f.textarea(d.translation(),K).setMode(u).setInvs(A);K&&f.on(c,function(a,b,c){d.translate(b,h);0===h&&p.updateListCell(d,"target");d.fuzzy(h)?p.fuzzy(!1,d,h):p.unsave(d,h);""===b?p.fire("poEmpty",[!0,d,h]):""===c&&p.fire("poEmpty",[!1,d,h])}).on(e,function(b){p.dict&&p.rebuildSearch();p.fire(a,[d])})}function l(f){f.off();b(f,
|
162 |
+
L[r]);f.textarea(d.context(),!0).setMode(u).setInvs(A);U&&f.on(c,function(a,b){d.context(b);p.updateListCell(d,"source");p.unsave(d,N)}).on(e,function(){p.po.reIndex(d);p.dict&&p.rebuildSearch();p.fire(a,[d])})}function s(a){var e=L[t];a.titled()!==e&&b(a,e);a.off().on(c,function(a,b){d.comment(b);p.fire("poComment",[d,b]);p.unsave(d,N)}).textarea(d.comment(),!0)}var p=this,u=p.ide||"",A=p.inv||!1,C=this.fmt||null,G=d.format()||null,M=d.is(p.active),N=0,J=p.sourceCell,W=p.targetCell,Q=p.contextCell,
|
163 |
+
X=p.commentCell,O=p.notesPara,K=p.editable.target,T=p.editable.source,U=p.editable.context,Y=d.source()||"",S=d.plural()||"",R=d.notes(),P=v,Z=p.targetLocale,L=p.labels;p.active=d;J&&f(J);Q&&l(Q);W&&Z&&(N=W.navigated()||0,g(W,Z,N));X&&s(X);P&&(P.exists()||(P=P.parent()),(J=P.editable())&&J.focus());C!==G&&(J=h(p.rootDiv),G&&J.addClass(G+"-format"),C&&J.removeClass(C+"-format"),this.fmt=G);M||p.fire("poSelected",[d])};u.unloadActive=function(){var a;(a=this.notesPara)&&a.text("").hide();(a=this.sourceCell)&&
|
164 |
+
a.off().clear();(a=this.contextCell)&&a.off().clear();(a=this.targetCell)&&a.off().clear();(a=this.commentCell)&&a.off();this.active&&(this.fire("poDeselected",[this.active]),this.active=null);return this};u.loadNothing=function(){var a,b=this.t,c=this.ide||"",e=this.inv||!1;this.unloadActive();(a=this.commentCell)&&a.textarea("",!1);if(a=this.sourceCell)a.textarea("",!1).setMode(c).setInvs(e),a.title(b._x("Source text not loaded","Editor")+":");if(a=this.contextCell)a.textarea("",!1).setMode(c).setInvs(e),
|
165 |
+
a.title(b._x("Context not loaded","Editor")+":");if(a=this.targetCell)a.textarea("",!1).setMode(c).setInvs(e),a.title(b._x("Translation not loaded","Editor")+":");this.fire("poSelected",[null])};u.updateListCell=function(a,b){var c=this.getListColumns()[b],e=this.getListEntry(a)[c||0],d=this.po.indexOf(a);if(c=this.listTable.td(d,c))c.textContent=e};u.cellText=function(a){if(-1!==a.indexOf("<")||-1!==a.indexOf("&"))a=C(a);""===a?a="\u00a0":s.test(a)&&(a="\u00a0"+a);return a};u.fuzzy=function(b,c,
|
166 |
+
e){if(!c){c=this.active;if(!c)return null;null==e&&(e=this.targetCell&&this.targetCell.navigated()||0)}var d=c.fuzzy(e);null==b||d==b||b&&!c.translated(e)||!this.fire("poFuzzy",[c,b,e])||(c.fuzzy(e,b),this.fire(a,[c])&&this.unsave(c,e));return d};u.add=function(b,c){var e,d=this.po.get(b,c);d?e=this.po.indexOf(d):(e=this.po.length,d=this.po.add(b,c),this.load(this.po,-1),this.fire("poAdd",[d]),this.fire(a,[d]));this.lastSearch&&this.filter("");this.listTable.select(e);return d};u.del=function(b){if(b=
|
167 |
+
b||this.active){var c=this.lastSearch,e=this.po.del(b);null!=e&&(this.unsave(b),this.fire("poDel",[b]),this.fire(a,[b]),this.reload(),this.dict&&this.rebuildSearch(),this.active&&this.active.equals(b)&&this.unloadActive(),this.po.length&&(c&&this.filter(c),this.active||(e=Math.min(e,this.po.length-1),this.listTable.select(e))))}};u.setMode=function(a){var b=a?"code":this._ide;this.ide!==b&&(this.ide=b,this.callTextareas(function(a){a.setMode(b)}));return this};u.getMode=function(){return"code"===
|
168 |
+
this.ide};u.setInvs=function(a){(this.inv||!1)!==a&&(this.inv=a,this.callTextareas(function(b){b.setInvs(a)}),this.fire("poInvs",[a]));return this};u.getInvs=function(){return this.inv||!1};u.callTextareas=function(a){var b=this.targetCell;b&&b.eachTextarea(a);(b=this.contextCell)&&b.eachTextarea(a);(b=this.sourceCell)&&b.eachTextarea(a);return this};u=null;return f}({},p,w));n.register("$11",function(f,d,h){function l(){this.init()._validate();this.sourceLocale={lang:"en",label:"English",plurals:["One",
|
169 |
+
"Other"]}}d=n.require("$23","base.js");f.init=function(b){var d=new l;b=d.setRootCell(b);var a=b.splity("po-list","po-edit"),c=a[0],e=a[1],a=e.splitx("po-trans","po-comment"),f=a[0],h=a[1].header("Loading.."),a=f.splity("po-source","po-target"),f=a[0].header("Loading.."),a=a[1].header("Loading..");b.distribute([0.34]);e.distribute([0.8]);d.setListCell(c);d.setSourceCell(f);d.setTargetCell(a);d.commentCell=h;d.editable.source=!1;return d};d=l.prototype=d.extend(l);d.getListHeadings=function(){var b=
|
170 |
+
this.t||{_x:function(b){return b}};return[b._x("Source text","Editor"),b._x("Translation","Editor")]};d.getListColumns=function(){return{source:0,target:1}};d.getListEntry=function(b){if(!b)return["",""];var d=this.cellText,a=[d(b.id||b.source()||""),d(b.translation()||"")];if(b=b.context())a[0]+=" [ "+d(b)+" ]";return a};d.stats=function(){var b=this.po.length,d=0,a=0,c=0;this.po.each(function(b,f){f.translation()?f.fuzzy()?c++:d++:a++});return{t:b,p:String(d?Math.round(100*(d/b)):0)+"%",f:c,u:a}};
|
171 |
+
d.unlock=function(){this._unlocked||(this._unlocked=this.targetLocale,delete this.targetLocale,this.po&&this.po.unlock(),this.editable={source:!0,context:!0,target:!1},this.contextCell=this.targetCell,delete this.targetCell,this.fire("poLock",[!1]),this.active&&this.loadMessage(this.active))};d.lock=function(){var b;this._unlocked&&(b=this.targetLocale=this._unlocked,delete this._unlocked,this.po&&this.po.lock(b),this.editable={source:!1,context:!1,target:!0},this.targetCell=this.contextCell,delete this.contextCell,
|
172 |
+
this.fire("poLock",[!0,b]),this.active&&this.loadMessage(this.active))};d.locked=function(){return!this._unlocked};return f}({},p,w));n.register("$12",function(f,d,n){var l={copy:66,clear:75,save:83,fuzzy:85,next:40,prev:38,enter:13,invis:73},b={38:!0,40:!0,73:!0},g={66:function(a,b){var e=b.current();e&&(e.normalize(),b.pasteMessage(e))},75:function(a,b){var e=b.current();e&&(e.untranslate(),b.pasteMessage(e))},85:function(a,b){b.fuzzy(!b.fuzzy())},13:function(a,b){b.getFirstEditable()&&b.next(1,
|
173 |
+
!0,!0)},40:function(a,b){var e=a.shiftKey;b.next(1,e,e)},38:function(a,b){var e=a.shiftKey;b.next(-1,e,e)},73:function(a,b){if(!a.shiftKey)return!1;b.setInvs(!b.getInvs())}};f.init=function(a,c){function e(c){if(c.isPropagationStopped()||!c.metaKey&&!c.ctrlKey)return!0;var e=c.which;if(!f[e])return!0;var d=g[e];if(!d)throw Error("No such command");if(c.altKey||c.shiftKey&&!b[e]||!1===d(c,a))return!0;c.preventDefault();return!1}var f={};h(c||d).on("keydown",e);return{add:function(a,b){g[l[a]]=b;return this},
|
174 |
+
enable:function(){var a,b;for(b in arguments)a=l[arguments[b]],f[a]=!0;return this},disable:function(){h(c||d).off("keydown",e);a=c=f=null}}};return f}({},p,w));n.register("$25",function(f,d,h){function l(b,d){var a=RegExp("^.{0,"+(b-1)+"}["+d+"]"),c=RegExp("^[^"+d+"]+");return function(e,d){for(var f=e.length,g;f>b;){g=a.exec(e)||c.exec(e);if(null==g)break;g=g[0];d.push(g);g=g.length;f-=g;e=e.substr(g)}0!==f&&d.push(e);return d}}f.create=function(b){function d(a){return q[a]||"\\"+a}var a,c,e=/(?:\r\n|[\r\n\v\f\u2028\u2029])/g,
|
175 |
+
f=/[ \r\n]+/g,h=/[\t\v\f\x07\x08\\\"]/g,q={"\t":"\\t","\v":"\\v","\f":"\\f","\u0007":"\\a","\b":"\\b"};null==b&&(b=79);0!==b&&(a=l(b-3," "),c=l(b-2,"-\u2013 \\.,:;\\?!\\)\\]\\}\\>"));return{pair:function(a,f){if(!f)return a+' ""';f=f.replace(h,d);var k=0;f=f.replace(e,function(){k++;return"\\n\n"});if(!(k||b&&b<f.length+a.length+3))return a+' "'+f+'"';var q=[a+' "'],l=f.split("\n");if(c)for(var n=-1,p=l.length;++n<p;)c(l[n],q);else q=q.concat(l);return q.join('"\n"')+'"'},prefix:function(a,b){var c=
|
176 |
+
a.split(e);return b+c.join("\n"+b)},refs:function(b){b=b.replace(f," ",b);a&&(b=a(b,[]).join("\n#: "));return"#: "+b}}};return f}({},p,w));n.register("$26",function(f,d,h){function l(){}f.extend=function(b){return b.prototype=new l};d=l.prototype=n.require("$32","abstract.js").init(["add","load"]);d.row=function(b){return this.rows[b]};d.lock=function(b){return this.locale(b||{lang:"zxx",label:"Unknown",nplurals:1,pluraleq:"n!=1"})};d.unlock=function(){var b=this.loc;this.loc=null;return b};d.locale=
|
177 |
+
function(b){var d=n.require("$6","locale.js");null==b?b=this.loc:this.loc=b=d.cast(b);return b};d.each=function(b){this.rows.each(b);return this};d.indexOf=function(b){"object"!==typeof b&&(b=this.get(b));if(!b)return-1;null==b.idx&&(b.idx=this.rows.indexOf(b.hash()));return b.idx};d.get=function(b){return this.rows&&this.rows.get(b)};d.del=function(b){b=this.indexOf(b);if(-1!==b){var d=this.rows.cut(b,1);if(d&&d.length)return this.length=this.rows.length,this.rows.each(function(a,b,e){b.idx=e}),
|
178 |
+
b}};d.reIndex=function(b,d){var a=this.indexOf(b),c=b.hash(),e=this.rows.indexOf(c);return e===a?a:-1!==e?(d=(d||0)+1,b.source("Error, duplicate "+String(d)+": "+b.source()),this.reIndex(b,d)):this.rows.key(a,c)};d=null;return f}({},p,w));n.register("$27",function(f,d,h){function l(){this.id=this._id=this.ref=this.cmt=this.xcmt=""}f.extend=function(b){return b.prototype=new l};d=l.prototype;d.flag=function(b,d){var a=this.flg||(this.flg=[]);if(null!=d)a[d]=b;else for(var c=Math.max(a.length,this.src.length,
|
179 |
+
this.msg.length);0!==c--;)a[c]=b;return this};d.flagged=function(b){var d=this.flg||[];if(null!=b)return d[b]||0;for(b=d.length;0!==b--;)if(d[b])return!0;return!1};d.flags=function(){for(var b,d={},a=[],c=this.flg||[],e=c.length;0!==e--;)b=c[e],d[b]||(d[b]=!0,a.push(b));return a};d.flaggedAs=function(b,d){var a=this.flg||[];if(null!=d)return b===a[d]||0;for(var c=a.length;0!==c--;)if(a[c]===b)return!0;return!1};d.fuzzy=function(b,d){var a=this.flaggedAs(4,b);null!=d&&this.flag(d?4:0,b);return a};
|
180 |
+
d.source=function(b,d){if(null==b)return this.src[d||0]||"";this.src[d||0]=b;return this};d.plural=function(b,d){if(null==b)return this.src[d||1]||"";this.src[d||1]=b||"";return this};d.each=function(b){for(var d=-1,a=this.src,c=this.msg,e=Math.max(a.length,c.length);++d<e;)b(d,a[d],c[d]);return this};d.pluralized=function(){return 1<this.src.length||1<this.msg.length};d.translate=function(b,d){this.msg[d||0]=b||"";return this};d.untranslate=function(b){null!=b&&(this.msg[b]="");for(b=0;b<this.msg.length;b++)this.msg[b]=
|
181 |
+
"";return this};d.translation=function(b){return this.msg[b||0]||""};d.translated=function(b){if(null!=b)return!!this.translation(b);var d=this.msg.length;for(b=0;b<d;b++)if(!this.msg[b])return!1;return!0};d.comment=function(b){if(null==b)return this.cmt;this.cmt=b||"";return this};d.notes=function(b){if(null==b)return this.xcmt;this.xcmt=b||"";return this};d.refs=function(b){if(null==b)return this.ref;this.ref=b||"";return this};d.format=function(b){if(null==b)return this.fmt;this.fmt=b;return this};
|
182 |
+
d.context=function(b){if(null==b)return this.ctx||"";this.ctx=b||"";return this};d.toString=d.toText=function(){return this.src.concat(this.msg,[this.id,this.ctx]).join(" ")};d.weight=function(){var b=0;this.translation()||(b+=2);this.fuzzy()&&(b+=1);return b};d.equals=function(b){return this===b||this.hash()===b.hash()};d.hash=function(){return this.id};d.normalize=function(){for(var b=this.msg.length;0!==b--;)this.msg[b]=this.src[b]||""};d.disabled=function(b){return!!(this.lck||[])[b||0]};d.disable=
|
183 |
+
function(b){(this.lck||(this.lck=[]))[b||0]=!0;return this};d.saved=function(b){var d=this.drt;if(!d)return!0;if(null!=b)return!d[b];for(b=d.length;0!==b--;)if(d[b])return!1;return!0};d.unsave=function(b){(this.drt||(this.drt=[]))[b||0]=!0;return this};d.save=function(b){var d=this.drt;null==b?this.drt=null:d[b]=!1;return this};d.is=function(b){return b&&(b===this||b.idx===this.idx)};d=null;return f}({},p,w));n.register("$13",function(f,d,h){function l(a){return{"Project-Id-Version":"PACKAGE VERSION",
|
184 |
+
"Report-Msgid-Bugs-To":"","POT-Creation-Date":a||"","PO-Revision-Date":a||"","Last-Translator":"","Language-Team":"",Language:"","Plural-Forms":"","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit"}}function b(a,b){var c=a||"";b&&(c+="\x00"+b);return c}function g(){return n.require("$24","collection.js").init()}function a(a){this.locale(a);this.length=0;this.rows=g();this.head=l(this.now())}function c(a,b){this.src=[a||""];this.msg=[b||""]}f.create=
|
185 |
+
function(b){return new a(b)};d=n.require("$26","messages.js").extend(a);d.now=function(){function a(b,c){for(var d=String(b);d.length<c;)d="0"+d;return d}var b=new Date,c=b.getUTCFullYear(),d=b.getUTCMonth()+1,f=b.getUTCDate(),g=b.getUTCHours(),b=b.getUTCMinutes();return a(c,4)+"-"+a(d,2)+"-"+a(f,2)+" "+a(g,2)+":"+a(b,2)+"+0000"};d.header=function(a,b){var c=this.head||(this.head={});if(null==b)return this.headers()[a]||"";c[a]=b||"";return this};d.headers=function(a){var b,c=this.now(),d=this.head||
|
186 |
+
(this.head=l(c));if(null!=a){for(b in a)d[b]=a[b];return this}var f=this.locale();a={};for(b in d)a[b]=String(d[b]);f?(a.Language=String(f)||"zxx",a["Language-Team"]=f.label||a.Language,a["Plural-Forms"]="nplurals="+(f.nplurals||"2")+"; plural="+(f.pluraleq||"n!=1"),a["PO-Revision-Date"]=c):(a.Language="",a["Plural-Forms"]="nplurals=INTEGER; plural=EXPRESSION",a["POT-Creation-Date"]=c,a["PO-Revision-Date"]="YEAR-MO-DA HO:MI+ZONE");a["X-Generator"]="Loco - https://localise.biz/";return a};d.get=function(a,
|
187 |
+
c){var d=b(a,c);return this.rows.get(d)};d.add=function(a,b){a instanceof c||(a=new c(a));b&&a.context(b);var d=a.hash();if(this.rows.get(d))throw Error("Duplicate message at index "+this.indexOf(a));a.idx=this.rows.add(d,a);this.length=this.rows.length;return a};d.load=function(a){for(var b=-1,d,f,g,h,l,n,p=[],A=[],w=[],E=[];++b<a.length;)d=a[b],null==d.parent?(f=d.source||d.id,g=d.target||"",h=d.context,f||h?(l=new c(f,g),l._id=d._id,h&&l.context(h),d.flag&&l.flag(d.flag,0),d.comment&&l.comment(d.comment),
|
188 |
+
d.notes&&l.notes(d.notes),d.refs&&l.refs(d.refs),null!==d.format&&l.format(d.format),d.message=l,l.translation()?l.fuzzy()?w.push(l):A.push(l):E.push(l)):0===b&&"object"===typeof g&&(this.head=g)):p.push(d);for(b=-1;++b<p.length;)try{d=p[b];f=d.source||d.id;l=a[d.parent]&&a[d.parent].message;if(!l)throw Error("parent missing for plural "+f);n=d.plural;1===n&&l.plural(f);d.flag&&l.flag(d.flag,n);l.translate(d.target||"",n);d.format&&!l.format()&&l.format(d.format)}catch(C){}return this._add(E,w,A)};
|
189 |
+
d._add=function(a,b,c){c=[a,b,c];for(i=0;3>i;i++)for(b=c[i],a=-1;++a<b.length;)try{this.add(b[a])}catch(d){}return this};d.merge=function(a){var b,c=a.header("POT-Creation-Date"),d=this.rows,f=[],h=[],l=[],n=[],p=[];a=a.rows;this.rows.each(function(b,c){null==a.get(b)&&p.push(c)});a.each(function(a,c){try{(b=d.get(a))?(b.ref=c.ref,b.fmt=c.fmt):(b=c,n.push(b)),b.translation()?b.fuzzy()?h.push(b):l.push(b):f.push(b)}catch(e){}});this.rows=g();this._add(f,h,l);c&&this.header("POT-Creation-Date",c);return{add:n,
|
190 |
+
del:p}};d.toString=function(){var a,b=[],d=[],f=this.headers(),g=!this.loc,h=n.require("$25","format.js").create(void 0);for(a in f)d.push(a+": "+f[a]);d=new c("",d.join("\n"));g&&d.fuzzy(0,!0);b.push(d.toString());b.push("");this.rows.each(function(a,c){a&&(b.push(c.cat(h,g)),b.push(""))});return b.join("\n")};d=n.require("$27","message.js").extend(c);d.hash=function(){return b(this.source(),this.context())};d.source=function(a,b){if(null==a)return this.src[0];this.src[0]=a;null!=b&&this.plural(b);
|
191 |
+
return this};d.toString=function(){return this.cat(n.require("$25","format.js").create(void 0))};d.cat=function(a,b){var c,d=[],f;(f=this.cmt)&&d.push(a.prefix(f,"# "));(f=this.xcmt)&&d.push(a.prefix(f,"#. "));c=this.ref;if(f=this._id)c+=(c?" ":"")+"loco:"+f;c&&/\S/.test(c)&&d.push(a.refs(c));!b&&this.fuzzy()&&d.push("#, fuzzy");(f=this.fmt)?d.push("#, "+f+"-format"):null!=f&&d.push("#, no-c-format");(f=this.ctx)&&d.push(a.pair("msgctxt",f));d.push(a.pair("msgid",this.src[0]));if(null==this.src[1])d.push(a.pair("msgstr",
|
192 |
+
b?"":this.msg[0]));else for(c=-1,d.push(a.pair("msgid_plural",this.src[1]));++c<this.msg.length;)d.push(a.pair("msgstr["+c+"]",b?"":this.msg[c]));return d.join("\n")};d.compare=function(a,b){var c=this.weight(),d=a.weight();if(c>d)return 1;if(c<d)return-1;if(b){c=this.hash().toLowerCase();d=a.hash().toLowerCase();if(c<d)return 1;if(c>d)return-1}return 0};d=d=null;return f}({},p,w));n.register("$14",function(f,d,n){f.init=function(f){function b(){B&&B.dialog("close");h(f).find('input[type="submit"]').attr("disabled",
|
193 |
+
!1);h(s).addClass("jshide");t&&t(!0)}function g(){h(f).find('input[type="submit"]').attr("disabled",!0);t&&t(!1)}function a(a){var b,c;for(b in p)c=p[b],a[b]?a[b].value=c:h('<input type="hidden" />').attr("name",b).appendTo(a).val(c)}function c(a){a.preventDefault();a=h(a.target).serializeArray();m(a);w=!0;return!1}function e(a){a.preventDefault();B.dialog("close");return!1}function k(a){a.preventDefault();B.dialog("open");return!1}function n(d){p=d.authed&&d.creds;v=d.method;if(p)"direct"!==v&&(a(f),
|
194 |
+
w&&d.success&&E.notices.success(d.success)),D=!0,b();else if(D=!1,d.reason)E.notices.info(d.reason);else if(d=d.prompt){var g;B||(h(s).find("button.button-small").click(k),B=h('<div id="loco-fs-creds"></div>').dialog({dialogClass:"request-filesystem-credentials-dialog loco-modal",minWidth:480,modal:!0,autoOpen:!1,closeOnEscape:!0}));g=B;g.html(d).find("form").submit(c);g.dialog("option","title",g.find("h2").remove().text());g.find("button.cancel-button").show().click(e);g.find('input[type="submit"]').addClass("button-primary");
|
195 |
+
h(s).removeClass("jshide")}else E.notices.error("Server didn't return credentials, nor a prompt for credentials")}function q(){b()}function m(a){w=!1;a.path=C;a.auth=u;E.ajax.setNonce("fsConnect",z).post("fsConnect",a,n,q);return a}var p,t,s=f,v=null,w=!1,D=!1,E=d.locoScope,C=f.path.value,u=f.auth.value,z=f["loco-nonce"].value,B;f.connection_type?(p={},p.connection_type=f.connection_type.value,D=!0):C&&u&&(g(),m({}));return{applyCreds:function(b){if(b.nodeType)a(b);else{var c,d=p||{};for(c in d)b[c]=
|
196 |
+
d[c]}return this},setForm:function(b){f=b;D||g();a(b);return this},connect:function(){var a=h(f).serializeArray();C=a.path;u=a.auth;m(a);return this},listen:function(a){t=a;D&&a(!0);return this}}};return f}({},p,w));n.register("$15",function(f,d,n){function l(a,b){return function(d){a.apply(d,b);return d}}function b(a){return function(b,d){var f=b&&b[a]||0,g=d&&d[a]||0;return f===g?0:f>g?1:-1}}function g(a){return function(b,d){return(b&&b[a]||"").localeCompare(d&&d[a]||"")}}function a(a){return function(b,
|
197 |
+
d){return-1*a(b,d)}}f.sort=function(c){var d=[],f=[],n,p=0,m=c.getElementsByTagName("tbody")[0];if((c=c.getElementsByTagName("thead")[0])&&m){var r=0;h("th",c).each(function(c,s){var v=s.getAttribute("data-sort-type");v&&(c=r,h(s).addClass("loco-sort").click(function(r){r.preventDefault();var s=c;r=-1;var v=f[s],w=v.type,u=!(v.desc=!v.desc),z=d,s="n"===w?b(s):g(s);u&&(s=a(s));d=l([].sort,[s])(z);for(h("tr",m).remove();++r<p;)m.appendChild(d[r].$);n&&n.removeClass("loco-desc loco-asc");n=h(v.$).addClass(u?
|
198 |
+
"loco-desc":"loco-asc").removeClass(u?"loco-asc":"loco-desc");return!1}),f[r]={$:s,type:v});s.hasAttribute("colspan")?r+=Number(s.getAttribute("colspan")):r++});h("tr",m).each(function(a,b){var c,g,h={_:a,$:b},l=b.getElementsByTagName("td");for(g in f){c=l[g];c=c.hasAttribute("data-sort-value")?c.getAttribute("data-sort-value"):c.textContent.replace(/(^\s+|\s+$)/g,"");switch(f[g].type){case "n":c=Number(c)}h[g]=c}d[a]=h});p=d.length}};return f}({},p,w));var G=p.locoScope||(p.locoScope={});p=p.locoConf||
|
199 |
+
(p.locoConf={});w=n.require("$1","t.js").init();var Q=p.wplang;n.require("$2","array.js");G.l10n=w;w.load(p.wpl10n);Q&&w.pluraleq(Q.pluraleq);G.string=n.require("$3","string.js");G.notices=n.require("$4","notices.js").init(w);G.ajax=n.require("$5","ajax.js").init(p).localise(w);G.locale=n.require("$6","locale.js");G.fulltext=n.require("$7","fulltext.js");G.watchtext=n.require("$8","LocoTextListener.js").listen;G.selector=n.require("$9","LocoSelector.js").create;G.autocomp=n.require("$10","LocoAutoComplete.js").init;
|
200 |
+
G.po={ed:n.require("$11","poedit.js"),kbd:n.require("$12","hotkeys.js"),init:n.require("$13","po.js").create};G.fs=n.require("$14","fsconn.js");h("#loco.wrap table.wp-list-table").each(function(f,d){n.require("$15","tables.js").sort(d)})})(window,document,window.jQuery);
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== Plugin Name ===
|
2 |
Contributors: timwhitlock
|
3 |
Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity
|
4 |
-
Requires at least: 4.
|
5 |
Tested up to: 4.6.1
|
6 |
-
Stable tag: 2.0.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -85,6 +85,11 @@ Help is provided via the [plugin support forum](https://wordpress.org/support/pl
|
|
85 |
|
86 |
== Changelog ==
|
87 |
|
|
|
|
|
|
|
|
|
|
|
88 |
= 2.0.8 =
|
89 |
* Source refs fix for files in unknown subsets
|
90 |
* Downgrades PO formatting exceptions to PHP warnings
|
1 |
=== Plugin Name ===
|
2 |
Contributors: timwhitlock
|
3 |
Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity
|
4 |
+
Requires at least: 4.1
|
5 |
Tested up to: 4.6.1
|
6 |
+
Stable tag: 2.0.9
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 2.0.9 =
|
89 |
+
* Bumped minimum WordPress version to 4.1
|
90 |
+
* Some optimisation of transient caching
|
91 |
+
* Fixed hash table settings bug
|
92 |
+
|
93 |
= 2.0.8 =
|
94 |
* Source refs fix for files in unknown subsets
|
95 |
* Downgrades PO formatting exceptions to PHP warnings
|
src/admin/bundle/ViewController.php
CHANGED
@@ -79,7 +79,7 @@ class Loco_admin_bundle_ViewController extends Loco_admin_bundle_BaseController
|
|
79 |
// POT template file
|
80 |
$file = $project->getPot();
|
81 |
if( $file && $file->exists() ){
|
82 |
-
$meta = Loco_gettext_Metadata::load($file)->
|
83 |
$p['pot'] = new Loco_mvc_ViewParams( array(
|
84 |
// POT info
|
85 |
'name' => $file->basename(),
|
@@ -112,7 +112,7 @@ class Loco_admin_bundle_ViewController extends Loco_admin_bundle_BaseController
|
|
112 |
$pot = $project->getPot();
|
113 |
if( $pot && $pot->exists() ){
|
114 |
$p['pot'] = $pot;
|
115 |
-
$meta = Loco_gettext_Metadata::load($pot)->
|
116 |
$p['nav'][] = new Loco_mvc_ViewParams( array(
|
117 |
'href' => $this->getResourceLink('file-edit', $project, $meta ),
|
118 |
'name' => __('Edit template','loco'),
|
@@ -206,7 +206,7 @@ class Loco_admin_bundle_ViewController extends Loco_admin_bundle_BaseController
|
|
206 |
private function createFileParams( Loco_package_Project $project, Loco_fs_File $file, Loco_Locale $locale = null ){
|
207 |
// Pull Gettext meta data from cache if possible
|
208 |
// TODO save write when cached version was used
|
209 |
-
$meta = Loco_gettext_Metadata::load($file)->
|
210 |
// Establish whether translations are official or otherwise
|
211 |
$dir = new Loco_fs_LocaleDirectory( $file->dirname() );
|
212 |
// Retuen data required for PO table row
|
79 |
// POT template file
|
80 |
$file = $project->getPot();
|
81 |
if( $file && $file->exists() ){
|
82 |
+
$meta = Loco_gettext_Metadata::load($file)->persistIfDirty( 0, true );
|
83 |
$p['pot'] = new Loco_mvc_ViewParams( array(
|
84 |
// POT info
|
85 |
'name' => $file->basename(),
|
112 |
$pot = $project->getPot();
|
113 |
if( $pot && $pot->exists() ){
|
114 |
$p['pot'] = $pot;
|
115 |
+
$meta = Loco_gettext_Metadata::load($pot)->persistIfDirty( 0, true );
|
116 |
$p['nav'][] = new Loco_mvc_ViewParams( array(
|
117 |
'href' => $this->getResourceLink('file-edit', $project, $meta ),
|
118 |
'name' => __('Edit template','loco'),
|
206 |
private function createFileParams( Loco_package_Project $project, Loco_fs_File $file, Loco_Locale $locale = null ){
|
207 |
// Pull Gettext meta data from cache if possible
|
208 |
// TODO save write when cached version was used
|
209 |
+
$meta = Loco_gettext_Metadata::load($file)->persistIfDirty( 0, true );
|
210 |
// Establish whether translations are official or otherwise
|
211 |
$dir = new Loco_fs_LocaleDirectory( $file->dirname() );
|
212 |
// Retuen data required for PO table row
|
src/config/CustomSaved.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*/
|
5 |
class Loco_config_CustomSaved extends Loco_data_Option {
|
6 |
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Bundle configuration saved as a WordPress site option.
|
4 |
*/
|
5 |
class Loco_config_CustomSaved extends Loco_data_Option {
|
6 |
|
src/data/Serializable.php
CHANGED
@@ -4,13 +4,17 @@
|
|
4 |
*/
|
5 |
abstract class Loco_data_Serializable extends ArrayObject {
|
6 |
|
7 |
-
|
8 |
/**
|
9 |
* Object version, can be used for validation and migrations.
|
10 |
* @var string|int|float
|
11 |
*/
|
12 |
private $v = 0;
|
13 |
|
|
|
|
|
|
|
|
|
|
|
14 |
/**
|
15 |
* Commit serialized data to WordPress storage
|
16 |
* @return mixed
|
@@ -19,18 +23,68 @@ abstract class Loco_data_Serializable extends ArrayObject {
|
|
19 |
|
20 |
|
21 |
/**
|
22 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
*/
|
24 |
-
public function
|
25 |
-
return $this
|
26 |
}
|
27 |
|
28 |
|
29 |
/**
|
30 |
-
*
|
|
|
31 |
*/
|
32 |
-
|
33 |
-
$this
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
|
@@ -38,7 +92,10 @@ abstract class Loco_data_Serializable extends ArrayObject {
|
|
38 |
* @return Loco_data_Serializable
|
39 |
*/
|
40 |
public function setVersion( $version ){
|
41 |
-
$this->v
|
|
|
|
|
|
|
42 |
return $this;
|
43 |
}
|
44 |
|
@@ -84,6 +141,9 @@ abstract class Loco_data_Serializable extends ArrayObject {
|
|
84 |
|
85 |
// ok to populate ArrayObject
|
86 |
$this->exchangeArray( $data['d'] );
|
|
|
|
|
|
|
87 |
|
88 |
return $this;
|
89 |
}
|
4 |
*/
|
5 |
abstract class Loco_data_Serializable extends ArrayObject {
|
6 |
|
|
|
7 |
/**
|
8 |
* Object version, can be used for validation and migrations.
|
9 |
* @var string|int|float
|
10 |
*/
|
11 |
private $v = 0;
|
12 |
|
13 |
+
/**
|
14 |
+
* @var bool
|
15 |
+
*/
|
16 |
+
private $dirty;
|
17 |
+
|
18 |
/**
|
19 |
* Commit serialized data to WordPress storage
|
20 |
* @return mixed
|
23 |
|
24 |
|
25 |
/**
|
26 |
+
* {@inheritdoc}
|
27 |
+
*/
|
28 |
+
public function __construct( array $data = array() ){
|
29 |
+
$this->setFlags( ArrayObject::ARRAY_AS_PROPS );
|
30 |
+
parent::__construct( $data );
|
31 |
+
$this->dirty = (bool) $data;
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Check if object's properties have change since last clean
|
37 |
+
* @return bool
|
38 |
*/
|
39 |
+
public function isDirty(){
|
40 |
+
return $this->dirty;
|
41 |
}
|
42 |
|
43 |
|
44 |
/**
|
45 |
+
* Make not dirty
|
46 |
+
* @return Loco_data_Serializable
|
47 |
*/
|
48 |
+
protected function clean(){
|
49 |
+
$this->dirty = false;
|
50 |
+
return $this;
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Call persist method only if has changed since last clean
|
57 |
+
* @return Loco_data_Serializable
|
58 |
+
*/
|
59 |
+
public function persistIfDirty(){
|
60 |
+
if( $this->isDirty() ){
|
61 |
+
$params = func_get_args();
|
62 |
+
call_user_func_array( array($this,'persist'), $params );
|
63 |
+
}
|
64 |
+
return $this;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @override so we can set dirty flag
|
71 |
+
*/
|
72 |
+
public function offsetSet( $prop, $value ){
|
73 |
+
if( ! isset($this[$prop]) || $value !== $this[$prop] ){
|
74 |
+
parent::offsetSet( $prop, $value );
|
75 |
+
$this->dirty = true;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @override so we can set dirty flag
|
82 |
+
*/
|
83 |
+
public function offsetUnset( $prop ){
|
84 |
+
if( isset($this[$prop]) ){
|
85 |
+
parent::offsetUnset($prop);
|
86 |
+
$this->dirty = true;
|
87 |
+
}
|
88 |
}
|
89 |
|
90 |
|
92 |
* @return Loco_data_Serializable
|
93 |
*/
|
94 |
public function setVersion( $version ){
|
95 |
+
if( $version !== $this->v ){
|
96 |
+
$this->v = $version;
|
97 |
+
$this->dirty = true;
|
98 |
+
}
|
99 |
return $this;
|
100 |
}
|
101 |
|
141 |
|
142 |
// ok to populate ArrayObject
|
143 |
$this->exchangeArray( $data['d'] );
|
144 |
+
|
145 |
+
// because object is being restored, probably from disk. this make it clean now
|
146 |
+
$this->dirty = false;
|
147 |
|
148 |
return $this;
|
149 |
}
|
src/data/Settings.php
CHANGED
@@ -125,6 +125,7 @@ class Loco_data_Settings extends Loco_data_Serializable {
|
|
125 |
*/
|
126 |
public function persist(){
|
127 |
$this->version = loco_plugin_version();
|
|
|
128 |
return update_option('loco_settings', $this->getSerializable() );
|
129 |
}
|
130 |
|
@@ -144,6 +145,7 @@ class Loco_data_Settings extends Loco_data_Serializable {
|
|
144 |
// could ensure redundant keys are removed, but no need currently
|
145 |
// $data = array_intersect_key( $data, self::$defaults );
|
146 |
$this->exchangeArray( $data );
|
|
|
147 |
return true;
|
148 |
}
|
149 |
return false;
|
@@ -157,11 +159,13 @@ class Loco_data_Settings extends Loco_data_Serializable {
|
|
157 |
*/
|
158 |
public function migrate(){
|
159 |
$existed = (bool) get_option('loco_settings');
|
160 |
-
// Populate new format from legacy 1.x options
|
161 |
-
$
|
162 |
-
|
163 |
-
|
164 |
-
|
|
|
|
|
165 |
// currently the only upgrade could be 1.x => 2.0
|
166 |
// deliberately keeping the old options due to legacy switching feature
|
167 |
return ! $existed;
|
125 |
*/
|
126 |
public function persist(){
|
127 |
$this->version = loco_plugin_version();
|
128 |
+
$this->clean();
|
129 |
return update_option('loco_settings', $this->getSerializable() );
|
130 |
}
|
131 |
|
145 |
// could ensure redundant keys are removed, but no need currently
|
146 |
// $data = array_intersect_key( $data, self::$defaults );
|
147 |
$this->exchangeArray( $data );
|
148 |
+
$this->clean();
|
149 |
return true;
|
150 |
}
|
151 |
return false;
|
159 |
*/
|
160 |
public function migrate(){
|
161 |
$existed = (bool) get_option('loco_settings');
|
162 |
+
// Populate new format from legacy 1.x options, but only on first run
|
163 |
+
if( ! $existed ){
|
164 |
+
$this->gen_hash = get_option('loco-translate-gen_hash','0');
|
165 |
+
$this->use_fuzzy = get_option('loco-translate-use_fuzzy', '1' );
|
166 |
+
$this->num_backups = get_option('loco-translate-num_backups','1');
|
167 |
+
$this->persist();
|
168 |
+
}
|
169 |
// currently the only upgrade could be 1.x => 2.0
|
170 |
// deliberately keeping the old options due to legacy switching feature
|
171 |
return ! $existed;
|
src/data/Transient.php
CHANGED
@@ -28,6 +28,7 @@ abstract class Loco_data_Transient extends Loco_data_Serializable {
|
|
28 |
$data = $this->getSerializable();
|
29 |
set_transient( $key, $data, $ttl );
|
30 |
$this->lazy = null;
|
|
|
31 |
}
|
32 |
else {
|
33 |
$this->lazy = $ttl;
|
@@ -37,13 +38,12 @@ abstract class Loco_data_Transient extends Loco_data_Serializable {
|
|
37 |
}
|
38 |
|
39 |
|
40 |
-
|
41 |
/**
|
42 |
* Commit to transient cache on object destruction
|
43 |
*/
|
44 |
final public function __destruct(){
|
45 |
if( is_int($this->lazy) ){
|
46 |
-
$this->
|
47 |
}
|
48 |
}
|
49 |
|
28 |
$data = $this->getSerializable();
|
29 |
set_transient( $key, $data, $ttl );
|
30 |
$this->lazy = null;
|
31 |
+
$this->clean();
|
32 |
}
|
33 |
else {
|
34 |
$this->lazy = $ttl;
|
38 |
}
|
39 |
|
40 |
|
|
|
41 |
/**
|
42 |
* Commit to transient cache on object destruction
|
43 |
*/
|
44 |
final public function __destruct(){
|
45 |
if( is_int($this->lazy) ){
|
46 |
+
$this->persistIfDirty( $this->lazy, true );
|
47 |
}
|
48 |
}
|
49 |
|
src/gettext/Metadata.php
CHANGED
@@ -62,7 +62,6 @@ class Loco_gettext_Metadata extends Loco_data_Transient {
|
|
62 |
'rpath' => $po->getRelativePath( loco_constant('WP_CONTENT_DIR') ),
|
63 |
) );
|
64 |
// pull from cache if exists and has not been modified
|
65 |
-
// TODO cache enabled filter / debug mode switch
|
66 |
if( $nocache || ! $meta->fetch() || $bytes !== $meta['bytes'] || $mtime !== $meta['mtime'] ){
|
67 |
// not available from cache, or cache is invalidated
|
68 |
$meta['bytes'] = $bytes;
|
@@ -77,12 +76,10 @@ class Loco_gettext_Metadata extends Loco_data_Transient {
|
|
77 |
catch( Exception $e ){
|
78 |
$meta['valid'] = false;
|
79 |
}
|
80 |
-
// TODO set flag so we know whether uncached data needs caching again
|
81 |
-
/*if( ! $nocache ){
|
82 |
-
...
|
83 |
-
}*/
|
84 |
}
|
85 |
-
|
|
|
|
|
86 |
return $meta;
|
87 |
}
|
88 |
|
62 |
'rpath' => $po->getRelativePath( loco_constant('WP_CONTENT_DIR') ),
|
63 |
) );
|
64 |
// pull from cache if exists and has not been modified
|
|
|
65 |
if( $nocache || ! $meta->fetch() || $bytes !== $meta['bytes'] || $mtime !== $meta['mtime'] ){
|
66 |
// not available from cache, or cache is invalidated
|
67 |
$meta['bytes'] = $bytes;
|
76 |
catch( Exception $e ){
|
77 |
$meta['valid'] = false;
|
78 |
}
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
+
/*/ debug cache status after fetching transient: dirty means a miss and will require call to persist.
|
81 |
+
Loco_error_AdminNotices::debug( sprintf('%s for %s', $meta->isDirty() ? 'MISS' : 'HIT', $meta['rpath'] ) );*/
|
82 |
+
|
83 |
return $meta;
|
84 |
}
|
85 |
|
src/test/DummyFtpConnect.php
CHANGED
@@ -22,6 +22,12 @@ class WP_Filesystem_Debug extends WP_Filesystem_Base {
|
|
22 |
|
23 |
private $authed;
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
public function __construct( array $opt ) {
|
26 |
$this->options = $opt;
|
27 |
$this->method = 'ftp';
|
22 |
|
23 |
private $authed;
|
24 |
|
25 |
+
/**
|
26 |
+
* @var WP_Error
|
27 |
+
*/
|
28 |
+
public $errors;
|
29 |
+
|
30 |
+
|
31 |
public function __construct( array $opt ) {
|
32 |
$this->options = $opt;
|
33 |
$this->method = 'ftp';
|