Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d8f3cf7cad
|
@ -39,7 +39,7 @@ const (
|
||||||
PathListSeparator = string(os.PathListSeparator)
|
PathListSeparator = string(os.PathListSeparator)
|
||||||
|
|
||||||
// WideVersion holds the current wide version.
|
// WideVersion holds the current wide version.
|
||||||
WideVersion = "1.1.0"
|
WideVersion = "1.2.0"
|
||||||
// CodeMirrorVer holds the current editor version.
|
// CodeMirrorVer holds the current editor version.
|
||||||
CodeMirrorVer = "4.10"
|
CodeMirrorVer = "4.10"
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#dialogAbout {
|
#dialogAbout {
|
||||||
margin: 35px 100px 0 100px;
|
margin: 35px 20px;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#dialogAbout .item {
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
#dialogAbout a {
|
#dialogAbout a {
|
||||||
color: #4183c4;
|
color: #4183c4;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -49,12 +53,6 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#dialogAbout .thx {
|
|
||||||
border-left: 1px solid #919191;
|
|
||||||
padding-left: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#dialogAbout .thx,
|
|
||||||
#dialogAbout .thx ul {
|
#dialogAbout .thx ul {
|
||||||
margin-left: 50px;
|
margin-left: 50px;
|
||||||
}
|
}
|
||||||
|
@ -69,5 +67,6 @@
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
height: 85px;
|
height: 85px;
|
||||||
overflow: auto;
|
overflow-x: hidden;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
|
@ -13,6 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
body {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
@ -87,4 +91,9 @@
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
padding: 1px 5px;
|
padding: 1px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#disqus_thread {
|
||||||
|
border-top: 1px solid #919191;
|
||||||
|
padding: 0 30px;
|
||||||
}
|
}
|
|
@ -13,6 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
body {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -83,4 +87,9 @@
|
||||||
#dialogShare a {
|
#dialogShare a {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
#disqus_thread {
|
||||||
|
border-top: 1px solid #919191;
|
||||||
|
padding: 0 30px;
|
||||||
}
|
}
|
|
@ -309,7 +309,6 @@
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
height: 19px;
|
height: 19px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 11;
|
z-index: 11;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -161,7 +161,8 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).resize(function () {
|
$(window).resize(function () {
|
||||||
$(".dialog-background").height($("body").height());
|
var height = $("body").height() > $(window).height() ? $("body").height() : $(window).height();
|
||||||
|
$(".dialog-background").height(height);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof settings.afterInit === "function") {
|
if (typeof settings.afterInit === "function") {
|
||||||
|
|
|
@ -58,8 +58,6 @@ var menu = {
|
||||||
$("#dialogAbout").load(config.context + '/about', function () {
|
$("#dialogAbout").load(config.context + '/about', function () {
|
||||||
$("#dialogAbout").dialog({
|
$("#dialogAbout").dialog({
|
||||||
"modal": true,
|
"modal": true,
|
||||||
"height": 460,
|
|
||||||
"width": 800,
|
|
||||||
"title": config.label.about,
|
"title": config.label.about,
|
||||||
"hideFooter": true,
|
"hideFooter": true,
|
||||||
"afterOpen": function () {
|
"afterOpen": function () {
|
||||||
|
|
|
@ -18,11 +18,14 @@ var playground = {
|
||||||
editor: undefined,
|
editor: undefined,
|
||||||
pid: undefined,
|
pid: undefined,
|
||||||
_resize: function () {
|
_resize: function () {
|
||||||
|
if (config.disqus) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (config.embed) {
|
if (config.embed) {
|
||||||
$("#editorDiv").parent().height($(window).height() - 35 - $(".footer").height());
|
$("#editorDiv").parent().height($(window).height() - 33 - $(".footer").height());
|
||||||
playground.editor.setSize("auto", ($("#editorDiv").parent().height() * 0.7) + "px");
|
playground.editor.setSize("auto", ($("#editorDiv").parent().height() * 0.7) + "px");
|
||||||
} else {
|
} else {
|
||||||
$("#editor, #output").height($(window).height() - 58 - $(".footer").height());
|
$("#editor, #output").height($(window).height() - 60 - $(".footer").height());
|
||||||
playground.editor.setSize("auto", $("#editor").height() + "px");
|
playground.editor.setSize("auto", $("#editor").height() + "px");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -188,6 +191,12 @@ var playground = {
|
||||||
playground._resize();
|
playground._resize();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (config.embed) {
|
||||||
|
playground.editor.setSize("auto", ($("#editorDiv").parent().height() * 0.7) + "px");
|
||||||
|
} else {
|
||||||
|
playground.editor.setSize("auto", $("#editor").height() + "px");
|
||||||
|
}
|
||||||
|
|
||||||
var hovered = false;
|
var hovered = false;
|
||||||
$(".menu .ico-share").hover(function () {
|
$(".menu .ico-share").hover(function () {
|
||||||
$(".menu .share-panel").show();
|
$(".menu .share-panel").show();
|
||||||
|
@ -306,13 +315,13 @@ var playground = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var html = '<div class="fn-clear"><label>' + config.label.url
|
var html = '<div class="fn-clear"><label>' + config.label.url
|
||||||
+ config.label.colon + '</label><a href="'
|
+ config.label.colon + '</label><a href="'
|
||||||
+ url + '" target="_blank">' + url + "</a><br/>";
|
+ url + '" target="_blank">' + url + "</a><br/>";
|
||||||
html += '<label>' + config.label.short_url + config.label.colon
|
html += '<label>' + config.label.short_url + config.label.colon
|
||||||
+ '</label><a href="' + data.shortURL + '" target="_blank">'
|
+ '</label><a href="' + data.shortURL + '" target="_blank">'
|
||||||
+ data.shortURL + '</a><br/>';
|
+ data.shortURL + '</a><br/>';
|
||||||
html += '<label>' + config.label.embeded + config.label.colon
|
html += '<label>' + config.label.embeded + config.label.colon
|
||||||
+ '</label><br/><textarea rows="5" style="width:100%" readonly><iframe style="border:1px solid" src="'
|
+ '</label><br/><textarea rows="5" style="width:100%" readonly><iframe style="border:1px solid" src="'
|
||||||
+ url + '?embed=true" width="100%" height="600"></iframe></textarea>';
|
+ url + '?embed=true" width="100%" height="600"></iframe></textarea>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
@ -323,6 +332,21 @@ var playground = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
disqus: function () {
|
||||||
|
var url = window.location.href;
|
||||||
|
if (url.indexOf("?") >= 0) {
|
||||||
|
if (url.indexOf("disqus=") >= 0) {
|
||||||
|
url = url.replace("disqus=false", "disqus=true");
|
||||||
|
console.log(url);
|
||||||
|
} else {
|
||||||
|
url += "&disqus=true";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
url += "?disqus=true";
|
||||||
|
}
|
||||||
|
|
||||||
|
window.location.href = url;
|
||||||
|
},
|
||||||
stop: function () {
|
stop: function () {
|
||||||
if (!playground.editor) {
|
if (!playground.editor) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,52 +1,51 @@
|
||||||
<div class="fn-clear">
|
<div class="item">
|
||||||
<img class="logo" src="{{.conf.StaticServer}}/static/images/wide-logo.png" alt="wide logi"/>
|
<div class="fn-clear">
|
||||||
<div class="fn-left">
|
<img class="logo" src="{{.conf.StaticServer}}/static/images/wide-logo.png" alt="wide logi"/>
|
||||||
<h2>Hello, 世界</h2>
|
<div class="fn-left">
|
||||||
<h3>Coding with Go on the Wide way.</h3>
|
<h2>Hello, 世界</h2>
|
||||||
|
<h3>Coding with Go on the Wide way.</h3>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label>{{.i18n.current_ver}}{{.i18n.colon}}</label>
|
<label>{{.i18n.current_ver}}{{.i18n.colon}}</label>
|
||||||
<span class="version">{{.ver}}</span>,
|
<span class="version">{{.ver}}</span>,
|
||||||
<span class="upgrade">{{.i18n.check_version}}....</span>
|
<span class="upgrade">{{.i18n.check_version}}....</span>
|
||||||
<div class="space"></div>
|
</div>
|
||||||
|
|
||||||
<div class="fn-clear">
|
<div class="space"></div>
|
||||||
<div class="fn-left">
|
|
||||||
<label>{{.i18n.project_address}}{{.i18n.colon}}</label>
|
|
||||||
<a href="https://github.com/b3log/wide" target="_blank">github.com/b3log/wide</a><br/>
|
|
||||||
|
|
||||||
<label>{{.i18n.dev_team}}{{.i18n.colon}}</label>
|
<div class="item">
|
||||||
<a href="https://github.com/b3log/b3log-solo/wiki/About_us" target="_blank">B3log</a><br/>
|
<label>{{.i18n.project_address}}{{.i18n.colon}}</label>
|
||||||
|
<a href="https://github.com/b3log/wide" target="_blank">github.com/b3log/wide</a><br/>
|
||||||
|
|
||||||
<label>{{.i18n.go_env}}{{.i18n.colon}}</label>
|
<label>{{.i18n.dev_team}}{{.i18n.colon}}</label>
|
||||||
{{.gover}}, {{.goos}}_{{.goarch}}<br/>
|
<a href="https://github.com/b3log/b3log-solo/wiki/About_us" target="_blank">B3log</a><br/>
|
||||||
|
|
||||||
<label>{{.i18n.donate}}{{.i18n.colon}}</label>
|
<label>{{.i18n.go_env}}{{.i18n.colon}}</label>
|
||||||
<a href="http://b3log.org/donate.html" target="_blank">b3log.org/donate.html</a>
|
{{.gover}}, {{.goos}}_{{.goarch}}<br/>
|
||||||
</div>
|
|
||||||
<div class="fn-left thx">
|
<label>{{.i18n.donate}}{{.i18n.colon}}</label>
|
||||||
<label>{{.i18n.credits}}{{.i18n.colon}}</label>
|
<a href="http://b3log.org/donate.html" target="_blank">b3log.org/donate.html</a>
|
||||||
<ul>
|
</div>
|
||||||
<li>
|
|
||||||
<a href="http://golang.org" target="_blank">golang</a>
|
<div class="thx item">
|
||||||
<a href="https://github.com/marijnh/CodeMirror" target="_blank">CodeMirror</a>
|
<label>{{.i18n.credits}}{{.i18n.colon}}</label>
|
||||||
</li>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/zTree/zTree_v3" target="_blank">zTree</a>
|
<a href="http://golang.org" target="_blank">golang</a>
|
||||||
<a href="https://github.com/visualfc/liteide" target="_blank">LiteIDE</a>
|
<a href="https://github.com/marijnh/CodeMirror" target="_blank">CodeMirror</a>
|
||||||
</li>
|
<a href="https://github.com/zTree/zTree_v3" target="_blank">zTree</a>
|
||||||
<li>
|
<a href="https://github.com/visualfc/liteide" target="_blank">LiteIDE</a>
|
||||||
<a href="https://github.com/nsf/gocode" target="_blank">gocode</a>
|
<a href="https://github.com/nsf/gocode" target="_blank">gocode</a>
|
||||||
<a href="https://github.com/gorilla" target="_blank">Gorilla</a>
|
<a href="https://github.com/gorilla" target="_blank">Gorilla</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="space"></div>
|
<div class="space"></div>
|
||||||
<div>
|
|
||||||
<label>{{.i18n.license}}{{.i18n.colon}}</label>
|
<div class="item">
|
||||||
<pre class="license">
|
<label>{{.i18n.license}}{{.i18n.colon}}</label>
|
||||||
|
<pre class="license">
|
||||||
Apache License
|
Apache License
|
||||||
Version 2.0, January 2004
|
Version 2.0, January 2004
|
||||||
http://www.apache.org/licenses/
|
http://www.apache.org/licenses/
|
||||||
|
@ -248,6 +247,5 @@
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/themes/default.css?{{.conf.StaticResourceVersion}}">
|
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/themes/default.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="stylesheet" href="{{.conf.StaticServer}}/static/css/side.css?{{.conf.StaticResourceVersion}}">
|
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/side.css?{{.conf.StaticResourceVersion}}">
|
||||||
{{if .embed}}<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/playground-embed.css?{{.conf.StaticResourceVersion}}">{{else}}<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/playground.css?{{.conf.StaticResourceVersion}}">{{end}}
|
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/playground{{if .embed}}-embed{{end}}.css?{{.conf.StaticResourceVersion}}">
|
||||||
|
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||||
</head>
|
</head>
|
||||||
|
@ -40,6 +40,9 @@
|
||||||
<li>
|
<li>
|
||||||
<button class="btn btn-red" id="stop" onclick="playground.stop();">{{.i18n.stop}}</button>
|
<button class="btn btn-red" id="stop" onclick="playground.stop();">{{.i18n.stop}}</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<button class="btn-white btn" id="disqus" onclick="playground.disqus();">Disqus</button>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button class="btn-white btn" id="share" onclick="playground.share();">{{.i18n.share}}</button>
|
<button class="btn-white btn" id="share" onclick="playground.share();">{{.i18n.share}}</button>
|
||||||
</li>
|
</li>
|
||||||
|
@ -61,7 +64,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="fn-clear">
|
<div class="fn-clear">
|
||||||
<div id="editorDiv" class="fn-none">
|
<div id="editorDiv" class="fn-none">
|
||||||
<textarea id='editor'>{{.code}}</textarea>
|
<textarea rows="20" id='editor'>{{.code}}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<textarea id="output" rows="20" readonly="readonly" ></textarea>
|
<textarea id="output" rows="20" readonly="readonly" ></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
@ -70,12 +73,12 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var disqus_shortname = 'wide-playground';
|
var disqus_shortname = 'wide-playground';
|
||||||
var disqus_identifier = {{.fileName}};
|
var disqus_identifier = {{.fileName}};
|
||||||
var disqus_url = window.location.protocol + "//" + {{.conf.Server}} + {{.conf.Context}} + "/playground/" + {{.fileName}}
|
var disqus_url = window.location.protocol + "//" + {{.conf.Server}} + {{.conf.Context}} + "/playground/" + {{.fileName}};
|
||||||
(function() {
|
(function() {
|
||||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||||
})();</script>
|
})(); </script>
|
||||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
@ -94,7 +97,8 @@
|
||||||
"channel": "{{.conf.Channel}}",
|
"channel": "{{.conf.Channel}}",
|
||||||
"wideSessionId": "{{.session.ID}}",
|
"wideSessionId": "{{.session.ID}}",
|
||||||
"label": {{.i18n}},
|
"label": {{.i18n}},
|
||||||
"embed": {{.embed}}
|
"embed": {{.embed}},
|
||||||
|
"disqus": {{.disqus}}
|
||||||
};
|
};
|
||||||
function newWideRequest() {
|
function newWideRequest() {
|
||||||
var ret = {
|
var ret = {
|
||||||
|
|
Loading…
Reference in New Issue