diff --git a/.eslintignore b/.eslintignore index c0f2ec754..b0ddfcfa0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -10,8 +10,6 @@ js/libtextsecure.js js/util_worker.js libtextsecure/components.js test/test.js -libloki/test/components.js -libloki/test/test.js # Third-party files diff --git a/.gitignore b/.gitignore index ec7052e25..80cc79bfd 100644 --- a/.gitignore +++ b/.gitignore @@ -46,7 +46,6 @@ yarn-error.log # editor .vscode/ -libloki/test/test.js playwright.config.js *.js.map diff --git a/.prettierignore b/.prettierignore index a57b06841..3e592ba3e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -11,7 +11,6 @@ js/libtextsecure.js libtextsecure/components.js stylesheets/*.css test/test.js -libloki/test/test.js test/ts/**/*.js ts/**/*.js diff --git a/app/user_config.js b/app/user_config.js deleted file mode 100644 index 671a1c217..000000000 --- a/app/user_config.js +++ /dev/null @@ -1,38 +0,0 @@ -const path = require('path'); -const process = require('process'); - -const { app } = require('electron'); - -const { start } = require('./base_config'); - -let storageProfile; - -// Node makes sure all environment variables are strings -const { NODE_ENV: environment, NODE_APP_INSTANCE: instance } = process.env; - -// We need to make sure instance is not empty -const isValidInstance = typeof instance === 'string' && instance.length > 0; -const isProduction = environment === 'production' && !isValidInstance; - -// Use seperate data directories for each different environment and app instances -if (!isProduction) { - storageProfile = environment; - if (isValidInstance) { - storageProfile = storageProfile.concat(`-${instance}`); - } -} - -if (storageProfile) { - const userData = path.join(app.getPath('appData'), `Session-${storageProfile}`); - - app.setPath('userData', userData); -} - -console.log(`userData: ${app.getPath('userData')}`); - -const userDataPath = app.getPath('userData'); -const targetPath = path.join(userDataPath, 'config.json'); - -const userConfig = start('user', targetPath); - -module.exports = userConfig; diff --git a/js/views/whisper_view.js b/js/views/whisper_view.js new file mode 100644 index 000000000..2ddae270f --- /dev/null +++ b/js/views/whisper_view.js @@ -0,0 +1,65 @@ +"use strict"; +/* global Whisper, Backbone, Mustache, _, $ */ +/* + * Whisper.View + * + * This is the base for most of our views. The Backbone view is extended + * with some conveniences: + * + * 1. Pre-parses all our mustache templates for performance. + * https://github.com/janl/mustache.js#pre-parsing-and-caching-templates + * + * 2. Defines a default definition for render() which allows sub-classes + * to simply specify a templateName and renderAttributes which are plugged + * into Mustache.render + * + * 3. Makes all the templates available for rendering as partials. + * https://github.com/janl/mustache.js#partials + * + * 4. Provides some common functionality, e.g. confirmation dialog + * + */ +// eslint-disable-next-line func-names +(function () { + 'use strict'; + window.Whisper = window.Whisper || {}; + // window.Whisper.View = Backbone.View.extend( + // { + // constructor(...params: any) { + // Backbone.View.call(this, ...params); + // Mustache.parse(_.result(this, 'template')); + // }, + // render_attributes() { + // return _.result(this.model, 'attributes', {}); + // }, + // render_partials() { + // return window.Whisper.View.Templates; + // }, + // template() { + // if (this.templateName) { + // return window.Whisper.View.Templates[this.templateName]; + // } + // return ''; + // }, + // render() { + // const attrs = _.result(this, 'render_attributes', {}); + // const template = _.result(this, 'template', ''); + // const partials = _.result(this, 'render_partials', ''); + // this.$el.html(Mustache.render(template, attrs, partials)); + // return this; + // }, + // }, + // { + // // Class attributes + // Templates: (() => { + // const templates = {}; + // $('script[type="text/x-tmpl-mustache"]').each((i, el) => { + // const $el = $(el); + // const id = $el.attr('id'); + // templates[id] = $el.html(); + // }); + // return templates; + // })(), + // } + // ); +})(); \ No newline at end of file