updated history, minor LINT-related reformatting

upd4.2
jmoenig 2018-06-06 09:24:43 +02:00
rodzic f3ffe66a2b
commit 3b9299fbb3
3 zmienionych plików z 56 dodań i 21 usunięć

Wyświetl plik

@ -32,7 +32,7 @@
/*global modules, SnapSerializer, nop, hex_sha512, DialogBoxMorph, Color,
normalizeCanvas*/
modules.cloud = '2018-March-14';
modules.cloud = '2018-June-06';
// Global stuff
@ -410,7 +410,10 @@ Cloud.prototype.saveProject = function (ide, onSuccess, onError) {
myself.request(
'POST',
'/projects/' + encodeURIComponent(username) + '/' + encodeURIComponent(ide.projectName),
'/projects/' +
encodeURIComponent(username) +
'/' +
encodeURIComponent(ide.projectName),
onSuccess,
onError,
'Project could not be saved',
@ -498,7 +501,8 @@ Cloud.prototype.getProject = function (projectName, delta, onSuccess, onError) {
this.withCredentialsRequest(
'GET',
'/projects/%username/' +
encodeURIComponent(projectName) + (delta ? '?delta=' + delta : ''),
encodeURIComponent(projectName) +
(delta ? '?delta=' + delta : ''),
onSuccess,
onError,
'Could not fetch project ' + projectName,
@ -514,7 +518,10 @@ Cloud.prototype.getPublicProject = function (
) {
this.request(
'GET',
'/projects/' + encodeURIComponent(username) + '/' + encodeURIComponent(projectName),
'/projects/' +
encodeURIComponent(username) +
'/' +
encodeURIComponent(projectName),
onSuccess,
onError,
'Could not fetch project ' + projectName,
@ -530,7 +537,11 @@ Cloud.prototype.getProjectMetadata = function (
) {
this.request(
'GET',
'/projects/' + encodeURIComponent(username) + '/' + encodeURIComponent(projectName) + '/metadata',
'/projects/' +
encodeURIComponent(username) +
'/' +
encodeURIComponent(projectName) +
'/metadata',
onSuccess,
onError,
'Could not fetch metadata for ' + projectName
@ -561,8 +572,10 @@ Cloud.prototype.deleteProject = function (
) {
this[username ? 'request' : 'withCredentialsRequest'](
'DELETE',
'/projects/' + (username ? encodeURIComponent(username) : '%username') +
'/' + encodeURIComponent(projectName),
'/projects/' +
(username ? encodeURIComponent(username) : '%username') +
'/' +
encodeURIComponent(projectName),
onSuccess,
onError,
'Could not delete project'
@ -579,7 +592,8 @@ Cloud.prototype.shareProject = function (
'POST',
'/projects/' +
(username ? encodeURIComponent(username) : '%username') +
'/' + encodeURIComponent(projectName) +
'/' +
encodeURIComponent(projectName) +
'/metadata?ispublic=true',
onSuccess,
onError,
@ -597,7 +611,8 @@ Cloud.prototype.unshareProject = function (
'POST',
'/projects/' +
(username ? encodeURIComponent(username) : '%username') +
'/' + encodeURIComponent(projectName) +
'/' +
encodeURIComponent(projectName) +
'/metadata?ispublic=false&ispublished=false',
onSuccess,
onError,
@ -615,7 +630,8 @@ Cloud.prototype.publishProject = function (
'POST',
'/projects/' +
(username ? encodeURIComponent(username) : '%username') +
'/' + encodeURIComponent(projectName) +
'/' +
encodeURIComponent(projectName) +
'/metadata?ispublished=true',
onSuccess,
onError,
@ -633,7 +649,8 @@ Cloud.prototype.unpublishProject = function (
'POST',
'/projects/' +
(username ? encodeURIComponent(username) : '%username') +
'/' + encodeURIComponent(projectName) +
'/' +
encodeURIComponent(projectName) +
'/metadata?ispublished=false',
onSuccess,
onError,
@ -649,8 +666,10 @@ Cloud.prototype.remixProject = function (
) {
this.withCredentialsRequest(
'POST',
'/projects/' + encodeURIComponent(username) +
'/' + encodeURIComponent(projectName) +
'/projects/' +
encodeURIComponent(username) +
'/' +
encodeURIComponent(projectName) +
'/remix',
onSuccess,
onError,
@ -666,7 +685,9 @@ Cloud.prototype.updateNotes = function (
) {
this.withCredentialsRequest(
'POST',
'/projects/%username/' + encodeURIComponent(projectName) + '/metadata',
'/projects/%username/' +
encodeURIComponent(projectName) +
'/metadata',
onSuccess,
onError,
'Could not update project notes',

27
gui.js
Wyświetl plik

@ -75,7 +75,7 @@ isRetinaSupported, SliderMorph, Animation, BoxMorph, MediaRecorder*/
// Global stuff ////////////////////////////////////////////////////////
modules.gui = '2018-June-05';
modules.gui = '2018-June-06';
// Declarations
@ -6769,7 +6769,11 @@ function ProjectRecoveryDialogMorph(ide, project, browser) {
this.init(ide, project, browser);
}
ProjectRecoveryDialogMorph.prototype.init = function (ide, projectName, browser) {
ProjectRecoveryDialogMorph.prototype.init = function (
ide,
projectName,
browser
) {
// initialize inherited properties:
ProjectRecoveryDialogMorph.uber.init.call(
this,
@ -6894,11 +6898,15 @@ ProjectRecoveryDialogMorph.prototype.buildListField = function () {
yesterday.setDate(today.getDate() - 1);
myself.versions = versions;
myself.versions.forEach(function (version) {
var date = new Date(new Date().getTime() - version.lastupdated * 1000);
var date = new Date(
new Date().getTime() - version.lastupdated * 1000
);
if (date.toDateString() === today.toDateString()) {
version.lastupdated = localize('Today, ') + date.toLocaleTimeString();
version.lastupdated = localize('Today, ') +
date.toLocaleTimeString();
} else if (date.toDateString() === yesterday.toDateString()) {
version.lastupdated = localize('Yesterday, ') + date.toLocaleTimeString();
version.lastupdated = localize('Yesterday, ') +
date.toLocaleTimeString();
} else {
version.lastupdated = date.toLocaleString();
}
@ -6926,7 +6934,9 @@ ProjectRecoveryDialogMorph.prototype.cancel = function () {
this.browser.listField.select(
detect(
this.browser.projectList,
function (item) { return item.projectname === myself.projectName }
function (item) {
return item.projectname === myself.projectName;
}
)
);
ProjectRecoveryDialogMorph.uber.cancel.call(this);
@ -6940,7 +6950,10 @@ ProjectRecoveryDialogMorph.prototype.recoverProject = function () {
return version.lastupdated === lastupdated;
});
this.browser.openCloudProject({ projectname: this.projectName }, version.delta);
this.browser.openCloudProject(
{projectname: this.projectName},
version.delta
);
this.destroy();
};

Wyświetl plik

@ -4130,3 +4130,4 @@ in development:
------
* updated German translation, thanks, Jadga!
* updated Portuguese translation, thanks, Manuel!
* new Project Cloud Backups feature, thanks, Bernat!