Browse files

interim work on replacement of Prototype w/ jQuery

  • Loading branch information...
1 parent 91ab540 commit 56e8e311adef8033bb6a2f9c17ca706452ec9f5a @cwise cwise committed Feb 22, 2011
View
2 Rakefile
@@ -11,7 +11,7 @@ begin
gem.authors = ["Roland Guem"]
gem.files = Dir["{lib}/**/*", "{app}/**/*", "{config}/**/*", "{public}/**/*"]
gem.test_files = Dir["{test}/**/*"]
- gem.add_dependency 'rails', '>=3.0.0.rc'
+ gem.add_dependency 'rails', '>=3.0.0'
gem.add_dependency "will_paginate", ">= 3.0.pre2"
gem.add_dependency "meta_where", ">= 0.5.2"
gem.add_dependency "i18n", ">= 0.4.1"
View
5 VERSION.yml
@@ -1,5 +0,0 @@
----
-:major: 0
-:minor: 1
-:build:
-:patch: 6
View
9 app/controllers/logged_exceptions_controller.rb
@@ -42,11 +42,16 @@ def query
end
def show
- @exception = LoggedException.find params[:id]
+ @exception = LoggedException.where(:id => params[:id]).first
+
+ respond_to do |format|
+ format.js
+ format.html
+ end
end
def destroy
- @exception = LoggedException.find params[:id]
+ @exception = LoggedException.where(:id => params[:id]).first
@exception.destroy
end
View
3 app/views/layouts/logged_exceptions.html.erb
@@ -3,7 +3,8 @@
<head>
<title><%= content_for?(:title) ? yield(:title) : "Exception Logger" %></title>
<meta charset="UTF-8" />
- <%= javascript_include_tag :defaults, 'exception_logger.js' %>
+ <%= javascript_include_tag 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js' %>
+ <%= javascript_include_tag 'exception_logger.jquery.js' %>
<%= stylesheet_link_tag 'exception_logger' %>
<%= csrf_meta_tag %>
</head>
View
4 app/views/logged_exceptions/_exceptions.html.erb
@@ -1,6 +1,6 @@
<div id="exceptions">
<div class="pages">
- <%= link_to 'Delete Visible', { :action => 'destroy_all' }, :method => :post, :remote => true, :onclick => "ExceptionLogger.deleteAllRequest()" %>
+ <%= link_to 'Delete Visible', { :action => 'destroy_all' }, :class => 'delete_visible' %>
<% if @exceptions.total_pages > 1 %>
:: Pages: <strong><%= pagination_remote_links @exceptions %></strong>
<% end %>
@@ -18,7 +18,7 @@
<% @exceptions.each do |exception| %>
<tr id="<%= dom_id(exception) %>" class="<%= cycle("eor", "") %> exception">
<td>
- <div class="expclass"><%= link_to exception.name, {:action => "show", :id => exception}, :remote => true %></div>
+ <div class="expclass"><%= link_to exception.name, {:action => "show", :id => exception} %></div>
<span class="message"><%= h exception.message %></span>
</td>
<td class="time"><%= pretty_exception_date(exception) %></td>
View
2 app/views/logged_exceptions/_show.html.erb
@@ -1,7 +1,7 @@
<div class="tools">
<%= link_to 'Delete', { :action => 'destroy', :id => @exception }, :method => :delete, :remote => :true, :class => "util" %>
<span class="pipe">|</span>
- <%= link_to "Close", logged_exceptions_url, :remote => true, :onclick => "$('showpage').style.display='none'; return false;", :class => "util" %>
+ <%= link_to "Close", "#", :class => "util close_detail" %>
</div>
<div class="date">
View
2 app/views/logged_exceptions/show.js.erb
@@ -0,0 +1,2 @@
+$('#showpage').html('<%= escape_javascript render :partial => "show" %>');
+$('#showpage').show();
View
2 app/views/logged_exceptions/show.js.rjs
@@ -1,2 +0,0 @@
-page[:showpage].replace_html :partial => "show"
-page[:showpage].visual_effect :blind_down, :duration => 0.25
View
138 exception_logger.gemspec
@@ -0,0 +1,138 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{exception_logger}
+ s.version = "0.1.6"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Roland Guem"]
+ s.date = %q{2011-02-21}
+ s.description = %q{Logs exceptions inside a database table. Now available as gem for Rails3 (previously a plugin for Rails2)}
+ s.email = %q{roland.guem@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ "app/controllers/logged_exceptions_controller.rb",
+ "app/helpers/logged_exceptions_helper.rb",
+ "app/models/logged_exception.rb",
+ "app/views/layouts/logged_exceptions.html.erb",
+ "app/views/logged_exceptions/_exceptions.html.erb",
+ "app/views/logged_exceptions/_feed.html.erb",
+ "app/views/logged_exceptions/_show.html.erb",
+ "app/views/logged_exceptions/destroy.js.rjs",
+ "app/views/logged_exceptions/destroy_all.js.rjs",
+ "app/views/logged_exceptions/index.html.erb",
+ "app/views/logged_exceptions/query.js.rjs",
+ "app/views/logged_exceptions/query.xml.builder",
+ "app/views/logged_exceptions/show.html.erb",
+ "app/views/logged_exceptions/show.js.rjs",
+ "config/initializers/date_formats.rb",
+ "config/locales/en.yml",
+ "config/routes.rb",
+ "lib/exception_loggable_controller_mixin.rb",
+ "lib/exception_logger.rb",
+ "lib/exception_logger/engine.rb",
+ "lib/exception_logger/exception_loggable.rb",
+ "lib/generators/exception_logger/migration/migration_generator.rb",
+ "lib/generators/exception_logger/migration/templates/migration.rb",
+ "lib/generators/exception_logger/stylescripts/stylescripts_generator.rb",
+ "lib/logged_exception_rake.rb",
+ "lib/railties/tasks.rake",
+ "public/javascripts/exception_logger.js",
+ "public/javascripts/exception_logger_jquery.js",
+ "public/stylesheets/exception_logger.css"
+ ]
+ s.homepage = %q{http://github.com/QuBiT/exception_logger}
+ s.post_install_message = %q{
+_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_
+ Thank you for installing exception_logger.
+ Please be sure to read the README and HISTORY on
+ http://github.com/QuBiT/exception_logger
+ for important information about this release. Happy logging!
+_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_()_
+ }
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.3.7}
+ s.summary = %q{Exception Logger for Rails 3}
+ s.test_files = [
+ "test/controllers/logged_exceptions_controller_test.rb",
+ "test/models/logged_exception_test.rb",
+ "test/rails_root/Gemfile",
+ "test/rails_root/Gemfile.lock",
+ "test/rails_root/app/controllers/application_controller.rb",
+ "test/rails_root/test/factories/exception_logger.rb",
+ "test/test_helper.rb"
+ ]
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<sqlite3-ruby>, [">= 0"])
+ s.add_runtime_dependency(%q<shoulda>, [">= 2.11.3"])
+ s.add_runtime_dependency(%q<factory_girl_rails>, [">= 1.0.0"])
+ s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.3.1"])
+ s.add_runtime_dependency(%q<capybara>, [">= 0.3.9"])
+ s.add_runtime_dependency(%q<database_cleaner>, [">= 0.5.2"])
+ s.add_runtime_dependency(%q<cucumber-rails>, [">= 0.3.2"])
+ s.add_runtime_dependency(%q<cucumber>, [">= 0.8.5"])
+ s.add_runtime_dependency(%q<launchy>, [">= 0.3.7"])
+ s.add_runtime_dependency(%q<will_paginate>, [">= 3.0.pre2"])
+ s.add_runtime_dependency(%q<meta_where>, [">= 0.5.2"])
+ s.add_runtime_dependency(%q<i18n>, [">= 0.4.1"])
+ s.add_runtime_dependency(%q<exception_logger>, [">= 0"])
+ s.add_runtime_dependency(%q<rails>, [">= 3.0"])
+ s.add_runtime_dependency(%q<will_paginate>, [">= 3.0.pre2"])
+ s.add_runtime_dependency(%q<meta_where>, [">= 0.5.2"])
+ s.add_runtime_dependency(%q<i18n>, [">= 0.4.1"])
+ s.add_development_dependency(%q<shoulda>, [">= 2.11.3"])
+ else
+ s.add_dependency(%q<rails>, ["= 3.0.0.rc"])
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
+ s.add_dependency(%q<shoulda>, [">= 2.11.3"])
+ s.add_dependency(%q<factory_girl_rails>, [">= 1.0.0"])
+ s.add_dependency(%q<nokogiri>, [">= 1.4.3.1"])
+ s.add_dependency(%q<capybara>, [">= 0.3.9"])
+ s.add_dependency(%q<database_cleaner>, [">= 0.5.2"])
+ s.add_dependency(%q<cucumber-rails>, [">= 0.3.2"])
+ s.add_dependency(%q<cucumber>, [">= 0.8.5"])
+ s.add_dependency(%q<launchy>, [">= 0.3.7"])
+ s.add_dependency(%q<will_paginate>, [">= 3.0.pre2"])
+ s.add_dependency(%q<meta_where>, [">= 0.5.2"])
+ s.add_dependency(%q<i18n>, [">= 0.4.1"])
+ s.add_dependency(%q<exception_logger>, [">= 0"])
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
+ s.add_dependency(%q<will_paginate>, [">= 3.0.pre2"])
+ s.add_dependency(%q<meta_where>, [">= 0.5.2"])
+ s.add_dependency(%q<i18n>, [">= 0.4.1"])
+ s.add_dependency(%q<shoulda>, [">= 2.11.3"])
+ end
+ else
+ s.add_dependency(%q<rails>, ["= 3.0.0.rc"])
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
+ s.add_dependency(%q<shoulda>, [">= 2.11.3"])
+ s.add_dependency(%q<factory_girl_rails>, [">= 1.0.0"])
+ s.add_dependency(%q<nokogiri>, [">= 1.4.3.1"])
+ s.add_dependency(%q<capybara>, [">= 0.3.9"])
+ s.add_dependency(%q<database_cleaner>, [">= 0.5.2"])
+ s.add_dependency(%q<cucumber-rails>, [">= 0.3.2"])
+ s.add_dependency(%q<cucumber>, [">= 0.8.5"])
+ s.add_dependency(%q<launchy>, [">= 0.3.7"])
+ s.add_dependency(%q<will_paginate>, [">= 3.0.pre2"])
+ s.add_dependency(%q<meta_where>, [">= 0.5.2"])
+ s.add_dependency(%q<i18n>, [">= 0.4.1"])
+ s.add_dependency(%q<exception_logger>, [">= 0"])
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
+ s.add_dependency(%q<will_paginate>, [">= 3.0.pre2"])
+ s.add_dependency(%q<meta_where>, [">= 0.5.2"])
+ s.add_dependency(%q<i18n>, [">= 0.4.1"])
+ s.add_dependency(%q<shoulda>, [">= 2.11.3"])
+ end
+end
+
View
12 public/javascripts/exception_logger.jquery.js
@@ -0,0 +1,12 @@
+$(function () {
+ $('.expclass a').live('click', function(event) {
+ $.get($(this).attr("href"));
+ return false;
+ });
+
+ $('.close_detail').live('click', function(event) {
+ $("#showpage").hide();
+ return false;
+ });
+});
+
View
2 public/javascripts/exception_logger.js
@@ -78,4 +78,4 @@ Ajax.Responders.register({
onComplete: function() {
if($('activity') && Ajax.activeRequestCount == 0) $('activity').visualEffect('fade', {duration:0.25});
}
-});
+});

0 comments on commit 56e8e31

Please sign in to comment.