tabulation fixes

pull/2/head
Szekeres Bálint 2018-01-08 08:28:51 +01:00
parent fc2cdf4d9b
commit 16a27c75dd
4 changed files with 12 additions and 19 deletions

View File

@ -102,18 +102,6 @@ main .file .code pre code {
overflow-x: visible;
}
main .file .code pre code span.include {
white-space: pre-line;
}
main .file .code pre code span.include ng-include {
white-space: pre;
}
main .file .code pre code ng-include {
display: inline-block;
}
footer {
padding: 2rem 0 0.5rem;
text-align: center;

View File

@ -135,8 +135,13 @@
link: {
pre: function preLink(scope, iElement, iAttrs, controller) {
var tabs = parseInt(iAttrs.ngIncludeTabs || 0);
controller.template = controller.template.replace(/^(.*)$/mg, '\t'.repeat(tabs) + '$1').replace(/\s*$/, '');
console.log(controller);
var startRegex = new RegExp('\t'.repeat(tabs - 1));
controller.template = controller.template
.replace(/^(.*)$/mg, '\t'.repeat(tabs) + '$1')
.replace(startRegex, '')
.replace(/\s*$/, '');
},
},
};

View File

@ -4,6 +4,6 @@ index {{ data.index_html ? 'index.html ' : '' }}index.php;
# handle .php
location ~ \.php$ {<span ng-if="data.file_structure === 'separated'">
include _php_fastcgi.conf;
</span><span class="include" ng-if="data.file_structure === 'unified'">
<ng-include ng-include-tabs="{{ data.file_structure === 'unified' ? 3 : 1 }}" src="'templates/_php_fastcgi.conf.html'" onload="refreshHighlighting()"></ng-include></span>
</span><span ng-if="data.file_structure === 'unified'">
<ng-include ng-include-tabs="{{ data.file_structure === 'unified' ? 3 : 1 }}" src="'templates/_php_fastcgi.conf.html'" onload="refreshHighlighting()"></ng-include></span>
}

View File

@ -20,7 +20,7 @@ server {
include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
include _php.conf;</span>
include _letsencrypt.conf;
include _ssl.conf;</span><span class="include" ng-if="data.file_structure === 'unified'">
include _ssl.conf;</span><span ng-if="data.file_structure === 'unified'">
<ng-include ng-include-tabs="2" src="'templates/_general.conf.html'" onload="refreshHighlighting()"></ng-include><span ng-if="data.php !== 'off' && data.wordpress">
<ng-include ng-include-tabs="2" src="'templates/_wordpress.conf.html'" onload="refreshHighlighting()"></ng-include></span><span ng-if="data.php !== 'off'">
@ -89,7 +89,7 @@ server {
server_name {{ data.domain }} *.{{ data.domain }};
<span ng-if="data.file_structure === 'separated'">
include _letsencrypt.conf;</span><span class="include" ng-if="data.file_structure === 'unified'">
include _letsencrypt.conf;</span><span ng-if="data.file_structure === 'unified'">
<ng-include ng-include-tabs="2" src="'templates/_letsencrypt.conf.html'" onload="refreshHighlighting()"></ng-include></span>
return 301 https://{{ !data.non_www ? 'www.' : '' }}{{ data.domain }}$request_uri;
@ -108,7 +108,7 @@ server {
<span ng-if="data.file_structure === 'separated'">
include _general.conf;<span ng-if="data.php !== 'off' && data.wordpress">
include _wordpress.conf;</span><span ng-if="data.php !== 'off'">
include _php.conf;</span></span><span class="include" ng-if="data.file_structure === 'unified'">
include _php.conf;</span></span><span ng-if="data.file_structure === 'unified'">
<ng-include ng-include-tabs="2" src="'templates/_general.conf.html'" onload="refreshHighlighting()"></ng-include><span ng-if="data.php !== 'off' && data.wordpress">
<ng-include ng-include-tabs="2" src="'templates/_wordpress.conf.html'" onload="refreshHighlighting()"></ng-include></span><span ng-if="data.php !== 'off'">