homesteading_assets 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eda1e122128b4604b0c25ecfb7d85e82276ce1d1
|
4
|
+
data.tar.gz: 88a01d6739c5ce6b4d3492c914d3cabd0afe1df3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c03a3563238e096562743884d44d24d1dfd7595b9b77541039840b3c59f28a8d85419e3f814dcb8fd5a3391e7c3b63800adc48f413526c927fb469d5fb4a122
|
7
|
+
data.tar.gz: e4ad45e1f80043352079f567fd04544b940523ad310284f72de5a0c85ecd5259481b0218cf6ec51c3e2d3da3fe7e472ff07db31091c0fcac28e9f09f52ffe27b
|
@@ -2,46 +2,54 @@
|
|
2
2
|
//= require homesteading_assets/vendor/jquery
|
3
3
|
//= require jquery_ujs
|
4
4
|
//= require homesteading_assets/vendor/jquery.simplyCountable
|
5
|
+
//= require write-post
|
5
6
|
|
6
7
|
// for p-location geo fields
|
7
8
|
// TODO: extract into plugin and out of global namespace
|
8
|
-
function
|
9
|
-
|
10
|
-
|
9
|
+
(function($) {
|
10
|
+
function withLocation(callback) {
|
11
|
+
if (Modernizr.geolocation) {
|
12
|
+
navigator.geolocation.getCurrentPosition(callback);
|
13
|
+
}
|
11
14
|
}
|
12
|
-
}
|
13
15
|
|
14
|
-
// TODO: extract into plugin and out of global namespace
|
15
|
-
function populateGeoFields(position) {
|
16
|
-
|
17
|
-
var longitude = position.coords.longitude;
|
18
|
-
var altitude = position.coords.altitude;
|
16
|
+
// TODO: extract into plugin and out of global namespace
|
17
|
+
function populateGeoFields(position) {
|
18
|
+
var latitude, longitude, altitude, $pLocation;
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
}
|
20
|
+
latitude = position.coords.latitude;
|
21
|
+
longitude = position.coords.longitude;
|
22
|
+
altitude = position.coords.altitude;
|
24
23
|
|
24
|
+
$pLocation = $(".new .p-location");
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
|
-
$(function() {
|
40
|
-
// prints something like 2009-09-28T19:03:12Z
|
41
|
-
$(".new .dt-published").val(ISODateString(new Date()))
|
42
|
-
|
43
|
-
// ask user to access their location
|
44
|
-
// populate lat/lon/alt fields
|
26
|
+
$pLocation.find(".p-latitude" ).val(latitude);
|
27
|
+
$pLocation.find(".p-longitude").val(longitude);
|
28
|
+
$pLocation.find(".p-altitude" ).val(altitude);
|
29
|
+
}
|
30
|
+
|
31
|
+
function pad(n) {
|
32
|
+
return n < 10 ? "0" + n : n;
|
33
|
+
};
|
34
|
+
|
35
|
+
// for dt-published datetime field
|
45
36
|
// TODO: extract into plugin and out of global namespace
|
46
|
-
|
47
|
-
|
37
|
+
function ISODateString(d){
|
38
|
+
return d.getUTCFullYear()+"-"
|
39
|
+
+ pad(d.getUTCMonth()+1)+"-"
|
40
|
+
+ pad(d.getUTCDate())+"T"
|
41
|
+
+ pad(d.getUTCHours())+":"
|
42
|
+
+ pad(d.getUTCMinutes())+":"
|
43
|
+
+ pad(d.getUTCSeconds())+"-07:00";
|
44
|
+
}
|
45
|
+
|
46
|
+
$(function() {
|
47
|
+
// prints something like 2009-09-28T19:03:12Z
|
48
|
+
$(".new .dt-published").val(ISODateString(new Date()));
|
49
|
+
|
50
|
+
// ask user to access their location
|
51
|
+
// populate lat/lon/alt fields
|
52
|
+
// TODO: extract into plugin and out of global namespace
|
53
|
+
withLocation(populateGeoFields);
|
54
|
+
});
|
55
|
+
})(window.jQuery);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: homesteading_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Becker
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|