@atlassian/aui 9.3.21 → 9.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +7 -9
  3. package/dist/aui/aui-css-deprecations.js +1 -1
  4. package/dist/aui/aui-css-deprecations.js.map +1 -1
  5. package/dist/aui/aui-prototyping-browserfocus.css +1 -353
  6. package/dist/aui/aui-prototyping-darkmode.css +1 -262
  7. package/dist/aui/aui-prototyping.css +10 -10
  8. package/dist/aui/aui-prototyping.js +7 -7
  9. package/dist/aui/aui-prototyping.js.map +1 -1
  10. package/dist/aui/aui-prototyping.nodeps.css +10 -10
  11. package/dist/aui/aui-prototyping.nodeps.js +9 -9
  12. package/dist/aui/aui-prototyping.nodeps.js.map +1 -1
  13. package/entry/aui.batch.components.js +21 -21
  14. package/entry/aui.batch.page.js +3 -3
  15. package/entry/aui.batch.patterns.js +20 -20
  16. package/entry/aui.batch.prototyping.js +3 -11
  17. package/entry/aui.component.nav.js +1 -1
  18. package/entry/aui.component.progressbar.js +4 -1
  19. package/entry/aui.side-effects.js +2 -2
  20. package/entry/behaviours/aui.behaviour.format.js +1 -1
  21. package/entry/behaviours/aui.behaviour.i18n.js +1 -1
  22. package/entry/behaviours/aui.behaviour.keyboard-shortcuts.js +1 -1
  23. package/entry/behaviours/aui.behaviour.progressive-data-set.js +1 -1
  24. package/entry/behaviours/aui.behaviour.version.js +1 -1
  25. package/entry/deprecated/aui.component.inline-dialog1.js +1 -1
  26. package/package.json +3 -7
  27. package/src/js/aui/alphanum.js +1 -1
  28. package/src/js/aui/banner.js +2 -2
  29. package/src/js/aui/blanket.js +7 -11
  30. package/src/js/aui/button.js +5 -5
  31. package/src/js/aui/checkbox-multiselect.js +79 -76
  32. package/src/js/aui/clone.js +1 -1
  33. package/src/js/aui/close-button.js +2 -6
  34. package/src/js/aui/contain-dropdown.js +5 -5
  35. package/src/js/aui/contains.js +1 -1
  36. package/src/js/aui/cookie.js +12 -16
  37. package/src/js/aui/date-picker.js +84 -69
  38. package/src/js/aui/debounce.js +5 -8
  39. package/src/js/aui/dialog.js +206 -172
  40. package/src/js/aui/dialog2.js +9 -8
  41. package/src/js/aui/dropdown2.js +211 -181
  42. package/src/js/aui/escape-html.js +2 -2
  43. package/src/js/aui/escape.js +1 -1
  44. package/src/js/aui/event.js +4 -8
  45. package/src/js/aui/expander.js +9 -7
  46. package/src/js/aui/flag.js +15 -17
  47. package/src/js/aui/focus-manager.js +19 -18
  48. package/src/js/aui/form-notification.js +14 -13
  49. package/src/js/aui/form-validation/basic-validators.js +39 -30
  50. package/src/js/aui/form-validation/validator-register.js +9 -5
  51. package/src/js/aui/form-validation.js +17 -14
  52. package/src/js/aui/format.js +9 -6
  53. package/src/js/aui/forms/create-forms-component-body.js +6 -9
  54. package/src/js/aui/forms/custom-checkbox.js +2 -6
  55. package/src/js/aui/forms/custom-radio.js +2 -6
  56. package/src/js/aui/forms.js +4 -8
  57. package/src/js/aui/header-async.js +1 -1
  58. package/src/js/aui/header.js +2 -2
  59. package/src/js/aui/i18n.js +2 -5
  60. package/src/js/aui/index-of.js +1 -1
  61. package/src/js/aui/inline-dialog.js +171 -117
  62. package/src/js/aui/inline-dialog2.js +60 -50
  63. package/src/js/aui/internal/add-id.js +1 -1
  64. package/src/js/aui/internal/alignment.js +57 -49
  65. package/src/js/aui/internal/amdify.js +0 -1
  66. package/src/js/aui/internal/animation.js +2 -5
  67. package/src/js/aui/internal/attributes.js +2 -3
  68. package/src/js/aui/internal/browser.js +5 -6
  69. package/src/js/aui/internal/constants.js +1 -3
  70. package/src/js/aui/internal/deduplicateIDs.js +8 -7
  71. package/src/js/aui/internal/deprecation/deprecated-adg2-icons.js +132 -132
  72. package/src/js/aui/internal/deprecation.js +53 -31
  73. package/src/js/aui/internal/detect-children-change.js +3 -2
  74. package/src/js/aui/internal/elements.js +2 -5
  75. package/src/js/aui/internal/enforcer.js +11 -13
  76. package/src/js/aui/internal/globalize.js +3 -3
  77. package/src/js/aui/internal/has-touch.js +1 -2
  78. package/src/js/aui/internal/header/create-header.js +54 -28
  79. package/src/js/aui/internal/i18n/aui.js +8 -5
  80. package/src/js/aui/internal/i18n/aui_af.js +31 -31
  81. package/src/js/aui/internal/i18n/aui_ar.js +31 -31
  82. package/src/js/aui/internal/i18n/aui_ar_DZ.js +31 -31
  83. package/src/js/aui/internal/i18n/aui_az.js +31 -31
  84. package/src/js/aui/internal/i18n/aui_bg.js +31 -31
  85. package/src/js/aui/internal/i18n/aui_bs.js +31 -31
  86. package/src/js/aui/internal/i18n/aui_ca.js +31 -31
  87. package/src/js/aui/internal/i18n/aui_cs.js +31 -31
  88. package/src/js/aui/internal/i18n/aui_da.js +31 -31
  89. package/src/js/aui/internal/i18n/aui_de.js +31 -31
  90. package/src/js/aui/internal/i18n/aui_el.js +31 -31
  91. package/src/js/aui/internal/i18n/aui_en_AU.js +31 -31
  92. package/src/js/aui/internal/i18n/aui_en_GB.js +31 -31
  93. package/src/js/aui/internal/i18n/aui_en_NZ.js +31 -31
  94. package/src/js/aui/internal/i18n/aui_eo.js +31 -31
  95. package/src/js/aui/internal/i18n/aui_es.js +31 -31
  96. package/src/js/aui/internal/i18n/aui_et.js +31 -31
  97. package/src/js/aui/internal/i18n/aui_eu.js +31 -31
  98. package/src/js/aui/internal/i18n/aui_fa.js +31 -31
  99. package/src/js/aui/internal/i18n/aui_fi.js +31 -31
  100. package/src/js/aui/internal/i18n/aui_fo.js +31 -31
  101. package/src/js/aui/internal/i18n/aui_fr.js +31 -31
  102. package/src/js/aui/internal/i18n/aui_fr_CH.js +31 -31
  103. package/src/js/aui/internal/i18n/aui_gl.js +31 -31
  104. package/src/js/aui/internal/i18n/aui_he.js +31 -31
  105. package/src/js/aui/internal/i18n/aui_hr.js +31 -31
  106. package/src/js/aui/internal/i18n/aui_hu.js +31 -31
  107. package/src/js/aui/internal/i18n/aui_hy.js +31 -31
  108. package/src/js/aui/internal/i18n/aui_id.js +31 -31
  109. package/src/js/aui/internal/i18n/aui_is.js +31 -31
  110. package/src/js/aui/internal/i18n/aui_it.js +31 -31
  111. package/src/js/aui/internal/i18n/aui_ja.js +31 -31
  112. package/src/js/aui/internal/i18n/aui_ko.js +31 -31
  113. package/src/js/aui/internal/i18n/aui_kz.js +31 -31
  114. package/src/js/aui/internal/i18n/aui_lt.js +31 -31
  115. package/src/js/aui/internal/i18n/aui_lv.js +31 -31
  116. package/src/js/aui/internal/i18n/aui_ml.js +31 -31
  117. package/src/js/aui/internal/i18n/aui_ms.js +31 -31
  118. package/src/js/aui/internal/i18n/aui_nl.js +31 -31
  119. package/src/js/aui/internal/i18n/aui_no.js +31 -31
  120. package/src/js/aui/internal/i18n/aui_pl.js +31 -31
  121. package/src/js/aui/internal/i18n/aui_pt.js +31 -31
  122. package/src/js/aui/internal/i18n/aui_pt_BR.js +31 -31
  123. package/src/js/aui/internal/i18n/aui_rm.js +31 -31
  124. package/src/js/aui/internal/i18n/aui_ro.js +31 -31
  125. package/src/js/aui/internal/i18n/aui_ru.js +31 -31
  126. package/src/js/aui/internal/i18n/aui_sk.js +31 -31
  127. package/src/js/aui/internal/i18n/aui_sl.js +31 -31
  128. package/src/js/aui/internal/i18n/aui_sq.js +31 -31
  129. package/src/js/aui/internal/i18n/aui_sr.js +31 -31
  130. package/src/js/aui/internal/i18n/aui_sr_SR.js +31 -31
  131. package/src/js/aui/internal/i18n/aui_sv.js +31 -31
  132. package/src/js/aui/internal/i18n/aui_ta.js +31 -31
  133. package/src/js/aui/internal/i18n/aui_th.js +31 -31
  134. package/src/js/aui/internal/i18n/aui_tj.js +31 -31
  135. package/src/js/aui/internal/i18n/aui_tr.js +31 -31
  136. package/src/js/aui/internal/i18n/aui_uk.js +31 -31
  137. package/src/js/aui/internal/i18n/aui_vi.js +31 -31
  138. package/src/js/aui/internal/i18n/aui_zh_CN.js +31 -31
  139. package/src/js/aui/internal/i18n/aui_zh_HK.js +31 -31
  140. package/src/js/aui/internal/i18n/aui_zh_TW.js +31 -31
  141. package/src/js/aui/internal/log.js +2 -6
  142. package/src/js/aui/internal/mediaQuery.js +2 -3
  143. package/src/js/aui/internal/select/option.js +3 -3
  144. package/src/js/aui/internal/select/suggestion-model.js +1 -1
  145. package/src/js/aui/internal/select/suggestions-model.js +4 -5
  146. package/src/js/aui/internal/select/suggestions-view.js +17 -12
  147. package/src/js/aui/internal/state.js +2 -3
  148. package/src/js/aui/is-clipped.js +2 -2
  149. package/src/js/aui/key-code.js +1 -1
  150. package/src/js/aui/label.js +6 -6
  151. package/src/js/aui/layer.js +100 -98
  152. package/src/js/aui/messages.js +51 -38
  153. package/src/js/aui/navigation.js +7 -9
  154. package/src/js/aui/on-text-resize.js +7 -5
  155. package/src/js/aui/params.js +11 -8
  156. package/src/js/aui/polyfills/custom-event.js +7 -7
  157. package/src/js/aui/polyfills/placeholder.js +4 -4
  158. package/src/js/aui/populate-parameters.js +4 -4
  159. package/src/js/aui/progress-indicator.js +35 -27
  160. package/src/js/aui/progressive-data-set.js +13 -8
  161. package/src/js/aui/query-input.js +1 -1
  162. package/src/js/aui/restful-table/class-names.js +1 -1
  163. package/src/js/aui/restful-table/data-keys.js +1 -1
  164. package/src/js/aui/restful-table/edit-row.js +63 -63
  165. package/src/js/aui/restful-table/entry-model.js +6 -13
  166. package/src/js/aui/restful-table/event-handlers.js +4 -8
  167. package/src/js/aui/restful-table/event-names.js +1 -1
  168. package/src/js/aui/restful-table/row.js +41 -23
  169. package/src/js/aui/restful-table.js +101 -72
  170. package/src/js/aui/result-set.js +5 -5
  171. package/src/js/aui/results-list.js +3 -3
  172. package/src/js/aui/select.js +65 -49
  173. package/src/js/aui/select2.js +14 -6
  174. package/src/js/aui/sidebar.js +81 -51
  175. package/src/js/aui/spin.js +61 -49
  176. package/src/js/aui/spinner.js +11 -12
  177. package/src/js/aui/tables-sortable.js +21 -10
  178. package/src/js/aui/tabs.js +108 -77
  179. package/src/js/aui/to-init.js +1 -1
  180. package/src/js/aui/toggle.js +55 -43
  181. package/src/js/aui/tooltip.js +32 -31
  182. package/src/js/aui/trigger.js +20 -18
  183. package/src/js/aui/truncating-progressive-data-set.js +1 -1
  184. package/src/js/aui/unbind-text-resize.js +1 -1
  185. package/src/js/aui/unique-id.js +1 -1
  186. package/src/js/aui/when-i-type.js +66 -39
  187. package/src/js/aui-css-deprecations.js +50 -50
  188. package/src/js/jquery/jquery.hotkeys.js +124 -49
  189. package/src/js/jquery/jquery.moveto.js +18 -12
  190. package/src/less/adg-fancy-file-input.less +2 -3
  191. package/src/less/adg-header-quicksearch.less +4 -1
  192. package/src/less/adg-iconfont.less +242 -242
  193. package/src/less/adgs-icons.less +262 -262
  194. package/src/less/aui-appheader.less +10 -6
  195. package/src/less/aui-buttons.less +6 -5
  196. package/src/less/aui-date-picker.less +9 -6
  197. package/src/less/aui-experimental-expander.less +8 -8
  198. package/src/less/aui-experimental-labels.less +4 -3
  199. package/src/less/aui-experimental-progress-indicator.less +10 -4
  200. package/src/less/aui-experimental-progress-tracker.less +9 -6
  201. package/src/less/aui-experimental-restfultable.less +11 -3
  202. package/src/less/aui-experimental-tables-sortable.less +5 -3
  203. package/src/less/aui-experimental-tooltip.less +1 -1
  204. package/src/less/aui-link.less +0 -1
  205. package/src/less/aui-lozenge.less +6 -3
  206. package/src/less/aui-navigation.less +13 -13
  207. package/src/less/aui-page-layout.less +3 -4
  208. package/src/less/aui-page-typography.less +8 -3
  209. package/src/less/aui-reset.less +22 -6
  210. package/src/less/aui-select2.less +11 -8
  211. package/src/less/aui-sidebar-badges.less +1 -2
  212. package/src/less/aui-sidebar-config.less +7 -2
  213. package/src/less/aui-sidebar-grouping.less +16 -6
  214. package/src/less/aui-sidebar-navigation.less +7 -5
  215. package/src/less/aui-sidebar-skeleton.less +4 -3
  216. package/src/less/aui-skip-link.less +2 -1
  217. package/src/less/aui-spinner.less +2 -2
  218. package/src/less/aui-toggle.less +2 -2
  219. package/src/less/aui-toolbar2.less +1 -1
  220. package/src/less/checkbox-multiselect.less +13 -13
  221. package/src/less/dialog.less +3 -3
  222. package/src/less/dialog2.less +12 -11
  223. package/src/less/dropdown2-temp.css +4 -4
  224. package/src/less/dropdown2.less +3 -3
  225. package/src/less/form-notification.less +10 -6
  226. package/src/less/forms-current.less +6 -5
  227. package/src/less/forms-legacy.less +4 -2
  228. package/src/less/forms-radios-and-checkboxes.less +9 -11
  229. package/src/less/forms.less +2 -4
  230. package/src/less/iconfont-mixin.less +7 -4
  231. package/src/less/imports/aui-theme/adg/adg-colors.less +40 -40
  232. package/src/less/imports/aui-theme/adg/adg-neutral-dark.less +20 -20
  233. package/src/less/imports/aui-theme/adg/adg-neutral-light.less +20 -20
  234. package/src/less/imports/aui-theme/components/buttons.less +5 -1
  235. package/src/less/imports/aui-theme/components/dropdown.less +3 -1
  236. package/src/less/imports/aui-theme/components/form-notification.less +2 -1
  237. package/src/less/imports/aui-theme/components/forms.less +16 -1
  238. package/src/less/imports/aui-theme/components/inline-dialog2.less +1 -1
  239. package/src/less/imports/aui-theme/components/navigation.less +3 -3
  240. package/src/less/imports/aui-theme/components/progress-tracker.less +6 -2
  241. package/src/less/imports/aui-theme/components/tables.less +3 -2
  242. package/src/less/imports/aui-theme/components/toggle.less +8 -3
  243. package/src/less/imports/aui-theme/core/colors.less +12 -4
  244. package/src/less/imports/aui-theme/core/icons.less +22 -22
  245. package/src/less/imports/aui-theme/core/text.less +6 -3
  246. package/src/less/imports/mixins/dropdown2-trigger-chevron-icon.less +0 -1
  247. package/src/less/imports/mixins/focus.less +12 -4
  248. package/src/less/imports/mixins/media-queries.less +2 -2
  249. package/src/less/imports/mixins/shadows.less +3 -1
  250. package/src/less/imports/mixins/tab-indicator.less +2 -2
  251. package/src/less/imports/mixins.less +11 -4
  252. package/src/less/inline-dialog.less +21 -19
  253. package/src/less/layer.less +0 -2
  254. package/src/less/messages.less +2 -1
  255. package/src/less/single-select.less +14 -9
  256. package/src/less/tables.less +3 -2
  257. package/src/less/tabs.less +4 -3
  258. package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-base-themes.css +0 -797
  259. package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-base-themes.js +0 -26
  260. package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-theme-import-map.js +0 -51
  261. package/entry/token-themes-generated/npm/themes/dark-future.js +0 -7
  262. package/entry/token-themes-generated/npm/themes/dark-new-input-border.js +0 -7
  263. package/entry/token-themes-generated/npm/themes/dark.js +0 -395
  264. package/entry/token-themes-generated/npm/themes/legacy-dark.js +0 -395
  265. package/entry/token-themes-generated/npm/themes/legacy-light.js +0 -395
  266. package/entry/token-themes-generated/npm/themes/light-future.js +0 -7
  267. package/entry/token-themes-generated/npm/themes/light-new-input-border.js +0 -7
  268. package/entry/token-themes-generated/npm/themes/light.js +0 -395
  269. package/entry/token-themes-generated/npm/themes/shape.js +0 -15
  270. package/entry/token-themes-generated/npm/themes/spacing.js +0 -27
  271. package/entry/token-themes-generated/npm/themes/typography-adg3.js +0 -50
  272. package/entry/token-themes-generated/npm/themes/typography-minor3.js +0 -41
@@ -23,8 +23,8 @@ const ZINDEX_DIALOG_1 = 2600; // see also dialog.less
23
23
  * </pre>
24
24
  * @param options {object} [optional] Permitted options and defaults are as follows:
25
25
  * width (800), height (600), keypressListener (closes dialog on ESC).
26
- */
27
- function createPopup (options) {
26
+ */
27
+ function createPopup(options) {
28
28
  var defaults = {
29
29
  width: 800,
30
30
  height: 600,
@@ -33,14 +33,14 @@ function createPopup (options) {
33
33
  if (e.keyCode === keyCode.ESCAPE && popup.is(':visible')) {
34
34
  res.hide();
35
35
  }
36
- }
36
+ },
37
37
  };
38
38
  // for backwards-compatibility
39
39
  if (typeof options !== 'object') {
40
40
  options = {
41
41
  width: arguments[0],
42
42
  height: arguments[1],
43
- id: arguments[2]
43
+ id: arguments[2],
44
44
  };
45
45
  options = $.extend({}, options, arguments[3]);
46
46
  }
@@ -54,22 +54,25 @@ function createPopup (options) {
54
54
  var highestZIndex = ZINDEX_DIALOG_1;
55
55
  $('.aui-dialog').each(function () {
56
56
  var currentPopup = $(this);
57
- highestZIndex = (currentPopup.css('z-index') > highestZIndex) ? currentPopup.css('z-index') : highestZIndex;
57
+ highestZIndex =
58
+ currentPopup.css('z-index') > highestZIndex
59
+ ? currentPopup.css('z-index')
60
+ : highestZIndex;
58
61
  });
59
62
 
60
- var applySize = (function _applySize (width, height) {
61
- options.width = (width = (width || options.width));
62
- options.height = (height = (height || options.height));
63
+ var applySize = (function _applySize(width, height) {
64
+ options.width = width = width || options.width;
65
+ options.height = height = height || options.height;
63
66
 
64
67
  popup.css({
65
- marginTop: -Math.round(height / 2) + 'px',
66
- marginLeft: -Math.round(width / 2) + 'px',
67
- width: width,
68
- height: height,
69
- 'z-index': parseInt(highestZIndex,10) + 2 //+ 2 so that the shadow can be shown on +1 (underneath the popup but above everything else)
68
+ 'marginTop': -Math.round(height / 2) + 'px',
69
+ 'marginLeft': -Math.round(width / 2) + 'px',
70
+ 'width': width,
71
+ 'height': height,
72
+ 'z-index': parseInt(highestZIndex, 10) + 2, //+ 2 so that the shadow can be shown on +1 (underneath the popup but above everything else)
70
73
  });
71
74
  return _applySize;
72
- }(options.width, options.height));
75
+ })(options.width, options.height);
73
76
 
74
77
  $('body').append(popup);
75
78
 
@@ -80,7 +83,7 @@ function createPopup (options) {
80
83
  * Popup object
81
84
  * @class Popup
82
85
  * @static
83
- */
86
+ */
84
87
 
85
88
  //blanket for reference further down
86
89
  var blanket = $('.aui-blanket');
@@ -102,14 +105,17 @@ function createPopup (options) {
102
105
  return focusItem(options.focusSelector, element);
103
106
  }
104
107
  var defaultFocusSelector = ':input:visible:enabled:first';
105
- if (focusItem(defaultFocusSelector, $('.dialog-page-body', element))) { return; }
106
- if (focusItem(defaultFocusSelector, $('.dialog-button-panel', element))) { return; }
108
+ if (focusItem(defaultFocusSelector, $('.dialog-page-body', element))) {
109
+ return;
110
+ }
111
+ if (focusItem(defaultFocusSelector, $('.dialog-button-panel', element))) {
112
+ return;
113
+ }
107
114
 
108
115
  focusItem(defaultFocusSelector, $('.dialog-page-menu', element));
109
116
  };
110
117
 
111
118
  var res = {
112
-
113
119
  changeSize: function (w, h) {
114
120
  if ((w && w != options.width) || (h && h != options.height)) {
115
121
  applySize(w, h);
@@ -120,18 +126,17 @@ function createPopup (options) {
120
126
  /**
121
127
  * Shows the popup
122
128
  * @method show
123
- */
129
+ */
124
130
  show: function () {
125
-
126
131
  var show = function () {
127
132
  $(document)
128
133
  .off('keydown', options.keypressListener)
129
134
  .on('keydown', options.keypressListener);
130
135
  dim();
131
136
  blanket = $('.aui-blanket');
132
- if (blanket.length !== 0 && options.closeOnOutsideClick){
137
+ if (blanket.length !== 0 && options.closeOnOutsideClick) {
133
138
  blanket.on('click', function () {
134
- if (popup.is(':visible')){
139
+ if (popup.is(':visible')) {
135
140
  res.hide();
136
141
  }
137
142
  });
@@ -148,7 +153,7 @@ function createPopup (options) {
148
153
  /**
149
154
  * Hides the popup.
150
155
  * @method hide
151
- */
156
+ */
152
157
  hide: function () {
153
158
  $(document).unbind('keydown', options.keypressListener);
154
159
  blanket.unbind();
@@ -172,12 +177,12 @@ function createPopup (options) {
172
177
  /**
173
178
  * jQuery object, representing popup DOM element
174
179
  * @property element
175
- */
180
+ */
176
181
  element: popup,
177
182
  /**
178
183
  * Removes popup elements from the DOM
179
184
  * @method remove
180
- */
185
+ */
181
186
  remove: function () {
182
187
  popup.remove();
183
188
  this.element = null;
@@ -185,12 +190,12 @@ function createPopup (options) {
185
190
  /**
186
191
  * disables the popup
187
192
  * @method disable
188
- */
193
+ */
189
194
  disable: function () {
190
- if (!this.disabled){
195
+ if (!this.disabled) {
191
196
  this.popupBlanket = $("<div class='dialog-blanket'> </div>").css({
192
197
  height: popup.height(),
193
- width: popup.width()
198
+ width: popup.width(),
194
199
  });
195
200
  popup.append(this.popupBlanket);
196
201
  this.disabled = true;
@@ -199,14 +204,14 @@ function createPopup (options) {
199
204
  /**
200
205
  * enables the popup if it is disabled
201
206
  * @method enable
202
- */
207
+ */
203
208
  enable: function () {
204
209
  if (this.disabled) {
205
210
  this.disabled = false;
206
211
  this.popupBlanket.remove();
207
212
  this.popupBlanket = null;
208
213
  }
209
- }
214
+ },
210
215
  };
211
216
 
212
217
  return res;
@@ -222,7 +227,7 @@ var Dialog = (function () {
222
227
  * @param onclick {function} [optional] click event handler
223
228
  * @param className {string} [optional] class name
224
229
  * @private
225
- */
230
+ */
226
231
  function Button(page, label, onclick, className) {
227
232
  if (!page.buttonpanel) {
228
233
  page.addButtonPanel();
@@ -252,14 +257,14 @@ var Dialog = (function () {
252
257
  * @param onclick {function} [optional] click event handler
253
258
  * @param className {string} [optional] class name
254
259
  * @private
255
- */
260
+ */
256
261
  function Link(page, label, onclick, className, url) {
257
262
  if (!page.buttonpanel) {
258
263
  page.addButtonPanel();
259
264
  }
260
265
 
261
266
  //if no url is given use # as default
262
- if (!url){
267
+ if (!url) {
263
268
  url = '#';
264
269
  }
265
270
 
@@ -280,13 +285,13 @@ var Dialog = (function () {
280
285
  page.button[this.id] = this;
281
286
  }
282
287
 
283
- function itemMove (leftOrRight, target) {
288
+ function itemMove(leftOrRight, target) {
284
289
  var dir = leftOrRight == 'left' ? -1 : 1;
285
290
  return function (step) {
286
291
  var dtarget = this.page[target];
287
- if (this.id != ((dir == 1) ? dtarget.length - 1 : 0)) {
288
- dir *= (step || 1);
289
- dtarget[this.id + dir].item[(dir < 0 ? 'before' : 'after')](this.item);
292
+ if (this.id != (dir == 1 ? dtarget.length - 1 : 0)) {
293
+ dir *= step || 1;
294
+ dtarget[this.id + dir].item[dir < 0 ? 'before' : 'after'](this.item);
290
295
  dtarget.splice(this.id, 1);
291
296
  dtarget.splice(this.id + dir, 0, this);
292
297
  for (var i = 0, ii = dtarget.length; i < ii; i++) {
@@ -314,7 +319,7 @@ var Dialog = (function () {
314
319
  * @method moveLeft
315
320
  * @param step {number} how many items to move, default is 1
316
321
  * @return {object} button
317
- */
322
+ */
318
323
  Button.prototype.moveUp = Button.prototype.moveLeft = itemMove('left', 'button');
319
324
  /**
320
325
  * Moves item right in the hierarchy
@@ -322,12 +327,12 @@ var Dialog = (function () {
322
327
  * @method moveRight
323
328
  * @param step {number} how many items to move, default is 1
324
329
  * @return {object} button
325
- */
330
+ */
326
331
  Button.prototype.moveDown = Button.prototype.moveRight = itemMove('right', 'button');
327
332
  /**
328
333
  * Removes item
329
334
  * @method remove
330
- */
335
+ */
331
336
  Button.prototype.remove = itemRemove('button');
332
337
 
333
338
  /**
@@ -336,7 +341,7 @@ var Dialog = (function () {
336
341
  * @param label {string} [optional] label of the button
337
342
  * @return {string} label, if nothing is passed in
338
343
  * @return {object} jQuery button object, if label is passed in
339
- */
344
+ */
340
345
  Button.prototype.html = function (label) {
341
346
  return this.item.html(label);
342
347
  };
@@ -345,7 +350,7 @@ var Dialog = (function () {
345
350
  * @method onclick
346
351
  * @param onclick {function} [optional] new event handler, that is going to replace the old one
347
352
  * @return {function} existing event handler if new one is undefined
348
- */
353
+ */
349
354
  Button.prototype.onclick = function (onclick) {
350
355
  let self = this;
351
356
  if (typeof onclick === 'undefined') {
@@ -373,7 +378,7 @@ var Dialog = (function () {
373
378
  * @param className {string} [optional] HTML class name
374
379
  * @param panelButtonId {string} the unique id that will be put on the button element for this panel.
375
380
  * @private
376
- */
381
+ */
377
382
  var Panel = function (page, title, reference, className, panelButtonId) {
378
383
  if (!(reference instanceof $)) {
379
384
  reference = $(reference);
@@ -389,7 +394,10 @@ var Dialog = (function () {
389
394
  }
390
395
 
391
396
  this.item = $('<li></li>').append(this.button).addClass('page-menu-item');
392
- this.body = $('<div></div>').append(reference).addClass('dialog-panel-body').css('height', page.dialog.height + 'px');
397
+ this.body = $('<div></div>')
398
+ .append(reference)
399
+ .addClass('dialog-panel-body')
400
+ .css('height', page.dialog.height + 'px');
393
401
  this.padding = DEFAULT_PADDING;
394
402
  if (className) {
395
403
  this.body.addClass(className);
@@ -405,13 +413,13 @@ var Dialog = (function () {
405
413
  cur = page.panel[page.curtab];
406
414
  cur.body.hide();
407
415
  cur.item.removeClass('selected');
408
- (typeof cur.onblur === 'function') && cur.onblur();
416
+ typeof cur.onblur === 'function' && cur.onblur();
409
417
  }
410
418
  page.curtab = tab.id;
411
419
  tab.body.show();
412
420
  tab.item.addClass('selected');
413
- (typeof tab.onselect === 'function') && tab.onselect();
414
- (typeof page.ontabchange === 'function') && page.ontabchange(tab, cur);
421
+ typeof tab.onselect === 'function' && tab.onselect();
422
+ typeof page.ontabchange === 'function' && page.ontabchange(tab, cur);
415
423
  };
416
424
  if (!this.button.click) {
417
425
  logger.log('atlassian-dialog:Panel:constructor - this.button.click false');
@@ -429,7 +437,7 @@ var Dialog = (function () {
429
437
  /**
430
438
  * Selects current panel
431
439
  * @method select
432
- */
440
+ */
433
441
  Panel.prototype.select = function () {
434
442
  this.button.click();
435
443
  };
@@ -439,7 +447,7 @@ var Dialog = (function () {
439
447
  * @method moveLeft
440
448
  * @param step {number} how many items to move, default is 1
441
449
  * @return {object} panel
442
- */
450
+ */
443
451
  Panel.prototype.moveUp = Panel.prototype.moveLeft = itemMove('left', 'panel');
444
452
  /**
445
453
  * Moves item right in the hierarchy
@@ -447,12 +455,12 @@ var Dialog = (function () {
447
455
  * @method moveRight
448
456
  * @param step {number} how many items to move, default is 1
449
457
  * @return {object} panel
450
- */
458
+ */
451
459
  Panel.prototype.moveDown = Panel.prototype.moveRight = itemMove('right', 'panel');
452
460
  /**
453
461
  * Removes item
454
462
  * @method remove
455
- */
463
+ */
456
464
  Panel.prototype.remove = itemRemove('panel');
457
465
  /**
458
466
  * Getter and setter of inner HTML of the panel
@@ -460,7 +468,7 @@ var Dialog = (function () {
460
468
  * @param html {string} HTML source to set up
461
469
  * @return {object} panel
462
470
  * @return {string} current HTML source
463
- */
471
+ */
464
472
  Panel.prototype.html = function (html) {
465
473
  if (html) {
466
474
  this.body.html(html);
@@ -475,7 +483,7 @@ var Dialog = (function () {
475
483
  * @param padding {number} padding in pixels
476
484
  * @return {object} panel
477
485
  * @see DEFAULT_PADDING
478
- */
486
+ */
479
487
  Panel.prototype.setPadding = function (padding) {
480
488
  if (!isNaN(+padding)) {
481
489
  this.body.css('padding', +padding);
@@ -496,13 +504,15 @@ var Dialog = (function () {
496
504
  * @param dialog {object} dialog object
497
505
  * @param className {string} [optional] HTML class name
498
506
  * @private
499
- */
507
+ */
500
508
  var Page = function (dialog, className) {
501
509
  this.dialog = dialog;
502
510
  this.id = dialog.page.length;
503
511
  this.element = $('<div></div>').addClass('dialog-components');
504
512
  this.body = $('<div></div>').addClass('dialog-page-body');
505
- this.menu = $('<ul></ul>').addClass('dialog-page-menu').css('height', dialog.height + 'px');
513
+ this.menu = $('<ul></ul>')
514
+ .addClass('dialog-page-menu')
515
+ .css('height', dialog.height + 'px');
506
516
  this.body.append(this.menu);
507
517
  this.curtab;
508
518
  this.panel = [];
@@ -517,11 +527,11 @@ var Dialog = (function () {
517
527
  /**
518
528
  * Size updater for contents of the page. For internal use
519
529
  * @method recalcSize
520
- */
530
+ */
521
531
  Page.prototype.recalcSize = function () {
522
532
  var headerHeight = this.header ? HEADER_HEIGHT : 0;
523
533
  var buttonHeight = this.buttonpanel ? BUTTONS_HEIGHT : 0;
524
- for (var i = this.panel.length; i--;) {
534
+ for (var i = this.panel.length; i--; ) {
525
535
  var dialogComponentsHeight = this.dialog.height - headerHeight - buttonHeight;
526
536
  this.panel[i].body.css('height', dialogComponentsHeight);
527
537
  this.menu.css('height', dialogComponentsHeight);
@@ -545,7 +555,7 @@ var Dialog = (function () {
545
555
  * @param className {string} [optional] HTML class name
546
556
  * @param panelButtonId {string} [optional] The unique id for the panel's button.
547
557
  * @return {object} the page
548
- */
558
+ */
549
559
  Page.prototype.addPanel = function (title, reference, className, panelButtonId) {
550
560
  new Panel(this, title, reference, className, panelButtonId);
551
561
  this.recalcSize();
@@ -557,12 +567,14 @@ var Dialog = (function () {
557
567
  * @param title {string} panel title
558
568
  * @param className {string} [optional] CSS class name
559
569
  * @return {object} the page
560
- */
570
+ */
561
571
  Page.prototype.addHeader = function (title, className) {
562
572
  if (this.header) {
563
573
  this.header.remove();
564
574
  }
565
- this.header = $('<h2></h2>').text(title || '').addClass('dialog-title');
575
+ this.header = $('<h2></h2>')
576
+ .text(title || '')
577
+ .addClass('dialog-title');
566
578
  className && this.header.addClass(className);
567
579
  this.element.prepend(this.header);
568
580
  this.recalcSize();
@@ -575,7 +587,7 @@ var Dialog = (function () {
575
587
  * @param onclick {function} [optional] click event handler
576
588
  * @param className {string} [optional] class name
577
589
  * @return {object} the page
578
- */
590
+ */
579
591
  Page.prototype.addButton = function (label, onclick, className) {
580
592
  new Button(this, label, onclick, className);
581
593
  this.recalcSize();
@@ -588,7 +600,7 @@ var Dialog = (function () {
588
600
  * @param onclick {function} [optional] click event handler
589
601
  * @param className {string} [optional] class name
590
602
  * @return {object} the page
591
- */
603
+ */
592
604
  Page.prototype.addLink = function (label, onclick, className, url) {
593
605
  new Link(this, label, onclick, className, url);
594
606
  this.recalcSize();
@@ -600,7 +612,7 @@ var Dialog = (function () {
600
612
  * @method gotoPanel
601
613
  * @param panel {object} panel object
602
614
  * @param panel {number} id of the panel
603
- */
615
+ */
604
616
  Page.prototype.gotoPanel = function (panel) {
605
617
  this.panel[panel.id || panel].select();
606
618
  };
@@ -608,34 +620,32 @@ var Dialog = (function () {
608
620
  * Returns current panel on the page
609
621
  * @method getCurrentPanel
610
622
  * @return panel {object} the panel
611
- */
623
+ */
612
624
  Page.prototype.getCurrentPanel = function () {
613
625
  return this.panel[this.curtab];
614
626
  };
615
627
  /**
616
628
  * Hides the page
617
629
  * @method hide
618
- */
630
+ */
619
631
  Page.prototype.hide = function () {
620
632
  this.element.hide();
621
633
  };
622
634
  /**
623
635
  * Shows the page, if it was hidden
624
636
  * @method show
625
- */
637
+ */
626
638
  Page.prototype.show = function () {
627
639
  this.element.show();
628
640
  };
629
641
  /**
630
642
  * Removes the page
631
643
  * @method remove
632
- */
644
+ */
633
645
  Page.prototype.remove = function () {
634
646
  this.element.remove();
635
647
  };
636
648
 
637
-
638
-
639
649
  /**
640
650
  * Constructor for a Dialog. A Dialog is a popup which consists of Pages, where each Page can consist of Panels,
641
651
  * Buttons and a Header. The dialog must be constructed in page order as it has a current page state. For example,
@@ -663,8 +673,8 @@ var Dialog = (function () {
663
673
  * @param width {number} dialog width in pixels, or an object containing the Dialog parameters
664
674
  * @param height {number} dialog height in pixels
665
675
  * @param id {number} [optional] dialog id
666
- */
667
- function Dialog (width, height, id) {
676
+ */
677
+ function Dialog(width, height, id) {
668
678
  var options = {};
669
679
  if (!+width) {
670
680
  options = Object(width);
@@ -678,7 +688,7 @@ var Dialog = (function () {
678
688
  options = $.extend({}, options, {
679
689
  width: this.width,
680
690
  height: this.height,
681
- id: this.id
691
+ id: this.id,
682
692
  });
683
693
  this.popup = createPopup(options);
684
694
 
@@ -687,8 +697,7 @@ var Dialog = (function () {
687
697
  this.curpage = 0;
688
698
 
689
699
  new Page(this);
690
- };
691
-
700
+ }
692
701
 
693
702
  /**
694
703
  * Method for adding header to the current page
@@ -696,7 +705,7 @@ var Dialog = (function () {
696
705
  * @param title {string} panel title
697
706
  * @param className {string} [optional] HTML class name
698
707
  * @return {object} the dialog
699
- */
708
+ */
700
709
  Dialog.prototype.addHeader = function (title, className) {
701
710
  this.page[this.curpage].addHeader(title, className);
702
711
  return this;
@@ -708,7 +717,7 @@ var Dialog = (function () {
708
717
  * @param onclick {function} [optional] click event handler
709
718
  * @param className {string} [optional] class name
710
719
  * @return {object} the dialog
711
- */
720
+ */
712
721
  Dialog.prototype.addButton = function (label, onclick, className) {
713
722
  this.page[this.curpage].addButton(label, onclick, className);
714
723
  return this;
@@ -721,47 +730,45 @@ var Dialog = (function () {
721
730
  * @param onclick {function} [optional] click event handler
722
731
  * @param className {string} [optional] class name
723
732
  * @return {object} the dialog
724
- */
733
+ */
725
734
  Dialog.prototype.addLink = function (label, onclick, className, url) {
726
735
  this.page[this.curpage].addLink(label, onclick, className, url);
727
736
  return this;
728
737
  };
729
738
 
730
739
  /**
731
- * Method for adding a submit button to the current page
732
- * @method addSubmit
733
- * @param label {string} link label
734
- * @param onclick {function} [optional] click event handler
735
- * @return {object} the dialog
736
- */
740
+ * Method for adding a submit button to the current page
741
+ * @method addSubmit
742
+ * @param label {string} link label
743
+ * @param onclick {function} [optional] click event handler
744
+ * @return {object} the dialog
745
+ */
737
746
  Dialog.prototype.addSubmit = function (label, onclick) {
738
747
  this.page[this.curpage].addButton(label, onclick, 'button-panel-submit-button');
739
748
  return this;
740
749
  };
741
750
 
742
751
  /**
743
- * Method for adding a cancel link to the current page
744
- * @method addCancel
745
- * @param label {string} link label
746
- * @param onclick {function} [optional] click event handler
747
- * @return {object} the dialog
748
- */
752
+ * Method for adding a cancel link to the current page
753
+ * @method addCancel
754
+ * @param label {string} link label
755
+ * @param onclick {function} [optional] click event handler
756
+ * @return {object} the dialog
757
+ */
749
758
  Dialog.prototype.addCancel = function (label, onclick) {
750
759
  this.page[this.curpage].addLink(label, onclick, 'button-panel-cancel-link');
751
760
  return this;
752
761
  };
753
762
 
754
-
755
763
  /**
756
764
  * Method for adding new button panel to the current page
757
765
  * @return {object} the dialog
758
- */
766
+ */
759
767
  Dialog.prototype.addButtonPanel = function () {
760
768
  this.page[this.curpage].addButtonPanel();
761
769
  return this;
762
770
  };
763
771
 
764
-
765
772
  /**
766
773
  * Method for adding new panel to the current page.
767
774
  * @method addPanel
@@ -770,7 +777,7 @@ var Dialog = (function () {
770
777
  * @param className {string} [optional] HTML class name
771
778
  * @param panelButtonId {String} [optional] The unique id for the panel's button.
772
779
  * @return {object} the dialog
773
- */
780
+ */
774
781
  Dialog.prototype.addPanel = function (title, reference, className, panelButtonId) {
775
782
  this.page[this.curpage].addPanel(title, reference, className, panelButtonId);
776
783
  return this;
@@ -780,7 +787,7 @@ var Dialog = (function () {
780
787
  * @method addPage
781
788
  * @param className {string} [optional] HTML class name
782
789
  * @return {object} the dialog
783
- */
790
+ */
784
791
  Dialog.prototype.addPage = function (className) {
785
792
  new Page(this, className);
786
793
  this.page[this.curpage].hide();
@@ -791,7 +798,7 @@ var Dialog = (function () {
791
798
  * Making next page in hierarchy visible and active
792
799
  * @method nextPage
793
800
  * @return {object} the dialog
794
- */
801
+ */
795
802
  Dialog.prototype.nextPage = function () {
796
803
  this.page[this.curpage++].hide();
797
804
  if (this.curpage >= this.page.length) {
@@ -804,7 +811,7 @@ var Dialog = (function () {
804
811
  * Making previous page in hierarchy visible and active
805
812
  * @method prevPage
806
813
  * @return {object} the dialog
807
- */
814
+ */
808
815
  Dialog.prototype.prevPage = function () {
809
816
  this.page[this.curpage--].hide();
810
817
  if (this.curpage < 0) {
@@ -818,7 +825,7 @@ var Dialog = (function () {
818
825
  * @method gotoPage
819
826
  * @param num {number} page id
820
827
  * @return {object} the dialog
821
- */
828
+ */
822
829
  Dialog.prototype.gotoPage = function (num) {
823
830
  this.page[this.curpage].hide();
824
831
  this.curpage = num;
@@ -836,9 +843,9 @@ var Dialog = (function () {
836
843
  * @param pageorpanelId {number} page id or panel id
837
844
  * @param panelId {number} panel id
838
845
  * @return {object} the internal Panel object
839
- */
846
+ */
840
847
  Dialog.prototype.getPanel = function (pageorpanelId, panelId) {
841
- var pageid = (panelId == null) ? this.curpage : pageorpanelId;
848
+ var pageid = panelId == null ? this.curpage : pageorpanelId;
842
849
  if (panelId == null) {
843
850
  panelId = pageorpanelId;
844
851
  }
@@ -849,7 +856,7 @@ var Dialog = (function () {
849
856
  * @method getPage
850
857
  * @param pageid {number} page id
851
858
  * @return {object} the internal Page Object
852
- */
859
+ */
853
860
  Dialog.prototype.getPage = function (pageid) {
854
861
  return this.page[pageid];
855
862
  };
@@ -857,7 +864,7 @@ var Dialog = (function () {
857
864
  * Returns current panel at the current page
858
865
  * @method getCurrentPanel
859
866
  * @return {object} the internal Panel object
860
- */
867
+ */
861
868
  Dialog.prototype.getCurrentPanel = function () {
862
869
  return this.page[this.curpage].getCurrentPanel();
863
870
  };
@@ -868,7 +875,7 @@ var Dialog = (function () {
868
875
  * @param pageorpanel {object} panel object or page object
869
876
  * @param panel {object} panel object
870
877
  * @param panel {number} id of the panel
871
- */
878
+ */
872
879
  Dialog.prototype.gotoPanel = function (pageorpanel, panel) {
873
880
  if (panel != null) {
874
881
  var pageid = pageorpanel.id || pageorpanel;
@@ -881,35 +888,35 @@ var Dialog = (function () {
881
888
  * Shows the dialog, if it is not visible
882
889
  * @method show
883
890
  * @return {object} the dialog
884
- */
891
+ */
885
892
  Dialog.prototype.show = function () {
886
893
  this.popup.show();
887
- trigger('show.dialog', {dialog: this});
894
+ trigger('show.dialog', { dialog: this });
888
895
  return this;
889
896
  };
890
897
  /**
891
898
  * Hides the dialog, if it was visible
892
899
  * @method hide
893
900
  * @return {object} the dialog
894
- */
901
+ */
895
902
  Dialog.prototype.hide = function () {
896
903
  this.popup.hide();
897
- trigger('hide.dialog', {dialog: this});
904
+ trigger('hide.dialog', { dialog: this });
898
905
  return this;
899
906
  };
900
907
  /**
901
908
  * Removes the dialog elements from the DOM
902
909
  * @method remove
903
- */
910
+ */
904
911
  Dialog.prototype.remove = function () {
905
912
  this.popup.hide();
906
913
  this.popup.remove();
907
- trigger('remove.dialog', {dialog: this});
914
+ trigger('remove.dialog', { dialog: this });
908
915
  };
909
916
  /**
910
917
  * Disables the dialog if enabled
911
918
  * @method disable
912
- */
919
+ */
913
920
  Dialog.prototype.disable = function () {
914
921
  this.popup.disable();
915
922
  return this;
@@ -917,7 +924,7 @@ var Dialog = (function () {
917
924
  /**
918
925
  * Enables the dialog if disabled
919
926
  * @method disable
920
- */
927
+ */
921
928
  Dialog.prototype.enable = function () {
922
929
  this.popup.enable();
923
930
  return this;
@@ -935,77 +942,102 @@ var Dialog = (function () {
935
942
  Dialog.prototype.get = function (query) {
936
943
  var coll = [];
937
944
  var dialog = this;
938
- var nameExp = '#([^"][^ ]*|"[^"]*")'; // a name is a hash followed by either a bare word or quoted string
939
- var indexExp = ':(\\d+)'; // an index is a colon followed by some digits
945
+ var nameExp = '#([^"][^ ]*|"[^"]*")'; // a name is a hash followed by either a bare word or quoted string
946
+ var indexExp = ':(\\d+)'; // an index is a colon followed by some digits
940
947
  var typeExp = 'page|panel|button|header'; // one of the allowed types
941
- var selectorExp = '(?:' + // a selector is either ...
942
- '(' + typeExp + ')(?:' + nameExp + '|' + indexExp + ')?' + // a type optionally followed by either #name or :index
943
- '|' + nameExp + // or just a #name
948
+ var selectorExp =
949
+ '(?:' + // a selector is either ...
950
+ '(' +
951
+ typeExp +
952
+ ')(?:' +
953
+ nameExp +
954
+ '|' +
955
+ indexExp +
956
+ ')?' + // a type optionally followed by either #name or :index
957
+ '|' +
958
+ nameExp + // or just a #name
944
959
  ')';
945
- var queryRE = new RegExp('(?:^|,)' + // a comma or at the start of the line
946
- '\\s*' + selectorExp + // optional space and a selector
947
- '(?:\\s+' + selectorExp + ')?' + // optionally, followed by some space and a second selector
948
- '\\s*(?=,|$)', 'ig'); // followed by, but not including, a comma or the end of the string
949
- (query + '').replace(queryRE, function (all, name, title, id, justtitle, name2, title2, id2, justtitle2) {
950
- name = name && name.toLowerCase();
951
- var pages = [];
952
- if (name == 'page' && dialog.page[id]) {
953
- pages.push(dialog.page[id]);
954
- name = name2;
960
+ var queryRE = new RegExp(
961
+ '(?:^|,)' + // a comma or at the start of the line
962
+ '\\s*' +
963
+ selectorExp + // optional space and a selector
964
+ '(?:\\s+' +
965
+ selectorExp +
966
+ ')?' + // optionally, followed by some space and a second selector
967
+ '\\s*(?=,|$)',
968
+ 'ig'
969
+ ); // followed by, but not including, a comma or the end of the string
970
+ (query + '').replace(
971
+ queryRE,
972
+ function (all, name, title, id, justtitle, name2, title2, id2, justtitle2) {
955
973
  name = name && name.toLowerCase();
956
- title = title2;
957
- id = id2;
958
- justtitle = justtitle2;
959
- } else {
960
- pages = dialog.page;
961
- }
962
- title = title && (title + '').replace(/"/g, '');
963
- title2 = title2 && (title2 + '').replace(/"/g, '');
964
- justtitle = justtitle && (justtitle + '').replace(/"/g, '');
965
- justtitle2 = justtitle2 && (justtitle2 + '').replace(/"/g, '');
966
- if (name || justtitle) {
967
- for (var i = pages.length; i--;) {
968
- if (justtitle || (name == 'panel' && (title || (!title && id == null)))) {
969
- for (var j = pages[i].panel.length; j--;) {
970
- if (pages[i].panel[j].button.html() == justtitle || pages[i].panel[j].button.html() == title || (name == 'panel' && !title && id == null)) {
971
- coll.push(pages[i].panel[j]);
974
+ var pages = [];
975
+ if (name == 'page' && dialog.page[id]) {
976
+ pages.push(dialog.page[id]);
977
+ name = name2;
978
+ name = name && name.toLowerCase();
979
+ title = title2;
980
+ id = id2;
981
+ justtitle = justtitle2;
982
+ } else {
983
+ pages = dialog.page;
984
+ }
985
+ title = title && (title + '').replace(/"/g, '');
986
+ title2 = title2 && (title2 + '').replace(/"/g, '');
987
+ justtitle = justtitle && (justtitle + '').replace(/"/g, '');
988
+ justtitle2 = justtitle2 && (justtitle2 + '').replace(/"/g, '');
989
+ if (name || justtitle) {
990
+ for (var i = pages.length; i--; ) {
991
+ if (justtitle || (name == 'panel' && (title || (!title && id == null)))) {
992
+ for (var j = pages[i].panel.length; j--; ) {
993
+ if (
994
+ pages[i].panel[j].button.html() == justtitle ||
995
+ pages[i].panel[j].button.html() == title ||
996
+ (name == 'panel' && !title && id == null)
997
+ ) {
998
+ coll.push(pages[i].panel[j]);
999
+ }
972
1000
  }
973
1001
  }
974
- }
975
- if (justtitle || (name == 'button' && (title || (!title && id == null)))) {
976
- for (var j = pages[i].button.length; j--;) {
977
- if (pages[i].button[j].item.html() == justtitle || pages[i].button[j].item.html() == title || (name == 'button' && !title && id == null)) {
978
- coll.push(pages[i].button[j]);
1002
+ if (justtitle || (name == 'button' && (title || (!title && id == null)))) {
1003
+ for (var j = pages[i].button.length; j--; ) {
1004
+ if (
1005
+ pages[i].button[j].item.html() == justtitle ||
1006
+ pages[i].button[j].item.html() == title ||
1007
+ (name == 'button' && !title && id == null)
1008
+ ) {
1009
+ coll.push(pages[i].button[j]);
1010
+ }
979
1011
  }
980
1012
  }
1013
+ if (pages[i][name] && pages[i][name][id]) {
1014
+ coll.push(pages[i][name][id]);
1015
+ }
1016
+ if (name == 'header' && pages[i].header) {
1017
+ coll.push(pages[i].header);
1018
+ }
981
1019
  }
982
- if (pages[i][name] && pages[i][name][id]) {
983
- coll.push(pages[i][name][id]);
984
- }
985
- if (name == 'header' && pages[i].header) {
986
- coll.push(pages[i].header);
987
- }
1020
+ } else {
1021
+ coll = coll.concat(pages);
988
1022
  }
989
- } else {
990
- coll = coll.concat(pages);
991
1023
  }
992
- });
1024
+ );
993
1025
  var res = {
994
- length: coll.length
1026
+ length: coll.length,
995
1027
  };
996
- for (var i = coll.length; i--;) {
1028
+ for (var i = coll.length; i--; ) {
997
1029
  res[i] = coll[i];
998
1030
  for (var method in coll[i]) {
999
1031
  if (!(method in res)) {
1000
1032
  (function (m) {
1001
1033
  res[m] = function () {
1002
- for (var j = this.length; j--;) {
1034
+ for (var j = this.length; j--; ) {
1003
1035
  if (typeof this[j][m] === 'function') {
1004
1036
  this[j][m].apply(this[j], arguments);
1005
1037
  }
1006
1038
  }
1007
1039
  };
1008
- }(method));
1040
+ })(method);
1009
1041
  }
1010
1042
  }
1011
1043
  }
@@ -1019,17 +1051,21 @@ var Dialog = (function () {
1019
1051
  */
1020
1052
  Dialog.prototype.updateHeight = function () {
1021
1053
  var height = 0;
1022
- var maxDialogHeight = $(window).height() - HEADER_HEIGHT - BUTTONS_HEIGHT - (MIN_DIALOG_VERTICAL_BUFFER * 2);
1054
+ var maxDialogHeight =
1055
+ $(window).height() - HEADER_HEIGHT - BUTTONS_HEIGHT - MIN_DIALOG_VERTICAL_BUFFER * 2;
1023
1056
  for (var i = 0; this.getPanel(i); i++) {
1024
- if (this.getPanel(i).body.css({height: 'auto', display: 'block'}).outerHeight() > height) {
1057
+ if (
1058
+ this.getPanel(i).body.css({ height: 'auto', display: 'block' }).outerHeight() >
1059
+ height
1060
+ ) {
1025
1061
  height = Math.min(maxDialogHeight, this.getPanel(i).body.outerHeight());
1026
1062
  }
1027
1063
  if (i !== this.page[this.curpage].curtab) {
1028
- this.getPanel(i).body.css({display: 'none'});
1064
+ this.getPanel(i).body.css({ display: 'none' });
1029
1065
  }
1030
1066
  }
1031
1067
  for (i = 0; this.getPanel(i); i++) {
1032
- this.getPanel(i).body.css({height: height || this.height});
1068
+ this.getPanel(i).body.css({ height: height || this.height });
1033
1069
  }
1034
1070
  this.page[0].menu.height(height);
1035
1071
  this.height = height + HEADER_HEIGHT + BUTTONS_HEIGHT + 1;
@@ -1042,7 +1078,9 @@ var Dialog = (function () {
1042
1078
  * @method isMaximised
1043
1079
  */
1044
1080
  Dialog.prototype.isMaximised = function () {
1045
- return this.popup.element.outerHeight() >= $(window).height() - (MIN_DIALOG_VERTICAL_BUFFER * 2);
1081
+ return (
1082
+ this.popup.element.outerHeight() >= $(window).height() - MIN_DIALOG_VERTICAL_BUFFER * 2
1083
+ );
1046
1084
  };
1047
1085
 
1048
1086
  /**
@@ -1062,21 +1100,17 @@ var Dialog = (function () {
1062
1100
  };
1063
1101
 
1064
1102
  return Dialog;
1065
-
1066
- }());
1103
+ })();
1067
1104
 
1068
1105
  Dialog = deprecate.construct(Dialog, 'Dialog constructor', {
1069
- alternativeName: 'Dialog2'
1106
+ alternativeName: 'Dialog2',
1070
1107
  });
1071
1108
 
1072
1109
  createPopup = deprecate.construct(createPopup, 'Dialog popup constructor', {
1073
- alternatveName: 'Dialog2'
1110
+ alternatveName: 'Dialog2',
1074
1111
  });
1075
1112
 
1076
1113
  globalize('Dialog', Dialog);
1077
1114
  globalize('popup', createPopup);
1078
1115
 
1079
- export {
1080
- Dialog,
1081
- createPopup as popup
1082
- };
1116
+ export { Dialog, createPopup as popup };