cobot_client 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .rvmrc
data/README.md CHANGED
@@ -18,7 +18,40 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- Use the source, Luke.
21
+ ### Installing navigation links on Cobot:
22
+
23
+ You can install links to your app into the navigation on Cobot. When users click the link an iframe pointing to the given `iframe_url` will be shown.
24
+
25
+ CobotClient::NavigationLinkService.new().install_links [
26
+ CobotClient::NavigationLink.new(section: 'admin/manage', label: 'My App', iframe_url: 'http://example.com')]
27
+
28
+ ### Setting up automatic iframe resizing
29
+
30
+ When you install your app on Cobot you have to add the following to make sure the iframe on Cobot automatically gets resized according to the height of your page.
31
+
32
+ This only works for Ruby on Rails >= 3.2. If you are using anything else please take a look at the files involved and set it up manually.
33
+
34
+ Add jQuery to your app.
35
+
36
+ Add this lines to your layout, before the closing `</body>` tag:
37
+
38
+ <%= render 'cobot_client/resize_script' %>
39
+
40
+ Add this to your application.js:
41
+
42
+ //= require cobot_client/easyxdm
43
+
44
+ Add the following code to your application controller:
45
+
46
+ include CobotClient::XdmHelper
47
+
48
+ ### Generating URLs to the Cobot API
49
+
50
+ There is a module `CobotClient::UrlHelper`. After you include it you can call `cobot_url`. Examples:
51
+
52
+ cobot_url('co-up') # => 'https://co-up.cobot.me/'
53
+ cobot_url('co-up', '/api/user') # => 'https://co-up.cobot.me/api/user'
54
+ cobot_url('co-up', '/api/user', params: {x: 'y'}) # => 'https://co-up.cobot.me/api/user?x=y'
22
55
 
23
56
  ## Contributing
24
57