Add highlightjs editor to view files

This commit is contained in:
2015-04-10 12:43:31 +00:00
parent c143a84841
commit a6634c4207
9 changed files with 210 additions and 120 deletions

View File

@@ -37,8 +37,15 @@ define(['durandal/app', 'durandal/composition', 'plugins/http',
};
ctor.prototype.openFile = function(object, event) {
console.log('File dblclick ', arguments);
};
var type = arguments[0].extra();
http.get(arguments[0].path()).then(function(response) {
app.trigger('filebrowser:open_file', {
type: type,
content: response
});
});
};
ctor.prototype.select = function(object, event) {
if( !event.ctrlKey ) {
$('li > span.select').removeClass('select');
@@ -72,7 +79,7 @@ define(['durandal/app', 'durandal/composition', 'plugins/http',
posX = Math.min(posX - 45, windowWidth - menuWidth - 15);
posY = Math.min(posY - 80, windowHeight - menuHeight - 10);
// affichage
// display
contextMenu.css({
left : posX + 'px',
top : posY + 'px'
@@ -126,10 +133,9 @@ define(['durandal/app', 'durandal/composition', 'plugins/http',
/** End of Context Menu */
http.get('/data/filesystem.json').then(function(response) {
console.log(response);
folder(ko.mapping.fromJS(response));
$('#filebrowser').perfectScrollbar();
});
return ctor;
});