0.2.0: change behavior copy or href.

This commit is contained in:
2025-11-23 11:43:11 +08:00
parent f0a6e6d8ef
commit d2625039e9
3 changed files with 19 additions and 8 deletions

View File

@@ -12,6 +12,7 @@ git clone https://git.licsber.site/ruby/open_explorer
## ChangeLog ## ChangeLog
``` ```
251123周日0.2.0)对复制和打开功能作区分
250824周六0.1.2)增加复制功能 250824周六0.1.2)增加复制功能
250823周六0.0.9)修改按钮出现位置;优化样式 250823周六0.0.9)修改按钮出现位置;优化样式
250823周六0.0.1)基础功能 250823周六0.0.1)基础功能

View File

@@ -8,13 +8,23 @@
<% if archive_custom_field && archive_custom_field.value.present? %> <% if archive_custom_field && archive_custom_field.value.present? %>
<% archive_url = archive_custom_field.value.strip %> <% archive_url = archive_custom_field.value.strip %>
<a href="<%= archive_url %>" <% is_valid_url = archive_url.start_with?('http://', 'https://') %>
target="_blank"
onclick="copyLink(String.raw`<%= archive_url %>`)" <% if is_valid_url %>
class="archive-button"> <a href="<%= archive_url %>"
<span class="archive-icon">📂</span> target="_blank"
一键打开 onclick="copyLink(String.raw`<%= archive_url %>`)"
</a> class="archive-button">
<span class="archive-icon">📂</span>
一键打开
</a>
<% else %>
<button onclick="copyLink(String.raw`<%= archive_url %>`); return false;"
class="archive-button">
<span class="archive-icon">📋</span>
一键复制
</button>
<% end %>
<% end %> <% end %>
<script> <script>

View File

@@ -2,7 +2,7 @@ Redmine::Plugin.register :open_explorer do
name 'Open Explorer plugin' name 'Open Explorer plugin'
author 'licsber' author 'licsber'
description 'Open archive path using explorer.' description 'Open archive path using explorer.'
version '0.1.2' version '0.2.0'
url 'https://git.licsber.site/ruby/open_explorer' url 'https://git.licsber.site/ruby/open_explorer'
author_url 'https://licsber.site' author_url 'https://licsber.site'
end end