Merge pull request +13985 from c9/ide-fix-various

Ide fix several small issues
pull/312/head
Harutyun Amirjanyan 2016-05-27 11:16:03 +04:00
commit 1ac941460c
3 zmienionych plików z 23 dodań i 13 usunięć

Wyświetl plik

@ -73,7 +73,7 @@
"c9.ide.collab": "#cfbf987438", "c9.ide.collab": "#cfbf987438",
"c9.ide.local": "#10eb45842a", "c9.ide.local": "#10eb45842a",
"c9.ide.find": "#e33fbaed2f", "c9.ide.find": "#e33fbaed2f",
"c9.ide.find.infiles": "#c0a13737ef", "c9.ide.find.infiles": "#bd34c29373",
"c9.ide.find.replace": "#810ebf8bfb", "c9.ide.find.replace": "#810ebf8bfb",
"c9.ide.run.debug": "#94a48978bf", "c9.ide.run.debug": "#94a48978bf",
"c9.automate": "#47e2c429c9", "c9.automate": "#47e2c429c9",

Wyświetl plik

@ -51,21 +51,19 @@ define(function(require, exports, module) {
function set(type, data, list) { function set(type, data, list) {
if (notSupported(type)) if (notSupported(type))
return; return;
type = convertType(type);
if (nativeObject) { if (nativeObject) {
nativeObject.setData(type, data); handleClipboardData(nativeObject, type, data);
return true; return true;
} }
var setData = function(e) { var setData = function(e) {
if (list) { if (list) {
list.forEach(function(type) { list.forEach(function(type) {
e.clipboardData.setData(type, data); handleClipboardData(e.clipboardData, type, data);
}); });
} }
e.clipboardData.setData(type, data); handleClipboardData(e.clipboardData, type, data);
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
@ -82,17 +80,15 @@ define(function(require, exports, module) {
function get(type, full) { function get(type, full) {
if (notSupported(type)) if (notSupported(type))
return; return;
type = convertType(type);
if (!full && nativeObject) if (!full && nativeObject)
return nativeObject.getData(type); return handleClipboardData(nativeObject, type);
var data; var data;
var getData = function(e) { var getData = function(e) {
data = full data = full
? e.clipboardData ? e.clipboardData
: e.clipboardData.getData(type); : handleClipboardData(nativeObject, type);
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
}; };
@ -120,8 +116,22 @@ define(function(require, exports, module) {
return !/text($|\/)/.test(type); return !/text($|\/)/.test(type);
} }
function convertType(type) { function handleClipboardData(clipboardData, type, data, forceIEMime) {
return document.all ? "Text" : type; if (!clipboardData)
return;
// using "Text" doesn't work on old webkit but ie needs it
var mime = forceIEMime ? "Text" : type;
try {
if (data) {
// Safari 5 has clipboardData object, but does not handle setData()
return clipboardData.setData(mime, data) !== false;
} else {
return clipboardData.getData(mime);
}
} catch(e) {
if (!forceIEMime)
return handleClipboardData(clipboardData, type, data, true);
}
} }
function wrap(obj) { function wrap(obj) {

Wyświetl plik

@ -537,7 +537,7 @@ define(function(require, exports, module) {
if (err) { if (err) {
var message = err.message; var message = err.message;
if (err.code == "EEXIST") if (err.code == "EEXIST")
message = "File " + path + " already exists."; message = "File " + newpath + " already exists.";
return showError(message); return showError(message);
} }
if (dirname(newpath) != dirname(path)) if (dirname(newpath) != dirname(path))