Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions ace_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,19 @@ function insertLayoutAce() {
var lId = 'L' + window.location.pathname.split("/").pop();
setupEditor(lId, $('#layout_content').prev(), $('#layout_content'));
}
/**
* Inserts Ace elements into a File Manager's file view
*/
function insertFileManagerAce(){
var fId = 'F' + window.location.pathname.split("/").pop();
setupEditor(fId, $('#file_content').prev(), $('#file_content'));
}

function removeFileManagerAce(){
var fId = 'F' + window.location.pathname.split("/").pop();
$('#aceeditor' + fId).remove();
$('#aceoptions' + fId).remove();
}

/**
* main initialization
Expand All @@ -364,6 +377,11 @@ $(document).ready(function() {
if ($('#body_snippet_edit').length > 0) { // we are in SNIPPET
removeSnippetAce();
}
/* edit */
if ($('#body_plugin_file_manager')){ // we are in PLUGIN FILE MANAGER
removeFileManagerAce();
}

}
});

Expand All @@ -376,6 +394,10 @@ $(document).ready(function() {
if ($('#body_snippet_edit').length > 0) { // we are in SNIPPET
insertSnippetAce();
}
/* edit */
if ($('#body_plugin_file_manager')){ // we are in PLUGIN FILE MANAGER
insertFileManagerAce();
}
}
});

Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Observer::observe('view_backend_list_plugin', 'ace_make_settings_div');

$uri = $_SERVER['QUERY_STRING'];
if ( preg_match('/(\/plugin\/ace|page\/edit|snippet\/edit|layout\/edit|page\/add|snippet\/add|layout\/add)/', $uri, $match) )
if ( preg_match('/(\/plugin\/ace|\/plugin\/file_manager|page\/edit|snippet\/edit|layout\/edit|page\/add|snippet\/add|layout\/add)/', $uri, $match) )
ace_include_javascripts();
}

Expand Down Expand Up @@ -72,4 +72,4 @@ function ace_include_javascripts() {
Plugin::addJavascript('ace', 'ace_editor.js');
Plugin::addJavascript('ace', 'build/src-min/ace.js');

}
}