Permalink
Browse files

Renamed ApplicationHelperPatch to StealthCssHelper

* Releasing Carsten Schurig's support for custom css as v0.3.0
  • Loading branch information...
teleological committed Feb 29, 2012
1 parent 033e7b3 commit 69106082da22f16f45526e9a18253a6892aa8961
Showing with 9 additions and 16 deletions.
  1. +1 −2 assets/javascripts/stealth.js
  2. +3 −3 init.rb
  3. +3 −9 lib/{application_helper_patch.rb → stealth_css_helper.rb}
  4. +2 −2 lib/stealth_hooks.rb
@@ -1,8 +1,7 @@
function toggleStealthClassesOnBody() {
el = $$('body')[0]
- if (el.hasClassName('stealth_on'))
- {
+ if (el.hasClassName('stealth_on')) {
el.removeClassName('stealth_on');
el.addClassName('stealth_off');
} else {
View
@@ -11,7 +11,7 @@
author 'Riley Lynch'
description 'Enables users to disable Redmine email notifications ' +
'for their actions'
- version '0.2.2'
+ version '0.3.0'
if respond_to?(:url)
url 'http://teleological.github.com/redmine-stealth-plugin'
@@ -51,8 +51,8 @@
end
require 'dispatcher'
-require 'application_helper_patch'
+require 'stealth_css_helper'
Dispatcher.to_prepare do
- ApplicationHelper.send(:include, ApplicationHelperPatch)
+ ApplicationHelper.send(:include, StealthCssHelper)
end
@@ -1,8 +1,7 @@
require_dependency 'application_helper'
-module ApplicationHelperPatch
+module StealthCssHelper
def self.included(base) # :nodoc:
- base.extend(ClassMethods)
base.send(:include, InstanceMethods)
base.class_eval do
@@ -11,18 +10,13 @@ def self.included(base) # :nodoc:
end
end
- module ClassMethods
- end
-
module InstanceMethods
def body_css_classes_with_stealth
- css = body_css_classes_without_stealth
if ::RedmineStealth.cloaked?
- css += ' stealth_on'
+ body_css_classes_without_stealth += ' stealth_on'
else
- css += ' stealth_off'
+ body_css_classes_without_stealth += ' stealth_off'
end
- return css
end
end
end
View
@@ -6,8 +6,8 @@ def controller_account_success_authentication_after(context={})
end
def view_layouts_base_html_head(context={})
- js = javascript_include_tag 'stealth.js', :plugin => 'redmine-stealth-plugin'
- js
+ javascript_include_tag 'stealth.js',
+ :plugin => 'redmine-stealth-plugin'
end
end
end

0 comments on commit 6910608

Please sign in to comment.