diff --git a/FlashlightApp/EasySIMBL/Flashlight-Info.plist b/FlashlightApp/EasySIMBL/Flashlight-Info.plist index 88ff7505..b0864c22 100755 --- a/FlashlightApp/EasySIMBL/Flashlight-Info.plist +++ b/FlashlightApp/EasySIMBL/Flashlight-Info.plist @@ -32,11 +32,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.41 + 0.42 CFBundleSignature ???? CFBundleVersion - 7 + 8 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/SPOpenAPIResult.m b/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/SPOpenAPIResult.m index 8510ad61..83c79465 100644 --- a/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/SPOpenAPIResult.m +++ b/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/SPOpenAPIResult.m @@ -71,9 +71,12 @@ id __SS_SSOpenAPIResult_iconImage(SPResult *self, SEL cmd) { NSString *sourcePlugin = objc_getAssociatedObject(self, @selector(sourcePluginAssociatedObject)); NSString *iconPath = [[_SS_PluginRunner pathForPlugin:sourcePlugin] stringByAppendingPathComponent:@"icon.png"]; if (![[NSFileManager defaultManager] fileExistsAtPath:iconPath]) { - NSData *infoJsonData = [NSData dataWithContentsOfFile:[[_SS_PluginRunner pathForPlugin:sourcePlugin]] - if (appBundle.infoDictionary[@"IconPath"]) { - iconPath = appBundle.infoDictionary[@"IconPath"]; + NSData *infoJsonData = [NSData dataWithContentsOfFile:[[_SS_PluginRunner pathForPlugin:sourcePlugin] stringByAppendingPathComponent:@"info.json"]]; + if (infoJsonData) { + NSDictionary *info = [NSJSONSerialization JSONObjectWithData:infoJsonData options:0 error:nil]; + if (info[@"iconPath"]) { + iconPath = info[@"iconPath"]; + } } } return [[NSImage alloc] initByReferencingFile:iconPath]; diff --git a/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/_SS_InlineWebViewContainer.m b/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/_SS_InlineWebViewContainer.m index cef28f25..4eac83cf 100644 --- a/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/_SS_InlineWebViewContainer.m +++ b/FlashlightApp/SpotlightSIMBL/SpotlightSIMBL/_SS_InlineWebViewContainer.m @@ -72,6 +72,9 @@ - (void)setResult:(SPResult *)result { if ([json[@"webview_links_open_in_browser"] boolValue]) { self.linksOpenInBrowser = YES; } + if ([json[@"webview_transparent_background"] boolValue]) { + _webView.drawsBackground = NO; + } } else { for (NSView *v in self.subviews) { v.hidden = YES; @@ -83,7 +86,6 @@ - (void)ensureWebview { if (!_webView) { _webView = [WebView new]; [self addSubview:_webView positioned:NSWindowBelow relativeTo:_loader]; - // [_webView setCustomUserAgent:@"Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_4 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B350 Safari/8536.25"]; _webView.frameLoadDelegate = self; _webView.policyDelegate = self; _webView.frame = self.bounds; diff --git a/PluginDirectories/1/imdb.zip b/PluginDirectories/1/imdb.zip index 5548fc43..79ac18ff 100644 Binary files a/PluginDirectories/1/imdb.zip and b/PluginDirectories/1/imdb.zip differ diff --git a/PluginDirectories/1/weather.bundle/plugin.py b/PluginDirectories/1/weather.bundle/plugin.py index f65b79d6..cb8114f6 100755 --- a/PluginDirectories/1/weather.bundle/plugin.py +++ b/PluginDirectories/1/weather.bundle/plugin.py @@ -3,15 +3,20 @@ import sys, urllib, os import AppKit +def dark_mode(): + import Foundation + return Foundation.NSUserDefaults.standardUserDefaults().persistentDomainForName_(Foundation.NSGlobalDomain).objectForKey_("AppleInterfaceStyle") == "Dark" + def use_metric(): return AppKit.NSLocale.currentLocale().objectForKey_(AppKit.NSLocaleUsesMetricSystem) def results(parsed, original_query): location = parsed['location'] - html = open("weather.html").read().replace("", location).replace("", "metric" if use_metric() else "imperial") + html = open("weather.html").read().replace("", location).replace("", "metric" if use_metric() else "imperial").replace("", "dark" if dark_mode() else "light") return { "title": '"{0}" weather'.format(location), "html": html, + "webview_transparent_background": True, "run_args": location } diff --git a/PluginDirectories/1/weather.bundle/plugin.pyc b/PluginDirectories/1/weather.bundle/plugin.pyc index 0468f78f..b5e071db 100644 Binary files a/PluginDirectories/1/weather.bundle/plugin.pyc and b/PluginDirectories/1/weather.bundle/plugin.pyc differ diff --git a/PluginDirectories/1/weather.bundle/weather.html b/PluginDirectories/1/weather.bundle/weather.html index 1e84a4d2..1f495ad8 100644 --- a/PluginDirectories/1/weather.bundle/weather.html +++ b/PluginDirectories/1/weather.bundle/weather.html @@ -33,6 +33,7 @@ var locationName = ""; var units = ""; + var appearance = ""; function load() { var url = "http://api.openweathermap.org/data/2.5/forecast/daily?mode=json&cnt=4&units="+units+"&q=" + encodeURIComponent(locationName); @@ -52,7 +53,7 @@ function iconElementForWeatherCode(code, nighttime, size) { // CLEAR_DAY, CLEAR_NIGHT, PARTLY_CLOUDY, PARTLY_CLOUDY_NIGHT, CLOUDY, RAIN, SLEET - var skycons = new Skycons({color: "black"}); + var skycons = new Skycons({color: appearance=='dark' ? 'white' : 'black'}); var hundred = Math.floor(code / 100); var codes = [ Skycons.CLEAR_DAY, @@ -100,6 +101,9 @@ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial; line-height: 1.2; } + body.dark { + color: white; + } body > div { display: table; } @@ -131,15 +135,15 @@ margin: 5px; } .condition { - color: gray; + opacity: 0.6; } #location { font-size: small; - color: gray; + opacity: 0.6; } - +
diff --git a/PluginDirectories/1/weather.zip b/PluginDirectories/1/weather.zip index e1cbeb7c..2151e060 100644 Binary files a/PluginDirectories/1/weather.zip and b/PluginDirectories/1/weather.zip differ