3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
12 <link rel=
"canonical" href=
"https://docs.woltlab.com/5.4/javascript/new-api_ui/">
14 <link rel=
"icon" href=
"../../assets/default.favicon.ico">
15 <meta name=
"generator" content=
"mkdocs-1.1.2, mkdocs-material-7.1.2">
19 <title>User Interface - WoltLab Suite Documentation
</title>
23 <link rel=
"stylesheet" href=
"../../assets/stylesheets/main.6f955dcd.min.css">
26 <link rel=
"stylesheet" href=
"../../assets/stylesheets/palette.ef6f36e2.min.css">
30 <meta name=
"theme-color" content=
"#009485">
40 <link rel=
"stylesheet" href=
"../../stylesheets/extra.css">
54 <body dir=
"ltr" data-md-color-scheme=
"" data-md-color-primary=
"teal" data-md-color-accent=
"">
57 <script>function __prefix(e){return new URL(
"../..",location).pathname+
"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}
</script>
59 <input class=
"md-toggle" data-md-toggle=
"drawer" type=
"checkbox" id=
"__drawer" autocomplete=
"off">
60 <input class=
"md-toggle" data-md-toggle=
"search" type=
"checkbox" id=
"__search" autocomplete=
"off">
61 <label class=
"md-overlay" for=
"__drawer"></label>
62 <div data-md-component=
"skip">
65 <a href=
"#user-interface-javascript-api" class=
"md-skip">
70 <div data-md-component=
"announce">
72 <aside class=
"md-announce">
73 <div class=
"md-announce__inner md-grid md-typeset">
75 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
82 <header class=
"md-header" data-md-component=
"header">
83 <nav class=
"md-header__inner md-grid" aria-label=
"Header">
84 <a href=
"../.." title=
"WoltLab Suite Documentation" class=
"md-header__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
86 <img src=
"../../assets/logo.png" alt=
"logo">
89 <label class=
"md-header__button md-icon" for=
"__drawer">
90 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
92 <div class=
"md-header__title" data-md-component=
"header-title">
93 <div class=
"md-header__ellipsis">
94 <div class=
"md-header__topic">
95 <span class=
"md-ellipsis">
96 WoltLab Suite Documentation
99 <div class=
"md-header__topic" data-md-component=
"header-topic">
100 <span class=
"md-ellipsis">
111 <label class=
"md-header__button md-icon" for=
"__search">
112 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
115 <div class=
"md-search" data-md-component=
"search" role=
"dialog">
116 <label class=
"md-search__overlay" for=
"__search"></label>
117 <div class=
"md-search__inner" role=
"search">
118 <form class=
"md-search__form" name=
"search">
119 <input type=
"text" class=
"md-search__input" name=
"query" aria-label=
"Search" placeholder=
"Search" autocapitalize=
"off" autocorrect=
"off" autocomplete=
"off" spellcheck=
"false" data-md-component=
"search-query" data-md-state=
"active" required
>
120 <label class=
"md-search__icon md-icon" for=
"__search">
121 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
122 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
124 <button type=
"reset" class=
"md-search__icon md-icon" aria-label=
"Clear" tabindex=
"-1">
125 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
128 <div class=
"md-search__output">
129 <div class=
"md-search__scrollwrap" data-md-scrollfix
>
130 <div class=
"md-search-result" data-md-component=
"search-result">
131 <div class=
"md-search-result__meta">
134 <ol class=
"md-search-result__list"></ol>
142 <div class=
"md-header__source">
144 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
145 <div class=
"md-source__icon md-icon">
147 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
149 <div class=
"md-source__repository">
158 <div class=
"md-container" data-md-component=
"container">
163 <main class=
"md-main" data-md-component=
"main">
164 <div class=
"md-main__inner md-grid">
168 <div class=
"md-sidebar md-sidebar--primary" data-md-component=
"sidebar" data-md-type=
"navigation" >
169 <div class=
"md-sidebar__scrollwrap">
170 <div class=
"md-sidebar__inner">
174 <nav class=
"md-nav md-nav--primary" aria-label=
"Navigation" data-md-level=
"0">
175 <label class=
"md-nav__title" for=
"__drawer">
176 <a href=
"../.." title=
"WoltLab Suite Documentation" class=
"md-nav__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
178 <img src=
"../../assets/logo.png" alt=
"logo">
181 WoltLab Suite Documentation
184 <div class=
"md-nav__source">
186 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
187 <div class=
"md-source__icon md-icon">
189 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
191 <div class=
"md-source__repository">
197 <ul class=
"md-nav__list" data-md-scrollfix
>
206 <li class=
"md-nav__item">
207 <a href=
"../../getting-started/" class=
"md-nav__link">
222 <li class=
"md-nav__item md-nav__item--nested">
225 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2" type=
"checkbox" id=
"__nav_2" >
227 <label class=
"md-nav__link" for=
"__nav_2">
229 <span class=
"md-nav__icon md-icon"></span>
231 <nav class=
"md-nav" aria-label=
"PHP API" data-md-level=
"1">
232 <label class=
"md-nav__title" for=
"__nav_2">
233 <span class=
"md-nav__icon md-icon"></span>
236 <ul class=
"md-nav__list" data-md-scrollfix
>
242 <li class=
"md-nav__item">
243 <a href=
"../../php/pages/" class=
"md-nav__link">
254 <li class=
"md-nav__item">
255 <a href=
"../../php/database-objects/" class=
"md-nav__link">
266 <li class=
"md-nav__item">
267 <a href=
"../../php/database-access/" class=
"md-nav__link">
278 <li class=
"md-nav__item">
279 <a href=
"../../php/exceptions/" class=
"md-nav__link">
291 <li class=
"md-nav__item md-nav__item--nested">
294 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5" type=
"checkbox" id=
"__nav_2_5" >
296 <label class=
"md-nav__link" for=
"__nav_2_5">
298 <span class=
"md-nav__icon md-icon"></span>
300 <nav class=
"md-nav" aria-label=
"API" data-md-level=
"2">
301 <label class=
"md-nav__title" for=
"__nav_2_5">
302 <span class=
"md-nav__icon md-icon"></span>
305 <ul class=
"md-nav__list" data-md-scrollfix
>
312 <li class=
"md-nav__item md-nav__item--nested">
315 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_1" type=
"checkbox" id=
"__nav_2_5_1" >
317 <label class=
"md-nav__link" for=
"__nav_2_5_1">
319 <span class=
"md-nav__icon md-icon"></span>
321 <nav class=
"md-nav" aria-label=
"Caches" data-md-level=
"3">
322 <label class=
"md-nav__title" for=
"__nav_2_5_1">
323 <span class=
"md-nav__icon md-icon"></span>
326 <ul class=
"md-nav__list" data-md-scrollfix
>
332 <li class=
"md-nav__item">
333 <a href=
"../../php/api/caches/" class=
"md-nav__link">
344 <li class=
"md-nav__item">
345 <a href=
"../../php/api/caches_persistent-caches/" class=
"md-nav__link">
356 <li class=
"md-nav__item">
357 <a href=
"../../php/api/caches_runtime-caches/" class=
"md-nav__link">
374 <li class=
"md-nav__item">
375 <a href=
"../../php/api/comments/" class=
"md-nav__link">
386 <li class=
"md-nav__item">
387 <a href=
"../../php/api/cronjobs/" class=
"md-nav__link">
398 <li class=
"md-nav__item">
399 <a href=
"../../php/api/events/" class=
"md-nav__link">
411 <li class=
"md-nav__item md-nav__item--nested">
414 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_5" type=
"checkbox" id=
"__nav_2_5_5" >
416 <label class=
"md-nav__link" for=
"__nav_2_5_5">
418 <span class=
"md-nav__icon md-icon"></span>
420 <nav class=
"md-nav" aria-label=
"Form Builder" data-md-level=
"3">
421 <label class=
"md-nav__title" for=
"__nav_2_5_5">
422 <span class=
"md-nav__icon md-icon"></span>
425 <ul class=
"md-nav__list" data-md-scrollfix
>
431 <li class=
"md-nav__item">
432 <a href=
"../../php/api/form_builder/overview/" class=
"md-nav__link">
443 <li class=
"md-nav__item">
444 <a href=
"../../php/api/form_builder/structure/" class=
"md-nav__link">
455 <li class=
"md-nav__item">
456 <a href=
"../../php/api/form_builder/form_fields/" class=
"md-nav__link">
467 <li class=
"md-nav__item">
468 <a href=
"../../php/api/form_builder/validation_data/" class=
"md-nav__link">
479 <li class=
"md-nav__item">
480 <a href=
"../../php/api/form_builder/dependencies/" class=
"md-nav__link">
497 <li class=
"md-nav__item">
498 <a href=
"../../php/api/package_installation_plugins/" class=
"md-nav__link">
499 Package Installation Plugins
509 <li class=
"md-nav__item">
510 <a href=
"../../php/api/user_activity_points/" class=
"md-nav__link">
521 <li class=
"md-nav__item">
522 <a href=
"../../php/api/user_notifications/" class=
"md-nav__link">
533 <li class=
"md-nav__item">
534 <a href=
"../../php/api/sitemaps/" class=
"md-nav__link">
551 <li class=
"md-nav__item">
552 <a href=
"../../php/code-style/" class=
"md-nav__link">
563 <li class=
"md-nav__item">
564 <a href=
"../../php/apps/" class=
"md-nav__link">
575 <li class=
"md-nav__item">
576 <a href=
"../../php/gdpr/" class=
"md-nav__link">
597 <li class=
"md-nav__item md-nav__item--nested">
600 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_3" type=
"checkbox" id=
"__nav_3" >
602 <label class=
"md-nav__link" for=
"__nav_3">
603 Languages, Templates & CSS
604 <span class=
"md-nav__icon md-icon"></span>
606 <nav class=
"md-nav" aria-label=
"Languages, Templates & CSS" data-md-level=
"1">
607 <label class=
"md-nav__title" for=
"__nav_3">
608 <span class=
"md-nav__icon md-icon"></span>
609 Languages, Templates & CSS
611 <ul class=
"md-nav__list" data-md-scrollfix
>
617 <li class=
"md-nav__item">
618 <a href=
"../../view/languages/" class=
"md-nav__link">
629 <li class=
"md-nav__item">
630 <a href=
"../../view/templates/" class=
"md-nav__link">
641 <li class=
"md-nav__item">
642 <a href=
"../../view/template-plugins/" class=
"md-nav__link">
653 <li class=
"md-nav__item">
654 <a href=
"../../view/css/" class=
"md-nav__link">
677 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
680 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4" type=
"checkbox" id=
"__nav_4" checked
>
682 <label class=
"md-nav__link" for=
"__nav_4">
683 TypeScript and JavaScript API
684 <span class=
"md-nav__icon md-icon"></span>
686 <nav class=
"md-nav" aria-label=
"TypeScript and JavaScript API" data-md-level=
"1">
687 <label class=
"md-nav__title" for=
"__nav_4">
688 <span class=
"md-nav__icon md-icon"></span>
689 TypeScript and JavaScript API
691 <ul class=
"md-nav__list" data-md-scrollfix
>
697 <li class=
"md-nav__item">
698 <a href=
"../general-usage/" class=
"md-nav__link">
709 <li class=
"md-nav__item">
710 <a href=
"../typescript/" class=
"md-nav__link">
724 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
727 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4_3" type=
"checkbox" id=
"__nav_4_3" checked
>
729 <label class=
"md-nav__link" for=
"__nav_4_3">
731 <span class=
"md-nav__icon md-icon"></span>
733 <nav class=
"md-nav" aria-label=
"New API" data-md-level=
"2">
734 <label class=
"md-nav__title" for=
"__nav_4_3">
735 <span class=
"md-nav__icon md-icon"></span>
738 <ul class=
"md-nav__list" data-md-scrollfix
>
744 <li class=
"md-nav__item">
745 <a href=
"../new-api_writing-a-module/" class=
"md-nav__link">
756 <li class=
"md-nav__item">
757 <a href=
"../new-api_data-structures/" class=
"md-nav__link">
768 <li class=
"md-nav__item">
769 <a href=
"../new-api_core/" class=
"md-nav__link">
780 <li class=
"md-nav__item">
781 <a href=
"../new-api_dom/" class=
"md-nav__link">
792 <li class=
"md-nav__item">
793 <a href=
"../new-api_events/" class=
"md-nav__link">
804 <li class=
"md-nav__item">
805 <a href=
"../new-api_ajax/" class=
"md-nav__link">
816 <li class=
"md-nav__item">
817 <a href=
"../new-api_dialogs/" class=
"md-nav__link">
828 <li class=
"md-nav__item">
829 <a href=
"../new-api_browser/" class=
"md-nav__link">
830 Browser and Screen Sizes
842 <li class=
"md-nav__item md-nav__item--active">
844 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"toc" type=
"checkbox" id=
"__toc">
850 <label class=
"md-nav__link md-nav__link--active" for=
"__toc">
852 <span class=
"md-nav__icon md-icon"></span>
855 <a href=
"./" class=
"md-nav__link md-nav__link--active">
860 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
867 <label class=
"md-nav__title" for=
"__toc">
868 <span class=
"md-nav__icon md-icon"></span>
871 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
873 <li class=
"md-nav__item">
874 <a href=
"#uialignment" class=
"md-nav__link">
878 <nav class=
"md-nav" aria-label=
"Ui/Alignment">
879 <ul class=
"md-nav__list">
881 <li class=
"md-nav__item">
882 <a href=
"#setelement-element-referenceelement-element-options-object" class=
"md-nav__link">
883 set(element: Element, referenceElement: Element, options: Object)
886 <nav class=
"md-nav" aria-label=
"set(element: Element, referenceElement: Element, options: Object)">
887 <ul class=
"md-nav__list">
889 <li class=
"md-nav__item">
890 <a href=
"#verticaloffset-number" class=
"md-nav__link">
891 verticalOffset: number
896 <li class=
"md-nav__item">
897 <a href=
"#pointer-boolean" class=
"md-nav__link">
903 <li class=
"md-nav__item">
904 <a href=
"#pointeroffset-number" class=
"md-nav__link">
905 pointerOffset: number
910 <li class=
"md-nav__item">
911 <a href=
"#pointerclassnames-string" class=
"md-nav__link">
912 pointerClassNames: string[]
917 <li class=
"md-nav__item">
918 <a href=
"#refdimensionselement-element" class=
"md-nav__link">
919 refDimensionsElement: Element
924 <li class=
"md-nav__item">
925 <a href=
"#horizontal-string" class=
"md-nav__link">
931 <li class=
"md-nav__item">
932 <a href=
"#vertical-string" class=
"md-nav__link">
938 <li class=
"md-nav__item">
939 <a href=
"#allowflip-string" class=
"md-nav__link">
955 <li class=
"md-nav__item">
956 <a href=
"#uicloseoverlay" class=
"md-nav__link">
960 <nav class=
"md-nav" aria-label=
"Ui/CloseOverlay">
961 <ul class=
"md-nav__list">
963 <li class=
"md-nav__item">
964 <a href=
"#addidentifier-string-callback-void" class=
"md-nav__link">
965 add(identifier: string, callback: () =
> void)
975 <li class=
"md-nav__item">
976 <a href=
"#uiconfirmation" class=
"md-nav__link">
980 <nav class=
"md-nav" aria-label=
"Ui/Confirmation">
981 <ul class=
"md-nav__list">
983 <li class=
"md-nav__item">
984 <a href=
"#showoptions-object" class=
"md-nav__link">
985 show(options: Object)
988 <nav class=
"md-nav" aria-label=
"show(options: Object)">
989 <ul class=
"md-nav__list">
991 <li class=
"md-nav__item">
992 <a href=
"#cancel-parameters-object-void" class=
"md-nav__link">
993 cancel: (parameters: Object) =
> void
998 <li class=
"md-nav__item">
999 <a href=
"#confirm-parameters-object-void" class=
"md-nav__link">
1000 confirm: (parameters: Object) =
> void
1005 <li class=
"md-nav__item">
1006 <a href=
"#message-string" class=
"md-nav__link">
1012 <li class=
"md-nav__item">
1013 <a href=
"#messageishtml" class=
"md-nav__link">
1019 <li class=
"md-nav__item">
1020 <a href=
"#parameters-object" class=
"md-nav__link">
1026 <li class=
"md-nav__item">
1027 <a href=
"#template-string" class=
"md-nav__link">
1043 <li class=
"md-nav__item">
1044 <a href=
"#uinotification" class=
"md-nav__link">
1048 <nav class=
"md-nav" aria-label=
"Ui/Notification">
1049 <ul class=
"md-nav__list">
1051 <li class=
"md-nav__item">
1052 <a href=
"#showmessage-string-callback-void-cssclassname-string" class=
"md-nav__link">
1053 show(message: string, callback?: () =
> void, cssClassName?: string)
1081 <li class=
"md-nav__item">
1082 <a href=
"../legacy-api/" class=
"md-nav__link">
1093 <li class=
"md-nav__item">
1094 <a href=
"../helper-functions/" class=
"md-nav__link">
1105 <li class=
"md-nav__item">
1106 <a href=
"../code-snippets/" class=
"md-nav__link">
1127 <li class=
"md-nav__item md-nav__item--nested">
1130 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5" type=
"checkbox" id=
"__nav_5" >
1132 <label class=
"md-nav__link" for=
"__nav_5">
1134 <span class=
"md-nav__icon md-icon"></span>
1136 <nav class=
"md-nav" aria-label=
"Package Components" data-md-level=
"1">
1137 <label class=
"md-nav__title" for=
"__nav_5">
1138 <span class=
"md-nav__icon md-icon"></span>
1141 <ul class=
"md-nav__list" data-md-scrollfix
>
1147 <li class=
"md-nav__item">
1148 <a href=
"../../package/package-xml/" class=
"md-nav__link">
1160 <li class=
"md-nav__item md-nav__item--nested">
1163 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5_2" type=
"checkbox" id=
"__nav_5_2" >
1165 <label class=
"md-nav__link" for=
"__nav_5_2">
1167 <span class=
"md-nav__icon md-icon"></span>
1169 <nav class=
"md-nav" aria-label=
"PIPs" data-md-level=
"2">
1170 <label class=
"md-nav__title" for=
"__nav_5_2">
1171 <span class=
"md-nav__icon md-icon"></span>
1174 <ul class=
"md-nav__list" data-md-scrollfix
>
1180 <li class=
"md-nav__item">
1181 <a href=
"../../package/pip/" class=
"md-nav__link">
1192 <li class=
"md-nav__item">
1193 <a href=
"../../package/pip/acl-option/" class=
"md-nav__link">
1204 <li class=
"md-nav__item">
1205 <a href=
"../../package/pip/acp-menu/" class=
"md-nav__link">
1216 <li class=
"md-nav__item">
1217 <a href=
"../../package/pip/acp-search-provider/" class=
"md-nav__link">
1228 <li class=
"md-nav__item">
1229 <a href=
"../../package/pip/acp-template/" class=
"md-nav__link">
1240 <li class=
"md-nav__item">
1241 <a href=
"../../package/pip/bbcode/" class=
"md-nav__link">
1252 <li class=
"md-nav__item">
1253 <a href=
"../../package/pip/box/" class=
"md-nav__link">
1264 <li class=
"md-nav__item">
1265 <a href=
"../../package/pip/clipboard-action/" class=
"md-nav__link">
1276 <li class=
"md-nav__item">
1277 <a href=
"../../package/pip/core-object/" class=
"md-nav__link">
1288 <li class=
"md-nav__item">
1289 <a href=
"../../package/pip/cronjob/" class=
"md-nav__link">
1300 <li class=
"md-nav__item">
1301 <a href=
"../../package/pip/database/" class=
"md-nav__link">
1312 <li class=
"md-nav__item">
1313 <a href=
"../../package/pip/event-listener/" class=
"md-nav__link">
1324 <li class=
"md-nav__item">
1325 <a href=
"../../package/pip/file/" class=
"md-nav__link">
1336 <li class=
"md-nav__item">
1337 <a href=
"../../package/pip/language/" class=
"md-nav__link">
1348 <li class=
"md-nav__item">
1349 <a href=
"../../package/pip/media-provider/" class=
"md-nav__link">
1360 <li class=
"md-nav__item">
1361 <a href=
"../../package/pip/menu/" class=
"md-nav__link">
1372 <li class=
"md-nav__item">
1373 <a href=
"../../package/pip/menu-item/" class=
"md-nav__link">
1384 <li class=
"md-nav__item">
1385 <a href=
"../../package/pip/object-type/" class=
"md-nav__link">
1396 <li class=
"md-nav__item">
1397 <a href=
"../../package/pip/object-type-definition/" class=
"md-nav__link">
1398 objectTypeDefinition
1408 <li class=
"md-nav__item">
1409 <a href=
"../../package/pip/option/" class=
"md-nav__link">
1420 <li class=
"md-nav__item">
1421 <a href=
"../../package/pip/page/" class=
"md-nav__link">
1432 <li class=
"md-nav__item">
1433 <a href=
"../../package/pip/pip/" class=
"md-nav__link">
1444 <li class=
"md-nav__item">
1445 <a href=
"../../package/pip/script/" class=
"md-nav__link">
1456 <li class=
"md-nav__item">
1457 <a href=
"../../package/pip/smiley/" class=
"md-nav__link">
1468 <li class=
"md-nav__item">
1469 <a href=
"../../package/pip/sql/" class=
"md-nav__link">
1480 <li class=
"md-nav__item">
1481 <a href=
"../../package/pip/style/" class=
"md-nav__link">
1492 <li class=
"md-nav__item">
1493 <a href=
"../../package/pip/template/" class=
"md-nav__link">
1504 <li class=
"md-nav__item">
1505 <a href=
"../../package/pip/template-listener/" class=
"md-nav__link">
1516 <li class=
"md-nav__item">
1517 <a href=
"../../package/pip/user-group-option/" class=
"md-nav__link">
1528 <li class=
"md-nav__item">
1529 <a href=
"../../package/pip/user-menu/" class=
"md-nav__link">
1540 <li class=
"md-nav__item">
1541 <a href=
"../../package/pip/user-notification-event/" class=
"md-nav__link">
1542 userNotificationEvent
1552 <li class=
"md-nav__item">
1553 <a href=
"../../package/pip/user-option/" class=
"md-nav__link">
1564 <li class=
"md-nav__item">
1565 <a href=
"../../package/pip/user-profile-menu/" class=
"md-nav__link">
1582 <li class=
"md-nav__item">
1583 <a href=
"../../package/database-php-api/" class=
"md-nav__link">
1604 <li class=
"md-nav__item md-nav__item--nested">
1607 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6" type=
"checkbox" id=
"__nav_6" >
1609 <label class=
"md-nav__link" for=
"__nav_6">
1611 <span class=
"md-nav__icon md-icon"></span>
1613 <nav class=
"md-nav" aria-label=
"Migration" data-md-level=
"1">
1614 <label class=
"md-nav__title" for=
"__nav_6">
1615 <span class=
"md-nav__icon md-icon"></span>
1618 <ul class=
"md-nav__list" data-md-scrollfix
>
1625 <li class=
"md-nav__item md-nav__item--nested">
1628 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_1" type=
"checkbox" id=
"__nav_6_1" >
1630 <label class=
"md-nav__link" for=
"__nav_6_1">
1631 Migrating from WSC
5.3
1632 <span class=
"md-nav__icon md-icon"></span>
1634 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.3" data-md-level=
"2">
1635 <label class=
"md-nav__title" for=
"__nav_6_1">
1636 <span class=
"md-nav__icon md-icon"></span>
1637 Migrating from WSC
5.3
1639 <ul class=
"md-nav__list" data-md-scrollfix
>
1645 <li class=
"md-nav__item">
1646 <a href=
"../../migration/wsc53/php/" class=
"md-nav__link">
1657 <li class=
"md-nav__item">
1658 <a href=
"../../migration/wsc53/session/" class=
"md-nav__link">
1659 Session Handling and Authentication
1669 <li class=
"md-nav__item">
1670 <a href=
"../../migration/wsc53/javascript/" class=
"md-nav__link">
1671 TypeScript and JavaScript
1681 <li class=
"md-nav__item">
1682 <a href=
"../../migration/wsc53/templates/" class=
"md-nav__link">
1693 <li class=
"md-nav__item">
1694 <a href=
"../../migration/wsc53/libraries/" class=
"md-nav__link">
1695 Third Party Libraries
1712 <li class=
"md-nav__item md-nav__item--nested">
1715 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_2" type=
"checkbox" id=
"__nav_6_2" >
1717 <label class=
"md-nav__link" for=
"__nav_6_2">
1718 Migrating from WSC
5.2
1719 <span class=
"md-nav__icon md-icon"></span>
1721 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.2" data-md-level=
"2">
1722 <label class=
"md-nav__title" for=
"__nav_6_2">
1723 <span class=
"md-nav__icon md-icon"></span>
1724 Migrating from WSC
5.2
1726 <ul class=
"md-nav__list" data-md-scrollfix
>
1732 <li class=
"md-nav__item">
1733 <a href=
"../../migration/wsc52/php/" class=
"md-nav__link">
1744 <li class=
"md-nav__item">
1745 <a href=
"../../migration/wsc52/templates/" class=
"md-nav__link">
1746 Templates and Languages
1756 <li class=
"md-nav__item">
1757 <a href=
"../../migration/wsc52/libraries/" class=
"md-nav__link">
1758 Third Party Libraries
1775 <li class=
"md-nav__item md-nav__item--nested">
1778 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_3" type=
"checkbox" id=
"__nav_6_3" >
1780 <label class=
"md-nav__link" for=
"__nav_6_3">
1781 Migrating from WSC
3.1
1782 <span class=
"md-nav__icon md-icon"></span>
1784 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.1" data-md-level=
"2">
1785 <label class=
"md-nav__title" for=
"__nav_6_3">
1786 <span class=
"md-nav__icon md-icon"></span>
1787 Migrating from WSC
3.1
1789 <ul class=
"md-nav__list" data-md-scrollfix
>
1795 <li class=
"md-nav__item">
1796 <a href=
"../../migration/wsc31/php/" class=
"md-nav__link">
1814 <li class=
"md-nav__item md-nav__item--nested">
1817 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_4" type=
"checkbox" id=
"__nav_6_4" >
1819 <label class=
"md-nav__link" for=
"__nav_6_4">
1820 Migrating from WSC
3.0
1821 <span class=
"md-nav__icon md-icon"></span>
1823 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.0" data-md-level=
"2">
1824 <label class=
"md-nav__title" for=
"__nav_6_4">
1825 <span class=
"md-nav__icon md-icon"></span>
1826 Migrating from WSC
3.0
1828 <ul class=
"md-nav__list" data-md-scrollfix
>
1834 <li class=
"md-nav__item">
1835 <a href=
"../../migration/wsc30/php/" class=
"md-nav__link">
1846 <li class=
"md-nav__item">
1847 <a href=
"../../migration/wsc30/javascript/" class=
"md-nav__link">
1858 <li class=
"md-nav__item">
1859 <a href=
"../../migration/wsc30/templates/" class=
"md-nav__link">
1870 <li class=
"md-nav__item">
1871 <a href=
"../../migration/wsc30/css/" class=
"md-nav__link">
1882 <li class=
"md-nav__item">
1883 <a href=
"../../migration/wsc30/package/" class=
"md-nav__link">
1901 <li class=
"md-nav__item md-nav__item--nested">
1904 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_5" type=
"checkbox" id=
"__nav_6_5" >
1906 <label class=
"md-nav__link" for=
"__nav_6_5">
1907 Migrating from WCF
2.1
1908 <span class=
"md-nav__icon md-icon"></span>
1910 <nav class=
"md-nav" aria-label=
"Migrating from WCF 2.1" data-md-level=
"2">
1911 <label class=
"md-nav__title" for=
"__nav_6_5">
1912 <span class=
"md-nav__icon md-icon"></span>
1913 Migrating from WCF
2.1
1915 <ul class=
"md-nav__list" data-md-scrollfix
>
1921 <li class=
"md-nav__item">
1922 <a href=
"../../migration/wcf21/php/" class=
"md-nav__link">
1933 <li class=
"md-nav__item">
1934 <a href=
"../../migration/wcf21/templates/" class=
"md-nav__link">
1945 <li class=
"md-nav__item">
1946 <a href=
"../../migration/wcf21/css/" class=
"md-nav__link">
1957 <li class=
"md-nav__item">
1958 <a href=
"../../migration/wcf21/package/" class=
"md-nav__link">
1985 <li class=
"md-nav__item md-nav__item--nested">
1988 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7" type=
"checkbox" id=
"__nav_7" >
1990 <label class=
"md-nav__link" for=
"__nav_7">
1992 <span class=
"md-nav__icon md-icon"></span>
1994 <nav class=
"md-nav" aria-label=
"Tutorials" data-md-level=
"1">
1995 <label class=
"md-nav__title" for=
"__nav_7">
1996 <span class=
"md-nav__icon md-icon"></span>
1999 <ul class=
"md-nav__list" data-md-scrollfix
>
2006 <li class=
"md-nav__item md-nav__item--nested">
2009 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7_1" type=
"checkbox" id=
"__nav_7_1" >
2011 <label class=
"md-nav__link" for=
"__nav_7_1">
2013 <span class=
"md-nav__icon md-icon"></span>
2015 <nav class=
"md-nav" aria-label=
"Tutorial Series" data-md-level=
"2">
2016 <label class=
"md-nav__title" for=
"__nav_7_1">
2017 <span class=
"md-nav__icon md-icon"></span>
2020 <ul class=
"md-nav__list" data-md-scrollfix
>
2026 <li class=
"md-nav__item">
2027 <a href=
"../../tutorial/series/overview/" class=
"md-nav__link">
2038 <li class=
"md-nav__item">
2039 <a href=
"../../tutorial/series/part_1/" class=
"md-nav__link">
2050 <li class=
"md-nav__item">
2051 <a href=
"../../tutorial/series/part_2/" class=
"md-nav__link">
2062 <li class=
"md-nav__item">
2063 <a href=
"../../tutorial/series/part_3/" class=
"md-nav__link">
2074 <li class=
"md-nav__item">
2075 <a href=
"../../tutorial/series/part_4/" class=
"md-nav__link">
2086 <li class=
"md-nav__item">
2087 <a href=
"../../tutorial/series/part_5/" class=
"md-nav__link">
2114 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
2115 <div class=
"md-sidebar__scrollwrap">
2116 <div class=
"md-sidebar__inner">
2118 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
2125 <label class=
"md-nav__title" for=
"__toc">
2126 <span class=
"md-nav__icon md-icon"></span>
2129 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
2131 <li class=
"md-nav__item">
2132 <a href=
"#uialignment" class=
"md-nav__link">
2136 <nav class=
"md-nav" aria-label=
"Ui/Alignment">
2137 <ul class=
"md-nav__list">
2139 <li class=
"md-nav__item">
2140 <a href=
"#setelement-element-referenceelement-element-options-object" class=
"md-nav__link">
2141 set(element: Element, referenceElement: Element, options: Object)
2144 <nav class=
"md-nav" aria-label=
"set(element: Element, referenceElement: Element, options: Object)">
2145 <ul class=
"md-nav__list">
2147 <li class=
"md-nav__item">
2148 <a href=
"#verticaloffset-number" class=
"md-nav__link">
2149 verticalOffset: number
2154 <li class=
"md-nav__item">
2155 <a href=
"#pointer-boolean" class=
"md-nav__link">
2161 <li class=
"md-nav__item">
2162 <a href=
"#pointeroffset-number" class=
"md-nav__link">
2163 pointerOffset: number
2168 <li class=
"md-nav__item">
2169 <a href=
"#pointerclassnames-string" class=
"md-nav__link">
2170 pointerClassNames: string[]
2175 <li class=
"md-nav__item">
2176 <a href=
"#refdimensionselement-element" class=
"md-nav__link">
2177 refDimensionsElement: Element
2182 <li class=
"md-nav__item">
2183 <a href=
"#horizontal-string" class=
"md-nav__link">
2189 <li class=
"md-nav__item">
2190 <a href=
"#vertical-string" class=
"md-nav__link">
2196 <li class=
"md-nav__item">
2197 <a href=
"#allowflip-string" class=
"md-nav__link">
2213 <li class=
"md-nav__item">
2214 <a href=
"#uicloseoverlay" class=
"md-nav__link">
2218 <nav class=
"md-nav" aria-label=
"Ui/CloseOverlay">
2219 <ul class=
"md-nav__list">
2221 <li class=
"md-nav__item">
2222 <a href=
"#addidentifier-string-callback-void" class=
"md-nav__link">
2223 add(identifier: string, callback: () =
> void)
2233 <li class=
"md-nav__item">
2234 <a href=
"#uiconfirmation" class=
"md-nav__link">
2238 <nav class=
"md-nav" aria-label=
"Ui/Confirmation">
2239 <ul class=
"md-nav__list">
2241 <li class=
"md-nav__item">
2242 <a href=
"#showoptions-object" class=
"md-nav__link">
2243 show(options: Object)
2246 <nav class=
"md-nav" aria-label=
"show(options: Object)">
2247 <ul class=
"md-nav__list">
2249 <li class=
"md-nav__item">
2250 <a href=
"#cancel-parameters-object-void" class=
"md-nav__link">
2251 cancel: (parameters: Object) =
> void
2256 <li class=
"md-nav__item">
2257 <a href=
"#confirm-parameters-object-void" class=
"md-nav__link">
2258 confirm: (parameters: Object) =
> void
2263 <li class=
"md-nav__item">
2264 <a href=
"#message-string" class=
"md-nav__link">
2270 <li class=
"md-nav__item">
2271 <a href=
"#messageishtml" class=
"md-nav__link">
2277 <li class=
"md-nav__item">
2278 <a href=
"#parameters-object" class=
"md-nav__link">
2284 <li class=
"md-nav__item">
2285 <a href=
"#template-string" class=
"md-nav__link">
2301 <li class=
"md-nav__item">
2302 <a href=
"#uinotification" class=
"md-nav__link">
2306 <nav class=
"md-nav" aria-label=
"Ui/Notification">
2307 <ul class=
"md-nav__list">
2309 <li class=
"md-nav__item">
2310 <a href=
"#showmessage-string-callback-void-cssclassname-string" class=
"md-nav__link">
2311 show(message: string, callback?: () =
> void, cssClassName?: string)
2329 <div class=
"md-content" data-md-component=
"content">
2330 <article class=
"md-content__inner md-typeset">
2333 <a href=
"https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/javascript/new-api_ui.md" title=
"Edit this page" class=
"md-content__button md-icon">
2334 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
2338 <h1 id=
"user-interface-javascript-api">User Interface - JavaScript API
<a class=
"headerlink" href=
"#user-interface-javascript-api" title=
"Permanent link">#
</a></h1>
2339 <h2 id=
"uialignment"><code>Ui/Alignment
</code><a class=
"headerlink" href=
"#uialignment" title=
"Permanent link">#
</a></h2>
2340 <p>Calculates the alignment of one element relative to another element, with support
2341 for boundary constraints, alignment restrictions and additional pointer elements.
</p>
2342 <h3 id=
"setelement-element-referenceelement-element-options-object"><code>set(element: Element, referenceElement: Element, options: Object)
</code><a class=
"headerlink" href=
"#setelement-element-referenceelement-element-options-object" title=
"Permanent link">#
</a></h3>
2343 <p>Calculates and sets the alignment of the element
<code>element
</code>.
</p>
2344 <h4 id=
"verticaloffset-number"><code>verticalOffset: number
</code><a class=
"headerlink" href=
"#verticaloffset-number" title=
"Permanent link">#
</a></h4>
2345 <p><em>Defaults to
<code>0</code>.
</em></p>
2346 <p>Creates a gap between the element and the reference element, in pixels.
</p>
2347 <h4 id=
"pointer-boolean"><code>pointer: boolean
</code><a class=
"headerlink" href=
"#pointer-boolean" title=
"Permanent link">#
</a></h4>
2348 <p><em>Defaults to
<code>false
</code>.
</em></p>
2349 <p>Sets the position of the pointer element, requires an existing child of the
2350 element with the CSS class
<code>.elementPointer
</code>.
</p>
2351 <h4 id=
"pointeroffset-number"><code>pointerOffset: number
</code><a class=
"headerlink" href=
"#pointeroffset-number" title=
"Permanent link">#
</a></h4>
2352 <p><em>Defaults to
<code>4</code>.
</em></p>
2353 <p>The margin from the left/right edge of the element and is used to avoid the
2354 arrow from being placed right at the edge.
</p>
2355 <p>Does not apply when aligning the element to the reference elemnent's center.
</p>
2356 <h4 id=
"pointerclassnames-string"><code>pointerClassNames: string[]
</code><a class=
"headerlink" href=
"#pointerclassnames-string" title=
"Permanent link">#
</a></h4>
2357 <p><em>Defaults to
<code>[]
</code>.
</em></p>
2358 <p>If your element uses CSS-only pointers, such as using the
<code>::before
</code> or
<code>::after
</code>
2359 pseudo selectors, you can specifiy two separate CSS class names that control the
2362 <li><code>pointerClassNames[
0]
</code> is applied to the element when the pointer is displayed
2364 <li><code>pointerClassNames[
1]
</code> is used to align the pointer to the right side of the
2367 <h4 id=
"refdimensionselement-element"><code>refDimensionsElement: Element
</code><a class=
"headerlink" href=
"#refdimensionselement-element" title=
"Permanent link">#
</a></h4>
2368 <p><em>Defaults to
<code>null
</code>.
</em></p>
2369 <p>An alternative element that will be used to determine the position and dimensions
2370 of the reference element. This can be useful if you reference element is contained
2371 in a wrapper element with alternating dimensions.
</p>
2372 <h4 id=
"horizontal-string"><code>horizontal: string
</code><a class=
"headerlink" href=
"#horizontal-string" title=
"Permanent link">#
</a></h4>
2373 <div class=
"admonition info">
2374 <p class=
"admonition-title">This value is automatically flipped for RTL (right-to-left) languages,
<code>left
</code> is changed into
<code>right
</code> and vice versa.
</p>
2376 <p><em>Defaults to
<code>"left"</code>.
</em></p>
2377 <p>Sets the prefered alignment, accepts either
<code>left
</code> or
<code>right
</code>. The value
<code>left
</code>
2378 instructs the module to align the element with the left boundary of the reference
2380 <p>The
<code>horizontal
</code> alignment is used as the default and a flip only occurs, if there
2381 is not enough space in the desired direction. If the element exceeds the boundaries
2382 in both directions, the value of
<code>horizontal
</code> is used.
</p>
2383 <h4 id=
"vertical-string"><code>vertical: string
</code><a class=
"headerlink" href=
"#vertical-string" title=
"Permanent link">#
</a></h4>
2384 <p><em>Defaults to
<code>"bottom"</code>.
</em></p>
2385 <p>Sets the prefered alignment, accepts either
<code>bottom
</code> or
<code>top
</code>. The value
<code>bottom
</code>
2386 instructs the module to align the element below the reference element.
</p>
2387 <p>The
<code>vertical
</code> alignment is used as the default and a flip only occurs, if there
2388 is not enough space in the desired direction. If the element exceeds the boundaries
2389 in both directions, the value of
<code>vertical
</code> is used.
</p>
2390 <h4 id=
"allowflip-string"><code>allowFlip: string
</code><a class=
"headerlink" href=
"#allowflip-string" title=
"Permanent link">#
</a></h4>
2391 <div class=
"admonition info">
2392 <p class=
"admonition-title">The value for
<code>horizontal
</code> is automatically flipped for RTL (right-to-left) languages,
<code>left
</code> is changed into
<code>right
</code> and vice versa. This setting only controls the behavior when violating space constraints, therefore the aforementioned transformation is always applied.
</p>
2394 <p><em>Defaults to
<code>"both"</code>.
</em></p>
2395 <p>Restricts the automatic alignment flipping if the element exceeds the window
2396 boundaries in the instructed direction.
</p>
2398 <li><code>both
</code> - No restrictions.
</li>
2399 <li><code>horizontal
</code> - Element can be aligned with the left
<em>or
</em> the right boundary of
2400 the reference element, but the vertical position is fixed.
</li>
2401 <li><code>vertical
</code> - Element can be aligned below
<em>or
</em> above the reference element,
2402 but the vertical position is fixed.
</li>
2403 <li><code>none
</code> - No flipping can occur, the element will be aligned regardless of
2404 any space constraints.
</li>
2406 <h2 id=
"uicloseoverlay"><code>Ui/CloseOverlay
</code><a class=
"headerlink" href=
"#uicloseoverlay" title=
"Permanent link">#
</a></h2>
2407 <p>Register elements that should be closed when the user clicks anywhere else, such
2408 as drop-down menus or tooltips.
</p>
2409 <table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span>
2410 <span class=
"normal">2</span>
2411 <span class=
"normal">3</span>
2412 <span class=
"normal">4</span>
2413 <span class=
"normal">5</span></pre></div></td><td class=
"code"><div class=
"highlight"><pre><span></span><code><span class=
"nx">require
</span><span class=
"p">([
</span><span class=
"s2">"Ui/CloseOverlay
"</span><span class=
"p">],
</span> <span class=
"kd">function
</span><span class=
"p">(
</span><span class=
"nx">UiCloseOverlay
</span><span class=
"p">)
</span> <span class=
"p">{
</span>
2414 <span class=
"nx">UiCloseOverlay
</span><span class=
"p">.
</span><span class=
"nx">add
</span><span class=
"p">(
</span><span class=
"s2">"App/Foo
"</span><span class=
"p">,
</span> <span class=
"kd">function
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2415 <span class=
"c1">// invoked, close something
</span>
2416 <span class=
"p">});
</span>
2417 <span class=
"p">});
</span>
2420 <h3 id=
"addidentifier-string-callback-void"><code>add(identifier: string, callback: () =
> void)
</code><a class=
"headerlink" href=
"#addidentifier-string-callback-void" title=
"Permanent link">#
</a></h3>
2421 <p>Adds a callback that will be invoked when the user clicks anywhere else.
</p>
2422 <h2 id=
"uiconfirmation"><code>Ui/Confirmation
</code><a class=
"headerlink" href=
"#uiconfirmation" title=
"Permanent link">#
</a></h2>
2423 <p>Prompt the user to make a decision before carrying out an action, such as a safety
2424 warning before permanently deleting content.
</p>
2425 <table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span>
2426 <span class=
"normal">2</span>
2427 <span class=
"normal">3</span>
2428 <span class=
"normal">4</span>
2429 <span class=
"normal">5</span>
2430 <span class=
"normal">6</span>
2431 <span class=
"normal">7</span>
2432 <span class=
"normal">8</span></pre></div></td><td class=
"code"><div class=
"highlight"><pre><span></span><code><span class=
"nx">require
</span><span class=
"p">([
</span><span class=
"s2">"Ui/Confirmation
"</span><span class=
"p">],
</span> <span class=
"kd">function
</span><span class=
"p">(
</span><span class=
"nx">UiConfirmation
</span><span class=
"p">)
</span> <span class=
"p">{
</span>
2433 <span class=
"nx">UiConfirmation
</span><span class=
"p">.
</span><span class=
"nx">show
</span><span class=
"p">({
</span>
2434 <span class=
"nx">confirm
</span><span class=
"o">:
</span> <span class=
"kd">function
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2435 <span class=
"c1">// the user has confirmed the dialog
</span>
2436 <span class=
"p">},
</span>
2437 <span class=
"nx">message
</span><span class=
"o">:
</span> <span class=
"s2">"Do you really want to continue?
"</span>
2438 <span class=
"p">});
</span>
2439 <span class=
"p">});
</span>
2442 <h3 id=
"showoptions-object"><code>show(options: Object)
</code><a class=
"headerlink" href=
"#showoptions-object" title=
"Permanent link">#
</a></h3>
2443 <p>Displays a dialog overlay with actions buttons to confirm or reject the dialog.
</p>
2444 <h4 id=
"cancel-parameters-object-void"><code>cancel: (parameters: Object) =
> void
</code><a class=
"headerlink" href=
"#cancel-parameters-object-void" title=
"Permanent link">#
</a></h4>
2445 <p><em>Defaults to
<code>null
</code>.
</em></p>
2446 <p>Callback that is invoked when the dialog was rejected.
</p>
2447 <h4 id=
"confirm-parameters-object-void"><code>confirm: (parameters: Object) =
> void
</code><a class=
"headerlink" href=
"#confirm-parameters-object-void" title=
"Permanent link">#
</a></h4>
2448 <p><em>Defaults to
<code>null
</code>.
</em></p>
2449 <p>Callback that is invoked when the user has confirmed the dialog.
</p>
2450 <h4 id=
"message-string"><code>message: string
</code><a class=
"headerlink" href=
"#message-string" title=
"Permanent link">#
</a></h4>
2451 <p><em>Defaults to '
""'.
</em></p>
2452 <p>Text that is displayed in the content area of the dialog, optionally this can
2453 be HTML, but this requires
<code>messageIsHtml
</code> to be enabled.
</p>
2454 <h4 id=
"messageishtml"><code>messageIsHtml
</code><a class=
"headerlink" href=
"#messageishtml" title=
"Permanent link">#
</a></h4>
2455 <p><em>Defaults to
<code>false
</code>.
</em></p>
2456 <p>The
<code>message
</code> option is interpreted as text-only, setting this option to
<code>true
</code>
2457 will cause the
<code>message
</code> to be evaluated as HTML.
</p>
2458 <h4 id=
"parameters-object"><code>parameters: Object
</code><a class=
"headerlink" href=
"#parameters-object" title=
"Permanent link">#
</a></h4>
2459 <p>Optional list of parameter options that will be passed to the
<code>cancel()
</code> and
2460 <code>confirm()
</code> callbacks.
</p>
2461 <h4 id=
"template-string"><code>template: string
</code><a class=
"headerlink" href=
"#template-string" title=
"Permanent link">#
</a></h4>
2462 <p>An optional HTML template that will be inserted into the dialog content area,
2463 but after the
<code>message
</code> section.
</p>
2464 <h2 id=
"uinotification"><code>Ui/Notification
</code><a class=
"headerlink" href=
"#uinotification" title=
"Permanent link">#
</a></h2>
2465 <p>Displays a simple notification at the very top of the window, such as a success
2466 message for Ajax based actions.
</p>
2467 <table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span>
2468 <span class=
"normal">2</span>
2469 <span class=
"normal">3</span>
2470 <span class=
"normal">4</span>
2471 <span class=
"normal">5</span>
2472 <span class=
"normal">6</span>
2473 <span class=
"normal">7</span>
2474 <span class=
"normal">8</span>
2475 <span class=
"normal">9</span></pre></div></td><td class=
"code"><div class=
"highlight"><pre><span></span><code><span class=
"nx">require
</span><span class=
"p">([
</span><span class=
"s2">"Ui/Notification
"</span><span class=
"p">],
</span> <span class=
"kd">function
</span><span class=
"p">(
</span><span class=
"nx">UiNotification
</span><span class=
"p">)
</span> <span class=
"p">{
</span>
2476 <span class=
"nx">UiNotification
</span><span class=
"p">.
</span><span class=
"nx">show
</span><span class=
"p">(
</span>
2477 <span class=
"s2">"Your changes have been saved.
"</span><span class=
"p">,
</span>
2478 <span class=
"kd">function
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2479 <span class=
"c1">// this callback will be invoked after
2 seconds
</span>
2480 <span class=
"p">},
</span>
2481 <span class=
"s2">"success
"</span>
2482 <span class=
"p">);
</span>
2483 <span class=
"p">});
</span>
2486 <h3 id=
"showmessage-string-callback-void-cssclassname-string"><code>show(message: string, callback?: () =
> void, cssClassName?: string)
</code><a class=
"headerlink" href=
"#showmessage-string-callback-void-cssclassname-string" title=
"Permanent link">#
</a></h3>
2487 <p>Shows the notification and executes the callback after
2 seconds.
</p>
2493 <div class=
"md-source-date">
2496 Last update:
2021-
01-
08
2515 <footer class=
"md-footer">
2517 <nav class=
"md-footer__inner md-grid" aria-label=
"Footer">
2519 <a href=
"../new-api_browser/" class=
"md-footer__link md-footer__link--prev" rel=
"prev">
2520 <div class=
"md-footer__button md-icon">
2521 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
2523 <div class=
"md-footer__title">
2524 <div class=
"md-ellipsis">
2525 <span class=
"md-footer__direction">
2528 Browser and Screen Sizes
2534 <a href=
"../legacy-api/" class=
"md-footer__link md-footer__link--next" rel=
"next">
2535 <div class=
"md-footer__title">
2536 <div class=
"md-ellipsis">
2537 <span class=
"md-footer__direction">
2543 <div class=
"md-footer__button md-icon">
2544 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
2550 <div class=
"md-footer-meta md-typeset">
2551 <div class=
"md-footer-meta__inner md-grid">
2552 <div class=
"md-footer-copyright">
2554 <div class=
"md-footer-copyright__highlight">
2555 Copyright ©
2020 WoltLab GmbH
2559 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
2564 <div class=
"md-footer-copyright">
2565 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
2566 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
2573 <div class=
"md-dialog" data-md-component=
"dialog">
2574 <div class=
"md-dialog__inner md-typeset"></div>
2576 <script id=
"__config" type=
"application/json">{
"base":
"../..",
"features": [],
"translations": {
"clipboard.copy":
"Copy to clipboard",
"clipboard.copied":
"Copied to clipboard",
"search.config.lang":
"en",
"search.config.pipeline":
"trimmer, stopWordFilter",
"search.config.separator":
"[\\s\\-]+",
"search.placeholder":
"Search",
"search.result.placeholder":
"Type to start searching",
"search.result.none":
"No matching documents",
"search.result.one":
"1 matching document",
"search.result.other":
"# matching documents",
"search.result.more.one":
"1 more on this page",
"search.result.more.other":
"# more on this page",
"search.result.term.missing":
"Missing"},
"search":
"../../assets/javascripts/workers/search.fe42c31b.min.js",
"version": {
"provider":
"mike"}}
</script>
2579 <script src=
"../../assets/javascripts/bundle.4ea5477f.min.js"></script>