Merge branch 'master' into soon

pull/1/head
yflory 8 years ago
commit ed79b8870c

@ -6,9 +6,8 @@ env:
branches:
only:
- master
- diffdom
- beta
- netflux
- soon
- staging
node_js:
- "4.2.1"
before_script:

@ -19,12 +19,15 @@ if (process.env.SAUCE_USERNAME !== undefined) {
driver.get('http://localhost:3000/assert/');
var report = driver.wait(WebDriver.until.elementLocated(WebDriver.By.className("report")), 5000);
report.getAttribute("class").then(function (cls) {
driver.quit();
if (!cls) {
throw new Error("cls is null");
} else if (cls.indexOf("failure") !== -1) {
throw new Error("cls contains the word failure");
} else if (cls.indexOf("success") === -1) {
throw new Error("cls does not contain the word success");
}
report.getText().then(function (text) {
console.log("\n-----\n" + text + "\n-----");
driver.quit();
if (!cls) {
throw new Error("cls is null");
} else if (cls.indexOf("failure") !== -1) {
throw new Error("cls contains the word failure");
} else if (cls.indexOf("success") === -1) {
throw new Error("cls does not contain the word success");
}
});
});

@ -149,7 +149,8 @@ define([
console.log('* ' + msg);
});
return false;
// No, this is crappy, it's going to cause tests to fail basically all of the time.
//return false;
}
return true;
}, "expected all translation keys in default language to be present in all translations. See console for details.");

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="cp code">
<head>
<title>CryptPad</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<script data-main="main" src="/bower_components/requirejs/require.js"></script>
<script>

@ -174,7 +174,9 @@ define([
defaultTitle: defaultName
}
};
obj.metadata.title = document.title;
if (!initializing) {
obj.metadata.title = document.title;
}
// set mode too...
obj.highlightMode = module.highlightMode;
@ -348,6 +350,7 @@ define([
var updateMetadata = function(shjson) {
// Extract the user list (metadata) from the hyperjson
var json = (shjson === "") ? "" : JSON.parse(shjson);
var titleUpdated = false;
if (json && json.metadata) {
if (json.metadata.users) {
var userData = json.metadata.users;
@ -358,9 +361,13 @@ define([
updateDefaultTitle(json.metadata.defaultTitle);
}
if (typeof json.metadata.title !== "undefined") {
updateTitle(json.metadata.title);
updateTitle(json.metadata.title || defaultName);
titleUpdated = true;
}
}
if (!titleUpdated) {
updateTitle(defaultName);
}
};
var onInit = config.onInit = function (info) {
@ -500,15 +507,6 @@ define([
// set the hash
if (!readOnly) { Cryptpad.replaceHash(editHash); }
Cryptpad.getPadTitle(function (err, title) {
if (err) {
console.log("Unable to get pad title");
console.error(err);
return;
}
updateTitle(title || defaultName);
});
};
var unnotify = module.unnotify = function () {

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="cp pad">
<head>
<title>CryptPad</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<link rel="icon" type="image/png"
href="/customize/main-favicon.png"

@ -370,7 +370,9 @@ define([
defaultTitle: defaultName
}
};
hjson[3].metadata.title = document.title;
if (!initializing) {
hjson[3].metadata.title = document.title;
}
return stringify(hjson);
};
@ -438,6 +440,7 @@ define([
// Extract the user list (metadata) from the hyperjson
var hjson = JSON.parse(shjson);
var peerMetadata = hjson[3];
var titleUpdated = false;
if (peerMetadata && peerMetadata.metadata) {
if (peerMetadata.metadata.users) {
var userData = peerMetadata.metadata.users;
@ -448,9 +451,13 @@ define([
updateDefaultTitle(peerMetadata.metadata.defaultTitle);
}
if (typeof peerMetadata.metadata.title !== "undefined") {
updateTitle(peerMetadata.metadata.title);
updateTitle(peerMetadata.metadata.title || defaultName);
titleUpdated = true;
}
}
if (!titleUpdated) {
updateTitle(defaultName);
}
};
var unnotify = function () {
@ -622,15 +629,6 @@ define([
// set the hash
if (!readOnly) { Cryptpad.replaceHash(editHash); }
Cryptpad.getPadTitle(function (err, title) {
if (err) {
console.error(err);
console.log("Couldn't get pad title");
return;
}
updateTitle(title || defaultName);
});
};
// this should only ever get called once, when the chain syncs

@ -466,10 +466,13 @@ define([
var renameCb = function (err, title) {
if (err) { return; }
document.title = title;
APP.proxy.info.title = title;
APP.proxy.info.title = title === defaultName ? "" : title;
};
var suggestName = function (fallback) {
if (document.title === defaultName) {
return fallback || "";
}
return document.title || defaultName || "";
};
@ -692,15 +695,6 @@ define([
// set the hash
if (!readOnly) { Cryptpad.replaceHash(editHash); }
Cryptpad.getPadTitle(function (err, title) {
if (err) {
console.error(err);
console.log("Couldn't get pad title");
return;
}
updateTitle(title || defaultName);
});
};
var disconnect = function (info) {

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html class="cp slide">
<head>
<title>CryptPad</title>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<script data-main="main" src="/bower_components/requirejs/require.js"></script>
<script>

@ -215,7 +215,9 @@ define([
defaultTitle: defaultName
}
};
obj.metadata.title = APP.title;
if (!initializing) {
obj.metadata.title = APP.title;
}
if (textColor) {
obj.metadata.color = textColor;
}
@ -383,6 +385,7 @@ define([
var updateMetadata = function(shjson) {
// Extract the user list (metadata) from the hyperjson
var json = (shjson === "") ? "" : JSON.parse(shjson);
var titleUpdated = false;
if (json && json.metadata) {
if (json.metadata.users) {
var userData = json.metadata.users;
@ -393,10 +396,14 @@ define([
updateDefaultTitle(json.metadata.defaultTitle);
}
if (typeof json.metadata.title !== "undefined") {
updateTitle(json.metadata.title);
updateTitle(json.metadata.title || defaultName);
titleUpdated = true;
}
updateColors(json.metadata.color, json.metadata.backColor);
}
if (!titleUpdated) {
updateTitle(defaultName);
}
};
var renameCb = function (err, title) {
@ -589,15 +596,6 @@ define([
if (!window.location.hash || window.location.hash === '#') {
Cryptpad.replaceHash(editHash);
}
Cryptpad.getPadTitle(function (err, title) {
if (err) {
console.log("Unable to get pad title");
console.error(err);
return;
}
updateTitle(title || defaultName);
});
};
var unnotify = module.unnotify = function () {

Loading…
Cancel
Save