1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Various tweaks to get prod version to work

This commit is contained in:
Laurent Cozic 2017-11-13 18:47:35 +00:00
parent 395804ec0d
commit 48061457ac
13 changed files with 42 additions and 18 deletions

View File

@ -519,9 +519,15 @@ msgid ""
"New notebook \"%s\" will be created and file \"%s\" will be imported into it" "New notebook \"%s\" will be created and file \"%s\" will be imported into it"
msgstr "" msgstr ""
msgid "Please create a notebook first."
msgstr ""
msgid "Note title:" msgid "Note title:"
msgstr "" msgstr ""
msgid "Please create a notebook first"
msgstr ""
msgid "To-do title:" msgid "To-do title:"
msgstr "" msgstr ""

View File

@ -572,10 +572,18 @@ msgstr ""
"Un nouveau carnet \"%s\" va être créé et le fichier \"%s\" va être importé " "Un nouveau carnet \"%s\" va être créé et le fichier \"%s\" va être importé "
"dedans. Continuer ?" "dedans. Continuer ?"
#, fuzzy
msgid "Please create a notebook first."
msgstr "Veuillez d'abord sélectionner un carnet."
#, fuzzy #, fuzzy
msgid "Note title:" msgid "Note title:"
msgstr "cat <titre>" msgstr "cat <titre>"
#, fuzzy
msgid "Please create a notebook first"
msgstr "Veuillez d'abord sélectionner un carnet."
#, fuzzy #, fuzzy
msgid "To-do title:" msgid "To-do title:"
msgstr "cat <titre>" msgstr "cat <titre>"

View File

@ -519,9 +519,15 @@ msgid ""
"New notebook \"%s\" will be created and file \"%s\" will be imported into it" "New notebook \"%s\" will be created and file \"%s\" will be imported into it"
msgstr "" msgstr ""
msgid "Please create a notebook first."
msgstr ""
msgid "Note title:" msgid "Note title:"
msgstr "" msgstr ""
msgid "Please create a notebook first"
msgstr ""
msgid "To-do title:" msgid "To-do title:"
msgstr "" msgstr ""

View File

@ -1,6 +1,6 @@
{ {
"name": "joplin", "name": "joplin",
"version": "0.10.66", "version": "0.10.68",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -18,7 +18,7 @@
], ],
"owner": "Laurent Cozic" "owner": "Laurent Cozic"
}, },
"version": "0.10.66", "version": "0.10.68",
"bin": { "bin": {
"joplin": "./main.js" "joplin": "./main.js"
}, },

View File

@ -6,8 +6,9 @@ const urlUtils = require('lib/urlUtils.js');
class ElectronAppWrapper { class ElectronAppWrapper {
constructor(electronApp) { constructor(electronApp, env) {
this.electronApp_ = electronApp; this.electronApp_ = electronApp;
this.env_ = env;
this.win_ = null; this.win_ = null;
} }
@ -36,7 +37,7 @@ class ElectronAppWrapper {
slashes: true slashes: true
})) }))
this.win_.webContents.openDevTools() if (this.env_ === 'dev') this.win_.webContents.openDevTools();
this.win_.on('closed', () => { this.win_.on('closed', () => {
this.win_ = null this.win_ = null

View File

@ -1,5 +1,6 @@
const React = require('react'); const React = require('react');
const { Note } = require('lib/models/note.js'); const { Note } = require('lib/models/note.js');
const { Setting } = require('lib/models/setting.js');
const { IconButton } = require('./IconButton.min.js'); const { IconButton } = require('./IconButton.min.js');
const { connect } = require('react-redux'); const { connect } = require('react-redux');
const { _ } = require('lib/locale.js'); const { _ } = require('lib/locale.js');
@ -46,7 +47,6 @@ class NoteTextComponent extends React.Component {
// https://github.com/ajaxorg/ace/issues/2046 // https://github.com/ajaxorg/ace/issues/2046
this.editorMaxScrollTop_ = 0; this.editorMaxScrollTop_ = 0;
this.onAfterEditorRender_ = () => { this.onAfterEditorRender_ = () => {
console.info('ENDER done');
const r = this.editor_.editor.renderer; const r = this.editor_.editor.renderer;
this.editorMaxScrollTop_ = Math.max(0, r.layerConfig.maxHeight - r.$size.scrollerHeight); this.editorMaxScrollTop_ = Math.max(0, r.layerConfig.maxHeight - r.$size.scrollerHeight);
@ -243,7 +243,7 @@ class NoteTextComponent extends React.Component {
webviewReady: true, webviewReady: true,
}); });
this.webview_.openDevTools(); // if (Setting.value('env') === 'dev') this.webview_.openDevTools();
} }
webview_ref(element) { webview_ref(element) {

View File

@ -1,5 +1,6 @@
const React = require('react'); const React = require('react');
const { Note } = require('lib/models/note.js'); const { Note } = require('lib/models/note.js');
const { Setting } = require('lib/models/setting.js');
const { IconButton } = require('./IconButton.min.js'); const { IconButton } = require('./IconButton.min.js');
const { connect } = require('react-redux'); const { connect } = require('react-redux');
const { _ } = require('lib/locale.js'); const { _ } = require('lib/locale.js');
@ -46,7 +47,6 @@ class NoteTextComponent extends React.Component {
// https://github.com/ajaxorg/ace/issues/2046 // https://github.com/ajaxorg/ace/issues/2046
this.editorMaxScrollTop_ = 0; this.editorMaxScrollTop_ = 0;
this.onAfterEditorRender_ = () => { this.onAfterEditorRender_ = () => {
console.info('ENDER done');
const r = this.editor_.editor.renderer; const r = this.editor_.editor.renderer;
this.editorMaxScrollTop_ = Math.max(0, r.layerConfig.maxHeight - r.$size.scrollerHeight); this.editorMaxScrollTop_ = Math.max(0, r.layerConfig.maxHeight - r.$size.scrollerHeight);
@ -243,7 +243,7 @@ class NoteTextComponent extends React.Component {
webviewReady: true webviewReady: true
}); });
this.webview_.openDevTools(); // if (Setting.value('env') === 'dev') this.webview_.openDevTools();
} }
webview_ref(element) { webview_ref(element) {

View File

@ -347,17 +347,12 @@ class MdToHtml {
width: auto; width: auto;
max-width: 100%; max-width: 100%;
} }
pre, code {
white-space: pre;
}
`; `;
const styleHtml = '<style>' + normalizeCss + "\n" + css + '</style>'; const styleHtml = '<style>' + normalizeCss + "\n" + css + '</style>';
const output = styleHtml + renderedBody; const output = styleHtml + renderedBody;
console.info(renderedBody);
this.cachedContent_ = output; this.cachedContent_ = output;
this.cachedContentKey_ = cacheKey; this.cachedContentKey_ = cacheKey;
return this.cachedContent_; return this.cachedContent_;

View File

@ -283,7 +283,6 @@ function localeStrings(canonicalName) {
function setLocale(canonicalName) { function setLocale(canonicalName) {
if (currentLocale_ == canonicalName) return; if (currentLocale_ == canonicalName) return;
currentLocale_ = closestSupportedLocale(canonicalName); currentLocale_ = closestSupportedLocale(canonicalName);
console.info('Set locale to ' + currentLocale_);
} }
function languageCode() { function languageCode() {

View File

@ -12,7 +12,19 @@ process.on('unhandledRejection', (reason, p) => {
process.exit(1); process.exit(1);
}); });
const wrapper = new ElectronAppWrapper(electronApp); // Flags are parsed properly in BaseApplication, however it's better to have
// the env as early as possible to enable debugging capabilities.
function envFromArgs(args) {
if (!args) return 'prod';
const envIndex = args.indexOf('--env');
const devIndex = args.indexOf('dev');
if (envIndex === devIndex - 1) return 'dev';
return 'prod';
}
const env = envFromArgs(process.argv);
const wrapper = new ElectronAppWrapper(electronApp, env);
initBridge(wrapper); initBridge(wrapper);

View File

@ -353,8 +353,6 @@ class MdToHtml {
const output = styleHtml + renderedBody; const output = styleHtml + renderedBody;
console.info(renderedBody);
this.cachedContent_ = output; this.cachedContent_ = output;
this.cachedContentKey_ = cacheKey; this.cachedContentKey_ = cacheKey;
return this.cachedContent_; return this.cachedContent_;

View File

@ -283,7 +283,6 @@ function localeStrings(canonicalName) {
function setLocale(canonicalName) { function setLocale(canonicalName) {
if (currentLocale_ == canonicalName) return; if (currentLocale_ == canonicalName) return;
currentLocale_ = closestSupportedLocale(canonicalName); currentLocale_ = closestSupportedLocale(canonicalName);
console.info('Set locale to ' + currentLocale_);
} }
function languageCode() { function languageCode() {