-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5588 from dodona-edu/fix/cliboard-empty
Replace clipboardjs by webcomponent
- Loading branch information
Showing
19 changed files
with
75 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { html, TemplateResult } from "lit"; | ||
import { customElement, property } from "lit/decorators.js"; | ||
import "components/copy_button"; | ||
import { DodonaElement } from "components/meta/dodona_element"; | ||
|
||
/** | ||
* A container that holds code that can be copied to the clipboard. | ||
* | ||
* @element d-copy-container | ||
* | ||
* @property {string} content - The content that is copied to the clipboard. | ||
*/ | ||
@customElement("d-copy-container") | ||
export class CopyContainer extends DodonaElement { | ||
@property({ type: String }) | ||
content: string; | ||
|
||
@property({ state: true }) | ||
containerId: string; | ||
|
||
constructor() { | ||
super(); | ||
this.containerId = "copy-container-" + Math.random().toString(36).substring(7); | ||
} | ||
|
||
protected render(): TemplateResult { | ||
return html`<pre class="code-wrapper"><code id="${this.containerId}">${this.content}</code><d-copy-button targetId="${this.containerId}"></d-copy-button></pre>`; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,7 +192,7 @@ center img { | |
|
||
code { | ||
overflow: auto; | ||
width: 100%; | ||
width: calc(100%); | ||
display: block; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
<%= text_field_tag name, value, readonly: true, class: 'form-control' %> | ||
<%= clipboard_button_for name %> | ||
<d-copy-container content="<%= value %>"></d-copy-container> | ||
<% if reset_url.present? %> | ||
<%= link_to reset_url, | ||
title: t('general.generate_token'), | ||
method: :post, | ||
data: {confirm: t('general.confirm_reset_token')}, | ||
remote: true, | ||
class: 'btn btn-icon' do %> | ||
<i class="mdi mdi-refresh mdi-18"></i> | ||
class: 'btn btn-outline btn-icon ms-1 flex-shrink-0' do %> | ||
<i class="mdi mdi-refresh mdi-24"></i> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.