bhf 0.5.10 → 0.5.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a87aaf5d94cb54bc7759cb669df3e0491f223e9
4
- data.tar.gz: 7433440f4026cd0498649dd34c23d8369cf3b701
3
+ metadata.gz: 44d97d2f89b28b90d9ee8628e8d8ca973f1bd4f3
4
+ data.tar.gz: cf46ad7abfecb44eabb043e162f71e573a407582
5
5
  SHA512:
6
- metadata.gz: 86f0220165ec5b52e6413047aaa83bac1df6f9f630052d3b89b9254155b8c6a8046ba3a2a7223ddee337315145c692fbe1ecc2db0fe24684a6a3874551a2eecc
7
- data.tar.gz: fe95249740d4d57271d61547aebeec8d21a807a21e695ef3b0c3107c873cc7264faee3a50fa6f921670d5aa1d55e603c643e630d66f396ce7f04374873efcc00
6
+ metadata.gz: c0745fb59e87b4d9535a9c42c1f32012cf54b9a66ac222ad594396d94cee2b6201f382138503ac77f85de0d33467d363066b895cbd1d3b1f609dfd5c1060ba19
7
+ data.tar.gz: dac8cddf8498172feb5c4930a4202606743e54a3b28e3fabf0a90d79b9ce5db071437ea1d3d82f13094ef442d1da4ddb310e4086f5254348a1f0dc7435bf8c6b
@@ -1,4 +1,3 @@
1
1
  = node f, field do
2
2
  = f.hidden_field :lat, :'data-default-lat' => 42.6259285, class: 'map_data_lat'
3
3
  = f.hidden_field :lng, :'data-default-lng' => -70.6519888, class: 'map_data_lng'
4
- = javascript_include_tag 'http://maps.googleapis.com/maps/api/js?sensor=false'
@@ -6,7 +6,7 @@
6
6
  %link{href: '/favicon.ico', rel: 'icon', type: 'image/x-icon'}
7
7
  - (['bhf/application'] + Bhf::Engine.config.css.to_a).each do |css|
8
8
  = stylesheet_link_tag css
9
- = javascript_include_tag 'bhf/application'
9
+ = javascript_include_tag 'bhf/application', {:'data-turbolinks-eval' => false}
10
10
 
11
11
  %body
12
12
  %header
@@ -6,13 +6,24 @@ var Setlatlng = new Class({
6
6
  },
7
7
 
8
8
  initialize: function(elem){
9
+ if (window.google) {
10
+ this.setup(elem);
11
+ }
12
+ else {
13
+ Setlatlng.GMapsCallback = function(){
14
+ this.setup(elem);
15
+ }.bind(this);
16
+ Asset.javascript('http://maps.googleapis.com/maps/api/js?sensor=false&callback=Setlatlng.GMapsCallback');
17
+ }
18
+ },
19
+
20
+ setup: function(elem){
9
21
  var latElem = elem;
10
22
  var lngElem = elem.getNext('.map_data_lng');
11
23
  var setValues = function(lat, lng){
12
24
  latElem.value = lat;
13
25
  lngElem.value = lng;
14
26
  };
15
-
16
27
  var center = new google.maps.LatLng(
17
28
  latElem.value ? latElem.value : latElem.get('data-default-lat'),
18
29
  lngElem.value ? lngElem.value : latElem.get('data-default-lng')
@@ -62,4 +73,5 @@ var Setlatlng = new Class({
62
73
  setValues(mPos.lat(), mPos.lng());
63
74
  });
64
75
  }
65
- });
76
+ });
77
+
@@ -1,6 +1,6 @@
1
1
  // MooTools: the javascript framework.
2
- // Load this file's selection again by visiting: http://mootools.net/more/c278dccc6c5a065496983e2e621825a4
3
- // Or build this file again with packager using: packager build More/Date More/String.Extras More/Sortables More/IframeShim More/Locale More/Locale.en-US.Date More/Locale.de-DE.Date
2
+ // Load this file's selection again by visiting: http://mootools.net/more/335fff3ee615958016e5569b21c1d4cf
3
+ // Or build this file again with packager using: packager build More/Date More/String.Extras More/Sortables More/Assets More/IframeShim More/Locale More/Locale.en-US.Date More/Locale.de-DE.Date
4
4
  /*
5
5
  ---
6
6
 
@@ -1716,6 +1716,139 @@ var Sortables = new Class({
1716
1716
  });
1717
1717
 
1718
1718
 
1719
+ /*
1720
+ ---
1721
+
1722
+ script: Assets.js
1723
+
1724
+ name: Assets
1725
+
1726
+ description: Provides methods to dynamically load JavaScript, CSS, and Image files into the document.
1727
+
1728
+ license: MIT-style license
1729
+
1730
+ authors:
1731
+ - Valerio Proietti
1732
+
1733
+ requires:
1734
+ - Core/Element.Event
1735
+ - /MooTools.More
1736
+
1737
+ provides: [Assets]
1738
+
1739
+ ...
1740
+ */
1741
+
1742
+ var Asset = {
1743
+
1744
+ javascript: function(source, properties){
1745
+ if (!properties) properties = {};
1746
+
1747
+ var script = new Element('script', {src: source, type: 'text/javascript'}),
1748
+ doc = properties.document || document,
1749
+ load = properties.onload || properties.onLoad;
1750
+
1751
+ delete properties.onload;
1752
+ delete properties.onLoad;
1753
+ delete properties.document;
1754
+
1755
+ if (load){
1756
+ if (typeof script.onreadystatechange != 'undefined'){
1757
+ script.addEvent('readystatechange', function(){
1758
+ if (['loaded', 'complete'].contains(this.readyState)) load.call(this);
1759
+ });
1760
+ } else {
1761
+ script.addEvent('load', load);
1762
+ }
1763
+ }
1764
+
1765
+ return script.set(properties).inject(doc.head);
1766
+ },
1767
+
1768
+ css: function(source, properties){
1769
+ if (!properties) properties = {};
1770
+
1771
+ var link = new Element('link', {
1772
+ rel: 'stylesheet',
1773
+ media: 'screen',
1774
+ type: 'text/css',
1775
+ href: source
1776
+ });
1777
+
1778
+ var load = properties.onload || properties.onLoad,
1779
+ doc = properties.document || document;
1780
+
1781
+ delete properties.onload;
1782
+ delete properties.onLoad;
1783
+ delete properties.document;
1784
+
1785
+ if (load) link.addEvent('load', load);
1786
+ return link.set(properties).inject(doc.head);
1787
+ },
1788
+
1789
+ image: function(source, properties){
1790
+ if (!properties) properties = {};
1791
+
1792
+ var image = new Image(),
1793
+ element = document.id(image) || new Element('img');
1794
+
1795
+ ['load', 'abort', 'error'].each(function(name){
1796
+ var type = 'on' + name,
1797
+ cap = 'on' + name.capitalize(),
1798
+ event = properties[type] || properties[cap] || function(){};
1799
+
1800
+ delete properties[cap];
1801
+ delete properties[type];
1802
+
1803
+ image[type] = function(){
1804
+ if (!image) return;
1805
+ if (!element.parentNode){
1806
+ element.width = image.width;
1807
+ element.height = image.height;
1808
+ }
1809
+ image = image.onload = image.onabort = image.onerror = null;
1810
+ event.delay(1, element, element);
1811
+ element.fireEvent(name, element, 1);
1812
+ };
1813
+ });
1814
+
1815
+ image.src = element.src = source;
1816
+ if (image && image.complete) image.onload.delay(1);
1817
+ return element.set(properties);
1818
+ },
1819
+
1820
+ images: function(sources, options){
1821
+ sources = Array.from(sources);
1822
+
1823
+ var fn = function(){},
1824
+ counter = 0;
1825
+
1826
+ options = Object.merge({
1827
+ onComplete: fn,
1828
+ onProgress: fn,
1829
+ onError: fn,
1830
+ properties: {}
1831
+ }, options);
1832
+
1833
+ return new Elements(sources.map(function(source, index){
1834
+ return Asset.image(source, Object.append(options.properties, {
1835
+ onload: function(){
1836
+ counter++;
1837
+ options.onProgress.call(this, counter, index, source);
1838
+ if (counter == sources.length) options.onComplete();
1839
+ },
1840
+ onerror: function(){
1841
+ counter++;
1842
+ options.onError.call(this, counter, index, source);
1843
+ if (counter == sources.length) options.onComplete();
1844
+ }
1845
+ }));
1846
+ }));
1847
+ }
1848
+
1849
+ };
1850
+
1851
+
1719
1852
  /*
1720
1853
  ---
1721
1854
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Pawlik
@@ -207,7 +207,8 @@ files:
207
207
  - vendor/assets/stylesheets/bhf/typo.css.scss
208
208
  - README.md
209
209
  homepage: http://github.com/antpaw/bhf
210
- licenses: []
210
+ licenses:
211
+ - MIT
211
212
  metadata: {}
212
213
  post_install_message:
213
214
  rdoc_options: []