mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
refactoring
This commit is contained in:
parent
e411ad0eb1
commit
c190296bf9
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitToolBoxProjectSettings">
|
||||||
|
<option name="commitMessageIssueKeyValidationOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
<option name="commitMessageValidationEnabledOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -1,6 +1,6 @@
|
|||||||
const Note = require('../../src/becca/entities/bnote.js');
|
const Note = require('../../src/becca/entities/bnote');
|
||||||
const Branch = require('../../src/becca/entities/bbranch.js');
|
const Branch = require('../../src/becca/entities/bbranch');
|
||||||
const Attribute = require('../../src/becca/entities/battribute.js');
|
const Attribute = require('../../src/becca/entities/battribute');
|
||||||
const becca = require('../../src/becca/becca');
|
const becca = require('../../src/becca/becca');
|
||||||
const randtoken = require('rand-token').generator({source: 'crypto'});
|
const randtoken = require('rand-token').generator({source: 'crypto'});
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
const searchService = require('../../src/services/search/services/search');
|
const searchService = require('../../src/services/search/services/search');
|
||||||
const Note = require('../../src/becca/entities/bnote.js');
|
|
||||||
const Branch = require('../../src/becca/entities/bbranch.js');
|
|
||||||
const SearchContext = require('../../src/services/search/search_context');
|
const SearchContext = require('../../src/services/search/search_context');
|
||||||
const dateUtils = require('../../src/services/date_utils');
|
const dateUtils = require('../../src/services/date_utils');
|
||||||
const becca = require('../../src/becca/becca');
|
const becca = require('../../src/becca/becca');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const fs = require("fs-extra");
|
const fs = require("fs-extra");
|
||||||
const utils = require("../../src/services/utils.js");
|
const utils = require("../../src/services/utils");
|
||||||
const html = require("html");
|
const html = require("html");
|
||||||
|
|
||||||
const SRC_DIR = './src-build/docs-website';
|
const SRC_DIR = './src-build/docs-website';
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
const sql = require("../services/sql");
|
const sql = require("../services/sql");
|
||||||
const NoteSet = require("../services/search/note_set");
|
const NoteSet = require("../services/search/note_set");
|
||||||
const BNoteRevision = require("./entities/bnote_revision.js");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Becca is a backend cache of all notes, branches and attributes. There's a similar frontend cache Froca.
|
* Becca is a backend cache of all notes, branches and attributes. There's a similar frontend cache Froca.
|
||||||
|
@ -8,7 +8,6 @@ const v = require("./validators");
|
|||||||
const searchService = require("../services/search/services/search");
|
const searchService = require("../services/search/services/search");
|
||||||
const SearchContext = require("../services/search/search_context");
|
const SearchContext = require("../services/search/search_context");
|
||||||
const zipExportService = require("../services/export/zip");
|
const zipExportService = require("../services/export/zip");
|
||||||
const noteRevisionService = require("../services/note_revisions.js");
|
|
||||||
|
|
||||||
function register(router) {
|
function register(router) {
|
||||||
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
|
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
const imageType = require('image-type');
|
const imageType = require('image-type');
|
||||||
const imageService = require('../../services/image');
|
const imageService = require('../../services/image');
|
||||||
const noteService = require('../../services/notes');
|
const noteService = require('../../services/notes');
|
||||||
const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name.js");
|
const {sanitizeAttributeName} = require("../../services/sanitize_attribute_name");
|
||||||
const specialNotesService = require("../../services/special_notes.js");
|
const specialNotesService = require("../../services/special_notes");
|
||||||
|
|
||||||
function uploadImage(req) {
|
function uploadImage(req) {
|
||||||
const file = req.file;
|
const file = req.file;
|
||||||
|
@ -8,7 +8,7 @@ const noteService = require("../notes");
|
|||||||
const imageService = require("../image");
|
const imageService = require("../image");
|
||||||
const protectedSessionService = require('../protected_session');
|
const protectedSessionService = require('../protected_session');
|
||||||
const htmlSanitizer = require("../html_sanitizer");
|
const htmlSanitizer = require("../html_sanitizer");
|
||||||
const {sanitizeAttributeName} = require("../sanitize_attribute_name.js");
|
const {sanitizeAttributeName} = require("../sanitize_attribute_name");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* date format is e.g. 20181121T193703Z or 2013-04-14T16:19:00.000Z (Mac evernote, see #3496)
|
* date format is e.g. 20181121T193703Z or 2013-04-14T16:19:00.000Z (Mac evernote, see #3496)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const protectedSession = require("./protected_session.js");
|
const protectedSession = require("./protected_session");
|
||||||
const log = require("./log.js");
|
const log = require("./log");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {BNote} note
|
* @param {BNote} note
|
||||||
|
@ -126,8 +126,6 @@ async function ocrTextFromBuffer(buffer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function runOcr(note, buffer) {
|
async function runOcr(note, buffer) {
|
||||||
console.log("buffer length", buffer.length);
|
|
||||||
|
|
||||||
if (!note.isImage()
|
if (!note.isImage()
|
||||||
|| !optionService.getOptionBool('ocrImages')
|
|| !optionService.getOptionBool('ocrImages')
|
||||||
|| cls.isOcrDisabled()
|
|| cls.isOcrDisabled()
|
||||||
|
@ -90,7 +90,7 @@ async function importZip(fileBuffer, importRootNote) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getNoteId(noteMeta) {
|
function getNoteId(noteMeta) {
|
||||||
let userGuideNoteId = noteMeta.attributes?.find(attr => attr.type === 'label' && attr.name === 'helpNoteId')?.value;
|
let userGuideNoteId;// = noteMeta.attributes?.find(attr => attr.type === 'label' && attr.name === 'helpNoteId')?.value;
|
||||||
|
|
||||||
userGuideNoteId = '_userGuide' + noteMeta.title.replace(/[^a-z0-9]/ig, '');
|
userGuideNoteId = '_userGuide' + noteMeta.title.replace(/[^a-z0-9]/ig, '');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user