Skip to content

Commit

Permalink
Deletes trailing whitespaces (over text files only find * -type f -ex…
Browse files Browse the repository at this point in the history
…ec sed 's/[ \t]*$//' -i {} \;)

Thanks Santiago Pastorino
  • Loading branch information
delwyn committed Oct 29, 2010
1 parent ab170fe commit 99aa658
Show file tree
Hide file tree
Showing 71 changed files with 508 additions and 512 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* API backward incompatibility
* +ext_config+ config level is removed; put all that configuration in the top level
* mentioning actions in the +bbar+, +tbar+, etc, should be explicit, e.g.:

:bbar => [:apply.action, :delete.action]

* +late_aggregatee+ is now +lazy_loading+
* +aggregatees+ are now +components+
* +widgets+ are now +components+, too
Expand All @@ -30,9 +30,9 @@
* +js_method+ DSL method to define (public) methods in JS class
* +js_property+ DSL method to define (public) properties in JS class
* +endpoint+ DSL method to define server endpoints

* Different deprecations throughout the code

= v0.5.3 - 2010-06-14
* Fix: Getting rid of deprecation warnings about tasks not sitting in lib.

Expand Down Expand Up @@ -206,7 +206,7 @@
= v0.1.0.2
* Meta: fix outdated Manifest

= v0.1.0.1
= v0.1.0.1
* Meta work: replacing underscore with dash in the name

= v0.1.0 - 2008-12-11
Expand Down
4 changes: 2 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ Create YOUR_APP/app/components/hello_world_component.rb, and put in the followin

# Bottom bar with an automatically created action
js_property :bbar, [:bug_server.action]

# Action to be placed on the bottom bar
action :bug_server, :text => 'Ask server', :icon => :accept

# Method in the JS class that (by default) processes the action's "click" event
js_method :on_bug_server, <<-JS
function(){
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ begin
========================================================================
Thanks for installing Netzke Core!
Netzke home page: http://netzke.org
Netzke Google Groups: http://groups.google.com/group/netzke
Netzke tutorials: http://blog.writelesscode.com
========================================================================
MESSAGE

end
Jeweler::GemcutterTasks.new
rescue LoadError
Expand Down
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Some day
endpoint :call_server do |params, orig|
orig.merge(:set_title => orig[:set_title] + " extended")
end

Bad idea because calling the super method is often required AFTER doing something in the override, not BEFORE. For example, deliver_component in GridPanel in Basepack is overridden to reconfigure the components on the fly before actually delivering the component (i.e. calling super).
So, to override an endpoint, simply define a method with endpoint's name, e.g.:

Expand Down
18 changes: 9 additions & 9 deletions app/controllers/netzke_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class NetzkeController < ApplicationController

# Collect javascripts and stylesheets from all plugins that registered it in Netzke::Core.javascripts
# TODO: caching
# caches_action :netzke
Expand All @@ -11,7 +11,7 @@ def netzke
f = File.new(path)
res << f.read
end

# If JS classes are not inserted into the main page, we need to render all the classes needed to load the page that includes us
# (i.e. netzke/netzke.js) here
if !Netzke::Core.javascript_on_main_page
Expand All @@ -26,7 +26,7 @@ def netzke

render :text => defined?(::Rails) && ::Rails.env.production? ? res.strip_js_comments : res
}

format.css {
res = ""
Netzke::Core.stylesheets.each do |path|
Expand All @@ -37,15 +37,15 @@ def netzke
}
end
end
# Main dispatcher of the HTTP requests. The URL contains the name of the component,
# as well as the method of this component to be called, according to the double underscore notation.

# Main dispatcher of the HTTP requests. The URL contains the name of the component,
# as well as the method of this component to be called, according to the double underscore notation.
# E.g.: some_grid__post_grid_data.
def method_missing(method_name)
component_name, *action = method_name.to_s.split('__')
component_name = component_name.to_sym
action = !action.empty? && action.join("__").to_sym

if action
w_instance = Netzke::Base.instance_by_config(Netzke::Core.session[:netzke_components][component_name])
# only component's actions starting with "endpoint_" are accessible from outside (security)
Expand All @@ -55,7 +55,7 @@ def method_missing(method_name)
super
end
end

private
# Generates initial javascript code that is dependent on Rails environement
def initial_dynamic_javascript
Expand All @@ -66,5 +66,5 @@ def initial_dynamic_javascript
res << %{Netzke.RelativeExtUrl = '#{ActionController::Base.config.relative_url_root}/extjs';}
res.join("\n")
end

end
54 changes: 27 additions & 27 deletions app/models/netzke_preference.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
class NetzkePreference < ActiveRecord::Base
serialize :value

# belongs_to :user
# belongs_to :role

# ELEMENTARY_CONVERTION_METHODS= {'Fixnum' => 'to_i', 'String' => 'to_s', 'Float' => 'to_f', 'Symbol' => 'to_sym'}

# def self.component_name=(value)
# @@component_name = value
# end
#
#
# def self.component_name
# @@component_name ||= nil
# end

# def normalized_value
# klass = read_attribute(:pref_type)
# norm_value = read_attribute(:value)
#
#
# case klass
# when nil then r = norm_value # do not cast
# when 'Boolean' then r = norm_value == 'false' ? false : (norm_value == 'true' || norm_value)
Expand All @@ -28,7 +28,7 @@ class NetzkePreference < ActiveRecord::Base
# end
# r
# end
#
#
# def normalized_value=(new_value)
# case new_value.class.name
# when "Array" then write_attribute(:value, new_value.to_json)
Expand All @@ -37,17 +37,17 @@ class NetzkePreference < ActiveRecord::Base
# end
# write_attribute(:pref_type, [TrueClass, FalseClass].include?(new_value.class) ? 'Boolean' : new_value.class.to_s)
# end
#
#
# def self.[](pref_name)
# pref_name = normalize_preference_name(pref_name)
# pref = self.pref_to_read(pref_name)
# pref && pref.normalized_value
# end
#
#
# def self.[]=(pref_name, new_value)
# pref_name = normalize_preference_name(pref_name)
# pref = self.pref_to_write(pref_name)
#
#
# # if assigning nil, simply delete the eventually found preference
# if new_value.nil?
# pref && pref.destroy
Expand All @@ -58,9 +58,9 @@ class NetzkePreference < ActiveRecord::Base
# end
# end



# Overwrite pref_to_read, pref_to_write methods, and find_all_for_component if you want a different way of

# Overwrite pref_to_read, pref_to_write methods, and find_all_for_component if you want a different way of
# identifying the proper preference based on your own authorization strategy.
#
# The default strategy is:
Expand All @@ -70,22 +70,22 @@ class NetzkePreference < ActiveRecord::Base
# 2) if masq_user or masq_role is defined
# pref_to_read and pref_to_write will always take the masquerade into account, e.g. reads/writes will go to
# the user/role specified
#
#
def self.pref_to_read(name)
name = name.to_s
session = Netzke::Core.session
cond = {:key => name}

if session[:masq_user]
# first, get the prefs for this user it they exist
res = self.where(cond.merge({:user_id => session[:masq_user]})).first

# if it doesn't exist, get them for the user's role
user = User.where(session[:masq_user])
res ||= self.where(cond.merge({:role_id => user.role.id})).first

# if it doesn't exist either, get them for the World (role_id = 0)
res ||= self.where(cond.merge({:role_id => 0})).first
res ||= self.where(cond.merge({:role_id => 0})).first
elsif session[:masq_role]
# first, get the prefs for this role
res = self.where(cond.merge({:role_id => session[:masq_role]})).first
Expand All @@ -102,15 +102,15 @@ def self.pref_to_read(name)
else
res = self.where(cond).first
end
res

res
end

def self.pref_to_write(name)
name = name.to_s
session = Netzke::Core.session
cond = {:key => name}

if session[:masq_user]
cond.merge!({:user_id => session[:masq_user]})
# first, try to find the preference for masq_user
Expand Down Expand Up @@ -139,11 +139,11 @@ def self.pref_to_write(name)
end
res
end

# def self.find_all_for_component(name)
# session = Netzke::Core.session
# cond = {:component_name => name}
#
#
# if session[:masq_user] || session[:masq_role]
# cond.merge!({:user_id => session[:masq_user], :role_id => session[:masq_role]})
# res = self.where(cond).all
Expand All @@ -154,17 +154,17 @@ def self.pref_to_write(name)
# else
# res = self.where(cond).all
# end
#
# res
#
# res
# end

# def self.delete_all_for_component(name)
# self.destroy(find_all_for_component(name))
# end
#
#
# private
# def self.normalize_preference_name(name)
# name.to_s.gsub(".", "__").gsub("/", "__")
# end

end
2 changes: 1 addition & 1 deletion features/actions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Scenario: Pressing button should result in corresponding actions
When I go to the ComponentWithActions test page
Then I should see "Disabled action"
And button "Disabled action" should be disabled

When I press "Some action"
Then I should see "Some action was triggered"
2 changes: 1 addition & 1 deletion features/basic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Feature: Basic Netzke functionality
In order to value
As a role
I want feature

Scenario: Initial loading
Then Netzke should be initialized
2 changes: 1 addition & 1 deletion features/client-server.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Client/server communication
Scenario: Ask server to set our title
Given I am on the ServerCaller test page
Then I should see "Server Caller"

# When I execute "Ext.getCmp('server_caller').buttons.first().fireEvent('click');"
When I press "Call server"
Then I should see "All quiet here on the server"
Expand Down
13 changes: 6 additions & 7 deletions features/component_loader.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,22 @@ Feature: Component loader
When I press "Load component"
Then I should see "Inner text"
And I should see "Simple Component"

When I press "Load in window"
Then I should see "Component loaded in window"

@selenium
Scenario: Component loader should invoke a callback
Given I am on the ComponentLoader test page
When I press "Load with feedback"
Then I should see "Callback invoked!"


@selenium
Scenario: Component loader should load a window component with another component in it
Given I am on the ComponentLoader test page
When I press "Load window with simple component"
Then I should see "Simple Component Inside Window"
And I should see "Inner text"





11 changes: 5 additions & 6 deletions features/composition.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ Feature: Composition
When I press "Call server" within "#some_composite__center_panel"
Then I should see "All quiet here on the server"
And I should not see "All quiet here on the server, shiny weather"

When I press "Call server" within "#some_composite__west_panel"
Then I should see "All quiet here on the server, shiny weather"

@javascript
Scenario: Server should be able to address (deeply) nested components
Given I am on the SomeComposite test page
When I press "Update west from server"
Then I should see "Here's an update for west panel"

When I press "Update east south from server"
Then I should see "Here's an update for south panel in east panel"





2 changes: 1 addition & 1 deletion features/custom_css.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Custom css
When I go to the ComponentWithCustomCss test page
Then I should see "ComponentWithCustomCss"
But the body of ComponentWithCustomCss component should not be invisible

@javascript
Scenario: A dynamically loaded component with a hidden body should not display its body
When I go to the LoaderOfComponentWithCustomCss test page
Expand Down
1 change: 0 additions & 1 deletion features/inheritance.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ Feature: Inheritance
Given I am on the ScopedComponents::ExtendedScopedComponent test page
Then I should see "Extended Scoped Component Title"
And I should see "Extended Scoped Component HTML"

6 changes: 3 additions & 3 deletions features/persistence.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Feature: Persistence
When I press "Tell server to store new title"
And I go to the ComponentWithSessionPersistence test page
Then I should see "New Title!"



Loading

0 comments on commit 99aa658

Please sign in to comment.