diff options
author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-07-10 01:41:34 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2018-07-10 01:41:34 +0800 |
commit | 5e356c5f635d45f0241854d9f43f38b2f0bd44f9 (patch) | |
tree | 52d12fa3e71c1f843c385271c2f22b8842ddc0ba /layouts/partials/scripts.html | |
parent | d3a1ab071c983586b474c5e5dc0fa6afb0babce8 (diff) |
style(*): google js style & trim whitespace
Diffstat (limited to 'layouts/partials/scripts.html')
-rw-r--r-- | layouts/partials/scripts.html | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index a89ad89..2dfea1a 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -17,55 +17,55 @@ <!-- timeago.JS --> {{- if and (or .Params.enableOutdatedInfoWarning (and .Site.Params.outdatedInfoWarning.enable (ne .Params.enableOutdatedInfoWarning false))) (or .IsPage .IsHome) }} {{- if .Site.Params.publicCDN.enable }} - {{ .Site.Params.publicCDN.timeagoJS | safeHTML }} - {{ .Site.Params.publicCDN.timeagoLocalesJS | safeHTML }} + {{ .Site.Params.publicCDN.timeagoJS | safeHTML }} + {{ .Site.Params.publicCDN.timeagoLocalesJS | safeHTML }} {{- else }} - <script type="text/javascript" src="{{ "lib/timeago/timeago-3.0.2.min.js" | relURL }}"></script> - <script type="text/javascript" src="{{ "lib/timeago/timeago.locales-3.0.2.min.js" | relURL }}"></script> + <script type="text/javascript" src="{{ "lib/timeago/timeago-3.0.2.min.js" | relURL }}"></script> + <script type="text/javascript" src="{{ "lib/timeago/timeago.locales-3.0.2.min.js" | relURL }}"></script> {{- end }} -<script> // NOTE: timeago.js uses the language code format like "zh_CN" (underscore and case sensitive) - var languageCode = {{ .Site.LanguageCode }}.replace(/-/g, '_').replace(/_(.*)/, function ($0, $1) {return $0.replace($1, $1.toUpperCase());}); - timeago().render(document.querySelectorAll('.timeago'), languageCode); - timeago.cancel(); // stop update -</script> -{{- end }} + <script><!-- NOTE: timeago.js uses the language code format like "zh_CN" (underscore and case sensitive) --> + var languageCode = {{ .Site.LanguageCode }}.replace(/-/g, '_').replace(/_(.*)/, function ($0, $1) {return $0.replace($1, $1.toUpperCase());}); + timeago().render(document.querySelectorAll('.timeago'), languageCode); + timeago.cancel(); // stop update + </script> +{{- end -}} <!-- flowchart --> {{- if and (or .Params.flowchartDiagrams.enable (and .Site.Params.flowchartDiagrams.enable (ne .Params.flowchartDiagrams.enable false))) (or .IsPage .IsHome) -}} -<script> - {{- if .Params.flowchartDiagrams.options -}} - window.flowchartDiagramsOptions = {{ .Params.flowchartDiagrams.options | safeJS }}; - {{- else if .Site.Params.flowchartDiagrams.options -}} - window.flowchartDiagramsOptions = {{ .Site.Params.flowchartDiagrams.options | safeJS }}; + <script> + {{- if .Params.flowchartDiagrams.options -}} + window.flowchartDiagramsOptions = {{ .Params.flowchartDiagrams.options | safeJS }}; + {{- else if .Site.Params.flowchartDiagrams.options -}} + window.flowchartDiagramsOptions = {{ .Site.Params.flowchartDiagrams.options | safeJS }}; + {{- end -}} + </script> + {{- if .Site.Params.publicCDN.enable -}} + {{ .Site.Params.publicCDN.flowchartDiagramsJS | safeHTML }} + {{- else -}} + <script src="{{ "lib/flowchartDiagrams/raphael-2.2.7.min.js" | relURL }}" integrity="sha256-67By+NpOtm9ka1R6xpUefeGOY8kWWHHRAKlvaTJ7ONI=" crossorigin="anonymous"></script> + <script src="{{ "lib/flowchartDiagrams/flowchart-1.8.0.min.js" | relURL }}" integrity="sha256-zNGWjubXoY6rb5MnmpBNefO0RgoVYfle9p0tvOQM+6k=" crossorigin="anonymous"></script> {{- end -}} -</script> -{{- if .Site.Params.publicCDN.enable -}} - {{ .Site.Params.publicCDN.flowchartDiagramsJS | safeHTML }} -{{- else -}} -<script src="{{ "lib/flowchartDiagrams/raphael-2.2.7.min.js" | relURL }}" integrity="sha256-67By+NpOtm9ka1R6xpUefeGOY8kWWHHRAKlvaTJ7ONI=" crossorigin="anonymous"></script> -<script src="{{ "lib/flowchartDiagrams/flowchart-1.8.0.min.js" | relURL }}" integrity="sha256-zNGWjubXoY6rb5MnmpBNefO0RgoVYfle9p0tvOQM+6k=" crossorigin="anonymous"></script> -{{- end -}} {{- end -}} <!-- js-sequence-diagrams --> {{- if and (or .Params.sequenceDiagrams.enable (and .Site.Params.sequenceDiagrams.enable (ne .Params.sequenceDiagrams.enable false))) (or .IsPage .IsHome) -}} -<script> - {{- if .Params.sequenceDiagrams.options -}} - window.sequenceDiagramsOptions = {{ .Params.sequenceDiagrams.options | safeJS }}; - {{- else if .Site.Params.sequenceDiagrams.options -}} - window.sequenceDiagramsOptions = {{ .Site.Params.sequenceDiagrams.options | safeJS }}; + <script> + {{- if .Params.sequenceDiagrams.options -}} + window.sequenceDiagramsOptions = {{ .Params.sequenceDiagrams.options | safeJS }}; + {{- else if .Site.Params.sequenceDiagrams.options -}} + window.sequenceDiagramsOptions = {{ .Site.Params.sequenceDiagrams.options | safeJS }}; + {{- end -}} + </script> + {{- if .Site.Params.publicCDN.enable -}} + {{ .Site.Params.publicCDN.sequenceDiagramsJS | safeHTML }} + {{ .Site.Params.publicCDN.sequenceDiagramsCSS | safeHTML }} + {{- else -}} + <script src="{{ "lib/js-sequence-diagrams/webfontloader-1.6.28.js" | relURL }}" integrity="sha256-4O4pS1SH31ZqrSO2A/2QJTVjTPqVe+jnYgOWUVr7EEc=" crossorigin="anonymous"></script> + <script src="{{ "lib/js-sequence-diagrams/snap.svg-0.5.1.min.js" | relURL }}" integrity="sha256-oI+elz+sIm+jpn8F/qEspKoKveTc5uKeFHNNVexe6d8=" crossorigin="anonymous"></script> + <script src="{{ "lib/js-sequence-diagrams/underscore-1.8.3.min.js" | relURL }}" integrity="sha256-obZACiHd7gkOk9iIL/pimWMTJ4W/pBsKu+oZnSeBIek=" crossorigin="anonymous"></script> + <script src="{{ "lib/js-sequence-diagrams/sequence-diagram-2.0.1.min.js" | relURL }}" integrity="sha384-8748Vn52gHJYJI0XEuPB2QlPVNUkJlJn9tHqKec6J3q2r9l8fvRxrgn/E5ZHV0sP" crossorigin="anonymous"></script> + <link rel="stylesheet" href="{{ "lib/js-sequence-diagrams/sequence-diagram-2.0.1.min.css" | relURL }}" integrity="sha384-6QbLKJMz5dS3adWSeINZe74uSydBGFbnzaAYmp+tKyq60S7H2p6V7g1TysM5lAaF" crossorigin="anonymous"> {{- end -}} -</script> -{{- if .Site.Params.publicCDN.enable -}} - {{ .Site.Params.publicCDN.sequenceDiagramsJS | safeHTML }} - {{ .Site.Params.publicCDN.sequenceDiagramsCSS | safeHTML }} -{{- else -}} -<script src="{{ "lib/js-sequence-diagrams/webfontloader-1.6.28.js" | relURL }}" integrity="sha256-4O4pS1SH31ZqrSO2A/2QJTVjTPqVe+jnYgOWUVr7EEc=" crossorigin="anonymous"></script> -<script src="{{ "lib/js-sequence-diagrams/snap.svg-0.5.1.min.js" | relURL }}" integrity="sha256-oI+elz+sIm+jpn8F/qEspKoKveTc5uKeFHNNVexe6d8=" crossorigin="anonymous"></script> -<script src="{{ "lib/js-sequence-diagrams/underscore-1.8.3.min.js" | relURL }}" integrity="sha256-obZACiHd7gkOk9iIL/pimWMTJ4W/pBsKu+oZnSeBIek=" crossorigin="anonymous"></script> -<script src="{{ "lib/js-sequence-diagrams/sequence-diagram-2.0.1.min.js" | relURL }}" integrity="sha384-8748Vn52gHJYJI0XEuPB2QlPVNUkJlJn9tHqKec6J3q2r9l8fvRxrgn/E5ZHV0sP" crossorigin="anonymous"></script> -<link rel="stylesheet" href="{{ "lib/js-sequence-diagrams/sequence-diagram-2.0.1.min.css" | relURL }}" integrity="sha384-6QbLKJMz5dS3adWSeINZe74uSydBGFbnzaAYmp+tKyq60S7H2p6V7g1TysM5lAaF" crossorigin="anonymous"> -{{- end -}} {{- end }} <script type="text/javascript" src="{{ print "dist/" .Site.Data.even.assets.even.js | relURL }}"></script> @@ -128,5 +128,5 @@ <!-- custom js --> {{ range .Site.Params.customJS -}} -<script src="{{ "/js/" | relURL }}{{ . }}"></script> + <script src="{{ "/js/" | relURL }}{{ . }}"></script> {{ end }} |