From c980bb439a1685510b1b479669761a93f0d8c5b0 Mon Sep 17 00:00:00 2001 From: ulrich <not disclosed> Date: Sat, 25 Feb 2017 17:32:26 +0000 Subject: [PATCH] Mustache Templates ausgelagert (noch in Arbeit) --- web/ui/ui.js | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/web/ui/ui.js b/web/ui/ui.js index 9f66ee4..e20c80b 100644 --- a/web/ui/ui.js +++ b/web/ui/ui.js @@ -365,6 +365,8 @@ if(dirList.length > 0) { $.get('tpl-bcr.txt', function(template) { $('#bcnav').html(Mustache.render(template, bl)); + //fm_bcr_step2(dirs, dirList); + if(dirs.length > 0) { dirList.push(new BcrFile(rp + '/' + dirs[dirs.length-1], dirs[dirs.length-1])); $.get('tpl-bcr2.txt', function(template) { @@ -380,13 +382,16 @@ $('#bcnav').append(Mustache.render(template, dirList[0])); $('#bcnav').append($('#tpl-bcr3').html()); fm_bcr_end(); - }); + }); //template = $('#tpl-bcr2').html(); //Mustache.parse(template); // optional, speeds up future uses //$('#bcnav').append(Mustache.render(template, dirList[0])); } + }); } else { + //fm_bcr_step2(dirs, dirList); + /* if(dirs.length > 0) { dirList.push(new BcrFile(rp + '/' + dirs[dirs.length-1], dirs[dirs.length-1])); $.get('tpl-bcr2.txt', function(template) { @@ -407,6 +412,7 @@ //Mustache.parse(template); // optional, speeds up future uses //$('#bcnav').append(Mustache.render(template, dirList[0])); } + */ } } else { pfad = ''; @@ -426,6 +432,31 @@ }); } +/* +function fm_bcr_step2(dirs, dirList) { + if(dirs.length > 0) { + dirList.push(new BcrFile(rp + '/' + dirs[dirs.length-1], dirs[dirs.length-1])); + $.get('tpl-bcr2.txt', function(template) { + $('#bcnav').append(Mustache.render(template, dirList[dirList.length-1])); + $('#bcnav').append($('#tpl-bcr3').html()); + fm_bcr_end(); + }); + //template = $('#tpl-bcr2').html(); + //Mustache.parse(template); // optional, speeds up future uses + //$('#bcnav').append(Mustache.render(template, dirList[dirList.length-1])); + } else { + $.get('tpl-bcr2.txt', function(template) { + $('#bcnav').append(Mustache.render(template, dirList[0])); + $('#bcnav').append($('#tpl-bcr3').html()); + fm_bcr_end(); + }); + //template = $('#tpl-bcr2').html(); + //Mustache.parse(template); // optional, speeds up future uses + //$('#bcnav').append(Mustache.render(template, dirList[0])); + } +} +*/ + function fm_bcr_end() { $('.breadcrumb-item').click(fm_bc_click); $('#ansicht').click(fm_ansicht_umschalten); -- Gitblit v1.9.3