From 6560a2990b0e889aa76ae12f8056250a8b138326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Ba=CC=81lint?= Date: Sun, 7 Jan 2018 22:42:27 +0100 Subject: [PATCH] cdn support, regex fixes --- public/assets/js/app.js | 35 ++++++++++--- public/index.html | 20 ++++--- public/templates/_general.conf.html | 24 ++++----- public/templates/_wordpress.conf.html | 8 +-- public/templates/example.com.conf.html | 72 ++++++++++++++++++++++---- 5 files changed, 119 insertions(+), 40 deletions(-) diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 9a7ca4f..e36db75 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -3,6 +3,9 @@ angular .module('NginxConfigIoApp', []) .controller('NginxConfigIoController', function NginxConfigIoController($scope, $timeout) { + ///////////////////// + // SCOPE VARIABLES // + ///////////////////// $scope.data = { domain: 'example.com', path: '/var/www/example.com', @@ -10,6 +13,7 @@ https: false, http2: true, email: 'hello@example.com', + cdn: true, non_www: true, php: '7.2', index_html: false, @@ -28,13 +32,29 @@ limit_req: false, expires: { - css_js: '7d', - media: '7d', + assets: '7d', + fonts: '7d', svg: '7d', - font: '7d', + media: '7d', + docs: '7d', }, }; + $scope.extensions = { + assets: 'css(\\.map)?|js(\\.map)?', + fonts: 'ttf|ttc|otf|eot|woff|woff2', + svg: 'svgz?', + images: 'jpe?g|png|gif|ico|cur|heic|webp|tiff?', + audio: 'mp3|m4a|aac|ogg|midi?|wav', + video: 'mp4|mov|webm|mpe?g|avi|ogv|flv|wmv', + docs: 'pdf|docx?|xlsx?|pptx?' + }; + + + + ///////////////////// + // SCOPE FUNCTIONS // + ///////////////////// $scope.refreshHighlighting = function() { document.querySelectorAll('main .file .code.source').forEach(function(code) { $timeout(function(code) { @@ -46,9 +66,12 @@ }); }; - $scope.$watch('data', function(data) { - $scope.refreshHighlighting(); - }, true); + + + ////////////////// + // SCOPE EVENTS // + ////////////////// + $scope.$watch('data', $scope.refreshHighlighting, true); }); })(); diff --git a/public/index.html b/public/index.html index e07859e..3432050 100644 --- a/public/index.html +++ b/public/index.html @@ -49,9 +49,15 @@
- - -
+ + + +
+ + +