1
0
mirror of https://gitnet.fr/deblan/gist.git synced 2021-08-14 08:30:49 +02:00

Embed block moved

This commit is contained in:
Simon Vieille 2017-10-15 02:58:10 +02:00
parent 21a85c0db4
commit 1a79e4520f
9 changed files with 22 additions and 18 deletions

View File

@ -37,7 +37,7 @@ gist:
raw: '源文件' raw: '源文件'
download: '下载' download: '下载'
clone: '克隆' clone: '克隆'
embed: '引用:' embed: '引用'
add: '新建' add: '新建'
date: date:

View File

@ -37,7 +37,7 @@ gist:
raw: 'RAW' raw: 'RAW'
download: 'Herunterladen' download: 'Herunterladen'
clone: 'Klonen' clone: 'Klonen'
embed: 'Einfügen:' embed: 'Einfügen'
add: 'Hinzufügen' add: 'Hinzufügen'
date: date:

View File

@ -38,7 +38,7 @@ gist:
raw: 'RAW' raw: 'RAW'
download: 'Download' download: 'Download'
clone: 'Clone' clone: 'Clone'
embed: 'Embed:' embed: 'Embed'
add: 'New' add: 'New'
date: date:

View File

@ -37,7 +37,7 @@ gist:
raw: 'RAW' raw: 'RAW'
download: 'Descargar' download: 'Descargar'
clone: 'Clonar' clone: 'Clonar'
embed: 'Insertar : ' embed: 'Insertar'
add: 'Añadir' add: 'Añadir'
date: date:

View File

@ -37,7 +37,7 @@ gist:
raw: 'RAW' raw: 'RAW'
download: 'Télécharger' download: 'Télécharger'
clone: 'Clôner' clone: 'Clôner'
embed: 'Insérer : ' embed: 'Insérer'
add: 'Ajouter' add: 'Ajouter'
date: date:

View File

@ -12,10 +12,6 @@
{% endif %} {% endif %}
<style type="text/css"> <style type="text/css">
#embed {
padding: 0;
}
.panel-body { .panel-body {
padding: 0; padding: 0;
} }

View File

@ -64,11 +64,19 @@
<div id="viewer"> <div id="viewer">
<pre><code {% if gist.cipher %}data-cipher{% endif %} class="language-{{ gist.type }}" data-dependencies="{{ gist.type }}">{{ raw_content }}</code></pre> <pre><code {% if gist.cipher %}data-cipher{% endif %} class="language-{{ gist.type }}" data-dependencies="{{ gist.type }}">{{ raw_content }}</code></pre>
</div> </div>
</div>
<p id="embed" class="pull-right"> </div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
{{ 'gist.action.embed'|trans }} {{ 'gist.action.embed'|trans }}
<input type="text" class="form-control" id="embed-input" value="{{ '<div%key%id="gist-' ~ gist.file ~ '-' ~ commit ~ '" class="gist-container"></div><script src="' ~ app.request.getSchemeAndHttpHost() ~ path('embedjs', app.request.attributes.get('_route_params')) ~ '" async></script>' }}" /> </div>
</p> <div class="panel-body" id="embed">
<div class="tab-content">
<div class="tab-pane active in">
<pre><code class="language-html">{{ '<div%key%id="gist-' ~ gist.file ~ '-' ~ commit ~ '" class="gist-container"></div>
<script src="' ~ app.request.getSchemeAndHttpHost() ~ path('embedjs', app.request.attributes.get('_route_params')) ~ '" async></script>' }}</code></pre>
</div> </div>
</div> </div>
</div> </div>

View File

@ -26,7 +26,7 @@ body {
margin-right: 4px; margin-right: 4px;
} }
#viewer pre, #viewer code, #revisions pre, #revisions code { #viewer pre, #viewer code, #revisions pre, #revisions code, #embed pre, #embed code {
background: none !important; background: none !important;
white-space: pre-wrap; white-space: pre-wrap;
white-space: -moz-pre-wrap; white-space: -moz-pre-wrap;

View File

@ -144,7 +144,7 @@ var viewerEvents = function() {
var key = getKey(); var key = getKey();
var $cipherEditor = $('.cipher-editor'); var $cipherEditor = $('.cipher-editor');
var $embedInput = $('#embed-input'); var $embedCode = $('#embed code');
var to = ' '; var to = ' ';
@ -177,8 +177,8 @@ var viewerEvents = function() {
} }
} }
if ($embedInput.length) { if ($embedCode.length) {
$embedInput.val($embedInput.val().replace('%key%', to)); $embedCode.html($embedCode.html().replace('%key%', to));
} }
}); });
} }