Commit f083c3b

mo khan <mo@mokhan.ca>
2015-06-14 02:55:47
work on google drive integration.
1 parent 2b13b25
Changed files (5)
app
assets
views
config
environments
app/assets/javascripts/models/google.js.coffee
@@ -0,0 +1,10 @@
+class Stronglifters.GoogleDrive
+  constructor: () ->
+    console.log("GOOGLE DRIVE")
+
+  initialize: () ->
+    @drive = new gapi.drive.share.ShareClient('241601222378')
+    @drive.setItemIds(["<FILE_ID>"])
+
+  showSettingDialog: () ->
+    @drive.showSettingsDialog()
app/assets/javascripts/application.js
@@ -18,3 +18,8 @@
 //= require_tree .
 
 var Stronglifters = Stronglifters || {};
+
+//init = function() {
+  //s = new gapi.drive.share.ShareClient('<YOUR_APP_ID>');
+  //s.setItemIds(["<FILE_ID>"]);
+//};
app/views/layouts/application.html.erb
@@ -8,8 +8,11 @@
     <%= javascript_include_tag "vendor/modernizr" %>
     <%= javascript_include_tag "application" %>
     <%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>
+    <%= javascript_include_tag "//apis.google.com/js/api.js" %>
     <script type="text/javascript" charset="utf-8">
-      $(function(){ $(document).foundation(); });
+      $(function(){
+        $(document).foundation();
+      });
     </script>
     <%= csrf_meta_tags %>
   </head>
app/views/training_sessions/index.html.erb
@@ -25,3 +25,12 @@
     </div>
   </div>
 </div>
+
+<script type="text/javascript" charset="utf-8">
+  $(function(){
+    window.onload = function() {
+      var driver = new Stronglifters.GoogleDrive();
+      gapi.load('drive-share', driver.initialize);
+    };
+  });
+</script>
config/environments/development.rb
@@ -27,6 +27,7 @@ Rails.application.configure do
   # This option may cause significant delays in view rendering with a large
   # number of complex assets.
   config.assets.debug = false
+  config.assets.compress = false
 
   # Asset digests allow you to set far-future HTTP expiration dates on all assets,
   # yet still be able to expire them through the digest params.