Prechádzať zdrojové kódy

added link for feedback, added support for `@supportURL`

Gerald 11 rokov pred
rodič
commit
0d4bba46f1

+ 24 - 8
_locales/cs/messages.json

@@ -87,10 +87,6 @@
 		"message": "Vkládání požadavky... ($1/$2)",
 		"description": "Message shown on confirm page when the requirements are being downloaded."
 	},
-	"anchorGetMoreScripts": {
-		"message": "Získej více skritpů",
-		"description": "Link to get more scripts."
-	},
 	"sideMenuInstalled": {
 		"message": "Nainstalované skripty",
 		"description": "Side menu: Installed scripts"
@@ -111,6 +107,10 @@
 		"message": "Zkontrolovat aktualizace",
 		"description": "Check all scripts for updates."
 	},
+	"anchorGetMoreScripts": {
+		"message": "Získej více skritpů",
+		"description": "Link to get more scripts."
+	},
 	"msgLoading": {
 		"message": "Nahrávám ...",
 		"description": "Message shown in the options page before script list is loaded."
@@ -167,9 +167,9 @@
 		"message": "About Violentmonkey",
 		"description": "Label shown on top of the about page."
 	},
-	"labelSupportPage": {
-		"message": "Support page: ",
-		"description": "Label of support page."
+	"labelRelated": {
+		"message": "Related links: ",
+		"description": "Label of related links."
 	},
 	"anchorSupportPage": {
 		"message": "<a href=https://github.com/gera2ld/Violentmonkey/wiki target=_blank>Violentmonkey</a>",
@@ -179,6 +179,10 @@
 		"message": "Donate",
 		"description": "Label of link to donate page."
 	},
+	"labelFeedback": {
+		"message": "Feedback",
+		"description": "Label of link to feedback page."
+	},
 	"labelAuthor": {
 		"message": "Autor: ",
 		"description": "Label of author shown in the details of a script."
@@ -279,6 +283,10 @@
 		"message": "Jméno nebylo definováno",
 		"description": "Text as the name of a script when no @name is assigned."
 	},
+	"hintSupportPage": {
+		"message": "Support page",
+		"description": "Hint for support page."
+	},
 	"buttonDisable": {
 		"message": "Vypnout",
 		"description": "Button to disable a script."
@@ -347,10 +355,18 @@
 		"message": "Hledat: ",
 		"description": "Label for search input in search box."
 	},
+	"labelSearchFor": {
+		"message": "Search for...",
+		"description": "Text shown as a place holder in the search box."
+	},
 	"labelReplace": {
 		"message": "Nahradit: ",
 		"description": "Label for replace input in search box."
 	},
+	"labelReplaceWith": {
+		"message": "Replace with...",
+		"description": "Text shown as a place holder in the replace box."
+	},
 	"buttonReplace": {
 		"message": "Nahradit",
 		"description": "Button to replace the current match."
@@ -359,4 +375,4 @@
 		"message": "Vše",
 		"description": "Button to replace all matches."
 	}
-}
+}

+ 24 - 8
_locales/en/messages.json

@@ -87,10 +87,6 @@
 		"message": "Loading dependencies... ($1/$2)",
 		"description": "Message shown on confirm page when the requirements are being downloaded."
 	},
-	"anchorGetMoreScripts": {
-		"message": "Get more scripts",
-		"description": "Link to get more scripts."
-	},
 	"sideMenuInstalled": {
 		"message": "Installed scripts",
 		"description": "Side menu: Installed scripts"
@@ -111,6 +107,10 @@
 		"message": "Check all for updates",
 		"description": "Check all scripts for updates."
 	},
+	"anchorGetMoreScripts": {
+		"message": "Get more scripts",
+		"description": "Link to get more scripts."
+	},
 	"msgLoading": {
 		"message": "Loading ...",
 		"description": "Message shown in the options page before script list is loaded."
@@ -167,9 +167,9 @@
 		"message": "About Violentmonkey",
 		"description": "Label shown on top of the about page."
 	},
-	"labelSupportPage": {
-		"message": "Support page: ",
-		"description": "Label of support page."
+	"labelRelated": {
+		"message": "Related links: ",
+		"description": "Label of related links."
 	},
 	"anchorSupportPage": {
 		"message": "<a href=https://github.com/gera2ld/Violentmonkey/wiki target=_blank>Violentmonkey</a>",
@@ -179,6 +179,10 @@
 		"message": "Donate",
 		"description": "Label of link to donate page."
 	},
+	"labelFeedback": {
+		"message": "Feedback",
+		"description": "Label of link to feedback page."
+	},
 	"labelAuthor": {
 		"message": "Author: ",
 		"description": "Label of author shown in the details of a script."
@@ -279,6 +283,10 @@
 		"message": "No Name",
 		"description": "Text as the name of a script when no @name is assigned."
 	},
+	"hintSupportPage": {
+		"message": "Support page",
+		"description": "Hint for support page."
+	},
 	"buttonDisable": {
 		"message": "Disable",
 		"description": "Button to disable a script."
@@ -347,10 +355,18 @@
 		"message": "Search for: ",
 		"description": "Label for search input in search box."
 	},
+	"labelSearchFor": {
+		"message": "Search for...",
+		"description": "Text shown as a place holder in the search box."
+	},
 	"labelReplace": {
 		"message": "Replace with: ",
 		"description": "Label for replace input in search box."
 	},
+	"labelReplaceWith": {
+		"message": "Replace with...",
+		"description": "Text shown as a place holder in the replace box."
+	},
 	"buttonReplace": {
 		"message": "Replace",
 		"description": "Button to replace the current match."
@@ -359,4 +375,4 @@
 		"message": "All",
 		"description": "Button to replace all matches."
 	}
-}
+}

+ 24 - 8
_locales/pl/messages.json

@@ -87,10 +87,6 @@
 		"message": "Wczytywanie wymagań... ($1/$2)",
 		"description": "Message shown on confirm page when the requirements are being downloaded."
 	},
-	"anchorGetMoreScripts": {
-		"message": "Znajdź nowe skrypty",
-		"description": "Link to get more scripts."
-	},
 	"sideMenuInstalled": {
 		"message": "Zainstalowane skrypty",
 		"description": "Side menu: Installed scripts"
@@ -111,6 +107,10 @@
 		"message": "Sprawdź aktualizacje dla wszystkich skryptów",
 		"description": "Check all scripts for updates."
 	},
+	"anchorGetMoreScripts": {
+		"message": "Znajdź nowe skrypty",
+		"description": "Link to get more scripts."
+	},
 	"msgLoading": {
 		"message": "Wczytywanie...",
 		"description": "Message shown in the options page before script list is loaded."
@@ -167,9 +167,9 @@
 		"message": "O rozszerzeniu Violentmonkey",
 		"description": "Label shown on top of the about page."
 	},
-	"labelSupportPage": {
-		"message": "Strona wsparcia: ",
-		"description": "Label of support page."
+	"labelRelated": {
+		"message": "Related links: ",
+		"description": "Label of related links."
 	},
 	"anchorSupportPage": {
 		"message": "<a href=https://github.com/gera2ld/Violentmonkey/wiki target=_blank>Violentmonkey</a>",
@@ -179,6 +179,10 @@
 		"message": "Dotacja",
 		"description": "Label of link to donate page."
 	},
+	"labelFeedback": {
+		"message": "Feedback",
+		"description": "Label of link to feedback page."
+	},
 	"labelAuthor": {
 		"message": "Autor: ",
 		"description": "Label of author shown in the details of a script."
@@ -279,6 +283,10 @@
 		"message": "Bez nazwy",
 		"description": "Text as the name of a script when no @name is assigned."
 	},
+	"hintSupportPage": {
+		"message": "Strona wsparcia",
+		"description": "Hint for support page."
+	},
 	"buttonDisable": {
 		"message": "Wyłącz skrypt",
 		"description": "Button to disable a script."
@@ -347,10 +355,18 @@
 		"message": "Szukaj w: ",
 		"description": "Label for search input in search box."
 	},
+	"labelSearchFor": {
+		"message": "Search for...",
+		"description": "Text shown as a place holder in the search box."
+	},
 	"labelReplace": {
 		"message": "Zamień na: ",
 		"description": "Label for replace input in search box."
 	},
+	"labelReplaceWith": {
+		"message": "Replace with...",
+		"description": "Text shown as a place holder in the replace box."
+	},
 	"buttonReplace": {
 		"message": "Zamień",
 		"description": "Button to replace the current match."
@@ -359,4 +375,4 @@
 		"message": "Wszystko",
 		"description": "Button to replace all matches."
 	}
-}
+}

+ 24 - 8
_locales/ru/messages.json

@@ -87,10 +87,6 @@
 		"message": "Загрузка требований... ($1/$2)",
 		"description": "Message shown on confirm page when the requirements are being downloaded."
 	},
-	"anchorGetMoreScripts": {
-		"message": "Скачать скрипты",
-		"description": "Link to get more scripts."
-	},
 	"sideMenuInstalled": {
 		"message": "Установленные скрипты",
 		"description": "Side menu: Installed scripts"
@@ -111,6 +107,10 @@
 		"message": "Проверить обновления скриптов",
 		"description": "Check all scripts for updates."
 	},
+	"anchorGetMoreScripts": {
+		"message": "Скачать скрипты",
+		"description": "Link to get more scripts."
+	},
 	"msgLoading": {
 		"message": "Загрузка...",
 		"description": "Message shown in the options page before script list is loaded."
@@ -167,9 +167,9 @@
 		"message": "About Violentmonkey",
 		"description": "Label shown on top of the about page."
 	},
-	"labelSupportPage": {
-		"message": "Support page: ",
-		"description": "Label of support page."
+	"labelRelated": {
+		"message": "Related links: ",
+		"description": "Label of related links."
 	},
 	"anchorSupportPage": {
 		"message": "<a href=https://github.com/gera2ld/Violentmonkey/wiki target=_blank>Violentmonkey</a>",
@@ -179,6 +179,10 @@
 		"message": "Donate",
 		"description": "Label of link to donate page."
 	},
+	"labelFeedback": {
+		"message": "Feedback",
+		"description": "Label of link to feedback page."
+	},
 	"labelAuthor": {
 		"message": "Автор: ",
 		"description": "Label of author shown in the details of a script."
@@ -279,6 +283,10 @@
 		"message": "Новый скрипт",
 		"description": "Text as the name of a script when no @name is assigned."
 	},
+	"hintSupportPage": {
+		"message": "Support page",
+		"description": "Hint for support page."
+	},
 	"buttonDisable": {
 		"message": "Выключить",
 		"description": "Button to disable a script."
@@ -347,10 +355,18 @@
 		"message": "Найти для: ",
 		"description": "Label for search input in search box."
 	},
+	"labelSearchFor": {
+		"message": "Search for...",
+		"description": "Text shown as a place holder in the search box."
+	},
 	"labelReplace": {
 		"message": "Заменить на: ",
 		"description": "Label for replace input in search box."
 	},
+	"labelReplaceWith": {
+		"message": "Replace with...",
+		"description": "Text shown as a place holder in the replace box."
+	},
 	"buttonReplace": {
 		"message": "Заменять",
 		"description": "Button to replace the current match."
@@ -359,4 +375,4 @@
 		"message": "Заменить всё",
 		"description": "Button to replace all matches."
 	}
-}
+}

+ 24 - 8
_locales/zh/messages.json

@@ -87,10 +87,6 @@
 		"message": "正在加载脚本依赖...($1/$2)",
 		"description": "Message shown on confirm page when the requirements are being downloaded."
 	},
-	"anchorGetMoreScripts": {
-		"message": "获取更多脚本",
-		"description": "Link to get more scripts."
-	},
 	"sideMenuInstalled": {
 		"message": "已安装的脚本",
 		"description": "Side menu: Installed scripts"
@@ -111,6 +107,10 @@
 		"message": "全部更新",
 		"description": "Check all scripts for updates."
 	},
+	"anchorGetMoreScripts": {
+		"message": "获取更多脚本",
+		"description": "Link to get more scripts."
+	},
 	"msgLoading": {
 		"message": "加载中 ...",
 		"description": "Message shown in the options page before script list is loaded."
@@ -167,9 +167,9 @@
 		"message": "关于暴力猴",
 		"description": "Label shown on top of the about page."
 	},
-	"labelSupportPage": {
-		"message": "支持页面:",
-		"description": "Label of support page."
+	"labelRelated": {
+		"message": "相关链接:",
+		"description": "Label of related links."
 	},
 	"anchorSupportPage": {
 		"message": "<a href=https://github.com/gera2ld/Violentmonkey/wiki target=_blank>暴力猴</a>",
@@ -179,6 +179,10 @@
 		"message": "捐助",
 		"description": "Label of link to donate page."
 	},
+	"labelFeedback": {
+		"message": "反馈",
+		"description": "Label of link to feedback page."
+	},
 	"labelAuthor": {
 		"message": "作者:",
 		"description": "Label of author shown in the details of a script."
@@ -279,6 +283,10 @@
 		"message": "名字为空",
 		"description": "Text as the name of a script when no @name is assigned."
 	},
+	"hintSupportPage": {
+		"message": "支持页面",
+		"description": "Hint for support page."
+	},
 	"buttonDisable": {
 		"message": "禁用",
 		"description": "Button to disable a script."
@@ -347,10 +355,18 @@
 		"message": "查找:",
 		"description": "Label for search input in search box."
 	},
+	"labelSearchFor": {
+		"message": "查找...",
+		"description": "Text shown as a place holder in the search box."
+	},
 	"labelReplace": {
 		"message": "替换:",
 		"description": "Label for replace input in search box."
 	},
+	"labelReplaceWith": {
+		"message": "替换成...",
+		"description": "Text shown as a place holder in the replace box."
+	},
 	"buttonReplace": {
 		"message": "替换",
 		"description": "Button to replace the current match."
@@ -359,4 +375,4 @@
 		"message": "所有",
 		"description": "Button to replace all matches."
 	}
-}
+}

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
 	"name": "Violent monkey",
-	"version" : "2.1.6.1",
+	"version" : "2.1.6.2",
 	"manifest_version" : 2,
 	"description" : "__MSG_extDescription__",
 	"developer": {"name" : "Gerald", "url" : "http://geraldl.ml"},

+ 2 - 2
mylib/CodeMirror/search.js

@@ -42,8 +42,8 @@
 			dialog = wrap.appendChild(document.createElement("div"));
 			dialog.className='CodeMirror-dialog';
 		}
-		var text=_('labelSearch')+'<input class=CodeMirror-search placeholder="Search for"><button class=CodeMirror-findPrev>&lt;</button><button class=CodeMirror-findNext>&gt;</button><button class=CodeMirror-cancel>&times;</button>',closed=false,iS,iR;
-		if(rep) text+='<br>'+_('labelReplace')+'<input class=CodeMirror-replace placeholder="Replace with"><button class=CodeMirror-replaceNext>'+_('buttonReplace')+'</button><button class=CodeMirror-replaceAll>'+_('buttonReplaceAll')+'</button>';
+		var text=_('labelSearch')+'<input class=CodeMirror-search placeholder="'+_('labelSearchFor')+'"><button class=CodeMirror-findPrev>&lt;</button><button class=CodeMirror-findNext>&gt;</button><button class=CodeMirror-cancel>&times;</button>',closed=false,iS,iR;
+		if(rep) text+='<br>'+_('labelReplace')+'<input class=CodeMirror-replace placeholder="'+_('labelReplaceWith')+'"><button class=CodeMirror-replaceNext>'+_('buttonReplace')+'</button><button class=CodeMirror-replaceAll>'+_('buttonReplaceAll')+'</button>';
 		dialog.innerHTML=text;
 		iS=dialog.querySelector('.CodeMirror-search');
 		CodeMirror.on(dialog.querySelector('.CodeMirror-findNext'), "click", function(e) {findNext(cm);});

+ 2 - 0
options.css

@@ -24,6 +24,8 @@ fieldset.title{border:none;border-top:1px solid silver;margin:20px 0 0;}
 #sList>div.disabled .icon{opacity:0.5;}
 #sList>div.moving{background:lightgreen;border:1px outset gray;cursor:move;}
 #sList .name{margin-left:60px;margin-right:10px;font-weight:bold;font-size:120%;}
+#sList .support{margin-right:10px;width:16px;height:16px;border-radius:8px;background-color:green;color:white;text-align:center;display:inline-block;text-decoration:none;font-size:12px;}
+#sList .support.hide{display:none;}
 #sList .icon{top:1em;width:40px;height:40px;margin:2px;position:absolute;}
 #sList .version{margin-right:10px;}
 #sList .descrip{margin-left:60px;}

+ 1 - 1
options.html

@@ -66,7 +66,7 @@
 				<div id=tabAbout class=hide>
 					<h1 data-i18n=labelAbout></h1>
 					<p data-i18n=extDescription></p>
-					<p><label data-i18n=labelSupportPage></label><span data-i18n=anchorSupportPage></span> <a href=http://geraldl.ml/pay target=_blank data-i18n=labelDonate></a></p>
+					<p><label data-i18n=labelRelated></label><span data-i18n=anchorSupportPage></span> | <a href=http://geraldl.ml/pay target=_blank data-i18n=labelDonate></a> | <a href=https://github.com/gera2ld/Violentmonkey/issues target=_blank data-i18n=labelFeedback></a></p>
 					<p><label data-i18n=labelAuthor></label><span data-i18n=anchorAuthor></span></p>
 					<p><label data-i18n=labelTranslator></label><span data-i18n=anchorTranslator></span></p>
 				</div>

+ 5 - 0
options.js

@@ -33,6 +33,10 @@ function modifyItem(r){
 	a=d.querySelector('.name');
 	getName(a,n.custom.name||n.meta.name);
 	if(o=n.custom.homepageURL||n.meta.homepageURL||n.meta.homepage) a.href=o;	// compatible with @homepage
+	if(o=n.meta.supportURL) {
+		a=d.querySelector('.support');a.classList.remove('hide');
+		a.href=o;a.title=_('hintSupportPage');
+	}
 	getAuthor(d.querySelector('.author'),n.meta.author||'');
 	a=d.querySelector('.descrip');
 	getName(a,n.meta.description||'','&nbsp;');
@@ -44,6 +48,7 @@ function loadItem(o,r){
 	var d=o.div,n=o.obj;if(!r) r={id:n.id};
 	d.innerHTML='<img class=icon>'
 	+'<a class="name ellipsis" target=_blank></a>'
+	+'<a class="support hide" target=_blank>?</a>'
 	+'<span class=version>'+(n.meta.version?'v'+n.meta.version:'')+'</span>'
 	+'<span class=author></span>'
 	+'<div class=panelT>'