parent
a977c0ceb3
commit
1ded44610b
@ -4,6 +4,8 @@ env:
|
||||
browser: true
|
||||
jquery: true
|
||||
extends: 'eslint:recommended'
|
||||
plugins:
|
||||
- ignore-erb
|
||||
rules:
|
||||
indent:
|
||||
- error
|
||||
|
@ -14,13 +14,7 @@
|
||||
//= require jquery_ujs
|
||||
//= require turbolinks
|
||||
//= require modernizr-lite/modernizr
|
||||
//= require jquery-linedtextarea-moser
|
||||
|
||||
//= require button-group
|
||||
//= require form-animation
|
||||
//= require summary-edit
|
||||
//= require textarea-limit
|
||||
//= require live-coder
|
||||
|
||||
|
||||
//= require admin
|
||||
//= require forms/button-group
|
||||
//= require forms/animations
|
||||
//= require forms/textarea-limit
|
||||
|
@ -7,6 +7,7 @@ $textInput.each(function() {
|
||||
$(this).prev('label').addClass('animate');
|
||||
}
|
||||
});
|
||||
|
||||
$textInput.on('focus', function() {
|
||||
$(this).prev('label').addClass('animate');
|
||||
}).on('focusout', function() {
|
2
app/assets/javascripts/live-coder.js
Normal file
2
app/assets/javascripts/live-coder.js
Normal file
@ -0,0 +1,2 @@
|
||||
//= require live-coder/linedtextarea
|
||||
//= require live-coder/editor
|
@ -18,9 +18,7 @@ function updateResults(elem) {
|
||||
|
||||
var jqueryNode = document.createElement("script");
|
||||
jqueryNode.setAttribute("type", "text/javascript");
|
||||
// TODO: fix eslint runner to handle erb snippets
|
||||
// jqueryNode.setAttribute("src", "<%= "//#{ENV['full_app_url']}#{javascript_path "jquery"}" %>");
|
||||
jqueryNode.setAttribute("src", "https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js");
|
||||
jqueryNode.setAttribute("src", "<%= "//#{ENV['full_app_url']}#{javascript_path "jquery"}" %>");
|
||||
iHead.appendChild(jqueryNode);
|
||||
|
||||
var codeStyle = document.createElement("style");
|
@ -28,4 +28,14 @@ module ApplicationHelper
|
||||
%w(Coder live_code)
|
||||
], selected: (val.blank? ? '' : val))
|
||||
end
|
||||
|
||||
# include javascript only once
|
||||
# Allows the safe loading of js dependencies in partials multiple times.
|
||||
def content_for_javascript_once code_label, &block
|
||||
@js_blocks ||= []
|
||||
return if @js_blocks.include? code_label
|
||||
|
||||
@js_blocks << code_label
|
||||
content_for :custom_javascipt, &block
|
||||
end
|
||||
end
|
||||
|
@ -1,3 +1,9 @@
|
||||
<%
|
||||
content_for_javascript_once 'live-coder' do
|
||||
javascript_include_tag "live-coder"
|
||||
end
|
||||
%>
|
||||
|
||||
<div data-id="live-coder-answer">
|
||||
<div class="code-input">
|
||||
<label for="question_input_options_html">HTML</label>
|
||||
|
@ -45,6 +45,8 @@
|
||||
|
||||
<!--[if ! lte IE 8]><!-->
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'admin', 'data-turbolinks-track': 'reload' %>
|
||||
<%= yield :custom_javascipt %>
|
||||
<!--<![endif]-->
|
||||
</body>
|
||||
</html>
|
||||
|
@ -52,6 +52,7 @@
|
||||
|
||||
<!--[if ! lte IE 8]><!-->
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||
<%= yield :custom_javascipt %>
|
||||
<!--<![endif]-->
|
||||
|
||||
</body>
|
||||
|
@ -1,4 +1,8 @@
|
||||
<%
|
||||
content_for_javascript_once 'live-coder' do
|
||||
javascript_include_tag "live-coder"
|
||||
end
|
||||
|
||||
option_id = "#{question.question_id}_finish-later"
|
||||
checkbox_html = {class: 'checkbox',
|
||||
id: "answer_#{option_id}",
|
||||
|
@ -2,6 +2,9 @@
|
||||
content_for :title, "Skills Assessment"
|
||||
content_for :footer_title, "Skills Assessment"
|
||||
content_for :progress, @status.progress.to_s
|
||||
content_for_javascript_once 'summary-edit' do
|
||||
javascript_include_tag "summary-edit"
|
||||
end
|
||||
%>
|
||||
|
||||
<main class="summary_tpl">
|
||||
|
@ -11,5 +11,5 @@ Rails.application.config.assets.version = '1.0'
|
||||
# Rails.application.config.assets.precompile += %w( search.js )
|
||||
|
||||
Rails.application.config.assets.precompile += ['vendor/assets/**/*']
|
||||
Rails.application.config.assets.precompile += %w(ie9.js)
|
||||
Rails.application.config.assets.precompile += %w(ie9.js admin.js summary-edit.js live-coder.js)
|
||||
Rails.application.config.assets.precompile += %w(mailers/foundation_vendor_manifest.scss)
|
||||
|
@ -4,7 +4,8 @@
|
||||
"description": "rails-dev assets",
|
||||
"dependencies": {
|
||||
"bower": "^1.7.9",
|
||||
"eslint": "^3.2.2"
|
||||
"eslint": "^3.2.2",
|
||||
"eslint-plugin-ignore-erb": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"repository": {
|
||||
|
Loading…
Reference in New Issue
Block a user