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: '源文件'
download: '下载'
clone: '克隆'
embed: '引用:'
embed: '引用'
add: '新建'
date:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -64,11 +64,19 @@
<div id="viewer">
<pre><code {% if gist.cipher %}data-cipher{% endif %} class="language-{{ gist.type }}" data-dependencies="{{ gist.type }}">{{ raw_content }}</code></pre>
</div>
<p id="embed" class="pull-right">
{{ '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>' }}" />
</p>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
{{ 'gist.action.embed'|trans }}
</div>
<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>

View File

@ -26,7 +26,7 @@ body {
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;
white-space: pre-wrap;
white-space: -moz-pre-wrap;

View File

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