Просмотр исходного кода

#2005 Mobile Apps
- setting for custom styles
- better perceived loading speed
- messenger & notification

Alex Trofimov 7 лет назад
Родитель
Сommit
9987bb4164

+ 4 - 1
modules/boonex/nexus/classes/BxNexusModule.php

@@ -51,7 +51,10 @@ class BxNexusModule extends BxDolModule
             $iBubbles += $r['bx_if:addon']['content']['addon'];
         }
 
-        $s  = $this->_oTemplate->parseHtmlByName('styles.html', array());
+        $s = $this->_oTemplate->parseHtmlByName('styles.html', array());
+        if ($sCustomStyles = getParam('bx_nexus_option_styles'))
+            $s .= "<style>\n" . $sCustomStyles . "\n</style>";
+
         $s .= $this->_oTemplate->parseHtmlByName('js.html', array(
             'msg' => json_encode(array(
                 'loggedin' => isLogged(),                

+ 1 - 1
modules/boonex/nexus/install/langs/en.xml

@@ -6,7 +6,7 @@
 	<string name="_bx_nexus_setting"><![CDATA[Nexus Setting]]></string>
     <string name="_bx_nexus_adm_stg_cpt_type"><![CDATA[Nexus]]></string>
     <string name="_bx_nexus_adm_stg_cpt_category_general"><![CDATA[General]]></string>
-    <string name="_bx_nexus_option_qwerty"><![CDATA[Qwerty]]></string>
+    <string name="_bx_nexus_option_styles"><![CDATA[Custom CSS styles for mobile apps]]></string>
 
 	<string name="_bx_nexus_information"><![CDATA[Information]]></string>
     <string name="_bx_nexus_information_block"><![CDATA[This module adds neccesary styles and functionalty for proper functionality of UNA Nexus apps. Installing this module isn't enough, you need to get source code of mobile apps then modify them for your needs then publish in Google and Apple stores.]]></string>

+ 1 - 1
modules/boonex/nexus/install/sql/enable.sql

@@ -11,7 +11,7 @@ VALUES (@iTypeId, 'bx_nexus_general', '_bx_nexus_adm_stg_cpt_category_general',
 SET @iCategId = LAST_INSERT_ID();
 
 INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `extra`, `check`, `check_error`, `order`) VALUES
-('bx_nexus_option_qwerty', '123', @iCategId, '_bx_nexus_option_qwerty', 'digit', '', '', '', 10);
+('bx_nexus_option_styles', '', @iCategId, '_bx_nexus_option_styles', 'text', '', '', '', 10);
 
 -- Injections
 

+ 10 - 0
modules/boonex/nexus/template/js.html

@@ -14,6 +14,14 @@
         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));
@@ -78,5 +86,7 @@
                 },
             });
         }
+        if ('undefined' !== typeof(window.ReactNativeWebView))
+            window.ReactNativeWebView.postMessage(JSON.stringify({stop_loading: 1}));
     });
 </script>