Commit fdfb7925 authored by Martin Urban's avatar Martin Urban
Browse files

Merge

parents 18587a20 d31df7b7
......@@ -40,7 +40,7 @@
top: 0px;
bottom: 0px;
width: 4px;
overflow: auto;
overflow: visible;
z-index: 1;
background-color: #E8E8E8;
}
......@@ -69,7 +69,7 @@
left: 0px;
right: 0px;
height: 4px;
overflow: auto;
overflow: visible;
z-index: 1;
background-color: #E8E8E8;
}
......
......@@ -284,19 +284,36 @@ var CodeEditor = Emitter.extend({
var args = {
"path": path,
callback: function(path) {
var fileExtension = path.split(".").pop().toLowerCase();
if (!~self.view._extension.fileExtensions.indexOf(fileExtension)) {
var msg = "<html>File extension '" + fileExtension +
"' is not supported! <br /> Save anyway?</html>";
self.view.confirm(msg, function(confirmed) {
if (confirmed) {
self.view.POST(vispa.url.dynamic("/ajax/fs/exists"), {
path: path
}).done(function(selectedType) {
var proceedSave = function() {
var fileExtension = path.split(".").pop().toLowerCase();
if (!~self.view._extension.fileExtensions.indexOf(fileExtension)) {
var msg = "<html>File extension '" + fileExtension +
"' is not supported! <br /> Save anyway?</html>";
self.view.confirm(msg, function(confirmed) {
if (confirmed) {
self.save(callback, "new", path);
}
});
} else {
self.save(callback, "new", path);
}
});
} else {
self.save(callback, "new", path);
}
};
if (selectedType == "f") { //selected element is an existing file
var msg = "<html> File exists already! <br />" +
"Do you want to overwrite it ? </html>";
self.view.confirm(msg, function(confirmed) {
if (confirmed)
proceedSave();
else
return;
});
} else
proceedSave();
});
},
sort: ["name", "ext"],
reverse: [false, false]
......
......@@ -29,7 +29,7 @@ var CodeEditorExtension = vispa.Extension.extend({
// register to listen to certain file extensions
this.fileExtensions = ["bsc", "c", "cc", "conf", "cpp", "csh", "css", "diff", "f", "f70",
"f90", "f95", "f03", "h", "hh", "hpp", "html", "ini", "java", "js", "less", "log", "json",
"md", "orig", "php", "py", "pyc", "rb", "sh", "tex", "txt", "xml", "yml", "yaml", "zsh"
"md", "orig", "php", "py", "rb", "sh", "tex", "txt", "xml", "yml", "yaml", "zsh"
];
$.each(this.fileExtensions, function(i, key) {
self.addFileHandler(key, function(workspaceId, path) {
......
......@@ -22,6 +22,24 @@ var CodeEditorUI = Emitter.extend({
this.xDragbar = $(".codeeditor-x-dragbar", this.view._nodes.content);
this.yDragbar = $(".codeeditor-y-dragbar", this.view._nodes.content);
if (vispa.device.hasTouch) {
var xMarker = $("<div />").css({
"height": "15px",
"width": "15px",
"top": "30%",
"position": "absolute"
}).append($("<i />").addClass("glyphicon glyphicon-resize-horizontal"));
var yMarker = $("<div />").css({
"height": "15px",
"width": "15px",
"left": "30%",
"position": "absolute",
"bottom": "0%"
}).append($("<i />").addClass("glyphicon glyphicon-resize-vertical"));
this.xDragbar.append(xMarker);
this.yDragbar.append(yMarker);
}
this.xDragbar.on({
mouseover: function() {
$("body").css("cursor", "col-resize");
......
......@@ -49,11 +49,7 @@ function getFileMenuEntries() {
iconClass: "glyphicon glyphicon-list",
buttonClass: "btn-default",
callback: function() {
if (this._name == "FileBrowser") {
this.fb.changeView(Tableview);
} else {
this.fb.changeView(SelectorTableview);
}
this.fb.changeView(Tableview);
}
}]
}, {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment