add playground link
This commit is contained in:
Liang Ding 2015-02-15 16:04:18 +08:00
parent 4b254f4e91
commit ce489a73e7
3 changed files with 110 additions and 103 deletions

View File

@ -342,6 +342,11 @@
{{.i18n.keyboard_shortcuts}} {{.i18n.keyboard_shortcuts}}
</li> </li>
<li class="hr"></li> <li class="hr"></li>
<li onclick="window.open('/playground')">
<span class="space"></span>
Playground
</li>
<li class="hr"></li>
<li onclick="window.open('http://b3log.org/services')"> <li onclick="window.open('http://b3log.org/services')">
<span class="font-ico ico-price"></span> <span class="font-ico ico-price"></span>
<span>{{.i18n.pricing}}</span> <span>{{.i18n.pricing}}</span>

View File

@ -19,6 +19,7 @@
<img title="Wide, a Web-based IDE for Teams using Golang." src="{{.conf.StaticServer}}/static/images/wide-logo.png" <img title="Wide, a Web-based IDE for Teams using Golang." src="{{.conf.StaticServer}}/static/images/wide-logo.png"
class="logo"/></a> class="logo"/></a>
<ul class="fn-right"> <ul class="fn-right">
<li><a rel="bookmark" href="/playground" target="_blank">Play</a></li>
<li><a rel="bookmark" href="https://github.com/b3log/wide" target="_blank">GitHub</a></li> <li><a rel="bookmark" href="https://github.com/b3log/wide" target="_blank">GitHub</a></li>
<li><a rel="help" href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li> <li><a rel="help" href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li>
<li><a rel="bookmark" href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li> <li><a rel="bookmark" href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li>

View File

@ -3,11 +3,11 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{{.i18n.wide}} - {{.i18n.sign_up}}</title> <title>{{.i18n.wide}} - {{.i18n.sign_up}}</title>
<meta name="keywords" content="Wide, Golang, IDE, Team, Cloud, B3log, Sign Up"/> <meta name="keywords" content="Wide, Golang, IDE, Team, Cloud, B3log, Sign Up"/>
<meta name="description" content="A Web-based IDE for Teams using Golang, do your development anytime, anywhere."/> <meta name="description" content="A Web-based IDE for Teams using Golang, do your development anytime, anywhere."/>
<meta name="author" content="B3log"> <meta name="author" content="B3log">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/base.css?{{.conf.StaticResourceVersion}}"> <link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/base.css?{{.conf.StaticResourceVersion}}">
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/sign.css?{{.conf.StaticResourceVersion}}"> <link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/sign.css?{{.conf.StaticResourceVersion}}">
<link rel="icon" type="image/x-icon" href="/favicon.ico" /> <link rel="icon" type="image/x-icon" href="/favicon.ico" />
@ -19,6 +19,7 @@
<img title="Wide, a Web-based IDE for Teams using Golang." src="{{.conf.StaticServer}}/static/images/wide-logo.png" <img title="Wide, a Web-based IDE for Teams using Golang." src="{{.conf.StaticServer}}/static/images/wide-logo.png"
class="logo"/></a> class="logo"/></a>
<ul class="fn-right"> <ul class="fn-right">
<li><a rel="bookmark" href="/playground" target="_blank">Play</a></li>
<li><a rel="bookmark" href="https://github.com/b3log/wide" target="_blank">GitHub</a></li> <li><a rel="bookmark" href="https://github.com/b3log/wide" target="_blank">GitHub</a></li>
<li><a rel="help" href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li> <li><a rel="help" href="https://www.gitbook.io/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li>
<li><a rel="bookmark" href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li> <li><a rel="bookmark" href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.report_issues}}</a></li>
@ -55,115 +56,115 @@
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery-2.1.1.min.js"></script>
<script> <script>
(function () { (function () {
var contentH = $(window).height() - $(".footer").height() - $(".header").height() - 18; var contentH = $(window).height() - $(".footer").height() - $(".header").height() - 18;
$(".content").height(contentH) $(".content").height(contentH)
.css("padding-top", (contentH - $(".content .fn-left").height()) / 2 + "px"); .css("padding-top", (contentH - $(".content .fn-left").height()) / 2 + "px");
var signUp = function () { var signUp = function () {
if ($.trim($("#username").val()) === "" if ($.trim($("#username").val()) === ""
|| !/^\w+$/.test($("#username").val()) || !/^\w+$/.test($("#username").val())
|| $.trim($("#username").val()).length > 16) { || $.trim($("#username").val()).length > 16) {
$("#msg").text("{{.i18n.user_name_ruler}}").show(); $("#msg").text("{{.i18n.user_name_ruler}}").show();
$("#username").focus(); $("#username").focus();
return false; return false;
} else if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#email").val())) { } else if (!/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test($("#email").val())) {
$("#msg").text("{{.i18n.invalid_email}}").show(); $("#msg").text("{{.i18n.invalid_email}}").show();
$("#email").focus(); $("#email").focus();
return false; return false;
} else if ($.trim($("#password").val()) === "") { } else if ($.trim($("#password").val()) === "") {
$("#msg").text("{{.i18n.sing_up_error}}").show(); $("#msg").text("{{.i18n.sing_up_error}}").show();
$("#password").focus(); $("#password").focus();
return false; return false;
} else if ($("#confirmPassword").val() !== $("#password").val()) { } else if ($("#confirmPassword").val() !== $("#password").val()) {
$("#msg").text("{{.i18n.password_no_match}}").show(); $("#msg").text("{{.i18n.password_no_match}}").show();
$("#confirmPassword").focus(); $("#confirmPassword").focus();
return false; return false;
} }
var request = { var request = {
username: $("#username").val(), username: $("#username").val(),
password: $("#password").val(), password: $("#password").val(),
email: $("#email").val() email: $("#email").val()
}; };
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: '/signup', url: '/signup',
data: JSON.stringify(request), data: JSON.stringify(request),
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (!data.succ) { if (!data.succ) {
$("#msg").text(data.msg).show(); $("#msg").text(data.msg).show();
return; return;
} }
window.location.href = "/"; window.location.href = "/";
} }
}); });
}; };
$("#username").keyup(function (event) { $("#username").keyup(function (event) {
if (event.which === 13) { if (event.which === 13) {
if ($.trim($(this).val()) === "" if ($.trim($(this).val()) === ""
|| !/^\w+$/.test($(this).val()) || !/^\w+$/.test($(this).val())
|| $.trim($(this).val()).length > 16) { || $.trim($(this).val()).length > 16) {
$("#msg").text("{{.i18n.user_name_ruler}}").show(); $("#msg").text("{{.i18n.user_name_ruler}}").show();
} else { } else {
$("#email").focus(); $("#email").focus();
$("#msg").hide(); $("#msg").hide();
} }
} else { } else {
if ($.trim($(this).val()) === "" if ($.trim($(this).val()) === ""
|| !/^\w+$/.test($(this).val()) || !/^\w+$/.test($(this).val())
|| $.trim($(this).val()).length > 16) { || $.trim($(this).val()).length > 16) {
$("#msg").text("{{.i18n.user_name_ruler}}").show(); $("#msg").text("{{.i18n.user_name_ruler}}").show();
} else { } else {
$("#msg").hide(); $("#msg").hide();
} }
$("#dir").html($("#dir").data('dir') + $(this).val()); $("#dir").html($("#dir").data('dir') + $(this).val());
} }
}).focus(); }).focus();
$("#email").keydown(function (event) { $("#email").keydown(function (event) {
if (event.which === 13) { if (event.which === 13) {
if ($.trim($(this).val()) === "") { if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.invalid_email}}").show(); $("#msg").text("{{.i18n.invalid_email}}").show();
} else { } else {
$("#password").focus(); $("#password").focus();
} }
} else { } else {
$("#msg").hide(); $("#msg").hide();
} }
}); });
$("#password").keydown(function (event) { $("#password").keydown(function (event) {
if (event.which === 13) { if (event.which === 13) {
if ($.trim($(this).val()) === "") { if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.sing_up_error}}").show(); $("#msg").text("{{.i18n.sing_up_error}}").show();
} else { } else {
$("#confirmPassword").focus(); $("#confirmPassword").focus();
} }
} else { } else {
$("#msg").hide(); $("#msg").hide();
} }
}); });
$("#confirmPassword").keydown(function (event) { $("#confirmPassword").keydown(function (event) {
if (event.which === 13) { if (event.which === 13) {
if ($(this).val() !== $("#password").val()) { if ($(this).val() !== $("#password").val()) {
$("#msg").text("{{.i18n.password_no_match}}").show(); $("#msg").text("{{.i18n.password_no_match}}").show();
} else { } else {
signUp(); signUp();
} }
} else { } else {
$("#msg").hide(); $("#msg").hide();
} }
}); });
$("#signUpBtn").click(function () { $("#signUpBtn").click(function () {
signUp(); signUp();
}); });
})(); })();
</script> </script>
</body> </body>
</html> </html>