Advanced Access Manager - Version 2.9.2

Version Description

  • Small fix in core
  • Moved ConfigPress as stand-alone plugin. It is no longer a part of AAM
  • Styled the AAM notification message
Download this release

Release Info

Developer vasyl_m
Plugin Icon 128x128 Advanced Access Manager
Version 2.9.2
Comparing to
See all releases

Code changes from version 2.8 to 2.9.2

aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: Manage User and Role Access to WordPress Backend and Frontend.
6
- Version: 2.8
7
  Author: Vasyl Martyniuk <support@wpaam.com>
8
  Author URI: http://www.wpaam.com
9
 
@@ -68,9 +68,6 @@ class aam {
68
  add_action('admin_print_scripts', array($this, 'printScripts'));
69
  add_action('admin_print_styles', array($this, 'printStyles'));
70
 
71
- //add help menu
72
- add_filter('contextual_help', array($this, 'contextualHelp'), 10, 3);
73
-
74
  //manager Admin Menu
75
  if (aam_Core_API::isNetworkPanel()) {
76
  add_action('network_admin_menu', array($this, 'adminMenu'), 999);
@@ -94,6 +91,10 @@ class aam {
94
  add_filter('post_row_actions', array($this, 'postRowActions'), 10, 2);
95
  add_filter('tag_row_actions', array($this, 'tagRowActions'), 10, 2);
96
  add_action('admin_action_edit', array($this, 'adminActionEdit'), 10);
 
 
 
 
97
  //wp die hook
98
  add_filter('wp_die_handler', array($this, 'wpDie'), 10);
99
  //***For UI purposes***
@@ -189,6 +190,26 @@ class aam {
189
 
190
  return $open;
191
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
  /**
194
  * Get Post ID
@@ -295,24 +316,6 @@ class aam {
295
  return $pages;
296
  }
297
 
298
- /**
299
- * Contextual Help Menu
300
- *
301
- * @param type $contextual_help
302
- * @param type $screen_id
303
- * @param type $screen
304
- *
305
- * @return
306
- */
307
- public function contextualHelp($contextual_help, $screen_id, $screen){
308
- if ($this->isAAMScreen()){
309
- $help = new aam_View_Help();
310
- $help->content($screen);
311
- }
312
-
313
- return $contextual_help;
314
- }
315
-
316
  /**
317
  * Filter Navigation menu
318
  *
@@ -757,7 +760,6 @@ class aam {
757
  AAM_MEDIA_URL . 'css/configpress.css',
758
  array('aam-common-style')
759
  );
760
- wp_enqueue_style('aam-codemirror', AAM_MEDIA_URL . 'css/codemirror.css');
761
  }
762
 
763
  }
@@ -828,11 +830,7 @@ class aam {
828
  wp_localize_script('aam-admin', 'aamLocal', $localization);
829
  } elseif ($this->isAAMConfigPressScreen()) {
830
  wp_enqueue_script('jquery-ui-core');
831
- wp_enqueue_script('jquery-effects-core');
832
- wp_enqueue_script('jquery-effects-highlight');
833
  wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/configpress.js');
834
- wp_enqueue_script('aam-codemirror', AAM_MEDIA_URL . 'js/codemirror.js');
835
- wp_enqueue_script('aam-cmini', AAM_MEDIA_URL . 'js/properties.js');
836
 
837
  $localization = array(
838
  'nonce' => wp_create_nonce('aam_ajax'),
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: Manage User and Role Access to WordPress Backend and Frontend.
6
+ Version: 2.9.2
7
  Author: Vasyl Martyniuk <support@wpaam.com>
8
  Author URI: http://www.wpaam.com
9
 
68
  add_action('admin_print_scripts', array($this, 'printScripts'));
69
  add_action('admin_print_styles', array($this, 'printStyles'));
70
 
 
 
 
71
  //manager Admin Menu
72
  if (aam_Core_API::isNetworkPanel()) {
73
  add_action('network_admin_menu', array($this, 'adminMenu'), 999);
91
  add_filter('post_row_actions', array($this, 'postRowActions'), 10, 2);
92
  add_filter('tag_row_actions', array($this, 'tagRowActions'), 10, 2);
93
  add_action('admin_action_edit', array($this, 'adminActionEdit'), 10);
94
+ //control permalink editing
95
+ add_filter(
96
+ 'get_sample_permalink_html', array($this, 'permalinkHTML'), 10, 4
97
+ );
98
  //wp die hook
99
  add_filter('wp_die_handler', array($this, 'wpDie'), 10);
100
  //***For UI purposes***
190
 
191
  return $open;
192
  }
193
+
194
+ /**
195
+ * Control edit permalink feature
196
+ *
197
+ * @param string $html
198
+ * @param int $id
199
+ * @param type $new_title
200
+ * @param type $new_slug
201
+ *
202
+ * @return string
203
+ */
204
+ public function permalinkHTML($html, $id, $new_title, $new_slug) {
205
+ if (aam_Core_ConfigPress::getParam('aam.control_permalink') === 'true') {
206
+ if ($this->getUser()->hasCapability('manage_permalink') === false) {
207
+ $html = '';
208
+ }
209
+ }
210
+
211
+ return $html;
212
+ }
213
 
214
  /**
215
  * Get Post ID
316
  return $pages;
317
  }
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  /**
320
  * Filter Navigation menu
321
  *
760
  AAM_MEDIA_URL . 'css/configpress.css',
761
  array('aam-common-style')
762
  );
 
763
  }
764
 
765
  }
830
  wp_localize_script('aam-admin', 'aamLocal', $localization);
831
  } elseif ($this->isAAMConfigPressScreen()) {
832
  wp_enqueue_script('jquery-ui-core');
 
 
833
  wp_enqueue_script('aam-admin', AAM_MEDIA_URL . 'js/configpress.js');
 
 
834
 
835
  $localization = array(
836
  'nonce' => wp_create_nonce('aam_ajax'),
application/core/configpress.php CHANGED
@@ -17,16 +17,6 @@
17
  */
18
  final class aam_Core_ConfigPress {
19
 
20
- /**
21
- * Parsed ConfigPress from the file
22
- *
23
- * @var Zend_Config_Ini
24
- *
25
- * @access private
26
- * @static
27
- */
28
- private static $_config = null;
29
-
30
  /**
31
  * Read ConfigPress File content
32
  *
@@ -46,33 +36,6 @@ final class aam_Core_ConfigPress {
46
  return $content;
47
  }
48
 
49
- /**
50
- * Write ConfigPres to file
51
- *
52
- * @param string $content
53
- *
54
- * @return boolean
55
- *
56
- * @access public
57
- * @static
58
- */
59
- public static function write($content) {
60
- if (is_writable(AAM_TEMP_DIR)) {
61
- $filename = aam_Core_API::getBlogOption('aam_configpress', '');
62
- if (!$filename) { //file already was created
63
- $filename = sha1(uniqid('aam'));
64
- aam_Core_API::updateBlogOption('aam_configpress', $filename);
65
- }
66
- $response = file_put_contents(
67
- AAM_TEMP_DIR . $filename, stripcslashes($content)
68
- );
69
- } else {
70
- $response = false;
71
- }
72
-
73
- return $response;
74
- }
75
-
76
  /**
77
  * Get ConfigPress parameter
78
  *
@@ -85,27 +48,13 @@ final class aam_Core_ConfigPress {
85
  * @static
86
  */
87
  public static function getParam($param, $default = null) {
88
- //initialize the ConfigPress if empty
89
- if (is_null(self::$_config)) {
90
- $filename = aam_Core_API::getBlogOption('aam_configpress', '');
91
- if ($filename && file_exists(AAM_TEMP_DIR . $filename)) {
92
- //parse the file content & create Config INI Object
93
- self::parseConfig(AAM_TEMP_DIR . $filename);
94
- }
95
- }
96
-
97
- //find the parameter
98
- $tree = self::$_config;
99
- foreach (explode('.', $param) as $section) {
100
- if (isset($tree->{$section})) {
101
- $tree = $tree->{$section};
102
- } else {
103
- $tree = $default;
104
- break;
105
- }
106
  }
107
 
108
- return self::parseParam($tree, $default);
109
  }
110
 
111
  /**
@@ -120,10 +69,9 @@ final class aam_Core_ConfigPress {
120
  * @static
121
  */
122
  protected static function parseParam($param, $default) {
123
- if (is_object($param) && isset($param->userFunc)) {
124
- $func = trim($param->userFunc);
125
- if (is_string($func) && is_callable($func)) {
126
- $response = call_user_func($func);
127
  } else {
128
  $response = $default;
129
  }
@@ -134,30 +82,4 @@ final class aam_Core_ConfigPress {
134
  return $response;
135
  }
136
 
137
- /**
138
- * Parse ConfigPress file and create an object
139
- *
140
- * @param string $filename
141
- *
142
- * @return void
143
- *
144
- * @access protected
145
- * @static
146
- */
147
- protected static function parseConfig($filename) {
148
- //include third party library
149
- if (!class_exists('Zend_Config')) {
150
- require_once(AAM_LIBRARY_DIR . 'Zend/Exception.php');
151
- require_once(AAM_LIBRARY_DIR . 'Zend/Config/Exception.php');
152
- require_once(AAM_LIBRARY_DIR . 'Zend/Config.php');
153
- require_once(AAM_LIBRARY_DIR . 'Zend/Config/Ini.php');
154
- }
155
- //parse ini file
156
- try {
157
- self::$_config = new Zend_Config_Ini($filename);
158
- } catch (Zend_Config_Exception $e) {
159
- //do nothing
160
- }
161
- }
162
-
163
  }
17
  */
18
  final class aam_Core_ConfigPress {
19
 
 
 
 
 
 
 
 
 
 
 
20
  /**
21
  * Read ConfigPress File content
22
  *
36
  return $content;
37
  }
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  /**
40
  * Get ConfigPress parameter
41
  *
48
  * @static
49
  */
50
  public static function getParam($param, $default = null) {
51
+ if (class_exists('ConfigPress')) {
52
+ $response = ConfigPress::get($param, $default);
53
+ } else {
54
+ $response = $default;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
+ return self::parseParam($response, $default);
58
  }
59
 
60
  /**
69
  * @static
70
  */
71
  protected static function parseParam($param, $default) {
72
+ if (is_array($param) && isset($param['userFunc'])) {
73
+ if (is_callable($param['userFunc'])) {
74
+ $response = call_user_func($param['userFunc']);
 
75
  } else {
76
  $response = $default;
77
  }
82
  return $response;
83
  }
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
application/core/repository.php CHANGED
@@ -17,21 +17,6 @@
17
  */
18
  class aam_Core_Repository {
19
 
20
- /**
21
- * Extensions download Failed
22
- */
23
- const STATUS_FAILED = 'failed';
24
-
25
- /**
26
- * Extensions status pending
27
- */
28
- const STATUS_PENDING = 'pending';
29
-
30
- /**
31
- * Extensions installed successfully
32
- */
33
- const STATUS_INSTALLED = 'installed';
34
-
35
  /**
36
  * Single instance of itself
37
  *
@@ -153,17 +138,22 @@ class aam_Core_Repository {
153
  * @access public
154
  */
155
  public function hasExtension($extension){
156
- $response = false;
157
-
158
- if (isset($this->_repository[$extension])){
159
- $info = $this->_repository[$extension];
160
- if ($info->status == self::STATUS_INSTALLED
161
- && file_exists($info->basedir)){
162
- $response = true;
163
- }
164
- }
165
-
166
- return $response;
 
 
 
 
 
167
  }
168
 
169
  /**
@@ -175,8 +165,8 @@ class aam_Core_Repository {
175
  *
176
  * @access public
177
  */
178
- public function getExtension($ext){
179
- return ($this->hasExtension($ext) ? $this->_repository[$ext] : new stdClass);
180
  }
181
 
182
  /**
@@ -192,12 +182,8 @@ class aam_Core_Repository {
192
 
193
  if (is_array($repository)) {
194
  //get the list of extensions
195
- foreach ($repository as $extension => $data) {
196
- if ($this->retrieve($data->license)) {
197
- $repository[$extension]->status = self::STATUS_INSTALLED;
198
- } else {
199
- $repository[$extension]->status = self::STATUS_FAILED;
200
- }
201
  }
202
  aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);
203
  }
@@ -219,10 +205,7 @@ class aam_Core_Repository {
219
 
220
  if ($this->retrieve($license)){
221
  $repository[$extension] = (object) array(
222
- 'status' => self::STATUS_INSTALLED,
223
- 'license' => $license,
224
- //ugly way but quick
225
- 'basedir' => "{$this->_basedir}/" . str_replace(' ', '_', $extension)
226
  );
227
  aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);
228
  $response = true;
@@ -237,31 +220,40 @@ class aam_Core_Repository {
237
  * Remove Extension from the repository
238
  *
239
  * @param string $extension
240
- * @param string $license
241
  *
242
  * @return boolean
243
  *
244
  * @access public
245
  */
246
- public function remove($extension, $license){
247
  global $wp_filesystem;
248
 
249
- $this->initFilesystem();
250
  $repository = aam_Core_API::getBlogOption('aam_extensions', array(), 1);
251
- $response = false;
252
 
 
 
253
  if (isset($repository[$extension])){
254
- $basedir = $repository[$extension]->basedir;
255
- if ($wp_filesystem->rmdir($basedir, true)){
256
- $response = true;
257
- unset($repository[$extension]);
258
- aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);
259
- } else {
260
- $this->addError(__('Failed to Remove Extension', 'aam'));
261
- }
 
262
  }
263
 
264
- return $response;
 
 
 
 
 
 
 
 
 
265
  }
266
 
267
  /**
@@ -291,7 +283,7 @@ class aam_Core_Repository {
291
  protected function retrieve($license) {
292
  global $wp_filesystem;
293
 
294
- $url = WPAAM_REST_API . '?method=extension&license=' . $license;
295
  $res = wp_remote_request($url, array('timeout' => 10));
296
  $response = false;
297
  if (!is_wp_error($res)) {
17
  */
18
  class aam_Core_Repository {
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  /**
21
  * Single instance of itself
22
  *
138
  * @access public
139
  */
140
  public function hasExtension($extension){
141
+ return file_exists(
142
+ $this->_basedir . '/' . $this->prepareExtFName($extension)
143
+ );
144
+ }
145
+
146
+ /**
147
+ * Check if license exists
148
+ *
149
+ * @param string $extension
150
+ *
151
+ * @return boolean
152
+ *
153
+ * @access public
154
+ */
155
+ public function hasLicense($extension) {
156
+ return (isset($this->_repository[$extension]) ? true : false);
157
  }
158
 
159
  /**
165
  *
166
  * @access public
167
  */
168
+ public function getLicense($ext){
169
+ return ($this->hasLicense($ext) ? $this->_repository[$ext]->license : '');
170
  }
171
 
172
  /**
182
 
183
  if (is_array($repository)) {
184
  //get the list of extensions
185
+ foreach ($repository as $data) {
186
+ $this->retrieve($data->license);
 
 
 
 
187
  }
188
  aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);
189
  }
205
 
206
  if ($this->retrieve($license)){
207
  $repository[$extension] = (object) array(
208
+ 'license' => $license
 
 
 
209
  );
210
  aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);
211
  $response = true;
220
  * Remove Extension from the repository
221
  *
222
  * @param string $extension
 
223
  *
224
  * @return boolean
225
  *
226
  * @access public
227
  */
228
+ public function remove($extension){
229
  global $wp_filesystem;
230
 
 
231
  $repository = aam_Core_API::getBlogOption('aam_extensions', array(), 1);
 
232
 
233
+ //if extension has been downloaded as part of dev license, it'll be
234
+ //not present in the repository list
235
  if (isset($repository[$extension])){
236
+ unset($repository[$extension]);
237
+ aam_Core_API::updateBlogOption('aam_extensions', $repository, 1);
238
+ }
239
+
240
+ if ($this->hasExtension($extension)){
241
+ $this->initFilesystem();
242
+ $wp_filesystem->rmdir(
243
+ $this->_basedir . '/' . $this->prepareExtFName($extension), true
244
+ );
245
  }
246
 
247
+ return true;
248
+ }
249
+
250
+ /**
251
+ *
252
+ * @param type $extension
253
+ * @return type
254
+ */
255
+ protected function prepareExtFName($extension) {
256
+ return str_replace(' ', '_', $extension);
257
  }
258
 
259
  /**
283
  protected function retrieve($license) {
284
  global $wp_filesystem;
285
 
286
+ $url = WPAAM_REST_API . '?method=exchange&license=' . $license;
287
  $res = wp_remote_request($url, array('timeout' => 10));
288
  $response = false;
289
  if (!is_wp_error($res)) {
application/view/help.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * ======================================================================
5
- * LICENSE: This file is subject to the terms and conditions defined in *
6
- * file 'license.txt', which is part of this source code package. *
7
- * ======================================================================
8
- */
9
-
10
- /**
11
- *
12
- * @package AAM
13
- * @author Vasyl Martyniuk <support@wpaam.com>
14
- * @copyright Copyright C 2013 Vasyl Martyniuk
15
- * @license GNU General Public License {@link http://www.gnu.org/licenses/}
16
- */
17
- class aam_View_Help extends aam_View_Abstract {
18
-
19
- /**
20
- * Get View content
21
- *
22
- * @return string
23
- *
24
- * @access public
25
- */
26
- public function content($screen) {
27
- $basedir = dirname(__FILE__) . '/tmpl/';
28
- $screen->add_help_tab(array(
29
- 'id' => 'faq',
30
- 'title' => 'FAQ',
31
- 'content' => $this->loadTemplate($basedir . 'help_faq.phtml')
32
- ));
33
- //add overview tab
34
- $screen->add_help_tab(array(
35
- 'id' => 'overview',
36
- 'title' => 'Overview',
37
- 'content' => $this->loadTemplate($basedir . 'help_overview.phtml')
38
- ));
39
- $screen->add_help_tab(array(
40
- 'id' => 'extensions',
41
- 'title' => 'Extensions',
42
- 'content' => $this->loadTemplate($basedir . 'help_extensions.phtml')
43
- ));
44
- $screen->add_help_tab(array(
45
- 'id' => 'developers',
46
- 'title' => 'Developers',
47
- 'content' => $this->loadTemplate($basedir . 'help_developers.phtml')
48
- ));
49
- }
50
-
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
application/view/manager.php CHANGED
@@ -732,13 +732,13 @@ class aam_View_Manager extends aam_View_Abstract {
732
  }
733
 
734
  /**
735
- * Install extension
736
  *
737
  * @return string
738
  *
739
  * @access public
740
  */
741
- public function installExtension()
742
  {
743
  if (current_user_can(aam_Core_ConfigPress::getParam(
744
  'aam.menu.extensions.capability', 'administrator'
@@ -753,13 +753,13 @@ class aam_View_Manager extends aam_View_Abstract {
753
  }
754
 
755
  /**
756
- * Remove extension
757
  *
758
  * @return string
759
  *
760
  * @access public
761
  */
762
- public function removeExtension()
763
  {
764
  if (current_user_can(aam_Core_ConfigPress::getParam(
765
  'aam.menu.extensions.capability', 'administrator'
732
  }
733
 
734
  /**
735
+ * Install license
736
  *
737
  * @return string
738
  *
739
  * @access public
740
  */
741
+ public function installLicense()
742
  {
743
  if (current_user_can(aam_Core_ConfigPress::getParam(
744
  'aam.menu.extensions.capability', 'administrator'
753
  }
754
 
755
  /**
756
+ * Remove license
757
  *
758
  * @return string
759
  *
760
  * @access public
761
  */
762
+ public function removeLicense()
763
  {
764
  if (current_user_can(aam_Core_ConfigPress::getParam(
765
  'aam.menu.extensions.capability', 'administrator'
application/view/tmpl/configpress.phtml CHANGED
@@ -18,7 +18,16 @@
18
  </span>
19
  </h3>
20
  <div class="inside">
21
- <textarea id="configpress" style="width:100%; height: 400px;"><?php echo aam_Core_ConfigPress::read(); ?></textarea>
 
 
 
 
 
 
 
 
 
22
  </div>
23
  </div>
24
  </div>
@@ -38,7 +47,7 @@
38
  <div class="inside">
39
  <p>
40
  Below is the list of all possible ConfigPress settings with explanation:
41
- <pre style="background:#fff;color:#000">
42
  <span style="color:#05a;font-weight: bold;">[aam]</span>
43
  <span style="color:#00b418">#Define default access to admin menu items if it was not configured.</span>
44
  <span style="color:#00b418">#By default it is set to</span> <span style="color:#d80800">"allow"</span>.
@@ -69,6 +78,10 @@
69
  <span style="color:#00b418">#Each time you create new role with AAM, the ID is changed to something like aam_78koi9831933i.</span>
70
  <span style="color:#00b418">#Setting below suppresses this behavior and keep the name in lowercase format.</span>
71
  <span style="color:#0100b6;font-weight:700;">native_role_id</span> = <span style="color:#d80800">"true"</span>
 
 
 
 
72
 
73
  <span style="color:#05a;font-weight: bold;">[backend]</span>
74
  <span style="color:#00b418">#Defines redirect behavior when access is denied to any backend resource like menu</span>
@@ -85,7 +98,7 @@
85
  <span style="color:#0100b6;font-weight:700;">access.deny.redirect</span> = <span style="color:#d80800">"http://someurlhere.in"</span>
86
  <span style="color:#00b418">#Redefine default <b>Access Denied</b> message.</span>
87
  <span style="color:#0100b6;font-weight:700;">access.deny.message</span> = <span style="color:#d80800">"Oops. This is restricted area"</span>
88
- </pre>
89
  </p>
90
  </div>
91
  </div>
@@ -123,9 +136,6 @@
123
  </h3>
124
  <div class="inside">
125
  <div class="large-icons-row">
126
- <a href="#" class="aam-icon aam-icon-large aam-icon-large-save" id="save_config" >
127
- <span></span><?php echo __('Save', 'aam'); ?>
128
- </a>
129
  <a href="#" class="aam-icon aam-icon-large aam-icon-large-info" id="info_screen" >
130
  <span></span><?php echo __('Info', 'aam'); ?>
131
  </a>
18
  </span>
19
  </h3>
20
  <div class="inside">
21
+ <p>
22
+ ConfigPress has been moved as a stand-alone plugin. Please install <a href="https://wordpress.org/plugins/configpress/" target="_blank">ConfigPress plugin</a> from official WordPress repository.
23
+ </p>
24
+ <?php $config = aam_Core_ConfigPress::read(); ?>
25
+ <?php if ($config) { ?>
26
+ <p>After you install ConfigPress plugin. Go to Settings > ConfigPress and copy & paste your below configurations:</p>
27
+ <pre>
28
+ <?php echo aam_Core_ConfigPress::read(); ?>
29
+ </pre>
30
+ <?php } ?>
31
  </div>
32
  </div>
33
  </div>
47
  <div class="inside">
48
  <p>
49
  Below is the list of all possible ConfigPress settings with explanation:
50
+ <pre style="background:#fff;color:#000">
51
  <span style="color:#05a;font-weight: bold;">[aam]</span>
52
  <span style="color:#00b418">#Define default access to admin menu items if it was not configured.</span>
53
  <span style="color:#00b418">#By default it is set to</span> <span style="color:#d80800">"allow"</span>.
78
  <span style="color:#00b418">#Each time you create new role with AAM, the ID is changed to something like aam_78koi9831933i.</span>
79
  <span style="color:#00b418">#Setting below suppresses this behavior and keep the name in lowercase format.</span>
80
  <span style="color:#0100b6;font-weight:700;">native_role_id</span> = <span style="color:#d80800">"true"</span>
81
+ <span style="color:#00b418">#Control access to Edit Permalink feature (Permalink block under the post or page title).</span>
82
+ <span style="color:#00b418">#If this feature is activated, make sure that you created the custom capability "Manage Permalink"</span>
83
+ <span style="color:#00b418">#By default this feature is deactivated.</span>
84
+ <span style="color:#0100b6;font-weight:700;">control_permalink</span> = <span style="color:#d80800">"false"</span>
85
 
86
  <span style="color:#05a;font-weight: bold;">[backend]</span>
87
  <span style="color:#00b418">#Defines redirect behavior when access is denied to any backend resource like menu</span>
98
  <span style="color:#0100b6;font-weight:700;">access.deny.redirect</span> = <span style="color:#d80800">"http://someurlhere.in"</span>
99
  <span style="color:#00b418">#Redefine default <b>Access Denied</b> message.</span>
100
  <span style="color:#0100b6;font-weight:700;">access.deny.message</span> = <span style="color:#d80800">"Oops. This is restricted area"</span>
101
+ </pre>
102
  </p>
103
  </div>
104
  </div>
136
  </h3>
137
  <div class="inside">
138
  <div class="large-icons-row">
 
 
 
139
  <a href="#" class="aam-icon aam-icon-large aam-icon-large-info" id="info_screen" >
140
  <span></span><?php echo __('Info', 'aam'); ?>
141
  </a>
application/view/tmpl/extension.phtml CHANGED
@@ -46,9 +46,9 @@
46
  <div class="extension-actions">
47
  <a href="http://wpaam.com/aam-extensions/aam-plus-package/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
48
  <?php if ($this->getRepository()->hasExtension('AAM Plus Package')) { ?>
49
- <a href="#" extension="AAM Plus Package" license="<?php echo $this->getRepository()->getExtension('AAM Plus Package')->license; ?>" class="extension-action extension-action-ok" aam-tooltip="Installed Successfully"></a>
50
  <?php } else { ?>
51
- <a href="#" extension="AAM Plus Package" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UEM8U65HFEG4Q" class="extension-action extension-action-purchase" aam-tooltip="Get it Today"></a>
52
  <?php } ?>
53
  </div>
54
  </td>
@@ -67,9 +67,9 @@
67
  <div class="extension-actions">
68
  <a href="http://wpaam.com/aam-extensions/aam-activities/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
69
  <?php if ($this->getRepository()->hasExtension('AAM Activities')) { ?>
70
- <a href="#" extension="AAM Activities" license="<?php echo $this->getRepository()->getExtension('AAM Activities')->license; ?>" class="extension-action extension-action-ok" aam-tooltip="Installed Successfully"></a>
71
  <?php } else { ?>
72
- <a href="#" extension="AAM Activities" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HME9DTSFSJH4W" class="extension-action extension-action-purchase" aam-tooltip="Get it Today"></a>
73
  <?php } ?>
74
  </div>
75
  </td>
@@ -88,9 +88,9 @@
88
  <div class="extension-actions">
89
  <a href="http://wpaam.com/aam-extensions/aam-media-manager/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
90
  <?php if ($this->getRepository()->hasExtension('AAM Media Manager')) { ?>
91
- <a href="#" extension="AAM Media Manager" license="<?php echo $this->getRepository()->getExtension('AAM Media Manager')->license; ?>" class="extension-action extension-action-ok" aam-tooltip="Installed Successfully"></a>
92
  <?php } else { ?>
93
- <a href="#" extension="AAM Media Manager" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WJ48A7Z6EFZJ4" class="extension-action extension-action-purchase" aam-tooltip="Get it Today"></a>
94
  <?php } ?>
95
  </div>
96
  </td>
@@ -104,15 +104,15 @@
104
  The content (or part of the content) can be filtered based on currently logged in user or visitor.
105
  Check our <a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank">website</a> for more information.
106
  </td>
107
- <td class="extension-price payed">$15.00</td>
108
  <td>
109
 
110
  <div class="extension-actions">
111
  <a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
112
  <?php if ($this->getRepository()->hasExtension('AAM Content Filter')) { ?>
113
- <a href="#" extension="AAM Content Filter" license="<?php echo $this->getRepository()->getExtension('AAM Content Filter')->license; ?>" class="extension-action extension-action-ok" aam-tooltip="Installed Successfully"></a>
114
  <?php } else { ?>
115
- <a href="#" extension="AAM Content Filter" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X7NZ7QF8A9CVS" class="extension-action extension-action-purchase" aam-tooltip="Get it Today"></a>
116
  <?php } ?>
117
  </div>
118
  </td>
@@ -130,28 +130,28 @@
130
  <div class="extension-actions">
131
  <a href="http://wpaam.com/aam-development/aam-plugin-manager/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
132
  <?php if ($this->getRepository()->hasExtension('AAM Plugin Manager')) { ?>
133
- <a href="#" extension="AAM Plugin Manager" license="<?php echo $this->getRepository()->getExtension('AAM Content Filter')->license; ?>" class="extension-action extension-action-ok" aam-tooltip="Installed Successfully"></a>
134
  <?php } else { ?>
135
- <a href="#" extension="AAM Plugin Manager" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QJ2H2J483VXPL" class="extension-action extension-action-purchase" aam-tooltip="Get it Today"></a>
136
  <?php } ?>
137
  </div>
138
  </td>
139
  </tr>
140
  </tbody>
141
  </table>
142
- <div id="install_extension" class="aam-dialog" title="<?php echo __('Install Extension', 'aam'); ?>">
143
  <p class="dialog-content">
144
- <?php echo __('If you already have license key for current extension, please enter it below. Othewise click <b>Purchase</b> button to checkout your order.', 'aam'); ?>
145
  <input type="text" class="license-input" id="license_key" placeholder="License Key" />
146
  </p>
147
- <ul class="extension-error-list"></ul>
148
  </div>
149
- <div id="update_extension" class="aam-dialog" title="<?php echo __('Update Extension', 'aam'); ?>">
150
  <p class="dialog-content" style="text-align: center;">
151
- <?php echo __('Extension has been installed. Your license key: ', 'aam'); ?><br/>
152
  <b><span id="installed_license_key"></span></b>
153
  </p>
154
- <ul class="extension-error-list"></ul>
155
  </div>
156
  </div>
157
  </div>
@@ -189,13 +189,13 @@
189
  </h3>
190
  <div class="inside">
191
  <div class="large-icons-row">
192
- <a href="https://twitter.com/wpaam" class="aam-icon aam-icon-large aam-icon-large-twitter" aam-tooltip="Follow @wpaam" target="_blank">
193
  <span></span><?php echo __('Follow Us', 'aam'); ?>
194
  </a>
195
- <a href="mailto:support@wpaam.com" class="aam-icon aam-icon-large aam-icon-large-message" aam-tooltip="Send Us Email">
196
  <span></span><?php echo __('Send Message', 'aam'); ?>
197
  </a>
198
- <a href="http://wpaam.com" class="aam-icon aam-icon-large aam-icon-large-link" aam-tooltip="Visit Us" target="_blank">
199
  <span></span><?php echo __('Website', 'aam'); ?>
200
  </a>
201
  </div>
@@ -211,14 +211,19 @@
211
  <div class="postbox">
212
  <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
213
  <h3 class="hndle">
214
- <span><?php echo __('Development License', 'aam'); ?></span>
215
  </h3>
216
  <div class="inside">
217
  <p>
218
- <?php echo __('Become a member of <b>AAM Community</b>. Obtain <b>Development License</b> today for $119 and get access to all extensions that are available today and will be developed witin a year.', 'aam'); ?>
219
  </p>
220
  <div style="text-align: center;">
221
- <a href="http://wpaam.com/aam-development/aam-development-license/" target="_blank" class="button button-primary button-large"><?php echo __('Read More', 'aam'); ?></a>
 
 
 
 
 
222
  </div>
223
  </div>
224
  </div>
46
  <div class="extension-actions">
47
  <a href="http://wpaam.com/aam-extensions/aam-plus-package/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
48
  <?php if ($this->getRepository()->hasExtension('AAM Plus Package')) { ?>
49
+ <a href="#" extension="AAM Plus Package" license="<?php echo $this->getRepository()->getLicense('AAM Plus Package'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
50
  <?php } else { ?>
51
+ <a href="#" extension="AAM Plus Package" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UEM8U65HFEG4Q" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
52
  <?php } ?>
53
  </div>
54
  </td>
67
  <div class="extension-actions">
68
  <a href="http://wpaam.com/aam-extensions/aam-activities/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
69
  <?php if ($this->getRepository()->hasExtension('AAM Activities')) { ?>
70
+ <a href="#" extension="AAM Activities" license="<?php echo $this->getRepository()->getLicense('AAM Activities'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
71
  <?php } else { ?>
72
+ <a href="#" extension="AAM Activities" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HME9DTSFSJH4W" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
73
  <?php } ?>
74
  </div>
75
  </td>
88
  <div class="extension-actions">
89
  <a href="http://wpaam.com/aam-extensions/aam-media-manager/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
90
  <?php if ($this->getRepository()->hasExtension('AAM Media Manager')) { ?>
91
+ <a href="#" extension="AAM Media Manager" license="<?php echo $this->getRepository()->getLicense('AAM Media Manager'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
92
  <?php } else { ?>
93
+ <a href="#" extension="AAM Media Manager" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WJ48A7Z6EFZJ4" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
94
  <?php } ?>
95
  </div>
96
  </td>
104
  The content (or part of the content) can be filtered based on currently logged in user or visitor.
105
  Check our <a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank">website</a> for more information.
106
  </td>
107
+ <td class="extension-price payed">$20.00</td>
108
  <td>
109
 
110
  <div class="extension-actions">
111
  <a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
112
  <?php if ($this->getRepository()->hasExtension('AAM Content Filter')) { ?>
113
+ <a href="#" extension="AAM Content Filter" license="<?php echo $this->getRepository()->getLicense('AAM Content Filter'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
114
  <?php } else { ?>
115
+ <a href="#" extension="AAM Content Filter" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X7NZ7QF8A9CVS" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
116
  <?php } ?>
117
  </div>
118
  </td>
130
  <div class="extension-actions">
131
  <a href="http://wpaam.com/aam-development/aam-plugin-manager/" target="_blank" class="extension-action extension-action-forum" aam-tooltip="Visit Our Website"></a>
132
  <?php if ($this->getRepository()->hasExtension('AAM Plugin Manager')) { ?>
133
+ <a href="#" extension="AAM Plugin Manager" license="<?php echo $this->getRepository()->getLicense('AAM Content Filter'); ?>" class="extension-action extension-action-ok view-license-btn" aam-tooltip="Installed Successfully"></a>
134
  <?php } else { ?>
135
+ <a href="#" extension="AAM Plugin Manager" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QJ2H2J483VXPL" class="extension-action extension-action-purchase add-license-btn" aam-tooltip="Get it Today"></a>
136
  <?php } ?>
137
  </div>
138
  </td>
139
  </tr>
140
  </tbody>
141
  </table>
142
+ <div id="install_license" class="aam-dialog" title="<?php echo __('Install License', 'aam'); ?>">
143
  <p class="dialog-content">
144
+ <?php echo __('If you already have license key, just enter it below. Othewise click <b>Purchase</b> button to checkout your order.', 'aam'); ?>
145
  <input type="text" class="license-input" id="license_key" placeholder="License Key" />
146
  </p>
147
+ <ul class="license-error-list"></ul>
148
  </div>
149
+ <div id="update_license" class="aam-dialog" title="<?php echo __('Update License', 'aam'); ?>">
150
  <p class="dialog-content" style="text-align: center;">
151
+ <?php echo __('Your license key: ', 'aam'); ?><br/>
152
  <b><span id="installed_license_key"></span></b>
153
  </p>
154
+ <ul class="license-error-list"></ul>
155
  </div>
156
  </div>
157
  </div>
189
  </h3>
190
  <div class="inside">
191
  <div class="large-icons-row">
192
+ <a href="https://twitter.com/vasyltech" class="aam-icon aam-icon-large aam-icon-large-twitter" aam-tooltip="Follow @wpaam" target="_blank">
193
  <span></span><?php echo __('Follow Us', 'aam'); ?>
194
  </a>
195
+ <a href="mailto:vasyl@vasyltech.com" class="aam-icon aam-icon-large aam-icon-large-message" aam-tooltip="Send Us Email">
196
  <span></span><?php echo __('Send Message', 'aam'); ?>
197
  </a>
198
+ <a href="http://vasyltech.com" class="aam-icon aam-icon-large aam-icon-large-link" aam-tooltip="Visit Us" target="_blank">
199
  <span></span><?php echo __('Website', 'aam'); ?>
200
  </a>
201
  </div>
211
  <div class="postbox">
212
  <div class="handlediv" title="<?php echo __('Click to toggle', 'aam'); ?>"></div>
213
  <h3 class="hndle">
214
+ <span style="color:#FF0000;"><?php echo __('Development License', 'aam'); ?></span>
215
  </h3>
216
  <div class="inside">
217
  <p>
218
+ <?php echo __('Get <b>Development License</b> for $119 and receive access to all extensions that are available today and will be developed within a year.', 'aam'); ?>
219
  </p>
220
  <div style="text-align: center;">
221
+ <?php if ($this->getRepository()->hasLicense('AAM Development License')) { ?>
222
+ <a href="#" extension="AAM Development License" license="<?php echo $this->getRepository()->getLicense('AAM Development License'); ?>" class="button button-primary button-large view-license-btn"><?php echo __('View License', 'aam'); ?></a>
223
+ <?php } else { ?>
224
+ <a href="#" extension="AAM Development License" link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3Q6UDARTR532U" class="button button-primary button-large add-license-btn"><?php echo __('Add License', 'aam'); ?></a>
225
+ <?php } ?>
226
+
227
  </div>
228
  </div>
229
  </div>
application/view/tmpl/help_developers.phtml DELETED
@@ -1,29 +0,0 @@
1
- <h2>AAM Development Framework</h2>
2
-
3
- <p>
4
- Are you passionate about WordPress development? We are too! Become a member of
5
- the AAM community and obtain our
6
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3Q6UDARTR532U" target="_blank">Exclusive Development License</a>
7
- where you can profit from your own ideas and have access to all AAM extensions.
8
- </p>
9
-
10
- <p>
11
- We receive regular requests and suggestions for new extensions and decided we would
12
- extend the opportunity to create and earn by opening our platform to you. We will
13
- host your extensions on our server so you may develop custom features for you and
14
- your customers. If you have a great idea and would like to create an extension for
15
- sales, we will review, approve and host it on AAM server.
16
- </p>
17
-
18
- <p>
19
- You can download the sample extension from our official
20
- <a href="https://github.com/wpaam/AAM-Feature-Example" target="_blank">GitHub Repository</a>
21
- and customize it to your special need.
22
- </p>
23
-
24
- <p>
25
- Additionally the
26
- <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3Q6UDARTR532U" target="_blank">AAM Development License</a>
27
- gives you an opportunity to download <b>ALL</b> AAM extensions that are available
28
- now and all new extensions that will be developed within a year from the time of purchase.
29
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
application/view/tmpl/help_extensions.phtml DELETED
@@ -1,16 +0,0 @@
1
- <h2>AAM Extensions</h2>
2
-
3
- <p>
4
- Advanced Access Manager is free platform and you can use most of the features without
5
- any limitations but in case you are looking for more, this is where AAM extensions
6
- might be useful for you to check. Complete list of available extensions you can find
7
- on AAM->Extensions page.
8
- </p>
9
- <p>
10
- We are using PayPal to process the payment and if it completed successfully, you will
11
- automatically receive an email with license key that you can use to activate the extension.
12
- </p>
13
- <p>
14
- In case of any issues with license key, we guaranty to resolve the issue within one business day.
15
- Otherwise your money back.
16
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
application/view/tmpl/help_faq.phtml DELETED
@@ -1,38 +0,0 @@
1
- <h2>Frequently Asked Questions</h2>
2
-
3
- <h4>What is Advanced Access Manager?</h4>
4
- <p>
5
- Advanced Access Manager (aka AAM) is free WordPress plugin that allows you to
6
- control access to your website. With AAM you can manager access to your Posts,
7
- Pages and Categories, filter unnecessary areas in your Backend, manager Users and
8
- Roles and many more.
9
- </p>
10
-
11
- <h4>What should I know to understand how AAM works?</h4>
12
- <p>
13
- Best way to learn more about AAM is to check our
14
- <a href="http://wpaam.com/tutorials/" target="_blank">collection of tutorials</a>.
15
- From here you'll get the basic understanding about most important aspects of AAM
16
- functionality. It is also very important to understand how WordPress
17
- <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">Roles & Capabilities</a>
18
- are organized.
19
- </p>
20
-
21
- <h4>I'm not able to manage Administrator Role. What am I missing?</h4>
22
- <p>
23
- In fact that AAM is very powerful tool, many unexperienced users were able to limit
24
- Administrator rights and loose access to Dashboard. That is why from AAM Release 2.5
25
- we introduced <a href="http://wpaam.com/tutorials/aam-super-admin/" target="_blank">AAM Super Admin</a>.
26
- You can make one user in your system as AAM Super Administrator that is able to manager other
27
- administrators.<br/>
28
- <span style="color:#FF0000; font-weight: bold;">Warning!</span> Do not limit capabilities for Administrator
29
- Role, because even if you are AAM Super Administrator, you still remain WordPress Administrator.
30
- </p>
31
-
32
- <h4>What is ConfigPress?</h4>
33
- <p>
34
- Think about ConfigPress as a settings page but instead of dozens of checkboxes, drop-downs and input fields
35
- you use configuration script based on <a href="http://en.wikipedia.org/wiki/INI_file" target="_blank">INI Standard</a>.
36
- The reason we use this format is that AAM is not only just a plugin but complex and very flexible development
37
- tool. That is why we came to conclusion to organize all settings in ConfigPress format.
38
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
application/view/tmpl/help_overview.phtml DELETED
@@ -1,48 +0,0 @@
1
- <h2>General Overview</h2>
2
- <p>
3
- Advanced Access Manager (aka AAM) is one of the most popular access control plugins. It is easy-to-use but
4
- at the same time very powerful tool that gives you a flexible control over your either
5
- single WordPress site or Multisite Network. With AAM you are allowed to configure access
6
- to different parts of your website for any <i>role</i> or individual <i>user</i>.
7
- </p>
8
- <p>
9
- Another great aspect of AAM is that our team constantly working on new features and improving
10
- existing. We are very dedicated to success of this project and our support is ready to help you
11
- within 48hours.
12
- </p>
13
- <p>
14
- Below you can find some of the major feature that are available in current AAM version:
15
- </p>
16
-
17
- <b>Control access to backend menu (including submenu).</b> As example you can restrict
18
- access for <i>role</i> Editor to Menu "Pages" or does not allow any <i>user</i> to
19
- manage Post's Categories.<br/>
20
- <br/>
21
- <b>Filter <i>widgets</i> & <i>metaboxes</i>.</b> Filter the list of metaboxes that any <i>role</i>
22
- or <i>user</i> can see during Post/Page editing. At the same time you can filter the
23
- list of Dashboard and Frontend widgets.<br/>
24
- <br/>
25
- <b>Control access to any <i>post</i>, <i>page</i>, <i>custom post type</i> or <i>category</i>.</b>
26
- You can restrict access to page or post for any <i>user</i> or <i>role</i> as well as
27
- restrict access to entire <i>category</i> and all posts inside it. You can also restrict
28
- commenting for pages or exclude any from the frontend menu. For more restrictions you can
29
- consider to get <a href="http://wpaam.com/aam-extensions/aam-plus-package/" target="_blank">AAM Plus Package</a>.<br/>
30
- <br/>
31
- <b>Filter Post or Page content.</b> You can filter Post's or Page's content for
32
- currently logged in user or visitor. This feature is available with extension
33
- <a href="http://wpaam.com/aam-extensions/aam-content-filter/" target="_blank">AAM Content Manager</a>.<br/>
34
- <br/>
35
- <b>Manage capabilities for any <i>role</i> or <i>user</i>.</b>
36
- AAM, with simple interface, allows you to grand or remove capabilities for any <i>role</i> or <i>user</i>.
37
- You can also create new custom capability or remove existing.<br/>
38
- <br/>
39
- <b>Create custom actions for system events.</b> As example your system can send email
40
- to you if some user published post or page, or modified content. You also can develop
41
- your own custom action for system event.<br/>
42
- <br/>
43
- <b>Track <i>user</i> activities.</b> With AAM you can track user activities within
44
- your website. So you can easily find out when user was logged in or modified any post
45
- or page. To extend the list of tracked activities, consider to get
46
- <a href="http://wpaam.com/aam-extensions/aam-activities/" target="_blank">AAM Activities</a>
47
- extension.
48
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
application/view/tmpl/manager.phtml CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * ======================================================================
5
  * LICENSE: This file is subject to the terms and conditions defined in *
@@ -8,6 +7,19 @@
8
  */
9
  ?>
10
  <div class="wrap" id="aam">
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  <form action="" method="post" id="aam_form">
12
  <?php do_action('aam_cmanager_hierarchy'); ?>
13
  <div class="postbox-container" style="width:70%;">
1
  <?php
 
2
  /**
3
  * ======================================================================
4
  * LICENSE: This file is subject to the terms and conditions defined in *
7
  */
8
  ?>
9
  <div class="wrap" id="aam">
10
+ <div class="aam-notification">
11
+ <div class="aam-logo"></div>
12
+ <div class="aam-notification-content">
13
+ <h1>Important Notification</h1>
14
+ <p>
15
+ Advanced Access Manager is changing the primary owner to <a href="http://vasyltech.com" target="_blank">VasylTech</a>.<br/>
16
+ Stay tuned to the AAM version 3 development progress on <a href="https://github.com/VasylTech/advanced-access-manager" target="_blank">GitHub repository</a> or on twitter <a href="https://twitter.com/vasyltech" target="_blank">@vasyltech</a>.
17
+ <br/>The estimated release is mid November 2015.
18
+ </p>
19
+ </div>
20
+ <a class="dashicons dashicons-dismiss" id="close-aam-notification" href="#"></a>
21
+ </div>
22
+
23
  <form action="" method="post" id="aam_form">
24
  <?php do_action('aam_cmanager_hierarchy'); ?>
25
  <div class="postbox-container" style="width:70%;">
config.php CHANGED
@@ -8,14 +8,17 @@
8
  */
9
 
10
  //AAM Version for Update purpose
11
- define('AAM_VERSION', '2.8');
12
 
13
  define('AAM_BASE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
14
 
15
  $base_url = WP_PLUGIN_URL . '/' . basename(AAM_BASE_DIR) . '/';
16
- if (force_ssl_admin() && (strpos($base_url, 'https') !== 0)) {
17
- $base_url = str_replace('http', 'https', $base_url);
 
 
18
  }
 
19
  define('AAM_BASE_URL', $base_url);
20
 
21
  define('AAM_TEMPLATE_DIR', AAM_BASE_DIR . 'view/html/');
8
  */
9
 
10
  //AAM Version for Update purpose
11
+ define('AAM_VERSION', '2.9.2');
12
 
13
  define('AAM_BASE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
14
 
15
  $base_url = WP_PLUGIN_URL . '/' . basename(AAM_BASE_DIR) . '/';
16
+ if (strpos($base_url, 'https') === 0) {
17
+ $base_url = str_replace('https:', '', $base_url);
18
+ } elseif (strpos($base_url, 'http') === 0) {
19
+ $base_url = str_replace('http:', '', $base_url);
20
  }
21
+
22
  define('AAM_BASE_URL', $base_url);
23
 
24
  define('AAM_TEMPLATE_DIR', AAM_BASE_DIR . 'view/html/');
extension/AAM_Activity_Log/extension.php CHANGED
@@ -79,11 +79,9 @@ class AAM_Extension_ActivityLog extends AAM_Core_Extension {
79
  }
80
 
81
  /**
82
- *
83
- * @param type $username
84
- * @param type $user
85
  */
86
- public function login($username, $user) {
87
  $this->getParent()->getUser()
88
  ->getObject(aam_Control_Object_Activity::UID)->add(
89
  time(),
79
  }
80
 
81
  /**
82
+ *
 
 
83
  */
84
+ public function login() {
85
  $this->getParent()->getUser()
86
  ->getObject(aam_Control_Object_Activity::UID)->add(
87
  time(),
extension/AAM_Secure/geoip/freegeoip.php CHANGED
@@ -12,17 +12,18 @@ class FreeGeoIP extends GeoIP {
12
 
13
  public static function query($ip) {
14
  $response = aam_Core_API::cURL('http://freegeoip.net/xml/' . $ip, false, true);
 
15
  if ($response['status'] == 'success') {
16
- $data = simplexml_load_string($response['content']);
17
- $geodata = (object) array(
18
- 'countryCode' => (string) $data->CountryCode,
19
- 'countryName' => (string) $data->CountryName,
20
- 'region' => (string) $data->RegionCode,
21
- 'city' => (string) $data->City,
22
- 'zip' => (string) $data->ZipCode
23
- );
24
- } else {
25
- $geodata = null;
26
  }
27
 
28
  return $geodata;
12
 
13
  public static function query($ip) {
14
  $response = aam_Core_API::cURL('http://freegeoip.net/xml/' . $ip, false, true);
15
+ $geodata = null;
16
  if ($response['status'] == 'success') {
17
+ $data = @simplexml_load_string($response['content']);
18
+ if ($data) {
19
+ $geodata = (object) array(
20
+ 'countryCode' => (string) $data->CountryCode,
21
+ 'countryName' => (string) $data->CountryName,
22
+ 'region' => (string) $data->RegionCode,
23
+ 'city' => (string) $data->City,
24
+ 'zip' => (string) $data->ZipCode
25
+ );
26
+ }
27
  }
28
 
29
  return $geodata;
library/Zend/Config.php DELETED
@@ -1,485 +0,0 @@
1
- <?php
2
- /**
3
- * Zend Framework
4
- *
5
- * LICENSE
6
- *
7
- * This source file is subject to the new BSD license that is bundled
8
- * with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://framework.zend.com/license/new-bsd
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@zend.com so we can send you a copy immediately.
14
- *
15
- * @category Zend
16
- * @package Zend_Config
17
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
- * @license http://framework.zend.com/license/new-bsd New BSD License
19
- * @version $Id: Config.php 23775 2011-03-01 17:25:24Z ralph $
20
- */
21
-
22
- /**
23
- * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
- * project needs.
25
- */
26
-
27
- /**
28
- * @category Zend
29
- * @package Zend_Config
30
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
31
- * @license http://framework.zend.com/license/new-bsd New BSD License
32
- */
33
- class Zend_Config implements Countable, Iterator
34
- {
35
- /**
36
- * Whether in-memory modifications to configuration data are allowed
37
- *
38
- * @var boolean
39
- */
40
- protected $_allowModifications;
41
-
42
- /**
43
- * Iteration index
44
- *
45
- * @var integer
46
- */
47
- protected $_index;
48
-
49
- /**
50
- * Number of elements in configuration data
51
- *
52
- * @var integer
53
- */
54
- protected $_count;
55
-
56
- /**
57
- * Contains array of configuration data
58
- *
59
- * @var array
60
- */
61
- protected $_data;
62
-
63
- /**
64
- * Used when unsetting values during iteration to ensure we do not skip
65
- * the next element
66
- *
67
- * @var boolean
68
- */
69
- protected $_skipNextIteration;
70
-
71
- /**
72
- * Contains which config file sections were loaded. This is null
73
- * if all sections were loaded, a string name if one section is loaded
74
- * and an array of string names if multiple sections were loaded.
75
- *
76
- * @var mixed
77
- */
78
- protected $_loadedSection;
79
-
80
- /**
81
- * This is used to track section inheritance. The keys are names of sections that
82
- * extend other sections, and the values are the extended sections.
83
- *
84
- * @var array
85
- */
86
- protected $_extends = array();
87
-
88
- /**
89
- * Load file error string.
90
- *
91
- * Is null if there was no error while file loading
92
- *
93
- * @var string
94
- */
95
- protected $_loadFileErrorStr = null;
96
-
97
- /**
98
- * Zend_Config provides a property based interface to
99
- * an array. The data are read-only unless $allowModifications
100
- * is set to true on construction.
101
- *
102
- * Zend_Config also implements Countable and Iterator to
103
- * facilitate easy access to the data.
104
- *
105
- * @param array $array
106
- * @param boolean $allowModifications
107
- * @return void
108
- */
109
- public function __construct(array $array, $allowModifications = false)
110
- {
111
- $this->_allowModifications = (boolean) $allowModifications;
112
- $this->_loadedSection = null;
113
- $this->_index = 0;
114
- $this->_data = array();
115
- foreach ($array as $key => $value) {
116
- if (is_array($value)) {
117
- $this->_data[$key] = new self($value, $this->_allowModifications);
118
- } else {
119
- $this->_data[$key] = $value;
120
- }
121
- }
122
- $this->_count = count($this->_data);
123
- }
124
-
125
- /**
126
- * Retrieve a value and return $default if there is no element set.
127
- *
128
- * @param string $name
129
- * @param mixed $default
130
- * @return mixed
131
- */
132
- public function get($name, $default = null)
133
- {
134
- $result = $default;
135
- if (array_key_exists($name, $this->_data)) {
136
- $result = $this->_data[$name];
137
- }
138
- return $result;
139
- }
140
-
141
- /**
142
- * Magic function so that $obj->value will work.
143
- *
144
- * @param string $name
145
- * @return mixed
146
- */
147
- public function __get($name)
148
- {
149
- return $this->get($name);
150
- }
151
-
152
- /**
153
- * Only allow setting of a property if $allowModifications
154
- * was set to true on construction. Otherwise, throw an exception.
155
- *
156
- * @param string $name
157
- * @param mixed $value
158
- * @throws Zend_Config_Exception
159
- * @return void
160
- */
161
- public function __set($name, $value)
162
- {
163
- if ($this->_allowModifications) {
164
- if (is_array($value)) {
165
- $this->_data[$name] = new self($value, true);
166
- } else {
167
- $this->_data[$name] = $value;
168
- }
169
- $this->_count = count($this->_data);
170
- } else {
171
- /** @see Zend_Config_Exception */
172
- throw new Zend_Config_Exception('Zend_Config is read only');
173
- }
174
- }
175
-
176
- /**
177
- * Deep clone of this instance to ensure that nested Zend_Configs
178
- * are also cloned.
179
- *
180
- * @return void
181
- */
182
- public function __clone()
183
- {
184
- $array = array();
185
- foreach ($this->_data as $key => $value) {
186
- if ($value instanceof Zend_Config) {
187
- $array[$key] = clone $value;
188
- } else {
189
- $array[$key] = $value;
190
- }
191
- }
192
- $this->_data = $array;
193
- }
194
-
195
- /**
196
- * Return an associative array of the stored data.
197
- *
198
- * @return array
199
- */
200
- public function toArray()
201
- {
202
- $array = array();
203
- $data = $this->_data;
204
- foreach ($data as $key => $value) {
205
- if ($value instanceof Zend_Config) {
206
- $array[$key] = $value->toArray();
207
- } else {
208
- $array[$key] = $value;
209
- }
210
- }
211
- return $array;
212
- }
213
-
214
- /**
215
- * Support isset() overloading on PHP 5.1
216
- *
217
- * @param string $name
218
- * @return boolean
219
- */
220
- public function __isset($name)
221
- {
222
- return isset($this->_data[$name]);
223
- }
224
-
225
- /**
226
- * Support unset() overloading on PHP 5.1
227
- *
228
- * @param string $name
229
- * @throws Zend_Config_Exception
230
- * @return void
231
- */
232
- public function __unset($name)
233
- {
234
- if ($this->_allowModifications) {
235
- unset($this->_data[$name]);
236
- $this->_count = count($this->_data);
237
- $this->_skipNextIteration = true;
238
- } else {
239
- /** @see Zend_Config_Exception */
240
- throw new Zend_Config_Exception('Zend_Config is read only');
241
- }
242
-
243
- }
244
-
245
- /**
246
- * Defined by Countable interface
247
- *
248
- * @return int
249
- */
250
- public function count()
251
- {
252
- return $this->_count;
253
- }
254
-
255
- /**
256
- * Defined by Iterator interface
257
- *
258
- * @return mixed
259
- */
260
- public function current()
261
- {
262
- $this->_skipNextIteration = false;
263
- return current($this->_data);
264
- }
265
-
266
- /**
267
- * Defined by Iterator interface
268
- *
269
- * @return mixed
270
- */
271
- public function key()
272
- {
273
- return key($this->_data);
274
- }
275
-
276
- /**
277
- * Defined by Iterator interface
278
- *
279
- */
280
- public function next()
281
- {
282
- if ($this->_skipNextIteration) {
283
- $this->_skipNextIteration = false;
284
- return;
285
- }
286
- next($this->_data);
287
- $this->_index++;
288
- }
289
-
290
- /**
291
- * Defined by Iterator interface
292
- *
293
- */
294
- public function rewind()
295
- {
296
- $this->_skipNextIteration = false;
297
- reset($this->_data);
298
- $this->_index = 0;
299
- }
300
-
301
- /**
302
- * Defined by Iterator interface
303
- *
304
- * @return boolean
305
- */
306
- public function valid()
307
- {
308
- return $this->_index < $this->_count;
309
- }
310
-
311
- /**
312
- * Returns the section name(s) loaded.
313
- *
314
- * @return mixed
315
- */
316
- public function getSectionName()
317
- {
318
- if(is_array($this->_loadedSection) && count($this->_loadedSection) == 1) {
319
- $this->_loadedSection = $this->_loadedSection[0];
320
- }
321
- return $this->_loadedSection;
322
- }
323
-
324
- /**
325
- * Returns true if all sections were loaded
326
- *
327
- * @return boolean
328
- */
329
- public function areAllSectionsLoaded()
330
- {
331
- return $this->_loadedSection === null;
332
- }
333
-
334
-
335
- /**
336
- * Merge another Zend_Config with this one. The items
337
- * in $merge will override the same named items in
338
- * the current config.
339
- *
340
- * @param Zend_Config $merge
341
- * @return Zend_Config
342
- */
343
- public function merge(Zend_Config $merge)
344
- {
345
- foreach($merge as $key => $item) {
346
- if(array_key_exists($key, $this->_data)) {
347
- if($item instanceof Zend_Config && $this->$key instanceof Zend_Config) {
348
- $this->$key = $this->$key->merge(new Zend_Config($item->toArray(), !$this->readOnly()));
349
- } else {
350
- $this->$key = $item;
351
- }
352
- } else {
353
- if($item instanceof Zend_Config) {
354
- $this->$key = new Zend_Config($item->toArray(), !$this->readOnly());
355
- } else {
356
- $this->$key = $item;
357
- }
358
- }
359
- }
360
-
361
- return $this;
362
- }
363
-
364
- /**
365
- * Prevent any more modifications being made to this instance. Useful
366
- * after merge() has been used to merge multiple Zend_Config objects
367
- * into one object which should then not be modified again.
368
- *
369
- */
370
- public function setReadOnly()
371
- {
372
- $this->_allowModifications = false;
373
- foreach ($this->_data as $key => $value) {
374
- if ($value instanceof Zend_Config) {
375
- $value->setReadOnly();
376
- }
377
- }
378
- }
379
-
380
- /**
381
- * Returns if this Zend_Config object is read only or not.
382
- *
383
- * @return boolean
384
- */
385
- public function readOnly()
386
- {
387
- return !$this->_allowModifications;
388
- }
389
-
390
- /**
391
- * Get the current extends
392
- *
393
- * @return array
394
- */
395
- public function getExtends()
396
- {
397
- return $this->_extends;
398
- }
399
-
400
- /**
401
- * Set an extend for Zend_Config_Writer
402
- *
403
- * @param string $extendingSection
404
- * @param string $extendedSection
405
- * @return void
406
- */
407
- public function setExtend($extendingSection, $extendedSection = null)
408
- {
409
- if ($extendedSection === null && isset($this->_extends[$extendingSection])) {
410
- unset($this->_extends[$extendingSection]);
411
- } else if ($extendedSection !== null) {
412
- $this->_extends[$extendingSection] = $extendedSection;
413
- }
414
- }
415
-
416
- /**
417
- * Throws an exception if $extendingSection may not extend $extendedSection,
418
- * and tracks the section extension if it is valid.
419
- *
420
- * @param string $extendingSection
421
- * @param string $extendedSection
422
- * @throws Zend_Config_Exception
423
- * @return void
424
- */
425
- protected function _assertValidExtend($extendingSection, $extendedSection)
426
- {
427
- // detect circular section inheritance
428
- $extendedSectionCurrent = $extendedSection;
429
- while (array_key_exists($extendedSectionCurrent, $this->_extends)) {
430
- if ($this->_extends[$extendedSectionCurrent] == $extendingSection) {
431
- /** @see Zend_Config_Exception */
432
- throw new Zend_Config_Exception('Illegal circular inheritance detected');
433
- }
434
- $extendedSectionCurrent = $this->_extends[$extendedSectionCurrent];
435
- }
436
- // remember that this section extends another section
437
- $this->_extends[$extendingSection] = $extendedSection;
438
- }
439
-
440
- /**
441
- * Handle any errors from simplexml_load_file or parse_ini_file
442
- *
443
- * @param integer $errno
444
- * @param string $errstr
445
- * @param string $errfile
446
- * @param integer $errline
447
- */
448
- protected function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
449
- {
450
- if ($this->_loadFileErrorStr === null) {
451
- $this->_loadFileErrorStr = $errstr;
452
- } else {
453
- $this->_loadFileErrorStr .= (PHP_EOL . $errstr);
454
- }
455
- }
456
-
457
- /**
458
- * Merge two arrays recursively, overwriting keys of the same name
459
- * in $firstArray with the value in $secondArray.
460
- *
461
- * @param mixed $firstArray First array
462
- * @param mixed $secondArray Second array to merge into first array
463
- * @return array
464
- */
465
- protected function _arrayMergeRecursive($firstArray, $secondArray)
466
- {
467
- if (is_array($firstArray) && is_array($secondArray)) {
468
- foreach ($secondArray as $key => $value) {
469
- if (isset($firstArray[$key])) {
470
- $firstArray[$key] = $this->_arrayMergeRecursive($firstArray[$key], $value);
471
- } else {
472
- if($key === 0) {
473
- $firstArray= array(0=>$this->_arrayMergeRecursive($firstArray, $value));
474
- } else {
475
- $firstArray[$key] = $value;
476
- }
477
- }
478
- }
479
- } else {
480
- $firstArray = $secondArray;
481
- }
482
-
483
- return $firstArray;
484
- }
485
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
library/Zend/Config/Exception.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Zend Framework
4
- *
5
- * LICENSE
6
- *
7
- * This source file is subject to the new BSD license that is bundled
8
- * with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://framework.zend.com/license/new-bsd
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@zend.com so we can send you a copy immediately.
14
- *
15
- * @category Zend
16
- * @package Zend_Config
17
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
- * @license http://framework.zend.com/license/new-bsd New BSD License
19
- * @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
20
- */
21
-
22
- /**
23
- * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
- * project needs.
25
- */
26
-
27
- /**
28
- * @category Zend
29
- * @package Zend_Config
30
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
31
- * @license http://framework.zend.com/license/new-bsd New BSD License
32
- */
33
- class Zend_Config_Exception extends Zend_Exception {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
library/Zend/Config/Ini.php DELETED
@@ -1,301 +0,0 @@
1
- <?php
2
- /**
3
- * Zend Framework
4
- *
5
- * LICENSE
6
- *
7
- * This source file is subject to the new BSD license that is bundled
8
- * with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://framework.zend.com/license/new-bsd
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@zend.com so we can send you a copy immediately.
14
- *
15
- * @category Zend
16
- * @package Zend_Config
17
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
- * @license http://framework.zend.com/license/new-bsd New BSD License
19
- * @version $Id: Ini.php 24045 2011-05-23 12:45:11Z rob $
20
- */
21
-
22
- /**
23
- * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
- * project needs.
25
- */
26
-
27
-
28
- /**
29
- * @category Zend
30
- * @package Zend_Config
31
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
32
- * @license http://framework.zend.com/license/new-bsd New BSD License
33
- */
34
- class Zend_Config_Ini extends Zend_Config
35
- {
36
- /**
37
- * String that separates nesting levels of configuration data identifiers
38
- *
39
- * @var string
40
- */
41
- protected $_nestSeparator = '.';
42
-
43
- /**
44
- * String that separates the parent section name
45
- *
46
- * @var string
47
- */
48
- protected $_sectionSeparator = ':';
49
-
50
- /**
51
- * Whether to skip extends or not
52
- *
53
- * @var boolean
54
- */
55
- protected $_skipExtends = false;
56
-
57
- /**
58
- * Loads the section $section from the config file $filename for
59
- * access facilitated by nested object properties.
60
- *
61
- * If the section name contains a ":" then the section name to the right
62
- * is loaded and included into the properties. Note that the keys in
63
- * this $section will override any keys of the same
64
- * name in the sections that have been included via ":".
65
- *
66
- * If the $section is null, then all sections in the ini file are loaded.
67
- *
68
- * If any key includes a ".", then this will act as a separator to
69
- * create a sub-property.
70
- *
71
- * example ini file:
72
- * [all]
73
- * db.connection = database
74
- * hostname = live
75
- *
76
- * [staging : all]
77
- * hostname = staging
78
- *
79
- * after calling $data = new Zend_Config_Ini($file, 'staging'); then
80
- * $data->hostname === "staging"
81
- * $data->db->connection === "database"
82
- *
83
- * The $options parameter may be provided as either a boolean or an array.
84
- * If provided as a boolean, this sets the $allowModifications option of
85
- * Zend_Config. If provided as an array, there are three configuration
86
- * directives that may be set. For example:
87
- *
88
- * $options = array(
89
- * 'allowModifications' => false,
90
- * 'nestSeparator' => ':',
91
- * 'skipExtends' => false,
92
- * );
93
- *
94
- * @param string $filename
95
- * @param mixed $section
96
- * @param boolean|array $options
97
- * @throws Zend_Config_Exception
98
- * @return void
99
- */
100
- public function __construct($filename, $section = null, $options = false)
101
- {
102
- if (empty($filename)) {
103
- /**
104
- * @see Zend_Config_Exception
105
- */
106
- throw new Zend_Config_Exception('Filename is not set');
107
- }
108
-
109
- $allowModifications = false;
110
- if (is_bool($options)) {
111
- $allowModifications = $options;
112
- } elseif (is_array($options)) {
113
- if (isset($options['allowModifications'])) {
114
- $allowModifications = (bool) $options['allowModifications'];
115
- }
116
- if (isset($options['nestSeparator'])) {
117
- $this->_nestSeparator = (string) $options['nestSeparator'];
118
- }
119
- if (isset($options['skipExtends'])) {
120
- $this->_skipExtends = (bool) $options['skipExtends'];
121
- }
122
- }
123
-
124
- $iniArray = $this->_loadIniFile($filename);
125
-
126
- if (null === $section) {
127
- // Load entire file
128
- $dataArray = array();
129
- foreach ($iniArray as $sectionName => $sectionData) {
130
- if(!is_array($sectionData)) {
131
- $dataArray = $this->_arrayMergeRecursive($dataArray, $this->_processKey(array(), $sectionName, $sectionData));
132
- } else {
133
- $dataArray[$sectionName] = $this->_processSection($iniArray, $sectionName);
134
- }
135
- }
136
- parent::__construct($dataArray, $allowModifications);
137
- } else {
138
- // Load one or more sections
139
- if (!is_array($section)) {
140
- $section = array($section);
141
- }
142
- $dataArray = array();
143
- foreach ($section as $sectionName) {
144
- if (!isset($iniArray[$sectionName])) {
145
- /**
146
- * @see Zend_Config_Exception
147
- */
148
- throw new Zend_Config_Exception("Section '$sectionName' cannot be found in $filename");
149
- }
150
- $dataArray = $this->_arrayMergeRecursive($this->_processSection($iniArray, $sectionName), $dataArray);
151
-
152
- }
153
- parent::__construct($dataArray, $allowModifications);
154
- }
155
-
156
- $this->_loadedSection = $section;
157
- }
158
-
159
- /**
160
- * Load the INI file from disk using parse_ini_file(). Use a private error
161
- * handler to convert any loading errors into a Zend_Config_Exception
162
- *
163
- * @param string $filename
164
- * @throws Zend_Config_Exception
165
- * @return array
166
- */
167
- protected function _parseIniFile($filename)
168
- {
169
- set_error_handler(array($this, '_loadFileErrorHandler'));
170
- $iniArray = parse_ini_file($filename, true); // Warnings and errors are suppressed
171
- restore_error_handler();
172
-
173
- // Check if there was a error while loading file
174
- if ($this->_loadFileErrorStr !== null) {
175
- /**
176
- * @see Zend_Config_Exception
177
- */
178
- throw new Zend_Config_Exception($this->_loadFileErrorStr);
179
- }
180
-
181
- return $iniArray;
182
- }
183
-
184
- /**
185
- * Load the ini file and preprocess the section separator (':' in the
186
- * section name (that is used for section extension) so that the resultant
187
- * array has the correct section names and the extension information is
188
- * stored in a sub-key called ';extends'. We use ';extends' as this can
189
- * never be a valid key name in an INI file that has been loaded using
190
- * parse_ini_file().
191
- *
192
- * @param string $filename
193
- * @throws Zend_Config_Exception
194
- * @return array
195
- */
196
- protected function _loadIniFile($filename)
197
- {
198
- $loaded = $this->_parseIniFile($filename);
199
- $iniArray = array();
200
- foreach ($loaded as $key => $data)
201
- {
202
- $pieces = explode($this->_sectionSeparator, $key);
203
- $thisSection = trim($pieces[0]);
204
- switch (count($pieces)) {
205
- case 1:
206
- $iniArray[$thisSection] = $data;
207
- break;
208
-
209
- case 2:
210
- $extendedSection = trim($pieces[1]);
211
- $iniArray[$thisSection] = array_merge(array(';extends'=>$extendedSection), $data);
212
- break;
213
-
214
- default:
215
- /**
216
- * @see Zend_Config_Exception
217
- */
218
- throw new Zend_Config_Exception("Section '$thisSection' may not extend multiple sections in $filename");
219
- }
220
- }
221
-
222
- return $iniArray;
223
- }
224
-
225
- /**
226
- * Process each element in the section and handle the ";extends" inheritance
227
- * key. Passes control to _processKey() to handle the nest separator
228
- * sub-property syntax that may be used within the key name.
229
- *
230
- * @param array $iniArray
231
- * @param string $section
232
- * @param array $config
233
- * @throws Zend_Config_Exception
234
- * @return array
235
- */
236
- protected function _processSection($iniArray, $section, $config = array())
237
- {
238
- $thisSection = $iniArray[$section];
239
-
240
- foreach ($thisSection as $key => $value) {
241
- if (strtolower($key) == ';extends') {
242
- if (isset($iniArray[$value])) {
243
- $this->_assertValidExtend($section, $value);
244
-
245
- if (!$this->_skipExtends) {
246
- $config = $this->_processSection($iniArray, $value, $config);
247
- }
248
- } else {
249
- /**
250
- * @see Zend_Config_Exception
251
- */
252
- throw new Zend_Config_Exception("Parent section '$section' cannot be found");
253
- }
254
- } else {
255
- $config = $this->_processKey($config, $key, $value);
256
- }
257
- }
258
- return $config;
259
- }
260
-
261
- /**
262
- * Assign the key's value to the property list. Handles the
263
- * nest separator for sub-properties.
264
- *
265
- * @param array $config
266
- * @param string $key
267
- * @param string $value
268
- * @throws Zend_Config_Exception
269
- * @return array
270
- */
271
- protected function _processKey($config, $key, $value)
272
- {
273
- if (strpos($key, $this->_nestSeparator) !== false) {
274
- $pieces = explode($this->_nestSeparator, $key, 2);
275
- if (strlen($pieces[0]) && strlen($pieces[1])) {
276
- if (!isset($config[$pieces[0]])) {
277
- if ($pieces[0] === '0' && !empty($config)) {
278
- // convert the current values in $config into an array
279
- $config = array($pieces[0] => $config);
280
- } else {
281
- $config[$pieces[0]] = array();
282
- }
283
- } elseif (!is_array($config[$pieces[0]])) {
284
- /**
285
- * @see Zend_Config_Exception
286
- */
287
- throw new Zend_Config_Exception("Cannot create sub-key for '{$pieces[0]}' as key already exists");
288
- }
289
- $config[$pieces[0]] = $this->_processKey($config[$pieces[0]], $pieces[1], $value);
290
- } else {
291
- /**
292
- * @see Zend_Config_Exception
293
- */
294
- throw new Zend_Config_Exception("Invalid key '$key'");
295
- }
296
- } else {
297
- $config[$key] = $value;
298
- }
299
- return $config;
300
- }
301
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
library/Zend/Exception.php DELETED
@@ -1,101 +0,0 @@
1
- <?php
2
- /**
3
- * Zend Framework
4
- *
5
- * LICENSE
6
- *
7
- * This source file is subject to the new BSD license that is bundled
8
- * with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://framework.zend.com/license/new-bsd
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@zend.com so we can send you a copy immediately.
14
- *
15
- * @category Zend
16
- * @package Zend
17
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18
- * @license http://framework.zend.com/license/new-bsd New BSD License
19
- * @version $Id: Exception.php 23775 2011-03-01 17:25:24Z ralph $
20
- */
21
-
22
- /**
23
- * File has been modified by Vasyl Martyniuk <martyniuk.vasyl@gmail.com> to fit the
24
- * project needs.
25
- */
26
-
27
- /**
28
- * @category Zend
29
- * @package Zend
30
- * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
31
- * @license http://framework.zend.com/license/new-bsd New BSD License
32
- */
33
- class Zend_Exception extends Exception
34
- {
35
- /**
36
- * @var null|Exception
37
- */
38
- private $_previous = null;
39
-
40
- /**
41
- * Construct the exception
42
- *
43
- * @param string $msg
44
- * @param int $code
45
- * @param Exception $previous
46
- * @return void
47
- */
48
- public function __construct($msg = '', $code = 0, Exception $previous = null)
49
- {
50
- if (version_compare(PHP_VERSION, '5.3.0', '<')) {
51
- parent::__construct($msg, (int) $code);
52
- $this->_previous = $previous;
53
- } else {
54
- parent::__construct($msg, (int) $code, $previous);
55
- }
56
- }
57
-
58
- /**
59
- * Overloading
60
- *
61
- * For PHP < 5.3.0, provides access to the getPrevious() method.
62
- *
63
- * @param string $method
64
- * @param array $args
65
- * @return mixed
66
- */
67
- public function __call($method, array $args)
68
- {
69
- if ('getprevious' == strtolower($method)) {
70
- return $this->_getPrevious();
71
- }
72
- return null;
73
- }
74
-
75
- /**
76
- * String representation of the exception
77
- *
78
- * @return string
79
- */
80
- public function __toString()
81
- {
82
- if (version_compare(PHP_VERSION, '5.3.0', '<')) {
83
- if (null !== ($e = $this->getPrevious())) {
84
- return $e->__toString()
85
- . "\n\nNext "
86
- . parent::__toString();
87
- }
88
- }
89
- return parent::__toString();
90
- }
91
-
92
- /**
93
- * Returns previous Exception
94
- *
95
- * @return Exception|null
96
- */
97
- protected function _getPrevious()
98
- {
99
- return $this->_previous;
100
- }
101
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media/css/aam.css CHANGED
@@ -853,4 +853,44 @@ a.aam-lock-big{
853
 
854
  .event-specifier{
855
  display:none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
856
  }
853
 
854
  .event-specifier{
855
  display:none;
856
+ }
857
+
858
+ .ui-accordion h4{
859
+ margin: 0;
860
+ }
861
+
862
+ .aam-logo {
863
+ float: left;
864
+ width: 128px;
865
+ height: 128px;
866
+ background: transparent url('images/logo.png') no-repeat center;
867
+ background-size: 100% 100%;
868
+ }
869
+
870
+ .aam-notification {
871
+ width: 95%;
872
+ border-left: 3px solid #F04748;
873
+ background-color: #FFFFFF;
874
+ padding: 10px;
875
+ position: relative;
876
+ }
877
+
878
+ .aam-notification-content {
879
+ float: left;
880
+ padding-left: 15px;
881
+ }
882
+
883
+ .aam-notification:after {
884
+ content: ' ';
885
+ display: block;
886
+ clear:both;
887
+ }
888
+
889
+ .aam-notification > .dashicons-dismiss {
890
+ color: #424242;
891
+ position: absolute;
892
+ right: 20px;
893
+ top: 50%;
894
+ width: 1em;
895
+ margin-top: -0.5em;
896
  }
media/css/codemirror.css DELETED
@@ -1,262 +0,0 @@
1
- /* BASICS */
2
-
3
- .CodeMirror {
4
- /* Set height, width, borders, and global font properties here */
5
- font-family: monospace;
6
- height: 300px;
7
- }
8
- .CodeMirror-scroll {
9
- /* Set scrolling behaviour here */
10
- overflow: auto;
11
- }
12
-
13
- /* PADDING */
14
-
15
- .CodeMirror-lines {
16
- padding: 4px 0; /* Vertical padding around content */
17
- }
18
- .CodeMirror pre {
19
- padding: 0 4px; /* Horizontal padding of content */
20
- }
21
-
22
- .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
23
- background-color: white; /* The little square between H and V scrollbars */
24
- }
25
-
26
- /* GUTTER */
27
-
28
- .CodeMirror-gutters {
29
- border-right: 1px solid #ddd;
30
- background-color: #f7f7f7;
31
- white-space: nowrap;
32
- }
33
- .CodeMirror-linenumbers {}
34
- .CodeMirror-linenumber {
35
- padding: 0 3px 0 5px;
36
- min-width: 20px;
37
- text-align: right;
38
- color: #999;
39
- }
40
-
41
- /* CURSOR */
42
-
43
- .CodeMirror div.CodeMirror-cursor {
44
- border-left: 1px solid black;
45
- z-index: 3;
46
- }
47
- /* Shown when moving in bi-directional text */
48
- .CodeMirror div.CodeMirror-secondarycursor {
49
- border-left: 1px solid silver;
50
- }
51
- .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
52
- width: auto;
53
- border: 0;
54
- background: #7e7;
55
- z-index: 1;
56
- }
57
- /* Can style cursor different in overwrite (non-insert) mode */
58
- .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
59
-
60
- .cm-tab { display: inline-block; }
61
-
62
- /* DEFAULT THEME */
63
-
64
- .cm-s-default .cm-keyword {color: #708;}
65
- .cm-s-default .cm-atom {color: #219;}
66
- .cm-s-default .cm-number {color: #164;}
67
- .cm-s-default .cm-def {color: #00f;}
68
- .cm-s-default .cm-variable {color: black;}
69
- .cm-s-default .cm-variable-2 {color: #05a;}
70
- .cm-s-default .cm-variable-3 {color: #085;}
71
- .cm-s-default .cm-property {color: black;}
72
- .cm-s-default .cm-operator {color: black;}
73
- .cm-s-default .cm-comment {color: #a50;}
74
- .cm-s-default .cm-string {color: #a11;}
75
- .cm-s-default .cm-string-2 {color: #f50;}
76
- .cm-s-default .cm-meta {color: #555;}
77
- .cm-s-default .cm-error {color: #f00;}
78
- .cm-s-default .cm-qualifier {color: #555;}
79
- .cm-s-default .cm-builtin {color: #30a;}
80
- .cm-s-default .cm-bracket {color: #997;}
81
- .cm-s-default .cm-tag {color: #170;}
82
- .cm-s-default .cm-attribute {color: #00c;}
83
- .cm-s-default .cm-header {color: blue;}
84
- .cm-s-default .cm-quote {color: #090;}
85
- .cm-s-default .cm-hr {color: #999;}
86
- .cm-s-default .cm-link {color: #00c;}
87
-
88
- .cm-negative {color: #d44;}
89
- .cm-positive {color: #292;}
90
- .cm-header, .cm-strong {font-weight: bold;}
91
- .cm-em {font-style: italic;}
92
- .cm-link {text-decoration: underline;}
93
-
94
- .cm-invalidchar {color: #f00;}
95
-
96
- div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
97
- div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
98
- .CodeMirror-activeline-background {background: #e8f2ff;}
99
-
100
- /* STOP */
101
-
102
- /* The rest of this file contains styles related to the mechanics of
103
- the editor. You probably shouldn't touch them. */
104
-
105
- .CodeMirror {
106
- line-height: 1;
107
- position: relative;
108
- overflow: hidden;
109
- background: #FFFFFF;
110
- color: black;
111
- border: 1px solid #CCCCCC;
112
- border-radius: 4px;
113
- padding: 1px;
114
- }
115
-
116
- .CodeMirror-scroll {
117
- /* 30px is the magic margin used to hide the element's real scrollbars */
118
- /* See overflow: hidden in .CodeMirror */
119
- background-color: #F9F9F9;
120
- font-size: 1.1em;
121
- height: 100%;
122
- outline: none; /* Prevent dragging from highlighting the element */
123
- position: relative;
124
- }
125
- .CodeMirror-sizer {
126
- position: relative;
127
- }
128
-
129
- /* The fake, visible scrollbars. Used to force redraw during scrolling
130
- before actuall scrolling happens, thus preventing shaking and
131
- flickering artifacts. */
132
- .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
133
- position: absolute;
134
- z-index: 6;
135
- display: none;
136
- }
137
- .CodeMirror-vscrollbar {
138
- right: 0; top: 0;
139
- overflow-x: hidden;
140
- overflow-y: scroll;
141
- }
142
- .CodeMirror-hscrollbar {
143
- bottom: 0; left: 0;
144
- overflow-y: hidden;
145
- overflow-x: scroll;
146
- }
147
- .CodeMirror-scrollbar-filler {
148
- right: 0; bottom: 0;
149
- }
150
- .CodeMirror-gutter-filler {
151
- left: 0; bottom: 0;
152
- }
153
-
154
- .CodeMirror-gutters {
155
- position: absolute; left: 0; top: 0;
156
- padding-bottom: 30px;
157
- z-index: 3;
158
- }
159
- .CodeMirror-gutter {
160
- white-space: normal;
161
- height: 100%;
162
- padding-bottom: 30px;
163
- margin-bottom: -32px;
164
- display: inline-block;
165
- /* Hack to make IE7 behave */
166
- *zoom:1;
167
- *display:inline;
168
- }
169
- .CodeMirror-gutter-elt {
170
- position: absolute;
171
- cursor: default;
172
- z-index: 4;
173
- }
174
-
175
- .CodeMirror-lines {
176
- cursor: text;
177
- }
178
- .CodeMirror pre {
179
- /* Reset some styles that the rest of the page might have set */
180
- -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
181
- border-width: 0;
182
- background: transparent;
183
- font-family: inherit;
184
- font-size: inherit;
185
- margin: 0;
186
- white-space: pre;
187
- word-wrap: normal;
188
- line-height: inherit;
189
- color: inherit;
190
- z-index: 2;
191
- position: relative;
192
- overflow: visible;
193
- }
194
- .CodeMirror-wrap pre {
195
- word-wrap: break-word;
196
- white-space: pre-wrap;
197
- word-break: normal;
198
- }
199
- .CodeMirror-code pre {
200
- border-right: 30px solid transparent;
201
- width: -webkit-fit-content;
202
- width: -moz-fit-content;
203
- width: fit-content;
204
- }
205
- .CodeMirror-wrap .CodeMirror-code pre {
206
- border-right: none;
207
- width: auto;
208
- }
209
- .CodeMirror-linebackground {
210
- position: absolute;
211
- left: 0; right: 0; top: 0; bottom: 0;
212
- z-index: 0;
213
- }
214
-
215
- .CodeMirror-linewidget {
216
- position: relative;
217
- z-index: 2;
218
- overflow: auto;
219
- }
220
-
221
- .CodeMirror-widget {
222
- }
223
-
224
- .CodeMirror-wrap .CodeMirror-scroll {
225
- overflow-x: hidden;
226
- }
227
-
228
- .CodeMirror-measure {
229
- position: absolute;
230
- width: 100%; height: 0px;
231
- overflow: hidden;
232
- visibility: hidden;
233
- }
234
- .CodeMirror-measure pre { position: static; }
235
-
236
- .CodeMirror div.CodeMirror-cursor {
237
- position: absolute;
238
- visibility: hidden;
239
- border-right: none;
240
- width: 0;
241
- }
242
- .CodeMirror-focused div.CodeMirror-cursor {
243
- visibility: visible;
244
- }
245
-
246
- .CodeMirror-selected { background: #d9d9d9; }
247
- .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
248
-
249
- .cm-searching {
250
- background: #ffa;
251
- background: rgba(255, 255, 0, .4);
252
- }
253
-
254
- /* IE7 hack to prevent it from returning funny offsetTops on the spans */
255
- .CodeMirror span { *vertical-align: text-bottom; }
256
-
257
- @media print {
258
- /* Hide the cursor when printing */
259
- .CodeMirror div.CodeMirror-cursor {
260
- visibility: hidden;
261
- }
262
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media/css/extension.css CHANGED
@@ -146,7 +146,7 @@ input.license-input{
146
  opacity: 0.8;
147
  }
148
 
149
- .extension-error-list{
150
  margin-top: 5px;
151
  display: none;
152
  font-size: 0.8em;
146
  opacity: 0.8;
147
  }
148
 
149
+ .license-error-list{
150
  margin-top: 5px;
151
  display: none;
152
  font-size: 0.8em;
media/css/images/logo.png ADDED
Binary file
media/js/aam.js CHANGED
@@ -163,37 +163,11 @@ AAM.prototype.initUI = function() {
163
  //Retrieve settings for default segment
164
  this.retrieveSettings();
165
 
166
- //init contextual menu if necessary
167
- this.initContextualMenu();
168
- };
169
-
170
- /**
171
- * Initial Contextual Menu
172
- *
173
- * @returns void
174
- *
175
- * @access public
176
- */
177
- AAM.prototype.initContextualMenu = function(){
178
- var _this = this;
179
- if (parseInt(aamLocal.contextualMenu) !== 1){
180
- jQuery('#contextual-help-link-wrap').pointer({
181
- pointerClass : 'aam-help-pointer',
182
- pointerWidth : 300,
183
- content: aamLocal.labels['AAM Documentation'],
184
- position: {
185
- edge : 'top',
186
- align : 'right'
187
- },
188
- close: function() {
189
- jQuery.ajax(aamLocal.ajaxurl, {
190
- type: 'POST',
191
- dataType: 'json',
192
- data: _this.compileAjaxPackage('discardHelp', false)
193
- });
194
- }
195
- }).pointer('open');
196
- }
197
  };
198
 
199
  /**
163
  //Retrieve settings for default segment
164
  this.retrieveSettings();
165
 
166
+ //notification message
167
+ jQuery('#close-aam-notification').bind('click', function (event) {
168
+ event.preventDefault();
169
+ jQuery('.aam-notification').remove();
170
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  };
172
 
173
  /**
media/js/codemirror.js DELETED
@@ -1 +0,0 @@
1
- window.CodeMirror=function(){function m(a,b){if(!(this instanceof m))return new m(a,b);this.options=b=b||{};for(var c in Rb)!b.hasOwnProperty(c)&&Rb.hasOwnProperty(c)&&(b[c]=Rb[c]);Sb(b);c=this.display=Td(a,"string"==typeof b.value?0:b.value.first);c.wrapper.CodeMirror=this;Nc(this);b.autofocus&&!Tb&&N(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Ub};Oc(this);b.lineWrapping&&(this.display.wrapper.className+= " CodeMirror-wrap");var d=b.value;"string"==typeof d&&(d=new I(b.value,b.mode));t(this,Pc)(this,d);B&&setTimeout(O(Y,this,!0),20);Ud(this);var e;try{e=document.activeElement==c.input}catch(f){}e||b.autofocus&&!Tb?setTimeout(O(ha,this),20):Vb(this);t(this,function(){for(var a in pa)if(pa.propertyIsEnumerable(a))pa[a](this,b[a],Qc);for(a=0;a<Wb.length;++a)Wb[a](this)})()}function Td(a,b){var c={},d=c.input=p("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;"); K?d.style.width="1000px":d.setAttribute("wrap","off");Ia&&(d.style.border="1px solid black");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");c.inputDiv=p("div",[d],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");c.scrollbarH=p("div",[p("div",null,null,"height: 1px")],"CodeMirror-hscrollbar");c.scrollbarV=p("div",[p("div",null,null,"width: 1px")],"CodeMirror-vscrollbar");c.scrollbarFiller=p("div",null,"CodeMirror-scrollbar-filler"); c.gutterFiller=p("div",null,"CodeMirror-gutter-filler");c.lineDiv=p("div",null,"CodeMirror-code");c.selectionDiv=p("div",null,null,"position: relative; z-index: 1");c.cursor=p("div","\u00a0","CodeMirror-cursor");c.otherCursor=p("div","\u00a0","CodeMirror-cursor CodeMirror-secondarycursor");c.measure=p("div",null,"CodeMirror-measure");c.lineSpace=p("div",[c.measure,c.selectionDiv,c.lineDiv,c.cursor,c.otherCursor],null,"position: relative; outline: none");c.mover=p("div",[p("div",[c.lineSpace],"CodeMirror-lines")], null,"position: relative");c.sizer=p("div",[c.mover],"CodeMirror-sizer");c.heightForcer=p("div",null,null,"position: absolute; height: "+qa+"px; width: 1px;");c.gutters=p("div",null,"CodeMirror-gutters");c.lineGutter=null;c.scroller=p("div",[c.sizer,c.heightForcer,c.gutters],"CodeMirror-scroll");c.scroller.setAttribute("tabIndex","-1");c.wrapper=p("div",[c.inputDiv,c.scrollbarH,c.scrollbarV,c.scrollbarFiller,c.gutterFiller,c.scroller],"CodeMirror");ra&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight= 0);a.appendChild?a.appendChild(c.wrapper):a(c.wrapper);Ia&&(d.style.width="0px");K||(c.scroller.draggable=!0);Xb?(c.inputDiv.style.height="1px",c.inputDiv.style.position="absolute"):ra&&(c.scrollbarH.style.minWidth=c.scrollbarV.style.minWidth="18px");c.viewOffset=c.lastSizeC=0;c.showingFrom=c.showingTo=b;c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null;c.prevInput="";c.alignWidgets=!1;c.pollingFast=!1;c.poll=new Ub;c.cachedCharWidth=c.cachedTextHeight=null;c.measureLineCache=[];c.measureLineCachePos= 0;c.inaccurateSelection=!1;c.maxLine=null;c.maxLineLength=0;c.maxLineChanged=!1;c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null;return c}function Ja(a){a.doc.mode=m.getMode(a.options,a.doc.modeOption);a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;Ka(a,100);a.state.modeGen++;a.curOp&&D(a)}function Rc(a){var b=sa(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/Sc(a.display)-3);return function(e){return ia(a.doc, e)?0:c?(Math.ceil(e.text.length/d)||1)*b:b}}function Tc(a){var b=a.doc,c=Rc(a);b.iter(function(a){var b=c(a);b!=a.height&&R(a,b)})}function Uc(a){var b=Z[a.options.keyMap],c=b.style;a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(c?" cm-keymap-"+c:"");a.state.disableInput=b.disableInput}function Oc(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-");ta(a)}function La(a){Nc(a); D(a);setTimeout(function(){Yb(a)},20)}function Nc(a){var b=a.display.gutters,c=a.options.gutters;Ma(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(p("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none"}function mb(a,b){if(0==b.height)return 0;for(var c=b.text.length,d,e=b;d=ua(e,-1);)d=d.find(),e=u(a,d.from.line),c+=d.from.ch-d.to.ch;for(e=b;d=nb(e);)d=d.find(),c-=e.text.length- d.from.ch,e=u(a,d.to.line),c+=e.text.length-d.to.ch;return c}function Zb(a){var b=a.display,c=a.doc;b.maxLine=u(c,c.first);b.maxLineLength=mb(c,b.maxLine);b.maxLineChanged=!0;c.iter(function(a){var e=mb(c,a);e>b.maxLineLength&&(b.maxLineLength=e,b.maxLine=a)})}function Sb(a){for(var b=!1,c=0;c<a.gutters.length;++c)"CodeMirror-linenumbers"==a.gutters[c]&&(a.lineNumbers?b=!0:a.gutters.splice(c--,1));!b&&a.lineNumbers&&a.gutters.push("CodeMirror-linenumbers")}function $b(a){var b=a.display,c=a.doc.height+ (b.mover.offsetHeight-b.lineSpace.offsetHeight);b.sizer.style.minHeight=b.heightForcer.style.top=c+"px";b.gutters.style.height=Math.max(c,b.scroller.clientHeight-qa)+"px";var c=Math.max(c,b.scroller.scrollHeight),d=b.scroller.scrollWidth>b.scroller.clientWidth+1,e=c>b.scroller.clientHeight+1;e?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=d?Na(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=c-b.scroller.clientHeight+b.scrollbarV.clientHeight+"px"):(b.scrollbarV.style.display= "",b.scrollbarV.firstChild.style.height="0");d?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=e?Na(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):(b.scrollbarH.style.display="",b.scrollbarH.firstChild.style.width="0");d&&e?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=Na(b.measure)+"px"):b.scrollbarFiller.style.display="";d&&a.options.coverGutterNextToScrollbar&& a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=Na(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="";Vd&&0===Na(b.measure)&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=Wd?"18px":"12px")}function ac(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;"number"==typeof c?d=c:c&&(d=c.top,e=c.bottom-c.top);d=Math.floor(d-a.lineSpace.offsetTop);a=Math.ceil(d+e);return{from:Oa(b,d),to:Oa(b,a)}} function Yb(a){var b=a.display;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var c=bc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px",f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g<h.length;++g)h[g].style.left=e;a.options.fixedGutter&&(b.gutters.style.left=c+d+"px")}}function Xd(a){if(!a.options.lineNumbers)return!1;var b=a.doc,b=cc(a.options,b.first+b.size-1);a=a.display;if(b.length!=a.lineNumChars){var c=a.measure.appendChild(p("div", [p("div",b)],"CodeMirror-linenumber CodeMirror-gutter-elt")),d=c.firstChild.offsetWidth,c=c.offsetWidth-d;a.lineGutter.style.width="";a.lineNumInnerWidth=Math.max(d,a.lineGutter.offsetWidth-c);a.lineNumWidth=a.lineNumInnerWidth+c;a.lineNumChars=a.lineNumInnerWidth?b.length:-1;a.lineGutter.style.width=a.lineNumWidth+"px";return!0}return!1}function cc(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function bc(a){return y(a.scroller).left-y(a.sizer).left}function ob(a,b,c,d){for(var e= a.display.showingFrom,f=a.display.showingTo,g,h=ac(a.display,a.doc,c);Yd(a,b,h,d);){d=!1;g=!0;dc(a);$b(a);c&&(c=Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,"number"==typeof c?c:c.top));h=ac(a.display,a.doc,c);if(h.from>=a.display.showingFrom&&h.to<=a.display.showingTo)break;b=[]}g&&(M(a,"update",a),a.display.showingFrom==e&&a.display.showingTo==f||M(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo));return g}function Yd(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth)e.showingFrom= e.showingTo=f.first,e.viewOffset=0;else if(d||!(0==b.length&&c.from>e.showingFrom&&c.to<e.showingTo)){Xd(a)&&(b=[{from:f.first,to:f.first+f.size}]);var g=e.sizer.style.marginLeft=e.gutters.offsetWidth+"px";e.scrollbarH.style.left=a.options.fixedGutter?g:"0";g=Infinity;if(a.options.lineNumbers)for(var h=0;h<b.length;++h)b[h].diff&&b[h].from<g&&(g=b[h].from);var h=f.first+f.size,k=Math.max(c.from-a.options.viewportMargin,f.first);c=Math.min(h,c.to+a.options.viewportMargin);e.showingFrom<k&&20>k-e.showingFrom&& (k=Math.max(f.first,e.showingFrom));e.showingTo>c&&20>e.showingTo-c&&(c=Math.min(h,e.showingTo));if(Pa)for(k=P($(f,u(f,k)));c<h&&ia(f,u(f,c));)++c;var l=[{from:Math.max(e.showingFrom,f.first),to:Math.min(e.showingTo,h)}],l=l[0].from>=l[0].to?[]:Zd(l,b);if(Pa)for(h=0;h<l.length;++h){b=l[h];for(var n;n=nb(u(f,b.to-1));)if(n=n.find().from.line,n>b.from)b.to=n;else{l.splice(h--,1);break}}for(h=f=0;h<l.length;++h)b=l[h],b.from<k&&(b.from=k),b.to>c&&(b.to=c),b.from>=b.to?l.splice(h--,1):f+=b.to-b.from; if(d||f!=c-k||k!=e.showingFrom||c!=e.showingTo){l.sort(function(a,b){return a.from-b.from});try{var E=document.activeElement}catch(q){}f<0.7*(c-k)&&(e.lineDiv.style.display="none");$d(a,k,c,l,g);e.lineDiv.style.display="";E&&document.activeElement!=E&&E.offsetHeight&&E.focus();if(k!=e.showingFrom||c!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight)e.lastSizeC=e.wrapper.clientHeight,Ka(a,400);e.showingFrom=k;e.showingTo=c;ae(a);Vc(a);return!0}Vc(a)}}function ae(a){a=a.display;for(var b=a.lineDiv.offsetTop, c=a.lineDiv.firstChild,d;c;c=c.nextSibling)if(c.lineObj){if(ra){var e=c.offsetTop+c.offsetHeight;d=e-b;b=e}else d=y(c),d=d.bottom-d.top;e=c.lineObj.height-d;2>d&&(d=sa(a));if(0.001<e||-0.001>e)if(R(c.lineObj,d),d=c.lineObj.widgets)for(e=0;e<d.length;++e)d[e].height=d[e].node.offsetHeight}}function Vc(a){var b=a.display.viewOffset=Qa(a,u(a.doc,a.display.showingFrom));a.display.mover.style.top=b+"px"}function Zd(a,b){for(var c=0,d=b.length||0;c<d;++c){for(var e=b[c],f=[],g=e.diff||0,h=0,k=a.length;h< k;++h){var l=a[h];e.to<=l.from&&e.diff?f.push({from:l.from+g,to:l.to+g}):e.to<=l.from||e.from>=l.to?f.push(l):(e.from>l.from&&f.push({from:l.from,to:e.from}),e.to<l.to&&f.push({from:e.to+g,to:l.to+g}))}a=f}return a}function be(a){for(var b=a.display,c={},d={},e=b.gutters.firstChild,f=0;e;e=e.nextSibling,++f)c[a.options.gutters[f]]=e.offsetLeft,d[a.options.gutters[f]]=e.offsetWidth;return{fixedPos:bc(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}} function $d(a,b,c,d,e){function f(b){var c=b.nextSibling;K&&va&&a.display.currentWheelTarget==b?(b.style.display="none",b.lineObj=null):b.parentNode.removeChild(b);return c}var g=be(a),h=a.display,k=a.options.lineNumbers;d.length||K&&a.display.currentWheelTarget||Ma(h.lineDiv);var l=h.lineDiv,n=l.firstChild,E=d.shift(),q=b;for(a.doc.iter(b,c,function(b){E&&E.to==q&&(E=d.shift());if(ia(a.doc,b)){if(0!=b.height&&R(b,0),b.widgets&&n&&n.previousSibling)for(var c=0;c<b.widgets.length;++c){var h=b.widgets[c]; if(h.showIfHidden){var m=n.previousSibling;if(/pre/i.test(m.nodeName)){var C=p("div",null,null,"position: relative");m.parentNode.replaceChild(C,m);C.appendChild(m);m=C}C=m.appendChild(p("div",[h.node],"CodeMirror-linewidget"));h.handleMouseEvents||(C.ignoreEvents=!0);ec(h,C,m,g)}}}else if(E&&E.from<=q&&E.to>q){for(;n.lineObj!=b;)n=f(n);k&&e<=q&&n.lineNumber&&Wc(n.lineNumber,cc(a.options,q));n=n.nextSibling}else{if(b.widgets)for(var C=0,r=n;r&&20>C;++C,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){c= r;break}var C=a,u=q,H=c,r=fc(C,b),G=b.gutterMarkers,s=C.display;if(C.options.lineNumbers||G||b.bgClass||b.wrapClass||b.widgets){if(H){H.alignable=null;for(var t=!0,v=0,w=null,x=H.firstChild,z;x;x=z)if(z=x.nextSibling,/\bCodeMirror-linewidget\b/.test(x.className)){for(var y=0;y<b.widgets.length;++y){var B=b.widgets[y];if(B.node==x.firstChild){B.above||w||(w=x);ec(B,x,H,g);++v;break}}if(y==b.widgets.length){t=!1;break}}else H.removeChild(x);H.insertBefore(r,w);t&&v==b.widgets.length&&(h=H,H.className= b.wrapClass||"")}h||(h=p("div",null,b.wrapClass,"position: relative"),h.appendChild(r));b.bgClass&&h.insertBefore(p("div",null,b.bgClass+" CodeMirror-linebackground"),h.firstChild);if(C.options.lineNumbers||G)if(m=h.insertBefore(p("div",null,null,"position: absolute; left: "+(C.options.fixedGutter?g.fixedPos:-g.gutterTotalWidth)+"px"),h.firstChild),C.options.fixedGutter&&(h.alignable||(h.alignable=[])).push(m),!C.options.lineNumbers||G&&G["CodeMirror-linenumbers"]||(h.lineNumber=m.appendChild(p("div", cc(C.options,u),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+g.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+s.lineNumInnerWidth+"px"))),G)for(y=0;y<C.options.gutters.length;++y)B=C.options.gutters[y],(u=G.hasOwnProperty(B)&&G[B])&&m.appendChild(p("div",[u],"CodeMirror-gutter-elt","left: "+g.gutterLeft[B]+"px; width: "+g.gutterWidth[B]+"px"));ra&&(h.style.zIndex=2);if(b.widgets&&h!=H)for(y=0,H=b.widgets;y<H.length;++y)B=H[y],G=p("div",[B.node],"CodeMirror-linewidget"),B.handleMouseEvents|| (G.ignoreEvents=!0),ec(B,G,h,g),B.above?h.insertBefore(G,C.options.lineNumbers&&0!=b.height?m:r):h.appendChild(G),M(B,"redraw")}else h=r;if(h!=c)l.insertBefore(h,n);else{for(;n!=c;)n=f(n);n=n.nextSibling}h.lineObj=b}++q});n;)n=f(n)}function ec(a,b,c,d){a.noHScroll&&((c.alignable||(c.alignable=[])).push(b),c=d.wrapperWidth,b.style.left=d.fixedPos+"px",a.coverGutter||(c-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=c+"px");a.coverGutter&&(b.style.zIndex=5,b.style.position= "relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function dc(a){var b=a.display,c=x(a.doc.sel.from,a.doc.sel.to);if(c||a.options.showCursorWhenSelecting){var d=a.display,e=U(a,a.doc.sel.head,"div");d.cursor.style.left=e.left+"px";d.cursor.style.top=e.top+"px";d.cursor.style.height=Math.max(0,e.bottom-e.top)*a.options.cursorHeight+"px";d.cursor.style.display="";e.other?(d.otherCursor.style.display="",d.otherCursor.style.left=e.other.left+"px",d.otherCursor.style.top=e.other.top+ "px",d.otherCursor.style.height=0.85*(e.other.bottom-e.other.top)+"px"):d.otherCursor.style.display="none"}else b.cursor.style.display=b.otherCursor.style.display="none";c?b.selectionDiv.style.display="none":ce(a);a.options.moveInputWithCursor&&(a=U(a,a.doc.sel.head,"div"),c=y(b.wrapper),d=y(b.lineDiv),b.inputDiv.style.top=Math.max(0,Math.min(b.wrapper.clientHeight-10,a.top+d.top-c.top))+"px",b.inputDiv.style.left=Math.max(0,Math.min(b.wrapper.clientWidth-10,a.left+d.left-c.left))+"px")}function ce(a){function b(a, b,c,d){0>b&&(b=0);g.appendChild(p("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?h-a:c)+"px; height: "+(d-b)+"px"))}function c(c,d,f){var g=u(e,c),l=g.text.length,n,m;de(V(g),d||0,null==f?l:f,function(e,u,H){var p=rb(a,r(c,e),"div",g,"left"),s,t;e==u?(s=p,H=t=p.left):(s=rb(a,r(c,u-1),"div",g,"right"),"rtl"==H&&(H=p,p=s,s=H),H=p.left,t=s.right);null==d&&0==e&&(H=k);3<s.top-p.top&&(b(H,p.top,null,p.bottom),H=k,p.bottom<s.top&&b(H,p.bottom,null,s.top)); null==f&&u==l&&(t=h);if(!n||p.top<n.top||p.top==n.top&&p.left<n.left)n=p;if(!m||s.bottom>m.bottom||s.bottom==m.bottom&&s.right>m.right)m=s;H<k+1&&(H=k);b(H,s.top,t-H,s.bottom)});return{start:n,end:m}}var d=a.display,e=a.doc,f=a.doc.sel,g=document.createDocumentFragment(),h=d.lineSpace.offsetWidth,k=W(a.display.measure,p("pre",null,null,"text-align: left")).appendChild(p("span","x")).offsetLeft;if(f.from.line==f.to.line)c(f.from.line,f.from.ch,f.to.ch);else{var l=u(e,f.from.line),n=u(e,f.to.line), n=$(e,l)==$(e,n),l=c(f.from.line,f.from.ch,n?l.text.length:null).end,f=c(f.to.line,n?0:null,f.to.ch).start;n&&(l.top<f.top-2?(b(l.right,l.top,null,l.bottom),b(k,f.top,f.left,f.bottom)):b(l.right,l.top,f.left-l.right,l.bottom));l.bottom<f.top&&b(k,l.bottom,null,f.top)}W(d.selectionDiv,g);d.selectionDiv.style.display=""}function sb(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursor.style.visibility=b.otherCursor.style.visibility="";0<a.options.cursorBlinkRate&&(b.blinker= setInterval(function(){b.cursor.style.visibility=b.otherCursor.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate))}}function Ka(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.showingTo&&a.state.highlight.set(b,O(ee,a))}function ee(a){var b=a.doc;b.frontier<b.first&&(b.frontier=b.first);if(!(b.frontier>=a.display.showingTo)){var c=+new Date+a.options.workTime,d=wa(b.mode,Ra(a,b.frontier)),e=[],f;b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>= a.display.showingFrom){var h=g.styles;g.styles=Xc(a,g,d);for(var k=!h||h.length!=g.styles.length,l=0;!k&&l<h.length;++l)k=h[l]!=g.styles[l];k&&(f&&f.end==b.frontier?f.end++:e.push(f={start:b.frontier,end:b.frontier+1}));g.stateAfter=wa(b.mode,d)}else Yc(a,g,d),g.stateAfter=0==b.frontier%5?wa(b.mode,d):null;++b.frontier;if(+new Date>c)return Ka(a,a.options.workDelay),!0});e.length&&t(a,function(){for(var a=0;a<e.length;++a)D(this,e[a].start,e[a].end)})()}}function fe(a,b,c){var d,e,f=a.doc,g=b;for(b-= a.doc.mode.innerMode?1E3:100;g>b;--g){if(g<=f.first)return f.first;var h=u(f,g-1);if(h.stateAfter&&(!c||g<=f.frontier))return g;h=xa(h.text,null,a.options.tabSize);if(null==e||d>h)e=g-1,d=h}return e}function Ra(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=fe(a,b,c),g=f>d.first&&u(d,f-1).stateAfter,g=g?wa(d.mode,g):Zc(d.mode);d.iter(f,b,function(c){Yc(a,c,g);c.stateAfter=f==b-1||0==f%5||f>=e.showingFrom&&f<e.showingTo?wa(d.mode,g):null;++f});return g}function gc(a,b,c,d,e){var f= -1;d=d||hc(a,b);for(a=c;;a+=f){var g=d[a];if(g)break;0>f&&0==a&&(f=1)}e=a>c?"left":a<c?"right":e;"left"==e&&g.leftSide?g=g.leftSide:"right"==e&&g.rightSide&&(g=g.rightSide);return{left:a<c?g.right:g.left,right:a>c?g.left:g.right,top:g.top,bottom:g.bottom}}function ic(a,b){for(var c=a.display.measureLineCache,d=0;d<c.length;++d){var e=c[d];if(e.text==b.text&&e.markedSpans==b.markedSpans&&a.display.scroller.clientWidth==e.width&&e.classes==b.textClass+"|"+b.bgClass+"|"+b.wrapClass)return e}}function ge(a, b){var c=ic(a,b);c&&(c.text=c.measure=c.markedSpans=null)}function hc(a,b){var c=ic(a,b);if(c)return c.measure;var c=he(a,b),d=a.display.measureLineCache,e={text:b.text,width:a.display.scroller.clientWidth,markedSpans:b.markedSpans,measure:c,classes:b.textClass+"|"+b.bgClass+"|"+b.wrapClass};16==d.length?d[++a.display.measureLineCachePos%16]=e:d.push(e);return c}function he(a,b){function c(a){var b=a.top-pb.top,c=a.bottom-pb.top;c>r&&(c=r);0>b&&(b=0);for(var d=m.length-2;0<=d;d-=2){var e=m[d],f=m[d+ 1];if(!(e>c||f<b)&&(e<=b&&f>=c||b<=e&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1)){m[d]=Math.min(b,e);m[d+1]=Math.max(c,f);break}}0>d&&(d=m.length,m.push(b,c));return{left:a.left-pb.left,right:a.right-pb.left,top:d,bottom:null}}function d(a){a.bottom=m[a.top+1];a.top=m[a.top]}var e=a.display,f=$c(b.text.length),g=fc(a,b,f,!0);if(B&&!ra&&!a.options.lineWrapping&&100<g.childNodes.length){for(var h=document.createDocumentFragment(),k=g.childNodes.length,l=0,n=Math.ceil(k/10);l<n;++l){for(var E=p("div", null,null,"display: inline-block"),q=0;10>q&&k;++q)E.appendChild(g.firstChild),--k;h.appendChild(E)}g.appendChild(h)}W(e.measure,g);var pb=y(e.lineDiv),m=[],h=$c(b.text.length),r=g.offsetHeight;Q&&e.measure.first!=g&&W(e.measure,g);for(l=0;l<f.length;++l)if(e=f[l])g=e,k=null,/\bCodeMirror-widget\b/.test(e.className)&&e.getClientRects&&(1==e.firstChild.nodeType&&(g=e.firstChild),n=g.getClientRects(),1<n.length&&(k=h[l]=c(n[0]),k.rightSide=c(n[n.length-1]))),k||(k=h[l]=c(y(g))),e.measureRight&&(k.right= y(e.measureRight).left),e.leftSide&&(k.leftSide=c(y(e.leftSide)));Ma(a.display.measure);for(l=0;l<h.length;++l)if(e=h[l])d(e),e.leftSide&&d(e.leftSide),e.rightSide&&d(e.rightSide);return h}function ta(a){a.display.measureLineCache.length=a.display.measureLineCachePos=0;a.display.cachedCharWidth=a.display.cachedTextHeight=null;a.options.lineWrapping||(a.display.maxLineChanged=!0);a.display.lineNumChars=null}function jc(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f= tb(b.widgets[e]);c.top+=f;c.bottom+=f}if("line"==d)return c;d||(d="local");b=Qa(a,b);b="local"==d?b+a.display.lineSpace.offsetTop:b-a.display.viewOffset;if("page"==d||"window"==d)a=y(a.display.lineSpace),b+=a.top+("window"==d?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),d=a.left+("window"==d?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),c.left+=d,c.right+=d;c.top+=b;c.bottom+=b;return c}function ad(a,b,c){if("div"==c)return b;var d=b.left; b=b.top;"page"==c?(d-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,b-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=c&&c||(c=y(a.display.sizer),d+=c.left,b+=c.top);a=y(a.display.lineSpace);return{left:d-a.left,top:b-a.top}}function rb(a,b,c,d,e){d||(d=u(a.doc,b.line));return jc(a,d,gc(a,d,b.ch,null,e),c)}function U(a,b,c,d,e){function f(b,f){var g=gc(a,d,b,e,f?"right":"left");f?g.left=g.right:g.right=g.left;return jc(a,d,g,c)}function g(a, b){var c=h[b],d=c.level%2;a==kc(c)&&b&&c.level<h[b-1].level?(c=h[--b],a=lc(c)-(c.level%2?0:1),d=!0):a==lc(c)&&b<h.length-1&&c.level<h[b+1].level&&(c=h[++b],a=kc(c)-c.level%2,d=!1);return d&&a==c.to&&a>c.from?f(a-1):f(a,d)}d=d||u(a.doc,b.line);e||(e=hc(a,d));var h=V(d);b=b.ch;if(!h)return f(b);var k=mc(h,b),k=g(b,k);null!=ya&&(k.other=g(b,ya));return k}function ub(a,b,c,d){a=new r(a,b);a.xRel=d;c&&(a.outside=!0);return a}function nc(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return ub(d.first, 0,!0,-1);var e=Oa(d,c),f=d.first+d.size-1;if(e>f)return ub(d.first+d.size-1,u(d,f).text.length,!0,1);for(0>b&&(b=0);;){var f=u(d,e),e=ie(a,f,e,b,c),g=(f=nb(f))&&f.find();if(f&&(e.ch>g.from.ch||e.ch==g.from.ch&&0<e.xRel))e=g.to.line;else return e}}function ie(a,b,c,d,e){function f(d){d=U(a,r(c,d),"line",b,l);h=!0;if(g>d.bottom)return d.left-k;if(g<d.top)return d.left+k;h=!1;return d.left}var g=e-Qa(a,b),h=!1,k=2*a.display.wrapper.clientWidth,l=hc(a,b),n=V(b),E=b.text.length;e=vb(b);var q=wb(b),m=f(e), p=h,s=f(q),u=h;if(d>s)return ub(c,q,u,1);for(;;){if(n?q==e||q==oc(b,e,1):1>=q-e){n=d<m||d-m<=s-d?e:q;for(d-=n==e?m:s;pc.test(b.text.charAt(n));)++n;return ub(c,n,n==e?p:u,0>d?-1:d?1:0)}var C=Math.ceil(E/2),t=e+C;if(n)for(var t=e,v=0;v<C;++v)t=oc(b,t,1);v=f(t);if(v>d){q=t;s=v;if(u=h)s+=1E3;E=C}else e=t,m=v,p=h,E-=C}}function sa(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==ja){ja=p("pre");for(var b=0;49>b;++b)ja.appendChild(document.createTextNode("x")),ja.appendChild(p("br")); ja.appendChild(document.createTextNode("x"))}W(a.measure,ja);b=ja.offsetHeight/50;3<b&&(a.cachedTextHeight=b);Ma(a.measure);return b||1}function Sc(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=p("span","x"),c=p("pre",[b]);W(a.measure,c);b=b.offsetWidth;2<b&&(a.cachedCharWidth=b);return b||10}function za(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++je};xb++|| (da=[])}function Aa(a){var b=a.curOp,c=a.doc,d=a.display;a.curOp=null;b.updateMaxLine&&Zb(a);if(d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e;e=d.maxLine;var f=!1;if(e.markedSpans)for(var g=0;g<e.markedSpans;++g){var h=e.markedSpans[g];!h.collapsed||null!=h.to&&h.to!=e.text.length||(f=!0)}(f=!f&&ic(a,e))?e=gc(a,e,e.text.length,f.measure,"right").right:(e=fc(a,e,null,!0),f=e.appendChild(Sa(a.display.measure)),W(a.display.measure,e),e=y(f).right-y(a.display.lineDiv).left);d.sizer.style.minWidth= Math.max(0,e+3+qa)+"px";d.maxLineChanged=!1;e=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);e<c.scrollLeft&&!b.updateScrollPos&&Ba(a,Math.min(d.scroller.scrollLeft,e),!0)}var k,l;b.updateScrollPos?k=b.updateScrollPos:b.selectionChanged&&d.scroller.clientHeight&&(k=U(a,c.sel.head),k=yb(a,k.left,k.top,k.left,k.bottom));if(b.changes.length||b.forceUpdate||k&&null!=k.scrollTop)l=ob(a,b.changes,k&&k.scrollTop,b.forceUpdate),a.display.scroller.offsetHeight&&(a.doc.scrollTop= a.display.scroller.scrollTop);!l&&b.selectionChanged&&dc(a);if(b.updateScrollPos)d.scroller.scrollTop=d.scrollbarV.scrollTop=c.scrollTop=k.scrollTop,d.scroller.scrollLeft=d.scrollbarH.scrollLeft=c.scrollLeft=k.scrollLeft,Yb(a),b.scrollToPos&&bd(a,s(a.doc,b.scrollToPos),b.scrollToPosMargin);else if(k&&(c=bd(a,a.doc.sel.head,a.options.cursorScrollMargin),a.state.focused&&(d=a.display,k=y(d.sizer),l=null,0>c.top+k.top?l=!0:c.bottom+k.top>(window.innerHeight||document.documentElement.clientHeight)&&(l= !1),null!=l&&!ke))){if(k="none"==d.cursor.style.display)d.cursor.style.display="",d.cursor.style.left=c.left+"px",d.cursor.style.top=c.top-d.viewOffset+"px";d.cursor.scrollIntoView(l);k&&(d.cursor.style.display="none")}b.selectionChanged&&sb(a);a.state.focused&&b.updateInput&&Y(a,b.userSelChange);c=b.maybeHiddenMarkers;d=b.maybeUnhiddenMarkers;if(c)for(l=0;l<c.length;++l)c[l].lines.length||J(c[l],"hide");if(d)for(l=0;l<d.length;++l)d[l].lines.length&&J(d[l],"unhide");var n;--xb||(n=da,da=null);b.textChanged&& J(a,"change",a,b.textChanged);b.cursorActivity&&J(a,"cursorActivity",a);if(n)for(l=0;l<n.length;++l)n[l]()}function t(a,b){return function(){var c=a||this,d=!c.curOp;d&&za(c);try{var e=b.apply(c,arguments)}finally{d&&Aa(c)}return e}}function Ta(a){return function(){var b=this.cm&&!this.cm.curOp,c;b&&za(this.cm);try{c=a.apply(this,arguments)}finally{b&&Aa(this.cm)}return c}}function qc(a,b){var c=!a.curOp,d;c&&za(a);try{d=b()}finally{c&&Aa(a)}return d}function D(a,b,c,d){null==b&&(b=a.doc.first);null== c&&(c=a.doc.first+a.doc.size);a.curOp.changes.push({from:b,to:c,diff:d})}function zb(a){a.display.pollingFast||a.display.poll.set(a.options.pollInterval,function(){rc(a);a.state.focused&&zb(a)})}function Ua(a){function b(){rc(a)||c?(a.display.pollingFast=!1,zb(a)):(c=!0,a.display.poll.set(60,b))}var c=!1;a.display.pollingFast=!0;a.display.poll.set(20,b)}function rc(a){var b=a.display.input,c=a.display.prevInput,d=a.doc,e=d.sel;if(!a.state.focused||le(b)||Va(a)||a.state.disableInput)return!1;a.state.pasteIncoming&& a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);var f=b.value;if(f==c&&x(e.from,e.to))return!1;if(B&&!Q&&a.display.inputHasSelection===f)return Y(a,!0),!1;var g=!a.curOp;g&&za(a);e.shift=!1;for(var h=0,k=Math.min(c.length,f.length);h<k&&c.charCodeAt(h)==f.charCodeAt(h);)++h;k=e.from;e=e.to;h<c.length?k=r(k.line,k.ch-(c.length-h)):a.state.overwrite&&x(k,e)&&!a.state.pasteIncoming&&(e=r(e.line,Math.min(u(d,e.line).text.length,e.ch+(f.length-h))));c=a.curOp.updateInput; h={from:k,to:e,text:ka(f.slice(h)),origin:a.state.pasteIncoming?"paste":"+input"};Ca(a.doc,h,"end");a.curOp.updateInput=c;M(a,"inputRead",a,h);1E3<f.length||-1<f.indexOf("\n")?b.value=a.display.prevInput="":a.display.prevInput=f;g&&Aa(a);a.state.pasteIncoming=!1;return!0}function Y(a,b){var c,d,e=a.doc;x(e.sel.from,e.sel.to)?b&&(a.display.prevInput=a.display.input.value="",B&&!Q&&(a.display.inputHasSelection=null)):(a.display.prevInput="",d=(c=cd&&(100<e.sel.to.line-e.sel.from.line||1E3<(d=a.getSelection()).length))? "-":d||a.getSelection(),a.display.input.value=d,a.state.focused&&dd(a.display.input),B&&!Q&&(a.display.inputHasSelection=d));a.display.inaccurateSelection=c}function N(a){"nocursor"==a.options.readOnly||Tb&&document.activeElement==a.display.input||a.display.input.focus()}function Va(a){return a.options.readOnly||a.doc.cantEdit}function Ud(a){function b(){a.state.focused&&setTimeout(O(N,a),0)}function c(){null==h&&(h=setTimeout(function(){h=null;g.cachedCharWidth=g.cachedTextHeight=Wa=null;ta(a);qc(a, O(D,a))},100))}function d(){for(var a=g.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(d,5E3):aa(window,"resize",c)}function e(b){X(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,Xa(b))||Ya(b)}function f(){g.inaccurateSelection&&(g.prevInput="",g.inaccurateSelection=!1,g.input.value=a.getSelection(),dd(g.input))}var g=a.display;v(g.scroller,"mousedown",t(a,me));B?v(g.scroller,"dblclick",t(a,function(b){if(!X(a,b)){var c=Za(a,b);!c||ed(a,b)||la(a.display,b)||(A(b),b=sc(u(a.doc, c.line).text,c),F(a.doc,b.from,b.to))}})):v(g.scroller,"dblclick",function(b){X(a,b)||A(b)});v(g.lineSpace,"selectstart",function(a){la(g,a)||A(a)});tc||v(g.scroller,"contextmenu",function(b){fd(a,b)});v(g.scroller,"scroll",function(){g.scroller.clientHeight&&($a(a,g.scroller.scrollTop),Ba(a,g.scroller.scrollLeft,!0),J(a,"scroll",a))});v(g.scrollbarV,"scroll",function(){g.scroller.clientHeight&&$a(a,g.scrollbarV.scrollTop)});v(g.scrollbarH,"scroll",function(){g.scroller.clientHeight&&Ba(a,g.scrollbarH.scrollLeft)}); v(g.scroller,"mousewheel",function(b){gd(a,b)});v(g.scroller,"DOMMouseScroll",function(b){gd(a,b)});v(g.scrollbarH,"mousedown",b);v(g.scrollbarV,"mousedown",b);v(g.wrapper,"scroll",function(){g.wrapper.scrollTop=g.wrapper.scrollLeft=0});var h;v(window,"resize",c);setTimeout(d,5E3);v(g.input,"keyup",t(a,function(b){X(a,b)||a.options.onKeyEvent&&a.options.onKeyEvent(a,Xa(b))||16!=b.keyCode||(a.doc.sel.shift=!1)}));v(g.input,"input",O(Ua,a));v(g.input,"keydown",t(a,hd));v(g.input,"keypress",t(a,ne)); v(g.input,"focus",O(ha,a));v(g.input,"blur",O(Vb,a));a.options.dragDrop&&(v(g.scroller,"dragstart",function(b){var c=a;if(B&&(!c.state.draggingText||100>+new Date-id))Ya(b);else if(!X(c,b)&&!la(c.display,b)){var d=c.getSelection();b.dataTransfer.setData("Text",d);b.dataTransfer.setDragImage&&!uc&&(d=p("img",null,null,"position: fixed; left: 0; top: 0;"),S&&(d.width=d.height=1,c.display.wrapper.appendChild(d),d._top=d.offsetTop),b.dataTransfer.setDragImage(d,0,0),S&&d.parentNode.removeChild(d))}}), v(g.scroller,"dragenter",e),v(g.scroller,"dragover",e),v(g.scroller,"drop",t(a,oe)));v(g.scroller,"paste",function(b){la(g,b)||(N(a),Ua(a))});v(g.input,"paste",function(){if(K&&!(a.state.fakedLastChar||200>new Date-a.state.lastMiddleDown)){var b=g.input.selectionStart,c=g.input.selectionEnd;g.input.value+="$";g.input.selectionStart=b;g.input.selectionEnd=c;a.state.fakedLastChar=!0}a.state.pasteIncoming=!0;Ua(a)});v(g.input,"cut",f);v(g.input,"copy",f);Xb&&v(g.sizer,"mouseup",function(){document.activeElement== g.input&&g.input.blur();N(a)})}function la(a,b){for(var c=b.target||b.srcElement;c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Za(a,b,c){var d=a.display;if(!c&&(c=b.target||b.srcElement,c==d.scrollbarH||c==d.scrollbarH.firstChild||c==d.scrollbarV||c==d.scrollbarV.firstChild||c==d.scrollbarFiller||c==d.gutterFiller))return null;var e,f,d=y(d.lineSpace);try{e=b.clientX,f=b.clientY}catch(g){return null}return nc(a,e-d.left,f-d.top)}function me(a){function b(a){if(!x(p, a))if(p=a,"single"==n)F(e.doc,s(g,k),a);else if(q=s(g,q),m=s(g,m),"double"==n){var b=sc(u(g,a.line).text,a);z(a,q)?F(e.doc,b.from,m):F(e.doc,q,b.to)}else"triple"==n&&(z(a,q)?F(e.doc,m,s(g,r(a.line,0))):F(e.doc,q,s(g,r(a.line+1,0))))}function c(a){var d=++qb,h=Za(e,a,!0);if(h)if(x(h,E)){var k=a.clientY<w.top?-20:a.clientY>w.bottom?20:0;k&&setTimeout(t(e,function(){qb==d&&(f.scroller.scrollTop+=k,c(a))}),50)}else{e.state.focused||ha(e);E=h;b(h);var l=ac(f,g);(h.line>=l.to||h.line<l.from)&&setTimeout(t(e, function(){qb==d&&c(a)}),150)}}function d(a){qb=Infinity;A(a);N(e);aa(document,"mousemove",C);aa(document,"mouseup",D)}if(!X(this,a)){var e=this,f=e.display,g=e.doc,h=g.sel;h.shift=a.shiftKey;if(la(f,a))K||(f.scroller.draggable=!1,setTimeout(function(){f.scroller.draggable=!0},100));else if(!ed(e,a)){var k=Za(e,a);switch(jd(a)){case 3:tc&&fd.call(e,e,a);return;case 2:K&&(e.state.lastMiddleDown=+new Date);k&&F(e.doc,k);setTimeout(O(N,e),20);A(a);return}if(k){e.state.focused||ha(e);var l=+new Date, n="single";Ab&&Ab.time>l-400&&x(Ab.pos,k)?(n="triple",A(a),setTimeout(O(N,e),20),pe(e,k.line)):Bb&&Bb.time>l-400&&x(Bb.pos,k)?(n="double",Ab={time:l,pos:k},A(a),l=sc(u(g,k.line).text,k),F(e.doc,l.from,l.to)):Bb={time:l,pos:k};var E=k;if(!e.options.dragDrop||!qe||Va(e)||x(h.from,h.to)||z(k,h.from)||z(h.to,k)||"single"!=n){A(a);"single"==n&&F(e.doc,s(g,k));var q=h.from,m=h.to,p=k,w=y(f.wrapper),qb=0,C=t(e,function(a){B||jd(a)?c(a):d(a)}),D=t(e,d);v(document,"mousemove",C);v(document,"mouseup",D)}else{var J= t(e,function(b){K&&(f.scroller.draggable=!1);e.state.draggingText=!1;aa(document,"mouseup",J);aa(f.scroller,"drop",J);10>Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)&&(A(b),F(e.doc,k),N(e))});K&&(f.scroller.draggable=!0);e.state.draggingText=J;f.scroller.dragDrop&&f.scroller.dragDrop();v(document,"mouseup",J);v(f.scroller,"drop",J)}}else(a.target||a.srcElement)==f.scroller&&A(a)}}}function ed(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(f){return!1}if(d>=Math.floor(y(c.gutters).right))return!1; A(b);if(!ba(a,"gutterClick"))return!0;var g=y(c.lineDiv);if(e>g.bottom)return!0;e-=g.top-c.viewOffset;for(g=0;g<a.options.gutters.length;++g){var h=c.gutters.childNodes[g];if(h&&y(h).right>=d){c=Oa(a.doc,e);M(a,"gutterClick",a,c,a.options.gutters[g],b);break}}return!0}function oe(a){var b=this;if(!(X(b,a)||la(b.display,a)||b.options.onDragEvent&&b.options.onDragEvent(b,Xa(a)))){A(a);B&&(id=+new Date);var c=Za(b,a,!0),d=a.dataTransfer.files;if(c&&!Va(b))if(d&&d.length&&window.FileReader&&window.File){var e= d.length,f=Array(e),g=0;a=function(a,d){var h=new FileReader;h.onload=function(){f[d]=h.result;++g==e&&(c=s(b.doc,c),Ca(b.doc,{from:c,to:c,text:ka(f.join("\n")),origin:"paste"},"around"))};h.readAsText(a)};for(var h=0;h<e;++h)a(d[h],h)}else if(!b.state.draggingText||z(c,b.doc.sel.from)||z(b.doc.sel.to,c))try{if(f=a.dataTransfer.getData("Text")){var h=b.doc.sel.from,k=b.doc.sel.to;ea(b.doc,c,c);b.state.draggingText&&fa(b.doc,"",h,k,"paste");b.replaceSelection(f,null,"paste");N(b);ha(b)}}catch(l){}else b.state.draggingText(a), setTimeout(O(N,b),20)}}function $a(a,b){2>Math.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,Da||ob(a,[],b),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbarV.scrollTop!=b&&(a.display.scrollbarV.scrollTop=b),Da&&ob(a,[]),Ka(a,100))}function Ba(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,Yb(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft= b),a.display.scrollbarH.scrollLeft!=b&&(a.display.scrollbarH.scrollLeft=b))}function gd(a,b){var c=b.wheelDeltaX,d=b.wheelDeltaY;null==c&&b.detail&&b.axis==b.HORIZONTAL_AXIS&&(c=b.detail);null==d&&b.detail&&b.axis==b.VERTICAL_AXIS?d=b.detail:null==d&&(d=b.wheelDelta);var e=a.display,f=e.scroller;if(c&&f.scrollWidth>f.clientWidth||d&&f.scrollHeight>f.clientHeight){if(d&&va&&K)for(var g=b.target;g!=f;g=g.parentNode)if(g.lineObj){a.display.currentWheelTarget=g;break}if(!c||Da||S||null==T){if(d&&null!= T){var g=d*T,h=a.doc.scrollTop,k=h+e.wrapper.clientHeight;0>g?h=Math.max(0,h+g-50):k=Math.min(a.doc.height,k+g+50);ob(a,[],{top:h,bottom:k})}20>Cb&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft,e.wheelStartY=f.scrollTop,e.wheelDX=c,e.wheelDY=d,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(T=(T*Cb+a)/(Cb+1),++Cb)}},200)):(e.wheelDX+=c,e.wheelDY+= d))}else d&&$a(a,Math.max(0,Math.min(f.scrollTop+d*T,f.scrollHeight-f.clientHeight))),Ba(a,Math.max(0,Math.min(f.scrollLeft+c*T,f.scrollWidth-f.clientWidth))),A(b),e.wheelStartX=null}}function Db(a,b,c){if("string"==typeof b&&(b=vc[b],!b))return!1;a.display.pollingFast&&rc(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Va(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=kd}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function ld(a){var b=a.state.keyMaps.slice(0); a.options.extraKeys&&b.push(a.options.extraKeys);b.push(a.options.keyMap);return b}function md(a,b){var c=wc(a.options.keyMap),d=c.auto;clearTimeout(nd);d&&!od(b)&&(nd=setTimeout(function(){wc(a.options.keyMap)==c&&(a.options.keyMap=d.call?d.call(null,a):d,Uc(a))},50));var e=pd(b,!0),f=!1;if(!e)return!1;f=ld(a);if(f=b.shiftKey?ab("Shift-"+e,f,function(b){return Db(a,b,!0)})||ab(e,f,function(b){if("string"==typeof b?/^go[A-Z]/.test(b):b.motion)return Db(a,b)}):ab(e,f,function(b){return Db(a,b)}))A(b), sb(a),Q&&(b.oldKeyCode=b.keyCode,b.keyCode=0),M(a,"keyHandled",a,e,b);return f}function re(a,b,c){var d=ab("'"+c+"'",ld(a),function(b){return Db(a,b,!0)});d&&(A(b),sb(a),M(a,"keyHandled",a,"'"+c+"'",b));return d}function hd(a){this.state.focused||ha(this);if(!(X(this,a)||this.options.onKeyEvent&&this.options.onKeyEvent(this,Xa(a)))){B&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.doc.sel.shift=16==b||a.shiftKey;var c=md(this,a);S&&(xc=c?b:null,!c&&88==b&&!cd&&(va?a.metaKey:a.ctrlKey)&&this.replaceSelection(""))}} function ne(a){var b=this;if(!(X(b,a)||b.options.onKeyEvent&&b.options.onKeyEvent(b,Xa(a)))){var c=a.keyCode,d=a.charCode;S&&c==xc?(xc=null,A(a)):(S&&(!a.which||10>a.which)||Xb)&&md(b,a)||(c=String.fromCharCode(null==d?c:d),this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Va(this)&&-1<this.doc.mode.electricChars.indexOf(c)&&setTimeout(t(b,function(){Eb(b,b.doc.sel.to.line,"smart")}),75),re(b,a,c)||(B&&!Q&&(b.display.inputHasSelection=null),Ua(b)))}}function ha(a){"nocursor"!= a.options.readOnly&&(a.state.focused||(J(a,"focus",a),a.state.focused=!0,-1==a.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(a.display.wrapper.className+=" CodeMirror-focused"),a.curOp||(Y(a,!0),K&&setTimeout(O(Y,a,!0),0))),zb(a),sb(a))}function Vb(a){a.state.focused&&(J(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused",""));clearInterval(a.display.blinker);setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)}, 150)}function fd(a,b){function c(){if(null!=e.input.selectionStart){var a=e.input.value=" "+(x(f.from,f.to)?"":e.input.value);e.prevInput=" ";e.input.selectionStart=1;e.input.selectionEnd=a.length}}function d(){e.inputDiv.style.position="relative";e.input.style.cssText=k;Q&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=h);zb(a);if(null!=e.input.selectionStart){B&&!Q||c();clearTimeout(yc);var b=0,d=function(){" "==e.prevInput&&0==e.input.selectionStart?t(a,vc.selectAll)(a):10>b++?yc=setTimeout(d,500): Y(a)};yc=setTimeout(d,200)}}if(!X(a,b,"contextmenu")){var e=a.display,f=a.doc.sel;if(!la(e,b)){var g=Za(a,b),h=e.scroller.scrollTop;if(g&&!S){(x(f.from,f.to)||z(g,f.from)||!z(g,f.to))&&t(a,ea)(a.doc,g,g);var k=e.input.style.cssText;e.inputDiv.style.position="absolute";e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(b.clientY-5)+"px; left: "+(b.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);"; N(a);Y(a,!0);x(f.from,f.to)&&(e.input.value=e.prevInput=" ");B&&!Q&&c();if(tc){Ya(b);var l=function(){aa(window,"mouseup",l);setTimeout(d,20)};v(window,"mouseup",l)}else setTimeout(d,50)}}}}function qd(a,b,c){if(!z(b.from,c))return s(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d)return b=c.line-d,d=a.first+a.size-1,b>d?r(d,u(a,d).text.length):Fb(c,u(a,b).text.length);if(c.line==b.to.line+d)return Fb(c,L(b.text).length+(1==b.text.length?b.from.ch:0)+u(a,b.to.line).text.length- b.to.ch);a=c.line-b.from.line;return Fb(c,b.text[a].length+(a?0:b.from.ch))}function zc(a,b,c){if(c&&"object"==typeof c)return{anchor:qd(a,b,c.anchor),head:qd(a,b,c.head)};if("start"==c)return{anchor:b.from,head:b.from};var d=Ac(b);if("around"==c)return{anchor:b.from,head:d};if("end"==c)return{anchor:d,head:d};c=function(a){if(z(a,b.from))return a;if(!z(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,g=a.ch;a.line==b.to.line&&(g+=d.ch-b.to.ch);return r(c,g)};return{anchor:c(a.sel.anchor), head:c(a.sel.head)}}function rd(a,b,c){b={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};c&&(b.update=function(b,c,f,g){b&&(this.from=s(a,b));c&&(this.to=s(a,c));f&&(this.text=f);void 0!==g&&(this.origin=g)});J(a,"beforeChange",a,b);a.cm&&J(a.cm,"beforeChange",a.cm,b);return b.canceled?null:{from:b.from,to:b.to,text:b.text,origin:b.origin}}function Ca(a,b,c,d){if(a.cm){if(!a.cm.curOp)return t(a.cm,Ca)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(ba(a, "beforeChange")||a.cm&&ba(a.cm,"beforeChange"))if(b=rd(a,b,!0),!b)return;if(d=sd&&!d&&se(a,b.from,b.to)){for(var e=d.length-1;1<=e;--e)Bc(a,{from:d[e].from,to:d[e].to,text:[""]});d.length&&Bc(a,{from:d[0].from,to:d[0].to,text:b.text},c)}else Bc(a,b,c)}function Bc(a,b,c){c=zc(a,b,c);td(a,b,c,a.cm?a.cm.curOp.id:NaN);bb(a,b,c,Cc(a,b));var d=[];Ea(a,function(a,c){c||-1!=ca(d,a.history)||(ud(a.history,b),d.push(a.history));bb(a,b,null,Cc(a,b))})}function vd(a,b){if(!a.cm||!a.cm.state.suppressEdits){var c= a.history,d=("undo"==b?c.done:c.undone).pop();if(d){var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};("undo"==b?c.undone:c.done).push(e);c.generation=d.generation||++c.maxGeneration;for(var f=ba(a,"beforeChange")||a.cm&&ba(a.cm,"beforeChange"),g=d.changes.length-1;0<=g;--g){var h=d.changes[g];h.origin=b;if(f&&!rd(a,h,!1)){("undo"==b?c.done:c.undone).length=0;break}e.changes.push(Dc(a,h));var k=g?zc(a,h,null): {anchor:d.anchorBefore,head:d.headBefore};bb(a,h,k,wd(a,h));var l=[];Ea(a,function(a,b){b||-1!=ca(l,a.history)||(ud(a.history,h),l.push(a.history));bb(a,h,null,wd(a,h))})}}}}function xd(a,b){function c(a){return r(a.line+b,a.ch)}a.first+=b;a.cm&&D(a.cm,a.first,a.first,b);a.sel.head=c(a.sel.head);a.sel.anchor=c(a.sel.anchor);a.sel.from=c(a.sel.from);a.sel.to=c(a.sel.to)}function bb(a,b,c,d){if(a.cm&&!a.cm.curOp)return t(a.cm,bb)(a,b,c,d);if(b.to.line<a.first)xd(a,b.text.length-1-(b.to.line-b.from.line)); else if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);xd(a,e);b={from:r(a.first,0),to:r(b.to.line+e,b.to.ch),text:[L(b.text)],origin:b.origin}}e=a.lastLine();b.to.line>e&&(b={from:b.from,to:r(e,u(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=Ec(a,b.from,b.to);c||(c=zc(a,b,null));a.cm?te(a.cm,b,d,c):Fc(a,b,d,c)}}function te(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,k=!1,l=g.line;a.options.lineWrapping||(l=P($(e,u(e,g.line))), e.iter(l,h.line+1,function(a){if(a==f.maxLine)return k=!0}));z(e.sel.head,b.from)||z(b.to,e.sel.head)||(a.curOp.cursorActivity=!0);Fc(e,b,c,d,Rc(a));a.options.lineWrapping||(e.iter(l,g.line+b.text.length,function(a){var b=mb(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,k=!1)}),k&&(a.curOp.updateMaxLine=!0));e.frontier=Math.min(e.frontier,g.line);Ka(a,400);D(a,g.line,h.line+1,b.text.length-(h.line-g.line)-1);if(ba(a,"change"))if(b={from:g,to:h,text:b.text,removed:b.removed, origin:b.origin},a.curOp.textChanged){for(a=a.curOp.textChanged;a.next;a=a.next);a.next=b}else a.curOp.textChanged=b}function fa(a,b,c,d,e){d||(d=c);if(z(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=ka(b));Ca(a,{from:c,to:d,text:b,origin:e},null)}function r(a,b){if(!(this instanceof r))return new r(a,b);this.line=a;this.ch=b}function x(a,b){return a.line==b.line&&a.ch==b.ch}function z(a,b){return a.line<b.line||a.line==b.line&&a.ch<b.ch}function ma(a){return r(a.line,a.ch)}function s(a,b){if(b.line< a.first)return r(a.first,0);var c=a.first+a.size-1;return b.line>c?r(c,u(a,c).text.length):Fb(b,u(a,b.line).text.length)}function Fb(a,b){var c=a.ch;return null==c||c>b?r(a.line,b):0>c?r(a.line,0):a}function Fa(a,b){return b>=a.first&&b<a.first+a.size}function F(a,b,c,d){if(a.sel.shift||a.sel.extend){var e=a.sel.anchor;if(c){var f=z(b,e);f!=z(c,e)?(e=b,b=c):f!=z(b,c)&&(b=c)}ea(a,e,b,d)}else ea(a,b,c||b,d);a.cm&&(a.cm.curOp.userSelChange=!0)}function ea(a,b,c,d,e){if(!e&&ba(a,"beforeSelectionChange")|| a.cm&&ba(a.cm,"beforeSelectionChange"))b={anchor:b,head:c},J(a,"beforeSelectionChange",a,b),a.cm&&J(a.cm,"beforeSelectionChange",a.cm,b),b.anchor=s(a,b.anchor),b.head=s(a,b.head),c=b.head,b=b.anchor;var f=a.sel;f.goalColumn=null;if(e||!x(b,f.anchor))b=Gb(a,b,d,"push"!=e);if(e||!x(c,f.head))c=Gb(a,c,d,"push"!=e);x(f.anchor,b)&&x(f.head,c)||(f.anchor=b,f.head=c,d=z(c,b),f.from=d?c:b,f.to=d?b:c,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=a.cm.curOp.cursorActivity=!0),M(a,"cursorActivity", a))}function yd(a){ea(a.doc,a.doc.sel.from,a.doc.sel.to,null,"push")}function Gb(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=u(a,f.line);if(h.markedSpans)for(var k=0;k<h.markedSpans.length;++k){var l=h.markedSpans[k],n=l.marker;if((null==l.from||(n.inclusiveLeft?l.from<=f.ch:l.from<f.ch))&&(null==l.to||(n.inclusiveRight?l.to>=f.ch:l.to>f.ch))){if(d&&(J(n,"beforeCursorEnter"),n.explicitlyCleared))if(h.markedSpans){--k;continue}else break;if(n.atomic){k=n.find()[0>g?"from":"to"];if(x(k, f)&&(k.ch+=g,0>k.ch?k=k.line>a.first?s(a,r(k.line-1)):null:k.ch>h.text.length&&(k=k.line<a.first+a.size-1?r(k.line+1,0):null),!k)){if(e){if(!d)return Gb(a,b,c,!0);a.cantEdit=!0;return r(a.first,0)}e=!0;k=b;g=-g}f=k;continue a}}}return f}}function bd(a,b,c){for(null==c&&(c=0);;){var d=!1,e=U(a,b),f=yb(a,e.left,e.top-c,e.left,e.bottom+c),g=a.doc.scrollTop,h=a.doc.scrollLeft;null!=f.scrollTop&&($a(a,f.scrollTop),1<Math.abs(a.doc.scrollTop-g)&&(d=!0));null!=f.scrollLeft&&(Ba(a,f.scrollLeft),1<Math.abs(a.doc.scrollLeft- h)&&(d=!0));if(!d)return e}}function yb(a,b,c,d,e){var f=a.display,g=sa(a.display);0>c&&(c=0);var h=f.scroller.clientHeight-qa,k=f.scroller.scrollTop,l={};a=a.doc.height+(f.mover.offsetHeight-f.lineSpace.offsetHeight);var n=c<g,g=e>a-g;c<k?l.scrollTop=n?0:c:e>k+h&&(c=Math.min(c,(g?a:e)-h),c!=k&&(l.scrollTop=c));k=f.scroller.clientWidth-qa;c=f.scroller.scrollLeft;b+=f.gutters.offsetWidth;d+=f.gutters.offsetWidth;f=f.gutters.offsetWidth;e=b<f+10;b<c+f||e?(e&&(b=0),l.scrollLeft=Math.max(0,b-10-f)):d> k+c-3&&(l.scrollLeft=d+10-k);return l}function Hb(a,b,c){a.curOp.updateScrollPos={scrollLeft:null==b?a.doc.scrollLeft:b,scrollTop:null==c?a.doc.scrollTop:c}}function Gc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop});a=a.display.scroller;d.scrollTop=Math.max(0,Math.min(a.scrollHeight-a.clientHeight,d.scrollTop+c));d.scrollLeft=Math.max(0,Math.min(a.scrollWidth-a.clientWidth,d.scrollLeft+b))}function Eb(a,b,c,d){var e=a.doc;null== c&&(c="add");if("smart"==c)if(a.doc.mode.indent)var f=Ra(a,b);else c="prev";var g=a.options.tabSize,h=u(e,b),k=xa(h.text,null,g),l=h.text.match(/^\s*/)[0],n;if("smart"==c&&(n=a.doc.mode.indent(f,h.text.slice(l.length),h.text),n==kd)){if(!d)return;c="prev"}"prev"==c?n=b>e.first?xa(u(e,b-1).text,null,g):0:"add"==c?n=k+a.options.indentUnit:"subtract"==c?n=k-a.options.indentUnit:"number"==typeof c&&(n=k+c);n=Math.max(0,n);c="";d=0;if(a.options.indentWithTabs)for(e=Math.floor(n/g);e;--e)d+=g,c+="\t";d< n&&(c+=zd(n-d));c!=l&&fa(a.doc,c,r(b,0),r(b,l.length),"+input");h.stateAfter=null}function Ib(a,b,c){var d=b,e=b,f=a.doc;"number"==typeof b?e=u(f,Math.max(f.first,Math.min(b,f.first+f.size-1))):d=P(b);if(null!=d&&c(e,d))D(a,d,d+1);else return null;return e}function Hc(a,b,c,d,e){function f(b){var d=(e?oc:Ad)(k,h,c,!0);if(null==d){if(b=!b)b=g+c,b<a.first||b>=a.first+a.size?b=l=!1:(g=b,b=k=u(a,b));if(b)h=e?(0>c?wb:vb)(k):0>c?k.text.length:0;else return l=!1}else h=d;return!0}var g=b.line,h=b.ch;b=c; var k=u(a,g),l=!0;if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var n=null;d="group"==d;for(var E=!0;!(0>c)||f(!E);E=!1){var q=k.text.charAt(h)||"\n",q=cb(q)?"w":d?/\s/.test(q)?null:"p":null;if(n&&n!=q){0>c&&(c=1,f());break}q&&(n=q);if(0<c&&!f(!E))break}}b=Gb(a,r(g,h),b,!0);l||(b.hitSide=!0);return b}function Bd(a,b,c,d){var e=a.doc,f=b.left,g;"page"==d?(d=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=b.top+c*(d-(0> c?1.5:0.5)*sa(a.display))):"line"==d&&(g=0<c?b.bottom+3:b.top-3);for(;;){var h=nc(a,f,g);if(!h.outside)break;if(0>c?0>=g:g>=e.height){h.hitSide=!0;break}g+=5*c}return h}function sc(a,b){var c=b.ch,d=b.ch;if(a){(0>b.xRel||d==a.length)&&c?--c:++d;for(var e=a.charAt(c),e=cb(e)?cb:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!cb(a)};0<c&&e(a.charAt(c-1));)--c;for(;d<a.length&&e(a.charAt(d));)++d}return{from:r(b.line,c),to:r(b.line,d)}}function pe(a,b){F(a.doc,r(b,0),s(a.doc, r(b+1,0)))}function w(a,b,c,d){m.defaults[a]=b;c&&(pa[a]=d?function(a,b,d){d!=Qc&&c(a,b,d)}:c)}function wa(a,b){if(!0===b)return b;if(a.copyState)return a.copyState(b);var c={},d;for(d in b){var e=b[d];e instanceof Array&&(e=e.concat([]));c[d]=e}return c}function Zc(a,b,c){return a.startState?a.startState(b,c):!0}function wc(a){return"string"==typeof a?Z[a]:a}function ab(a,b,c){function d(b){b=wc(b);var e=b[a];if(!1===e)return"stop";if(null!=e&&c(e))return!0;if(b.nofallthrough)return"stop";b=b.fallthrough; if(null==b)return!1;if("[object Array]"!=Object.prototype.toString.call(b))return d(b);for(var e=0,f=b.length;e<f;++e){var l=d(b[e]);if(l)return l}return!1}for(var e=0;e<b.length;++e){var f=d(b[e]);if(f)return"stop"!=f}}function od(a){a=na[a.keyCode];return"Ctrl"==a||"Alt"==a||"Shift"==a||"Mod"==a}function pd(a,b){if(S&&34==a.keyCode&&a["char"])return!1;var c=na[a.keyCode];if(null==c||a.altGraphKey)return!1;a.altKey&&(c="Alt-"+c);if(Cd?a.metaKey:a.ctrlKey)c="Ctrl-"+c;if(Cd?a.ctrlKey:a.metaKey)c="Cmd-"+ c;!b&&a.shiftKey&&(c="Shift-"+c);return c}function db(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lastColumnPos=this.lastColumnValue=0}function ga(a,b){this.lines=[];this.type=b;this.doc=a}function eb(a,b,c,d,e){if(d&&d.shared)return ue(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return t(a.cm,eb)(a,b,c,d,e);var f=new ga(a,e);if("range"==e&&!z(b,c))return f;d&&Jb(d,f);f.replacedWith&&(f.collapsed=!0,f.replacedWith=p("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||(f.replacedWith.ignoreEvents= !0));f.collapsed&&(Pa=!0);f.addToHistory&&td(a,{from:b,to:c,origin:"markText"},{head:a.sel.head,anchor:a.sel.anchor},NaN);var g=b.line,h=0,k,l,n=a.cm,E;a.iter(g,c.line+1,function(d){n&&f.collapsed&&!n.options.lineWrapping&&$(a,d)==n.display.maxLine&&(E=!0);var e={from:null,to:null,marker:f};h+=d.text.length;g==b.line&&(e.from=b.ch,h-=b.ch);g==c.line&&(e.to=c.ch,h-=d.text.length-c.ch);f.collapsed&&(g==c.line&&(l=ua(d,c.ch)),g==b.line?k=ua(d,b.ch):R(d,0));d.markedSpans=d.markedSpans?d.markedSpans.concat([e]): [e];e.marker.attachLine(d);++g});f.collapsed&&a.iter(b.line,c.line+1,function(b){ia(a,b)&&R(b,0)});f.clearOnEnter&&v(f,"beforeCursorEnter",function(){f.clear()});f.readOnly&&(sd=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory());if(f.collapsed){if(k!=l)throw Error("Inserting collapsed marker overlapping an existing one");f.size=h;f.atomic=!0}n&&(E&&(n.curOp.updateMaxLine=!0),(f.className||f.title||f.startStyle||f.endStyle||f.collapsed)&&D(n,b.line,c.line+1),f.atomic&&yd(n));return f} function fb(a,b){this.markers=a;this.primary=b;for(var c=0,d=this;c<a.length;++c)a[c].parent=this,v(a[c],"clear",function(){d.clear()})}function ue(a,b,c,d,e){d=Jb(d);d.shared=!1;var f=[eb(a,b,c,d,e)],g=f[0],h=d.replacedWith;Ea(a,function(a){h&&(d.replacedWith=h.cloneNode(!0));f.push(eb(a,s(a,b),s(a,c),d,e));for(var l=0;l<a.linked.length;++l)if(a.linked[l].isParent)return;g=L(f)});return new fb(f,g)}function gb(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Cc(a, b){var c=Fa(a,b.from.line)&&u(a,b.from.line).markedSpans,d=Fa(a,b.to.line)&&u(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=x(b.from,b.to);if(c)for(var h=0,k;h<c.length;++h){var l=c[h],n=l.marker;if(null==l.from||(n.inclusiveLeft?l.from<=e:l.from<e)||"bookmark"==n.type&&!(l.from!=e||g&&l.marker.insertLeft)){var E=null==l.to||(n.inclusiveRight?l.to>=e:l.to>e);(k||(k=[])).push({from:l.from,to:E?null:l.to,marker:n})}}c=k;if(d)for(var h=0,m;h<d.length;++h)if(k=d[h],l=k.marker, null==k.to||(l.inclusiveRight?k.to>=f:k.to>f)||"bookmark"==l.type&&k.from==f&&(!g||k.marker.insertLeft))n=null==k.from||(l.inclusiveLeft?k.from<=f:k.from<f),(m||(m=[])).push({from:n?null:k.from-f,to:null==k.to?null:k.to-f,marker:l});d=m;g=1==b.text.length;m=L(b.text).length+(g?e:0);if(c)for(f=0;f<c.length;++f)if(h=c[f],null==h.to)(k=gb(d,h.marker),k)?g&&(h.to=null==k.to?null:k.to+m):h.to=e;if(d)for(f=0;f<d.length;++f)h=d[f],null!=h.to&&(h.to+=m),null==h.from?(k=gb(c,h.marker),k||(h.from=m,g&&(c|| (c=[])).push(h))):(h.from+=m,g&&(c||(c=[])).push(h));if(g&&c){for(f=0;f<c.length;++f)null!=c[f].from&&c[f].from==c[f].to&&"bookmark"!=c[f].marker.type&&c.splice(f--,1);c.length||(c=null)}e=[c];if(!g){var g=b.text.length-2,p;if(0<g&&c)for(f=0;f<c.length;++f)null==c[f].to&&(p||(p=[])).push({from:null,to:null,marker:c[f].marker});for(f=0;f<g;++f)e.push(p);e.push(d)}return e}function wd(a,b){var c;if(c=b["spans_"+a.id]){for(var d=0,e=[];d<b.text.length;++d)e.push(ve(c[d]));c=e}else c=null;d=Cc(a,b);if(!c)return d; if(!d)return c;for(e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g){var h=0;a:for(;h<g.length;++h){for(var k=g[h],l=0;l<f.length;++l)if(f[l].marker==k.marker)continue a;f.push(k)}}else g&&(c[e]=g)}return c}function se(a,b,c){var d=null;a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=ca(d,c)||(d||(d=[])).push(c)}});if(!d)return null;a=[{from:b,to:c}];for(b=0;b<d.length;++b){c=d[b];for(var e=c.find(),f=0;f<a.length;++f){var g= a[f];if(!z(g.to,e.from)&&!z(e.to,g.from)){var h=[f,1];(z(g.from,e.from)||!c.inclusiveLeft&&x(g.from,e.from))&&h.push({from:g.from,to:e.from});(z(e.to,g.to)||!c.inclusiveRight&&x(g.to,e.to))&&h.push({from:e.to,to:g.to});a.splice.apply(a,h);f+=h.length-1}}}return a}function ua(a,b){var c=Pa&&a.markedSpans,d;if(c)for(var e,f=0;f<c.length;++f)e=c[f],e.marker.collapsed&&(null==e.from||e.from<b)&&(null==e.to||e.to>b)&&(!d||d.width<e.marker.width)&&(d=e.marker);return d}function nb(a){return ua(a,a.text.length+ 1)}function $(a,b){for(var c;c=ua(b,-1);)b=u(a,c.find().from.line);return b}function ia(a,b){var c=Pa&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed&&(null==d.from||!d.marker.replacedWith&&0==d.from&&d.marker.inclusiveLeft&&Ic(a,b,d)))return!0}function Ic(a,b,c){if(null==c.to)return b=c.marker.find().to,b=u(a,b.line),Ic(a,b,gb(b.markedSpans,c.marker));if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var d,e=0;e<b.markedSpans.length;++e)if(d=b.markedSpans[e], d.marker.collapsed&&!d.marker.replacedWith&&d.from==c.to&&(d.marker.inclusiveLeft||c.marker.inclusiveRight)&&Ic(a,b,d))return!0}function Dd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function Ed(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function Fd(a){return function(){var b=!this.cm.curOp;b&&za(this.cm);try{var c=a.apply(this,arguments)}finally{b&&Aa(this.cm)}return c}}function tb(a){if(null!=a.height)return a.height; a.node.parentNode&&1==a.node.parentNode.nodeType||W(a.cm.display.measure,p("div",[a.node],null,"position: relative"));return a.height=a.node.offsetHeight}function we(a,b,c,d){var e=new Kb(a,c,d);e.noHScroll&&(a.display.alignWidgets=!0);Ib(a,b,function(b){var c=b.widgets||(b.widgets=[]);null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e);e.line=b;if(!ia(a.doc,b)||e.showIfHidden)c=Qa(a,b)<a.doc.scrollTop,R(b,b.height+tb(e)),c&&Gc(a,0,e.height);return!0});return e}function Gd(a, b,c,d,e){var f=c.flattenSpans;null==f&&(f=a.options.flattenSpans);var g=0,h=null,k=new db(b,a.options.tabSize),l;for(""==b&&c.blankLine&&c.blankLine(d);!k.eol();)k.pos>a.options.maxHighlightLength?(f=!1,k.pos=Math.min(b.length,k.start+5E4),l=null):l=c.token(k,d),f&&h==l||(g<k.start&&e(k.start,h),g=k.start,h=l),k.start=k.pos;g<k.pos&&e(k.pos,h)}function Xc(a,b,c){var d=[a.state.modeGen];Gd(a,b.text,a.doc.mode,c,function(a,b){d.push(a,b)});for(c=0;c<a.state.overlays.length;++c){var e=a.state.overlays[c], f=1,g=0;Gd(a,b.text,e.mode,!0,function(a,b){for(var c=f;g<a;){var n=d[f];n>a&&d.splice(f,1,a,d[f+1],n);f+=2;g=Math.min(a,n)}if(b)if(e.opaque)d.splice(c,f-c,a,b),f=c+2;else for(;c<f;c+=2)n=d[c+1],d[c+1]=n?n+" "+b:b})}return d}function Hd(a,b){b.styles&&b.styles[0]==a.state.modeGen||(b.styles=Xc(a,b,b.stateAfter=Ra(a,P(b))));return b.styles}function Yc(a,b,c){var d=a.doc.mode,e=new db(b.text,a.options.tabSize);for(""==b.text&&d.blankLine&&d.blankLine(c);!e.eol()&&e.pos<=a.options.maxHighlightLength;)d.token(e, c),e.start=e.pos}function Id(a){return a?Jd[a]||(Jd[a]="cm-"+a.replace(/ +/g," cm-")):null}function fc(a,b,c,d){for(var e,f=b,g=!0;e=ua(f,-1);)f=u(a.doc,e.find().from.line);d={pre:p("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:a,copyWidgets:d};f.textClass&&(d.pre.className=f.textClass);do{f.text&&(g=!1);d.measure=f==b&&c;d.pos=0;d.addToken=d.measure?xe:Kd;(B||K)&&a.getOption("lineWrapping")&&(d.addToken=ye(d.addToken));a:{e=d;var h=Hd(a,f),k=f.markedSpans,l=f.text,n=0;if(k)for(var m=l.length, q=0,r=1,s="",t=void 0,v=0,C=void 0,w=void 0,x=void 0,y=void 0,G=void 0;;){if(v==q){for(var C=w=x=y="",G=null,v=Infinity,z=[],D=0;D<k.length;++D){var A=k[D],F=A.marker;A.from<=q&&(null==A.to||A.to>q)?(null!=A.to&&v>A.to&&(v=A.to,w=""),F.className&&(C+=" "+F.className),F.startStyle&&A.from==q&&(x+=" "+F.startStyle),F.endStyle&&A.to==v&&(w+=" "+F.endStyle),F.title&&!y&&(y=F.title),F.collapsed&&(!G||G.marker.size<F.size)&&(G=A)):A.from>q&&v>A.from&&(v=A.from);"bookmark"==F.type&&A.from==q&&F.replacedWith&& z.push(F)}if(G&&(G.from||0)==q&&(Ld(e,(null==G.to?m:G.to)-q,G.marker,null==G.from),null==G.to)){e=G.marker.find();break a}if(!G&&z.length)for(D=0;D<z.length;++D)Ld(e,0,z[D])}if(q>=m)break;for(z=Math.min(m,v);;){if(s){D=q+s.length;G||(A=D>z?s.slice(0,z-q):s,e.addToken(e,A,t?t+C:C,x,q+A.length==v?w:"",y));if(D>=z){s=s.slice(z-q);q=z;break}q=D;x=""}s=l.slice(n,n=h[r++]);t=Id(h[r++])}}else for(var r=1;r<h.length;r+=2)e.addToken(e,l.slice(n,n=h[r]),Id(h[r+1]));e=void 0}c&&f==b&&!d.measuredSomething&&(c[0]= d.pre.appendChild(Sa(a.display.measure)),d.measuredSomething=!0);e&&(f=u(a.doc,e.to.line))}while(e);!c||d.measuredSomething||c[0]||(c[0]=d.pre.appendChild(g?p("span","\u00a0"):Sa(a.display.measure)));d.pre.firstChild||ia(a.doc,b)||d.pre.appendChild(document.createTextNode("\u00a0"));var I;c&&B&&(I=V(f))&&(g=I.length-1,I[g].from==I[g].to&&--g,f=I[g],I=I[g-1],f.from+1==f.to&&I&&f.level<I.level&&(c=c[d.pos-1])&&c.parentNode.insertBefore(c.measureRight=Sa(a.display.measure),c.nextSibling));J(a,"renderLine", a,b,d.pre);return d.pre}function Kd(a,b,c,d,e,f){if(b){if(Jc.test(b))for(var g=document.createDocumentFragment(),h=0;;){Jc.lastIndex=h;var k=Jc.exec(b),l=k?k.index-h:b.length-h;l&&(g.appendChild(document.createTextNode(b.slice(h,h+l))),a.col+=l);if(!k)break;h+=l+1;"\t"==k[0]?(k=a.cm.options.tabSize,k-=a.col%k,g.appendChild(p("span",zd(k),"cm-tab")),a.col+=k):(l=p("span","\u2022","cm-invalidchar"),l.title="\\u"+k[0].charCodeAt(0).toString(16),g.appendChild(l),a.col+=1)}else{a.col+=b.length;var g=document.createTextNode(b)}if(c|| d||e||a.measure)return b=c||"",d&&(b+=d),e&&(b+=e),l=p("span",[g],b),f&&(l.title=f),a.pre.appendChild(l);a.pre.appendChild(g)}}function xe(a,b,c,d,e){for(var f=a.cm.options.lineWrapping,g=0;g<b.length;++g){var h=b.charAt(g),k=0==g;"\ud800"<=h&&"\udbff">h&&g<b.length-1?(h=b.slice(g,g+2),++g):g&&f&&Lb(b,g)&&a.pre.appendChild(p("wbr"));var l=a.measure[a.pos],k=a.measure[a.pos]=Kd(a,h,c,k&&d,g==b.length-1&&e);l&&(k.leftSide=l.leftSide||l);B&&f&&" "==h&&g&&!/\s/.test(b.charAt(g-1))&&g<b.length-1&&!/\s/.test(b.charAt(g+ 1))&&(k.style.whiteSpace="normal");a.pos+=h.length}b.length&&(a.measuredSomething=!0)}function ye(a){function b(a){for(var b=" ",e=0;e<a.length-2;++e)b+=e%2?" ":"\u00a0";return b+" "}return function(c,d,e,f,g,h){return a(c,d.replace(/ {3,}/,b),e,f,g,h)}}function Ld(a,b,c,d){if(d=!d&&c.replacedWith)if(a.copyWidgets&&(d=d.cloneNode(!0)),a.pre.appendChild(d),a.measure){if(b)a.measure[a.pos]=d;else{var e=Sa(a.cm.display.measure);if("bookmark"!=c.type||c.insertLeft){if(a.measure[a.pos])return;a.measure[a.pos]= a.pre.insertBefore(e,d)}else a.measure[a.pos]=a.pre.appendChild(e)}a.measuredSomething=!0}a.pos+=b}function Fc(a,b,c,d,e){function f(a,c,d){var f=e;a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);Dd(a);Ed(a,d);c=f?f(a):1;c!=a.height&&R(a,c);M(a,"change",a,b)}var g=b.from,h=b.to,k=b.text,l=u(a,g.line),n=u(a,h.line),m=L(k),q=c?c[k.length-1]:null,r=h.line-g.line;if(0==g.ch&&0==h.ch&&""==m){for(var p=0,s=k.length-1,t=[];p<s;++p)t.push(new Ga(k[p],c?c[p]: null,e));f(n,n.text,q);r&&a.remove(g.line,r);t.length&&a.insert(g.line,t)}else if(l==n)if(1==k.length)f(l,l.text.slice(0,g.ch)+m+l.text.slice(h.ch),q);else{t=[];p=1;for(s=k.length-1;p<s;++p)t.push(new Ga(k[p],c?c[p]:null,e));t.push(new Ga(m+l.text.slice(h.ch),q,e));f(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null);a.insert(g.line+1,t)}else if(1==k.length)f(l,l.text.slice(0,g.ch)+k[0]+n.text.slice(h.ch),c?c[0]:null),a.remove(g.line+1,r);else{f(l,l.text.slice(0,g.ch)+k[0],c?c[0]:null);f(n,m+n.text.slice(h.ch), q);p=1;s=k.length-1;for(t=[];p<s;++p)t.push(new Ga(k[p],c?c[p]:null,e));1<r&&a.remove(g.line+1,r-1);a.insert(g.line+1,t)}M(a,"change",a,b);ea(a,d.anchor,d.head,null,!0)}function Mb(a){this.lines=a;this.parent=null;for(var b=0,c=a.length,d=0;b<c;++b)a[b].parent=this,d+=a[b].height;this.height=d}function hb(a){this.children=a;for(var b=0,c=0,d=0,e=a.length;d<e;++d){var f=a[d],b=b+f.chunkSize(),c=c+f.height;f.parent=this}this.size=b;this.height=c;this.parent=null}function Ea(a,b,c){function d(a,f,g){if(a.linked)for(var h= 0;h<a.linked.length;++h){var k=a.linked[h];if(k.doc!=f){var l=g&&k.sharedHist;if(!c||l)b(k.doc,l),d(k.doc,a,l)}}}d(a,null,!0)}function Pc(a,b){if(b.cm)throw Error("This document is already in use.");a.doc=b;b.cm=a;Tc(a);Ja(a);a.options.lineWrapping||Zb(a);a.options.mode=b.modeOption;D(a)}function u(a,b){for(b-=a.first;!a.lines;)for(var c=0;;++c){var d=a.children[c],e=d.chunkSize();if(b<e){a=d;break}b-=e}return a.lines[b]}function Ec(a,b,c){var d=[],e=b.line;a.iter(b.line,c.line+1,function(a){a=a.text; e==c.line&&(a=a.slice(0,c.ch));e==b.line&&(a=a.slice(b.ch));d.push(a);++e});return d}function Kc(a,b,c){var d=[];a.iter(b,c,function(a){d.push(a.text)});return d}function R(a,b){for(var c=b-a.height,d=a;d;d=d.parent)d.height+=c}function P(a){if(null==a.parent)return null;var b=a.parent;a=ca(b.lines,a);for(var c=b.parent;c;b=c,c=c.parent)for(var d=0;c.children[d]!=b;++d)a+=c.children[d].chunkSize();return a+b.first}function Oa(a,b){var c=a.first;a:do{for(var d=0,e=a.children.length;d<e;++d){var f= a.children[d],g=f.height;if(b<g){a=f;continue a}b-=g;c+=f.chunkSize()}return c}while(!a.lines);d=0;for(e=a.lines.length;d<e;++d){f=a.lines[d].height;if(b<f)break;b-=f}return c+d}function Qa(a,b){b=$(a.doc,b);for(var c=0,d=b.parent,e=0;e<d.lines.length;++e){var f=d.lines[e];if(f==b)break;else c+=f.height}for(f=d.parent;f;d=f,f=d.parent)for(e=0;e<f.children.length;++e){var g=f.children[e];if(g==d)break;else c+=g.height}return c}function V(a){var b=a.order;null==b&&(b=a.order=ze(a.text));return b}function Nb(a){return{done:[], undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,generation:a||1,maxGeneration:a||1}}function Md(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans);++f})}function Dc(a,b){var c={from:{line:b.from.line,ch:b.from.ch},to:Ac(b),text:Ec(a,b.from,b.to)};Md(a,c,b.from.line,b.to.line+1);Ea(a,function(a){Md(a,c,b.from.line,b.to.line+1)},!0);return c}function td(a,b,c,d){var e= a.history;e.undone.length=0;var f=+new Date,g=L(e.done);if(g&&(e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastTime>f-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))){var h=L(g.changes);x(b.from,b.to)&&x(b.from,h.to)?h.to=Ac(b):g.changes.push(Dc(a,b));g.anchorAfter=c.anchor;g.headAfter=c.head}else for(g={changes:[Dc(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g),e.generation= ++e.maxGeneration;e.done.length>e.undoDepth;)e.done.shift();e.lastTime=f;e.lastOp=d;e.lastOrigin=b.origin}function ve(a){if(!a)return null;for(var b=0,c;b<a.length;++b)a[b].marker.explicitlyCleared?c||(c=a.slice(0,b)):c&&c.push(a[b]);return c?c.length?c:null:a}function Ob(a,b){for(var c=0,d=[];c<a.length;++c){var e=a[c],f=e.changes,g=[];d.push({changes:g,anchorBefore:e.anchorBefore,headBefore:e.headBefore,anchorAfter:e.anchorAfter,headAfter:e.headAfter});for(e=0;e<f.length;++e){var h=f[e],k;g.push({from:h.from, to:h.to,text:h.text});if(b)for(var l in h)(k=l.match(/^spans_(\d+)$/))&&-1<ca(b,Number(k[1]))&&(L(g)[l]=h[l],delete h[l])}}return d}function Pb(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function Nd(a,b,c,d){for(var e=0;e<a.length;++e){for(var f=a[e],g=!0,h=0;h<f.changes.length;++h){var k=f.changes[h];f.copied||(k.from=ma(k.from),k.to=ma(k.to));if(c<k.from.line)k.from.line+=d,k.to.line+=d;else if(b<=k.to.line){g=!1;break}}f.copied||(f.anchorBefore=ma(f.anchorBefore),f.headBefore=ma(f.headBefore), f.anchorAfter=ma(f.anchorAfter),f.readAfter=ma(f.headAfter),f.copied=!0);g?(Pb(f.anchorBefore),Pb(f.headBefore),Pb(f.anchorAfter),Pb(f.headAfter)):(a.splice(0,e+1),e=0)}}function ud(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;Nd(a.done,c,d,e);Nd(a.undone,c,d,e)}function Ae(){Ya(this)}function Xa(a){a.stop||(a.stop=Ae);return a}function A(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Od(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Ya(a){A(a); Od(a)}function jd(a){var b=a.which;null==b&&(a.button&1?b=1:a.button&2?b=3:a.button&4&&(b=2));va&&a.ctrlKey&&1==b&&(b=3);return b}function v(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))}function aa(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else if(a=a._handlers&&a._handlers[b])for(b=0;b<a.length;++b)if(a[b]==c){a.splice(b,1);break}} function J(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)}function M(a,b){function c(a){return function(){a.apply(null,e)}}var d=a._handlers&&a._handlers[b];if(d){var e=Array.prototype.slice.call(arguments,2);da||(++xb,da=[],setTimeout(Be,0));for(var f=0;f<d.length;++f)da.push(c(d[f]))}}function X(a,b,c){J(a,c||b.type,a,b);return(null!=b.defaultPrevented?b.defaultPrevented:!1==b.returnValue)||b.codemirrorIgnore}function Be(){--xb; var a=da;da=null;for(var b=0;b<a.length;++b)a[b]()}function ba(a,b){var c=a._handlers&&a._handlers[b];return c&&0<c.length}function Ha(a){a.prototype.on=function(a,c){v(this,a,c)};a.prototype.off=function(a,c){aa(this,a,c)}}function Ub(){this.id=null}function xa(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));d=d||0;for(e=e||0;d<b;++d)"\t"==a.charAt(d)?e+=c-e%c:++e;return e}function zd(a){for(;Qb.length<=a;)Qb.push(L(Qb)+" ");return Qb[a]}function L(a){return a[a.length-1]}function dd(a){if(Ia)a.selectionStart= 0,a.selectionEnd=a.value.length;else try{a.select()}catch(b){}}function ca(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;++c)if(a[c]==b)return c;return-1}function Pd(a,b){function c(){}c.prototype=a;var d=new c;b&&Jb(b,d);return d}function Jb(a,b){b||(b={});for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function $c(a){for(var b=[],c=0;c<a;++c)b.push(void 0);return b}function O(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function cb(a){return/\w/.test(a)|| "\u0080"<a&&(a.toUpperCase()!=a.toLowerCase()||Ce.test(a))}function Qd(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function p(a,b,c,d){a=document.createElement(a);c&&(a.className=c);d&&(a.style.cssText=d);if("string"==typeof b)Wc(a,b);else if(b)for(c=0;c<b.length;++c)a.appendChild(b[c]);return a}function Ma(a){for(var b=a.childNodes.length;0<b;--b)a.removeChild(a.firstChild);return a}function W(a,b){return Ma(a).appendChild(b)}function Wc(a,b){Q?(a.innerHTML="",a.appendChild(document.createTextNode(b))): a.textContent=b}function y(a){return a.getBoundingClientRect()}function Lb(){return!1}function Na(a){if(null!=Wa)return Wa;var b=p("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");W(a,b);b.offsetWidth&&(Wa=b.offsetHeight-b.clientHeight);return Wa||0}function Sa(a){if(null==Lc){var b=p("span","\u200b");W(a,p("span",[b,document.createTextNode("x")]));0!=a.firstChild.offsetHeight&&(Lc=1>=b.offsetWidth&&2<b.offsetHeight&&!ra)}return Lc?p("span","\u200b"):p("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px")} function de(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];if(g.from<c&&g.to>b||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function kc(a){return a.level%2?a.to:a.from}function lc(a){return a.level%2?a.from:a.to}function vb(a){return(a=V(a))?kc(a[0]):0}function wb(a){var b=V(a);return b?lc(L(b)):a.text.length}function Rd(a,b){var c=u(a.doc,b),d=$(a.doc,c);d!=c&&(b=P(d));d=(c=V(d))?c[0].level%2?wb(d):vb(d):0;return r(b, d)}function De(a,b){for(var c,d;c=nb(d=u(a.doc,b));)b=c.find().to.line;d=(c=V(d))?c[0].level%2?vb(d):wb(d):d.text.length;return r(b,d)}function mc(a,b){for(var c=0,d;c<a.length;++c){var e=a[c];if(e.from<b&&e.to>b)return ya=null,c;if(e.from==b||e.to==b)if(null==d)d=c;else{var e=e.level,f=a[d].level,g=a[0].level,e=e==g?!0:f==g?!1:e<f;if(e)return ya=d,c;ya=c;return d}}ya=null;return d}function Mc(a,b,c,d){if(!d)return b+c;do b+=c;while(0<b&&pc.test(a.text.charAt(b)));return b}function oc(a,b,c,d){var e= V(a);if(!e)return Ad(a,b,c,d);var f=mc(e,b),g=e[f];for(b=Mc(a,b,g.level%2?-c:c,d);;){if(b>g.from&&b<g.to)return b;if(b==g.from||b==g.to){if(mc(e,b)==f)return b;g=e[f+c];return 0<c==g.level%2?g.to:g.from}g=e[f+=c];if(!g)return null;b=0<c==g.level%2?Mc(a,g.to,-1,d):Mc(a,g.from,1,d)}}function Ad(a,b,c,d){b+=c;if(d)for(;0<b&&pc.test(a.text.charAt(b));)b+=c;return 0>b||b>a.text.length?null:b}var Da=/gecko\/\d/i.test(navigator.userAgent),B=/MSIE \d/.test(navigator.userAgent),ra=B&&(null==document.documentMode|| 8>document.documentMode),Q=B&&(null==document.documentMode||9>document.documentMode),K=/WebKit\//.test(navigator.userAgent),Ee=K&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Fe=/Chrome\//.test(navigator.userAgent),S=/Opera\//.test(navigator.userAgent),uc=/Apple Computer/.test(navigator.vendor),Xb=/KHTML\//.test(navigator.userAgent),Vd=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Wd=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),ke=/PhantomJS/.test(navigator.userAgent),Ia=/AppleWebKit/.test(navigator.userAgent)&& /Mobile\/\w+/.test(navigator.userAgent),Tb=Ia||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),va=Ia||/Mac/.test(navigator.platform),Ge=/win/i.test(navigator.platform),oa=S&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);oa&&(oa=Number(oa[1]));oa&&15<=oa&&(S=!1,K=!0);var Cd=va&&(Ee||S&&(null==oa||12.11>oa)),tc=Da||B&&!Q,sd=!1,Pa=!1,ja,je=0,Bb,Ab,id=0,Cb=0,T=null;B?T=-0.53:Da?T=15:Fe?T=-0.7:uc&&(T=-1/3);var nd,xc=null,yc,Ac=m.changeEnd=function(a){return a.text? r(a.from.line+a.text.length-1,L(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};m.Pos=r;m.prototype={constructor:m,focus:function(){window.focus();N(this);ha(this);Ua(this)},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]!=b||"mode"==a)c[a]=b,pa.hasOwnProperty(a)&&t(this,pa[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){for(var b=this.state.keyMaps, c=0;c<b.length;++c)if(b[c]==a||"string"!=typeof b[c]&&b[c].name==a)return b.splice(c,1),!0},addOverlay:t(null,function(a,b){var c=a.token?a:m.getMode(this.options,a);if(c.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:c,modeSpec:a,opaque:b&&b.opaque});this.state.modeGen++;D(this)}),removeOverlay:t(null,function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a){b.splice(c,1);this.state.modeGen++; D(this);break}}}),indentLine:t(null,function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract");Fa(this.doc,a)&&Eb(this,a,b,c)}),indentSelection:t(null,function(a){var b=this.doc.sel;if(x(b.from,b.to))return Eb(this,b.from.line,a);for(var c=b.to.line-(b.to.ch?0:1),b=b.from.line;b<=c;++b)Eb(this,b,a)}),getTokenAt:function(a,b){var c=this.doc;a=s(c,a);for(var d=Ra(this,a.line,b),e=this.doc.mode,c=u(c,a.line),c=new db(c.text,this.options.tabSize);c.pos< a.ch&&!c.eol();){c.start=c.pos;var f=e.token(c,d)}return{start:c.start,end:c.pos,string:c.current(),className:f||null,type:f||null,state:d}},getTokenTypeAt:function(a){a=s(this.doc,a);var b=Hd(this,u(this.doc,a.line)),c=0,d=(b.length-1)/2;a=a.ch;if(0==a)return b[2];for(;;){var e=c+d>>1;if((e?b[2*e-1]:0)>=a)d=e;else if(b[2*e+1]<a)c=e+1;else return b[2*e+2]}},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?m.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){if(ib.hasOwnProperty(b)){var c= ib[b],d=this.getModeAt(a);return d[b]&&c[d[b]]||d.helperType&&c[d.helperType]||c[d.name]}},getStateAfter:function(a,b){var c=this.doc;a=Math.max(c.first,Math.min(null==a?c.first+c.size-1:a,c.first+c.size-1));return Ra(this,a+1,b)},cursorCoords:function(a,b){var c;c=this.doc.sel;c=null==a?c.head:"object"==typeof a?s(this.doc,a):a?c.from:c.to;return U(this,c,b||"page")},charCoords:function(a,b){return rb(this,s(this.doc,a),b||"page")},coordsChar:function(a,b){a=ad(this,a,b||"page");return nc(this,a.left, a.top)},lineAtHeight:function(a,b){a=ad(this,{top:a,left:0},b||"page").top;return Oa(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c=!1,d=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>d&&(a=d,c=!0);d=u(this.doc,a);return jc(this,u(this.doc,a),{top:0,left:0},b||"page").top+(c?d.height:0)},defaultTextHeight:function(){return sa(this.display)},defaultCharWidth:function(){return Sc(this.display)},setGutterMarker:t(null,function(a,b,c){return Ib(this,a,function(a){var e= a.gutterMarkers||(a.gutterMarkers={});e[b]=c;!c&&Qd(e)&&(a.gutterMarkers=null);return!0})}),clearGutter:t(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,D(b,d,d+1),Qd(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),addLineClass:t(null,function(a,b,c){return Ib(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass";if(a[e]){if(RegExp("(?:^|\\s)"+c+"(?:$|\\s)").test(a[e]))return!1;a[e]+=" "+ c}else a[e]=c;return!0})}),removeLineClass:t(null,function(a,b,c){return Ib(this,a,function(a){var e="text"==b?"textClass":"background"==b?"bgClass":"wrapClass",f=a[e];if(f)if(null==c)a[e]=null;else{var g=f.match(RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!g)return!1;var h=g.index+g[0].length;a[e]=f.slice(0,g.index)+(g.index&&h!=f.length?" ":"")+f.slice(h)||null}else return!1;return!0})}),addLineWidget:t(null,function(a,b,c){return we(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if("number"== typeof a){if(!Fa(this.doc,a))return null;var b=a;a=u(this.doc,a);if(!a)return null}else if(b=P(a),null==b)return null;return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=U(this,s(this.doc,a));var g=a.bottom,h=a.left;b.style.position="absolute";f.sizer.appendChild(b); if("over"==d)g=a.top;else if("above"==d||"near"==d){var k=Math.max(f.wrapper.clientHeight,this.doc.height),l=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=k&&(g=a.bottom);h+b.offsetWidth>l&&(h=l-b.offsetWidth)}b.style.top=g+"px";b.style.left=b.style.right="";"right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/ 2),b.style.left=h+"px");c&&(a=yb(this,h,g,h+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&$a(this,a.scrollTop),null!=a.scrollLeft&&Ba(this,a.scrollLeft))},triggerOnKeyDown:t(null,hd),execCommand:function(a){return vc[a](this)},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=s(this.doc,a);f<b&&(a=Hc(this.doc,a,e,c,d),!a.hitSide);++f);return a},moveH:t(null,function(a,b){var c=this.doc.sel,c=c.shift||c.extend||x(c.from,c.to)?Hc(this.doc,c.head,a,b,this.options.rtlMoveVisually): 0>a?c.from:c.to;F(this.doc,c,c,a)}),deleteH:t(null,function(a,b){var c=this.doc.sel;x(c.from,c.to)?fa(this.doc,"",c.from,Hc(this.doc,c.head,a,b,!1),"+delete"):fa(this.doc,"",c.from,c.to,"+delete");this.curOp.userSelChange=!0}),findPosV:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=s(this.doc,a);f<b&&(a=U(this,a,"div"),null==d?d=a.left:a.left=d,a=Bd(this,a,e,c),!a.hitSide);++f);return a},moveV:t(null,function(a,b){var c=this.doc.sel,d=U(this,c.head,"div");null!=c.goalColumn&&(d.left=c.goalColumn); var e=Bd(this,d,a,b);"page"==b&&Gc(this,0,rb(this,e,"div").top-d.top);F(this.doc,e,e,a);c.goalColumn=d.left}),toggleOverwrite:function(a){if(null==a||a!=this.state.overwrite)(this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite","")},hasFocus:function(){return this.state.focused},scrollTo:t(null,function(a,b){Hb(this,a,b)}),getScrollInfo:function(){var a=this.display.scroller, b=qa;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-b,width:a.scrollWidth-b,clientHeight:a.clientHeight-b,clientWidth:a.clientWidth-b}},scrollIntoView:t(null,function(a,b){"number"==typeof a&&(a=r(a,0));b||(b=0);var c=a;a&&null==a.line||(this.curOp.scrollToPos=a?s(this.doc,a):this.doc.sel.head,this.curOp.scrollToPosMargin=b,c=U(this,this.curOp.scrollToPos));c=yb(this,c.left,c.top-b,c.right,c.bottom+b);Hb(this,c.scrollLeft,c.scrollTop)}),setSize:t(null,function(a,b){function c(a){return"number"== typeof a||/^\d+$/.test(String(a))?a+"px":a}null!=a&&(this.display.wrapper.style.width=c(a));null!=b&&(this.display.wrapper.style.height=c(b));this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0);this.curOp.forceUpdate=!0}),operation:function(a){return qc(this,a)},refresh:t(null,function(){ta(this);Hb(this,this.doc.scrollLeft,this.doc.scrollTop);D(this)}),swapDoc:t(null,function(a){var b=this.doc;b.cm=null;Pc(this,a);ta(this);Y(this,!0);Hb(this,a.scrollLeft, a.scrollTop);return b}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};Ha(m);var pa=m.optionHandlers={},Rb=m.defaults={},Qc=m.Init={toString:function(){return"CodeMirror.Init"}};w("value","",function(a,b){a.setValue(b)},!0);w("mode",null,function(a,b){a.doc.modeOption=b;Ja(a)},!0);w("indentUnit",2,Ja,!0);w("indentWithTabs", !1);w("smartIndent",!0);w("tabSize",4,function(a){Ja(a);ta(a);D(a)},!0);w("electricChars",!0);w("rtlMoveVisually",!Ge);w("theme","default",function(a){Oc(a);La(a)},!0);w("keyMap","default",Uc);w("extraKeys",null);w("onKeyEvent",null);w("onDragEvent",null);w("lineWrapping",!1,function(a){a.options.lineWrapping?(a.display.wrapper.className+=" CodeMirror-wrap",a.display.sizer.style.minWidth=""):(a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-wrap",""),Zb(a));Tc(a);D(a); ta(a);setTimeout(function(){$b(a)},100)},!0);w("gutters",[],function(a){Sb(a.options);La(a)},!0);w("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?bc(a.display)+"px":"0";a.refresh()},!0);w("coverGutterNextToScrollbar",!1,$b,!0);w("lineNumbers",!1,function(a){Sb(a.options);La(a)},!0);w("firstLineNumber",1,La,!0);w("lineNumberFormatter",function(a){return a},La,!0);w("showCursorWhenSelecting",!1,dc,!0);w("readOnly",!1,function(a,b){"nocursor"==b?(Vb(a),a.display.input.blur()):b||Y(a,!0)}); w("dragDrop",!0);w("cursorBlinkRate",530);w("cursorScrollMargin",0);w("cursorHeight",1);w("workTime",100);w("workDelay",100);w("flattenSpans",!0);w("pollInterval",100);w("undoDepth",40,function(a,b){a.doc.history.undoDepth=b});w("historyEventDelay",500);w("viewportMargin",10,function(a){a.refresh()},!0);w("maxHighlightLength",1E4,function(a){Ja(a);a.refresh()},!0);w("moveInputWithCursor",!0,function(a,b){b||(a.display.inputDiv.style.top=a.display.inputDiv.style.left=0)});w("tabindex",null,function(a, b){a.display.input.tabIndex=b||""});w("autofocus",null);var Sd=m.modes={},jb=m.mimeModes={};m.defineMode=function(a,b){m.defaults.mode||"null"==a||(m.defaults.mode=a);if(2<arguments.length){b.dependencies=[];for(var c=2;c<arguments.length;++c)b.dependencies.push(arguments[c])}Sd[a]=b};m.defineMIME=function(a,b){jb[a]=b};m.resolveMode=function(a){if("string"==typeof a&&jb.hasOwnProperty(a))a=jb[a];else if(a&&"string"==typeof a.name&&jb.hasOwnProperty(a.name)){var b=jb[a.name];a=Pd(b,a);a.name=b.name}else if("string"== typeof a&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return m.resolveMode("application/xml");return"string"==typeof a?{name:a}:a||{name:"null"}};m.getMode=function(a,b){b=m.resolveMode(b);var c=Sd[b.name];if(!c)return m.getMode(a,"text/plain");c=c(a,b);if(kb.hasOwnProperty(b.name)){var d=kb[b.name],e;for(e in d)d.hasOwnProperty(e)&&(c.hasOwnProperty(e)&&(c["_"+e]=c[e]),c[e]=d[e])}c.name=b.name;return c};m.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}});m.defineMIME("text/plain","null"); var kb=m.modeExtensions={};m.extendMode=function(a,b){var c=kb.hasOwnProperty(a)?kb[a]:kb[a]={};Jb(b,c)};m.defineExtension=function(a,b){m.prototype[a]=b};m.defineDocExtension=function(a,b){I.prototype[a]=b};m.defineOption=w;var Wb=[];m.defineInitHook=function(a){Wb.push(a)};var ib=m.helpers={};m.registerHelper=function(a,b,c){ib.hasOwnProperty(a)||(ib[a]=m[a]={});ib[a][b]=c};m.isWordChar=cb;m.copyState=wa;m.startState=Zc;m.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode== a)break;b=c.state;a=c.mode}return c||{mode:a,state:b}};var vc=m.commands={selectAll:function(a){a.setSelection(r(a.firstLine(),0),r(a.lastLine()))},killLine:function(a){var b=a.getCursor(!0),c=a.getCursor(!1),d=!x(b,c);d||a.getLine(b.line).length!=b.ch?a.replaceRange("",b,d?c:r(b.line),"+delete"):a.replaceRange("",b,r(b.line+1,0),"+delete")},deleteLine:function(a){var b=a.getCursor().line;a.replaceRange("",r(b,0),r(b),"+delete")},delLineLeft:function(a){var b=a.getCursor();a.replaceRange("",r(b.line, 0),b,"+delete")},undo:function(a){a.undo()},redo:function(a){a.redo()},goDocStart:function(a){a.extendSelection(r(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(r(a.lastLine()))},goLineStart:function(a){a.extendSelection(Rd(a,a.getCursor().line))},goLineStartSmart:function(a){var b=a.getCursor(),c=Rd(a,b.line),d=a.getLineHandle(c.line),e=V(d);e&&0!=e[0].level?a.extendSelection(c):(d=Math.max(0,d.text.search(/\S/)),a.extendSelection(r(c.line,b.line==c.line&&b.ch<=d&&b.ch?0:d)))},goLineEnd:function(a){a.extendSelection(De(a, a.getCursor().line))},goLineRight:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:b},"div"))},goLineLeft:function(a){var b=a.charCoords(a.getCursor(),"div").top+5;a.extendSelection(a.coordsChar({left:0,top:b},"div"))},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1, "char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1, "word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection("\t","end","+input")},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.replaceSelection("\t","end","+input")},transposeChars:function(a){var b=a.getCursor(),c=a.getLine(b.line); 0<b.ch&&b.ch<c.length-1&&a.replaceRange(c.charAt(b.ch)+c.charAt(b.ch-1),r(b.line,b.ch-1),r(b.line,b.ch+1))},newlineAndIndent:function(a){t(a,function(){a.replaceSelection("\n","end","+input");a.indentLine(a.getCursor().line,null,!0)})()},toggleOverwrite:function(a){a.toggleOverwrite()}},Z=m.keyMap={};Z.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore", Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};Z.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext", "Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore",fallthrough:"basic"};Z.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter", "Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delLineLeft",fallthrough:["basic","emacsy"]};Z["default"]=va?Z.macDefault:Z.pcDefault;Z.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp", "Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"};m.lookupKey=ab;m.isModifierKey=od;m.keyName=pd;m.fromTextArea=function(a,b){function c(){a.value=l.getValue()}b||(b={});b.value=a.value;!b.tabindex&&a.tabindex&&(b.tabindex=a.tabindex);!b.placeholder&&a.placeholder&&(b.placeholder=a.placeholder);if(null==b.autofocus){var d=document.body;try{d=document.activeElement}catch(e){}b.autofocus=d==a||null!= a.getAttribute("autofocus")&&d==document.body}if(a.form&&(v(a.form,"submit",c),!b.leaveSubmitMethodAlone)){var f=a.form,g=f.submit;try{var h=f.submit=function(){c();f.submit=g;f.submit();f.submit=h}}catch(k){}}a.style.display="none";var l=m(function(b){a.parentNode.insertBefore(b,a.nextSibling)},b);l.save=c;l.getTextArea=function(){return a};l.toTextArea=function(){c();a.parentNode.removeChild(l.getWrapperElement());a.style.display="";a.form&&(aa(a.form,"submit",c),"function"==typeof a.form.submit&& (a.form.submit=g))};return l};db.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a?b==a:b&&(a.test?a.test(b):a(b)))return++this.pos,b},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a= this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1<a)return this.pos=a,!0},backUp:function(a){this.pos-=a},column:function(){this.lastColumnPos<this.start&&(this.lastColumnValue=xa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start);return this.lastColumnValue},indentation:function(){return xa(this.string, null,this.tabSize)},match:function(a,b,c){if("string"==typeof a){var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return!1!==b&&(this.pos+=a.length),!0}else{if((a=this.string.slice(this.pos).match(a))&&0<a.index)return null;a&&!1!==b&&(this.pos+=a[0].length);return a}},current:function(){return this.string.slice(this.start,this.pos)}};m.StringStream=db;m.TextMarker=ga;Ha(ga);ga.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm, b=a&&!a.curOp;b&&za(a);if(ba(this,"clear")){var c=this.find();c&&M(this,"clear",c.from,c.to)}for(var d=c=null,e=0;e<this.lines.length;++e){var f=this.lines[e],g=gb(f.markedSpans,this);null!=g.to&&(d=P(f));for(var h=f,k=f.markedSpans,l=g,n=void 0,m=0;m<k.length;++m)k[m]!=l&&(n||(n=[])).push(k[m]);h.markedSpans=n;null!=g.from?c=P(f):this.collapsed&&!ia(this.doc,f)&&a&&R(f,sa(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(e=0;e<this.lines.length;++e)f=$(a.doc,this.lines[e]),g=mb(a.doc, f),g>a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&D(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&yd(a));b&&Aa(a)}};ga.prototype.find=function(){for(var a,b,c=0;c<this.lines.length;++c){var d=this.lines[c],e=gb(d.markedSpans,this);if(null!=e.from||null!=e.to)d=P(d),null!=e.from&&(a=r(d,e.from)),null!=e.to&&(b=r(d,e.to))}return"bookmark"==this.type?a:a&&{from:a,to:b}}; ga.prototype.changed=function(){var a=this.find(),b=this.doc.cm;if(a&&b){"bookmark"!=this.type&&(a=a.from);var c=u(this.doc,a.line);ge(b,c);if(a.line>=b.display.showingFrom&&a.line<b.display.showingTo){for(a=b.display.lineDiv.firstChild;a;a=a.nextSibling)if(a.lineObj==c){a.offsetHeight!=c.height&&R(c,a.offsetHeight);break}qc(b,function(){b.curOp.selectionChanged=b.curOp.forceUpdate=b.curOp.updateMaxLine=!0})}}};ga.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp; b.maybeHiddenMarkers&&-1!=ca(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)};ga.prototype.detachLine=function(a){this.lines.splice(ca(this.lines,a),1);!this.lines.length&&this.doc.cm&&(a=this.doc.cm.curOp,(a.maybeHiddenMarkers||(a.maybeHiddenMarkers=[])).push(this))};m.SharedTextMarker=fb;Ha(fb);fb.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear(); M(this,"clear")}};fb.prototype.find=function(){return this.primary.find()};var Kb=m.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.cm=a;this.node=b};Ha(Kb);Kb.prototype.clear=Fd(function(){var a=this.line.widgets,b=P(this.line);if(null!=b&&a){for(var c=0;c<a.length;++c)a[c]==this&&a.splice(c--,1);a.length||(this.line.widgets=null);a=Qa(this.cm,this.line)<this.cm.doc.scrollTop;R(this.line,Math.max(0,this.line.height-tb(this)));a&&Gc(this.cm,0,-this.height); D(this.cm,b,b+1)}});Kb.prototype.changed=Fd(function(){var a=this.height;this.height=null;if(a=tb(this)-a)R(this.line,this.line.height+a),a=P(this.line),D(this.cm,a,a+1)});var Ga=m.Line=function(a,b,c){this.text=a;Ed(this,b);this.height=c?c(this):1};Ha(Ga);var Jd={},Jc=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;Mb.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;c<d;++c){var e=this.lines[c];this.height-=e.height;var f=e;f.parent=null;Dd(f); M(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.splice.apply(a,[a.length,0].concat(this.lines))},insertInner:function(a,b,c){this.height+=c;this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));a=0;for(c=b.length;a<c;++a)b[a].parent=this},iterN:function(a,b,c){for(b=a+b;a<b;++a)if(c(this.lines[a]))return!0}};hb.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize(); if(a<e){var f=Math.min(b,e-a),g=d.height;d.removeInner(a,f);this.height-=g-d.height;e==f&&(this.children.splice(c--,1),d.parent=null);if(0==(b-=f))break;a=0}else a-=e}25>this.size-b&&(c=[],this.collapse(c),this.children=[new Mb(c)],this.children[0].parent=this)},collapse:function(a){for(var b=0,c=this.children.length;b<c;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length;this.height+=c;for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize(); if(a<=g){f.insertInner(a,b,c);if(f.lines&&50<f.lines.length){for(;50<f.lines.length;)a=f.lines.splice(f.lines.length-25,25),a=new Mb(a),f.height-=a.height,this.children.splice(d+1,0,a),a.parent=this;this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(!(10>=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length-5,5),b=new hb(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=ca(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new hb(a.children),c.parent= a,a.children=[c,b],a=c;b.parent=a.parent}while(10<a.children.length);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0,e=this.children.length;d<e;++d){var f=this.children[d],g=f.chunkSize();if(a<g){g=Math.min(b,g-a);if(f.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=g}}};var He=0,I=m.Doc=function(a,b,c){if(!(this instanceof I))return new I(a,b,c);null==c&&(c=0);hb.call(this,[new Mb([new Ga("",null)])]);this.first=c;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.history=Nb(); this.cleanGeneration=1;this.frontier=c;c=r(c,0);this.sel={from:c,to:c,head:c,anchor:c,shift:!1,extend:!1,goalColumn:null};this.id=++He;this.modeOption=b;"string"==typeof a&&(a=ka(a));Fc(this,{from:c,to:c,text:a},null,{head:c,anchor:c})};I.prototype=Pd(hb.prototype,{constructor:I,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0,e=b.length;d<e;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a, b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Kc(this,this.first,this.first+this.size);return!1===a?b:b.join(a||"\n")},setValue:function(a){var b=r(this.first,0),c=this.first+this.size-1;Ca(this,{from:b,to:r(c,u(this,c).text.length),text:ka(a),origin:"setValue"},{head:b,anchor:b},!0)},replaceRange:function(a,b,c,d){b=s(this,b);c=c?s(this,c):b;fa(this,a,b,c,d)},getRange:function(a,b,c){a=Ec(this,s(this,a),s(this,b));return!1===c?a:a.join(c||"\n")},getLine:function(a){return(a=this.getLineHandle(a))&& a.text},setLine:function(a,b){Fa(this,a)&&fa(this,b,r(a,0),s(this,r(a)))},removeLine:function(a){a?fa(this,"",s(this,r(a-1)),s(this,r(a))):fa(this,"",r(0,0),s(this,r(1,0)))},getLineHandle:function(a){if(Fa(this,a))return u(this,a)},getLineNumber:function(a){return P(a)},getLineHandleVisualStart:function(a){"number"==typeof a&&(a=u(this,a));return $(this,a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return s(this, a)},getCursor:function(a){var b=this.sel;return ma(null==a||"head"==a?b.head:"anchor"==a?b.anchor:"end"==a||!1===a?b.to:b.from)},somethingSelected:function(){return!x(this.sel.head,this.sel.anchor)},setCursor:Ta(function(a,b,c){a=s(this,"number"==typeof a?r(a,b||0):a);c?F(this,a):ea(this,a,a)}),setSelection:Ta(function(a,b,c){ea(this,s(this,a),s(this,b||a),c)}),extendSelection:Ta(function(a,b,c){F(this,s(this,a),b&&s(this,b),c)}),getSelection:function(a){return this.getRange(this.sel.from,this.sel.to, a)},replaceSelection:function(a,b,c){Ca(this,{from:this.sel.from,to:this.sel.to,text:ka(a),origin:c},b||"around")},undo:Ta(function(){vd(this,"undo")}),redo:Ta(function(){vd(this,"redo")}),setExtending:function(a){this.sel.extend=a},historySize:function(){var a=this.history;return{undo:a.done.length,redo:a.undone.length}},clearHistory:function(){this.history=Nb(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){this.history.lastOp= this.history.lastOrigin=null;return this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Ob(this.history.done),undone:Ob(this.history.undone)}},setHistory:function(a){var b=this.history=Nb(this.history.maxGeneration);b.done=a.done.slice(0);b.undone=a.undone.slice(0)},markText:function(a,b,c){return eb(this,s(this,a),s(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget: b),insertLeft:b&&b.insertLeft};a=s(this,a);return eb(this,a,a,c,"bookmark")},findMarksAt:function(a){a=s(this,a);var b=[],c=u(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;c<b.length;++c)null!=b[c].from&&a.push(b[c].marker)});return a},posFromIndex:function(a){var b,c=this.first;this.iter(function(d){d= d.text.length+1;if(d>a)return b=a,!0;a-=d;++c});return s(this,r(c,b))},indexFromPos:function(a){a=s(this,a);var b=a.ch;if(a.line<this.first||0>a.ch)return 0;this.iter(this.first,a.line,function(a){b+=a.text.length+1});return b},copy:function(a){var b=new I(Kc(this,this.first,this.first+this.size),this.modeOption,this.first);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn}; a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.to<c&&(c=a.to);b=new I(Kc(this,b,c),a.mode||this.modeOption,b);a.sharedHist&&(b.history=this.history);(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist});b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}];return b},unlinkDoc:function(a){a instanceof m&&(a=a.doc);if(this.linked)for(var b= 0;b<this.linked.length;++b)if(this.linked[b].doc==a){this.linked.splice(b,1);a.unlinkDoc(this);break}if(a.history==this.history){var c=[a.id];Ea(a,function(a){c.push(a.id)},!0);a.history=Nb();a.history.done=Ob(this.history.done,c);a.history.undone=Ob(this.history.undone,c)}},iterLinkedDocs:function(a){Ea(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});I.prototype.eachLine=I.prototype.iter;var Ie=["iter","insert","remove","copy","getEditor"],lb;for(lb in I.prototype)I.prototype.hasOwnProperty(lb)&& 0>ca(Ie,lb)&&(m.prototype[lb]=function(a){return function(){return a.apply(this.doc,arguments)}}(I.prototype[lb]));Ha(I);m.e_stop=Ya;m.e_preventDefault=A;m.e_stopPropagation=Od;var da,xb=0;m.on=v;m.off=aa;m.signal=J;var qa=30,kd=m.Pass={toString:function(){return"CodeMirror.Pass"}};Ub.prototype={set:function(a,b){clearTimeout(this.id);this.id=setTimeout(b,a)}};m.countColumn=xa;var Qb=[""],Ce=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,pc=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/; m.replaceGetRect=function(a){y=a};var qe=function(){if(Q)return!1;var a=p("div");return"draggable"in a||"dragDrop"in a}();Da?Lb=function(a,b){return 36==a.charCodeAt(b-1)&&39==a.charCodeAt(b)}:uc&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?Lb=function(a,b){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(a.slice(b-1,b+1))}:K&&!/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)&&(Lb=function(a,b){if(1<b&&45==a.charCodeAt(b-1)){if(/\w/.test(a.charAt(b-2))&&/[^\-?\.]/.test(a.charAt(b)))return!0; if(2<b&&/[\d\.,]/.test(a.charAt(b-2))&&/[\d\.,]/.test(a.charAt(b)))return!1}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|\u2026[\w~`@#$%\^&*(_=+{[><]/.test(a.slice(b-1,b+1))});var Wa,Lc,ka=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)}; m.splitLines=ka;var le=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},cd=function(){var a=p("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(),na={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc", 32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};m.keyNames=na;(function(){for(var a=0;10>a;a++)na[a+48]=String(a);for(a=65;90>= a;a++)na[a]=String.fromCharCode(a);for(a=1;12>=a;a++)na[a+111]=na[a+63235]="F"+a})();var ya,ze=function(){function a(a){return 255>=a?b.charAt(a):1424<=a&&1524>=a?"R":1536<=a&&1791>=a?c.charAt(a-1536):1792<=a&&2220>=a?"r":"L"}var b="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",c="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr", d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/;return function(b){if(!d.test(b))return!1;for(var c=b.length,n=[],m=0,q;m<c;++m)n.push(a(b.charCodeAt(m)));for(var m=0,p="L";m<c;++m)q=n[m],"m"==q?n[m]=p:p=q;m=0;for(p="L";m<c;++m)q=n[m],"1"==q&&"r"==p?n[m]="n":f.test(q)&&(p=q,"r"==q&&(n[m]="R"));m=1;for(p=n[0];m<c-1;++m)q=n[m],"+"==q&&"1"==p&&"1"==n[m+1]?n[m]="1":","!=q||p!=n[m+1]||"1"!=p&&"n"!=p||(n[m]=p),p=q;for(m=0;m<c;++m)if(q=n[m],","==q)n[m]="N";else if("%"== q){for(p=m+1;p<c&&"%"==n[p];++p);var r=m&&"!"==n[m-1]||p<c-1&&"1"==n[p]?"1":"N";for(q=m;q<p;++q)n[q]=r;m=p-1}m=0;for(p="L";m<c;++m)q=n[m],"L"==p&&"1"==q?n[m]="L":f.test(q)&&(p=q);for(m=0;m<c;++m)if(e.test(n[m])){for(p=m+1;p<c&&e.test(n[p]);++p);q="L"==(p<c-1?n[p]:"L");r="L"==(m?n[m-1]:"L")||q?"L":"R";for(q=m;q<p;++q)n[q]=r;m=p-1}for(var p=[],s,m=0;m<c;)if(g.test(n[m])){q=m;for(++m;m<c&&g.test(n[m]);++m);p.push({from:q,to:m,level:0})}else{var t=m,r=p.length;for(++m;m<c&&"L"!=n[m];++m);for(q=t;q<m;)if(h.test(n[q])){t< q&&p.splice(r,0,{from:t,to:q,level:1});t=q;for(++q;q<m&&h.test(n[q]);++q);p.splice(r,0,{from:t,to:q,level:2});t=q}else++q;t<m&&p.splice(r,0,{from:t,to:m,level:1})}1==p[0].level&&(s=b.match(/^\s+/))&&(p[0].from=s[0].length,p.unshift({from:0,to:s[0].length,level:0}));1==L(p).level&&(s=b.match(/\s+$/))&&(L(p).to-=s[0].length,p.push({from:c-s[0].length,to:c,level:0}));p[0].level!=L(p).level&&p.push({from:c,to:c,level:p[0].level});return p}}();m.version="3.16.0";return m}();
 
media/js/configpress.js CHANGED
@@ -7,52 +7,6 @@
7
 
8
  jQuery(document).ready(function() {
9
 
10
- /**
11
- * Highlight the specified DOM area
12
- *
13
- * @param {String} selector
14
- * @param {String} status
15
- *
16
- * @returns {void}
17
- *
18
- * @access public
19
- */
20
- function highlight(selector, status) {
21
- if (status === 'success') {
22
- jQuery(selector).effect("highlight", {
23
- color: '#98CE90'
24
- }, 3000);
25
- } else {
26
- jQuery(selector).effect("highlight", {
27
- color: '#FFAAAA'
28
- }, 3000);
29
- }
30
- }
31
-
32
- var editor = CodeMirror.fromTextArea(
33
- document.getElementById("configpress"), {}
34
- );
35
-
36
- jQuery('#save_config').bind('click', function(event) {
37
- event.preventDefault();
38
- jQuery.ajax(aamLocal.ajaxurl, {
39
- type: 'POST',
40
- dataType: 'json',
41
- data: {
42
- action: 'aam',
43
- sub_action: 'saveConfigpress',
44
- config: editor.getValue(),
45
- _ajax_nonce: aamLocal.nonce
46
- },
47
- success: function(response) {
48
- highlight('#control_panel', response.status);
49
- },
50
- error: function() {
51
- highlight('#control_panel', 'failure');
52
- }
53
- });
54
- });
55
-
56
  jQuery('#info_screen').bind('click', function(event){
57
  event.preventDefault();
58
  jQuery('#configpress_area').hide();
7
 
8
  jQuery(document).ready(function() {
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  jQuery('#info_screen').bind('click', function(event){
11
  event.preventDefault();
12
  jQuery('#configpress_area').hide();
media/js/extension.js CHANGED
@@ -23,14 +23,16 @@ jQuery(document).ready(function() {
23
  }
24
  },
25
  fnDrawCallback: function() {
26
- jQuery('.extension-action-purchase').each(function() {
27
  var link = jQuery(this).attr('link');
28
  var extension = jQuery(this).attr('extension');
29
 
30
- jQuery(this).bind('click', function() {
31
- jQuery('.extension-error-list').hide();
 
 
32
  //show the dialog
33
- jQuery('#install_extension').dialog({
34
  resizable: false,
35
  height: 'auto',
36
  width: '30%',
@@ -53,7 +55,7 @@ jQuery(document).ready(function() {
53
 
54
  if (license) {
55
  //add loader
56
- jQuery('#install_extension').append(jQuery('<div/>', {
57
  'class' : 'loading-extension'
58
  }));
59
 
@@ -62,7 +64,7 @@ jQuery(document).ready(function() {
62
  dataType: 'json',
63
  data: {
64
  action: 'aam',
65
- sub_action: 'installExtension',
66
  extension: extension,
67
  license: license,
68
  _ajax_nonce: aamLocal.nonce
@@ -73,7 +75,7 @@ jQuery(document).ready(function() {
73
  } else {
74
  showErrorMessage(
75
  response.reasons,
76
- '#install_extension .extension-error-list'
77
  );
78
  jQuery('#license_key').effect('highlight', 2000);
79
  }
@@ -83,12 +85,12 @@ jQuery(document).ready(function() {
83
  reasons.push('Unexpected Application Error');
84
  showErrorMessage(
85
  reasons,
86
- '#install_extension .extension-error-list'
87
  );
88
  jQuery('#license_key').effect('highlight', 2000);
89
  },
90
  complete: function(){
91
- jQuery('.loading-extension', '#install_extension').remove();
92
  }
93
  });
94
  } else {
@@ -107,17 +109,21 @@ jQuery(document).ready(function() {
107
  });
108
  });
109
  });
110
- jQuery('.extension-action-ok').each(function() {
111
- jQuery(this).bind('click', function() {
 
 
112
  var license = jQuery(this).attr('license');
113
  var extension = jQuery(this).attr('extension');
114
  var dialog = this;
115
 
116
- jQuery('#installed_license_key').html(license);
117
- jQuery('.extension-error-list').hide();
 
 
118
 
119
  //show the dialog
120
- jQuery('#update_extension').dialog({
121
  resizable: false,
122
  height: 'auto',
123
  width: '25%',
@@ -132,7 +138,7 @@ jQuery(document).ready(function() {
132
  dataType: 'json',
133
  data: {
134
  action: 'aam',
135
- sub_action: 'removeExtension',
136
  extension: extension,
137
  license: license,
138
  _ajax_nonce: aamLocal.nonce
@@ -143,7 +149,7 @@ jQuery(document).ready(function() {
143
  } else {
144
  showErrorMessage(
145
  response.reasons,
146
- '#update_extension .extension-error-list'
147
  );
148
  jQuery(dialog).dialog('close');
149
  }
23
  }
24
  },
25
  fnDrawCallback: function() {
26
+ jQuery('.add-license-btn').each(function() {
27
  var link = jQuery(this).attr('link');
28
  var extension = jQuery(this).attr('extension');
29
 
30
+ jQuery(this).bind('click', function(event) {
31
+ event.preventDefault();
32
+
33
+ jQuery('.license-error-list').hide();
34
  //show the dialog
35
+ jQuery('#install_license').dialog({
36
  resizable: false,
37
  height: 'auto',
38
  width: '30%',
55
 
56
  if (license) {
57
  //add loader
58
+ jQuery('#install_license').append(jQuery('<div/>', {
59
  'class' : 'loading-extension'
60
  }));
61
 
64
  dataType: 'json',
65
  data: {
66
  action: 'aam',
67
+ sub_action: 'installLicense',
68
  extension: extension,
69
  license: license,
70
  _ajax_nonce: aamLocal.nonce
75
  } else {
76
  showErrorMessage(
77
  response.reasons,
78
+ '#install_license .license-error-list'
79
  );
80
  jQuery('#license_key').effect('highlight', 2000);
81
  }
85
  reasons.push('Unexpected Application Error');
86
  showErrorMessage(
87
  reasons,
88
+ '#install_license .license-error-list'
89
  );
90
  jQuery('#license_key').effect('highlight', 2000);
91
  },
92
  complete: function(){
93
+ jQuery('.loading-extension', '#install_license').remove();
94
  }
95
  });
96
  } else {
109
  });
110
  });
111
  });
112
+ jQuery('.view-license-btn').each(function() {
113
+ jQuery(this).bind('click', function(event) {
114
+ event.preventDefault();
115
+
116
  var license = jQuery(this).attr('license');
117
  var extension = jQuery(this).attr('extension');
118
  var dialog = this;
119
 
120
+ jQuery('#installed_license_key').html(
121
+ (license ? license : 'undefined')
122
+ );
123
+ jQuery('.license-error-list').hide();
124
 
125
  //show the dialog
126
+ jQuery('#update_license').dialog({
127
  resizable: false,
128
  height: 'auto',
129
  width: '25%',
138
  dataType: 'json',
139
  data: {
140
  action: 'aam',
141
+ sub_action: 'removeLicense',
142
  extension: extension,
143
  license: license,
144
  _ajax_nonce: aamLocal.nonce
149
  } else {
150
  showErrorMessage(
151
  response.reasons,
152
+ '#update_license .license-error-list'
153
  );
154
  jQuery(dialog).dialog('close');
155
  }
media/js/properties.js DELETED
@@ -1,64 +0,0 @@
1
- CodeMirror.defineMode("properties", function() {
2
- return {
3
- token: function(stream, state) {
4
- var sol = stream.sol() || state.afterSection;
5
- var eol = stream.eol();
6
-
7
- state.afterSection = false;
8
-
9
- if (sol) {
10
- if (state.nextMultiline) {
11
- state.inMultiline = true;
12
- state.nextMultiline = false;
13
- } else {
14
- state.position = "def";
15
- }
16
- }
17
-
18
- if (eol && !state.nextMultiline) {
19
- state.inMultiline = false;
20
- state.position = "def";
21
- }
22
-
23
- if (sol) {
24
- while (stream.eatSpace())
25
- ;
26
- }
27
-
28
- var ch = stream.next();
29
-
30
- if (sol && (ch === "#" || ch === "!" || ch === ";")) {
31
- state.position = "comment";
32
- stream.skipToEnd();
33
- return "comment";
34
- } else if (sol && ch === "[") {
35
- state.afterSection = true;
36
- stream.skipTo("]");
37
- stream.eat("]");
38
- return "header";
39
- } else if (ch === "=" || ch === ":") {
40
- state.position = "quote";
41
- return null;
42
- } else if (ch === "\\" && state.position === "quote") {
43
- if (stream.next() !== "u") { // u = Unicode sequence \u1234
44
- // Multiline value
45
- state.nextMultiline = true;
46
- }
47
- }
48
-
49
- return state.position;
50
- },
51
- startState: function() {
52
- return {
53
- position: "def", // Current position, "def", "quote" or "comment"
54
- nextMultiline: false, // Is the next line multiline value
55
- inMultiline: false, // Is the current line a multiline value
56
- afterSection: false // Did we just open a section
57
- };
58
- }
59
-
60
- };
61
- });
62
-
63
- CodeMirror.defineMIME("text/x-properties", "properties");
64
- CodeMirror.defineMIME("text/x-ini", "properties");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,65 +1,61 @@
1
  === Advanced Access Manager ===
2
- Contributors: vasyl_m
3
  Tags: security, login, access manager, access, access control, capability, role, user, post filter, category
4
  Requires at least: 3.4.2
5
- Tested up to: 3.9.1
6
- Stable tag: 2.8
7
 
8
  The powerful and easy-to-use tool to improve security and define access to your
9
  posts, pages and backend areas for single blog or multisite network.
10
 
11
  == Description ==
12
 
13
- **Advanced Access Manager** (aka **AAM**) is known nowadays as one of the best 
access control
14
- access control and security enhancement tool. It is easy-to-use and at the same
15
- time very powerful plugin that gives you the flexible control over your single
16
- blog or multisite network.
17
-
18
- With **AAM** you can control access to different areas of your website like posts,
19
- pages, categories, widgets or menus. The access can be defined for any user, role
20
- or visitor.
21
-
22
- Below is the list of highlighted features that has been implemented and proved in
23
- current **AAM** version:
24
-
25
- **Secure Admin Login**.
26
- Control the login process to your website. Define the number or possible login
27
- attempts, trace the failed login request's geographical location, lockout IP
28
- addresses for potential hacker attacks.
29
-
30
- **Control Access to Posts, Pages or Categories**.
31
- Restrict access to your posts, pages, custom post types of categories for any
32
- user, role or visitor. Define whether the viewer can ''see'', ''read'' or ''comment''
33
- on any post or page. For more extended list of possible options consider to get
34
- the [AAM Plus Package](http://wpaam.com/aam-extensions/aam-plus-package/). To
35
- learn more about this feature check our
36
- [Posts and Pages Tutorial](http://wpaam.com/tutorials/posts-pages-general-overview/).
37
-
38
- **Control Access to Media Files**.
39
- Define your custom access to media files for any user, role or visitor. The feature
40
- works without any extra configurations to your server .htaccess file. Find more
41
- information about this topic in our
42
- [Tutorial](http://wpaam.com/tutorials/control-access-to-media-files/).
43
-
44
- **Manage Roles and Capabilities**.
45
- Manage the list of roles and capabilities. This feature has been designed and tested
46
- by hundreds of experienced WordPress user and developers. It gives you possibility
47
- to create, update or delete any role or capability. For security reasons, this
48
- feature is limited by default but can be easily activated. Read more about it in
49
- our [AAM Super Admin Tutorial](http://wpaam.com/tutorials/aam-super-admin/).
50
-
51
- **Track User Activity**.
52
- Track logged in user activities like when user was logged in or logged out. Explore
53
- more tracking options with [AAM Activities](http://wpaam.com/aam-extensions/aam-activities/).
54
-
55
- **Filter Backend Menu**.
56
- Control access to backend menu (including submenus). For more information check
57
  [How to Manage Admin Menu](http://wpaam.com/tutorials/how-to-manage-admin-menu/).
58
 
59
- **Filter Metaboxes and Widgets**.
60
- Filter available metaboxes or widgets for any user, role or visitor.
61
 
62
- And many, many more...
 
 
 
 
63
 
64
  The **AAM** has multi-language UI:
65
 
@@ -97,10 +93,44 @@ the list of additional metaboxes can be picked by AAM.
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  = 2.8 =
101
  * Fixed issue with AAM Control Manage HTML
102
  * Fixed issue with __PHP_Incomplete_Class
103
- * Addedd AAM Plugin Manager Extension
104
  * Removed Deprecated ConfigPress Object from the core
105
 
106
  = 2.7.3 =
1
  === Advanced Access Manager ===
2
+ Contributors: vasyltech
3
  Tags: security, login, access manager, access, access control, capability, role, user, post filter, category
4
  Requires at least: 3.4.2
5
+ Tested up to: 4.3.1
6
+ Stable tag: 2.9.2
7
 
8
  The powerful and easy-to-use tool to improve security and define access to your
9
  posts, pages and backend areas for single blog or multisite network.
10
 
11
  == Description ==
12
 
13
+ **Advanced Access Manager** (aka **AAM**) is known to be one of the very best
access control
14
+ security enhancement tools available for WordPress. A very powerful yet easy-to-use plugin,
15
+ AAM gives you flexible and customizable control over your single blog or multisite network.
16
+
17
+ With **AAM**, you can control access to various areas of your website, including posts, pages,
18
+ categories, widgets, or menus. The access you set can be defined and tailored for any user, role,
19
+ or visitor.
20
+
21
+ Below is the list of highlighted features that have been implemented and proven in the current
22
+ version of **AAM**:
23
+
24
+ **Secure Admin Login**: Control the login process to your website. AAM allows you to define the
25
+ number of possible login attempts, trace a failed login request's geographical location, and even
26
+ lockout selected IP addresses by default to protect from potential hacker attacks.
27
+
28
+ **Control Access to Posts, Pages or Categories**: This feature allows you to restrict access to
29
+ your posts, pages, and custom post types or categories for any user, role, or visitor. Define
30
+ whether the viewer can "see", "read" or "comment" on any post or page. For a more extended list
31
+ of possible options, consider getting the [AAM Plus Package](http://wpaam.com/aam-extensions/aam-plus-package/). To learn more about this feature and
32
+ its use, check out our [Posts and Pages Tutorial](http://wpaam.com/tutorials/posts-pages-general-overview/).
33
+
34
+ **Control Access to Media Files**: AAM allows you to configure custom access to media files for
35
+ any user, role, or visitor. This feature works without any additional changes to your server’s
36
+ .htaccess file. You can find more information about this topic in our [Tutorial](http://wpaam.com/tutorials).
37
+
38
+ **Manage Roles and Capabilities**: This feature has been designed and tested by hundreds of
39
+ experienced WordPress user and developers. It gives you the ability to create, update, or delete
40
+ any role or capability. For security reasons, this feature is limited by default, but can be easily
41
+ activated. Read more about this feature, including how to activate its full functionality, in our [AAM
42
+ Super Admin Tutorial](http://wpaam.com/tutorials/aam-super-admin/).
43
+
44
+ **Track User Activity**: Track logged-in user activities like when user was logged in or logged out.
45
+ To expand the tracking capabilities available, check out our [AAM Activities](http://wpaam.com/aam-extensions/aam-activities/) extension.
46
+
47
+ **Filter Backend Menu**: Control access to backend menu, (including submenus). For more
48
+ information on how this feature works, and for directions on how to use it, check out this tutorial-
 
 
 
 
 
 
 
 
49
  [How to Manage Admin Menu](http://wpaam.com/tutorials/how-to-manage-admin-menu/).
50
 
51
+ **Filter Metaboxes and Widgets**: Filter available metaboxes or widgets for any user, role or
52
+ visitor.
53
 
54
+ And many, many more... Check out our tutorials for more information about some of these
55
+
56
+ features, including step-by-step directions on how to use them.
57
+
58
+ To take AAM even further, check out the [additional extensions](http://wpaam.com/extensions/) we offer.
59
 
60
  The **AAM** has multi-language UI:
61
 
93
 
94
  == Changelog ==
95
 
96
+ = 2.9.2 =
97
+ * Small fix in core
98
+ * Moved ConfigPress as stand-alone plugin. It is no longer a part of AAM
99
+ * Styled the AAM notification message
100
+
101
+ = 2.8.8 =
102
+ * AAM is changing the primary owner to VasylTech
103
+ * Removed contextual help menu
104
+ * Added notification about AAM v3
105
+
106
+ = 2.8.7 =
107
+ * Tested and verified functionality on the latest WordPress release
108
+ * Removed AAM Plus Package. Happy hours are over.
109
+
110
+ = 2.8.5 =
111
+ * Fixed bugs reported by (@TheThree)
112
+ * Improved CSS
113
+
114
+ = 2.8.4 =
115
+ * Updated the extension list pricing
116
+ * Updated AAM Plugin Manager
117
+
118
+ = 2.8.3 =
119
+ * Improved ConfigPress security (thanks to Tom Adams from security.dxw.com)
120
+ * Added ConfigPress new setting control_permalink
121
+
122
+ = 2.8.2 =
123
+ * Fixed issue with Default acces to posts/pages for AAM Plus Package
124
+ * Fixed issue with AAM Plugin Manager for lower PHP version
125
+
126
+ = 2.8.1 =
127
+ * Simplified the Repository internal handling
128
+ * Added Development License Support
129
+
130
  = 2.8 =
131
  * Fixed issue with AAM Control Manage HTML
132
  * Fixed issue with __PHP_Incomplete_Class
133
+ * Added AAM Plugin Manager Extension
134
  * Removed Deprecated ConfigPress Object from the core
135
 
136
  = 2.7.3 =