Skip to content

Commit

Permalink
moved views to TS but broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilb committed Mar 24, 2022
1 parent 449751a commit 51575d2
Show file tree
Hide file tree
Showing 22 changed files with 753 additions and 930 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ yarn-error.log
libloki/test/test.js

playwright.config.js
playwright.config.js.map
*.js.map
8 changes: 0 additions & 8 deletions background.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,11 @@
<link href="images/sesion/session_icon_128.png" rel="shortcut icon" />
<link href="stylesheets/manifest.css" rel="stylesheet" type="text/css" />

<!--
When making changes to these templates, be sure to update test/index.html as well
-->

<script type="text/javascript" src="js/components.js"></script>
<script type="text/javascript" src="js/libtextsecure.js"></script>

<script type="text/javascript" src="js/views/react_wrapper_view.js"></script>
<script type="text/javascript" src="js/views/whisper_view.js"></script>

<script type="text/javascript" src="js/views/session_inbox_view.js"></script>
<script type="text/javascript" src="js/views/session_registration_view.js"></script>
<script type="text/javascript" src="js/views/app_view.js"></script>
</head>

<body>
Expand Down
35 changes: 4 additions & 31 deletions debug_log.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,9 @@
<link href="stylesheets/manifest.css" rel="stylesheet" type="text/css" />
<style></style>
</head>
<body class="debug-log-window"></body>
<script type="text/x-tmpl-mustache" id="debug-log">
<div class='content'>
<div>
<a class='x close' alt='close debug log' href='#'></a>
<h1> {{ title }} </h1>
<p> {{ debugLogExplanation }}</p>
</div>
<textarea spellcheck='false' rows='5'></textarea>
<div class='buttons'>
<button class='grey submit'>{{ saveLogToDesktop }}</button>
</div>
<div class='result'>
</div>
</div>
</script>
<script type="text/x-tmpl-mustache" id="debug-log-link">
<div class='input-group clearfix'>
<input type='text' class='link' readonly value='{{ url }}' />
<a class='open' alt='open in a new browser tab' target='_blank' href='{{ url }}'></a>
</div>
<p>
<a class='report-link' target='_blank'
href='https://github.com/oxen-io/session-desktop/issues/new/'>
{{ reportIssue }}
</a>
</p>
</script>
<script type="text/javascript" src="js/components.js"></script>
<script type="text/javascript" src="js/views/whisper_view.js"></script>
<script type="text/javascript" src="js/views/debug_log_view.js"></script>
<body>
<div id="app"></div>
</body>

<script type="text/javascript" src="js/debug_log_start.js"></script>
</html>
7 changes: 7 additions & 0 deletions debug_log_preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const { ipcRenderer } = require('electron');
const url = require('url');
const i18n = require('./js/modules/i18n');
const { DebugLogView } = require('./ts/views/DebugLogView');

const config = url.parse(window.location.toString(), true).query;
const { locale } = config;
Expand All @@ -13,6 +14,9 @@ global.dcodeIO.ByteBuffer = require('bytebuffer');

window._ = require('lodash');

window.React = require('react');
window.ReactDOM = require('react-dom');

window.getVersion = () => config.version;
window.theme = config.theme;
window.i18n = i18n.setup(locale, localeMessages);
Expand All @@ -31,4 +35,7 @@ window.getCommitHash = () => config.commitHash;

window.closeDebugLog = () => ipcRenderer.send('close-debug-log');

window.Views = {};
window.Views.DebugLogView = DebugLogView;

window.saveLog = logText => ipcRenderer.send('save-debug-log', logText);
8 changes: 1 addition & 7 deletions js/debug_log_start.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,4 @@ $(document).on('keyup', e => {
}
});

const $body = $(document.body);

// got.js appears to need this to successfully submit debug logs to the cloud
window.setImmediate = window.nodeSetImmediate;

window.view = new Whisper.DebugLogView();
window.view.$el.appendTo($body);
window.ReactDOM.render(<window.Views.DebugLogView />, document.getElementById('app'));
Loading

0 comments on commit 51575d2

Please sign in to comment.