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
```
251123周日0.2.0)对复制和打开功能作区分
250824周六0.1.2)增加复制功能
250823周六0.0.9)修改按钮出现位置;优化样式
250823周六0.0.1)基础功能

View File

@@ -8,13 +8,23 @@
<% if archive_custom_field && archive_custom_field.value.present? %>
<% archive_url = archive_custom_field.value.strip %>
<a href="<%= archive_url %>"
target="_blank"
onclick="copyLink(String.raw`<%= archive_url %>`)"
class="archive-button">
<span class="archive-icon">📂</span>
一键打开
</a>
<% is_valid_url = archive_url.start_with?('http://', 'https://') %>
<% if is_valid_url %>
<a href="<%= archive_url %>"
target="_blank"
onclick="copyLink(String.raw`<%= archive_url %>`)"
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 %>
<script>

View File

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