diff --git a/Plugins/Wox.Plugin.WebSearch/Images/bing.png b/Plugins/Wox.Plugin.WebSearch/Images/bing.png new file mode 100644 index 0000000000..8e4ee8ea26 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/bing.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/duckduckgo.png b/Plugins/Wox.Plugin.WebSearch/Images/duckduckgo.png new file mode 100644 index 0000000000..d4f3608172 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/duckduckgo.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/facebook.png b/Plugins/Wox.Plugin.WebSearch/Images/facebook.png new file mode 100644 index 0000000000..75f0a543e6 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/facebook.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/gist.png b/Plugins/Wox.Plugin.WebSearch/Images/gist.png new file mode 100644 index 0000000000..a804cece0c Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/gist.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/github.png b/Plugins/Wox.Plugin.WebSearch/Images/github.png new file mode 100644 index 0000000000..54aa26b8ed Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/github.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/gmail.png b/Plugins/Wox.Plugin.WebSearch/Images/gmail.png new file mode 100644 index 0000000000..e00e3cd2d5 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/gmail.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/google_drive.png b/Plugins/Wox.Plugin.WebSearch/Images/google_drive.png new file mode 100644 index 0000000000..ce2346a316 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/google_drive.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/google_maps.png b/Plugins/Wox.Plugin.WebSearch/Images/google_maps.png new file mode 100644 index 0000000000..2413eec586 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/google_maps.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/google_translate.png b/Plugins/Wox.Plugin.WebSearch/Images/google_translate.png new file mode 100644 index 0000000000..63ff5c883d Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/google_translate.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/stackoverflow.png b/Plugins/Wox.Plugin.WebSearch/Images/stackoverflow.png new file mode 100644 index 0000000000..a31f6a96de Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/stackoverflow.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/twitter.png b/Plugins/Wox.Plugin.WebSearch/Images/twitter.png new file mode 100644 index 0000000000..3c7c61da32 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/twitter.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/wolframalpha.png b/Plugins/Wox.Plugin.WebSearch/Images/wolframalpha.png new file mode 100644 index 0000000000..c45021f0ed Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/wolframalpha.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/yahoo.png b/Plugins/Wox.Plugin.WebSearch/Images/yahoo.png new file mode 100644 index 0000000000..cf8453c9f8 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/yahoo.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/Images/youtube.png b/Plugins/Wox.Plugin.WebSearch/Images/youtube.png new file mode 100644 index 0000000000..e044efbef2 Binary files /dev/null and b/Plugins/Wox.Plugin.WebSearch/Images/youtube.png differ diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs index 68bd9e9c6f..73f3c4151a 100644 --- a/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs +++ b/Plugins/Wox.Plugin.WebSearch/WebSearchPlugin.cs @@ -79,10 +79,7 @@ namespace Wox.Plugin.WebSearch public void Init(PluginInitContext context) { - this.Context = context; - - if (WebSearchStorage.Instance.WebSearches == null) - WebSearchStorage.Instance.WebSearches = WebSearchStorage.Instance.LoadDefaultWebSearches(); + Context = context; } #region ISettingProvider Members diff --git a/Plugins/Wox.Plugin.WebSearch/WebSearchStorage.cs b/Plugins/Wox.Plugin.WebSearch/WebSearchStorage.cs index fec8f937a4..5a059a2385 100644 --- a/Plugins/Wox.Plugin.WebSearch/WebSearchStorage.cs +++ b/Plugins/Wox.Plugin.WebSearch/WebSearchStorage.cs @@ -6,7 +6,7 @@ using Wox.Infrastructure.Storage; namespace Wox.Plugin.WebSearch { - public class WebSearchStorage :JsonStrorage + public class WebSearchStorage : JsonStrorage { [JsonProperty] public List WebSearches { get; set; } @@ -26,49 +26,5 @@ namespace Wox.Plugin.WebSearch { get { return "setting"; } } - - protected override WebSearchStorage LoadDefault() - { - WebSearches = LoadDefaultWebSearches(); - return this; - } - - public List LoadDefaultWebSearches() - { - List webSearches = new List(); - - WebSearch googleWebSearch = new WebSearch() - { - Title = "Google", - ActionKeyword = "g", - IconPath = @"Images\google.png", - Url = "https://www.google.com/search?q={q}", - Enabled = true - }; - webSearches.Add(googleWebSearch); - - - WebSearch wikiWebSearch = new WebSearch() - { - Title = "Wikipedia", - ActionKeyword = "wiki", - IconPath = @"Images\wiki.png", - Url = "http://en.wikipedia.org/wiki/{q}", - Enabled = true - }; - webSearches.Add(wikiWebSearch); - - WebSearch findIcon = new WebSearch() - { - Title = "FindIcon", - ActionKeyword = "findicon", - IconPath = @"Images\pictures.png", - Url = "http://findicons.com/search/{q}", - Enabled = true - }; - webSearches.Add(findIcon); - - return webSearches; - } } } diff --git a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj index 667253e6af..44ccaff99c 100644 --- a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj +++ b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj @@ -79,6 +79,48 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + MSBuild:Compile Designer @@ -94,6 +136,9 @@ Designer PreserveNewest + + PreserveNewest + MSBuild:Compile Designer diff --git a/Plugins/Wox.Plugin.WebSearch/plugin.json b/Plugins/Wox.Plugin.WebSearch/plugin.json index 6b0182734e..751208bc75 100644 --- a/Plugins/Wox.Plugin.WebSearch/plugin.json +++ b/Plugins/Wox.Plugin.WebSearch/plugin.json @@ -1,12 +1,32 @@ { - "ID":"565B73353DBF4806919830B9202EE3BF", - "ActionKeywords": ["g", "wiki", "findicon"], - "Name":"Web Searches", - "Description":"Provide the web search ability", - "Author":"qianlifeng", - "Version":"1.0.0", - "Language":"csharp", - "Website":"http://www.getwox.com/plugin", - "ExecuteFileName":"Wox.Plugin.WebSearch.dll", - "IcoPath":"Images\\web_search.png" + "ID": "565B73353DBF4806919830B9202EE3BF", + "ActionKeywords": [ + "g", + "wiki", + "findicon", + "facebook", + "twitter", + "maps", + "translate", + "duckduckgo", + "github", + "gist", + "gmail", + "drive", + "wolframalpha", + "stackoverflow", + "lucky", + "image", + "youtube", + "bing", + "yahoo" + ], + "Name": "Web Searches", + "Description": "Provide the web search ability", + "Author": "qianlifeng", + "Version": "1.0.0", + "Language": "csharp", + "Website": "http://www.getwox.com/plugin", + "ExecuteFileName": "Wox.Plugin.WebSearch.dll", + "IcoPath": "Images\\web_search.png" } diff --git a/Plugins/Wox.Plugin.WebSearch/setting.json b/Plugins/Wox.Plugin.WebSearch/setting.json new file mode 100644 index 0000000000..c31d02ae67 --- /dev/null +++ b/Plugins/Wox.Plugin.WebSearch/setting.json @@ -0,0 +1,139 @@ +{ + "WebSearches": [ + { + "Title": "Google", + "ActionKeyword": "g", + "IconPath": "Images\\google.png", + "Url": "https://www.google.com/search?q={q}", + "Enabled": true + }, + { + "Title": "Wikipedia", + "ActionKeyword": "wiki", + "IconPath": "Images\\wiki.png", + "Url": "http://en.wikipedia.org/wiki/{q}", + "Enabled": true + }, + { + "Title": "FindIcon", + "ActionKeyword": "findicon", + "IconPath": "Images\\pictures.png", + "Url": "http://findicons.com/search/{q}", + "Enabled": true + }, + { + "Title": "Facebook", + "ActionKeyword": "facebook", + "IconPath": "Images\\facebook.png", + "Url": "http://www.facebook.com/search/?q={q}", + "Enabled": true + }, + { + "Title": "Twitter", + "ActionKeyword": "twitter", + "IconPath": "Images\\twitter.png", + "Url": "http://twitter.com/search?q={q}", + "Enabled": true + }, + { + "Title": "Google Maps", + "ActionKeyword": "maps", + "IconPath": "Images\\google_maps.png", + "Url": "http://maps.google.com/maps?q={q}", + "Enabled": true + }, + { + "Title": "Google Translate", + "ActionKeyword": "translate", + "IconPath": "Images\\google_translate.png", + "Url": "http://translate.google.com/#auto|en|{q}", + "Enabled": true + }, + { + "Title": "Duckduckgo", + "ActionKeyword": "duckduckgo", + "IconPath": "Images\\duckduckgo.png", + "Url": "https://duckduckgo.com/?q={q}", + "Enabled": true + }, + { + "Title": "Github", + "ActionKeyword": "github", + "IconPath": "Images\\github.png", + "Url": "https://github.com/search?q={q}", + "Enabled": true + }, + { + "Title": "Github Gist", + "ActionKeyword": "gist", + "IconPath": "Images\\gist.png", + "Url": "https://gist.github.com/search?q={q}", + "Enabled": true + }, + { + "Title": "Gmail", + "ActionKeyword": "gmail", + "IconPath": "Images\\gmail.png", + "Url": "https://mail.google.com/mail/ca/u/0/#apps/{q}", + "Enabled": true + }, + { + "Title": "Google Drive", + "ActionKeyword": "drive", + "IconPath": "Images\\google_drive.png", + "Url": "http://drive.google.com/?hl=en&tab=bo#search/{q}", + "Enabled": true + }, + { + "Title": "Wolframalpha", + "ActionKeyword": "wolframalpha", + "IconPath": "Images\\wolframalpha.png", + "Url": "http://www.wolframalpha.com/input/?i={q}", + "Enabled": true + }, + { + "Title": "Stackoverflow", + "ActionKeyword": "stackoverflow", + "IconPath": "Images\\stackoverflow.png", + "Url": "http://stackoverflow.com/search?q={q}", + "Enabled": true + }, + { + "Title": "I'm Feeling Lucky", + "ActionKeyword": "lucky", + "IconPath": "Images\\google.png", + "Url": "http://google.com/search?q={q}&btnI=I", + "Enabled": true + }, + { + "Title": "Google Image", + "ActionKeyword": "image", + "IconPath": "Images\\google.png", + "Url": "https://www.google.com/search?q={q}&tbm=isch", + "Enabled": true + }, + { + "Title": "Youtube", + "ActionKeyword": "youtube", + "IconPath": "Images\\youtube.png", + "Url": "http://www.youtube.com/results?search_query={q}", + "Enabled": true + }, + { + "Title": "Bing", + "ActionKeyword": "bing", + "IconPath": "Images\\bing.png", + "URL": "https://www.bing.com/search?q={q}", + "Enabled": true + }, + { + "Title": "Yahoo", + "ActionKeyword": "yahoo", + "IconPath": "Images\\yahoo.png", + "URL": "http://www.search.yahoo.com/search?p={q}", + "Enabled": true + } + ], + "EnableWebSearchSuggestion": false, + "WebSearchSuggestionSource": "Google" +} \ No newline at end of file diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index 08affe03dd..ff9276d5af 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -63,7 +63,6 @@ -