| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <script>
- function bx_mobile_apps_show_main_menu () {
- if ('__main_menu__' == 'default') {
- if ($('.bx-pt-application #toggleSidebarMobile').size() && $(window).width() < 1280)
- $('#toggleSidebarMobile').trigger('click');
- else if ($('.bx-pt-application #toggleSidebar').size() && $(window).width() >= 1280)
- $('#toggleSidebar').trigger('click');
- else if ($('.bx-sidebar-site-trigger').size())
- bx_sidebar_toggle('site');
- else if ($('.cd-dropdown-trigger').size())
- $('.cd-dropdown-trigger').click();
- else if ($('.cd-side-nav').size())
- $([$('.cd-side-nav'), $('.cd-nav-trigger')]).toggleClass('nav-is-visible');
- else
- bx_menu_slide_inline('#bx-sliding-menu-sys_site', null, 'site');
- }
- else {
- bx_menu_popup('__main_menu__');
- }
- }
- function bx_mobile_apps_show_profile_menu () {
- if ($('.bx-sidebar-account-trigger').size())
- bx_sidebar_toggle('account');
- else
- bx_menu_slide_inline('#bx-sliding-menu-account', null, 'site');
- }
- function bx_mobile_apps_show_add_menu () {
- if ('undefined' !== typeof(oBxArtificerUtils))
- $('#bx-sliding-menu-sys_add_content').css({visibility:'visible', top:'0'});
-
- bx_menu_slide_inline('#bx-sliding-menu-sys_add_content', null, 'site');
- }
- function bx_mobile_apps_show_notifications_menu () {
- bx_menu_slide('bx_notifications_preview', null, 'site', {id:{value:'bx_notifications_preview', force:1}});
- }
- function bx_mobile_apps_show_messenger_menu () {
- document.location = sUrlRoot + 'page.php?i=messenger';
- }
- function bx_mobile_apps_home () {
- if (window.history.length > 1)
- window.history.go(-(window.history.length - 1));
- }
- function bx_mobile_apps_close_sliding_menus () {
- if ($('.bx-sliding-menu-main:visible').size()) // hide sliding menu if they are open
- bx_menu_slide_inline('.bx-sliding-menu-main');
- }
- function bx_mobile_apps_video_terminated (e) {
- if (typeof window.glBxVideoCallTerminated !== 'undefined' && window.glBxVideoCallTerminated instanceof Array) {
- for (let i = 0; i < window.glBxVideoCallTerminated.length; i++)
- if (typeof window.glBxVideoCallTerminated[i] === "function")
- window.glBxVideoCallTerminated[i](e);
- }
- }
- function bx_mobile_apps_video_joined (e) {
- if (typeof window.glBxVideoCallJoined !== 'undefined' && window.glBxVideoCallJoined instanceof Array) {
- for (let i = 0; i < window.glBxVideoCallJoined.length; i++)
- if (typeof window.glBxVideoCallJoined[i] === "function")
- window.glBxVideoCallJoined[i](e);
- }
- }
- function bx_mobile_apps_video_will_join (e) {
- if (typeof window.glBxVideoCallWillJoin !== 'undefined' && window.glBxVideoCallWillJoin instanceof Array) {
- for (let i = 0; i < window.glBxVideoCallWillJoin.length; i++)
- if (typeof window.glBxVideoCallWillJoin[i] === "function")
- window.glBxVideoCallWillJoin[i](e);
- }
- }
- function bx_mobile_apps_post_message (oJSON) {
- var sMsg = JSON.stringify(oJSON);
- if ('undefined' !== typeof(window.ReactNativeWebView))
- window.ReactNativeWebView.postMessage(sMsg);
- else
- window.postMessage(sMsg, '*');
- }
- bx_mobile_apps_post_message (__msg__);
- if (window && window.process && window.process.type) { // if run in electron
- const { ipcRenderer, shell } = require('electron')
-
- // send all notification badges
- ipcRenderer.send('message', __msg__);
- // send messenger badge
- if (typeof window.glBxMessengerOnNotificationChange === 'undefined')
- window.glBxMessengerOnNotificationChange = [];
- window.glBxMessengerOnNotificationChange.push(function (iNewNumberOfUnreadChats) {
- sMsg = {
- 'bubbles': {
- 'notifications-messenger': iNewNumberOfUnreadChats,
- },
- };
- ipcRenderer.send('message', sMsg);
- });
- if ($.cookie('memberID')) {
- // force links to open in external browser in electron
- $(document).ready(function () {
- document.querySelector('body').addEventListener('click', event => {
- let link = event.target.href;
- if (event.target.tagName.toLowerCase() !== 'a')
- return;
- event.preventDefault();
- shell.openExternal(link);
- });
- });
- }
- }
- // pull to refresh
- $(document).ready(function () {
- /*
- if ($('.bx-messenger-block-lots').length)
- glBxMobileDisablePullToRefresh = true;
- if ('undefined' === typeof glBxMobileDisablePullToRefresh || false === glBxMobileDisablePullToRefresh) {
- PullToRefresh.init({
- instructionsPullToRefresh: '__txt_pull_to_refresh__',
- instructionsReleaseToRefresh: '__txt_release_to_refresh__',
- instructionsRefreshing: '__txt_refreshing__',
- onRefresh() {
- window.location.reload();
- },
- });
- }
- */
- bx_mobile_apps_post_message({stop_loading: 1});
- });
- </script>
|