Version Description
- Fixed a bug that made menu items "jump" slightly to the left when you start to drag them.
- Fixed a Multisite-specific bug where temporarily switching to another site using the switch_to_blog() function could result in the user having the wrong permissions.
- When saving settings, the plugin will now compress the menu data before sending it to the server. This reduces the chances of exceeding request size limits that are imposed by some hosting companies.
- You can dismiss the "Settings saved" notification by clicking the "x" button.
- Tested up to WordPress 4.5.2.
Download this release
Release Info
Developer | whiteshadow |
Plugin | Admin Menu Editor |
Version | 1.6.2 |
Comparing to | |
See all releases |
Code changes from version 1.6.1 to 1.6.2
- css/menu-editor.css +1 -1
- css/menu-editor.scss +13 -5
- css/style-modern-one.css +2 -1
- css/style-modern-one.scss +11 -8
- includes/ajax-helper.php +178 -0
- includes/editor-page.php +1 -1
- includes/menu-editor-core.php +39 -6
- includes/menu.php +3 -1
- js/actor-manager.js +11 -2
- js/actor-manager.ts +13 -2
- js/jquery.form.d.ts +7 -0
- js/jquery.form.js +260 -115
- js/jqueryui.d.ts +1843 -0
- js/lodash-3.10.d.ts +17 -17
- js/menu-editor.js +64 -0
- menu-editor.php +1 -1
- modules/access-editor/access-editor.js +3 -3
- readme.txt +9 -2
css/menu-editor.css
CHANGED
@@ -144,7 +144,7 @@
|
|
144 |
display: block;
|
145 |
width: 290px;
|
146 |
padding: 3px;
|
147 |
-
margin: 2px
|
148 |
|
149 |
.ws_submenu {
|
150 |
min-height: 2em; }
|
144 |
display: block;
|
145 |
width: 290px;
|
146 |
padding: 3px;
|
147 |
+
margin: 2px 0 2px 6px; }
|
148 |
|
149 |
.ws_submenu {
|
150 |
min-height: 2em; }
|
css/menu-editor.scss
CHANGED
@@ -12,13 +12,16 @@
|
|
12 |
margin-top: 9px;
|
13 |
}
|
14 |
|
|
|
|
|
|
|
15 |
.ws_main_container {
|
16 |
margin: 2px;
|
17 |
-
width:
|
18 |
float: left;
|
19 |
display:block;
|
20 |
|
21 |
-
border:
|
22 |
background-color: #FFFFFF;
|
23 |
|
24 |
border-radius: 3px;
|
@@ -204,11 +207,16 @@
|
|
204 |
*/
|
205 |
|
206 |
.ws_container {
|
|
|
|
|
|
|
|
|
|
|
207 |
display: block;
|
208 |
-
width:
|
209 |
|
210 |
-
padding :
|
211 |
-
margin: 2px
|
212 |
}
|
213 |
|
214 |
.ws_active { }
|
12 |
margin-top: 9px;
|
13 |
}
|
14 |
|
15 |
+
$mainContainerWidth: 310px;
|
16 |
+
$mainContainerBorderWidth: 1px;
|
17 |
+
|
18 |
.ws_main_container {
|
19 |
margin: 2px;
|
20 |
+
width: $mainContainerWidth;
|
21 |
float: left;
|
22 |
display:block;
|
23 |
|
24 |
+
border: $mainContainerBorderWidth solid #cdd5d5;
|
25 |
background-color: #FFFFFF;
|
26 |
|
27 |
border-radius: 3px;
|
207 |
*/
|
208 |
|
209 |
.ws_container {
|
210 |
+
$itemWidth: 290px;
|
211 |
+
$itemPadding: 3px;
|
212 |
+
$itemBorderWidth: 1px;
|
213 |
+
$itemHorizontalMargin: ($mainContainerWidth - $itemWidth - $itemPadding * 2 - $itemBorderWidth * 2) / 2;
|
214 |
+
|
215 |
display: block;
|
216 |
+
width: $itemWidth;
|
217 |
|
218 |
+
padding : $itemPadding;
|
219 |
+
margin: 2px 0 2px $itemHorizontalMargin;
|
220 |
}
|
221 |
|
222 |
.ws_active { }
|
css/style-modern-one.css
CHANGED
@@ -13,6 +13,7 @@ $hiddenItemBorder: #f1acb1;
|
|
13 |
padding: 0;
|
14 |
margin-top: 0;
|
15 |
margin-bottom: 9px;
|
|
|
16 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); }
|
17 |
.ws_container .ws_item_title {
|
18 |
color: #23282D;
|
@@ -116,7 +117,7 @@ $hiddenItemBorder: #f1acb1;
|
|
116 |
#ws_menu_editor #ws_toggle_editor_layout {
|
117 |
display: block; }
|
118 |
|
119 |
-
#ws_icon_selector {
|
120 |
z-index: 3; }
|
121 |
|
122 |
.ws_container.ui-sortable-helper {
|
13 |
padding: 0;
|
14 |
margin-top: 0;
|
15 |
margin-bottom: 9px;
|
16 |
+
margin-left: 10px;
|
17 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); }
|
18 |
.ws_container .ws_item_title {
|
19 |
color: #23282D;
|
117 |
#ws_menu_editor #ws_toggle_editor_layout {
|
118 |
display: block; }
|
119 |
|
120 |
+
#ws_icon_selector, #ws_embedded_page_selector {
|
121 |
z-index: 3; }
|
122 |
|
123 |
.ws_container.ui-sortable-helper {
|
css/style-modern-one.scss
CHANGED
@@ -27,7 +27,12 @@ $hiddenItemBackground: darken($itemBackground, 9);
|
|
27 |
$hiddenItemBorder: $itemBorder;
|
28 |
$hiddenItemText: #888; //#9a9ea5; //#82878C; //#999
|
29 |
|
|
|
|
|
|
|
30 |
.ws_container {
|
|
|
|
|
31 |
border: 0 solid transparent;
|
32 |
background: $itemBackground;
|
33 |
|
@@ -40,6 +45,7 @@ $hiddenItemText: #888; //#9a9ea5; //#82878C; //#999
|
|
40 |
|
41 |
margin-top: 0;
|
42 |
margin-bottom: $itemMarginBottom;
|
|
|
43 |
|
44 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
45 |
|
@@ -231,12 +237,11 @@ $hiddenItemText: #888; //#9a9ea5; //#82878C; //#999
|
|
231 |
display: block;
|
232 |
}
|
233 |
|
234 |
-
|
235 |
-
//
|
236 |
-
|
237 |
|
238 |
-
#ws_icon_selector {
|
239 |
-
//Appear above the selected item.
|
240 |
z-index: 3;
|
241 |
}
|
242 |
|
@@ -252,10 +257,8 @@ $hiddenItemText: #888; //#9a9ea5; //#82878C; //#999
|
|
252 |
// Columns / containers
|
253 |
//==============================================
|
254 |
|
255 |
-
$columnPadding: 10px;
|
256 |
-
|
257 |
.ws_main_container {
|
258 |
-
width: $
|
259 |
|
260 |
.ws_toolbar {
|
261 |
padding: $columnPadding $columnPadding 0;
|
27 |
$hiddenItemBorder: $itemBorder;
|
28 |
$hiddenItemText: #888; //#9a9ea5; //#82878C; //#999
|
29 |
|
30 |
+
$columnPadding: 10px;
|
31 |
+
$mainContainerWidth: $itemWidth + $columnPadding * 2;
|
32 |
+
|
33 |
.ws_container {
|
34 |
+
$itemHorizontalMargin: ($mainContainerWidth - $itemWidth) / 2;
|
35 |
+
|
36 |
border: 0 solid transparent;
|
37 |
background: $itemBackground;
|
38 |
|
45 |
|
46 |
margin-top: 0;
|
47 |
margin-bottom: $itemMarginBottom;
|
48 |
+
margin-left: $itemHorizontalMargin;
|
49 |
|
50 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
51 |
|
237 |
display: block;
|
238 |
}
|
239 |
|
240 |
+
//====================================================
|
241 |
+
// Dropdowns should appear above the selected item.
|
242 |
+
//====================================================
|
243 |
|
244 |
+
#ws_icon_selector, #ws_embedded_page_selector {
|
|
|
245 |
z-index: 3;
|
246 |
}
|
247 |
|
257 |
// Columns / containers
|
258 |
//==============================================
|
259 |
|
|
|
|
|
260 |
.ws_main_container {
|
261 |
+
width: $mainContainerWidth;
|
262 |
|
263 |
.ws_toolbar {
|
264 |
padding: $columnPadding $columnPadding 0;
|
includes/ajax-helper.php
ADDED
@@ -0,0 +1,178 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class ameAjaxAction {
|
3 |
+
protected $action = '';
|
4 |
+
protected $handler;
|
5 |
+
|
6 |
+
protected $requiredParameters = array();
|
7 |
+
protected $defaultParameters = array();
|
8 |
+
protected $checkAuthorization;
|
9 |
+
|
10 |
+
public function __construct($uniqueActionName = null, $handler = null) {
|
11 |
+
if (isset($uniqueActionName)) {
|
12 |
+
$this->action = $uniqueActionName;
|
13 |
+
}
|
14 |
+
if (isset($handler)) {
|
15 |
+
$this->handler = $handler;
|
16 |
+
}
|
17 |
+
|
18 |
+
if (empty($this->action)) {
|
19 |
+
throw new LogicException(sprintf(
|
20 |
+
'AJAX action name is missing. You must either pass it to the %1$s constructor '
|
21 |
+
. 'or give the %1$s::$action property a valid default value.',
|
22 |
+
get_class($this)
|
23 |
+
));
|
24 |
+
}
|
25 |
+
|
26 |
+
$hookName = 'wp_ajax_' . $this->action;
|
27 |
+
if (has_action($hookName)) {
|
28 |
+
throw new RuntimeException(sprintf('The action name "%s" is already in use.', $this->action));
|
29 |
+
}
|
30 |
+
add_action('wp_ajax_' . $this->action, array($this, '_processRequest'));
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @access protected
|
35 |
+
*/
|
36 |
+
public function _processRequest() {
|
37 |
+
//Check nonce.
|
38 |
+
if (!check_ajax_referer($this->action, false, false)) {
|
39 |
+
$this->exitWithError(
|
40 |
+
'Access denied. Invalid nonce',
|
41 |
+
'invalid_nonce'
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
$method = filter_input(INPUT_SERVER, 'REQUEST_METHOD');
|
46 |
+
|
47 |
+
//Retrieve request parameters.
|
48 |
+
$params = array();
|
49 |
+
if ($method === 'GET') {
|
50 |
+
$params = $_GET;
|
51 |
+
} else if ($method === 'POST') {
|
52 |
+
$params = $_POST;
|
53 |
+
}
|
54 |
+
|
55 |
+
//Remove magic quotes. WordPress applies them in wp-settings.php.
|
56 |
+
if (did_action('sanitize_comment_cookies') && function_exists('wp_magic_quotes')) {
|
57 |
+
$params = wp_unslash($params);
|
58 |
+
}
|
59 |
+
|
60 |
+
//Verify that all of the required parameters are present. Empty strings are not allowed.
|
61 |
+
foreach($this->requiredParameters as $name) {
|
62 |
+
if (!isset($params[$name]) || ($params[$name] === '')) {
|
63 |
+
$this->exitWithError(
|
64 |
+
sprintf('The required parameter "%s" is missing or empty.', $name),
|
65 |
+
'missing_required_parameter'
|
66 |
+
);
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
//Apply defaults.
|
71 |
+
$params = array_merge($this->defaultParameters, $params);
|
72 |
+
|
73 |
+
//Run custom authorization checks.
|
74 |
+
$isAllowed = $this->isUserAuthorized($params);
|
75 |
+
if ($isAllowed instanceof WP_Error) {
|
76 |
+
$this->exitWithError($isAllowed->get_error_message(), $isAllowed->get_error_code());
|
77 |
+
} else if (!$isAllowed) {
|
78 |
+
$this->exitWithError(
|
79 |
+
sprintf('You don\'t have permission to perform the "%s" action.', $this->action),
|
80 |
+
'access_denied'
|
81 |
+
);
|
82 |
+
}
|
83 |
+
|
84 |
+
//Finally, perform the action.
|
85 |
+
$response = $this->handleAction($params);
|
86 |
+
if ($response instanceof WP_Error) {
|
87 |
+
$this->exitWithError($response->get_error_message(), $response->get_error_code());
|
88 |
+
}
|
89 |
+
$this->outputResponse($response);
|
90 |
+
exit;
|
91 |
+
}
|
92 |
+
|
93 |
+
protected function handleAction($params) {
|
94 |
+
if (is_callable($this->handler)) {
|
95 |
+
return call_user_func($this->handler, $params);
|
96 |
+
} else {
|
97 |
+
$this->exitWithError(
|
98 |
+
sprintf(
|
99 |
+
'There is no request handler assigned to the "%1$s" action. '
|
100 |
+
. 'Either override the %3$s method or set %2$s::$handler to a valid callback.',
|
101 |
+
$this->action,
|
102 |
+
__CLASS__,
|
103 |
+
__METHOD__
|
104 |
+
),
|
105 |
+
'missing_ajax_handler'
|
106 |
+
);
|
107 |
+
return null;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
|
111 |
+
protected function exitWithError($message, $code = null) {
|
112 |
+
if ( ($message === '') && !empty($code) ) {
|
113 |
+
$message = $code;
|
114 |
+
}
|
115 |
+
|
116 |
+
$response = array(
|
117 |
+
'error' => array(
|
118 |
+
'message' => $message,
|
119 |
+
'code' => $code,
|
120 |
+
)
|
121 |
+
);
|
122 |
+
$this->outputResponse($response);
|
123 |
+
exit;
|
124 |
+
}
|
125 |
+
|
126 |
+
protected function outputResponse($response) {
|
127 |
+
header('Content-Type: application/json');
|
128 |
+
echo json_encode($response);
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Check if the current user is authorized to perform this action.
|
133 |
+
*
|
134 |
+
* @param array $params Request parameters.
|
135 |
+
* @return bool|WP_Error
|
136 |
+
*/
|
137 |
+
protected function isUserAuthorized($params) {
|
138 |
+
if (isset($this->checkAuthorization)) {
|
139 |
+
return call_user_func($this->checkAuthorization, $params);
|
140 |
+
}
|
141 |
+
return true;
|
142 |
+
}
|
143 |
+
|
144 |
+
//Just a bunch of fluent setters.
|
145 |
+
//-------------------------------
|
146 |
+
|
147 |
+
/**
|
148 |
+
* @param string ...$param One or more parameter names.
|
149 |
+
* @return $this
|
150 |
+
*/
|
151 |
+
public function setRequiredParams($param) {
|
152 |
+
$params = func_get_args();
|
153 |
+
if (count($params) === 1 && is_array($params[0])) {
|
154 |
+
$params = $params[0];
|
155 |
+
}
|
156 |
+
|
157 |
+
$this->requiredParameters = $params;
|
158 |
+
return $this;
|
159 |
+
}
|
160 |
+
|
161 |
+
/**
|
162 |
+
* @param callable $handler
|
163 |
+
* @return $this
|
164 |
+
*/
|
165 |
+
public function setHandler($handler) {
|
166 |
+
$this->handler = $handler;
|
167 |
+
return $this;
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* @param callable $callback
|
172 |
+
* @return $this
|
173 |
+
*/
|
174 |
+
public function setAuthCallback($callback) {
|
175 |
+
$this->checkAuthorization = $callback;
|
176 |
+
return $this;
|
177 |
+
}
|
178 |
+
}
|
includes/editor-page.php
CHANGED
@@ -64,7 +64,7 @@ if ( !apply_filters('admin_menu_editor_is_pro', false) ){
|
|
64 |
<?php
|
65 |
if ( !empty($_GET['message']) ){
|
66 |
if ( intval($_GET['message']) == 1 ){
|
67 |
-
echo '<div id="message" class="updated
|
68 |
} elseif ( intval($_GET['message']) == 2 ) {
|
69 |
echo '<div id="message" class="error"><p><strong>Failed to decode input! The menu wasn\'t modified.</strong></p></div>';
|
70 |
}
|
64 |
<?php
|
65 |
if ( !empty($_GET['message']) ){
|
66 |
if ( intval($_GET['message']) == 1 ){
|
67 |
+
echo '<div id="message" class="updated notice is-dismissible"><p><strong>Settings saved.</strong></p></div>';
|
68 |
} elseif ( intval($_GET['message']) == 2 ) {
|
69 |
echo '<div id="message" class="error"><p><strong>Failed to decode input! The menu wasn\'t modified.</strong></p></div>';
|
70 |
}
|
includes/menu-editor-core.php
CHANGED
@@ -14,6 +14,7 @@ require $thisDirectory . '/role-utils.php';
|
|
14 |
require $thisDirectory . '/menu-item.php';
|
15 |
require $thisDirectory . '/menu.php';
|
16 |
require $thisDirectory . '/auto-versioning.php';
|
|
|
17 |
|
18 |
class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
19 |
const WPML_CONTEXT = 'admin-menu-editor menu texts';
|
@@ -186,6 +187,11 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
186 |
'index.php?page=dwqa-about' => true,
|
187 |
'index.php?page=dwqa-changelog' => true,
|
188 |
'index.php?page=dwqa-credits' => true,
|
|
|
|
|
|
|
|
|
|
|
189 |
);
|
190 |
|
191 |
//AJAXify screen options
|
@@ -231,6 +237,9 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
231 |
//There's also a "set_user_role" hook, but it's only called by WP_User::set_role and not WP_User::add_role.
|
232 |
//It's also redundant - WP_User::set_role updates user meta, so the above hooks already cover it.
|
233 |
|
|
|
|
|
|
|
234 |
add_action('admin_menu_editor-display_tabs', array($this, 'display_editor_tabs'));
|
235 |
|
236 |
//Modules
|
@@ -239,7 +248,11 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
239 |
|
240 |
$proModuleDirectory = AME_ROOT_DIR . '/extras/modules';
|
241 |
if ( @is_dir($proModuleDirectory) ) {
|
242 |
-
|
|
|
|
|
|
|
|
|
243 |
require_once $proModuleDirectory . '/dashboard-widget-editor/load.php';
|
244 |
new ameWidgetEditor($this);
|
245 |
}
|
@@ -340,8 +353,15 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
340 |
if ( $this->current_user_can_edit_menu() ){
|
341 |
$this->log_security_note('Current user can edit the admin menu.');
|
342 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
$page = add_options_page(
|
344 |
-
apply_filters('admin_menu_editor-self_page_title', 'Menu Editor'),
|
345 |
apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor'),
|
346 |
apply_filters('admin_menu_editor-capability', 'manage_options'),
|
347 |
'menu_editor',
|
@@ -365,9 +385,6 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
365 |
|
366 |
//Make a placeholder for our screen options (hacky)
|
367 |
add_meta_box("ws-ame-screen-options", "[AME placeholder]", '__return_false', $page);
|
368 |
-
|
369 |
-
//Determine the current menu editor page tab.
|
370 |
-
$this->current_tab = isset($this->get['sub_section']) ? strval($this->get['sub_section']) : 'editor';
|
371 |
}
|
372 |
|
373 |
//Store the "original" menus for later use in the editor
|
@@ -594,7 +611,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
594 |
*
|
595 |
* @return void
|
596 |
*/
|
597 |
-
function enqueue_scripts(){
|
598 |
//Optimization: Remove wp-emoji.js from the plugin page. wpEmoji makes DOM manipulation slow because
|
599 |
//it tracks *all* DOM changes using MutationObserver.
|
600 |
remove_action('admin_print_scripts', 'print_emoji_detection_script');
|
@@ -2128,6 +2145,22 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
2128 |
return $capability;
|
2129 |
}
|
2130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2131 |
/**
|
2132 |
* Create a virtual 'super_admin' capability that only super admins have.
|
2133 |
* This function accomplishes that by by filtering 'user_has_cap' calls.
|
14 |
require $thisDirectory . '/menu-item.php';
|
15 |
require $thisDirectory . '/menu.php';
|
16 |
require $thisDirectory . '/auto-versioning.php';
|
17 |
+
require $thisDirectory . '/ajax-helper.php';
|
18 |
|
19 |
class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
20 |
const WPML_CONTEXT = 'admin-menu-editor menu texts';
|
187 |
'index.php?page=dwqa-about' => true,
|
188 |
'index.php?page=dwqa-changelog' => true,
|
189 |
'index.php?page=dwqa-credits' => true,
|
190 |
+
//Ninja Forms 2.9.41
|
191 |
+
'index.php?page=nf-about' => true,
|
192 |
+
'index.php?page=nf-changelog' => true,
|
193 |
+
'index.php?page=nf-getting-started' => true,
|
194 |
+
'index.php?page=nf-credits' => true,
|
195 |
);
|
196 |
|
197 |
//AJAXify screen options
|
237 |
//There's also a "set_user_role" hook, but it's only called by WP_User::set_role and not WP_User::add_role.
|
238 |
//It's also redundant - WP_User::set_role updates user meta, so the above hooks already cover it.
|
239 |
|
240 |
+
//Multisite: Clear role and capability caches when switching to another site.
|
241 |
+
add_action('switch_blog', array($this, 'clear_site_specific_caches'), 10, 0);
|
242 |
+
|
243 |
add_action('admin_menu_editor-display_tabs', array($this, 'display_editor_tabs'));
|
244 |
|
245 |
//Modules
|
248 |
|
249 |
$proModuleDirectory = AME_ROOT_DIR . '/extras/modules';
|
250 |
if ( @is_dir($proModuleDirectory) ) {
|
251 |
+
//The widget module requires PHP 5.3.
|
252 |
+
if (
|
253 |
+
version_compare(phpversion(), '5.3', '>=')
|
254 |
+
&& is_file($proModuleDirectory . '/dashboard-widget-editor/load.php')
|
255 |
+
) {
|
256 |
require_once $proModuleDirectory . '/dashboard-widget-editor/load.php';
|
257 |
new ameWidgetEditor($this);
|
258 |
}
|
353 |
if ( $this->current_user_can_edit_menu() ){
|
354 |
$this->log_security_note('Current user can edit the admin menu.');
|
355 |
|
356 |
+
//Determine the current menu editor page tab.
|
357 |
+
$this->current_tab = isset($this->get['sub_section']) ? strval($this->get['sub_section']) : 'editor';
|
358 |
+
$tab_title = '';
|
359 |
+
if ($this->current_tab !== 'editor' && isset($this->tabs[$this->current_tab])) {
|
360 |
+
$tab_title = ' - ' . $this->tabs[$this->current_tab];
|
361 |
+
}
|
362 |
+
|
363 |
$page = add_options_page(
|
364 |
+
apply_filters('admin_menu_editor-self_page_title', 'Menu Editor') . $tab_title,
|
365 |
apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor'),
|
366 |
apply_filters('admin_menu_editor-capability', 'manage_options'),
|
367 |
'menu_editor',
|
385 |
|
386 |
//Make a placeholder for our screen options (hacky)
|
387 |
add_meta_box("ws-ame-screen-options", "[AME placeholder]", '__return_false', $page);
|
|
|
|
|
|
|
388 |
}
|
389 |
|
390 |
//Store the "original" menus for later use in the editor
|
611 |
*
|
612 |
* @return void
|
613 |
*/
|
614 |
+
function enqueue_scripts() {
|
615 |
//Optimization: Remove wp-emoji.js from the plugin page. wpEmoji makes DOM manipulation slow because
|
616 |
//it tracks *all* DOM changes using MutationObserver.
|
617 |
remove_action('admin_print_scripts', 'print_emoji_detection_script');
|
2145 |
return $capability;
|
2146 |
}
|
2147 |
|
2148 |
+
/**
|
2149 |
+
* Clear all internal caches that can vary depending on the current site.
|
2150 |
+
*
|
2151 |
+
* For example, the same user can have different roles on different sites,
|
2152 |
+
* so we must clear the role cache when WordPress switches the active site.
|
2153 |
+
*/
|
2154 |
+
public function clear_site_specific_caches() {
|
2155 |
+
$this->cached_virtual_caps = null;
|
2156 |
+
$this->cached_user_caps = array();
|
2157 |
+
$this->cached_user_roles = array();
|
2158 |
+
|
2159 |
+
if ($this->options['menu_config_scope'] === 'site') {
|
2160 |
+
$this->cached_custom_menu = null;
|
2161 |
+
}
|
2162 |
+
}
|
2163 |
+
|
2164 |
/**
|
2165 |
* Create a virtual 'super_admin' capability that only super admins have.
|
2166 |
* This function accomplishes that by by filtering 'user_has_cap' calls.
|
includes/menu.php
CHANGED
@@ -478,4 +478,6 @@ class ameGrantedCapabilityFilter {
|
|
478 |
}
|
479 |
|
480 |
|
481 |
-
class InvalidMenuException extends Exception {}
|
|
|
|
478 |
}
|
479 |
|
480 |
|
481 |
+
class InvalidMenuException extends Exception {}
|
482 |
+
|
483 |
+
class ameInvalidJsonException extends RuntimeException {};
|
js/actor-manager.js
CHANGED
@@ -55,6 +55,15 @@ var AmeRole = (function (_super) {
|
|
55 |
this.actorTypeSpecificity = 1;
|
56 |
this.name = roleId;
|
57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
return AmeRole;
|
59 |
}(AmeBaseActor));
|
60 |
var AmeUser = (function (_super) {
|
@@ -264,14 +273,14 @@ var AmeActorManager = (function () {
|
|
264 |
AmeActorManager.setCapInContext = function (context, actor, capability, hasCap, sourceType, sourceName) {
|
265 |
capability = AmeActorManager.mapMetaCap(capability);
|
266 |
var grant = sourceType ? [hasCap, sourceType, sourceName || null] : hasCap;
|
267 |
-
_.set(context, [actor, capability], grant);
|
268 |
};
|
269 |
AmeActorManager.prototype.resetCap = function (actor, capability) {
|
270 |
AmeActorManager.resetCapInContext(this.grantedCapabilities, actor, capability);
|
271 |
};
|
272 |
AmeActorManager.resetCapInContext = function (context, actor, capability) {
|
273 |
capability = AmeActorManager.mapMetaCap(capability);
|
274 |
-
if (_.has(context, [actor, capability])) {
|
275 |
delete context[actor][capability];
|
276 |
}
|
277 |
};
|
55 |
this.actorTypeSpecificity = 1;
|
56 |
this.name = roleId;
|
57 |
}
|
58 |
+
AmeRole.prototype.hasOwnCap = function (capability) {
|
59 |
+
//In WordPress, a role name is also a capability name. Users that have the role "foo" always
|
60 |
+
//have the "foo" capability. It's debatable whether the role itself actually has that capability
|
61 |
+
//(WP_Role says no), but it's convenient to treat it that way.
|
62 |
+
if (capability === this.name) {
|
63 |
+
return true;
|
64 |
+
}
|
65 |
+
return _super.prototype.hasOwnCap.call(this, capability);
|
66 |
+
};
|
67 |
return AmeRole;
|
68 |
}(AmeBaseActor));
|
69 |
var AmeUser = (function (_super) {
|
273 |
AmeActorManager.setCapInContext = function (context, actor, capability, hasCap, sourceType, sourceName) {
|
274 |
capability = AmeActorManager.mapMetaCap(capability);
|
275 |
var grant = sourceType ? [hasCap, sourceType, sourceName || null] : hasCap;
|
276 |
+
AmeActorManager._.set(context, [actor, capability], grant);
|
277 |
};
|
278 |
AmeActorManager.prototype.resetCap = function (actor, capability) {
|
279 |
AmeActorManager.resetCapInContext(this.grantedCapabilities, actor, capability);
|
280 |
};
|
281 |
AmeActorManager.resetCapInContext = function (context, actor, capability) {
|
282 |
capability = AmeActorManager.mapMetaCap(capability);
|
283 |
+
if (AmeActorManager._.has(context, [actor, capability])) {
|
284 |
delete context[actor][capability];
|
285 |
}
|
286 |
};
|
js/actor-manager.ts
CHANGED
@@ -68,6 +68,17 @@ class AmeRole extends AmeBaseActor {
|
|
68 |
super('role:' + roleId, displayName, capabilities);
|
69 |
this.name = roleId;
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
class AmeUser extends AmeBaseActor {
|
@@ -345,7 +356,7 @@ class AmeActorManager {
|
|
345 |
capability = AmeActorManager.mapMetaCap(capability);
|
346 |
|
347 |
var grant = sourceType ? [hasCap, sourceType, sourceName || null] : hasCap;
|
348 |
-
_.set(context, [actor, capability], grant);
|
349 |
}
|
350 |
|
351 |
resetCap(actor: string, capability: string) {
|
@@ -355,7 +366,7 @@ class AmeActorManager {
|
|
355 |
static resetCapInContext(context: AmeGrantedCapabilityMap, actor: string, capability: string) {
|
356 |
capability = AmeActorManager.mapMetaCap(capability);
|
357 |
|
358 |
-
if (_.has(context, [actor, capability])) {
|
359 |
delete context[actor][capability];
|
360 |
}
|
361 |
}
|
68 |
super('role:' + roleId, displayName, capabilities);
|
69 |
this.name = roleId;
|
70 |
}
|
71 |
+
|
72 |
+
|
73 |
+
hasOwnCap(capability: string): boolean {
|
74 |
+
//In WordPress, a role name is also a capability name. Users that have the role "foo" always
|
75 |
+
//have the "foo" capability. It's debatable whether the role itself actually has that capability
|
76 |
+
//(WP_Role says no), but it's convenient to treat it that way.
|
77 |
+
if (capability === this.name) {
|
78 |
+
return true;
|
79 |
+
}
|
80 |
+
return super.hasOwnCap(capability);
|
81 |
+
}
|
82 |
}
|
83 |
|
84 |
class AmeUser extends AmeBaseActor {
|
356 |
capability = AmeActorManager.mapMetaCap(capability);
|
357 |
|
358 |
var grant = sourceType ? [hasCap, sourceType, sourceName || null] : hasCap;
|
359 |
+
AmeActorManager._.set(context, [actor, capability], grant);
|
360 |
}
|
361 |
|
362 |
resetCap(actor: string, capability: string) {
|
366 |
static resetCapInContext(context: AmeGrantedCapabilityMap, actor: string, capability: string) {
|
367 |
capability = AmeActorManager.mapMetaCap(capability);
|
368 |
|
369 |
+
if (AmeActorManager._.has(context, [actor, capability])) {
|
370 |
delete context[actor][capability];
|
371 |
}
|
372 |
}
|
js/jquery.form.d.ts
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/// <reference path="jquery.d.ts" />
|
2 |
+
|
3 |
+
interface JQuery {
|
4 |
+
//These method are added by the jquery-form plugin.
|
5 |
+
ajaxForm: (options: any) => JQuery;
|
6 |
+
resetForm: () => JQuery;
|
7 |
+
}
|
js/jquery.form.js
CHANGED
@@ -1,16 +1,28 @@
|
|
1 |
/*!
|
2 |
* jQuery Form Plugin
|
3 |
-
* version: 3.
|
4 |
-
*
|
5 |
-
*
|
6 |
* Examples and documentation at: http://malsup.com/jquery/form/
|
7 |
* Project repository: https://github.com/malsup/form
|
8 |
-
* Dual licensed under the MIT and GPL licenses
|
9 |
-
*
|
10 |
-
* http://malsup.github.com/gpl-license-v2.txt
|
11 |
*/
|
12 |
-
/*global ActiveXObject
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
"use strict";
|
15 |
|
16 |
/*
|
@@ -37,7 +49,7 @@
|
|
37 |
target: '#output'
|
38 |
});
|
39 |
});
|
40 |
-
|
41 |
You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
|
42 |
form does not have to exist when you invoke ajaxForm:
|
43 |
|
@@ -45,7 +57,7 @@
|
|
45 |
delegation: true,
|
46 |
target: '#output'
|
47 |
});
|
48 |
-
|
49 |
When using ajaxForm, the ajaxSubmit function will be invoked for you
|
50 |
at the appropriate time.
|
51 |
*/
|
@@ -57,6 +69,23 @@ var feature = {};
|
|
57 |
feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
|
58 |
feature.formdata = window.FormData !== undefined;
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
/**
|
61 |
* ajaxSubmit() provides a mechanism for immediately submitting
|
62 |
* an HTML form using AJAX.
|
@@ -69,15 +98,19 @@ $.fn.ajaxSubmit = function(options) {
|
|
69 |
log('ajaxSubmit: skipping submit process - no element selected');
|
70 |
return this;
|
71 |
}
|
72 |
-
|
73 |
var method, action, url, $form = this;
|
74 |
|
75 |
if (typeof options == 'function') {
|
76 |
options = { success: options };
|
77 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
-
method = this.attr('method');
|
80 |
-
action = this.attr('action');
|
81 |
url = (typeof action === 'string') ? $.trim(action) : '';
|
82 |
url = url || window.location.href || '';
|
83 |
if (url) {
|
@@ -88,7 +121,7 @@ $.fn.ajaxSubmit = function(options) {
|
|
88 |
options = $.extend(true, {
|
89 |
url: url,
|
90 |
success: $.ajaxSettings.success,
|
91 |
-
type: method ||
|
92 |
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
|
93 |
}, options);
|
94 |
|
@@ -111,7 +144,7 @@ $.fn.ajaxSubmit = function(options) {
|
|
111 |
if ( traditional === undefined ) {
|
112 |
traditional = $.ajaxSettings.traditional;
|
113 |
}
|
114 |
-
|
115 |
var elements = [];
|
116 |
var qx, a = this.formToArray(options.semantic, elements);
|
117 |
if (options.data) {
|
@@ -135,7 +168,7 @@ $.fn.ajaxSubmit = function(options) {
|
|
135 |
var q = $.param(a, traditional);
|
136 |
if (qx) {
|
137 |
q = ( q ? (q + '&' + qx) : qx );
|
138 |
-
}
|
139 |
if (options.type.toUpperCase() == 'GET') {
|
140 |
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
|
141 |
options.data = null; // data is null for 'get'
|
@@ -165,17 +198,33 @@ $.fn.ajaxSubmit = function(options) {
|
|
165 |
}
|
166 |
|
167 |
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
|
168 |
-
var context = options.context || this ; // jQuery 1.4+ supports scope context
|
169 |
for (var i=0, max=callbacks.length; i < max; i++) {
|
170 |
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
|
171 |
}
|
172 |
};
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
// are there files to upload?
|
175 |
|
176 |
// [value] (issue #113), also see comment:
|
177 |
// https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
|
178 |
-
var fileInputs = $('input[type=file]:enabled
|
179 |
|
180 |
var hasFileInputs = fileInputs.length > 0;
|
181 |
var mp = 'multipart/form-data';
|
@@ -211,8 +260,9 @@ $.fn.ajaxSubmit = function(options) {
|
|
211 |
$form.removeData('jqxhr').data('jqxhr', jqxhr);
|
212 |
|
213 |
// clear element array
|
214 |
-
for (var k=0; k < elements.length; k++)
|
215 |
elements[k] = null;
|
|
|
216 |
|
217 |
// fire 'notify' event
|
218 |
this.trigger('form-submit-notify', [this, options]);
|
@@ -220,15 +270,16 @@ $.fn.ajaxSubmit = function(options) {
|
|
220 |
|
221 |
// utility fn for deep serialization
|
222 |
function deepSerialize(extraData){
|
223 |
-
var serialized = $.param(extraData).split('&');
|
224 |
var len = serialized.length;
|
225 |
-
var result =
|
226 |
var i, part;
|
227 |
for (i=0; i < len; i++) {
|
228 |
// #252; undo param space replacement
|
229 |
serialized[i] = serialized[i].replace(/\+/g,' ');
|
230 |
part = serialized[i].split('=');
|
231 |
-
|
|
|
232 |
}
|
233 |
return result;
|
234 |
}
|
@@ -243,9 +294,11 @@ $.fn.ajaxSubmit = function(options) {
|
|
243 |
|
244 |
if (options.extraData) {
|
245 |
var serializedData = deepSerialize(options.extraData);
|
246 |
-
for (
|
247 |
-
if (serializedData
|
248 |
-
formdata.append(
|
|
|
|
|
249 |
}
|
250 |
|
251 |
options.data = null;
|
@@ -256,13 +309,13 @@ $.fn.ajaxSubmit = function(options) {
|
|
256 |
cache: false,
|
257 |
type: method || 'POST'
|
258 |
});
|
259 |
-
|
260 |
if (options.uploadProgress) {
|
261 |
// workaround because jqXHR does not expose upload property
|
262 |
s.xhr = function() {
|
263 |
-
var xhr =
|
264 |
if (xhr.upload) {
|
265 |
-
xhr.upload.
|
266 |
var percent = 0;
|
267 |
var position = event.loaded || event.position; /*event.position is deprecated*/
|
268 |
var total = event.total;
|
@@ -270,18 +323,25 @@ $.fn.ajaxSubmit = function(options) {
|
|
270 |
percent = Math.ceil(position / total * 100);
|
271 |
}
|
272 |
options.uploadProgress(event, position, total, percent);
|
273 |
-
};
|
274 |
}
|
275 |
return xhr;
|
276 |
};
|
277 |
}
|
278 |
|
279 |
s.data = null;
|
280 |
-
|
281 |
-
|
|
|
|
|
|
|
|
|
|
|
282 |
o.data = formdata;
|
283 |
-
|
284 |
-
|
|
|
|
|
285 |
};
|
286 |
return $.ajax(s);
|
287 |
}
|
@@ -289,25 +349,23 @@ $.fn.ajaxSubmit = function(options) {
|
|
289 |
// private function for handling file uploads (hat tip to YAHOO!)
|
290 |
function fileUploadIframe(a) {
|
291 |
var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
|
292 |
-
var useProp = !!$.fn.prop;
|
293 |
var deferred = $.Deferred();
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
return deferred;
|
301 |
-
}
|
302 |
-
|
303 |
if (a) {
|
304 |
// ensure that every serialized input is still enabled
|
305 |
for (i=0; i < elements.length; i++) {
|
306 |
el = $(elements[i]);
|
307 |
-
if (
|
308 |
el.prop('disabled', false);
|
309 |
-
|
|
|
310 |
el.removeAttr('disabled');
|
|
|
311 |
}
|
312 |
}
|
313 |
|
@@ -316,11 +374,13 @@ $.fn.ajaxSubmit = function(options) {
|
|
316 |
id = 'jqFormIO' + (new Date().getTime());
|
317 |
if (s.iframeTarget) {
|
318 |
$io = $(s.iframeTarget);
|
319 |
-
n = $io.
|
320 |
-
if (!n)
|
321 |
-
|
322 |
-
|
|
|
323 |
id = n;
|
|
|
324 |
}
|
325 |
else {
|
326 |
$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
|
@@ -347,17 +407,20 @@ $.fn.ajaxSubmit = function(options) {
|
|
347 |
if (io.contentWindow.document.execCommand) {
|
348 |
io.contentWindow.document.execCommand('Stop');
|
349 |
}
|
350 |
-
}
|
351 |
catch(ignore) {}
|
352 |
|
353 |
$io.attr('src', s.iframeSrc); // abort op in progress
|
354 |
xhr.error = e;
|
355 |
-
if (s.error)
|
356 |
s.error.call(s.context, xhr, e, status);
|
357 |
-
|
|
|
358 |
$.event.trigger("ajaxError", [xhr, s, e]);
|
359 |
-
|
|
|
360 |
s.complete.call(s.context, xhr, e);
|
|
|
361 |
}
|
362 |
};
|
363 |
|
@@ -395,15 +458,44 @@ $.fn.ajaxSubmit = function(options) {
|
|
395 |
}
|
396 |
}
|
397 |
}
|
398 |
-
|
399 |
var CLIENT_TIMEOUT_ABORT = 1;
|
400 |
var SERVER_ABORT = 2;
|
401 |
-
|
402 |
function getDoc(frame) {
|
403 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
return doc;
|
405 |
}
|
406 |
-
|
407 |
// Rails CSRF hack (thanks to Yvan Barthelemy)
|
408 |
var csrf_token = $('meta[name=csrf-token]').attr('content');
|
409 |
var csrf_param = $('meta[name=csrf-param]').attr('content');
|
@@ -415,11 +507,14 @@ $.fn.ajaxSubmit = function(options) {
|
|
415 |
// take a breath so that pending repaints get some cpu time before the upload starts
|
416 |
function doSubmit() {
|
417 |
// make sure form attrs are set
|
418 |
-
var t = $form.
|
|
|
|
|
|
|
419 |
|
420 |
// update form attrs in IE friendly way
|
421 |
form.setAttribute('target',id);
|
422 |
-
if (!method) {
|
423 |
form.setAttribute('method', 'POST');
|
424 |
}
|
425 |
if (a != s.url) {
|
@@ -438,20 +533,22 @@ $.fn.ajaxSubmit = function(options) {
|
|
438 |
if (s.timeout) {
|
439 |
timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
|
440 |
}
|
441 |
-
|
442 |
// look for server aborts
|
443 |
function checkState() {
|
444 |
try {
|
445 |
var state = getDoc(io).readyState;
|
446 |
log('state = ' + state);
|
447 |
-
if (state && state.toLowerCase() == 'uninitialized')
|
448 |
setTimeout(checkState,50);
|
|
|
449 |
}
|
450 |
catch(e) {
|
451 |
log('Server abort: ' , e, ' (', e.name, ')');
|
452 |
cb(SERVER_ABORT);
|
453 |
-
if (timeoutHandle)
|
454 |
clearTimeout(timeoutHandle);
|
|
|
455 |
timeoutHandle = undefined;
|
456 |
}
|
457 |
}
|
@@ -479,17 +576,27 @@ $.fn.ajaxSubmit = function(options) {
|
|
479 |
if (!s.iframeTarget) {
|
480 |
// add iframe to doc and submit the form
|
481 |
$io.appendTo('body');
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
|
|
|
|
486 |
}
|
487 |
setTimeout(checkState,15);
|
488 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
}
|
490 |
finally {
|
491 |
// reset attrs and remove "extra" input elements
|
492 |
form.setAttribute('action',a);
|
|
|
493 |
if(t) {
|
494 |
form.setAttribute('target', t);
|
495 |
} else {
|
@@ -512,11 +619,10 @@ $.fn.ajaxSubmit = function(options) {
|
|
512 |
if (xhr.aborted || callbackProcessed) {
|
513 |
return;
|
514 |
}
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
log('cannot access response document: ', ex);
|
520 |
e = SERVER_ABORT;
|
521 |
}
|
522 |
if (e === CLIENT_TIMEOUT_ABORT && xhr) {
|
@@ -532,13 +638,16 @@ $.fn.ajaxSubmit = function(options) {
|
|
532 |
|
533 |
if (!doc || doc.location.href == s.iframeSrc) {
|
534 |
// response not received yet
|
535 |
-
if (!timedOut)
|
536 |
return;
|
|
|
537 |
}
|
538 |
-
if (io.detachEvent)
|
539 |
io.detachEvent('onload', cb);
|
540 |
-
|
|
|
541 |
io.removeEventListener('load', cb, false);
|
|
|
542 |
|
543 |
var status = 'success', errMsg;
|
544 |
try {
|
@@ -565,11 +674,12 @@ $.fn.ajaxSubmit = function(options) {
|
|
565 |
var docRoot = doc.body ? doc.body : doc.documentElement;
|
566 |
xhr.responseText = docRoot ? docRoot.innerHTML : null;
|
567 |
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
|
568 |
-
if (isXml)
|
569 |
s.dataType = 'xml';
|
|
|
570 |
xhr.getResponseHeader = function(header){
|
571 |
var headers = {'content-type': s.dataType};
|
572 |
-
return headers[header];
|
573 |
};
|
574 |
// support for XHR 'status' & 'statusText' emulation :
|
575 |
if (docRoot) {
|
@@ -607,15 +717,15 @@ $.fn.ajaxSubmit = function(options) {
|
|
607 |
try {
|
608 |
data = httpData(xhr, dt, s);
|
609 |
}
|
610 |
-
catch (
|
611 |
status = 'parsererror';
|
612 |
-
xhr.error = errMsg = (
|
613 |
}
|
614 |
}
|
615 |
-
catch (
|
616 |
-
log('error caught: ',
|
617 |
status = 'error';
|
618 |
-
xhr.error = errMsg = (
|
619 |
}
|
620 |
|
621 |
if (xhr.aborted) {
|
@@ -629,40 +739,52 @@ $.fn.ajaxSubmit = function(options) {
|
|
629 |
|
630 |
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
|
631 |
if (status === 'success') {
|
632 |
-
if (s.success)
|
633 |
s.success.call(s.context, data, 'success', xhr);
|
|
|
634 |
deferred.resolve(xhr.responseText, 'success', xhr);
|
635 |
-
if (g)
|
636 |
$.event.trigger("ajaxSuccess", [xhr, s]);
|
|
|
637 |
}
|
638 |
else if (status) {
|
639 |
-
if (errMsg === undefined)
|
640 |
errMsg = xhr.statusText;
|
641 |
-
|
|
|
642 |
s.error.call(s.context, xhr, status, errMsg);
|
|
|
643 |
deferred.reject(xhr, 'error', errMsg);
|
644 |
-
if (g)
|
645 |
$.event.trigger("ajaxError", [xhr, s, errMsg]);
|
|
|
646 |
}
|
647 |
|
648 |
-
if (g)
|
649 |
$.event.trigger("ajaxComplete", [xhr, s]);
|
|
|
650 |
|
651 |
if (g && ! --$.active) {
|
652 |
$.event.trigger("ajaxStop");
|
653 |
}
|
654 |
|
655 |
-
if (s.complete)
|
656 |
s.complete.call(s.context, xhr, status);
|
|
|
657 |
|
658 |
callbackProcessed = true;
|
659 |
-
if (s.timeout)
|
660 |
clearTimeout(timeoutHandle);
|
|
|
661 |
|
662 |
// clean up
|
663 |
setTimeout(function() {
|
664 |
-
if (!s.iframeTarget)
|
665 |
$io.remove();
|
|
|
|
|
|
|
|
|
666 |
xhr.responseXML = null;
|
667 |
}, 100);
|
668 |
}
|
@@ -690,8 +812,9 @@ $.fn.ajaxSubmit = function(options) {
|
|
690 |
data = xml ? xhr.responseXML : xhr.responseText;
|
691 |
|
692 |
if (xml && data.documentElement.nodeName === 'parsererror') {
|
693 |
-
if ($.error)
|
694 |
$.error('parsererror');
|
|
|
695 |
}
|
696 |
if (s && s.dataFilter) {
|
697 |
data = s.dataFilter(data, type);
|
@@ -728,7 +851,7 @@ $.fn.ajaxSubmit = function(options) {
|
|
728 |
$.fn.ajaxForm = function(options) {
|
729 |
options = options || {};
|
730 |
options.delegation = options.delegation && $.isFunction($.fn.on);
|
731 |
-
|
732 |
// in jQuery 1.3+ we can fix mistakes with the ready state
|
733 |
if (!options.delegation && this.length === 0) {
|
734 |
var o = { s: this.selector, c: this.context };
|
@@ -758,16 +881,16 @@ $.fn.ajaxForm = function(options) {
|
|
758 |
.bind('click.form-plugin', options, captureSubmittingElement);
|
759 |
};
|
760 |
|
761 |
-
// private event handlers
|
762 |
function doAjaxSubmit(e) {
|
763 |
/*jshint validthis:true */
|
764 |
var options = e.data;
|
765 |
if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
|
766 |
e.preventDefault();
|
767 |
-
$(
|
768 |
}
|
769 |
}
|
770 |
-
|
771 |
function captureSubmittingElement(e) {
|
772 |
/*jshint validthis:true */
|
773 |
var target = e.target;
|
@@ -823,8 +946,23 @@ $.fn.formToArray = function(semantic, elements) {
|
|
823 |
}
|
824 |
|
825 |
var form = this[0];
|
|
|
826 |
var els = semantic ? form.getElementsByTagName('*') : form.elements;
|
827 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
828 |
return a;
|
829 |
}
|
830 |
|
@@ -832,13 +970,13 @@ $.fn.formToArray = function(semantic, elements) {
|
|
832 |
for(i=0, max=els.length; i < max; i++) {
|
833 |
el = els[i];
|
834 |
n = el.name;
|
835 |
-
if (!n) {
|
836 |
continue;
|
837 |
}
|
838 |
|
839 |
if (semantic && form.clk && el.type == "image") {
|
840 |
// handle image inputs on the fly when semantic == true
|
841 |
-
if(
|
842 |
a.push({name: n, value: $(el).val(), type: el.type });
|
843 |
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
844 |
}
|
@@ -847,15 +985,17 @@ $.fn.formToArray = function(semantic, elements) {
|
|
847 |
|
848 |
v = $.fieldValue(el, true);
|
849 |
if (v && v.constructor == Array) {
|
850 |
-
if (elements)
|
851 |
elements.push(el);
|
|
|
852 |
for(j=0, jmax=v.length; j < jmax; j++) {
|
853 |
a.push({name: n, value: v[j]});
|
854 |
}
|
855 |
}
|
856 |
-
else if (feature.fileapi && el.type == 'file'
|
857 |
-
if (elements)
|
858 |
elements.push(el);
|
|
|
859 |
var files = el.files;
|
860 |
if (files.length) {
|
861 |
for (j=0; j < files.length; j++) {
|
@@ -868,8 +1008,9 @@ $.fn.formToArray = function(semantic, elements) {
|
|
868 |
}
|
869 |
}
|
870 |
else if (v !== null && typeof v != 'undefined') {
|
871 |
-
if (elements)
|
872 |
elements.push(el);
|
|
|
873 |
a.push({name: n, value: v, type: el.type, required: el.required});
|
874 |
}
|
875 |
}
|
@@ -965,10 +1106,12 @@ $.fn.fieldValue = function(successful) {
|
|
965 |
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
|
966 |
continue;
|
967 |
}
|
968 |
-
if (v.constructor == Array)
|
969 |
$.merge(val, v);
|
970 |
-
|
|
|
971 |
val.push(v);
|
|
|
972 |
}
|
973 |
return val;
|
974 |
};
|
@@ -1002,7 +1145,7 @@ $.fieldValue = function(el, successful) {
|
|
1002 |
if (op.selected) {
|
1003 |
var v = op.value;
|
1004 |
if (!v) { // extra pain for IE...
|
1005 |
-
v = (op.attributes && op.attributes
|
1006 |
}
|
1007 |
if (one) {
|
1008 |
return v;
|
@@ -1045,21 +1188,22 @@ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
|
|
1045 |
else if (tag == 'select') {
|
1046 |
this.selectedIndex = -1;
|
1047 |
}
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
else if (includeHidden) {
|
1056 |
// includeHidden can be the value true, or it can be a selector string
|
1057 |
// indicating a special test; for example:
|
1058 |
// $('#myForm').clearForm('.special:hidden')
|
1059 |
// the above would clean hidden inputs that have the class of 'special'
|
1060 |
if ( (includeHidden === true && /hidden/.test(t)) ||
|
1061 |
-
(typeof includeHidden == 'string' && $(this).is(includeHidden)) )
|
1062 |
this.value = '';
|
|
|
1063 |
}
|
1064 |
});
|
1065 |
};
|
@@ -1118,8 +1262,9 @@ $.fn.ajaxSubmit.debug = false;
|
|
1118 |
|
1119 |
// helper fn for console logging
|
1120 |
function log() {
|
1121 |
-
if (!$.fn.ajaxSubmit.debug)
|
1122 |
return;
|
|
|
1123 |
var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
|
1124 |
if (window.console && window.console.log) {
|
1125 |
window.console.log(msg);
|
@@ -1129,4 +1274,4 @@ function log() {
|
|
1129 |
}
|
1130 |
}
|
1131 |
|
1132 |
-
})
|
1 |
/*!
|
2 |
* jQuery Form Plugin
|
3 |
+
* version: 3.51.0-2014.06.20
|
4 |
+
* Requires jQuery v1.5 or later
|
5 |
+
* Copyright (c) 2014 M. Alsup
|
6 |
* Examples and documentation at: http://malsup.com/jquery/form/
|
7 |
* Project repository: https://github.com/malsup/form
|
8 |
+
* Dual licensed under the MIT and GPL licenses.
|
9 |
+
* https://github.com/malsup/form#copyright-and-license
|
|
|
10 |
*/
|
11 |
+
/*global ActiveXObject */
|
12 |
+
|
13 |
+
// AMD support
|
14 |
+
(function (factory) {
|
15 |
+
"use strict";
|
16 |
+
if (typeof define === 'function' && define.amd) {
|
17 |
+
// using AMD; register as anon module
|
18 |
+
define(['jquery'], factory);
|
19 |
+
} else {
|
20 |
+
// no AMD; invoke directly
|
21 |
+
factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
(function($) {
|
26 |
"use strict";
|
27 |
|
28 |
/*
|
49 |
target: '#output'
|
50 |
});
|
51 |
});
|
52 |
+
|
53 |
You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
|
54 |
form does not have to exist when you invoke ajaxForm:
|
55 |
|
57 |
delegation: true,
|
58 |
target: '#output'
|
59 |
});
|
60 |
+
|
61 |
When using ajaxForm, the ajaxSubmit function will be invoked for you
|
62 |
at the appropriate time.
|
63 |
*/
|
69 |
feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
|
70 |
feature.formdata = window.FormData !== undefined;
|
71 |
|
72 |
+
var hasProp = !!$.fn.prop;
|
73 |
+
|
74 |
+
// attr2 uses prop when it can but checks the return type for
|
75 |
+
// an expected string. this accounts for the case where a form
|
76 |
+
// contains inputs with names like "action" or "method"; in those
|
77 |
+
// cases "prop" returns the element
|
78 |
+
$.fn.attr2 = function() {
|
79 |
+
if ( ! hasProp ) {
|
80 |
+
return this.attr.apply(this, arguments);
|
81 |
+
}
|
82 |
+
var val = this.prop.apply(this, arguments);
|
83 |
+
if ( ( val && val.jquery ) || typeof val === 'string' ) {
|
84 |
+
return val;
|
85 |
+
}
|
86 |
+
return this.attr.apply(this, arguments);
|
87 |
+
};
|
88 |
+
|
89 |
/**
|
90 |
* ajaxSubmit() provides a mechanism for immediately submitting
|
91 |
* an HTML form using AJAX.
|
98 |
log('ajaxSubmit: skipping submit process - no element selected');
|
99 |
return this;
|
100 |
}
|
101 |
+
|
102 |
var method, action, url, $form = this;
|
103 |
|
104 |
if (typeof options == 'function') {
|
105 |
options = { success: options };
|
106 |
}
|
107 |
+
else if ( options === undefined ) {
|
108 |
+
options = {};
|
109 |
+
}
|
110 |
+
|
111 |
+
method = options.type || this.attr2('method');
|
112 |
+
action = options.url || this.attr2('action');
|
113 |
|
|
|
|
|
114 |
url = (typeof action === 'string') ? $.trim(action) : '';
|
115 |
url = url || window.location.href || '';
|
116 |
if (url) {
|
121 |
options = $.extend(true, {
|
122 |
url: url,
|
123 |
success: $.ajaxSettings.success,
|
124 |
+
type: method || $.ajaxSettings.type,
|
125 |
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
|
126 |
}, options);
|
127 |
|
144 |
if ( traditional === undefined ) {
|
145 |
traditional = $.ajaxSettings.traditional;
|
146 |
}
|
147 |
+
|
148 |
var elements = [];
|
149 |
var qx, a = this.formToArray(options.semantic, elements);
|
150 |
if (options.data) {
|
168 |
var q = $.param(a, traditional);
|
169 |
if (qx) {
|
170 |
q = ( q ? (q + '&' + qx) : qx );
|
171 |
+
}
|
172 |
if (options.type.toUpperCase() == 'GET') {
|
173 |
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
|
174 |
options.data = null; // data is null for 'get'
|
198 |
}
|
199 |
|
200 |
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
|
201 |
+
var context = options.context || this ; // jQuery 1.4+ supports scope context
|
202 |
for (var i=0, max=callbacks.length; i < max; i++) {
|
203 |
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
|
204 |
}
|
205 |
};
|
206 |
|
207 |
+
if (options.error) {
|
208 |
+
var oldError = options.error;
|
209 |
+
options.error = function(xhr, status, error) {
|
210 |
+
var context = options.context || this;
|
211 |
+
oldError.apply(context, [xhr, status, error, $form]);
|
212 |
+
};
|
213 |
+
}
|
214 |
+
|
215 |
+
if (options.complete) {
|
216 |
+
var oldComplete = options.complete;
|
217 |
+
options.complete = function(xhr, status) {
|
218 |
+
var context = options.context || this;
|
219 |
+
oldComplete.apply(context, [xhr, status, $form]);
|
220 |
+
};
|
221 |
+
}
|
222 |
+
|
223 |
// are there files to upload?
|
224 |
|
225 |
// [value] (issue #113), also see comment:
|
226 |
// https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
|
227 |
+
var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; });
|
228 |
|
229 |
var hasFileInputs = fileInputs.length > 0;
|
230 |
var mp = 'multipart/form-data';
|
260 |
$form.removeData('jqxhr').data('jqxhr', jqxhr);
|
261 |
|
262 |
// clear element array
|
263 |
+
for (var k=0; k < elements.length; k++) {
|
264 |
elements[k] = null;
|
265 |
+
}
|
266 |
|
267 |
// fire 'notify' event
|
268 |
this.trigger('form-submit-notify', [this, options]);
|
270 |
|
271 |
// utility fn for deep serialization
|
272 |
function deepSerialize(extraData){
|
273 |
+
var serialized = $.param(extraData, options.traditional).split('&');
|
274 |
var len = serialized.length;
|
275 |
+
var result = [];
|
276 |
var i, part;
|
277 |
for (i=0; i < len; i++) {
|
278 |
// #252; undo param space replacement
|
279 |
serialized[i] = serialized[i].replace(/\+/g,' ');
|
280 |
part = serialized[i].split('=');
|
281 |
+
// #278; use array instead of object storage, favoring array serializations
|
282 |
+
result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
|
283 |
}
|
284 |
return result;
|
285 |
}
|
294 |
|
295 |
if (options.extraData) {
|
296 |
var serializedData = deepSerialize(options.extraData);
|
297 |
+
for (i=0; i < serializedData.length; i++) {
|
298 |
+
if (serializedData[i]) {
|
299 |
+
formdata.append(serializedData[i][0], serializedData[i][1]);
|
300 |
+
}
|
301 |
+
}
|
302 |
}
|
303 |
|
304 |
options.data = null;
|
309 |
cache: false,
|
310 |
type: method || 'POST'
|
311 |
});
|
312 |
+
|
313 |
if (options.uploadProgress) {
|
314 |
// workaround because jqXHR does not expose upload property
|
315 |
s.xhr = function() {
|
316 |
+
var xhr = $.ajaxSettings.xhr();
|
317 |
if (xhr.upload) {
|
318 |
+
xhr.upload.addEventListener('progress', function(event) {
|
319 |
var percent = 0;
|
320 |
var position = event.loaded || event.position; /*event.position is deprecated*/
|
321 |
var total = event.total;
|
323 |
percent = Math.ceil(position / total * 100);
|
324 |
}
|
325 |
options.uploadProgress(event, position, total, percent);
|
326 |
+
}, false);
|
327 |
}
|
328 |
return xhr;
|
329 |
};
|
330 |
}
|
331 |
|
332 |
s.data = null;
|
333 |
+
var beforeSend = s.beforeSend;
|
334 |
+
s.beforeSend = function(xhr, o) {
|
335 |
+
//Send FormData() provided by user
|
336 |
+
if (options.formData) {
|
337 |
+
o.data = options.formData;
|
338 |
+
}
|
339 |
+
else {
|
340 |
o.data = formdata;
|
341 |
+
}
|
342 |
+
if(beforeSend) {
|
343 |
+
beforeSend.call(this, xhr, o);
|
344 |
+
}
|
345 |
};
|
346 |
return $.ajax(s);
|
347 |
}
|
349 |
// private function for handling file uploads (hat tip to YAHOO!)
|
350 |
function fileUploadIframe(a) {
|
351 |
var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
|
|
|
352 |
var deferred = $.Deferred();
|
353 |
|
354 |
+
// #341
|
355 |
+
deferred.abort = function(status) {
|
356 |
+
xhr.abort(status);
|
357 |
+
};
|
358 |
+
|
|
|
|
|
|
|
359 |
if (a) {
|
360 |
// ensure that every serialized input is still enabled
|
361 |
for (i=0; i < elements.length; i++) {
|
362 |
el = $(elements[i]);
|
363 |
+
if ( hasProp ) {
|
364 |
el.prop('disabled', false);
|
365 |
+
}
|
366 |
+
else {
|
367 |
el.removeAttr('disabled');
|
368 |
+
}
|
369 |
}
|
370 |
}
|
371 |
|
374 |
id = 'jqFormIO' + (new Date().getTime());
|
375 |
if (s.iframeTarget) {
|
376 |
$io = $(s.iframeTarget);
|
377 |
+
n = $io.attr2('name');
|
378 |
+
if (!n) {
|
379 |
+
$io.attr2('name', id);
|
380 |
+
}
|
381 |
+
else {
|
382 |
id = n;
|
383 |
+
}
|
384 |
}
|
385 |
else {
|
386 |
$io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
|
407 |
if (io.contentWindow.document.execCommand) {
|
408 |
io.contentWindow.document.execCommand('Stop');
|
409 |
}
|
410 |
+
}
|
411 |
catch(ignore) {}
|
412 |
|
413 |
$io.attr('src', s.iframeSrc); // abort op in progress
|
414 |
xhr.error = e;
|
415 |
+
if (s.error) {
|
416 |
s.error.call(s.context, xhr, e, status);
|
417 |
+
}
|
418 |
+
if (g) {
|
419 |
$.event.trigger("ajaxError", [xhr, s, e]);
|
420 |
+
}
|
421 |
+
if (s.complete) {
|
422 |
s.complete.call(s.context, xhr, e);
|
423 |
+
}
|
424 |
}
|
425 |
};
|
426 |
|
458 |
}
|
459 |
}
|
460 |
}
|
461 |
+
|
462 |
var CLIENT_TIMEOUT_ABORT = 1;
|
463 |
var SERVER_ABORT = 2;
|
464 |
+
|
465 |
function getDoc(frame) {
|
466 |
+
/* it looks like contentWindow or contentDocument do not
|
467 |
+
* carry the protocol property in ie8, when running under ssl
|
468 |
+
* frame.document is the only valid response document, since
|
469 |
+
* the protocol is know but not on the other two objects. strange?
|
470 |
+
* "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
|
471 |
+
*/
|
472 |
+
|
473 |
+
var doc = null;
|
474 |
+
|
475 |
+
// IE8 cascading access check
|
476 |
+
try {
|
477 |
+
if (frame.contentWindow) {
|
478 |
+
doc = frame.contentWindow.document;
|
479 |
+
}
|
480 |
+
} catch(err) {
|
481 |
+
// IE8 access denied under ssl & missing protocol
|
482 |
+
log('cannot get iframe.contentWindow document: ' + err);
|
483 |
+
}
|
484 |
+
|
485 |
+
if (doc) { // successful getting content
|
486 |
+
return doc;
|
487 |
+
}
|
488 |
+
|
489 |
+
try { // simply checking may throw in ie8 under ssl or mismatched protocol
|
490 |
+
doc = frame.contentDocument ? frame.contentDocument : frame.document;
|
491 |
+
} catch(err) {
|
492 |
+
// last attempt
|
493 |
+
log('cannot get iframe.contentDocument: ' + err);
|
494 |
+
doc = frame.document;
|
495 |
+
}
|
496 |
return doc;
|
497 |
}
|
498 |
+
|
499 |
// Rails CSRF hack (thanks to Yvan Barthelemy)
|
500 |
var csrf_token = $('meta[name=csrf-token]').attr('content');
|
501 |
var csrf_param = $('meta[name=csrf-param]').attr('content');
|
507 |
// take a breath so that pending repaints get some cpu time before the upload starts
|
508 |
function doSubmit() {
|
509 |
// make sure form attrs are set
|
510 |
+
var t = $form.attr2('target'),
|
511 |
+
a = $form.attr2('action'),
|
512 |
+
mp = 'multipart/form-data',
|
513 |
+
et = $form.attr('enctype') || $form.attr('encoding') || mp;
|
514 |
|
515 |
// update form attrs in IE friendly way
|
516 |
form.setAttribute('target',id);
|
517 |
+
if (!method || /post/i.test(method) ) {
|
518 |
form.setAttribute('method', 'POST');
|
519 |
}
|
520 |
if (a != s.url) {
|
533 |
if (s.timeout) {
|
534 |
timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
|
535 |
}
|
536 |
+
|
537 |
// look for server aborts
|
538 |
function checkState() {
|
539 |
try {
|
540 |
var state = getDoc(io).readyState;
|
541 |
log('state = ' + state);
|
542 |
+
if (state && state.toLowerCase() == 'uninitialized') {
|
543 |
setTimeout(checkState,50);
|
544 |
+
}
|
545 |
}
|
546 |
catch(e) {
|
547 |
log('Server abort: ' , e, ' (', e.name, ')');
|
548 |
cb(SERVER_ABORT);
|
549 |
+
if (timeoutHandle) {
|
550 |
clearTimeout(timeoutHandle);
|
551 |
+
}
|
552 |
timeoutHandle = undefined;
|
553 |
}
|
554 |
}
|
576 |
if (!s.iframeTarget) {
|
577 |
// add iframe to doc and submit the form
|
578 |
$io.appendTo('body');
|
579 |
+
}
|
580 |
+
if (io.attachEvent) {
|
581 |
+
io.attachEvent('onload', cb);
|
582 |
+
}
|
583 |
+
else {
|
584 |
+
io.addEventListener('load', cb, false);
|
585 |
}
|
586 |
setTimeout(checkState,15);
|
587 |
+
|
588 |
+
try {
|
589 |
+
form.submit();
|
590 |
+
} catch(err) {
|
591 |
+
// just in case form has element with name/id of 'submit'
|
592 |
+
var submitFn = document.createElement('form').submit;
|
593 |
+
submitFn.apply(form);
|
594 |
+
}
|
595 |
}
|
596 |
finally {
|
597 |
// reset attrs and remove "extra" input elements
|
598 |
form.setAttribute('action',a);
|
599 |
+
form.setAttribute('enctype', et); // #380
|
600 |
if(t) {
|
601 |
form.setAttribute('target', t);
|
602 |
} else {
|
619 |
if (xhr.aborted || callbackProcessed) {
|
620 |
return;
|
621 |
}
|
622 |
+
|
623 |
+
doc = getDoc(io);
|
624 |
+
if(!doc) {
|
625 |
+
log('cannot access response document');
|
|
|
626 |
e = SERVER_ABORT;
|
627 |
}
|
628 |
if (e === CLIENT_TIMEOUT_ABORT && xhr) {
|
638 |
|
639 |
if (!doc || doc.location.href == s.iframeSrc) {
|
640 |
// response not received yet
|
641 |
+
if (!timedOut) {
|
642 |
return;
|
643 |
+
}
|
644 |
}
|
645 |
+
if (io.detachEvent) {
|
646 |
io.detachEvent('onload', cb);
|
647 |
+
}
|
648 |
+
else {
|
649 |
io.removeEventListener('load', cb, false);
|
650 |
+
}
|
651 |
|
652 |
var status = 'success', errMsg;
|
653 |
try {
|
674 |
var docRoot = doc.body ? doc.body : doc.documentElement;
|
675 |
xhr.responseText = docRoot ? docRoot.innerHTML : null;
|
676 |
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
|
677 |
+
if (isXml) {
|
678 |
s.dataType = 'xml';
|
679 |
+
}
|
680 |
xhr.getResponseHeader = function(header){
|
681 |
var headers = {'content-type': s.dataType};
|
682 |
+
return headers[header.toLowerCase()];
|
683 |
};
|
684 |
// support for XHR 'status' & 'statusText' emulation :
|
685 |
if (docRoot) {
|
717 |
try {
|
718 |
data = httpData(xhr, dt, s);
|
719 |
}
|
720 |
+
catch (err) {
|
721 |
status = 'parsererror';
|
722 |
+
xhr.error = errMsg = (err || status);
|
723 |
}
|
724 |
}
|
725 |
+
catch (err) {
|
726 |
+
log('error caught: ',err);
|
727 |
status = 'error';
|
728 |
+
xhr.error = errMsg = (err || status);
|
729 |
}
|
730 |
|
731 |
if (xhr.aborted) {
|
739 |
|
740 |
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
|
741 |
if (status === 'success') {
|
742 |
+
if (s.success) {
|
743 |
s.success.call(s.context, data, 'success', xhr);
|
744 |
+
}
|
745 |
deferred.resolve(xhr.responseText, 'success', xhr);
|
746 |
+
if (g) {
|
747 |
$.event.trigger("ajaxSuccess", [xhr, s]);
|
748 |
+
}
|
749 |
}
|
750 |
else if (status) {
|
751 |
+
if (errMsg === undefined) {
|
752 |
errMsg = xhr.statusText;
|
753 |
+
}
|
754 |
+
if (s.error) {
|
755 |
s.error.call(s.context, xhr, status, errMsg);
|
756 |
+
}
|
757 |
deferred.reject(xhr, 'error', errMsg);
|
758 |
+
if (g) {
|
759 |
$.event.trigger("ajaxError", [xhr, s, errMsg]);
|
760 |
+
}
|
761 |
}
|
762 |
|
763 |
+
if (g) {
|
764 |
$.event.trigger("ajaxComplete", [xhr, s]);
|
765 |
+
}
|
766 |
|
767 |
if (g && ! --$.active) {
|
768 |
$.event.trigger("ajaxStop");
|
769 |
}
|
770 |
|
771 |
+
if (s.complete) {
|
772 |
s.complete.call(s.context, xhr, status);
|
773 |
+
}
|
774 |
|
775 |
callbackProcessed = true;
|
776 |
+
if (s.timeout) {
|
777 |
clearTimeout(timeoutHandle);
|
778 |
+
}
|
779 |
|
780 |
// clean up
|
781 |
setTimeout(function() {
|
782 |
+
if (!s.iframeTarget) {
|
783 |
$io.remove();
|
784 |
+
}
|
785 |
+
else { //adding else to clean up existing iframe response.
|
786 |
+
$io.attr('src', s.iframeSrc);
|
787 |
+
}
|
788 |
xhr.responseXML = null;
|
789 |
}, 100);
|
790 |
}
|
812 |
data = xml ? xhr.responseXML : xhr.responseText;
|
813 |
|
814 |
if (xml && data.documentElement.nodeName === 'parsererror') {
|
815 |
+
if ($.error) {
|
816 |
$.error('parsererror');
|
817 |
+
}
|
818 |
}
|
819 |
if (s && s.dataFilter) {
|
820 |
data = s.dataFilter(data, type);
|
851 |
$.fn.ajaxForm = function(options) {
|
852 |
options = options || {};
|
853 |
options.delegation = options.delegation && $.isFunction($.fn.on);
|
854 |
+
|
855 |
// in jQuery 1.3+ we can fix mistakes with the ready state
|
856 |
if (!options.delegation && this.length === 0) {
|
857 |
var o = { s: this.selector, c: this.context };
|
881 |
.bind('click.form-plugin', options, captureSubmittingElement);
|
882 |
};
|
883 |
|
884 |
+
// private event handlers
|
885 |
function doAjaxSubmit(e) {
|
886 |
/*jshint validthis:true */
|
887 |
var options = e.data;
|
888 |
if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
|
889 |
e.preventDefault();
|
890 |
+
$(e.target).ajaxSubmit(options); // #365
|
891 |
}
|
892 |
}
|
893 |
+
|
894 |
function captureSubmittingElement(e) {
|
895 |
/*jshint validthis:true */
|
896 |
var target = e.target;
|
946 |
}
|
947 |
|
948 |
var form = this[0];
|
949 |
+
var formId = this.attr('id');
|
950 |
var els = semantic ? form.getElementsByTagName('*') : form.elements;
|
951 |
+
var els2;
|
952 |
+
|
953 |
+
if (els && !/MSIE [678]/.test(navigator.userAgent)) { // #390
|
954 |
+
els = $(els).get(); // convert to standard array
|
955 |
+
}
|
956 |
+
|
957 |
+
// #386; account for inputs outside the form which use the 'form' attribute
|
958 |
+
if ( formId ) {
|
959 |
+
els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet
|
960 |
+
if ( els2.length ) {
|
961 |
+
els = (els || []).concat(els2);
|
962 |
+
}
|
963 |
+
}
|
964 |
+
|
965 |
+
if (!els || !els.length) {
|
966 |
return a;
|
967 |
}
|
968 |
|
970 |
for(i=0, max=els.length; i < max; i++) {
|
971 |
el = els[i];
|
972 |
n = el.name;
|
973 |
+
if (!n || el.disabled) {
|
974 |
continue;
|
975 |
}
|
976 |
|
977 |
if (semantic && form.clk && el.type == "image") {
|
978 |
// handle image inputs on the fly when semantic == true
|
979 |
+
if(form.clk == el) {
|
980 |
a.push({name: n, value: $(el).val(), type: el.type });
|
981 |
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
982 |
}
|
985 |
|
986 |
v = $.fieldValue(el, true);
|
987 |
if (v && v.constructor == Array) {
|
988 |
+
if (elements) {
|
989 |
elements.push(el);
|
990 |
+
}
|
991 |
for(j=0, jmax=v.length; j < jmax; j++) {
|
992 |
a.push({name: n, value: v[j]});
|
993 |
}
|
994 |
}
|
995 |
+
else if (feature.fileapi && el.type == 'file') {
|
996 |
+
if (elements) {
|
997 |
elements.push(el);
|
998 |
+
}
|
999 |
var files = el.files;
|
1000 |
if (files.length) {
|
1001 |
for (j=0; j < files.length; j++) {
|
1008 |
}
|
1009 |
}
|
1010 |
else if (v !== null && typeof v != 'undefined') {
|
1011 |
+
if (elements) {
|
1012 |
elements.push(el);
|
1013 |
+
}
|
1014 |
a.push({name: n, value: v, type: el.type, required: el.required});
|
1015 |
}
|
1016 |
}
|
1106 |
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
|
1107 |
continue;
|
1108 |
}
|
1109 |
+
if (v.constructor == Array) {
|
1110 |
$.merge(val, v);
|
1111 |
+
}
|
1112 |
+
else {
|
1113 |
val.push(v);
|
1114 |
+
}
|
1115 |
}
|
1116 |
return val;
|
1117 |
};
|
1145 |
if (op.selected) {
|
1146 |
var v = op.value;
|
1147 |
if (!v) { // extra pain for IE...
|
1148 |
+
v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value;
|
1149 |
}
|
1150 |
if (one) {
|
1151 |
return v;
|
1188 |
else if (tag == 'select') {
|
1189 |
this.selectedIndex = -1;
|
1190 |
}
|
1191 |
+
else if (t == "file") {
|
1192 |
+
if (/MSIE/.test(navigator.userAgent)) {
|
1193 |
+
$(this).replaceWith($(this).clone(true));
|
1194 |
+
} else {
|
1195 |
+
$(this).val('');
|
1196 |
+
}
|
1197 |
+
}
|
1198 |
else if (includeHidden) {
|
1199 |
// includeHidden can be the value true, or it can be a selector string
|
1200 |
// indicating a special test; for example:
|
1201 |
// $('#myForm').clearForm('.special:hidden')
|
1202 |
// the above would clean hidden inputs that have the class of 'special'
|
1203 |
if ( (includeHidden === true && /hidden/.test(t)) ||
|
1204 |
+
(typeof includeHidden == 'string' && $(this).is(includeHidden)) ) {
|
1205 |
this.value = '';
|
1206 |
+
}
|
1207 |
}
|
1208 |
});
|
1209 |
};
|
1262 |
|
1263 |
// helper fn for console logging
|
1264 |
function log() {
|
1265 |
+
if (!$.fn.ajaxSubmit.debug) {
|
1266 |
return;
|
1267 |
+
}
|
1268 |
var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
|
1269 |
if (window.console && window.console.log) {
|
1270 |
window.console.log(msg);
|
1274 |
}
|
1275 |
}
|
1276 |
|
1277 |
+
}));
|
js/jqueryui.d.ts
ADDED
@@ -0,0 +1,1843 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Type definitions for jQueryUI 1.9
|
2 |
+
// Project: http://jqueryui.com/
|
3 |
+
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, John Reilly <https://github.com/johnnyreilly>
|
4 |
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
5 |
+
|
6 |
+
|
7 |
+
/// <reference path="jquery.d.ts"/>
|
8 |
+
|
9 |
+
declare namespace JQueryUI {
|
10 |
+
// Accordion //////////////////////////////////////////////////
|
11 |
+
|
12 |
+
interface AccordionOptions extends AccordionEvents {
|
13 |
+
active?: any; // boolean or number
|
14 |
+
animate?: any; // boolean, number, string or object
|
15 |
+
collapsible?: boolean;
|
16 |
+
disabled?: boolean;
|
17 |
+
event?: string;
|
18 |
+
header?: string;
|
19 |
+
heightStyle?: string;
|
20 |
+
icons?: any;
|
21 |
+
}
|
22 |
+
|
23 |
+
interface AccordionUIParams {
|
24 |
+
newHeader: JQuery;
|
25 |
+
oldHeader: JQuery;
|
26 |
+
newPanel: JQuery;
|
27 |
+
oldPanel: JQuery;
|
28 |
+
}
|
29 |
+
|
30 |
+
interface AccordionEvent {
|
31 |
+
(event: Event, ui: AccordionUIParams): void;
|
32 |
+
}
|
33 |
+
|
34 |
+
interface AccordionEvents {
|
35 |
+
activate?: AccordionEvent;
|
36 |
+
beforeActivate?: AccordionEvent;
|
37 |
+
create?: AccordionEvent;
|
38 |
+
}
|
39 |
+
|
40 |
+
interface Accordion extends Widget, AccordionOptions {
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
// Autocomplete //////////////////////////////////////////////////
|
45 |
+
|
46 |
+
interface AutocompleteOptions extends AutocompleteEvents {
|
47 |
+
appendTo?: any; //Selector;
|
48 |
+
autoFocus?: boolean;
|
49 |
+
delay?: number;
|
50 |
+
disabled?: boolean;
|
51 |
+
minLength?: number;
|
52 |
+
position?: any; // object
|
53 |
+
source?: any; // [], string or ()
|
54 |
+
}
|
55 |
+
|
56 |
+
interface AutocompleteUIParams {
|
57 |
+
/**
|
58 |
+
* The item selected from the menu, if any. Otherwise the property is null
|
59 |
+
*/
|
60 |
+
item?: any;
|
61 |
+
}
|
62 |
+
|
63 |
+
interface AutocompleteEvent {
|
64 |
+
(event: Event, ui: AutocompleteUIParams): void;
|
65 |
+
}
|
66 |
+
|
67 |
+
interface AutocompleteEvents {
|
68 |
+
change?: AutocompleteEvent;
|
69 |
+
close?: AutocompleteEvent;
|
70 |
+
create?: AutocompleteEvent;
|
71 |
+
focus?: AutocompleteEvent;
|
72 |
+
open?: AutocompleteEvent;
|
73 |
+
response?: AutocompleteEvent;
|
74 |
+
search?: AutocompleteEvent;
|
75 |
+
select?: AutocompleteEvent;
|
76 |
+
}
|
77 |
+
|
78 |
+
interface Autocomplete extends Widget, AutocompleteOptions {
|
79 |
+
escapeRegex: (value: string) => string;
|
80 |
+
filter: (array: any, term: string) => any;
|
81 |
+
}
|
82 |
+
|
83 |
+
|
84 |
+
// Button //////////////////////////////////////////////////
|
85 |
+
|
86 |
+
interface ButtonOptions {
|
87 |
+
disabled?: boolean;
|
88 |
+
icons?: any;
|
89 |
+
label?: string;
|
90 |
+
text?: string|boolean;
|
91 |
+
click?: (event?: Event) => void;
|
92 |
+
}
|
93 |
+
|
94 |
+
interface Button extends Widget, ButtonOptions {
|
95 |
+
}
|
96 |
+
|
97 |
+
|
98 |
+
// Datepicker //////////////////////////////////////////////////
|
99 |
+
|
100 |
+
interface DatepickerOptions {
|
101 |
+
/**
|
102 |
+
* An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
|
103 |
+
*/
|
104 |
+
altField?: any; // Selector, jQuery or Element
|
105 |
+
/**
|
106 |
+
* The dateFormat to be used for the altField option. This allows one date format to be shown to the user for selection purposes, while a different format is actually sent behind the scenes. For a full list of the possible formats see the formatDate function
|
107 |
+
*/
|
108 |
+
altFormat?: string;
|
109 |
+
/**
|
110 |
+
* The text to display after each date field, e.g., to show the required format.
|
111 |
+
*/
|
112 |
+
appendText?: string;
|
113 |
+
/**
|
114 |
+
* Set to true to automatically resize the input field to accommodate dates in the current dateFormat.
|
115 |
+
*/
|
116 |
+
autoSize?: boolean;
|
117 |
+
/**
|
118 |
+
* A function that takes an input field and current datepicker instance and returns an options object to update the datepicker with. It is called just before the datepicker is displayed.
|
119 |
+
*/
|
120 |
+
beforeShow?: (input: Element, inst: any) => JQueryUI.DatepickerOptions;
|
121 |
+
/**
|
122 |
+
* A function that takes a date as a parameter and must return an array with:
|
123 |
+
* [0]: true/false indicating whether or not this date is selectable
|
124 |
+
* [1]: a CSS class name to add to the date's cell or "" for the default presentation
|
125 |
+
* [2]: an optional popup tooltip for this date
|
126 |
+
* The function is called for each day in the datepicker before it is displayed.
|
127 |
+
*/
|
128 |
+
beforeShowDay?: (date: Date) => any[];
|
129 |
+
/**
|
130 |
+
* A URL of an image to use to display the datepicker when the showOn option is set to "button" or "both". If set, the buttonText option becomes the alt value and is not directly displayed.
|
131 |
+
*/
|
132 |
+
buttonImage?: string;
|
133 |
+
/**
|
134 |
+
* Whether the button image should be rendered by itself instead of inside a button element. This option is only relevant if the buttonImage option has also been set.
|
135 |
+
*/
|
136 |
+
buttonImageOnly?: boolean;
|
137 |
+
/**
|
138 |
+
* The text to display on the trigger button. Use in conjunction with the showOn option set to "button" or "both".
|
139 |
+
*/
|
140 |
+
buttonText?: string;
|
141 |
+
/**
|
142 |
+
* A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year.
|
143 |
+
*/
|
144 |
+
calculateWeek?: (date: Date) => string;
|
145 |
+
/**
|
146 |
+
* Whether the month should be rendered as a dropdown instead of text.
|
147 |
+
*/
|
148 |
+
changeMonth?: boolean;
|
149 |
+
/**
|
150 |
+
* Whether the year should be rendered as a dropdown instead of text. Use the yearRange option to control which years are made available for selection.
|
151 |
+
*/
|
152 |
+
changeYear?: boolean;
|
153 |
+
/**
|
154 |
+
* The text to display for the close link. Use the showButtonPanel option to display this button.
|
155 |
+
*/
|
156 |
+
closeText?: string;
|
157 |
+
/**
|
158 |
+
* When true, entry in the input field is constrained to those characters allowed by the current dateFormat option.
|
159 |
+
*/
|
160 |
+
constrainInput?: boolean;
|
161 |
+
/**
|
162 |
+
* The text to display for the current day link. Use the showButtonPanel option to display this button.
|
163 |
+
*/
|
164 |
+
currentText?: string;
|
165 |
+
/**
|
166 |
+
* The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function.
|
167 |
+
*/
|
168 |
+
dateFormat?: string;
|
169 |
+
/**
|
170 |
+
* The list of long day names, starting from Sunday, for use as requested via the dateFormat option.
|
171 |
+
*/
|
172 |
+
dayNames?: string[];
|
173 |
+
/**
|
174 |
+
* The list of minimised day names, starting from Sunday, for use as column headers within the datepicker.
|
175 |
+
*/
|
176 |
+
dayNamesMin?: string[];
|
177 |
+
/**
|
178 |
+
* The list of abbreviated day names, starting from Sunday, for use as requested via the dateFormat option.
|
179 |
+
*/
|
180 |
+
dayNamesShort?: string[];
|
181 |
+
/**
|
182 |
+
* Set the date to highlight on first opening if the field is blank. Specify either an actual date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null for today.
|
183 |
+
* Multiple types supported:
|
184 |
+
* Date: A date object containing the default date.
|
185 |
+
* Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday.
|
186 |
+
* String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today.
|
187 |
+
*/
|
188 |
+
defaultDate?: any; // Date, number or string
|
189 |
+
/**
|
190 |
+
* Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast").
|
191 |
+
*/
|
192 |
+
duration?: string;
|
193 |
+
/**
|
194 |
+
* Set the first day of the week: Sunday is 0, Monday is 1, etc.
|
195 |
+
*/
|
196 |
+
firstDay?: number;
|
197 |
+
/**
|
198 |
+
* When true, the current day link moves to the currently selected date instead of today.
|
199 |
+
*/
|
200 |
+
gotoCurrent?: boolean;
|
201 |
+
/**
|
202 |
+
* Normally the previous and next links are disabled when not applicable (see the minDate and maxDate options). You can hide them altogether by setting this attribute to true.
|
203 |
+
*/
|
204 |
+
hideIfNoPrevNext?: boolean;
|
205 |
+
/**
|
206 |
+
* Whether the current language is drawn from right to left.
|
207 |
+
*/
|
208 |
+
isRTL?: boolean;
|
209 |
+
/**
|
210 |
+
* The maximum selectable date. When set to null, there is no maximum.
|
211 |
+
* Multiple types supported:
|
212 |
+
* Date: A date object containing the maximum date.
|
213 |
+
* Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday.
|
214 |
+
* String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today.
|
215 |
+
*/
|
216 |
+
maxDate?: any; // Date, number or string
|
217 |
+
/**
|
218 |
+
* The minimum selectable date. When set to null, there is no minimum.
|
219 |
+
* Multiple types supported:
|
220 |
+
* Date: A date object containing the minimum date.
|
221 |
+
* Number: A number of days from today. For example 2 represents two days from today and -1 represents yesterday.
|
222 |
+
* String: A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today.
|
223 |
+
*/
|
224 |
+
minDate?: any; // Date, number or string
|
225 |
+
/**
|
226 |
+
* The list of full month names, for use as requested via the dateFormat option.
|
227 |
+
*/
|
228 |
+
monthNames?: string[];
|
229 |
+
/**
|
230 |
+
* The list of abbreviated month names, as used in the month header on each datepicker and as requested via the dateFormat option.
|
231 |
+
*/
|
232 |
+
monthNamesShort?: string[];
|
233 |
+
/**
|
234 |
+
* Whether the prevText and nextText options should be parsed as dates by the formatDate function, allowing them to display the target month names for example.
|
235 |
+
*/
|
236 |
+
navigationAsDateFormat?: boolean;
|
237 |
+
/**
|
238 |
+
* The text to display for the next month link. With the standard ThemeRoller styling, this value is replaced by an icon.
|
239 |
+
*/
|
240 |
+
nextText?: string;
|
241 |
+
/**
|
242 |
+
* The number of months to show at once.
|
243 |
+
* Multiple types supported:
|
244 |
+
* Number: The number of months to display in a single row.
|
245 |
+
* Array: An array defining the number of rows and columns to display.
|
246 |
+
*/
|
247 |
+
numberOfMonths?: any; // number or number[]
|
248 |
+
/**
|
249 |
+
* Called when the datepicker moves to a new month and/or year. The function receives the selected year, month (1-12), and the datepicker instance as parameters. this refers to the associated input field.
|
250 |
+
*/
|
251 |
+
onChangeMonthYear?: (year: number, month: number, inst: any) => void;
|
252 |
+
/**
|
253 |
+
* Called when the datepicker is closed, whether or not a date is selected. The function receives the selected date as text ("" if none) and the datepicker instance as parameters. this refers to the associated input field.
|
254 |
+
*/
|
255 |
+
onClose?: (dateText: string, inst: any) => void;
|
256 |
+
/**
|
257 |
+
* Called when the datepicker is selected. The function receives the selected date as text and the datepicker instance as parameters. this refers to the associated input field.
|
258 |
+
*/
|
259 |
+
onSelect?: (dateText: string, inst: any) => void;
|
260 |
+
/**
|
261 |
+
* The text to display for the previous month link. With the standard ThemeRoller styling, this value is replaced by an icon.
|
262 |
+
*/
|
263 |
+
prevText?: string;
|
264 |
+
/**
|
265 |
+
* Whether days in other months shown before or after the current month are selectable. This only applies if the showOtherMonths option is set to true.
|
266 |
+
*/
|
267 |
+
selectOtherMonths?: boolean;
|
268 |
+
/**
|
269 |
+
* The cutoff year for determining the century for a date (used in conjunction with dateFormat 'y'). Any dates entered with a year value less than or equal to the cutoff year are considered to be in the current century, while those greater than it are deemed to be in the previous century.
|
270 |
+
* Multiple types supported:
|
271 |
+
* Number: A value between 0 and 99 indicating the cutoff year.
|
272 |
+
* String: A relative number of years from the current year, e.g., "+3" or "-5".
|
273 |
+
*/
|
274 |
+
shortYearCutoff?: any; // number or string
|
275 |
+
/**
|
276 |
+
* The name of the animation used to show and hide the datepicker. Use "show" (the default), "slideDown", "fadeIn", any of the jQuery UI effects. Set to an empty string to disable animation.
|
277 |
+
*/
|
278 |
+
showAnim?: string;
|
279 |
+
/**
|
280 |
+
* Whether to display a button pane underneath the calendar. The button pane contains two buttons, a Today button that links to the current day, and a Done button that closes the datepicker. The buttons' text can be customized using the currentText and closeText options respectively.
|
281 |
+
*/
|
282 |
+
showButtonPanel?: boolean;
|
283 |
+
/**
|
284 |
+
* When displaying multiple months via the numberOfMonths option, the showCurrentAtPos option defines which position to display the current month in.
|
285 |
+
*/
|
286 |
+
showCurrentAtPos?: number;
|
287 |
+
/**
|
288 |
+
* Whether to show the month after the year in the header.
|
289 |
+
*/
|
290 |
+
showMonthAfterYear?: boolean;
|
291 |
+
/**
|
292 |
+
* When the datepicker should appear. The datepicker can appear when the field receives focus ("focus"), when a button is clicked ("button"), or when either event occurs ("both").
|
293 |
+
*/
|
294 |
+
showOn?: string;
|
295 |
+
/**
|
296 |
+
* If using one of the jQuery UI effects for the showAnim option, you can provide additional settings for that animation via this option.
|
297 |
+
*/
|
298 |
+
showOptions?: any; // TODO
|
299 |
+
/**
|
300 |
+
* Whether to display dates in other months (non-selectable) at the start or end of the current month. To make these days selectable use the selectOtherMonths option.
|
301 |
+
*/
|
302 |
+
showOtherMonths?: boolean;
|
303 |
+
/**
|
304 |
+
* When true, a column is added to show the week of the year. The calculateWeek option determines how the week of the year is calculated. You may also want to change the firstDay option.
|
305 |
+
*/
|
306 |
+
showWeek?: boolean;
|
307 |
+
/**
|
308 |
+
* Set how many months to move when clicking the previous/next links.
|
309 |
+
*/
|
310 |
+
stepMonths?: number;
|
311 |
+
/**
|
312 |
+
* The text to display for the week of the year column heading. Use the showWeek option to display this column.
|
313 |
+
*/
|
314 |
+
weekHeader?: string;
|
315 |
+
/**
|
316 |
+
* The range of years displayed in the year drop-down: either relative to today's year ("-nn:+nn"), relative to the currently selected year ("c-nn:c+nn"), absolute ("nnnn:nnnn"), or combinations of these formats ("nnnn:-nn"). Note that this option only affects what appears in the drop-down, to restrict which dates may be selected use the minDate and/or maxDate options.
|
317 |
+
*/
|
318 |
+
yearRange?: string;
|
319 |
+
/**
|
320 |
+
* Additional text to display after the year in the month headers.
|
321 |
+
*/
|
322 |
+
yearSuffix?: string;
|
323 |
+
}
|
324 |
+
|
325 |
+
interface DatepickerFormatDateOptions {
|
326 |
+
dayNamesShort?: string[];
|
327 |
+
dayNames?: string[];
|
328 |
+
monthNamesShort?: string[];
|
329 |
+
monthNames?: string[];
|
330 |
+
}
|
331 |
+
|
332 |
+
interface Datepicker extends Widget, DatepickerOptions {
|
333 |
+
regional: { [languageCod3: string]: any; };
|
334 |
+
setDefaults(defaults: DatepickerOptions): void;
|
335 |
+
formatDate(format: string, date: Date, settings?: DatepickerFormatDateOptions): string;
|
336 |
+
parseDate(format: string, date: string, settings?: DatepickerFormatDateOptions): Date;
|
337 |
+
iso8601Week(date: Date): number;
|
338 |
+
noWeekends(date: Date): any[];
|
339 |
+
}
|
340 |
+
|
341 |
+
|
342 |
+
// Dialog //////////////////////////////////////////////////
|
343 |
+
|
344 |
+
interface DialogOptions extends DialogEvents {
|
345 |
+
autoOpen?: boolean;
|
346 |
+
buttons?: { [buttonText: string]: (event?: Event) => void } | DialogButtonOptions[];
|
347 |
+
closeOnEscape?: boolean;
|
348 |
+
closeText?: string;
|
349 |
+
appendTo?: string;
|
350 |
+
dialogClass?: string;
|
351 |
+
disabled?: boolean;
|
352 |
+
draggable?: boolean;
|
353 |
+
height?: number | string;
|
354 |
+
hide?: boolean | number | string | DialogShowHideOptions;
|
355 |
+
maxHeight?: number;
|
356 |
+
maxWidth?: number;
|
357 |
+
minHeight?: number;
|
358 |
+
minWidth?: number;
|
359 |
+
modal?: boolean;
|
360 |
+
position?: any; // object, string or []
|
361 |
+
resizable?: boolean;
|
362 |
+
show?: boolean | number | string | DialogShowHideOptions;
|
363 |
+
stack?: boolean;
|
364 |
+
title?: string;
|
365 |
+
width?: any; // number or string
|
366 |
+
zIndex?: number;
|
367 |
+
|
368 |
+
open?: DialogEvent;
|
369 |
+
close?: DialogEvent;
|
370 |
+
}
|
371 |
+
|
372 |
+
interface DialogButtonOptions {
|
373 |
+
icons?: any;
|
374 |
+
showText?: string | boolean;
|
375 |
+
text?: string;
|
376 |
+
click?: (eventObject: JQueryEventObject) => any;
|
377 |
+
[attr: string]: any; // attributes for the <button> element
|
378 |
+
}
|
379 |
+
|
380 |
+
interface DialogShowHideOptions {
|
381 |
+
effect: string;
|
382 |
+
delay?: number;
|
383 |
+
duration?: number;
|
384 |
+
easing?: string;
|
385 |
+
}
|
386 |
+
|
387 |
+
interface DialogUIParams {
|
388 |
+
}
|
389 |
+
|
390 |
+
interface DialogEvent {
|
391 |
+
(event: Event, ui: DialogUIParams): void;
|
392 |
+
}
|
393 |
+
|
394 |
+
interface DialogEvents {
|
395 |
+
beforeClose?: DialogEvent;
|
396 |
+
close?: DialogEvent;
|
397 |
+
create?: DialogEvent;
|
398 |
+
drag?: DialogEvent;
|
399 |
+
dragStart?: DialogEvent;
|
400 |
+
dragStop?: DialogEvent;
|
401 |
+
focus?: DialogEvent;
|
402 |
+
open?: DialogEvent;
|
403 |
+
resize?: DialogEvent;
|
404 |
+
resizeStart?: DialogEvent;
|
405 |
+
resizeStop?: DialogEvent;
|
406 |
+
}
|
407 |
+
|
408 |
+
interface Dialog extends Widget, DialogOptions {
|
409 |
+
}
|
410 |
+
|
411 |
+
|
412 |
+
// Draggable //////////////////////////////////////////////////
|
413 |
+
|
414 |
+
interface DraggableEventUIParams {
|
415 |
+
helper: JQuery;
|
416 |
+
position: { top: number; left: number; };
|
417 |
+
offset: { top: number; left: number; };
|
418 |
+
}
|
419 |
+
|
420 |
+
interface DraggableEvent {
|
421 |
+
(event: Event, ui: DraggableEventUIParams): void;
|
422 |
+
}
|
423 |
+
|
424 |
+
interface DraggableOptions extends DraggableEvents {
|
425 |
+
disabled?: boolean;
|
426 |
+
addClasses?: boolean;
|
427 |
+
appendTo?: any;
|
428 |
+
axis?: string;
|
429 |
+
cancel?: string;
|
430 |
+
connectToSortable?: string;
|
431 |
+
containment?: any;
|
432 |
+
cursor?: string;
|
433 |
+
cursorAt?: any;
|
434 |
+
delay?: number;
|
435 |
+
distance?: number;
|
436 |
+
grid?: number[];
|
437 |
+
handle?: any;
|
438 |
+
helper?: any;
|
439 |
+
iframeFix?: any;
|
440 |
+
opacity?: number;
|
441 |
+
refreshPositions?: boolean;
|
442 |
+
revert?: any;
|
443 |
+
revertDuration?: number;
|
444 |
+
scope?: string;
|
445 |
+
scroll?: boolean;
|
446 |
+
scrollSensitivity?: number;
|
447 |
+
scrollSpeed?: number;
|
448 |
+
snap?: any;
|
449 |
+
snapMode?: string;
|
450 |
+
snapTolerance?: number;
|
451 |
+
stack?: string;
|
452 |
+
zIndex?: number;
|
453 |
+
}
|
454 |
+
|
455 |
+
interface DraggableEvents {
|
456 |
+
create?: DraggableEvent;
|
457 |
+
start?: DraggableEvent;
|
458 |
+
drag?: DraggableEvent;
|
459 |
+
stop?: DraggableEvent;
|
460 |
+
}
|
461 |
+
|
462 |
+
interface Draggable extends Widget, DraggableOptions, DraggableEvent {
|
463 |
+
}
|
464 |
+
|
465 |
+
|
466 |
+
// Droppable //////////////////////////////////////////////////
|
467 |
+
|
468 |
+
interface DroppableEventUIParam {
|
469 |
+
draggable: JQuery;
|
470 |
+
helper: JQuery;
|
471 |
+
position: { top: number; left: number; };
|
472 |
+
offset: { top: number; left: number; };
|
473 |
+
}
|
474 |
+
|
475 |
+
interface DroppableEvent {
|
476 |
+
(event: Event, ui: DroppableEventUIParam): void;
|
477 |
+
}
|
478 |
+
|
479 |
+
interface DroppableOptions extends DroppableEvents {
|
480 |
+
disabled?: boolean;
|
481 |
+
accept?: any;
|
482 |
+
activeClass?: string;
|
483 |
+
greedy?: boolean;
|
484 |
+
hoverClass?: string;
|
485 |
+
scope?: string;
|
486 |
+
tolerance?: string;
|
487 |
+
}
|
488 |
+
|
489 |
+
interface DroppableEvents {
|
490 |
+
create?: DroppableEvent;
|
491 |
+
activate?: DroppableEvent;
|
492 |
+
deactivate?: DroppableEvent;
|
493 |
+
over?: DroppableEvent;
|
494 |
+
out?: DroppableEvent;
|
495 |
+
drop?: DroppableEvent;
|
496 |
+
}
|
497 |
+
|
498 |
+
interface Droppable extends Widget, DroppableOptions {
|
499 |
+
}
|
500 |
+
|
501 |
+
// Menu //////////////////////////////////////////////////
|
502 |
+
|
503 |
+
interface MenuOptions extends MenuEvents {
|
504 |
+
disabled?: boolean;
|
505 |
+
icons?: any;
|
506 |
+
menus?: string;
|
507 |
+
position?: any; // TODO
|
508 |
+
role?: string;
|
509 |
+
}
|
510 |
+
|
511 |
+
interface MenuUIParams {
|
512 |
+
item?: JQuery;
|
513 |
+
}
|
514 |
+
|
515 |
+
interface MenuEvent {
|
516 |
+
(event: Event, ui: MenuUIParams): void;
|
517 |
+
}
|
518 |
+
|
519 |
+
interface MenuEvents {
|
520 |
+
blur?: MenuEvent;
|
521 |
+
create?: MenuEvent;
|
522 |
+
focus?: MenuEvent;
|
523 |
+
select?: MenuEvent;
|
524 |
+
}
|
525 |
+
|
526 |
+
interface Menu extends Widget, MenuOptions {
|
527 |
+
}
|
528 |
+
|
529 |
+
|
530 |
+
// Progressbar //////////////////////////////////////////////////
|
531 |
+
|
532 |
+
interface ProgressbarOptions extends ProgressbarEvents {
|
533 |
+
disabled?: boolean;
|
534 |
+
value?: number | boolean;
|
535 |
+
max?: number;
|
536 |
+
}
|
537 |
+
|
538 |
+
interface ProgressbarUIParams {
|
539 |
+
}
|
540 |
+
|
541 |
+
interface ProgressbarEvent {
|
542 |
+
(event: Event, ui: ProgressbarUIParams): void;
|
543 |
+
}
|
544 |
+
|
545 |
+
interface ProgressbarEvents {
|
546 |
+
change?: ProgressbarEvent;
|
547 |
+
complete?: ProgressbarEvent;
|
548 |
+
create?: ProgressbarEvent;
|
549 |
+
}
|
550 |
+
|
551 |
+
interface Progressbar extends Widget, ProgressbarOptions {
|
552 |
+
}
|
553 |
+
|
554 |
+
|
555 |
+
// Resizable //////////////////////////////////////////////////
|
556 |
+
|
557 |
+
interface ResizableOptions extends ResizableEvents {
|
558 |
+
alsoResize?: any; // Selector, JQuery or Element
|
559 |
+
animate?: boolean;
|
560 |
+
animateDuration?: any; // number or string
|
561 |
+
animateEasing?: string;
|
562 |
+
aspectRatio?: any; // boolean or number
|
563 |
+
autoHide?: boolean;
|
564 |
+
cancel?: string;
|
565 |
+
containment?: any; // Selector, Element or string
|
566 |
+
delay?: number;
|
567 |
+
disabled?: boolean;
|
568 |
+
distance?: number;
|
569 |
+
ghost?: boolean;
|
570 |
+
grid?: any;
|
571 |
+
handles?: any; // string or object
|
572 |
+
helper?: string;
|
573 |
+
maxHeight?: number;
|
574 |
+
maxWidth?: number;
|
575 |
+
minHeight?: number;
|
576 |
+
minWidth?: number;
|
577 |
+
}
|
578 |
+
|
579 |
+
interface ResizableUIParams {
|
580 |
+
element: JQuery;
|
581 |
+
helper: JQuery;
|
582 |
+
originalElement: JQuery;
|
583 |
+
originalPosition: any;
|
584 |
+
originalSize: any;
|
585 |
+
position: any;
|
586 |
+
size: any;
|
587 |
+
}
|
588 |
+
|
589 |
+
interface ResizableEvent {
|
590 |
+
(event: Event, ui: ResizableUIParams): void;
|
591 |
+
}
|
592 |
+
|
593 |
+
interface ResizableEvents {
|
594 |
+
resize?: ResizableEvent;
|
595 |
+
start?: ResizableEvent;
|
596 |
+
stop?: ResizableEvent;
|
597 |
+
create?: ResizableEvents;
|
598 |
+
}
|
599 |
+
|
600 |
+
interface Resizable extends Widget, ResizableOptions {
|
601 |
+
}
|
602 |
+
|
603 |
+
|
604 |
+
// Selectable //////////////////////////////////////////////////
|
605 |
+
|
606 |
+
interface SelectableOptions extends SelectableEvents {
|
607 |
+
autoRefresh?: boolean;
|
608 |
+
cancel?: string;
|
609 |
+
delay?: number;
|
610 |
+
disabled?: boolean;
|
611 |
+
distance?: number;
|
612 |
+
filter?: string;
|
613 |
+
tolerance?: string;
|
614 |
+
}
|
615 |
+
|
616 |
+
interface SelectableEvents {
|
617 |
+
selected? (event: Event, ui: { selected?: Element; }): void;
|
618 |
+
selecting? (event: Event, ui: { selecting?: Element; }): void;
|
619 |
+
start? (event: Event, ui: any): void;
|
620 |
+
stop? (event: Event, ui: any): void;
|
621 |
+
unselected? (event: Event, ui: { unselected: Element; }): void;
|
622 |
+
unselecting? (event: Event, ui: { unselecting: Element; }): void;
|
623 |
+
}
|
624 |
+
|
625 |
+
interface Selectable extends Widget, SelectableOptions {
|
626 |
+
}
|
627 |
+
|
628 |
+
// Slider //////////////////////////////////////////////////
|
629 |
+
|
630 |
+
interface SliderOptions extends SliderEvents {
|
631 |
+
animate?: any; // boolean, string or number
|
632 |
+
disabled?: boolean;
|
633 |
+
max?: number;
|
634 |
+
min?: number;
|
635 |
+
orientation?: string;
|
636 |
+
range?: any; // boolean or string
|
637 |
+
step?: number;
|
638 |
+
value?: number;
|
639 |
+
values?: number[];
|
640 |
+
highlight?: boolean;
|
641 |
+
}
|
642 |
+
|
643 |
+
interface SliderUIParams {
|
644 |
+
handle?: JQuery;
|
645 |
+
value?: number;
|
646 |
+
values?: number[];
|
647 |
+
}
|
648 |
+
|
649 |
+
interface SliderEvent {
|
650 |
+
(event: Event, ui: SliderUIParams): void;
|
651 |
+
}
|
652 |
+
|
653 |
+
interface SliderEvents {
|
654 |
+
change?: SliderEvent;
|
655 |
+
create?: SliderEvent;
|
656 |
+
slide?: SliderEvent;
|
657 |
+
start?: SliderEvent;
|
658 |
+
stop?: SliderEvent;
|
659 |
+
}
|
660 |
+
|
661 |
+
interface Slider extends Widget, SliderOptions {
|
662 |
+
}
|
663 |
+
|
664 |
+
|
665 |
+
// Sortable //////////////////////////////////////////////////
|
666 |
+
|
667 |
+
interface SortableOptions extends SortableEvents {
|
668 |
+
appendTo?: any; // jQuery, Element, Selector or string
|
669 |
+
axis?: string;
|
670 |
+
cancel?: any; // Selector
|
671 |
+
connectWith?: any; // Selector
|
672 |
+
containment?: any; // Element, Selector or string
|
673 |
+
cursor?: string;
|
674 |
+
cursorAt?: any;
|
675 |
+
delay?: number;
|
676 |
+
disabled?: boolean;
|
677 |
+
distance?: number;
|
678 |
+
dropOnEmpty?: boolean;
|
679 |
+
forceHelperSize?: boolean;
|
680 |
+
forcePlaceholderSize?: boolean;
|
681 |
+
grid?: number[];
|
682 |
+
helper?: string | ((event: Event, element: Sortable) => Element);
|
683 |
+
handle?: any; // Selector or Element
|
684 |
+
items?: any; // Selector
|
685 |
+
opacity?: number;
|
686 |
+
placeholder?: string;
|
687 |
+
revert?: any; // boolean or number
|
688 |
+
scroll?: boolean;
|
689 |
+
scrollSensitivity?: number;
|
690 |
+
scrollSpeed?: number;
|
691 |
+
tolerance?: string;
|
692 |
+
zIndex?: number;
|
693 |
+
}
|
694 |
+
|
695 |
+
interface SortableUIParams {
|
696 |
+
helper: JQuery;
|
697 |
+
item: JQuery;
|
698 |
+
offset: any;
|
699 |
+
position: any;
|
700 |
+
originalPosition: any;
|
701 |
+
sender: JQuery;
|
702 |
+
placeholder: JQuery;
|
703 |
+
}
|
704 |
+
|
705 |
+
interface SortableEvent {
|
706 |
+
(event: JQueryEventObject, ui: SortableUIParams): void;
|
707 |
+
}
|
708 |
+
|
709 |
+
interface SortableEvents {
|
710 |
+
activate?: SortableEvent;
|
711 |
+
beforeStop?: SortableEvent;
|
712 |
+
change?: SortableEvent;
|
713 |
+
deactivate?: SortableEvent;
|
714 |
+
out?: SortableEvent;
|
715 |
+
over?: SortableEvent;
|
716 |
+
receive?: SortableEvent;
|
717 |
+
remove?: SortableEvent;
|
718 |
+
sort?: SortableEvent;
|
719 |
+
start?: SortableEvent;
|
720 |
+
stop?: SortableEvent;
|
721 |
+
update?: SortableEvent;
|
722 |
+
}
|
723 |
+
|
724 |
+
interface Sortable extends Widget, SortableOptions, SortableEvents {
|
725 |
+
}
|
726 |
+
|
727 |
+
|
728 |
+
// Spinner //////////////////////////////////////////////////
|
729 |
+
|
730 |
+
interface SpinnerOptions extends SpinnerEvents {
|
731 |
+
culture?: string;
|
732 |
+
disabled?: boolean;
|
733 |
+
icons?: any;
|
734 |
+
incremental?: any; // boolean or ()
|
735 |
+
max?: any; // number or string
|
736 |
+
min?: any; // number or string
|
737 |
+
numberFormat?: string;
|
738 |
+
page?: number;
|
739 |
+
step?: any; // number or string
|
740 |
+
}
|
741 |
+
|
742 |
+
interface SpinnerUIParam {
|
743 |
+
value: number;
|
744 |
+
}
|
745 |
+
|
746 |
+
interface SpinnerEvent<T> {
|
747 |
+
(event: Event, ui: T): void;
|
748 |
+
}
|
749 |
+
|
750 |
+
interface SpinnerEvents {
|
751 |
+
change?: SpinnerEvent<{}>;
|
752 |
+
create?: SpinnerEvent<{}>;
|
753 |
+
spin?: SpinnerEvent<SpinnerUIParam>;
|
754 |
+
start?: SpinnerEvent<{}>;
|
755 |
+
stop?: SpinnerEvent<{}>;
|
756 |
+
}
|
757 |
+
|
758 |
+
interface Spinner extends Widget, SpinnerOptions {
|
759 |
+
}
|
760 |
+
|
761 |
+
|
762 |
+
// Tabs //////////////////////////////////////////////////
|
763 |
+
|
764 |
+
interface TabsOptions extends TabsEvents {
|
765 |
+
active?: any; // boolean or number
|
766 |
+
collapsible?: boolean;
|
767 |
+
disabled?: any; // boolean or []
|
768 |
+
event?: string;
|
769 |
+
heightStyle?: string;
|
770 |
+
hide?: any; // boolean, number, string or object
|
771 |
+
show?: any; // boolean, number, string or object
|
772 |
+
}
|
773 |
+
|
774 |
+
interface TabsActivationUIParams {
|
775 |
+
newTab: JQuery;
|
776 |
+
oldTab: JQuery;
|
777 |
+
newPanel: JQuery;
|
778 |
+
oldPanel: JQuery;
|
779 |
+
}
|
780 |
+
|
781 |
+
interface TabsBeforeLoadUIParams {
|
782 |
+
tab: JQuery;
|
783 |
+
panel: JQuery;
|
784 |
+
jqXHR: JQueryXHR;
|
785 |
+
ajaxSettings: any;
|
786 |
+
}
|
787 |
+
|
788 |
+
interface TabsCreateOrLoadUIParams {
|
789 |
+
tab: JQuery;
|
790 |
+
panel: JQuery;
|
791 |
+
}
|
792 |
+
|
793 |
+
interface TabsEvent<UI> {
|
794 |
+
(event: Event, ui: UI): void;
|
795 |
+
}
|
796 |
+
|
797 |
+
interface TabsEvents {
|
798 |
+
activate?: TabsEvent<TabsActivationUIParams>;
|
799 |
+
beforeActivate?: TabsEvent<TabsActivationUIParams>;
|
800 |
+
beforeLoad?: TabsEvent<TabsBeforeLoadUIParams>;
|
801 |
+
load?: TabsEvent<TabsCreateOrLoadUIParams>;
|
802 |
+
create?: TabsEvent<TabsCreateOrLoadUIParams>;
|
803 |
+
}
|
804 |
+
|
805 |
+
interface Tabs extends Widget, TabsOptions {
|
806 |
+
}
|
807 |
+
|
808 |
+
|
809 |
+
// Tooltip //////////////////////////////////////////////////
|
810 |
+
|
811 |
+
interface TooltipOptions extends TooltipEvents {
|
812 |
+
content?: any; // () or string
|
813 |
+
disabled?: boolean;
|
814 |
+
hide?: any; // boolean, number, string or object
|
815 |
+
items?: string;
|
816 |
+
position?: any; // TODO
|
817 |
+
show?: any; // boolean, number, string or object
|
818 |
+
tooltipClass?: string;
|
819 |
+
track?: boolean;
|
820 |
+
}
|
821 |
+
|
822 |
+
interface TooltipUIParams {
|
823 |
+
}
|
824 |
+
|
825 |
+
interface TooltipEvent {
|
826 |
+
(event: Event, ui: TooltipUIParams): void;
|
827 |
+
}
|
828 |
+
|
829 |
+
interface TooltipEvents {
|
830 |
+
close?: TooltipEvent;
|
831 |
+
open?: TooltipEvent;
|
832 |
+
}
|
833 |
+
|
834 |
+
interface Tooltip extends Widget, TooltipOptions {
|
835 |
+
}
|
836 |
+
|
837 |
+
|
838 |
+
// Effects //////////////////////////////////////////////////
|
839 |
+
|
840 |
+
interface EffectOptions {
|
841 |
+
effect: string;
|
842 |
+
easing?: string;
|
843 |
+
duration?: number;
|
844 |
+
complete: Function;
|
845 |
+
}
|
846 |
+
|
847 |
+
interface BlindEffect {
|
848 |
+
direction?: string;
|
849 |
+
}
|
850 |
+
|
851 |
+
interface BounceEffect {
|
852 |
+
distance?: number;
|
853 |
+
times?: number;
|
854 |
+
}
|
855 |
+
|
856 |
+
interface ClipEffect {
|
857 |
+
direction?: number;
|
858 |
+
}
|
859 |
+
|
860 |
+
interface DropEffect {
|
861 |
+
direction?: number;
|
862 |
+
}
|
863 |
+
|
864 |
+
interface ExplodeEffect {
|
865 |
+
pieces?: number;
|
866 |
+
}
|
867 |
+
|
868 |
+
interface FadeEffect { }
|
869 |
+
|
870 |
+
interface FoldEffect {
|
871 |
+
size?: any;
|
872 |
+
horizFirst?: boolean;
|
873 |
+
}
|
874 |
+
|
875 |
+
interface HighlightEffect {
|
876 |
+
color?: string;
|
877 |
+
}
|
878 |
+
|
879 |
+
interface PuffEffect {
|
880 |
+
percent?: number;
|
881 |
+
}
|
882 |
+
|
883 |
+
interface PulsateEffect {
|
884 |
+
times?: number;
|
885 |
+
}
|
886 |
+
|
887 |
+
interface ScaleEffect {
|
888 |
+
direction?: string;
|
889 |
+
origin?: string[];
|
890 |
+
percent?: number;
|
891 |
+
scale?: string;
|
892 |
+
}
|
893 |
+
|
894 |
+
interface ShakeEffect {
|
895 |
+
direction?: string;
|
896 |
+
distance?: number;
|
897 |
+
times?: number;
|
898 |
+
}
|
899 |
+
|
900 |
+
interface SizeEffect {
|
901 |
+
to?: any;
|
902 |
+
origin?: string[];
|
903 |
+
scale?: string;
|
904 |
+
}
|
905 |
+
|
906 |
+
interface SlideEffect {
|
907 |
+
direction?: string;
|
908 |
+
distance?: number;
|
909 |
+
}
|
910 |
+
|
911 |
+
interface TransferEffect {
|
912 |
+
className?: string;
|
913 |
+
to?: string;
|
914 |
+
}
|
915 |
+
|
916 |
+
interface JQueryPositionOptions {
|
917 |
+
my?: string;
|
918 |
+
at?: string;
|
919 |
+
of?: any;
|
920 |
+
collision?: string;
|
921 |
+
using?: Function;
|
922 |
+
within?: any;
|
923 |
+
}
|
924 |
+
|
925 |
+
|
926 |
+
// UI //////////////////////////////////////////////////
|
927 |
+
|
928 |
+
interface MouseOptions {
|
929 |
+
cancel?: string;
|
930 |
+
delay?: number;
|
931 |
+
distance?: number;
|
932 |
+
}
|
933 |
+
|
934 |
+
interface KeyCode {
|
935 |
+
BACKSPACE: number;
|
936 |
+
COMMA: number;
|
937 |
+
DELETE: number;
|
938 |
+
DOWN: number;
|
939 |
+
END: number;
|
940 |
+
ENTER: number;
|
941 |
+
ESCAPE: number;
|
942 |
+
HOME: number;
|
943 |
+
LEFT: number;
|
944 |
+
NUMPAD_ADD: number;
|
945 |
+
NUMPAD_DECIMAL: number;
|
946 |
+
NUMPAD_DIVIDE: number;
|
947 |
+
NUMPAD_ENTER: number;
|
948 |
+
NUMPAD_MULTIPLY: number;
|
949 |
+
NUMPAD_SUBTRACT: number;
|
950 |
+
PAGE_DOWN: number;
|
951 |
+
PAGE_UP: number;
|
952 |
+
PERIOD: number;
|
953 |
+
RIGHT: number;
|
954 |
+
SPACE: number;
|
955 |
+
TAB: number;
|
956 |
+
UP: number;
|
957 |
+
}
|
958 |
+
|
959 |
+
interface UI {
|
960 |
+
mouse(method: string): JQuery;
|
961 |
+
mouse(options: MouseOptions): JQuery;
|
962 |
+
mouse(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
963 |
+
mouse(optionLiteral: string, optionValue: any): any;
|
964 |
+
|
965 |
+
accordion: Accordion;
|
966 |
+
autocomplete: Autocomplete;
|
967 |
+
button: Button;
|
968 |
+
buttonset: Button;
|
969 |
+
datepicker: Datepicker;
|
970 |
+
dialog: Dialog;
|
971 |
+
keyCode: KeyCode;
|
972 |
+
menu: Menu;
|
973 |
+
progressbar: Progressbar;
|
974 |
+
slider: Slider;
|
975 |
+
spinner: Spinner;
|
976 |
+
tabs: Tabs;
|
977 |
+
tooltip: Tooltip;
|
978 |
+
version: string;
|
979 |
+
}
|
980 |
+
|
981 |
+
|
982 |
+
// Widget //////////////////////////////////////////////////
|
983 |
+
|
984 |
+
interface WidgetOptions {
|
985 |
+
disabled?: boolean;
|
986 |
+
hide?: any;
|
987 |
+
show?: any;
|
988 |
+
}
|
989 |
+
|
990 |
+
interface Widget {
|
991 |
+
(methodName: string): JQuery;
|
992 |
+
(options: WidgetOptions): JQuery;
|
993 |
+
(options: AccordionOptions): JQuery;
|
994 |
+
(optionLiteral: string, optionName: string): any;
|
995 |
+
(optionLiteral: string, options: WidgetOptions): any;
|
996 |
+
(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
997 |
+
|
998 |
+
(name: string, prototype: any): JQuery;
|
999 |
+
(name: string, base: Function, prototype: any): JQuery;
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
////////////////////////////////////////////////////////////////////////////////////////////////////
|
1003 |
+
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
interface JQuery {
|
1007 |
+
|
1008 |
+
accordion(): JQuery;
|
1009 |
+
accordion(methodName: 'destroy'): void;
|
1010 |
+
accordion(methodName: 'disable'): void;
|
1011 |
+
accordion(methodName: 'enable'): void;
|
1012 |
+
accordion(methodName: 'refresh'): void;
|
1013 |
+
accordion(methodName: 'widget'): JQuery;
|
1014 |
+
accordion(methodName: string): JQuery;
|
1015 |
+
accordion(options: JQueryUI.AccordionOptions): JQuery;
|
1016 |
+
accordion(optionLiteral: string, optionName: string): any;
|
1017 |
+
accordion(optionLiteral: string, options: JQueryUI.AccordionOptions): any;
|
1018 |
+
accordion(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1019 |
+
|
1020 |
+
autocomplete(): JQuery;
|
1021 |
+
autocomplete(methodName: 'close'): void;
|
1022 |
+
autocomplete(methodName: 'destroy'): void;
|
1023 |
+
autocomplete(methodName: 'disable'): void;
|
1024 |
+
autocomplete(methodName: 'enable'): void;
|
1025 |
+
autocomplete(methodName: 'search', value?: string): void;
|
1026 |
+
autocomplete(methodName: 'widget'): JQuery;
|
1027 |
+
autocomplete(methodName: string): JQuery;
|
1028 |
+
autocomplete(options: JQueryUI.AutocompleteOptions): JQuery;
|
1029 |
+
autocomplete(optionLiteral: string, optionName: string): any;
|
1030 |
+
autocomplete(optionLiteral: string, options: JQueryUI.AutocompleteOptions): any;
|
1031 |
+
autocomplete(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1032 |
+
|
1033 |
+
button(): JQuery;
|
1034 |
+
button(methodName: 'destroy'): void;
|
1035 |
+
button(methodName: 'disable'): void;
|
1036 |
+
button(methodName: 'enable'): void;
|
1037 |
+
button(methodName: 'refresh'): void;
|
1038 |
+
button(methodName: 'widget'): JQuery;
|
1039 |
+
button(methodName: string): JQuery;
|
1040 |
+
button(options: JQueryUI.ButtonOptions): JQuery;
|
1041 |
+
button(optionLiteral: string, optionName: string): any;
|
1042 |
+
button(optionLiteral: string, options: JQueryUI.ButtonOptions): any;
|
1043 |
+
button(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1044 |
+
|
1045 |
+
buttonset(): JQuery;
|
1046 |
+
buttonset(methodName: 'destroy'): void;
|
1047 |
+
buttonset(methodName: 'disable'): void;
|
1048 |
+
buttonset(methodName: 'enable'): void;
|
1049 |
+
buttonset(methodName: 'refresh'): void;
|
1050 |
+
buttonset(methodName: 'widget'): JQuery;
|
1051 |
+
buttonset(methodName: string): JQuery;
|
1052 |
+
buttonset(options: JQueryUI.ButtonOptions): JQuery;
|
1053 |
+
buttonset(optionLiteral: string, optionName: string): any;
|
1054 |
+
buttonset(optionLiteral: string, options: JQueryUI.ButtonOptions): any;
|
1055 |
+
buttonset(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1056 |
+
|
1057 |
+
/**
|
1058 |
+
* Initialize a datepicker
|
1059 |
+
*/
|
1060 |
+
datepicker(): JQuery;
|
1061 |
+
/**
|
1062 |
+
* Removes the datepicker functionality completely. This will return the element back to its pre-init state.
|
1063 |
+
*
|
1064 |
+
* @param methodName 'destroy'
|
1065 |
+
*/
|
1066 |
+
datepicker(methodName: 'destroy'): JQuery;
|
1067 |
+
/**
|
1068 |
+
* Opens the datepicker in a dialog box.
|
1069 |
+
*
|
1070 |
+
* @param methodName 'dialog'
|
1071 |
+
* @param date The initial date.
|
1072 |
+
* @param onSelect A callback function when a date is selected. The function receives the date text and date picker instance as parameters.
|
1073 |
+
* @param settings The new settings for the date picker.
|
1074 |
+
* @param pos The position of the top/left of the dialog as [x, y] or a MouseEvent that contains the coordinates. If not specified the dialog is centered on the screen.
|
1075 |
+
*/
|
1076 |
+
datepicker(methodName: 'dialog', date: Date, onSelect?: () => void, settings?: JQueryUI.DatepickerOptions, pos?: number[]): JQuery;
|
1077 |
+
/**
|
1078 |
+
* Opens the datepicker in a dialog box.
|
1079 |
+
*
|
1080 |
+
* @param methodName 'dialog'
|
1081 |
+
* @param date The initial date.
|
1082 |
+
* @param onSelect A callback function when a date is selected. The function receives the date text and date picker instance as parameters.
|
1083 |
+
* @param settings The new settings for the date picker.
|
1084 |
+
* @param pos The position of the top/left of the dialog as [x, y] or a MouseEvent that contains the coordinates. If not specified the dialog is centered on the screen.
|
1085 |
+
*/
|
1086 |
+
datepicker(methodName: 'dialog', date: Date, onSelect?: () => void, settings?: JQueryUI.DatepickerOptions, pos?: MouseEvent): JQuery;
|
1087 |
+
/**
|
1088 |
+
* Opens the datepicker in a dialog box.
|
1089 |
+
*
|
1090 |
+
* @param methodName 'dialog'
|
1091 |
+
* @param date The initial date.
|
1092 |
+
* @param onSelect A callback function when a date is selected. The function receives the date text and date picker instance as parameters.
|
1093 |
+
* @param settings The new settings for the date picker.
|
1094 |
+
* @param pos The position of the top/left of the dialog as [x, y] or a MouseEvent that contains the coordinates. If not specified the dialog is centered on the screen.
|
1095 |
+
*/
|
1096 |
+
datepicker(methodName: 'dialog', date: string, onSelect?: () => void, settings?: JQueryUI.DatepickerOptions, pos?: number[]): JQuery;
|
1097 |
+
/**
|
1098 |
+
* Opens the datepicker in a dialog box.
|
1099 |
+
*
|
1100 |
+
* @param methodName 'dialog'
|
1101 |
+
* @param date The initial date.
|
1102 |
+
* @param onSelect A callback function when a date is selected. The function receives the date text and date picker instance as parameters.
|
1103 |
+
* @param settings The new settings for the date picker.
|
1104 |
+
* @param pos The position of the top/left of the dialog as [x, y] or a MouseEvent that contains the coordinates. If not specified the dialog is centered on the screen.
|
1105 |
+
*/
|
1106 |
+
datepicker(methodName: 'dialog', date: string, onSelect?: () => void, settings?: JQueryUI.DatepickerOptions, pos?: MouseEvent): JQuery;
|
1107 |
+
/**
|
1108 |
+
* Returns the current date for the datepicker or null if no date has been selected.
|
1109 |
+
*
|
1110 |
+
* @param methodName 'getDate'
|
1111 |
+
*/
|
1112 |
+
datepicker(methodName: 'getDate'): Date;
|
1113 |
+
/**
|
1114 |
+
* Close a previously opened date picker.
|
1115 |
+
*
|
1116 |
+
* @param methodName 'hide'
|
1117 |
+
*/
|
1118 |
+
datepicker(methodName: 'hide'): JQuery;
|
1119 |
+
/**
|
1120 |
+
* Determine whether a date picker has been disabled.
|
1121 |
+
*
|
1122 |
+
* @param methodName 'isDisabled'
|
1123 |
+
*/
|
1124 |
+
datepicker(methodName: 'isDisabled'): boolean;
|
1125 |
+
/**
|
1126 |
+
* Redraw the date picker, after having made some external modifications.
|
1127 |
+
*
|
1128 |
+
* @param methodName 'refresh'
|
1129 |
+
*/
|
1130 |
+
datepicker(methodName: 'refresh'): JQuery;
|
1131 |
+
/**
|
1132 |
+
* Sets the date for the datepicker. The new date may be a Date object or a string in the current date format (e.g., "01/26/2009"), a number of days from today (e.g., +7) or a string of values and periods ("y" for years, "m" for months, "w" for weeks, "d" for days, e.g., "+1m +7d"), or null to clear the selected date.
|
1133 |
+
*
|
1134 |
+
* @param methodName 'setDate'
|
1135 |
+
* @param date The new date.
|
1136 |
+
*/
|
1137 |
+
datepicker(methodName: 'setDate', date: Date): JQuery;
|
1138 |
+
/**
|
1139 |
+
* Sets the date for the datepicker. The new date may be a Date object or a string in the current date format (e.g., "01/26/2009"), a number of days from today (e.g., +7) or a string of values and periods ("y" for years, "m" for months, "w" for weeks, "d" for days, e.g., "+1m +7d"), or null to clear the selected date.
|
1140 |
+
*
|
1141 |
+
* @param methodName 'setDate'
|
1142 |
+
* @param date The new date.
|
1143 |
+
*/
|
1144 |
+
datepicker(methodName: 'setDate', date: string): JQuery;
|
1145 |
+
/**
|
1146 |
+
* Open the date picker. If the datepicker is attached to an input, the input must be visible for the datepicker to be shown.
|
1147 |
+
*
|
1148 |
+
* @param methodName 'show'
|
1149 |
+
*/
|
1150 |
+
datepicker(methodName: 'show'): JQuery;
|
1151 |
+
/**
|
1152 |
+
* Returns a jQuery object containing the datepicker.
|
1153 |
+
*
|
1154 |
+
* @param methodName 'widget'
|
1155 |
+
*/
|
1156 |
+
datepicker(methodName: 'widget'): JQuery;
|
1157 |
+
|
1158 |
+
/**
|
1159 |
+
* Get the altField option, after initialization
|
1160 |
+
*
|
1161 |
+
* @param methodName 'option'
|
1162 |
+
* @param optionName 'altField'
|
1163 |
+
*/
|
1164 |
+
datepicker(methodName: 'option', optionName: 'altField'): any;
|
1165 |
+
/**
|
1166 |
+
* Set the altField option, after initialization
|
1167 |
+
*
|
1168 |
+
* @param methodName 'option'
|
1169 |
+
* @param optionName 'altField'
|
1170 |
+
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
|
1171 |
+
*/
|
1172 |
+
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: string): JQuery;
|
1173 |
+
/**
|
1174 |
+
* Set the altField option, after initialization
|
1175 |
+
*
|
1176 |
+
* @param methodName 'option'
|
1177 |
+
* @param optionName 'altField'
|
1178 |
+
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
|
1179 |
+
*/
|
1180 |
+
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: JQuery): JQuery;
|
1181 |
+
/**
|
1182 |
+
* Set the altField option, after initialization
|
1183 |
+
*
|
1184 |
+
* @param methodName 'option'
|
1185 |
+
* @param optionName 'altField'
|
1186 |
+
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
|
1187 |
+
*/
|
1188 |
+
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: Element): JQuery;
|
1189 |
+
|
1190 |
+
/**
|
1191 |
+
* Get the altFormat option, after initialization
|
1192 |
+
*
|
1193 |
+
* @param methodName 'option'
|
1194 |
+
* @param optionName 'altFormat'
|
1195 |
+
*/
|
1196 |
+
datepicker(methodName: 'option', optionName: 'altFormat'): string;
|
1197 |
+
/**
|
1198 |
+
* Set the altFormat option, after initialization
|
1199 |
+
*
|
1200 |
+
* @param methodName 'option'
|
1201 |
+
* @param optionName 'altFormat'
|
1202 |
+
* @param altFormatValue The dateFormat to be used for the altField option. This allows one date format to be shown to the user for selection purposes, while a different format is actually sent behind the scenes. For a full list of the possible formats see the formatDate function
|
1203 |
+
*/
|
1204 |
+
datepicker(methodName: 'option', optionName: 'altFormat', altFormatValue: string): JQuery;
|
1205 |
+
|
1206 |
+
/**
|
1207 |
+
* Get the appendText option, after initialization
|
1208 |
+
*
|
1209 |
+
* @param methodName 'option'
|
1210 |
+
* @param optionName 'appendText'
|
1211 |
+
*/
|
1212 |
+
datepicker(methodName: 'option', optionName: 'appendText'): string;
|
1213 |
+
/**
|
1214 |
+
* Set the appendText option, after initialization
|
1215 |
+
*
|
1216 |
+
* @param methodName 'option'
|
1217 |
+
* @param optionName 'appendText'
|
1218 |
+
* @param appendTextValue The text to display after each date field, e.g., to show the required format.
|
1219 |
+
*/
|
1220 |
+
datepicker(methodName: 'option', optionName: 'appendText', appendTextValue: string): JQuery;
|
1221 |
+
|
1222 |
+
/**
|
1223 |
+
* Get the autoSize option, after initialization
|
1224 |
+
*
|
1225 |
+
* @param methodName 'option'
|
1226 |
+
* @param optionName 'autoSize'
|
1227 |
+
*/
|
1228 |
+
datepicker(methodName: 'option', optionName: 'autoSize'): boolean;
|
1229 |
+
/**
|
1230 |
+
* Set the autoSize option, after initialization
|
1231 |
+
*
|
1232 |
+
* @param methodName 'option'
|
1233 |
+
* @param optionName 'autoSize'
|
1234 |
+
* @param autoSizeValue Set to true to automatically resize the input field to accommodate dates in the current dateFormat.
|
1235 |
+
*/
|
1236 |
+
datepicker(methodName: 'option', optionName: 'autoSize', autoSizeValue: boolean): JQuery;
|
1237 |
+
|
1238 |
+
/**
|
1239 |
+
* Get the beforeShow option, after initialization
|
1240 |
+
*
|
1241 |
+
* @param methodName 'option'
|
1242 |
+
* @param optionName 'beforeShow'
|
1243 |
+
*/
|
1244 |
+
datepicker(methodName: 'option', optionName: 'beforeShow'): (input: Element, inst: any) => JQueryUI.DatepickerOptions;
|
1245 |
+
/**
|
1246 |
+
* Set the beforeShow option, after initialization
|
1247 |
+
*
|
1248 |
+
* @param methodName 'option'
|
1249 |
+
* @param optionName 'beforeShow'
|
1250 |
+
* @param beforeShowValue A function that takes an input field and current datepicker instance and returns an options object to update the datepicker with. It is called just before the datepicker is displayed.
|
1251 |
+
*/
|
1252 |
+
datepicker(methodName: 'option', optionName: 'beforeShow', beforeShowValue: (input: Element, inst: any) => JQueryUI.DatepickerOptions): JQuery;
|
1253 |
+
|
1254 |
+
/**
|
1255 |
+
* Get the beforeShow option, after initialization
|
1256 |
+
*
|
1257 |
+
* @param methodName 'option'
|
1258 |
+
* @param optionName 'beforeShowDay'
|
1259 |
+
*/
|
1260 |
+
datepicker(methodName: 'option', optionName: 'beforeShowDay'): (date: Date) => any[];
|
1261 |
+
/**
|
1262 |
+
* Set the beforeShow option, after initialization
|
1263 |
+
*
|
1264 |
+
* @param methodName 'option'
|
1265 |
+
* @param optionName 'beforeShowDay'
|
1266 |
+
* @param beforeShowDayValue A function that takes a date as a parameter and must return an array with:
|
1267 |
+
* [0]: true/false indicating whether or not this date is selectable
|
1268 |
+
* [1]: a CSS class name to add to the date's cell or "" for the default presentation
|
1269 |
+
* [2]: an optional popup tooltip for this date
|
1270 |
+
* The function is called for each day in the datepicker before it is displayed.
|
1271 |
+
*/
|
1272 |
+
datepicker(methodName: 'option', optionName: 'beforeShowDay', beforeShowDayValue: (date: Date) => any[]): JQuery;
|
1273 |
+
|
1274 |
+
/**
|
1275 |
+
* Get the buttonImage option, after initialization
|
1276 |
+
*
|
1277 |
+
* @param methodName 'option'
|
1278 |
+
* @param optionName 'buttonImage'
|
1279 |
+
*/
|
1280 |
+
datepicker(methodName: 'option', optionName: 'buttonImage'): string;
|
1281 |
+
/**
|
1282 |
+
* Set the buttonImage option, after initialization
|
1283 |
+
*
|
1284 |
+
* @param methodName 'option'
|
1285 |
+
* @param optionName 'buttonImage'
|
1286 |
+
* @param buttonImageValue A URL of an image to use to display the datepicker when the showOn option is set to "button" or "both". If set, the buttonText option becomes the alt value and is not directly displayed.
|
1287 |
+
*/
|
1288 |
+
datepicker(methodName: 'option', optionName: 'buttonImage', buttonImageValue: string): JQuery;
|
1289 |
+
|
1290 |
+
/**
|
1291 |
+
* Get the buttonImageOnly option, after initialization
|
1292 |
+
*
|
1293 |
+
* @param methodName 'option'
|
1294 |
+
* @param optionName 'buttonImageOnly'
|
1295 |
+
*/
|
1296 |
+
datepicker(methodName: 'option', optionName: 'buttonImageOnly'): boolean;
|
1297 |
+
/**
|
1298 |
+
* Set the buttonImageOnly option, after initialization
|
1299 |
+
*
|
1300 |
+
* @param methodName 'option'
|
1301 |
+
* @param optionName 'buttonImageOnly'
|
1302 |
+
* @param buttonImageOnlyValue Whether the button image should be rendered by itself instead of inside a button element. This option is only relevant if the buttonImage option has also been set.
|
1303 |
+
*/
|
1304 |
+
datepicker(methodName: 'option', optionName: 'buttonImageOnly', buttonImageOnlyValue: boolean): JQuery;
|
1305 |
+
|
1306 |
+
/**
|
1307 |
+
* Get the buttonText option, after initialization
|
1308 |
+
*
|
1309 |
+
* @param methodName 'option'
|
1310 |
+
* @param optionName 'buttonText'
|
1311 |
+
*/
|
1312 |
+
datepicker(methodName: 'option', optionName: 'buttonText'): string;
|
1313 |
+
/**
|
1314 |
+
* Set the buttonText option, after initialization
|
1315 |
+
*
|
1316 |
+
* @param methodName 'option'
|
1317 |
+
* @param optionName 'buttonText'
|
1318 |
+
* @param buttonTextValue The text to display on the trigger button. Use in conjunction with the showOn option set to "button" or "both".
|
1319 |
+
*/
|
1320 |
+
datepicker(methodName: 'option', optionName: 'buttonText', buttonTextValue: string): JQuery;
|
1321 |
+
|
1322 |
+
/**
|
1323 |
+
* Get the calculateWeek option, after initialization
|
1324 |
+
*
|
1325 |
+
* @param methodName 'option'
|
1326 |
+
* @param optionName 'calculateWeek'
|
1327 |
+
*/
|
1328 |
+
datepicker(methodName: 'option', optionName: 'calculateWeek'): (date: Date) => string;
|
1329 |
+
/**
|
1330 |
+
* Set the calculateWeek option, after initialization
|
1331 |
+
*
|
1332 |
+
* @param methodName 'option'
|
1333 |
+
* @param optionName 'calculateWeek'
|
1334 |
+
* @param calculateWeekValue A function to calculate the week of the year for a given date. The default implementation uses the ISO 8601 definition: weeks start on a Monday; the first week of the year contains the first Thursday of the year.
|
1335 |
+
*/
|
1336 |
+
datepicker(methodName: 'option', optionName: 'calculateWeek', calculateWeekValue: (date: Date) => string): JQuery;
|
1337 |
+
|
1338 |
+
/**
|
1339 |
+
* Get the changeMonth option, after initialization
|
1340 |
+
*
|
1341 |
+
* @param methodName 'option'
|
1342 |
+
* @param optionName 'changeMonth'
|
1343 |
+
*/
|
1344 |
+
datepicker(methodName: 'option', optionName: 'changeMonth'): boolean;
|
1345 |
+
/**
|
1346 |
+
* Set the changeMonth option, after initialization
|
1347 |
+
*
|
1348 |
+
* @param methodName 'option'
|
1349 |
+
* @param optionName 'changeMonth'
|
1350 |
+
* @param changeMonthValue Whether the month should be rendered as a dropdown instead of text.
|
1351 |
+
*/
|
1352 |
+
datepicker(methodName: 'option', optionName: 'changeMonth', changeMonthValue: boolean): JQuery;
|
1353 |
+
|
1354 |
+
/**
|
1355 |
+
* Get the changeYear option, after initialization
|
1356 |
+
*
|
1357 |
+
* @param methodName 'option'
|
1358 |
+
* @param optionName 'changeYear'
|
1359 |
+
*/
|
1360 |
+
datepicker(methodName: 'option', optionName: 'changeYear'): boolean;
|
1361 |
+
/**
|
1362 |
+
* Set the changeYear option, after initialization
|
1363 |
+
*
|
1364 |
+
* @param methodName 'option'
|
1365 |
+
* @param optionName 'changeYear'
|
1366 |
+
* @param changeYearValue Whether the year should be rendered as a dropdown instead of text. Use the yearRange option to control which years are made available for selection.
|
1367 |
+
*/
|
1368 |
+
datepicker(methodName: 'option', optionName: 'changeYear', changeYearValue: boolean): JQuery;
|
1369 |
+
|
1370 |
+
/**
|
1371 |
+
* Get the closeText option, after initialization
|
1372 |
+
*
|
1373 |
+
* @param methodName 'option'
|
1374 |
+
* @param optionName 'closeText'
|
1375 |
+
*/
|
1376 |
+
datepicker(methodName: 'option', optionName: 'closeText'): string;
|
1377 |
+
/**
|
1378 |
+
* Set the closeText option, after initialization
|
1379 |
+
*
|
1380 |
+
* @param methodName 'option'
|
1381 |
+
* @param optionName 'closeText'
|
1382 |
+
* @param closeTextValue The text to display for the close link. Use the showButtonPanel option to display this button.
|
1383 |
+
*/
|
1384 |
+
datepicker(methodName: 'option', optionName: 'closeText', closeTextValue: string): JQuery;
|
1385 |
+
|
1386 |
+
/**
|
1387 |
+
* Get the constrainInput option, after initialization
|
1388 |
+
*
|
1389 |
+
* @param methodName 'option'
|
1390 |
+
* @param optionName 'constrainInput'
|
1391 |
+
*/
|
1392 |
+
datepicker(methodName: 'option', optionName: 'constrainInput'): boolean;
|
1393 |
+
/**
|
1394 |
+
* Set the constrainInput option, after initialization
|
1395 |
+
*
|
1396 |
+
* @param methodName 'option'
|
1397 |
+
* @param optionName 'constrainInput'
|
1398 |
+
* @param constrainInputValue When true, entry in the input field is constrained to those characters allowed by the current dateFormat option.
|
1399 |
+
*/
|
1400 |
+
datepicker(methodName: 'option', optionName: 'constrainInput', constrainInputValue: boolean): JQuery;
|
1401 |
+
|
1402 |
+
/**
|
1403 |
+
* Get the currentText option, after initialization
|
1404 |
+
*
|
1405 |
+
* @param methodName 'option'
|
1406 |
+
* @param optionName 'currentText'
|
1407 |
+
*/
|
1408 |
+
datepicker(methodName: 'option', optionName: 'currentText'): string;
|
1409 |
+
/**
|
1410 |
+
* Set the currentText option, after initialization
|
1411 |
+
*
|
1412 |
+
* @param methodName 'option'
|
1413 |
+
* @param optionName 'currentText'
|
1414 |
+
* @param currentTextValue The text to display for the current day link. Use the showButtonPanel option to display this button.
|
1415 |
+
*/
|
1416 |
+
datepicker(methodName: 'option', optionName: 'currentText', currentTextValue: string): JQuery;
|
1417 |
+
|
1418 |
+
/**
|
1419 |
+
* Get the dateFormat option, after initialization
|
1420 |
+
*
|
1421 |
+
* @param methodName 'option'
|
1422 |
+
* @param optionName 'dateFormat'
|
1423 |
+
*/
|
1424 |
+
datepicker(methodName: 'option', optionName: 'dateFormat'): string;
|
1425 |
+
/**
|
1426 |
+
* Set the dateFormat option, after initialization
|
1427 |
+
*
|
1428 |
+
* @param methodName 'option'
|
1429 |
+
* @param optionName 'dateFormat'
|
1430 |
+
* @param dateFormatValue The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function.
|
1431 |
+
*/
|
1432 |
+
datepicker(methodName: 'option', optionName: 'dateFormat', dateFormatValue: string): JQuery;
|
1433 |
+
|
1434 |
+
/**
|
1435 |
+
* Get the dayNames option, after initialization
|
1436 |
+
*
|
1437 |
+
* @param methodName 'option'
|
1438 |
+
* @param optionName 'dayNames'
|
1439 |
+
*/
|
1440 |
+
datepicker(methodName: 'option', optionName: 'dayNames'): string[];
|
1441 |
+
/**
|
1442 |
+
* Set the dayNames option, after initialization
|
1443 |
+
*
|
1444 |
+
* @param methodName 'option'
|
1445 |
+
* @param optionName 'dayNames'
|
1446 |
+
* @param dayNamesValue The list of long day names, starting from Sunday, for use as requested via the dateFormat option.
|
1447 |
+
*/
|
1448 |
+
datepicker(methodName: 'option', optionName: 'dayNames', dayNamesValue: string[]): JQuery;
|
1449 |
+
|
1450 |
+
/**
|
1451 |
+
* Get the dayNamesMin option, after initialization
|
1452 |
+
*
|
1453 |
+
* @param methodName 'option'
|
1454 |
+
* @param optionName 'dayNamesMin'
|
1455 |
+
*/
|
1456 |
+
datepicker(methodName: 'option', optionName: 'dayNamesMin'): string[];
|
1457 |
+
/**
|
1458 |
+
* Set the dayNamesMin option, after initialization
|
1459 |
+
*
|
1460 |
+
* @param methodName 'option'
|
1461 |
+
* @param optionName 'dayNamesMin'
|
1462 |
+
* @param dayNamesMinValue The list of minimised day names, starting from Sunday, for use as column headers within the datepicker.
|
1463 |
+
*/
|
1464 |
+
datepicker(methodName: 'option', optionName: 'dayNamesMin', dayNamesMinValue: string[]): JQuery;
|
1465 |
+
|
1466 |
+
/**
|
1467 |
+
* Get the dayNamesShort option, after initialization
|
1468 |
+
*
|
1469 |
+
* @param methodName 'option'
|
1470 |
+
* @param optionName 'dayNamesShort'
|
1471 |
+
*/
|
1472 |
+
datepicker(methodName: 'option', optionName: 'dayNamesShort'): string[];
|
1473 |
+
/**
|
1474 |
+
* Set the dayNamesShort option, after initialization
|
1475 |
+
*
|
1476 |
+
* @param methodName 'option'
|
1477 |
+
* @param optionName 'dayNamesShort'
|
1478 |
+
* @param dayNamesShortValue The list of abbreviated day names, starting from Sunday, for use as requested via the dateFormat option.
|
1479 |
+
*/
|
1480 |
+
datepicker(methodName: 'option', optionName: 'dayNamesShort', dayNamesShortValue: string[]): JQuery;
|
1481 |
+
|
1482 |
+
/**
|
1483 |
+
* Get the defaultDate option, after initialization
|
1484 |
+
*
|
1485 |
+
* @param methodName 'option'
|
1486 |
+
* @param optionName 'defaultDate'
|
1487 |
+
*/
|
1488 |
+
datepicker(methodName: 'option', optionName: 'defaultDate'): any;
|
1489 |
+
/**
|
1490 |
+
* Set the defaultDate option, after initialization
|
1491 |
+
*
|
1492 |
+
* @param methodName 'option'
|
1493 |
+
* @param optionName 'defaultDate'
|
1494 |
+
* @param defaultDateValue A date object containing the default date.
|
1495 |
+
*/
|
1496 |
+
datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: Date): JQuery;
|
1497 |
+
/**
|
1498 |
+
* Set the defaultDate option, after initialization
|
1499 |
+
*
|
1500 |
+
* @param methodName 'option'
|
1501 |
+
* @param optionName 'defaultDate'
|
1502 |
+
* @param defaultDateValue A number of days from today. For example 2 represents two days from today and -1 represents yesterday.
|
1503 |
+
*/
|
1504 |
+
datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: number): JQuery;
|
1505 |
+
/**
|
1506 |
+
* Set the defaultDate option, after initialization
|
1507 |
+
*
|
1508 |
+
* @param methodName 'option'
|
1509 |
+
* @param optionName 'defaultDate'
|
1510 |
+
* @param defaultDateValue A string in the format defined by the dateFormat option, or a relative date. Relative dates must contain value and period pairs; valid periods are "y" for years, "m" for months, "w" for weeks, and "d" for days. For example, "+1m +7d" represents one month and seven days from today.
|
1511 |
+
*/
|
1512 |
+
datepicker(methodName: 'option', optionName: 'defaultDate', defaultDateValue: string): JQuery;
|
1513 |
+
|
1514 |
+
/**
|
1515 |
+
* Get the duration option, after initialization
|
1516 |
+
*
|
1517 |
+
* @param methodName 'option'
|
1518 |
+
* @param optionName 'duration'
|
1519 |
+
*/
|
1520 |
+
datepicker(methodName: 'option', optionName: 'duration'): string;
|
1521 |
+
/**
|
1522 |
+
* Set the duration option, after initialization
|
1523 |
+
*
|
1524 |
+
* @param methodName 'option'
|
1525 |
+
* @param optionName 'duration'
|
1526 |
+
* @param durationValue Control the speed at which the datepicker appears, it may be a time in milliseconds or a string representing one of the three predefined speeds ("slow", "normal", "fast").
|
1527 |
+
*/
|
1528 |
+
datepicker(methodName: 'option', optionName: 'duration', durationValue: string): JQuery;
|
1529 |
+
|
1530 |
+
/**
|
1531 |
+
* Get the firstDay option, after initialization
|
1532 |
+
*
|
1533 |
+
* @param methodName 'option'
|
1534 |
+
* @param optionName 'firstDay'
|
1535 |
+
*/
|
1536 |
+
datepicker(methodName: 'option', optionName: 'firstDay'): number;
|
1537 |
+
/**
|
1538 |
+
* Set the firstDay option, after initialization
|
1539 |
+
*
|
1540 |
+
* @param methodName 'option'
|
1541 |
+
* @param optionName 'firstDay'
|
1542 |
+
* @param firstDayValue Set the first day of the week: Sunday is 0, Monday is 1, etc.
|
1543 |
+
*/
|
1544 |
+
datepicker(methodName: 'option', optionName: 'firstDay', firstDayValue: number): JQuery;
|
1545 |
+
|
1546 |
+
/**
|
1547 |
+
* Get the gotoCurrent option, after initialization
|
1548 |
+
*
|
1549 |
+
* @param methodName 'option'
|
1550 |
+
* @param optionName 'gotoCurrent'
|
1551 |
+
*/
|
1552 |
+
datepicker(methodName: 'option', optionName: 'gotoCurrent'): boolean;
|
1553 |
+
/**
|
1554 |
+
* Set the gotoCurrent option, after initialization
|
1555 |
+
*
|
1556 |
+
* @param methodName 'option'
|
1557 |
+
* @param optionName 'gotoCurrent'
|
1558 |
+
* @param gotoCurrentValue When true, the current day link moves to the currently selected date instead of today.
|
1559 |
+
*/
|
1560 |
+
datepicker(methodName: 'option', optionName: 'gotoCurrent', gotoCurrentValue: boolean): JQuery;
|
1561 |
+
|
1562 |
+
/**
|
1563 |
+
* Gets the value currently associated with the specified optionName.
|
1564 |
+
*
|
1565 |
+
* @param methodName 'option'
|
1566 |
+
* @param optionName The name of the option to get.
|
1567 |
+
*/
|
1568 |
+
datepicker(methodName: 'option', optionName: string): any;
|
1569 |
+
|
1570 |
+
datepicker(methodName: 'option', optionName: string, ...otherParams: any[]): any; // Used for getting and setting options
|
1571 |
+
|
1572 |
+
datepicker(methodName: string, ...otherParams: any[]): any;
|
1573 |
+
|
1574 |
+
/**
|
1575 |
+
* Initialize a datepicker with the given options
|
1576 |
+
*/
|
1577 |
+
datepicker(options: JQueryUI.DatepickerOptions): JQuery;
|
1578 |
+
|
1579 |
+
dialog(): JQuery;
|
1580 |
+
dialog(methodName: 'close'): JQuery;
|
1581 |
+
dialog(methodName: 'destroy'): JQuery;
|
1582 |
+
dialog(methodName: 'isOpen'): boolean;
|
1583 |
+
dialog(methodName: 'moveToTop'): JQuery;
|
1584 |
+
dialog(methodName: 'open'): JQuery;
|
1585 |
+
dialog(methodName: 'widget'): JQuery;
|
1586 |
+
dialog(methodName: string): JQuery;
|
1587 |
+
dialog(options: JQueryUI.DialogOptions): JQuery;
|
1588 |
+
dialog(optionLiteral: string, optionName: string): any;
|
1589 |
+
dialog(optionLiteral: string, options: JQueryUI.DialogOptions): any;
|
1590 |
+
dialog(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1591 |
+
|
1592 |
+
draggable(): JQuery;
|
1593 |
+
draggable(methodName: 'destroy'): void;
|
1594 |
+
draggable(methodName: 'disable'): void;
|
1595 |
+
draggable(methodName: 'enable'): void;
|
1596 |
+
draggable(methodName: 'widget'): JQuery;
|
1597 |
+
draggable(methodName: string): JQuery;
|
1598 |
+
draggable(options: JQueryUI.DraggableOptions): JQuery;
|
1599 |
+
draggable(optionLiteral: string, optionName: string): any;
|
1600 |
+
draggable(optionLiteral: string, options: JQueryUI.DraggableOptions): any;
|
1601 |
+
draggable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1602 |
+
|
1603 |
+
droppable(): JQuery;
|
1604 |
+
droppable(methodName: 'destroy'): void;
|
1605 |
+
droppable(methodName: 'disable'): void;
|
1606 |
+
droppable(methodName: 'enable'): void;
|
1607 |
+
droppable(methodName: 'widget'): JQuery;
|
1608 |
+
droppable(methodName: string): JQuery;
|
1609 |
+
droppable(options: JQueryUI.DroppableOptions): JQuery;
|
1610 |
+
droppable(optionLiteral: string, optionName: string): any;
|
1611 |
+
droppable(optionLiteral: string, options: JQueryUI.DraggableOptions): any;
|
1612 |
+
droppable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1613 |
+
|
1614 |
+
menu: {
|
1615 |
+
(): JQuery;
|
1616 |
+
(methodName: 'blur'): void;
|
1617 |
+
(methodName: 'collapse', event?: JQueryEventObject): void;
|
1618 |
+
(methodName: 'collapseAll', event?: JQueryEventObject, all?: boolean): void;
|
1619 |
+
(methodName: 'destroy'): void;
|
1620 |
+
(methodName: 'disable'): void;
|
1621 |
+
(methodName: 'enable'): void;
|
1622 |
+
(methodName: string, event: JQueryEventObject, item: JQuery): void;
|
1623 |
+
(methodName: 'focus', event: JQueryEventObject, item: JQuery): void;
|
1624 |
+
(methodName: 'isFirstItem'): boolean;
|
1625 |
+
(methodName: 'isLastItem'): boolean;
|
1626 |
+
(methodName: 'next', event?: JQueryEventObject): void;
|
1627 |
+
(methodName: 'nextPage', event?: JQueryEventObject): void;
|
1628 |
+
(methodName: 'previous', event?: JQueryEventObject): void;
|
1629 |
+
(methodName: 'previousPage', event?: JQueryEventObject): void;
|
1630 |
+
(methodName: 'refresh'): void;
|
1631 |
+
(methodName: 'select', event?: JQueryEventObject): void;
|
1632 |
+
(methodName: 'widget'): JQuery;
|
1633 |
+
(methodName: string): JQuery;
|
1634 |
+
(options: JQueryUI.MenuOptions): JQuery;
|
1635 |
+
(optionLiteral: string, optionName: string): any;
|
1636 |
+
(optionLiteral: string, options: JQueryUI.MenuOptions): any;
|
1637 |
+
(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1638 |
+
active: boolean;
|
1639 |
+
}
|
1640 |
+
|
1641 |
+
progressbar(): JQuery;
|
1642 |
+
progressbar(methodName: 'destroy'): void;
|
1643 |
+
progressbar(methodName: 'disable'): void;
|
1644 |
+
progressbar(methodName: 'enable'): void;
|
1645 |
+
progressbar(methodName: 'refresh'): void;
|
1646 |
+
progressbar(methodName: 'value'): any; // number or boolean
|
1647 |
+
progressbar(methodName: 'value', value: number): void;
|
1648 |
+
progressbar(methodName: 'value', value: boolean): void;
|
1649 |
+
progressbar(methodName: 'widget'): JQuery;
|
1650 |
+
progressbar(methodName: string): JQuery;
|
1651 |
+
progressbar(options: JQueryUI.ProgressbarOptions): JQuery;
|
1652 |
+
progressbar(optionLiteral: string, optionName: string): any;
|
1653 |
+
progressbar(optionLiteral: string, options: JQueryUI.ProgressbarOptions): any;
|
1654 |
+
progressbar(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1655 |
+
|
1656 |
+
resizable(): JQuery;
|
1657 |
+
resizable(methodName: 'destroy'): void;
|
1658 |
+
resizable(methodName: 'disable'): void;
|
1659 |
+
resizable(methodName: 'enable'): void;
|
1660 |
+
resizable(methodName: 'widget'): JQuery;
|
1661 |
+
resizable(methodName: string): JQuery;
|
1662 |
+
resizable(options: JQueryUI.ResizableOptions): JQuery;
|
1663 |
+
resizable(optionLiteral: string, optionName: string): any;
|
1664 |
+
resizable(optionLiteral: string, options: JQueryUI.ResizableOptions): any;
|
1665 |
+
resizable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1666 |
+
|
1667 |
+
selectable(): JQuery;
|
1668 |
+
selectable(methodName: 'destroy'): void;
|
1669 |
+
selectable(methodName: 'disable'): void;
|
1670 |
+
selectable(methodName: 'enable'): void;
|
1671 |
+
selectable(methodName: 'widget'): JQuery;
|
1672 |
+
selectable(methodName: string): JQuery;
|
1673 |
+
selectable(options: JQueryUI.SelectableOptions): JQuery;
|
1674 |
+
selectable(optionLiteral: string, optionName: string): any;
|
1675 |
+
selectable(optionLiteral: string, options: JQueryUI.SelectableOptions): any;
|
1676 |
+
selectable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1677 |
+
|
1678 |
+
slider(): JQuery;
|
1679 |
+
slider(methodName: 'destroy'): void;
|
1680 |
+
slider(methodName: 'disable'): void;
|
1681 |
+
slider(methodName: 'enable'): void;
|
1682 |
+
slider(methodName: 'refresh'): void;
|
1683 |
+
slider(methodName: 'value'): number;
|
1684 |
+
slider(methodName: 'value', value: number): void;
|
1685 |
+
slider(methodName: 'values'): Array<number>;
|
1686 |
+
slider(methodName: 'values', index: number): number;
|
1687 |
+
slider(methodName: string, index: number, value: number): void;
|
1688 |
+
slider(methodName: 'values', index: number, value: number): void;
|
1689 |
+
slider(methodName: string, values: Array<number>): void;
|
1690 |
+
slider(methodName: 'values', values: Array<number>): void;
|
1691 |
+
slider(methodName: 'widget'): JQuery;
|
1692 |
+
slider(methodName: string): JQuery;
|
1693 |
+
slider(options: JQueryUI.SliderOptions): JQuery;
|
1694 |
+
slider(optionLiteral: string, optionName: string): any;
|
1695 |
+
slider(optionLiteral: string, options: JQueryUI.SliderOptions): any;
|
1696 |
+
slider(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1697 |
+
|
1698 |
+
sortable(): JQuery;
|
1699 |
+
sortable(methodName: 'destroy'): void;
|
1700 |
+
sortable(methodName: 'disable'): void;
|
1701 |
+
sortable(methodName: 'enable'): void;
|
1702 |
+
sortable(methodName: 'widget'): JQuery;
|
1703 |
+
sortable(methodName: 'toArray'): string[];
|
1704 |
+
sortable(methodName: string): JQuery;
|
1705 |
+
sortable(options: JQueryUI.SortableOptions): JQuery;
|
1706 |
+
sortable(optionLiteral: string, optionName: string): any;
|
1707 |
+
sortable(methodName: 'serialize', options?: { key?: string; attribute?: string; expression?: RegExp }): string;
|
1708 |
+
sortable(optionLiteral: string, options: JQueryUI.SortableOptions): any;
|
1709 |
+
sortable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1710 |
+
|
1711 |
+
spinner(): JQuery;
|
1712 |
+
spinner(methodName: 'destroy'): void;
|
1713 |
+
spinner(methodName: 'disable'): void;
|
1714 |
+
spinner(methodName: 'enable'): void;
|
1715 |
+
spinner(methodName: 'pageDown', pages?: number): void;
|
1716 |
+
spinner(methodName: 'pageUp', pages?: number): void;
|
1717 |
+
spinner(methodName: 'stepDown', steps?: number): void;
|
1718 |
+
spinner(methodName: 'stepUp', steps?: number): void;
|
1719 |
+
spinner(methodName: 'value'): number;
|
1720 |
+
spinner(methodName: 'value', value: number): void;
|
1721 |
+
spinner(methodName: 'widget'): JQuery;
|
1722 |
+
spinner(methodName: string): JQuery;
|
1723 |
+
spinner(options: JQueryUI.SpinnerOptions): JQuery;
|
1724 |
+
spinner(optionLiteral: string, optionName: string): any;
|
1725 |
+
spinner(optionLiteral: string, options: JQueryUI.SpinnerOptions): any;
|
1726 |
+
spinner(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1727 |
+
|
1728 |
+
tabs(): JQuery;
|
1729 |
+
tabs(methodName: 'destroy'): void;
|
1730 |
+
tabs(methodName: 'disable'): void;
|
1731 |
+
tabs(methodName: 'enable'): void;
|
1732 |
+
tabs(methodName: 'load', index: number): void;
|
1733 |
+
tabs(methodName: 'refresh'): void;
|
1734 |
+
tabs(methodName: 'widget'): JQuery;
|
1735 |
+
tabs(methodName: string): JQuery;
|
1736 |
+
tabs(options: JQueryUI.TabsOptions): JQuery;
|
1737 |
+
tabs(optionLiteral: string, optionName: string): any;
|
1738 |
+
tabs(optionLiteral: string, options: JQueryUI.TabsOptions): any;
|
1739 |
+
tabs(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1740 |
+
|
1741 |
+
tooltip(): JQuery;
|
1742 |
+
tooltip(methodName: 'destroy'): void;
|
1743 |
+
tooltip(methodName: 'disable'): void;
|
1744 |
+
tooltip(methodName: 'enable'): void;
|
1745 |
+
tooltip(methodName: 'open'): void;
|
1746 |
+
tooltip(methodName: 'close'): void;
|
1747 |
+
tooltip(methodName: 'widget'): JQuery;
|
1748 |
+
tooltip(methodName: string): JQuery;
|
1749 |
+
tooltip(options: JQueryUI.TooltipOptions): JQuery;
|
1750 |
+
tooltip(optionLiteral: string, optionName: string): any;
|
1751 |
+
tooltip(optionLiteral: string, options: JQueryUI.TooltipOptions): any;
|
1752 |
+
tooltip(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
1753 |
+
|
1754 |
+
|
1755 |
+
addClass(classNames: string, speed?: number, callback?: Function): JQuery;
|
1756 |
+
addClass(classNames: string, speed?: string, callback?: Function): JQuery;
|
1757 |
+
addClass(classNames: string, speed?: number, easing?: string, callback?: Function): JQuery;
|
1758 |
+
addClass(classNames: string, speed?: string, easing?: string, callback?: Function): JQuery;
|
1759 |
+
|
1760 |
+
removeClass(classNames: string, speed?: number, callback?: Function): JQuery;
|
1761 |
+
removeClass(classNames: string, speed?: string, callback?: Function): JQuery;
|
1762 |
+
removeClass(classNames: string, speed?: number, easing?: string, callback?: Function): JQuery;
|
1763 |
+
removeClass(classNames: string, speed?: string, easing?: string, callback?: Function): JQuery;
|
1764 |
+
|
1765 |
+
switchClass(removeClassName: string, addClassName: string, duration?: number, easing?: string, complete?: Function): JQuery;
|
1766 |
+
switchClass(removeClassName: string, addClassName: string, duration?: string, easing?: string, complete?: Function): JQuery;
|
1767 |
+
|
1768 |
+
toggleClass(className: string, duration?: number, easing?: string, complete?: Function): JQuery;
|
1769 |
+
toggleClass(className: string, duration?: string, easing?: string, complete?: Function): JQuery;
|
1770 |
+
toggleClass(className: string, aswitch?: boolean, duration?: number, easing?: string, complete?: Function): JQuery;
|
1771 |
+
toggleClass(className: string, aswitch?: boolean, duration?: string, easing?: string, complete?: Function): JQuery;
|
1772 |
+
|
1773 |
+
effect(options: any): JQuery;
|
1774 |
+
effect(effect: string, options?: any, duration?: number, complete?: Function): JQuery;
|
1775 |
+
effect(effect: string, options?: any, duration?: string, complete?: Function): JQuery;
|
1776 |
+
|
1777 |
+
hide(options: any): JQuery;
|
1778 |
+
hide(effect: string, options?: any, duration?: number, complete?: Function): JQuery;
|
1779 |
+
hide(effect: string, options?: any, duration?: string, complete?: Function): JQuery;
|
1780 |
+
|
1781 |
+
show(options: any): JQuery;
|
1782 |
+
show(effect: string, options?: any, duration?: number, complete?: Function): JQuery;
|
1783 |
+
show(effect: string, options?: any, duration?: string, complete?: Function): JQuery;
|
1784 |
+
|
1785 |
+
toggle(options: any): JQuery;
|
1786 |
+
toggle(effect: string, options?: any, duration?: number, complete?: Function): JQuery;
|
1787 |
+
toggle(effect: string, options?: any, duration?: string, complete?: Function): JQuery;
|
1788 |
+
|
1789 |
+
position(options: JQueryUI.JQueryPositionOptions): JQuery;
|
1790 |
+
|
1791 |
+
enableSelection(): JQuery;
|
1792 |
+
disableSelection(): JQuery;
|
1793 |
+
focus(delay: number, callback?: Function): JQuery;
|
1794 |
+
uniqueId(): JQuery;
|
1795 |
+
removeUniqueId(): JQuery;
|
1796 |
+
scrollParent(): JQuery;
|
1797 |
+
zIndex(): JQuery;
|
1798 |
+
zIndex(zIndex: number): JQuery;
|
1799 |
+
|
1800 |
+
widget: JQueryUI.Widget;
|
1801 |
+
|
1802 |
+
jQuery: JQueryStatic;
|
1803 |
+
}
|
1804 |
+
|
1805 |
+
interface JQueryStatic {
|
1806 |
+
ui: JQueryUI.UI;
|
1807 |
+
datepicker: JQueryUI.Datepicker;
|
1808 |
+
widget: JQueryUI.Widget;
|
1809 |
+
Widget: JQueryUI.Widget;
|
1810 |
+
}
|
1811 |
+
|
1812 |
+
interface JQueryEasingFunctions {
|
1813 |
+
easeInQuad: JQueryEasingFunction;
|
1814 |
+
easeOutQuad: JQueryEasingFunction;
|
1815 |
+
easeInOutQuad: JQueryEasingFunction;
|
1816 |
+
easeInCubic: JQueryEasingFunction;
|
1817 |
+
easeOutCubic: JQueryEasingFunction;
|
1818 |
+
easeInOutCubic: JQueryEasingFunction;
|
1819 |
+
easeInQuart: JQueryEasingFunction;
|
1820 |
+
easeOutQuart: JQueryEasingFunction;
|
1821 |
+
easeInOutQuart: JQueryEasingFunction;
|
1822 |
+
easeInQuint: JQueryEasingFunction;
|
1823 |
+
easeOutQuint: JQueryEasingFunction;
|
1824 |
+
easeInOutQuint: JQueryEasingFunction;
|
1825 |
+
easeInExpo: JQueryEasingFunction;
|
1826 |
+
easeOutExpo: JQueryEasingFunction;
|
1827 |
+
easeInOutExpo: JQueryEasingFunction;
|
1828 |
+
easeInSine: JQueryEasingFunction;
|
1829 |
+
easeOutSine: JQueryEasingFunction;
|
1830 |
+
easeInOutSine: JQueryEasingFunction;
|
1831 |
+
easeInCirc: JQueryEasingFunction;
|
1832 |
+
easeOutCirc: JQueryEasingFunction;
|
1833 |
+
easeInOutCirc: JQueryEasingFunction;
|
1834 |
+
easeInElastic: JQueryEasingFunction;
|
1835 |
+
easeOutElastic: JQueryEasingFunction;
|
1836 |
+
easeInOutElastic: JQueryEasingFunction;
|
1837 |
+
easeInBack: JQueryEasingFunction;
|
1838 |
+
easeOutBack: JQueryEasingFunction;
|
1839 |
+
easeInOutBack: JQueryEasingFunction;
|
1840 |
+
easeInBounce: JQueryEasingFunction;
|
1841 |
+
easeOutBounce: JQueryEasingFunction;
|
1842 |
+
easeInOutBounce: JQueryEasingFunction;
|
1843 |
+
}
|
js/lodash-3.10.d.ts
CHANGED
@@ -7329,7 +7329,7 @@ declare module _ {
|
|
7329 |
*/
|
7330 |
pluck<T extends {}>(
|
7331 |
collection: List<T>|Dictionary<T>,
|
7332 |
-
path: StringRepresentable|StringRepresentable[]
|
7333 |
): any[];
|
7334 |
|
7335 |
/**
|
@@ -7337,7 +7337,7 @@ declare module _ {
|
|
7337 |
*/
|
7338 |
pluck<T extends {}, TResult>(
|
7339 |
collection: List<T>|Dictionary<T>,
|
7340 |
-
path: StringRepresentable|StringRepresentable[]
|
7341 |
): TResult[];
|
7342 |
}
|
7343 |
|
@@ -7345,28 +7345,28 @@ declare module _ {
|
|
7345 |
/**
|
7346 |
* @see _.pluck
|
7347 |
*/
|
7348 |
-
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashImplicitArrayWrapper<TResult>;
|
7349 |
}
|
7350 |
|
7351 |
interface LoDashImplicitObjectWrapper<T> {
|
7352 |
/**
|
7353 |
* @see _.pluck
|
7354 |
*/
|
7355 |
-
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashImplicitArrayWrapper<TResult>;
|
7356 |
}
|
7357 |
|
7358 |
interface LoDashExplicitArrayWrapper<T> {
|
7359 |
/**
|
7360 |
* @see _.pluck
|
7361 |
*/
|
7362 |
-
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashExplicitArrayWrapper<TResult>;
|
7363 |
}
|
7364 |
|
7365 |
interface LoDashExplicitObjectWrapper<T> {
|
7366 |
/**
|
7367 |
* @see _.pluck
|
7368 |
*/
|
7369 |
-
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashExplicitArrayWrapper<TResult>;
|
7370 |
}
|
7371 |
|
7372 |
//_.reduce
|
@@ -12697,7 +12697,7 @@ declare module _ {
|
|
12697 |
*/
|
12698 |
has<T extends {}>(
|
12699 |
object: T,
|
12700 |
-
path: StringRepresentable|StringRepresentable[]
|
12701 |
): boolean;
|
12702 |
}
|
12703 |
|
@@ -12705,14 +12705,14 @@ declare module _ {
|
|
12705 |
/**
|
12706 |
* @see _.has
|
12707 |
*/
|
12708 |
-
has(path: StringRepresentable|StringRepresentable[]): boolean;
|
12709 |
}
|
12710 |
|
12711 |
interface LoDashExplicitObjectWrapper<T> {
|
12712 |
/**
|
12713 |
* @see _.has
|
12714 |
*/
|
12715 |
-
has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>;
|
12716 |
}
|
12717 |
|
12718 |
//_.invert
|
@@ -13192,7 +13192,7 @@ declare module _ {
|
|
13192 |
* @see _.omit
|
13193 |
*/
|
13194 |
omit<TResult extends {}>(
|
13195 |
-
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13196 |
): LoDashImplicitObjectWrapper<TResult>;
|
13197 |
}
|
13198 |
|
@@ -13209,7 +13209,7 @@ declare module _ {
|
|
13209 |
* @see _.omit
|
13210 |
*/
|
13211 |
omit<TResult extends {}>(
|
13212 |
-
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13213 |
): LoDashExplicitObjectWrapper<TResult>;
|
13214 |
}
|
13215 |
|
@@ -13282,7 +13282,7 @@ declare module _ {
|
|
13282 |
* @see _.pick
|
13283 |
*/
|
13284 |
pick<TResult extends {}>(
|
13285 |
-
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13286 |
): LoDashImplicitObjectWrapper<TResult>;
|
13287 |
}
|
13288 |
|
@@ -13299,7 +13299,7 @@ declare module _ {
|
|
13299 |
* @see _.pick
|
13300 |
*/
|
13301 |
pick<TResult extends {}>(
|
13302 |
-
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13303 |
): LoDashExplicitObjectWrapper<TResult>;
|
13304 |
}
|
13305 |
|
@@ -13343,7 +13343,7 @@ declare module _ {
|
|
13343 |
*/
|
13344 |
set<T>(
|
13345 |
object: T,
|
13346 |
-
path: StringRepresentable|StringRepresentable[],
|
13347 |
value: any
|
13348 |
): T;
|
13349 |
|
@@ -13352,7 +13352,7 @@ declare module _ {
|
|
13352 |
*/
|
13353 |
set<V, T>(
|
13354 |
object: T,
|
13355 |
-
path: StringRepresentable|StringRepresentable[],
|
13356 |
value: V
|
13357 |
): T;
|
13358 |
}
|
@@ -13362,7 +13362,7 @@ declare module _ {
|
|
13362 |
* @see _.set
|
13363 |
*/
|
13364 |
set<V>(
|
13365 |
-
path: StringRepresentable|StringRepresentable[],
|
13366 |
value: V
|
13367 |
): LoDashImplicitObjectWrapper<T>;
|
13368 |
}
|
@@ -13372,7 +13372,7 @@ declare module _ {
|
|
13372 |
* @see _.set
|
13373 |
*/
|
13374 |
set<V>(
|
13375 |
-
path: StringRepresentable|StringRepresentable[],
|
13376 |
value: V
|
13377 |
): LoDashExplicitObjectWrapper<T>;
|
13378 |
}
|
7329 |
*/
|
7330 |
pluck<T extends {}>(
|
7331 |
collection: List<T>|Dictionary<T>,
|
7332 |
+
path: string|StringRepresentable|StringRepresentable[]
|
7333 |
): any[];
|
7334 |
|
7335 |
/**
|
7337 |
*/
|
7338 |
pluck<T extends {}, TResult>(
|
7339 |
collection: List<T>|Dictionary<T>,
|
7340 |
+
path: string|StringRepresentable|StringRepresentable[]
|
7341 |
): TResult[];
|
7342 |
}
|
7343 |
|
7345 |
/**
|
7346 |
* @see _.pluck
|
7347 |
*/
|
7348 |
+
pluck<TResult>(path: string|StringRepresentable|StringRepresentable[]): LoDashImplicitArrayWrapper<TResult>;
|
7349 |
}
|
7350 |
|
7351 |
interface LoDashImplicitObjectWrapper<T> {
|
7352 |
/**
|
7353 |
* @see _.pluck
|
7354 |
*/
|
7355 |
+
pluck<TResult>(path: string|StringRepresentable|StringRepresentable[]): LoDashImplicitArrayWrapper<TResult>;
|
7356 |
}
|
7357 |
|
7358 |
interface LoDashExplicitArrayWrapper<T> {
|
7359 |
/**
|
7360 |
* @see _.pluck
|
7361 |
*/
|
7362 |
+
pluck<TResult>(path: string|StringRepresentable|StringRepresentable[]): LoDashExplicitArrayWrapper<TResult>;
|
7363 |
}
|
7364 |
|
7365 |
interface LoDashExplicitObjectWrapper<T> {
|
7366 |
/**
|
7367 |
* @see _.pluck
|
7368 |
*/
|
7369 |
+
pluck<TResult>(path: string|StringRepresentable|StringRepresentable[]): LoDashExplicitArrayWrapper<TResult>;
|
7370 |
}
|
7371 |
|
7372 |
//_.reduce
|
12697 |
*/
|
12698 |
has<T extends {}>(
|
12699 |
object: T,
|
12700 |
+
path: string|StringRepresentable|StringRepresentable[]
|
12701 |
): boolean;
|
12702 |
}
|
12703 |
|
12705 |
/**
|
12706 |
* @see _.has
|
12707 |
*/
|
12708 |
+
has(path: string|StringRepresentable|StringRepresentable[]): boolean;
|
12709 |
}
|
12710 |
|
12711 |
interface LoDashExplicitObjectWrapper<T> {
|
12712 |
/**
|
12713 |
* @see _.has
|
12714 |
*/
|
12715 |
+
has(path: string|StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>;
|
12716 |
}
|
12717 |
|
12718 |
//_.invert
|
13192 |
* @see _.omit
|
13193 |
*/
|
13194 |
omit<TResult extends {}>(
|
13195 |
+
...predicate: (string|StringRepresentable|StringRepresentable[])[]
|
13196 |
): LoDashImplicitObjectWrapper<TResult>;
|
13197 |
}
|
13198 |
|
13209 |
* @see _.omit
|
13210 |
*/
|
13211 |
omit<TResult extends {}>(
|
13212 |
+
...predicate: (string|StringRepresentable|StringRepresentable[])[]
|
13213 |
): LoDashExplicitObjectWrapper<TResult>;
|
13214 |
}
|
13215 |
|
13282 |
* @see _.pick
|
13283 |
*/
|
13284 |
pick<TResult extends {}>(
|
13285 |
+
...predicate: (string|StringRepresentable|StringRepresentable[])[]
|
13286 |
): LoDashImplicitObjectWrapper<TResult>;
|
13287 |
}
|
13288 |
|
13299 |
* @see _.pick
|
13300 |
*/
|
13301 |
pick<TResult extends {}>(
|
13302 |
+
...predicate: (string|StringRepresentable|StringRepresentable[])[]
|
13303 |
): LoDashExplicitObjectWrapper<TResult>;
|
13304 |
}
|
13305 |
|
13343 |
*/
|
13344 |
set<T>(
|
13345 |
object: T,
|
13346 |
+
path: string|StringRepresentable|StringRepresentable[],
|
13347 |
value: any
|
13348 |
): T;
|
13349 |
|
13352 |
*/
|
13353 |
set<V, T>(
|
13354 |
object: T,
|
13355 |
+
path: string|StringRepresentable|StringRepresentable[],
|
13356 |
value: V
|
13357 |
): T;
|
13358 |
}
|
13362 |
* @see _.set
|
13363 |
*/
|
13364 |
set<V>(
|
13365 |
+
path: string|StringRepresentable|StringRepresentable[],
|
13366 |
value: V
|
13367 |
): LoDashImplicitObjectWrapper<T>;
|
13368 |
}
|
13372 |
* @see _.set
|
13373 |
*/
|
13374 |
set<V>(
|
13375 |
+
path: string|StringRepresentable|StringRepresentable[],
|
13376 |
value: V
|
13377 |
): LoDashExplicitObjectWrapper<T>;
|
13378 |
}
|
js/menu-editor.js
CHANGED
@@ -1378,6 +1378,11 @@ function encodeMenuAsJSON(tree){
|
|
1378 |
name: wsEditorData.menuFormatName,
|
1379 |
version: wsEditorData.menuFormatVersion
|
1380 |
};
|
|
|
|
|
|
|
|
|
|
|
1381 |
return $.toJSON(tree);
|
1382 |
}
|
1383 |
|
@@ -1427,6 +1432,65 @@ function readMenuTreeState(){
|
|
1427 |
};
|
1428 |
}
|
1429 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1430 |
AmeEditorApi.readMenuTreeState = readMenuTreeState;
|
1431 |
AmeEditorApi.encodeMenuAsJson = encodeMenuAsJSON;
|
1432 |
|
1378 |
name: wsEditorData.menuFormatName,
|
1379 |
version: wsEditorData.menuFormatVersion
|
1380 |
};
|
1381 |
+
|
1382 |
+
//Compress the admin menu.
|
1383 |
+
tree = compressMenu(tree);
|
1384 |
+
console.log(tree); //xxxx debugging code
|
1385 |
+
|
1386 |
return $.toJSON(tree);
|
1387 |
}
|
1388 |
|
1432 |
};
|
1433 |
}
|
1434 |
|
1435 |
+
/**
|
1436 |
+
* Losslessly compress the admin menu configuration.
|
1437 |
+
*
|
1438 |
+
* This is a JS port of the ameMenu::compress() function defined in /includes/menu.php.
|
1439 |
+
*
|
1440 |
+
* @param {Object} adminMenu
|
1441 |
+
* @returns {Object}
|
1442 |
+
*/
|
1443 |
+
function compressMenu(adminMenu) {
|
1444 |
+
var common = {
|
1445 |
+
properties: _.omit(wsEditorData.blankMenuItem, ['defaults']),
|
1446 |
+
basic_defaults: _.clone(_.get(wsEditorData.blankMenuItem, 'defaults', {})),
|
1447 |
+
custom_item_defaults: _.clone(itemTemplates.getTemplateById('').defaults)
|
1448 |
+
};
|
1449 |
+
|
1450 |
+
adminMenu.format.compressed = true;
|
1451 |
+
adminMenu.format.common = common;
|
1452 |
+
|
1453 |
+
function compressItem(item) {
|
1454 |
+
//These empty arrays can be dropped.
|
1455 |
+
if ( _.isEmpty(item['grant_access']) ) {
|
1456 |
+
delete item['grant_access'];
|
1457 |
+
}
|
1458 |
+
if ( _.isEmpty(item['items']) ) {
|
1459 |
+
delete item['items'];
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
//Normal and custom menu items have different defaults.
|
1463 |
+
//Remove defaults that are the same for all items of that type.
|
1464 |
+
var defaults = _.get(item, 'custom', false) ? common['custom_item_defaults'] : common['basic_defaults'];
|
1465 |
+
if ( _.has(item, 'defaults') ) {
|
1466 |
+
_.forEach(defaults, function(value, key) {
|
1467 |
+
if (_.has(item['defaults'], key) && (item['defaults'][key] === value)) {
|
1468 |
+
delete item['defaults'][key];
|
1469 |
+
}
|
1470 |
+
});
|
1471 |
+
}
|
1472 |
+
|
1473 |
+
//Remove properties that match the common values.
|
1474 |
+
_.forEach(common['properties'], function(value, key) {
|
1475 |
+
if (_.has(item, key) && (item[key] === value)) {
|
1476 |
+
delete item[key];
|
1477 |
+
}
|
1478 |
+
});
|
1479 |
+
|
1480 |
+
return item;
|
1481 |
+
}
|
1482 |
+
|
1483 |
+
adminMenu.tree = _.mapValues(adminMenu.tree, function(topMenu) {
|
1484 |
+
topMenu = compressItem(topMenu);
|
1485 |
+
if (typeof topMenu.items !== 'undefined') {
|
1486 |
+
topMenu.items = _.map(topMenu.items, compressItem);
|
1487 |
+
}
|
1488 |
+
return topMenu;
|
1489 |
+
});
|
1490 |
+
|
1491 |
+
return adminMenu;
|
1492 |
+
}
|
1493 |
+
|
1494 |
AmeEditorApi.readMenuTreeState = readMenuTreeState;
|
1495 |
AmeEditorApi.encodeMenuAsJson = encodeMenuAsJSON;
|
1496 |
|
menu-editor.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Admin Menu Editor
|
4 |
Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
|
5 |
Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
|
6 |
-
Version: 1.6.
|
7 |
Author: Janis Elsts
|
8 |
Author URI: http://w-shadow.com/blog/
|
9 |
*/
|
3 |
Plugin Name: Admin Menu Editor
|
4 |
Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
|
5 |
Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
|
6 |
+
Version: 1.6.2
|
7 |
Author: Janis Elsts
|
8 |
Author URI: http://w-shadow.com/blog/
|
9 |
*/
|
modules/access-editor/access-editor.js
CHANGED
@@ -240,10 +240,10 @@ window.AmeItemAccessEditor = (function ($) {
|
|
240 |
hasCapWhenReset;
|
241 |
|
242 |
//Don't create custom settings unless necessary.
|
243 |
-
|
244 |
hasCapWhenReset = AmeCapabilityManager.hasCap(selectedActor, capability, unsavedCapabilities);
|
245 |
if (isAllowed !== hasCapWhenReset) {
|
246 |
-
|
247 |
unsavedCapabilities,
|
248 |
selectedActor,
|
249 |
capability,
|
@@ -275,7 +275,7 @@ window.AmeItemAccessEditor = (function ($) {
|
|
275 |
hasCapByDefault = AmeCapabilityManager.hasCapByDefault(selectedActor, itemRequiredCap);
|
276 |
|
277 |
if (isAllowed && hasCapByDefault && !hasCap) {
|
278 |
-
|
279 |
unsavedCapabilities,
|
280 |
selectedActor,
|
281 |
itemRequiredCap,
|
240 |
hasCapWhenReset;
|
241 |
|
242 |
//Don't create custom settings unless necessary.
|
243 |
+
AmeActorManager.resetCapInContext(unsavedCapabilities, selectedActor, capability);
|
244 |
hasCapWhenReset = AmeCapabilityManager.hasCap(selectedActor, capability, unsavedCapabilities);
|
245 |
if (isAllowed !== hasCapWhenReset) {
|
246 |
+
AmeActorManager.setCapInContext(
|
247 |
unsavedCapabilities,
|
248 |
selectedActor,
|
249 |
capability,
|
275 |
hasCapByDefault = AmeCapabilityManager.hasCapByDefault(selectedActor, itemRequiredCap);
|
276 |
|
277 |
if (isAllowed && hasCapByDefault && !hasCap) {
|
278 |
+
AmeActorManager.setCapInContext(
|
279 |
unsavedCapabilities,
|
280 |
selectedActor,
|
281 |
itemRequiredCap,
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: whiteshadow
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
|
4 |
Tags: admin, dashboard, menu, security, wpmu
|
5 |
Requires at least: 4.1
|
6 |
-
Tested up to: 4.5
|
7 |
-
Stable tag: 1.6.
|
8 |
|
9 |
Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
|
10 |
|
@@ -63,6 +63,13 @@ Plugins installed in the `mu-plugins` directory are treated as "always on", so y
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 1.6.1 =
|
67 |
* Fixed a bug introduced in version 1.6 that prevented the "collapse menu" link from working. In some cases, this bug also made it impossible to switch between "Help" tabs.
|
68 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
|
4 |
Tags: admin, dashboard, menu, security, wpmu
|
5 |
Requires at least: 4.1
|
6 |
+
Tested up to: 4.5.2
|
7 |
+
Stable tag: 1.6.2
|
8 |
|
9 |
Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
|
10 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 1.6.2 =
|
67 |
+
* Fixed a bug that made menu items "jump" slightly to the left when you start to drag them.
|
68 |
+
* Fixed a Multisite-specific bug where temporarily switching to another site using the switch_to_blog() function could result in the user having the wrong permissions.
|
69 |
+
* When saving settings, the plugin will now compress the menu data before sending it to the server. This reduces the chances of exceeding request size limits that are imposed by some hosting companies.
|
70 |
+
* You can dismiss the "Settings saved" notification by clicking the "x" button.
|
71 |
+
* Tested up to WordPress 4.5.2.
|
72 |
+
|
73 |
= 1.6.1 =
|
74 |
* Fixed a bug introduced in version 1.6 that prevented the "collapse menu" link from working. In some cases, this bug also made it impossible to switch between "Help" tabs.
|
75 |
|