ende 0.2.12 → 0.2.13
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 +4 -4
- data/README.md +8 -4
- data/ende.gemspec +1 -1
- data/lib/assets/javascripts/aura/extensions/devise.js.coffee +4 -3
- data/lib/assets/javascripts/aura/extensions/routes.js.coffee +8 -3
- data/lib/assets/javascripts/aura/extensions/states.js.coffee +2 -1
- data/lib/assets/javascripts/aura/extensions/widget/lifecycleable.js.coffee +1 -1
- data/lib/assets/javascripts/widgets/content/main.js.coffee +28 -21
- data/lib/assets/javascripts/widgets/dialog/main.js.coffee +2 -2
- data/lib/assets/javascripts/widgets/tray/main.js.coffee +1 -1
- data/lib/ende/version.rb +1 -1
- data/lib/ende.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 504ff45f462cdfcecee33f8867767d0b49d6647b
|
4
|
+
data.tar.gz: d635519312ac9541c3d4a5116f77a89eb649aa55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 908dd43ba6855773323856bf3741ee3f9e0ac920689f418ea5ed7fb38dc732e8111ce8f275e6063fa98baf2496cc34e620f525414eb307604bc4be68508eba30
|
7
|
+
data.tar.gz: 34efabfe0a90591ddd2db38dc4246d87be434469b063c7a8a3313de1cca51c6e2033238f9bdccc5f3fee46443225f1f763a1c4c1d237b3316cf3327986f06362
|
data/README.md
CHANGED
@@ -7,11 +7,11 @@ Summary
|
|
7
7
|
|
8
8
|
Endë (core, middle)
|
9
9
|
|
10
|
-
A modular web application
|
10
|
+
A modular web application rails gem. Using aurajs for architecture and indemma for resource management by default.
|
11
11
|
|
12
12
|
The goal is to provide seamlessly integration for web applications and various standard domains by providing default extensions and components for aura.
|
13
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.
|
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
15
|
Also aurajs has not stable release yet. So expect big changes!**
|
16
16
|
|
17
17
|
Installation
|
@@ -35,10 +35,14 @@ Components List
|
|
35
35
|
|
36
36
|
_Detailed documentation is comming!_
|
37
37
|
|
38
|
-
- Viewer
|
39
|
-
- List
|
40
38
|
- Authenticator
|
39
|
+
- Content
|
40
|
+
- Dialog
|
41
|
+
- Form
|
42
|
+
- List
|
41
43
|
- Support
|
44
|
+
- Tray
|
45
|
+
- Viewer
|
42
46
|
|
43
47
|
<!---
|
44
48
|
Heitor do futuro não se esqueça de mencionar a integração do
|
data/ende.gemspec
CHANGED
@@ -116,9 +116,10 @@ define 'aura/extensions/devise', () ->
|
|
116
116
|
# devise is included to send it to us
|
117
117
|
# TODO implement as a indemma extension
|
118
118
|
token = xhr.getResponseHeader 'X-CSRF-Token'
|
119
|
-
|
120
|
-
|
121
|
-
|
119
|
+
|
120
|
+
console.error "Server did not send the new csrf token.\n User may not be logged in!" unless token
|
121
|
+
|
122
|
+
$('meta[name="csrf-token"]').attr 'content', token
|
122
123
|
|
123
124
|
.fail (xhr) ->
|
124
125
|
switch xhr.status
|
@@ -9,6 +9,7 @@ define 'aura/extensions/routes', (routes) ->
|
|
9
9
|
query = loader.require.call null, 'querystring'
|
10
10
|
router = null
|
11
11
|
|
12
|
+
# TODO rename to router stationg
|
12
13
|
(application) ->
|
13
14
|
core = application.core
|
14
15
|
mediator = core.mediator
|
@@ -18,18 +19,22 @@ define 'aura/extensions/routes', (routes) ->
|
|
18
19
|
# TODO implement logger api for lennon or change lennon library
|
19
20
|
# logger: application.logger
|
20
21
|
publishEvent: (name, params) ->
|
22
|
+
|
21
23
|
# TODO method parsing (get, delete, put, post)
|
22
24
|
mediator.emit name, params
|
23
25
|
|
26
|
+
mediator.emit 'route.changed'
|
24
27
|
|
25
|
-
router.location = (href) ->
|
28
|
+
router.location = (href, process = true) ->
|
26
29
|
if Modernizr.history
|
27
30
|
window.history.pushState null, null, href
|
28
31
|
else
|
29
32
|
# TODO parse href and extract path!
|
30
33
|
window.location.hash = href
|
31
34
|
|
32
|
-
router.process()
|
35
|
+
process and router.process()
|
36
|
+
|
37
|
+
|
33
38
|
|
34
39
|
application.core.router = router
|
35
40
|
|
@@ -40,7 +45,7 @@ define 'aura/extensions/routes', (routes) ->
|
|
40
45
|
|
41
46
|
toString: -> window.location
|
42
47
|
|
43
|
-
version: '0.2.
|
48
|
+
version: '0.2.1'
|
44
49
|
|
45
50
|
initialize: (application) ->
|
46
51
|
application.sandbox.location = location
|
@@ -40,7 +40,8 @@ define 'aura/extensions/states', ['application/states'], (states) ->
|
|
40
40
|
widgets = []
|
41
41
|
|
42
42
|
for name, options of unormalized_widget_options
|
43
|
-
widget_name
|
43
|
+
widget_name = options.name || name
|
44
|
+
options.resource ||= name
|
44
45
|
|
45
46
|
# To allow user controlling the application change the
|
46
47
|
# widget configuration at runtime, we check the transition
|
@@ -46,7 +46,7 @@ define 'aura/extensions/widget/lifecycleable', ->
|
|
46
46
|
options.require = options.require || {}
|
47
47
|
options.require.packages = options.require.packages || []
|
48
48
|
options.require.packages.push name: options.ref, location: widgetsPath + "/" + widgetName
|
49
|
-
options.name = widgetName
|
49
|
+
options.name = widgetName
|
50
50
|
|
51
51
|
unless options.el
|
52
52
|
options.el = jQuery '<div class="widget"></div>'
|
@@ -1,11 +1,7 @@
|
|
1
1
|
define ->
|
2
2
|
|
3
|
-
defaults =
|
4
|
-
beforeSend: (xhr) ->
|
5
|
-
xhr.setRequestHeader 'X-XHR-Referer', document.location.href
|
6
|
-
|
7
3
|
type: 'Base'
|
8
|
-
version: '0.1.
|
4
|
+
version: '0.1.1'
|
9
5
|
options:
|
10
6
|
autoload: true
|
11
7
|
|
@@ -21,22 +17,25 @@ define ->
|
|
21
17
|
@$el.addClass "content idle"
|
22
18
|
@$el.attr 'id', @identifier unless @$el.attr 'id'
|
23
19
|
|
24
|
-
|
25
|
-
throw new TypeError "content.initialize: Multiple before sends are not supported yet" if extra?.beforeSend
|
26
|
-
|
20
|
+
request_options: (extra) ->
|
27
21
|
options = @sandbox.util._.omit @options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl'
|
28
|
-
|
22
|
+
|
23
|
+
normalized_options = @sandbox.util.extend context: @, options, extra
|
29
24
|
|
30
25
|
throw new TypeError "content.initialize: No uri provided to load content" unless normalized_options.uri?
|
31
26
|
|
32
27
|
normalized_options.url = normalized_options.uri
|
33
28
|
delete normalized_options.uri
|
34
29
|
|
30
|
+
normalized_options.headers = @sandbox.util.extend 'X-XHR-Referer': document.location.href, normalized_options.headers
|
31
|
+
|
35
32
|
normalized_options
|
36
33
|
|
34
|
+
|
37
35
|
# Total number of completed loads (loaded or failed)
|
38
36
|
loads: 0
|
39
37
|
|
38
|
+
# TODO move to handlers
|
40
39
|
load: (options) ->
|
41
40
|
# TODO move to anoter method
|
42
41
|
if @loads > 0
|
@@ -53,7 +52,7 @@ define ->
|
|
53
52
|
@$el.removeClass "idle"
|
54
53
|
|
55
54
|
# TODO remove jQuery dependency
|
56
|
-
@loading = $.ajax(@
|
55
|
+
@loading = $.ajax(@request_options options).done(@loaded).fail(@failed).always(@ended)
|
57
56
|
|
58
57
|
@sandbox.emit "content.#{@identifier}.loading", @loading
|
59
58
|
|
@@ -63,17 +62,25 @@ define ->
|
|
63
62
|
@html response
|
64
63
|
|
65
64
|
failed: (xhr) ->
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
65
|
+
switch xhr.status
|
66
|
+
when 401
|
67
|
+
@sandbox.emit "content.#{@identifier}.loading_unauthorized"
|
68
|
+
else
|
69
|
+
# TODO better debugging code location
|
70
|
+
if @sandbox.debug.enabled
|
71
|
+
html = "<h2>Content Widget: Failed to load Content. Click to retry.</h2>"
|
72
|
+
html += xhr.responseText
|
73
|
+
html = html.replace /\n/g, '<br/>'
|
74
|
+
|
75
|
+
else
|
76
|
+
# TODO prettier default user message message
|
77
|
+
html = "Failed to load content. Click to retry."
|
78
|
+
|
79
|
+
# TODO change method name to retry
|
80
|
+
# TODO treat complex settings cases, and better store the settings
|
81
|
+
@$el.one('click', => @load())
|
82
|
+
|
83
|
+
@html html
|
77
84
|
|
78
85
|
ended: ->
|
79
86
|
@$el.removeClass "loading"
|
@@ -83,7 +83,7 @@ define ->
|
|
83
83
|
# el: @$el
|
84
84
|
|
85
85
|
|
86
|
-
@identifier = widget_options.name if @identifier == 'default'
|
86
|
+
@identifier = widget_options.name if @identifier == 'default' or @identifier == @name
|
87
87
|
@$el.attr 'id', 'dialog'
|
88
88
|
options.size && @$el.addClass options.size
|
89
89
|
options.theme && @$el.addClass options.theme
|
@@ -126,7 +126,7 @@ define ->
|
|
126
126
|
@dialog.hide()
|
127
127
|
|
128
128
|
extract_options: ->
|
129
|
-
options = _.omit @options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl', 'theme'
|
129
|
+
options = _.omit @options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl', 'theme', 'resource'
|
130
130
|
|
131
131
|
dynamic_options = _.omit options, Object.keys(@constructor.__super__.options)
|
132
132
|
|
@@ -11,7 +11,7 @@ define ->
|
|
11
11
|
{identifier} = options
|
12
12
|
|
13
13
|
# TODO access omit method throuhgh underscore
|
14
|
-
widget_options = _.omit options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl'
|
14
|
+
widget_options = _.omit options, 'el', 'ref', '_ref', 'name', 'require', 'baseUrl', 'resource'
|
15
15
|
|
16
16
|
# TODO remove jquery dependency
|
17
17
|
for name, suboptions of widget_options when $.type(suboptions) is "object"
|
data/lib/ende/version.rb
CHANGED
data/lib/ende.rb
CHANGED
@@ -38,6 +38,11 @@ module Ende
|
|
38
38
|
include ::CsrfExtensions
|
39
39
|
after_filter :add_new_csrf_token, only: [:create, :destroy]
|
40
40
|
end
|
41
|
+
|
42
|
+
Devise::RegistrationsController.class_eval do
|
43
|
+
include ::CsrfExtensions
|
44
|
+
after_filter :add_new_csrf_token, only: [:create]
|
45
|
+
end
|
41
46
|
end
|
42
47
|
end
|
43
48
|
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.2.
|
4
|
+
version: 0.2.13
|
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-12-
|
11
|
+
date: 2013-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|