ende 0.2.12 → 0.2.13

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: 5b1c53a69c8b1d7cbe7cb6ba7bfc57e8e230ebea
4
- data.tar.gz: 07ace8c49d169b12aa81e66180743264870fc917
3
+ metadata.gz: 504ff45f462cdfcecee33f8867767d0b49d6647b
4
+ data.tar.gz: d635519312ac9541c3d4a5116f77a89eb649aa55
5
5
  SHA512:
6
- metadata.gz: bf1f94b17a0347cd1faa46bc4b45c19c90645c7093b463c7634cb0d1e195123f171a3c9e9fac1acb587322a7caeee8601fa55a0bfc9e37f110aa721ff82ba5be
7
- data.tar.gz: 2165a27bd1da00f8878c7e4305810facb99878f4daefbe3e2a2302420c4793333732b81ae730184fe2bfe23a1e1b7dfc499d2344d5bc0b99956f48115fcf591d
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 engine for rails. Using aurajs for architecture and indemma for resource management by default.
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
@@ -1,4 +1,4 @@
1
- # cofding: utf-8
1
+ # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'ende/version'
@@ -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
- unless token
120
- console.error "Server did not send the new csrf token.\n User may not be logged in!"
121
- $('meta[name="csrf-token"]').attr 'content', token
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.0'
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 = options.name || 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.0'
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
- normalize_options: (extra) ->
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
- normalized_options = @sandbox.util.extend context: @, defaults, options, extra
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(@normalize_options options).done(@loaded).fail(@failed).always(@ended)
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
- # TODO better debugging code location
67
- if @sandbox.debug.enabled
68
- html = "<h2>Content Widget: Failed to load Content</h2>"
69
- html += xhr.responseText
70
- html = html.replace /\n/g, '<br/>'
71
-
72
- else
73
- # TODO prettier message
74
- html = "Failed to load content."
75
-
76
- @html html
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
@@ -1,3 +1,3 @@
1
1
  module Ende
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.13"
3
3
  end
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.12
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-13 00:00:00.000000000 Z
11
+ date: 2013-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler