Просмотр исходного кода

show fallback values for custom meta data

Signed-off-by: Gerald <[email protected]>
Gerald 11 лет назад
Родитель
Сommit
35f9e3bc3d

+ 4 - 0
_locales/cs/messages.json

@@ -327,6 +327,10 @@
 		"description": "Hint for vacuuming data.",
 		"message": "Zbavit se nadbytečného a zkusit znovu načíst chybějící zdroje v cache."
 	},
+	"Use @downloadURL": {
+		"description": "Shown as a place holder for @updateURL when it is not assigned",
+		"message": "Use @downloadURL"
+	},
 	"buttonVacuumed": {
 		"description": "Message shown when data is vacuumed.",
 		"message": "Data vyprázdněna"

+ 4 - 0
_locales/en/messages.json

@@ -327,6 +327,10 @@
 		"description": "Hint for vacuuming data.",
 		"message": "Discard the redundancy and try to reload the missing resources in cache."
 	},
+	"Use @downloadURL": {
+		"description": "Shown as a place holder for @updateURL when it is not assigned",
+		"message": "Use @downloadURL"
+	},
 	"buttonVacuumed": {
 		"description": "Message shown when data is vacuumed.",
 		"message": "Data vacuumed"

+ 5 - 1
_locales/pl/messages.json

@@ -113,7 +113,7 @@
 	},
 	"msgLoading": {
 		"description": "Message shown in the options page before script list is loaded.",
-		"message": "Wczytywanie..."
+		"message": "Wczytywanie ..."
 	},
 	"labelSettings": {
 		"description": "Label shown on the top of settings page",
@@ -327,6 +327,10 @@
 		"description": "Hint for vacuuming data.",
 		"message": "Usuń nadmiarowość i spróbuj przeładować brakujące dane w pamięci podręcznej."
 	},
+	"Use @downloadURL": {
+		"description": "Shown as a place holder for @updateURL when it is not assigned",
+		"message": "Use @downloadURL"
+	},
 	"buttonVacuumed": {
 		"description": "Message shown when data is vacuumed.",
 		"message": "Dane wyczyszczone"

+ 5 - 1
_locales/ru/messages.json

@@ -113,7 +113,7 @@
 	},
 	"msgLoading": {
 		"description": "Message shown in the options page before script list is loaded.",
-		"message": "Загрузка..."
+		"message": "Загрузка ..."
 	},
 	"labelSettings": {
 		"description": "Label shown on the top of settings page",
@@ -327,6 +327,10 @@
 		"description": "Hint for vacuuming data.",
 		"message": "Сбросить избыточность кэша и попробовать подгрузить недостающие ресурсы"
 	},
+	"Use @downloadURL": {
+		"description": "Shown as a place holder for @updateURL when it is not assigned",
+		"message": "Use @downloadURL"
+	},
 	"buttonVacuumed": {
 		"description": "Message shown when data is vacuumed.",
 		"message": "Сбросить кэш"

+ 5 - 1
_locales/zh/messages.json

@@ -173,7 +173,7 @@
 	},
 	"anchorSupportPage": {
 		"description": "Link to the support page of Violentmonkey.",
-		"message": "<a href=https://github.com/gera2ld/Violentmonkey/wiki target=_blank>暴力猴</a>"
+		"message": "<a href=http://geraldl.net/proj/vm-nex target=_blank>暴力猴</a>"
 	},
 	"labelDonate": {
 		"description": "Label of link to donate page.",
@@ -327,6 +327,10 @@
 		"description": "Hint for vacuuming data.",
 		"message": "丢弃多余的数据,并尝试重新获取缺失的资源。"
 	},
+	"Use @downloadURL": {
+		"description": "Shown as a place holder for @updateURL when it is not assigned",
+		"message": "使用@downloadURL"
+	},
 	"buttonVacuumed": {
 		"description": "Message shown when data is vacuumed.",
 		"message": "数据已整理"

+ 3 - 3
manifest.json

@@ -1,10 +1,10 @@
 {
 	"name": "Violent monkey",
-	"version" : "2.1.6.3",
+	"version" : "2.1.6.5",
 	"manifest_version" : 2,
 	"description" : "__MSG_extDescription__",
-	"developer": {"name" : "Gerald", "url" : "http://geraldl.ml"},
-	"homepage_url":"http://geraldl.ml/proj/vm?from=nex",
+	"developer": {"name" : "Gerald", "url" : "http://geraldl.net"},
+	"homepage_url":"http://geraldl.net/proj/vm?from=nex",
 	"icons" : {
 		"16":"images/icon16.png",
 		"48":"images/icon48.png",

+ 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=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=labelRelated></label><span data-i18n=anchorSupportPage></span> | <a href=http://geraldl.net/donate 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>

+ 15 - 1
options.js

@@ -306,11 +306,16 @@ function markClean(){
 function mReset(){
 	M.classList.add('hide');
 	sC.innerHTML='&laquo;';
-	var e=[],c=E.scr.custom;M.dirty=false;
+	var e=[],c=E.scr.custom,m=E.scr.meta;
+	M.dirty=false;
 	mN.value=c.name||'';
+	mN.placeholder=m.name||'';
 	mH.value=c.homepageURL||'';
+	mH.placeholder=m.homepageURL||'';
 	mU.value=c.updateURL||'';
+	mU.placeholder=m.updateURL||_('Use @downloadURL');
 	mD.value=c.downloadURL||'';
+	mD.placeholder=m.downloadURL||c.lastInstallURL||'';
 	switch(c['run-at']){
 		case 'document-start':mR.value='start';break;
 		case 'document-idle':mR.value='idle';break;
@@ -319,10 +324,13 @@ function mReset(){
 	}
 	cI.checked=c._include!=false;
 	mI.value=(c.include||e).join('\n');
+	mI.placeholder=m.include.join('\n');
 	cM.checked=c._match!=false;
 	mM.value=(c.match||e).join('\n');
+	mM.placeholder=m.match.join('\n');
 	cE.checked=c._exclude!=false;
 	mE.value=(c.exclude||e).join('\n');
+	mE.placeholder=m.exclude.join('\n');
 }
 function gotScript(o){
 	E.classList.remove('hide');
@@ -377,6 +385,12 @@ eS.onclick=eSave;
 eSC.onclick=function(){eSave();eClose();};
 E.close=$('#eClose').onclick=function(){if(confirmCancel(!eS.disabled)) eClose();};
 initEditor(function(o){T=o;},{save:eSave,exit:E.close,onchange:E.markDirty});
+// double click to fill with default value
+function mDefault(e){
+	e=e.target;
+	if(!e.value) e.value=e.placeholder;
+}
+[mN,mH,mU,mD,mI,mM,mE].forEach(function(i){i.ondblclick=mDefault;});
 
 // Load at last
 var ids=[],map={},cache;