-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Copy/paste settings through UI
- Loading branch information
1 parent
0f21120
commit 14b8040
Showing
8 changed files
with
108 additions
and
7 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
1 change: 1 addition & 0 deletions
1
packages/userscript/source/images/content_copy_FILL0_wght400_GRAD0_opsz48.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
packages/userscript/source/images/publish_FILL0_wght400_GRAD0_opsz48.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { UserScript } from "../../UserScript"; | ||
import { UiComponent } from "./UiComponent"; | ||
|
||
/** | ||
* A button that is intended to initiate a copy action. | ||
*/ | ||
export class CopyButton extends UiComponent { | ||
readonly element: JQuery<HTMLElement>; | ||
|
||
/** | ||
* Constructs a `CopyButton`. | ||
* | ||
* @param host A reference to the host. | ||
*/ | ||
constructor(host: UserScript) { | ||
super(host); | ||
|
||
const element = $("<div/>", { | ||
html: '<svg style="width: 15px; height: 15px;" viewBox="0 0 48 48"><path fill="currentColor" d="M9 43.95q-1.2 0-2.1-.9-.9-.9-.9-2.1V10.8h3v30.15h23.7v3Zm6-6q-1.2 0-2.1-.9-.9-.9-.9-2.1v-28q0-1.2.9-2.1.9-.9 2.1-.9h22q1.2 0 2.1.9.9.9.9 2.1v28q0 1.2-.9 2.1-.9.9-2.1.9Zm0-3h22v-28H15v28Zm0 0v-28 28Z"/></svg>', | ||
title: "Copy to clipboard", | ||
}).addClass("ks-icon-button"); | ||
|
||
this.element = element; | ||
} | ||
} |
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,25 @@ | ||
import { UserScript } from "../../UserScript"; | ||
import { UiComponent } from "./UiComponent"; | ||
|
||
/** | ||
* A button that is intended to initiate an import action. | ||
*/ | ||
export class ImportButton extends UiComponent { | ||
readonly element: JQuery<HTMLElement>; | ||
|
||
/** | ||
* Constructs a `ImportButton`. | ||
* | ||
* @param host A reference to the host. | ||
*/ | ||
constructor(host: UserScript) { | ||
super(host); | ||
|
||
const element = $("<div/>", { | ||
html: '<svg style="width: 15px; height: 15px;" viewBox="0 0 48 48"><path fill="currentColor" d="M22.5 40V21.45l-6 6-2.15-2.15L24 15.65l9.65 9.65-2.15 2.15-6-6V40ZM8 18.15V11q0-1.2.9-2.1Q9.8 8 11 8h26q1.2 0 2.1.9.9.9.9 2.1v7.15h-3V11H11v7.15Z"/></svg>', | ||
title: "Import", | ||
}).addClass("ks-icon-button"); | ||
|
||
this.element = element; | ||
} | ||
} |