Browse Source

Feature: line-numbers, UI: target blank on embed links

dev-master
Simon Vieille 2 years ago
parent
commit
7f77b92554
No known key found for this signature in database GPG Key ID: 919533E2B946EA10
5 changed files with 47 additions and 35 deletions
  1. +6
    -6
      src/Gist/Resources/views/View/embed.html.twig
  2. +1
    -1
      src/Gist/Resources/views/View/view.html.twig
  3. +8
    -0
      web/app/css/themes/dark.css
  4. +8
    -0
      web/app/css/themes/light.css
  5. +24
    -28
      web/app/js/prism.js

+ 6
- 6
src/Gist/Resources/views/View/embed.html.twig View File

@ -55,18 +55,18 @@
</li>
{% if not gist.cipher %}
<li>
<a href="{{ path('raw', app.request.attributes.get('_route_params')) }}">
<a target="_blank" href="{{ path('raw', app.request.attributes.get('_route_params')) }}">
{{ 'gist.action.raw'|trans }}
</a>
</li>
<li>
<a href="{{ path('download', app.request.attributes.get('_route_params')) }}">
<a target="_blank" href="{{ path('download', app.request.attributes.get('_route_params')) }}">
{{ 'gist.action.download'|trans }}
</a>
</li>
{% endif %}
<li>
<a href="{{ path('clone', app.request.attributes.get('_route_params')) }}" class="cipher-link">
<a target="_blank" href="{{ path('clone', app.request.attributes.get('_route_params')) }}" class="cipher-link">
{{ 'gist.action.clone'|trans }}
</a>
</li>
@ -78,17 +78,17 @@
<a target="_blank" href="{{ path('view', app.request.attributes.get('_route_params')) }}" class="cipher-link"><span class="btn btn-warning btn-xs">{{ commit|slice(0, 10) }}</span></a>
{% if not gist.cipher %}
<a href="{{ path('raw', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
<a target="_blank" href="{{ path('raw', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-eye-open"></span>
{{ 'gist.action.raw'|trans }}
</a>
<a href="{{ path('download', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
<a target="_blank" href="{{ path('download', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-save-file"></span>
{{ 'gist.action.download'|trans }}
</a>
{% endif %}
<a href="{{ path('clone', app.request.attributes.get('_route_params')) }}" class="btn btn-success btn-sm cipher-link">
<a target="_blank" href="{{ path('clone', app.request.attributes.get('_route_params')) }}" class="btn btn-success btn-sm cipher-link">
<span class="glyphicon glyphicon-copy"></span>
{{ 'gist.action.clone'|trans }}
</a>


+ 1
- 1
src/Gist/Resources/views/View/view.html.twig View File

@ -101,7 +101,7 @@
<div class="tab-content">
<div id="view" class="tab-pane active in">
<div id="viewer">
<pre><code {% if gist.cipher %}data-cipher{% endif %} class="language-{{ gist.highlightType }}">{{ raw_content }}</code></pre>
<pre><code {% if gist.cipher %}data-cipher{% endif %} class="line-numbers language-{{ gist.highlightType }}">{{ raw_content }}</code></pre>
</div>
</div>
</div>


+ 8
- 0
web/app/css/themes/dark.css View File

@ -56,3 +56,11 @@ body {
.btn-error:active, .btn-error:hover, .btn-error:focus {
color: #000;
}
pre.line-numbers {
padding-left: 50px !important;
}
.line-numbers-rows {
top: -4px !important;
}

+ 8
- 0
web/app/css/themes/light.css View File

@ -46,3 +46,11 @@ pre, code {
.btn-error:active, .btn-error:hover, .btn-error:focus {
color: #000;
}
pre.line-numbers {
padding-left: 50px !important;
}
.line-numbers-rows {
top: -4px !important;
}

+ 24
- 28
web/app/js/prism.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save