Permalink
Browse files

Turn it into Rails 3 plugin (freshly generated with Rails 3.1.1)

  • Loading branch information...
1 parent 753ce07 commit 1e0a9d53402efa3cdf8b4bb7885bd0647ed3b652 Sergei Kozlov committed Oct 13, 2011
Showing with 410 additions and 10,126 deletions.
  1. +6 −4 .gitignore
  2. +0 −3 CHANGELOG.rdoc
  3. +15 −2 Gemfile
  4. +99 −0 Gemfile.lock
  5. +20 −0 MIT-LICENSE
  6. +2 −5 README.rdoc
  7. +36 −1 Rakefile
  8. +9 −4 lib/netzke-communitypack.rb
  9. +2 −9 lib/netzke-communitypack/version.rb
  10. +22 −22 lib/netzke/communitypack/google_map_panel.rb
  11. +36 −36 lib/netzke/communitypack/live_search_grid_panel.rb
  12. +0 −4 lib/netzke/communitypack/viewport.rb
  13. +4 −0 lib/tasks/netzke-communitypack_tasks.rake
  14. +15 −19 netzke-communitypack.gemspec
  15. +2 −2 test/{rails_app → dummy}/Rakefile
  16. +9 −0 test/dummy/app/assets/javascripts/application.js
  17. +7 −0 test/dummy/app/assets/stylesheets/application.css
  18. 0 test/{rails_app → dummy}/app/controllers/application_controller.rb
  19. 0 test/{rails_app → dummy}/app/helpers/application_helper.rb
  20. 0 test/{rails_app/lib/tasks → dummy/app/mailers}/.gitkeep
  21. 0 test/{rails_app/public/stylesheets → dummy/app/models}/.gitkeep
  22. +14 −0 test/dummy/app/views/layouts/application.html.erb
  23. +1 −1 test/{rails_app → dummy}/config.ru
  24. +12 −12 test/{rails_app → dummy}/config/application.rb
  25. +10 −0 test/dummy/config/boot.rb
  26. +4 −1 test/{rails_app → dummy}/config/database.yml
  27. +1 −1 test/{rails_app → dummy}/config/environment.rb
  28. +9 −5 test/{rails_app → dummy}/config/environments/development.rb
  29. +25 −14 test/{rails_app → dummy}/config/environments/production.rb
  30. +7 −3 test/{rails_app → dummy}/config/environments/test.rb
  31. 0 test/{rails_app → dummy}/config/initializers/backtrace_silencers.rb
  32. 0 test/{rails_app → dummy}/config/initializers/inflections.rb
  33. 0 test/{rails_app → dummy}/config/initializers/mime_types.rb
  34. +1 −1 test/{rails_app → dummy}/config/initializers/secret_token.rb
  35. +8 −0 test/dummy/config/initializers/session_store.rb
  36. +14 −0 test/dummy/config/initializers/wrap_parameters.rb
  37. +1 −1 test/{rails_app → dummy}/config/locales/en.yml
  38. +2 −5 test/{rails_app → dummy}/config/routes.rb
  39. 0 test/{rails_app/vendor/plugins → dummy/lib/assets}/.gitkeep
  40. 0 test/{rails_app/public/favicon.ico → dummy/log/.gitkeep}
  41. 0 test/{rails_app → dummy}/public/404.html
  42. 0 test/{rails_app → dummy}/public/422.html
  43. 0 test/{rails_app → dummy}/public/500.html
  44. 0 test/dummy/public/favicon.ico
  45. 0 test/{rails_app → dummy}/script/rails
  46. +7 −0 test/netzke-communitypack_test.rb
  47. +0 −4 test/rails_app/.gitignore
  48. +0 −34 test/rails_app/Gemfile
  49. +0 −89 test/rails_app/Gemfile.lock
  50. +0 −256 test/rails_app/README
  51. +0 −3 test/rails_app/app/components/test_panel.rb
  52. +0 −5 test/rails_app/app/controllers/components_controller.rb
  53. +0 −2 test/rails_app/app/helpers/components_helper.rb
  54. +0 −13 test/rails_app/app/views/components/show.html.erb
  55. +0 −17 test/rails_app/app/views/layouts/application.html.erb
  56. +0 −13 test/rails_app/config/boot.rb
  57. +0 −8 test/rails_app/config/initializers/session_store.rb
  58. +0 −7 test/rails_app/db/seeds.rb
  59. +0 −2 test/rails_app/doc/README_FOR_APP
  60. BIN test/rails_app/public/images/rails.png
  61. +0 −239 test/rails_app/public/index.html
  62. +0 −2 test/rails_app/public/javascripts/application.js
  63. +0 −965 test/rails_app/public/javascripts/controls.js
  64. +0 −974 test/rails_app/public/javascripts/dragdrop.js
  65. +0 −1,123 test/rails_app/public/javascripts/effects.js
  66. +0 −6,001 test/rails_app/public/javascripts/prototype.js
  67. +0 −175 test/rails_app/public/javascripts/rails.js
  68. +0 −5 test/rails_app/public/robots.txt
  69. +0 −8 test/rails_app/test/functional/components_controller_test.rb
  70. +0 −9 test/rails_app/test/performance/browsing_test.rb
  71. +0 −13 test/rails_app/test/test_helper.rb
  72. +0 −4 test/rails_app/test/unit/helpers/components_helper_test.rb
  73. +10 −0 test/test_helper.rb
View
@@ -1,4 +1,6 @@
-pkg/*
-*.gem
-.bundle
-/test/rails_app/public/extjs
+.bundle/
+log/*.log
+pkg/
+test/dummy/db/*.sqlite3
+test/dummy/log/*.log
+test/dummy/tmp/
View
@@ -1,3 +0,0 @@
-= v0.1.1 - 2010-10-25
-
-= v0.1.0 - 2010-10-21
View
17 Gemfile
@@ -1,4 +1,17 @@
-source :gemcutter
+source "http://rubygems.org"
-# Specify your gem's dependencies in netzke-communitypack.gemspec
+# Declare your gem's dependencies in netzke-communitypack.gemspec.
+# Bundler will treat runtime dependencies like base dependencies, and
+# development dependencies will be added by default to the :development group.
gemspec
+
+# jquery-rails is used by the dummy application
+gem "jquery-rails"
+
+# Declare any dependencies that are still in development here instead of in
+# your gemspec. These might include edge Rails or gems from your path or
+# Git. Remember to move these dependencies to your gemspec before releasing
+# your gem to rubygems.org.
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
View
@@ -0,0 +1,99 @@
+PATH
+ remote: .
+ specs:
+ netzke-communitypack (0.0.1)
+ rails (>= 3.0.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.1.1)
+ actionpack (= 3.1.1)
+ mail (~> 2.3.0)
+ actionpack (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6)
+ rack (~> 1.3.2)
+ rack-cache (~> 1.1)
+ rack-mount (~> 0.8.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.0.2)
+ activemodel (3.1.1)
+ activesupport (= 3.1.1)
+ builder (~> 3.0.0)
+ i18n (~> 0.6)
+ activerecord (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ arel (~> 2.2.1)
+ tzinfo (~> 0.3.29)
+ activeresource (3.1.1)
+ activemodel (= 3.1.1)
+ activesupport (= 3.1.1)
+ activesupport (3.1.1)
+ multi_json (~> 1.0)
+ arel (2.2.1)
+ builder (3.0.0)
+ erubis (2.7.0)
+ hike (1.2.1)
+ i18n (0.6.0)
+ jquery-rails (1.0.16)
+ railties (~> 3.0)
+ thor (~> 0.14)
+ json (1.6.1)
+ mail (2.3.0)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ multi_json (1.0.3)
+ polyglot (0.3.2)
+ rack (1.3.4)
+ rack-cache (1.1)
+ rack (>= 0.4)
+ rack-mount (0.8.3)
+ rack (>= 1.0.0)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.1.1)
+ actionmailer (= 3.1.1)
+ actionpack (= 3.1.1)
+ activerecord (= 3.1.1)
+ activeresource (= 3.1.1)
+ activesupport (= 3.1.1)
+ bundler (~> 1.0)
+ railties (= 3.1.1)
+ railties (3.1.1)
+ actionpack (= 3.1.1)
+ activesupport (= 3.1.1)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2)
+ rdoc (3.10)
+ json (~> 1.4)
+ sprockets (2.0.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (!= 1.3.0, ~> 1.1)
+ sqlite3 (1.3.4)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.30)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jquery-rails
+ netzke-communitypack!
+ sqlite3
View
@@ -0,0 +1,20 @@
+Copyright 2011 YOURNAME
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -1,6 +1,3 @@
-= Netzke components submitted by the community
+= NetzkeCommunitypack
-Includes the following components:
-
-* LiveSearchGridPanel - GridPanel extension with a configurable live-search textfield
-* GoogleMapPanel - Panel showing a Google map
+This project rocks and uses MIT-LICENSE.
View
@@ -1,2 +1,37 @@
-require 'bundler'
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'NetzkeCommunitypack'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+
+
Bundler::GemHelper.install_tasks
+
+require 'rake/testtask'
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+
+task :default => :test
@@ -1,5 +1,10 @@
-module Netzke
- module Communitypack
- # Your code goes here...
- end
+# External dependencies
+require 'netzke-core'
+require 'active_support/dependencies'
+
+# Make components auto-loadable
+ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__)
+
+module NetzkeCommunitypack
+
end
@@ -1,10 +1,3 @@
-module Netzke
- module Communitypack
- MAJOR = 0
- MINOR = 1
- PATCH = 3
-
- STRING = [MAJOR, MINOR, PATCH].compact.join('.')
- VERSION = STRING
- end
+module NetzkeCommunitypack
+ VERSION = "0.7.0" # Keep the major and minor versions synced with those of Netzke Core gem.
end
@@ -1,30 +1,30 @@
# Creates a google map panel. The panel additionaly has the options of google maps, i.e.:
# * +zoom_level+ - The initial zoom level
-# * +gmap_type+ -
-# * +map_conf_opts+ -
+# * +gmap_type+ -
+# * +map_conf_opts+ -
# * +map_controlls+ -
# * +set_center+ - The initial map position
# * +markers+ - Initial markers on the page
# ...
class Netzke::Communitypack::GoogleMapPanel < ::Netzke::Base
- js_include "#{File.dirname(__FILE__)}/google_map_panel/javascript/GMapPanel.js"
-
- # default configuration
- config do
- {
- :zoom_level => 14,
- :gmap_type => 'map',
- :layout => :fit,
- :map_conf_opts => ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
- :map_controls => ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
- :set_center => {
- :geo_code_addr => 'Flottwellstr. 4-5, 10785 Berlin, Germany',
- :marker => {
- :title => 'pme Familienservice GmbH'
- }
- }
- }
- end
-
- js_base_class 'Ext.ux.GMapPanel'
+ js_include "#{File.dirname(__FILE__)}/google_map_panel/javascript/GMapPanel.js"
+
+ # default configuration
+ config do
+ {
+ :zoom_level => 14,
+ :gmap_type => 'map',
+ :layout => :fit,
+ :map_conf_opts => ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
+ :map_controls => ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
+ :set_center => {
+ :geo_code_addr => 'Flottwellstr. 4-5, 10785 Berlin, Germany',
+ :marker => {
+ :title => 'pme Familienservice GmbH'
+ }
+ }
+ }
+ end
+
+ js_base_class 'Ext.ux.GMapPanel'
end
@@ -7,40 +7,40 @@
# * +live_search_scope+ - The scope name for filtering the results by the live search (default: :live_search)
#
class Netzke::Communitypack::LiveSearchGridPanel < ::Netzke::Basepack::GridPanel
- config :tbar => ['->', {
- :xtype => 'textfield',
- :id => 'live_search_field',
- :enable_key_events => true,
- :ref => '../live_search_field',
- :empty_text => 'Search'
- }]
-
- js_method :init_component, <<-JS
- function() {
- #{js_full_class_name}.superclass.initComponent.call(this);
-
- this.liveSearchBuffer = '';
- this.live_search_field.on('keydown', function() { this.onLiveSearch(); }, this, { buffer: 500 });
- this.live_search_field.on('blur', function() { this.onLiveSearch(); }, this, { buffer: 500 });
- }
- JS
-
- js_method :on_live_search, <<-JS
- function() {
- var search_text = this.getTopToolbar().get('live_search_field').getValue();
- if (search_text == this.liveSearchBuffer) return;
- this.liveSearchBuffer = search_text;
- this.getStore().setBaseParam('live_search', search_text);
- this.getStore().load();
- }
- JS
-
- def get_data(*args)
- params = args.first
- search_scope = config[:live_search_scope] || :live_search
- data_class.send(search_scope, params && params[:live_search] || '').scoping do
- super
- end
- end
-
+ config :tbar => ['->', {
+ :xtype => 'textfield',
+ :id => 'live_search_field',
+ :enable_key_events => true,
+ :ref => '../live_search_field',
+ :empty_text => 'Search'
+ }]
+
+ js_method :init_component, <<-JS
+ function() {
+ #{js_full_class_name}.superclass.initComponent.call(this);
+
+ this.liveSearchBuffer = '';
+ this.live_search_field.on('keydown', function() { this.onLiveSearch(); }, this, { buffer: 500 });
+ this.live_search_field.on('blur', function() { this.onLiveSearch(); }, this, { buffer: 500 });
+ }
+ JS
+
+ js_method :on_live_search, <<-JS
+ function() {
+ var search_text = this.getTopToolbar().get('live_search_field').getValue();
+ if (search_text == this.liveSearchBuffer) return;
+ this.liveSearchBuffer = search_text;
+ this.getStore().setBaseParam('live_search', search_text);
+ this.getStore().load();
+ }
+ JS
+
+ def get_data(*args)
+ params = args.first
+ search_scope = config[:live_search_scope] || :live_search
+ data_class.send(search_scope, params && params[:live_search] || '').scoping do
+ super
+ end
+ end
+
end
@@ -1,4 +0,0 @@
-# A simple Ext.Viewport
-class Netzke::Communitypack::Viewport < ::Netzke::Base
- js_base_class 'Ext.Viewport'
-end
@@ -0,0 +1,4 @@
+# desc "Explaining what the task does"
+# task :netzke-communitypack do
+# # Task goes here
+# end
Oops, something went wrong.

0 comments on commit 1e0a9d5

Please sign in to comment.