new H_ui()
ui.js, line 29
Members
-
translate_blockObject
-
Block for translation UI logic.
Contains methods for changing language and translating content.
Methods
-
staticH_ui.add_window(parent_node, settings){H_ui_window}
ui.js, line 487 -
Adds a new window (modal/dialog) to the UI.
Name Type Description parent_nodeHTMLElement Parent node to append to. settingsObject Window settings Name Type Description titleString | Array | HTMLElement Add a title on top classString Additional CSS classes for the modal modalBoolean Display as modal with background mask closeBoolean | String Label for the close button, or true for default on_closefunction | String Callback executed when closed hiddenBoolean Hide it on create content_resizableBoolean Make the window partialy resizable. Depends its CSS, if there is min-width or min-height set remove_on_closeBoolean Remove from DOM when closed nodragBoolean Disable drag of whole modal disable_background_clickBoolean Disable closing by clicking background and pressing ESC key disable_auto_resizeBoolean Disable auto-resize/alignment on content change specialBoolean special modal, higher z-index special_levelNumber | String Priority level for special modals, or 'err' for error modals Returns:
Type Description H_ui_window The created window instance. -
staticH_ui.change_multi_radio(event)
ui.js, line 191 -
Updates the selected state for multi-radio blocks.
Toggles the 'selected' class on labels.Name Type Description eventEvent The change event. -
staticH_ui.clean_color_pickers()
ui.js, line 123 -
Cleans up unused color pickers.
Destroys pickers that are no longer open or present in the DOM. -
staticH_ui.clean_tox()
ui.js, line 461 -
Cleans up TinyMCE auxiliary elements. Removes all elements with class 'tox-tinymce-aux' left by tynimce.
-
staticH_ui.confirm_popup(message, ok_handler, cancel_handler)
ui.js, line 555 -
Displays a confirmation popup with OK and Cancel buttons.
Name Type Description messagestring | Array Message to display. ok_handlerfunction Handler for OK button. cancel_handlerfunction Handler for Cancel button. -
staticH_ui.copy_to_clipboard(content, popup, html)
ui.js, line 930 -
Copies content to the clipboard.
Optionally shows a popup and supports HTML content.Name Type Default Description contentstring Content to copy. popupboolean | string true optional Show popup or custom message. htmlboolean false optional Copy as HTML. -
staticH_ui.detect_screen_infos()
ui.js, line 830 -
Detects screen info and sets CSS variables.
window screen logarythmique ratio calculator is used to create some CSS vars that can reduce issues with some screens.
e.g : for a 4k screen, you don't display the navigator in full screen size, in general the user reduce the window size because it's more easy.
but in this case all vars based on screen width height should be reduced by a ratio based on fullHD as base.
--fhd-hr and --fhd-vr are those horizontal and vertical ratio that can be used to multiple othe size vars in your theme to auto adapt it to huge screen.
Called from init.js to set screen and window size variables. -
staticH_ui.display_color_picker(evt, dom_id)
ui.js, line 63 -
Displays a color picker for a given input.
Initializes and manages the color picker instance.
the colorpicker source in in /js/externals/alwan
as there is already tons of colopicker, we choose this one : https://github.com/sefianecho/alwan
Name Type Description evtEvent The triggering event. dom_idstring The DOM id of the input. -
staticH_ui.get_token(evt, from_form)
ui.js, line 293 -
Retrieves a token via AJAX and inserts it into the form.
this token will permit to identify one authorized submit, and reduce DDOS risk.Name Type Default Description evtEvent The triggering event. from_formboolean false optional Whether the event is from a form. -
staticH_ui.init_input_order(base_name, base_id, editable, callback)
ui.js, line 373 -
Initializes input order management for a group of inputs.
Name Type Description base_namestring Base name for the group. base_idstring Base id for the input. editableboolean Whether the input is editable. callbackfunction Callback on order change. -
staticH_ui.init_range_tracks()
ui.js, line 955 -
Initializes styled input range tracks.
Updates CSS variables for custom range inputs. -
staticH_ui.input_copy_to_clipboard(id, popup, html)
ui.js, line 890 -
Copies the value of an input to the clipboard.
Optionally shows a popup and supports HTML content.Name Type Default Description idstring Input element id. popupboolean | string true optional Show popup or custom message. htmlboolean false optional Copy as HTML. -
staticH_ui.message_popup(message, ok_handler){H_ui_prompt}
ui.js, line 503 -
Displays a message popup with an OK button.
Name Type Description messagestring | Array Message to display. ok_handlerfunction Handler for OK button. Returns:
Type Description H_ui_prompt The prompt instance. -
staticH_ui.message_popup_timed(message, ok_handler, time)
ui.js, line 530 -
Displays a timed message popup.
Name Type Default Description messagestring | Array Message to display. ok_handlerfunction Handler for OK button. timenumber 3000 optional Time in ms before auto-close. -
staticH_ui.new_tab(url)
ui.js, line 361 -
Opens a new browser tab.
Name Type Description urlstring URL to open. -
staticH_ui.open_popup_modal(evt, module_name, params, special, special_level)
ui.js, line 389 -
Opens a popup modal for a public module.
Supports special modals (saved as special instances), with level of display priority (z-index).Name Type Default Description evtEvent The triggering event. module_namestring Module name. paramsObject Parameters for the module. specialboolean | number false optional Special modal index. special_levelnumber 1 optional Special modal level. -
staticH_ui.popup(lapage, titre, w, h, scroll)
ui.js, line 327 -
Opens a popup window.
Name Type Description lapagestring URL to open. titrestring Window title. wnumber Width. hnumber Height. scrollboolean | number Enable scrollbars. -
staticH_ui.scroll_to(dom_id, offset)
ui.js, line 278 -
Scrolls to a DOM element with an optional offset.
Name Type Default Description dom_idstring Target element id. offsetnumber 0 optional Offset in pixels. -
staticH_ui.scroll_toggle_class(elem_id, nbr_px, class_name)
ui.js, line 259 -
Adds or removes a CSS class on scroll.
Toggles the class when scrolling past a threshold.Name Type Description elem_idstring Target element id. nbr_pxnumber Scroll threshold in pixels. class_namestring CSS class to toggle. -
staticH_ui.show_big_image(evt, new_url)
ui.js, line 210 -
Displays a big image overlay.
Creates and shows a modal for the image.Name Type Default Description evtEvent The triggering event. new_urlstring | boolean false optional Optional new image URL. -
staticH_ui.toggle_accordion(target, css_class, custom_func, indicator)
ui.js, line 142 -
Initializes an accordion UI component.
Adds toggling and indicator logic to elements with the given class.
The target must have "data-target_id" that points to the element to toggleName Type Default Description targetstring CSS class of toggler elements. css_classstring CSS class to toggle. custom_funcfunction | boolean false optional Custom function on open. indicatorstring | boolean false optional Id of the collapse indicator -
staticH_ui.tooltip(evt, id)
ui.js, line 586 -
Displays a tooltip for a DOM element.
Positions and shows the tooltip content.Name Type Description evtEvent The triggering event. idstring Tooltip content element id. -
staticH_ui.update_css_fhd_vr()
ui.js, line 867 -
Updates CSS variable for FHD vertical ratio.
Called on window resize.