Responsive Menu - Version 3.1.4

Version Description

(10th June 2017) = * Requires PHP 5.4 * Added CSRF protection using nonces in admin * Updated wpdb method to use replace() instead of update() to protect from migration issues * Added selectize JS library * Allow custom trigger types for button - Pro Only * Fixed custom HTML icon bug - Pro Only

Download this release

Release Info

Developer peterfeatherstone
Plugin Icon 128x128 Responsive Menu
Version 3.1.4
Comparing to
See all releases

Code changes from version 3.1.3 to 3.1.4

README.md CHANGED
@@ -1 +1,6 @@
1
- [![Codeship Status](https://www.codeship.io/projects/0f626140-0c02-0135-749e-1e85f2753028/status?branch=master)](https://codeship.com/projects/215186)
 
 
 
 
 
1
+ [![Codeship Status](https://app.codeship.com/projects/e616fbf0-13cd-0135-911a-3e3c5a78d2e0/status?branch=master)](https://codeship.com/projects/215186)
2
+
3
+ ### Supported by BrowserStack
4
+ Thanks to [BrowserStack](https://browserstack.com/) for their support of this open-source project.
5
+
6
+ <img src="https://responsive.menu/wp-content/themes/responsive-menu/imgs/browserstacklogo.svg" width="150">
app/Collections/OptionsCollection.php CHANGED
@@ -8,13 +8,13 @@ class OptionsCollection implements \ArrayAccess, \Countable {
8
 
9
  public function __construct(array $options = []) {
10
  $this->options = array_map(function($o) {
11
- return is_array($o) ? stripslashes(json_encode($o)) : stripslashes($o);
12
  }, $options);
13
  }
14
 
15
  public function add(array $option) {
16
  $value = $option[key($option)];
17
- $this->options[key($option)] = is_array($value) ? stripslashes(json_encode($value)) : stripslashes($value);
18
  }
19
 
20
  public function getActiveArrow() {
8
 
9
  public function __construct(array $options = []) {
10
  $this->options = array_map(function($o) {
11
+ return is_array($o) ? json_encode($o) : $o;
12
  }, $options);
13
  }
14
 
15
  public function add(array $option) {
16
  $value = $option[key($option)];
17
+ $this->options[key($option)] = is_array($value) ? json_encode($value) : $value;
18
  }
19
 
20
  public function getActiveArrow() {
app/Controllers/AdminController.php CHANGED
@@ -37,10 +37,13 @@ class AdminController {
37
  );
38
  }
39
 
40
- public function update($new_options, $nav_menus, $location_menus) {
41
  $validator = new Validator();
42
  $errors = [];
43
- if($validator->validate($new_options)):
 
 
 
44
  try {
45
  $options = $this->manager->updateOptions($new_options);
46
  $task = new UpdateOptionsTask;
@@ -88,9 +91,9 @@ class AdminController {
88
  }
89
 
90
  public function import($imported_options, $nav_menus, $location_menus) {
 
91
  if(!empty($imported_options)):
92
  $validator = new Validator();
93
- $errors = [];
94
  if($validator->validate($imported_options)):
95
  try {
96
  unset($imported_options['button_click_trigger']);
37
  );
38
  }
39
 
40
+ public function update($valid_nonce, $new_options, $nav_menus, $location_menus) {
41
  $validator = new Validator();
42
  $errors = [];
43
+ if(!$valid_nonce):
44
+ $alert = ['danger' => 'CSRF token not valid'];
45
+ $options = new OptionsCollection($new_options);
46
+ elseif($validator->validate($new_options)):
47
  try {
48
  $options = $this->manager->updateOptions($new_options);
49
  $task = new UpdateOptionsTask;
91
  }
92
 
93
  public function import($imported_options, $nav_menus, $location_menus) {
94
+ $errors = [];
95
  if(!empty($imported_options)):
96
  $validator = new Validator();
 
97
  if($validator->validate($imported_options)):
98
  try {
99
  unset($imported_options['button_click_trigger']);
app/Database/Database.php CHANGED
@@ -16,8 +16,8 @@ class Database {
16
  return $flattened;
17
  }
18
 
19
- public function update($table, array $to_update, array $where) {
20
- return $this->db->update($this->db->prefix . $table, $to_update, $where);
21
  }
22
 
23
  public function delete($table, $name) {
16
  return $flattened;
17
  }
18
 
19
+ public function update($table, array $to_update) {
20
+ return $this->db->replace($this->db->prefix . $table, $to_update, ['%s', '%s']);
21
  }
22
 
23
  public function delete($table, $name) {
app/Management/OptionManager.php CHANGED
@@ -23,9 +23,8 @@ class OptionManager {
23
  $updated_options = $this->combineOptions($options);
24
  foreach($updated_options as $name => $val):
25
  $val = is_array($val) ? json_encode($val) : $val;
26
- $val = stripslashes($val);
27
  $updated_options[$name] = $val;
28
- $this->db->update('responsive_menu', ['value' => $val], ['name' => $name]);
29
  endforeach;
30
  return new OptionsCollection($updated_options);
31
  }
@@ -34,7 +33,6 @@ class OptionManager {
34
  $updated_options = $this->combineOptions($options);
35
  foreach($options as $name => $val):
36
  $val = is_array($val) ? json_encode($val) : $val;
37
- $val = stripslashes($val);
38
  $updated_options[$name] = $val;
39
  $this->db->insert('responsive_menu', ['name' => $name, 'value' => $val]);
40
  endforeach;
@@ -45,7 +43,6 @@ class OptionManager {
45
  $updated_options = $this->combineOptions($options);
46
  foreach($options as $name => $val):
47
  $val = is_array($val) ? json_encode($val) : $val;
48
- $val = stripslashes($val);
49
  $updated_options[$name] = $val;
50
  unset($updated_options[$name]);
51
  $this->db->delete('responsive_menu', ['name' => $name]);
@@ -57,7 +54,6 @@ class OptionManager {
57
  $new_options = $this->combineOptions($options);
58
  foreach($options as $name => $val):
59
  $val = is_array($val) ? json_encode($val) : $val;
60
- $val = stripslashes($val);
61
  $new_options[$name] = $val;
62
  endforeach;
63
  return new OptionsCollection($new_options);
23
  $updated_options = $this->combineOptions($options);
24
  foreach($updated_options as $name => $val):
25
  $val = is_array($val) ? json_encode($val) : $val;
 
26
  $updated_options[$name] = $val;
27
+ $this->db->update('responsive_menu', ['name' => $name, 'value' => $val]);
28
  endforeach;
29
  return new OptionsCollection($updated_options);
30
  }
33
  $updated_options = $this->combineOptions($options);
34
  foreach($options as $name => $val):
35
  $val = is_array($val) ? json_encode($val) : $val;
 
36
  $updated_options[$name] = $val;
37
  $this->db->insert('responsive_menu', ['name' => $name, 'value' => $val]);
38
  endforeach;
43
  $updated_options = $this->combineOptions($options);
44
  foreach($options as $name => $val):
45
  $val = is_array($val) ? json_encode($val) : $val;
 
46
  $updated_options[$name] = $val;
47
  unset($updated_options[$name]);
48
  $this->db->delete('responsive_menu', ['name' => $name]);
54
  $new_options = $this->combineOptions($options);
55
  foreach($options as $name => $val):
56
  $val = is_array($val) ? json_encode($val) : $val;
 
57
  $new_options[$name] = $val;
58
  endforeach;
59
  return new OptionsCollection($new_options);
app/Validation/Validator.php CHANGED
@@ -14,7 +14,7 @@ class Validator {
14
  $validator = new $validator_obj($options[$option]);
15
  if(!$validator->validate()):
16
  $nice_name = str_replace('_', ' ', ucwords($option));
17
- $this->errors[$option][] = 'Validation failed on <a class="validation-error" href="#responsive-menu-' . str_replace('_', '-', $option) . '">' . $nice_name . '</a>: ' . $validator->getErrorMessage();
18
  endif;
19
  endif;
20
  endforeach;
14
  $validator = new $validator_obj($options[$option]);
15
  if(!$validator->validate()):
16
  $nice_name = str_replace('_', ' ', ucwords($option));
17
+ $this->errors[$option][] = 'Validation failed on <a class="validation-error scroll-to-option" href="#responsive-menu-' . str_replace('_', '-', $option) . '">' . $nice_name . '</a>: ' . $validator->getErrorMessage();
18
  endif;
19
  endif;
20
  endforeach;
config/default_options.php CHANGED
@@ -33,6 +33,7 @@ function get_responsive_menu_default_options() {
33
  'button_font_icon_type' => 'font-awesome',
34
  'button_font_icon_when_clicked' => null,
35
  'button_font_icon_when_clicked_type' => 'font-awesome',
 
36
  'button_click_trigger' => '#responsive-menu-button',
37
  'button_title_position' => 'left',
38
  'button_title_line_height' => '13',
33
  'button_font_icon_type' => 'font-awesome',
34
  'button_font_icon_when_clicked' => null,
35
  'button_font_icon_when_clicked_type' => 'font-awesome',
36
+ 'button_trigger_type' => 'click',
37
  'button_click_trigger' => '#responsive-menu-button',
38
  'button_title_position' => 'left',
39
  'button_title_line_height' => '13',
config/routing.php CHANGED
@@ -30,7 +30,8 @@ if(is_admin()):
30
  update_option('responsive_menu_current_page', $_POST['responsive-menu-current-page']);
31
 
32
  if(isset($_POST['responsive-menu-submit'])):
33
- echo $controller->update($_POST['menu'], $menus_array, $location_menus);
 
34
  elseif(isset($_POST['responsive-menu-reset'])):
35
  echo $controller->reset(get_responsive_menu_default_options(), $menus_array, $location_menus);
36
  elseif(isset($_POST['responsive-menu-import'])):
30
  update_option('responsive_menu_current_page', $_POST['responsive-menu-current-page']);
31
 
32
  if(isset($_POST['responsive-menu-submit'])):
33
+ $valid_nonce = wp_verify_nonce($_POST['responsive-menu-nonce'], 'update');
34
+ echo $controller->update($valid_nonce, wp_unslash($_POST['menu']), $menus_array, $location_menus);
35
  elseif(isset($_POST['responsive-menu-reset'])):
36
  echo $controller->reset(get_responsive_menu_default_options(), $menus_array, $location_menus);
37
  elseif(isset($_POST['responsive-menu-import'])):
config/twig.php CHANGED
@@ -25,6 +25,10 @@ $twig->addFunction(new Twig_SimpleFunction('header_bar_items', function($items)
25
  return $items;
26
  }));
27
 
 
 
 
 
28
  $twig->addFunction(new Twig_SimpleFunction('build_menu', function($env, $options) {
29
 
30
  $translator = $env->getFilter('translate')->getCallable();
25
  return $items;
26
  }));
27
 
28
+ $twig->addFunction(new Twig_SimpleFunction('csrf', function() {
29
+ return wp_nonce_field('update', 'responsive-menu-nonce', true, false);
30
+ }));
31
+
32
  $twig->addFunction(new Twig_SimpleFunction('build_menu', function($env, $options) {
33
 
34
  $translator = $env->getFilter('translate')->getCallable();
config/wp/scripts.php CHANGED
@@ -21,6 +21,9 @@ if(isset($_GET['page']) && $_GET['page'] == 'responsive-menu'):
21
  wp_enqueue_script('responsive-menu-minicolours-js', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/js/admin/minicolours.js', null, null);
22
  wp_enqueue_style('responsive-menu-minicolours-css', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/css/admin/minicolours.css', null, null);
23
 
 
 
 
24
  wp_enqueue_script('jquery-ui-core');
25
 
26
  wp_register_style('responsive-menu-admin-css', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/css/admin/admin.css', false, null);
21
  wp_enqueue_script('responsive-menu-minicolours-js', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/js/admin/minicolours.js', null, null);
22
  wp_enqueue_style('responsive-menu-minicolours-css', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/css/admin/minicolours.css', null, null);
23
 
24
+ wp_enqueue_script('responsive-menu-selectize-js', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/js/admin/selectize.js', null, null);
25
+ wp_enqueue_style('responsive-menu-selectize-css', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/css/admin/selectize.css', null, null);
26
+
27
  wp_enqueue_script('jquery-ui-core');
28
 
29
  wp_register_style('responsive-menu-admin-css', plugin_dir_url(dirname(dirname(__FILE__))) . 'public/css/admin/admin.css', false, null);
public/css/admin/admin.css CHANGED
@@ -32,6 +32,7 @@
32
  text-align: center;
33
  }
34
 
 
35
  .container-fluid form.form-horizontal .bootstrap-select,
36
  .container-fluid form.form-horizontal input,
37
  .container-fluid form.form-horizontal textarea {
@@ -39,6 +40,10 @@
39
  display: inline-block;
40
  }
41
 
 
 
 
 
42
  .container-fluid form.form-horizontal .input-group input {
43
  width: 100% !important;
44
  }
@@ -135,6 +140,17 @@
135
  margin-right: 5px;
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
138
  .pro::before,
139
  .semi-pro::before {
140
  content: "PRO";
@@ -161,7 +177,7 @@
161
  font-weight: normal;
162
  }
163
 
164
- .example {
165
  padding-top: 2px;
166
  color: dimgray;
167
  font-size: 10px;
@@ -174,6 +190,14 @@
174
  margin-left: 5px;
175
  }
176
 
 
 
 
 
 
 
 
 
177
 
178
  .draggable {
179
  border: 1px solid #DADADA;
32
  text-align: center;
33
  }
34
 
35
+ .container-fluid form.form-horizontal .selectize-input,
36
  .container-fluid form.form-horizontal .bootstrap-select,
37
  .container-fluid form.form-horizontal input,
38
  .container-fluid form.form-horizontal textarea {
40
  display: inline-block;
41
  }
42
 
43
+ .container-fluid form.form-horizontal input#responsive-menu-button-trigger-type-selectized {
44
+ width: auto !important;
45
+ }
46
+
47
  .container-fluid form.form-horizontal .input-group input {
48
  width: 100% !important;
49
  }
140
  margin-right: 5px;
141
  }
142
 
143
+ .selectize-control.multi .selectize-input > div,
144
+ .selectize-control.multi .selectize-input > div.active {
145
+ background: #5cb85c;
146
+ color: white;
147
+ }
148
+
149
+ .selectize-control.multi .selectize-input > div[data-value="mouseover"],
150
+ .selectize-control.multi .selectize-input > div.active[data-value="mouseover"] {
151
+ background: #DE4B42;
152
+ }
153
+
154
  .pro::before,
155
  .semi-pro::before {
156
  content: "PRO";
177
  font-weight: normal;
178
  }
179
 
180
+ .sub_sub_title {
181
  padding-top: 2px;
182
  color: dimgray;
183
  font-size: 10px;
190
  margin-left: 5px;
191
  }
192
 
193
+ .option-highlight .well,
194
+ .option-highlight,
195
+ .table-hover > tbody > tr.option-highlight
196
+ .table-hover > tbody > tr.option-highlight:hover,
197
+ .table-hover > tbody > tr.option-highlight td,
198
+ .table-hover > tbody > tr.option-highlight td:hover {
199
+ background-color: #ffff99 !important;
200
+ }
201
 
202
  .draggable {
203
  border: 1px solid #DADADA;
public/css/admin/selectize.css ADDED
@@ -0,0 +1,324 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * selectize.css (v0.12.4)
3
+ * Copyright (c) 2013–2015 Brian Reavis & contributors
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
6
+ * file except in compliance with the License. You may obtain a copy of the License at:
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software distributed under
10
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ * ANY KIND, either express or implied. See the License for the specific language
12
+ * governing permissions and limitations under the License.
13
+ *
14
+ * @author Brian Reavis <brian@thirdroute.com>
15
+ */
16
+
17
+ .selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
18
+ visibility: visible !important;
19
+ background: #f2f2f2 !important;
20
+ background: rgba(0, 0, 0, 0.06) !important;
21
+ border: 0 none !important;
22
+ -webkit-box-shadow: inset 0 0 12px 4px #ffffff;
23
+ box-shadow: inset 0 0 12px 4px #ffffff;
24
+ }
25
+ .selectize-control.plugin-drag_drop .ui-sortable-placeholder::after {
26
+ content: '!';
27
+ visibility: hidden;
28
+ }
29
+ .selectize-control.plugin-drag_drop .ui-sortable-helper {
30
+ -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
31
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
32
+ }
33
+ .selectize-dropdown-header {
34
+ position: relative;
35
+ padding: 5px 8px;
36
+ border-bottom: 1px solid #d0d0d0;
37
+ background: #f8f8f8;
38
+ -webkit-border-radius: 3px 3px 0 0;
39
+ -moz-border-radius: 3px 3px 0 0;
40
+ border-radius: 3px 3px 0 0;
41
+ }
42
+ .selectize-dropdown-header-close {
43
+ position: absolute;
44
+ right: 8px;
45
+ top: 50%;
46
+ color: #303030;
47
+ opacity: 0.4;
48
+ margin-top: -12px;
49
+ line-height: 20px;
50
+ font-size: 20px !important;
51
+ }
52
+ .selectize-dropdown-header-close:hover {
53
+ color: #000000;
54
+ }
55
+ .selectize-dropdown.plugin-optgroup_columns .optgroup {
56
+ border-right: 1px solid #f2f2f2;
57
+ border-top: 0 none;
58
+ float: left;
59
+ -webkit-box-sizing: border-box;
60
+ -moz-box-sizing: border-box;
61
+ box-sizing: border-box;
62
+ }
63
+ .selectize-dropdown.plugin-optgroup_columns .optgroup:last-child {
64
+ border-right: 0 none;
65
+ }
66
+ .selectize-dropdown.plugin-optgroup_columns .optgroup:before {
67
+ display: none;
68
+ }
69
+ .selectize-dropdown.plugin-optgroup_columns .optgroup-header {
70
+ border-top: 0 none;
71
+ }
72
+ .selectize-control.plugin-remove_button [data-value] {
73
+ position: relative;
74
+ padding-right: 24px !important;
75
+ }
76
+ .selectize-control.plugin-remove_button [data-value] .remove {
77
+ z-index: 1;
78
+ /* fixes ie bug (see #392) */
79
+ position: absolute;
80
+ top: 0;
81
+ right: 0;
82
+ bottom: 0;
83
+ width: 17px;
84
+ text-align: center;
85
+ font-weight: bold;
86
+ font-size: 12px;
87
+ color: inherit;
88
+ text-decoration: none;
89
+ vertical-align: middle;
90
+ display: inline-block;
91
+ padding: 2px 0 0 0;
92
+ border-left: 1px solid #d0d0d0;
93
+ -webkit-border-radius: 0 2px 2px 0;
94
+ -moz-border-radius: 0 2px 2px 0;
95
+ border-radius: 0 2px 2px 0;
96
+ -webkit-box-sizing: border-box;
97
+ -moz-box-sizing: border-box;
98
+ box-sizing: border-box;
99
+ }
100
+ .selectize-control.plugin-remove_button [data-value] .remove:hover {
101
+ background: rgba(0, 0, 0, 0.05);
102
+ }
103
+ .selectize-control.plugin-remove_button [data-value].active .remove {
104
+ border-left-color: #cacaca;
105
+ }
106
+ .selectize-control.plugin-remove_button .disabled [data-value] .remove:hover {
107
+ background: none;
108
+ }
109
+ .selectize-control.plugin-remove_button .disabled [data-value] .remove {
110
+ border-left-color: #ffffff;
111
+ }
112
+ .selectize-control.plugin-remove_button .remove-single {
113
+ position: absolute;
114
+ right: 28px;
115
+ top: 6px;
116
+ font-size: 23px;
117
+ }
118
+ .selectize-control {
119
+ position: relative;
120
+ }
121
+ .selectize-dropdown,
122
+ .selectize-input,
123
+ .selectize-input input {
124
+ color: #303030;
125
+ font-family: inherit;
126
+ font-size: 13px;
127
+ line-height: 18px;
128
+ -webkit-font-smoothing: inherit;
129
+ }
130
+ .selectize-input,
131
+ .selectize-control.single .selectize-input.input-active {
132
+ background: #ffffff;
133
+ cursor: text;
134
+ display: inline-block;
135
+ }
136
+ .selectize-input {
137
+ border: 1px solid #d0d0d0;
138
+ padding: 8px 8px;
139
+ display: inline-block;
140
+ width: 100%;
141
+ overflow: hidden;
142
+ position: relative;
143
+ z-index: 1;
144
+ -webkit-box-sizing: border-box;
145
+ -moz-box-sizing: border-box;
146
+ box-sizing: border-box;
147
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
148
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
149
+ -webkit-border-radius: 3px;
150
+ -moz-border-radius: 3px;
151
+ border-radius: 3px;
152
+ }
153
+ .selectize-control.multi .selectize-input.has-items {
154
+ padding: 6px 8px 3px;
155
+ }
156
+ .selectize-input.full {
157
+ background-color: #ffffff;
158
+ }
159
+ .selectize-input.disabled,
160
+ .selectize-input.disabled * {
161
+ cursor: default !important;
162
+ }
163
+ .selectize-input.focus {
164
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
165
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
166
+ }
167
+ .selectize-input.dropdown-active {
168
+ -webkit-border-radius: 3px 3px 0 0;
169
+ -moz-border-radius: 3px 3px 0 0;
170
+ border-radius: 3px 3px 0 0;
171
+ }
172
+ .selectize-input > * {
173
+ vertical-align: baseline;
174
+ display: -moz-inline-stack;
175
+ display: inline-block;
176
+ zoom: 1;
177
+ *display: inline;
178
+ }
179
+ .selectize-control.multi .selectize-input > div {
180
+ cursor: pointer;
181
+ margin: 0 3px 3px 0;
182
+ padding: 2px 6px;
183
+ background: #f2f2f2;
184
+ color: #303030;
185
+ border: 0 solid #d0d0d0;
186
+ }
187
+ .selectize-control.multi .selectize-input > div.active {
188
+ background: #e8e8e8;
189
+ color: #303030;
190
+ border: 0 solid #cacaca;
191
+ }
192
+ .selectize-control.multi .selectize-input.disabled > div,
193
+ .selectize-control.multi .selectize-input.disabled > div.active {
194
+ color: #7d7d7d;
195
+ background: #ffffff;
196
+ border: 0 solid #ffffff;
197
+ }
198
+ .selectize-input > input {
199
+ display: inline-block !important;
200
+ padding: 0 !important;
201
+ min-height: 0 !important;
202
+ max-height: none !important;
203
+ max-width: 100% !important;
204
+ margin: 0 2px 0 0 !important;
205
+ text-indent: 0 !important;
206
+ border: 0 none !important;
207
+ background: none !important;
208
+ line-height: inherit !important;
209
+ -webkit-user-select: auto !important;
210
+ -webkit-box-shadow: none !important;
211
+ box-shadow: none !important;
212
+ }
213
+ .selectize-input > input::-ms-clear {
214
+ display: none;
215
+ }
216
+ .selectize-input > input:focus {
217
+ outline: none !important;
218
+ }
219
+ .selectize-input::after {
220
+ content: ' ';
221
+ display: block;
222
+ clear: left;
223
+ }
224
+ .selectize-input.dropdown-active::before {
225
+ content: ' ';
226
+ display: block;
227
+ position: absolute;
228
+ background: #f0f0f0;
229
+ height: 1px;
230
+ bottom: 0;
231
+ left: 0;
232
+ right: 0;
233
+ }
234
+ .selectize-dropdown {
235
+ position: absolute;
236
+ z-index: 10;
237
+ border: 1px solid #d0d0d0;
238
+ background: #ffffff;
239
+ margin: -1px 0 0 0;
240
+ border-top: 0 none;
241
+ -webkit-box-sizing: border-box;
242
+ -moz-box-sizing: border-box;
243
+ box-sizing: border-box;
244
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
245
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
246
+ -webkit-border-radius: 0 0 3px 3px;
247
+ -moz-border-radius: 0 0 3px 3px;
248
+ border-radius: 0 0 3px 3px;
249
+ }
250
+ .selectize-dropdown [data-selectable] {
251
+ cursor: pointer;
252
+ overflow: hidden;
253
+ }
254
+ .selectize-dropdown [data-selectable] .highlight {
255
+ background: rgba(125, 168, 208, 0.2);
256
+ -webkit-border-radius: 1px;
257
+ -moz-border-radius: 1px;
258
+ border-radius: 1px;
259
+ }
260
+ .selectize-dropdown [data-selectable],
261
+ .selectize-dropdown .optgroup-header {
262
+ padding: 5px 8px;
263
+ }
264
+ .selectize-dropdown .optgroup:first-child .optgroup-header {
265
+ border-top: 0 none;
266
+ }
267
+ .selectize-dropdown .optgroup-header {
268
+ color: #303030;
269
+ background: #ffffff;
270
+ cursor: default;
271
+ }
272
+ .selectize-dropdown .active {
273
+ background-color: #f5fafd;
274
+ color: #495c68;
275
+ }
276
+ .selectize-dropdown .active.create {
277
+ color: #495c68;
278
+ }
279
+ .selectize-dropdown .create {
280
+ color: rgba(48, 48, 48, 0.5);
281
+ }
282
+ .selectize-dropdown-content {
283
+ overflow-y: auto;
284
+ overflow-x: hidden;
285
+ max-height: 200px;
286
+ -webkit-overflow-scrolling: touch;
287
+ }
288
+ .selectize-control.single .selectize-input,
289
+ .selectize-control.single .selectize-input input {
290
+ cursor: pointer;
291
+ }
292
+ .selectize-control.single .selectize-input.input-active,
293
+ .selectize-control.single .selectize-input.input-active input {
294
+ cursor: text;
295
+ }
296
+ .selectize-control.single .selectize-input:after {
297
+ content: ' ';
298
+ display: block;
299
+ position: absolute;
300
+ top: 50%;
301
+ right: 15px;
302
+ margin-top: -3px;
303
+ width: 0;
304
+ height: 0;
305
+ border-style: solid;
306
+ border-width: 5px 5px 0 5px;
307
+ border-color: #808080 transparent transparent transparent;
308
+ }
309
+ .selectize-control.single .selectize-input.dropdown-active:after {
310
+ margin-top: -4px;
311
+ border-width: 0 5px 5px 5px;
312
+ border-color: transparent transparent #808080 transparent;
313
+ }
314
+ .selectize-control.rtl.single .selectize-input:after {
315
+ left: 15px;
316
+ right: auto;
317
+ }
318
+ .selectize-control.rtl .selectize-input > input {
319
+ margin: 0 4px 0 -2px !important;
320
+ }
321
+ .selectize-control .selectize-input.disabled {
322
+ opacity: 0.5;
323
+ background-color: #fafafa;
324
+ }
public/js/admin/admin.js CHANGED
@@ -49,12 +49,13 @@ jQuery(function($) {
49
  form.attr('target', '');
50
  });
51
 
52
- $(document).on('click', '.validation-error', function(e) {
53
  e.preventDefault();
54
  var id_to_scroll_to = $(this).attr('href');
55
  var parent_panel_id = $(id_to_scroll_to).parents('.tab-pane').attr('id');
56
  var parent_tab = $('a[href="#' + parent_panel_id + '"]').parent('li');
57
 
 
58
  $('ul.nav-tabs li').removeClass('active');
59
  parent_tab.addClass('active');
60
 
@@ -67,6 +68,8 @@ jQuery(function($) {
67
  $('html, body').animate({
68
  scrollTop: $(id_to_scroll_to).offset().top - 50
69
  }, 1000);
 
 
70
  });
71
 
72
  $(document).on('click', '.nav-tabs li a', function() {
@@ -113,4 +116,18 @@ jQuery(function($) {
113
  }
114
  });
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  });
49
  form.attr('target', '');
50
  });
51
 
52
+ $(document).on('click', '.scroll-to-option', function(e) {
53
  e.preventDefault();
54
  var id_to_scroll_to = $(this).attr('href');
55
  var parent_panel_id = $(id_to_scroll_to).parents('.tab-pane').attr('id');
56
  var parent_tab = $('a[href="#' + parent_panel_id + '"]').parent('li');
57
 
58
+ $('tr').removeClass('option-highlight');
59
  $('ul.nav-tabs li').removeClass('active');
60
  parent_tab.addClass('active');
61
 
68
  $('html, body').animate({
69
  scrollTop: $(id_to_scroll_to).offset().top - 50
70
  }, 1000);
71
+
72
+ $(id_to_scroll_to).closest('tr').addClass('option-highlight');
73
  });
74
 
75
  $(document).on('click', '.nav-tabs li a', function() {
116
  }
117
  });
118
 
119
+ $('#responsive-menu-button-trigger-type').selectize({
120
+ plugins: ['remove_button'],
121
+ options: [
122
+ {
123
+ value:'click',
124
+ text:'Click'
125
+ },
126
+ {
127
+ value:'mouseover',
128
+ text:'Hover'
129
+ }
130
+ ]
131
+ });
132
+
133
  });
public/js/admin/selectize.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! selectize.js - v0.12.4 | https://github.com/selectize/selectize.js | Apache License (v2) */
2
+ !function(a,b){"function"==typeof define&&define.amd?define("sifter",b):"object"==typeof exports?module.exports=b():a.Sifter=b()}(this,function(){var a=function(a,b){this.items=a,this.settings=b||{diacritics:!0}};a.prototype.tokenize=function(a){if(a=e(String(a||"").toLowerCase()),!a||!a.length)return[];var b,c,d,g,i=[],j=a.split(/ +/);for(b=0,c=j.length;b<c;b++){if(d=f(j[b]),this.settings.diacritics)for(g in h)h.hasOwnProperty(g)&&(d=d.replace(new RegExp(g,"g"),h[g]));i.push({string:j[b],regex:new RegExp(d,"i")})}return i},a.prototype.iterator=function(a,b){var c;c=g(a)?Array.prototype.forEach||function(a){for(var b=0,c=this.length;b<c;b++)a(this[b],b,this)}:function(a){for(var b in this)this.hasOwnProperty(b)&&a(this[b],b,this)},c.apply(a,[b])},a.prototype.getScoreFunction=function(a,b){var c,e,f,g,h;c=this,a=c.prepareSearch(a,b),f=a.tokens,e=a.options.fields,g=f.length,h=a.options.nesting;var i=function(a,b){var c,d;return a?(a=String(a||""),d=a.search(b.regex),d===-1?0:(c=b.string.length/a.length,0===d&&(c+=.5),c)):0},j=function(){var a=e.length;return a?1===a?function(a,b){return i(d(b,e[0],h),a)}:function(b,c){for(var f=0,g=0;f<a;f++)g+=i(d(c,e[f],h),b);return g/a}:function(){return 0}}();return g?1===g?function(a){return j(f[0],a)}:"and"===a.options.conjunction?function(a){for(var b,c=0,d=0;c<g;c++){if(b=j(f[c],a),b<=0)return 0;d+=b}return d/g}:function(a){for(var b=0,c=0;b<g;b++)c+=j(f[b],a);return c/g}:function(){return 0}},a.prototype.getSortFunction=function(a,c){var e,f,g,h,i,j,k,l,m,n,o;if(g=this,a=g.prepareSearch(a,c),o=!a.query&&c.sort_empty||c.sort,m=function(a,b){return"$score"===a?b.score:d(g.items[b.id],a,c.nesting)},i=[],o)for(e=0,f=o.length;e<f;e++)(a.query||"$score"!==o[e].field)&&i.push(o[e]);if(a.query){for(n=!0,e=0,f=i.length;e<f;e++)if("$score"===i[e].field){n=!1;break}n&&i.unshift({field:"$score",direction:"desc"})}else for(e=0,f=i.length;e<f;e++)if("$score"===i[e].field){i.splice(e,1);break}for(l=[],e=0,f=i.length;e<f;e++)l.push("desc"===i[e].direction?-1:1);return j=i.length,j?1===j?(h=i[0].field,k=l[0],function(a,c){return k*b(m(h,a),m(h,c))}):function(a,c){var d,e,f;for(d=0;d<j;d++)if(f=i[d].field,e=l[d]*b(m(f,a),m(f,c)))return e;return 0}:null},a.prototype.prepareSearch=function(a,b){if("object"==typeof a)return a;b=c({},b);var d=b.fields,e=b.sort,f=b.sort_empty;return d&&!g(d)&&(b.fields=[d]),e&&!g(e)&&(b.sort=[e]),f&&!g(f)&&(b.sort_empty=[f]),{options:b,query:String(a||"").toLowerCase(),tokens:this.tokenize(a),total:0,items:[]}},a.prototype.search=function(a,b){var c,d,e,f,g=this;return d=this.prepareSearch(a,b),b=d.options,a=d.query,f=b.score||g.getScoreFunction(d),a.length?g.iterator(g.items,function(a,e){c=f(a),(b.filter===!1||c>0)&&d.items.push({score:c,id:e})}):g.iterator(g.items,function(a,b){d.items.push({score:1,id:b})}),e=g.getSortFunction(d,b),e&&d.items.sort(e),d.total=d.items.length,"number"==typeof b.limit&&(d.items=d.items.slice(0,b.limit)),d};var b=function(a,b){return"number"==typeof a&&"number"==typeof b?a>b?1:a<b?-1:0:(a=i(String(a||"")),b=i(String(b||"")),a>b?1:b>a?-1:0)},c=function(a,b){var c,d,e,f;for(c=1,d=arguments.length;c<d;c++)if(f=arguments[c])for(e in f)f.hasOwnProperty(e)&&(a[e]=f[e]);return a},d=function(a,b,c){if(a&&b){if(!c)return a[b];for(var d=b.split(".");d.length&&(a=a[d.shift()]););return a}},e=function(a){return(a+"").replace(/^\s+|\s+$|/g,"")},f=function(a){return(a+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},g=Array.isArray||"undefined"!=typeof $&&$.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},h={a:"[aḀḁĂăÂâǍǎȺⱥȦȧẠạÄäÀàÁáĀāÃãÅåąĄÃąĄ]",b:"[b␢βΒB฿𐌁ᛒ]",c:"[cĆćĈĉČčĊċC̄c̄ÇçḈḉȻȼƇƈɕᴄCc]",d:"[dĎďḊḋḐḑḌḍḒḓḎḏĐđD̦d̦ƉɖƊɗƋƌᵭᶁᶑȡᴅDdð]",e:"[eÉéÈèÊêḘḙĚěĔĕẼẽḚḛẺẻĖėËëĒēȨȩĘęᶒɆɇȄȅẾếỀềỄễỂểḜḝḖḗḔḕȆȇẸẹỆệⱸᴇEeɘǝƏƐε]",f:"[fƑƒḞḟ]",g:"[gɢ₲ǤǥĜĝĞğĢģƓɠĠġ]",h:"[hĤĥĦħḨḩẖẖḤḥḢḣɦʰǶƕ]",i:"[iÍíÌìĬĭÎîǏǐÏïḮḯĨĩĮįĪīỈỉȈȉȊȋỊịḬḭƗɨɨ̆ᵻᶖİiIıɪIi]",j:"[jȷĴĵɈɉʝɟʲ]",k:"[kƘƙꝀꝁḰḱǨǩḲḳḴḵκϰ₭]",l:"[lŁłĽľĻļĹĺḶḷḸḹḼḽḺḻĿŀȽƚⱠⱡⱢɫɬᶅɭȴʟLl]",n:"[nŃńǸǹŇňÑñṄṅŅņṆṇṊṋṈṉN̈n̈ƝɲȠƞᵰᶇɳȵɴNnŊŋ]",o:"[oØøÖöÓóÒòÔôǑǒŐőŎŏȮȯỌọƟɵƠơỎỏŌōÕõǪǫȌȍՕօ]",p:"[pṔṕṖṗⱣᵽƤƥᵱ]",q:"[qꝖꝗʠɊɋꝘꝙq̃]",r:"[rŔŕɌɍŘřŖŗṘṙȐȑȒȓṚṛⱤɽ]",s:"[sŚśṠṡṢṣꞨꞩŜŝŠšŞşȘșS̈s̈]",t:"[tŤťṪṫŢţṬṭƮʈȚțṰṱṮṯƬƭ]",u:"[uŬŭɄʉỤụÜüÚúÙùÛûǓǔŰűŬŭƯưỦủŪūŨũŲųȔȕ∪]",v:"[vṼṽṾṿƲʋꝞꝟⱱʋ]",w:"[wẂẃẀẁŴŵẄẅẆẇẈẉ]",x:"[xẌẍẊẋχ]",y:"[yÝýỲỳŶŷŸÿỸỹẎẏỴỵɎɏƳƴ]",z:"[zŹźẐẑŽžŻżẒẓẔẕƵƶ]"},i=function(){var a,b,c,d,e="",f={};for(c in h)if(h.hasOwnProperty(c))for(d=h[c].substring(2,h[c].length-1),e+=d,a=0,b=d.length;a<b;a++)f[d.charAt(a)]=c;var g=new RegExp("["+e+"]","g");return function(a){return a.replace(g,function(a){return f[a]}).toLowerCase()}}();return a}),function(a,b){"function"==typeof define&&define.amd?define("microplugin",b):"object"==typeof exports?module.exports=b():a.MicroPlugin=b()}(this,function(){var a={};a.mixin=function(a){a.plugins={},a.prototype.initializePlugins=function(a){var c,d,e,f=this,g=[];if(f.plugins={names:[],settings:{},requested:{},loaded:{}},b.isArray(a))for(c=0,d=a.length;c<d;c++)"string"==typeof a[c]?g.push(a[c]):(f.plugins.settings[a[c].name]=a[c].options,g.push(a[c].name));else if(a)for(e in a)a.hasOwnProperty(e)&&(f.plugins.settings[e]=a[e],g.push(e));for(;g.length;)f.require(g.shift())},a.prototype.loadPlugin=function(b){var c=this,d=c.plugins,e=a.plugins[b];if(!a.plugins.hasOwnProperty(b))throw new Error('Unable to find "'+b+'" plugin');d.requested[b]=!0,d.loaded[b]=e.fn.apply(c,[c.plugins.settings[b]||{}]),d.names.push(b)},a.prototype.require=function(a){var b=this,c=b.plugins;if(!b.plugins.loaded.hasOwnProperty(a)){if(c.requested[a])throw new Error('Plugin has circular dependency ("'+a+'")');b.loadPlugin(a)}return c.loaded[a]},a.define=function(b,c){a.plugins[b]={name:b,fn:c}}};var b={isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}};return a}),function(a,b){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],b):"object"==typeof exports?module.exports=b(require("jquery"),require("sifter"),require("microplugin")):a.Selectize=b(a.jQuery,a.Sifter,a.MicroPlugin)}(this,function(a,b,c){"use strict";var d=function(a,b){if("string"!=typeof b||b.length){var c="string"==typeof b?new RegExp(b,"i"):b,d=function(a){var b=0;if(3===a.nodeType){var e=a.data.search(c);if(e>=0&&a.data.length>0){var f=a.data.match(c),g=document.createElement("span");g.className="highlight";var h=a.splitText(e),i=(h.splitText(f[0].length),h.cloneNode(!0));g.appendChild(i),h.parentNode.replaceChild(g,h),b=1}}else if(1===a.nodeType&&a.childNodes&&!/(script|style)/i.test(a.tagName))for(var j=0;j<a.childNodes.length;++j)j+=d(a.childNodes[j]);return b};return a.each(function(){d(this)})}};a.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;var a=this.parentNode;a.replaceChild(this.firstChild,this),a.normalize()}).end()};var e=function(){};e.prototype={on:function(a,b){this._events=this._events||{},this._events[a]=this._events[a]||[],this._events[a].push(b)},off:function(a,b){var c=arguments.length;return 0===c?delete this._events:1===c?delete this._events[a]:(this._events=this._events||{},void(a in this._events!=!1&&this._events[a].splice(this._events[a].indexOf(b),1)))},trigger:function(a){if(this._events=this._events||{},a in this._events!=!1)for(var b=0;b<this._events[a].length;b++)this._events[a][b].apply(this,Array.prototype.slice.call(arguments,1))}},e.mixin=function(a){for(var b=["on","off","trigger"],c=0;c<b.length;c++)a.prototype[b[c]]=e.prototype[b[c]]};var f=/Mac/.test(navigator.userAgent),g=65,h=13,i=27,j=37,k=38,l=80,m=39,n=40,o=78,p=8,q=46,r=16,s=f?91:17,t=f?18:17,u=9,v=1,w=2,x=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity,y=function(a){return"undefined"!=typeof a},z=function(a){return"undefined"==typeof a||null===a?null:"boolean"==typeof a?a?"1":"0":a+""},A=function(a){return(a+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},B={};B.before=function(a,b,c){var d=a[b];a[b]=function(){return c.apply(a,arguments),d.apply(a,arguments)}},B.after=function(a,b,c){var d=a[b];a[b]=function(){var b=d.apply(a,arguments);return c.apply(a,arguments),b}};var C=function(a){var b=!1;return function(){b||(b=!0,a.apply(this,arguments))}},D=function(a,b){var c;return function(){var d=this,e=arguments;window.clearTimeout(c),c=window.setTimeout(function(){a.apply(d,e)},b)}},E=function(a,b,c){var d,e=a.trigger,f={};a.trigger=function(){var c=arguments[0];return b.indexOf(c)===-1?e.apply(a,arguments):void(f[c]=arguments)},c.apply(a,[]),a.trigger=e;for(d in f)f.hasOwnProperty(d)&&e.apply(a,f[d])},F=function(a,b,c,d){a.on(b,c,function(b){for(var c=b.target;c&&c.parentNode!==a[0];)c=c.parentNode;return b.currentTarget=c,d.apply(this,[b])})},G=function(a){var b={};if("selectionStart"in a)b.start=a.selectionStart,b.length=a.selectionEnd-b.start;else if(document.selection){a.focus();var c=document.selection.createRange(),d=document.selection.createRange().text.length;c.moveStart("character",-a.value.length),b.start=c.text.length-d,b.length=d}return b},H=function(a,b,c){var d,e,f={};if(c)for(d=0,e=c.length;d<e;d++)f[c[d]]=a.css(c[d]);else f=a.css();b.css(f)},I=function(b,c){if(!b)return 0;var d=a("<test>").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).text(b).appendTo("body");H(c,d,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);var e=d.width();return d.remove(),e},J=function(a){var b=null,c=function(c,d){var e,f,g,h,i,j,k,l;c=c||window.event||{},d=d||{},c.metaKey||c.altKey||(d.force||a.data("grow")!==!1)&&(e=a.val(),c.type&&"keydown"===c.type.toLowerCase()&&(f=c.keyCode,g=f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||32===f,f===q||f===p?(l=G(a[0]),l.length?e=e.substring(0,l.start)+e.substring(l.start+l.length):f===p&&l.start?e=e.substring(0,l.start-1)+e.substring(l.start+1):f===q&&"undefined"!=typeof l.start&&(e=e.substring(0,l.start)+e.substring(l.start+1))):g&&(j=c.shiftKey,k=String.fromCharCode(c.keyCode),k=j?k.toUpperCase():k.toLowerCase(),e+=k)),h=a.attr("placeholder"),!e&&h&&(e=h),i=I(e,a)+4,i!==b&&(b=i,a.width(i),a.triggerHandler("resize")))};a.on("keydown keyup update blur",c),c()},K=function(a){var b=document.createElement("div");return b.appendChild(a.cloneNode(!0)),b.innerHTML},L=function(a,b){b||(b={});var c="Selectize";console.error(c+": "+a),b.explanation&&(console.group&&console.group(),console.error(b.explanation),console.group&&console.groupEnd())},M=function(c,d){var e,f,g,h,i=this;h=c[0],h.selectize=i;var j=window.getComputedStyle&&window.getComputedStyle(h,null);if(g=j?j.getPropertyValue("direction"):h.currentStyle&&h.currentStyle.direction,g=g||c.parents("[dir]:first").attr("dir")||"",a.extend(i,{order:0,settings:d,$input:c,tabIndex:c.attr("tabindex")||"",tagType:"select"===h.tagName.toLowerCase()?v:w,rtl:/rtl/i.test(g),eventNS:".selectize"+ ++M.count,highlightedValue:null,isOpen:!1,isDisabled:!1,isRequired:c.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===d.loadThrottle?i.onSearchChange:D(i.onSearchChange,d.loadThrottle)}),i.sifter=new b(this.options,{diacritics:d.diacritics}),i.settings.options){for(e=0,f=i.settings.options.length;e<f;e++)i.registerOption(i.settings.options[e]);delete i.settings.options}if(i.settings.optgroups){for(e=0,f=i.settings.optgroups.length;e<f;e++)i.registerOptionGroup(i.settings.optgroups[e]);delete i.settings.optgroups}i.settings.mode=i.settings.mode||(1===i.settings.maxItems?"single":"multi"),"boolean"!=typeof i.settings.hideSelected&&(i.settings.hideSelected="multi"===i.settings.mode),i.initializePlugins(i.settings.plugins),i.setupCallbacks(),i.setupTemplates(),i.setup()};return e.mixin(M),"undefined"!=typeof c?c.mixin(M):L("Dependency MicroPlugin is missing",{explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'}),a.extend(M.prototype,{setup:function(){var b,c,d,e,g,h,i,j,k,l,m=this,n=m.settings,o=m.eventNS,p=a(window),q=a(document),u=m.$input;if(i=m.settings.mode,j=u.attr("class")||"",b=a("<div>").addClass(n.wrapperClass).addClass(j).addClass(i),c=a("<div>").addClass(n.inputClass).addClass("items").appendTo(b),d=a('<input type="text" autocomplete="off" />').appendTo(c).attr("tabindex",u.is(":disabled")?"-1":m.tabIndex),h=a(n.dropdownParent||b),e=a("<div>").addClass(n.dropdownClass).addClass(i).hide().appendTo(h),g=a("<div>").addClass(n.dropdownContentClass).appendTo(e),(l=u.attr("id"))&&(d.attr("id",l+"-selectized"),a("label[for='"+l+"']").attr("for",l+"-selectized")),m.settings.copyClassesToDropdown&&e.addClass(j),b.css({width:u[0].style.width}),m.plugins.names.length&&(k="plugin-"+m.plugins.names.join(" plugin-"),b.addClass(k),e.addClass(k)),(null===n.maxItems||n.maxItems>1)&&m.tagType===v&&u.attr("multiple","multiple"),m.settings.placeholder&&d.attr("placeholder",n.placeholder),!m.settings.splitOn&&m.settings.delimiter){var w=m.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");m.settings.splitOn=new RegExp("\\s*"+w+"+\\s*")}u.attr("autocorrect")&&d.attr("autocorrect",u.attr("autocorrect")),u.attr("autocapitalize")&&d.attr("autocapitalize",u.attr("autocapitalize")),m.$wrapper=b,m.$control=c,m.$control_input=d,m.$dropdown=e,m.$dropdown_content=g,e.on("mouseenter","[data-selectable]",function(){return m.onOptionHover.apply(m,arguments)}),e.on("mousedown click","[data-selectable]",function(){return m.onOptionSelect.apply(m,arguments)}),F(c,"mousedown","*:not(input)",function(){return m.onItemSelect.apply(m,arguments)}),J(d),c.on({mousedown:function(){return m.onMouseDown.apply(m,arguments)},click:function(){return m.onClick.apply(m,arguments)}}),d.on({mousedown:function(a){a.stopPropagation()},keydown:function(){return m.onKeyDown.apply(m,arguments)},keyup:function(){return m.onKeyUp.apply(m,arguments)},keypress:function(){return m.onKeyPress.apply(m,arguments)},resize:function(){m.positionDropdown.apply(m,[])},blur:function(){return m.onBlur.apply(m,arguments)},focus:function(){return m.ignoreBlur=!1,m.onFocus.apply(m,arguments)},paste:function(){return m.onPaste.apply(m,arguments)}}),q.on("keydown"+o,function(a){m.isCmdDown=a[f?"metaKey":"ctrlKey"],m.isCtrlDown=a[f?"altKey":"ctrlKey"],m.isShiftDown=a.shiftKey}),q.on("keyup"+o,function(a){a.keyCode===t&&(m.isCtrlDown=!1),a.keyCode===r&&(m.isShiftDown=!1),a.keyCode===s&&(m.isCmdDown=!1)}),q.on("mousedown"+o,function(a){if(m.isFocused){if(a.target===m.$dropdown[0]||a.target.parentNode===m.$dropdown[0])return!1;m.$control.has(a.target).length||a.target===m.$control[0]||m.blur(a.target)}}),p.on(["scroll"+o,"resize"+o].join(" "),function(){m.isOpen&&m.positionDropdown.apply(m,arguments)}),p.on("mousemove"+o,function(){m.ignoreHover=!1}),this.revertSettings={$children:u.children().detach(),tabindex:u.attr("tabindex")},u.attr("tabindex",-1).hide().after(m.$wrapper),a.isArray(n.items)&&(m.setValue(n.items),delete n.items),x&&u.on("invalid"+o,function(a){a.preventDefault(),m.isInvalid=!0,m.refreshState()}),m.updateOriginalInput(),m.refreshItems(),m.refreshState(),m.updatePlaceholder(),m.isSetup=!0,u.is(":disabled")&&m.disable(),m.on("change",this.onChange),u.data("selectize",m),u.addClass("selectized"),m.trigger("initialize"),n.preload===!0&&m.onSearchChange("")},setupTemplates:function(){var b=this,c=b.settings.labelField,d=b.settings.optgroupLabelField,e={optgroup:function(a){return'<div class="optgroup">'+a.html+"</div>"},optgroup_header:function(a,b){return'<div class="optgroup-header">'+b(a[d])+"</div>"},option:function(a,b){return'<div class="option">'+b(a[c])+"</div>"},item:function(a,b){return'<div class="item">'+b(a[c])+"</div>"},option_create:function(a,b){return'<div class="create">Add <strong>'+b(a.input)+"</strong>&hellip;</div>"}};b.settings.render=a.extend({},e,b.settings.render)},setupCallbacks:function(){var a,b,c={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(a in c)c.hasOwnProperty(a)&&(b=this.settings[c[a]],b&&this.on(a,b))},onClick:function(a){var b=this;b.isFocused||(b.focus(),a.preventDefault())},onMouseDown:function(b){var c=this,d=b.isDefaultPrevented();a(b.target);if(c.isFocused){if(b.target!==c.$control_input[0])return"single"===c.settings.mode?c.isOpen?c.close():c.open():d||c.setActiveItem(null),!1}else d||window.setTimeout(function(){c.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(b){var c=this;return c.isFull()||c.isInputHidden||c.isLocked?void b.preventDefault():void(c.settings.splitOn&&setTimeout(function(){var b=c.$control_input.val();if(b.match(c.settings.splitOn))for(var d=a.trim(b).split(c.settings.splitOn),e=0,f=d.length;e<f;e++)c.createItem(d[e])},0))},onKeyPress:function(a){if(this.isLocked)return a&&a.preventDefault();var b=String.fromCharCode(a.keyCode||a.which);return this.settings.create&&"multi"===this.settings.mode&&b===this.settings.delimiter?(this.createItem(),a.preventDefault(),!1):void 0},onKeyDown:function(a){var b=(a.target===this.$control_input[0],this);if(b.isLocked)return void(a.keyCode!==u&&a.preventDefault());switch(a.keyCode){case g:if(b.isCmdDown)return void b.selectAll();break;case i:return void(b.isOpen&&(a.preventDefault(),a.stopPropagation(),b.close()));case o:if(!a.ctrlKey||a.altKey)break;case n:if(!b.isOpen&&b.hasOptions)b.open();else if(b.$activeOption){b.ignoreHover=!0;var c=b.getAdjacentOption(b.$activeOption,1);c.length&&b.setActiveOption(c,!0,!0)}return void a.preventDefault();case l:if(!a.ctrlKey||a.altKey)break;case k:if(b.$activeOption){b.ignoreHover=!0;var d=b.getAdjacentOption(b.$activeOption,-1);d.length&&b.setActiveOption(d,!0,!0)}return void a.preventDefault();case h:return void(b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),a.preventDefault()));case j:return void b.advanceSelection(-1,a);case m:return void b.advanceSelection(1,a);case u:return b.settings.selectOnTab&&b.isOpen&&b.$activeOption&&(b.onOptionSelect({currentTarget:b.$activeOption}),b.isFull()||a.preventDefault()),void(b.settings.create&&b.createItem()&&a.preventDefault());case p:case q:return void b.deleteSelection(a)}return!b.isFull()&&!b.isInputHidden||(f?a.metaKey:a.ctrlKey)?void 0:void a.preventDefault()},onKeyUp:function(a){var b=this;if(b.isLocked)return a&&a.preventDefault();var c=b.$control_input.val()||"";b.lastValue!==c&&(b.lastValue=c,b.onSearchChange(c),b.refreshOptions(),b.trigger("type",c))},onSearchChange:function(a){var b=this,c=b.settings.load;c&&(b.loadedSearches.hasOwnProperty(a)||(b.loadedSearches[a]=!0,b.load(function(d){c.apply(b,[a,d])})))},onFocus:function(a){var b=this,c=b.isFocused;return b.isDisabled?(b.blur(),a&&a.preventDefault(),!1):void(b.ignoreFocus||(b.isFocused=!0,"focus"===b.settings.preload&&b.onSearchChange(""),c||b.trigger("focus"),b.$activeItems.length||(b.showInput(),b.setActiveItem(null),b.refreshOptions(!!b.settings.openOnFocus)),b.refreshState()))},onBlur:function(a,b){var c=this;if(c.isFocused&&(c.isFocused=!1,!c.ignoreFocus)){if(!c.ignoreBlur&&document.activeElement===c.$dropdown_content[0])return c.ignoreBlur=!0,void c.onFocus(a);var d=function(){c.close(),c.setTextboxValue(""),c.setActiveItem(null),c.setActiveOption(null),c.setCaret(c.items.length),c.refreshState(),b&&b.focus&&b.focus(),c.ignoreFocus=!1,c.trigger("blur")};c.ignoreFocus=!0,c.settings.create&&c.settings.createOnBlur?c.createItem(null,!1,d):d()}},onOptionHover:function(a){this.ignoreHover||this.setActiveOption(a.currentTarget,!1)},onOptionSelect:function(b){var c,d,e=this;b.preventDefault&&(b.preventDefault(),b.stopPropagation()),d=a(b.currentTarget),d.hasClass("create")?e.createItem(null,function(){e.settings.closeAfterSelect&&e.close()}):(c=d.attr("data-value"),"undefined"!=typeof c&&(e.lastQuery=null,e.setTextboxValue(""),e.addItem(c),e.settings.closeAfterSelect?e.close():!e.settings.hideSelected&&b.type&&/mouse/.test(b.type)&&e.setActiveOption(e.getOption(c))))},onItemSelect:function(a){var b=this;b.isLocked||"multi"===b.settings.mode&&(a.preventDefault(),b.setActiveItem(a.currentTarget,a))},load:function(a){var b=this,c=b.$wrapper.addClass(b.settings.loadingClass);b.loading++,a.apply(b,[function(a){b.loading=Math.max(b.loading-1,0),a&&a.length&&(b.addOption(a),b.refreshOptions(b.isFocused&&!b.isInputHidden)),b.loading||c.removeClass(b.settings.loadingClass),b.trigger("load",a)}])},setTextboxValue:function(a){var b=this.$control_input,c=b.val()!==a;c&&(b.val(a).triggerHandler("update"),this.lastValue=a)},getValue:function(){return this.tagType===v&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(a,b){var c=b?[]:["change"];E(this,c,function(){this.clear(b),this.addItems(a,b)})},setActiveItem:function(b,c){var d,e,f,g,h,i,j,k,l=this;if("single"!==l.settings.mode){if(b=a(b),!b.length)return a(l.$activeItems).removeClass("active"),l.$activeItems=[],void(l.isFocused&&l.showInput());if(d=c&&c.type.toLowerCase(),"mousedown"===d&&l.isShiftDown&&l.$activeItems.length){for(k=l.$control.children(".active:last"),g=Array.prototype.indexOf.apply(l.$control[0].childNodes,[k[0]]),h=Array.prototype.indexOf.apply(l.$control[0].childNodes,[b[0]]),g>h&&(j=g,g=h,h=j),e=g;e<=h;e++)i=l.$control[0].childNodes[e],l.$activeItems.indexOf(i)===-1&&(a(i).addClass("active"),l.$activeItems.push(i));c.preventDefault()}else"mousedown"===d&&l.isCtrlDown||"keydown"===d&&this.isShiftDown?b.hasClass("active")?(f=l.$activeItems.indexOf(b[0]),l.$activeItems.splice(f,1),b.removeClass("active")):l.$activeItems.push(b.addClass("active")[0]):(a(l.$activeItems).removeClass("active"),l.$activeItems=[b.addClass("active")[0]]);l.hideInput(),this.isFocused||l.focus()}},setActiveOption:function(b,c,d){var e,f,g,h,i,j=this;j.$activeOption&&j.$activeOption.removeClass("active"),j.$activeOption=null,b=a(b),b.length&&(j.$activeOption=b.addClass("active"),!c&&y(c)||(e=j.$dropdown_content.height(),f=j.$activeOption.outerHeight(!0),c=j.$dropdown_content.scrollTop()||0,g=j.$activeOption.offset().top-j.$dropdown_content.offset().top+c,h=g,i=g-e+f,g+f>e+c?j.$dropdown_content.stop().animate({scrollTop:i},d?j.settings.scrollDuration:0):g<c&&j.$dropdown_content.stop().animate({scrollTop:h},d?j.settings.scrollDuration:0)))},selectAll:function(){var a=this;"single"!==a.settings.mode&&(a.$activeItems=Array.prototype.slice.apply(a.$control.children(":not(input)").addClass("active")),a.$activeItems.length&&(a.hideInput(),a.close()),a.focus())},hideInput:function(){var a=this;a.setTextboxValue(""),a.$control_input.css({opacity:0,position:"absolute",left:a.rtl?1e4:-1e4}),a.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var a=this;a.isDisabled||(a.ignoreFocus=!0,a.$control_input[0].focus(),window.setTimeout(function(){a.ignoreFocus=!1,a.onFocus()},0))},blur:function(a){this.$control_input[0].blur(),this.onBlur(null,a)},getScoreFunction:function(a){return this.sifter.getScoreFunction(a,this.getSearchOptions())},getSearchOptions:function(){var a=this.settings,b=a.sortField;return"string"==typeof b&&(b=[{field:b}]),{fields:a.searchField,conjunction:a.searchConjunction,sort:b}},search:function(b){var c,d,e,f=this,g=f.settings,h=this.getSearchOptions();if(g.score&&(e=f.settings.score.apply(this,[b]),"function"!=typeof e))throw new Error('Selectize "score" setting must be a function that returns a function');if(b!==f.lastQuery?(f.lastQuery=b,d=f.sifter.search(b,a.extend(h,{score:e})),f.currentResults=d):d=a.extend(!0,{},f.currentResults),g.hideSelected)for(c=d.items.length-1;c>=0;c--)f.items.indexOf(z(d.items[c].id))!==-1&&d.items.splice(c,1);return d},refreshOptions:function(b){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;"undefined"==typeof b&&(b=!0);var t=this,u=a.trim(t.$control_input.val()),v=t.search(u),w=t.$dropdown_content,x=t.$activeOption&&z(t.$activeOption.attr("data-value"));for(g=v.items.length,"number"==typeof t.settings.maxOptions&&(g=Math.min(g,t.settings.maxOptions)),h={},i=[],c=0;c<g;c++)for(j=t.options[v.items[c].id],k=t.render("option",j),l=j[t.settings.optgroupField]||"",m=a.isArray(l)?l:[l],e=0,f=m&&m.length;e<f;e++)l=m[e],t.optgroups.hasOwnProperty(l)||(l=""),h.hasOwnProperty(l)||(h[l]=document.createDocumentFragment(),i.push(l)),h[l].appendChild(k);for(this.settings.lockOptgroupOrder&&i.sort(function(a,b){var c=t.optgroups[a].$order||0,d=t.optgroups[b].$order||0;return c-d}),n=document.createDocumentFragment(),c=0,g=i.length;c<g;c++)l=i[c],t.optgroups.hasOwnProperty(l)&&h[l].childNodes.length?(o=document.createDocumentFragment(),o.appendChild(t.render("optgroup_header",t.optgroups[l])),o.appendChild(h[l]),n.appendChild(t.render("optgroup",a.extend({},t.optgroups[l],{html:K(o),dom:o})))):n.appendChild(h[l]);if(w.html(n),t.settings.highlight&&v.query.length&&v.tokens.length)for(w.removeHighlight(),c=0,g=v.tokens.length;c<g;c++)d(w,v.tokens[c].regex);if(!t.settings.hideSelected)for(c=0,g=t.items.length;c<g;c++)t.getOption(t.items[c]).addClass("selected");p=t.canCreate(u),p&&(w.prepend(t.render("option_create",{input:u})),s=a(w[0].childNodes[0])),t.hasOptions=v.items.length>0||p,t.hasOptions?(v.items.length>0?(r=x&&t.getOption(x),r&&r.length?q=r:"single"===t.settings.mode&&t.items.length&&(q=t.getOption(t.items[0])),q&&q.length||(q=s&&!t.settings.addPrecedence?t.getAdjacentOption(s,1):w.find("[data-selectable]:first"))):q=s,t.setActiveOption(q),b&&!t.isOpen&&t.open()):(t.setActiveOption(null),b&&t.isOpen&&t.close())},addOption:function(b){var c,d,e,f=this;if(a.isArray(b))for(c=0,d=b.length;c<d;c++)f.addOption(b[c]);else(e=f.registerOption(b))&&(f.userOptions[e]=!0,f.lastQuery=null,f.trigger("option_add",e,b))},registerOption:function(a){var b=z(a[this.settings.valueField]);return"undefined"!=typeof b&&null!==b&&!this.options.hasOwnProperty(b)&&(a.$order=a.$order||++this.order,this.options[b]=a,b)},registerOptionGroup:function(a){var b=z(a[this.settings.optgroupValueField]);return!!b&&(a.$order=a.$order||++this.order,this.optgroups[b]=a,b)},addOptionGroup:function(a,b){b[this.settings.optgroupValueField]=a,(a=this.registerOptionGroup(b))&&this.trigger("optgroup_add",a,b)},removeOptionGroup:function(a){this.optgroups.hasOwnProperty(a)&&(delete this.optgroups[a],this.renderCache={},this.trigger("optgroup_remove",a))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(b,c){var d,e,f,g,h,i,j,k=this;if(b=z(b),f=z(c[k.settings.valueField]),null!==b&&k.options.hasOwnProperty(b)){if("string"!=typeof f)throw new Error("Value must be set in option data");j=k.options[b].$order,f!==b&&(delete k.options[b],g=k.items.indexOf(b),g!==-1&&k.items.splice(g,1,f)),c.$order=c.$order||j,k.options[f]=c,h=k.renderCache.item,i=k.renderCache.option,h&&(delete h[b],delete h[f]),i&&(delete i[b],delete i[f]),k.items.indexOf(f)!==-1&&(d=k.getItem(b),e=a(k.render("item",c)),d.hasClass("active")&&e.addClass("active"),d.replaceWith(e)),k.lastQuery=null,k.isOpen&&k.refreshOptions(!1)}},removeOption:function(a,b){var c=this;a=z(a);var d=c.renderCache.item,e=c.renderCache.option;d&&delete d[a],e&&delete e[a],delete c.userOptions[a],delete c.options[a],c.lastQuery=null,c.trigger("option_remove",a),c.removeItem(a,b)},clearOptions:function(){var a=this;a.loadedSearches={},a.userOptions={},a.renderCache={},a.options=a.sifter.items={},a.lastQuery=null,a.trigger("option_clear"),a.clear()},getOption:function(a){return this.getElementWithValue(a,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(b,c){var d=this.$dropdown.find("[data-selectable]"),e=d.index(b)+c;return e>=0&&e<d.length?d.eq(e):a()},getElementWithValue:function(b,c){if(b=z(b),"undefined"!=typeof b&&null!==b)for(var d=0,e=c.length;d<e;d++)if(c[d].getAttribute("data-value")===b)return a(c[d]);return a()},getItem:function(a){return this.getElementWithValue(a,this.$control.children())},addItems:function(b,c){for(var d=a.isArray(b)?b:[b],e=0,f=d.length;e<f;e++)this.isPending=e<f-1,this.addItem(d[e],c)},addItem:function(b,c){var d=c?[]:["change"];E(this,d,function(){var d,e,f,g,h,i=this,j=i.settings.mode;return b=z(b),i.items.indexOf(b)!==-1?void("single"===j&&i.close()):void(i.options.hasOwnProperty(b)&&("single"===j&&i.clear(c),"multi"===j&&i.isFull()||(d=a(i.render("item",i.options[b])),h=i.isFull(),i.items.splice(i.caretPos,0,b),i.insertAtCaret(d),(!i.isPending||!h&&i.isFull())&&i.refreshState(),i.isSetup&&(f=i.$dropdown_content.find("[data-selectable]"),i.isPending||(e=i.getOption(b),g=i.getAdjacentOption(e,1).attr("data-value"),i.refreshOptions(i.isFocused&&"single"!==j),g&&i.setActiveOption(i.getOption(g))),!f.length||i.isFull()?i.close():i.positionDropdown(),i.updatePlaceholder(),i.trigger("item_add",b,d),i.updateOriginalInput({silent:c})))))})},removeItem:function(b,c){var d,e,f,g=this;d=b instanceof a?b:g.getItem(b),b=z(d.attr("data-value")),e=g.items.indexOf(b),e!==-1&&(d.remove(),d.hasClass("active")&&(f=g.$activeItems.indexOf(d[0]),g.$activeItems.splice(f,1)),g.items.splice(e,1),g.lastQuery=null,!g.settings.persist&&g.userOptions.hasOwnProperty(b)&&g.removeOption(b,c),e<g.caretPos&&g.setCaret(g.caretPos-1),g.refreshState(),g.updatePlaceholder(),g.updateOriginalInput({silent:c}),g.positionDropdown(),g.trigger("item_remove",b,d))},createItem:function(b,c){var d=this,e=d.caretPos;b=b||a.trim(d.$control_input.val()||"");var f=arguments[arguments.length-1];if("function"!=typeof f&&(f=function(){}),"boolean"!=typeof c&&(c=!0),!d.canCreate(b))return f(),!1;d.lock();var g="function"==typeof d.settings.create?this.settings.create:function(a){var b={};return b[d.settings.labelField]=a,b[d.settings.valueField]=a,b},h=C(function(a){if(d.unlock(),!a||"object"!=typeof a)return f();var b=z(a[d.settings.valueField]);return"string"!=typeof b?f():(d.setTextboxValue(""),d.addOption(a),d.setCaret(e),d.addItem(b),d.refreshOptions(c&&"single"!==d.settings.mode),void f(a))}),i=g.apply(this,[b,h]);return"undefined"!=typeof i&&h(i),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return!1;var a=!this.items.length;this.isInvalid=a,this.$control_input.prop("required",a),this.$input.prop("required",!a)},refreshClasses:function(){var b=this,c=b.isFull(),d=b.isLocked;b.$wrapper.toggleClass("rtl",b.rtl),b.$control.toggleClass("focus",b.isFocused).toggleClass("disabled",b.isDisabled).toggleClass("required",b.isRequired).toggleClass("invalid",b.isInvalid).toggleClass("locked",d).toggleClass("full",c).toggleClass("not-full",!c).toggleClass("input-active",b.isFocused&&!b.isInputHidden).toggleClass("dropdown-active",b.isOpen).toggleClass("has-options",!a.isEmptyObject(b.options)).toggleClass("has-items",b.items.length>0),b.$control_input.data("grow",!c&&!d)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(a){var b,c,d,e,f=this;if(a=a||{},f.tagType===v){for(d=[],b=0,c=f.items.length;b<c;b++)e=f.options[f.items[b]][f.settings.labelField]||"",d.push('<option value="'+A(f.items[b])+'" selected="selected">'+A(e)+"</option>");d.length||this.$input.attr("multiple")||d.push('<option value="" selected="selected"></option>'),
3
+ f.$input.html(d.join(""))}else f.$input.val(f.getValue()),f.$input.attr("value",f.$input.val());f.isSetup&&(a.silent||f.trigger("change",f.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var a=this.$control_input;this.items.length?a.removeAttr("placeholder"):a.attr("placeholder",this.settings.placeholder),a.triggerHandler("update",{force:!0})}},open:function(){var a=this;a.isLocked||a.isOpen||"multi"===a.settings.mode&&a.isFull()||(a.focus(),a.isOpen=!0,a.refreshState(),a.$dropdown.css({visibility:"hidden",display:"block"}),a.positionDropdown(),a.$dropdown.css({visibility:"visible"}),a.trigger("dropdown_open",a.$dropdown))},close:function(){var a=this,b=a.isOpen;"single"===a.settings.mode&&a.items.length&&(a.hideInput(),a.$control_input.blur()),a.isOpen=!1,a.$dropdown.hide(),a.setActiveOption(null),a.refreshState(),b&&a.trigger("dropdown_close",a.$dropdown)},positionDropdown:function(){var a=this.$control,b="body"===this.settings.dropdownParent?a.offset():a.position();b.top+=a.outerHeight(!0),this.$dropdown.css({width:a.outerWidth(),top:b.top,left:b.left})},clear:function(a){var b=this;b.items.length&&(b.$control.children(":not(input)").remove(),b.items=[],b.lastQuery=null,b.setCaret(0),b.setActiveItem(null),b.updatePlaceholder(),b.updateOriginalInput({silent:a}),b.refreshState(),b.showInput(),b.trigger("clear"))},insertAtCaret:function(b){var c=Math.min(this.caretPos,this.items.length);0===c?this.$control.prepend(b):a(this.$control[0].childNodes[c]).before(b),this.setCaret(c+1)},deleteSelection:function(b){var c,d,e,f,g,h,i,j,k,l=this;if(e=b&&b.keyCode===p?-1:1,f=G(l.$control_input[0]),l.$activeOption&&!l.settings.hideSelected&&(i=l.getAdjacentOption(l.$activeOption,-1).attr("data-value")),g=[],l.$activeItems.length){for(k=l.$control.children(".active:"+(e>0?"last":"first")),h=l.$control.children(":not(input)").index(k),e>0&&h++,c=0,d=l.$activeItems.length;c<d;c++)g.push(a(l.$activeItems[c]).attr("data-value"));b&&(b.preventDefault(),b.stopPropagation())}else(l.isFocused||"single"===l.settings.mode)&&l.items.length&&(e<0&&0===f.start&&0===f.length?g.push(l.items[l.caretPos-1]):e>0&&f.start===l.$control_input.val().length&&g.push(l.items[l.caretPos]));if(!g.length||"function"==typeof l.settings.onDelete&&l.settings.onDelete.apply(l,[g])===!1)return!1;for("undefined"!=typeof h&&l.setCaret(h);g.length;)l.removeItem(g.pop());return l.showInput(),l.positionDropdown(),l.refreshOptions(!0),i&&(j=l.getOption(i),j.length&&l.setActiveOption(j)),!0},advanceSelection:function(a,b){var c,d,e,f,g,h,i=this;0!==a&&(i.rtl&&(a*=-1),c=a>0?"last":"first",d=G(i.$control_input[0]),i.isFocused&&!i.isInputHidden?(f=i.$control_input.val().length,g=a<0?0===d.start&&0===d.length:d.start===f,g&&!f&&i.advanceCaret(a,b)):(h=i.$control.children(".active:"+c),h.length&&(e=i.$control.children(":not(input)").index(h),i.setActiveItem(null),i.setCaret(a>0?e+1:e))))},advanceCaret:function(a,b){var c,d,e=this;0!==a&&(c=a>0?"next":"prev",e.isShiftDown?(d=e.$control_input[c](),d.length&&(e.hideInput(),e.setActiveItem(d),b&&b.preventDefault())):e.setCaret(e.caretPos+a))},setCaret:function(b){var c=this;if(b="single"===c.settings.mode?c.items.length:Math.max(0,Math.min(c.items.length,b)),!c.isPending){var d,e,f,g;for(f=c.$control.children(":not(input)"),d=0,e=f.length;d<e;d++)g=a(f[d]).detach(),d<b?c.$control_input.before(g):c.$control.append(g)}c.caretPos=b},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var a=this;a.$input.prop("disabled",!0),a.$control_input.prop("disabled",!0).prop("tabindex",-1),a.isDisabled=!0,a.lock()},enable:function(){var a=this;a.$input.prop("disabled",!1),a.$control_input.prop("disabled",!1).prop("tabindex",a.tabIndex),a.isDisabled=!1,a.unlock()},destroy:function(){var b=this,c=b.eventNS,d=b.revertSettings;b.trigger("destroy"),b.off(),b.$wrapper.remove(),b.$dropdown.remove(),b.$input.html("").append(d.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:d.tabindex}).show(),b.$control_input.removeData("grow"),b.$input.removeData("selectize"),a(window).off(c),a(document).off(c),a(document.body).off(c),delete b.$input[0].selectize},render:function(b,c){var d,e,f="",g=!1,h=this;return"option"!==b&&"item"!==b||(d=z(c[h.settings.valueField]),g=!!d),g&&(y(h.renderCache[b])||(h.renderCache[b]={}),h.renderCache[b].hasOwnProperty(d))?h.renderCache[b][d]:(f=a(h.settings.render[b].apply(this,[c,A])),"option"===b||"option_create"===b?f.attr("data-selectable",""):"optgroup"===b&&(e=c[h.settings.optgroupValueField]||"",f.attr("data-group",e)),"option"!==b&&"item"!==b||f.attr("data-value",d||""),g&&(h.renderCache[b][d]=f[0]),f[0])},clearCache:function(a){var b=this;"undefined"==typeof a?b.renderCache={}:delete b.renderCache[a]},canCreate:function(a){var b=this;if(!b.settings.create)return!1;var c=b.settings.createFilter;return a.length&&("function"!=typeof c||c.apply(b,[a]))&&("string"!=typeof c||new RegExp(c).test(a))&&(!(c instanceof RegExp)||c.test(a))}}),M.count=0,M.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},a.fn.selectize=function(b){var c=a.fn.selectize.defaults,d=a.extend({},c,b),e=d.dataAttr,f=d.labelField,g=d.valueField,h=d.optgroupField,i=d.optgroupLabelField,j=d.optgroupValueField,k=function(b,c){var h,i,j,k,l=b.attr(e);if(l)for(c.options=JSON.parse(l),h=0,i=c.options.length;h<i;h++)c.items.push(c.options[h][g]);else{var m=a.trim(b.val()||"");if(!d.allowEmptyOption&&!m.length)return;for(j=m.split(d.delimiter),h=0,i=j.length;h<i;h++)k={},k[f]=j[h],k[g]=j[h],c.options.push(k);c.items=j}},l=function(b,c){var k,l,m,n,o=c.options,p={},q=function(a){var b=e&&a.attr(e);return"string"==typeof b&&b.length?JSON.parse(b):null},r=function(b,e){b=a(b);var i=z(b.val());if(i||d.allowEmptyOption)if(p.hasOwnProperty(i)){if(e){var j=p[i][h];j?a.isArray(j)?j.push(e):p[i][h]=[j,e]:p[i][h]=e}}else{var k=q(b)||{};k[f]=k[f]||b.text(),k[g]=k[g]||i,k[h]=k[h]||e,p[i]=k,o.push(k),b.is(":selected")&&c.items.push(i)}},s=function(b){var d,e,f,g,h;for(b=a(b),f=b.attr("label"),f&&(g=q(b)||{},g[i]=f,g[j]=f,c.optgroups.push(g)),h=a("option",b),d=0,e=h.length;d<e;d++)r(h[d],f)};for(c.maxItems=b.attr("multiple")?null:1,n=b.children(),k=0,l=n.length;k<l;k++)m=n[k].tagName.toLowerCase(),"optgroup"===m?s(n[k]):"option"===m&&r(n[k])};return this.each(function(){if(!this.selectize){var e,f=a(this),g=this.tagName.toLowerCase(),h=f.attr("placeholder")||f.attr("data-placeholder");h||d.allowEmptyOption||(h=f.children('option[value=""]').text());var i={placeholder:h,options:[],optgroups:[],items:[]};"select"===g?l(f,i):k(f,i),e=new M(f,a.extend(!0,{},c,i,b))}})},a.fn.selectize.defaults=M.defaults,a.fn.selectize.support={validity:x},M.define("drag_drop",function(b){if(!a.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var c=this;c.lock=function(){var a=c.lock;return function(){var b=c.$control.data("sortable");return b&&b.disable(),a.apply(c,arguments)}}(),c.unlock=function(){var a=c.unlock;return function(){var b=c.$control.data("sortable");return b&&b.enable(),a.apply(c,arguments)}}(),c.setup=function(){var b=c.setup;return function(){b.apply(this,arguments);var d=c.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:c.isLocked,start:function(a,b){b.placeholder.css("width",b.helper.css("width")),d.css({overflow:"visible"})},stop:function(){d.css({overflow:"hidden"});var b=c.$activeItems?c.$activeItems.slice():null,e=[];d.children("[data-value]").each(function(){e.push(a(this).attr("data-value"))}),c.setValue(e),c.setActiveItem(b)}})}}()}}),M.define("dropdown_header",function(b){var c=this;b=a.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(a){return'<div class="'+a.headerClass+'"><div class="'+a.titleRowClass+'"><span class="'+a.labelClass+'">'+a.title+'</span><a href="javascript:void(0)" class="'+a.closeClass+'">&times;</a></div></div>'}},b),c.setup=function(){var d=c.setup;return function(){d.apply(c,arguments),c.$dropdown_header=a(b.html(b)),c.$dropdown.prepend(c.$dropdown_header)}}()}),M.define("optgroup_columns",function(b){var c=this;b=a.extend({equalizeWidth:!0,equalizeHeight:!0},b),this.getAdjacentOption=function(b,c){var d=b.closest("[data-group]").find("[data-selectable]"),e=d.index(b)+c;return e>=0&&e<d.length?d.eq(e):a()},this.onKeyDown=function(){var a=c.onKeyDown;return function(b){var d,e,f,g;return!this.isOpen||b.keyCode!==j&&b.keyCode!==m?a.apply(this,arguments):(c.ignoreHover=!0,g=this.$activeOption.closest("[data-group]"),d=g.find("[data-selectable]").index(this.$activeOption),g=b.keyCode===j?g.prev("[data-group]"):g.next("[data-group]"),f=g.find("[data-selectable]"),e=f.eq(Math.min(f.length-1,d)),void(e.length&&this.setActiveOption(e)))}}();var d=function(){var a,b=d.width,c=document;return"undefined"==typeof b&&(a=c.createElement("div"),a.innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',a=a.firstChild,c.body.appendChild(a),b=d.width=a.offsetWidth-a.clientWidth,c.body.removeChild(a)),b},e=function(){var e,f,g,h,i,j,k;if(k=a("[data-group]",c.$dropdown_content),f=k.length,f&&c.$dropdown_content.width()){if(b.equalizeHeight){for(g=0,e=0;e<f;e++)g=Math.max(g,k.eq(e).height());k.css({height:g})}b.equalizeWidth&&(j=c.$dropdown_content.innerWidth()-d(),h=Math.round(j/f),k.css({width:h}),f>1&&(i=j-h*(f-1),k.eq(f-1).css({width:i})))}};(b.equalizeHeight||b.equalizeWidth)&&(B.after(this,"positionDropdown",e),B.after(this,"refreshOptions",e))}),M.define("remove_button",function(b){b=a.extend({label:"&times;",title:"Remove",className:"remove",append:!0},b);var c=function(b,c){c.className="remove-single";var d=b,e='<a href="javascript:void(0)" class="'+c.className+'" tabindex="-1" title="'+A(c.title)+'">'+c.label+"</a>",f=function(a,b){return a+b};b.setup=function(){var g=d.setup;return function(){if(c.append){var h=a(d.$input.context).attr("id"),i=(a("#"+h),d.settings.render.item);d.settings.render.item=function(a){return f(i.apply(b,arguments),e)}}g.apply(b,arguments),b.$control.on("click","."+c.className,function(a){a.preventDefault(),d.isLocked||d.clear()})}}()},d=function(b,c){var d=b,e='<a href="javascript:void(0)" class="'+c.className+'" tabindex="-1" title="'+A(c.title)+'">'+c.label+"</a>",f=function(a,b){var c=a.search(/(<\/[^>]+>\s*)$/);return a.substring(0,c)+b+a.substring(c)};b.setup=function(){var g=d.setup;return function(){if(c.append){var h=d.settings.render.item;d.settings.render.item=function(a){return f(h.apply(b,arguments),e)}}g.apply(b,arguments),b.$control.on("click","."+c.className,function(b){if(b.preventDefault(),!d.isLocked){var c=a(b.currentTarget).parent();d.setActiveItem(c),d.deleteSelection()&&d.setCaret(d.items.length)}})}}()};return"single"===this.settings.mode?void c(this,b):void d(this,b)}),M.define("restore_on_backspace",function(a){var b=this;a.text=a.text||function(a){return a[this.settings.labelField]},this.onKeyDown=function(){var c=b.onKeyDown;return function(b){var d,e;return b.keyCode===p&&""===this.$control_input.val()&&!this.$activeItems.length&&(d=this.caretPos-1,d>=0&&d<this.items.length)?(e=this.options[this.items[d]],this.deleteSelection(b)&&(this.setTextboxValue(a.text.apply(this,[e])),this.refreshOptions(!0)),void b.preventDefault()):c.apply(this,arguments)}}()}),M});
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://responsive.menu/donate
4
  Tags: responsive, menu, responsive menu, mobile menu, wordpress responsive menu, wp responsive menu, tablet menu, hamburger menu, hamburger, mobile, tablet, 3 lines, 3 line, three line, three lines
5
  Requires at least: 3.6
6
  Tested up to: 4.8
7
- Stable tag: 3.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -111,6 +111,14 @@ To view our FAQ, please go to <a href="https://responsive.menu/faq">https://resp
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
 
 
 
114
  = 3.1.3 (19th May 2017) =
115
  * **Requires PHP 5.4**
116
  * RTL improvements for admin UI
4
  Tags: responsive, menu, responsive menu, mobile menu, wordpress responsive menu, wp responsive menu, tablet menu, hamburger menu, hamburger, mobile, tablet, 3 lines, 3 line, three line, three lines
5
  Requires at least: 3.6
6
  Tested up to: 4.8
7
+ Stable tag: 3.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
111
 
112
  == Changelog ==
113
 
114
+ = 3.1.4 (10th June 2017) =
115
+ * **Requires PHP 5.4**
116
+ * Added CSRF protection using nonces in admin
117
+ * Updated wpdb method to use replace() instead of update() to protect from migration issues
118
+ * Added selectize JS library
119
+ * Allow custom trigger types for button - Pro Only
120
+ * Fixed custom HTML icon bug - Pro Only
121
+
122
  = 3.1.3 (19th May 2017) =
123
  * **Requires PHP 5.4**
124
  * RTL improvements for admin UI
responsive-menu.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Responsive Menu
5
  Plugin URI: https://responsive.menu
6
  Description: Highly Customisable Responsive Menu Plugin for WordPress
7
- Version: 3.1.3
8
  Author: Peter Featherstone
9
  Text Domain: responsive-menu
10
  Author URI: https://peterfeatherstone.com
4
  Plugin Name: Responsive Menu
5
  Plugin URI: https://responsive.menu
6
  Description: Highly Customisable Responsive Menu Plugin for WordPress
7
+ Version: 3.1.4
8
  Author: Peter Featherstone
9
  Text Domain: responsive-menu
10
  Author URI: https://peterfeatherstone.com
views/admin/macros.html.twig CHANGED
@@ -34,6 +34,10 @@
34
  </select>
35
  {% endmacro %}
36
 
 
 
 
 
37
  {% macro font_icon(name, value, type) %}
38
  <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value|escape }}' class='form-control font-icon-input {{ class }}'>
39
  <select class='selectpicker show-tick font-icon-select' name='menu[{{ name }}_type]'>
@@ -107,7 +111,7 @@
107
  <textarea class='form-control' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]'>{{ value }}</textarea>
108
  {% endmacro %}
109
 
110
- {% macro row(name, title, type, options, errors, class='', pro='', select_type='', unit_type='', sub_title='', unit='', choices=[], example='') %}
111
  {% import _self as macros %}
112
  <tr{% if errors[name] %} class='danger'{% endif %}>
113
  <td class='well col-md-3'>
@@ -115,8 +119,8 @@
115
  {% if sub_title %}
116
  <div class='sub-text'>{{ sub_title|raw }}</div>
117
  {% endif %}
118
- {% if example %}
119
- <div class='example'>{{ example|raw }}</div>
120
  {% endif %}
121
  </td>
122
  <td{% if pro %} class='{{ pro }}'{% endif %}>
@@ -141,6 +145,8 @@
141
  {% endif %}
142
  {% elseif type == 'textarea' %}
143
  {{ macros.textarea(name, options[name], class) }}
 
 
144
  {% elseif type == 'select' %}
145
  {% if select_type == 'side' %}
146
  {% set choices = {
34
  </select>
35
  {% endmacro %}
36
 
37
+ {% macro selectize(name, value, class='') %}
38
+ <input type="text" value="{{ value }}" id='responsive-menu-{{ name|replace({'_': '-'}) }}' class='selectize {{ class }}' name='menu[{{ name }}]' />
39
+ {% endmacro %}
40
+
41
  {% macro font_icon(name, value, type) %}
42
  <input type='text' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]' value='{{ value|escape }}' class='form-control font-icon-input {{ class }}'>
43
  <select class='selectpicker show-tick font-icon-select' name='menu[{{ name }}_type]'>
111
  <textarea class='form-control' id='responsive-menu-{{ name|replace({'_': '-'}) }}' name='menu[{{ name }}]'>{{ value }}</textarea>
112
  {% endmacro %}
113
 
114
+ {% macro row(name, title, type, options, errors, class='', pro='', select_type='', unit_type='', sub_title='', unit='', choices=[], sub_sub_title='') %}
115
  {% import _self as macros %}
116
  <tr{% if errors[name] %} class='danger'{% endif %}>
117
  <td class='well col-md-3'>
119
  {% if sub_title %}
120
  <div class='sub-text'>{{ sub_title|raw }}</div>
121
  {% endif %}
122
+ {% if sub_sub_title %}
123
+ <div class='sub_sub_title'><br />{{ sub_sub_title|raw }}</div>
124
  {% endif %}
125
  </td>
126
  <td{% if pro %} class='{{ pro }}'{% endif %}>
145
  {% endif %}
146
  {% elseif type == 'textarea' %}
147
  {{ macros.textarea(name, options[name], class) }}
148
+ {% elseif type == 'selectize' %}
149
+ {{ macros.selectize(name, options[name]) }}
150
  {% elseif type == 'select' %}
151
  {% if select_type == 'side' %}
152
  {% set choices = {
views/admin/main.html.twig CHANGED
@@ -1,5 +1,6 @@
1
  <div class='container-fluid'>
2
  <form class='form-horizontal form-inline' id='responsive-menu-form' action='' method='post' enctype='multipart/form-data'>
 
3
  {% include 'admin/alerts.html.twig' %}
4
  {% include 'admin/tabs.html.twig' %}
5
  <div id='options-area'>
1
  <div class='container-fluid'>
2
  <form class='form-horizontal form-inline' id='responsive-menu-form' action='' method='post' enctype='multipart/form-data'>
3
+ {{ csrf() }}
4
  {% include 'admin/alerts.html.twig' %}
5
  {% include 'admin/tabs.html.twig' %}
6
  <div id='options-area'>
views/admin/sections/button.html.twig CHANGED
@@ -4,6 +4,7 @@
4
  <div class='panel-body'>Animation<small>Button</small></div>
5
  <table class='table table-bordered table-hover'>
6
  {{ macros.row('button_click_animation', 'Type', 'select', options, errors, '', 'semi-pro', 'button_animation', '', 'To see all animations in action please visit <a href="https://jonsuh.com/hamburgers/" target="_blank">this page</a>.') }}
 
7
  {{ macros.row('button_position_type', 'Positioning', 'select', options, errors, '', '', 'position') }}
8
  {{ macros.row('button_push_with_animation', 'Push Button with Menu', 'checkbox', options, errors) }}
9
  </table>
4
  <div class='panel-body'>Animation<small>Button</small></div>
5
  <table class='table table-bordered table-hover'>
6
  {{ macros.row('button_click_animation', 'Type', 'select', options, errors, '', 'semi-pro', 'button_animation', '', 'To see all animations in action please visit <a href="https://jonsuh.com/hamburgers/" target="_blank">this page</a>.') }}
7
+ {{ macros.row('button_trigger_type', 'Trigger Types', 'selectize', options, errors, '', 'semi-pro', '', '', 'Only click is available in the Free version.') }}
8
  {{ macros.row('button_position_type', 'Positioning', 'select', options, errors, '', '', 'position') }}
9
  {{ macros.row('button_push_with_animation', 'Push Button with Menu', 'checkbox', options, errors) }}
10
  </table>
views/admin/sections/initial-setup.html.twig CHANGED
@@ -8,7 +8,7 @@
8
  </div>
9
  <table class="table table-bordered table-hover">
10
  {{ macros.row('breakpoint', 'Breakpoint', 'input', options, errors, '', '', '', '', 'This is the width of the screen at which point you would like the menu to start showing in pixels.', 'px', '', 'Set to 80000 if you want the menu to appear on all devices.') }}
11
- {{ macros.row('menu_to_use', 'Menu to Use', 'select', options, errors, '', '', 'custom', '', 'If no options appear here, make sure you have set them up under <strong>Appearance > Menus</strong> or click <a href="' ~ admin_url ~ 'nav-menus.php">here</a>.', '', nav_menus) }}
12
  {{ macros.row('menu_to_hide', 'CSS Selector of Menu to Hide', 'input', options, errors, '', '', '', '', 'Any legal CSS selection criteria is valid here.', '', '', 'e.g: #nav-menu, nav, .other-nav') }}
13
  </table>
14
  </div>
8
  </div>
9
  <table class="table table-bordered table-hover">
10
  {{ macros.row('breakpoint', 'Breakpoint', 'input', options, errors, '', '', '', '', 'This is the width of the screen at which point you would like the menu to start showing in pixels.', 'px', '', 'Set to 80000 if you want the menu to appear on all devices.') }}
11
+ {{ macros.row('menu_to_use', 'Menu to Use', 'select', options, errors, '', '', 'custom', '', 'If no options appear here, make sure you have set them up under <strong>Appearance > Menus</strong> or click <a href="' ~ admin_url ~ 'nav-menus.php">here</a>.', '', nav_menus, 'Please note that the <a class="scroll-to-option" href="#responsive-menu-theme-location-menu">Theme Location</a> option will take precedence over this.') }}
12
  {{ macros.row('menu_to_hide', 'CSS Selector of Menu to Hide', 'input', options, errors, '', '', '', '', 'Any legal CSS selection criteria is valid here.', '', '', 'e.g: #nav-menu, nav, .other-nav') }}
13
  </table>
14
  </div>
views/admin/sections/menu.html.twig CHANGED
@@ -219,6 +219,6 @@
219
  <div class='panel-body'>Advanced<small>Menu</small></div>
220
  <table class='table table-bordered table-hover'>
221
  {{ macros.row('menu_disable_scrolling', 'Disable Background Scrolling', 'checkbox', options, errors, '', 'pro') }}
222
- {{ macros.row('theme_location_menu', 'Theme Location Menu', 'select', options, errors, '', '', 'custom', '', '', '', location_menus) }}
223
  </table>
224
  </div>
219
  <div class='panel-body'>Advanced<small>Menu</small></div>
220
  <table class='table table-bordered table-hover'>
221
  {{ macros.row('menu_disable_scrolling', 'Disable Background Scrolling', 'checkbox', options, errors, '', 'pro') }}
222
+ {{ macros.row('theme_location_menu', 'Theme Location Menu', 'select', options, errors, '', '', 'custom', '', '', '', location_menus, 'Please note that this will overwrite the <a class="scroll-to-option" href="#responsive-menu-menu-to-use">Menu to Use</a> option.') }}
223
  </table>
224
  </div>
views/admin/tabs.html.twig CHANGED
@@ -1,7 +1,7 @@
1
  <ul class='nav nav-tabs'>
2
  <li{% if current_page() == 'initial-setup' %} class='active'{% endif %} id="initial-setup-tab"><a data-toggle='tab' href='#initial-setup'>Initial Setup <span class='badge'>3</span></a></li>
3
  <li{% if current_page() == 'menu' %} class='active'{% endif %} id="menu-tab"><a data-toggle='tab' href='#menu'>Menu <span class='badge'>56</span></a></li>
4
- <li{% if current_page() == 'button' %} class='active'{% endif %} id="button-tab"><a data-toggle='tab' href='#button'>Button <span class='badge'>31</span></a></li>
5
  <li{% if current_page() == 'sub-menus' %} class='active'{% endif %} id="sub-menus-tab"><a data-toggle='tab' href='#sub-menus'>Sub Menus <span class='badge'>33</span></a></li>
6
  <li{% if current_page() == 'technical' %} class='active'{% endif %} id="technical-tab"><a data-toggle='tab' href='#technical'>Technical <span class='badge'>8</span></a></li>
7
  <li{% if current_page() == 'import-export' %} class='active'{% endif %} id="import-export-tabZz"><a data-toggle='tab' href='#import-export'>Import/Export <span class='badge'>4</span></a></li>
1
  <ul class='nav nav-tabs'>
2
  <li{% if current_page() == 'initial-setup' %} class='active'{% endif %} id="initial-setup-tab"><a data-toggle='tab' href='#initial-setup'>Initial Setup <span class='badge'>3</span></a></li>
3
  <li{% if current_page() == 'menu' %} class='active'{% endif %} id="menu-tab"><a data-toggle='tab' href='#menu'>Menu <span class='badge'>56</span></a></li>
4
+ <li{% if current_page() == 'button' %} class='active'{% endif %} id="button-tab"><a data-toggle='tab' href='#button'>Button <span class='badge'>32</span></a></li>
5
  <li{% if current_page() == 'sub-menus' %} class='active'{% endif %} id="sub-menus-tab"><a data-toggle='tab' href='#sub-menus'>Sub Menus <span class='badge'>33</span></a></li>
6
  <li{% if current_page() == 'technical' %} class='active'{% endif %} id="technical-tab"><a data-toggle='tab' href='#technical'>Technical <span class='badge'>8</span></a></li>
7
  <li{% if current_page() == 'import-export' %} class='active'{% endif %} id="import-export-tabZz"><a data-toggle='tab' href='#import-export'>Import/Export <span class='badge'>4</span></a></li>