2020-03-18 03:31:29 +01:00
{ * < ? php * }
2024-09-05 04:00:49 +02:00
2020-03-18 03:31:29 +01:00
{ *// set the doctype * }
{ if $browser_name == 'Internet Explorer' }
<! DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Transitional//EN " " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
{ else }
<! DOCTYPE html >
{ / if }
< html xmlns = 'http://www.w3.org/1999/xhtml' xml : lang = 'en' lang = 'en' >
< head >
< meta charset = 'utf-8' >
< meta http - equiv = 'Content-Type' content = 'text/html; charset=UTF-8' >
< meta http - equiv = 'X-UA-Compatible' content = 'IE=edge' >
2020-05-23 22:00:49 +02:00
< meta name = 'viewport' content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
2023-05-20 01:33:12 +02:00
< meta name = " robots " content = " noindex, nofollow, noarchive " />
2020-03-18 03:31:29 +01:00
{ *// external css files * }
2020-03-20 04:11:53 +01:00
< link rel = 'stylesheet' type = 'text/css' href = '{$project_path}/resources/bootstrap/css/bootstrap.min.css.php' >
< link rel = 'stylesheet' type = 'text/css' href = '{$project_path}/resources/bootstrap/css/bootstrap-tempusdominus.min.css.php' >
< link rel = 'stylesheet' type = 'text/css' href = '{$project_path}/resources/bootstrap/css/bootstrap-colorpicker.min.css.php' >
< link rel = 'stylesheet' type = 'text/css' href = '{$project_path}/resources/fontawesome/css/all.min.css.php' >
2025-03-13 21:58:15 +01:00
< link rel = 'stylesheet' type = 'text/css' href = '{$project_path}/themes/default/css.php?updated=202503130256' >
2020-03-18 03:31:29 +01:00
{ *// link to custom css file * }
2023-05-11 06:30:42 +02:00
{ if ! empty ( $settings . theme . custom_css )}
2020-03-20 04:11:53 +01:00
< link rel = 'stylesheet' type = 'text/css' href = '{$settings.theme.custom_css}' >
2020-03-18 03:31:29 +01:00
{ / if }
{ *// set favorite icon * }
< link rel = 'icon' href = '{$settings.theme.favicon}' >
{ *// document title * }
< title > { $document_title } </ title >
{ *// remote javascript * }
2020-03-20 04:11:53 +01:00
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/jquery/jquery.min.js.php' ></ script >
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/jquery/jquery.autosize.input.js.php' ></ script >
2022-08-01 15:59:53 +02:00
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/momentjs/moment-with-locales.min.js.php' ></ script >
2020-03-20 04:11:53 +01:00
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/bootstrap/js/bootstrap.min.js.php' ></ script >
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/bootstrap/js/bootstrap-tempusdominus.min.js.php' ></ script >
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/bootstrap/js/bootstrap-colorpicker.min.js.php' ></ script >
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/bootstrap/js/bootstrap-pwstrength.min.js.php' ></ script >
2020-03-18 03:31:29 +01:00
< script language = 'JavaScript' type = 'text/javascript' > { literal } window . FontAwesomeConfig = { autoReplaceSvg : false }{ / literal } </ script >
2024-08-10 02:14:52 +02:00
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/fontawesome/js/all.min.js.php' defer ></ script >
2020-03-18 03:31:29 +01:00
{ *// web font loader * }
2023-05-11 06:30:42 +02:00
{ if isset ( $settings . theme . font_loader ) && $settings . theme . font_loader == 'true' }
2020-03-18 03:31:29 +01:00
{ if $settings . theme . font_retrieval != 'asynchronous' }
< script language = 'JavaScript' type = 'text/javascript' src = '//ajax.googleapis.com/ajax/libs/webfont/{$settings.theme.font_loader_version}/webfont.js' ></ script >
{ / if }
< script language = 'JavaScript' type = 'text/javascript' src = '{$project_path}/resources/fonts/web_font_loader.php?v={$settings.theme.font_loader_version}' ></ script >
{ / if }
{ *// local javascript * }
< script language = 'JavaScript' type = 'text/javascript' >
//message bar display
{ literal }
function display_message ( msg , mood , delay ) {
2020-03-25 23:48:12 +01:00
mood = mood !== undefined ? mood : 'default' ;
delay = delay !== undefined ? delay : { / literal }{ $settings . theme . message_delay }{ literal };
2020-03-18 03:31:29 +01:00
if ( msg !== '' ) {
var message_text = $ ( document . createElement ( 'div' ));
message_text . addClass ( 'message_text message_mood_' + mood );
message_text . html ( msg );
message_text . on ( 'click' , function () {
var object = $ ( this );
object . clearQueue () . finish ();
$ ( '#message_container div' ) . remove ();
$ ( '#message_container' ) . css ({ opacity : 0 , 'height' : 0 }) . css ({ 'height' : 'auto' });
} );
$ ( '#message_container' ) . append ( message_text );
message_text . css ({ 'height' : 'auto' }) . animate ({ opacity : 1 }, 250 , function (){
$ ( '#message_container' ) . delay ( delay ) . animate ({ opacity : 0 , 'height' : 0 }, 500 , function () {
$ ( '#message_container div' ) . remove ();
$ ( '#message_container' ) . animate ({ opacity : 1 }, 300 ) . css ({ 'height' : 'auto' });
});
2019-02-16 21:48:31 +01:00
});
2020-03-18 03:31:29 +01:00
}
2016-03-25 23:29:20 +01:00
}
2020-03-18 03:31:29 +01:00
{ / literal }
{ if $settings . theme . menu_style == 'side' }
//side menu visibility toggle
2020-05-25 21:17:01 +02:00
var menu_side_expand_timer ;
var menu_side_contract_timer ;
2020-05-28 05:24:07 +02:00
var menu_side_state_current = '{if $menu_side_state == ' hidden '}expanded{else}{$menu_side_state}{/if}' ;
2020-03-18 03:31:29 +01:00
{ literal }
2020-05-25 21:17:01 +02:00
function menu_side_contract_start () {
menu_side_contract_timer = setTimeout ( function () {
menu_side_contract ();
}, { / literal }{ $settings . theme . menu_side_toggle_hover_delay_contract }{ literal });
}
2020-03-18 03:31:29 +01:00
function menu_side_contract () {
2020-05-21 05:24:19 +02:00
if ( menu_side_state_current == 'expanded' ) {
2020-03-18 03:31:29 +01:00
{ / literal }
2020-05-28 05:24:07 +02:00
{ if $menu_side_state == 'hidden' }
2020-05-21 05:24:19 +02:00
{ literal }
2020-05-28 05:24:07 +02:00
$ ( '#menu_side_container' ) . hide ();
2020-05-21 05:24:19 +02:00
{ / literal }
2020-05-28 05:24:07 +02:00
{ else }
2020-05-21 05:24:19 +02:00
{ literal }
2020-05-28 05:24:07 +02:00
$ ( '.menu_side_sub' ) . slideUp ( 180 );
$ ( '.menu_side_item_title' ) . hide ();
2020-05-21 05:24:19 +02:00
{ / literal }
2020-05-28 05:24:07 +02:00
{ if $settings . theme . menu_brand_type == 'image' || $settings . theme . menu_brand_type == 'image_text' || $settings . theme . menu_brand_type == '' }
{ literal }
$ ( '#menu_brand_image_expanded' ) . fadeOut ( 180 , function () {
$ ( '#menu_brand_image_contracted' ) . fadeIn ( 180 );
});
{ / literal }
{ else if $settings . theme . menu_brand_type == 'text' }
{ literal }
$ ( '.menu_brand_text' ) . hide ();
{ / literal }
{ / if }
2020-05-26 02:38:52 +02:00
{ literal }
2020-05-28 05:24:07 +02:00
$ ( '.menu_side_control_state' ) . hide ();
$ ( '.menu_side_item_main_sub_icons' ) . hide ();
2024-09-05 03:31:09 +02:00
$ ( '.sub_arrows' ) . removeClass ( '{/literal}{$settings.theme.menu_side_item_main_sub_icon_contract}{literal}' ) . addClass ( '{/literal}{$settings.theme.menu_side_item_main_sub_icon_expand}{literal}' );
2020-05-28 05:24:07 +02:00
$ ( '#menu_side_container' ) . animate ({ width : '{/literal}{$settings.theme.menu_side_width_contracted}{literal}px' }, 180 , function () {
menu_side_state_current = 'contracted' ;
});
{ / literal }
{ if $settings . theme . menu_side_toggle_body_width == 'shrink' || ( $settings . theme . menu_side_state == 'expanded' && $settings . theme . menu_side_toggle_body_width == 'fixed' )}
{ literal }
if ( $ ( window ) . width () >= 576 ) {
$ ( '#content_container' ) . animate ({ width : $ ( window ) . width () - { / literal }{ $settings . theme . menu_side_width_contracted }{ literal } }, 250 );
}
{ / literal }
{ / if }
{ literal }
2024-09-09 20:29:49 +02:00
$ ( '.menu_side_contract' ) . hide ();
2020-05-28 05:24:07 +02:00
$ ( '.menu_side_expand' ) . show ();
if ( $ ( window ) . width () < 576 ) {
$ ( '#menu_side_container' ) . hide ();
2020-05-26 02:38:52 +02:00
}
{ / literal }
{ / if }
{ literal }
2020-05-21 05:24:19 +02:00
}
2020-03-18 03:31:29 +01:00
}
2019-03-26 21:43:31 +01:00
2020-05-25 21:17:01 +02:00
function menu_side_expand_start () {
menu_side_expand_timer = setTimeout ( function () {
menu_side_expand ();
}, { / literal }{ $settings . theme . menu_side_toggle_hover_delay_expand }{ literal });
}
2020-03-18 03:31:29 +01:00
function menu_side_expand () {
2020-05-24 02:57:17 +02:00
{ / literal }
2020-05-28 05:24:07 +02:00
{ if $menu_side_state == 'hidden' }
2020-05-24 02:57:17 +02:00
{ literal }
2020-05-28 05:24:07 +02:00
$ ( '.menu_side_contract' ) . show ();
2020-05-24 02:57:17 +02:00
{ / literal }
2020-05-26 02:38:52 +02:00
{ if $settings . theme . menu_brand_type == 'image' || $settings . theme . menu_brand_type == 'image_text' || $settings . theme . menu_brand_type == '' }
2020-03-18 03:31:29 +01:00
{ literal }
2020-05-28 05:24:07 +02:00
$ ( '#menu_brand_image_contracted' ) . hide ();
$ ( '#menu_brand_image_expanded' ) . show ();
2020-03-18 03:31:29 +01:00
{ / literal }
{ / if }
{ literal }
2020-05-28 05:24:07 +02:00
$ ( '.menu_side_control_state' ) . show ();
$ ( '.menu_brand_text' ) . show ();
$ ( '.menu_side_item_main_sub_icons' ) . show ();
$ ( '.menu_side_item_title' ) . show ();
if ( $ ( window ) . width () < 576 ) {
$ ( '#menu_side_container' ) . width ( $ ( window ) . width ());
2020-05-26 02:38:52 +02:00
}
2020-05-28 05:24:07 +02:00
$ ( '#menu_side_container' ) . show ();
2020-05-26 02:38:52 +02:00
{ / literal }
2020-05-28 05:24:07 +02:00
{ else }
{ if $settings . theme . menu_brand_type == 'image' || $settings . theme . menu_brand_type == 'image_text' || $settings . theme . menu_brand_type == '' }
{ literal }
$ ( '#menu_brand_image_contracted' ) . fadeOut ( 180 );
{ / literal }
{ / if }
{ literal }
$ ( '.menu_side_expand' ) . hide ();
$ ( '.menu_side_contract' ) . show ();
$ ( '#menu_side_container' ) . show ();
var menu_side_container_width = $ ( window ) . width () < 576 ? $ ( window ) . width () : '{/literal}{$settings.theme.menu_side_width_expanded}{literal}px' ;
$ ( '#menu_side_container' ) . animate ({ width : menu_side_container_width }, 180 , function () {
{ / literal }
{ if $settings . theme . menu_brand_type == 'image' || $settings . theme . menu_brand_type == 'image_text' || $settings . theme . menu_brand_type == '' }
{ literal }
$ ( '#menu_brand_image_expanded' ) . fadeIn ( 180 );
{ / literal }
{ / if }
{ literal }
$ ( '.menu_side_control_state' ) . fadeIn ( 180 );
$ ( '.menu_brand_text' ) . fadeIn ( 180 );
$ ( '.menu_side_item_main_sub_icons' ) . fadeIn ( 180 );
$ ( '.menu_side_item_title' ) . fadeIn ( 180 , function () {
menu_side_state_current = 'expanded' ;
});
});
{ / literal }
{ if $settings . theme . menu_side_toggle_body_width == 'shrink' || ( $settings . theme . menu_side_state == 'expanded' && $settings . theme . menu_side_toggle_body_width == 'fixed' )}
{ literal }
if ( $ ( window ) . width () >= 576 ) {
$ ( '#content_container' ) . animate ({ width : $ ( window ) . width () - { / literal }{ $settings . theme . menu_side_width_expanded }{ literal } }, 250 );
}
{ / literal }
{ / if }
2020-05-26 02:38:52 +02:00
{ / if }
{ literal }
2020-05-21 05:24:19 +02:00
}
2020-05-25 19:53:44 +02:00
function menu_side_item_toggle ( item_id ) {
2024-09-05 03:31:09 +02:00
$ ( '#sub_arrow_' + item_id ) . toggleClass ([ '{/literal}{$settings.theme.menu_side_item_main_sub_icon_contract}{literal}' , '{/literal}{$settings.theme.menu_side_item_main_sub_icon_expand}{literal}' ]);
$ ( '.sub_arrows' ) . not ( '#sub_arrow_' + item_id ) . removeClass ( '{/literal}{$settings.theme.menu_side_item_main_sub_icon_contract}{literal}' ) . addClass ( '{/literal}{$settings.theme.menu_side_item_main_sub_icon_expand}{literal}' );
2020-05-25 19:53:44 +02:00
$ ( '#sub_' + item_id ) . slideToggle ( 180 , function () {
2022-02-12 04:48:28 +01:00
{ / literal }
{ if $settings . theme . menu_side_item_main_sub_close != 'manual' }
{ literal }
if ( ! $ ( this ) . is ( ':hidden' )) {
$ ( '.menu_side_sub' ) . not ( $ ( this )) . slideUp ( 180 );
}
{ / literal }
{ / if }
{ literal }
2020-05-25 19:53:44 +02:00
});
}
2020-03-18 03:31:29 +01:00
{ / literal }
{ / if }
2019-03-26 21:43:31 +01:00
2020-03-18 03:31:29 +01:00
{ literal }
2016-04-07 22:48:12 +02:00
$ ( document ) . ready ( function () {
2020-03-18 03:31:29 +01:00
{ / literal }
2016-03-25 23:29:20 +01:00
2020-03-18 18:54:31 +01:00
{ $messages }
2016-03-25 23:29:20 +01:00
2020-03-18 03:31:29 +01:00
//message bar hide on hover
{ literal }
$ ( '#message_container' ) . on ( 'mouseenter' , function () {
$ ( '#message_container div' ) . remove ();
$ ( '#message_container' ) . css ({ opacity : 0 , 'height' : 0 }) . css ({ 'height' : 'auto' });
2019-02-16 21:48:31 +01:00
});
2020-03-18 03:31:29 +01:00
{ / literal }
2016-03-25 23:29:20 +01:00
2020-03-18 03:31:29 +01:00
//domain selector controls
{ if $domain_selector_enabled }
{ literal }
2024-10-07 22:36:55 +02:00
$ ( '.header_domain_selector_domain' ) . on ( 'click' , function () { event . preventDefault (); show_domains (); });
2020-03-18 03:31:29 +01:00
$ ( '#domains_hide' ) . on ( 'click' , function () { hide_domains (); });
2016-03-25 23:29:20 +01:00
2016-04-01 01:11:37 +02:00
function show_domains () {
2024-10-07 22:36:55 +02:00
$ ( '#body_header_user_menu' ) . fadeOut ( 200 );
2022-11-28 22:56:52 +01:00
search_domains ( 'domains_list' );
2016-04-07 21:01:21 +02:00
$ ( '#domains_visible' ) . val ( 1 );
2016-04-01 01:11:37 +02:00
var scrollbar_width = ( window . innerWidth - $ ( window ) . width ()); //gold: only solution that worked with body { overflow:auto } (add -ms-overflow-style: scrollbar; to <body> style for ie 10+)
if ( scrollbar_width > 0 ) {
2020-03-18 03:31:29 +01:00
$ ( 'body' ) . css ({ 'margin-right' : scrollbar_width , 'overflow' : 'hidden' }); //disable body scroll bars
$ ( '.navbar' ) . css ( 'margin-right' , scrollbar_width ); //adjust navbar margin to compensate
$ ( '#domains_container' ) . css ( 'right' , - scrollbar_width ); //domain container right position to compensate
2016-04-01 01:11:37 +02:00
}
2020-03-18 03:31:29 +01:00
$ ( '#domains_container' ) . show ();
$ ( '#domains_block' ) . animate ({ marginRight : '+=300' }, 400 , function () {
2022-11-28 22:56:52 +01:00
$ ( '#domains_search' ) . trigger ( 'focus' );
2016-04-07 21:01:21 +02:00
});
2016-03-25 23:29:20 +01:00
}
2016-04-01 01:11:37 +02:00
function hide_domains () {
2016-04-07 21:01:21 +02:00
$ ( '#domains_visible' ) . val ( 0 );
2016-04-01 01:11:37 +02:00
$ ( document ) . ready ( function () {
2020-03-18 03:31:29 +01:00
$ ( '#domains_block' ) . animate ({ marginRight : '-=300' }, 400 , function () {
2022-11-28 22:56:52 +01:00
$ ( '#domains_search' ) . val ( '' );
2020-03-18 03:31:29 +01:00
$ ( '.navbar' ) . css ( 'margin-right' , '0' ); //restore navbar margin
$ ( '#domains_container' ) . css ( 'right' , '0' ); //domain container right position
$ ( '#domains_container' ) . hide ();
$ ( 'body' ) . css ({ 'margin-right' : '0' , 'overflow' : 'auto' }); //enable body scroll bars
2020-03-06 17:58:20 +01:00
document . activeElement . blur ();
2016-04-01 01:11:37 +02:00
});
2016-03-25 23:29:20 +01:00
});
}
2020-03-18 03:31:29 +01:00
{ / literal }
{ / if }
2020-03-06 02:43:28 +01:00
//keyboard shortcut scripts
2020-03-18 03:31:29 +01:00
//key: [enter] - retain default behavior to submit form, when present - note: safari does not honor the first submit element when hiding it using 'display: none;' in the setAttribute method
2020-03-18 18:54:31 +01:00
{ if $settings . theme . keyboard_shortcut_submit_enabled }
{ literal }
2020-03-26 22:29:12 +01:00
var action_bar_actions , first_form , first_submit , modal_input_class , modal_continue_button ;
2020-03-18 18:54:31 +01:00
action_bar_actions = document . querySelector ( 'div#action_bar.action_bar > div.actions' );
first_form = document . querySelector ( 'form#frm' );
if ( action_bar_actions !== null ) {
if ( first_form !== null ) {
first_submit = document . createElement ( 'input' );
first_submit . type = 'submit' ;
first_submit . id = 'default_submit' ;
first_submit . setAttribute ( 'style' , 'position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden;' );
first_form . prepend ( first_submit );
window . addEventListener ( 'keydown' , function ( e ){
2020-03-26 22:29:12 +01:00
modal_input_class = e . target . className ;
2020-03-18 18:54:31 +01:00
if ( e . which == 13 && ( e . target . tagName == 'INPUT' || e . target . tagName == 'SELECT' )) {
2020-03-26 22:29:12 +01:00
if ( modal_input_class . includes ( 'modal-input' )) {
e . preventDefault ();
modal_continue_button = document . getElementById ( e . target . dataset . continue );
if ( modal_continue_button ) { modal_continue_button . click (); }
}
else {
if ( typeof window . submit_form === 'function' ) { submit_form (); }
else { document . getElementById ( 'frm' ) . submit (); }
}
2020-03-18 18:54:31 +01:00
}
});
}
2020-03-18 03:31:29 +01:00
}
2020-03-18 18:54:31 +01:00
{ / literal }
{ / if }
2020-03-06 02:43:28 +01:00
//common (used by delete and toggle)
2023-05-13 04:29:44 +02:00
{ if ! empty ( $settings . theme . keyboard_shortcut_delete_enabled ) || ! empty ( $settings . theme . keyboard_shortcut_toggle_enabled )}
2020-03-18 18:54:31 +01:00
var list_checkboxes ;
list_checkboxes = document . querySelectorAll ( 'table.list tr.list-row td.checkbox input[type=checkbox]' );
{ / if }
2020-03-06 02:43:28 +01:00
//keyup event listener
2020-03-18 03:31:29 +01:00
{ literal }
window . addEventListener ( 'keyup' , function ( e ) {
{ / literal }
//key: [escape] - close modal window, if open, or toggle domain selector
{ literal }
if ( e . which == 27 ) {
e . preventDefault ();
var modals , modal_visible , modal ;
modal_visible = false ;
modals = document . querySelectorAll ( 'div.modal-window' );
if ( modals . length !== 0 ) {
for ( var x = 0 , max = modals . length ; x < max ; x ++ ) {
modal = document . getElementById ( modals [ x ] . id );
if ( window . getComputedStyle ( modal ) . getPropertyValue ( 'opacity' ) == 1 ) {
modal_visible = true ;
}
}
}
if ( modal_visible ) {
modal_close ();
}
{ / literal }
{ if $domain_selector_enabled }
{ literal }
else {
if ( document . getElementById ( 'domains_visible' ) . value == 0 ) {
show_domains ();
}
else {
hide_domains ();
}
}
{ / literal }
{ / if }
{ literal }
}
{ / literal }
//key: [insert], list: to add
2020-03-18 18:54:31 +01:00
{ if $settings . theme . keyboard_shortcut_add_enabled }
{ literal }
if ( e . which == 45 && ! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) && e . target . tagName != 'TEXTAREA' ) {
e . preventDefault ();
2020-03-25 23:48:12 +01:00
var add_button ;
add_button = document . getElementById ( 'btn_add' );
if ( add_button === null || add_button === undefined ) {
add_button = document . querySelector ( 'button[name=btn_add]' );
2020-03-18 18:54:31 +01:00
}
2020-03-25 23:48:12 +01:00
if ( add_button !== null ) { add_button . click (); }
2020-03-18 03:31:29 +01:00
}
2020-03-18 18:54:31 +01:00
{ / literal }
{ / if }
2020-03-18 03:31:29 +01:00
//key: [delete], list: to delete checked, edit: to delete
2023-05-13 04:29:44 +02:00
{ if ! empty ( $settings . theme . keyboard_shortcut_delete_enabled )}
2020-03-18 18:54:31 +01:00
{ literal }
if ( e . which == 46 && ! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) && e . target . tagName != 'TEXTAREA' ) {
e . preventDefault ();
2020-03-25 23:48:12 +01:00
var delete_button ;
delete_button = document . querySelector ( 'button[name=btn_delete]' );
if ( delete_button === null || delete_button === undefined ) {
delete_button = document . getElementById ( 'btn_delete' );
2020-03-18 03:31:29 +01:00
}
2020-03-25 23:48:12 +01:00
if ( delete_button !== null ) { delete_button . click (); }
}
{ / literal }
{ / if }
//key: [space], list,edit:prevent default space key behavior when opening toggle confirmation (which would automatically *click* the focused continue button on key-up)
{ if $settings . theme . keyboard_shortcut_toggle_enabled }
{ literal }
if ( e . which == 32 && e . target . id == 'btn_toggle' ) {
e . preventDefault ();
2020-03-18 03:31:29 +01:00
}
2020-03-18 18:54:31 +01:00
{ / literal }
{ / if }
2020-03-18 03:31:29 +01:00
//keyup end
{ literal }
});
{ / literal }
2020-03-06 02:43:28 +01:00
//keydown event listener
2020-03-18 03:31:29 +01:00
{ literal }
window . addEventListener ( 'keydown' , function ( e ) {
{ / literal }
//key: [space], list: to toggle checked - note: for default [space] checkbox behavior (ie. toggle focused checkbox) include in the if statement: && !(e.target.tagName == 'INPUT' && e.target.type == 'checkbox')
2020-03-18 18:54:31 +01:00
{ if $settings . theme . keyboard_shortcut_toggle_enabled }
{ literal }
2020-03-25 23:48:12 +01:00
if ( e . which == 32 && ! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) && e . target . tagName != 'BUTTON' && ! ( e . target . tagName == 'INPUT' && e . target . type == 'button' ) && ! ( e . target . tagName == 'INPUT' && e . target . type == 'submit' ) && e . target . tagName != 'TEXTAREA' && list_checkboxes . length !== 0 ) {
2020-03-18 18:54:31 +01:00
e . preventDefault ();
2020-03-25 23:48:12 +01:00
var toggle_button ;
toggle_button = document . querySelector ( 'button[name=btn_toggle]' );
if ( toggle_button === null || toggle_button === undefined ) {
toggle_button = document . getElementById ( 'btn_toggle' );
2020-03-18 18:54:31 +01:00
}
2020-03-25 23:48:12 +01:00
if ( toggle_button !== null ) { toggle_button . click (); }
2020-03-18 03:31:29 +01:00
}
2020-03-18 18:54:31 +01:00
{ / literal }
{ / if }
2020-03-18 03:31:29 +01:00
//key: [ctrl]+[a], list,edit: to check all
2020-03-18 18:54:31 +01:00
{ if $settings . theme . keyboard_shortcut_check_all_enabled }
{ literal }
if (((( e . which == 97 || e . which == 65 ) && ( e . ctrlKey || e . metaKey ) && ! e . shiftKey ) || e . which == 19 ) && ! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) && e . target . tagName != 'TEXTAREA' ) {
2020-03-25 23:48:12 +01:00
var all_checkboxes ;
all_checkboxes = document . querySelectorAll ( 'table.list tr.list-header th.checkbox input[name=checkbox_all]' );
2020-03-26 15:31:49 +01:00
if ( typeof all_checkboxes != 'object' || all_checkboxes . length == 0 ) {
2020-03-25 23:48:12 +01:00
all_checkboxes = document . querySelectorAll ( 'td.edit_delete_checkbox_all > span > input[name=checkbox_all]' );
2020-03-18 03:31:29 +01:00
}
2020-03-26 15:31:49 +01:00
if ( typeof all_checkboxes == 'object' && all_checkboxes . length > 0 ) {
2020-03-18 18:54:31 +01:00
e . preventDefault ();
2020-03-25 23:48:12 +01:00
for ( var x = 0 , max = all_checkboxes . length ; x < max ; x ++ ) {
all_checkboxes [ x ] . click ();
2020-03-18 18:54:31 +01:00
}
2020-03-18 03:31:29 +01:00
}
}
2020-03-18 18:54:31 +01:00
{ / literal }
2020-03-26 15:31:49 +01:00
2020-03-18 18:54:31 +01:00
{ / if }
2020-03-18 03:31:29 +01:00
//key: [ctrl]+[s], edit: to save
2020-03-25 17:35:39 +01:00
{ if $settings . theme . keyboard_shortcut_save_enabled }
2020-03-18 18:54:31 +01:00
{ literal }
if ((( e . which == 115 || e . which == 83 ) && ( e . ctrlKey || e . metaKey ) && ! e . shiftKey ) || ( e . which == 19 )) {
e . preventDefault ();
2020-03-25 23:48:12 +01:00
var save_button ;
save_button = document . getElementById ( 'btn_save' );
if ( save_button === null || save_button === undefined ) {
save_button = document . querySelector ( 'button[name=btn_save]' );
2020-03-18 18:54:31 +01:00
}
2020-03-25 23:48:12 +01:00
if ( save_button !== null ) { save_button . click (); }
2020-03-18 03:31:29 +01:00
}
2020-03-18 18:54:31 +01:00
{ / literal }
{ / if }
2020-03-18 03:31:29 +01:00
//key: [ctrl]+[c], list,edit: to copy
2020-03-25 17:35:39 +01:00
{ if $settings . theme . keyboard_shortcut_copy_enabled }
2020-03-18 18:54:31 +01:00
{ if $browser_name_short == 'Safari' } //emulate with detecting [c] only, as [command] and [control] keys are ignored when captured
{ literal }
2020-09-24 19:15:53 +02:00
if (
( e . which == 99 || e . which == 67 ) &&
! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) &&
! ( e . target . tagName == 'INPUT' && e . target . type == 'password' ) &&
e . target . tagName != 'TEXTAREA'
) {
2020-03-18 18:54:31 +01:00
{ / literal }
{ else }
{ literal }
2020-09-24 19:15:53 +02:00
if (
(
(
( e . which == 99 || e . which == 67 ) &&
( e . ctrlKey || e . metaKey ) &&
! e . shiftKey
) ||
e . which == 19
) &&
! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) &&
e . target . tagName != 'TEXTAREA'
) {
2020-03-18 18:54:31 +01:00
{ / literal }
{ / if }
2020-03-18 03:31:29 +01:00
{ literal }
2020-03-18 18:54:31 +01:00
var current_selection , copy_button ;
current_selection = window . getSelection ();
2020-03-25 23:48:12 +01:00
if ( current_selection === null || current_selection === undefined || current_selection . toString () == '' ) {
2020-03-18 18:54:31 +01:00
e . preventDefault ();
2020-03-25 23:48:12 +01:00
copy_button = document . querySelector ( 'button[name=btn_copy]' );
if ( copy_button === null || copy_button === undefined ) {
copy_button = document . getElementById ( 'btn_copy' );
2020-03-18 18:54:31 +01:00
}
if ( copy_button !== null ) { copy_button . click (); }
2020-03-18 03:31:29 +01:00
}
}
2020-03-18 18:54:31 +01:00
{ / literal }
{ / if }
2020-03-18 03:31:29 +01:00
2024-01-12 23:34:51 +01:00
//key: [left] / [right], audio playback: rewind / fast-forward
{ literal }
if (
e . which == 39 &&
! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) &&
e . target . tagName != 'TEXTAREA'
) {
recording_fast_forward ();
}
if (
e . which == 37 &&
! ( e . target . tagName == 'INPUT' && e . target . type == 'text' ) &&
e . target . tagName != 'TEXTAREA'
) {
recording_rewind ();
}
{ / literal }
2020-03-18 03:31:29 +01:00
//keydown end
{ literal }
});
{ / literal }
//link list rows
{ literal }
2019-10-20 00:55:46 +02:00
$ ( '.tr_hover tr,.list tr' ) . each ( function ( i , e ) {
$ ( e ) . children ( 'td:not(.list_control_icon,.list_control_icons,.tr_link_void,.list-row > .no-link,.list-row > .checkbox,.list-row > .button,.list-row > .action-button)' ) . on ( 'click' , function () {
2020-03-18 03:31:29 +01:00
var href = $ ( this ) . closest ( 'tr' ) . attr ( 'href' );
2019-05-06 18:08:15 +02:00
var target = $ ( this ) . closest ( 'tr' ) . attr ( 'target' );
if ( href ) {
if ( target ) { window . open ( href , target ); }
else { window . location = href ; }
}
});
2016-03-25 23:29:20 +01:00
});
2020-03-18 03:31:29 +01:00
{ / literal }
2016-03-25 23:29:20 +01:00
2019-08-22 19:04:03 +02:00
//autosize jquery autosize plugin on applicable input fields
2020-03-18 03:31:29 +01:00
{ literal }
$ ( 'input[type=text].txt.auto-size,input[type=number].txt.auto-size,input[type=password].txt.auto-size,input[type=text].formfld.auto-size,input[type=number].formfld.auto-size,input[type=password].formfld.auto-size' ) . autosizeInput ();
{ / literal }
2016-03-25 23:29:20 +01:00
2019-08-22 19:04:03 +02:00
//initialize bootstrap tempusdominus (calendar/datetime picker) plugin
2020-03-18 03:31:29 +01:00
{ literal }
2016-03-25 23:29:20 +01:00
$ ( function () {
2019-08-22 19:04:03 +02:00
//set defaults
$ . fn . datetimepicker . Constructor . Default = $ . extend ({}, $ . fn . datetimepicker . Constructor . Default , {
buttons : {
showToday : true ,
showClear : true ,
showClose : true ,
},
icons : {
2024-09-05 03:31:09 +02:00
time : 'fa-solid fa-clock' ,
date : 'fa-solid fa-calendar-days' ,
up : 'fa-solid fa-arrow-up' ,
down : 'fa-solid fa-arrow-down' ,
previous : 'fa-solid fa-chevron-left' ,
next : 'fa-solid fa-chevron-right' ,
today : 'fa-solid fa-calendar-check' ,
clear : 'fa-solid fa-trash' ,
close : 'fa-solid fa-xmark' ,
2019-08-22 19:04:03 +02:00
}
});
//define formatting of individual classes
2020-03-18 03:31:29 +01:00
$ ( '.datepicker' ) . datetimepicker ({ format : 'YYYY-MM-DD' , });
$ ( '.datetimepicker' ) . datetimepicker ({ format : 'YYYY-MM-DD HH:mm' , });
2023-01-18 23:25:55 +01:00
$ ( '.datetimepicker-future' ) . datetimepicker ({ format : 'YYYY-MM-DD HH:mm' , minDate : new Date (), });
2020-03-18 03:31:29 +01:00
$ ( '.datetimesecpicker' ) . datetimepicker ({ format : 'YYYY-MM-DD HH:mm:ss' , });
2016-03-25 23:29:20 +01:00
});
2020-03-18 03:31:29 +01:00
{ / literal }
2016-03-25 23:29:20 +01:00
2019-08-22 19:04:03 +02:00
//apply bootstrap colorpicker plugin
2020-03-18 03:31:29 +01:00
{ literal }
2016-03-25 23:29:20 +01:00
$ ( function (){
$ ( '.colorpicker' ) . colorpicker ({
align : 'left' ,
customClass : 'colorpicker-2x' ,
sliders : {
saturation : {
maxLeft : 200 ,
maxTop : 200
},
hue : {
maxTop : 200
},
alpha : {
maxTop : 200
}
}
});
});
2020-03-18 03:31:29 +01:00
{ / literal }
2016-03-25 23:29:20 +01:00
2019-08-22 19:04:03 +02:00
//apply bootstrap password strength plugin
2020-03-18 03:31:29 +01:00
{ literal }
2016-06-03 02:26:32 +02:00
$ ( '#password' ) . pwstrength ({
common : {
minChar : 8 ,
usernameField : '#username' ,
},
2020-03-18 03:31:29 +01:00
//rules: { },
2016-06-03 02:26:32 +02:00
ui : {
2020-03-18 03:31:29 +01:00
colorClasses : [ 'danger' , 'warning' , 'warning' , 'warning' , 'success' , 'success' ], //weak,poor,normal,medium,good,strong
2016-06-03 02:26:32 +02:00
progressBarMinPercentage : 15 ,
showVerdicts : false ,
viewports : {
2020-03-18 03:31:29 +01:00
progress : '#pwstrength_progress'
2016-06-03 02:26:32 +02:00
}
}
});
2020-03-18 03:31:29 +01:00
{ / literal }
2016-06-03 02:26:32 +02:00
2020-03-18 03:31:29 +01:00
//crossfade menu brand images (if hover version set)
2023-05-13 04:29:44 +02:00
{ if ! empty ( $settings . theme . menu_brand_image ) && ! empty ( $settings . theme . menu_brand_image_hover ) && isset ( $settings . theme . menu_style ) && $settings . theme . menu_style != 'side' }
2020-03-18 03:31:29 +01:00
{ literal }
2016-05-21 03:08:10 +02:00
$ ( function (){
2019-08-21 02:15:50 +02:00
$ ( '#menu_brand_image' ) . on ( 'mouseover' , function (){
2016-05-21 03:08:10 +02:00
$ ( this ) . fadeOut ( 'fast' , function (){
$ ( '#menu_brand_image_hover' ) . fadeIn ( 'fast' );
});
});
2019-08-21 02:15:50 +02:00
$ ( '#menu_brand_image_hover' ) . on ( 'mouseout' , function (){
2016-05-21 03:08:10 +02:00
$ ( this ) . fadeOut ( 'fast' , function (){
$ ( '#menu_brand_image' ) . fadeIn ( 'fast' );
});
});
});
2020-03-18 03:31:29 +01:00
{ / literal }
{ / if }
2016-05-21 03:08:10 +02:00
2019-03-29 00:58:02 +01:00
//generate resizeEnd event after window resize event finishes (used when side menu and on messages app)
2020-03-18 03:31:29 +01:00
{ literal }
2019-08-21 02:15:50 +02:00
$ ( window ) . on ( 'resize' , function () {
2019-03-29 00:58:02 +01:00
if ( this . resizeTO ) { clearTimeout ( this . resizeTO ); }
this . resizeTO = setTimeout ( function () { $ ( this ) . trigger ( 'resizeEnd' ); }, 180 );
});
2020-03-18 03:31:29 +01:00
{ / literal }
2019-03-29 00:58:02 +01:00
2020-03-18 03:31:29 +01:00
//side menu: adjust content container width after window resize
{ if $settings . theme . menu_style == 'side' }
{ literal }
2019-03-26 21:43:31 +01:00
$ ( window ) . on ( 'resizeEnd' , function () {
2020-05-23 22:00:49 +02:00
if ( $ ( window ) . width () < 576 ) {
if ( menu_side_state_current == 'contracted' ) {
$ ( '#menu_side_container' ) . hide ();
}
if ( menu_side_state_current == 'expanded' ) {
2020-05-28 05:24:07 +02:00
{ / literal }
{ if $menu_side_state != 'hidden' }
{ literal }
$ ( '#menu_side_container' ) . show ();
{ / literal }
{ / if }
{ literal }
2020-05-23 22:00:49 +02:00
$ ( '#menu_side_container' ) . animate ({ width : $ ( window ) . width () }, 180 );
}
$ ( '#content_container' ) . animate ({ width : $ ( window ) . width () }, 100 );
}
else {
2020-05-28 05:24:07 +02:00
{ / literal }
{ if $menu_side_state == 'hidden' }
{ literal }
$ ( '#menu_side_container' ) . animate ({ width : '{/literal}{$settings.theme.menu_side_width_expanded}{literal}px' }, 180 );
$ ( '#content_container' ) . animate ({ width : $ ( window ) . width () }, 100 );
{ / literal }
{ else }
{ literal }
$ ( '#menu_side_container' ) . show ();
if ( menu_side_state_current == 'expanded' ) {
$ ( '#menu_side_container' ) . animate ({ width : '{/literal}{$settings.theme.menu_side_width_expanded}{literal}px' }, 180 , function () {
$ ( '#content_container' ) . animate ({ width : $ ( window ) . width () - $ ( '#menu_side_container' ) . width () }, 100 );
});
}
else {
2020-05-23 22:00:49 +02:00
$ ( '#content_container' ) . animate ({ width : $ ( window ) . width () - $ ( '#menu_side_container' ) . width () }, 100 );
2020-05-28 05:24:07 +02:00
}
{ / literal }
{ / if }
{ literal }
2020-05-23 22:00:49 +02:00
}
2019-03-26 21:43:31 +01:00
});
2024-10-07 22:36:55 +02:00
{ / literal }
{ / if }
2024-09-29 00:37:36 +02:00
2025-03-12 20:15:38 +01:00
//hide an open user menu in the body header or menu on scroll
{ literal }
$ ( window ) . on ( 'scroll' , function () {
$ ( '#body_header_user_menu' ) . fadeOut ( 200 );
});
$ ( 'div#main_content' ) . on ( 'click' , function () {
$ ( '#body_header_user_menu' ) . fadeOut ( 200 );
});
{ / literal }
2020-03-18 03:31:29 +01:00
2024-10-07 22:36:55 +02:00
//create function to mimic toggling fade and slide at the same time
{ literal }
( function ( $ ){
$ . fn . toggleFadeSlide = function ( speed = 200 , easing , callback ){
return this . animate ({ opacity : 'toggle' , height : 'toggle' }, speed , easing , callback );
};
})( jQuery );
{ / literal }
2020-03-18 03:31:29 +01:00
{ literal }
}); //document ready end
{ / literal }
2019-03-26 21:43:31 +01:00
2016-03-25 23:29:20 +01:00
2016-03-28 17:09:33 +02:00
//audio playback functions
2020-03-18 03:31:29 +01:00
{ literal }
2024-01-12 23:34:51 +01:00
var recording_audio , audio_clock , recording_id_playing ;
2016-03-28 17:09:33 +02:00
2024-02-09 21:07:19 +01:00
function recording_play ( player_id , data , audio_type ) {
if ( document . getElementById ( 'recording_progress_bar_' + player_id )) {
document . getElementById ( 'recording_progress_bar_' + player_id ) . style . display = '' ;
2016-03-28 17:09:33 +02:00
}
2024-02-09 21:07:19 +01:00
recording_audio = document . getElementById ( 'recording_audio_' + player_id );
2016-03-28 17:09:33 +02:00
if ( recording_audio . paused ) {
2024-02-09 21:07:19 +01:00
{ / literal }
//create and load waveform image
{ if $settings . theme . audio_player_waveform_enabled == 'true' }
{ literal }
//list playback
if ( document . getElementById ( 'playback_progress_bar_background_' + player_id )) {
// alert("waveform.php?id=" + player_id + (data !== undefined ? '&data=' + data : '') + (audio_type !== undefined ? '&type=' + audio_type : ''));
document . getElementById ( 'playback_progress_bar_background_' + player_id ) . style . backgroundImage = " linear-gradient(to bottom, rgba(0,0,0,0.10) 0%, transparent 20%), url('waveform.php?id= " + player_id + ( data !== undefined ? '&data=' + data : '' ) + ( audio_type !== undefined ? '&type=' + audio_type : '' ) + " ') " ;
}
//form playback
else if ( document . getElementById ( 'recording_progress_bar_' + player_id )) {
// alert("waveform.php?id=" + player_id + (data !== undefined ? '&data=' + data : '') + (audio_type !== undefined ? '&type=' + audio_type : ''));
document . getElementById ( 'recording_progress_bar_' + player_id ) . style . backgroundImage = " linear-gradient(to bottom, rgba(0,0,0,0.10) 0%, transparent 20%), url('waveform.php?id= " + player_id + ( data !== undefined ? '&data=' + data : '' ) + ( audio_type !== undefined ? '&type=' + audio_type : '' ) + " ') " ;
}
{ / literal }
{ / if }
{ literal }
2016-03-28 17:09:33 +02:00
recording_audio . volume = 1 ;
recording_audio . play ();
2024-02-09 21:07:19 +01:00
recording_id_playing = player_id ;
document . getElementById ( 'recording_button_' + player_id ) . innerHTML = " <span class=' { /literal} { $settings . theme . button_icon_pause } { literal} fa-fw'></span> " ;
audio_clock = setInterval ( function () { update_progress ( player_id ); }, 20 );
2016-09-04 04:24:47 +02:00
2024-02-09 21:07:19 +01:00
$ ( '[id*=recording_button]' ) . not ( '[id*=recording_button_' + player_id + ']' ) . html ( " <span class=' { /literal} { $settings . theme . button_icon_play } { literal} fa-fw'></span> " );
2024-08-01 18:27:15 +02:00
$ ( '[id*=recording_button_intro]' ) . not ( '[id*=recording_button_' + player_id + ']' ) . html ( " <span class=' { /literal} { $settings . theme . button_icon_comment } { literal} fa-fw'></span> " );
2024-02-09 21:07:19 +01:00
$ ( '[id*=recording_progress_bar]' ) . not ( '[id*=recording_progress_bar_' + player_id + ']' ) . css ( 'display' , 'none' );
2018-12-12 22:52:56 +01:00
2023-08-27 01:30:58 +02:00
$ ( 'audio' ) . each ( function (){
2016-09-04 04:24:47 +02:00
if ( $ ( this ) . get ( 0 ) != recording_audio ) {
2020-03-18 03:31:29 +01:00
$ ( this ) . get ( 0 ) . pause (); //stop playing
$ ( this ) . get ( 0 ) . currentTime = 0 ; //reset time
2016-09-04 04:24:47 +02:00
}
});
2016-03-28 17:09:33 +02:00
}
else {
recording_audio . pause ();
2024-01-12 23:34:51 +01:00
recording_id_playing = '' ;
2024-08-01 18:27:15 +02:00
if ( player_id . substring ( 0 , 6 ) == 'intro_' ) {
document . getElementById ( 'recording_button_' + player_id ) . innerHTML = " <span class=' { /literal} { $settings . theme . button_icon_comment } { literal} fa-fw'></span> " ;
}
else {
document . getElementById ( 'recording_button_' + player_id ) . innerHTML = " <span class=' { /literal} { $settings . theme . button_icon_play } { literal} fa-fw'></span> " ;
}
2016-06-28 20:08:36 +02:00
clearInterval ( audio_clock );
2016-03-28 17:09:33 +02:00
}
}
2024-02-09 21:07:19 +01:00
function recording_stop ( player_id ) {
recording_reset ( player_id );
2016-06-28 20:08:36 +02:00
clearInterval ( audio_clock );
2016-06-21 23:56:15 +02:00
}
2024-02-09 21:07:19 +01:00
function recording_reset ( player_id ) {
recording_audio = document . getElementById ( 'recording_audio_' + player_id );
2016-06-21 23:56:15 +02:00
recording_audio . pause ();
recording_audio . currentTime = 0 ;
2024-02-09 21:07:19 +01:00
if ( document . getElementById ( 'recording_progress_bar_' + player_id )) {
document . getElementById ( 'recording_progress_bar_' + player_id ) . style . display = 'none' ;
2016-03-28 17:09:33 +02:00
}
2024-08-01 18:27:15 +02:00
if ( player_id . substring ( 0 , 6 ) == 'intro_' ) {
document . getElementById ( 'recording_button_' + player_id ) . innerHTML = " <span class=' { /literal} { $settings . theme . button_icon_comment } { literal} fa-fw'></span> " ;
}
else {
document . getElementById ( 'recording_button_' + player_id ) . innerHTML = " <span class=' { /literal} { $settings . theme . button_icon_play } { literal} fa-fw'></span> " ;
}
2016-06-28 20:08:36 +02:00
clearInterval ( audio_clock );
2016-03-28 17:09:33 +02:00
}
2024-02-09 21:07:19 +01:00
function update_progress ( player_id ) {
recording_audio = document . getElementById ( 'recording_audio_' + player_id );
var recording_progress = document . getElementById ( 'recording_progress_' + player_id );
2016-03-28 17:09:33 +02:00
var value = 0 ;
2024-01-12 23:34:51 +01:00
if ( recording_audio != null && recording_audio . currentTime > 0 ) {
2024-02-09 21:07:19 +01:00
value = Number ((( 100 / recording_audio . duration ) * recording_audio . currentTime ) . toFixed ( 1 ));
2016-03-28 17:09:33 +02:00
}
2024-01-12 23:34:51 +01:00
if ( recording_progress ) {
recording_progress . style . marginLeft = value + '%' ;
}
2024-10-19 02:58:44 +02:00
// if (recording_audio != null && parseInt(recording_audio.duration) > 30) { //seconds
// clearInterval(audio_clock);
// }
2016-03-28 17:09:33 +02:00
}
2024-01-12 23:34:51 +01:00
function recording_fast_forward () {
if ( recording_audio ) {
2024-02-09 21:07:19 +01:00
recording_audio . currentTime += { / literal }{ if ! empty ( $settings . theme . audio_player_scrub_seconds ) }{ $settings . theme . audio_player_scrub_seconds }{ else } 2 { / if }{ literal };
2024-01-12 23:34:51 +01:00
update_progress ( recording_id_playing );
}
}
function recording_rewind () {
if ( recording_audio ) {
2024-02-09 21:07:19 +01:00
recording_audio . currentTime -= { / literal }{ if ! empty ( $settings . theme . audio_player_scrub_seconds ) }{ $settings . theme . audio_player_scrub_seconds }{ else } 2 { / if }{ literal };
2024-01-12 23:34:51 +01:00
update_progress ( recording_id_playing );
}
}
2024-10-19 03:02:21 +02:00
function recording_seek ( event , player_id ) {
2024-10-19 02:45:21 +02:00
if ( recording_audio ) {
if ( document . getElementById ( 'playback_progress_bar_background_' + player_id )) {
audio_player = document . getElementById ( 'playback_progress_bar_background_' + player_id );
}
else if ( document . getElementById ( 'recording_progress_bar_' + player_id )) {
audio_player = document . getElementById ( 'recording_progress_bar_' + player_id );
}
recording_audio . currentTime = ( event . offsetX / audio_player . offsetWidth ) * recording_audio . duration ;
update_progress ( recording_id_playing );
2024-10-19 02:58:44 +02:00
document . getElementById ( 'recording_button_' + player_id ) . focus ();
2024-10-19 02:45:21 +02:00
}
}
2020-03-18 03:31:29 +01:00
{ / literal }
2016-03-28 17:09:33 +02:00
2019-10-20 00:55:46 +02:00
//handle action bar style on scroll
2020-03-18 03:31:29 +01:00
{ literal }
2020-01-12 04:23:40 +01:00
window . addEventListener ( 'scroll' , function (){
2024-09-12 02:35:50 +02:00
action_bar_scroll ( 'action_bar' , { / literal }{ if $settings . theme . menu_style == 'side' } 60 { else } 20 { / if }{ literal });
2020-01-12 04:23:40 +01:00
}, false );
function action_bar_scroll ( action_bar_id , scroll_position , function_sticky , function_inline ) {
if ( document . getElementById ( action_bar_id )) {
//sticky
if ( this . scrollY > scroll_position ) {
document . getElementById ( action_bar_id ) . classList . add ( 'scroll' );
if ( typeof function_sticky === 'function' ) { function_sticky (); }
}
//inline
if ( this . scrollY < scroll_position ) {
document . getElementById ( action_bar_id ) . classList . remove ( 'scroll' );
if ( typeof function_inline === 'function' ) { function_inline (); }
}
2019-10-17 22:24:34 +02:00
}
}
2020-03-18 03:31:29 +01:00
{ / literal }
2019-10-17 22:24:34 +02:00
2019-10-24 05:19:37 +02:00
//enable button class button
2020-03-18 03:31:29 +01:00
{ literal }
2019-10-24 05:19:37 +02:00
function button_enable ( button_id ) {
button = document . getElementById ( button_id );
button . disabled = false ;
button . classList . remove ( 'disabled' );
if ( button . parentElement . nodeName == 'A' ) {
anchor = button . parentElement ;
anchor . classList . remove ( 'disabled' );
anchor . setAttribute ( 'onclick' , '' );
}
}
2020-03-18 03:31:29 +01:00
{ / literal }
2019-10-24 05:19:37 +02:00
//disable button class button
2020-03-18 03:31:29 +01:00
{ literal }
2019-10-24 05:19:37 +02:00
function button_disable ( button_id ) {
button = document . getElementById ( button_id );
button . disabled = true ;
button . classList . add ( 'disabled' );
if ( button . parentElement . nodeName == 'A' ) {
anchor = button . parentElement ;
anchor . classList . add ( 'disabled' );
anchor . setAttribute ( 'onclick' , 'return false;' );
}
}
2020-03-18 03:31:29 +01:00
{ / literal }
2019-10-24 05:19:37 +02:00
2020-07-23 10:10:36 +02:00
//checkbox on change
{ literal }
function checkbox_on_change ( checkbox ) {
checked = false ;
var inputs = document . getElementsByTagName ( 'input' );
for ( var i = 0 , max = inputs . length ; i < max ; i ++ ) {
if ( inputs [ i ] . type === 'checkbox' && inputs [ i ] . checked == true ) {
checked = true ;
break ;
}
}
2020-07-23 17:43:01 +02:00
btn_copy = document . getElementById ( " btn_copy " );
btn_toggle = document . getElementById ( " btn_toggle " );
btn_delete = document . getElementById ( " btn_delete " );
2023-10-19 02:40:50 +02:00
btn_download = document . getElementById ( " btn_download " );
2024-05-21 22:59:23 +02:00
btn_transcribe = document . getElementById ( " btn_transcribe " );
2024-07-11 00:28:41 +02:00
btn_resend = document . getElementById ( " btn_resend " );
2020-07-23 10:10:36 +02:00
if ( checked == true ) {
2023-10-19 02:40:50 +02:00
if ( btn_copy ) { btn_copy . style . display = " inline " ; }
if ( btn_toggle ) { btn_toggle . style . display = " inline " ; }
if ( btn_delete ) { btn_delete . style . display = " inline " ; }
if ( btn_download ) { btn_download . style . display = " inline " ; }
2024-05-21 22:59:23 +02:00
if ( btn_transcribe ) { btn_transcribe . style . display = " inline " ; }
2024-07-11 00:28:41 +02:00
if ( btn_resend ) { btn_resend . style . display = " inline " ; }
2020-07-23 10:10:36 +02:00
}
else {
2023-10-19 02:40:50 +02:00
if ( btn_copy ) { btn_copy . style . display = " none " ; }
if ( btn_toggle ) { btn_toggle . style . display = " none " ; }
if ( btn_delete ) { btn_delete . style . display = " none " ; }
if ( btn_download ) { btn_download . style . display = " none " ; }
2024-05-21 22:59:23 +02:00
if ( btn_transcribe ) { btn_transcribe . style . display = " none " ; }
2024-07-11 00:28:41 +02:00
if ( btn_resend ) { btn_resend . style . display = " none " ; }
2020-07-23 10:10:36 +02:00
}
}
{ / literal }
2020-03-18 03:31:29 +01:00
//list page functions
{ literal }
2019-11-26 21:50:24 +01:00
function list_all_toggle ( modifier ) {
2020-02-28 02:58:44 +01:00
var checkboxes = ( modifier !== undefined ) ? document . getElementsByClassName ( 'checkbox_' + modifier ) : document . querySelectorAll ( " input[type='checkbox'] " );
var checkbox_checked = document . getElementById ( 'checkbox_all' + ( modifier !== undefined ? '_' + modifier : '' )) . checked ;
for ( var i = 0 , max = checkboxes . length ; i < max ; i ++ ) {
checkboxes [ i ] . checked = checkbox_checked ;
2019-10-20 00:55:46 +02:00
}
2019-11-26 21:50:24 +01:00
if ( document . getElementById ( 'btn_check_all' ) && document . getElementById ( 'btn_check_none' )) {
if ( checkbox_checked ) {
document . getElementById ( 'btn_check_all' ) . style . display = 'none' ;
document . getElementById ( 'btn_check_none' ) . style . display = '' ;
}
else {
document . getElementById ( 'btn_check_all' ) . style . display = '' ;
document . getElementById ( 'btn_check_none' ) . style . display = 'none' ;
}
2019-10-20 00:55:46 +02:00
}
}
2019-11-18 21:31:06 +01:00
function list_all_check () {
var inputs = document . getElementsByTagName ( 'input' );
document . getElementById ( 'checkbox_all' ) . checked ;
for ( var i = 0 , max = inputs . length ; i < max ; i ++ ) {
if ( inputs [ i ] . type === 'checkbox' ) {
inputs [ i ] . checked = true ;
}
}
}
2019-10-20 00:55:46 +02:00
function list_self_check ( checkbox_id ) {
var inputs = document . getElementsByTagName ( 'input' );
for ( var i = 0 , max = inputs . length ; i < max ; i ++ ) {
2023-06-14 00:54:48 +02:00
if ( inputs [ i ] . type === 'checkbox' && inputs [ i ] . name . search [ 'enabled' ] == - 1 ) {
2019-10-20 00:55:46 +02:00
inputs [ i ] . checked = false ;
}
}
document . getElementById ( checkbox_id ) . checked = true ;
}
function list_action_set ( action ) {
document . getElementById ( 'action' ) . value = action ;
}
function list_form_submit ( form_id ) {
document . getElementById ( form_id ) . submit ();
}
function list_search_reset () {
document . getElementById ( 'btn_reset' ) . style . display = 'none' ;
document . getElementById ( 'btn_search' ) . style . display = '' ;
}
2020-03-18 03:31:29 +01:00
{ / literal }
2019-10-20 00:55:46 +02:00
2020-03-18 03:31:29 +01:00
//edit page functions
{ literal }
2020-02-28 02:58:44 +01:00
function edit_all_toggle ( modifier ) {
var checkboxes = document . getElementsByClassName ( 'checkbox_' + modifier );
var checkbox_checked = document . getElementById ( 'checkbox_all_' + modifier ) . checked ;
2020-02-28 15:29:57 +01:00
if ( checkboxes . length > 0 ) {
2020-02-28 02:58:44 +01:00
for ( var i = 0 ; i < checkboxes . length ; ++ i ) {
checkboxes [ i ] . checked = checkbox_checked ;
}
2020-02-28 15:29:57 +01:00
if ( document . getElementById ( 'btn_delete' )) {
document . getElementById ( 'btn_delete' ) . value = checkbox_checked ? '' : 'delete' ;
}
2020-02-28 02:58:44 +01:00
}
}
function edit_delete_action ( modifier ) {
2020-02-27 17:27:11 +01:00
var checkboxes = document . getElementsByClassName ( 'chk_delete' );
if ( document . getElementById ( 'btn_delete' ) && checkboxes . length > 0 ) {
var checkbox_checked = false ;
for ( var i = 0 ; i < checkboxes . length ; ++ i ) {
2020-02-28 02:58:44 +01:00
if ( checkboxes [ i ] . checked ) {
checkbox_checked = true ;
}
else {
if ( document . getElementById ( 'checkbox_all' + ( modifier !== undefined ? '_' + modifier : '' ))) {
document . getElementById ( 'checkbox_all' + ( modifier !== undefined ? '_' + modifier : '' )) . checked = false ;
}
}
2020-02-27 17:27:11 +01:00
}
document . getElementById ( 'btn_delete' ) . value = checkbox_checked ? '' : 'delete' ;
}
}
2020-03-18 03:31:29 +01:00
{ / literal }
2020-02-27 17:27:11 +01:00
2020-03-25 23:48:12 +01:00
//modal functions
{ literal }
function modal_open ( modal_id , focus_id ) {
var modal = document . getElementById ( modal_id );
modal . style . opacity = '1' ;
modal . style . pointerEvents = 'auto' ;
if ( focus_id !== undefined ) {
document . getElementById ( focus_id ) . focus ();
}
}
function modal_close () {
var modals = document . getElementsByClassName ( 'modal-window' );
if ( modals . length > 0 ) {
for ( var m = 0 ; m < modals . length ; ++ m ) {
modals [ m ] . style . opacity = '0' ;
modals [ m ] . style . pointerEvents = 'none' ;
}
}
document . activeElement . blur ();
}
{ / literal }
2020-03-18 03:31:29 +01:00
//misc functions
{ literal }
2020-02-28 02:58:44 +01:00
function swap_display ( a_id , b_id , display_value ) {
display_value = display_value !== undefined ? display_value : 'inline-block' ;
a = document . getElementById ( a_id );
b = document . getElementById ( b_id );
if ( window . getComputedStyle ( a ) . display === 'none' ) {
a . style . display = display_value ;
b . style . display = 'none' ;
}
else {
a . style . display = 'none' ;
b . style . display = display_value ;
}
}
2020-03-04 03:10:50 +01:00
function hide_password_fields () {
var password_fields = document . querySelectorAll ( " input[type='password'] " );
for ( var p = 0 , max = password_fields . length ; p < max ; p ++ ) {
password_fields [ p ] . style . visibility = 'hidden' ;
password_fields [ p ] . type = 'text' ;
}
}
window . addEventListener ( 'beforeunload' , function ( e ){
hide_password_fields ();
});
2020-03-18 03:31:29 +01:00
{ / literal }
2020-04-18 22:09:51 +02:00
{ *// session timer * }
2023-05-13 04:29:44 +02:00
{ if ! empty ( $session_timer )}
{ $session_timer }
{ / if }
2020-04-18 22:09:51 +02:00
2022-11-28 22:56:52 +01:00
{ *// domain selector * }
function search_domains ( element_id ) {
var xhttp = new XMLHttpRequest ();
xhttp . onreadystatechange = function () {
//if (this.readyState == 4 && this.status == 200) {
// document.getElementById(element_id).innerHTML = this.responseText;
//}
//remove current options
document . getElementById ( element_id ) . innerHTML = '' ;
if ( this . readyState == 4 && this . status == 200 ) {
//create the json object from the response
obj = JSON . parse ( this . responseText );
//update the domain count
2025-03-11 23:11:40 +01:00
document . getElementById ( 'domain_count' ) . innerText = obj . length ;
2022-11-28 22:56:52 +01:00
//add new options from the json results
for ( var i = 0 ; i < obj . length ; i ++ ) {
2024-06-18 17:32:19 +02:00
2022-11-28 22:56:52 +01:00
//get the variables
domain_uuid = obj [ i ] . domain_uuid ;
domain_name = obj [ i ] . domain_name ;
if ( obj [ i ] . domain_description != null ) {
// domain_description = DOMPurify.sanitize(obj[i].domain_description);
}
//create a div element
var div = document . createElement ( 'div' );
//add a div title
div . title = obj [ i ] . domain_name ;
//add a css class
div . classList . add ( " domains_list_item " );
//alternate the background color
if ( i % 2 == 0 ) {
div . style . background = '{$domain_selector_background_color_1}' ;
}
else {
div . style . background = '{$domain_selector_background_color_2}' ;
}
2024-06-18 17:32:19 +02:00
//set the active domain style
2022-11-28 22:56:52 +01:00
if ( '{$domain_uuid}' == obj [ i ] . domain_uuid ) {
div . style . background = '{$domain_active_background_color}' ;
div . style . fontWeight = 'bold' ;
//div.classList.add("domains_list_item_active");
//var item_description_class = 'domain_active_list_item_description';
}
else {
//div.classList.add("domains_list_item_inactive");
//var item_description_class = 'domain_inactive_list_item_description';
}
2023-01-18 01:34:34 +01:00
//set link on domain div in list
div . setAttribute ( 'onclick' , " window.location.href=' { $domains_app_path } ?domain_uuid= " + obj [ i ] . domain_uuid + " &domain_change=true'; " );
//define domain link text and description (if any)
2022-11-28 22:56:52 +01:00
link_label = obj [ i ] . domain_name ;
if ( obj [ i ] . domain_description != null ) {
2023-01-18 01:34:34 +01:00
link_label += " <span class='domain_list_item_description' title= \" " + obj [ i ] . domain_description + " \" > " + obj [ i ] . domain_description + " </span> " ;
2022-11-28 22:56:52 +01:00
}
var a_tag = document . createElement ( 'a' );
2023-01-18 01:34:34 +01:00
a_tag . setAttribute ( 'href' , 'manage:' + obj [ i ] . domain_name );
a_tag . setAttribute ( 'onclick' , 'event.preventDefault();' );
a_tag . innerHTML = link_label ;
2022-11-28 22:56:52 +01:00
div . appendChild ( a_tag );
document . getElementById ( element_id ) . appendChild ( div );
}
}
};
search = document . getElementById ( 'domains_search' );
if ( search . value ) {
//xhttp.open("GET", "/core/domains/domain_list.php?search="+search.value, true);
2022-11-29 05:07:18 +01:00
xhttp . open ( " GET " , " /core/domains/domain_json.php?search= " + search . value + " & { $domain_json_token_name } = { $domain_json_token_hash } " , true );
2022-11-28 22:56:52 +01:00
}
else {
//xhttp.open("GET", "/core/domains/domain_list.php", true);
2022-11-29 05:07:18 +01:00
xhttp . open ( " GET " , " /core/domains/domain_json.php? { $domain_json_token_name } = { $domain_json_token_hash } " , true );
2022-11-28 22:56:52 +01:00
}
xhttp . send ();
}
{ *// domain selector * }
2020-03-18 03:31:29 +01:00
</ script >
</ head >
< body >
2024-06-18 17:32:19 +02:00
{ *// video background * }
2024-09-10 12:03:44 +02:00
{ if ! empty ({ $background_video })}
2024-07-27 03:47:13 +02:00
< video id = " background-video " autoplay muted poster = " " disablePictureInPicture = " true " onloadstart = " this.playbackRate = 1; this.pause(); " >
2024-09-10 12:03:44 +02:00
< source src = " { $background_video } " type = " video/mp4 " >
2024-06-18 17:32:19 +02:00
</ video >
{ / if }
2024-09-01 10:18:35 +02:00
{ *// image background * }
< div id = 'background-image' ></ div >
{ *// color background * }
< div id = 'background-color' ></ div >
2020-03-18 03:31:29 +01:00
{ *// message container * }
2024-09-01 10:18:35 +02:00
< div id = 'message_container' ></ div >
2020-03-18 03:31:29 +01:00
{ *// domain selector * }
2024-09-01 10:18:35 +02:00
{ if $authenticated && $domain_selector_enabled }
< div id = 'domains_container' >
< input type = 'hidden' id = 'domains_visible' value = '0' >
< div id = 'domains_block' >
< div id = 'domains_header' >
< input id = 'domains_hide' type = 'button' class = 'btn' style = 'float: right' value = " { $text . theme_button_close } " >
2025-03-11 23:11:40 +01:00
< a id = 'domains_title' href = '{$domains_app_path}' > { $text . theme_title_domains } < div class = 'count' id = 'domain_count' style = 'font-size: 80%;' ></ div ></ a >
2024-09-01 10:18:35 +02:00
< br >< br >
< input type = 'text' id = 'domains_search' class = 'formfld' style = 'margin-left: 0; min-width: 100%; width: 100%;' placeholder = " { $text . theme_label_search } " onkeyup = " search_domains('domains_list'); " >
2020-03-18 03:31:29 +01:00
</ div >
2024-09-01 10:18:35 +02:00
< div id = 'domains_list' ></ div >
2020-03-18 03:31:29 +01:00
</ div >
2024-09-01 10:18:35 +02:00
</ div >
2020-03-18 03:31:29 +01:00
2024-09-01 10:18:35 +02:00
{ / if }
2020-03-18 03:31:29 +01:00
{ *// qr code container for contacts * }
2024-09-01 10:18:35 +02:00
< div id = 'qr_code_container' style = 'display: none;' onclick = '$(this).fadeOut(400);' >
< table cellpadding = '0' cellspacing = '0' border = '0' width = '100%' height = '100%' >< tr >< td align = 'center' valign = 'middle' >
< span id = 'qr_code' onclick = " $ ('#qr_code_container').fadeOut(400); " ></ span >
</ td ></ tr ></ table >
</ div >
2020-03-18 03:31:29 +01:00
2020-03-22 05:33:35 +01:00
{ *// login page * }
2024-09-01 10:18:35 +02:00
{ if ! empty ( $login_page )}
< div id = 'default_login' >
< a href = '{$project_path}/' >< img id = 'login_logo' style = 'width: {$login_logo_width}; height: {$login_logo_height};' src = '{$login_logo_source}' ></ a >< br />
{ $document_body }
</ div >
< div id = 'footer_login' >
< span class = 'footer' > { $settings . theme . footer } </ span >
</ div >
2020-03-22 05:33:35 +01:00
{ *// other pages * }
2024-09-01 10:18:35 +02:00
{ else }
{ if $settings . theme . menu_style == 'side' || $settings . theme . menu_style == 'inline' || $settings . theme . menu_style == 'static' }
{ $container_open }
{ if $settings . theme . menu_style == 'inline' }{ $logo }{ / if }
{ $menu }
{ if $settings . theme . menu_style == 'inline' || $settings . theme . menu_style == 'static' } < br /> { / if }
{ if $settings . theme . menu_style == 'side' } < input type = 'hidden' id = 'menu_side_state_current' value = '{if $menu_side_state == ' hidden '}expanded{else}{$menu_side_state}{/if}' > { / if }
{ else } { *// default : fixed * }
{ $menu }
{ $container_open }
2020-03-18 03:31:29 +01:00
{ / if }
2024-09-01 10:18:35 +02:00
< div id = 'main_content' >
{ $document_body }
</ div >
< div id = 'footer' >
< span class = 'footer' > { $settings . theme . footer } </ span >
</ div >
{ $container_close }
{ / if }
2020-03-18 03:31:29 +01:00
</ body >
2020-07-23 08:34:16 +02:00
</ html >