redmine-neopoly_style 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +8 -0
- data/assets/images/favicon.ico +0 -0
- data/assets/javascripts/neopoly_style.js +77 -0
- data/assets/stylesheets/neopoly_style.css +14 -0
- data/lib/neopoly_style/engine.rb +10 -0
- data/lib/neopoly_style/hooks.rb +17 -0
- data/lib/neopoly_style/infos.rb +11 -0
- data/lib/neopoly_style/patches/application_helper_patch.rb +16 -0
- data/lib/neopoly_style/patches.rb +17 -0
- data/lib/neopoly_style/redmine_plugin.rb +37 -0
- data/lib/neopoly_style/version.rb +3 -0
- data/lib/redmine-neopoly_style.rb +7 -0
- data/redmine-neopoly_style.gemspec +27 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3329375d8b84626fda45f6fd33bd9b85904e3c72
|
4
|
+
data.tar.gz: 4cb8f410e5cd4479455851d0019e456f6d8e5426
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fe2ff7cabb3e8c1c9b02b0943a2c2b56bbf0535d3f335444af0cb012afb5283c3b2221b9e128872dfccf2cf2787b0a136717a86dd925c05d56bee80a99211d4e
|
7
|
+
data.tar.gz: abe658f187745814f9060ba11a1104c99330142ca0aa79807f3a6896cf73c9b98a5229f5197a5a529e458bf9d34a357730dd8c9f4bc6063e278dcc7cbf3182e2
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Jonas Thiel
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# redmine-neopoly_style
|
2
|
+
|
3
|
+
Custom style overrides for Redmine
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Ensure you have a `Gemfile.local` file in your Redmine installation. Add to your `Gemfile.local`:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem "redmine-neopoly_style"
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Restart the Redmine application
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
No further steps needed
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/redmine-neopoly_style/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
Binary file
|
@@ -0,0 +1,77 @@
|
|
1
|
+
(function($) {
|
2
|
+
$(function(){
|
3
|
+
|
4
|
+
var wiki = $("#content .wiki").first();
|
5
|
+
if(wiki.size() > 0 && !wiki.is("#preview")) {
|
6
|
+
// on wiki page
|
7
|
+
|
8
|
+
// BUILD TOC ---------------------------------------------------
|
9
|
+
var toc = $('<div style="z-index: 9999; width: auto; padding: 8px; background-color: #fafafa; border: 1px solid #dedede; position: absolute; margin: -20px 0 0 20px;"/>').hide();
|
10
|
+
wiki.prepend(toc);
|
11
|
+
wiki.prepend($(" <a href='#' style='position: absolute; margin-left: -30px; font-weight: normal; font-size: 0.7em;' title='Table of contents'>TOC</a>").click(function() { toc.toggle("fast"); return false;}));
|
12
|
+
|
13
|
+
var append_link = function() {
|
14
|
+
var e = $(this);
|
15
|
+
if(e.is(".end-fold")) return;
|
16
|
+
var pref = "";
|
17
|
+
if(e.is("h2")) pref = " ";
|
18
|
+
if(e.is("h3")) pref = " ";
|
19
|
+
if(e.is("h4")) pref = " ";
|
20
|
+
if(e.is("h5")) pref = " ";
|
21
|
+
if(e.is("h6")) pref = " ";
|
22
|
+
|
23
|
+
var cl = e.clone();
|
24
|
+
|
25
|
+
var l = $("a", cl);
|
26
|
+
if(l.size() > 0) {
|
27
|
+
l.detach();
|
28
|
+
cl.wrapInner("<a href='" + l.attr("href") + "'/>");
|
29
|
+
}
|
30
|
+
|
31
|
+
toc.append(pref + cl.html() + "<br/>");
|
32
|
+
};
|
33
|
+
|
34
|
+
$("h1, h2, h3, h4, h5, h6", wiki).each(append_link);
|
35
|
+
|
36
|
+
// BUILD ROLL-NEXT --------------------------------
|
37
|
+
var build_roll_next = function() {
|
38
|
+
var e = $(this).click(function() {
|
39
|
+
if(e.hasClass("rolled-out")) {
|
40
|
+
e.removeClass("rolled-out");
|
41
|
+
var n = e.next();
|
42
|
+
while(n && n.size() > 0 && !n.is(".end-fold")) {
|
43
|
+
n.hide("fast");
|
44
|
+
n = n.next();
|
45
|
+
}
|
46
|
+
$(".fold-indicator", e).animate({ borderBottomWidth: "2px", height: "18px", width: "180px", opacity: 1}, "fast");
|
47
|
+
} else {
|
48
|
+
e.addClass("rolled-out");
|
49
|
+
var n = e.next();
|
50
|
+
while(n && n.size() > 0 && !n.is(".end-fold")) {
|
51
|
+
n.show("fast");
|
52
|
+
n = n.next();
|
53
|
+
}
|
54
|
+
$(".fold-indicator", e).animate({ borderBottomWidth: 0, height: "60px", width: "0", opacity: 0.6 }, "fast");
|
55
|
+
}
|
56
|
+
}).attr("title", "Click to toggle fold").prepend("<div class='fold-indicator' style='position: absolute; height: 18px; width: 180px; margin-left: -5px; border-left: 2px solid #cccccc; border-bottom: 2px solid #cccccc;'/>").css("cursor", "pointer").hover(function(){
|
57
|
+
// over
|
58
|
+
$(e).css("backgroundColor", "#fafafa");
|
59
|
+
}, function() {
|
60
|
+
// out
|
61
|
+
$(e).css("background", "none");
|
62
|
+
});
|
63
|
+
|
64
|
+
// HIDE TIPP END-FOLD
|
65
|
+
var n = e.next();
|
66
|
+
while(n && n.size() > 0 && !n.is(".end-fold")) {
|
67
|
+
n.hide();
|
68
|
+
n = n.next();
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
$(".start-fold").each(build_roll_next);
|
73
|
+
$(".end-fold").hide();
|
74
|
+
}
|
75
|
+
|
76
|
+
});
|
77
|
+
})(jQuery);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module NeopolyStyle
|
2
|
+
class Hooks < Redmine::Hook::ViewListener
|
3
|
+
def view_layouts_base_html_head(_context)
|
4
|
+
javascript_tags + stylesheet_tags
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def javascript_tags
|
10
|
+
javascript_include_tag "neopoly_style", plugin: "neopoly_style"
|
11
|
+
end
|
12
|
+
|
13
|
+
def stylesheet_tags
|
14
|
+
stylesheet_link_tag "neopoly_style", plugin: "neopoly_style"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module NeopolyStyle
|
2
|
+
module Infos
|
3
|
+
NAME = "redmine-neopoly_style"
|
4
|
+
DESCRIPTION = "Custom style overrides for Redmine"
|
5
|
+
LICENSE = "MIT"
|
6
|
+
URL = "https://github.com/neopoly/redmine-neopoly_style"
|
7
|
+
AUTHORS = {
|
8
|
+
"Jonas Thiel" => "jt@neopoly.de"
|
9
|
+
}.freeze
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module NeopolyStyle
|
2
|
+
module Patches
|
3
|
+
module ApplicationHelperPatch
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
alias_method_chain :favicon_path, :neopoly_style
|
8
|
+
end
|
9
|
+
|
10
|
+
def favicon_path_with_neopoly_style
|
11
|
+
path = "/plugin_assets/neopoly_style/images/favicon.ico"
|
12
|
+
image_path(path)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "neopoly_style/patches/application_helper_patch"
|
2
|
+
|
3
|
+
module NeopolyStyle
|
4
|
+
# This module holds all patches of a default Redmine application
|
5
|
+
module Patches
|
6
|
+
# Apply all patches
|
7
|
+
def self.apply!
|
8
|
+
apply_to(::ApplicationHelper, ApplicationHelperPatch)
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def self.apply_to(target, mod)
|
14
|
+
target.send(:include, mod)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "neopoly_style/patches"
|
2
|
+
|
3
|
+
module NeopolyStyle
|
4
|
+
# Registers this gems a Redmine plugin and applies the needed patches
|
5
|
+
class RedminePlugin
|
6
|
+
include NeopolyStyle::Infos
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
register!
|
10
|
+
boot!
|
11
|
+
mirror_assets!
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def register!
|
17
|
+
@plugin = Redmine::Plugin.register :neopoly_style do
|
18
|
+
name NAME
|
19
|
+
author AUTHORS.keys.join(", ")
|
20
|
+
description DESCRIPTION
|
21
|
+
version VERSION
|
22
|
+
url URL
|
23
|
+
author_url URL
|
24
|
+
directory Engine.root
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def boot!
|
29
|
+
require "neopoly_style/hooks"
|
30
|
+
Patches.apply!
|
31
|
+
end
|
32
|
+
|
33
|
+
def mirror_assets!
|
34
|
+
@plugin.mirror_assets
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "neopoly_style/version"
|
5
|
+
require "neopoly_style/infos"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "redmine-neopoly_style"
|
9
|
+
spec.version = NeopolyStyle::VERSION
|
10
|
+
spec.authors = NeopolyStyle::Infos::AUTHORS.keys
|
11
|
+
spec.email = NeopolyStyle::Infos::AUTHORS.values
|
12
|
+
spec.summary = NeopolyStyle::Infos::DESCRIPTION
|
13
|
+
spec.description = NeopolyStyle::Infos::DESCRIPTION
|
14
|
+
spec.homepage = NeopolyStyle::Infos::URL
|
15
|
+
spec.license = NeopolyStyle::Infos::LICENSE
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0")
|
18
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency "rails", "~> 4.2.0"
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rubocop"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: redmine-neopoly_style
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jonas Thiel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.7'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Custom style overrides for Redmine
|
70
|
+
email:
|
71
|
+
- jt@neopoly.de
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rubocop.yml"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- assets/images/favicon.ico
|
83
|
+
- assets/javascripts/neopoly_style.js
|
84
|
+
- assets/stylesheets/neopoly_style.css
|
85
|
+
- lib/neopoly_style/engine.rb
|
86
|
+
- lib/neopoly_style/hooks.rb
|
87
|
+
- lib/neopoly_style/infos.rb
|
88
|
+
- lib/neopoly_style/patches.rb
|
89
|
+
- lib/neopoly_style/patches/application_helper_patch.rb
|
90
|
+
- lib/neopoly_style/redmine_plugin.rb
|
91
|
+
- lib/neopoly_style/version.rb
|
92
|
+
- lib/redmine-neopoly_style.rb
|
93
|
+
- redmine-neopoly_style.gemspec
|
94
|
+
homepage: https://github.com/neopoly/redmine-neopoly_style
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.4.6
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: Custom style overrides for Redmine
|
118
|
+
test_files: []
|
119
|
+
has_rdoc:
|