diff --git a/README.md b/README.md
index e5254feb8..868e6cfe0 100644
--- a/README.md
+++ b/README.md
@@ -76,8 +76,8 @@ The first step is to fork and clone Thimble and navigate to the cloned directory
For the first time, you need to install Thimble's dependencies and start all dependent services. To do this, simply run the following commands in succession:
```sh
-npm run env
npm install
+npm run env
vagrant up
```
This process can take a while depending on your internet connection speed as it needs to download all dependencies.
@@ -123,8 +123,8 @@ Please note: On Windows, use ``copy`` instead of ``cp``
#### Thimble
* Fork and clone https://github.com/mozilla/thimble.mozilla.org
-* Run ``npm run env`` to create an environment file
* Run ``npm install`` to install dependencies
+* Run ``npm run env`` to create an environment file
* Run ``npm start`` to start the server
#### id.webmaker.org
diff --git a/locales/kab/editor.properties b/locales/kab/editor.properties
index 7c005705e..c641cede4 100644
--- a/locales/kab/editor.properties
+++ b/locales/kab/editor.properties
@@ -185,6 +185,7 @@ VIDEO_OPTION_DISABLE_AUDIO=Sens ameslaw
# Audio Viewer
AUDIO_FILE=Afaylu ameslaw
AUDIO_OPTIONS=Iɣewwaṛen n umeslaw
+AUDIO_OPTION_AUTOPLAY=Bdu taɣuri n imesli-agi s wudem awurman
# Binary Viewer
# Title for binary file actions that user can take
diff --git a/locales/kab/server.properties b/locales/kab/server.properties
index 65c9fb316..95ab632e9 100644
--- a/locales/kab/server.properties
+++ b/locales/kab/server.properties
@@ -27,6 +27,7 @@ signInPromptHomepage=Lær deg å undervise som Mozilla på learning.mozilla.org.
pageTitleGetInvolved=Thimble av Mozilla - ver med
+pageTitleFeatures=Thimble av Mozilla - funksjonar
# Userbar
signInPromptHomepage=Logg inn eller opprett ein konto
# Reload Preview Page
+errorCantLoadPreviewTitle=Å nei, noko gjekk gale!
+errorCantLoadPreview=Vi klarte ikkje å laste førehandsvisinga, last om for å prøve på nytt…
reloadButtonLabel=Oppdater
############
@@ -33,6 +36,8 @@ reloadButtonLabel=Oppdater
# Loading the editor
loadingProject=Lastar prosjekt
+loadingProjectSupportSuggestion=Om prosketet ikkje lastar, få hjelp her.
+reloadThimbleMessage=Oppdater nettlesaren din for å laste inn Thimble på nytt.
errorCouldNotStart=Thimble klarte ikkje å starte.
errorUnsupportedBrowserIgnore=La meg prøve likevel!
tryAgainButtonLabel=Prøv på nytt
@@ -273,7 +278,6 @@ sanariaz154Quote=«Alle menneske treng nokon som gjev oss tilbakemelding. Slik f
raygervaisContrib1=Lagt til ein JavaScript-konsoll for å hjelpa elevane med å feilsøkje koden sin og å finne feil
raygervaisContrib2=Forbetra brukarvennlegheita i Thimble-menyane
cgsinghContrib1=La til skildringar på prosjektsoda
-peiying16Contrib1=La til støtte for filikon i
peiying16Contrib2=Fiksa ein feil (bug) i relatert til JavaScript-instillingane
peiying16Contrib3=Støtte for redigering av SVG-filer direkte i redigeraren (editor)
omytryniukContrib1=Gjer den innebyde bildevisaren betre
diff --git a/locales/te/server.properties b/locales/te/server.properties
index 858651ea3..6a6ea3119 100644
--- a/locales/te/server.properties
+++ b/locales/te/server.properties
@@ -24,6 +24,7 @@ pageTitleGetInvolved=Mozilla వారి Thimble లో పల్గొనం
# Userbar
# Reload Preview Page
+errorCantLoadPreviewTitle=అయ్యో, ఎదో తప్పు జరిగింది!
############
## Editor ##
diff --git a/locales/zh-CN/editor.properties b/locales/zh-CN/editor.properties
index 1d887e052..2ef160292 100644
--- a/locales/zh-CN/editor.properties
+++ b/locales/zh-CN/editor.properties
@@ -202,6 +202,9 @@ BINARY_FILE_DOWNLOAD=下载它
BINARY_FILE_OPEN=在新标签页中打开它
BINARY_FILE_TRY_EDIT=尝试编辑它
+#PDF Viewer
+PDF_FILE_TITLE=PDF 文件
+
################
## EXTENSIONS ##
################
diff --git a/locales/zh-CN/server.properties b/locales/zh-CN/server.properties
index 316315bbe..3b4baada7 100644
--- a/locales/zh-CN/server.properties
+++ b/locales/zh-CN/server.properties
@@ -25,17 +25,22 @@ pageTitleFeatures=Mozilla Thimble - 功能
# Userbar
signInPromptHomepage=登录或创建一个账号
+# Reload Preview Page
+errorCantLoadPreviewTitle=哦!好像出错了!
+errorCantLoadPreview=我们无法载入预览,请重新载入页面后再试一次...
+reloadButtonLabel=重新载入
+
############
## Editor ##
############
# Loading the editor
-loadingProject=正在加载项目
-loadingProjectSupportSuggestion=如果项目未加载,到这里获取帮助。
+loadingProject=正在载入项目
+loadingProjectSupportSuggestion=如果项目未载入,到这里获取帮助。
reloadThimbleMessage=请重新载入 Thimble 以重试。
errorCouldNotStart=Thimble 无法启动。
-errorLoadingProject=加载您的项目时出错。
请刷新您的浏览器。
-errorLoadingProjectSuggestion=注意,如果您在使用隐私浏览模式,请试试在普通模式中加载。
+errorLoadingProject=载入您的项目时出错。
请刷新您的浏览器。
+errorLoadingProjectSuggestion=注意,如果您在使用隐私浏览模式,请试试在普通模式中载入。
errorUnsupportedBrowser=很抱歉,Thimble 不适用您的浏览器
errorUnsupportedBrowserSuggestion1=Thimble 可以在下列浏览器中正常运行:Firefox、Chrome、Internet Explorer 11, Microsoft Edge、Safari (8+) 及 Opera。
errorUnsupportedBrowserIgnore=但我还想试试!
@@ -78,7 +83,7 @@ navAllowJS=允许 JavaScript
navAllowWS=显示空白
navAutoComplete=自动完成代码
navAutoEncloseTags=自动关闭标签
-navXMLSVG=XML/SVG
+navSVGedit=用代码编辑 SVG 图像
navPreview=预览
navViewTutorial=教程
navToggleAutoUpdateTitle=切换自动刷新预览
@@ -228,7 +233,7 @@ deleteProjects=删除项目
## Features page ##
###################
-featuresHeader=绝佳的功能使编写代码
的学习和教学更加轻松和有趣
+featuresHeader=绝佳的功能使学习与
教授编写代码简单而有趣
featuresCallout=Thimble 是一个可以在浏览器中运行的全功能代码编辑器。它旨在帮助新手编程人员使用 HTML、CSS 和 JavaScript 创建自己的网站和基于 Web 的项目。您需要的一切都在您的指尖,让您(或您的课堂)快速部署和运行。
featuresCalloutDesc=它将代码编辑器、网页服务器、网页浏览器和开发者工具合而为一,而且它还是免费的!
@@ -280,7 +285,7 @@ contributeReason3=支持 Mozilla 的使命,为所有人建立开放的互联
contributeReason4=感觉很棒!
getInvolvedDescription1=Thimble 是 Mozilla 基金会 与 塞内卡大学开放技术开发中心 联合创建的一个开源项目。自创立以来,来自全世界的贡献者为项目的成功发挥了重要作用。
getInvolvedDescription2=这是一个真正的国际项目,它 已被翻译为 33 种语言(并有超过 100 种语言正在翻译),且 有超过 200 多个国家/地区的学习者。
-noContributionTooSmallTitle=没有贡献微不足道
+noContributionTooSmallTitle=再小的贡献也足以称道
noContributionTooSmallDesc=我们欢迎所有技能水平与职业背景的贡献者。你不必是一个专业程序员,事实上,超过一半贡献者标识自己为学生。你可以从小事开始,比如填报一个问题…
noContributionTooSmallReason1=报告缺陷、问题或拼写错误
noContributionTooSmallReason2=请求更改、新功能或新项目
@@ -308,20 +313,25 @@ raygervaisQuote=“在向 Thimble 的过程中我了解了现代的 JavaScript
hkiratContrib1=已创建一个自定义界面来编辑 A 帧标签的参数
hkiratContrib2=代码完成已是可选设置
hkiratContrib3=研究合作编辑的技术方法
+hkiratQuote=“在 Thimble 的工作经历很有意义。他们的代码写得很好,导师也非常热心。如果你想开始在开源领域做点事,这个项目不错,贡献的过程中我还知道了很多开源的最佳实践。“
cgsinghContrib1=已添加描述到项目页面
cgsinghContrib2=自动闭合标签已成为可选设置
cgsinghContrib3=修复一个发布按钮的长期可用性问题
-peiying16Contrib1=已添加文件图标支持
+cgsinghQuote=“最开始来 Thimble 的时候我还挺担心的。但我开始做贡献后,一切逐渐变得还算满意。在我通常不愿接触的领域 — Web 开发上我学到了很多。做开源开发时,我从不觉得孤单。把这么多天才的想法聚集起来,让像 Thimble 这样伟大的产品才诞生了。“
+peiying16Contrib1fix=在文件列表中添加文件图标对应关系
peiying16Contrib2=修复 JavaScript 设置相关的问题
peiying16Contrib3=支持在编辑器中编辑 SVG 文件
peiying16Quote=“我爱 Thimble,我也喜欢与 Thimble 团队修复 bug。”
th30Contrib1=已更新菜单过渡效果
th30Contrib2=确保文件在编辑器中正确突出显示
+th30Quote=“Thimble 的工作的确是进入开源领域具有挑战性和爆炸性的途径。它真的让我有机会能跟许多才华横溢的人合作共事,在这工作,犯错误不过是改进自我的宝贵机会。坚持是关键,还一定要对宝贵的改进机会做出反应!”
omytryniukContrib1=改进内置的图像查看器界面
omytryniukContrib2=已增加数个界面改进和修复一些前端样式和功能的问题
omytryniukContrib3=已更新 Thimble 项目中的节点依赖关系
+omytryniukQuote=“对我来说,使用Thimble不仅能获得宝贵的编程经验,还能有强烈的成就感,并且你参与设计的产品会在世界各地使用。我写的程序能够造福数百万人,意识到这一点使我在Thimble的工作充满动力。项目团队友好、积极的氛围是令我享受在Thimble这个开放源代码平台工作的另一原因。”
timmoyContrib1=已修复与预览面板上的自动刷新设置相关的错误 — 它现在会记住浏览器刷新时的设置
timmoyContrib2=已添加功能,可以为项目中的图像添加滤镜
+timmoyQuote=“来到Thimble之前,我独自或者跟团队一起编写相对小规模的程序。而现在,我写的代码分布于300多人一起工作的成百上千个文件之中,这确实让我大开眼界,令我认识到竟能如此“与他人合作”。我发现适应这里的环境需要经历学习曲线,但在这里总有友好的人帮助我入门,克服一路重重障碍。仅数月之后,我就有能力为社群做出超出自己预期的贡献了。开放源代码的持续发展会让我们一起创造无限可能!”
############
## Shared ##
diff --git a/package.json b/package.json
index d6d9be905..f03bb958f 100644
--- a/package.json
+++ b/package.json
@@ -92,6 +92,7 @@
"devDependencies": {
"eslint": "^4.6.1",
"eslint-plugin-prettier": "^2.2.0",
+ "is-reachable":"^2.3.3",
"prettier": "^1.6.1",
"shx": "^0.2.2",
"stylelint": "^8.1.1",
diff --git a/public/editor/scripts/ui/index.js b/public/editor/scripts/ui/index.js
index fc2e7eaec..2480e3230 100644
--- a/public/editor/scripts/ui/index.js
+++ b/public/editor/scripts/ui/index.js
@@ -443,6 +443,10 @@ function init(bramble, csrfToken, appUrl) {
_escKeyHandler.stop();
_escKeyHandler = null;
+
+ //Calling function in public/editor/ui/publisher.js
+ //When user clicks outside the dialog box, description is saved
+ publisher.handlers.saveDescription();
}
function showPublishDialog() {
publishDialogUnderlay = new Underlay("#publish-dialog", hidePublishDialog);
diff --git a/public/editor/scripts/ui/menus.js b/public/editor/scripts/ui/menus.js
index 88dec7f1e..6246f2ad7 100644
--- a/public/editor/scripts/ui/menus.js
+++ b/public/editor/scripts/ui/menus.js
@@ -163,7 +163,7 @@ function setupOptionsMenu(bramble) {
setWordWrapUI(value);
});
}
- $("#line-wrap-toggle").click(function() {
+ $("#editor-option-wraptext").click(function() {
// Toggle current value
setWordWrap(!bramble.getWordWrap());
var mode = !bramble.getWordWrap() ? "Enabled" : "Disabled";
@@ -191,7 +191,7 @@ function setupOptionsMenu(bramble) {
}
// Enable/Disable JavaScript in Preview
- $("#allow-scripts-toggle").click(function() {
+ $("#editor-option-allowjs").click(function() {
// Toggle current value
var $allowScriptsToggle = $("#allow-scripts-toggle");
var toggle = !$allowScriptsToggle.hasClass("switch-enabled");
@@ -223,8 +223,9 @@ function setupOptionsMenu(bramble) {
} else {
$("#allow-whitespace-toggle").removeClass("switch-enabled");
}
+
// Enable/Disable Whitespace Indicator
- $("#allow-whitespace-toggle").click(function() {
+ $("#editor-option-allowws").click(function() {
// Toggle current value
var $allowWhitespaceToggle = $("#allow-whitespace-toggle");
var toggle = !$allowWhitespaceToggle.hasClass("switch-enabled");
@@ -246,8 +247,9 @@ function setupOptionsMenu(bramble) {
} else {
$("#autocomplete-toggle").removeClass("switch-enabled");
}
+
// Enable/Disable Autocomplete
- $("#autocomplete-toggle").click(function() {
+ $("#editor-option-autocomplete").click(function() {
// Toggle current value
var $autocompleteToggle = $("#autocomplete-toggle");
var toggle = !$autocompleteToggle.hasClass("switch-enabled");
@@ -264,7 +266,7 @@ function setupOptionsMenu(bramble) {
});
//Edit SVG as XML
- $("#edit-SVG-toggle").click(function() {
+ $("#editor-option-svgedit").click(function() {
// Toggle current value
var $editSVGToggle = $("#edit-SVG-toggle");
var toggle = !$editSVGToggle.hasClass("switch-enabled");
@@ -288,7 +290,7 @@ function setupOptionsMenu(bramble) {
$("#auto-tags-toggle").removeClass("switch-enabled");
}
- $("#auto-tags-toggle").click(function() {
+ $("#editor-option-autoenclosetags").click(function() {
var $autoTagsToggle = $("#auto-tags-toggle");
var autoCloseTagsEnabled = $autoTagsToggle.hasClass("switch-enabled");
@@ -376,8 +378,7 @@ function setupOptionsMenu(bramble) {
});
}
}
- $("#theme-light").click(toggleTheme);
- $("#theme-dark").click(toggleTheme);
+ $("#editor-option-colortheme").click(toggleTheme);
// If the user explicitly set the light-theme last time, use that
// otherwise default to using the dark-theme.
diff --git a/public/editor/scripts/ui/publisher.js b/public/editor/scripts/ui/publisher.js
index 14d5d3965..0a5ffb14f 100644
--- a/public/editor/scripts/ui/publisher.js
+++ b/public/editor/scripts/ui/publisher.js
@@ -5,6 +5,7 @@ var strings = require("strings");
var Project = require("../project");
var FileSystemSync = require("../filesystem-sync");
var SyncState = require("../filesystem-sync/state");
+var Metadata = require("../project/metadata.js");
var host;
@@ -54,6 +55,7 @@ Publisher.prototype.init = function(bramble) {
publisher.handlers = {
publish: publisher.publish.bind(publisher, bramble),
unpublish: publisher.unpublish.bind(publisher),
+ saveDescription: publisher.saveDescription.bind(publisher),
unpublishedChangesPrompt: unpublishedChangesPrompt.bind(publisher)
};
@@ -130,6 +132,77 @@ Publisher.prototype.showUnpublishedChangesPrompt = function(callback) {
});
};
+Publisher.prototype.saveDescription = function() {
+ /*var publisher = this;
+ var action = "unpublish";
+ if (Project.getPublishUrl()) {
+ var action = "publish";
+ }
+
+ SyncState.syncing();
+
+ var request = $.ajax({
+ contentType: "application/json",
+ headers: {
+ "X-Csrf-Token": publisher.csrfToken,
+ Accept: "application/json"
+ },
+ type: "PUT",
+ url: host + "/projects/" + Project.getID() + "/" + action,
+ data: JSON.stringify({
+ description: publisher.dialog.description.val() || " ",
+ public: publisher.isProjectPublic,
+ dateUpdated: new Date().toISOString()
+ })
+ });
+
+ //publishing/unpublishing an already published/unpublished project is expected to fail
+ //doing this for now until we can send an ajax request to UPDATE only
+ request.fail(function(jqXHR, status, err) {
+ console.error(
+ "[Thimble] Failed to send request to",
+ action,
+ "project to the server with: ",
+ err,
+ "but description is now updated"
+ );
+ });
+ request.always(function() {
+ SyncState.completed();
+ });*/
+
+ const publisher = this;
+ const oldDescription = Project.getDescription();
+ const description = publisher.dialog.description.val();
+
+ if (oldDescription === description) {
+ return;
+ }
+
+ Project.setDescription(description);
+
+ const data = {
+ title: Project.getTitle(),
+ description,
+ dateUpdated: new Date().toISOString()
+ };
+
+ Metadata.update(
+ {
+ update: true,
+ csrfToken: publisher.csrfToken,
+ host: Project.getHost(),
+ id: Project.getID(),
+ data
+ },
+ error => {
+ console.error("[Thimble] Failed to update project description with: ",
+ error
+ );
+ }
+ );
+};
+
Publisher.prototype.publish = function(bramble) {
var publisher = this;
var dialog = publisher.dialog;
diff --git a/public/editor/stylesheets/editor.less b/public/editor/stylesheets/editor.less
index 6ae028ece..cabe1ea65 100755
--- a/public/editor/stylesheets/editor.less
+++ b/public/editor/stylesheets/editor.less
@@ -536,6 +536,11 @@ body {
padding: 20px 100px 20px 20px;
position: relative;
color: rgba(0, 0, 0, 0.6);
+ cursor: pointer;
+ }
+
+ #editor-option-textsize {
+ cursor: default;
}
li + li {
@@ -564,7 +569,6 @@ body {
height: 30px;
width: 60px;
top: 16px;
- cursor: pointer;
&.switch-enabled {
.toggle-backing {
diff --git a/public/editor/stylesheets/publish.less b/public/editor/stylesheets/publish.less
index 7b448cce9..406feb1a5 100644
--- a/public/editor/stylesheets/publish.less
+++ b/public/editor/stylesheets/publish.less
@@ -150,20 +150,6 @@
font-weight: 600;
}
}
-
- #publish-button-cancel {
- background-color: #b0b0b0;
- .publish-button;
- .grey-button;
-
- &:hover {
- background-color: #bcbcbc;
- }
-
- &:active {
- background-color: #9b9b9b;
- }
- }
}
#publish-details {
diff --git a/views/editor/nav-options.html b/views/editor/nav-options.html
index 0720e5f50..7687c6fc8 100644
--- a/views/editor/nav-options.html
+++ b/views/editor/nav-options.html
@@ -112,14 +112,14 @@