redmine-cmd_submit 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5496ff69fb04cc5266d0edcc712a0180cdce6a17
4
+ data.tar.gz: a54ff3240cf945c319bdcf2147fe1ae74610cf8f
5
+ SHA512:
6
+ metadata.gz: af50570ceebb4578863d81ba9d26e611a3e68dd97194f8be7f8a5cbef241dd74b0da0e9a22c347507ac1bb268a365cce8927aa35c14a33fac3ed3299efeeb10e
7
+ data.tar.gz: ef1a21e77eea6ced60f9be9a164c4ef3f0009e26f711d7f453a73d0cc551fb430ce43f3891f477d15cf0e5f2dffbe416e3c21b5718c1026c0a0e39a4852bca87
@@ -0,0 +1,2 @@
1
+ Gemfile.lock
2
+ pkg
@@ -0,0 +1,12 @@
1
+ StringLiterals:
2
+ EnforcedStyle: "double_quotes"
3
+
4
+ Style/FileName:
5
+ Enabled: false
6
+
7
+ Documentation:
8
+ Enabled: false
9
+
10
+ Lint/HandleExceptions:
11
+ Exclude:
12
+ - rakelib/rubocop.rake
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in redmine-cmd_submit.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2016 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.
@@ -0,0 +1,45 @@
1
+ [github]: https://github.com/neopoly/redmine-cmd_submit
2
+ [doc]: http://rubydoc.info/github/neopoly/redmine-cmd_submit/master/file/README.md
3
+ [gem]: https://rubygems.org/gems/redmine-cmd_submit
4
+ [gem-badge]: https://img.shields.io/gem/v/redmine-cmd_submit.svg
5
+ [inchpages]: https://inch-ci.org/github/neopoly/redmine-cmd_submit
6
+ [inchpages-badge]: https://inch-ci.org/github/neopoly/redmine-cmd_submit.svg?branch=master&style=flat
7
+
8
+ # redmine-cmd_submit
9
+
10
+ [![Gem Version][gem-badge]][gem]
11
+ [![Inline docs][inchpages-badge]][inchpages]
12
+
13
+ [Gem][gem] |
14
+ [Source][github] |
15
+ [Documentation][doc]
16
+
17
+ Submit from textareas with cmd-enter (ctrl-enter) for Redmine.
18
+
19
+ ## Installation
20
+
21
+ Ensure you have a `Gemfile.local` file in your Redmine installation. Add to your `Gemfile.local`:
22
+
23
+ ```ruby
24
+ gem "redmine-cmd_submit"
25
+ ```
26
+
27
+ And then execute:
28
+
29
+ ```
30
+ $ bundle
31
+ ```
32
+
33
+ Restart the Redmine application
34
+
35
+ ## Usage
36
+
37
+ No further steps needed
38
+
39
+ ## Contributing
40
+
41
+ 1. Fork it ( https://github.com/neopoly/redmine-cmd_submit/fork )
42
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
43
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
44
+ 4. Push to the branch (`git push origin my-new-feature`)
45
+ 5. Create a new Pull Request
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env rake
2
+
3
+ require "bundler/gem_tasks"
@@ -0,0 +1,18 @@
1
+ (function($) {
2
+ "use strict";
3
+
4
+ $(document).on("keydown", "form textarea", function(evt) {
5
+ var $ui = $(this);
6
+ if(evt.keyCode == 13 && (evt.metaKey || evt.ctrlKey)) {
7
+ // mark changes of this textarea to be committed
8
+ $ui.removeData("changed");
9
+ // prevent the next change handler, which would mark this textarea
10
+ // as "changed" again.
11
+ $ui.one("change", function(evt) {
12
+ evt.stopPropagation();
13
+ });
14
+ $ui.parents("form").submit();
15
+ }
16
+ });
17
+
18
+ })(jQuery);
@@ -0,0 +1,10 @@
1
+ require "cmd_submit/redmine_plugin"
2
+
3
+ module CmdSubmit
4
+ # Simple engine to support the Redmine plugin
5
+ class Engine < ::Rails::Engine
6
+ config.to_prepare do
7
+ RedminePlugin.new
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,16 @@
1
+ module CmdSubmit
2
+ # Includes special javascript files into the base layout
3
+ class Hooks < Redmine::Hook::ViewListener
4
+ # Inject javascript and stylesheet tags
5
+ # @param _context [Hash] ignored
6
+ def view_layouts_base_html_head(_context)
7
+ javascript_tags
8
+ end
9
+
10
+ private
11
+
12
+ def javascript_tags
13
+ javascript_include_tag "cmd_submit", plugin: "cmd_submit"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ module CmdSubmit
2
+ # Shared infos between the gemspec and the plugin
3
+ module Infos
4
+ NAME = "redmine-cmd_submit".freeze
5
+ DESCRIPTION = "Submit from textareas with cmd-enter in Redmine".freeze
6
+ LICENSE = "MIT".freeze
7
+ URL = "https://github.com/neopoly/redmine-cmd_submit".freeze
8
+ AUTHORS = {
9
+ "Jonas Thiel" => "jt@neopoly.de"
10
+ }.freeze
11
+ end
12
+ end
@@ -0,0 +1,34 @@
1
+ module CmdSubmit
2
+ # Registers this gems a Redmine plugin and applies the needed patches
3
+ class RedminePlugin
4
+ include CmdSubmit::Infos
5
+
6
+ def initialize
7
+ register!
8
+ boot!
9
+ mirror_assets!
10
+ end
11
+
12
+ private
13
+
14
+ def register!
15
+ @plugin = Redmine::Plugin.register :cmd_submit do
16
+ name NAME
17
+ author AUTHORS.keys.join(", ")
18
+ description DESCRIPTION
19
+ version VERSION
20
+ url URL
21
+ author_url URL
22
+ directory Engine.root
23
+ end
24
+ end
25
+
26
+ def boot!
27
+ require "cmd_submit/hooks"
28
+ end
29
+
30
+ def mirror_assets!
31
+ @plugin.mirror_assets
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,3 @@
1
+ module CmdSubmit
2
+ VERSION = "0.0.1".freeze
3
+ end
@@ -0,0 +1,7 @@
1
+ require "cmd_submit/version"
2
+ require "cmd_submit/infos"
3
+ require "cmd_submit/engine"
4
+
5
+ # Redmine plugin to support submitting forms using cmd-enter or ctrl-enter
6
+ module CmdSubmit
7
+ end
@@ -0,0 +1,5 @@
1
+ begin
2
+ require "rubocop/rake_task"
3
+ RuboCop::RakeTask.new
4
+ rescue LoadError
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "cmd_submit/version"
5
+ require "cmd_submit/infos"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.version = CmdSubmit::VERSION
9
+ spec.name = CmdSubmit::Infos::NAME
10
+ spec.authors = CmdSubmit::Infos::AUTHORS.keys
11
+ spec.email = CmdSubmit::Infos::AUTHORS.values
12
+ spec.summary = CmdSubmit::Infos::DESCRIPTION
13
+ spec.description = CmdSubmit::Infos::DESCRIPTION
14
+ spec.homepage = CmdSubmit::Infos::URL
15
+ spec.license = CmdSubmit::Infos::LICENSE
16
+
17
+ spec.files = `git ls-files -z`.split("\x0")
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.11"
23
+ spec.add_development_dependency "rake", "~> 11.1"
24
+ spec.add_development_dependency "rubocop"
25
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: redmine-cmd_submit
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: 2016-03-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.11'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.11'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '11.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '11.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Submit from textareas with cmd-enter in Redmine
56
+ email:
57
+ - jt@neopoly.de
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rubocop.yml"
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - assets/javascripts/cmd_submit.js
69
+ - lib/cmd_submit/engine.rb
70
+ - lib/cmd_submit/hooks.rb
71
+ - lib/cmd_submit/infos.rb
72
+ - lib/cmd_submit/redmine_plugin.rb
73
+ - lib/cmd_submit/version.rb
74
+ - lib/redmine-cmd_submit.rb
75
+ - rakelib/rubocop.rake
76
+ - redmine-cmd_submit.gemspec
77
+ homepage: https://github.com/neopoly/redmine-cmd_submit
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.4.3
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: Submit from textareas with cmd-enter in Redmine
101
+ test_files: []