editor
This commit is contained in:
2
Gemfile
2
Gemfile
@ -28,7 +28,7 @@ gem 'rubytree'
|
||||
gem 'sass-rails', '~> 4.0.3'
|
||||
gem 'sdoc', '~> 0.4.0', group: :doc
|
||||
gem 'slim'
|
||||
gem 'pagedown-bootstrap-rails'
|
||||
gem 'pagedown-rails', '~> 1.1.4'
|
||||
gem 'sorcery'
|
||||
gem 'thread_safe'
|
||||
gem 'turbolinks'
|
||||
|
@ -175,6 +175,8 @@ GEM
|
||||
multi_json (~> 1.3)
|
||||
multi_xml (~> 0.5)
|
||||
rack (>= 1.2, < 3)
|
||||
pagedown-rails (1.1.4)
|
||||
railties (> 3.1)
|
||||
parser (2.3.0.6)
|
||||
ast (~> 2.2)
|
||||
pg (0.18.4)
|
||||
@ -382,6 +384,7 @@ DEPENDENCIES
|
||||
newrelic_rpm
|
||||
nokogiri
|
||||
nyan-cat-formatter
|
||||
pagedown-rails (~> 1.1.4)
|
||||
pg
|
||||
pry
|
||||
puma (~> 2.15.3)
|
||||
@ -410,3 +413,6 @@ DEPENDENCIES
|
||||
uglifier (>= 1.3.0)
|
||||
web-console (~> 2.0)
|
||||
will_paginate (~> 3.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.12.4
|
||||
|
@ -21,3 +21,7 @@
|
||||
//= require turbolinks
|
||||
//= require_tree ../../../lib
|
||||
//= require_tree .
|
||||
//= require markdown.converter
|
||||
//= require markdown.sanitizer
|
||||
//= require markdown.editor
|
||||
|
||||
|
@ -1,16 +1,19 @@
|
||||
(function() {
|
||||
var ACE_FILES_PATH = '/assets/ace/';
|
||||
|
||||
window.MarkdownEditor = function(selector) {
|
||||
(function()
|
||||
{
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
var editor = new Markdown.Editor(converter);
|
||||
editor.run();
|
||||
/*
|
||||
window.MarkdownEditor = function(selector)
|
||||
{
|
||||
ace.config.set('modePath', ACE_FILES_PATH);
|
||||
var editor = ace.edit($(selector).next()[0]);
|
||||
editor.on('change', function() {
|
||||
$(selector).val(editor.getValue());
|
||||
});
|
||||
editor.on('change', function(){ $(selector).val(editor.getValue()); });
|
||||
editor.setShowPrintMargin(false);
|
||||
var session = editor.getSession();
|
||||
session.setMode('markdown');
|
||||
session.setUseWrapMode(true);
|
||||
session.setValue($(selector).val());
|
||||
};
|
||||
};
|
||||
*/
|
||||
})();
|
||||
|
@ -14,4 +14,5 @@
|
||||
*= require_tree ../../../lib
|
||||
*= require_tree ../../../vendor/assets/stylesheets/
|
||||
*= require_self
|
||||
*/
|
||||
*= require markdown
|
||||
*/
|
||||
|
@ -9,7 +9,10 @@
|
||||
.form-group
|
||||
= f.label(: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
|
||||
= f.label(:execution_environment_id)
|
||||
= 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.
|
||||
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
||||
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.
|
||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
||||
# config.i18n.default_locale = :de
|
||||
|
Reference in New Issue
Block a user