editor
This commit is contained in:
2
Gemfile
2
Gemfile
@ -28,7 +28,7 @@ gem 'rubytree'
|
|||||||
gem 'sass-rails', '~> 4.0.3'
|
gem 'sass-rails', '~> 4.0.3'
|
||||||
gem 'sdoc', '~> 0.4.0', group: :doc
|
gem 'sdoc', '~> 0.4.0', group: :doc
|
||||||
gem 'slim'
|
gem 'slim'
|
||||||
gem 'pagedown-bootstrap-rails'
|
gem 'pagedown-rails', '~> 1.1.4'
|
||||||
gem 'sorcery'
|
gem 'sorcery'
|
||||||
gem 'thread_safe'
|
gem 'thread_safe'
|
||||||
gem 'turbolinks'
|
gem 'turbolinks'
|
||||||
|
@ -175,6 +175,8 @@ GEM
|
|||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
multi_xml (~> 0.5)
|
multi_xml (~> 0.5)
|
||||||
rack (>= 1.2, < 3)
|
rack (>= 1.2, < 3)
|
||||||
|
pagedown-rails (1.1.4)
|
||||||
|
railties (> 3.1)
|
||||||
parser (2.3.0.6)
|
parser (2.3.0.6)
|
||||||
ast (~> 2.2)
|
ast (~> 2.2)
|
||||||
pg (0.18.4)
|
pg (0.18.4)
|
||||||
@ -382,6 +384,7 @@ DEPENDENCIES
|
|||||||
newrelic_rpm
|
newrelic_rpm
|
||||||
nokogiri
|
nokogiri
|
||||||
nyan-cat-formatter
|
nyan-cat-formatter
|
||||||
|
pagedown-rails (~> 1.1.4)
|
||||||
pg
|
pg
|
||||||
pry
|
pry
|
||||||
puma (~> 2.15.3)
|
puma (~> 2.15.3)
|
||||||
@ -410,3 +413,6 @@ DEPENDENCIES
|
|||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
web-console (~> 2.0)
|
web-console (~> 2.0)
|
||||||
will_paginate (~> 3.0)
|
will_paginate (~> 3.0)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.12.4
|
||||||
|
@ -21,3 +21,7 @@
|
|||||||
//= require turbolinks
|
//= require turbolinks
|
||||||
//= require_tree ../../../lib
|
//= require_tree ../../../lib
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
//= require markdown.converter
|
||||||
|
//= require markdown.sanitizer
|
||||||
|
//= require markdown.editor
|
||||||
|
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
(function() {
|
(function()
|
||||||
var ACE_FILES_PATH = '/assets/ace/';
|
{
|
||||||
|
var converter = Markdown.getSanitizingConverter();
|
||||||
window.MarkdownEditor = function(selector) {
|
var editor = new Markdown.Editor(converter);
|
||||||
|
editor.run();
|
||||||
|
/*
|
||||||
|
window.MarkdownEditor = function(selector)
|
||||||
|
{
|
||||||
ace.config.set('modePath', ACE_FILES_PATH);
|
ace.config.set('modePath', ACE_FILES_PATH);
|
||||||
var editor = ace.edit($(selector).next()[0]);
|
var editor = ace.edit($(selector).next()[0]);
|
||||||
editor.on('change', function() {
|
editor.on('change', function(){ $(selector).val(editor.getValue()); });
|
||||||
$(selector).val(editor.getValue());
|
|
||||||
});
|
|
||||||
editor.setShowPrintMargin(false);
|
editor.setShowPrintMargin(false);
|
||||||
var session = editor.getSession();
|
var session = editor.getSession();
|
||||||
session.setMode('markdown');
|
session.setMode('markdown');
|
||||||
session.setUseWrapMode(true);
|
session.setUseWrapMode(true);
|
||||||
session.setValue($(selector).val());
|
session.setValue($(selector).val());
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
})();
|
})();
|
||||||
|
@ -14,4 +14,5 @@
|
|||||||
*= require_tree ../../../lib
|
*= require_tree ../../../lib
|
||||||
*= require_tree ../../../vendor/assets/stylesheets/
|
*= require_tree ../../../vendor/assets/stylesheets/
|
||||||
*= require_self
|
*= require_self
|
||||||
*/
|
*= require markdown
|
||||||
|
*/
|
||||||
|
@ -9,7 +9,10 @@
|
|||||||
.form-group
|
.form-group
|
||||||
= f.label(:description)
|
= f.label(:description)
|
||||||
= f.hidden_field(:description)
|
= f.hidden_field(:description)
|
||||||
.form-control.markdown
|
.wmd-panel
|
||||||
|
#wmd-button-bar
|
||||||
|
textarea.wmd-input
|
||||||
|
/=f.input :description, :as => :pagedown, :input_html => { :preview => true }
|
||||||
.form-group
|
.form-group
|
||||||
= f.label(:execution_environment_id)
|
= f.label(:execution_environment_id)
|
||||||
= f.collection_select(:execution_environment_id, @execution_environments, :id, :name, {}, class: 'form-control')
|
= f.collection_select(:execution_environment_id, @execution_environments, :id, :name, {}, class: 'form-control')
|
||||||
|
@ -22,7 +22,8 @@ module CodeOcean
|
|||||||
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
||||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||||
config.time_zone = 'Berlin'
|
config.time_zone = 'Berlin'
|
||||||
|
config.assets.precompile += %w( markdown-buttons.png )
|
||||||
|
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||||
# config.i18n.default_locale = :de
|
# config.i18n.default_locale = :de
|
||||||
|
Reference in New Issue
Block a user