Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ ruby:
config_file: .rubocop.yml
haml:
config_file: .haml-lint.yml
eslint:
enabled: false
3 changes: 3 additions & 0 deletions .rubocop-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Style/IfUnlessModifier:
Style/StringLiterals:
Enabled: false

Style/TrailingCommaInArguments:
Enabled: false

TrailingCommaInHashLiteral:
Enabled: false

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ group :test do
gem 'codeclimate-test-reporter', '~> 0.6.0', require: nil
gem 'rails-controller-testing' # Rails 4 fallback
gem 'webmock', '~> 3.4'
gem 'timecop'

# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
timecop (0.9.1)
turbolinks (5.2.0)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
Expand Down Expand Up @@ -505,6 +506,7 @@ DEPENDENCIES
sprockets
strip_attributes
test-unit (~> 3.0)
timecop
turbolinks (~> 5)
uglifier (>= 1.3.0)
valid_attribute
Expand Down
5 changes: 5 additions & 0 deletions app/assets/javascripts/manage/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
//= require popper
//= require bootstrap
//= require ../vendor/datatables.min
//= require ../vendor/codemirror
//= require ../vendor/codemirror-modes/htmlmixed
//= require ../vendor/codemirror-modes/xml
//= require ../vendor/codemirror-modes/css
//= require selectize
//= require_directory ./lib

Expand All @@ -18,6 +22,7 @@ function applicationReady() {
setupSimpleMde();
setupEmailEvents();
setupManageForms();
setupCodeMirror();

$.ajaxSetup({
beforeSend: function(xhr) {
Expand Down
9 changes: 9 additions & 0 deletions app/assets/javascripts/manage/lib/codeMirror.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function setupCodeMirror() {
$('[data-code-mirror-textarea]').each(function(i, element) {
var myCodeMirror = CodeMirror.fromTextArea(element, {
lineNumbers: true,
mode: 'htmlmixed',
});
myCodeMirror.setSize(null, window.innerHeight - 200);
});
}
Loading