Loco Translate - Version 1.1.0

Version Description

  • Added translation search filter in editor
  • Added percentage completion in list and edit views
Download this release

Release Info

Developer timwhitlock
Plugin Icon 128x128 Loco Translate
Version 1.1.0
Comparing to
See all releases

Code changes from version 1.0.0 to 1.1.0

languages/loco-translate.pot CHANGED
@@ -4,8 +4,8 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: PACKAGE VERSION\n"
6
  "Report-Msgid-Bugs-To: \n"
7
- "POT-Creation-Date: Tue Jul 23 2013 16:16:17 GMT+0100 (BST)\n"
8
- "POT-Revision-Date: Tue Jul 23 2013 16:16:22 GMT+0100 (BST)\n"
9
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10
  "Last-Translator: \n"
11
  "Language-Team: \n"
@@ -77,6 +77,20 @@ msgstr ""
77
  msgid "Bad file path"
78
  msgstr ""
79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  msgid "Loco, Translation Management"
81
  msgstr ""
82
 
@@ -114,7 +128,7 @@ msgid "No strings could be extracted from source files"
114
  msgstr ""
115
 
116
  msgctxt "Table header"
117
- msgid "Package name"
118
  msgstr ""
119
 
120
  msgctxt "Table header"
@@ -134,6 +148,10 @@ msgid_plural "%u languages"
134
  msgstr[0] ""
135
  msgstr[1] ""
136
 
 
 
 
 
137
  msgctxt "Add button"
138
  msgid "New language"
139
  msgstr ""
@@ -142,7 +160,7 @@ msgctxt "Add button"
142
  msgid "New template"
143
  msgstr ""
144
 
145
- msgid "Powered by Loco"
146
  msgstr ""
147
 
148
  msgid "Packages"
@@ -151,7 +169,7 @@ msgstr ""
151
  msgid "Template file"
152
  msgstr ""
153
 
154
- msgid "last modified"
155
  msgstr ""
156
 
157
  msgid "never"
@@ -185,6 +203,9 @@ msgctxt "Editor button"
185
  msgid "Fuzzy"
186
  msgstr ""
187
 
 
 
 
188
  msgctxt "Editor button"
189
  msgid "Help"
190
  msgstr ""
4
  msgstr ""
5
  "Project-Id-Version: PACKAGE VERSION\n"
6
  "Report-Msgid-Bugs-To: \n"
7
+ "POT-Creation-Date: Wed Jul 31 2013 17:14:31 GMT+0100 (BST)\n"
8
+ "POT-Revision-Date: Wed Jul 31 2013 17:14:36 GMT+0100 (BST)\n"
9
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10
  "Last-Translator: \n"
11
  "Language-Team: \n"
77
  msgid "Bad file path"
78
  msgstr ""
79
 
80
+ msgid "%s%% translated"
81
+ msgstr ""
82
+
83
+ msgid "1 string"
84
+ msgid_plural "%s strings"
85
+ msgstr[0] ""
86
+ msgstr[1] ""
87
+
88
+ msgid "%s fuzzy"
89
+ msgstr ""
90
+
91
+ msgid "%s unstranslated"
92
+ msgstr ""
93
+
94
  msgid "Loco, Translation Management"
95
  msgstr ""
96
 
128
  msgstr ""
129
 
130
  msgctxt "Table header"
131
+ msgid "Package details"
132
  msgstr ""
133
 
134
  msgctxt "Table header"
148
  msgstr[0] ""
149
  msgstr[1] ""
150
 
151
+ msgctxt "Modified time"
152
+ msgid "Updated"
153
+ msgstr ""
154
+
155
  msgctxt "Add button"
156
  msgid "New language"
157
  msgstr ""
160
  msgid "New template"
161
  msgstr ""
162
 
163
+ msgid "Powered by"
164
  msgstr ""
165
 
166
  msgid "Packages"
169
  msgid "Template file"
170
  msgstr ""
171
 
172
+ msgid "Updated"
173
  msgstr ""
174
 
175
  msgid "never"
203
  msgid "Fuzzy"
204
  msgstr ""
205
 
206
+ msgid "Filter translations"
207
+ msgstr ""
208
+
209
  msgctxt "Editor button"
210
  msgid "Help"
211
  msgstr ""
lib/build/gettext-compiled.php CHANGED
@@ -2,6 +2,6 @@
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
- * @date Tue, 23 Jul 2013 15:38:20 +0100
6
  */
7
- class LocoArray implements Iterator { private $i; private $length; private $keys; private $vals; private $index; public function __construct( array $data = array() ){ $this->keys = array_keys( $data ); $this->vals = array_values( $data ); $this->index = array_flip( array_map( 'strtolower', $this->keys ) ); $this->length = count( $this->keys ); $this->rewind(); } public function add( $key, $val ){ $k = strtolower($key); if( isset($this->index[$k]) ){ $this->keys[ $this->index[$k] ] = $key; $this->vals[ $this->index[$k] ] = $val; } else { $this->index[$k] = $this->length++; $this->keys[] = $key; $this->vals[] = $val; } return $this; } public function to_array(){ return array_combine( $this->keys, $this->vals ); } public function count(){ return $this->length; } public function trimmed( $prop ){ return trim( $this->__get($prop) ); } public function has( $key ){ return isset( $this->index[ strtolower($key) ] ); } public function __get( $key ){ $key = strtolower( $key ); return isset($this->index[$key]) ? $this->vals[ $this->index[$key] ] : null; } public function rewind(){ $this->i = reset( $this->index ); } public function key(){ return is_int($this->i) ? $this->keys[$this->i] : null; } public function current(){ return is_int($this->i) ? $this->vals[$this->i] : null; } public function valid(){ return is_int($this->i); } public function next(){ $this->i = next( $this->index ); } } function loco_parse_po( $src ){ $i = -1; $key = ''; $entries = array(); $template = array( '#' => array(), 'id' => array(), 'str' => array(), 'ctxt' => array() ); foreach( preg_split('/[\r\n]+/', $src) as $line ){ while( $line = trim($line) ){ $c = $line{0}; if( '"' === $c ){ if( $key && isset($entry) ){ $entry[$key][$idx][] = loco_po_unquote( $line ); } } else if( '#' === $c ){ if( isset($entry['i']) ){ unset( $entry ); $entry = $template; } $f = empty($line{1}) ? ' ' : $line{1}; $entry['#'][$f][] = substr( $line, 1+strlen($f) ); } else if( preg_match('/^msg(id|str|ctxt|id_plural)(?:\[(\d+)\])?[ \t]+/', $line, $r ) ){ $key = $r[1]; $idx = isset($r[2]) ? (int) $r[2] : 0; if( 'str' === $key ){ if( ! isset($entry['i']) ){ $entry['i'] = ++$i; $entries[$i] = &$entry; } } else if( ! isset($entry) || isset($entry['i']) ){ unset( $entry ); $entry = $template; } $line = substr( $line, strlen($r[0]) ); continue; } continue 2; } } unset( $entry ); $assets = array(); foreach( $entries as $i => $entry ){ $asset = array ( 'id' => '', 'source' => implode('',$entry['id'][0]), 'target' => implode('',$entry['str'][0]), ); if( isset($entry['ctxt'][0]) ){ $asset['context'] = implode('',$entry['ctxt'][0]); } if( isset($entry['#'][' ']) ){ $asset['comment'] = implode("\n", $entry['#'][' ']); } if( isset($entry['#'][',']) ){ foreach( $entry['#'][','] as $flag ){ if( $flag = loco_po_parse_flag($flag) ){ $asset['flag'] = $flag; break; } } } $pidx = count($assets); $assets[] = $asset; if( isset($entry['id_plural']) || isset($entry['str'][1]) ){ $idx = 0; $num = max( 2, count($entry['str']) ); while( ++$idx < $num ){ $assets[] = array ( 'id' => '', 'parent' => $pidx, 'plural' => $idx, 'source' => isset($entry['id_plural'][0]) ? implode('',$entry['id_plural'][0]) : '', 'target' => isset($entry['str'][$idx]) ? implode('',$entry['str'][$idx]) : '', ); } } } return $assets; } function loco_po_parse_flag( $text, $flag = 0 ){ static $map; if( ! isset($map) ){ $map = unserialize('a:1:{i:4;s:8:"#, fuzzy";}'); } foreach( explode(',',$text) as $needle ){ if( $needle = trim($needle) ){ foreach( $map as $loco_flag => $haystack ){ if( false !== stripos($haystack, $needle) ){ $flag |= $loco_flag; break; } } } } return $flag; } function loco_po_unquote( $str ){ return substr( stripcslashes($str), 1, -1 ); } function loco_parse_po_headers( $str ){ $headers = new LocoArray( array() ); foreach( explode("\n",$str) as $line ){ $i = strpos($line,':') and $key = trim( substr($line,0,$i) ) and $headers->add( $key, trim( substr($line,++$i) ) ); } return $headers; } final class PHPTokens implements Iterator { private $tokens; private $i; private $skip_tokens = array(); private $skip_strings = array(); public function __construct( array $tokens ){ $this->tokens = $tokens; $this->rewind(); } public function ignore(){ foreach( func_get_args() as $t ){ if( is_int($t) ){ $this->skip_tokens[$t] = true; } else { $this->skip_strings[$t] = true; } } return $this; } public function advance(){ $this->next(); return $this->current(); } public function rewind(){ $this->i = false === reset($this->tokens) ? null : key($this->tokens); } public function valid(){ return isset($this->i); } public function key(){ return $this->i; } public function next(){ $this->i = false === next($this->tokens) ? null : key($this->tokens); } public function current(){ while( isset($this->i) ){ $tok = $this->tokens[$this->i]; if( is_array($tok) ){ if( isset($this->skip_tokens[$tok[0]]) ){ $this->next(); } else { return $tok; } } else if( isset($this->skip_strings[$tok]) ){ $this->next(); } else { return $tok; } } return false; } } function decapse_string( $s ){ if( empty($s) ){ return ''; } $q = $s{0}; switch( $q ){ case "'": case '"': case '`': $s = substr( $s, 1, -1 ); return str_replace( "\\$q", $q, $s ); default: trigger_error( "Bad quote character ($q) at offset 0", E_USER_NOTICE ); return $s; } } function loco_extract_php( array $tokens, $fileref = '' ){ $extractor = new LocoPHPExtractor; return $extractor->extract( $tokens, $fileref ); } final class LocoPHPExtractor { private static $rules = array ( '_' => 's', 'gettext' => 's', 'dgettext' => '_s', 'ngettext' => 'sp', 'dngettext' => '_sp', '__' => 's', '_e' => 's', '_c' => 's', '_n' => 'sp', '_n_noop' => 'sp', '_nc' => 'sp', '__ngettext' => 'sp', '__ngettext_noop' => 'sp', '_x' => 'sc', '_ex' => 'sc', '_nx' => 'sp_c', '_nx_noop' => 'spc', '_n_js' => 'sp', '_nx_js' => 'spc', 'esc_attr__' => 's', 'esc_html__' => 's', 'esc_attr_e' => 's', 'esc_html_e' => 's', 'esc_attr_x' => 'sc', 'esc_html_x' => 'sc', 'comments_number_link' => '_sp', 't' => 's', 'st' => 's', 'trans' => 's', 'transChoice' => 'sp', ); private $exp = array(); private $reg = array(); public function extract( array $tokens, $fileref = '' ){ $tokens = new PHPTokens( $tokens ); $tokens->ignore( T_WHITESPACE ); $comment = ''; foreach( $tokens as $tok ){ if( isset($args) ){ if( ')' === $tok ){ isset($arg) and $arg and $args[] = $arg; $this->push( $rule, $args, $comment, $ref ); unset($args,$arg); $comment = ''; } else if( ',' === $tok ){ isset($arg) and $arg and $args[] = $arg; unset($arg); } else if( isset($arg) ){ $arg[] = $tok; } else { $arg = array( $tok ); } } else if( is_array($tok) ){ list($t,$s) = $tok; if( T_COMMENT === $t || T_DOC_COMMENT === $t ){ $comment = $s; } else if( T_STRING === $t && isset(self::$rules[$s]) && '(' === $tokens->advance() ){ $rule = self::$rules[$s]; $args = array(); $ref = $fileref ? $fileref.':'.$tok[2]: ''; } else if( $comment && false === stripos($comment, 'translators') ){ $comment = ''; } } } return $this->exp; } private function push( $rule, array $args, $comment = '', $ref = '' ){ $s = strpos( $rule, 's'); $p = strpos( $rule, 'p'); $c = strpos( $rule, 'c'); foreach( $args as $i => $tokens ){ if( 1 === count($tokens) && is_array($tokens[0]) && T_CONSTANT_ENCAPSED_STRING === $tokens[0][0] ){ $args[$i] = decapse_string( $tokens[0][1] ); } else { $args[$i] = null; } } $key = $msgid = $args[$s]; if( ! $msgid ){ return null; } $entry = array ( 'id' => '', 'source' => $msgid, 'target' => '', ); if( $c && isset($args[$c]) ){ $entry['context'] = $args[$c]; $key .= "\0". $args[$c]; } if( $ref ){ $entry['refs'] = $ref; } if( $comment ){ if( '*' === $comment{1} ){ $lines = array(); foreach( explode("\n", $comment) as $line ){ $line and $lines[] = trim($line,"/* \r\t"); } $lines and $entry['comment'] = implode(" ", $lines); } else { $comment = trim( $comment,"/ \n\r\t" ) and $entry['comment'] = $comment; } } if( isset($this->reg[$key]) ){ $index = $this->reg[$key]; $a = array(); isset($this->exp[$index]['refs']) and $a[] = $this->exp[$index]['refs']; isset($entry['refs']) and $a[] = $entry['refs']; $a && $this->exp[$index]['refs'] = implode(" ", $a ); $a = array(); isset($this->exp[$index]['comment']) and $a[] = $this->exp[$index]['comment']; isset($entry['comment']) and $a[] = $entry['comment']; $a && $this->exp[$index]['comment'] = implode("\n", $a ); } else { $index = count($this->exp); $this->reg[$key] = $index; $this->exp[] = $entry; } if( $p && isset($args[$p]) ){ $msgid_plural = $args[$p]; $entry = array ( 'id' => '', 'source' => $msgid_plural, 'target' => '', 'plural' => 1, 'parent' => $index, ); $key = $msgid_plural."\0\0"; if( isset($this->reg[$key]) ){ $plural_index = $this->reg[$key]; $this->exp[$plural_index] = $entry; } else { $plural_index = count($this->exp); $this->reg[$key] = $plural_index; $this->exp[] = $entry; } } return $index; } public function get_xgettext( $input = '-' ){ $cmd = defined('WHICH_XGETTEXT') ? WHICH_XGETTEXT : 'xgettext'; $cmd.= ' -LPHP -c -o-'; if( $k = $this->get_xgettext_keywords() ){ $cmd.= ' -k'.implode(' -k', $k ); } return $cmd.' '.$input; } public function get_xgettext_keywords(){ $ks = array(); foreach( self::$rules as $word => $rule ){ $s = strpos( $rule, 's'); $k = $word.':'.++$s; if( false !== $p = strpos( $rule, 'p') ){ $k.= ','.++$p; } if( false !== $p = strpos( $rule, 'c') ){ $k.= ','.++$p.'c'; } $ks[] = $k; } return $ks; } } define('WHICH_MSGFMT','/usr/bin/msgfmt'); function loco_compile_mo( $po ){ $descriptorspec = array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'), ); $cmd = WHICH_MSGFMT.' -o - -'; $process = proc_open($cmd, $descriptorspec, $pipes ); if( ! $process ){ throw new Exception('Failed to open process to '.$cmd); } fwrite($pipes[0], $po); fclose($pipes[0]); $err = stream_get_contents($pipes[2]); fclose($pipes[2]); $mo = stream_get_contents($pipes[1]); fclose($pipes[1]); $e = proc_close($process); if( 0 !== $e ){ $err and trigger_error( $err, E_USER_WARNING ); throw new Exception('Gettext msgfmt exited with code '.sprintf('%d',$e).'; Got '.strlen($mo).' bytes from '.strlen($po).' bytes'); } return $mo; }
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
+ * @date Wed, 31 Jul 2013 17:03:28 +0100
6
  */
7
+ class LocoArray implements Iterator { private $i; private $length; private $keys; private $vals; private $index; public function __construct( array $data = array() ){ $this->keys = array_keys( $data ); $this->vals = array_values( $data ); $this->index = array_flip( array_map( 'strtolower', $this->keys ) ); $this->length = count( $this->keys ); $this->rewind(); } public function add( $key, $val ){ $k = strtolower($key); if( isset($this->index[$k]) ){ $this->keys[ $this->index[$k] ] = $key; $this->vals[ $this->index[$k] ] = $val; } else { $this->index[$k] = $this->length++; $this->keys[] = $key; $this->vals[] = $val; } return $this; } public function to_array(){ return array_combine( $this->keys, $this->vals ); } public function count(){ return $this->length; } public function trimmed( $prop ){ return trim( $this->__get($prop) ); } public function has( $key ){ return isset( $this->index[ strtolower($key) ] ); } public function __get( $key ){ $key = strtolower( $key ); return isset($this->index[$key]) ? $this->vals[ $this->index[$key] ] : null; } public function rewind(){ $this->i = reset( $this->index ); } public function key(){ return is_int($this->i) ? $this->keys[$this->i] : null; } public function current(){ return is_int($this->i) ? $this->vals[$this->i] : null; } public function valid(){ return is_int($this->i); } public function next(){ $this->i = next( $this->index ); } } function loco_parse_po( $src ){ $i = -1; $key = ''; $entries = array(); $template = array( '#' => array(), 'id' => array(), 'str' => array(), 'ctxt' => array() ); foreach( preg_split('/[\r\n]+/', $src) as $line ){ while( $line = trim($line) ){ $c = $line{0}; if( '"' === $c ){ if( $key && isset($entry) ){ $entry[$key][$idx][] = loco_po_unquote( $line ); } } else if( '#' === $c ){ if( isset($entry['i']) ){ unset( $entry ); $entry = $template; } $f = empty($line{1}) ? ' ' : $line{1}; $entry['#'][$f][] = substr( $line, 1+strlen($f) ); } else if( preg_match('/^msg(id|str|ctxt|id_plural)(?:\[(\d+)\])?[ \t]+/', $line, $r ) ){ $key = $r[1]; $idx = isset($r[2]) ? (int) $r[2] : 0; if( 'str' === $key ){ if( ! isset($entry['i']) ){ $entry['i'] = ++$i; $entries[$i] = &$entry; } } else if( ! isset($entry) || isset($entry['i']) ){ unset( $entry ); $entry = $template; } $line = substr( $line, strlen($r[0]) ); continue; } continue 2; } } unset( $entry ); $assets = array(); foreach( $entries as $i => $entry ){ $asset = array ( 'id' => '', 'source' => implode('',$entry['id'][0]), 'target' => implode('',$entry['str'][0]), ); if( isset($entry['ctxt'][0]) ){ $asset['context'] = implode('',$entry['ctxt'][0]); } if( isset($entry['#'][' ']) ){ $asset['comment'] = implode("\n", $entry['#'][' ']); } if( isset($entry['#'][',']) ){ foreach( $entry['#'][','] as $flag ){ if( $flag = loco_po_parse_flag($flag) ){ $asset['flag'] = $flag; break; } } } $pidx = count($assets); $assets[] = $asset; if( isset($entry['id_plural']) || isset($entry['str'][1]) ){ $idx = 0; $num = max( 2, count($entry['str']) ); while( ++$idx < $num ){ $assets[] = array ( 'id' => '', 'parent' => $pidx, 'plural' => $idx, 'source' => isset($entry['id_plural'][0]) ? implode('',$entry['id_plural'][0]) : '', 'target' => isset($entry['str'][$idx]) ? implode('',$entry['str'][$idx]) : '', ); } } } return $assets; } function loco_po_parse_flag( $text, $flag = 0 ){ static $map; if( ! isset($map) ){ $map = unserialize('a:1:{i:4;s:8:"#, fuzzy";}'); } foreach( explode(',',$text) as $needle ){ if( $needle = trim($needle) ){ foreach( $map as $loco_flag => $haystack ){ if( false !== stripos($haystack, $needle) ){ $flag |= $loco_flag; break; } } } } return $flag; } function loco_po_unquote( $str ){ return substr( stripcslashes($str), 1, -1 ); } function loco_parse_po_headers( $str ){ $headers = new LocoArray( array() ); foreach( explode("\n",$str) as $line ){ $i = strpos($line,':') and $key = trim( substr($line,0,$i) ) and $headers->add( $key, trim( substr($line,++$i) ) ); } return $headers; } define( 'LOCO_FLAG_OK', 0 ); define( 'LOCO_FLAG_ERROR', 1 ); define( 'LOCO_FLAG_REVIEW', 2 ); define( 'LOCO_FLAG_PENDING', 3 ); define( 'LOCO_FLAG_FUZZY', 4 ); function loco_flags(){ static $flags = array ( LOCO_FLAG_OK => 'Translated', LOCO_FLAG_ERROR => 'Incorrect', LOCO_FLAG_REVIEW => 'Needs review', LOCO_FLAG_PENDING => 'Pending sign-off', LOCO_FLAG_FUZZY => 'Fuzzy', ); return $flags; } function loco_flag( $f ){ $flags = loco_flags(); if( ! isset($flags[$f]) ){ throw new Exception('Invalid LOCO_FLAG_ constant ', var_export($f,1) ); } return $flags[$f]; } final class PHPTokens implements Iterator { private $tokens; private $i; private $skip_tokens = array(); private $skip_strings = array(); public function __construct( array $tokens ){ $this->tokens = $tokens; $this->rewind(); } public function ignore(){ foreach( func_get_args() as $t ){ if( is_int($t) ){ $this->skip_tokens[$t] = true; } else { $this->skip_strings[$t] = true; } } return $this; } public function advance(){ $this->next(); return $this->current(); } public function rewind(){ $this->i = false === reset($this->tokens) ? null : key($this->tokens); } public function valid(){ return isset($this->i); } public function key(){ return $this->i; } public function next(){ $this->i = false === next($this->tokens) ? null : key($this->tokens); } public function current(){ while( isset($this->i) ){ $tok = $this->tokens[$this->i]; if( is_array($tok) ){ if( isset($this->skip_tokens[$tok[0]]) ){ $this->next(); } else { return $tok; } } else if( isset($this->skip_strings[$tok]) ){ $this->next(); } else { return $tok; } } return false; } } function decapse_string( $s ){ if( empty($s) ){ return ''; } $q = $s{0}; switch( $q ){ case "'": case '"': case '`': $s = substr( $s, 1, -1 ); return str_replace( "\\$q", $q, $s ); default: trigger_error( "Bad quote character ($q) at offset 0", E_USER_NOTICE ); return $s; } } function loco_extract_php( array $tokens, $fileref = '' ){ $extractor = new LocoPHPExtractor; return $extractor->extract( $tokens, $fileref ); } final class LocoPHPExtractor { private static $rules = array ( '_' => 's', 'gettext' => 's', 'dgettext' => '_s', 'ngettext' => 'sp', 'dngettext' => '_sp', '__' => 's', '_e' => 's', '_c' => 's', '_n' => 'sp', '_n_noop' => 'sp', '_nc' => 'sp', '__ngettext' => 'sp', '__ngettext_noop' => 'sp', '_x' => 'sc', '_ex' => 'sc', '_nx' => 'sp_c', '_nx_noop' => 'spc', '_n_js' => 'sp', '_nx_js' => 'spc', 'esc_attr__' => 's', 'esc_html__' => 's', 'esc_attr_e' => 's', 'esc_html_e' => 's', 'esc_attr_x' => 'sc', 'esc_html_x' => 'sc', 'comments_number_link' => '_sp', 't' => 's', 'st' => 's', 'trans' => 's', 'transChoice' => 'sp', ); private $exp = array(); private $reg = array(); public function extract( array $tokens, $fileref = '' ){ $tokens = new PHPTokens( $tokens ); $tokens->ignore( T_WHITESPACE ); $comment = ''; foreach( $tokens as $tok ){ if( isset($args) ){ if( ')' === $tok ){ isset($arg) and $arg and $args[] = $arg; $this->push( $rule, $args, $comment, $ref ); unset($args,$arg); $comment = ''; } else if( ',' === $tok ){ isset($arg) and $arg and $args[] = $arg; unset($arg); } else if( isset($arg) ){ $arg[] = $tok; } else { $arg = array( $tok ); } } else if( is_array($tok) ){ list($t,$s) = $tok; if( T_COMMENT === $t || T_DOC_COMMENT === $t ){ $comment = $s; } else if( T_STRING === $t && isset(self::$rules[$s]) && '(' === $tokens->advance() ){ $rule = self::$rules[$s]; $args = array(); $ref = $fileref ? $fileref.':'.$tok[2]: ''; } else if( $comment && false === stripos($comment, 'translators') ){ $comment = ''; } } } return $this->exp; } private function push( $rule, array $args, $comment = '', $ref = '' ){ $s = strpos( $rule, 's'); $p = strpos( $rule, 'p'); $c = strpos( $rule, 'c'); foreach( $args as $i => $tokens ){ if( 1 === count($tokens) && is_array($tokens[0]) && T_CONSTANT_ENCAPSED_STRING === $tokens[0][0] ){ $args[$i] = decapse_string( $tokens[0][1] ); } else { $args[$i] = null; } } $key = $msgid = $args[$s]; if( ! $msgid ){ return null; } $entry = array ( 'id' => '', 'source' => $msgid, 'target' => '', ); if( $c && isset($args[$c]) ){ $entry['context'] = $args[$c]; $key .= "\0". $args[$c]; } if( $ref ){ $entry['refs'] = $ref; } if( $comment ){ if( '*' === $comment{1} ){ $lines = array(); foreach( explode("\n", $comment) as $line ){ $line and $lines[] = trim($line,"/* \r\t"); } $lines and $entry['comment'] = implode(" ", $lines); } else { $comment = trim( $comment,"/ \n\r\t" ) and $entry['comment'] = $comment; } } if( isset($this->reg[$key]) ){ $index = $this->reg[$key]; $a = array(); isset($this->exp[$index]['refs']) and $a[] = $this->exp[$index]['refs']; isset($entry['refs']) and $a[] = $entry['refs']; $a && $this->exp[$index]['refs'] = implode(" ", $a ); $a = array(); isset($this->exp[$index]['comment']) and $a[] = $this->exp[$index]['comment']; isset($entry['comment']) and $a[] = $entry['comment']; $a && $this->exp[$index]['comment'] = implode("\n", $a ); } else { $index = count($this->exp); $this->reg[$key] = $index; $this->exp[] = $entry; } if( $p && isset($args[$p]) ){ $msgid_plural = $args[$p]; $entry = array ( 'id' => '', 'source' => $msgid_plural, 'target' => '', 'plural' => 1, 'parent' => $index, ); $key = $msgid_plural."\0\0"; if( isset($this->reg[$key]) ){ $plural_index = $this->reg[$key]; $this->exp[$plural_index] = $entry; } else { $plural_index = count($this->exp); $this->reg[$key] = $plural_index; $this->exp[] = $entry; } } return $index; } public function get_xgettext( $input = '-' ){ $cmd = defined('WHICH_XGETTEXT') ? WHICH_XGETTEXT : 'xgettext'; $cmd.= ' -LPHP -c -o-'; if( $k = $this->get_xgettext_keywords() ){ $cmd.= ' -k'.implode(' -k', $k ); } return $cmd.' '.$input; } public function get_xgettext_keywords(){ $ks = array(); foreach( self::$rules as $word => $rule ){ $s = strpos( $rule, 's'); $k = $word.':'.++$s; if( false !== $p = strpos( $rule, 'p') ){ $k.= ','.++$p; } if( false !== $p = strpos( $rule, 'c') ){ $k.= ','.++$p.'c'; } $ks[] = $k; } return $ks; } } define('WHICH_MSGFMT','/usr/bin/msgfmt'); function loco_compile_mo( $po ){ $descriptorspec = array( 0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'), ); $cmd = WHICH_MSGFMT.' -o - -'; $process = proc_open($cmd, $descriptorspec, $pipes ); if( ! $process ){ throw new Exception('Failed to open process to '.$cmd); } fwrite($pipes[0], $po); fclose($pipes[0]); $err = stream_get_contents($pipes[2]); fclose($pipes[2]); $mo = stream_get_contents($pipes[1]); fclose($pipes[1]); $e = proc_close($process); if( 0 !== $e ){ $err and trigger_error( $err, E_USER_WARNING ); throw new Exception('Gettext msgfmt exited with code '.sprintf('%d',$e).'; Got '.strlen($mo).' bytes from '.strlen($po).' bytes'); } return $mo; } function loco_po_stats( array $po ){ $t = $n = $f = $u = 0; foreach( $po as $r ){ if( ! isset($r['source']) || '' === $r['source'] ){ continue; } if( isset($r['parent']) && is_int($r['parent']) ){ continue; } $t++; if( '' === $r['target'] ){ $u++; } else if( isset($r['flag']) && LOCO_FLAG_FUZZY === $r['flag'] ){ $f++; } else { $n++; } } $r = $t && $n ? $n / $t : 0; $p = (string) round( $r * 100 ); return compact('t','p','f','u'); }
lib/build/locales-compiled.php CHANGED
@@ -2,6 +2,6 @@
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
- * @date Tue, 23 Jul 2013 15:05:30 +0100
6
  */
7
  return unserialize('a:130:{s:5:"af_ZA";s:24:"Afrikaans (South Africa)";s:5:"ar_AE";s:29:"Arabic (United Arab Emirates)";s:5:"ar_IL";s:15:"Arabic (Israel)";s:5:"az_TR";s:20:"Azerbaijani (Turkey)";s:5:"bg_BG";s:9:"Bulgarian";s:5:"bn_BD";s:20:"Bengali (Bangladesh)";s:5:"bs_BA";s:30:"Bosnian (Bosnia & Herzegovina)";s:5:"cs_CZ";s:5:"Czech";s:5:"cy_GB";s:5:"Welsh";s:5:"da_DK";s:6:"Danish";s:5:"de_AT";s:16:"German (Austria)";s:5:"de_CH";s:20:"German (Switzerland)";s:5:"de_DE";s:6:"German";s:5:"el_CY";s:14:"Greek (Cyprus)";s:5:"el_GR";s:5:"Greek";s:5:"en_AE";s:30:"English (United Arab Emirates)";s:5:"en_AU";s:19:"English (Australia)";s:5:"en_CA";s:16:"English (Canada)";s:5:"en_GB";s:12:"English (UK)";s:5:"en_HK";s:19:"English (Hong Kong)";s:5:"en_IE";s:17:"English (Ireland)";s:5:"en_IN";s:15:"English (India)";s:5:"en_NZ";s:21:"English (New Zealand)";s:5:"en_SG";s:19:"English (Singapore)";s:5:"en_US";s:13:"English (USA)";s:5:"en_ZA";s:22:"English (South Africa)";s:5:"es_AR";s:19:"Spanish (Argentina)";s:5:"es_BO";s:17:"Spanish (Bolivia)";s:5:"es_CL";s:15:"Spanish (Chile)";s:5:"es_CO";s:18:"Spanish (Colombia)";s:5:"es_CR";s:20:"Spanish (Costa Rica)";s:5:"es_CU";s:14:"Spanish (Cuba)";s:5:"es_DO";s:28:"Spanish (Dominican Republic)";s:5:"es_EC";s:17:"Spanish (Ecuador)";s:5:"es_ES";s:7:"Spanish";s:5:"es_GT";s:19:"Spanish (Guatemala)";s:5:"es_HN";s:18:"Spanish (Honduras)";s:5:"es_MX";s:16:"Spanish (Mexico)";s:5:"es_NI";s:19:"Spanish (Nicaragua)";s:5:"es_PA";s:16:"Spanish (Panama)";s:5:"es_PE";s:14:"Spanish (Peru)";s:5:"es_PY";s:18:"Spanish (Paraguay)";s:5:"es_SV";s:21:"Spanish (El Salvador)";s:5:"es_UY";s:17:"Spanish (Uruguay)";s:5:"es_VE";s:19:"Spanish (Venezuela)";s:5:"et_EE";s:8:"Estonian";s:5:"fa_AF";s:21:"Persian (Afghanistan)";s:5:"fa_IR";s:13:"Persian (Iran";s:5:"fi_FI";s:7:"Finnish";s:5:"fo_DK";s:17:"Faroese (Denmark)";s:5:"fo_FO";s:23:"Faroese (Faroe Islands)";s:5:"fr_BE";s:16:"French (Belgium)";s:5:"fr_CA";s:15:"French (Canada)";s:5:"fr_CH";s:20:"French (Switzerland)";s:5:"fr_FR";s:6:"French";s:5:"fr_HT";s:14:"French (Haiti)";s:5:"ga_IE";s:15:"Irish (Ireland)";s:5:"gl_ES";s:16:"Galician (Spain)";s:5:"gn_PY";s:18:"Guarani (Paraguay)";s:5:"he_IL";s:15:"Hebrew (Israel)";s:5:"hi_IN";s:13:"Hindi (India)";s:5:"hr_HR";s:8:"Croatian";s:5:"ht_HT";s:14:"Haitian Creole";s:5:"hu_HU";s:9:"Hungarian";s:5:"hy_AM";s:8:"Armenian";s:5:"id_ID";s:10:"Indonesian";s:5:"is_IS";s:9:"Icelandic";s:5:"it_CH";s:21:"Italian (Switzerland)";s:5:"it_IT";s:7:"Italian";s:5:"ja_JP";s:8:"Japanese";s:5:"jv_ID";s:20:"Javanese (Indonesia)";s:5:"ka_GE";s:8:"Georgian";s:5:"kk_KZ";s:6:"Kazakh";s:5:"kn_IN";s:15:"Kannada (India)";s:5:"ko_KR";s:6:"Korean";s:5:"lb_LU";s:13:"Luxembourgish";s:5:"li_NL";s:24:"Limburgish (Netherlands)";s:5:"lo_LA";s:10:"Lao (Laos)";s:5:"lt_LT";s:10:"Lithuanian";s:5:"lv_LV";s:7:"Latvian";s:5:"mg_MG";s:21:"Malagasy (Madagascar)";s:5:"ms_MY";s:16:"Malay (Malaysia)";s:5:"mt_MT";s:7:"Maltese";s:5:"my_MM";s:17:"Burmese (Myanmar)";s:5:"nb_NO";s:7:"Bokmål";s:5:"ne_NP";s:6:"Nepali";s:5:"nl_BE";s:15:"Dutch (Belgium)";s:5:"nl_NL";s:5:"Dutch";s:5:"nn_NO";s:7:"Nynorsk";s:5:"no_NO";s:9:"Norwegian";s:5:"os_GE";s:18:"Ossetian (Georgia)";s:5:"os_RU";s:17:"Ossetian (Russia)";s:5:"os_TR";s:17:"Ossetian (Turkey)";s:5:"pa_IN";s:15:"Punjabi (India)";s:5:"pl_PL";s:6:"Polish";s:5:"pt_BR";s:19:"Portuguese (Brazil)";s:5:"pt_PT";s:10:"Portuguese";s:5:"ro_RO";s:8:"Romanian";s:5:"ru_RU";s:7:"Russian";s:5:"ru_UA";s:17:"Russian (Ukraine)";s:5:"sa_IN";s:16:"Sanskrit (India)";s:5:"sc_IT";s:17:"Sardinian (Italy)";s:5:"sd_PK";s:17:"Sindhi (Pakistan)";s:5:"si_LK";s:19:"Sinhala (Sri Lanka)";s:5:"sk_SK";s:6:"Slovak";s:5:"sl_SI";s:9:"Slovenian";s:5:"so_SO";s:6:"Somali";s:5:"sq_AL";s:18:"Albanian (Albania)";s:5:"sr_RS";s:7:"Serbian";s:5:"su_ID";s:21:"Sundanese (Indonesia)";s:5:"sv_SE";s:7:"Swedish";s:5:"sw_KE";s:15:"Swahili (Kenya)";s:5:"sw_KM";s:17:"Swahili (Comoros)";s:5:"sw_TZ";s:18:"Swahili (Tanzania)";s:5:"sw_UG";s:16:"Swahili (Uganda)";s:5:"ta_IN";s:13:"Tamil (India)";s:5:"ta_LK";s:17:"Tamil (Sri Lanka)";s:5:"te_IN";s:14:"Telugu (India)";s:5:"tg_TJ";s:18:"Tajik (Tajikistan)";s:5:"th_TW";s:13:"Thai (Taiwan)";s:5:"tr_TR";s:7:"Turkish";s:5:"ug_CN";s:14:"Uyghur (China)";s:5:"uk_UA";s:19:"Ukrainian (Ukraine)";s:5:"ur_IN";s:12:"Urdu (India)";s:5:"ur_PK";s:15:"Urdu (Pakistan)";s:5:"uz_UZ";s:18:"Uzbek (Uzbekistan)";s:5:"vi_VN";s:10:"Vietnamese";s:5:"zh_CN";s:7:"Chinese";s:5:"zh_HK";s:19:"Chinese (Hong Kong)";s:5:"zh_TW";s:16:"Chinese (Taiwan)";}');
2
  /**
3
  * Compiled source code - DO NOT EDIT!
4
  * @author Tim Whitlock http://timwhitlock.info/
5
+ * @date Wed, 31 Jul 2013 17:03:28 +0100
6
  */
7
  return unserialize('a:130:{s:5:"af_ZA";s:24:"Afrikaans (South Africa)";s:5:"ar_AE";s:29:"Arabic (United Arab Emirates)";s:5:"ar_IL";s:15:"Arabic (Israel)";s:5:"az_TR";s:20:"Azerbaijani (Turkey)";s:5:"bg_BG";s:9:"Bulgarian";s:5:"bn_BD";s:20:"Bengali (Bangladesh)";s:5:"bs_BA";s:30:"Bosnian (Bosnia & Herzegovina)";s:5:"cs_CZ";s:5:"Czech";s:5:"cy_GB";s:5:"Welsh";s:5:"da_DK";s:6:"Danish";s:5:"de_AT";s:16:"German (Austria)";s:5:"de_CH";s:20:"German (Switzerland)";s:5:"de_DE";s:6:"German";s:5:"el_CY";s:14:"Greek (Cyprus)";s:5:"el_GR";s:5:"Greek";s:5:"en_AE";s:30:"English (United Arab Emirates)";s:5:"en_AU";s:19:"English (Australia)";s:5:"en_CA";s:16:"English (Canada)";s:5:"en_GB";s:12:"English (UK)";s:5:"en_HK";s:19:"English (Hong Kong)";s:5:"en_IE";s:17:"English (Ireland)";s:5:"en_IN";s:15:"English (India)";s:5:"en_NZ";s:21:"English (New Zealand)";s:5:"en_SG";s:19:"English (Singapore)";s:5:"en_US";s:13:"English (USA)";s:5:"en_ZA";s:22:"English (South Africa)";s:5:"es_AR";s:19:"Spanish (Argentina)";s:5:"es_BO";s:17:"Spanish (Bolivia)";s:5:"es_CL";s:15:"Spanish (Chile)";s:5:"es_CO";s:18:"Spanish (Colombia)";s:5:"es_CR";s:20:"Spanish (Costa Rica)";s:5:"es_CU";s:14:"Spanish (Cuba)";s:5:"es_DO";s:28:"Spanish (Dominican Republic)";s:5:"es_EC";s:17:"Spanish (Ecuador)";s:5:"es_ES";s:7:"Spanish";s:5:"es_GT";s:19:"Spanish (Guatemala)";s:5:"es_HN";s:18:"Spanish (Honduras)";s:5:"es_MX";s:16:"Spanish (Mexico)";s:5:"es_NI";s:19:"Spanish (Nicaragua)";s:5:"es_PA";s:16:"Spanish (Panama)";s:5:"es_PE";s:14:"Spanish (Peru)";s:5:"es_PY";s:18:"Spanish (Paraguay)";s:5:"es_SV";s:21:"Spanish (El Salvador)";s:5:"es_UY";s:17:"Spanish (Uruguay)";s:5:"es_VE";s:19:"Spanish (Venezuela)";s:5:"et_EE";s:8:"Estonian";s:5:"fa_AF";s:21:"Persian (Afghanistan)";s:5:"fa_IR";s:13:"Persian (Iran";s:5:"fi_FI";s:7:"Finnish";s:5:"fo_DK";s:17:"Faroese (Denmark)";s:5:"fo_FO";s:23:"Faroese (Faroe Islands)";s:5:"fr_BE";s:16:"French (Belgium)";s:5:"fr_CA";s:15:"French (Canada)";s:5:"fr_CH";s:20:"French (Switzerland)";s:5:"fr_FR";s:6:"French";s:5:"fr_HT";s:14:"French (Haiti)";s:5:"ga_IE";s:15:"Irish (Ireland)";s:5:"gl_ES";s:16:"Galician (Spain)";s:5:"gn_PY";s:18:"Guarani (Paraguay)";s:5:"he_IL";s:15:"Hebrew (Israel)";s:5:"hi_IN";s:13:"Hindi (India)";s:5:"hr_HR";s:8:"Croatian";s:5:"ht_HT";s:14:"Haitian Creole";s:5:"hu_HU";s:9:"Hungarian";s:5:"hy_AM";s:8:"Armenian";s:5:"id_ID";s:10:"Indonesian";s:5:"is_IS";s:9:"Icelandic";s:5:"it_CH";s:21:"Italian (Switzerland)";s:5:"it_IT";s:7:"Italian";s:5:"ja_JP";s:8:"Japanese";s:5:"jv_ID";s:20:"Javanese (Indonesia)";s:5:"ka_GE";s:8:"Georgian";s:5:"kk_KZ";s:6:"Kazakh";s:5:"kn_IN";s:15:"Kannada (India)";s:5:"ko_KR";s:6:"Korean";s:5:"lb_LU";s:13:"Luxembourgish";s:5:"li_NL";s:24:"Limburgish (Netherlands)";s:5:"lo_LA";s:10:"Lao (Laos)";s:5:"lt_LT";s:10:"Lithuanian";s:5:"lv_LV";s:7:"Latvian";s:5:"mg_MG";s:21:"Malagasy (Madagascar)";s:5:"ms_MY";s:16:"Malay (Malaysia)";s:5:"mt_MT";s:7:"Maltese";s:5:"my_MM";s:17:"Burmese (Myanmar)";s:5:"nb_NO";s:7:"Bokmål";s:5:"ne_NP";s:6:"Nepali";s:5:"nl_BE";s:15:"Dutch (Belgium)";s:5:"nl_NL";s:5:"Dutch";s:5:"nn_NO";s:7:"Nynorsk";s:5:"no_NO";s:9:"Norwegian";s:5:"os_GE";s:18:"Ossetian (Georgia)";s:5:"os_RU";s:17:"Ossetian (Russia)";s:5:"os_TR";s:17:"Ossetian (Turkey)";s:5:"pa_IN";s:15:"Punjabi (India)";s:5:"pl_PL";s:6:"Polish";s:5:"pt_BR";s:19:"Portuguese (Brazil)";s:5:"pt_PT";s:10:"Portuguese";s:5:"ro_RO";s:8:"Romanian";s:5:"ru_RU";s:7:"Russian";s:5:"ru_UA";s:17:"Russian (Ukraine)";s:5:"sa_IN";s:16:"Sanskrit (India)";s:5:"sc_IT";s:17:"Sardinian (Italy)";s:5:"sd_PK";s:17:"Sindhi (Pakistan)";s:5:"si_LK";s:19:"Sinhala (Sri Lanka)";s:5:"sk_SK";s:6:"Slovak";s:5:"sl_SI";s:9:"Slovenian";s:5:"so_SO";s:6:"Somali";s:5:"sq_AL";s:18:"Albanian (Albania)";s:5:"sr_RS";s:7:"Serbian";s:5:"su_ID";s:21:"Sundanese (Indonesia)";s:5:"sv_SE";s:7:"Swedish";s:5:"sw_KE";s:15:"Swahili (Kenya)";s:5:"sw_KM";s:17:"Swahili (Comoros)";s:5:"sw_TZ";s:18:"Swahili (Tanzania)";s:5:"sw_UG";s:16:"Swahili (Uganda)";s:5:"ta_IN";s:13:"Tamil (India)";s:5:"ta_LK";s:17:"Tamil (Sri Lanka)";s:5:"te_IN";s:14:"Telugu (India)";s:5:"tg_TJ";s:18:"Tajik (Tajikistan)";s:5:"th_TW";s:13:"Thai (Taiwan)";s:5:"tr_TR";s:7:"Turkish";s:5:"ug_CN";s:14:"Uyghur (China)";s:5:"uk_UA";s:19:"Ukrainian (Ukraine)";s:5:"ur_IN";s:12:"Urdu (India)";s:5:"ur_PK";s:15:"Urdu (Pakistan)";s:5:"uz_UZ";s:18:"Uzbek (Uzbekistan)";s:5:"vi_VN";s:10:"Vietnamese";s:5:"zh_CN";s:7:"Chinese";s:5:"zh_HK";s:19:"Chinese (Hong Kong)";s:5:"zh_TW";s:16:"Chinese (Taiwan)";}');
lib/loco-admin.php CHANGED
@@ -126,13 +126,13 @@ abstract class LocoAdmin {
126
  foreach( wp_get_themes( array( 'allowed' => true ) ) as $name => $theme ){
127
  $root = $theme->get_theme_root().'/'.$name;
128
  $name = $theme->get('Name');
129
- $themes[] = self::init_package_args($root) + compact('name');
130
  }
131
  // @var $plugin array
132
  foreach( get_plugins() as $subpath => $plugin ){
133
  $root = WP_PLUGIN_DIR.'/'.dirname($subpath);
134
  $name = $plugin['Name'];
135
- $plugins[] = self::init_package_args($root) + compact('name');
136
  }
137
  // order most active first
138
  $sorter = array( __CLASS__, 'sort_packages' );
@@ -142,7 +142,7 @@ abstract class LocoAdmin {
142
  $update = '';
143
  if( $updates = get_site_transient('update_plugins') ){
144
  $key = Loco::NS.'/loco.php';
145
- if( isset($updates->checked[$key]) && 1 === version_compare( Loco::VERSION, $updates->checked[$key] ) ){
146
  $update = $updates->checked[$key];
147
  }
148
  }
@@ -158,7 +158,7 @@ abstract class LocoAdmin {
158
  * initialize template arguments for a plugin or theme table row
159
  * @return array
160
  */
161
- private function init_package_args( $root ){
162
  $files = self::find_po( $root );
163
  // filesystem warning. Only want one though
164
  $warnings = array();
@@ -179,7 +179,43 @@ abstract class LocoAdmin {
179
  $warnings[] = sprintf( Loco::__('"%s" folder not writable'), basename($dir) );
180
  }
181
  }
182
- return $files + compact('root','warnings');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  }
184
 
185
 
@@ -188,12 +224,10 @@ abstract class LocoAdmin {
188
  * Sort packages according to most recently updated language files
189
  */
190
  private static function sort_packages( array $a, array $b ){
191
- $atime = self::newest_mtime_recursive( $a['po'], $a['pot'] );
192
- $btime = self::newest_mtime_recursive( $b['po'], $b['pot'] );
193
- if( $atime > $btime ){
194
  return -1;
195
  }
196
- if( $btime > $atime ){
197
  return 1;
198
  }
199
  return 0;
@@ -215,6 +249,7 @@ abstract class LocoAdmin {
215
  }
216
 
217
 
 
218
  /**
219
  * Initialize a new PO file from a locale code
220
  * @return string path where PO file will be saved to
@@ -296,9 +331,7 @@ abstract class LocoAdmin {
296
  // remove header and check if empty
297
  $minlength = 1;
298
  if( isset($data[0]) && $data[0]['source'] === '' ){
299
- // @todo something useful with headers
300
- // var_dump( loco_parse_po_headers($data[0]['target']) );
301
- $data[0] = array( /* dummy, avoids index errors */ );
302
  $minlength = 2;
303
  }
304
  // template file is developer-editable and has no locale
@@ -545,6 +578,23 @@ abstract class LocoAdmin {
545
 
546
 
547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
 
549
  /**
550
  * Resolve a list of PO file paths to locale instances
@@ -567,7 +617,7 @@ abstract class LocoAdmin {
567
  */
568
  public static function resolve_file_locale( $path ){
569
  $stub = str_replace( '.po', '', basename($path) );
570
- $locale = loco_locale_resolve($stub) or $locale = new LocoLocale;
571
  return $locale;
572
  }
573
 
@@ -655,7 +705,27 @@ abstract class LocoAdmin {
655
  }
656
  return date_i18n( $df.' '.$tf, $u );
657
  }
658
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
 
660
  }
661
 
126
  foreach( wp_get_themes( array( 'allowed' => true ) ) as $name => $theme ){
127
  $root = $theme->get_theme_root().'/'.$name;
128
  $name = $theme->get('Name');
129
+ $themes[] = self::init_package_args( $root, $name, 'theme' );
130
  }
131
  // @var $plugin array
132
  foreach( get_plugins() as $subpath => $plugin ){
133
  $root = WP_PLUGIN_DIR.'/'.dirname($subpath);
134
  $name = $plugin['Name'];
135
+ $plugins[] = self::init_package_args( $root, $name, 'plugin' );
136
  }
137
  // order most active first
138
  $sorter = array( __CLASS__, 'sort_packages' );
142
  $update = '';
143
  if( $updates = get_site_transient('update_plugins') ){
144
  $key = Loco::NS.'/loco.php';
145
+ if( isset($updates->checked[$key]) && 1 === version_compare( $updates->checked[$key], Loco::VERSION ) ){
146
  $update = $updates->checked[$key];
147
  }
148
  }
158
  * initialize template arguments for a plugin or theme table row
159
  * @return array
160
  */
161
+ private function init_package_args( $root, $name, $type ){
162
  $files = self::find_po( $root );
163
  // filesystem warning. Only want one though
164
  $warnings = array();
179
  $warnings[] = sprintf( Loco::__('"%s" folder not writable'), basename($dir) );
180
  }
181
  }
182
+ // find newest file in package to establish cache invalidation
183
+ $mtime = self::newest_mtime_recursive( $files['po'], $files['pot'] );
184
+ // get meta data or re-generate meta data from files
185
+ $mkey = $type.'_'.$name;
186
+ $meta = Loco::cached( $mkey );
187
+ if( ! $meta || $mtime > $meta['mtime'] || Loco::VERSION !== $meta['v'] ){
188
+ $pot = $po = array();
189
+ foreach( $files['pot'] as $pot_path ){
190
+ $pot[] = array (
191
+ 'path' => $pot_path,
192
+ );
193
+ }
194
+ // get progress and locale for each PO file
195
+ foreach( $files['po'] as $po_path ){
196
+ try {
197
+ unset($headers);
198
+ $export = self::parse_po_with_headers( $po_path, $headers );
199
+ $stats = loco_po_stats( $export );
200
+ }
201
+ catch( Exception $Ex ){
202
+ // self::warning( $Ex->getMessage() );
203
+ continue;
204
+ }
205
+ $po[] = array (
206
+ 'path' => $po_path,
207
+ 'name' => str_replace( array('.po',$name), array('',''), basename($po_path) ),
208
+ 'stats' => $stats,
209
+ 'status' => self::format_progress_summary($stats),
210
+ 'length' => count( $export ),
211
+ 'locale' => LocoAdmin::resolve_file_locale($po_path),
212
+ );
213
+ }
214
+ $meta = compact('mtime','po','pot');
215
+ $meta['v'] = Loco::VERSION;
216
+ Loco::cache( $mkey, $meta );
217
+ }
218
+ return $meta + compact('root','warnings','name');
219
  }
220
 
221
 
224
  * Sort packages according to most recently updated language files
225
  */
226
  private static function sort_packages( array $a, array $b ){
227
+ if( $a['mtime'] > $b['mtime'] ){
 
 
228
  return -1;
229
  }
230
+ if( $b['mtime'] > $a['mtime'] ){
231
  return 1;
232
  }
233
  return 0;
249
  }
250
 
251
 
252
+
253
  /**
254
  * Initialize a new PO file from a locale code
255
  * @return string path where PO file will be saved to
331
  // remove header and check if empty
332
  $minlength = 1;
333
  if( isset($data[0]) && $data[0]['source'] === '' ){
334
+ $data[0] = array();
 
 
335
  $minlength = 2;
336
  }
337
  // template file is developer-editable and has no locale
578
 
579
 
580
 
581
+ /**
582
+ * Parse PO or POT file, placing header object into argument
583
+ */
584
+ private static function parse_po_with_headers( $path, &$headers ){
585
+ $export = self::parse_po( $path );
586
+ if( ! isset($export[0]) ){
587
+ throw new Exception('Empty or invalid PO file');
588
+ }
589
+ if( $export[0]['source'] !== '' ){
590
+ throw new Exception('PO file has no header');
591
+ }
592
+ $headers = loco_parse_po_headers( $export[0]['target'] );
593
+ $export[0] = array(); // <- avoid index errors as json
594
+ return $export;
595
+ }
596
+
597
+
598
 
599
  /**
600
  * Resolve a list of PO file paths to locale instances
617
  */
618
  public static function resolve_file_locale( $path ){
619
  $stub = str_replace( '.po', '', basename($path) );
620
+ $locale = loco_locale_resolve($stub);
621
  return $locale;
622
  }
623
 
705
  }
706
  return date_i18n( $df.' '.$tf, $u );
707
  }
708
+
709
+
710
+
711
+ /**
712
+ * PO translate progress summary
713
+ */
714
+ public static function format_progress_summary( array $stats ){
715
+ extract( $stats );
716
+ $text = sprintf( Loco::__('%s%% translated'), $p ).', '.sprintf( Loco::_n('1 string', '%s strings', $t ), number_format($t) );
717
+ $extra = array();
718
+ if( $f ){
719
+ $extra[] = sprintf( Loco::__('%s fuzzy'), number_format($f) );
720
+ }
721
+ if( $u ){
722
+ $extra[] = sprintf( Loco::__('%s unstranslated'), number_format($f) );
723
+ }
724
+ if( $extra ){
725
+ $text .= ' ('.implode(', ',$extra).')';
726
+ }
727
+ return $text;
728
+ }
729
 
730
  }
731
 
lib/loco-boot.php CHANGED
@@ -8,8 +8,11 @@ abstract class Loco {
8
  /** plugin namespace */
9
  const NS = 'loco-translate';
10
 
11
- const VERSION = '1.0.0';
12
  const CAPABILITY = 'manage_options';
 
 
 
13
 
14
  /* call Wordpress __ with our text domain */
15
  public static function __( $msgid = '' ){
@@ -171,5 +174,61 @@ abstract class Loco {
171
  }
172
  return $post;
173
  }
174
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  }
 
 
 
 
 
 
 
 
 
 
8
  /** plugin namespace */
9
  const NS = 'loco-translate';
10
 
11
+ const VERSION = '1.1.0';
12
  const CAPABILITY = 'manage_options';
13
+
14
+ /* whether to enable APC cache */
15
+ public static $apc_enabled;
16
 
17
  /* call Wordpress __ with our text domain */
18
  public static function __( $msgid = '' ){
174
  }
175
  return $post;
176
  }
177
+
178
+
179
+
180
+ /**
181
+ * Abstraction of cache retrieval, using apc where possible
182
+ * @return mixed
183
+ */
184
+ public static function cached( $key ){
185
+ $key = self::cache_key($key);
186
+ if( self::$apc_enabled ){
187
+ return apc_fetch( $key );
188
+ }
189
+ return get_transient( $key );
190
+ }
191
+
192
+
193
+
194
+ /**
195
+ * Abstraction of cache storage, using apc where possible
196
+ * @return void
197
+ */
198
+ public static function cache( $key, $value, $ttl = 0 ){
199
+ $key = self::cache_key($key);
200
+ if( self::$apc_enabled ){
201
+ apc_store( $key, $value, $ttl );
202
+ return;
203
+ }
204
+ if( ! $ttl ){
205
+ // WP would expire immediately as opposed to never
206
+ $ttl = 31536000;
207
+ }
208
+ set_transient( $key, $value, $ttl );
209
+ }
210
+
211
+
212
+
213
+ /**
214
+ * Sanitize a cache key
215
+ */
216
+ private static function cache_key( $key ){
217
+ $key = 'loco_'.preg_replace('/[^a-z]+/','_', strtolower($key) );
218
+ if( isset($key{45}) ){
219
+ $key = 'loco_'.md5($key);
220
+ }
221
+ return $key;
222
+ }
223
+
224
  }
225
+
226
+
227
+
228
+
229
+ // minimum config
230
+ Loco::$apc_enabled = function_exists('apc_fetch') && ini_get('apc.enabled');
231
+
232
+
233
+
234
+
lib/loco-locales.php CHANGED
@@ -9,11 +9,15 @@
9
  * @return LocoLocale
10
  */
11
  function loco_locale_resolve( $s ){
12
- if( preg_match('/([a-z]{2})(?:(?:-|_)([a-z]{2}))?$/i', $s, $r ) ){
13
- $lc = strtolower( $r[1] );
14
- $cc = isset($r[2]) ? strtoupper($r[2]) : '';
15
- return LocoLocale::init( $lc, $cc );
 
 
 
16
  }
 
17
  }
18
 
19
 
@@ -32,7 +36,6 @@ final class LocoLocale {
32
  private function __construct( $lc, $cc ){
33
  $lc and $this->lang = $lc;
34
  $cc and $this->region = $cc;
35
- $this->label = Loco::__('Unknown language');
36
  }
37
 
38
  private function __import( $lc, $cc, array $raw ){
@@ -46,15 +49,19 @@ final class LocoLocale {
46
  }
47
 
48
  public function __toString(){
49
- return $this->get_code().', '.$this->label;
 
 
 
 
50
  }
51
 
52
  public function get_code(){
53
- return $this->lang && $this->region ? $this->lang.'_'.$this->region : ( $this->lang ? $this->lang : 'zz' ) ;
54
  }
55
 
56
  public function get_name(){
57
- return $this->label;
58
  }
59
 
60
  public function equal_to( LocoLocale $locale ){
9
  * @return LocoLocale
10
  */
11
  function loco_locale_resolve( $s ){
12
+ $lc = '';
13
+ $cc = '';
14
+ if( preg_match('/(?:^|\W)([a-z]{2})(?:(?:-|_)([a-z]{2}))?$/i', $s, $r ) ){
15
+ $lc = strtolower($r[1]);
16
+ if( isset($r[2]) ){
17
+ $cc = strtoupper($r[2]);
18
+ }
19
  }
20
+ return LocoLocale::init( $lc, $cc );
21
  }
22
 
23
 
36
  private function __construct( $lc, $cc ){
37
  $lc and $this->lang = $lc;
38
  $cc and $this->region = $cc;
 
39
  }
40
 
41
  private function __import( $lc, $cc, array $raw ){
49
  }
50
 
51
  public function __toString(){
52
+ $str = $this->get_name();
53
+ if( $code = $this->get_code() ){
54
+ $str = $code.', '.$str;
55
+ }
56
+ return $str;
57
  }
58
 
59
  public function get_code(){
60
+ return $this->lang && $this->region ? $this->lang.'_'.$this->region : ( $this->lang ? $this->lang : '' ) ;
61
  }
62
 
63
  public function get_name(){
64
+ return is_null($this->label) ? Loco::__('Unknown language') : $this->label;
65
  }
66
 
67
  public function equal_to( LocoLocale $locale ){
loco.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Loco Translate
4
  Plugin URI: http://wordpress.org/extend/plugins/loco-translate
5
  Description: Translate Wordpress plugins and themes directly in your browser
6
  Author: Tim Whitlock
7
- Version: 1.0.0
8
  Author URI: http://localise.biz/
9
  */
10
 
4
  Plugin URI: http://wordpress.org/extend/plugins/loco-translate
5
  Description: Translate Wordpress plugins and themes directly in your browser
6
  Author: Tim Whitlock
7
+ Version: 1.1.0
8
  Author URI: http://localise.biz/
9
  */
10
 
pub/css/build/poedit-compiled.css CHANGED
@@ -30,6 +30,8 @@
30
  .wrap #loco-poedit .is-table .wg-tr.selected { background-color: #3875d7; color: #fff; }
31
  .wrap #loco-poedit .is-table .wg-td { white-space: nowrap; line-height: 1.2em; margin: 0.3em 4px; -o-text-overflow: ellipsis; text-overflow: ellipsis; overflow: hidden; }
32
  .wrap #loco-poedit .is-table .wg-tbody .not-first .wg-td { margin-left: 10px; }
 
 
33
  .wrap #loco-poedit .is-field > .wg-content { cursor: text; outline: 0; white-space: pre-wrap; }
34
  .wrap #loco-poedit .is-field > .wg-content:focus { -moz-box-shadow: inset 0 0 10px #3875d7; -webkit-box-shadow: inset 0 0 10px #3875d7; box-shadow: inset 0 0 10px #3875d7; }
35
  .wrap #loco-poedit .is-field.readonly > .wg-content { cursor: default; background: #f8f8f8; text-shadow: 0 1px white; }
30
  .wrap #loco-poedit .is-table .wg-tr.selected { background-color: #3875d7; color: #fff; }
31
  .wrap #loco-poedit .is-table .wg-td { white-space: nowrap; line-height: 1.2em; margin: 0.3em 4px; -o-text-overflow: ellipsis; text-overflow: ellipsis; overflow: hidden; }
32
  .wrap #loco-poedit .is-table .wg-tbody .not-first .wg-td { margin-left: 10px; }
33
+ .wrap #loco-poedit .is-table .wg-cols.filtered .wg-tr { display: none; }
34
+ .wrap #loco-poedit .is-table .wg-cols.filtered .wg-tr.filtered { display: block; }
35
  .wrap #loco-poedit .is-field > .wg-content { cursor: text; outline: 0; white-space: pre-wrap; }
36
  .wrap #loco-poedit .is-field > .wg-content:focus { -moz-box-shadow: inset 0 0 10px #3875d7; -webkit-box-shadow: inset 0 0 10px #3875d7; box-shadow: inset 0 0 10px #3875d7; }
37
  .wrap #loco-poedit .is-field.readonly > .wg-content { cursor: default; background: #f8f8f8; text-shadow: 0 1px white; }
pub/css/build/poedit-import.scss CHANGED
@@ -1 +1 @@
1
- .wg-cell,.wg-cell div{position:relative;box-sizing:border-box}.wg-cell{left:0;top:0;padding:0;margin:0;overflow:hidden}.wg-split{background:#eee}.wg-body:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.wg-split-x>div>.not-first>*{margin-left:6px}.wg-split-y>div>.not-first>*{margin-top:6px}.wg-split>div>.has-title .wg-content{margin-top:0}.wg-split-x>div>.wg-cell{float:left;clear:none;height:100%}.wg-split-x>div{cursor:move;cursor:ew-resize;cursor:col-resize}.wg-split>div>.not-first:before{display:block;position:absolute;overflow:hidden;content:" "}.wg-split-x>div>.not-first:before{width:6px;height:100%;background:transparent url(../../img/wg/splitx.png) center center no-repeat}.wg-split-y>div{cursor:move;cursor:ns-resize;cursor:row-resize}.wg-split-y>div>.not-first:before{height:6px;width:100%;background:transparent url(../../img/wg/splity.png) center center no-repeat}.wg-split>div.locked{cursor:default}.wg-split-x>div.locked>.not-first>*{margin-left:1px}.wg-split-y>div.locked>.not-first>*{margin-top:1px}.wg-split>div.locked>.not-first:before{display:none}.wg-title{background:#ddd;cursor:default!important;margin:0;padding:4px 6px;font-size:1em;white-space:nowrap}.wg-content{background:#fff;cursor:default;padding:4px 6px;overflow-x:hidden;overflow-y:auto;box-sizing:border-box}.is-table .wg-cols{outline:0}.is-table .wg-col{float:left;clear:none}.is-table .wg-title{padding:2px 4px;font-weight:normal}.is-table .wg-thead>div>.not-first:before{background-position:center 1px}.is-table .wg-thead{background:#ddd;border-bottom:solid 1px #ccc}.is-table .wg-tr{height:1.6em;overflow:hidden}.is-table .wg-tr:nth-child(even){background-color:#f3f7fd}.is-table .wg-tr.selected{background-color:#3875d7;color:#fff}.is-table .wg-td{white-space:nowrap;line-height:1.2em;margin:.3em 4px;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden}.is-table .wg-tbody .not-first .wg-td{margin-left:10px}.is-field>.wg-content{cursor:text;outline:0;white-space:pre-wrap}.is-field>.wg-content:focus{-moz-box-shadow:inset 0 0 10px #3875d7;-webkit-box-shadow:inset 0 0 10px #3875d7;box-shadow:inset 0 0 10px #3875d7}.is-field.readonly>.wg-content{cursor:default;background:#f8f8f8;text-shadow:0 1px #fff}.is-field.readonly>.wg-content:focus{-moz-box-shadow:inset 0 0 10px #c00;-webkit-box-shadow:inset 0 0 10px #c00;box-shadow:inset 0 0 10px #c00}.wg-split-x>nav.wg-tabs{white-space:nowrap;text-align:center}.wg-split-x>nav.wg-tabs>a{display:inline-block;padding:.5em 1em;color:#000;text-decoration:none;-moz-border-radius:.2em;-webkit-border-radius:.2em;border-radius:.2em}.wg-split-x>nav.wg-tabs>a:hover{background-color:#f3f7fd}.wg-split-x>nav.wg-tabs>a.active{background-color:#3875d7;color:#fff}@media all and (max-width:768px){.wg-split-x>div>.not-first>*{margin-left:20px}.wg-split-y>div>.not-first>*{margin-top:20px}.wg-split-x>div>.not-first:before{width:20px}.wg-split-y>div>.not-first:before{height:20px}}.is-table .po-fuzzy{color:#b59829;font-weight:bold}.is-table .po-empty{color:#1f507a;font-weight:bold}.is-table .wg-col.first .wg-td:before{font-family:IconFont;display:inline-block;content:" ";width:1.2em;line-height:1}.is-table .wg-col.first .po-unsaved .wg-td:before{content:"\f005";color:#f1d040}.is-table .wg-col.first .po-comment .wg-td:before{content:"\f075";color:#999}#po-list .wg-content{padding:0}#po-source>.wg-body>.has-title>h2{background:transparent;font-weight:normal;float:left;clear:none;min-width:4em}#po-source>.wg-body>.has-title>.wg-content{clear:none}
1
+ .wg-cell,.wg-cell div{position:relative;box-sizing:border-box}.wg-cell{left:0;top:0;padding:0;margin:0;overflow:hidden}.wg-split{background:#eee}.wg-body:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.wg-split-x>div>.not-first>*{margin-left:6px}.wg-split-y>div>.not-first>*{margin-top:6px}.wg-split>div>.has-title .wg-content{margin-top:0}.wg-split-x>div>.wg-cell{float:left;clear:none;height:100%}.wg-split-x>div{cursor:move;cursor:ew-resize;cursor:col-resize}.wg-split>div>.not-first:before{display:block;position:absolute;overflow:hidden;content:" "}.wg-split-x>div>.not-first:before{width:6px;height:100%;background:transparent url(../../img/wg/splitx.png) center center no-repeat}.wg-split-y>div{cursor:move;cursor:ns-resize;cursor:row-resize}.wg-split-y>div>.not-first:before{height:6px;width:100%;background:transparent url(../../img/wg/splity.png) center center no-repeat}.wg-split>div.locked{cursor:default}.wg-split-x>div.locked>.not-first>*{margin-left:1px}.wg-split-y>div.locked>.not-first>*{margin-top:1px}.wg-split>div.locked>.not-first:before{display:none}.wg-title{background:#ddd;cursor:default!important;margin:0;padding:4px 6px;font-size:1em;white-space:nowrap}.wg-content{background:#fff;cursor:default;padding:4px 6px;overflow-x:hidden;overflow-y:auto;box-sizing:border-box}.is-table .wg-cols{outline:0}.is-table .wg-col{float:left;clear:none}.is-table .wg-title{padding:2px 4px;font-weight:normal}.is-table .wg-thead>div>.not-first:before{background-position:center 1px}.is-table .wg-thead{background:#ddd;border-bottom:solid 1px #ccc}.is-table .wg-tr{height:1.6em;overflow:hidden}.is-table .wg-tr:nth-child(even){background-color:#f3f7fd}.is-table .wg-tr.selected{background-color:#3875d7;color:#fff}.is-table .wg-td{white-space:nowrap;line-height:1.2em;margin:.3em 4px;-o-text-overflow:ellipsis;text-overflow:ellipsis;overflow:hidden}.is-table .wg-tbody .not-first .wg-td{margin-left:10px}.is-table .wg-cols.filtered .wg-tr{display:none}.is-table .wg-cols.filtered .wg-tr.filtered{display:block}.is-field>.wg-content{cursor:text;outline:0;white-space:pre-wrap}.is-field>.wg-content:focus{-moz-box-shadow:inset 0 0 10px #3875d7;-webkit-box-shadow:inset 0 0 10px #3875d7;box-shadow:inset 0 0 10px #3875d7}.is-field.readonly>.wg-content{cursor:default;background:#f8f8f8;text-shadow:0 1px #fff}.is-field.readonly>.wg-content:focus{-moz-box-shadow:inset 0 0 10px #c00;-webkit-box-shadow:inset 0 0 10px #c00;box-shadow:inset 0 0 10px #c00}.wg-split-x>nav.wg-tabs{white-space:nowrap;text-align:center}.wg-split-x>nav.wg-tabs>a{display:inline-block;padding:.5em 1em;color:#000;text-decoration:none;-moz-border-radius:.2em;-webkit-border-radius:.2em;border-radius:.2em}.wg-split-x>nav.wg-tabs>a:hover{background-color:#f3f7fd}.wg-split-x>nav.wg-tabs>a.active{background-color:#3875d7;color:#fff}@media all and (max-width:768px){.wg-split-x>div>.not-first>*{margin-left:20px}.wg-split-y>div>.not-first>*{margin-top:20px}.wg-split-x>div>.not-first:before{width:20px}.wg-split-y>div>.not-first:before{height:20px}}.is-table .po-fuzzy{color:#b59829;font-weight:bold}.is-table .po-empty{color:#1f507a;font-weight:bold}.is-table .wg-col.first .wg-td:before{font-family:IconFont;display:inline-block;content:" ";width:1.2em;line-height:1}.is-table .wg-col.first .po-unsaved .wg-td:before{content:"\f005";color:#f1d040}.is-table .wg-col.first .po-comment .wg-td:before{content:"\f075";color:#999}#po-list .wg-content{padding:0}#po-source>.wg-body>.has-title>h2{background:transparent;font-weight:normal;float:left;clear:none;min-width:4em}#po-source>.wg-body>.has-title>.wg-content{clear:none}
pub/css/loco-admin.css CHANGED
@@ -26,6 +26,11 @@ h2 .nav-tab.nav-tab-loco {
26
  float: right;
27
  border-color: transparent;
28
  font-size: 16px;
 
 
 
 
 
29
  }
30
 
31
 
@@ -67,6 +72,17 @@ h2 .nav-tab.nav-tab-loco {
67
  }
68
 
69
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
  /* Warnings and messages */
72
 
@@ -129,6 +145,7 @@ h2 .nav-tab.nav-tab-loco {
129
  margin: 0;
130
  }
131
 
 
132
  #loco-nav button {
133
  display: block;
134
  position: relative;
@@ -172,6 +189,19 @@ h2 .nav-tab.nav-tab-loco {
172
 
173
 
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
 
177
 
26
  float: right;
27
  border-color: transparent;
28
  font-size: 16px;
29
+ color: #2e892e;
30
+ }
31
+
32
+ h2 .nav-tab.nav-tab-loco:hover {
33
+ color: #3db63d;
34
  }
35
 
36
 
72
  }
73
 
74
 
75
+ .wrap .loco-list .loco-details li {
76
+ margin-bottom: 0;
77
+ }
78
+ .wrap .loco-list .loco-mtime {
79
+ color: #999;
80
+ }
81
+ .wrap .loco-list .loco-progress {
82
+ color: #999;
83
+ }
84
+
85
+
86
 
87
  /* Warnings and messages */
88
 
145
  margin: 0;
146
  }
147
 
148
+ #loco-search,
149
  #loco-nav button {
150
  display: block;
151
  position: relative;
189
 
190
 
191
 
192
+ /* additional for search field and text field listener */
193
+ #loco-filter input[type="text"] {
194
+ padding-left: 10px;
195
+ margin-left: 20px;
196
+ width: 300px;
197
+ font-size: 15px;
198
+ }
199
+
200
+ #loco-filter .icon.clear {
201
+ display: none !important;
202
+ }
203
+
204
+
205
 
206
 
207
 
pub/js/build/admin-poedit.js CHANGED
@@ -1,104 +1,144 @@
1
- (function(A,u,d){function M(a){a.stopPropagation();a.preventDefault();return!1}function W(a,c){function k(){g();h=setTimeout(function(){d(a).fadeOut(1E3,c)},f)}function g(){h&&clearTimeout(h);h=null}var h,f=5E3;k();d(a).mouseenter(g).mouseleave(k)}function S(a,c){function k(g){d(a).remove();d(A).triggerHandler("resize");return g&&M(g)}d('<a class="dismiss" href="#">&times;</a>').appendTo(a).click(k);c||W(a,k)}function T(a,c,k,g){var h="loco-js-"+k,k=u.getElementById(h)||d('<div id="'+h+'" class="loco-message '+
2
- (g||k)+'"></div>').insertBefore(d("#loco-poedit")),a=d(u.createElement("p")).text(a),c=d(u.createElement("strong")).text(c+": ");a.prepend(c).appendTo(d(k).html(""));d(A).triggerHandler("resize");S(k)}function U(a){return T(a,O("OK"),"updated loco-success")}function V(a,c,k){function g(a,f,b){b=b||O("Unknown Ajax error");T(b,O("Error"),"error");k&&k(a,f,b)}return d.ajax({url:X,type:a.method,data:d(a).serialize(),dataType:"json",error:g,success:function(a,f,b){!a||a.error?g(b,f,a&&a.error&&a.error.message):
3
- c&&c(a,f,b)}})}var o=function(){var a={};return{register:function(c,d){a[c]=d},require:function(c,d){var g=a[c];if(!g)throw Error('CommonJS error: failed to require("'+d+'")');return g}}}();o.register("$3",function(a){function c(a){this.reIndex([]);if(a)for(var c in a)this.add(c,a[c])}a.init=function(a){return new c(a)};var d=c.prototype;d.reIndex=function(a){var c=-1;for(this.ords={};++c<a.length;)this.ords[a[c]]=c;this.keys=a;this.length=c};d.key=function(a,c){if(null==c)return this.keys[a];var f=
4
- this.keys[a],b=this.ords[c];if(c!==f){if(null!=b)throw Error("Clash with item at ["+b+"]");this.keys[a]=c;delete this.ords[f];this.ords[c]=a}return a};d.indexOf=function(a){return this.ords[a]};d.add=function(a,c){var f=this.ords[a];null==f&&(this.keys[this.length]=a,f=this.ords[a]=this.length++);this[f]=c;return f};d.get=function(a){return this[this.ords[a]]};d.cut=function(a,c){var f=[].splice.call(this,a,c);this.keys.splice(a,c);this.reIndex(this.keys);return f};d.each=function(a){for(var c=-1;++c<
5
- this.length;)a(this.keys[c],this[c],c);return this};d=null;return a}({},A,u));o.register("$1",function(a){function c(b){return{"Project-Id-Version":"PACKAGE VERSION","Report-Msgid-Bugs-To":"","POT-Creation-Date":b||"","POT-Revision-Date":b||"","PO-Revision-Date":b||"","Last-Translator":"","Language-Team":"",Language:"","Plural-Forms":"","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Poedit-SourceCharset":"UTF-8"}}function d(b,a){var e=b||"";a&&
6
- (e+="\000"+a);return e}function g(){return o.require("$3","collection.js").init()}function h(b){if(!b)return'""';for(var a=b.replace("\r\n","\n").split("\n"),e=a.length-1,l=[],c=-1,d;++c<a.length;){b=a[c];for(e&&e!==c&&(b+="\n");b&&b.charAt(79);){for(d=80;--d;)if(-1!==" \n\r.?!,;:-".indexOf(b.charAt(d))){d++;break}d||(d=79);l.push(f(b.substr(0,d)));b=b.substr(d)}b&&l.push(f(b))}l[1]&&l.unshift("");return'"'+l.join('"\n"')+'"'}function f(b){return b.replace(/(["\\])/g,"\\$1").replace(/\n/g,"\\n")}
7
- function b(b){this.head={};this.headers(c(this.now()));this.locale(b);this.length=0;this.rows=g()}function l(b,a){this.src=[b||""];this.msg=[a||""];this.cmt="";this.status=0}a.create=function(a){return new b(a)};var e=b.prototype;e.now=function(){return(new Date).toString()};e.header=function(b,a){if(null==a)return this.headers()[b]||"";this.head[b]=a||"";return this};e.headers=function(b){var a;if(null!=b){for(a in b)this.head[a]=b[a];return this}var e=this.locale(),l=this.now(),b={};for(a in this.head)b[a]=
8
- String(this.head[a]);e?(b.Language=e.label||"Unknown locale",b["Plural-Forms"]="nplurals="+(e.nplurals||"2")+"; plural="+(e.pluraleq||"n!=1"),b["X-Loco-Target-Locale"]=(e.lang||"en")+"_"+(e.region||"GB"),b["PO-Revision-Date"]=l,delete b["POT-Revision-Date"]):(b.Language="",b["Plural-Forms"]="nplurals=INTEGER; plural=EXPRESSION",b["POT-Revision-Date"]=l,b["PO-Revision-Date"]="YEAR-MO-DA HO:MI+ZONE");b["X-Generator"]="Loco - http://localise.biz/";return b};e.locale=function(b){if(null==b)return this.loc;
9
- this.loc=b||{lang:"en",region:"GB",nplurals:2,pluraleq:"n == 1 ? 0 : 1",label:"English"};this.loc.toString=function(){return this.lang+"_"+this.region};return this};e.lock=function(b){this.locale(b||!1);return this.loc};e.unlock=function(){var b=this.loc;this.loc=null;return b};e.reIndex=function(b,a){var e=this.indexOf(b),l=b.hash(),c=this.rows.indexOf(l);return c===e?e:c!=null?(a=(a||0)+1,b.source("Error, duplicate "+String(a)+": "+b.source()),this.reIndex(b,a)):this.rows.key(e,l)};e.get=function(b,
10
- a){return this.rows.get(d(b,a))};e.indexOf=function(b){if(null==b.idx)b.idx=this.rows.indexOf(b.hash());return b.idx};e.del=function(b){b=this.indexOf(b);if(null!=b){var a=this.rows.cut(b,1);if(a&&a.length)return this.length=this.rows.length,this.rows.each(function(b,a,e){a.idx=e}),b}};e.add=function(b,a){b instanceof l||(b=new l(b));a&&b.context(a);var e=b.hash();if(this.rows.get(e))throw Error("Duplicate message at index "+this.indexOf(b));b.idx=this.rows.add(e,b);this.length=this.rows.length;return b};
11
- e.eq=function(b,a){return b===a||b.source()===a.source()&&b.context()===a.context()};e.each=function(b){this.rows.each(b);return this};e.load=function(b){for(var a=-1,e,c,f,d,g=[],h=[],t=[],z=[];++a<b.length;)if(e=b[a],null==e.parent){if(c=e.source||e.id,f=e.context,c||f)d=new l(c,e.target||""),f&&d.context(f),e.flag&&d.flag(e.flag,!0),e.comment&&d.comment(e.comment),e.message=d,d.translation()?d.fuzzy()?t.push(d):h.push(d):z.push(d)}else g.push(e);for(a=-1;++a<g.length;)try{e=g[a];c=e.source||e.id;
12
- d=b[e.parent]&&b[e.parent].message;if(!d)throw Error("parent missing for plural "+c);1===e.plural&&d.plural(c);d.translate(e.target||"",e.plural)}catch(v){}c=[z,t,h];for(a=0;a<3;a++){e=c[a];for(b=-1;++b<e.length;)try{this.add(e[b])}catch(k){}}return this};e.merge=function(b){var a,e=this.rows,l=g(),c={add:[],del:[]},b=b.rows;this.rows.each(function(a,e){b.get(a)||c.del.push(e)});b.each(function(b,f){try{a=e.get(b),a||(a=f,c.add.push(a)),a.idx=l.add(b,a)}catch(d){}});this.rows=l;this.length=l.length;
13
- return c};e.row=function(b){return this.rows[b]};e.toString=function(){var b,a=[],e=[],c=this.headers(),f=!this.loc;for(b in c)e.push(b+": "+c[b]);e=new l("",e.join("\n"));f&&(e.comment("Loco Gettext template"),e.fuzzy(!0));a.push(e.toString());a.push("");this.rows.each(function(b,e){a.push(e.toString(f));a.push("")});return a.join("\n")};e=l.prototype;e.hash=function(){return d(this.source(),this.context())};e.flag=function(b,a){var e=b===(b&this.status);if(null==a)return e;a?this.status|=b:e&&(this.status^=
14
- b);return this};e.fuzzy=function(b){return this.flag(4,b)};e.source=function(b,a){if(null==b)return this.src[0];this.src[0]=b;this.plural(a);return this};e.plural=function(b){if(null==b)return this.src[1];this.src[1]=b||"";return this};e.each=function(b){for(var a=-1;++a<this.msg.length;)b(a,this.msg[a]);return this};e.translate=function(b,a){this.msg[a||0]=b||"";return this};e.translation=function(b){return this.msg[b||0]||""};e.comment=function(b){if(null==b)return this.cmt||"";this.cmt=b||"";return this};
15
- e.context=function(b){if(null==b)return this.src[2]||"";this.src[2]=b||"";return this};e.toString=function(b){var a,e=[];this.cmt&&(e=["# "+this.cmt.replace("\r\n","\n").split("\n").join("\n# ")]);!b&&this.fuzzy()&&e.push("#, fuzzy");this.src[2]&&e.push("msgctxt "+h(this.src[2]));e.push("msgid "+h(this.src[0]));if(null==this.src[1])e.push("msgstr "+h(b?"":this.msg[0]));else{a=-1;for(e.push("msgid_plural "+h(this.src[1]));++a<this.msg.length;)e.push("msgstr["+a+"] "+h(b?"":this.msg[a]))}return e.join("\n")};
16
- e.weight=function(){var b=0;this.translation()||(b+=2);this.fuzzy()&&(b+=1);return b};e.compare=function(b,a){var e=this.weight(),l=b.weight();if(e>l)return 1;if(e<l)return-1;if(a){e=this.hash().toLowerCase();l=b.hash().toLowerCase();if(e<l)return 1;if(e>l)return-1}return 0};e=e=null;return a}({},A,u));o.register("$14",function(a,c,d){function g(l){b||c._gat&&(b=_gat._createTracker(h,"loco"));if(b){var e=l.shift();b[e].apply(b,l)}else f&&f.push(l);return a}var h,f,b;a._init=function(b){if(h=b.code){f=
17
- c._gaq||(c._gaq=[]);f.push(["_setAccount",h]);f.push(["_trackPageview"]);f.push(["_setDomainName",b.host]);b=d.createElement("script");b.type="text/javascript";b.async=!0;b.src=("https:"==d.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var e=d.getElementsByTagName("script")[0];e.parentNode.insertBefore(b,e)}return a};a.event=function(b,a,c,f){return g(["_trackEvent",b||"",a||"",c||"",f||0])};a.page=function(b,a){return g(["_trackPageview",{page:b||location.pathname+location.hash,
18
- title:a||d.title}])};return a}({},A,u));o.register("$15",function(a,c,d){function g(b,l){if(h)h[b](l);else c.ga&&ga(b,l);return a}var h,f;a._init=function(b){b.code&&(function(b,a,c,f,d,g,h){b.GoogleAnalyticsObject=d;b[d]=b[d]||function(){(b[d].q=b[d].q||[]).push(arguments)};b[d].l=1*new Date;g=a.createElement(c);h=a.getElementsByTagName(c)[0];g.async=1;g.src=f;h.parentNode.insertBefore(g,h)}(c,d,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",b.code,{alwaysSendReferrer:!0}),
19
- b.custom&&g("set",b.custom),a.page(),ga(function(b){h=b}));return a};a.event=function(b,a,e,c){return g("send",{hitType:"event",eventCategory:b||"",eventAction:a||"",eventLabel:e||"",eventValue:Number(c||0)})};a.page=function(b,a){var e={hitType:"pageview",page:b||location.pathname+location.hash,title:a||d.title};e.location=location.protocol+"//"+location.hostname+e.page;f&&g("set",{referrer:f});f=e.location;return g("send",e)};a.reset=function(){f=location.href;g("set",{page:location.pathname+location.hash,
20
- title:d.title,location:f});return a};return a}({},A,u));o.register("$7",function(a){var c;a.init=function(d){if(!c&&d)d.host||(d.host=location.hostname),c=d.legacy?o.require("$14","legacy.js"):o.require("$15","universal.js"),c._init(d);return a};a.link=function(k){var g,h=k.getAttribute("href");if(!h||"#"===h)return a;if(0===h.indexOf("#"))g="anchor";else if((0===h.indexOf("http")||0===h.indexOf("//"))&&-1===h.indexOf())g="external",k.setAttribute("target","_blank");else return a;d(k).click(function(){c.event(g,
21
- "click",h);return!0});k=null;return a};a.page=function(){c&&c.page.apply(c,arguments);return a};a.event=function(){c&&c.event.apply(c,arguments);return a};a.reset=function(){c&&c.reset&&c.reset();return a};return a}({},A,u));o.register("$21",function(a,c,k){function g(b,a,e,c,g){function p(){B&&clearTimeout(B);m&&m.fadeOut(400,function(){d(this).remove();m=null});return!1}function h(){n();c!==-1&&(B=setTimeout(p,c||2E3));m.unbind("mouseleave");m.mouseenter(n)}function n(){B&&clearTimeout(B);B=null;
22
- m.unbind("mouseenter");m.mouseleave(h)}var B;if(!f)f=k.createElement("div"),f.id="growls",k.body.appendChild(f);var m=d('<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>');m.find("p").text(b||"Empty message");a?m.find("small").text(a):m.find("small").remove();if(g.length){g.push({label:"Cancel",callback:p,css:"cancel"});for(var s,t=d('<form action="#" class="dialog"></form>'),
23
- a=function(b,a){s=d('<input type="button" value="'+a.label+'" class="butt '+(a.css||"")+'" />');s.click(function(b){"function"===typeof a.callback&&a.callback(b,{close:p})});t.append(s);return s},b=0;b<g.length;b++)a(b,g[b]);m.append(t)}d(f).prepend(m.hide().fadeIn(400));m.find("a").click(p);h()}var h,f;a.init=function(){if(!h)return h=c.alert,c.alert=function(b){var b=String(b).split("\n"),c=b[1]&&b.slice(1).join("\n");a.alert(b[0],c)},a};a.debug=function(b){h(b);return a};a.alert=function(b,a,e,
24
- f,d){try{return g(b,a||"",e||"alert",f||4E3,d||[]),!0}catch(p){return b+="\n\n--\n"+(p.message||p),h.call(c,b),!1}};a.success=function(b,c,e){return a.alert(b,c,"success",e||2E3)};a.dialog=function(b,c,e,f){return a.alert(b,c,f||"alert",-1,e)};a.login=function(b,c,e,f){a.dialog(c||"You're not logged in",e||"Please log in to continue",[{label:f||"Log in",callback:function(){location.assign(b||"/session/auth/login?r="+encodeURIComponent(location.href))}}])};return a}({},A,u));o.register("$17",function(a,
25
- c,k){function g(b){return b.keyCode===27&&q&&n?(D(),b.preventDefault(),!1):!0}function h(a){if(q){var e=Math.max(b.height(),l.outerHeight(!0));e&&y.css("height",e+"px");a&&(z=d(c).innerWidth(),F(v))}return!0}function f(b){b?(r.show(),e.addClass("has-title")):(r.hide(),e.removeClass("has-title"))}var b,l,e,y,r,p,q=!1,n=!1,B=!1,m,s,t,z,v,C=a.init=function(){if(!b){b=d('<div id="overlay"></div>');l=d('<div class="overlay-frame"></div>');e=d('<div class="overlay-container"></div>');r=d('<div class="overlay-title"><span class="title">Untitled</span></div>');
26
- p=d('<a class="overlay-close" href="#"><span>x</span></a>');y=d('<div class="overlay-bg"></div>');b.append(l.append(e)).append(y).prependTo(k.body);d(k).bind("keydown",g);d(c).resize(h);t=e.outerWidth(!0)-e.width()+(l.innerWidth()-l.width());e.outerHeight(!0);e.outerHeight(!1);l.innerHeight();l.height();z=d(c).innerWidth();m=parseInt(e.css("width"));if(!m||isNaN(m))m=e.width();s=parseInt(e.css("height"));if(!s||isNaN(s))s=e.height();r.append(p.hide()).hide().prependTo(l);b.hide()}return b},F=a.width=
27
- function(c){C();if(c===null)l.css("width",""),e.css("width","");else{c=c||m||640;x=c+t;v=c;var f=z;x>f?(x=f,c=x-t,b.addClass("spill")):b.removeClass("spill");l.css("width",x+"px");e.css("width",c+"px")}return a};a.autoSize=function(){C();h();var b=m||0;e.children().each(function(a,e){b=Math.max(b,d(e).outerWidth(!0))});F(b);return a};a.css=function(b){C().attr("class",b);return a};a.html=function(b){C();c.innerShiv&&(b=innerShiv(b,!1));return e.html(b)};a.append=function(b){C();b instanceof jQuery||
28
- (b=d(b));e.append(b);return a};var D=a.close=function(c){if(q){var f=function(){C().hide();d(k.body).removeClass("has-overlay");q=!1;e.html("");q=null;b.trigger("overlayClosed",[a])};c==null&&(c=300);c?b.fadeOut(c,f):f()}return a};a.title=function(b){C();B=b||"";r.find("span.title").text(B);b!=null?f(!0):n||f(!1);return a};a.enableClose=function(){C();n=!0;p.unbind("click").bind("click",function(){D();return!1});f(!0);p.show();return a};a.disableClose=function(){C();n=!1;p.hide();q&&B||f(!1);return a};
29
- a.open=function(){C();e.html("");F(m);b.attr("class","");d(k.body).addClass("has-overlay");C().show();q=!0;h();a.title(null);n&&f(!0);b.trigger("overlayOpened",[a]);return a};a.listen=function(b){C().bind("overlayClosed",b);return a};a.unlisten=function(b){C().unbind("overlayClosed",b);return a};return a}({},A,u));o.register("$16",function(a,c,k){var g={401:"You've been logged out",404:"Not Found",500:"Server Error",502:"Bad Gateway",503:"Service unavailable",504:"Gateway timeout"};a.getErrors=function(){return g};
30
- a.jsonLink=function(a){if(!a)return"";a=a.split("?");a[0]=a[0].replace(/(\.[a-z0-9]{1,4})?$/i,".json");return a.join("?")};a.errorData=function(a,c){var b,l,e=a.responseText,c=a.status;if(!e&&c===0)return null;try{b=d.parseJSON(e)||{}}catch(y){b={},l=y.message||y}l||(l=b.statusText||a.statusText||g[c]||"Unknown Error");b.error=l;return b};a.ajax=function(g,f,b,l){function e(){b&&b()}function y(b){b.alert&&alert(b.alert);var a=b.success;a&&o.require("$21","growl.js").success.apply(this,a.push?a:[a]);
31
- if((a=b.events)&&a.length)for(var f,g=o.require("$7","ga.js"),h=l||d(k.body);f=a.shift();)h.trigger(f,[b]),g.event("ajax",f);b.modal&&o.require("$9","LocoModal.js").replace(b.modal);if(b.download)c.location.assign(b.download);else if(b.redirect)return c.location.assign(b.redirect),!1;e();return!0}function r(b,c,d){if(b.status===401)o.require("$21","growl.js").login(),e();else if(c=a.errorData(b,c,d),c!=null)if(d=c.error,"function"===typeof f&&!1===f(null,d,b.status))e();else if(!c||!c.data||y(c.data))alert(d||
32
- "Unknown error"),e()}g.error=r;g.success=function(b,a,c){if(!b)return r(c,"unknown");b.status&&alert(b.statusText||"Unknown error");"function"===typeof f&&!1===f(b&&b.data?b.data:b)?e():b&&b.data?y(b.data):e()};d.ajax(g)};return a}({},A,u));o.register("$9",function(a){function c(b,a){g.autoSize();var c=g.init();o.require("$5","html.js").init(c);c.find("[data-script]").each(function(b,e){for(var e=d(e),c=-1,l,t=e.attr("data-script").split(" ");++c<t.length;)l=t[c],f[l]?f[l](e,a||{}):alert("Unknown script "+
33
- l)});c.trigger("locoModalLoaded",[g,b||"",a||{}]);var l,h=c.find("form")[0];if(h){c=0;a:for(;c<h.elements.length;c++)switch(l=h.elements[c],l.type){case "text":case "textarea":d(l).focus();break a}}}function k(a){var c=d(a.currentTarget),f=c.attr("data-modal");if(f==="close"){l();var h=c.attr("href");if(h&&-1!==h.indexOf("#!"))return!0}else{var k="submit"===a.type,n=c.attr("title")||c.attr("data-title"),h=c.attr("href")||c.attr("action"),B=k?c.serialize():"",c=k?c.attr("method"):"get";b(h,n,c,B);
34
- f||(f=h.split("/").slice(1,4).join("-"));g.width(null).css("modal "+f).autoSize()}a.stopPropagation();a.preventDefault();return!1}var g=o.require("$17","overlay.js"),h=o.require("$7","ga.js"),f={},b=a.load=function(b,f,l,p){g.open().title("Loading ..").disableClose().css("modal").html('<div class="overlay-placeholder"></div>');var k=o.require("$16","http.js"),l={type:l||"get",data:p||"",url:k.jsonLink(b)};k.ajax(l,function(a,l,p){var k=a&&a.html;if(!k)return a=d('<h3 class="error"></h3>').text(l||
35
- "Unknown error"),g.enableClose().title("Error "+p||"?").html("").append(a),!1;f=a.title||f||"Untitled";g.enableClose().title(f).html(k);c(b,a.js);h.page(b,f);g.init().one("overlayClosed",function(){h.reset()});return!0});return a},l=a.close=function(){g.close();return a};a.initLink=function(b){b.click(k)};a.initForm=function(b){d(b).submit(k)};a.replace=function(a){var f=a&&a.html,l=a&&a.url,d=a&&a.title;l?(b(l,d),a=a&&a.css||l.split("/").slice(1,4).join("-"),g.width(null).css(" modal "+a).autoSize()):
36
- f&&(g.open().html(f),d&&g.enableClose().title(d),c("",a&&a.js))};a.find=function(b){return g.init().find(b)};a.script=function(b,c){if(c){if("function"!==typeof c.run)throw Error(b+" macro has no run function");f[b]=c.run;return a}return f[b]};return a}({},A,u));o.register("$18",function(a){a.listen=function(a,k){function g(){y[l?"show":"hide"]()}function h(){if(a.value!==l)f&&clearTimeout(f),l=a.value,e&&a.setAttribute("size",l.length||1),g(),f=setTimeout(function(){k(l)},b)}var a=a instanceof jQuery?
37
- a[0]:a,f,b=200,l=a.value,e=1===Number(a.size),y=d('<a href="#clear" tabindex="-1" class="icon clear"><span>clear</span></a>').click(function(){a.value="";h();return!1});d(a).keyup(function(){h();return!0}).after(y);g();return{ping:h,val:function(b){if(b==null)return l;f&&clearTimeout(f);a.value=l=b;g()}}};return a}({},A,u));o.register("$19",function(a){function c(){this.length=this.depth=0;this.ignorecase=this.matchall=!0;var a={},c=[];this.getTree=function(){return a};this.getData=function(){return c}}
38
- a.create=function(){return new c};var d=c.prototype;d.add=function(a,c){var f,b,l,e,d,k,p,q={};this.ignorecase&&(c=c.toLowerCase());null==c&&(c=String(a));d=this.getData();var n=d.length;d.push(a);p=c.split(/[\s\(\)\[\]/{/}\.\-_,:;]+/);for(d=0;d<p.length;d++)if((k=p[d])&&!q[k]){f=this.getTree();b=Math.min(k.length,this.depth)||k.length;for(l=0;l<b;l++)e=k.charAt(l),f=f[e]||(f[e]={});f=f[" "]||(f[" "]=[]);f.push(n);q[k]=!0}this.length++;return this};d.find=function(a){function c(b,a){var e,d,l;for(e in b)if(" "===
39
- e)for(d in b[" "])l=b[" "][d],l=f[l]||(f[l]={length:0,words:{}}),l.length+=l.words[a]?0:1,l.words[a]=1+(l.words[a]||0);else c(b[e],a)}this.ignorecase&&(a=a.toLowerCase());var f={},b,d,e=0,k,r,p;d=a.split(/\s+/);a=0;a:for(;a<d.length;a++)if(b=d[a]){e++;p=this.getTree();r=b.split("");for(this.depth&&(r=r.slice(0,this.depth));k=r.shift();){if(!p[k])continue a;p=p[k]}c(p,b)}var q,a=[];b=this.getData();for(q in f)this.matchall&&f[q].length<e||a.push(b[q]);return a};return a}({},A,u));o.register("$10",
40
- function(a){function c(a){this.url="/auto/"+a+".json?q=";this.dead={}}function k(){this.dict=o.require("$19","dict.js").create()}a.init=function(a){function h(){if("hint"!==F){var b=v.val()&&!(w&&w.val())&&t==null&&!B;K[b?"addClass":"removeClass"]("error")}}function f(){L.show();var b=v.outerWidth(!1),a=v.outerHeight(!1),c=v.css("margin-top");c&&(c=parseInt(c),isNaN(c)||(a+=c));b-=2;L.css("top",a+"px").css("width",b+"px");B=!0}function b(){L.hide();B=!1}function l(){L.html("");b();n=0;z=t=null}function e(b){l();
41
- var a;for(a=0;a<b.length;a++){var c=a,e=b[a],t=d('<span class="label"></span>').text(e.label),g=d('<div class="auto-comp-result"></div>'),v=void 0;for(v in e)g.attr("data-"+v,e[v]);e.icon&&g.append(d("<span></span>").attr("class",e.icon));g.append(t);y(c,g)}(n=b.length)?(m&&f(),r(0)):(r(null),h())}function y(b,a){L.append(a);a.click(function(c){c.stopPropagation();r(b,a);q();return!1});return a}function r(b,a){z&&(z.removeClass("selected"),z=null);t=null;b==null?w&&w.val(""):(a||(a=L.find("div.auto-comp-result").eq(b)),
42
- a.length&&(a.addClass("selected"),t=b,z=a))}function p(b){if(n){var a=n-1;t==null?b=b>0?0:a:(b=t+b,b<0?b=a:b>a&&(b=0));return r(b)}}function q(){if(t==null)Q.val(""),w&&w.val("");else{var a=L.find("div.auto-comp-result").eq(t),c=a.attr("data-value"),e=a.attr("data-label");w&&w.val(c);Q.val(e);b();a=a.clone();l();y(0,a);n=1;r(0,a);h();a.trigger("locoAutocomp",[c,e,a])}}var n=0,B=!1,m=!1,s=a.form,t=null,z=null,v=d(a),C=v.attr("name"),F=v.attr("data-mode"),D=v.attr("data-provider"),w="hint"!==F&&d('<input type="hidden" value="" name="'+
43
- C+'" />').appendTo(s),K=d('<div class="auto-comp-wrap"></div>').replaceAll(v),L=d('<div class="auto-comp-drop"></div>');D&&(D=new c(D));w&&v.attr("name","_"+C);v.attr("autocomplete","off");K.append(v).append(L);b();v.focus(function(){m=!0;n>1&&f()}).blur(function(){m=!1;h()}).keydown(function(a){function c(){a.preventDefault();a.stopPropagation();return!1}switch(a.keyCode){case 27:B&&(a.stopPropagation(),b(),v.blur());break;case 40:n&&(B?p(1):f());break;case 38:B&&p(-1);break;case 13:if(B)return q(),
44
- c();else if(!t&&F!=="hint")return c()}return!0});var Q=o.require("$18","LocoTextListener.js").listen(v,function(b){D&&D.fetch(b,e)});(s=v.attr("data-pre"))&&(s=d.parseJSON(s))&&s.value&&s.label?(e([s]),q()):a.value&&(!w||!w.val())&&D&&D.fetch(a.value,function(b){e(b);q()});return{$:v,clear:l,reset:function(){l();v.val("");w&&w.val("");Q.ping()},preload:function(b){n&&l();D=new k;var a,c;for(a in b)c=b[a],D.add(c)},mode:function(b){F=b}}};c.prototype.fetch=function(a,c){if(!a)return c&&c([]),this;
45
- var f,b=this.dead;for(f in b)if(0===a.indexOf(f))return c&&c([]),this;f={dataType:"json",url:this.url+encodeURIComponent(a)};o.require("$16","http.js").ajax(f,function(f){var e=f&&f.results;e&&(c&&f.query&&f.query===a&&c(f.results),e.length||(b[a]=0));return!0});return this};k.prototype.add=function(a){var c=a.fulltext||a.label||a.value;c&&this.dict.add(a,c)};k.prototype.fetch=function(a,c){if(!a)return c&&c([]),this;var f=this.dict.find(a);c(f)};return a}({},A,u));o.register("$11",function(a,c,k){function g(b){b.stopPropagation();
46
- b.preventDefault();return!1}function h(b,a,c){if(c=c||b.getElement(a))c.unbind().mouseup(function(c){c.stopPropagation();b.selectIndex(a,!0);return!1}).mouseover(function(){d(this).addClass("over");b.hover=a;return!0}).mouseout(function(){d(this).removeClass("over");b.hover=-1;return!0}),c=null;return b}function f(b){if(b){var a=this,c=b[0];a.id=c.id||"";a.name=c.name||"";a.prefix=c.getAttribute("data-prefix");a.defaultIcon=c.getAttribute("data-icon")||"jshide";var f=c.selectedIndex,g=[],h,q,n;for(q=
47
- 0;q<c.options.length;q++)h=c.options[q],n=h.disabled,h=d(h),g.push([h.val(),h.text(),h.attr("data-icon")||"",n]);a.hidden=d('<input type="hidden" name="'+a.name+'" value="" />').appendTo(c.form);a.list=d('<ul class="clearfix"></ul>');a.icon=d('<span class="icon"> </span>');a.selection=d("<label></label>");a.handle=d('<a class="handle" href="#"></a>').attr("tabindex",b.attr("tabindex")||"").append(a.icon).append(a.selection);a.wrapper=d("<div></div>").addClass(c.className).addClass("selector").append(a.handle).append(a.list).replaceAll(c);
48
- this.id&&a.wrapper.attr("id",this.id);for(a.clearOptions();h=g.shift();)a.addOption.apply(a,h);a.handle.click(function(b){b.preventDefault();return!1}).mouseover(function(b){return a.onRollover(b)}).mouseout(function(b){return a.onRollout(b)}).mousedown(function(b){return a.onPress(b)}).keydown(function(b){return a.onKeydown(b)});d(k.body).mouseup(function(b){return a.onRelease(b)}).keydown(function(b){return a.onGlobalKeydown(b)});a.close();a.selectIndex(f)}}a.create=function(b){return new f(b)};
49
- a.extend=function(b){b.prototype=new f};c=f.prototype;c.onRollover=function(){return this.over=!0};c.onRollout=function(){this.over=!1;return!0};c.onPress=function(b){return!this.active?(this.open(),b.stopPropagation(),b.preventDefault(),this.handle.focus(),!1):this.over?(this.close(),b.stopPropagation(),b.preventDefault(),!1):!0};c.onRelease=function(){this.active&&!this.over&&this.close();return!0};c.onGlobalKeydown=function(b){if(this.active)switch(b.keyCode){case 27:return this.close(),g(b);case 40:return this.hoverNext(1),
50
- g(b);case 38:return this.hoverNext(-1),g(b);case 13:if(this.hover!=-1)return this.selectIndex(this.hover,!0),this.hoverItem(-1),this.close(),g(b)}return!0};c.onKeydown=function(b){return!this.active&&40===b.keyCode?(this.open(),g(b)):!0};c.open=function(){this.active=!0;this.hover=-1;this.wrapper.addClass("active");var b=this.handle.outerHeight()||0;this.list.show().css("top",b+"px");var b=this.handle.outerWidth()||0,a=this.list.outerWidth()||0;b>a&&(a-=this.list.width(),this.list.css("min-width",
51
- String(b-a)+"px"))};c.close=function(){this.list.hide();this.active=!1;if(this.hover!==-1)this.getElement(this.hover).removeClass("over"),this.hover=-1;this.wrapper.removeClass("active")};c.hoverItem=function(b,a){this.hover!==-1&&this.getElement(this.hover).removeClass("over");this.hover=b;b!==-1&&(a=a||this.getElement(b),a.addClass("over"))};c.hoverNext=function(b){var a=this.options.length;if(a){a-=1;if(this.hover==-1)b=b>0?0:a;else if(b=this.hover+b,b<0){this.close();return}else b>a&&(b=0);this.hoverItem(b)}};
52
- c.enableChange=function(b){this.eventName=b;this.eventData=[].slice.call(arguments,1);return this};c.clearOptions=function(){this.index={};this.length=0;this.options=[];this.list.html("");this.hidden.val("");this.idx=this.hover=-1;return this};c.addOption=function(b,a,c,f){var g=this.options.length,k=d("<span></span>").addClass(c||"jshide"),q=d("<label></label>").text(a||b),k=d("<li></li>").append(k).append(q).appendTo(this.list);if(f)return this.disableIndex(g),null;k.attr("data-option",g);this.options[g]=
53
- {value:b,text:a,icon:c};this.index[b]=g;this.length=g+1;h(this,g,k);return g};c.disableOption=function(b){return this.disableIndex(this.index[b])};c.disableIndex=function(b){(b=this.getElement(b))&&!this.disabled&&b.addClass("disabled").unbind();return this};c.enableOption=function(b){return this.enableIndex(this.index[b])};c.enableIndex=function(b){return h(this,b)};c.reIndex=function(){this.index={};this.length=0;for(var b=this.options.length;-1<--b;)this.index[this.options[b].value]=b,this.length++};
54
- c.selectValue=function(b,a){return this.selectIndex(this.index[b],a)};c.selectIndex=function(b,a){var c=this.options[b];if(c){this.hidden.val(c.value);if(b!==this.idx)this.idx=b,this.setLabel(c.text),this.icon.attr("class",c.icon||this.defaultIcon),a&&this.change();this.active&&this.close()}return this};c.setLabel=function(b){this.selection.text(b);this.prefix&&this.selection.prepend(d('<span class="prefix"></span>').text(this.prefix))};c.val=function(){var b=this.options[this.idx];return b&&b.value};
55
- c.change=function(){var b=this.eventName||"change",a=this.eventData&&this.eventData.slice()||[];a.unshift(this.val());this.wrapper.trigger(b,a);return this};c.renameOption=function(b,a){var c=this.index[b],f=this.options[c];if(f)f.text=a,this.getElement(c).find("label").text(a),c===this.idx&&this.setLabel(a);return this};c.removeOption=function(b){var a=this.index[b],c=this.options[a];c&&(b=this.val(),this.getElement(a).remove(),this.options.splice(a,1),this.reIndex(),b===c.value?this.selectIndex(0,
56
- !0):this.selectValue(b,!1))};c.getElement=function(b){return this.list.find("li").eq(b)};c=null;return a}({},A,u));o.register("$20",function(a){function c(a){d&&(a=g[a]||a);return a}var d=navigator.msPointerEnabled,g={touchstart:"MSPointerDown",touchmove:"MSPointerMove",touchend:"MSPointerUp"};a.bind=function(d,f,b){d=c(d);f.addEventListener&&f.addEventListener(d,b,!1);return a};a.unbind=function(d,f,b){d=c(d);f.removeEventListener&&f.removeEventListener(d,b,!1);return a};return a}({},A,u));o.register("$12",
57
- function(a,c,k){function g(){l&&clearTimeout(l);l=null}function h(b){b.preventDefault();b.stopPropagation();return!1}var f,b,l,e=100,y=100,r=!1,p=!1,q;a.delays=function(b,a){e=b||0;y=a||0};a.kill=function(){b&&b.hide().stop().remove();b=null;f&&f.hide().html("")};a.text=function(a){b&&b.find("label.tip").text(a)};a.init=function(n){function B(){f||(f=d('<div id="tipholder"></div>').appendTo(k.body));return f}function m(){g();C?l=setTimeout(s,C):s()}function s(){g();r||p||z()}function t(){g();b&&(b.stop(),
58
- b.remove());var a=n.offset();b=D.clone();B().show().append(b);var c=Math.round(a.left),a=Math.round(a.top);b.hasClass("tooltip-right")&&(c-=b.outerWidth(!1),c+=n.outerWidth(!1));b.hasClass("tooltip-top")?a-=b.outerHeight():a+=n.outerHeight();B().css("left",c+"px").css("top",a+"px");b.mouseenter(function(){r=!0;return!1}).mouseleave(function(){r=!1;m();return!0});Boolean(b.find("form").length|b.find("a").length)||b.click(v);n.trigger("tooltipOpen",[b])}function z(){function c(){a.kill()}b?b.fadeOut(500,
59
- c):c();n.trigger("tooltipClose",[b])}function v(){if(!1!==n.triggerHandler("click")&&K)location.href=K;return!1}var C=Number(n.attr("data-hide-delay")||y),F=Number(n.attr("data-show-delay")||e),D=n.find("div.tooltip"),w=n.attr("title");if(!D.length){if(!w)return;D=d('<div class="tooltip"></div>').append(d('<label class="tip"></label>').text(w));n.hasClass("hastip-top")&&D.addClass("tooltip-top");n.hasClass("hastip-right")&&D.addClass("tooltip-right");n.prepend(D)}w&&(n.attr("data-title")&&D.children("label.tip").text(w),
60
- n.attr("data-title",w),n.attr("title",""));var K=n.attr("href");K==="#"&&(K="");w=o.require("$20","touch.js").bind("touchstart",n[0],h).bind("touchmove",n[0],h).bind("touchend",n[0],function(a){setTimeout(v,300);return h(a)});null==q&&(q=!1,w.bind("touchstart",c,function(){return q=!0}).bind("touchend",c,function(){setTimeout(function(){q=!1},300);return!0}));n.mouseover(function(){q||(p=!0,g(),b?t():F?l=setTimeout(t,F):t());return!0}).mouseout(function(){q||(p=!1,m());return!0});K&&n.click(function(){p=
61
- !1;z();return!0})};return a}({},A,u));o.register("$5",function(a,c,k){var g=0;c.attachEvent&&/MSIE ([\d\.]+)/.exec(navigator.appVersion)&&(g=parseInt(RegExp.$1));a.ie=function(a){return a?g<=a:g};var h=a.init=function(c){c?c instanceof jQuery||(c=d(c)):c=d(k.body);var b=o.require("$7","ga.js"),l=o.require("$8","forms.js"),e=o.require("$9","LocoModal.js"),y=o.require("$10","LocoAutoComplete.js"),r=o.require("$11","LocoSelector.js"),p=o.require("$12","tooltip.js");c.find("form").each(function(a,b){var c=
62
- d(b);g&&10>g&&l.placeholders(c);b.getAttribute("data-modal")?e.initForm(b):b.action&&0!==b.action.indexOf("#")&&!b.target&&l.jsonify(b);c.hasClass("hasreveal")&&l.revealify(c);c.find("input.button").each(function(a,b){l.linkify(b)});c.find("input.auto-comp").each(function(b,a){y.init(a)});c.find("select.selector").each(function(a,b){r.create(d(b))})});c.find("a").each(function(c,f){-1!==f.className.indexOf("hastip")&&p.init(d(f));if(-1!==f.href.indexOf("/modal/")||f.getAttribute("data-modal"))e.initLink(d(f));
63
- else{b.link(f);var g=f.getAttribute("data-ajax-target");g&&(g=d("#"+g),d(f).click(function(b){b.preventDefault();g.addClass("loading");d.get(f.href,function(b){b=a.$(b).replaceAll(g);h(b)});return!1}))}});l=e=y=c=null;return a};a.$=function(a){return d(c.innerShiv?innerShiv(a,!1):a)};d.fn._html=function(a){return a!=null?(a=this.html(c.innerShiv?innerShiv(a,!1):a),h(this),a):j.html()};d.fn.macro=function(a,b){if("function"!==typeof a.run)throw Error("macro has no run function");a.run(this,b||{});
64
- return this};a.el=function(a,b){var c=k.createElement(a||"div");b&&(c.className=b);return c};a.txt=function(a){return k.createTextNode(a||"")};return a}({},A,u));o.register("$8",function(a,c){function k(a){function b(){if(a.value===g)a.value="",e.removeClass("placeheld");return!0}function c(){if(a.value==="")a.value=g,e.addClass("placeheld");return!0}var e=d(a);if(!e.hasClass("auto-comp")){var g=e.attr("placeholder");if(g)return e.focus(b).blur(c),c(),{kill:function(){b();e.unbind("focus",b).unbind("blur",
65
- c)}}}}var g=a.enable=function(d){function b(a,b){if(!b.getAttribute("data-was-disabled"))b.disabled=!1}d.find(".button").removeClass("loading");d.find("input").each(b);d.find("select").each(b);d.find("textarea").each(b);c.attachEvent&&d.hasClass("has-placeholders")&&a.placeholders(d)},h=a.disable=function(a){function b(a,b){b.disabled?b.setAttribute("data-was-disabled","true"):b.disabled=!0}a.find(".button").addClass("loading");a.find("input").each(b);a.find("select").each(b);a.find("textarea").each(b)};
66
- a.jsonify=function(a,b,l){a instanceof jQuery||(a=d(a));if(!a.disable)d.fn.disable=function(){h(this);return this},d.fn.enable=function(){g(this);this.placehold&&this.placehold();return this};var e="";a.find('[type="submit"]').click(function(a){a&&a.target&&a.target.name&&(e=encodeURIComponent(a.target.name)+"="+encodeURIComponent(a.target.value));return!0});a.submit(function(d){if(d&&d.isDefaultPrevented&&d.isDefaultPrevented())return!1;if(l&&!1===l(d))return!1;var g=c.tinyMCE;g&&a.find("textarea.editor").each(function(a,
67
- b){var c=g.get(b.id);c&&c.save()});var h=a.serialize();e&&(h&&(h+="&"),h+=e,e="");a.disable();var k=o.require("$16","http.js"),h={url:k.jsonLink(a.attr("action")),type:a.attr("method"),data:h};k.ajax(h,b,function(){a.enable()},a);d.preventDefault();d.stopPropagation();return!1});if(a.hasClass("autopost")){var k,r=Number(a.attr("data-autopost-delay")||500);a.find('input[type="checkbox"]').change(function(){k&&clearTimeout(k);k=setTimeout(function(){a.submit()},r);return!0})}};a.revealify=function(a){a.find("div[data-reveal-if]").each(function(b,
68
- c){function e(a){var b;m=m||a.target;if("."===n)b=Boolean(m&&m[o]);else if("="===n){var c,e;b=d(m.form).serializeArray();for(e in b)if(b[e].name===q)c=b[e].value;b=o===c}if(b!==k)if(k=b,a)g[k?"slideDown":"slideUp"](200);else g[k?"show":"hide"]();return!0}var g=d(c),h=/^([_\w\-\[\]]+)(\.|=)(.+)$/.exec(g.attr("data-reveal-if"));if(h){var k,q=h[1],n=h[2],o=h[3],h=a[0][q];h.length||(h=[h]);for(var m,b=0;b<h.length;b++)m=h[b],e(),d(m).change(e).removeClass("jshide");h=h=m=null}});a=null};a.linkify=function(a){var b=
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  a.getAttribute("data-icon");if(b){var c=d(a),e=d("<a> </a>");e.attr("href",a.form.action);e.attr("class",c.attr("class"));e.attr("tabindex",c.attr("tabindex"));c.attr("tabindex","-1");e.text(c.val());b&&d("<span></span>").prependTo(e).addClass(b);c.hide().after(e);e.click(function(){c.click();return!1})}};a.placeholders=function(a){var b,c=[];a.find("input[placeholder]").each(function(a,d){(b=k(d))&&c.push(b)});c.length&&(a.submit(function(){for(var a in c)c[a].kill()}),a.addClass("has-placeholders"),
70
- b=i=null)};return a}({},A,u));o.register("$13",function(a,c){var d=c.requestAnimationFrame,g=c.cancelAnimationFrame,h=0;if(!d||!g)for(var f in{ms:1,moz:1,webkit:1,o:1})if(d=c[f+"RequestAnimationFrame"])if(g=c[f+"CancelAnimationFrame"]||c[f+"CancelRequestAnimationFrame"])break;if(!d||!g)d=function(a){var d=b();timeToCall=Math.max(0,16-(d-h));nextTime=d+timeToCall;timerId=c.setTimeout(function(){a(nextTime)},timeToCall);h=nextTime;return timerId},g=function(a){clearTimeout(a)};var b=Date.now||function(){return(new Date).getTime()};
71
- a.loop=function(a,b){function c(){h=d(c,b);a(f++)}var f=0,h;c();return{stop:function(){h&&g(h);h=null}}};return a}({},A,u));o.register("$6",function(a,c,d){function g(a,c){if(b)a.MSPOINTER_TYPE_TOUCH===a.pointerType&&c(0,a);else for(var d=-1,e=(a.originalEvent||a).changedTouches||[];++d<e.length;)c(d,e[d])}function h(a){a.preventDefault();a.stopPropagation();return!1}var f,b=c.navigator.msPointerEnabled,l=b?"MSPointerDown":"touchstart",e=b?"MSPointerMove":"touchmove",y=b?"MSPointerUp":"touchend";
72
- a.ok=function(b){f==null&&(f="function"===typeof d.body.addEventListener);f&&b&&b(a);return f};a.dragger=function(a,b){function c(b){a.addEventListener(b,f[b],!1)}function d(b){a.removeEventListener(b,f[b],!1)}var f={};f[l]=function(a){g(a,function(c,d){d.type=l;b(a,d,k)});c(e);c(y);return!0};f[y]=function(a){d(e);d(y);g(a,function(c,d){d.type=y;b(a,d,k)});return!0};f[e]=function(a){g(a,function(c,d){d.type=e;b(a,d,k)});return h(a)};c(l);var k={kill:function(){d(l);d(e);d(y);a=k=b=null}};return k};
73
- a.swiper=function(a,c,d){function f(b){a.addEventListener(b,C[b],!1)}function k(b){a.removeEventListener(b,C[b],!1)}function s(){t&&t.stop();t=null}var t,z,v,C={},F=[],D=[],w=[];C[l]=function(b){z=!1;s();var c=r();g(b,function(a,b){F[a]=c;D[a]=b.clientX;w[a]=b.clientY});v=a.scrollLeft;return!0};C[y]=function(a){g(a,function(a,b){var d=r()-F[a],e=D[a]-b.clientX;c(Math.abs(e)/d,e?e<0?-1:1:0)});v=null;return!0};C[e]=function(b){var c,d;v==null||g(b,function(a,b){c=D[a]-b.clientX;d=w[a]-b.clientY});if(d&&
74
- Math.abs(d)>Math.abs(c))return z=!0;if(c)z=!0,a.scrollLeft=Math.max(0,v+c);return h(b)};if(!b||d)f(l),f(e),f(y),b&&(a.className+=" mstouch");return{kill:function(){k(l);k(e);k(y);s()},swiped:function(){return z},ms:function(){return b},snap:function(c){b&&!d&&(a.style["-ms-scroll-snap-points-x"]="snapInterval(0px,"+c+"px)",a.style["-ms-scroll-snap-type"]="mandatory",a.style["-ms-scroll-chaining"]="none")},scroll:function(b,c,d){s();var e=a.scrollLeft,f=b>e?1:-1,g=Math[f===1?"min":"max"],h=Math.round(c*
75
- 16*f);return t=o.require("$13","fps.js").loop(function(c){if(c)e=Math.max(0,g(b,e+h)),a.scrollLeft=e,b===e&&(s(),d&&d(e))},a)}}};var r=Date.now||function(){return(new Date).getTime()};return a}({},A,u));o.register("$4",function(a,c,k){function g(a,b){var c=a.id,d=c&&m[c],e=d&&d.parent();if(!d||!e)return null;var f=(c=e.dir===B)?"X":"Y",c=c?y:r,g=c(e.el),h=b["offset"+f];null==h&&(h=b["page"+f]-c(a));h&&(g+=h);return{move:function(a){e.resize(a["page"+f]-g,d);return!0}}}function h(a){function b(){d(k).unbind("mousemove",
76
- c);s=null;return!0}function c(a){s?s.move(a):b();return!0}if(s)return!0;s=g(a.target,a);if(!s)return!0;d(k).one("mouseup",b).mousemove(c);return e(a)}function f(a,b){var c=b.type;"touchmove"===c?s&&s.move(b):"touchstart"===c?s=g(a.target,b):"touchend"===c&&s&&(s=null)}function b(a){var b=d(a.target).closest("div.wg-tr"),c=b.length&&b.closest("div.is-table");(c=c&&m[c.attr("id")])&&c.selectRow(Number(b.attr("data-row")));return e(a)}function l(a){var t;var b=a.keyCode;if(b=40===b?1:38===b?-1:0){var c=
77
- d(a.target),f=c.data("row");if(f>-1&&(t=(c=c.closest("div.is-table"))&&m[c.attr("id")],c=t))return c.selectRow(f+b),e(a)}return!0}function e(a){a.stopPropagation();a.preventDefault();return!1}function y(a,b){b||(b=k.body);for(var c=a.offsetLeft||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetLeft||0;return c}function r(a,b){b||(b=k.body);for(var c=a.offsetTop||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetTop||0;return c}function p(a){function b(){var c=a.innerHTML;c!==e&&(e=c,d(a).trigger("wgChange",[c]));return!0}
78
- var c=n.ie()?["keyup","paste"]:["input"],e=a.innerHTML,f=e;return d(a).attr("contenteditable","true").focus(function(){for(var e=d(a),f=-1;++f<c.length;)e.bind(c[f],b);return!0}).blur(function(){for(var g=d(a),h=-1;++h<c.length;)g.unbind(c[h]);b();f!==e&&d(a).trigger("wgChanged",[a]);return!0})}function q(a){this.el=a;this.id=a.id;this.pos=this.index=0;this.css=["wg-cell"];m[a.id]=this;this.clear()}var n=o.require("$5","html.js"),B=1,m={},s=!1;a.init=function(a){var b=new q(a);b.restyle().redraw();
79
- b.root=!0;o.require("$6","touch.js").ok(function(b){b.dragger(a,f)});d(a).mousedown(h);return b};c=q.prototype;c.each=function(a){for(var b=-1;++b<this.length;)a(b,this.cells[b]);return this};c.bind=function(){return this.$("bind",arguments)};c.unbind=function(){return this.$("unbind",arguments)};c.$=function(a,b){d.fn[a].apply(d(this.el),b);return this};c.parent=function(){return this.pid&&m[this.pid]};c.splitx=function(){return this._split(B,arguments)};c.splity=function(){return this._split(2,
80
- arguments)};c._split=function(a,b){this.dir&&this.dir!==a&&this.clear();this.dir=a;var c=-1,d,e=this.length,f=b.length,g=1/(e+f),h=0;if(e)throw Error("Todo: implement re-split");for(;++c<f;){d=n.el();this.body.appendChild(d);for(var l=d,k=b[c],o=k,p=1;m[k];)k=o+"-"+ ++p;l.id=k;d=new q(d);d.index=e+c;d.pid=this.id;d.pos=h;h+=g;this.cells.push(d);this.length++}this.restyle().redraw();return this.cells};c.clear=function(){for(var a=-1,b;++a<this.length;)b=this.cells[a].clear(),delete m[b.id];this.cells=
81
- [];this.length=0;this.nav&&this.el.removeChild(this.nav);this.nav=null;if(this.body){if(this.field&&n.ie())d(this.body).triggerHandler("blur"),this.field=null;if(this.table)this.table=null;this.el.removeChild(this.body)}this.body=this.el.appendChild(n.el("","wg-body"));return this};c.resize=function(a,b){if(!b&&(b=this.cells[1],!b))return;var c=b.index,e=d(this.el)[this.dir===B?"width":"height"](),f=this.cells[c+1],c=this.cells[c-1];pad=(b.body||b.el.firstChild).offsetTop||0;max=(f?f.pos*e:e)-pad;
82
  min=c?c.pos*e:0;b.pos=Math.min(max,Math.max(min,a))/e;(e=this.parent())&&e.table?e.redraw():this.redraw();return this};c.distribute=function(){for(var a,b=0;b<arguments.length;)a=Math.max(0,Math.min(1,arguments[b++])),this.cells[b].pos=a;this.redraw();return this};c.restyle=function(){var a=this.css.slice();this.root&&a.push("wg-root");this.index===0?a.push("first"):a.push("not-first");this.dir&&(a.push("wg-split"),2===this.dir?a.push("wg-split-y"):a.push("wg-split-x"));this.t&&a.push("has-title");
83
  this.nav&&a.push("has-nav");this.table?a.push("is-table"):null!=this.field&&(a.push("is-field"),this.field||a.push("readonly"));this.el.className=a.join(" ");return this};c.redraw=function(){if(this.body){var a=this.el.clientHeight||0,b=this.body.offsetTop||0;b<a&&(a-=b);this.body.style.height=String(a)+"px"}for(var a=this.length,c,e=1,f=this.dir===2?"height":"width";--a>=0;){b=this.cells[a];if(this.nav)c=1;else{if(b.fixed)b.pos=b.fixed/d(this.el)[f]();c=e-b.pos;e=b.pos}b.el.style[f]=String(100*c)+
84
- "%";b.restyle().redraw()}this.table&&this.redrawTable();return this};c.redrawTable=function(){var a=-1,b=this.cells[0],c=this.cells[1],a=d(c.body).width(),e=c.body.firstChild,c=e.childNodes;e.style.width=a+"px";for(var a=b.length,f=1;--a>=0;)e=b.cells[a],c[a].style.width=String(100*(f-e.pos))+"%",f=e.pos;return!0};c.contents=function(a){if(null===a)return this.body.innerHTML;this.cells.length?this.clear():this.body&&this.el.removeChild(this.body);this.body=this.el.appendChild(n.el("","wg-content"));
85
- "string"===typeof a?d(this.body).html(a):this.append(a);this.redraw();return this};c.textarea=function(a,b){this.contents(n.txt(a));(this.field=b)&&p(this.body);this.restyle();return this};c.append=function(a){a.nodeType?this.body.appendChild(a):d(this.body).append(a);return this};c.header=function(a){if(!arguments.length)return this.el.getElementsByTagName("h2")[0];this.t=n.txt(a||"");this.el.insertBefore(n.el("h2","wg-title"),this.body).appendChild(this.t);this.restyle().redraw();return this};c.title=
86
- function(a){this.t?this.t.nodeValue=a||"":this.header(a);return this.t};c.tabulate=function(a){var c=this.id,e=[],f=[];rows=this.splity(c+"-thead",c+"-body");thead=rows[0];tbody=rows[1];thead.css.push("wg-thead");tbody.css.push("wg-tbody");a.eachCol(function(a,b){e.push(c+"-col"+a);f.push(b)});for(var g=-1,h,k=n.el("","wg-cols"),m=thead._split(B,e);++g<m.length;)h=m[g],h.header(f[g]),k.appendChild(n.el("","wg-col "+(g===0?"":"not-")+"first"));tbody.contents(k);a.eachRow(function(a,b,c){tbody._addRow(b,
87
- c)});d(tbody.el).mousedown(b);this.lock();this.table=a;this.restyle().redraw();h=thead.cells[0];tbody.fixed=r(h.body,h.el)||20;this.resize(tbody.fixed);d(k).attr("tabindex","-1").keydown(l);return k};c.lock=function(){this.body.className+=" locked";return this};c.addRow=function(a,b){this.table&&this.cells[1]&&this.cells[1]._addRow(a,b);return this};c._addRow=function(a,b){for(var c,d=this.body.firstChild.childNodes,e=d.length,f=d[0].childNodes.length,g=-1;++g<e;)c=d[g].appendChild(n.el("",b||"wg-tr")),
88
- c.setAttribute("data-row",f),c=c.appendChild(n.el("","wg-td")),a[g]&&/\S/.test(a[g])?c.appendChild(n.txt(a[g])):c.innerHTML="&nbsp;";return d};c.tr=function(a){for(var b=-1,c,d=[],e=this.cells[1].body.firstChild.childNodes;++b<e.length;)(c=e[b].childNodes[a])&&d.push(c);return d};c.td=function(a,b){try{return this.cells[1].body.firstChild.childNodes[b].childNodes[a].firstChild}catch(c){return null}};c.selectRow=function(a){var b=this.table&&this.table.row(a);if(b){var c=this.tr(a);if(c.length){var e=
89
- this.cells[1],f=e.body,g=d(f.firstChild);g.find("div.selected").removeClass("selected");d(c).addClass("selected");g.data("row",a);var h=f.scrollTop;g.focus();if(h)f.scrollTop=h;e.scrollTo(c[0]);g.trigger("wgRowSelect",[a,b])}return this}};c.scrollTo=function(a,b){var c,e=this.body.scrollTop,f=this.body.clientHeight+e,g=r(a,this.body),h=g+d(a).outerHeight();e>g?c=g:f<h&&(c=h-this.body.clientHeight);if(null!=c)b?this.body.scrollTop=c:d(this.body).animate({scrollTop:c},300);return this};c.navigize=function(a){function b(a,
90
- c){f=a.show();g=c.addClass("active");a.trigger("wgTabSelect",[a.data("index")]);return a}var c=this;c.nav&&c.el.removeChild(c.nav);c.nav=c.el.insertBefore(n.el("nav","wg-tabs"),c.body);var f,g,h=d(c.nav).click(function(a){var h=d(a.target),k=h.data("tab");if(k){var l=g;f&&f.hide();l&&l.removeClass("active");b(k,h).children().focus();c.redraw();return e(a)}});c.each(function(c,e){e.pos=0;var g=d(e.el).data("index",c),k=d('<a href="#'+e.id+'"></a>').data("tab",g).text(a[c]).appendTo(h);f?g&&g.hide():
91
- b(g,k)});c.lock();c.restyle().redraw();h=null;return c};c=null;return a}({},A,u));o.register("$2",function(a,c,k){function g(a){var c=k.createElement("pre");c.innerHTML=a.replace(/<(p|div|br) ?\/?>/ig,"\n<$1>").replace(/(^\n+|\n+$)/g,"");a="string"===typeof c.textContent?c.textContent:"string"===typeof c.innerText?c.innerText:d(c).text();return a}a.init=function(a){function f(a){if(!a)return["",""];var b=[a.source()||"",a.translation()||""];(a=a.context())&&(b[0]+=" [ "+a+" ]");return b}function b(a){if(a=
92
- a||z){var b=m.indexOf(a),b=u.tr(b);d(b).attr("class",e(a)+" po-unsaved");p("poUnsaved",[++v])}}function k(a,c){c=c||z;if(!c)return null;var d=c.fuzzy();null!=a&&d!=a&&(c.fuzzy(a),p("poFuzzy",[c,a]),b(c));return d}function e(a){var b=["wg-tr"];a&&(a.fuzzy()&&b.push("po-fuzzy"),a.translation()||b.push("po-empty"),a.comment()&&b.push("po-comment"),z&&m.eq(z,a)&&b.push("selected"));return b.join(" ")}function y(a,b){var c=f(a)[b||0],e=m.indexOf(a),e=u.td(e,b);c&&/\S/.test(c)?d(e).text(c.replace("\n",
93
- " ")):d(e).html("&nbsp;")}function r(a){a!==s&&(t=(s=a)?m.lock(t):m.unlock()||t,p("poLock",[a,t]),z&&B(z))}function p(b,c){return d(a).trigger(b,c||[])}function q(){if(!m||!m.row)u.clear().header("Error").contents("Invalid PO");else{var a;u.table&&(a=C?C.parentNode.scrollTop:0,u.clear());C=u.tabulate(A);if(a)C.parentNode.scrollTop=a;p("poLoad");(a=m.locale())?(t=a,r(!0)):r(!1);return!!m.length}}function n(){z&&(p("poDeselected",[z]),z=null)}function B(a){function c(){var d=t&&t.lang&&"en"!==t.lang&&
94
- t.label;H.title(d?d+" translation:":"Translation:");if(r){var h=[],m=o.require("$3","collection.js").init();a.each(function(a,b){h.push("Form "+a);m.add("plural-"+a,b)});w=H.splitx.apply(H,m.keys);H.each(function(a,b){b.textarea(m[a],f)});H.navigize(h).bind("wgTabSelect",function(a,b){e=b})}else H.textarea(a.translation(),f);H.bind("wgChange",function(c,d){var f=g(d);a.translate(f,e);0===e&&y(a,1);p("poTranslate",[a,f]);a.fuzzy()?k(!1,a):b(a)})}function d(){H.title("Context:");H.textarea(a.context(),
95
- !0);H.bind("wgChange",function(c,d){var e=g(d);a.context(e);e=a.source();y(a,0);p("potChange",[a,e]);b(a)}).bind("wgChanged",function(){m.reIndex(a)})}n();z=a;J.unbind().clear();H.unbind().clear();I.unbind();I.textarea(a.comment(),!0).bind("wgChange",function(c,d){var e=g(d);a.comment(e);p("poComment",[a,e]);b(a)});var e=0,f=s,h=!s,q=a.source()||"",r=a.plural();(function(){r?(w=J.splity(J.id+"-singular",J.id+"-plural"),w[0].header("Singular:").textarea(q,h),w[1].header("Plural:").textarea(r,h),J.lock()):
96
- J.textarea(q,h);h&&J.bind("wgChange",function(c,d){var e=g(d);J.id+"-plural"===c.target.parentNode.id?a.plural(e):(a.source(e),y(a,0));p("potChange",[a,e]);b(a)}).bind("wgChanged",function(b){J.id+"-plural"===b.target.parentNode.id||m.reIndex(a)})})();f?c():d();p("poSelected",[a]);data=null}var m,s,t,z,v=0,C,A={row:function(a){return f(m.row(a))},eachCol:function(a){a(0,"Source text");a(0,"Translation")},eachRow:function(a){var b=0;m.each(function(c,d){a(b++,f(d),e(d))})}},D=o.require("$4","LocoWinGrid.js").init(a),
97
- w=D.splity("po-list","po-edit"),u=w[0],E=w[1],w=E.splitx("po-trans","po-comment"),G=w[0],I=w[1].header("Comment:"),w=G.splity("po-source","po-target"),J=w[0].header("Source text:"),H=w[1].header("Translation:");D.distribute(0.34);E.distribute(0.8);d(c).resize(function(){D.redraw(!0);return!0});u.bind("wgRowSelect",function(a,b){var c=m.row(b);B(c);return!0});return{bind:function(b,c){return d(a).bind(b,c)},load:function(a){m=a;q()&&u.selectRow(0)},save:function(a){if(v||a)d(C).find("div.po-unsaved").removeClass("po-unsaved"),
98
- p("poSave");v=0;return m},fuzzy:function(a){return k(a)},del:function(a,b){var c=arguments.length?m.get(a,b):z;if(c){var d=m.del(c);null!=d&&(z&&m.eq(c,z)&&n(),q(),m.length&&!z&&(d=Math.min(d,m.length-1),u.selectRow(d)))}},add:function(a,c){var d,f=m.get(a,c);f?d=m.indexOf(f):(d=m.length,f=m.add(a,c),u.addRow(A.row(d),e(f)),b(f));u.selectRow(d);return f},lock:function(){r(!0)},unlock:function(){r(!1)},locked:function(){return Boolean(s)}}};return a}({},A,u));var X=A.ajaxurl||"/wp-admin/admin-ajax.php",
99
- R=(A.loco||{}).conf||{},P=R.locale,I=o.require("$1","po.js").create(P),G={},N=u.getElementById("loco-poedit-inner"),O=A.loco__||function(a){return a};d(A).resize(function(){function a(){var a;a=N;for(var h=a.offsetTop||0;(a=a.offsetParent)&&a!==void 0;)h+=a.offsetTop||0;a=h;h=d(A).innerHeight();N.style.height=String(Math.max(k,h-a-c))+"px";return!0}var c=20,k=parseInt(d(N).css("min-height")||0);a();return a}());G.save=function(a){function c(){a.disabled=!1}c();E.bind("poUnsaved",function(){d(a).addClass("button-primary loco-flagged")}).bind("poSave",
100
- function(){d(a).removeClass("button-primary loco-flagged")});d(a.form).submit(function(k){var g=k.target;k.target.po.value=I.toString();a.disabled=!0;V(g,function(a){c();d("#loco-po-modified").text(a.modified);E.save(!0);U(O("File saved")+", "+a.filename)},c);return M(k)});return!0};G.download=function(a){a.disabled=!1;d(a).click(function(){a.form.po.value=I.toString();d(N).trigger("poSave");return!0});return!0};G.add=!P&&function(a){a.disabled=!1;d(a).click(function(a){var d=1,g;for(g="New message";I.get(g);)d=
101
- /(\d+)/.exec(g)?Math.max(d,RegExp.$1):d,g="New message "+ ++d;E.add(g);return M(a)});return!0};G.del=!P&&function(a){a.disabled=!1;d(a).click(function(a){E.del();return M(a)});return!0};G.fuzzy=P&&function(a){function c(c){d(a)[c?"addClass":"removeClass"]("loco-inverted")}a.disabled=!1;E.bind("poSelected",function(a,d){c(d.fuzzy())}).bind("poFuzzy",function(a,d,h){c(h)});d(a).click(function(a){var c=!E.fuzzy();E.fuzzy(c);return M(a)});return!0};G.sync=function(a){function c(){a.disabled=!1}c();E.bind("poUnsaved",
102
- function(){a.disabled=!0}).bind("poSave",function(){c()});d(a.form).submit(function(k){a.disabled=!0;V(k.target,function(a){c();var h=o.require("$1","po.js").create(void 0);h.load(a.exp);var f=[],b=I.merge(h),h=b.add.length,b=b.del.length;E.load(I);h||b?(f.push("Merged from "+(a.pot||"source code")),h&&f.push(h+" new string"+(h===1?"":"s")+" added"),b&&f.push(b+" obsolete string"+(b===1?"":"s")+" removed"),d(N).trigger("poUnsaved",[])):f.push("Already up to date with "+(a.pot||"source code"));U(f.join(". "))},
103
- c);return M(k)});return!0};G.revert=function(a){E.bind("poUnsaved",function(){a.disabled=!1}).bind("poSave",function(){a.disabled=!0});d(a).click(function(a){location.reload();return M(a)});return!0};G.help=function(){return!0};N.innerHTML="";var E=o.require("$2","poedit.js").init(N);d("#loco-nav").find("button").each(function(a,c){var k=c.getAttribute("data-loco");G[k]&&G[k](c)||d(c).hide()});G=null;E.bind("poUnsaved",function(){A.onbeforeunload=function(){return O("Your changes will be lost if you continue without saving")}}).bind("poSave",
104
- function(){A.onbeforeunload=null});P?I.load(R.po||{}):I.load(R.pot||{});E.load(I);d("#wpbody-content").find("div.loco-message").each(function(a,c){S(c,!0)})})(window,document,window.jQuery);
 
 
 
 
1
+ (function(w,v,d){function H(a){a.stopPropagation();a.preventDefault();return!1}function Z(a,c){function k(){f();h=setTimeout(function(){d(a).fadeOut(1E3,c)},g)}function f(){h&&clearTimeout(h);h=null}var h,g=5E3;k();d(a).mouseenter(f).mouseleave(k)}function U(a,c){function k(f){d(a).remove();d(w).triggerHandler("resize");return f&&H(f)}d('<a class="dismiss" href="#">&times;</a>').appendTo(a).click(k);c||Z(a,k)}function V(a,c,k,f){var h="loco-js-"+k,k=v.getElementById(h)||d('<div id="'+h+'" class="loco-message '+
2
+ (f||k)+'"></div>').insertBefore(d("#loco-poedit")),a=d(v.createElement("p")).text(a),c=d(v.createElement("strong")).text(c+": ");a.prepend(c).appendTo(d(k).html(""));d(w).triggerHandler("resize");U(k)}function W(a){return V(a,O("OK"),"updated loco-success")}function X(){var a=E.stats(),c=a.t,k=a.f,f=a.u,a=a.p+" translated, "+c+" string"+(1===c?"":"s"),c=[];k&&c.push(k+" fuzzy");f&&c.push(f+" untranslated");c.length&&(a+=" ("+c.join(", ")+")");d("#loco-po-status").text(a)}function Y(a,c,k){function f(a,
3
+ f,b){b=b||O("Unknown Ajax error");V(b,O("Error"),"error");k&&k(a,f,b)}return d.ajax({url:$,type:a.method,data:d(a).serialize(),dataType:"json",error:f,success:function(a,g,b){!a||a.error?f(b,g,a&&a.error&&a.error.message):c&&c(a,g,b)}})}var o=function(){var a={};return{register:function(c,d){a[c]=d},require:function(c,d){var f=a[c];if(!f)throw Error('CommonJS error: failed to require("'+d+'")');return f}}}();o.register("$6",function(a){function c(a){this.reIndex([]);if(a)for(var c in a)this.add(c,
4
+ a[c])}a.init=function(a){return new c(a)};var d=c.prototype;d.reIndex=function(a){var c=-1;for(this.ords={};++c<a.length;)this.ords[a[c]]=c;this.keys=a;this.length=c};d.key=function(a,c){if(null==c)return this.keys[a];var g=this.keys[a],b=this.ords[c];if(c!==g){if(null!=b)throw Error("Clash with item at ["+b+"]");this.keys[a]=c;delete this.ords[g];this.ords[c]=a}return a};d.indexOf=function(a){a=this.ords[a];return null==a?-1:a};d.add=function(a,c){var g=this.ords[a];null==g&&(this.keys[this.length]=
5
+ a,g=this.ords[a]=this.length++);this[g]=c;return g};d.get=function(a){return this[this.ords[a]]};d.cut=function(a,c){var g=[].splice.call(this,a,c);this.keys.splice(a,c);this.reIndex(this.keys);return g};d.each=function(a){for(var c=-1;++c<this.length;)a(this.keys[c],this[c],c);return this};d=null;return a}({},w,v));o.register("$1",function(a){function c(b){return{"Project-Id-Version":"PACKAGE VERSION","Report-Msgid-Bugs-To":"","POT-Creation-Date":b||"","POT-Revision-Date":b||"","PO-Revision-Date":b||
6
+ "","Last-Translator":"","Language-Team":"",Language:"","Plural-Forms":"","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-Poedit-SourceCharset":"UTF-8"}}function d(b,a){var e=b||"";a&&(e+="\000"+a);return e}function f(){return o.require("$6","collection.js").init()}function h(b){if(!b)return'""';for(var a=b.replace("\r\n","\n").split("\n"),e=a.length-1,l=[],c=-1,f;++c<a.length;){b=a[c];for(e&&e!==c&&(b+="\n");b&&b.charAt(79);){for(f=80;--f;)if(-1!==
7
+ " \n\r.?!,;:-".indexOf(b.charAt(f))){f++;break}f||(f=79);l.push(g(b.substr(0,f)));b=b.substr(f)}b&&l.push(g(b))}l[1]&&l.unshift("");return'"'+l.join('"\n"')+'"'}function g(b){return b.replace(/(["\\])/g,"\\$1").replace(/\n/g,"\\n")}function b(b){this.head={};this.headers(c(this.now()));this.locale(b);this.length=0;this.rows=f()}function l(b,a){this.src=[b||""];this.msg=[a||""];this.cmt="";this.status=0}a.create=function(a){return new b(a)};var e=b.prototype;e.now=function(){return(new Date).toString()};
8
+ e.header=function(b,a){if(null==a)return this.headers()[b]||"";this.head[b]=a||"";return this};e.headers=function(b){var a;if(null!=b){for(a in b)this.head[a]=b[a];return this}var e=this.locale(),l=this.now(),b={};for(a in this.head)b[a]=String(this.head[a]);e?(b.Language=e.label||"Unknown locale",b["Plural-Forms"]="nplurals="+(e.nplurals||"2")+"; plural="+(e.pluraleq||"n!=1"),b["X-Loco-Target-Locale"]=(e.lang||"en")+"_"+(e.region||"GB"),b["PO-Revision-Date"]=l,delete b["POT-Revision-Date"]):(b.Language=
9
+ "",b["Plural-Forms"]="nplurals=INTEGER; plural=EXPRESSION",b["POT-Revision-Date"]=l,b["PO-Revision-Date"]="YEAR-MO-DA HO:MI+ZONE");b["X-Generator"]="Loco - http://localise.biz/";return b};e.locale=function(b){if(null==b)return this.loc;this.loc=b||{lang:"en",region:"GB",nplurals:2,pluraleq:"n == 1 ? 0 : 1",label:"English"};this.loc.toString=function(){return this.lang+"_"+this.region};return this};e.lock=function(b){this.locale(b||!1);return this.loc};e.unlock=function(){var b=this.loc;this.loc=null;
10
+ return b};e.reIndex=function(b,a){var e=this.indexOf(b),l=b.hash(),c=this.rows.indexOf(l);return c===e?e:-1!==c?(a=(a||0)+1,b.source("Error, duplicate "+String(a)+": "+b.source()),this.reIndex(b,a)):this.rows.key(e,l)};e.get=function(b,a){return this.rows.get(d(b,a))};e.indexOf=function(b){if(null==b.idx)b.idx=this.rows.indexOf(b.hash());return b.idx};e.del=function(b){b=this.indexOf(b);if(-1!==b){var a=this.rows.cut(b,1);if(a&&a.length)return this.length=this.rows.length,this.rows.each(function(b,
11
+ a,e){a.idx=e}),b}};e.add=function(b,a){b instanceof l||(b=new l(b));a&&b.context(a);var e=b.hash();if(this.rows.get(e))throw Error("Duplicate message at index "+this.indexOf(b));b.idx=this.rows.add(e,b);this.length=this.rows.length;return b};e.each=function(b){this.rows.each(b);return this};e.load=function(b){for(var a=-1,e,c,g,f,d=[],h=[],A=[],n=[];++a<b.length;)if(e=b[a],null==e.parent){if(c=e.source||e.id,g=e.context,c||g)f=new l(c,e.target||""),g&&f.context(g),e.flag&&f.flag(e.flag,!0),e.comment&&
12
+ f.comment(e.comment),e.message=f,f.translation()?f.fuzzy()?A.push(f):h.push(f):n.push(f)}else d.push(e);for(a=-1;++a<d.length;)try{e=d[a];c=e.source||e.id;f=b[e.parent]&&b[e.parent].message;if(!f)throw Error("parent missing for plural "+c);1===e.plural&&f.plural(c);f.translate(e.target||"",e.plural)}catch(u){}c=[n,A,h];for(a=0;a<3;a++){e=c[a];for(b=-1;++b<e.length;)try{this.add(e[b])}catch(k){}}return this};e.merge=function(b){var a,e=this.rows,l=f(),c={add:[],del:[]},b=b.rows;this.rows.each(function(a,
13
+ e){b.get(a)||c.del.push(e)});b.each(function(b,f){try{a=e.get(b),a||(a=f,c.add.push(a)),a.idx=l.add(b,a)}catch(g){}});this.rows=l;this.length=l.length;return c};e.row=function(b){return this.rows[b]};e.toString=function(){var b,a=[],e=[],c=this.headers(),f=!this.loc;for(b in c)e.push(b+": "+c[b]);e=new l("",e.join("\n"));f&&(e.comment("Loco Gettext template"),e.fuzzy(!0));a.push(e.toString());a.push("");this.rows.each(function(b,e){a.push(e.toString(f));a.push("")});return a.join("\n")};e=l.prototype;
14
+ e.hash=function(){return d(this.source(),this.context())};e.flag=function(b,a){var e=b===(b&this.status);if(null==a)return e;a?this.status|=b:e&&(this.status^=b);return this};e.fuzzy=function(b){return this.flag(4,b)};e.source=function(b,a){if(null==b)return this.src[0];this.src[0]=b;this.plural(a);return this};e.plural=function(b){if(null==b)return this.src[1];this.src[1]=b||"";return this};e.each=function(b){for(var a=-1;++a<this.msg.length;)b(a,this.msg[a]);return this};e.translate=function(b,
15
+ a){this.msg[a||0]=b||"";return this};e.translation=function(b){return this.msg[b||0]||""};e.comment=function(b){if(null==b)return this.cmt||"";this.cmt=b||"";return this};e.context=function(b){if(null==b)return this.src[2]||"";this.src[2]=b||"";return this};e.toString=function(b){var a,e=[];this.cmt&&(e=["# "+this.cmt.replace("\r\n","\n").split("\n").join("\n# ")]);!b&&this.fuzzy()&&e.push("#, fuzzy");this.src[2]&&e.push("msgctxt "+h(this.src[2]));e.push("msgid "+h(this.src[0]));if(null==this.src[1])e.push("msgstr "+
16
+ h(b?"":this.msg[0]));else{a=-1;for(e.push("msgid_plural "+h(this.src[1]));++a<this.msg.length;)e.push("msgstr["+a+"] "+h(b?"":this.msg[a]))}return e.join("\n")};e.toText=function(){return this.src.join(" ")+" "+this.msg.join(" ")};e.weight=function(){var b=0;this.translation()||(b+=2);this.fuzzy()&&(b+=1);return b};e.compare=function(b,a){var e=this.weight(),c=b.weight();if(e>c)return 1;if(e<c)return-1;if(a){e=this.hash().toLowerCase();c=b.hash().toLowerCase();if(e<c)return 1;if(e>c)return-1}return 0};
17
+ e.equals=function(b){return this===b||this.source()===b.source()&&this.context()===b.context()};e=e=null;return a}({},w,v));o.register("$2",function(a){function c(){var a,c;this.clear=function(){this.length=0;a={};c=[]};this.getTree=function(){return a};this.getData=function(){return c};this.clear()}a.create=function(){return new c};var d=c.prototype;d.depth=0;d.matchall=!0;d.ignorecase=!0;d.nonword=/[\-.?!;:,_*^+=~`"'(){}<>[\]\/\\\u00a0\u1680\u180e\u2000-\u206f\u2e00-\u2e7f\u3000-\u303f]+/g;d.translit=
18
+ function(a,c){function g(b){return a[b]||b}c=c||/[^a-z0-9]/g;this.trans=function(b){return b.replace(c,g)}};d.stoppers=function(a){this.stopped=function(c){return Boolean(a[c])}};d.add=function(a,c){null==c&&(c=String(a));var g=-1,b,l,e,d,k,s=this.normalize(c);b=this.getData();var r=b.length;b.push(a);for(this.length++;++g<s.length;)if(b=s[g],!this.stopped(b)){l=this.getTree();e=Math.min(b.length,this.depth)||b.length;for(d=0;d<e;d++)k=b.charAt(d),l=l[k]||(l[k]={});b=l[" "]||(l[" "]=[]);b.push(r)}return this};
19
+ d.find=function(a,c){function g(b,a){var e,c,l;for(s in b)if(l=b[s]," "===s)for(e in l)r=l[e],c=m[r]||(m[r]={length:0,words:{}}),c.length+=c.words[a]?0:1,c.words[a]=1+(c.words[a]||0);else g(l,a)}var b=-1,l,e,d,k,s,r,m={},p=[],q=this.normalize(a),t=this.getData();a:for(;++b<q.length;){l=q[b];e=this.getTree();d=Math.min(l.length,this.depth)||l.length;for(k=0;k<d;k++){s=l.charAt(k);if(!e[s])continue a;e=e[s]}g(e,l)}for(r in m)this.matchall&&m[r].length<q.length||p.push(t[r]);if(c)c.query=a,c.words=q;
20
+ return p};d.normalize=function(a){for(var c=-1,g={},b=[],l=this.split(a);++c<l.length;)if(a=l[c])if(this.ignorecase&&(a=a.toLowerCase()),a=this.strip(a))this.trans&&(a=this.trans(a)),g[a]||(b.push(a),g[a]=!0);return b};d.stopped=function(a){return 1===a.length};d.split=function(a){return a.split(/\s+/)};d.strip=function(a){return a.replace(this.nonword,"")};d=null;return a}({},w,v));o.register("$3",{"\u0131":"i","\u03b1":"a","\u03b2":"b","\u03c8":"c","\u03b4":"d","\u03b5":"e","\u03c6":"f","\u03b3":"g",
21
+ "\u03b7":"h","\u03b9":"i","\u03be":"j","\u03ba":"k","\u03bb":"l","\u03bc":"m","\u03bd":"n","\u03bf":"o","\u03c0":"p","\u03c1":"r","\u03c3":"s","\u03c4":"t","\u03b8":"u","\u03c9":"v","\u03c2":"s","\u03c7":"x","\u03c5":"y","\u03b6":"z","\u0444":"a","\u0438":"b","\u0441":"c","\u0432":"d","\u0443":"e","\u0430":"f","\u043f":"g","\u0440":"h","\u0448":"i","\u043e":"j","\u043b":"k","\u0434":"l","\u044c":"m","\u0442":"n","\u0449":"o","\u0437":"p","\u0439":"\ua647","\u043a":"r","\u044b":"s","\u0435":"t","\u0433":"u",
22
+ "\u043c":"v","\u0446":"w","\u0447":"x","\u043d":"y","\u044f":"z","\u00aa":"a","\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","\ua733":"a","\u00e6":"a","\u01fd":"a","\u01e3":"a",
23
+ "\ua735":"a","\ua737":"a","\ua739":"a","\ua73b":"a","\ua73d":"a","\u1e9a":"a","\u2c65":"\u2c65","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"\u0180","\u0183":"\u0183","\u0107":"c","\u0109":"c","\u010d":"c","\u010b":"c","\u00e7":"c","\u1e09":"c","\u023c":"\u023c","\ua792":"\ua793","\u0188":"\u0188","\ua73f":"\ua73f","\u010f":"d","\u1e0b":"d","\u1e11":"d","\u1e0d":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u00f0":"d","\ua77a":"d","\u0238":"d","\u01f3":"d","\u01f2":"d","\u01c6":"d","\u01c5":"d",
24
+ "\u018c":"\u018c","\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","\u1e1b":"e","\u0247":"\u0247","\u01dd":"\u01dd","\u1e1f":"f","\ua77c":"f","\u0192":"\u0192","\u01f5":"g","\u011f":"g","\u011d":"g","\u01e7":"g","\u0121":"g","\u0123":"g",
25
+ "\u1e21":"g","\ua7a1":"g","\u01e5":"\u01e5","\ua77f":"\ua77f","\u01a3":"\u01a3","\u0125":"h","\u021f":"h","\u1e27":"h","\u1e23":"h","\u1e29":"h","\u1e25":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\ua7f8":"h","\u0195":"\u0195","\u2c68":"\u2c68","\u2c76":"\u2c76","\ua727":"\ua727","\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","\u0133":"i","\ud835\udea4":"i",
26
+ "\u2c7c":"j","\u0135":"j","\u01f0":"j","\u0249":"\u0249","\u1e31":"k","\u01e9":"k","\u0137":"k","\ua7a3":"k","\u1e33":"k","\u1e35":"k","\u0199":"\u0199","\u2c6a":"\u2c6a","\ua741":"\ua741","\ua743":"\ua743","\ua745":"\ua745","\u013a":"l","\u013e":"l","\u013c":"l","\u1e37":"l","\u1e39":"l","\u1e3d":"l","\u1e3b":"l","\u0142":"l","\u0140":"l","\u01c9":"l","\u01c8":"l","\u1efb":"l","\ua747":"\ua747","\ua749":"\ua749","\u019a":"\u019a","\u2c61":"\u2c61","\ua781":"\ua781","\u1e3f":"m","\u1e41":"m","\u1e43":"m",
27
+ "\u0144":"n","\u01f9":"n","\u0148":"n","\u00f1":"n","\u1e45":"n","\u0146":"n","\ua7a5":"n","\u1e47":"n","\u1e4b":"n","\u1e49":"n","\u01cc":"n","\u01cb":"n","\u019e":"\u019e","\ua791":"\ua791","\u014b":"\u014b","\u00ba":"o","\u00f3":"o","\u00f2":"o","\u014f":"o","\u00f4":"o","\u1ed1":"o","\u1ed3":"o","\u1ed7":"o","\u1ed5":"o","\u01d2":"o","\u00f6":"o","\u022b":"o","\u0151":"o","\u00f5":"o","\u1e4d":"o","\u1e4f":"o","\u022d":"o","\u022f":"o","\u0231":"o","\u00f8":"o","\u01ff":"o","\u01eb":"o","\u01ed":"o",
28
+ "\u014d":"o","\u1e53":"o","\u1e51":"o","\u1ecf":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edb":"o","\u1edd":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u0153":"o","\ua7f9":"o","\ua74f":"o","\ua74d":"\ua74d","\ua74b":"\ua74b","\u0223":"\u0223","\u1e55":"p","\u1e57":"p","\ua751":"\ua751","\u01a5":"\u01a5","\ua753":"\ua753","\ua755":"\ua755","\u0239":"q","\ua757":"\ua757","\ua759":"\ua759","\u024b":"\u024b","\u0155":"r","\u0159":"r","\u1e59":"r","\u0157":"r","\ua7a7":"r",
29
+ "\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u1e5f":"r","\ua783":"r","\ua75b":"\ua75b","\u024d":"\u024d","\ua75d":"\ua75d","\u015b":"s","\u1e65":"s","\u015d":"s","\u0161":"s","\u1e67":"s","\u1e61":"s","\u015f":"s","\ua7a9":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u017f":"s","\ua785":"s","\u1e9b":"s","\u00df":"s","\u023f":"\u023f","\u0165":"t","\u1e97":"t","\u1e6b":"t","\u0163":"t","\u1e6d":"t","\u021b":"t","\u1e71":"t","\u1e6f":"t","\ua787":"t","\u01be":"t","\ua729":"t","\u0167":"\u0167",
30
+ "\u2c66":"\u2c66","\u01ad":"\u01ad","\u00fa":"u","\u00f9":"u","\u016d":"u","\u00fb":"u","\u01d4":"u","\u016f":"u","\u00fc":"u","\u01d8":"u","\u01dc":"u","\u01da":"u","\u01d6":"u","\u0171":"u","\u0169":"u","\u1e79":"u","\u0173":"u","\u016b":"u","\u1e7b":"u","\u1ee7":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1ee9":"u","\u1eeb":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u1e77":"u","\u1e75":"u","\u2c7d":"v","\u1e7d":"v","\u1e7f":"v","\ua761":"v","\ua75f":"\ua75f","\u1efd":"\u1efd",
31
+ "\u1e83":"w","\u1e81":"w","\u0175":"w","\u1e98":"w","\u1e85":"w","\u1e87":"w","\u1e89":"w","\u2c73":"\u2c73","\u1e8d":"x","\u1e8b":"x","\u00fd":"y","\u1ef3":"y","\u0177":"y","\u1e99":"y","\u00ff":"y","\u1ef9":"y","\u1e8f":"y","\u0233":"y","\u1ef7":"y","\u1ef5":"y","\u024f":"\u024f","\u01b4":"\u01b4","\u1eff":"\u1eff","\u021d":"\u021d","\u017a":"z","\u1e91":"z","\u017e":"z","\u017c":"z","\u1e93":"z","\u1e95":"z","\u018d":"z","\u01b6":"\u01b6","\u0225":"\u0225","\u0240":"\u0240","\u2c6c":"\u2c6c","\ua763":"\ua763",
32
+ "\u01b9":"\u01b9","\u00fe":"\u00fe","\ua765":"\ua765","\ua767":"\ua767","\u01bf":"\u01bf","\ua769":"\ua769","\ua76b":"\ua76b","\ua76d":"\ua76d","\ua76f":"\ua76f","\ua770":"\ua76f","\ua72b":"\ua72b","\ua72d":"\ua72d","\ua72f":"\ua72f","\u01a8":"\u01a8","\u01bd":"\u01bd","\u0185":"\u0185","\u0242":"\u0242","\ua723":"\ua723","\ua78c":"\ua78c","\ua725":"\ua725","\ud835\udec2":"a","\ud835\udefc":"a","\ud835\udf36":"a","\ud835\udf70":"a","\ud835\udfaa":"a","\ud835\udea8":"a","\ud835\udee2":"a","\ud835\udf1c":"a",
33
+ "\ud835\udf56":"a","\ud835\udf90":"a","\u1f00":"a","\u1f04":"a","\u1f84":"a","\u1f8c":"a","\u1f02":"a","\u1f82":"a","\u1f8a":"a","\u1f06":"a","\u1f86":"a","\u1f8e":"a","\u1f80":"a","\u1f88":"a","\u1f01":"a","\u1f05":"a","\u1f85":"a","\u1f8d":"a","\u1f03":"a","\u1f83":"a","\u1f8b":"a","\u1f07":"a","\u1f87":"a","\u1f8f":"a","\u1f81":"a","\u1f89":"a","\u03ac":"a","\u1f71":"a","\u1fb4":"a","\u1f70":"a","\u1fb2":"a","\u1fb0":"a","\u1fb6":"a","\u1fb7":"a","\u1fb1":"a","\u1fb3":"a","\u1fbc":"a","\u03d0":"b",
34
+ "\ud835\udec3":"b","\ud835\udefd":"b","\ud835\udf37":"b","\ud835\udf71":"b","\ud835\udfab":"b","\ud835\udea9":"b","\ud835\udee3":"b","\ud835\udf1d":"b","\ud835\udf57":"b","\ud835\udf91":"b","\u1d5d":"b","\u1d66":"b","\u213d":"g","\ud835\udec4":"g","\ud835\udefe":"g","\ud835\udf38":"g","\ud835\udf72":"g","\ud835\udfac":"g","\u213e":"g","\ud835\udeaa":"g","\ud835\udee4":"g","\ud835\udf1e":"g","\ud835\udf58":"g","\ud835\udf92":"g","\u1d5e":"g","\u1d67":"g","\ud835\udec5":"d","\ud835\udeff":"d","\ud835\udf39":"d",
35
+ "\ud835\udf73":"d","\ud835\udfad":"d","\ud835\udeab":"d","\ud835\udee5":"d","\ud835\udf1f":"d","\ud835\udf59":"d","\ud835\udf93":"d","\u1d5f":"d","\u03f5":"e","\ud835\udec6":"e","\ud835\udedc":"e","\ud835\udf00":"e","\ud835\udf16":"e","\ud835\udf3a":"e","\ud835\udf50":"e","\ud835\udf74":"e","\ud835\udf8a":"e","\ud835\udfae":"e","\ud835\udfc4":"e","\ud835\udeac":"e","\ud835\udee6":"e","\ud835\udf20":"e","\ud835\udf5a":"e","\ud835\udf94":"e","\u1f10":"e","\u1f14":"e","\u1f12":"e","\u1f11":"e","\u1f15":"e",
36
+ "\u1f13":"e","\u03ad":"e","\u1f73":"e","\u1f72":"e","\u03dd":"\u03dd","\u0377":"\u0377","\u03db":"\u03db","\ud835\udec7":"z","\ud835\udf01":"z","\ud835\udf3b":"z","\ud835\udf75":"z","\ud835\udfaf":"z","\ud835\udead":"z","\ud835\udee7":"z","\ud835\udf21":"z","\ud835\udf5b":"z","\ud835\udf95":"z","\u0371":"\u0371","\ud835\udec8":"h","\ud835\udf02":"h","\ud835\udf3c":"h","\ud835\udf76":"h","\ud835\udfb0":"h","\ud835\udeae":"h","\ud835\udee8":"h","\ud835\udf22":"h","\ud835\udf5c":"h","\ud835\udf96":"h",
37
+ "\u1f20":"h","\u1f24":"h","\u1f94":"h","\u1f9c":"h","\u1f22":"h","\u1f92":"h","\u1f9a":"h","\u1f26":"h","\u1f96":"h","\u1f9e":"h","\u1f90":"h","\u1f98":"h","\u1f21":"h","\u1f25":"h","\u1f95":"h","\u1f9d":"h","\u1f23":"h","\u1f93":"h","\u1f9b":"h","\u1f27":"h","\u1f97":"h","\u1f9f":"h","\u1f91":"h","\u1f99":"h","\u03ae":"h","\u1f75":"h","\u1fc4":"h","\u1f74":"h","\u1fc2":"h","\u1fc6":"h","\u1fc7":"h","\u1fc3":"h","\u1fcc":"h","\u03d1":"u","\ud835\udec9":"u","\ud835\udedd":"u","\ud835\udf03":"u","\ud835\udf17":"u",
38
+ "\ud835\udf3d":"u","\ud835\udf51":"u","\ud835\udf77":"u","\ud835\udf8b":"u","\ud835\udfb1":"u","\ud835\udfc5":"u","\ud835\udeaf":"u","\ud835\udeb9":"u","\ud835\udee9":"u","\ud835\udef3":"u","\ud835\udf23":"u","\ud835\udf2d":"u","\ud835\udf5d":"u","\ud835\udf67":"u","\ud835\udf97":"u","\ud835\udfa1":"u","\u1dbf":"u","\u1fbe":"i","\u037a":"i","\ud835\udeca":"i","\ud835\udf04":"i","\ud835\udf3e":"i","\ud835\udf78":"i","\ud835\udfb2":"i","\ud835\udeb0":"i","\ud835\udeea":"i","\ud835\udf24":"i","\ud835\udf5e":"i",
39
+ "\ud835\udf98":"i","\u1f30":"i","\u1f34":"i","\u1f32":"i","\u1f36":"i","\u1f31":"i","\u1f35":"i","\u1f33":"i","\u1f37":"i","\u03af":"i","\u1f77":"i","\u1f76":"i","\u1fd0":"i","\u1fd6":"i","\u03ca":"i","\u0390":"i","\u1fd3":"i","\u1fd2":"i","\u1fd7":"i","\u1fd1":"i","\u03f0":"k","\ud835\udecb":"k","\ud835\udede":"k","\ud835\udf05":"k","\ud835\udf18":"k","\ud835\udf3f":"k","\ud835\udf52":"k","\ud835\udf79":"k","\ud835\udf8c":"k","\ud835\udfb3":"k","\ud835\udfc6":"k","\ud835\udeb1":"k","\ud835\udeeb":"k",
40
+ "\ud835\udf25":"k","\ud835\udf5f":"k","\ud835\udf99":"k","\u03d7":"k","\ud835\udecc":"l","\ud835\udf06":"l","\ud835\udf40":"l","\ud835\udf7a":"l","\ud835\udfb4":"l","\ud835\udeb2":"l","\ud835\udeec":"l","\ud835\udf26":"l","\ud835\udf60":"l","\ud835\udf9a":"l","\u00b5":"m","\ud835\udecd":"m","\ud835\udf07":"m","\ud835\udf41":"m","\ud835\udf7b":"m","\ud835\udfb5":"m","\ud835\udeb3":"m","\ud835\udeed":"m","\ud835\udf27":"m","\ud835\udf61":"m","\ud835\udf9b":"m","\u3382":"m","\u338c":"m","\u338d":"m",
41
+ "\u3395":"m","\u339b":"m","\u33b2":"m","\u33b6":"m","\u33bc":"m","\ud835\udece":"n","\ud835\udf08":"n","\ud835\udf42":"n","\ud835\udf7c":"n","\ud835\udfb6":"n","\ud835\udeb4":"n","\ud835\udeee":"n","\ud835\udf28":"n","\ud835\udf62":"n","\ud835\udf9c":"n","\ud835\udecf":"j","\ud835\udf09":"j","\ud835\udf43":"j","\ud835\udf7d":"j","\ud835\udfb7":"j","\ud835\udeb5":"j","\ud835\udeef":"j","\ud835\udf29":"j","\ud835\udf63":"j","\ud835\udf9d":"j","\ud835\uded0":"o","\ud835\udf0a":"o","\ud835\udf44":"o",
42
+ "\ud835\udf7e":"o","\ud835\udfb8":"o","\ud835\udeb6":"o","\ud835\udef0":"o","\ud835\udf2a":"o","\ud835\udf64":"o","\ud835\udf9e":"o","\u1f40":"o","\u1f44":"o","\u1f42":"o","\u1f41":"o","\u1f45":"o","\u1f43":"o","\u03cc":"o","\u1f79":"o","\u1f78":"o","\u03d6":"p","\u213c":"p","\ud835\uded1":"p","\ud835\udee1":"p","\ud835\udf0b":"p","\ud835\udf1b":"p","\ud835\udf45":"p","\ud835\udf55":"p","\ud835\udf7f":"p","\ud835\udf8f":"p","\ud835\udfb9":"p","\ud835\udfc9":"p","\u213f":"p","\ud835\udeb7":"p","\ud835\udef1":"p",
43
+ "\ud835\udf2b":"p","\ud835\udf65":"p","\ud835\udf9f":"p","\u03fb":"\u03fb","\u03df":"\u03df","\u03d9":"\u03d9","\u03f1":"r","\ud835\uded2":"r","\ud835\udee0":"r","\ud835\udf0c":"r","\ud835\udf1a":"r","\ud835\udf46":"r","\ud835\udf54":"r","\ud835\udf80":"r","\ud835\udf8e":"r","\ud835\udfba":"r","\ud835\udfc8":"r","\ud835\udeb8":"r","\ud835\udef2":"r","\ud835\udf2c":"r","\ud835\udf66":"r","\ud835\udfa0":"r","\u1d68":"r","\u1fe4":"r","\u1fe5":"r","\u03f2":"s","\ud835\uded3":"s","\ud835\uded4":"s","\ud835\udf0d":"s",
44
+ "\ud835\udf0e":"s","\ud835\udf47":"s","\ud835\udf48":"s","\ud835\udf81":"s","\ud835\udf82":"s","\ud835\udfbb":"s","\ud835\udfbc":"s","\ud835\udeba":"s","\ud835\udef4":"s","\ud835\udf2e":"s","\ud835\udf68":"s","\ud835\udfa2":"s","\u037c":"\u037c","\u037b":"\u037b","\u037d":"\u037d","\ud835\uded5":"t","\ud835\udf0f":"t","\ud835\udf49":"t","\ud835\udf83":"t","\ud835\udfbd":"t","\ud835\udebb":"t","\ud835\udef5":"t","\ud835\udf2f":"t","\ud835\udf69":"t","\ud835\udfa3":"t","\ud835\uded6":"y","\ud835\udf10":"y",
45
+ "\ud835\udf4a":"y","\ud835\udf84":"y","\ud835\udfbe":"y","\u03d2":"y","\ud835\udebc":"y","\ud835\udef6":"y","\ud835\udf30":"y","\ud835\udf6a":"y","\ud835\udfa4":"y","\u1f50":"y","\u1f54":"y","\u1f52":"y","\u1f56":"y","\u1f51":"y","\u1f55":"y","\u1f53":"y","\u1f57":"y","\u03cd":"y","\u1f7b":"y","\u03d3":"y","\u1f7a":"y","\u1fe0":"y","\u1fe6":"y","\u03cb":"y","\u03d4":"y","\u03b0":"y","\u1fe3":"y","\u1fe2":"y","\u1fe7":"y","\u1fe1":"y","\u03d5":"f","\ud835\uded7":"f","\ud835\udedf":"f","\ud835\udf11":"f",
46
+ "\ud835\udf19":"f","\ud835\udf4b":"f","\ud835\udf53":"f","\ud835\udf85":"f","\ud835\udf8d":"f","\ud835\udfbf":"f","\ud835\udfc7":"f","\ud835\udebd":"f","\ud835\udef7":"f","\ud835\udf31":"f","\ud835\udf6b":"f","\ud835\udfa5":"f","\u1d60":"f","\u1d69":"f","\ud835\uded8":"x","\ud835\udf12":"x","\ud835\udf4c":"x","\ud835\udf86":"x","\ud835\udfc0":"x","\ud835\udebe":"x","\ud835\udef8":"x","\ud835\udf32":"x","\ud835\udf6c":"x","\ud835\udfa6":"x","\u1d61":"x","\u1d6a":"x","\ud835\uded9":"c","\ud835\udf13":"c",
47
+ "\ud835\udf4d":"c","\ud835\udf87":"c","\ud835\udfc1":"c","\ud835\udebf":"c","\ud835\udef9":"c","\ud835\udf33":"c","\ud835\udf6d":"c","\ud835\udfa7":"c","\ud835\udeda":"v","\ud835\udf14":"v","\ud835\udf4e":"v","\ud835\udf88":"v","\ud835\udfc2":"v","\ud835\udec0":"v","\ud835\udefa":"v","\ud835\udf34":"v","\ud835\udf6e":"v","\ud835\udfa8":"v","\u1f60":"v","\u1f64":"v","\u1fa4":"v","\u1fac":"v","\u1f62":"v","\u1fa2":"v","\u1faa":"v","\u1f66":"v","\u1fa6":"v","\u1fae":"v","\u1fa0":"v","\u1fa8":"v","\u1f61":"v",
48
+ "\u1f65":"v","\u1fa5":"v","\u1fad":"v","\u1f63":"v","\u1fa3":"v","\u1fab":"v","\u1f67":"v","\u1fa7":"v","\u1faf":"v","\u1fa1":"v","\u1fa9":"v","\u03ce":"v","\u1f7d":"v","\u1ff4":"v","\u1f7c":"v","\u1ff2":"v","\u1ff6":"v","\u1ff7":"v","\u1ff3":"v","\u1ffc":"v","\u03e1":"\u03e1","\u0373":"\u0373","\u03f8":"\u03f8","\u2df6":"f","\u04d1":"f","\u04d3":"f","\u04d9":"\u04d9","\u04db":"\u04d9","\u04d5":"\u04d5","\u2de0":"\u0431","\u0431":"\u0431","\u2de1":"d","\u2de2":"u","\u0491":"u","\u0493":"\u0493","\u04fb":"\u04fb",
49
+ "\u0495":"\u0495","\u04f7":"\u04f7","\u2de3":"l","\u0501":"\u0501","\ua681":"\ua681","\u0452":"\u0452","\ua663":"\ua663","\u0503":"\u0503","\u0453":"\u0503","\u0499":"\u0499","\u2df7":"t","\u0450":"t","\u0451":"t","\u04d7":"t","\ua674":"\u0454","\u0454":"\u0454","\u2de4":"\u0436","\u0436":"\u0436","\u04c2":"\u0436","\ua685":"\ua685","\u04dd":"\ua685","\u0497":"\u0497","\u2de5":"p","\ua641":"\ua641","\u0505":"\u0505","\u0511":"\u0511","\u04df":"\u0511","\ua643":"\ua643","\u0455":"\u0455","\ua645":"\ua645",
50
+ "\u04e1":"\u04e1","\ua689":"\ua689","\u0507":"\u0507","\ua683":"\ua683","\ua675":"b","\u045d":"b","\u04e3":"b","\u048b":"\u048b","\u04e5":"\u048b","\u0456":"\u0456","\ua647":"\ua647","\u0457":"\ua647","\ua676":"\ua647","\u0458":"\u0458","\u2df8":"\ua649","\ua649":"\ua649","\u2de6":"r","\u049b":"\u049b","\u04c4":"\u04c4","\u04a1":"\u04a1","\u049f":"\u049f","\u049d":"\u049d","\u051f":"\u051f","\u051b":"\u051b","\u2de7":"k","\u04c6":"\u04c6","\u0513":"\u0513","\u0521":"\u0521","\u0459":"\u0459","\ua665":"\ua665",
51
+ "\u0509":"\u0509","\u0515":"\u0515","\u2de8":"v","\u04ce":"\u04ce","\ua667":"\ua667","\u2de9":"y","\u1d78":"y","\u04ca":"\u04ca","\u04a3":"\u04a3","\u04c8":"\u04c8","\u0523":"\u0523","\u04a5":"\u04a5","\u045a":"\u045a","\u050b":"\u050b","\u2dea":"j","\ua669":"j","\ua66b":"j","\ua66d":"j","\ua66e":"j","\u04e7":"j","\u04e9":"\u04e9","\u04eb":"\u04e9","\u2deb":"g","\u0525":"\u0525","\u04a7":"\u04a7","\u0481":"\u0481","\u2dec":"h","\u048f":"\u048f","\u0517":"\u0517","\u2ded":"c","\u2df5":"c","\u050d":"\u050d",
52
+ "\u04ab":"\u04ab","\u2dee":"n","\ua68d":"\ua68d","\u050f":"\u050f","\u04ad":"\u04ad","\ua68b":"\ua68b","\u045b":"\u045b","\u045c":"\u045b","\ua677":"e","\u04ef":"e","\u045e":"e","\u04f1":"e","\u04f3":"e","\u04af":"\u04af","\u04b1":"\u04b1","\u2df9":"\ua64b","\ua64b":"\ua64b","\u0479":"\u0479","\u2def":"\u0445","\u0445":"\u0445","\u04fd":"\u04fd","\u04ff":"\u04ff","\u04b3":"\u04b3","\u04bb":"\u04bb","\u0527":"\u0527","\ua695":"\ua695","\ua67b":"\u0461","\u0461":"\u0461","\u047f":"\u047f","\ua64d":"\ua64d",
53
+ "\u047d":"\u047d","\u047b":"\u047b","\u2df0":"w","\ua661":"\ua661","\ua68f":"\ua68f","\u04b5":"\u04b5","\ua691":"\ua691","\u2df1":"x","\ua693":"\ua693","\u04f5":"\ua693","\u04b7":"\u04b7","\u04cc":"\u04cc","\u04b9":"\u04b9","\ua687":"\ua687","\u04bd":"\u04bd","\u04bf":"\u04bf","\u045f":"\u045f","\u2df2":"i","\ua697":"\ua697","\u2df3":"o","\ua64f":"\ua64f","\ua678":"\u044a","\u044a":"\u044a","\ua651":"\ua651","\ua679":"s","\u04f9":"s","\ua67a":"m","\u048d":"\u048d","\u2dfa":"\u0463","\u0463":"\u0463",
54
+ "\ua653":"\ua653","\u044d":"\u044d","\u04ed":"\u044d","\u2dfb":"\u044e","\u044e":"\u044e","\ua655":"\ua655","\u2dfc":"\ua657","\ua657":"\ua657","\u0519":"\u0519","\ua69f":"\u0465","\u0465":"\u0465","\u2dfd":"\u0467","\u0467":"\u0467","\ua659":"\ua659","\u2dfe":"\u046b","\u046b":"\u046b","\ua65b":"\ua65b","\u0469":"\u0469","\ua65d":"\ua65d","\u2dff":"\u046d","\u046d":"\u046d","\u046f":"\u046f","\u0471":"\u0471","\u2df4":"\u0473","\u0473":"\u0473","\u0475":"\u0475","\u0477":"\u0475","\ua65f":"\ua65f",
55
+ "\u04a9":"\u04a9","\u051d":"\u051d","\u04cf":"\u04cf"});o.register("$4",function(a){a.listen=function(a,k){function f(){z[l?"show":"hide"]()}function h(){if(a.value!==l)g&&clearTimeout(g),l=a.value,e&&a.setAttribute("size",l.length||1),f(),g=setTimeout(function(){k(l)},b)}var a=a instanceof jQuery?a[0]:a,g,b=150,l=a.value,e=1===Number(a.size),z=d('<a href="#clear" tabindex="-1" class="icon clear"><span>clear</span></a>').click(function(){a.value="";h();return!1});d(a).keyup(function(){h();return!0}).after(z);
56
+ f();return{ping:h,val:function(b){if(b==null)return l;g&&clearTimeout(g);a.value=l=b;f()}}};return a}({},w,v));o.register("$17",function(a,c,d){function f(l){b||c._gat&&(b=_gat._createTracker(h,"loco"));if(b){var e=l.shift();b[e].apply(b,l)}else g&&g.push(l);return a}var h,g,b;a._init=function(b){if(h=b.code){g=c._gaq||(c._gaq=[]);g.push(["_setAccount",h]);g.push(["_trackPageview"]);g.push(["_setDomainName",b.host]);b=d.createElement("script");b.type="text/javascript";b.async=!0;b.src=("https:"==
57
+ d.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var e=d.getElementsByTagName("script")[0];e.parentNode.insertBefore(b,e)}return a};a.event=function(b,a,c,g){return f(["_trackEvent",b||"",a||"",c||"",g||0])};a.page=function(b,a){return f(["_trackPageview",{page:b||location.pathname+location.hash,title:a||d.title}])};return a}({},w,v));o.register("$18",function(a,c,d){function f(b,l){if(h)h[b](l);else c.ga&&ga(b,l);return a}var h,g;a._init=function(b){b.code&&(function(b,
58
+ a,c,g,d,f,h){b.GoogleAnalyticsObject=d;b[d]=b[d]||function(){(b[d].q=b[d].q||[]).push(arguments)};b[d].l=1*new Date;f=a.createElement(c);h=a.getElementsByTagName(c)[0];f.async=1;f.src=g;h.parentNode.insertBefore(f,h)}(c,d,"script","//www.google-analytics.com/analytics.js","ga"),ga("create",b.code,{alwaysSendReferrer:!0}),b.custom&&f("set",b.custom),a.page(),ga(function(b){h=b}));return a};a.event=function(b,a,e,c){return f("send",{hitType:"event",eventCategory:b||"",eventAction:a||"",eventLabel:e||
59
+ "",eventValue:Number(c||0)})};a.page=function(b,a){var e={hitType:"pageview",page:b||location.pathname+location.hash,title:a||d.title};e.location=location.protocol+"//"+location.hostname+e.page;g&&f("set",{referrer:g});g=e.location;return f("send",e)};a.reset=function(){g=location.href;f("set",{page:location.pathname+location.hash,title:d.title,location:g});return a};return a}({},w,v));o.register("$10",function(a){var c;a.init=function(d){if(!c&&d)d.host||(d.host=location.hostname),c=d.legacy?o.require("$17",
60
+ "legacy.js"):o.require("$18","universal.js"),c._init(d);return a};a.link=function(k){var f,h=k.getAttribute("href");if(!h||"#"===h)return a;if(0===h.indexOf("#"))f="anchor";else if((0===h.indexOf("http")||0===h.indexOf("//"))&&-1===h.indexOf())f="external",k.setAttribute("target","_blank");else return a;d(k).click(function(){c.event(f,"click",h);return!0});k=null;return a};a.page=function(){c&&c.page.apply(c,arguments);return a};a.event=function(){c&&c.event.apply(c,arguments);return a};a.reset=function(){c&&
61
+ c.reset&&c.reset();return a};return a}({},w,v));o.register("$22",function(a,c,k){function f(b,a,e,c,f){function s(){p&&clearTimeout(p);q&&q.fadeOut(400,function(){d(this).remove();q=null});return!1}function h(){m();c!==-1&&(p=setTimeout(s,c||2E3));q.unbind("mouseleave");q.mouseenter(m)}function m(){p&&clearTimeout(p);p=null;q.unbind("mouseenter");q.mouseleave(h)}var p;if(!g)g=k.createElement("div"),g.id="growls",k.body.appendChild(g);var q=d('<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>');
62
+ q.find("p").text(b||"Empty message");a?q.find("small").text(a):q.find("small").remove();if(f.length){f.push({label:"Cancel",callback:s,css:"cancel"});for(var t,A=d('<form action="#" class="dialog"></form>'),a=function(b,a){t=d('<input type="button" value="'+a.label+'" class="butt '+(a.css||"")+'" />');t.click(function(b){"function"===typeof a.callback&&a.callback(b,{close:s})});A.append(t);return t},b=0;b<f.length;b++)a(b,f[b]);q.append(A)}d(g).prepend(q.hide().fadeIn(400));q.find("a").click(s);h()}
63
+ var h,g;a.init=function(){if(!h)return h=c.alert,c.alert=function(b){var b=String(b).split("\n"),c=b[1]&&b.slice(1).join("\n");a.alert(b[0],c)},a};a.debug=function(b){h(b);return a};a.alert=function(b,a,e,d,g){try{return f(b,a||"",e||"alert",d||4E3,g||[]),!0}catch(s){return b+="\n\n--\n"+(s.message||s),h.call(c,b),!1}};a.success=function(b,c,e){return a.alert(b,c,"success",e||2E3)};a.dialog=function(b,c,e,d){return a.alert(b,c,d||"alert",-1,e)};a.login=function(b,c,e,d){a.dialog(c||"You're not logged in",
64
+ e||"Please log in to continue",[{label:d||"Log in",callback:function(){location.assign(b||"/session/auth/login?r="+encodeURIComponent(location.href))}}])};return a}({},w,v));o.register("$20",function(a,c,k){function f(b){return b.keyCode===27&&r&&m?(D(),b.preventDefault(),!1):!0}function h(a){if(r){var e=Math.max(b.height(),l.outerHeight(!0));e&&z.css("height",e+"px");a&&(n=d(c).innerWidth(),I(u))}return!0}function g(b){b?(C.show(),e.addClass("has-title")):(C.hide(),e.removeClass("has-title"))}var b,
65
+ l,e,z,C,s,r=!1,m=!1,p=!1,q,t,A,n,u,y=a.init=function(){if(!b){b=d('<div id="overlay"></div>');l=d('<div class="overlay-frame"></div>');e=d('<div class="overlay-container"></div>');C=d('<div class="overlay-title"><span class="title">Untitled</span></div>');s=d('<a class="overlay-close" href="#"><span>x</span></a>');z=d('<div class="overlay-bg"></div>');b.append(l.append(e)).append(z).prependTo(k.body);d(k).bind("keydown",f);d(c).resize(h);A=e.outerWidth(!0)-e.width()+(l.innerWidth()-l.width());e.outerHeight(!0);
66
+ e.outerHeight(!1);l.innerHeight();l.height();n=d(c).innerWidth();q=parseInt(e.css("width"));if(!q||isNaN(q))q=e.width();t=parseInt(e.css("height"));if(!t||isNaN(t))t=e.height();C.append(s.hide()).hide().prependTo(l);b.hide()}return b},I=a.width=function(c){y();if(c===null)l.css("width",""),e.css("width","");else{c=c||q||640;x=c+A;u=c;var d=n;x>d?(x=d,c=x-A,b.addClass("spill")):b.removeClass("spill");l.css("width",x+"px");e.css("width",c+"px")}return a};a.autoSize=function(){y();h();var b=q||0;e.children().each(function(a,
67
+ e){b=Math.max(b,d(e).outerWidth(!0))});I(b);return a};a.css=function(b){y().attr("class",b);return a};a.html=function(b){y();c.innerShiv&&(b=innerShiv(b,!1));return e.html(b)};a.append=function(b){y();b instanceof jQuery||(b=d(b));e.append(b);return a};var D=a.close=function(c){if(r){var g=function(){y().hide();d(k.body).removeClass("has-overlay");r=!1;e.html("");r=null;b.trigger("overlayClosed",[a])};c==null&&(c=300);c?b.fadeOut(c,g):g()}return a};a.title=function(b){y();p=b||"";C.find("span.title").text(p);
68
+ b!=null?g(!0):m||g(!1);return a};a.enableClose=function(){y();m=!0;s.unbind("click").bind("click",function(){D();return!1});g(!0);s.show();return a};a.disableClose=function(){y();m=!1;s.hide();r&&p||g(!1);return a};a.open=function(){y();e.html("");I(q);b.attr("class","");d(k.body).addClass("has-overlay");y().show();r=!0;h();a.title(null);m&&g(!0);b.trigger("overlayOpened",[a]);return a};a.listen=function(b){y().bind("overlayClosed",b);return a};a.unlisten=function(b){y().unbind("overlayClosed",b);
69
+ return a};return a}({},w,v));o.register("$19",function(a,c,k){var f={401:"You've been logged out",404:"Not Found",500:"Server Error",502:"Bad Gateway",503:"Service unavailable",504:"Gateway timeout"};a.getErrors=function(){return f};a.jsonLink=function(a){if(!a)return"";a=a.split("?");a[0]=a[0].replace(/(\.[a-z0-9]{1,4})?$/i,".json");return a.join("?")};a.errorData=function(a,c){var b,l,e=a.responseText,c=a.status;if(!e&&c===0)return null;try{b=d.parseJSON(e)||{}}catch(k){b={},l=k.message||k}l||(l=
70
+ b.statusText||a.statusText||f[c]||"Unknown Error");b.error=l;return b};a.ajax=function(f,g,b,l){function e(){b&&b()}function z(b){b.alert&&alert(b.alert);var a=b.success;a&&o.require("$22","growl.js").success.apply(this,a.push?a:[a]);if((a=b.events)&&a.length)for(var g,f=o.require("$10","ga.js"),h=l||d(k.body);g=a.shift();)h.trigger(g,[b]),f.event("ajax",g);b.modal&&o.require("$12","LocoModal.js").replace(b.modal);if(b.download)c.location.assign(b.download);else if(b.redirect)return c.location.assign(b.redirect),
71
+ !1;e();return!0}function C(b,c,d){if(b.status===401)o.require("$22","growl.js").login(),e();else if(c=a.errorData(b,c,d),c!=null)if(d=c.error,"function"===typeof g&&!1===g(null,d,b.status))e();else if(!c||!c.data||z(c.data))alert(d||"Unknown error"),e()}f.error=C;f.success=function(b,a,c){if(!b)return C(c,"unknown");b.status&&alert(b.statusText||"Unknown error");"function"===typeof g&&!1===g(b&&b.data?b.data:b)?e():b&&b.data?z(b.data):e()};d.ajax(f)};return a}({},w,v));o.register("$12",function(a){function c(b,
72
+ a){f.autoSize();var c=f.init();o.require("$8","html.js").init(c);c.find("[data-script]").each(function(b,c){for(var c=d(c),e=-1,l,A=c.attr("data-script").split(" ");++e<A.length;)l=A[e],g[l]?g[l](c,a||{}):alert("Unknown script "+l)});c.trigger("locoModalLoaded",[f,b||"",a||{}]);var l,h=c.find("form")[0];if(h){c=0;a:for(;c<h.elements.length;c++)switch(l=h.elements[c],l.type){case "text":case "textarea":d(l).focus();break a}}}function k(a){var c=d(a.currentTarget),g=c.attr("data-modal");if(g==="close"){l();
73
+ var h=c.attr("href");if(h&&-1!==h.indexOf("#!"))return!0}else{var k="submit"===a.type,m=c.attr("title")||c.attr("data-title"),h=c.attr("href")||c.attr("action"),p=k?c.serialize():"",c=k?c.attr("method"):"get";b(h,m,c,p);g||(g=h.split("/").slice(1,4).join("-"));f.width(null).css("modal "+g).autoSize()}a.stopPropagation();a.preventDefault();return!1}var f=o.require("$20","overlay.js"),h=o.require("$10","ga.js"),g={},b=a.load=function(b,g,l,s){f.open().title("Loading ..").disableClose().css("modal").html('<div class="overlay-placeholder"></div>');
74
+ var k=o.require("$19","http.js"),l={type:l||"get",data:s||"",url:k.jsonLink(b)};k.ajax(l,function(a,l,k){var s=a&&a.html;if(!s)return a=d('<h3 class="error"></h3>').text(l||"Unknown error"),f.enableClose().title("Error "+k||"?").html("").append(a),!1;g=a.title||g||"Untitled";f.enableClose().title(g).html(s);c(b,a.js);h.page(b,g);f.init().one("overlayClosed",function(){h.reset()});return!0});return a},l=a.close=function(){f.close();return a};a.initLink=function(b){b.click(k)};a.initForm=function(b){d(b).submit(k)};
75
+ a.replace=function(a){var d=a&&a.html,g=a&&a.url,l=a&&a.title;g?(b(g,l),a=a&&a.css||g.split("/").slice(1,4).join("-"),f.width(null).css(" modal "+a).autoSize()):d&&(f.open().html(d),l&&f.enableClose().title(l),c("",a&&a.js))};a.find=function(b){return f.init().find(b)};a.script=function(b,c){if(c){if("function"!==typeof c.run)throw Error(b+" macro has no run function");g[b]=c.run;return a}return g[b]};return a}({},w,v));o.register("$13",function(a){function c(a){this.url="/auto/"+a+".json?q=";this.dead=
76
+ {}}function k(){this.dict=o.require("$2","dict.js").create()}a.init=function(a){function h(){if("hint"!==I){var b=u.val()&&!(B&&B.val())&&A==null&&!p;P[b?"addClass":"removeClass"]("error")}}function g(){Q.show();var b=u.outerWidth(!1),a=u.outerHeight(!1),c=u.css("margin-top");c&&(c=parseInt(c),isNaN(c)||(a+=c));b-=2;Q.css("top",a+"px").css("width",b+"px");p=!0}function b(){Q.hide();p=!1}function l(){Q.html("");b();m=0;n=A=null}function e(b){l();var a;for(a=0;a<b.length;a++){var c=a,e=b[a],A=d('<span class="label"></span>').text(e.label),
77
+ f=d('<div class="auto-comp-result"></div>'),n=void 0;for(n in e)f.attr("data-"+n,e[n]);e.icon&&f.append(d("<span></span>").attr("class",e.icon));f.append(A);z(c,f)}(m=b.length)?(q&&g(),C(0)):(C(null),h())}function z(b,a){Q.append(a);a.click(function(c){c.stopPropagation();C(b,a);r();return!1});return a}function C(b,a){n&&(n.removeClass("selected"),n=null);A=null;b==null?B&&B.val(""):(a||(a=Q.find("div.auto-comp-result").eq(b)),a.length&&(a.addClass("selected"),A=b,n=a))}function s(b){if(m){var a=
78
+ m-1;A==null?b=b>0?0:a:(b=A+b,b<0?b=a:b>a&&(b=0));return C(b)}}function r(){if(A==null)T.val(""),B&&B.val("");else{var a=Q.find("div.auto-comp-result").eq(A),c=a.attr("data-value"),e=a.attr("data-label");B&&B.val(c);T.val(e);b();a=a.clone();l();z(0,a);m=1;C(0,a);h();a.trigger("locoAutocomp",[c,e,a])}}var m=0,p=!1,q=!1,t=a.form,A=null,n=null,u=d(a),y=u.attr("name"),I=u.attr("data-mode"),D=u.attr("data-provider"),B="hint"!==I&&d('<input type="hidden" value="" name="'+y+'" />').appendTo(t),P=d('<div class="auto-comp-wrap"></div>').replaceAll(u),
79
+ Q=d('<div class="auto-comp-drop"></div>');D&&(D=new c(D));B&&u.attr("name","_"+y);u.attr("autocomplete","off");P.append(u).append(Q);b();u.focus(function(){q=!0;m>1&&g()}).blur(function(){q=!1;h()}).keydown(function(a){function c(){a.preventDefault();a.stopPropagation();return!1}switch(a.keyCode){case 27:p&&(a.stopPropagation(),b(),u.blur());break;case 40:m&&(p?s(1):g());break;case 38:p&&s(-1);break;case 13:if(p)return r(),c();else if(!A&&I!=="hint")return c()}return!0});var T=o.require("$4","LocoTextListener.js").listen(u,
80
+ function(b){D&&D.fetch(b,e)});(t=u.attr("data-pre"))&&(t=d.parseJSON(t))&&t.value&&t.label?(e([t]),r()):a.value&&(!B||!B.val())&&D&&D.fetch(a.value,function(b){e(b);r()});return{$:u,clear:l,reset:function(){l();u.val("");B&&B.val("");T.ping()},preload:function(b){m&&l();D=new k;var a,c;for(a in b)c=b[a],D.add(c)},mode:function(b){I=b}}};c.prototype.fetch=function(a,c){if(!a)return c&&c([]),this;var d,b=this.dead;for(d in b)if(0===a.indexOf(d))return c&&c([]),this;d={dataType:"json",url:this.url+encodeURIComponent(a)};
81
+ o.require("$19","http.js").ajax(d,function(d){var e=d&&d.results;e&&(c&&d.query&&d.query===a&&c(d.results),e.length||(b[a]=0));return!0});return this};k.prototype.add=function(a){var c=a.fulltext||a.label||a.value;c&&this.dict.add(a,c)};k.prototype.fetch=function(a,c){if(!a)return c&&c([]),this;var d=this.dict.find(a);c(d)};return a}({},w,v));o.register("$14",function(a,c,k){function f(b){b.stopPropagation();b.preventDefault();return!1}function h(b,a,c){if(c=c||b.getElement(a))c.unbind().mouseup(function(c){c.stopPropagation();
82
+ b.selectIndex(a,!0);return!1}).mouseover(function(){d(this).addClass("over");b.hover=a;return!0}).mouseout(function(){d(this).removeClass("over");b.hover=-1;return!0}),c=null;return b}function g(b){if(b){var a=this,c=b[0];a.id=c.id||"";a.name=c.name||"";a.prefix=c.getAttribute("data-prefix");a.defaultIcon=c.getAttribute("data-icon")||"jshide";var g=c.selectedIndex,f=[],h,r,m;for(r=0;r<c.options.length;r++)h=c.options[r],m=h.disabled,h=d(h),f.push([h.val(),h.text(),h.attr("data-icon")||"",m]);a.hidden=
83
+ d('<input type="hidden" name="'+a.name+'" value="" />').appendTo(c.form);a.list=d('<ul class="clearfix"></ul>');a.icon=d('<span class="icon"> </span>');a.selection=d("<label></label>");a.handle=d('<a class="handle" href="#"></a>').attr("tabindex",b.attr("tabindex")||"").append(a.icon).append(a.selection);a.wrapper=d("<div></div>").addClass(c.className).addClass("selector").append(a.handle).append(a.list).replaceAll(c);this.id&&a.wrapper.attr("id",this.id);for(a.clearOptions();h=f.shift();)a.addOption.apply(a,
84
+ h);a.handle.click(function(b){b.preventDefault();return!1}).mouseover(function(b){return a.onRollover(b)}).mouseout(function(b){return a.onRollout(b)}).mousedown(function(b){return a.onPress(b)}).keydown(function(b){return a.onKeydown(b)});d(k.body).mouseup(function(b){return a.onRelease(b)}).keydown(function(b){return a.onGlobalKeydown(b)});a.close();a.selectIndex(g)}}a.create=function(b){return new g(b)};a.extend=function(b){b.prototype=new g};c=g.prototype;c.onRollover=function(){return this.over=
85
+ !0};c.onRollout=function(){this.over=!1;return!0};c.onPress=function(b){return!this.active?(this.open(),b.stopPropagation(),b.preventDefault(),this.handle.focus(),!1):this.over?(this.close(),b.stopPropagation(),b.preventDefault(),!1):!0};c.onRelease=function(){this.active&&!this.over&&this.close();return!0};c.onGlobalKeydown=function(b){if(this.active)switch(b.keyCode){case 27:return this.close(),f(b);case 40:return this.hoverNext(1),f(b);case 38:return this.hoverNext(-1),f(b);case 13:if(this.hover!=
86
+ -1)return this.selectIndex(this.hover,!0),this.hoverItem(-1),this.close(),f(b)}return!0};c.onKeydown=function(b){return!this.active&&40===b.keyCode?(this.open(),f(b)):!0};c.open=function(){this.active=!0;this.hover=-1;this.wrapper.addClass("active");var b=this.handle.outerHeight()||0;this.list.show().css("top",b+"px");var b=this.handle.outerWidth()||0,a=this.list.outerWidth()||0;b>a&&(a-=this.list.width(),this.list.css("min-width",String(b-a)+"px"))};c.close=function(){this.list.hide();this.active=
87
+ !1;if(this.hover!==-1)this.getElement(this.hover).removeClass("over"),this.hover=-1;this.wrapper.removeClass("active")};c.hoverItem=function(b,a){this.hover!==-1&&this.getElement(this.hover).removeClass("over");this.hover=b;b!==-1&&(a=a||this.getElement(b),a.addClass("over"))};c.hoverNext=function(b){var a=this.options.length;if(a){a-=1;if(this.hover==-1)b=b>0?0:a;else if(b=this.hover+b,b<0){this.close();return}else b>a&&(b=0);this.hoverItem(b)}};c.enableChange=function(b){this.eventName=b;this.eventData=
88
+ [].slice.call(arguments,1);return this};c.clearOptions=function(){this.index={};this.length=0;this.options=[];this.list.html("");this.hidden.val("");this.idx=this.hover=-1;return this};c.addOption=function(b,a,c,g){var f=this.options.length,k=d("<span></span>").addClass(c||"jshide"),r=d("<label></label>").text(a||b),k=d("<li></li>").append(k).append(r).appendTo(this.list);if(g)return this.disableIndex(f),null;k.attr("data-option",f);this.options[f]={value:b,text:a,icon:c};this.index[b]=f;this.length=
89
+ f+1;h(this,f,k);return f};c.disableOption=function(b){return this.disableIndex(this.index[b])};c.disableIndex=function(b){(b=this.getElement(b))&&!this.disabled&&b.addClass("disabled").unbind();return this};c.enableOption=function(b){return this.enableIndex(this.index[b])};c.enableIndex=function(b){return h(this,b)};c.reIndex=function(){this.index={};this.length=0;for(var b=this.options.length;-1<--b;)this.index[this.options[b].value]=b,this.length++};c.selectValue=function(b,a){return this.selectIndex(this.index[b],
90
+ a)};c.selectIndex=function(b,a){var c=this.options[b];if(c){this.hidden.val(c.value);if(b!==this.idx)this.idx=b,this.setLabel(c.text),this.icon.attr("class",c.icon||this.defaultIcon),a&&this.change();this.active&&this.close()}return this};c.setLabel=function(b){this.selection.text(b);this.prefix&&this.selection.prepend(d('<span class="prefix"></span>').text(this.prefix))};c.val=function(){var b=this.options[this.idx];return b&&b.value};c.change=function(){var b=this.eventName||"change",a=this.eventData&&
91
+ this.eventData.slice()||[];a.unshift(this.val());this.wrapper.trigger(b,a);return this};c.renameOption=function(a,c){var e=this.index[a],d=this.options[e];if(d)d.text=c,this.getElement(e).find("label").text(c),e===this.idx&&this.setLabel(c);return this};c.removeOption=function(a){var c=this.index[a],e=this.options[c];e&&(a=this.val(),this.getElement(c).remove(),this.options.splice(c,1),this.reIndex(),a===e.value?this.selectIndex(0,!0):this.selectValue(a,!1))};c.getElement=function(a){return this.list.find("li").eq(a)};
92
+ c=null;return a}({},w,v));o.register("$21",function(a){function c(a){d&&(a=f[a]||a);return a}var d=navigator.msPointerEnabled,f={touchstart:"MSPointerDown",touchmove:"MSPointerMove",touchend:"MSPointerUp"};a.bind=function(d,g,b){d=c(d);g.addEventListener&&g.addEventListener(d,b,!1);return a};a.unbind=function(d,g,b){d=c(d);g.removeEventListener&&g.removeEventListener(d,b,!1);return a};return a}({},w,v));o.register("$15",function(a,c,k){function f(){l&&clearTimeout(l);l=null}function h(a){a.preventDefault();
93
+ a.stopPropagation();return!1}var g,b,l,e=100,z=100,C=!1,s=!1,r;a.delays=function(a,b){e=a||0;z=b||0};a.kill=function(){b&&b.hide().stop().remove();b=null;g&&g.hide().html("")};a.text=function(a){b&&b.find("label.tip").text(a)};a.init=function(m){function p(){g||(g=d('<div id="tipholder"></div>').appendTo(k.body));return g}function q(){f();y?l=setTimeout(t,y):t()}function t(){f();C||s||n()}function A(){f();b&&(b.stop(),b.remove());var a=m.offset();b=D.clone();p().show().append(b);var c=Math.round(a.left),
94
+ a=Math.round(a.top);b.hasClass("tooltip-right")&&(c-=b.outerWidth(!1),c+=m.outerWidth(!1));b.hasClass("tooltip-top")?a-=b.outerHeight():a+=m.outerHeight();p().css("left",c+"px").css("top",a+"px");b.mouseenter(function(){C=!0;return!1}).mouseleave(function(){C=!1;q();return!0});Boolean(b.find("form").length|b.find("a").length)||b.click(u);m.trigger("tooltipOpen",[b])}function n(){function c(){a.kill()}b?b.fadeOut(500,c):c();m.trigger("tooltipClose",[b])}function u(){if(!1!==m.triggerHandler("click")&&
95
+ P)location.href=P;return!1}var y=Number(m.attr("data-hide-delay")||z),I=Number(m.attr("data-show-delay")||e),D=m.find("div.tooltip"),B=m.attr("title");if(!D.length){if(!B)return;D=d('<div class="tooltip"></div>').append(d('<label class="tip"></label>').text(B));m.hasClass("hastip-top")&&D.addClass("tooltip-top");m.hasClass("hastip-right")&&D.addClass("tooltip-right");m.prepend(D)}B&&(m.attr("data-title")&&D.children("label.tip").text(B),m.attr("data-title",B),m.attr("title",""));var P=m.attr("href");
96
+ P==="#"&&(P="");B=o.require("$21","touch.js").bind("touchstart",m[0],h).bind("touchmove",m[0],h).bind("touchend",m[0],function(a){setTimeout(u,300);return h(a)});null==r&&(r=!1,B.bind("touchstart",c,function(){return r=!0}).bind("touchend",c,function(){setTimeout(function(){r=!1},300);return!0}));m.mouseover(function(){r||(s=!0,f(),b?A():I?l=setTimeout(A,I):A());return!0}).mouseout(function(){r||(s=!1,q());return!0});P&&m.click(function(){s=!1;n();return!0})};return a}({},w,v));o.register("$8",function(a,
97
+ c,k){var f=0;c.attachEvent&&/MSIE ([\d\.]+)/.exec(navigator.appVersion)&&(f=parseInt(RegExp.$1));a.ie=function(a){return a?f<=a:f};var h=a.init=function(c){c?c instanceof jQuery||(c=d(c)):c=d(k.body);var b=o.require("$10","ga.js"),l=o.require("$11","forms.js"),e=o.require("$12","LocoModal.js"),z=o.require("$13","LocoAutoComplete.js"),C=o.require("$14","LocoSelector.js"),s=o.require("$15","tooltip.js");c.find("form").each(function(a,b){var c=d(b);f&&10>f&&l.placeholders(c);b.getAttribute("data-modal")?
98
+ e.initForm(b):b.action&&0!==b.action.indexOf("#")&&!b.target&&l.jsonify(b);c.hasClass("hasreveal")&&l.revealify(c);c.find("input.button").each(function(a,b){l.linkify(b)});c.find("input.auto-comp").each(function(a,b){z.init(b)});c.find("select.selector").each(function(a,b){C.create(d(b))})});c.find("a").each(function(c,g){-1!==g.className.indexOf("hastip")&&s.init(d(g));if(-1!==g.href.indexOf("/modal/")||g.getAttribute("data-modal"))e.initLink(d(g));else{b.link(g);var f=g.getAttribute("data-ajax-target");
99
+ f&&(f=d("#"+f),d(g).click(function(b){b.preventDefault();f.addClass("loading");d.get(g.href,function(b){b=a.$(b).replaceAll(f);h(b)});return!1}))}});l=e=z=c=null;return a};a.$=function(a){return d(c.innerShiv?innerShiv(a,!1):a)};d.fn._html=function(a){return a!=null?(a=this.html(c.innerShiv?innerShiv(a,!1):a),h(this),a):j.html()};d.fn.macro=function(a,b){if("function"!==typeof a.run)throw Error("macro has no run function");a.run(this,b||{});return this};a.el=function(a,b){var c=k.createElement(a||
100
+ "div");b&&(c.className=b);return c};a.txt=function(a){return k.createTextNode(a||"")};return a}({},w,v));o.register("$11",function(a,c){function k(a){function b(){if(a.value===f)a.value="",e.removeClass("placeheld");return!0}function c(){if(a.value==="")a.value=f,e.addClass("placeheld");return!0}var e=d(a);if(!e.hasClass("auto-comp")){var f=e.attr("placeholder");if(f)return e.focus(b).blur(c),c(),{kill:function(){b();e.unbind("focus",b).unbind("blur",c)}}}}var f=a.enable=function(d){function b(a,
101
+ b){if(!b.getAttribute("data-was-disabled"))b.disabled=!1}d.find(".button").removeClass("loading");d.find("input").each(b);d.find("select").each(b);d.find("textarea").each(b);c.attachEvent&&d.hasClass("has-placeholders")&&a.placeholders(d)},h=a.disable=function(a){function b(a,b){b.disabled?b.setAttribute("data-was-disabled","true"):b.disabled=!0}a.find(".button").addClass("loading");a.find("input").each(b);a.find("select").each(b);a.find("textarea").each(b)};a.jsonify=function(a,b,l){a instanceof
102
+ jQuery||(a=d(a));if(!a.disable)d.fn.disable=function(){h(this);return this},d.fn.enable=function(){f(this);this.placehold&&this.placehold();return this};var e="";a.find('[type="submit"]').click(function(a){a&&a.target&&a.target.name&&(e=encodeURIComponent(a.target.name)+"="+encodeURIComponent(a.target.value));return!0});a.submit(function(d){if(d&&d.isDefaultPrevented&&d.isDefaultPrevented())return!1;if(l&&!1===l(d))return!1;var f=c.tinyMCE;f&&a.find("textarea.editor").each(function(a,b){var c=f.get(b.id);
103
+ c&&c.save()});var h=a.serialize();e&&(h&&(h+="&"),h+=e,e="");a.disable();var k=o.require("$19","http.js"),h={url:k.jsonLink(a.attr("action")),type:a.attr("method"),data:h};k.ajax(h,b,function(){a.enable()},a);d.preventDefault();d.stopPropagation();return!1});if(a.hasClass("autopost")){var k,C=Number(a.attr("data-autopost-delay")||500);a.find('input[type="checkbox"]').change(function(){k&&clearTimeout(k);k=setTimeout(function(){a.submit()},C);return!0})}};a.revealify=function(a){a.find("div[data-reveal-if]").each(function(b,
104
+ c){function e(a){var b;q=q||a.target;if("."===m)b=Boolean(q&&q[p]);else if("="===m){var c,e;b=d(q.form).serializeArray();for(e in b)if(b[e].name===r)c=b[e].value;b=p===c}if(b!==k)if(k=b,a)f[k?"slideDown":"slideUp"](200);else f[k?"show":"hide"]();return!0}var f=d(c),h=/^([_\w\-\[\]]+)(\.|=)(.+)$/.exec(f.attr("data-reveal-if"));if(h){var k,r=h[1],m=h[2],p=h[3],h=a[0][r];h.length||(h=[h]);for(var q,b=0;b<h.length;b++)q=h[b],e(),d(q).change(e).removeClass("jshide");h=h=q=null}});a=null};a.linkify=function(a){var b=
105
  a.getAttribute("data-icon");if(b){var c=d(a),e=d("<a> </a>");e.attr("href",a.form.action);e.attr("class",c.attr("class"));e.attr("tabindex",c.attr("tabindex"));c.attr("tabindex","-1");e.text(c.val());b&&d("<span></span>").prependTo(e).addClass(b);c.hide().after(e);e.click(function(){c.click();return!1})}};a.placeholders=function(a){var b,c=[];a.find("input[placeholder]").each(function(a,d){(b=k(d))&&c.push(b)});c.length&&(a.submit(function(){for(var a in c)c[a].kill()}),a.addClass("has-placeholders"),
106
+ b=i=null)};return a}({},w,v));o.register("$16",function(a,c){var d=c.requestAnimationFrame,f=c.cancelAnimationFrame,h=0;if(!d||!f)for(var g in{ms:1,moz:1,webkit:1,o:1})if(d=c[g+"RequestAnimationFrame"])if(f=c[g+"CancelAnimationFrame"]||c[g+"CancelRequestAnimationFrame"])break;if(!d||!f)d=function(a){var d=b();timeToCall=Math.max(0,16-(d-h));nextTime=d+timeToCall;timerId=c.setTimeout(function(){a(nextTime)},timeToCall);h=nextTime;return timerId},f=function(a){clearTimeout(a)};var b=Date.now||function(){return(new Date).getTime()};
107
+ a.loop=function(a,b){function c(){h=d(c,b);a(g++)}var g=0,h;c();return{stop:function(){h&&f(h);h=null}}};return a}({},w,v));o.register("$9",function(a,c,d){function f(a,c){if(b)a.MSPOINTER_TYPE_TOUCH===a.pointerType&&c(0,a);else for(var d=-1,e=(a.originalEvent||a).changedTouches||[];++d<e.length;)c(d,e[d])}function h(a){a.preventDefault();a.stopPropagation();return!1}var g,b=c.navigator.msPointerEnabled,l=b?"MSPointerDown":"touchstart",e=b?"MSPointerMove":"touchmove",z=b?"MSPointerUp":"touchend";
108
+ a.ok=function(b){g==null&&(g="function"===typeof d.body.addEventListener);g&&b&&b(a);return g};a.dragger=function(a,b){function c(b){a.addEventListener(b,g[b],!1)}function d(b){a.removeEventListener(b,g[b],!1)}var g={};g[l]=function(a){f(a,function(c,d){d.type=l;b(a,d,k)});c(e);c(z);return!0};g[z]=function(a){d(e);d(z);f(a,function(c,d){d.type=z;b(a,d,k)});return!0};g[e]=function(a){f(a,function(c,d){d.type=e;b(a,d,k)});return h(a)};c(l);var k={kill:function(){d(l);d(e);d(z);a=k=b=null}};return k};
109
+ a.swiper=function(a,c,d){function g(b){a.addEventListener(b,y[b],!1)}function k(b){a.removeEventListener(b,y[b],!1)}function t(){A&&A.stop();A=null}var A,n,u,y={},I=[],D=[],B=[];y[l]=function(b){n=!1;t();var c=C();f(b,function(a,b){I[a]=c;D[a]=b.clientX;B[a]=b.clientY});u=a.scrollLeft;return!0};y[z]=function(a){f(a,function(a,b){var d=C()-I[a],e=D[a]-b.clientX;c(Math.abs(e)/d,e?e<0?-1:1:0)});u=null;return!0};y[e]=function(b){var c,d;u==null||f(b,function(a,b){c=D[a]-b.clientX;d=B[a]-b.clientY});if(d&&
110
+ Math.abs(d)>Math.abs(c))return n=!0;if(c)n=!0,a.scrollLeft=Math.max(0,u+c);return h(b)};if(!b||d)g(l),g(e),g(z),b&&(a.className+=" mstouch");return{kill:function(){k(l);k(e);k(z);t()},swiped:function(){return n},ms:function(){return b},snap:function(c){b&&!d&&(a.style["-ms-scroll-snap-points-x"]="snapInterval(0px,"+c+"px)",a.style["-ms-scroll-snap-type"]="mandatory",a.style["-ms-scroll-chaining"]="none")},scroll:function(b,c,d){t();var e=a.scrollLeft,f=b>e?1:-1,g=Math[f===1?"min":"max"],n=Math.round(c*
111
+ 16*f);return A=o.require("$16","fps.js").loop(function(c){if(c)e=Math.max(0,g(b,e+n)),a.scrollLeft=e,b===e&&(t(),d&&d(e))},a)}}};var C=Date.now||function(){return(new Date).getTime()};return a}({},w,v));o.register("$7",function(a,c,k){function f(a,b){var c=a.id,d=c&&q[c],e=d&&d.parent();if(!d||!e)return null;var f=(c=e.dir===p)?"X":"Y",c=c?z:C,g=c(e.el),h=b["offset"+f];null==h&&(h=b["page"+f]-c(a));h&&(g+=h);return{move:function(a){e.resize(a["page"+f]-g,d);return!0}}}function h(a){function b(){d(k).unbind("mousemove",
112
+ c);t=null;return!0}function c(a){t?t.move(a):b();return!0}if(t)return!0;t=f(a.target,a);if(!t)return!0;d(k).one("mouseup",b).mousemove(c);return e(a)}function g(a,b){var c=b.type;"touchmove"===c?t&&t.move(b):"touchstart"===c?t=f(a.target,b):"touchend"===c&&t&&(t=null)}function b(a){var b=d(a.target).closest("div.wg-tr"),c=b.length&&b.closest("div.is-table");(c=c&&q[c.attr("id")])&&c.selectRow(Number(b.attr("data-row")));return e(a)}function l(a){var n;var b=a.keyCode;if(b=40===b?1:38===b?-1:0){var c=
113
+ d(a.target),f=c.data("row");if(f>-1&&(n=(c=c.closest("div.is-table"))&&q[c.attr("id")],c=n)){for(;!1===c.selectRow(f+=b););return e(a)}}return!0}function e(a){a.stopPropagation();a.preventDefault();return!1}function z(a,b){b||(b=k.body);for(var c=a.offsetLeft||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetLeft||0;return c}function C(a,b){b||(b=k.body);for(var c=a.offsetTop||0;(a=a.offsetParent)&&a!==b;)c+=a.offsetTop||0;return c}function s(a){function b(){var c=a.innerHTML;c!==e&&(e=c,d(a).trigger("wgChange",
114
+ [c]));return!0}var c=m.ie()?["keyup","paste"]:["input"],e=a.innerHTML,f=e;return d(a).attr("contenteditable","true").focus(function(){for(var e=d(a),f=-1;++f<c.length;)e.bind(c[f],b);return!0}).blur(function(){for(var g=d(a),h=-1;++h<c.length;)g.unbind(c[h]);b();f!==e&&d(a).trigger("wgChanged",[a]);return!0})}function r(a){this.el=a;this.id=a.id;this.pos=this.index=0;this.css=["wg-cell"];q[a.id]=this;this.clear()}var m=o.require("$8","html.js"),p=1,q={},t=!1;a.init=function(a){var b=new r(a);b.restyle().redraw();
115
+ b.root=!0;o.require("$9","touch.js").ok(function(b){b.dragger(a,g)});d(a).mousedown(h);return b};c=r.prototype;c.each=function(a){for(var b=-1;++b<this.length;)a(b,this.cells[b]);return this};c.bind=function(){return this.$("bind",arguments)};c.unbind=function(){return this.$("unbind",arguments)};c.$=function(a,b){d.fn[a].apply(d(this.el),b);return this};c.parent=function(){return this.pid&&q[this.pid]};c.splitx=function(){return this._split(p,arguments)};c.splity=function(){return this._split(2,
116
+ arguments)};c._split=function(a,b){this.dir&&this.dir!==a&&this.clear();this.dir=a;var c=-1,d,e=this.length,f=b.length,g=1/(e+f),h=0;if(e)throw Error("Todo: implement re-split");for(;++c<f;){d=m.el();this.body.appendChild(d);for(var k=d,l=b[c],o=l,p=1;q[l];)l=o+"-"+ ++p;k.id=l;d=new r(d);d.index=e+c;d.pid=this.id;d.pos=h;h+=g;this.cells.push(d);this.length++}this.restyle().redraw();return this.cells};c.clear=function(){for(var a=-1,b;++a<this.length;)b=this.cells[a].clear(),delete q[b.id];this.cells=
117
+ [];this.length=0;this.nav&&this.el.removeChild(this.nav);this.nav=null;if(this.body){if(this.field&&m.ie())d(this.body).triggerHandler("blur"),this.field=null;if(this.table)this.table=null;this.el.removeChild(this.body)}this.body=this.el.appendChild(m.el("","wg-body"));return this};c.resize=function(a,b){if(!b&&(b=this.cells[1],!b))return;var c=b.index,e=d(this.el)[this.dir===p?"width":"height"](),f=this.cells[c+1],c=this.cells[c-1];pad=(b.body||b.el.firstChild).offsetTop||0;max=(f?f.pos*e:e)-pad;
118
  min=c?c.pos*e:0;b.pos=Math.min(max,Math.max(min,a))/e;(e=this.parent())&&e.table?e.redraw():this.redraw();return this};c.distribute=function(){for(var a,b=0;b<arguments.length;)a=Math.max(0,Math.min(1,arguments[b++])),this.cells[b].pos=a;this.redraw();return this};c.restyle=function(){var a=this.css.slice();this.root&&a.push("wg-root");this.index===0?a.push("first"):a.push("not-first");this.dir&&(a.push("wg-split"),2===this.dir?a.push("wg-split-y"):a.push("wg-split-x"));this.t&&a.push("has-title");
119
  this.nav&&a.push("has-nav");this.table?a.push("is-table"):null!=this.field&&(a.push("is-field"),this.field||a.push("readonly"));this.el.className=a.join(" ");return this};c.redraw=function(){if(this.body){var a=this.el.clientHeight||0,b=this.body.offsetTop||0;b<a&&(a-=b);this.body.style.height=String(a)+"px"}for(var a=this.length,c,e=1,f=this.dir===2?"height":"width";--a>=0;){b=this.cells[a];if(this.nav)c=1;else{if(b.fixed)b.pos=b.fixed/d(this.el)[f]();c=e-b.pos;e=b.pos}b.el.style[f]=String(100*c)+
120
+ "%";b.restyle().redraw()}this.table&&this.redrawTable();return this};c.redrawTable=function(){var a=-1,b=this.cells[0],c=this.cells[1],a=d(c.body).width(),e=c.body.firstChild,c=e.childNodes;e.style.width=a+"px";for(var a=b.length,f=1;--a>=0;)e=b.cells[a],c[a].style.width=String(100*(f-e.pos))+"%",f=e.pos;return!0};c.contents=function(a){if(null===a)return this.body.innerHTML;this.cells.length?this.clear():this.body&&this.el.removeChild(this.body);this.body=this.el.appendChild(m.el("","wg-content"));
121
+ "string"===typeof a?d(this.body).html(a):this.append(a);this.redraw();return this};c.textarea=function(a,b){this.contents(m.txt(a));(this.field=b)&&s(this.body);this.restyle();return this};c.append=function(a){a.nodeType?this.body.appendChild(a):d(this.body).append(a);return this};c.header=function(a){if(!arguments.length)return this.el.getElementsByTagName("h2")[0];this.t=m.txt(a||"");this.el.insertBefore(m.el("h2","wg-title"),this.body).appendChild(this.t);this.restyle().redraw();return this};c.title=
122
+ function(a){this.t?this.t.nodeValue=a||"":this.header(a);return this.t};c.tabulate=function(a){var c=this.id,e=[],f=[];rows=this.splity(c+"-thead",c+"-body");thead=rows[0];tbody=rows[1];thead.css.push("wg-thead");tbody.css.push("wg-tbody");a.eachCol(function(a,b){e.push(c+"-col"+a);f.push(b)});for(var g=-1,h,k=m.el("","wg-cols"),o=thead._split(p,e);++g<o.length;)h=o[g],h.header(f[g]),k.appendChild(m.el("","wg-col "+(g===0?"":"not-")+"first"));tbody.contents(k);a.eachRow(function(a,b,c){tbody._addRow(b,
123
+ c)});d(tbody.el).mousedown(b);this.lock();this.table=a;this.restyle().redraw();h=thead.cells[0];tbody.fixed=C(h.body,h.el)||20;this.resize(tbody.fixed);d(k).attr("tabindex","-1").keydown(l);return k};c.lock=function(){this.body.className+=" locked";return this};c.addRow=function(a,b){this.table&&this.cells[1]&&this.cells[1]._addRow(a,b);return this};c._addRow=function(a,b){for(var c,d=this.body.firstChild.childNodes,e=d.length,f=d[0].childNodes.length,g=-1,b=b&&"wg-tr "+b||"wg-tr";++g<e;)c=d[g].appendChild(m.el("",
124
+ b)),c.setAttribute("data-row",f),c=c.appendChild(m.el("","wg-td")),a[g]&&/\S/.test(a[g])?c.appendChild(m.txt(a[g])):c.innerHTML="&nbsp;";return d};c.tr=function(a){for(var b=-1,c,d=[],e=this.cells[1].body.firstChild.childNodes;++b<e.length;)(c=e[b].childNodes[a])&&d.push(c);return d};c.td=function(a,b){try{return this.cells[1].body.firstChild.childNodes[b].childNodes[a].firstChild}catch(c){return null}};c.selectRow=function(a,b){var c=this.table&&this.table.row(a);if(!c)return null;var e=this.tr(a);
125
+ if(e.length){var e=d(e),f=this.cells[1],g=f.body,h=d(g.firstChild);if(h.hasClass("filtered")&&!e.hasClass("filtered"))return!1;h.find("div.selected").removeClass("selected");e.addClass("selected");h.data("row",a);if(b)f.scrollTo(e[0],!0);else{var k=g.scrollTop;h.focus();if(k)g.scrollTop=k;f.scrollTo(e[0])}h.trigger("wgRowSelect",[a,c])}return this};c.deselectRow=function(){var a=d(this.cells[1].body.firstChild),b=a.data("row");a.find("div.selected").removeClass("selected");a.data("row",null);a.trigger("wgRowDeselect",
126
+ [b])};c.filterRows=function(a){var b=-1,c;c=d(this.cells[1].body.firstChild);if(!a)return c.removeClass("filtered"),this;for(c.addClass("filtered").find("div.filtered").removeClass("filtered");++b<a.length;)c=a[b],c=this.tr(c),c.length&&d(c).addClass("filtered");return this};c.scrollTo=function(a,b){var c,e=this.body.scrollTop,f=this.body.clientHeight+e,g=C(a,this.body),h=g+d(a).outerHeight();e>g?c=g:f<h&&(c=h-this.body.clientHeight);if(null!=c)b?this.body.scrollTop=c:d(this.body).animate({scrollTop:c},
127
+ 300);return this};c.navigize=function(a){function b(a,c){f=a.show();g=c.addClass("active");a.trigger("wgTabSelect",[a.data("index")]);return a}var c=this;c.nav&&c.el.removeChild(c.nav);c.nav=c.el.insertBefore(m.el("nav","wg-tabs"),c.body);var f,g,h=d(c.nav).click(function(a){var h=d(a.target),k=h.data("tab");if(k){var l=g;f&&f.hide();l&&l.removeClass("active");b(k,h).children().focus();c.redraw();return e(a)}});c.each(function(c,e){e.pos=0;var g=d(e.el).data("index",c),k=d('<a href="#'+e.id+'"></a>').data("tab",
128
+ g).text(a[c]).appendTo(h);f?g&&g.hide():b(g,k)});c.lock();c.restyle().redraw();h=null;return c};c=null;return a}({},w,v));o.register("$5",function(a,c,k){function f(a){var c=k.createElement("pre");c.innerHTML=a.replace(/<(p|div|br) ?\/?>/ig,"\n<$1>").replace(/(^\n+|\n+$)/g,"");a="string"===typeof c.textContent?c.textContent:"string"===typeof c.innerText?c.innerText:d(c).text();return a}a.init=function(a){function g(){var a=n.length,b=0,c=0,d=0;n.each(function(a,e){e.translation()?e.fuzzy()?d++:b++:
129
+ c++});return{t:a,p:String(b?Math.round(b/a*100):0)+"%",f:d,u:c}}function b(){u.clear();n.each(function(a,b,c){u.add(c,b.toText())});y="";w=n.length}function k(a,b){var c,d={};if(y===a)return w||0;if(!n.length)return 0;if(a){if(y&&!w&&0===a.indexOf(y))return 0;c=u.find(a,d);d.words.length||(a="")}y=a;w=c?c.length:n.length;G.filterRows(c);d=v?n.indexOf(v):-1;if(-1===d||c&&-1===c.indexOf(d))c?c.length?G.selectRow(c[0],!0):G.deselectRow():G.selectRow(0,!0);b||p("poFilter",[y,w]);return w}function e(a){if(!a)return["",
130
+ ""];var b=[a.source()||"",a.translation()||""];(a=a.context())&&(b[0]+=" [ "+a+" ]");return b}function z(a){if(a=a||v){var b=n.indexOf(a),b=G.tr(b),c=b[0].className.replace(/\s*po-[a-z]+/g,"");c+=" "+s(a)+" po-unsaved";d(b).attr("class",c);p("poUnsaved",[++E])}}function C(a,b){b=b||v;if(!b)return null;var c=b.fuzzy();null!=a&&c!=a&&(b.fuzzy(a),p("poFuzzy",[b,a]),p(F,[b]),z(b));return c}function s(a){var b=[];a&&(a.fuzzy()&&b.push("po-fuzzy"),a.translation()||b.push("po-empty"),a.comment()&&b.push("po-comment"));
131
+ return b.join(" ")}function r(a,b){var c=e(a)[b||0],f=n.indexOf(a),f=G.td(f,b);c&&/\S/.test(c)?d(f).text(c.replace("\n"," ")):d(f).html("&nbsp;")}function m(a){a!==D&&(B=(D=a)?n.lock(B):n.unlock()||B,p("poLock",[a,B]),v&&A(v))}function p(b,c){return d(a).trigger(b,c||[])}function q(){if(!n||!n.row)G.clear().header("Error").contents("Invalid PO");else{if(y)y="",w=n.length,p("poFilter",[y,w]);var a;G.table&&(a=H?H.parentNode.scrollTop:0,G.clear());H=G.tabulate(M);if(a)H.parentNode.scrollTop=a;p("poLoad");
132
+ (a=n.locale())?(B=a,m(!0)):m(!1);return!!n.length}}function t(){L.unbind().clear();K.unbind().clear();R.unbind();v&&(p("poDeselected",[v]),v=null)}function A(a){function c(){var d=B&&B.lang&&"en"!==B.lang&&B.label;K.title(d?d+" translation:":"Translation:");if(l){var h=[],k=o.require("$6","collection.js").init();a.each(function(a,b){h.push("Form "+a);k.add("plural-"+a,b)});J=K.splitx.apply(K,k.keys);K.each(function(a,b){b.textarea(k[a],g)});K.navigize(h).bind("wgTabSelect",function(a,b){e=b})}else K.textarea(a.translation(),
133
+ g);K.bind("wgChange",function(b,c){var d=f(c);a.translate(d,e);0===e&&r(a,1);a.fuzzy()?C(!1,a):z(a)}).bind("wgChanged",function(){u&&b();p(F,[a])})}function d(){K.title("Context:");K.textarea(a.context(),!0);K.bind("wgChange",function(b,c){var d=f(c);a.context(d);a.source();r(a,0);z(a)}).bind("wgChanged",function(){n.reIndex(a);u&&b();p(F,[a])})}t();v=a;R.textarea(a.comment(),!0).bind("wgChange",function(b,c){var d=f(c);a.comment(d);p("poComment",[a,d]);z(a)});var e=0,g=D,h=!D,k=a.source()||"",l=
134
+ a.plural()||"";(function(){l?(J=L.splity(L.id+"-singular",L.id+"-plural"),J[0].header("Singular:").textarea(k,h),J[1].header("Plural:").textarea(l,h),L.lock()):L.textarea(k,h);L.title("Source text:");h&&L.bind("wgChange",function(b,c){var d=f(c);L.id+"-plural"===b.target.parentNode.id?a.plural(d):(a.source(d),r(a,0));z(a)}).bind("wgChanged",function(c){L.id+"-plural"===c.target.parentNode.id||n.reIndex(a);u&&b();p(F,[a])})})();g?c():d();p("poSelected",[a]);data=null}var n,u,y,w,D,B,v,E=0,F="poUpdate",
135
+ H,M={row:function(a){return e(n.row(a))},eachCol:function(a){a(0,"Source text");a(0,"Translation")},eachRow:function(a){var b=0;n.each(function(c,d){a(b++,e(d),s(d))})}},N=o.require("$7","LocoWinGrid.js").init(a),J=N.splity("po-list","po-edit"),G=J[0],O=J[1],J=O.splitx("po-trans","po-comment"),S=J[0],R=J[1].header("Comment:"),J=S.splity("po-source","po-target"),L=J[0].header("Source text:"),K=J[1].header("Translation:");N.distribute(0.34);O.distribute(0.8);d(c).resize(function(){N.redraw(!0);return!0});
136
+ G.bind("wgRowSelect",function(a,b){var c=n.row(b);A(c);return!0}).bind("wgRowDeselect",function(){t();R.textarea("",!1);L.textarea("",!1).title("Source text not loaded:");K.textarea("",!1).title("Translation not loaded:");p("poSelected",[null]);return!0});return{bind:function(b,c){return d(a).bind(b,c)},load:function(a){n=a;u&&b();q()&&G.selectRow(0)},save:function(a){if(E||a)d(H).find("div.po-unsaved").removeClass("po-unsaved"),p("poSave");E=0;return n},fuzzy:function(a){return C(a)},del:function(a,
137
+ c){var d=arguments.length?n.get(a,c):v;if(d){var e=y,f=n.del(d);null!=f&&(p("poDel",[d]),p(F,[d]),q(),u&&b(),v&&v.equals(d)&&t(),n.length&&(e&&k(e),v||(f=Math.min(f,n.length-1),G.selectRow(f))))}},add:function(a,b){var c,d=n.get(a,b);d?c=n.indexOf(d):(c=n.length,d=n.add(a,b),G.addRow(M.row(c),s(d)),z(d),u&&u.add(n.indexOf(d),d.toText()),p("poAdd",[d]),p(F,[d]));y&&k("");G.selectRow(c);return d},lock:function(){m(!0)},unlock:function(){m(!1)},locked:function(){return Boolean(D)},filter:function(a){return u&&
138
+ n&&n.length&&k(a,!0)},searchable:function(a){a&&(u=a,n&&b());return u&&!0},stats:function(){return g()}}};return a}({},w,v));var $=w.ajaxurl||"/wp-admin/admin-ajax.php",R=(w.loco||{}).conf||{},S=R.locale,M=o.require("$1","po.js").create(S),F={},N=v.getElementById("loco-poedit-inner"),O=w.loco__||function(a){return a};d(w).resize(function(){function a(){var a;a=N;for(var h=a.offsetTop||0;(a=a.offsetParent)&&a!==void 0;)h+=a.offsetTop||0;a=h;h=d(w).innerHeight();N.style.height=String(Math.max(k,h-a-
139
+ c))+"px";return!0}var c=20,k=parseInt(d(N).css("min-height")||0);a();return a}());F.save=function(a){function c(){a.disabled=!1}c();E.bind("poUnsaved",function(){d(a).addClass("button-primary loco-flagged")}).bind("poSave",function(){d(a).removeClass("button-primary loco-flagged")});d(a.form).submit(function(k){var f=k.target;k.target.po.value=M.toString();a.disabled=!0;Y(f,function(a){c();d("#loco-po-modified").text(a.modified);E.save(!0);W(O("File saved")+", "+a.filename)},c);return H(k)});return!0};
140
+ F.download=function(a){a.disabled=!1;d(a).click(function(){a.form.po.value=M.toString();d(N).trigger("poSave");return!0});return!0};F.add=!S&&function(a){a.disabled=!1;d(a).click(function(a){var d=1,f;for(f="New message";M.get(f);)d=/(\d+)/.exec(f)?Math.max(d,RegExp.$1):d,f="New message "+ ++d;E.add(f);return H(a)});return!0};F.del=!S&&function(a){a.disabled=!1;d(a).click(function(a){E.del();return H(a)});return!0};F.fuzzy=S&&function(a){function c(c){a.disabled=null==c;d(a)[c?"addClass":"removeClass"]("loco-inverted")}
141
+ E.bind("poSelected",function(a,d){c(d&&E.locked()?d.fuzzy():null)}).bind("poFuzzy",function(a,d,h){c(E.locked()?h:null)});d(a).click(function(a){var c=!E.fuzzy();E.fuzzy(c);return H(a)});return!0};F.sync=function(a){function c(){a.disabled=!1}c();E.bind("poUnsaved",function(){a.disabled=!0}).bind("poSave",function(){c()});d(a.form).submit(function(k){a.disabled=!0;Y(k.target,function(a){c();var h=o.require("$1","po.js").create(void 0);h.load(a.exp);var g=[],b=M.merge(h),h=b.add.length,b=b.del.length;
142
+ E.load(M);h||b?(g.push("Merged from "+(a.pot||"source code")),h&&g.push(h+" new string"+(h===1?"":"s")+" added"),b&&g.push(b+" obsolete string"+(b===1?"":"s")+" removed"),d(N).trigger("poUnsaved",[])):g.push("Already up to date with "+(a.pot||"source code"));W(g.join(". "))},c);return H(k)});return!0};F.revert=function(a){E.bind("poUnsaved",function(){a.disabled=!1}).bind("poSave",function(){a.disabled=!0});d(a).click(function(a){location.reload();return H(a)});return!0};F.help=function(){return!0};
143
+ N.innerHTML="";var E=o.require("$5","poedit.js").init(N);d("#loco-nav").find("button").each(function(a,c){var k=c.getAttribute("data-loco");F[k]&&F[k](c)||d(c).hide()});F=null;(function(a){d(a.form).submit(function(a){return H(a)});var c=o.require("$2","dict.js").create();c.depth=10;c.translit(o.require("$3","translit.json"));E.searchable(c);a.disabled=!1;a.value="";var k=o.require("$4","LocoTextListener.js").listen(a,function(a){E.filter(a)});E.bind("poFilter",function(a,c){k.val(c)});a=c=null})(v.getElementById("loco-search"));
144
+ E.bind("poUnsaved",function(){w.onbeforeunload=function(){return O("Your changes will be lost if you continue without saving")}}).bind("poSave",function(){w.onbeforeunload=null}).bind("poUpdate",X);S?M.load(R.po||{}):M.load(R.pot||{});E.load(M);X();d("#wpbody-content").find("div.loco-message").each(function(a,c){U(c,!0)})})(window,document,window.jQuery);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: timwhitlock
3
  Tags: translation, translators, localization, l10n, i18n, Gettext, POEdit
4
  Requires at least: 3.5
5
  Tested up to: 3.5
6
- Stable tag: 1.0.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -87,5 +87,29 @@ Ensure that the web server is able to write the file to disk, and also ensure th
87
 
88
  == Changelog ==
89
 
 
 
 
 
 
90
  = 1.0.0 =
91
  * First version published
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Tags: translation, translators, localization, l10n, i18n, Gettext, POEdit
4
  Requires at least: 3.5
5
  Tested up to: 3.5
6
+ Stable tag: 1.1.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
87
 
88
  == Changelog ==
89
 
90
+ = 1.1.0 =
91
+ * Added translation search filter in editor
92
+ * Added percentage completion in list and edit views
93
+
94
+
95
  = 1.0.0 =
96
  * First version published
97
+
98
+
99
+ == Upgrade Notice ==
100
+
101
+ = 1.1.0 =
102
+ * Bug fixes and improvements available.
103
+
104
+
105
+
106
+ == Coming soon ==
107
+
108
+ These features are on our todo list. There's no particular timeframe for any of them and they're in no particular order:
109
+
110
+ * Integration with Google and Bing for automatic translation
111
+ * Full, but optional integration with Loco for collaborative translation
112
+ * Support multiple pairings of POT and PO files within a single package.
113
+
114
+
115
+
tpl/admin-list.tpl.php CHANGED
@@ -8,7 +8,7 @@
8
  <thead>
9
  <tr>
10
  <th scope="col">
11
- <?php Loco::h( Loco::_x('Package name','Table header') )?>
12
  </th>
13
  <th scope="col">
14
  <?php Loco::h( Loco::_x('Translations (PO)','Table header') )?>
@@ -28,21 +28,39 @@
28
  ?>
29
  <tr class="inactive">
30
  <td>
31
- <strong><?php Loco::h($name)?></strong>
32
- <br />
33
- <span><?php Loco::h( _n( '1 language', '%u languages', $n ), $n )?></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </td>
35
  <td>
36
  <ul>
37
  <li class="loco-add">
38
  <?php echo LocoAdmin::msginit_link( $root, Loco::_x('New language','Add button') )?>
39
  </li><?php
40
- foreach( $po as $po_path ):
41
- $locale = LocoAdmin::resolve_file_locale($po_path);
42
- $label = $locale->get_code().' : '.$locale->get_name();
 
43
  ?>
44
  <li class="loco-edit">
45
  <?php echo LocoAdmin::edit_link( $root, $po_path, $label )?>
 
 
 
46
  </li><?php
47
  endforeach;?>
48
  </ul>
@@ -50,7 +68,8 @@
50
  <td>
51
  <ul><?php // show POT files (should be no more than one)
52
  if( $pot ):
53
- foreach( $pot as $pot_path ):
 
54
  ?>
55
  <li class="loco-edit">
56
  <?php echo LocoAdmin::edit_link( $root, $pot_path )?>
8
  <thead>
9
  <tr>
10
  <th scope="col">
11
+ <?php Loco::h( Loco::_x('Package details','Table header') )?>
12
  </th>
13
  <th scope="col">
14
  <?php Loco::h( Loco::_x('Translations (PO)','Table header') )?>
28
  ?>
29
  <tr class="inactive">
30
  <td>
31
+ <ul class="loco-details">
32
+ <strong><?php Loco::h($name)?></strong>
33
+ <li>
34
+
35
+ </li>
36
+ <li>
37
+ <?php Loco::h( _n( '1 language', '%u languages', $n ), $n )?>
38
+ </li><?php
39
+ if( $mtime ):?>
40
+ <li class="loco-mtime">
41
+ <small>
42
+ <?php Loco::h( Loco::_x('Updated','Modified time') )?>
43
+ <?php Loco::h( LocoAdmin::format_datetime($mtime) )?>
44
+ </small>
45
+ </li><?php
46
+ endif?>
47
+ </ul>
48
  </td>
49
  <td>
50
  <ul>
51
  <li class="loco-add">
52
  <?php echo LocoAdmin::msginit_link( $root, Loco::_x('New language','Add button') )?>
53
  </li><?php
54
+ foreach( $po as $po_data ):
55
+ extract( $po_data, EXTR_PREFIX_ALL, 'po' );
56
+ $code = $po_locale->get_code();
57
+ $label = $code ? $code.' : '.$po_locale->get_name() : $po_name;
58
  ?>
59
  <li class="loco-edit">
60
  <?php echo LocoAdmin::edit_link( $root, $po_path, $label )?>
61
+ <small class="loco-progress">
62
+ <?php echo $po_stats['p']?>%
63
+ </small>
64
  </li><?php
65
  endforeach;?>
66
  </ul>
68
  <td>
69
  <ul><?php // show POT files (should be no more than one)
70
  if( $pot ):
71
+ foreach( $pot as $pot_data ):
72
+ extract( $pot_data, EXTR_PREFIX_ALL, 'pot' );
73
  ?>
74
  <li class="loco-edit">
75
  <?php echo LocoAdmin::edit_link( $root, $pot_path )?>
tpl/admin-nav.tpl.php CHANGED
@@ -17,7 +17,7 @@
17
  <?php endif?>
18
  <?php endforeach?>
19
  <a href="http://localise.biz/?<?php echo Loco::utm_query('nav')?>" class="nav-tab nav-tab-loco">
20
- <?php echo Loco::html(Loco::__('Powered by Loco'))?>
21
  </a>
22
  </h2>
23
 
17
  <?php endif?>
18
  <?php endforeach?>
19
  <a href="http://localise.biz/?<?php echo Loco::utm_query('nav')?>" class="nav-tab nav-tab-loco">
20
+ <?php echo Loco::html(Loco::__('Powered by'))?> <strong>Loco</strong>
21
  </a>
22
  </h2>
23
 
tpl/admin-poedit.tpl.php CHANGED
@@ -16,10 +16,9 @@ $phpbase = Loco::html( Loco::baseurl() ).'/php';
16
  <?php Loco::render('admin-nav', compact('nav') )?>
17
 
18
  <h3 class="title">
19
- <?php Loco::h( $locale ? $locale->get_name() : Loco::__('Template file') )?>
20
  <span class="loco-meta">
21
- &ndash;
22
- <?php Loco::h( Loco::__('last modified') )?>:
23
  <span id="loco-po-modified">
24
  <?php if( $modified ):?>
25
  <?php Loco::h($modified)?>
@@ -27,6 +26,10 @@ $phpbase = Loco::html( Loco::baseurl() ).'/php';
27
  <em><?php Loco::h( Loco::__('never') )?></em>
28
  <?php endif?>
29
  </span>
 
 
 
 
30
  </span>
31
  </h3>
32
 
@@ -80,6 +83,9 @@ $phpbase = Loco::html( Loco::baseurl() ).'/php';
80
  <span><?php Loco::h( Loco::_x('Fuzzy','Editor button') )?></span>
81
  </button>
82
  </form>
 
 
 
83
  <form action="http://wordpress.org/support/plugin/<?php echo Loco::NS?>" target="_blank">
84
  <button class="button loco-help" data-loco="help" type="submit">
85
  <span><?php Loco::h( Loco::_x('Help','Editor button') )?></span>
16
  <?php Loco::render('admin-nav', compact('nav') )?>
17
 
18
  <h3 class="title">
19
+ <?php Loco::h( $locale ? $locale->get_name() : Loco::__('Template file') )?>:
20
  <span class="loco-meta">
21
+ <?php Loco::h( Loco::__('Updated') )?>:
 
22
  <span id="loco-po-modified">
23
  <?php if( $modified ):?>
24
  <?php Loco::h($modified)?>
26
  <em><?php Loco::h( Loco::__('never') )?></em>
27
  <?php endif?>
28
  </span>
29
+ &mdash;
30
+ <span id="loco-po-status">
31
+ <!-- js will load status -->
32
+ </span>
33
  </span>
34
  </h3>
35
 
83
  <span><?php Loco::h( Loco::_x('Fuzzy','Editor button') )?></span>
84
  </button>
85
  </form>
86
+ <form action="<?php echo $phpbase?>/loco-fail.php" id="loco-filter">
87
+ <input type="text" maxlength="100" name="q" id="loco-search" placeholder="<?php Loco::h(Loco::__('Filter translations'))?>" autocomplete="off" disabled />
88
+ </form>
89
  <form action="http://wordpress.org/support/plugin/<?php echo Loco::NS?>" target="_blank">
90
  <button class="button loco-help" data-loco="help" type="submit">
91
  <span><?php Loco::h( Loco::_x('Help','Editor button') )?></span>