Skip to content
This repository was archived by the owner on Jan 23, 2020. It is now read-only.

Commit 5c8639c

Browse files
committed
ace loaded from cdn
1 parent afbb57e commit 5c8639c

File tree

332 files changed

+109
-468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+109
-468
lines changed

assets/css/styles.css

Lines changed: 18 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/styles.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/app.js

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,36 @@ window.APP = (function (module, $) {
1212
}).width();
1313

1414
$(function() {
15-
$('.code-editor').resizablePanels()
16-
// var success = function(response){
17-
// $('.code-editor').resizablePanels();
18-
// }
19-
// var script = $.getScript('//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js').then(success)
15+
var script,
16+
loadEditor;
17+
18+
loadEditor = function(response){
19+
var $codeBlock = $('.code-editor-panel__codeblock');
20+
21+
$('.code-editor').resizablePanels();
22+
23+
$codeBlock.each(function() {
24+
var id = $(this).attr('id'),
25+
mode = $(this).data('mode'),
26+
thisEditor = ace.edit(id);
27+
28+
thisEditor.setTheme('ace/theme/chrome');
29+
thisEditor.getSession().setMode(mode);
30+
31+
$(window).on('onResizePanels', function() {
32+
thisEditor.resize();
33+
});
34+
});
35+
36+
37+
}
38+
39+
if(typeof ace === 'undefined') {
40+
script = $.getScript('//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js').then(loadEditor)
41+
}
42+
else {
43+
loadEditor();
44+
}
2045
});
2146

2247
return module;

assets/js/libs/ace/ace.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

assets/js/libs/ace/ext-beautify.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

assets/js/libs/ace/ext-chromevox.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

assets/js/libs/ace/ext-elastic_tabstops_lite.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

assets/js/libs/ace/ext-emmet.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

assets/js/libs/ace/ext-error_marker.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)