FCF - Full Stack Javascript Framework
OpenSource is a full stack development framework designed to simplify the development of WEB projects of various complexity levels.
It is based on unique technologies that open up new opportunities in development approaches with NODEJS.
Révision | 235c528242aded1393edc5e6c0e1da689c4994e7 (tree) |
---|---|
l'heure | 2022-06-18 13:19:37 |
Auteur | Vladimir Markin <v.o.markin221@gmai...> |
Commiter | Vladimir Markin |
VERSION 1.1.45-a1 (hotfix: fixed short template path for fcf.argTmpl())
@@ -713,7 +713,7 @@ | ||
713 | 713 | .then(async ()=>{ |
714 | 714 | let templateRender = new TemplateRender({template: a_options.template, state: state, args: resultArgs}); |
715 | 715 | let lct = fcf.getContext().currentTemplate; |
716 | - fcf.getContext().currentTemplate = {id: fcfId}; | |
716 | + fcf.getContext().currentTemplate = {id: fcfId, template: a_options.template}; | |
717 | 717 | let libFCF = {}; |
718 | 718 | libFCF.__proto__ = fcf; |
719 | 719 | libFCF.argRef = function(){ |
@@ -302,7 +302,7 @@ | ||
302 | 302 | return; |
303 | 303 | } |
304 | 304 | |
305 | - fcf.getContext().currentTemplate = { id: a_taskInfo.args.fcfId }; | |
305 | + fcf.getContext().currentTemplate = { id: a_taskInfo.args.fcfId, template: a_taskInfo.template }; | |
306 | 306 | |
307 | 307 | if (!(fcf.isArg(a_srcArg)) || a_srcArg.type == "value") { |
308 | 308 | a_act.complete(self._processValue(a_srcArg, a_taskInfo)); |
@@ -612,7 +612,7 @@ | ||
612 | 612 | return; |
613 | 613 | } |
614 | 614 | |
615 | - fcf.getContext().currentTemplate = { id: a_taskInfo.args.fcfId }; | |
615 | + fcf.getContext().currentTemplate = { id: a_taskInfo.args.fcfId, template: a_taskInfo.template }; | |
616 | 616 | |
617 | 617 | if (!(fcf.isArg(a_srcArg)) || a_srcArg.type == "value") { |
618 | 618 | a_cb(undefined, self._processValue(a_srcArg, a_taskInfo)); |
@@ -102,7 +102,7 @@ | ||
102 | 102 | } |
103 | 103 | |
104 | 104 | this._renderBlock = async function(a_code, a_args, a_path, a_stringNumber, a_template) { |
105 | - fcf.getContext().currentTemplate = {id: a_args.args.fcfId}; | |
105 | + fcf.getContext().currentTemplate = {id: a_args.args.fcfId, template: a_template}; | |
106 | 106 | let ov = fcf.NDetails.currentTemplate; |
107 | 107 | fcf.NDetails.currentTemplate = a_template; |
108 | 108 | await fcf.scriptExecutor.execute(a_code, a_args, a_path, a_stringNumber, 0, true); |
@@ -58,7 +58,7 @@ | ||
58 | 58 | |
59 | 59 | var fcfId = typeof a_options.args === "object" && a_options.args.fcfId ? a_options.args.fcfId : |
60 | 60 | fcf.id(); |
61 | - fcf.getContext().currentTemplate = { id: fcfId }; | |
61 | + fcf.getContext().currentTemplate = { id: fcfId, template: a_options.template }; | |
62 | 62 | var needOnServer = !fcf.isServer() && fcf.getContext().get("needBabel"); |
63 | 63 | needOnServer = !fcf.isServer(); |
64 | 64 | var part = a_options.template.split("+")[1] ? a_options.template.split("+")[1] : ""; |
@@ -385,7 +385,7 @@ | ||
385 | 385 | templateInfo.templates[""] ? templateInfo.templates[""].options : |
386 | 386 | templateInfo.options; |
387 | 387 | if (options.clientRendering) |
388 | - wrapperCode += "var lastCurrentTemplate = fcf.getContext().currentTemplate; fcf.getContext().currentTemplate = { id: undefined };\n"; | |
388 | + wrapperCode += "var lastCurrentTemplate = fcf.getContext().currentTemplate; fcf.getContext().currentTemplate = { id: undefined, template: undefined };\n"; | |
389 | 389 | wrapperCode += "fcf.NDetails.renderInstructions[\"" + templateBlockPath + "\"]={\n"; |
390 | 390 | wrapperCode += " options: " + JSON.stringify(options) + ",\n"; |
391 | 391 | wrapperCode += "};\n" |
@@ -4662,8 +4662,14 @@ | ||
4662 | 4662 | let arg = { "fcf.Arg": true, type: "template", template: a_template, args: a_args }; |
4663 | 4663 | if (a_options) |
4664 | 4664 | fcf.append(arg, a_options); |
4665 | - if (arg.type == "template" && fcf.NDetails.currentTemplate && arg.template.charAt(0) == "+") | |
4666 | - arg.template = fcf.NDetails.currentTemplate.split("+")[0] + arg.template; | |
4665 | + if (arg.template.charAt(0) == "+"){ | |
4666 | + if (fcf.NDetails.currentTemplate){ | |
4667 | + arg.template = fcf.NDetails.currentTemplate.split("+")[0] + arg.template; | |
4668 | + } else if (fcf.getContext().currentTemplate && fcf.getContext().currentTemplate.template){ | |
4669 | + arg.template = fcf.getContext().currentTemplate.template.split("+")[0] + arg.template; | |
4670 | + } | |
4671 | + | |
4672 | + } | |
4667 | 4673 | return arg; |
4668 | 4674 | } |
4669 | 4675 |