From 47193dbcd97555d0c72d3219a372d9d5d01755d3 Mon Sep 17 00:00:00 2001 From: qwerty287 <80460567+qwerty287@users.noreply.github.com> Date: Sat, 2 Oct 2021 09:46:43 +0200 Subject: [PATCH] Add option to copy line permalink (#17145) * Add option to copy line permalink * Fix lint * Apply review suggestions * Update code and fix lint * Use features/clipboard.js framework --- options/locale/locale_en-US.ini | 1 + templates/repo/view_file.tmpl | 19 ++++++------ web_src/js/index.js | 51 ++++++++++++++++----------------- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index bd95cc8d8..bc03f8661 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -970,6 +970,7 @@ file_view_rendered = View Rendered file_view_raw = View Raw file_permalink = Permalink file_too_large = The file is too large to be shown. +file_copy_permalink = Copy Permalink video_not_supported_in_browser = Your browser does not support the HTML5 'video' tag. audio_not_supported_in_browser = Your browser does not support the HTML5 'audio' tag. stored_lfs = Stored with Git LFS diff --git a/templates/repo/view_file.tmpl b/templates/repo/view_file.tmpl index b6198bd0e..8e75bcb4c 100644 --- a/templates/repo/view_file.tmpl +++ b/templates/repo/view_file.tmpl @@ -112,17 +112,20 @@ {{end}} - {{if $.Permission.CanRead $.UnitTypeIssues}} -