diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/farbtastic/farbtastic.css | 32 | ||||
-rw-r--r-- | js/geometa.js | 24 | ||||
-rw-r--r-- | js/util.js | 30 |
3 files changed, 58 insertions, 28 deletions
diff --git a/js/farbtastic/farbtastic.css b/js/farbtastic/farbtastic.css new file mode 100644 index 000000000..a88e7b868 --- /dev/null +++ b/js/farbtastic/farbtastic.css @@ -0,0 +1,32 @@ +.farbtastic { + position: relative; +} +.farbtastic * { + position: absolute; + cursor: crosshair; +} +.farbtastic, .farbtastic .wheel { + width: 195px; + height: 195px; +} +.farbtastic .color, .farbtastic .overlay { + top: 47px; + left: 47px; + width: 101px; + height: 101px; +} +.farbtastic .wheel { + background: url(wheel.png) no-repeat; + width: 195px; + height: 195px; +} +.farbtastic .overlay { + background: url(mask.png) no-repeat; +} +.farbtastic .marker { + width: 17px; + height: 17px; + margin: -8px 0 0 -8px; + overflow: hidden; + background: url(marker.png) no-repeat; +} diff --git a/js/geometa.js b/js/geometa.js index 21deb1885..bba59b448 100644 --- a/js/geometa.js +++ b/js/geometa.js @@ -1,5 +1,5 @@ // A shim to implement the W3C Geolocation API Specification using Gears or the Ajax API -if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) (function(){ +if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) { (function(){ // -- BEGIN GEARS_INIT (function() { @@ -23,8 +23,7 @@ if (typeof navigator.geolocation == "undefined" || navigator.geolocation.shim ) } } catch (e) { // Safari - if ((typeof navigator.mimeTypes != 'undefined') - && navigator.mimeTypes["application/x-googlegears"]) { + if ((typeof navigator.mimeTypes != 'undefined') && navigator.mimeTypes["application/x-googlegears"]) { factory = document.createElement("object"); factory.style.display = "none"; factory.width = 0; @@ -64,8 +63,8 @@ var GearsGeoLocation = (function() { return function(position) { callback(position); self.lastPosition = position; - } - } + }; + }; // -- PUBLIC return { @@ -112,7 +111,7 @@ var AjaxGeoLocation = (function() { var queue = []; var addLocationQueue = function(callback) { queue.push(callback); - } + }; var runLocationQueue = function() { if (hasGoogleLoader()) { @@ -121,18 +120,18 @@ var AjaxGeoLocation = (function() { call(); } } - } + }; window['_google_loader_apiLoaded'] = function() { runLocationQueue(); - } + }; var hasGoogleLoader = function() { return (window['google'] && google['loader']); - } + }; var checkGoogleLoader = function(callback) { - if (hasGoogleLoader()) return true; + if (hasGoogleLoader()) { return true; } addLocationQueue(callback); @@ -155,7 +154,7 @@ var AjaxGeoLocation = (function() { var self = this; if (!checkGoogleLoader(function() { self.getCurrentPosition(successCallback, errorCallback, options); - })) return; + })) { return; } if (google.loader.ClientLocation) { var cl = google.loader.ClientLocation; @@ -168,7 +167,7 @@ var AjaxGeoLocation = (function() { accuracy: 43000, // same as Gears accuracy over wifi? altitudeAccuracy: null, heading: null, - speed: null, + speed: null }, // extra info that is outside of the bounds of the core API address: { @@ -215,3 +214,4 @@ var AjaxGeoLocation = (function() { navigator.geolocation = (window.google && google.gears) ? GearsGeoLocation() : AjaxGeoLocation(); })(); +} diff --git a/js/util.js b/js/util.js index 88016bd6d..aeec8d89d 100644 --- a/js/util.js +++ b/js/util.js @@ -509,7 +509,7 @@ var SN = { // StatusNet } if (typeof(location.name) == 'undefined') { - NLN_text = position.coords.latitude + ';' + position.coords.longitude; + NLN_text = data.lat + ';' + data.lon; } else { NLN_text = location.name; @@ -525,13 +525,13 @@ var SN = { // StatusNet $('#'+SN.C.S.NoticeDataGeo).attr('checked', true); var cookieValue = { - 'NLat': data.lat, - 'NLon': data.lon, - 'NLNS': lns, - 'NLID': lid, - 'NLN': NLN_text, - 'NLNU': location.url, - 'NDG': true + NLat: data.lat, + NLon: data.lon, + NLNS: lns, + NLID: lid, + NLN: NLN_text, + NLNU: location.url, + NDG: true }; $.cookie(SN.C.S.NoticeDataGeoCookie, JSON.stringify(cookieValue)); }); @@ -566,9 +566,9 @@ var SN = { // StatusNet $('#'+SN.C.S.NoticeLon).val(position.coords.longitude); var data = { - 'lat': position.coords.latitude, - 'lon': position.coords.longitude, - 'token': $('#token').val() + lat: position.coords.latitude, + lon: position.coords.longitude, + token: $('#token').val() }; getJSONgeocodeURL(geocodeURL, data); @@ -593,9 +593,9 @@ var SN = { // StatusNet else { if (NLat.length > 0 && NLon.length > 0) { var data = { - 'lat': NLat, - 'lon': NLon, - 'token': $('#token').val() + lat: NLat, + lon: NLon, + token: $('#token').val() }; getJSONgeocodeURL(geocodeURL, data); @@ -624,8 +624,6 @@ var SN = { // StatusNet else { removeNoticeDataGeo(); } - - $('#'+SN.C.S.NoticeDataText).focus(); }).change(); } }, |