-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
133 additions
and
18 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
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 |
---|---|---|
|
@@ -6,10 +6,41 @@ | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet"> | ||
<style> | ||
body { | ||
min-width: 600px; /* Increased minimum width for the table */ | ||
min-width: 600px; | ||
min-height: 150px; | ||
padding: 15px; | ||
} | ||
.table-fixed { | ||
table-layout: fixed; | ||
} | ||
.w-url { | ||
width: auto; | ||
} | ||
.single-line { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
max-width: 100%; | ||
} | ||
.wrap-url { | ||
white-space: normal; | ||
word-break: break-all; | ||
hyphens: auto; | ||
} | ||
.table-compact td { | ||
padding-top: 0.5rem; | ||
padding-bottom: 0.5rem; | ||
} | ||
.table-compact th { | ||
padding-top: 0.75rem; | ||
padding-bottom: 0.75rem; | ||
} | ||
#editRuleDiv.hidden { | ||
display: none; | ||
} | ||
#editRuleDiv { | ||
margin-top: 20px; /* Added margin to push the edit form down slightly if needed */ | ||
} | ||
</style> | ||
</head> | ||
<body class="bg-gray-100"> | ||
|
@@ -36,22 +67,22 @@ <h2 class="text-lg font-bold mb-2">管理重命名规则</h2> | |
<button id="addRuleButton" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">添加规则</button> | ||
</div> | ||
<div id="rulesList"> | ||
<table class="min-w-full leading-normal shadow-md rounded-lg overflow-hidden"> | ||
<table class="table-fixed min-w-full leading-normal shadow-md rounded-lg overflow-hidden table-compact"> | ||
<thead> | ||
<tr> | ||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
<th class="px-5 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
名称 | ||
</th> | ||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
<th class="px-5 border-b-2 border-gray-200 bg-gray-100 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider single-line"> | ||
匹配类型 | ||
</th> | ||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
<th class="px-5 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
URL 模式 | ||
</th> | ||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
<th class="px-5 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider single-line"> | ||
新标题 | ||
</th> | ||
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
<th class="px-5 border-b-2 border-gray-200 bg-gray-100 text-center text-xs font-semibold text-gray-600 uppercase tracking-wider"> | ||
操作 | ||
</th> | ||
</tr> | ||
|
@@ -64,6 +95,22 @@ <h2 class="text-lg font-bold mb-2">管理重命名规则</h2> | |
</div> | ||
</div> | ||
|
||
<div id="editRuleDiv" class="hidden mt-4"> | ||
<h2 class="text-lg font-bold mb-2">编辑重命名规则</h2> | ||
<input type="hidden" id="editRuleIndex"> | ||
<input type="text" id="editRuleName" placeholder="规则名称" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline mb-1"> | ||
<select id="editRuleMatchType" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline mb-1"> | ||
<option value="host">Host 匹配</option> | ||
<option value="regex">正则表达式匹配</option> | ||
</select> | ||
<input type="text" id="editRuleUrlPattern" placeholder="URL 或 Host 模式" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline mb-1"> | ||
<input type="text" id="editRuleNewTitle" placeholder="新的标签页标题 (可以使用 ${title} 占位符)" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline mb-1"> | ||
<div class="flex justify-end"> | ||
<button id="saveRuleButton" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline mr-2">保存</button> | ||
<button id="cancelEditButton" class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">取消</button> | ||
</div> | ||
</div> | ||
|
||
<script src="popup.js"></script> | ||
</body> | ||
</html> |
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