BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
674a1aee
Commit
674a1aee
authored
Feb 06, 2017
by
Fatih Acet
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-ace-editor-modules' into 'master'
fix ace editor modules to include asset digest in production See merge request !8869
parents
999edc5c
55d05bf8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
ace_config_paths.js.erb
app/assets/javascripts/lib/ace/ace_config_paths.js.erb
+13
-4
No files found.
app/assets/javascripts/lib/ace/ace_config_paths.js.erb
View file @
674a1aee
...
@@ -7,19 +7,28 @@ ace_modes = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/mode-*.js'].sort.
...
@@ -7,19 +7,28 @@ ace_modes = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/mode-*.js'].sort.
File
.
basename
(
file
,
'.js'
).
sub
(
/^mode-/
,
''
)
File
.
basename
(
file
,
'.js'
).
sub
(
/^mode-/
,
''
)
end
end
%>
%>
// Lazy-load configuration when ace.edit is called
(function() {
(function() {
var basePath;
var ace = window.ace;
var edit = ace.edit;
ace.edit = function() {
window.gon = window.gon || {};
window.gon = window.gon || {};
var
basePath = (window.gon.relative_url_root || '').replace(/\/$/, '') + '/assets/ace';
basePath = (window.gon.relative_url_root || '').replace(/\/$/, '') + '/assets/ace';
ace.config.set('basePath', basePath);
ace.config.set('basePath', basePath);
// configure paths for all worker modules
// configure paths for all worker modules
<%
ace_workers
.
each
do
|
worker
|
%>
<%
ace_workers
.
each
do
|
worker
|
%>
ace.config.setModuleUrl('ace/mode/
<%=
worker
%>
_worker', basePath + '/worker-
<%=
worker
%>
.js
');
ace.config.setModuleUrl('ace/mode/
<%=
worker
%>
_worker', basePath + '/
<%=
File
.
basename
(
asset_path
(
"ace/worker-
#{
worker
}
.js"
))
%>
');
<%
end
%>
<%
end
%>
// configure paths for all mode modules
// configure paths for all mode modules
<%
ace_modes
.
each
do
|
mode
|
%>
<%
ace_modes
.
each
do
|
mode
|
%>
ace.config.setModuleUrl('ace/mode/
<%=
mode
%>
', basePath + '/mode-
<%=
mode
%>
.js
');
ace.config.setModuleUrl('ace/mode/
<%=
mode
%>
', basePath + '/
<%=
File
.
basename
(
asset_path
(
"ace/mode-
#{
mode
}
.js"
))
%>
');
<%
end
%>
<%
end
%>
// restore original method
ace.edit = edit;
return ace.edit.apply(ace, arguments);
};
})();
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment