Remove unused handlebarsRenderStatic
This commit is contained in:
parent
e645296b1b
commit
e3c871bc00
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function apiTemplateRender(template, data, dynamic) {
|
function apiTemplateRender(template, data) {
|
||||||
return _apiInvoke('templateRender', {data, template, dynamic});
|
return _apiInvoke('templateRender', {data, template});
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiAudioGetUrl(definition, source, optionsContext) {
|
function apiAudioGetUrl(definition, source, optionsContext) {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/*global optionsSave, utilIsolate
|
/*global optionsSave, utilIsolate
|
||||||
conditionsTestValue, profileConditionsDescriptor, profileOptionsGetDefaultFieldTemplates
|
conditionsTestValue, profileConditionsDescriptor, profileOptionsGetDefaultFieldTemplates
|
||||||
handlebarsRenderDynamic, handlebarsRenderStatic
|
handlebarsRenderDynamic
|
||||||
requestText, requestJson, optionsLoad
|
requestText, requestJson, optionsLoad
|
||||||
dictConfigured, dictTermsSort, dictEnabledSet, dictNoteFormat
|
dictConfigured, dictTermsSort, dictEnabledSet, dictNoteFormat
|
||||||
audioGetUrl, audioInject
|
audioGetUrl, audioInject
|
||||||
@ -459,12 +459,8 @@ class Backend {
|
|||||||
return this.anki.guiBrowse(`nid:${noteId}`);
|
return this.anki.guiBrowse(`nid:${noteId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onApiTemplateRender({template, data, dynamic}) {
|
async _onApiTemplateRender({template, data}) {
|
||||||
return (
|
return handlebarsRenderDynamic(template, data);
|
||||||
dynamic ?
|
|
||||||
handlebarsRenderDynamic(template, data) :
|
|
||||||
handlebarsRenderStatic(template, data)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _onApiCommandExec({command, params}) {
|
async _onApiCommandExec({command, params}) {
|
||||||
|
@ -335,7 +335,7 @@ async function dictFieldFormat(field, definition, mode, options, templates, exce
|
|||||||
}
|
}
|
||||||
data.marker = marker;
|
data.marker = marker;
|
||||||
try {
|
try {
|
||||||
return await apiTemplateRender(templates, data, true);
|
return await apiTemplateRender(templates, data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (exceptions) { exceptions.push(e); }
|
if (exceptions) { exceptions.push(e); }
|
||||||
return `{${marker}-render-error}`;
|
return `{${marker}-render-error}`;
|
||||||
|
@ -135,11 +135,6 @@ function handlebarsRegisterHelpers() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handlebarsRenderStatic(name, data) {
|
|
||||||
handlebarsRegisterHelpers();
|
|
||||||
return Handlebars.templates[name](data).trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
function handlebarsRenderDynamic(template, data) {
|
function handlebarsRenderDynamic(template, data) {
|
||||||
handlebarsRegisterHelpers();
|
handlebarsRegisterHelpers();
|
||||||
const cache = handlebarsRenderDynamic._cache;
|
const cache = handlebarsRenderDynamic._cache;
|
||||||
|
@ -65,10 +65,6 @@ function apiNoteView(noteId) {
|
|||||||
return _apiInvoke('noteView', {noteId});
|
return _apiInvoke('noteView', {noteId});
|
||||||
}
|
}
|
||||||
|
|
||||||
function apiTemplateRender(template, data, dynamic) {
|
|
||||||
return _apiInvoke('templateRender', {data, template, dynamic});
|
|
||||||
}
|
|
||||||
|
|
||||||
function apiAudioGetUrl(definition, source, optionsContext) {
|
function apiAudioGetUrl(definition, source, optionsContext) {
|
||||||
return _apiInvoke('audioGetUrl', {definition, source, optionsContext});
|
return _apiInvoke('audioGetUrl', {definition, source, optionsContext});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user