浏览代码

Merge branch 'master' of [email protected]:gera2ld/Violentmonkey.git into dev

Gerald 11 年之前
父节点
当前提交
6f751e78ef
共有 10 个文件被更改,包括 7 次插入101 次删除
  1. 0 16
      _locales/cs/messages.json
  2. 0 16
      _locales/en/messages.json
  3. 0 16
      _locales/pl/messages.json
  4. 0 16
      _locales/ru/messages.json
  5. 0 16
      _locales/zh/messages.json
  6. 0 1
      background.js
  7. 0 7
      options.html
  8. 1 5
      options.js
  9. 2 2
      popup.css
  10. 4 6
      popup.js

+ 0 - 16
_locales/cs/messages.json

@@ -23,10 +23,6 @@
 		"description": "Message shown when a script is installed.",
 		"message": "Skript nainstalován."
 	},
-	"defaultSearch": {
-		"description": "URL for searching scripts, * stands for the keywords.",
-		"message": "http://www.google.com/search?q=*"
-	},
 	"msgUpdating": {
 		"description": "Message shown when a new version of script is being fetched.",
 		"message": "Aktualizuji..."
@@ -123,14 +119,6 @@
 		"description": "Option to allow automatically checking scripts for updates every 24 hours.",
 		"message": "Automaticky kontrolovat aktualizace skriptu každý den"
 	},
-	"labelSearchLink": {
-		"description": "Label of URL for searching scripts for a site.",
-		"message": "hledat URL: "
-	},
-	"buttonDefault": {
-		"description": "Button to replace search URL with the default one.",
-		"message": "Výchozí"
-	},
 	"labelDataImport": {
 		"description": "Section title of data import.",
 		"message": "Data Import"
@@ -311,10 +299,6 @@
 		"description": "Confirm message shown when there are unsaved script modifications.",
 		"message": "Modifikace není uložena! Klikni na OK pro zbavení se jí, nebo na zrušit pro zůstání zde."
 	},
-	"hintSearchLink": {
-		"description": "Hint for the search URL.",
-		"message": "Hledat URL musí být URL obsahující *. * má uplatnění pro klíčová slova generována Violentmonkey."
-	},
 	"msgImported": {
 		"description": "Message shown after import. There is an argument referring to the count of scripts imported.",
 		"message": "$1 vec(i) jsou importovány."

+ 0 - 16
_locales/en/messages.json

@@ -23,10 +23,6 @@
 		"description": "Message shown when a script is installed.",
 		"message": "Script installed."
 	},
-	"defaultSearch": {
-		"description": "URL for searching scripts, * stands for the keywords.",
-		"message": "http://www.google.com/search?q=*"
-	},
 	"msgUpdating": {
 		"description": "Message shown when a new version of script is being fetched.",
 		"message": "Updating..."
@@ -123,14 +119,6 @@
 		"description": "Option to allow automatically checking scripts for updates every 24 hours.",
 		"message": "Automatically check scripts for updates every day"
 	},
-	"labelSearchLink": {
-		"description": "Label of URL for searching scripts for a site.",
-		"message": "Search URL: "
-	},
-	"buttonDefault": {
-		"description": "Button to replace search URL with the default one.",
-		"message": "Default"
-	},
 	"labelDataImport": {
 		"description": "Section title of data import.",
 		"message": "Data Import"
@@ -311,10 +299,6 @@
 		"description": "Confirm message shown when there are unsaved script modifications.",
 		"message": "Modifications are not saved!\nClick OK to discard them or cancel to stay."
 	},
-	"hintSearchLink": {
-		"description": "Hint for the search URL.",
-		"message": "Search URL must be a URL containing an asterisk (*), which will be replaced with the keywords generated by Violentmonkey."
-	},
 	"msgImported": {
 		"description": "Message shown after import. There is an argument referring to the count of scripts imported.",
 		"message": "$1 item(s) are imported."

+ 0 - 16
_locales/pl/messages.json

@@ -23,10 +23,6 @@
 		"description": "Message shown when a script is installed.",
 		"message": "Skrypt zainstalowany"
 	},
-	"defaultSearch": {
-		"description": "URL for searching scripts, * stands for the keywords.",
-		"message": "http://www.google.com/search?q=*"
-	},
 	"msgUpdating": {
 		"description": "Message shown when a new version of script is being fetched.",
 		"message": "Aktualizowanie skryptu..."
@@ -123,14 +119,6 @@
 		"description": "Option to allow automatically checking scripts for updates every 24 hours.",
 		"message": "Automatycznie sprawdzaj aktualizacje dla skryptów każdego dnia"
 	},
-	"labelSearchLink": {
-		"description": "Label of URL for searching scripts for a site.",
-		"message": "Adres wyszukiwarki:"
-	},
-	"buttonDefault": {
-		"description": "Button to replace search URL with the default one.",
-		"message": "Domyślne"
-	},
 	"labelDataImport": {
 		"description": "Section title of data import.",
 		"message": "Import danych"
@@ -311,10 +299,6 @@
 		"description": "Confirm message shown when there are unsaved script modifications.",
 		"message": "Modyfikacje w tym skrypcie nie zostały zapisane! Kliknij \"OK\", aby wyjść lub \"Anuluj\", aby pozostać."
 	},
-	"hintSearchLink": {
-		"description": "Hint for the search URL.",
-		"message": "Adres wyszukiwarki musi zawierać *. *, co oznacza słowa kluczowe generowane przez Violentmonkey."
-	},
 	"msgImported": {
 		"description": "Message shown after import. There is an argument referring to the count of scripts imported.",
 		"message": "$1 pozycja/e/i zaimportowana/e/ych."

+ 0 - 16
_locales/ru/messages.json

@@ -23,10 +23,6 @@
 		"description": "Message shown when a script is installed.",
 		"message": "Скрипт установлен."
 	},
-	"defaultSearch": {
-		"description": "URL for searching scripts, * stands for the keywords.",
-		"message": "http://www.google.com/search?q=*"
-	},
 	"msgUpdating": {
 		"description": "Message shown when a new version of script is being fetched.",
 		"message": "Обновление..."
@@ -123,14 +119,6 @@
 		"description": "Option to allow automatically checking scripts for updates every 24 hours.",
 		"message": "Ежедневно проверять обновления скриптов"
 	},
-	"labelSearchLink": {
-		"description": "Label of URL for searching scripts for a site.",
-		"message": "Поисковый адрес: "
-	},
-	"buttonDefault": {
-		"description": "Button to replace search URL with the default one.",
-		"message": "По умолчанию"
-	},
 	"labelDataImport": {
 		"description": "Section title of data import.",
 		"message": "Data Import"
@@ -311,10 +299,6 @@
 		"description": "Confirm message shown when there are unsaved script modifications.",
 		"message": "Изменения не сохранены!\nНажмите OK, чтобы выйти или Отмена, чтобы вернуться."
 	},
-	"hintSearchLink": {
-		"description": "Hint for the search URL.",
-		"message": "Поисковый адрес должен включать *, где * - ключевые слова генерируемые Violentmonkey"
-	},
 	"msgImported": {
 		"description": "Message shown after import. There is an argument referring to the count of scripts imported.",
 		"message": "$1 скрипт(ов) импортировано."

+ 0 - 16
_locales/zh/messages.json

@@ -23,10 +23,6 @@
 		"description": "Message shown when a script is installed.",
 		"message": "脚本已安装。"
 	},
-	"defaultSearch": {
-		"description": "URL for searching scripts, * stands for the keywords.",
-		"message": "http://www.baidu.com/s?wd=*"
-	},
 	"msgUpdating": {
 		"description": "Message shown when a new version of script is being fetched.",
 		"message": "正在更新..."
@@ -123,14 +119,6 @@
 		"description": "Option to allow automatically checking scripts for updates every 24 hours.",
 		"message": "每天自动更新脚本"
 	},
-	"labelSearchLink": {
-		"description": "Label of URL for searching scripts for a site.",
-		"message": "搜索网址:"
-	},
-	"buttonDefault": {
-		"description": "Button to replace search URL with the default one.",
-		"message": "默认"
-	},
 	"labelDataImport": {
 		"description": "Section title of data import.",
 		"message": "数据导入"
@@ -311,10 +299,6 @@
 		"description": "Confirm message shown when there are unsaved script modifications.",
 		"message": "修改尚未保存!\n点击确定放弃修改或点击取消停留此页面。"
 	},
-	"hintSearchLink": {
-		"description": "Hint for the search URL.",
-		"message": "搜索网址必须包含一个星号(*),将替换为由<暴力猴>生成的关键字。"
-	},
 	"msgImported": {
 		"description": "Message shown after import. There is an argument referring to the count of scripts imported.",
 		"message": "已导入$1个脚本。"

+ 0 - 1
background.js

@@ -424,7 +424,6 @@ function initSettings(){
 	init('lastUpdate',0);
 	init('withData',true);
 	init('closeAfterInstall',false);
-	init('search',_('defaultSearch'));
 	init('dataVer',0);
 }
 function updateMeta(d,src,callback) {

+ 0 - 7
options.html

@@ -42,13 +42,6 @@
 				<div id=tabSettings class=hide>
 					<h1 data-i18n=labelSettings></h1>
 					<div><label><input type=checkbox id=cUpdate><span data-i18n=labelAutoUpdate></span></label></div>
-					<table>
-						<tr>
-							<td><span data-i18n=labelSearchLink></span></td>
-							<td class=expand><input type=text id=tSearch></td>
-							<td><button id=bDefSearch data-i18n=buttonDefault></button></td>
-						</tr>
-					</table>
 					<fieldset class=title>
 						<legend data-i18n=labelDataImport></legend>
 						<button id=bImport data-i18n=buttonImportData></button><input type=file class=hide id=iImport>

+ 1 - 5
options.js

@@ -167,11 +167,8 @@ function confirmCancel(dirty){
 }
 
 // Advanced
-var H=$('#iImport'),S=$('#tSearch'),V=$('#bVacuum');
+var H=$('#iImport'),V=$('#bVacuum');
 $('#cUpdate').onchange=function(){chrome.runtime.sendMessage({cmd:'AutoUpdate',data:this.checked});};
-S.title=_('hintSearchLink');
-S.onchange=function(){chrome.runtime.sendMessage({cmd:'SetOption',data:{key:'search',value:S.value}});};
-$('#bDefSearch').onclick=function(){S.value=_('defaultSearch');S.onchange();};
 H.onchange=function(e){
 	zip.createReader(new zip.BlobReader(e.target.files[0]),function(r){
 		r.getEntries(function(e){
@@ -398,7 +395,6 @@ function loadOptions(o){
 		ids.push(i.id);addItem(map[i.id]={obj:i});
 	});
 	$('#cUpdate').checked=o.settings.autoUpdate;
-	S.value=o.settings.search;
 	xD.checked=o.settings.withData;
 	switchTab();
 }

+ 2 - 2
popup.css

@@ -5,5 +5,5 @@ html,body{height:auto;background:inherit;}
 .menu>div.disabled{color:gray;}
 .menu>div.disabled:hover{color:silver;}
 .menu>div span{display:inline-block;width:20px;}
-.menu>hr{border:none;border-top:1px dashed gray;}
-.expand>td{border-top:1px dashed gray;}
+.menu>hr{border:none;border-top:1px solid silver;}
+.expand>td{border-top:1px solid silver;}

+ 4 - 6
popup.js

@@ -55,7 +55,7 @@ function initMenu(){
 			});
 		}
   });
-  /*if(/^https?:\/\//i.test(tab.url)) {
+  if(/^https?:\/\//i.test(tab.url)) {
 		var d=addItem(_('menuFindScripts'), {
 			holder: pT,
 			symbol: '➤',
@@ -64,14 +64,12 @@ function initMenu(){
 		loadItem(d,false);
 		chrome.runtime.sendMessage({cmd:'GetOption',data:'search'},function(o){
 			d.onclick=function(){
-				var q='site:userscripts.org+inurl:show+'+tab.url.replace(/^.*?:\/\/([^\/]*?)\.\w+\/.*$/, function(v,g){
-					return g.replace(/\.(com|..)$/, '').replace(/\./g, '+');
-				});
-				chrome.tabs.create({url:o.replace('*',q)});
+				var h=tab.url.match(/:\/\/(?:www\.)?([^\/]*)/);
+				chrome.tabs.create({url:'https://greasyfork.org/scripts/search?q='+h[1]});
 			};
 			loadItem(d,true);
 		});
-	}*/
+	}
   ia=addItem(_('menuScriptEnabled'), {
     holder: pT,
 		symbol: '✓',