mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 12:17:31 -06:00
doesn't work yet
This commit is contained in:
+20
-8
@@ -170,6 +170,16 @@ function initShareButton(getLink, layout, noteNewState) {
|
||||
setSocialSharing(socialSharing, result.url);
|
||||
}
|
||||
|
||||
function getEmbeddedCacheLinkId() {
|
||||
if ($("#shareembedlink input:checked").length === 0) return "Embed";
|
||||
|
||||
return "Embed|" + $("#shareembedlink input:checked").map(function () {
|
||||
return $(this).prop("class");
|
||||
})
|
||||
.get()
|
||||
.join();
|
||||
}
|
||||
|
||||
function update() {
|
||||
var socialSharing = socialSharingElements;
|
||||
socialSharing.empty();
|
||||
@@ -177,12 +187,8 @@ function initShareButton(getLink, layout, noteNewState) {
|
||||
permalink.prop('disabled', false);
|
||||
var config = layout.toConfig();
|
||||
var cacheLinkId = currentBind;
|
||||
if (cacheLinkId === "Embed" && $("#shareembedlink input:checked").length > 0) {
|
||||
cacheLinkId += "|" + $("#shareembedlink input:checked").map(function () {
|
||||
return $(this).prop("class");
|
||||
})
|
||||
.get()
|
||||
.join();
|
||||
if (currentBind === "Embed") {
|
||||
cacheLinkId = getEmbeddedCacheLinkId();
|
||||
}
|
||||
if (!urls[cacheLinkId]) {
|
||||
label.text(currentNode.text());
|
||||
@@ -210,8 +216,14 @@ function initShareButton(getLink, layout, noteNewState) {
|
||||
update();
|
||||
});
|
||||
|
||||
$(document).find('#embedsettings input').on('click', function () {
|
||||
setCurrent(root.find('.sources [data-bind="Embed"]'));
|
||||
var embeddedButton = $('#shareembed');
|
||||
$('#embedsettings input').on('click', function () {
|
||||
setCurrent(embeddedButton);
|
||||
update();
|
||||
});
|
||||
embeddedButton.off('click').on('click', function () {
|
||||
$('#embedsettings').modal('show');
|
||||
setCurrent(embeddedButton);
|
||||
update();
|
||||
});
|
||||
|
||||
|
||||
+10
-2
@@ -14,12 +14,20 @@
|
||||
| Short
|
||||
button.dropdown-item.btn.btn-light.btn-sm(data-bind="Full")
|
||||
| Full
|
||||
button.dropdown-item.btn.btn-light.btn-sm(data-bind="Embed" href="javascript:;" data-target="#shareembedlink" data-toggle="modal")
|
||||
| Embed
|
||||
input.form-control.input-sm.permalink(type="text" placeholder="Loading" readonly size="1024" style="font-size: 10px")
|
||||
.input-group-append
|
||||
button.input-group-btn.btn.btn-outline-secondary.btn-sm.clippy(type="button" data-clipboard-target=".popover .permalink" title="Copy to clipboard")
|
||||
span.fa.fa-clipboard
|
||||
div
|
||||
|
|
||||
.btn-group.btn-group-sm
|
||||
.input-group.input-group-sm
|
||||
.input-group-prepend
|
||||
span
|
||||
button.btn.btn-outline-secondary.btn-sm#shareembed(type="button" data-bind="Embed")
|
||||
| Embedded
|
||||
.input-group-append
|
||||
span
|
||||
if sharingEnabled
|
||||
.card-footer
|
||||
.socialsharing
|
||||
|
||||
Reference in New Issue
Block a user