diff --git a/resources/web/guide/11/11.js b/resources/web/guide/11/11.js index 3a5f7c914..0c5d4f884 100644 --- a/resources/web/guide/11/11.js +++ b/resources/web/guide/11/11.js @@ -62,7 +62,7 @@ function GotoPolicyPage() SendWXMessage( JSON.stringify(tSend) ); - window.location.href="../3/index.html"; + window.location.href="../3/index.html?region="+RegionFinal; } diff --git a/resources/web/guide/3/3.js b/resources/web/guide/3/3.js index 0c609fccd..d6842804b 100644 --- a/resources/web/guide/3/3.js +++ b/resources/web/guide/3/3.js @@ -1,9 +1,15 @@ +m_Region='US'; + function OnInit() { TranslatePage(); SendPrivacySelect(); + + let strRegion=GetQueryString('region'); + if( strRegion!=null ) + m_Region=strRegion.toLowerCase(); } @@ -97,4 +103,20 @@ function HandleModelInfo( pVal ) } window.location.href="../21/index.html"; -} \ No newline at end of file +} + +function OpenPrivacyPolicy() +{ + let PolicyUrl=''; + if( m_Region=='china' ) + PolicyUrl="https://bambulab.cn/policies/software-privacy"; + else + PolicyUrl="https://bambulab.com/policies/privacy"; + + var tSend={}; + tSend['sequence_id']=Math.round(new Date() / 1000); + tSend['command']="common_openurl"; + tSend['url']=PolicyUrl; + + SendWXMessage( JSON.stringify(tSend) ); +} diff --git a/resources/web/guide/3/index.html b/resources/web/guide/3/index.html index a365c0fde..f7b973c28 100644 --- a/resources/web/guide/3/index.html +++ b/resources/web/guide/3/index.html @@ -20,7 +20,7 @@
You may change your choice in preference anytime.
diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 8e5326fb9..3f237348c 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -485,6 +485,12 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt) } else InstallNetplugin = false; + } + else if (strCmd == "common_openurl") + { + std::string strUrl = j["url"]; + + wxLaunchDefaultBrowser(strUrl); } } catch (std::exception &e) { // wxMessageBox(e.what(), "json Exception", MB_OK);