ende 0.0.1 → 0.1.1

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: 95b8f0102eaf6c3d5fdf84a364afa9f01495d633
4
- data.tar.gz: 44a73feca7b3353f4a51831292dc96b8f83d51dc
3
+ metadata.gz: 3f3c9e5c81b4337e75cb7e34649b8b09cbe84320
4
+ data.tar.gz: 2c71b4efa170053efeb27cfa96865441c29668dd
5
5
  SHA512:
6
- metadata.gz: 98cda4fb64e3911896acb8fdb3029c5a734a6f2ea7d99f174c439a292858596097b3d61fde980dfd93d89a799dc8f103392aa0f40063d9353d8829342b3b4dec
7
- data.tar.gz: 08ac320f4d91562324f8a70261859e749b212fa7f0a1be9d42a13e52dfbf9cc5a780349ad9a276722045abbc9c822212144a4dde6ed90a20f0473cc55aed889b
6
+ metadata.gz: 98e2a69da11d3ecf32f391f907edc403ea43aac200c3a12d36c9f1aa6e8d5df2bff5ab4ed637a64f6234c772904017c8863399ec72ae8ef0f13b9c6f5e076ad4
7
+ data.tar.gz: 0268cbac75df0d96394e45e56f2ca922eb022d60841ab0a19bace84748b9297e5db820c00824f5890760107f1faa91a9e2f74476cba956210c689792c8faee25
data/README.md CHANGED
@@ -1,29 +1,83 @@
1
- # Ende
2
1
 
3
- TODO: Write a gem description
2
+ endë
3
+ ====
4
4
 
5
- ## Installation
5
+ Summary
6
+ -------
7
+
8
+ Endë (core, middle)
9
+
10
+ A modular web application engine for rails. Using aurajs for architecture and indemma for resource management by default.
11
+
12
+ The goal is to provide seamlessly integration for web applications and various standard domains by providing default extensions and components for aura.
13
+
14
+ **This is project is in a really early stage being primarily focused on solving the current web application challenges faced within our company.
15
+ Also aurajs has not stable release yet. So expect big changes!**
16
+
17
+ Installation
18
+ ------------
6
19
 
7
20
  Add this line to your application's Gemfile:
8
21
 
9
- gem 'ende'
22
+ ```ruby
23
+ gem 'ende'
24
+ ```
25
+
26
+ Usage
27
+ -----
28
+
29
+ TODO: Write usage instructions
30
+
31
+ Components List
32
+ ---------------
33
+
34
+ ### Standard Exibitions
10
35
 
11
- And then execute:
36
+ _Detailed documentation is comming!_
12
37
 
13
- $ bundle
38
+ - Viewer
39
+ - List
40
+ - Authenticator
41
+ - Support
14
42
 
15
- Or install it yourself as:
43
+ <!---
44
+ Heitor do futuro não se esqueça de mencionar a integração do
45
+ component.io com o requirejs
46
+ -->
16
47
 
17
- $ gem install ende
48
+ ### Vendored integrations
18
49
 
19
- ## Usage
20
50
 
21
- TODO: Write usage instructions here
51
+ Extensions List
52
+ ---------------
22
53
 
23
- ## Contributing
54
+ - Session
55
+ - Devise
56
+ - Rivets
57
+ - Widget
58
+ - Lifecycleable
59
+ - Eventable
60
+ - Models
61
+ - Loader
62
+
63
+ Contributing
64
+ ------------
24
65
 
25
66
  1. Fork it
26
67
  2. Create your feature branch (`git checkout -b my-new-feature`)
27
68
  3. Commit your changes (`git commit -am 'Add some feature'`)
28
69
  4. Push to the branch (`git push origin my-new-feature`)
29
70
  5. Create new Pull Request
71
+
72
+
73
+ Credits
74
+ -------
75
+
76
+ Uses the awesome declarative component sugar for event-driven apps: [aurajs](http://aurajs.com)
77
+ Also usses a modular javascript framework: [component.io](http://component.io)
78
+
79
+
80
+
81
+
82
+ This project rocks and uses [WTFP-LICENSE](http://www.wtfpl.net)
83
+
data/ende.gemspec CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "ende"
8
8
  spec.version = Ende::VERSION
9
9
  spec.authors = ["Heitor Salazar"]
10
- spec.email = ["heitorsalazar@gmail.com"]
11
- spec.description = %q{A modular web application engine for rails. Using aurajs and indemma by default. the goal is to provideseamlessly integrstion with rails and popular rails engines, such as devise.}
12
- spec.summary = %q{Endë (core, middle) a web application engine for rails with aurajs.}
10
+ spec.email = ["heitor@indefini.do"]
11
+ spec.description = %q{A modular web application engine for rails. Using aurajs for architecture and indemma for resource management by default. The goal is to provide seamlessly integration for web applications and various standard domains by providing default extensions and components for aura.}
12
+ spec.summary = %q{Endë (core, middle) a web application engine for rails with aurajs.}
13
13
  spec.homepage = ""
14
14
  spec.license = "WTFPL"
15
15
 
@@ -49,6 +49,7 @@ define 'aura/extensions/devise', () ->
49
49
  sandbox.current_user = null
50
50
  mediator.emit 'user.unauthorized', @ unless session.restoring
51
51
  sandbox.signed_in ||= false
52
+
52
53
  .always ->
53
54
  mediator.emit 'session.restore.tried', @ if session.restoring
54
55
  session.restoring = false
@@ -60,10 +61,9 @@ define 'aura/extensions/devise', () ->
60
61
  # PUT /users/password(.:format) devise/passwords#updaet
61
62
  password =
62
63
  build: (user = {}) ->
63
- core.models.record.call
64
- resource: 'user'
65
- route : '/users/password'
66
- email : user.email
64
+
65
+ core.models.password
66
+ email: user.email
67
67
  password: user.password
68
68
 
69
69
  create: (user) ->
@@ -102,9 +102,29 @@ define 'aura/extensions/devise', () ->
102
102
 
103
103
  sandbox.session = session
104
104
 
105
+ define_resources: (model) ->
105
106
 
107
+ # TODO define user session as a record too!
108
+ # model
109
+ # resource: 'user'
110
+ # route : '/users/sessions'
111
+ # email : user.email
112
+ # password: user.password
113
+
114
+ model.call
115
+ resource:
116
+ scope : 'users'
117
+ name : 'password'
118
+ param_name: 'user'
119
+ singular : true
120
+
121
+ email: String
122
+
123
+ afterAppStart: (application) ->
124
+ @define_resources application.core.models
106
125
 
107
- afterAppStart: () ->
108
126
  # Restore session if not already
109
127
  # TODO Restore only when application is ready
110
128
  session.restore()
129
+
130
+
@@ -43,6 +43,7 @@ define 'aura/extensions/states', ['application/states'], (states) ->
43
43
 
44
44
  delete options.name
45
45
 
46
+ # TODO update aura and use native start method
46
47
  core.inject(widgets).fail flow.failed
47
48
 
48
49
  delete states[transition.to]
@@ -16,7 +16,15 @@ define 'aura/extensions/widget/lifecycleable', ->
16
16
  if $.type(suboptions) == 'object'
17
17
 
18
18
  for name, suboption of suboptions
19
- options["#{subwidget_name}#{@capitalize name}"] = suboption
19
+
20
+ if $.type(suboption) == 'object'
21
+
22
+ for subname, subsuboption of suboption
23
+ options["#{subwidget_name}#{@capitalize name}#{@capitalize subname}"] = subsuboption
24
+
25
+ else
26
+
27
+ options["#{subwidget_name}#{@capitalize name}"] = suboption
20
28
 
21
29
  # TODO delete options[subwidget_name]
22
30
 
@@ -0,0 +1,126 @@
1
+ define(function () {
2
+ // TODO bettter require
3
+ stampit = require('indefinido-indemma/vendor/stampit.js');
4
+
5
+ root = window || exports;
6
+
7
+ root.olark || (function (c) {
8
+
9
+ var f = window,
10
+ d = document,
11
+ l = f.location.protocol == "https:" ? "https:" : "http:",
12
+ z = c.name,
13
+ r = "load";
14
+
15
+ var nt = function () {
16
+ f[z] = function () {
17
+ (a.s = a.s || []).push(arguments)
18
+ };
19
+
20
+ var a = f[z]._ = {}, q = c.methods.length;
21
+
22
+ while (q--) {
23
+ (function (n) {
24
+ f[z][n] = function () {
25
+ f[z]("call", n, arguments)
26
+ }
27
+ })(c.methods[q])
28
+ }
29
+
30
+ a.l = c.loader;
31
+ a.i = nt;
32
+
33
+ a.p = {
34
+ 0: +new Date
35
+ };
36
+
37
+ a.P = function (u) {
38
+ a.p[u] = new Date - a.p[0]
39
+ };
40
+
41
+ function s() {
42
+ a.P(r);
43
+ f[z](r)
44
+ }
45
+
46
+ f.addEventListener ? f.addEventListener(r, s, false) : f.attachEvent("on" + r, s);
47
+
48
+ var ld = function () {
49
+ function p(hd) {
50
+ hd = "head";
51
+ return ["<", hd, "></", hd, "><", i, ' onl' + 'oad="var d=', g, ";d.getElementsByTagName('head')[0].", j, "(d.", h, "('script')).", k, "='", l, "//", a.l, "'", '"', "></", i, ">"].join("")
52
+ }
53
+
54
+ var i = "body",
55
+ m = d[i];
56
+
57
+ if (!m) {
58
+ return setTimeout(ld, 100)
59
+ }
60
+ a.P(1);
61
+
62
+ var j = "appendChild",
63
+ h = "createElement",
64
+ k = "src",
65
+ n = d[h]("div"),
66
+ v = n[j](d[h](z)),
67
+ b = d[h]("iframe"),
68
+ g = "document",
69
+ e = "domain",
70
+ o;
71
+
72
+ n.style.display = "none";
73
+ m.insertBefore(n, m.firstChild).id = z;
74
+ b.frameBorder = "0";
75
+ b.id = z + "-loader";
76
+
77
+ if (/MSIE[ ]+6/.test(navigator.userAgent)) {
78
+ b.src = "javascript:false"
79
+ }
80
+
81
+ b.allowTransparency = "true";
82
+ v[j](b);
83
+ try {
84
+ b.contentWindow[g].open()
85
+ } catch (w) {
86
+ c[e] = d[e];
87
+ o = "javascript:var d=" + g + ".open();d.domain='" + d.domain + "';";
88
+ b[k] = o + "void(0);"
89
+ }
90
+ try {
91
+ var t = b.contentWindow[g];
92
+ t.write(p());
93
+ t.close()
94
+ } catch (x) {
95
+ b[k] = o + 'd.write("' + p().replace(/"/g, String.fromCharCode(92) + '"') + '");d.close();'
96
+ }
97
+ a.P(2)
98
+ };
99
+ ld()
100
+ };
101
+
102
+ nt()
103
+
104
+ })({
105
+ loader: "static.olark.com/jsclient/loader0.js",
106
+ name: "olark",
107
+ methods: ["configure", "extend", "declare", "identify"]
108
+ })
109
+
110
+
111
+
112
+ return stampit().methods({
113
+ focus: function () { return olark('api.box.expand'); },
114
+ update_user: function (user) {
115
+ user.email && olark('api.visitor.updateEmailAddress', {emailAddress: user.email});
116
+ user.name && olark('api.visitor.updateFullName' , {fullName: user.name});
117
+ user.phone && olark('api.visitor.updatePhoneNumber' , {phoneNumber: user.phone});
118
+ // TODO rename user._id to user.id
119
+ user._id && olark('api.visitor.updateCustomFields', {id: user._id});
120
+ }
121
+ }).enclose(function mixin_adapter () {
122
+ this.subscribe('user', this.update_user);
123
+ olark.identify(this.options.token);
124
+ return this
125
+ });
126
+ });
@@ -0,0 +1,49 @@
1
+ # TODO bettter require
2
+ stampit = require 'indefinido-indemma/vendor/stampit.js'
3
+ observable = require('observable').mixin
4
+
5
+ define ->
6
+
7
+ handlers =
8
+ adapter_loaded: (composable) ->
9
+ builder = stampit.compose(adaptable, composable)
10
+ @adapter = builder options: @options.adapter
11
+
12
+ handlers.adapter_initialized.call @
13
+
14
+ # Event handlers and state restoring
15
+ adapter_initialized: ->
16
+
17
+ if @sandbox.signed_in
18
+ @adapter.user = @sandbox.current_user
19
+ else
20
+ @sandbox.once 'user.signed_in', handlers.user_signed_in, @
21
+
22
+ @sandbox.on 'support.default.focus', @focus, @
23
+
24
+
25
+ user_signed_in: (user) -> @adapter.user = @sandbox.current_user
26
+
27
+ adaptable = stampit().methods(
28
+ focus: -> throw new Error "Not implemented by this interface."
29
+ ).enclose -> observable @
30
+
31
+ type: 'Base'
32
+
33
+ focus: -> @adapter.focus()
34
+
35
+ initialize: (options) ->
36
+
37
+ unless @options.adapter?
38
+ throw new TypeError "No adapter specified for support widget '#{@identifier}'."
39
+
40
+ @options.adapter = @sandbox.util.extend @options.adapter,
41
+ name : options.adapterName
42
+ token: options.adapterToken
43
+
44
+ require ["widgets/support/adapters/#{options.adapter.name}"], (composable) => handlers.adapter_loaded.call @, composable
45
+
46
+ # TODO implement a type of widget that does not require element
47
+ @$el.remove();
48
+
49
+
data/lib/ende/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ende
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ende
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heitor Salazar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-29 00:00:00.000000000 Z
11
+ date: 2013-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,11 +38,12 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: A modular web application engine for rails. Using aurajs and indemma
42
- by default. the goal is to provideseamlessly integrstion with rails and popular
43
- rails engines, such as devise.
41
+ description: A modular web application engine for rails. Using aurajs for architecture
42
+ and indemma for resource management by default. The goal is to provide seamlessly
43
+ integration for web applications and various standard domains by providing default
44
+ extensions and components for aura.
44
45
  email:
45
- - heitorsalazar@gmail.com
46
+ - heitor@indefini.do
46
47
  executables: []
47
48
  extensions: []
48
49
  extra_rdoc_files: []
@@ -76,6 +77,8 @@ files:
76
77
  - lib/assets/javascripts/widgets/list/presenter.js.coffee
77
78
  - lib/assets/javascripts/widgets/list/states/default.html
78
79
  - lib/assets/javascripts/widgets/list/states/index.js.coffee
80
+ - lib/assets/javascripts/widgets/support/adapters/olark.js
81
+ - lib/assets/javascripts/widgets/support/main.js.coffee
79
82
  - lib/assets/javascripts/widgets/viewer/main.js.coffee
80
83
  - lib/assets/javascripts/widgets/viewer/presenter.js.coffee
81
84
  - lib/assets/javascripts/widgets/viewer/states/default.html
@@ -122,5 +125,5 @@ rubyforge_project:
122
125
  rubygems_version: 2.0.3
123
126
  signing_key:
124
127
  specification_version: 4
125
- summary: Endë (core, middle) a web application engine for rails with aurajs.
128
+ summary: Endë (core, middle) a web application engine for rails with aurajs.
126
129
  test_files: []