Copy to clipboard feature
parent
0d90eaed55
commit
f2a43dc56a
|
@ -450,15 +450,20 @@ class BitbucketController extends mixOf(taiga.Controller, taiga.PageMixin, taiga
|
||||||
module.controller("BitbucketController", BitbucketController)
|
module.controller("BitbucketController", BitbucketController)
|
||||||
|
|
||||||
|
|
||||||
SelectInputText = ->
|
SelectInputText = ($translate, $confirm)->
|
||||||
link = ($scope, $el, $attrs) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
$el.on "click", ".select-input-content", () ->
|
$el.on "click", ".select-input-content", () ->
|
||||||
$el.find("input").select()
|
source = $el.find("input")
|
||||||
$el.find(".help-copy").addClass("visible")
|
if !source.val()
|
||||||
|
return
|
||||||
|
|
||||||
|
source.select()
|
||||||
|
document.execCommand 'copy'
|
||||||
|
$confirm.notify("success", $translate.instant("COMMON.COPIED_TO_CLIPBOARD"))
|
||||||
|
|
||||||
return {link:link}
|
return {link:link}
|
||||||
|
|
||||||
module.directive("tgSelectInputText", SelectInputText)
|
module.directive("tgSelectInputText", ["$translate", "$tgConfirm", SelectInputText])
|
||||||
|
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
|
@ -13,7 +13,8 @@
|
||||||
"UNLINK": "Unlink",
|
"UNLINK": "Unlink",
|
||||||
"CREATE": "Create",
|
"CREATE": "Create",
|
||||||
"ADD": "Add",
|
"ADD": "Add",
|
||||||
"COPY_TO_CLIPBOARD": "Copy to clipboard: Ctrl+C",
|
"COPY_TO_CLIPBOARD": "Copy to clipboard",
|
||||||
|
"COPIED_TO_CLIPBOARD": "Text has been copied to clipboard",
|
||||||
"EDIT": "Edit",
|
"EDIT": "Edit",
|
||||||
"DRAG": "Drag",
|
"DRAG": "Drag",
|
||||||
"TAG_LINE": "Your agile, free, and open source project management tool",
|
"TAG_LINE": "Your agile, free, and open source project management tool",
|
||||||
|
|
|
@ -39,9 +39,8 @@ div.wrapper.roles(
|
||||||
ng-model="bitbucket.webhooks_url"
|
ng-model="bitbucket.webhooks_url"
|
||||||
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
||||||
)
|
)
|
||||||
.option-wrapper.select-input-content
|
.option-wrapper.select-input-content(title="{{'COMMON.COPY_TO_CLIPBOARD' | translate}}")
|
||||||
tg-svg(svg-icon="icon-clipboard")
|
tg-svg(svg-icon="icon-clipboard")
|
||||||
.help-copy(translate="COMMON.COPY_TO_CLIPBOARD")
|
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
label(for="valid-origin-ips", translate="ADMIN.THIRD_PARTIES.VALID_IPS")
|
label(for="valid-origin-ips", translate="ADMIN.THIRD_PARTIES.VALID_IPS")
|
||||||
|
|
|
@ -38,9 +38,8 @@ div.wrapper.roles(
|
||||||
ng-model="github.webhooks_url"
|
ng-model="github.webhooks_url"
|
||||||
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
||||||
)
|
)
|
||||||
.option-wrapper.select-input-content
|
.option-wrapper.select-input-content(title="{{'COMMON.COPY_TO_CLIPBOARD' | translate}}")
|
||||||
tg-svg(svg-icon="icon-clipboard")
|
tg-svg(svg-icon="icon-clipboard")
|
||||||
.help-copy(translate="COMMON.COPY_TO_CLIPBOARD")
|
|
||||||
|
|
||||||
button.button-green.submit-button(
|
button.button-green.submit-button(
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
@ -38,9 +38,8 @@ div.wrapper.roles(
|
||||||
ng-model="gitlab.webhooks_url"
|
ng-model="gitlab.webhooks_url"
|
||||||
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
||||||
)
|
)
|
||||||
.option-wrapper.select-input-content
|
.option-wrapper.select-input-content(title="{{'COMMON.COPY_TO_CLIPBOARD' | translate}}")
|
||||||
tg-svg(svg-icon="icon-clipboard")
|
tg-svg(svg-icon="icon-clipboard")
|
||||||
.help-copy(translate="COMMON.COPY_TO_CLIPBOARD")
|
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
label(for="valid-origin-ips", translate="ADMIN.THIRD_PARTIES.VALID_IPS")
|
label(for="valid-origin-ips", translate="ADMIN.THIRD_PARTIES.VALID_IPS")
|
||||||
|
|
|
@ -38,9 +38,8 @@ div.wrapper.roles(
|
||||||
ng-model="gogs.webhooks_url"
|
ng-model="gogs.webhooks_url"
|
||||||
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
placeholder="{{'ADMIN.THIRD_PARTIES.PAYLOAD_URL' | translate}}"
|
||||||
)
|
)
|
||||||
.option-wrapper.select-input-content
|
.option-wrapper.select-input-content(title="{{'COMMON.COPY_TO_CLIPBOARD' | translate}}")
|
||||||
tg-svg(svg-icon="icon-clipboard")
|
tg-svg(svg-icon="icon-clipboard")
|
||||||
.help-copy(translate="COMMON.COPY_TO_CLIPBOARD")
|
|
||||||
|
|
||||||
button.button-green.submit-button(
|
button.button-green.submit-button(
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
Loading…
Reference in New Issue