parlement 0.10 → 0.11
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.
- data/CHANGES +11 -0
- data/MEMORY +9 -1
- data/README +5 -4
- data/app/controllers/account_controller.rb +10 -13
- data/app/controllers/application.rb +4 -5
- data/app/controllers/elt_controller.rb +9 -7
- data/app/controllers/person_controller.rb +1 -3
- data/app/controllers/subscriber_controller.rb +10 -10
- data/app/helpers/elt_helper.rb +2 -0
- data/app/models/elt.rb +28 -19
- data/app/models/mail.rb +26 -14
- data/app/models/mail_notify.rb +5 -4
- data/app/models/person.rb +11 -2
- data/app/views/account/_login.rhtml +3 -3
- data/app/views/account/_show.rhtml +12 -14
- data/app/views/elt/_choice.rhtml +3 -3
- data/app/views/elt/_elt.rhtml +4 -4
- data/app/views/elt/_list.rhtml +2 -2
- data/app/views/elt/_listByDate.rhtml +1 -1
- data/app/views/elt/_listByVote.rhtml +1 -1
- data/app/views/elt/new.rhtml +3 -3
- data/app/views/elt/show.rhtml +2 -2
- data/app/views/layouts/top.rhtml +6 -0
- data/app/views/mail_notify/publish.text.html.rhtml +1 -1
- data/app/views/person/_listElts.rhtml +5 -3
- data/app/views/person/show.rhtml +1 -2
- data/config/boot.rb +5 -4
- data/config/environment.rb +6 -4
- data/config/routes.rb +3 -2
- data/db/development_structure.sql +15 -4
- data/db/migrate/006_last_activity.rb +10 -0
- data/db/schema.rb +67 -49
- data/public/dispatch.fcgi +1 -0
- data/public/javascripts/controls.js +41 -23
- data/public/javascripts/dragdrop.js +317 -99
- data/public/javascripts/effects.js +301 -166
- data/public/javascripts/prototype.js +932 -402
- data/public/stylesheets/default.css +3 -2
- data/test/unit/elt_test.rb +13 -0
- data/test/unit/mail_test.rb +3 -1
- data/vendor/plugins/engines/CHANGELOG +203 -99
- data/vendor/plugins/engines/MIT-LICENSE +1 -1
- data/vendor/plugins/engines/README +32 -384
- data/vendor/plugins/engines/Rakefile +14 -0
- data/vendor/plugins/engines/UPGRADING +93 -0
- data/vendor/plugins/engines/about.yml +7 -0
- data/vendor/plugins/engines/generators/plugin_migration/USAGE +45 -0
- data/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +79 -0
- data/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +13 -0
- data/vendor/plugins/engines/init.rb +34 -47
- data/vendor/plugins/engines/install.rb +32 -0
- data/vendor/plugins/engines/lib/engines/{ruby_extensions.rb → deprecated_config_support.rb} +135 -113
- data/vendor/plugins/engines/lib/engines/plugin.rb +214 -0
- data/vendor/plugins/engines/lib/engines/plugin_list.rb +31 -0
- data/vendor/plugins/engines/lib/engines/plugin_migrator.rb +60 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +19 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +143 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +155 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb +116 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +20 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb +86 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +77 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb +140 -0
- data/vendor/plugins/engines/lib/engines/rails_extensions.rb +6 -0
- data/vendor/plugins/engines/lib/engines/testing.rb +88 -0
- data/vendor/plugins/engines/lib/engines.rb +281 -425
- data/vendor/plugins/engines/tasks/engines.rake +108 -137
- metadata +218 -250
- data/db/ROOT/perso.txt +0 -214
- data/public/images/indicator.gif +0 -0
- data/public/images/orange_by_darren_Hester_350o.jpg +0 -0
- data/public/images/smile.png +0 -0
- data/vendor/plugins/engines/generators/engine/USAGE +0 -26
- data/vendor/plugins/engines/generators/engine/engine_generator.rb +0 -199
- data/vendor/plugins/engines/generators/engine/templates/README +0 -85
- data/vendor/plugins/engines/generators/engine/templates/init_engine.erb +0 -15
- data/vendor/plugins/engines/generators/engine/templates/install.erb +0 -4
- data/vendor/plugins/engines/generators/engine/templates/lib/engine.erb +0 -6
- data/vendor/plugins/engines/generators/engine/templates/licenses/GPL +0 -18
- data/vendor/plugins/engines/generators/engine/templates/licenses/LGPL +0 -19
- data/vendor/plugins/engines/generators/engine/templates/licenses/MIT +0 -22
- data/vendor/plugins/engines/generators/engine/templates/licenses/None +0 -1
- data/vendor/plugins/engines/generators/engine/templates/public/javascripts/engine.js +0 -0
- data/vendor/plugins/engines/generators/engine/templates/public/stylesheets/engine.css +0 -0
- data/vendor/plugins/engines/generators/engine/templates/tasks/engine.rake +0 -0
- data/vendor/plugins/engines/generators/engine/templates/test/test_helper.erb +0 -17
- data/vendor/plugins/engines/lib/bundles/require_resource.rb +0 -124
- data/vendor/plugins/engines/lib/bundles.rb +0 -77
- data/vendor/plugins/engines/lib/engines/action_mailer_extensions.rb +0 -140
- data/vendor/plugins/engines/lib/engines/action_view_extensions.rb +0 -141
- data/vendor/plugins/engines/lib/engines/active_record_extensions.rb +0 -21
- data/vendor/plugins/engines/lib/engines/dependencies_extensions.rb +0 -129
- data/vendor/plugins/engines/lib/engines/migration_extensions.rb +0 -53
- data/vendor/plugins/engines/lib/engines/routing_extensions.rb +0 -28
- data/vendor/plugins/engines/lib/engines/testing_extensions.rb +0 -327
- data/vendor/plugins/engines/tasks/deprecated_engines.rake +0 -7
- data/vendor/plugins/engines/test/action_view_extensions_test.rb +0 -9
- data/vendor/plugins/engines/test/ruby_extensions_test.rb +0 -115
- data/vendor/plugins/guid/README.TXT +0 -29
- data/vendor/plugins/guid/init.rb +0 -30
- data/vendor/plugins/guid/lib/usesguid.rb +0 -37
- data/vendor/plugins/guid/lib/uuid22.rb +0 -43
- data/vendor/plugins/guid/lib/uuidtools.rb +0 -572
- data/vendor/plugins/responds_to_parent/MIT-LICENSE +0 -20
- data/vendor/plugins/responds_to_parent/README +0 -42
- data/vendor/plugins/responds_to_parent/Rakefile +0 -22
- data/vendor/plugins/responds_to_parent/init.rb +0 -1
- data/vendor/plugins/responds_to_parent/lib/responds_to_parent.rb +0 -46
- data/vendor/plugins/responds_to_parent/test/responds_to_parent_test.rb +0 -115
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Module containing the methods useful for child IFRAME to parent window communication
|
|
2
|
-
module RespondsToParent
|
|
3
|
-
|
|
4
|
-
# Executes the response body as JavaScript in the context of the parent window.
|
|
5
|
-
# Use this method of you are posting a form to a hidden IFRAME or if you would like
|
|
6
|
-
# to use IFRAME base RPC.
|
|
7
|
-
def responds_to_parent(&block)
|
|
8
|
-
yield
|
|
9
|
-
|
|
10
|
-
if performed?
|
|
11
|
-
# We're returning HTML instead of JS or XML now
|
|
12
|
-
response.headers['Content-Type'] = 'text/html; charset=UTF-8'
|
|
13
|
-
|
|
14
|
-
# Either pull out a redirect or the request body
|
|
15
|
-
script = if location = erase_redirect_results
|
|
16
|
-
"document.location.href = #{location.to_s.inspect}"
|
|
17
|
-
else
|
|
18
|
-
response.body
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# Escape quotes, linebreaks and slashes, maintaining previously escaped slashes
|
|
22
|
-
# Suggestions for improvement?
|
|
23
|
-
script = (script || '').
|
|
24
|
-
gsub('\\', '\\\\\\').
|
|
25
|
-
gsub(/\r\n|\r|\n/, '\\n').
|
|
26
|
-
gsub(/['"]/, '\\\\\&').
|
|
27
|
-
gsub('</script>','</scr"+"ipt>')
|
|
28
|
-
|
|
29
|
-
# Clear out the previous render to prevent double render
|
|
30
|
-
erase_results
|
|
31
|
-
|
|
32
|
-
# Eval in parent scope and replace document location of this frame
|
|
33
|
-
# so back button doesn't replay action on targeted forms
|
|
34
|
-
# loc = document.location to be set after parent is updated for IE
|
|
35
|
-
# with(window.parent) - pull in variables from parent window
|
|
36
|
-
# setTimeout - scope the execution in the windows parent for safari
|
|
37
|
-
# window.eval - legal eval for Opera
|
|
38
|
-
render :text => "<html><body><script type='text/javascript' charset='utf-8'>
|
|
39
|
-
var loc = document.location;
|
|
40
|
-
with(window.parent) { setTimeout(function() { window.eval('#{script}'); loc.replace('about:blank'); }, 1) }
|
|
41
|
-
</script></body></html>"
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
alias respond_to_parent responds_to_parent
|
|
45
|
-
end
|
|
46
|
-
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../../../../config/environment'
|
|
2
|
-
require 'test/unit'
|
|
3
|
-
require 'test_help'
|
|
4
|
-
|
|
5
|
-
class IFrameController < ActionController::Base
|
|
6
|
-
def normal
|
|
7
|
-
render :update do |page|
|
|
8
|
-
page.alert "foo"
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def aliased
|
|
13
|
-
respond_to_parent do
|
|
14
|
-
render :text => 'woot'
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def redirect
|
|
19
|
-
responds_to_parent do
|
|
20
|
-
redirect_to '/another/place'
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def no_block
|
|
25
|
-
responds_to_parent
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def empty_render
|
|
29
|
-
responds_to_parent do
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
render :text => ''
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def quotes
|
|
36
|
-
responds_to_parent do
|
|
37
|
-
render :text => %(single' double" qs\\' qd\\" escaped\\\' doubleescaped\\\\')
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def newlines
|
|
42
|
-
responds_to_parent do
|
|
43
|
-
render :text => "line1\nline2\\nline2"
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def update
|
|
48
|
-
responds_to_parent do
|
|
49
|
-
render :update do |page|
|
|
50
|
-
page.alert 'foo'
|
|
51
|
-
page.alert 'bar'
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def rescue_action(e)
|
|
57
|
-
raise e
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
class RespondsToParentTest < Test::Unit::TestCase
|
|
62
|
-
def setup
|
|
63
|
-
@controller = IFrameController.new
|
|
64
|
-
@request = ActionController::TestRequest.new
|
|
65
|
-
@response = ActionController::TestResponse.new
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def test_normal
|
|
69
|
-
get :normal
|
|
70
|
-
assert_match /alert\("foo"\)/, @response.body
|
|
71
|
-
assert_no_match /window\.parent/, @response.body
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def test_quotes_should_be_escaped
|
|
75
|
-
render :quotes
|
|
76
|
-
assert_match %r{eval\('single\\' double\\" qs\\\\\\' qd\\\\\\" escaped\\\\\\' doubleescaped\\\\\\\\\\'}, @response.body
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
def test_newlines_should_be_escaped
|
|
80
|
-
render :newlines
|
|
81
|
-
assert_match %r{eval\('line1\\nline2\\\\nline2'\)}, @response.body
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def test_no_block_should_raise
|
|
85
|
-
assert_raises LocalJumpError do
|
|
86
|
-
get :no_block
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def test_empty_render_should_not_expand_javascript
|
|
91
|
-
get :empty_render
|
|
92
|
-
assert_equal '', @response.body
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def test_update_should_perform_combined_rjs
|
|
96
|
-
render :update
|
|
97
|
-
assert_match /alert\(\\"foo\\"\);\\nalert\(\\"bar\\"\)/, @response.body
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
def test_aliased_method_should_not_raise
|
|
101
|
-
assert_nothing_raised do
|
|
102
|
-
render :aliased
|
|
103
|
-
assert_match /eval\('woot'\)/, @response.body
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
protected
|
|
108
|
-
|
|
109
|
-
def render(action)
|
|
110
|
-
get action
|
|
111
|
-
assert_match /<script type='text\/javascript'/, @response.body
|
|
112
|
-
assert_match /with\(window\.parent\)/, @response.body
|
|
113
|
-
assert_match /document\.location\.replace\('about:blank'\)/, @response.body
|
|
114
|
-
end
|
|
115
|
-
end
|