tianbar 0.4.0.1 → 0.4.1.0
raw patch · 4 files changed
+10/−29 lines, 4 filesdep ~webkitPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: webkit
API changes (from Hackage documentation)
Files
- README.md +2/−5
- scripts/location_shim.js +0/−21
- src/System/Tianbar/WebKit.hs +6/−0
- tianbar.cabal +2/−3
README.md view
@@ -40,9 +40,8 @@ ### Weather -Displays the weather at current location through-[OpenWeatherMap][openweathermap]. HTML geolocation API is required to determine-the current location, see [Quirks](#quirks) below.+Displays the weather at current location (determined via HTML geolocation API)+through [OpenWeatherMap][openweathermap]. ### XMonad @@ -56,8 +55,6 @@ makes it easier to interact with various Web services. You can also make requests to the local files, for example, to extract CPU activity statistics from `/proc/stat`.-* HTML5 geolocation API does not work. A shim, which uses- [freegeoip.net][freegeoip], is provided instead. * Interaction with the displayed Web page is limited. For example, text fields are not active if there are other windows on the screen.
− scripts/location_shim.js
@@ -1,21 +0,0 @@-/*- * Basic HTML5 geolocation shim.- *- * Requires 'jquery' to be available through RequireJS.- */-define(['jquery'], function ($) {- "use strict";- var my_geolocation;-- navigator.geolocation = {};- navigator.geolocation.getCurrentPosition = function (cb) {- if (my_geolocation) {- cb(my_geolocation);- } else {- $.getJSON('http://freegeoip.net/json/').success(function (loc) {- my_geolocation = { coords: loc };- cb(my_geolocation);- });- }- };-});
src/System/Tianbar/WebKit.hs view
@@ -7,6 +7,7 @@ import Control.Monad.Trans.Maybe import Graphics.UI.Gtk hiding (disconnect, Signal, Variant)+import Graphics.UI.Gtk.WebKit.GeolocationPolicyDecision import Graphics.UI.Gtk.WebKit.NetworkRequest import Graphics.UI.Gtk.WebKit.WebSettings import Graphics.UI.Gtk.WebKit.WebView@@ -29,6 +30,11 @@ wsettings <- webViewGetWebSettings wk set wsettings [webSettingsEnableUniversalAccessFromFileUris := True] webViewSetWebSettings wk wsettings++ -- Enable geolocation+ _ <- on wk geolocationPolicyDecisionRequested $ \_ decision -> do+ geolocationPolicyAllow decision+ return True -- Initialize plugins, and re-initialize on reloads server <- startServer (callbacks wk) >>= newMVar
tianbar.cabal view
@@ -1,5 +1,5 @@ name: tianbar-version: 0.4.0.1+version: 0.4.1.0 synopsis: A desktop bar based on WebKit description: A desktop bar using WebKit for rendering as much as possible.@@ -13,7 +13,6 @@ build-type: Simple cabal-version: >=1.10 data-files: README.md- , scripts/location_shim.js , scripts/dbus.js , scripts/power.js , scripts/socket.js@@ -39,7 +38,7 @@ , split ==0.2.* , text ==0.11.* , transformers ==0.3.*- , webkit ==0.12.*+ , webkit >=0.12.6.1 && <0.13 , xdg-basedir ==0.2.* pkgconfig-depends: gtk+-2.0 hs-source-dirs: src