ace editor, markdown editor
No files matched your search
@@ -125,6 +125,8 @@ func (c Note) Index(noteId string) revel.Result {
|
||||
c.RenderArgs["globalConfigs"] = configService.GetGlobalConfigForUser()
|
||||
|
||||
|
||||
return c.RenderTemplate("note/note.html")
|
||||
|
||||
if isDev, _ := revel.Config.Bool("mode.dev"); isDev {
|
||||
return c.RenderTemplate("note/note-dev.html")
|
||||
} else {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{{end}}
|
||||
</h3></div>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<form id="formData">
|
||||
@@ -41,9 +41,9 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript" src="/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
selector : "#content1",
|
||||
@@ -55,7 +55,7 @@ $(function() {
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars leanote_code tabfocus",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
|
||||
menubar : false,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<form id="formData">
|
||||
@@ -61,7 +61,7 @@
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}";
|
||||
var UrlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
selector : "#content1",
|
||||
@@ -73,9 +73,9 @@ $(function() {
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars leanote_code tabfocus",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist | leanote_code",
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist",
|
||||
menubar : false,
|
||||
statusbar : false,
|
||||
font_formats : "Arial=arial,helvetica,sans-serif;"
|
||||
|
||||
@@ -165,7 +165,8 @@ if(typeof art != "undefined") {
|
||||
title: false,
|
||||
cancel: false,
|
||||
fixed: true,
|
||||
lock: true,
|
||||
top: 0,
|
||||
// lock: true,
|
||||
opacity: 0.3
|
||||
})
|
||||
.content('<div style="padding: 0 1em;">' + content + '</div>')
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
function reIsOk(e){return e&&"object"==typeof e&&e.Ok}function showAlert(e,t,n,o){$(e).html(t).removeClass("alert-danger").removeClass("alert-success").removeClass("alert-warning").addClass("alert-"+n).show(),o&&$(o).focus()}function hideAlert(e,t){t?setTimeout(function(){$(e).hide()},t):$(e).hide()}function ajaxGet(e,t,n){$.get(e,t,n)}function ajaxPost(e,t,n){$.post(e,t,n)}function ajaxGetP(e,t,n){ajaxP("GET",e,t,n)}function ajaxPostP(e,t,n){ajaxP("POST",e,t,n)}function ajaxP(e,t,n,o){n=n||{},o=o||function(){},$.ajax({dataType:"jsonp",url:t,type:e,data:n,jsonp:"callback",jsonpCallback:"jsonpCallback",success:o})}function getShareUrl(){return location.href}function getShareTitle(e){return encodeURI(e+" (来自leanote.com)")}function shareSinaWeibo(e,t,n){var o="http://service.weibo.com/share/share.php?title="+getShareTitle(t)+"&url="+getShareUrl(e);window.open(o,"Share",windowParam)}function shareTencentWeibo(e,t,n){var o="801542571",i="http://share.v.t.qq.com/index.php?c=share&a=index&appkey="+o+"&title="+getShareTitle(t)+"&url="+getShareUrl(e)+"&pic="+n;window.open(i,"Share",windowParam)}function shareQQ(e,t,n){var o="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+getShareUrl(e)+"&title="+t+"&pics="+n;window.open(o,"Share",windowParam)}function shareRenRen(e,t,n){var o="http://widget.renren.com/dialog/share?resourceUrl="+getShareUrl(e)+"&srcUrl="+getShareUrl(e)+"&title="+getShareTitle(t)+"&pic="+n;window.open(o,"Share",windowParam)}function shareTwitter(e,t,n){var o="https://twitter.com/intent/tweet?text="+getShareTitle(t)+"&pic="+n;window.open(o,"Share",windowParam)}function shareFacebook(e,t,n){var o=" http://www.facebook.com/sharer.php?t="+getShareTitle(t)+"&pic="+n;window.open(o,"Share",windowParam)}function goNowToDatetime(e){return e?e.substr(0,10)+" "+e.substr(11,8):""}function goNowToDate(e){if(!e)return"";var t=e.substr(0,10)+" "+e.substr(11,8),n=t.split(" "),o=n[0].split("-"),i=parseInt(o[0],10),a=parseInt(o[1],10)-1,r=parseInt(o[2],10),s=n[1].split(":"),l=parseInt(s[0],10),c=parseInt(s[1],10)-1,d=parseInt(s[2],10),f=new Date(i,a,r,l,c,d);return f}function getDateDiff(e){var t=(new Date).getTime(),n=t-e;if(0>n)return"";var o=n/diff.month,i=n/(7*diff.day),a=n/diff.day,r=n/diff.hour,s=parseInt(n/diff.minute);return result=o>=1?parseInt(o)+"个月前":i>=1?parseInt(i)+"周前":a>=1?parseInt(a)+"天前":r>=1?parseInt(r)+"小时前":s>1?s+"分钟前":"刚刚"}function weixin(){var e=window.location.href,t=$.trim($(".title").text()),n=$.trim($("#desc").text()),o=$("#content img").eq(0).attr("src");window.shareData={imgUrl:o,timeLineLink:e,sendFriendLink:e,weiboLink:e,tTitle:t,tContent:n,fTitle:t,fContent:n,wContent:n},document.addEventListener("WeixinJSBridgeReady",function i(){WeixinJSBridge.on("menu:share:appmessage",function(e){WeixinJSBridge.invoke("sendAppMessage",{img_url:window.shareData.imgUrl,img_width:"200",link:window.shareData.sendFriendLink,desc:window.shareData.fContent,title:window.shareData.fTitle},function(e){hs_guide("none"),_report("send_msg",e.err_msg)})}),WeixinJSBridge.on("menu:share:timeline",function(e){WeixinJSBridge.invoke("shareTimeline",{img_url:window.shareData.imgUrl,img_width:"200",link:window.shareData.timeLineLink,desc:window.shareData.tContent,title:window.shareData.tTitle},function(e){hs_guide("none"),_report("timeline",e.err_msg)})}),WeixinJSBridge.on("menu:share:weibo",function(e){WeixinJSBridge.invoke("shareWeibo",{content:window.shareData.wContent,url:window.shareData.weiboLink},function(e){hs_guide("none"),_report("weibo",e.err_msg)})})},!1)}function scrollTo(e,t,n){for(var o=$("#content"),i=o.find(t+":contains("+n+")"),a=$('#blogNavContent [data-a="'+t+"-"+encodeURI(n)+'"]'),r=a.size(),s=0;r>s&&a[s]!=e;++s);if(i.size()>=s+1){i=i.eq(s);var l=i.offset().top;LEA.isMobile&&(l-=50);var c=$(document).scrollTop();return void $("html,body").animate({scrollTop:l},200)}}function genNav(){for(var e=$("#content"),t=e.html(),n=[],o=e.find("h1,h2,h3,h4,h5,h6").toArray(),i="<ul>",a=0;a<o.length;++a){var r=$(o[a]).text(),s=o[a].tagName.toLowerCase();i+='<li class="nav-'+s+'"><a data-a="'+s+"-"+encodeURI(r)+'" onclick="scrollTo(this, \''+s+"', '"+r+"')\">"+r+"</a></li>"}return i+="</ul>",$("#blogNavContent").html(i),o.length?!0:($("#blogNavContent").html("无"),!1)}function initNav(){function e(){var e=r.scrollTop();i>=e?$("#blogNav").css("top",i-e):LEA.isMobile?$("#blogNav").css("top",50):$("#blogNav").css("top",10)}var t=genNav();if(t){var n=$(".title"),o=n.offset(),i=o.top+10;LEA.isMobile&&(i+=30),0>i&&(i=10);var a=n.width()+o.left-100;$("#blogNav").css("top",i).css("left",a),$("#blogNav").show(),$("#blogNavNav").click(function(){var e=$("#blogNavContent");e.is(":hidden")?e.show():e.hide()});var r=$(document);e(),$(window).scroll(e)}}function goLogin(){var e=siteUrl+"/login?from="+encodeURI(location.href);location.href=e}function goRegister(){var e=siteUrl+"/register?from="+encodeURI(location.href);location.href=e}function needLogin(){if("undefined"==typeoLine truncated
|
||||
@@ -355,10 +355,10 @@ function getCurVisitUserInfo() {
|
||||
}
|
||||
// 增加阅读次数
|
||||
function incReadNum(noteId) {
|
||||
if(!$.cookie(noteId)) {
|
||||
$.cookie(noteId, 1);
|
||||
//if(!$.cookie(noteId)) {
|
||||
// $.cookie(noteId, 1);
|
||||
ajaxGet(getCurHostUrl() + "/blog/incReadNum", {noteId: noteId});
|
||||
}
|
||||
//}
|
||||
}
|
||||
function getCurHostUrl() {
|
||||
return "//" + location.host;
|
||||
@@ -416,4 +416,4 @@ function isMobile() {
|
||||
}
|
||||
$(function() {
|
||||
isMobile();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>{{.title}}</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 109 KiB |
@@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
||||
@@ -0,0 +1,27 @@
|
||||
{{if gt $.paging.TotalPage 1}}
|
||||
|
||||
<!-- 上一页 -->
|
||||
{{if gt $.paging.CurPage 1}}
|
||||
{{set . "prePageClass" ""}}
|
||||
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
|
||||
{{else}}
|
||||
{{set . "prePageClass" "disabled"}}
|
||||
{{set . "prePageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
<!-- 下一页 -->
|
||||
{{if lt $.paging.CurPage $.paging.TotalPage }}
|
||||
{{set . "nextPageClass" ""}}
|
||||
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
|
||||
{{else}}
|
||||
{{set . "nextPageClass" "disabled"}}
|
||||
{{set . "nextPageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
|
||||
<ul class="pager">
|
||||
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
|
||||
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
|
||||
</ul>
|
||||
|
||||
{{end}}
|
||||
@@ -0,0 +1,49 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>搜索 - {{.keywords}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,52 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,528 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
#headerContainer {
|
||||
height: 100px;
|
||||
background-color: #fff;
|
||||
}
|
||||
#posts {
|
||||
width: 845px;
|
||||
margin: auto;
|
||||
}
|
||||
#postsContainer {
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 15px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a {
|
||||
color: #000000;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.navbar {
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #0fb264;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 200px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签 - {{.curTag}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.tags}}
|
||||
<li>
|
||||
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
|
||||
{{.Tag}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用JSON格式
|
||||
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||
|
||||
注意:
|
||||
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||
|
||||
请在此解析所有配置
|
||||
* Name 主题名
|
||||
* Version 主题版本
|
||||
* Author 主题的作者
|
||||
* AuthorUrl 作者的博客链接或相关链接
|
||||
|
||||
* FriendLinks 友情链接
|
||||
|
||||
*/
|
||||
{
|
||||
"Name": "leanote default theme",
|
||||
"Version": "1.0",
|
||||
"Author": "leanote.com",
|
||||
"AuthorUrl": "http://leanote.com",
|
||||
"FriendLinks": [
|
||||
{"Title": "leanote", "Url": "http://leanote.com"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,509 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>我的博客</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 83 KiB |
@@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
||||
@@ -0,0 +1,27 @@
|
||||
{{if gt $.paging.TotalPage 1}}
|
||||
|
||||
<!-- 上一页 -->
|
||||
{{if gt $.paging.CurPage 1}}
|
||||
{{set . "prePageClass" ""}}
|
||||
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
|
||||
{{else}}
|
||||
{{set . "prePageClass" "disabled"}}
|
||||
{{set . "prePageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
<!-- 下一页 -->
|
||||
{{if lt $.paging.CurPage $.paging.TotalPage }}
|
||||
{{set . "nextPageClass" ""}}
|
||||
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
|
||||
{{else}}
|
||||
{{set . "nextPageClass" "disabled"}}
|
||||
{{set . "nextPageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
|
||||
<ul class="pager">
|
||||
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
|
||||
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
|
||||
</ul>
|
||||
|
||||
{{end}}
|
||||
@@ -0,0 +1,49 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>搜索 - {{.keywords}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,52 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,542 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
#headerContainer {
|
||||
height: 230px;
|
||||
background-color: #fff;
|
||||
}
|
||||
#posts {
|
||||
width: 745px;
|
||||
margin: auto;
|
||||
}
|
||||
#postsContainer {
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 65px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
}
|
||||
#header h1 a {
|
||||
font-size: 48px;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
font-size: 32px;
|
||||
font-style: italic;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.navbar {
|
||||
background-color: #f7f5e7;
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.nav li a:hover {
|
||||
background-color: #000000 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
.nav li.active a {
|
||||
background-color: #f7f5e7 !important;
|
||||
color: #bc360a !important;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 48px;
|
||||
color: #000000;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 48px;
|
||||
color: #000000;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a:hover {
|
||||
color: #ea9629;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #000000;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 150px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin-bottom: 10px ;
|
||||
padding-left: 20px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签 - {{.curTag}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.tags}}
|
||||
<li>
|
||||
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
|
||||
{{.Tag}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用JSON格式
|
||||
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||
|
||||
注意:
|
||||
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||
|
||||
请在此解析所有配置
|
||||
* Name 主题名
|
||||
* Version 主题版本
|
||||
* Author 主题的作者
|
||||
* AuthorUrl 作者的博客链接或相关链接
|
||||
|
||||
* FriendLinks 友情链接
|
||||
|
||||
*/
|
||||
{
|
||||
"Name": "leanote default theme",
|
||||
"Version": "1.0",
|
||||
"Author": "leanote.com",
|
||||
"AuthorUrl": "http://leanote.com",
|
||||
"FriendLinks": [
|
||||
{"Title": "leanote", "Url": "http://leanote.com"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,509 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>{{.title}}</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 136 KiB |
@@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
||||
@@ -0,0 +1,27 @@
|
||||
{{if gt $.paging.TotalPage 1}}
|
||||
|
||||
<!-- 上一页 -->
|
||||
{{if gt $.paging.CurPage 1}}
|
||||
{{set . "prePageClass" ""}}
|
||||
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
|
||||
{{else}}
|
||||
{{set . "prePageClass" "disabled"}}
|
||||
{{set . "prePageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
<!-- 下一页 -->
|
||||
{{if lt $.paging.CurPage $.paging.TotalPage }}
|
||||
{{set . "nextPageClass" ""}}
|
||||
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
|
||||
{{else}}
|
||||
{{set . "nextPageClass" "disabled"}}
|
||||
{{set . "nextPageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
|
||||
<ul class="pager">
|
||||
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
|
||||
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
|
||||
</ul>
|
||||
|
||||
{{end}}
|
||||
@@ -0,0 +1,49 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>搜索 - {{.keywords}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,52 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,579 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 200px;
|
||||
border-right: 1px solid #ebeff2;
|
||||
text-align: right;
|
||||
}
|
||||
#headerContainer {
|
||||
width: 190px;
|
||||
}
|
||||
#headerContainer {
|
||||
background-color: #fff;
|
||||
}
|
||||
#postsContainer {
|
||||
margin-left: 211px;
|
||||
}
|
||||
#postsContainer {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
width: 800px;
|
||||
}
|
||||
#postsContainer .container {
|
||||
margin-left: 12px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 15px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a {
|
||||
color: #000000;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
font-size: 16px;
|
||||
}
|
||||
#logo {
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
}
|
||||
.navbar {
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.navbar .container {
|
||||
width: 200px;
|
||||
}
|
||||
.navbar-default {
|
||||
background: none;
|
||||
border-color: #e7e7e7;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
.navbar-nav {
|
||||
float: none;
|
||||
}
|
||||
.navbar-nav > li {
|
||||
float: none;
|
||||
}
|
||||
.navbar-default .navbar-nav > .active > a,
|
||||
.navbar-default .navbar-nav > .active > a:hover,
|
||||
.navbar-default .navbar-nav > .active > a:focus {
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
}
|
||||
.navbar-nav > li > a {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
width: 800px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px dashed #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #0fb264;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 170px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.tab-content {
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
}
|
||||
.mce-btn {
|
||||
background: none !important;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签 - {{.curTag}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.tags}}
|
||||
<li>
|
||||
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
|
||||
{{.Tag}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用JSON格式
|
||||
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||
|
||||
注意:
|
||||
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||
|
||||
请在此解析所有配置
|
||||
* Name 主题名
|
||||
* Version 主题版本
|
||||
* Author 主题的作者
|
||||
* AuthorUrl 作者的博客链接或相关链接
|
||||
|
||||
* FriendLinks 友情链接
|
||||
|
||||
*/
|
||||
{
|
||||
"Name": "leanote default theme",
|
||||
"Version": "1.0",
|
||||
"Author": "leanote.com",
|
||||
"AuthorUrl": "http://leanote.com",
|
||||
"FriendLinks": [
|
||||
{"Title": "leanote", "Url": "http://leanote.com"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,509 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
||||
@@ -279,7 +279,7 @@ a:hover {
|
||||
color: #000000;
|
||||
}
|
||||
#header h1 a img {
|
||||
max-height: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
font-size: 32px;
|
||||
|
||||
@@ -255,4 +255,4 @@ ul.dropdown-menu {
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -336,3 +336,24 @@ a:focus {
|
||||
display: inline-block;
|
||||
color: #a94442;
|
||||
}
|
||||
.article .article-info .label-post {
|
||||
background: #fff;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
.article .article-info .label-post:hover {
|
||||
background: #000;
|
||||
}
|
||||
.article .article-info .label-yellow:hover {
|
||||
background: #f0ad4e;
|
||||
}
|
||||
.article .article-info .label-green:hover {
|
||||
background: #5cb85c;
|
||||
}
|
||||
.article .article-info .label-blue:hover {
|
||||
background: #428bca;
|
||||
}
|
||||
.article .article-info .label-red:hover {
|
||||
background: #d9534f;
|
||||
}
|
||||
@@ -364,4 +364,28 @@ a:focus {
|
||||
display: inline-block;
|
||||
color: #a94442;
|
||||
}
|
||||
}
|
||||
|
||||
.article .article-info {
|
||||
.label-post {
|
||||
background: #fff;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
padding: 0 2px;
|
||||
&:hover {
|
||||
background: #000;
|
||||
}
|
||||
}
|
||||
.label-yellow:hover {
|
||||
background: #f0ad4e;
|
||||
}
|
||||
.label-green:hover {
|
||||
background: #5cb85c;
|
||||
}
|
||||
.label-blue:hover {
|
||||
background: #428bca;
|
||||
}
|
||||
.label-red:hover {
|
||||
background: #d9534f;
|
||||
}
|
||||
}
|
||||
@@ -7099,7 +7099,41 @@ td.visible-print {
|
||||
/* life */
|
||||
.btn {
|
||||
}
|
||||
.label-post {
|
||||
font-weight: normal;
|
||||
}
|
||||
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
|
||||
border: 1px solid #9B9898;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.label-default {
|
||||
background-color: #464C5E;
|
||||
}
|
||||
.label-red {
|
||||
background-color: #d9534f;
|
||||
}
|
||||
.label-red:hover {
|
||||
background-color: #ba6e6c;
|
||||
}
|
||||
.label-yellow {
|
||||
background-color: #f0ad4e;
|
||||
}
|
||||
.label-yellow:hover {
|
||||
background-color: #bd955d
|
||||
}
|
||||
.label-blue {
|
||||
background-color: #428bca;
|
||||
}
|
||||
.label-blue:hover {
|
||||
background-color: #4f7ca3;
|
||||
}
|
||||
.label-green {
|
||||
background-color: #5cb85c;
|
||||
}
|
||||
.label-green:hover {
|
||||
background-color: #4b764b;
|
||||
}
|
||||
#posts .each-post .title .label-post {
|
||||
font-size: 14px;
|
||||
padding: .2em .6em .3em;
|
||||
}
|
||||
@@ -54,7 +54,6 @@ a:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
#headerContainer {
|
||||
height: 60px;
|
||||
background-color: #fff;
|
||||
-webkit-box-shadow: 1px 1px 8px -1px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.1);
|
||||
@@ -568,3 +567,47 @@ input,
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
.slider-desc {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.slider-desc span {
|
||||
display: inline-block;
|
||||
padding: 3px 10px;
|
||||
background: rgba(27, 37, 46, 0.7);
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
}
|
||||
.mobile-text {
|
||||
bottom: 80px;
|
||||
}
|
||||
#webSliderContainer {
|
||||
position: relative;
|
||||
width: 750px;
|
||||
height: 370px;
|
||||
margin: auto;
|
||||
}
|
||||
#webSliderContainer img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
#mobileSliderContainer {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 300px;
|
||||
margin: auto;
|
||||
}
|
||||
#mobileSliderContainer img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.hide-img {
|
||||
opacity: 0;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ a:hover {
|
||||
}
|
||||
@headerHeight: 60px;
|
||||
#headerContainer {
|
||||
height: @headerHeight;
|
||||
// height: @headerHeight;
|
||||
background-color: #fff;
|
||||
-webkit-box-shadow: 1px 1px 8px -1px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.1);
|
||||
@@ -643,3 +643,50 @@ input, .form-control {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
.slider-desc {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
text-align: center;
|
||||
left:0;
|
||||
right:0;
|
||||
}
|
||||
.slider-desc span {
|
||||
display: inline-block;
|
||||
padding: 3px 10px;
|
||||
background: rgba(27, 37, 46, 0.7);
|
||||
border-radius: 3px;
|
||||
color: #fff;
|
||||
}
|
||||
.mobile-text {
|
||||
bottom: 80px;
|
||||
}
|
||||
#webSliderContainer {
|
||||
position: relative;
|
||||
width: 750px;
|
||||
height: 370px;
|
||||
margin: auto;
|
||||
|
||||
}
|
||||
#webSliderContainer img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
#mobileSliderContainer {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 300px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
#mobileSliderContainer img {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left:0;
|
||||
top:0;
|
||||
}
|
||||
.hide-img {
|
||||
opacity: 0;
|
||||
}
|
||||
@@ -35,11 +35,30 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
html,body {
|
||||
}
|
||||
*,.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
.h4,
|
||||
.h5,
|
||||
.h6 {
|
||||
font-family: @fontFamily;
|
||||
}
|
||||
body {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300;
|
||||
font-size: @fontSize;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
|
||||
#noteItemList, #notebook, #leftNotebook,
|
||||
.slimScrollDiv,
|
||||
#editorContent,
|
||||
#editorContent_ifr,
|
||||
.mce-edit-area,.mce-container-body,.mce-tinymce,
|
||||
#editor .mce-ifr,
|
||||
@@ -51,7 +70,47 @@
|
||||
-webkit-overflow-scrolling: touch !important; // for iphone
|
||||
}
|
||||
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 36px;
|
||||
vertical-align: middle;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tool {
|
||||
border-bottom: 1px solid #ddd;
|
||||
height: 36px;
|
||||
margin-left: -5px; // 为了和左边的底部线连接起来
|
||||
}
|
||||
#tag {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
#editor, #mdEditor{
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 66px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0; // 0px 0px 0px 0px;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 5px;
|
||||
#md-section-helper, #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
// 前面的38影响了dropdown
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
.btn {
|
||||
border-radius: 2px;
|
||||
}
|
||||
@@ -647,8 +706,8 @@
|
||||
#tag {
|
||||
position: absolute;
|
||||
right: 300px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 5px;
|
||||
bottom: 0;
|
||||
}
|
||||
#tagColor {
|
||||
@@ -734,13 +793,9 @@
|
||||
}
|
||||
|
||||
#right-column {
|
||||
border: 1px dashed #BBBBBB;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.preview-container {
|
||||
overflow: auto;
|
||||
|
||||
}
|
||||
|
||||
.wmd-preview {
|
||||
@@ -961,10 +1016,170 @@ top: 4px;
|
||||
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
}
|
||||
|
||||
|
||||
/* leanote nav */
|
||||
|
||||
.leanoteNavTrigger {
|
||||
}
|
||||
|
||||
.leanoteNav {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
// display: none;
|
||||
z-index: 11;
|
||||
margin-top: 4px;
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
// padding-top: 3px;
|
||||
}
|
||||
i {
|
||||
padding: 3px;
|
||||
}
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
.leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
// bottom: 1px;
|
||||
opacity: 0.8;
|
||||
h1 {
|
||||
border-bottom: 1px dashed @borderColor;
|
||||
}
|
||||
span {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.leanoteNav ul {
|
||||
margin:0;
|
||||
padding-left: 23px;
|
||||
li {
|
||||
list-style-type: disc;
|
||||
a {
|
||||
&:hover {
|
||||
color: @hColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.leanoteNav ul .nav-h1 {
|
||||
}
|
||||
.leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
#editorContent {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
outline: none;
|
||||
margin-top: 5px;
|
||||
}
|
||||
bottom: 5px !important;
|
||||
pre {
|
||||
position: relative;
|
||||
// overflow: visible;
|
||||
-mo-height: auto !important; // 防止ace设置了高度
|
||||
.toggle-raw {
|
||||
position: absolute;
|
||||
left: 2px;
|
||||
top: -2px;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
// cursor: default;
|
||||
input {
|
||||
}
|
||||
}
|
||||
&:hover .toggle-raw {
|
||||
// cursor: default;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 不显示空白
|
||||
.ace_invisible_space {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.mce-tinymce-inline {
|
||||
// visibility: hidden !important;
|
||||
// border-width: 0px !important;
|
||||
// z-index: -1 !important;
|
||||
border-width: 0 !important;
|
||||
}
|
||||
#editorContent {
|
||||
a {
|
||||
color: #2a6496;
|
||||
text-decoration: underline;
|
||||
}
|
||||
pre {
|
||||
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
// background-color: #FFFFFF;
|
||||
color: #4D4D4C;
|
||||
// padding: 5px;
|
||||
}
|
||||
.ace-tomorrow {
|
||||
padding: 0;
|
||||
padding-left: 44px;
|
||||
}
|
||||
.ace-to-pre {
|
||||
padding: 0;
|
||||
padding-left: 5px;
|
||||
// border-left: 10px solid #ccc;
|
||||
}
|
||||
|
||||
// 垂直滚动条, 在windows下会显示的问题
|
||||
.ace_scrollbar-v {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.leanote-image-container {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
.loader {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 3px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.progress {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
width: 80px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.close:focus {
|
||||
outline: none;
|
||||
}
|
||||
@@ -30,11 +30,32 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
*,
|
||||
.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
.h4,
|
||||
.h5,
|
||||
.h6 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
}
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
#noteItemList,
|
||||
#notebook,
|
||||
#leftNotebook,
|
||||
.slimScrollDiv,
|
||||
#editorContent,
|
||||
#editorContent_ifr,
|
||||
.mce-edit-area,
|
||||
.mce-container-body,
|
||||
@@ -46,6 +67,47 @@
|
||||
#tags {
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 36px;
|
||||
vertical-align: middle;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tool {
|
||||
border-bottom: 1px solid #ddd;
|
||||
height: 36px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
#tag {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
#editor,
|
||||
#mdEditor {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 66px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 5px;
|
||||
}
|
||||
#mdEditor #md-section-helper,
|
||||
#mdEditor #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
.btn {
|
||||
border-radius: 2px;
|
||||
}
|
||||
@@ -590,8 +652,8 @@
|
||||
#tag {
|
||||
position: absolute;
|
||||
right: 300px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 5px;
|
||||
bottom: 0;
|
||||
}
|
||||
#tagColor {
|
||||
@@ -673,11 +735,6 @@
|
||||
z-index: -1;
|
||||
opacity: none;
|
||||
}
|
||||
#right-column {
|
||||
border: 1px dashed #BBBBBB;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.preview-container {
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -886,12 +943,137 @@
|
||||
.ace_editor * {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
}
|
||||
/* leanote nav */
|
||||
.leanoteNav {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
z-index: 11;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.leanoteNav h1 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.leanoteNav i {
|
||||
padding: 3px;
|
||||
}
|
||||
.leanoteNav span {
|
||||
display: none;
|
||||
}
|
||||
.leanoteNav .leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
.leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.leanoteNav.unfolder h1 {
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
}
|
||||
.leanoteNav.unfolder span {
|
||||
display: inline;
|
||||
}
|
||||
.leanoteNav.unfolder .leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
.leanoteNav ul {
|
||||
margin: 0;
|
||||
padding-left: 23px;
|
||||
}
|
||||
.leanoteNav ul li {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.leanoteNav ul li a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
.leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
#editorContent {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
outline: none;
|
||||
margin-top: 5px;
|
||||
bottom: 5px !important;
|
||||
}
|
||||
#editorContent pre {
|
||||
position: relative;
|
||||
-mo-height: auto !important;
|
||||
}
|
||||
#editorContent pre .toggle-raw {
|
||||
position: absolute;
|
||||
left: 2px;
|
||||
top: -2px;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
#editorContent pre:hover .toggle-raw {
|
||||
display: block;
|
||||
}
|
||||
.ace_invisible_space {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.mce-tinymce-inline {
|
||||
border-width: 0 !important;
|
||||
}
|
||||
#editorContent a {
|
||||
color: #2a6496;
|
||||
text-decoration: underline;
|
||||
}
|
||||
#editorContent pre {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
color: #4D4D4C;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
padding: 0;
|
||||
padding-left: 44px;
|
||||
}
|
||||
#editorContent .ace-to-pre {
|
||||
padding: 0;
|
||||
padding-left: 5px;
|
||||
}
|
||||
#editorContent .ace_scrollbar-v {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#editorContent .leanote-image-container {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
#editorContent .leanote-image-container .loader {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 3px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
#editorContent .leanote-image-container .progress {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
width: 80px;
|
||||
}
|
||||
.close:focus {
|
||||
outline: none;
|
||||
}
|
||||
::selection {
|
||||
background: #000000;
|
||||
@@ -905,18 +1087,6 @@
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
color: #000000;
|
||||
cursor: pointer;
|
||||
@@ -1043,14 +1213,6 @@ a.raw:hover {
|
||||
.dropdown-menu li > a:focus {
|
||||
background-color: #ebeff2;
|
||||
}
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 40px;
|
||||
vertical-align: middle;
|
||||
line-height: 38px;
|
||||
cursor: pointer;
|
||||
}
|
||||
/*********************/
|
||||
#page {
|
||||
overflow: auto;
|
||||
@@ -1402,27 +1564,6 @@ a.raw:hover {
|
||||
#noteTitle:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
#editor,
|
||||
#mdEditor {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 71px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 10px;
|
||||
}
|
||||
#mdEditor #md-section-helper,
|
||||
#mdEditor #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
@@ -1494,13 +1635,6 @@ a.raw:hover {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
/* tag */
|
||||
#tag {
|
||||
height: 40px;
|
||||
line-height: 38px;
|
||||
}
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
#addTagInput {
|
||||
line-height: 25px;
|
||||
display: none;
|
||||
@@ -1542,73 +1676,6 @@ a.raw:hover {
|
||||
.label i:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
/* leanote nav */
|
||||
#leanoteNav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
z-index: 11;
|
||||
margin-right: 2px;
|
||||
}
|
||||
#leanoteNav h1 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#leanoteNav i {
|
||||
padding: 3px;
|
||||
}
|
||||
#leanoteNav span {
|
||||
display: none;
|
||||
}
|
||||
#leanoteNav #leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
#leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
#leanoteNav.unfolder h1 {
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
}
|
||||
#leanoteNav.unfolder span {
|
||||
display: inline;
|
||||
}
|
||||
#leanoteNav.unfolder #leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
#leanoteNav ul {
|
||||
margin: 0;
|
||||
padding-left: 23px;
|
||||
}
|
||||
#leanoteNav ul li {
|
||||
list-style-type: disc;
|
||||
}
|
||||
#leanoteNav ul li a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
#noteRead {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -2076,6 +2143,9 @@ background-position:-1px -670px
|
||||
#noteMaskForLoading {
|
||||
opacity: 0.8;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1024px) {
|
||||
#noteItemList,
|
||||
|
||||
@@ -21,17 +21,7 @@
|
||||
::-moz-selection { background:@selectionBg; color:@selectionColor; }
|
||||
::-webkit-selection { background:@selectionBg; color:@selectionColor; }
|
||||
|
||||
html,body {
|
||||
}
|
||||
*, body {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300;
|
||||
font-size: @fontSize;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
|
||||
a {
|
||||
color: @aBlackColor;
|
||||
cursor: pointer;
|
||||
@@ -178,14 +168,6 @@ a.raw:hover {
|
||||
background-color: @borderColor;
|
||||
}
|
||||
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 40px;
|
||||
vertical-align: middle;
|
||||
line-height: 38px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*********************/
|
||||
#page {
|
||||
@@ -567,25 +549,7 @@ a.raw:hover {
|
||||
// border: 1px solid @hColor;
|
||||
}
|
||||
|
||||
#editor, #mdEditor{
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 71px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0; // 0px 0px 0px 0px;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 10px;
|
||||
#md-section-helper, #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
top:30px;
|
||||
@@ -670,14 +634,7 @@ a.raw:hover {
|
||||
}
|
||||
|
||||
/* tag */
|
||||
#tag {
|
||||
height: 40px;
|
||||
line-height: 38px
|
||||
}
|
||||
// 前面的38影响了dropdown
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
#addTagInput {
|
||||
line-height: 25px;
|
||||
display: none;
|
||||
@@ -721,87 +678,6 @@ a.raw:hover {
|
||||
// font-weight: bold;
|
||||
}
|
||||
|
||||
/* leanote nav */
|
||||
|
||||
#leanoteNavTrigger {
|
||||
}
|
||||
|
||||
#leanoteNav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
// display: none;
|
||||
z-index: 11;
|
||||
margin-right: 2px;
|
||||
h1 {
|
||||
margin:0;
|
||||
font-size: 18px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
i {
|
||||
padding: 3px;
|
||||
}
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
#leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
#leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
// bottom: 1px;
|
||||
opacity: 0.8;
|
||||
h1 {
|
||||
border-bottom: 1px dashed @borderColor;
|
||||
}
|
||||
span {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
#leanoteNav ul {
|
||||
margin:0;
|
||||
padding-left: 23px;
|
||||
li {
|
||||
list-style-type: disc;
|
||||
a {
|
||||
&:hover {
|
||||
color: @hColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#leanoteNav ul .nav-h1 {
|
||||
}
|
||||
#leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
//---------------
|
||||
// note for read
|
||||
#noteRead {
|
||||
|
||||
@@ -262,8 +262,16 @@ a:focus, a:hover, a:active {
|
||||
opacity: .8
|
||||
}
|
||||
|
||||
// editor
|
||||
#editorContent .ace-tomorrow {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ipad
|
||||
@media screen and (max-device-width: 768px) {
|
||||
}
|
||||
// ipad
|
||||
// @media screen and (max-device-width: 1024px) and (orientation: landscape) {
|
||||
@media screen and (max-width: 1024px) {
|
||||
|
||||
@@ -30,11 +30,32 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
*,
|
||||
.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
.h4,
|
||||
.h5,
|
||||
.h6 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
}
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
#noteItemList,
|
||||
#notebook,
|
||||
#leftNotebook,
|
||||
.slimScrollDiv,
|
||||
#editorContent,
|
||||
#editorContent_ifr,
|
||||
.mce-edit-area,
|
||||
.mce-container-body,
|
||||
@@ -46,6 +67,47 @@
|
||||
#tags {
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 36px;
|
||||
vertical-align: middle;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tool {
|
||||
border-bottom: 1px solid #ddd;
|
||||
height: 36px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
#tag {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
#editor,
|
||||
#mdEditor {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 66px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 5px;
|
||||
}
|
||||
#mdEditor #md-section-helper,
|
||||
#mdEditor #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
.btn {
|
||||
border-radius: 2px;
|
||||
}
|
||||
@@ -590,8 +652,8 @@
|
||||
#tag {
|
||||
position: absolute;
|
||||
right: 300px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 5px;
|
||||
bottom: 0;
|
||||
}
|
||||
#tagColor {
|
||||
@@ -673,11 +735,6 @@
|
||||
z-index: -1;
|
||||
opacity: none;
|
||||
}
|
||||
#right-column {
|
||||
border: 1px dashed #BBBBBB;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.preview-container {
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -886,12 +943,137 @@
|
||||
.ace_editor * {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
}
|
||||
/* leanote nav */
|
||||
.leanoteNav {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
z-index: 11;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.leanoteNav h1 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.leanoteNav i {
|
||||
padding: 3px;
|
||||
}
|
||||
.leanoteNav span {
|
||||
display: none;
|
||||
}
|
||||
.leanoteNav .leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
.leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.leanoteNav.unfolder h1 {
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
}
|
||||
.leanoteNav.unfolder span {
|
||||
display: inline;
|
||||
}
|
||||
.leanoteNav.unfolder .leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
.leanoteNav ul {
|
||||
margin: 0;
|
||||
padding-left: 23px;
|
||||
}
|
||||
.leanoteNav ul li {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.leanoteNav ul li a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
.leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
#editorContent {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
outline: none;
|
||||
margin-top: 5px;
|
||||
bottom: 5px !important;
|
||||
}
|
||||
#editorContent pre {
|
||||
position: relative;
|
||||
-mo-height: auto !important;
|
||||
}
|
||||
#editorContent pre .toggle-raw {
|
||||
position: absolute;
|
||||
left: 2px;
|
||||
top: -2px;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
#editorContent pre:hover .toggle-raw {
|
||||
display: block;
|
||||
}
|
||||
.ace_invisible_space {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.mce-tinymce-inline {
|
||||
border-width: 0 !important;
|
||||
}
|
||||
#editorContent a {
|
||||
color: #2a6496;
|
||||
text-decoration: underline;
|
||||
}
|
||||
#editorContent pre {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
color: #4D4D4C;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
padding: 0;
|
||||
padding-left: 44px;
|
||||
}
|
||||
#editorContent .ace-to-pre {
|
||||
padding: 0;
|
||||
padding-left: 5px;
|
||||
}
|
||||
#editorContent .ace_scrollbar-v {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#editorContent .leanote-image-container {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
#editorContent .leanote-image-container .loader {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 3px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
#editorContent .leanote-image-container .progress {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
width: 80px;
|
||||
}
|
||||
.close:focus {
|
||||
outline: none;
|
||||
}
|
||||
::selection {
|
||||
background: #000000;
|
||||
@@ -905,18 +1087,6 @@
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
color: #000000;
|
||||
cursor: pointer;
|
||||
@@ -1037,14 +1207,6 @@ a.raw:hover {
|
||||
.dropdown-menu li > a:focus {
|
||||
background-color: #ebeff2;
|
||||
}
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 40px;
|
||||
vertical-align: middle;
|
||||
line-height: 38px;
|
||||
cursor: pointer;
|
||||
}
|
||||
/*********************/
|
||||
#page {
|
||||
overflow: auto;
|
||||
@@ -1366,27 +1528,6 @@ a.raw:hover {
|
||||
#noteTitle:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
#editor,
|
||||
#mdEditor {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 71px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 10px;
|
||||
}
|
||||
#mdEditor #md-section-helper,
|
||||
#mdEditor #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
@@ -1454,17 +1595,7 @@ a.raw:hover {
|
||||
color: #ddd;
|
||||
}
|
||||
/*标签与其它工具*/
|
||||
#tool {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
/* tag */
|
||||
#tag {
|
||||
height: 40px;
|
||||
line-height: 38px;
|
||||
}
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
#addTagInput {
|
||||
line-height: 25px;
|
||||
display: none;
|
||||
@@ -1506,73 +1637,6 @@ a.raw:hover {
|
||||
.label i:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
/* leanote nav */
|
||||
#leanoteNav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
z-index: 11;
|
||||
margin-right: 2px;
|
||||
}
|
||||
#leanoteNav h1 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#leanoteNav i {
|
||||
padding: 3px;
|
||||
}
|
||||
#leanoteNav span {
|
||||
display: none;
|
||||
}
|
||||
#leanoteNav #leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
#leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
#leanoteNav.unfolder h1 {
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
}
|
||||
#leanoteNav.unfolder span {
|
||||
display: inline;
|
||||
}
|
||||
#leanoteNav.unfolder #leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
#leanoteNav ul {
|
||||
margin: 0;
|
||||
padding-left: 23px;
|
||||
}
|
||||
#leanoteNav ul li {
|
||||
list-style-type: disc;
|
||||
}
|
||||
#leanoteNav ul li a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
#noteRead {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -2011,6 +2075,9 @@ background-position:-1px -670px
|
||||
#noteMaskForLoading {
|
||||
opacity: 0.8;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1024px) {
|
||||
#noteItemList,
|
||||
|
||||
@@ -20,17 +20,6 @@
|
||||
::-moz-selection { background:@selectionBg; color:@selectionColor; }
|
||||
::-webkit-selection { background:@selectionBg; color:@selectionColor; }
|
||||
|
||||
html,body {
|
||||
}
|
||||
*, body {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300;
|
||||
font-size: @fontSize;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
color: @aBlackColor;
|
||||
cursor: pointer;
|
||||
@@ -170,15 +159,6 @@ a.raw:hover {
|
||||
background-color: @borderColor;
|
||||
}
|
||||
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 40px;
|
||||
vertical-align: middle;
|
||||
line-height: 38px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*********************/
|
||||
#page {
|
||||
overflow: auto;
|
||||
@@ -524,25 +504,6 @@ a.raw:hover {
|
||||
outline: none !important;
|
||||
// border: 1px solid @hColor;
|
||||
}
|
||||
#editor, #mdEditor {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 71px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0; // 0px 0px 0px 0px;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 10px;
|
||||
#md-section-helper, #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
@@ -623,19 +584,8 @@ a.raw:hover {
|
||||
}
|
||||
|
||||
/*标签与其它工具*/
|
||||
#tool {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
/* tag */
|
||||
#tag {
|
||||
height: 40px;
|
||||
line-height: 38px
|
||||
}
|
||||
// 前面的38影响了dropdown
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
#addTagInput {
|
||||
line-height: 25px;
|
||||
display: none;
|
||||
@@ -679,88 +629,6 @@ a.raw:hover {
|
||||
// font-weight: bold;
|
||||
}
|
||||
|
||||
/* leanote nav */
|
||||
|
||||
#leanoteNavTrigger {
|
||||
|
||||
}
|
||||
|
||||
#leanoteNav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
// display: none;
|
||||
z-index: 11;
|
||||
margin-right: 2px;
|
||||
h1 {
|
||||
margin:0;
|
||||
font-size: 18px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
i {
|
||||
padding: 3px;
|
||||
}
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
#leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
#leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
// bottom: 1px;
|
||||
opacity: 0.8;
|
||||
h1 {
|
||||
border-bottom: 1px dashed @borderColor;
|
||||
}
|
||||
span {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
#leanoteNav ul {
|
||||
margin:0;
|
||||
padding-left: 23px;
|
||||
li {
|
||||
list-style-type: disc;
|
||||
a {
|
||||
&:hover {
|
||||
color: @hColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#leanoteNav ul .nav-h1 {
|
||||
}
|
||||
#leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
//---------------
|
||||
// note for read
|
||||
#noteRead {
|
||||
|
||||
@@ -30,11 +30,32 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
*,
|
||||
.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
.h4,
|
||||
.h5,
|
||||
.h6 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
}
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
#noteItemList,
|
||||
#notebook,
|
||||
#leftNotebook,
|
||||
.slimScrollDiv,
|
||||
#editorContent,
|
||||
#editorContent_ifr,
|
||||
.mce-edit-area,
|
||||
.mce-container-body,
|
||||
@@ -46,6 +67,47 @@
|
||||
#tags {
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 36px;
|
||||
vertical-align: middle;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tool {
|
||||
border-bottom: 1px solid #ddd;
|
||||
height: 36px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
#tag {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
#editor,
|
||||
#mdEditor {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 66px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 5px;
|
||||
}
|
||||
#mdEditor #md-section-helper,
|
||||
#mdEditor #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
.btn {
|
||||
border-radius: 2px;
|
||||
}
|
||||
@@ -590,8 +652,8 @@
|
||||
#tag {
|
||||
position: absolute;
|
||||
right: 300px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 5px;
|
||||
bottom: 0;
|
||||
}
|
||||
#tagColor {
|
||||
@@ -673,11 +735,6 @@
|
||||
z-index: -1;
|
||||
opacity: none;
|
||||
}
|
||||
#right-column {
|
||||
border: 1px dashed #BBBBBB;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.preview-container {
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -886,12 +943,137 @@
|
||||
.ace_editor * {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
}
|
||||
/* leanote nav */
|
||||
.leanoteNav {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
z-index: 11;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.leanoteNav h1 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.leanoteNav i {
|
||||
padding: 3px;
|
||||
}
|
||||
.leanoteNav span {
|
||||
display: none;
|
||||
}
|
||||
.leanoteNav .leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
.leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.leanoteNav.unfolder h1 {
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
}
|
||||
.leanoteNav.unfolder span {
|
||||
display: inline;
|
||||
}
|
||||
.leanoteNav.unfolder .leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
.leanoteNav ul {
|
||||
margin: 0;
|
||||
padding-left: 23px;
|
||||
}
|
||||
.leanoteNav ul li {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.leanoteNav ul li a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
.leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
#editorContent {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
outline: none;
|
||||
margin-top: 5px;
|
||||
bottom: 5px !important;
|
||||
}
|
||||
#editorContent pre {
|
||||
position: relative;
|
||||
-mo-height: auto !important;
|
||||
}
|
||||
#editorContent pre .toggle-raw {
|
||||
position: absolute;
|
||||
left: 2px;
|
||||
top: -2px;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
#editorContent pre:hover .toggle-raw {
|
||||
display: block;
|
||||
}
|
||||
.ace_invisible_space {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.mce-tinymce-inline {
|
||||
border-width: 0 !important;
|
||||
}
|
||||
#editorContent a {
|
||||
color: #2a6496;
|
||||
text-decoration: underline;
|
||||
}
|
||||
#editorContent pre {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
color: #4D4D4C;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
padding: 0;
|
||||
padding-left: 44px;
|
||||
}
|
||||
#editorContent .ace-to-pre {
|
||||
padding: 0;
|
||||
padding-left: 5px;
|
||||
}
|
||||
#editorContent .ace_scrollbar-v {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#editorContent .leanote-image-container {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
#editorContent .leanote-image-container .loader {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 3px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
#editorContent .leanote-image-container .progress {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
width: 80px;
|
||||
}
|
||||
.close:focus {
|
||||
outline: none;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
@@ -934,18 +1116,11 @@ html,
|
||||
body {
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
color: #000000;
|
||||
cursor: pointer;
|
||||
@@ -1222,6 +1397,13 @@ a.raw:hover {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
#mdEditor .navbar-default {
|
||||
height: auto !important;
|
||||
border: none !important;
|
||||
}
|
||||
#mdEditor .layout-wrapper-l3 {
|
||||
border: none !important;
|
||||
}
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
@@ -1345,7 +1527,7 @@ a.raw:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
/* leanote nav */
|
||||
#leanoteNav {
|
||||
.leanoteNav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
border: 1px solid #ccc;
|
||||
@@ -1355,62 +1537,66 @@ a.raw:hover {
|
||||
z-index: 11;
|
||||
margin-right: 2px;
|
||||
}
|
||||
#leanoteNav h1 {
|
||||
.leanoteNav h1 {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#leanoteNav i {
|
||||
.leanoteNav i {
|
||||
padding: 3px;
|
||||
}
|
||||
#leanoteNav span {
|
||||
.leanoteNav span {
|
||||
display: none;
|
||||
}
|
||||
#leanoteNav #leanoteNavContent {
|
||||
.leanoteNav .leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
#leanoteNav.unfolder {
|
||||
.leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
#leanoteNav.unfolder h1 {
|
||||
.leanoteNav.unfolder h1 {
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
}
|
||||
#leanoteNav.unfolder span {
|
||||
.leanoteNav.unfolder span {
|
||||
display: inline;
|
||||
}
|
||||
#leanoteNav.unfolder #leanoteNavContent {
|
||||
.leanoteNav.unfolder .leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
#leanoteNav ul {
|
||||
.leanoteNav ul {
|
||||
margin: 0;
|
||||
padding-left: 23px;
|
||||
}
|
||||
#leanoteNav ul li {
|
||||
.leanoteNav ul li {
|
||||
list-style-type: disc;
|
||||
}
|
||||
#leanoteNav ul li a:hover {
|
||||
.leanoteNav ul li a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#leanoteNav ul .nav-h2 {
|
||||
.leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#leanoteNav ul .nav-h3 {
|
||||
.leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#leanoteNav ul .nav-h4 {
|
||||
.leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#leanoteNav ul .nav-h5 {
|
||||
.leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
#mdEditor .leanoteNav {
|
||||
top: 10px;
|
||||
right: 0px;
|
||||
}
|
||||
#noteRead {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -1605,11 +1791,11 @@ background-position:-1px -670px
|
||||
}
|
||||
#editorMask {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
top: 30px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
right: -30px;
|
||||
left: 0;
|
||||
background-color: #fff;
|
||||
background-color: #fbfcf7;
|
||||
z-index: -10;
|
||||
padding-top: 50px;
|
||||
text-align: center;
|
||||
@@ -1713,10 +1899,11 @@ body {
|
||||
position: absolute;
|
||||
top: 60px;
|
||||
z-index: 2;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
#wmd-input {
|
||||
border: none;
|
||||
background-color: #fbfcf7;
|
||||
background-color: #fbfcf7 !important;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
#md-section-helper {
|
||||
@@ -1925,3 +2112,9 @@ body {
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
}
|
||||
#editorContent {
|
||||
border: none;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
@@ -68,15 +68,12 @@
|
||||
html,body {
|
||||
background-color: @bgColor;
|
||||
}
|
||||
*, body {
|
||||
body {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300;
|
||||
font-size: @fontSize;
|
||||
}
|
||||
h1, h2, h3 {
|
||||
font-family: @fontFamily;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
|
||||
a {
|
||||
color: @aBlackColor;
|
||||
cursor: pointer;
|
||||
@@ -381,6 +378,13 @@ a.raw:hover {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
.navbar-default {
|
||||
height: auto !important;
|
||||
border: none !important;
|
||||
}
|
||||
.layout-wrapper-l3 {
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
@@ -519,7 +523,7 @@ a.raw:hover {
|
||||
|
||||
/* leanote nav */
|
||||
|
||||
#leanoteNav {
|
||||
.leanoteNav {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
border: 1px solid #ccc;
|
||||
@@ -541,13 +545,13 @@ a.raw:hover {
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
#leanoteNavContent {
|
||||
.leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
#leanoteNav.unfolder {
|
||||
.leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
// bottom: 1px;
|
||||
@@ -559,13 +563,13 @@ a.raw:hover {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#leanoteNavContent {
|
||||
.leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
#leanoteNav ul {
|
||||
.leanoteNav ul {
|
||||
margin:0;
|
||||
padding-left: 23px;
|
||||
li {
|
||||
@@ -577,24 +581,29 @@ a.raw:hover {
|
||||
}
|
||||
}
|
||||
}
|
||||
#leanoteNav ul .nav-h1 {
|
||||
.leanoteNav ul .nav-h1 {
|
||||
}
|
||||
#leanoteNav ul .nav-h2 {
|
||||
.leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#leanoteNav ul .nav-h3 {
|
||||
.leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#leanoteNav ul .nav-h4 {
|
||||
.leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#leanoteNav ul .nav-h5 {
|
||||
.leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
#mdEditor .leanoteNav {
|
||||
top: 10px;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
//---------------
|
||||
// note for read
|
||||
#noteRead {
|
||||
@@ -811,8 +820,11 @@ background-position:-1px -670px
|
||||
width: 100% !important;
|
||||
}
|
||||
#editorMask {
|
||||
position: absolute; top: 0px; bottom: 0px; right: 0; left: 0;
|
||||
background-color: #fff;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
bottom: 0px; right: -30px;
|
||||
left: 0;
|
||||
background-color: #fbfcf7;
|
||||
z-index: -10;
|
||||
.fa, a {
|
||||
font-size: 24px;
|
||||
@@ -920,10 +932,11 @@ html,body {
|
||||
position: absolute;
|
||||
top: @headerHeight;
|
||||
z-index: 2;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
#wmd-input {
|
||||
border: none;
|
||||
background-color: @bgColor;
|
||||
background-color: @bgColor !important;
|
||||
font-size: 16px !important;
|
||||
}
|
||||
#md-section-helper {
|
||||
@@ -1135,3 +1148,10 @@ body {
|
||||
-webkit-overflow-scrolling: touch !important; // for iphone
|
||||
}
|
||||
}
|
||||
|
||||
#editorContent {
|
||||
border: none;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
@@ -30,11 +30,32 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
*,
|
||||
.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
.h4,
|
||||
.h5,
|
||||
.h6 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
}
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 16px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
#noteItemList,
|
||||
#notebook,
|
||||
#leftNotebook,
|
||||
.slimScrollDiv,
|
||||
#editorContent,
|
||||
#editorContent_ifr,
|
||||
.mce-edit-area,
|
||||
.mce-container-body,
|
||||
@@ -46,6 +67,47 @@
|
||||
#tags {
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
height: 36px;
|
||||
vertical-align: middle;
|
||||
line-height: 36px;
|
||||
cursor: pointer;
|
||||
}
|
||||
#tool {
|
||||
border-bottom: 1px solid #ddd;
|
||||
height: 36px;
|
||||
margin-left: -5px;
|
||||
}
|
||||
#tag {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
}
|
||||
#editor,
|
||||
#mdEditor {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top: 66px;
|
||||
bottom: 0px;
|
||||
right: 0;
|
||||
left: 5px;
|
||||
padding: 0;
|
||||
display: none;
|
||||
}
|
||||
#mdEditor {
|
||||
z-index: 1;
|
||||
background-color: #fff;
|
||||
bottom: 5px;
|
||||
}
|
||||
#mdEditor #md-section-helper,
|
||||
#mdEditor #wmd-input {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
}
|
||||
#tag .dropdown {
|
||||
line-height: 30px;
|
||||
}
|
||||
.btn {
|
||||
border-radius: 2px;
|
||||
}
|
||||
@@ -590,8 +652,8 @@
|
||||
#tag {
|
||||
position: absolute;
|
||||
right: 300px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
left: 5px;
|
||||
bottom: 0;
|
||||
}
|
||||
#tagColor {
|
||||
@@ -673,11 +735,6 @@
|
||||
z-index: -1;
|
||||
opacity: none;
|
||||
}
|
||||
#right-column {
|
||||
border: 1px dashed #BBBBBB;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.preview-container {
|
||||
overflow: auto;
|
||||
}
|
||||
@@ -886,12 +943,137 @@
|
||||
.ace_editor * {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
}
|
||||
/* leanote nav */
|
||||
.leanoteNav {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
opacity: 0.5;
|
||||
z-index: 11;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.leanoteNav h1 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
padding: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.leanoteNav i {
|
||||
padding: 3px;
|
||||
}
|
||||
.leanoteNav span {
|
||||
display: none;
|
||||
}
|
||||
.leanoteNav .leanoteNavContent {
|
||||
display: none;
|
||||
overflow: auto;
|
||||
}
|
||||
.leanoteNav.unfolder {
|
||||
min-width: 200px;
|
||||
max-width: 300px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
.leanoteNav.unfolder h1 {
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
}
|
||||
.leanoteNav.unfolder span {
|
||||
display: inline;
|
||||
}
|
||||
.leanoteNav.unfolder .leanoteNavContent {
|
||||
display: block;
|
||||
min-height: 30px;
|
||||
}
|
||||
.leanoteNav ul {
|
||||
margin: 0;
|
||||
padding-left: 23px;
|
||||
}
|
||||
.leanoteNav ul li {
|
||||
list-style-type: disc;
|
||||
}
|
||||
.leanoteNav ul li a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
.leanoteNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
.leanoteNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
.leanoteNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
.leanoteNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
#editorContent {
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
outline: none;
|
||||
margin-top: 5px;
|
||||
bottom: 5px !important;
|
||||
}
|
||||
#editorContent pre {
|
||||
position: relative;
|
||||
-mo-height: auto !important;
|
||||
}
|
||||
#editorContent pre .toggle-raw {
|
||||
position: absolute;
|
||||
left: 2px;
|
||||
top: -2px;
|
||||
z-index: 100;
|
||||
display: none;
|
||||
}
|
||||
#editorContent pre:hover .toggle-raw {
|
||||
display: block;
|
||||
}
|
||||
.ace_invisible_space {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.mce-tinymce-inline {
|
||||
border-width: 0 !important;
|
||||
}
|
||||
#editorContent a {
|
||||
color: #2a6496;
|
||||
text-decoration: underline;
|
||||
}
|
||||
#editorContent pre {
|
||||
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||
color: #4D4D4C;
|
||||
}
|
||||
#editorContent .ace-tomorrow {
|
||||
padding: 0;
|
||||
padding-left: 44px;
|
||||
}
|
||||
#editorContent .ace-to-pre {
|
||||
padding: 0;
|
||||
padding-left: 5px;
|
||||
}
|
||||
#editorContent .ace_scrollbar-v {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
#editorContent .leanote-image-container {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
}
|
||||
#editorContent .leanote-image-container .loader {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 3px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
#editorContent .leanote-image-container .progress {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
width: 80px;
|
||||
}
|
||||
.close:focus {
|
||||
outline: none;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
|
||||
@@ -49,7 +49,7 @@ ul.ztree.zTreeDragUL {z-index: 333;margin:0; padding:0; position:absolute; width
|
||||
background-color: cfcfcf;
|
||||
border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
|
||||
.zTreeMask {z-index:1000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
|
||||
.ztree li ul{ margin:0; padding:0}
|
||||
.ztree li ul{ margin:0; padding:0;margin-left: 10px;}
|
||||
.ztree li {line-height:30px;}
|
||||
.ztree > li {
|
||||
border-bottom: 1px dashed #eee;
|
||||
@@ -63,7 +63,7 @@ ul.ztree.zTreeDragUL {z-index: 333;margin:0; padding:0; position:absolute; width
|
||||
.ztree li span.button {margin-top: -5px;}
|
||||
.ztree li span.button.switch {width: 16px;height: 30px; line-height: 30px; text-align: center}
|
||||
|
||||
.ztree li a.level0 span {font-size: 13px;}
|
||||
.ztree li a.level0 span {font-size: 14px;}
|
||||
.ztree li span.button {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}window.rangy=function(){function t(t,e){var n=typeof t[e];return n==h||!(n!=u||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=u||!t[e])}function n(t,e){return typeof t[e]!=f}function r(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}function i(t){return t&&v(t,m)&&b(t,g)}function a(t){window.alert("Rangy not supported in your browser. Reason: "+t),x.initialized=!0,x.supported=!1}function o(t){var e="Rangy warning: "+t;x.config.alertOnWarn?window.alert(e):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(e)}function s(){if(!x.initialized){var n,r=!1,o=!1;t(document,"createRange")&&(n=document.createRange(),v(n,p)&&b(n,d)&&(r=!0),n.detach());var s=e(document,"body")?document.body:document.getElementsByTagName("body")[0];s&&t(s,"createTextRange")&&(n=s.createTextRange(),i(n)&&(o=!0)),r||o||a("Neither Range nor TextRange are implemented"),x.initialized=!0,x.features={implementsDomRange:r,implementsTextRange:o};for(var l=_.concat(w),c=0,u=l.length;u>c;++c)try{l[c](x)}catch(h){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",h)}}}function l(t){t=t||window,s();for(var e=0,n=C.length;n>e;++e)C[e](t)}function c(t){this.name=t,this.initialized=!1,this.supported=!1}var u="object",h="function",f="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],p=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],g=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],m=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],v=r(t),y=r(e),b=r(n),x={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:v,areHostObjects:y,areHostProperties:b,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};x.fail=a,x.warn=o,{}.hasOwnProperty?x.util.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}:a("hasOwnProperty not supported");var w=[],_=[];x.init=s,x.addInitListener=function(t){x.initialized?t(x):w.push(t)};var C=[];x.addCreateMissingNativeApiListener=function(t){C.push(t)},x.createMissingNativeApi=l,c.prototype.fail=function(t){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+t)},c.prototype.warn=function(t){x.warn("Module "+this.name+": "+t)},c.prototype.createError=function(t){return new Error("Error in Rangy "+this.name+" module: "+t)},x.createModule=function(t,e){var n=new c(t);x.modules[t]=n,_.push(function(t){e(t,n),n.initialized=!0,n.supported=!0})},x.requireModules=function(t){for(var e,n,r=0,i=t.length;i>r;++r){if(n=t[r],e=x.modules[n],!(e&&e instanceof c))throw new Error("Module '"+n+"' not found");if(!e.supported)throw new Error("Module '"+n+"' not supported")}};var S=!1,E=function(){S||(S=!0,x.initialized||s())};return typeof window==f?void a("No window found"):typeof document==f?void a("No document found"):(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",E,!1),t(window,"addEventListener")?window.addEventListener("load",E,!1):t(window,"attachEvent")?window.attachEvent("onload",E):a("Window does not have required addEventListener or attachEvent method"),x)}(),rangy.createModule("DomUtil",function(t,e){function n(t){var e;return typeof t.namespaceURI==E||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function r(t){var e=t.parentNode;return 1==e.nodeType?e:null}function i(t){for(var e=0;t=t.previousSibling;)e++;return e}function a(t){var e;return c(t)?t.length:(e=t.childNodes)?e.length:0}function o(t,e){var n,r=[];for(n=t;n;n=n.parentNode)r.push(n);for(n=e;n;n=n.parentNode)if(N(r,n))return n;return null}function s(t,e,n){for(var r=n?e:e.parentNode;r;){if(r===t)return!0;r=r.parentNode}return!1}function l(t,e,n){for(var r,i=n?t:t.parentNode;i;){if(r=i.parentNode,r===e)return i;i=r}return null}function c(t){var e=t.nodeType;return 3==e||4==e||8==e}function u(t,e){var n=e.nextSibling,r=e.parentNode;return n?r.insertBefore(t,n):r.appendChild(t),t}function h(t,e){var n=t.cloneNode(!1);return n.deleteData(0,e),t.deleteData(e,t.length-e),u(n,t),n}function f(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=E)return t.ownerDocument;if(typeof t.document!=E)return t.document;if(t.parentNode)return f(t.parentNode);throw new Error("getDocument: no document fouLine truncated
|
||||
else{var n=e.docSelection.createRange();if(u(n))h(e,n);else{e.rangeCount=n.length;for(var r,a=_.getDocument(n.item(0)),s=0;s<e.rangeCount;++s)r=t.createRange(a),r.selectNode(n.item(s)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,i(e,e._ranges[e.rangeCount-1],!1)}}}function d(t,e){for(var n=t.docSelection.createRange(),r=c(e),i=_.getDocument(n.item(0)),a=_.getBody(i).createControlRange(),o=0,s=n.length;s>o;++o)a.add(n.item(o));try{a.add(r)}catch(l){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),f(t)}function p(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function g(t,e){for(var n,r=_.getDocument(e[0].startContainer),i=_.getBody(r).createControlRange(),a=0;rangeCount>a;++a){n=c(e[a]);try{i.add(n)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),f(t)}function m(t,e){if(t.anchorNode&&_.getDocument(t.anchorNode)!==_.getDocument(e))throw new k("WRONG_DOCUMENT_ERR")}function v(t){var e=[],n=new T(t.anchorNode,t.anchorOffset),r=new T(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if("undefined"!=typeof t.rangeCount)for(var a=0,o=t.rangeCount;o>a;++a)e[a]=S.inspect(t.getRangeAt(a));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}t.requireModules(["DomUtil","DomRange","WrappedRange"]),t.config.checkSelectionRanges=!0;var y,b,x="boolean",w="_rangySelection",_=t.dom,C=t.util,S=t.DomRange,E=t.WrappedRange,k=t.DOMException,T=_.DomPosition,I="Control",N=t.util.isHostMethod(window,"getSelection"),R=t.util.isHostObject(document,"selection"),A=R&&(!N||t.config.preferTextRange);A?(y=r,t.isSelectionValid=function(t){var e=(t||window).document,n=e.selection;return"None"!=n.type||_.getDocument(n.createRange().parentElement())==e}):N?(y=n,t.isSelectionValid=function(){return!0}):e.fail("Neither document.selection or window.getSelection() detected."),t.getNativeSelection=y;var M=y(),L=t.createNativeRange(document),O=_.getBody(document),D=C.areHostObjects(M,["anchorNode","focusNode"]&&C.areHostProperties(M,["anchorOffset","focusOffset"]));t.features.selectionHasAnchorAndFocus=D;var F=C.isHostMethod(M,"extend");t.features.selectionHasExtend=F;var P="number"==typeof M.rangeCount;t.features.selectionHasRangeCount=P;var B=!1,j=!0;C.areHostMethods(M,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof M.rangeCount&&t.features.implementsDomRange&&!function(){var t=document.createElement("iframe");t.frameBorder=0,t.style.position="absolute",t.style.left="-10000px",O.appendChild(t);var e=_.getIframeDocument(t);e.open(),e.write("<html><head></head><body>12</body></html>"),e.close();var n=_.getIframeWindow(t).getSelection(),r=e.documentElement,i=r.lastChild,a=i.firstChild,o=e.createRange();o.setStart(a,1),o.collapse(!0),n.addRange(o),j=1==n.rangeCount,n.removeAllRanges();var s=o.cloneRange();o.setStart(a,0),s.setEnd(a,2),n.addRange(o),n.addRange(s),B=2==n.rangeCount,o.detach(),s.detach(),O.removeChild(t)}(),t.features.selectionSupportsMultipleRanges=B,t.features.collapsedNonEditableSelectionsSupported=j;var $,H=!1;O&&C.isHostMethod(O,"createControlRange")&&($=O.createControlRange(),C.areHostProperties($,["item","add"])&&(H=!0)),t.features.implementsControlRange=H,b=D?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return t.rangeCount?t.getRangeAt(t.rangeCount-1).collapsed:!1};var U;C.isHostMethod(M,"getRangeAt")?U=function(t,e){try{return t.getRangeAt(e)}catch(n){return null}}:D&&(U=function(e){var n=_.getDocument(e.anchorNode),r=t.createRange(n);return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&(r.setStart(e.focusNode,e.focusOffset),r.setEnd(e.anchorNode,e.anchorOffset)),r}),t.getSelection=function(t){t=t||window;var e=t[w],n=y(t),i=R?r(t):null;return e?(e.nativeSelection=n,e.docSelection=i,e.refresh(t)):(e=new p(n,i,t),t[w]=e),e},t.getIframeSelection=function(e){return t.getSelection(_.getIframeWindow(e))};var q=p.prototype;if(!A&&D&&C.areHostMethods(M,["removeAllRanges","addRange"])){q.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),o(this)};var z=function(e,n){var r=S.getRangeDocument(n),i=t.createRange(r);i.collapseToPoint(n.endContainer,n.endOffset),e.nativeSelection.addRange(s(i)),e.nativeSelection.extend(n.startContainer,n.startOffset),e.refresh()};q.addRange=P?function(e,n){if(H&&R&&this.docSelection.type==I)d(this,e);else if(n&&F)z(this,e);else{var r;if(B?r=this.rangeCount:(this.removeAllRanges(),r=0),this.nativeSelection.addRange(s(e)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==r+1){if(t.config.checkSelectionRanges){var a=U(this.nativeSelection,this.rangeCount-1);a&&!S.rangesEqual(a,e)&&(e=new E(a))}this._ranges[this.rangeLine truncated
|
||||
var i=x.exec.call(/\/([a-z]*)$/i,String(t))[1];return r=r||{},r.add&&(i=n(i+r.add)),r.remove&&(i=x.replace.call(i,new RegExp("["+r.remove+"]+","g"),"")),t=e(new RegExp(t.source,i),a(t)?t[y].captureNames.slice(0):null,r.addProto)}function i(){return{captureNames:null}}function a(t){return!(!t[y]||!t[y].captureNames)}function o(t,e){if(Array.prototype.indexOf)return t.indexOf(e);var n,r=t.length;for(n=0;r>n;++n)if(t[n]===e)return n;return-1}function s(t,e){return M.call(t)==="[object "+e+"]"}function l(t,e,n){return x.test.call(n.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,t.slice(e))}function c(t,e){var r;if(n(e)!==e)throw new SyntaxError("Invalid duplicate regex flag "+e);for(t=x.replace.call(t,/^\(\?([\w$]+)\)/,function(t,r){if(x.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+t);return e=n(e+r),""}),r=0;r<e.length;++r)if(!A[e.charAt(r)])throw new SyntaxError("Unknown regex flag "+e.charAt(r));return{pattern:t,flags:e}}function u(t){return t=t||{},s(t,"String")&&(t=m.forEach(t,/[^\s,]+/,function(t){this[t]=!0},{})),t}function h(t){if(!/^[\w$]$/.test(t))throw new Error("Flag must be a single character A-Za-z0-9_$");A[t]=!0}function f(t,e,n,r,i){for(var a,o,s=S.length,l=null;s--;)if(o=S[s],(o.scope===r||"all"===o.scope)&&(!o.flag||e.indexOf(o.flag)>-1)&&(a=m.exec(t,o.regex,n,"sticky"))){l={matchLength:a[0].length,output:o.handler.call(i,a,r,e),reparse:o.reparse};break}return l}function d(t){m.cache.flush("patterns"),b.astral=t}function p(t){RegExp.prototype.exec=(t?w:x).exec,RegExp.prototype.test=(t?w:x).test,String.prototype.match=(t?w:x).match,String.prototype.replace=(t?w:x).replace,String.prototype.split=(t?w:x).split,b.natives=t}function g(t){if(null==t)throw new TypeError("Cannot convert null or undefined to object");return t}var m,v,y="xregexp",b={astral:!1,natives:!1},x={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},w={},_={},C={},S=[],E="default",k="class",T={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},I=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,N=x.exec.call(/()??/,"")[1]===t,R=RegExp.prototype.sticky!==t,A={g:!0,i:!0,m:!0,y:R},M={}.toString;return m=function(n,i){var a,o,s,l={hasNamedCapture:!1,captureNames:[]},u=E,h="",d=0;if(m.isRegExp(n)){if(i!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return r(n,{addProto:!0})}if(n=n===t?"":String(n),i=i===t?"":String(i),s=n+"***"+i,!C[s]){for(a=c(n,i),n=a.pattern,i=a.flags;d<n.length;){do a=f(n,i,d,u,l),a&&a.reparse&&(n=n.slice(0,d)+a.output+n.slice(d+a.matchLength));while(a&&a.reparse);a?(h+=a.output,d+=a.matchLength||1):(o=m.exec(n,T[u],d,"sticky")[0],h+=o,d+=o.length,"["===o&&u===E?u=k:"]"===o&&u===k&&(u=E))}C[s]={pattern:x.replace.call(h,/\(\?:\)(?=\(\?:\))|^\(\?:\)|\(\?:\)$/g,""),flags:x.replace.call(i,/[^gimy]+/g,""),captures:l.hasNamedCapture?l.captureNames:null}}return s=C[s],e(new RegExp(s.pattern,s.flags),s.captures,!0)},m.prototype=new RegExp,m.version="3.0.0-pre",m.addToken=function(t,e,n){n=n||{};var i,a=n.optionalFlags;if(n.flag&&h(n.flag),a)for(a=x.split.call(a,""),i=0;i<a.length;++i)h(a[i]);S.push({regex:r(t,{add:"g"+(R?"y":"")}),handler:e,scope:n.scope||E,flag:n.flag,reparse:n.reparse}),m.cache.flush("patterns")},m.cache=function(t,e){var n=t+"***"+(e||"");return _[n]||(_[n]=m(t,e))},m.cache.flush=function(t){"patterns"===t?C={}:_={}},m.escape=function(t){return x.replace.call(g(t),/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},m.exec=function(t,e,n,a){var o,s,l="g";return R&&(a||e.sticky&&a!==!1)&&(l+="y"),e[y]=e[y]||i(),s=e[y][l]||(e[y][l]=r(e,{add:l,remove:a===!1?"y":""})),s.lastIndex=n=n||0,o=w.exec.call(s,t),a&&o&&o.index!==n&&(o=null),e.global&&(e.lastIndex=o?s.lastIndex:0),o},m.forEach=function(t,e,n,r){for(var i,a=0,o=-1;i=m.exec(t,e,a);)n.call(r,i,++o,t,e),a=i.index+(i[0].length||1);return r},m.globalize=function(t){return r(t,{add:"g",addProto:!0})},m.install=function(t){t=u(t),!b.astral&&t.astral&&d(!0),!b.natives&&t.natives&&p(!0)},m.isInstalled=function(t){return!!b[t]},m.isRegExp=function(t){return"[object RegExp]"===M.call(t)},m.match=function(t,e,n){var a,o,s=e.global&&"one"!==n||"all"===n,l=(s?"g":"")+(e.sticky?"y":"");return e[y]=e[y]||i(),o=e[y][l||"noGY"]||(e[y][l||"noGY"]=r(e,{add:l,remove:"one"===n?"g":""})),a=x.match.call(g(t),o),e.global&&(e.lastIndex="one"===n&&a?a.index+a[0].length:0),s?a||[]:a&&a[0]},m.matchChain=function(t,e){return function n(t,r){var i,a=e[r].regex?e[r]:{regex:e[r]},o=[],s=function(t){if(a.backref){if(!(t.hasOwnProperty(a.backref)||+a.backref<t.length))throw new ReferenceError("Backreference to undefined group: "+a.backref);o.push(t[a.backref]||"")}else o.push(t[0])};for(i=0;i<t.lenLine truncated
|
||||
}(t),function(t){if(!t.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");t.addUnicodeData([{name:"ASCII",bmp:"\x00-"},{name:"Alphabetic",bmp:"A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͅͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևְ-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-ٗٙ-ٟٮ-ۓە-ۜۡ-ۭۨ-ۯۺ-ۼۿܐ-ܿݍ-ޱߊ-ߪߴߵߺࠀ-ࠗࠚ-ࠬࡀ-ࡘࢠࢢ-ࢬࣤ-ࣰࣩ-ࣾऀ-ऻऽ-ौॎ-ॐॕ-ॣॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হঽ-ৄেৈোৌৎৗড়ঢ়য়-ৣৰৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੂੇੈੋੌੑਖ਼-ੜਫ਼ੰ-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ૅે-ૉોૌૐૠ-ૣଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽ-ୄେୈୋୌୖୗଡ଼ଢ଼ୟ-ୣୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-ௌௐௗఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-ౌౕౖౘౙౠ-ౣಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊ-ೌೕೖೞೠ-ೣೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൌൎൗൠ-ൣൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ුූෘ-ෟෲෳก-ฺเ-ๆํກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆໍໜ-ໟༀཀ-ཇཉ-ཬཱ-ཱྀྈ-ྗྙ-ྼက-ံးျ-ဿၐ-ၢၥ-ၨၮ-ႆႎႜႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜓᜠ-ᜳᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-ឳា-ៈៗៜᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-ᤸᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨛᨠ-ᩞᩡ-ᩴᪧᬀ-ᬳᬵ-ᭃᭅ-ᭋᮀ-ᮩᮬ-ᮯᮺ-ᯥᯧ-ᯱᰀ-ᰵᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙴ-ꙻꙿ-ꚗꚟ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠧꡀ-ꡳꢀ-ꣃꣲ-ꣷꣻꤊ-ꤪꤰ-ꥒꥠ-ꥼꦀ-ꦲꦴ-ꦿꧏꨀ-ꨶꩀ-ꩍꩠ-ꩶꩺꪀ-ꪾꫀꫂꫛ-ꫝꫠ-ꫯꫲ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",astral:"�[�-�]|�[�-�]|�[�-�]|�[�-�]|�[�-��-��-��-��-��-�]|[��-��-�][�-�]|�[�-�]|�[�-��-�]|�[�-�]|�[�-�]|�[�-���-�����-��-��-��-����-����-��-��-��-��-��-��-�]|�[�-��-��-����-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-��-�]|�[�-��-�������-��-���-��-��-��-��-��-��-��-���-��-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-������-��-��������-�������������-��-��-��-���-��-��-��-��-�]|�[�-��-�]|�[��]|�[�-�]|�[�-�]"},{name:"Any",isBmpLast:!0,bmp:"\x00-",astral:"[�-�][�-�]"},{name:"Assigned",inverseOf:"Cn"},{name:"Default_Ignorable_Code_Point",bmp:"͏ᅟᅠ឴឵᠋-᠍---ㅤ︀-️ᅠ-",astral:"[�-�][�-�]|�[�-�]"},{name:"Lowercase",bmp:"a-zªµºß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶƹƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿɀɂɇɉɋɍɏ-ʓʕ-ʸˀˁˠ-ˤͅͱͳͷͺ-ͽΐά-ώϐϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᶿḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷιῂ-ῄῆLine truncated
|
||||
}),define("settings",["underscore","constants","storage"],function(t,e,n){var r={layoutOrientation:"horizontal",editMode:"ltr",lazyRendering:!0,editorFontClass:"font-rich",fontSizeRatio:1,maxWidthRatio:1,cursorFocusRatio:.5,defaultContent:"\n\n\n> Written with [StackEdit]("+e.MAIN_URL+").",commitMsg:"Published with "+e.MAIN_URL,conflictMode:"merge",markdownMimeType:"text/plain",gdriveMultiAccount:1,gdriveFullAccess:!0,dropboxFullAccess:!0,githubFullAccess:!0,template:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width, initial-scale=1.0">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="'+e.MAIN_URL+'res-min/themes/base.css" />','<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>",'<body><div class="container"><%= documentHTML %></div></body>',"</html>"].join("\n"),pdfTemplate:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="http://localhost/res-min/themes/base.css" />','<script type="text/x-mathjax-config">','MathJax.Hub.Config({ messageStyle: "none" });',"</script>",'<script type="text/javascript" src="http://localhost/res/bower-libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>","<body><%= documentHTML %></body>","</html>"].join("\n"),pdfOptions:["{",' "marginTop": 25,',' "marginRight": 25,',' "marginBottom": 25,',' "marginLeft": 25,',' "pageSize": "A4"',"}"].join("\n"),couchdbUrl:e.COUCHDB_URL,extensionSettings:{}};try{t.extend(r,JSON.parse(n.settings))}catch(i){}return r}),function(t,e){function n(t,e,n){return t.addEventListener?void t.addEventListener(e,n,!1):void t.attachEvent("on"+e,n)}function r(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return S[t.which]?S[t.which]:E[t.which]?E[t.which]:String.fromCharCode(t.which).toLowerCase()}function i(t,e){return t.sort().join(",")===e.sort().join(",")}function a(t){t=t||{};var e,n=!1;for(e in R)t[e]?n=!0:R[e]=0;n||(L=!1)}function o(t,e,n,r,a,o){var s,l,c=[],u=n.type;if(!I[t])return[];for("keyup"==u&&d(t)&&(e=[t]),s=0;s<I[t].length;++s)if(l=I[t][s],(r||!l.seq||R[l.seq]==l.level)&&u==l.action&&("keypress"==u&&!n.metaKey&&!n.ctrlKey||i(e,l.modifiers))){var h=!r&&l.combo==a,f=r&&l.seq==r&&l.level==o;(h||f)&&I[t].splice(s,1),c.push(l)}return c}function s(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function l(t){return t.preventDefault?void t.preventDefault():void(t.returnValue=!1)}function c(t){return t.stopPropagation?void t.stopPropagation():void(t.cancelBubble=!0)}function u(t,e,n,r){D.stopCallback(e,e.target||e.srcElement,n,r)||t(e,n)===!1&&(l(e),c(e))}function h(t,e,n){var r,i=o(t,e,n),s={},l=0,c=!1;for(r=0;r<i.length;++r)i[r].seq&&(l=Math.max(l,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=l)continue;c=!0,s[i[r].seq]=1,u(i[r].callback,n,i[r].combo,i[r].seq)}else c||u(i[r].callback,n,i[r].combo);var h="keypress"==n.type&&M;n.type!=L||d(t)||h||a(s),M=c&&"keydown"==n.type}function f(t){"number"!=typeof t.which&&(t.which=t.keyCode);var e=r(t);if(e)return"keyup"==t.type&&A===e?void(A=!1):void D.handleKey(e,s(t),t)}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function p(){clearTimeout(C),C=setTimeout(a,1e3)}function g(){if(!_){_={};for(var t in S)t>95&&112>t||S.hasOwnProperty(t)&&(_[S[t]]=t)}return _}function m(t,e,n){return n||(n=g()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function v(t,e,n,i){function o(e){return function(){L=e,++R[t],p()}}function s(e){u(n,e,t),"keyup"!==i&&(A=r(e)),setTimeout(a,10)}R[t]=0;for(var l=0;l<e.length;++l){var c=l+1===e.length,h=c?s:o(i||b(e[l+1]).action);x(e[l],h,i,t,l)}}function y(t){return"+"===t?["+"]:t.split("+")}function b(t,e){var n,r,i,a=[];for(n=y(t),i=0;i<n.length;++i)r=n[i],T[r]&&(r=T[r]),e&&"keypress"!=e&&k[r]&&(r=k[r],a.push("shift")),d(r)&&a.push(r);return e=m(r,a,e),{key:r,modifiers:a,action:e}}function x(t,e,n,r,i){N[t+":"+n]=e,t=t.replace(/\s+/g," ");var a,s=t.split(" ");return s.length>1?void v(t,s,e,n):(a=b(t,n),I[a.key]=I[a.key]||[],o(a.key,a.modifiers,{type:a.action},r,t,i),void I[a.key][r?"unshift":"push"]({callback:e,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:t}))}function w(t,e,n){for(var r=0;r<t.length;++r)x(t[r],e,n)}for(var _,C,S={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},E={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},k={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|Line truncated
|
||||
},function(t){r.error&&r.error(t)}):n([o],function(t){e.finishLoad(a.moduleName+"."+a.ext,a.strip,t,r)}))},write:function(t,n,r){if(d.hasOwnProperty(n)){var i=e.jsEscape(d[n]);r.asModule(t+"!"+n,"define(function () { return '"+i+"';});\n")}},writeFile:function(t,n,r,i,a){var o=e.parseName(n),s=o.ext?"."+o.ext:"",l=o.moduleName+s,c=r.toUrl(o.moduleName+s)+".js";e.load(l,r,function(){var n=function(t){return i(c,t)};n.asModule=function(t,e){return i.asModule(t,c,e)},e.write(t,l,n,a)},a)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),e.get=function(t,e,r){try{var i=n.readFileSync(t,"utf8");""===i[0]&&(i=i.substring(1)),e(i)}catch(a){r&&r(a)}}):"xhr"===p.env||!p.env&&e.createXhr()?e.get=function(t,n,r,i){var a,o=e.createXhr();if(o.open("GET",t,!0),i)for(a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a.toLowerCase(),i[a]);p.onXhr&&p.onXhr(o,t),o.onreadystatechange=function(){var e,i;4===o.readyState&&(e=o.status||0,e>399&&600>e?(i=new Error(t+" HTTP status: "+e),i.xhr=o,r&&r(i)):n(o.responseText),p.onXhrComplete&&p.onXhrComplete(o,t))},o.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?e.get=function(t,e){var n,r,i="utf-8",a=new java.io.File(t),o=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(a),i)),l="";try{for(n=new java.lang.StringBuffer,r=s.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&n.append(r);null!==(r=s.readLine());)n.append(o),n.append(r);l=String(n.toString())}finally{s.close()}e(l)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),a="@mozilla.org/windows-registry-key;1"in r,e.get=function(t,e){var n,o,s,l={};a&&(t=t.replace(/\//g,"\\")),s=new FileUtils.File(t);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(s,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),l),o.close(),n.close(),e(l.value)}catch(c){throw new Error((s&&s.path||"")+": "+c)}}),e}),define("text!html/markdownExtraSettingsBlock.html",[],function(){return'<p>Adds extra features to the original Markdown syntax.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-markdownextra-tables">Tables</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-tables">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-deflist">Definition lists</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-deflist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-attrlist">Special attributes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-attrlist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-footnotes">Footnotes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-footnotes">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-comments">Comments</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-comments">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-smartypants">SmartyPants</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-smartypants">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-newlines">GFM newlines</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-newlines">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-intraword">GFM intra-word stars/underscores</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-intraword">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-strikethrough">GFM strikethrough</label>\n <div class="col-sm-7">\n <div class="checkbLine truncated
|
||||
},Markdown.Extra.init=function(t,e){var n=new Markdown.Extra,i=[],a=[],o=[],s=["unHashExtraBlocks"];return e=e||{},e.extensions=e.extensions||["all"],r(e.extensions,"all")&&(e.extensions=["tables","fenced_code_gfm","def_list","attr_list","footnotes","smartypants","strikethrough","newlines"]),a.push("wrapHeaders"),r(e.extensions,"attr_list")&&(i.push("hashFcbAttributeBlocks"),a.push("hashHeaderAttributeBlocks"),s.push("applyAttributeBlocks"),n.attributeBlocks=!0),r(e.extensions,"fenced_code_gfm")&&(a.push("fencedCodeBlocks"),i.push("fencedCodeBlocks")),r(e.extensions,"tables")&&a.push("tables"),r(e.extensions,"def_list")&&a.push("definitionLists"),r(e.extensions,"footnotes")&&(i.push("stripFootnoteDefinitions"),a.push("doFootnotes"),s.push("printFootnotes")),r(e.extensions,"smartypants")&&s.push("runSmartyPants"),r(e.extensions,"strikethrough")&&o.push("strikethrough"),r(e.extensions,"newlines")&&o.push("newlines"),t.hooks.chain("postNormalization",function(t){return n.doTransform(i,t)+"\n"}),t.hooks.chain("preBlockGamut",function(t,e){return n.blockGamutHookCallback=e,t=u(t),t=n.doTransform(a,t)+"\n",t=h(t)}),t.hooks.chain("postSpanGamut",function(t){return n.doTransform(o,t)}),n.previousPostConversion=t.hooks.postConversion,t.hooks.chain("postConversion",function(t){return t=n.doTransform(s,t),n.hashBlocks=[],n.footnotes={},n.usedFootnotes=[],t}),"highlighter"in e&&(n.googleCodePrettify="prettify"===e.highlighter,n.highlightJs="highlight"===e.highlighter),"table_class"in e&&(n.tableClass=e.table_class),n.converter=t,n},Markdown.Extra.prototype.doTransform=function(t,e){for(var n=0;n<t.length;n++)e=this[t[n]](e);return e},Markdown.Extra.prototype.hashExtraBlock=function(t){return"\n<p>~X"+(this.hashBlocks.push(t)-1)+"X</p>\n"},Markdown.Extra.prototype.hashExtraInline=function(t){return"~X"+(this.hashBlocks.push(t)-1)+"X"},Markdown.Extra.prototype.unHashExtraBlocks=function(t){function e(){var r=!1;t=t.replace(/(?:<p>)?~X(\d+)X(?:<\/p>)?/g,function(t,e){r=!0;var i=parseInt(e,10);return n.hashBlocks[i]}),r===!0&&e()}var n=this;return e(),t},Markdown.Extra.prototype.wrapHeaders=function(t){function e(t){return"\n"+t+"\n"}return t=t.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,e),t=t.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,e),t=t.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,e)};var m="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",v=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+m+"[ \\t]*(?:\\n|0x03)","gm"),y=new RegExp("^(.*)[ \\t]+"+m+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm"),b=new RegExp("^(```[^`\\n]*)[ \\t]+"+m+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t=t.replace(v,e),t=t.replace(y,e)},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t.replace(b,e)},Markdown.Extra.prototype.applyAttributeBlocks=function(t){var e=this,n=new RegExp('<p>~XX(\\d+)XX</p>[\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?</\\2>))',"gm");return t=t.replace(n,function(t,n,r,i,o){if(!r)return"";for(var s=parseInt(n,10),l=e.hashBlocks[s],c=l.match(/#[^\s#.]+/g)||[],u=c[0]?' id="'+c[0].substr(1,c[0].length-1)+'"':"",h=l.match(/\.[^\s#.]+/g)||[],f=0;f<h.length;f++)h[f]=h[f].substr(1,h[f].length-1);var d="";return i&&(h=a(h,[i])),h.length>0&&(d=' class="'+h.join(" ")+'"'),"<"+r+u+d+o})},Markdown.Extra.prototype.tables=function(e){function n(e,n,i,a){n=n.replace(/^ *[|]/m,""),i=i.replace(/^ *[|]/m,""),a=a.replace(/^ *[|]/gm,""),n=n.replace(/[|] *$/m,""),i=i.replace(/[|] *$/m,""),a=a.replace(/[|] *$/gm,""),alignspecs=i.split(/ *[|] */),align=[];for(var o=0;o<alignspecs.length;o++){var s=alignspecs[o];align[o]=s.match(/^ *-+: *$/m)?' align="right"':s.match(/^ *:-+: *$/m)?' align="center"':s.match(/^ *:-+ *$/m)?' align="left"':""}var c=n.split(/ *[|] */),u=c.length,h=r.tableClass?' class="'+r.tableClass+'"':"",f=["<table",h,">\n","<thead>\n","<tr>\n"].join("");for(o=0;u>o;o++){var d=l(t(c[o]),r);f+=[" <th",align[o],">",d,"</th>\n"].join("")}f+="</tr>\n</thead>\n";var p=a.split("\n");for(o=0;o<p.length;o++)if(!p[o].match(/^\s*$/)){for(var g=p[o].split(/ *[|] */),m=u-g.length,v=0;m>v;v++)g.push("");for(f+="<tr>\n",v=0;u>v;v++){var y=l(t(g[v]),r);f+=[" <td",align[v],">",y,"</td>\n"].join("")}f+="</tr>\n"}return f+="</table>\n",r.hashExtraBlock(f)}var r=this,i=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),a=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return e=e.replace(i,n),e=e.replace(a,n)},Markdown.Extra.prototype.stripFootnoteDefinitions=function(t){var e=this;return t=t.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,function(t,n,r){return n=d(n),r+="\n",r=r.replaLine truncated
|
||||
},c.onMessage=function(t){s(t)},c.onError=function(e){n.error(e),t.isString(e)?s(e,"icon-attention"):t.isObject(e)&&s(e.message,"icon-attention")};var p=!1;return c.onOfflineChanged=function(t){p=t,l(),p===!0?s("You are offline.","icon-attention-circled msg-offline"):s("You are back online!","icon-signal")},c.onSyncImportSuccess=function(e,n){var r=t.map(e,function(t){return t.title}).join(", ");s(r+" imported successfully from "+n.providerName+".")},c.onSyncExportSuccess=function(t,e){s('"'+t.title+'" will now be synchronized on '+e.provider.providerName+".")},c.onSyncRemoved=function(t,e){s(e.provider.providerName+" synchronized location has been removed.")},c.onPublishSuccess=function(t){s('"'+t.title+'" successfully published.')},c.onNewPublishSuccess=function(t,e){s('"'+t.title+'" is now published on '+e.provider.providerName+".")},c.onPublishRemoved=function(t,e){s(e.provider.providerName+" publish location has been removed.")},c}),define("text!html/umlDiagramsSettingsBlock.html",[],function(){return'<p>Creates UML diagrams from plain text description.</p>\n\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="textarea-umldiagram-flowchart-options">Flow charts options (JSON)\n </label>\n <div class="col-sm-7">\n <textarea id="textarea-umldiagram-flowchart-options" class="form-control"></textarea>\n </div>\n </div>\n</div>\n<br>\n<p>Sequence diagrams:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://bramp.github.io/js-sequence-diagrams/">More info</a></div><code>```sequence\nAlice->Bob: Hello Bob, how are you?\nBob-->Alice: I am good thanks!\n```</code>\n</pre>\n\n<p>Flow charts:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://adrai.github.io/flowchart.js/">More info</a></div><code>```flow\nst=>start: Start\ne=>end\nop=>operation: My Operation\ncond=>condition: Yes or No?\nst->op->cond\ncond(yes)->e\ncond(no)->op\n```</code>\n</pre>\n<blockquote>\n <p><b>Note:</b> Markdown Extra extension has to be enabled with GFM fenced code blocks option.</p>\n</blockquote>\n'}),function(t){var e,n,r="0.4.2",i="hasOwnProperty",a=/[\.\/]/,o="*",s=function(){},l=function(t,e){return t-e},c={n:{}},u=function(t,r){t=String(t);var i,a=n,o=Array.prototype.slice.call(arguments,2),s=u.listeners(t),c=0,h=[],f={},d=[],p=e;e=t,n=0;for(var g=0,m=s.length;m>g;g++)"zIndex"in s[g]&&(h.push(s[g].zIndex),s[g].zIndex<0&&(f[s[g].zIndex]=s[g]));for(h.sort(l);h[c]<0;)if(i=f[h[c++]],d.push(i.apply(r,o)),n)return n=a,d;for(g=0;m>g;g++)if(i=s[g],"zIndex"in i)if(i.zIndex==h[c]){if(d.push(i.apply(r,o)),n)break;do if(c++,i=f[h[c]],i&&d.push(i.apply(r,o)),n)break;while(i)}else f[i.zIndex]=i;else if(d.push(i.apply(r,o)),n)break;return n=a,e=p,d.length?d:null};u._events=c,u.listeners=function(t){var e,n,r,i,s,l,u,h,f=t.split(a),d=c,p=[d],g=[];for(i=0,s=f.length;s>i;i++){for(h=[],l=0,u=p.length;u>l;l++)for(d=p[l].n,n=[d[f[i]],d[o]],r=2;r--;)e=n[r],e&&(h.push(e),g=g.concat(e.f||[]));p=h}return g},u.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var n=t.split(a),r=c,i=0,o=n.length;o>i;i++)r=r.n,r=r.hasOwnProperty(n[i])&&r[n[i]]||(r[n[i]]={n:{}});for(r.f=r.f||[],i=0,o=r.f.length;o>i;i++)if(r.f[i]==e)return s;return r.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},u.f=function(t){var e=[].slice.call(arguments,1);return function(){u.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},u.stop=function(){n=1},u.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},u.nts=function(){return e.split(a)},u.off=u.unbind=function(t,e){if(!t)return void(u._events=c={n:{}});var n,r,s,l,h,f,d,p=t.split(a),g=[c];for(l=0,h=p.length;h>l;l++)for(f=0;f<g.length;f+=s.length-2){if(s=[f,1],n=g[f].n,p[l]!=o)n[p[l]]&&s.push(n[p[l]]);else for(r in n)n[i](r)&&s.push(n[r]);g.splice.apply(g,s)}for(l=0,h=g.length;h>l;l++)for(n=g[l];n.n;){if(e){if(n.f){for(f=0,d=n.f.length;d>f;f++)if(n.f[f]==e){n.f.splice(f,1);break}!n.f.length&&delete n.f}for(r in n.n)if(n.n[i](r)&&n.n[r].f){var m=n.n[r].f;for(f=0,d=m.length;d>f;f++)if(m[f]==e){m.splice(f,1);break}!m.length&&delete n.n[r].f}}else{delete n.f;for(r in n.n)n.n[i](r)&&n.n[r].f&&delete n.n[r].f}n=n.n}},u.once=function(t,e){var n=function(){return u.unbind(t,n),e.apply(this,arguments)};return u.on(t,n)},u.version=r,u.toString=function(){return"You are running Eve "+r},"undefined"!=typeof module&&module.exports?module.exports=u:"undefined"!=typeof define?define("eve",[],function(){return u}):t.eve=u}(this),function(t,e){"function"==typeof define&&define.amd?define("raphael",["eve"],function(n){return e(t,n)}):e(t,t.eve)}(this,function(t,e){function n(t){if(n.is(t,"function"))return x?t():e.on("raphael.DOMload",t);if(n.is(t,X))return n._engine.create[N](n,t.splice(0,3+n.is(t[0],G))).add(t);var r=Array.prototype.slice.call(arguments,0);if(n.is(r[r.length-1],"function")){var i=r.pop();return x?i.call(n._engine.creaLine truncated
|
||||
},n._toback=function(t,e){e.bottom!==t&&(Pe(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},n._insertafter=function(t,e,n){Pe(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},n._insertbefore=function(t,e,n){Pe(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},n.toMatrix=function(t,e){var n=Te(t),r={_:{transform:M},getBBox:function(){return n}};return je(r,e),r.matrix}),je=(n.transformPath=function(t,e){return ve(t,Be(t,e))},n._extractTransform=function(t,e){if(null==e)return t._.transform;e=O(e).replace(/\.{3}|\u2026/g,t._.transform||M);var r=n.parseTransformString(e),i=0,a=0,o=0,s=1,l=1,c=t._,u=new p;if(c.transform=r||[],r)for(var h=0,f=r.length;f>h;h++){var d,g,m,v,y,b=r[h],x=b.length,w=O(b[0]).toLowerCase(),_=b[0]!=w,C=_?u.invert():0;"t"==w&&3==x?_?(d=C.x(0,0),g=C.y(0,0),m=C.x(b[1],b[2]),v=C.y(b[1],b[2]),u.translate(m-d,v-g)):u.translate(b[1],b[2]):"r"==w?2==x?(y=y||t.getBBox(1),u.rotate(b[1],y.x+y.width/2,y.y+y.height/2),i+=b[1]):4==x&&(_?(m=C.x(b[2],b[3]),v=C.y(b[2],b[3]),u.rotate(b[1],m,v)):u.rotate(b[1],b[2],b[3]),i+=b[1]):"s"==w?2==x||3==x?(y=y||t.getBBox(1),u.scale(b[1],b[x-1],y.x+y.width/2,y.y+y.height/2),s*=b[1],l*=b[x-1]):5==x&&(_?(m=C.x(b[3],b[4]),v=C.y(b[3],b[4]),u.scale(b[1],b[2],m,v)):u.scale(b[1],b[2],b[3],b[4]),s*=b[1],l*=b[2]):"m"==w&&7==x&&u.add(b[1],b[2],b[3],b[4],b[5],b[6]),c.dirtyT=1,t.matrix=u}t.matrix=u,c.sx=s,c.sy=l,c.deg=i,c.dx=a=u.e,c.dy=o=u.f,1==s&&1==l&&!i&&c.bbox?(c.bbox.x+=+a,c.bbox.y+=+o):c.dirtyT=1}),$e=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},He=n._equaliseTransform=function(t,e){e=O(e).replace(/\.{3}|\u2026/g,t),t=n.parseTransformString(t)||[],e=n.parseTransformString(e)||[];for(var r,i,a,o,s=$(t.length,e.length),l=[],c=[],u=0;s>u;u++){if(a=t[u]||$e(e[u]),o=e[u]||$e(a),a[0]!=o[0]||"r"==a[0].toLowerCase()&&(a[2]!=o[2]||a[3]!=o[3])||"s"==a[0].toLowerCase()&&(a[3]!=o[3]||a[4]!=o[4]))return;for(l[u]=[],c[u]=[],r=0,i=$(a.length,o.length);i>r;r++)r in a&&(l[u][r]=a[r]),r in o&&(c[u][r]=o[r])}return{from:l,to:c}};n._getContainer=function(t,e,r,i){var a;return a=null!=i||n.is(t,"object")?t:k.doc.getElementById(t),null!=a?a.tagName?null==e?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:e,height:r}:{container:1,x:t,y:e,width:r,height:i}:void 0},n.pathToRelative=Ne,n._engine={},n.path2curve=Fe,n.matrix=function(t,e,n,r,i,a){return new p(t,e,n,r,i,a)},function(t){function e(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var n=j.sqrt(e(t));t[0]&&(t[0]/=n),t[1]&&(t[1]/=n)}t.add=function(t,e,n,r,i,a){var o,s,l,c,u=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],f=[[t,n,i],[e,r,a],[0,0,1]];for(t&&t instanceof p&&(f=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),o=0;3>o;o++)for(s=0;3>s;s++){for(c=0,l=0;3>l;l++)c+=h[o][l]*f[l][s];u[o][s]=c}this.a=u[0][0],this.b=u[1][0],this.c=u[0][1],this.d=u[1][1],this.e=u[0][2],this.f=u[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new p(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new p(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,r){null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},t.rotate=function(t,e,r){t=n.rad(t),e=e||0,r=r||0;var i=+j.cos(t).toFixed(9),a=+j.sin(t).toFixed(9);this.add(i,a,-a,i,e,r),this.add(1,0,0,1,-e,-r)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[O.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return n.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];t.scalex=j.sqrt(e(i[0])),r(i[0]),t.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*t.shear,i[1][1]-i[0][1]*t.shear],t.scaley=j.sqrt(e(i[1])),r(i[1]),t.shear/=t.scaley;var a=-i[0][1],o=i[1][1];return 0>o?(t.rotate=n.deg(j.acos(o)),0>a&&(t.rotate=360-t.rotate)):t.rotate=n.deg(j.asin(a)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[D]();return e.isSimpleLine truncated
|
||||
break;case"stroke-dasharray":w(r,g,a);break;case"fill":var R=e(g).match(n._ISURL);if(R){k=m("pattern");var A=m("image");k.id=n.createUUID(),m(k,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(A,{x:0,y:0,"xlink:href":R[1]}),k.appendChild(A),function(t){n._preload(R[1],function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(A,{width:e,height:n}),r.paper.safari()})}(k),r.paper.defs.appendChild(k),m(l,{fill:"url(#"+k.id+")"}),r.pattern=k,r.pattern&&y(r);break}var M=n.getRGB(g);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g)){if("opacity"in u||"fill-opacity"in u){var L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(L){var O=L.getElementsByTagName("stop");m(O[O.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!n.is(u.opacity,"undefined")&&n.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!n.is(u["fill-opacity"],"undefined")&&n.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});M[t]("opacity")&&m(l,{"fill-opacity":M.opacity>1?M.opacity/100:M.opacity});case"stroke":M=n.getRGB(g),l.setAttribute(p,M.hex),"stroke"==p&&M[t]("opacity")&&m(l,{"stroke-opacity":M.opacity>1?M.opacity/100:M.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&b(r,r._.arrows.startString),"endString"in r._.arrows&&b(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g);break;case"opacity":u.gradient&&!u[t]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h)),L&&(O=L.getElementsByTagName("stop"),m(O[O.length-1],{"stop-opacity":g}));break}default:"font-size"==p&&(g=i(g,10)+"px");var D=p.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[D]=g,r._.dirty=1,l.setAttribute(p,g)}}S(r,a),l.style.visibility=f},C=1.2,S=function(r,a){if("text"==r.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var o=r.attrs,s=r.node,l=s.firstChild?i(n._g.doc.defaultView.getComputedStyle(s.firstChild,h).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(o.text=a.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,u=e(a.text).split("\n"),f=[],d=0,p=u.length;p>d;d++)c=m("tspan"),d&&m(c,{dy:l*C,x:o.x}),c.appendChild(n._g.doc.createTextNode(u[d])),s.appendChild(c),f[d]=c}else for(f=s.getElementsByTagName("tspan"),d=0,p=f.length;p>d;d++)d?m(f[d],{dy:l*C,x:o.x}):m(f[0],{dy:0});m(s,{x:o.x,y:o.y}),r._.dirty=1;var g=r._getBBox(),v=o.y-(g.y+g.height/2);v&&n.is(v,"finite")&&m(f[0],{dy:v})}},E=function(t,e){this[0]=this.node=t,t.raphael=!0,this.id=n._oid++,t.raphaelid=this.id,this.matrix=n.matrix(),this.realPath=null,this.paper=e,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!e.bottom&&(e.bottom=this),this.prev=e.top,e.top&&(e.top.next=this),e.top=this,this.next=null},k=n.el;E.prototype=k,k.constructor=E,n._engine.path=function(t,e){var n=m("path");e.canvas&&e.canvas.appendChild(n);var r=new E(n,e);return r.type="path",_(r,{fill:"none",stroke:"#000",path:t}),r},k.rotate=function(t,n,i){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(n=i),null==n||null==i){var a=this.getBBox(1);n=a.x+a.width/2,i=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,n,i]])),this},k.scale=function(t,n,i,a){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2]),a=r(t[3])),t=r(t[0]),null==n&&(n=t),null==a&&(i=a),null==i||null==a)var o=this.getBBox(1);return i=null==i?o.x+o.width/2:i,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",t,n,i,a]])),this},k.translate=function(t,n){return this.removed?this:(t=e(t).split(c),t.length-1&&(n=r(t[1])),t=r(t[0])||0,n=+n||0,this.transform(this._.transform.concat([["t",t,n]])),this)},k.transform=function(e){var r=this._;if(null==e)return r.transform;if(n._extractTransform(this,e),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&m(this.node,{transform:this.matrix}),1!=r.sx||1!=r.sy){var i=this.attrs[t]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":i})}return this},k.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},k.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},k.remove=function(){if(!this.removed&&this.node.parentNode){var t=this.paper;t.__set__&&t.__set__.exclude(this),u.unbind("raphael.*.*."+this.id),this.gradient&&t.defs.removeChild(this.gradient),n._tear(this,t),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var e in this)this[e]="function"==typeof this[e]?n._removeLine truncated
|
||||
this.trace(t)},parse:function(t){function e(){var t;return t=n.lexer.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],a=[],o=this.table,s="",l=0,c=0,u=0,h=2,f=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;a.push(d);var p=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var g,m,v,y,b,x,w,_,C,S={};;){if(v=r[r.length-1],this.defaultActions[v]?y=this.defaultActions[v]:((null===g||"undefined"==typeof g)&&(g=e()),y=o[v]&&o[v][g]),"undefined"==typeof y||!y.length||!y[0]){var E="";C=[];for(x in o[v])this.terminals_[x]&&x>h&&C.push("'"+this.terminals_[x]+"'");E=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:d,expected:C})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(y[0]){case 1:r.push(g),i.push(this.lexer.yytext),a.push(this.lexer.yylloc),r.push(y[1]),g=null,m?(g=m,m=null):(c=this.lexer.yyleng,s=this.lexer.yytext,l=this.lexer.yylineno,d=this.lexer.yylloc,u>0&&u--);break;case 2:if(w=this.productions_[y[1]][1],S.$=i[i.length-w],S._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},p&&(S._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),b=this.performAction.call(S,s,c,l,this.yy,y[1],i,a),"undefined"!=typeof b)return b;w&&(r=r.slice(0,-1*w*2),i=i.slice(0,-1*w),a=a.slice(0,-1*w)),r.push(this.productions_[y[1]][0]),i.push(S.$),a.push(S._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0}},r=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylinLine truncated
|
||||
else a=this.leftEnd&&b?r(this.chart,c,[{x:c.x,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:c.y+C/2},{x:c.x+(c.x-d.x)/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e):r(this.chart,c,[{x:c.x,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+(c.x-d.x)/2;else a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+C/2;else a=r(this.chart,l,[{x:l.x+C/2,y:l.y},{x:l.x+C/2,y:d.y-C/2},{x:d.x,y:d.y-C/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+C/2;else a=r(this.chart,u,p,e),this.leftStart=!0,t.rightEnd=!0,_=p.x;else a=r(this.chart,l,g,e),this.rightStart=!0,t.leftEnd=!0,_=g.x;else a=r(this.chart,c,d,e),this.bottomStart=!0,t.topEnd=!0,_=c.x;if(a){for(var k=0,T=this.chart.lines.length;T>k;k++)for(var I,N=this.chart.lines[k],R=N.attr("path"),A=a.attr("path"),M=0,L=R.length-1;L>M;M++){var O=[];O.push(["M",R[M][1],R[M][2]]),O.push(["L",R[M+1][1],R[M+1][2]]);for(var D=O[0][1],F=O[0][2],P=O[1][1],B=O[1][2],j=0,$=A.length-1;$>j;j++){var H=[];H.push(["M",A[j][1],A[j][2]]),H.push(["L",A[j+1][1],A[j+1][2]]);var U=H[0][1],q=H[0][2],z=H[1][1],G=H[1][2],W=i(D,F,P,B,U,q,z,G);if(W.onLine1&&W.onLine2){var X;q===G?U>z?(X=["L",W.x+2*S,q],A.splice(j+1,0,X),X=["C",W.x+2*S,q,W.x,q-4*S,W.x-2*S,q],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",W.x-2*S,q],A.splice(j+1,0,X),X=["C",W.x-2*S,q,W.x,q-4*S,W.x+2*S,q],A.splice(j+2,0,X),a.attr("path",A)):q>G?(X=["L",U,W.y+2*S],A.splice(j+1,0,X),X=["C",U,W.y+2*S,U+4*S,W.y,U,W.y-2*S],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",U,W.y-2*S],A.splice(j+1,0,X),X=["C",U,W.y-2*S,U+4*S,W.y,U,W.y+2*S],A.splice(j+2,0,X),a.attr("path",A)),j+=2,I+=2}}}this.chart.lines.push(a)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&_>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=_)},m.inherits(s,o),m.inherits(l,o),m.inherits(c,o),m.inherits(u,o),m.inherits(h,o),h.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.textMargin;return{x:e,y:t}},h.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width-this.textMargin;return{x:e,y:t}},m.inherits(f,o),f.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var e=this.getBottom();this.bottom_symbol.getTop(),this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(e.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var n=this.getRight();if(this.right_symbol.getLeft(),!this.right_symbol.isPositioned){this.right_symbol.setY(n.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t);var r=this;!function i(){for(var e,n=!1,a=0,o=r.chart.symbols.length;o>a;a++){e=r.chart.symbols[a];var s=Math.abs(e.getCenter().x-r.right_symbol.getCenter().x);if(e.getCenter().y>r.right_symbol.getCenter().y&&s<=r.right_symbol.width/2){n=!0;break}}n&&(r.right_symbol.setX(e.getX()+e.width+t),i())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},f.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},p.parse=d,p}),define("extensions/umlDiagrams",["underscore","utils","logger","classes/Extension","text!html/umlDiagramsSettingsBlock.html","crel","Diagram","flow-chart"],function(t,e,n,r,i,a,o,s){var l=new r("umlDiagrams","UML Diagrams",!0);return l.settingsBlock=i,l.defaultConfig={flowchartOptions:["{",' "line-width": 2,',' "font-family": "sans-serif",',' "font-weight": "normal"',"}"].join("\n")},l.onLoadSettings=function(){e.setInputValue("#textarea-umldiagram-flowchart-options",l.config.flowchartOptions)},l.onSaveSettings=function(t,n){t.flowchartOptions=e.getInputJSONValue("#textarea-umldiagram-flowchart-options",n)},l.onPagedownConfigure=function(e){var n=document.getElementById("preview-contents");e.hooks.chain("onPreviewRefresh",function(){t.each(n.querySelectorAll(".prettyprint > .language-sequence"),function(t){try{var e=o.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"sequence-diagram"});n.parentNode.replaceChild(r,n),e.drawSVG(r,{theme:"simple"})}catch(i){}}),t.each(n.querySelectorAll(".prettyprint > .language-flow"),function(t){try{var e=s.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"flow-chart"});n.parentNode.replaceChild(r,n),e.drawSVG(r,JSON.parse(l.config.flowchartOptions))}catch(i){}})})},l}),define("text!html/tocSettingsBlock.html",[],function(){return'<p>Generates a table of contents when a [TOC] marker is found.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-toc-marker">Marker\nLine truncated
|
||||
},h.postMessage(JSON.stringify({language:u.language,code:u.code}))}else u.highlightedCode=e.highlight(u.code,u.grammar,u.language),e.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(r),e.hooks.run("after-highlight",u)}}},highlight:function(t,r,i){return n.stringify(e.tokenize(t,r),i)},tokenize:function(t,n){var r=e.Token,i=[t],a=n.rest;if(a){for(var o in a)n[o]=a[o];delete n.rest}t:for(var o in n)if(n.hasOwnProperty(o)&&n[o]){var s=n[o],l=s.inside,c=!!s.lookbehind,u=0;s=s.pattern||s;for(var h=0;h<i.length;h++){var f=i[h];if(i.length>t.length)break t;if(!(f instanceof r)){s.lastIndex=0;var d=s.exec(f);if(d){c&&(u=d[1].length);var p=d.index-1+u,d=d[0].slice(u),g=d.length,m=p+g,v=f.slice(0,p+1),y=f.slice(m+1),b=[h,1];v&&b.push(v);var x=new r(o,l?e.tokenize(d,l):d);b.push(x),y&&b.push(y),Array.prototype.splice.apply(i,b)}}}}return i},hooks:{all:{},add:function(t,n){var r=e.hooks.all;r[t]=r[t]||[],r[t].push(n)},run:function(t,n){var r=e.hooks.all[t];if(r&&r.length)for(var i,a=0;i=r[a++];)i(n)}}},n=e.Token=function(t,e){this.type=t,this.content=e};if(n.stringify=function(t,r,i){if("string"==typeof t)return t;if("[object Array]"==Object.prototype.toString.call(t))return t.map(function(e){return n.stringify(e,r,t)}).join("");var a={type:t.type,content:n.stringify(t.content,r,i),tag:"span",classes:["token",t.type],attributes:{},language:r,parent:i};"comment"==a.type&&(a.attributes.spellcheck="true"),e.hooks.run("wrap",a);var o="";for(var s in a.attributes)o+=s+'="'+(a.attributes[s]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+o+">"+a.content+"</"+a.tag+">"},!self.document)return void self.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(e.tokenize(i,e.languages[r]))),self.close()},!1);var r=document.getElementsByTagName("script");r=r[r.length-1],r&&(e.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",e.highlightAll))}(),define("prism-core",function(t){return function(){var e;return e||t.Prism}}(this));var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff,diff_match_patch.prototype.diff_main=function(t,e,n,r){"undefined"==typeof r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=r;if(null==t||null==e)throw new Error("Null input. (diff_main)");if(t==e)return t?[[DIFF_EQUAL,t]]:[];"undefined"==typeof n&&(n=!0);var a=n,o=this.diff_commonPrefix(t,e),s=t.substring(0,o);t=t.substring(o),e=e.substring(o),o=this.diff_commonSuffix(t,e);var l=t.substring(t.length-o);t=t.substring(0,t.length-o),e=e.substring(0,e.length-o);var c=this.diff_compute_(t,e,a,i);return s&&c.unshift([DIFF_EQUAL,s]),l&&c.push([DIFF_EQUAL,l]),this.diff_cleanupMerge(c),c},diff_match_patch.prototype.diff_compute_=function(t,e,n,r){var i;if(!t)return[[DIFF_INSERT,e]];if(!e)return[[DIFF_DELETE,t]];var a=t.length>e.length?t:e,o=t.length>e.length?e:t,s=a.indexOf(o);if(-1!=s)return i=[[DIFF_INSERT,a.substring(0,s)],[DIFF_EQUAL,o],[DIFF_INSERT,a.substring(s+o.length)]],t.length>e.length&&(i[0][0]=i[2][0]=DIFF_DELETE),i;if(1==o.length)return[[DIFF_DELETE,t],[DIFF_INSERT,e]];var l=this.diff_halfMatch_(t,e);if(l){var c=l[0],u=l[1],h=l[2],f=l[3],d=l[4],p=this.diff_main(c,h,n,r),g=this.diff_main(u,f,n,r);return p.concat([[DIFF_EQUAL,d]],g)}return n&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,r):this.diff_bisect_(t,e,r)},diff_match_patch.prototype.diff_lineMode_=function(t,e,n){var r=this.diff_linesToChars_(t,e);t=r.chars1,e=r.chars2;var i=r.lineArray,a=this.diff_main(t,e,!1,n);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push([DIFF_EQUAL,""]);for(var o=0,s=0,l=0,c="",u="";o<a.length;){switch(a[o][0]){case DIFF_INSERT:l++,u+=a[o][1];break;case DIFF_DELETE:s++,c+=a[o][1];break;case DIFF_EQUAL:if(s>=1&&l>=1){a.splice(o-s-l,s+l),o=o-s-l;for(var r=this.diff_main(c,u,!1,n),h=r.length-1;h>=0;h--)a.splice(o,0,r[h]);o+=r.length}l=0,s=0,c="",u=""}o++}return a.pop(),a},diff_match_patch.prototype.diff_bisect_=function(t,e,n){for(var r=t.length,i=e.length,a=Math.ceil((r+i)/2),o=a,s=2*a,l=new Array(s),c=new Array(s),u=0;s>u;u++)l[u]=-1,c[u]=-1;l[o+1]=0,c[o+1]=0;for(var h=r-i,f=h%2!=0,d=0,p=0,g=0,m=0,v=0;a>v&&!((new Date).getTime()>n);v++){for(var y=-v+d;v-p>=y;y+=2){var b,x=o+y;b=y==-v||y!=v&&l[x-1]<l[x+1]?l[x+1]:l[x-1]+1;for(var w=b-y;r>b&&i>w&&t.charAt(b)==e.charAt(w);)b++,w++;if(l[x]=b,b>r)p+=2;else if(w>i)d+=2;else if(f){var _=o+h-y;if(_>=0&&s>_&&-1!=c[_]){var C=r-c[_];if(b>=C)return this.diff_bisectSplit_(t,e,b,w,n)}}}for(var S=-v+g;v-m>=S;S+=2){var C,_=o+S;C=S==-v||S!=v&&c[_-1]<c[_+1]?c[_+1]:c[_-1]+1;for(var E=C-S;r>C&&i>E&&t.charAt(r-C-1)==e.charAt(i-E-1);)C++,E++;if(c[_]=C,C>r)m+=2;else if(E>i)g+=2;else if(!f){var x=o+h-S;if(x>=0&&s>x&&-1!=l[x]){var b=l[x],w=o+b-x;if(C=r-C,b>=C)return this.diff_bisectSplit_(t,e,b,w,n)}}}}return[[DIFF_DELETE,t],[DIFF_INSERT,e]]},diff_match_patch.prototype.diff_bisectSplit_=function(Line truncated
|
||||
};r.filterName="dates",n.diffFilter=r},{}],11:[function(t,e,n){var r=function(t,e,n,r){return t[n]===e[r]},i=function(t,e,n,r){var i,a,o=t.length,s=e.length,l=[o+1];for(i=0;o+1>i;i++)for(l[i]=[s+1],a=0;s+1>a;a++)l[i][a]=0;for(l.match=n,i=1;o+1>i;i++)for(a=1;s+1>a;a++)l[i][a]=n(t,e,i-1,a-1,r)?l[i-1][a-1]+1:Math.max(l[i-1][a],l[i][a-1]);return l},a=function(t,e,n,r,i,o){if(0===r||0===i)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,i-1,o)){var s=a(t,e,n,r-1,i-1,o);return s.sequence.push(e[r-1]),s.indices1.push(r-1),s.indices2.push(i-1),s}return t[r][i-1]>t[r-1][i]?a(t,e,n,r,i-1,o):a(t,e,n,r-1,i,o)},o=function(t,e,n,o){o=o||{};var s=i(t,e,n||r,o),l=a(s,t,e,t.length,e.length,o);return"string"==typeof t&&"string"==typeof e&&(l.sequence=l.sequence.join("")),l};n.get=o},{}],12:[function(t,e,n){var r=t("../contexts/diff").DiffContext,i=t("../contexts/patch").PatchContext,a=t("../contexts/reverse").ReverseContext,o=function(t){if(t&&t.children){for(var e,n=t.children.length,r=t.result,i=0;n>i;i++)e=t.children[i],"undefined"!=typeof e.result&&(r=r||{},r[e.childName]=e.result);r&&t.leftIsArray&&(r._t="a"),t.setResult(r).exit()}};o.filterName="collectChildren";var s=function(t){if(!t.leftIsArray&&"object"===t.leftType){var e,n;for(e in t.left)n=new r(t.left[e],t.right[e]),t.push(n,e);for(e in t.right)"undefined"==typeof t.left[e]&&(n=new r(void 0,t.right[e]),t.push(n,e));return t.children&&0!==t.children.length?void t.exit():void t.setResult(void 0).exit()}};s.filterName="objects";var l=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new i(t.left[e],t.delta[e]),t.push(n,e);t.exit()}};l.filterName="objects";var c=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r=0;n>r;r++)e=t.children[r],t.left[e.childName]!==e.result&&(t.left[e.childName]=e.result);t.setResult(t.left).exit()}};c.filterName="collectChildren";var u=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new a(t.delta[e]),t.push(n,e);t.exit()}};u.filterName="objects";var h=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r={},i=0;n>i;i++)e=t.children[i],r[e.childName]!==e.result&&(r[e.childName]=e.result);t.setResult(r).exit()}};h.filterName="collectChildren",n.collectChildrenDiffFilter=o,n.objectsDiffFilter=s,n.patchFilter=l,n.collectChildrenPatchFilter=c,n.reverseFilter=u,n.collectChildrenReverseFilter=h},{"../contexts/diff":3,"../contexts/patch":4,"../contexts/reverse":5}],13:[function(t,e,n){var r=2,i=60,a=null,o=function(){if(!a){var e;if("undefined"!=typeof diff_match_patch)e=new diff_match_patch;else if("function"==typeof t){var n=t("../../external/diff_match_patch_uncompressed");e=new n.diff_match_patch}if(!e){var r=new Error("text diff_match_patch library not found");throw r.diff_match_patch_not_found=!0,r}a={diff:function(t,n){return e.patch_toText(e.patch_make(t,n))},patch:function(t,n){for(var r=e.patch_apply(e.patch_fromText(n),t),i=0;i<r[1].length;i++)if(!r[1][i]){var a=new Error("text patch failed");a.textPatchFailed=!0}return r[0]}}}return a},s=function(t){if("string"===t.leftType){var e=t.options&&t.options.textDiff&&t.options.textDiff.minLength||i;if(t.left.length<e||t.right.length<e)return void t.setResult([t.left,t.right]).exit();var n=o().diff;t.setResult([n(t.left,t.right),0,r]).exit()}};s.filterName="texts";var l=function(t){if(!t.nested&&t.delta[2]===r){var e=o().patch;t.setResult(e(t.left,t.delta[0])).exit()}};l.filterName="texts";var c=function(t){var e,n,r,i,a,o,s,l,c=null,u=/^@@ +\-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;for(r=t.split("\n"),e=0,n=r.length;n>e;e++){i=r[e];var h=i.slice(0,1);"@"===h?(c=u.exec(i),o=e,s=null,l=null,r[o]="@@ -"+c[3]+","+c[4]+" +"+c[1]+","+c[2]+" @@"):"+"===h?(s=e,r[e]="-"+r[e].slice(1),"+"===r[e-1].slice(0,1)&&(a=r[e],r[e]=r[e-1],r[e-1]=a)):"-"===h&&(l=e,r[e]="+"+r[e].slice(1))}return r.join("\n")},u=function(t){t.nested||t.delta[2]===r&&t.setResult([c(t.delta[0]),0,r]).exit()};u.filterName="texts",n.diffFilter=s,n.patchFilter=l,n.reverseFilter=u},{}],14:[function(t,e,n){var r="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},i=function(t){if(t.left===t.right)return void t.setResult(void 0).exit();if("undefined"==typeof t.left){if("function"==typeof t.right)throw new Error("functions are not supported");return void t.setResult([t.right]).exit()}if("undefined"==typeof t.right)return void t.setResult([t.left,0,0]).exit();if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");return t.leftType=null===t.left?"null":typeof t.left,t.rightType=null===t.right?"null":typeof t.right,t.leftType!==t.rightType?void t.setResult([t.left,t.right]).exit():"boolean"===t.leftType||"number"===t.leftType?void t.setResult([t.left,t.right]).exit():("object"===t.leftType&&(t.leftIsArray=r(t.left)),"object"===t.rightType&&(t.rightIsArray=r(t.right)),t.leftIsArray!==t.rightIsArray?void t.setResult([t.left,t.right]).exit():void 0)};i.filterName="trivial";var
Line truncated
|
||||
R.blur(function(){e[0].setSelectionRange(0,0),e.blur()})}T.focus=y,T.adjustCursorPosition=h,Object.defineProperty(T,"value",{get:function(){return X},set:f}),Object.defineProperty(T,"selectionStart",{get:function(){return Math.min(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0}),Object.defineProperty(T,"selectionEnd",{get:function(){return Math.max(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(void 0,t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0});var r=!1;R.on("keydown",function(t){if(17!==t.which&&91!==t.which&&18!==t.which&&16!==t.which){W.saveSelectionState(),h();var e=t.metaKey||t.ctrlKey;switch(t.which){case 9:e||(i("indent",{inverse:t.shiftKey}),t.preventDefault());break;case 13:i("newline"),t.preventDefault()}13!==t.which&&(r=!1)}}).on("compositionstart",function(){j++}).on("compositionend",function(){setTimeout(function(){j--},0)}).on("mouseup",t.bind(W.saveSelectionState,W,!0,!1)).on("paste",function(t){Y.currentMode="paste",t.preventDefault();var e,n=(t.originalEvent||t).clipboardData;n?e=n.getData("text/plain"):(n=window.clipboardData,e=n&&n.getData("Text")),e&&(d(W.selectionStart,W.selectionEnd,e),h())}).on("cut",function(){Y.currentMode="cut",h()}).on("focus",function(){W.hasFocus=!0}).on("blur",function(){W.hasFocus=!1});var i=function(t,e){var n=v(),r=Math.min(W.selectionStart,W.selectionEnd),i=Math.max(W.selectionStart,W.selectionEnd),a={selectionStart:r,selectionEnd:i,before:n.slice(0,r),after:n.slice(i),selection:n.slice(r,i)};o[t](a,e||{}),f(a.before+a.selection+a.after),W.setSelectionStartEnd(a.selectionStart,a.selectionEnd),W.updateSelectionRange()},a=/^ {0,3}>[ ]*|^[ \t]*(?:[*+\-]|(\d+)\.)[ \t]|^\s+/,o={indent:function(t,e){function n(t,e,n,r){return n=+n||0,r=r||"",t.slice(0,e)+r+t.slice(e+n)}var r=t.before.lastIndexOf("\n")+1;if(e.inverse)/\s/.test(t.before.charAt(r))&&(t.before=n(t.before,r,1),t.selectionStart--,t.selectionEnd--),t.selection=t.selection.replace(/^[ \t]/gm,"");else{var i=t.before.slice(r);if(!t.selection&&!i.match(a))return t.before+=" ",t.selectionStart++,void t.selectionEnd++;t.before=n(t.before,r,0," "),t.selection=t.selection.replace(/\r?\n(?=[\s\S])/g,"\n "),t.selectionStart++,t.selectionEnd++}t.selectionEnd=t.selectionStart+t.selection.length},newline:function(t){var e=t.before.lastIndexOf("\n")+1;if(r)return t.before=t.before.substring(0,e),t.selection="",t.selectionStart=e,t.selectionEnd=e,void(r=!1);r=!1;var n=t.before.slice(e),i=n.match(a),o=(i||[""])[0];if(i&&i[1]){var s=parseInt(i[1],10);o=o.replace(/\d+/,s+1)}o.length&&(r=!0),Y.currentMode="newlines",t.before+="\n"+o,t.selection="",t.selectionStart+=o.length+1,t.selectionEnd=t.selectionStart}};V!==!1&&F.setContent(V)};var Q,K=[],Z=[],te=[],ee=function(){var t={"&":"&","<":"<"," ":" "};return function(e){return e.replace(/[&<\u00a0]/g,function(e){return t[e]})}}();return r.onEditorCreated(F),F}),function(){function t(){}function e(t){this.buttonBar=h.getElementById("wmd-button-bar"+t),this.preview=h.getElementById("wmd-preview"+t),this.input=h.getElementById("wmd-input"+t)}function n(t,e){var n,i,a,o=this,s=[],c=0,u="none",h=function(t,e){u!=t&&(u=t,e||d()),g.isIE&&"moving"==u?a=null:i=setTimeout(f,1)},f=function(t){a=new r(e,t),i=void 0};this.setCommandMode=function(){u="command",d(),i=setTimeout(f,0)},this.canUndo=function(){return c>1},this.canRedo=function(){return s[c+1]?!0:!1},this.undo=function(){o.canUndo()&&(n?(n.restore(),n=null):(s[c]=new r(e),s[--c].restore(),t&&t())),u="none",e.input.focus(),f()},this.redo=function(){o.canRedo()&&(s[++c].restore(),t&&t()),u="none",e.input.focus(),f()};var d=function(){var i=a||new r(e);return i?"moving"==u?void(n||(n=i)):(n&&(s[c-1].text!=n.text&&(s[c++]=n),n=null),s[c++]=i,s[c+1]=null,void(t&&t())):!1},p=function(t){if(!t.ctrlKey&&!t.metaKey){var e=t.keyCode;e>=33&&40>=e||e>=63232&&63235>=e?h("moving"):8==e||46==e||127==e?h("deleting"):13==e?h("newlines"):27==e?h("escape"):(16>e||e>20)&&91!=e&&h("typing")}},m=function(){l.addEvent(e.input,"keypress",function(t){!t.ctrlKey&&!t.metaKey||t.altKey||89!=t.keyCode&&90!=t.keyCode||t.preventDefault()});var t=function(){(g.isIE||a&&a.text!=e.input.value)&&void 0==i&&(u="paste",d(),f())};l.addEvent(e.input,"keydown",p),l.addEvent(e.input,"mousedown",function(){h("moving")}),e.input.onpaste=t,e.input.ondrop=t},v=function(){m(),f(!0)};this.reinit=function(t,e,r,o){s=[],c=0,u="none",n=void 0,i=void 0,f(),a.text=t,a.start=e,a.end=r,a.scrollTop=o,a.setInputAreaSelection(),d()},this.setMode=h,v()}function r(e){var n=this,r=e.input;this.init=function(){l.isVisible(r)&&(this.setInputAreaSelectionStartEnd(),this.scrollTop=r.scrollTop,(!this.text&&r.selectionStart||0===r.selectionStart)&&(this.text=r.value))},this.setInputAreaSelection=function(){l.isVisible(r)&&(r.focus(),r.selectionStart=n.start,r.selectionEnd=n.end)},this.setInputAreaSelLine truncated
|
||||
for(var n,r,i,a=0,o=t.attributes.length;o>a;++a)if(n=t.attributes[a],i=n.name,"class"!=i){if(r=e.attributes.getNamedItem(i),n.specified!=r.specified)return!1;if(n.specified&&n.nodeValue!==r.nodeValue)return!1}return!0}function f(t,e){for(var n,r=0,i=t.attributes.length;i>r;++r)if(n=t.attributes[r].name,(!e||!k.arrayContains(e,n))&&t.attributes[r].specified&&"class"!=n)return!0;return!1}function d(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function p(t){var e;return t&&1==t.nodeType&&((e=t.parentNode)&&9==e.nodeType&&"on"==e.designMode||N(t)&&!N(t.parentNode))}function g(t){return(N(t)||1!=t.nodeType&&N(t.parentNode))&&!p(t)}function m(t){return t&&1==t.nodeType&&!R.test(E(t,"display"))}function v(t){if(0==t.data.length)return!0;if(A.test(t.data))return!1;var e=E(t.parentNode,"whiteSpace");switch(e){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(t.data))return!1}return m(t.previousSibling)||m(t.nextSibling)}function y(t,e){return k.isCharacterDataNode(t)?0==e?!!t.previousSibling:e==t.length?!!t.nextSibling:!0:e>0&&e<t.childNodes.length}function b(t,n,r,i){var a,o=0==r;if(k.isAncestorOf(n,t))return t;if(k.isCharacterDataNode(n))if(0==r)r=k.getNodeIndex(n),n=n.parentNode;else{if(r!=n.length)throw e.createError("splitNodeAt should not be called with offset in the middle of a data node ("+r+" in "+n.data);r=k.getNodeIndex(n)+1,n=n.parentNode}if(y(n,r)){if(!a){a=n.cloneNode(!1),a.id&&a.removeAttribute("id");for(var s;s=n.childNodes[r];)a.appendChild(s);k.insertAfter(a,n)}return n==t?a:b(t,a.parentNode,k.getNodeIndex(a),i)}if(t!=n){a=n.parentNode;var l=k.getNodeIndex(n);return o||l++,b(t,a,l,i)}return t}function x(t,e){return t.tagName==e.tagName&&s(t,e)&&h(t,e)}function w(t){var e=t?"nextSibling":"previousSibling";return function(n,r){var i=n.parentNode,a=n[e];if(a){if(a&&3==a.nodeType)return a}else if(r&&(a=i[e],a&&1==a.nodeType&&x(i,a)))return a[t?"firstChild":"lastChild"];return null}}function _(t){this.isElementMerge=1==t.nodeType,this.firstTextNode=this.isElementMerge?t.lastChild:t,this.textNodes=[this.firstTextNode]}function C(t,e,r){this.cssClass=t;var i,o,s,l,c=null;if("object"==typeof e&&null!==e){for(r=e.tagNames,c=e.elementProperties,o=0;l=O[o++];)e.hasOwnProperty(l)&&(this[l]=e[l]);i=e.normalize}else i=e;this.normalize="undefined"==typeof i?!0:i,this.attrExceptions=[];var u=document.createElement(this.elementTagName);this.elementProperties={};for(var h in c)c.hasOwnProperty(h)&&(D.hasOwnProperty(h)&&(h=D[h]),u[h]=c[h],this.elementProperties[h]=u[h],this.attrExceptions.push(h));this.elementSortedClassName=this.elementProperties.hasOwnProperty("className")?a(this.elementProperties.className+" "+t):t,this.applyToAnyTagName=!1;var f=typeof r;if("string"==f)"*"==r?this.applyToAnyTagName=!0:this.tagNames=n(r.toLowerCase()).split(/\s*,\s*/);else if("object"==f&&"number"==typeof r.length)for(this.tagNames=[],o=0,s=r.length;s>o;++o)"*"==r[o]?this.applyToAnyTagName=!0:this.tagNames.push(r[o].toLowerCase());else this.tagNames=[this.elementTagName]}function S(t,e,n){return new C(t,e,n)}t.requireModules(["WrappedSelection","WrappedRange"]);var E,k=t.dom,T="span",I=function(){function t(t,e,n){return e&&n?" ":""}return function(e,n){e.className&&(e.className=e.className.replace(new RegExp("(?:^|\\s)"+n+"(?:\\s|$)"),t))}}();"undefined"!=typeof window.getComputedStyle?E=function(t,e){return k.getWindow(t).getComputedStyle(t,null)[e]}:"undefined"!=typeof document.documentElement.currentStyle?E=function(t,e){return t.currentStyle[e]}:e.fail("No means of obtaining computed style properties found");var N;!function(){var t=document.createElement("div");N="boolean"==typeof t.isContentEditable?function(t){return t&&1==t.nodeType&&t.isContentEditable}:function(t){return t&&1==t.nodeType&&"false"!=t.contentEditable?"true"==t.contentEditable||N(t.parentNode):!1}}();var R=/^inline(-block|-table)?$/i,A=/[^\r\n\t\f \u200B]/,M=w(!1),L=w(!0);_.prototype={doMerge:function(){for(var t,e,n,r=[],i=0,a=this.textNodes.length;a>i;++i)t=this.textNodes[i],e=t.parentNode,r[i]=t.data,i&&(e.removeChild(t),e.hasChildNodes()||e.parentNode.removeChild(e));return this.firstTextNode.data=n=r.join(""),n},getLength:function(){for(var t=this.textNodes.length,e=0;t--;)e+=this.textNodes[t].length;return e},toString:function(){for(var t=[],e=0,n=this.textNodes.length;n>e;++e)t[e]="'"+this.textNodes[e].data+"'";return"[Merge("+t.join(",")+")]"}};var O=["elementTagName","ignoreWhiteSpace","applyToEditableOnly"],D={"class":"className"};C.prototype={elementTagName:T,elementProperties:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,hasClass:function(t){return 1==t.nodeType&&k.arrayContains(this.tagNames,t.tagName.toLowerCase())&&r(t,this.cssClass)},getSelfOrAncestorWithClass:function(t){for(;t;){if(this.hasClass(t,this.cssClass))return t;t=t.parentNode}return null},isModifiable:function(t){return!this.applyToEditableOnly||g(t)},isIgnorableWhiteSpaceNode:function(t){return this.ignoreWhiteSpaLine truncated
|
||||
}function n(t){var n=tinymce.activeEditor,i=n.dom,a=function(n){function a(){i.setAttrib(o,"src",n.src),n.title&&i.setAttrib(o,"title",n.title),i.setAttrib(o,"id",null)}var o,s={};s.id="__mcenew"+r++,s.src="http://leanote.com/images/loading-24.gif",o=i.createHTML("img",s),tinymce.activeEditor.insertContent(o),o=i.get(s.id),e(t.src,a)},o="";if(fileIds=t.src.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(o=fileIds[1]),o){var s=Note.getCurNote();s&&s.UserId!=UserInfo.UserId?!function(t){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:o,toUserId:s.UserId},function(e){if(reIsOk(e)&&e.Id){var n=window.location.protocol+"//"+window.location.host;t.src=n+"/file/outputImage?fileId="+e.Id}a(t)})}(t):a(t)}else a(t)}t.prototype.update=function(t){var e=this;t=Math.ceil(100*t),t>=100&&(t=99),t+="%",$("#"+e.id+" .progress-bar").html(t).css("width",t)},t.prototype.replace=function(t){var n=this;e(t,function(){$("#"+n.id).replaceWith('<img src="'+t+'" />')})},t.prototype.remove=function(){var t=this;$("#"+t.id).remove()};var r=1,i=function(){function t(t){return"number"!=typeof t?"":t>=1e9?(t/1e9).toFixed(2)+" GB":t>=1e6?(t/1e6).toFixed(2)+" MB":(t/1e3).toFixed(2)+" KB"}function e(){$("#upload").css("z-index",12);var t=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",t-8),$("#upload").show()}function r(){$("#upload").css("z-index",0).css("top","auto").hide()}var i=$("#upload ul");$("#drop a").click(function(){$(this).parent().find("input").click()}),$("#upload").fileupload({dataType:"json",pasteZone:"",acceptFileTypes:/(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,maxFileSize:21e4,dropZone:$("#drop"),formData:function(){return[{name:"albumId",value:""}]},add:function(e,n){var r=$('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append(n.files[0].name+" <small>[<i>"+t(n.files[0].size)+"</i>]</small>"),n.context=r.appendTo(i);n.submit()},done:function(e,r){if(1==r.result.Ok){r.context.remove();var i={src:urlPrefix+"/file/outputImage?fileId="+r.result.Id};n(i)}else{r.context.empty();var a=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');a.find("div").append("<b>Error:</b> "+r.files[0].name+" <small>[<i>"+t(r.files[0].size)+"</i>]</small> "+r.result.Msg),r.context.append(a),setTimeout(function(t){return function(){t.remove()}}(a),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(e,n){n.context.empty();var r=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append("<b>Error:</b> "+n.files[0].name+" <small>[<i>"+t(n.files[0].size)+"</i>]</small> "+n.errorThrown),n.context.append(r),setTimeout(function(t){return function(){t.remove()}}(r),2e3),$("#uploadMsg").scrollTop(1e3)}}),$(document).on("drop dragover",function(t){t.preventDefault()}),$(document).bind("dragover",function(t){var n=$("#drop"),i=window.dropZoneTimeout;i?clearTimeout(i):(n.addClass("in"),e());var a=!1,o=t.target;do{if(o===n[0]){a=!0;break}o=o.parentNode}while(null!=o);a?n.addClass("hover"):n.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,n.removeClass("in hover"),r()},100)})},a=function(){var e;$("#editorContent").fileupload({dataType:"json",pasteZone:$("#editorContent"),dropZone:"",maxFileSize:21e4,url:"/file/pasteImage",paramName:"file",formData:function(){return[{name:"from",value:"pasteImage"},{name:"noteId",value:Note.curNoteId}]},progress:function(t,e){e.process.update(e.loaded/e.total)},add:function(n,r){var i=Note.getCurNote();if(!i||i.IsNew)return void alert("This note hasn't saved, please save it firstly!");e=tinymce.EditorManager.activeEditor;var a=new t(e);r.process=a;r.submit()},done:function(t,e){if(1==e.result.Ok){var n=e.result,r=UrlPrefix,i=r+"/file/outputImage?fileId="+n.Id;e.process.replace(i)}else e.process.remove()},fail:function(t,e){e.process.remove()}})};i(),a()});var urlPrefix=UrlPrefix;define("attachment_upload",["jquery.ui.widget","fileupload"],function(){function t(t){return"number"!=typeof t?"":t>=1e9?(t/1e9).toFixed(2)+" GB":t>=1e6?(t/1e6).toFixed(2)+" MB":(t/1e3).toFixed(2)+" KB"}function e(t,e){var n=$(t);$(e).bind("dragover",function(t){t.preventDefault();var e=window.dropZoneTimeoutAttach;e&&clearTimeout(e);var r=!1,i=t.target;do{if(i===n[0]){r=!0;break}i=i.parentNode}while(null!=i);r?n.addClass("hover"):n.removeClass("hover"),window.dropZoneTimeoutAttach=setTimeout(function(){window.dropZoneTimeoutAttach=null,n.removeClass("in hover")},100)})}e("#dropAttach","#uploadAttach"),e("#dropAvatar","#uploadAvatar");var n=function(){$(".dropzone .btn-choose-file").click(function(){$(this).parent().find("input").click()});var e=$("#attachUploadMsg");$("#uploadAttach").fileupload({dataType:"json",pasteZone:"",dropZone:$("#dropAttach"),formData:function(){return[{name:"noteId",value:NoLine truncated
|
||||
@@ -0,0 +1,334 @@
|
||||
/** lifelife */
|
||||
/* Pretty printing styles. Used with prettify.js. */
|
||||
pre.prettyprint * {
|
||||
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
|
||||
}
|
||||
pre.prettyprint {
|
||||
white-space: pre-wrap;
|
||||
white-space: -moz-pre-wrap;
|
||||
white-space: -pre-wrap;
|
||||
white-space: -o-pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
code.prettyprint,
|
||||
pre.prettyprint {
|
||||
padding: 8px;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
-o-border-radius: 3px;
|
||||
-ms-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
}
|
||||
/*行号*/
|
||||
code.prettyprint .linenums,
|
||||
pre.prettyprint .linenums {
|
||||
/*
|
||||
-webkit-box-shadow: inset 0px 0 0 #f7f7f9,inset 0px 0 0 #ececf0;
|
||||
-moz-box-shadow: inset 0px 0 0 #f7f7f9,inset 0px 0 0 #ececf0;
|
||||
box-shadow: inset 0px 0 0 #f7f7f9,inset 0px 0 0 #ececf0
|
||||
*/
|
||||
}
|
||||
code.prettyprint ol.linenums,
|
||||
pre.prettyprint ol.linenums {
|
||||
padding: 0 0 0 30px;
|
||||
margin: 0;
|
||||
}
|
||||
code.prettyprint ol.linenums li,
|
||||
pre.prettyprint ol.linenums li {
|
||||
padding-left: 0;
|
||||
color: #bebec5;
|
||||
line-height: 20px;
|
||||
}
|
||||
code.prettyprint .com,
|
||||
pre.prettyprint .com {
|
||||
color: #93a1a1;
|
||||
font-style: italic;
|
||||
}
|
||||
code.prettyprint .lit,
|
||||
pre.prettyprint .lit {
|
||||
color: #195f91;
|
||||
}
|
||||
code.prettyprint .pun,
|
||||
pre.prettyprint .pun {
|
||||
color: #93a1a1;
|
||||
}
|
||||
code.prettyprint .opn,
|
||||
pre.prettyprint .opn {
|
||||
color: #93a1a1;
|
||||
}
|
||||
code.prettyprint .clo,
|
||||
pre.prettyprint .clo {
|
||||
color: #93a1a1;
|
||||
}
|
||||
code.prettyprint .fun,
|
||||
pre.prettyprint .fun {
|
||||
color: #dc322f;
|
||||
}
|
||||
code.prettyprint .str,
|
||||
pre.prettyprint .str {
|
||||
color: #dd1144;
|
||||
}
|
||||
code.prettyprint .atv,
|
||||
pre.prettyprint .atv {
|
||||
color: #dd1144;
|
||||
}
|
||||
code.prettyprint .kwd,
|
||||
pre.prettyprint .kwd {
|
||||
color: #1e347b;
|
||||
}
|
||||
code.prettyprint .tag,
|
||||
pre.prettyprint .tag {
|
||||
color: #1e347b;
|
||||
}
|
||||
code.prettyprint .typ,
|
||||
pre.prettyprint .typ {
|
||||
color: #008080;
|
||||
}
|
||||
code.prettyprint .atn,
|
||||
pre.prettyprint .atn {
|
||||
color: #008080;
|
||||
}
|
||||
code.prettyprint .dec,
|
||||
pre.prettyprint .dec {
|
||||
color: #008080;
|
||||
}
|
||||
code.prettyprint .var,
|
||||
pre.prettyprint .var {
|
||||
color: #008080;
|
||||
}
|
||||
code.prettyprint .pln,
|
||||
pre.prettyprint .pln {
|
||||
color: #48484c;
|
||||
}
|
||||
/*
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.svg#fontello') format('svg'),
|
||||
url('../font/fontello.woff') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url("../font/SourceSansPro-Light-webfont.woff") format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Source Sans Pro'), local('SourceSansPro'), url("../font/SourceSansPro-Regular-webfont.woff") format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url("../font/SourceSansPro-Bold-webfont.woff") format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: italic;
|
||||
font-weight: 300;
|
||||
src: local('Source Sans Pro Light Italic'), local('SourceSansProLight-Italic'), url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url("../font/SourceSansPro-Italic-webfont.woff") format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Sans Pro';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: local('Source Sans Pro Bold Italic'), local('SourceSansPro-BoldItalic'), url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff');
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Source Code Pro';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url("../font/SourceCodePro-Regular-webfont.woff") format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Source Code Pro';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Source Code Pro Bold'), local('SourceCodePro-Bold'), url("../font/SourceCodePro-Bold-webfont.woff") format('woff');
|
||||
}
|
||||
*/
|
||||
.container {
|
||||
margin-bottom: 180px;
|
||||
text-align: justify;
|
||||
}
|
||||
a code {
|
||||
color: inherit;
|
||||
}
|
||||
/*
|
||||
h1 { font-size: @title-base-size * 2.60; }
|
||||
h2 { font-size: @title-base-size * 2.15; }
|
||||
h3 { font-size: @title-base-size * 1.70; }
|
||||
h4 { font-size: @title-base-size * 1.25; }
|
||||
h5 { font-size: @title-base-size; }
|
||||
h6 { font-size: @title-base-size * 0.85; }
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 1.5em 0;
|
||||
text-align: start;
|
||||
}
|
||||
*/
|
||||
pre {
|
||||
word-break: break-word;
|
||||
}
|
||||
p,
|
||||
blockquote {
|
||||
margin: 0 0 1.1em;
|
||||
}
|
||||
hr {
|
||||
margin: 2em 0;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
.sequence-diagram,
|
||||
.flow-chart {
|
||||
text-align: center;
|
||||
margin-bottom: 1.1em;
|
||||
}
|
||||
.sequence-diagram text,
|
||||
.flow-chart text {
|
||||
font-size: 15px !important;
|
||||
font-family: "Source Sans Pro", sans-serif !important;
|
||||
}
|
||||
.sequence-diagram [fill="#ffffff"],
|
||||
.flow-chart [fill="#ffffff"] {
|
||||
fill: #ffffff;
|
||||
}
|
||||
.sequence-diagram [stroke="#000000"],
|
||||
.flow-chart [stroke="#000000"] {
|
||||
stroke: #000000;
|
||||
}
|
||||
.sequence-diagram text[stroke="#000000"],
|
||||
.flow-chart text[stroke="#000000"] {
|
||||
stroke: none;
|
||||
}
|
||||
.sequence-diagram [fill="#000"],
|
||||
.flow-chart [fill="#000"],
|
||||
.sequence-diagram [fill="#000000"],
|
||||
.flow-chart [fill="#000000"],
|
||||
.sequence-diagram [fill="black"],
|
||||
.flow-chart [fill="black"] {
|
||||
fill: #000000;
|
||||
}
|
||||
code,
|
||||
pre {
|
||||
font-family: "Source Code Pro", monospace;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
code {
|
||||
white-space: normal;
|
||||
}
|
||||
pre {
|
||||
border-radius: 5px;
|
||||
}
|
||||
pre.prettyprint {
|
||||
text-align: start;
|
||||
border: 0;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
pre.prettyprint code {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
/* Definition list */
|
||||
dt,
|
||||
dd {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
dd {
|
||||
margin-left: 40px;
|
||||
}
|
||||
/* Table style */
|
||||
table {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
table th,
|
||||
table td {
|
||||
padding: 8px;
|
||||
line-height: 20px;
|
||||
vertical-align: top;
|
||||
border-top: 1px solid #dddddd;
|
||||
}
|
||||
table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
table thead th {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
table caption + thead tr:first-child th,
|
||||
table caption + thead tr:first-child td,
|
||||
table colgroup + thead tr:first-child th,
|
||||
table colgroup + thead tr:first-child td,
|
||||
table thead:first-child tr:first-child th,
|
||||
table thead:first-child tr:first-child td {
|
||||
border-top: 0;
|
||||
}
|
||||
table tbody + tbody {
|
||||
border-top: 2px solid #dddddd;
|
||||
}
|
||||
blockquote {
|
||||
border-left-width: 10px;
|
||||
background-color: #f8f8f8;
|
||||
border-top-right-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
blockquote p {
|
||||
margin-bottom: 1.1em;
|
||||
font-size: 1em;
|
||||
line-height: 1.45;
|
||||
}
|
||||
blockquote ul:last-child,
|
||||
blockquote ol:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
ul,
|
||||
ol {
|
||||
margin-bottom: 1.1em;
|
||||
}
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol,
|
||||
ol ol {
|
||||
margin-bottom: 1.1em;
|
||||
}
|
||||
kbd {
|
||||
padding: 0.1em 0.6em;
|
||||
border: 1px solid rgba(0, 0, 0, 0.25);
|
||||
-webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: 0 1px 0px rgba(0, 0, 0, 0.25);
|
||||
font-size: 0.7em;
|
||||
font-family: sans-serif;
|
||||
background-color: #ffffff;
|
||||
color: #333333;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
margin: 0 0.1em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.toc ul {
|
||||
list-style-type: none;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.footnote {
|
||||
vertical-align: top;
|
||||
position: relative;
|
||||
top: -0.5em;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 18 KiB |
@@ -1 +0,0 @@
|
||||
(function(){"use strict";var _camelizeCssPropName=function(){var matcherRegex=/\-([a-z])/g,replacerFn=function(match,group){return group.toUpperCase()};return function(prop){return prop.replace(matcherRegex,replacerFn)}}();var _getStyle=function(el,prop){var value,camelProp,tagName,possiblePointers,i,len;if(window.getComputedStyle){value=window.getComputedStyle(el,null).getPropertyValue(prop)}else{camelProp=_camelizeCssPropName(prop);if(el.currentStyle){value=el.currentStyle[camelProp]}else{value=el.style[camelProp]}}if(prop==="cursor"){if(!value||value==="auto"){tagName=el.tagName.toLowerCase();possiblePointers=["a"];for(i=0,len=possiblePointers.length;i<len;i++){if(tagName===possiblePointers[i]){return"pointer"}}}}return value};var _elementMouseOver=function(event){if(!ZeroClipboard.prototype._singleton)return;if(!event){event=window.event}var target;if(this!==window){target=this}else if(event.target){target=event.target}else if(event.srcElement){target=event.srcElement}ZeroClipboard.prototype._singleton.setCurrent(target)};var _addEventHandler=function(element,method,func){if(element.addEventListener){element.addEventListener(method,func,false)}else if(element.attachEvent){element.attachEvent("on"+method,func)}};var _removeEventHandler=function(element,method,func){if(element.removeEventListener){element.removeEventListener(method,func,false)}else if(element.detachEvent){element.detachEvent("on"+method,func)}};var _addClass=function(element,value){if(element.addClass){element.addClass(value);return element}if(value&&typeof value==="string"){var classNames=(value||"").split(/\s+/);if(element.nodeType===1){if(!element.className){element.className=value}else{var className=" "+element.className+" ",setClass=element.className;for(var c=0,cl=classNames.length;c<cl;c++){if(className.indexOf(" "+classNames[c]+" ")<0){setClass+=" "+classNames[c]}}element.className=setClass.replace(/^\s+|\s+$/g,"")}}}return element};var _removeClass=function(element,value){if(element.removeClass){element.removeClass(value);return element}if(value&&typeof value==="string"||value===undefined){var classNames=(value||"").split(/\s+/);if(element.nodeType===1&&element.className){if(value){var className=(" "+element.className+" ").replace(/[\n\t]/g," ");for(var c=0,cl=classNames.length;c<cl;c++){className=className.replace(" "+classNames[c]+" "," ")}element.className=className.replace(/^\s+|\s+$/g,"")}else{element.className=""}}}return element};var _getZoomFactor=function(){var rect,physicalWidth,logicalWidth,zoomFactor=1;if(typeof document.body.getBoundingClientRect==="function"){rect=document.body.getBoundingClientRect();physicalWidth=rect.right-rect.left;logicalWidth=document.body.offsetWidth;zoomFactor=Math.round(physicalWidth/logicalWidth*100)/100}return zoomFactor};var _getDOMObjectPosition=function(obj){var info={left:0,top:0,width:0,height:0,zIndex:999999999};var zi=_getStyle(obj,"z-index");if(zi&&zi!=="auto"){info.zIndex=parseInt(zi,10)}if(obj.getBoundingClientRect){var rect=obj.getBoundingClientRect();var pageXOffset,pageYOffset,zoomFactor;if("pageXOffset"in window&&"pageYOffset"in window){pageXOffset=window.pageXOffset;pageYOffset=window.pageYOffset}else{zoomFactor=_getZoomFactor();pageXOffset=Math.round(document.documentElement.scrollLeft/zoomFactor);pageYOffset=Math.round(document.documentElement.scrollTop/zoomFactor)}var leftBorderWidth=document.documentElement.clientLeft||0;var topBorderWidth=document.documentElement.clientTop||0;info.left=rect.left+pageXOffset-leftBorderWidth;info.top=rect.top+pageYOffset-topBorderWidth;info.width="width"in rect?rect.width:rect.right-rect.left;info.height="height"in rect?rect.height:rect.bottom-rect.top}return info};var _noCache=function(path,options){var useNoCache=!(options&&options.useNoCache===false);if(useNoCache){return(path.indexOf("?")===-1?"?":"&")+"nocache="+(new Date).getTime()}else{return""}};var _vars=function(options){var str=[];var origins=[];if(options.trustedOrigins){if(typeof options.trustedOrigins==="string"){origins=origins.push(options.trustedOrigins)}else if(typeof options.trustedOrigins==="object"&&"length"in options.trustedOrigins){origins=origins.concat(options.trustedOrigins)}}if(options.trustedDomains){if(typeof options.trustedDomains==="string"){origins=origins.push(options.trustedDomains)}else if(typeof options.trustedDomains==="object"&&"length"in options.trustedDomains){origins=origins.concat(options.trustedDomains)}}if(origins.length){str.push("trustedOrigins="+encodeURIComponent(origins.join(",")))}if(typeof options.amdModuleId==="string"&&options.amdModuleId){str.push("amdModuleId="+encodeURIComponent(options.amdModuleId))}if(typeof options.cjsModuleId==="string"&&options.cjsModuleId){str.push("cjsModuleId="+encodeURIComponent(options.cjsModuleId))}return str.join("&")};var _inArray=function(elem,array){if(array.indexOf){return array.indexOf(elem)}for(var i=0,length=array.length;i<length;i++){if(array[i]===elem){return i}}return-1};var _prepGlue=functionLine truncated
|
||||
@@ -1,458 +0,0 @@
|
||||
/*!
|
||||
* ZeroClipboard
|
||||
* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
|
||||
* Copyright (c) 2013 Jon Rohan, James M. Greene
|
||||
* Licensed MIT
|
||||
* http://zeroclipboard.org/
|
||||
* v1.2.0-beta.4
|
||||
*/
|
||||
(function() {
|
||||
"use strict";
|
||||
var _camelizeCssPropName = function() {
|
||||
var matcherRegex = /\-([a-z])/g, replacerFn = function(match, group) {
|
||||
return group.toUpperCase();
|
||||
};
|
||||
return function(prop) {
|
||||
return prop.replace(matcherRegex, replacerFn);
|
||||
};
|
||||
}();
|
||||
var _getStyle = function(el, prop) {
|
||||
var value, camelProp, tagName, possiblePointers, i, len;
|
||||
if (window.getComputedStyle) {
|
||||
value = window.getComputedStyle(el, null).getPropertyValue(prop);
|
||||
} else {
|
||||
camelProp = _camelizeCssPropName(prop);
|
||||
if (el.currentStyle) {
|
||||
value = el.currentStyle[camelProp];
|
||||
} else {
|
||||
value = el.style[camelProp];
|
||||
}
|
||||
}
|
||||
if (prop === "cursor") {
|
||||
if (!value || value === "auto") {
|
||||
tagName = el.tagName.toLowerCase();
|
||||
possiblePointers = [ "a" ];
|
||||
for (i = 0, len = possiblePointers.length; i < len; i++) {
|
||||
if (tagName === possiblePointers[i]) {
|
||||
return "pointer";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
var _elementMouseOver = function(event) {
|
||||
if (!ZeroClipboard.prototype._singleton) return;
|
||||
if (!event) {
|
||||
event = window.event;
|
||||
}
|
||||
var target;
|
||||
if (this !== window) {
|
||||
target = this;
|
||||
} else if (event.target) {
|
||||
target = event.target;
|
||||
} else if (event.srcElement) {
|
||||
target = event.srcElement;
|
||||
}
|
||||
ZeroClipboard.prototype._singleton.setCurrent(target);
|
||||
};
|
||||
var _addEventHandler = function(element, method, func) {
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(method, func, false);
|
||||
} else if (element.attachEvent) {
|
||||
element.attachEvent("on" + method, func);
|
||||
}
|
||||
};
|
||||
var _removeEventHandler = function(element, method, func) {
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(method, func, false);
|
||||
} else if (element.detachEvent) {
|
||||
element.detachEvent("on" + method, func);
|
||||
}
|
||||
};
|
||||
var _addClass = function(element, value) {
|
||||
if (element.addClass) {
|
||||
element.addClass(value);
|
||||
return element;
|
||||
}
|
||||
if (value && typeof value === "string") {
|
||||
var classNames = (value || "").split(/\s+/);
|
||||
if (element.nodeType === 1) {
|
||||
if (!element.className) {
|
||||
element.className = value;
|
||||
} else {
|
||||
var className = " " + element.className + " ", setClass = element.className;
|
||||
for (var c = 0, cl = classNames.length; c < cl; c++) {
|
||||
if (className.indexOf(" " + classNames[c] + " ") < 0) {
|
||||
setClass += " " + classNames[c];
|
||||
}
|
||||
}
|
||||
element.className = setClass.replace(/^\s+|\s+$/g, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
return element;
|
||||
};
|
||||
var _removeClass = function(element, value) {
|
||||
if (element.removeClass) {
|
||||
element.removeClass(value);
|
||||
return element;
|
||||
}
|
||||
if (value && typeof value === "string" || value === undefined) {
|
||||
var classNames = (value || "").split(/\s+/);
|
||||
if (element.nodeType === 1 && element.className) {
|
||||
if (value) {
|
||||
var className = (" " + element.className + " ").replace(/[\n\t]/g, " ");
|
||||
for (var c = 0, cl = classNames.length; c < cl; c++) {
|
||||
className = className.replace(" " + classNames[c] + " ", " ");
|
||||
}
|
||||
element.className = className.replace(/^\s+|\s+$/g, "");
|
||||
} else {
|
||||
element.className = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
return element;
|
||||
};
|
||||
var _getZoomFactor = function() {
|
||||
var rect, physicalWidth, logicalWidth, zoomFactor = 1;
|
||||
if (typeof document.body.getBoundingClientRect === "function") {
|
||||
rect = document.body.getBoundingClientRect();
|
||||
physicalWidth = rect.right - rect.left;
|
||||
logicalWidth = document.body.offsetWidth;
|
||||
zoomFactor = Math.round(physicalWidth / logicalWidth * 100) / 100;
|
||||
}
|
||||
return zoomFactor;
|
||||
};
|
||||
var _getDOMObjectPosition = function(obj) {
|
||||
var info = {
|
||||
left: 0,
|
||||
top: 0,
|
||||
width: 0,
|
||||
height: 0,
|
||||
zIndex: 999999999
|
||||
};
|
||||
var zi = _getStyle(obj, "z-index");
|
||||
if (zi && zi !== "auto") {
|
||||
info.zIndex = parseInt(zi, 10);
|
||||
}
|
||||
if (obj.getBoundingClientRect) {
|
||||
var rect = obj.getBoundingClientRect();
|
||||
var pageXOffset, pageYOffset, zoomFactor;
|
||||
if ("pageXOffset" in window && "pageYOffset" in window) {
|
||||
pageXOffset = window.pageXOffset;
|
||||
pageYOffset = window.pageYOffset;
|
||||
} else {
|
||||
zoomFactor = _getZoomFactor();
|
||||
pageXOffset = Math.round(document.documentElement.scrollLeft / zoomFactor);
|
||||
pageYOffset = Math.round(document.documentElement.scrollTop / zoomFactor);
|
||||
}
|
||||
var leftBorderWidth = document.documentElement.clientLeft || 0;
|
||||
var topBorderWidth = document.documentElement.clientTop || 0;
|
||||
info.left = rect.left + pageXOffset - leftBorderWidth;
|
||||
info.top = rect.top + pageYOffset - topBorderWidth;
|
||||
info.width = "width" in rect ? rect.width : rect.right - rect.left;
|
||||
info.height = "height" in rect ? rect.height : rect.bottom - rect.top;
|
||||
}
|
||||
return info;
|
||||
};
|
||||
var _noCache = function(path, options) {
|
||||
var useNoCache = !(options && options.useNoCache === false);
|
||||
if (useNoCache) {
|
||||
return (path.indexOf("?") === -1 ? "?" : "&") + "nocache=" + new Date().getTime();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
var _vars = function(options) {
|
||||
var str = [];
|
||||
var origins = [];
|
||||
if (options.trustedOrigins) {
|
||||
if (typeof options.trustedOrigins === "string") {
|
||||
origins = origins.push(options.trustedOrigins);
|
||||
} else if (typeof options.trustedOrigins === "object" && "length" in options.trustedOrigins) {
|
||||
origins = origins.concat(options.trustedOrigins);
|
||||
}
|
||||
}
|
||||
if (options.trustedDomains) {
|
||||
if (typeof options.trustedDomains === "string") {
|
||||
origins = origins.push(options.trustedDomains);
|
||||
} else if (typeof options.trustedDomains === "object" && "length" in options.trustedDomains) {
|
||||
origins = origins.concat(options.trustedDomains);
|
||||
}
|
||||
}
|
||||
if (origins.length) {
|
||||
str.push("trustedOrigins=" + encodeURIComponent(origins.join(",")));
|
||||
}
|
||||
if (typeof options.amdModuleId === "string" && options.amdModuleId) {
|
||||
str.push("amdModuleId=" + encodeURIComponent(options.amdModuleId));
|
||||
}
|
||||
if (typeof options.cjsModuleId === "string" && options.cjsModuleId) {
|
||||
str.push("cjsModuleId=" + encodeURIComponent(options.cjsModuleId));
|
||||
}
|
||||
return str.join("&");
|
||||
};
|
||||
var _inArray = function(elem, array) {
|
||||
if (array.indexOf) {
|
||||
return array.indexOf(elem);
|
||||
}
|
||||
for (var i = 0, length = array.length; i < length; i++) {
|
||||
if (array[i] === elem) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
var _prepGlue = function(elements) {
|
||||
if (typeof elements === "string") throw new TypeError("ZeroClipboard doesn't accept query strings.");
|
||||
if (!elements.length) return [ elements ];
|
||||
return elements;
|
||||
};
|
||||
var _dispatchCallback = function(func, element, instance, args, async) {
|
||||
if (async) {
|
||||
window.setTimeout(function() {
|
||||
func.call(element, instance, args);
|
||||
}, 0);
|
||||
} else {
|
||||
func.call(element, instance, args);
|
||||
}
|
||||
};
|
||||
var ZeroClipboard = function(elements, options) {
|
||||
if (elements) (ZeroClipboard.prototype._singleton || this).glue(elements);
|
||||
if (ZeroClipboard.prototype._singleton) return ZeroClipboard.prototype._singleton;
|
||||
ZeroClipboard.prototype._singleton = this;
|
||||
this.options = {};
|
||||
for (var kd in _defaults) this.options[kd] = _defaults[kd];
|
||||
for (var ko in options) this.options[ko] = options[ko];
|
||||
this.handlers = {};
|
||||
if (ZeroClipboard.detectFlashSupport()) _bridge();
|
||||
};
|
||||
var currentElement, gluedElements = [];
|
||||
ZeroClipboard.prototype.setCurrent = function(element) {
|
||||
currentElement = element;
|
||||
this.reposition();
|
||||
var titleAttr = element.getAttribute("title");
|
||||
if (titleAttr) {
|
||||
this.setTitle(titleAttr);
|
||||
}
|
||||
var useHandCursor = this.options.forceHandCursor === true || _getStyle(element, "cursor") === "pointer";
|
||||
_setHandCursor.call(this, useHandCursor);
|
||||
};
|
||||
ZeroClipboard.prototype.setText = function(newText) {
|
||||
if (newText && newText !== "") {
|
||||
this.options.text = newText;
|
||||
if (this.ready()) this.flashBridge.setText(newText);
|
||||
}
|
||||
};
|
||||
ZeroClipboard.prototype.setTitle = function(newTitle) {
|
||||
if (newTitle && newTitle !== "") this.htmlBridge.setAttribute("title", newTitle);
|
||||
};
|
||||
ZeroClipboard.prototype.setSize = function(width, height) {
|
||||
if (this.ready()) this.flashBridge.setSize(width, height);
|
||||
};
|
||||
ZeroClipboard.prototype.setHandCursor = function(enabled) {
|
||||
enabled = typeof enabled === "boolean" ? enabled : !!enabled;
|
||||
_setHandCursor.call(this, enabled);
|
||||
this.options.forceHandCursor = enabled;
|
||||
};
|
||||
var _setHandCursor = function(enabled) {
|
||||
if (this.ready()) this.flashBridge.setHandCursor(enabled);
|
||||
};
|
||||
ZeroClipboard.version = "1.2.0-beta.4";
|
||||
var _defaults = {
|
||||
moviePath: "ZeroClipboard.swf",
|
||||
trustedOrigins: null,
|
||||
text: null,
|
||||
hoverClass: "zeroclipboard-is-hover",
|
||||
activeClass: "zeroclipboard-is-active",
|
||||
allowScriptAccess: "sameDomain",
|
||||
useNoCache: true,
|
||||
forceHandCursor: false
|
||||
};
|
||||
ZeroClipboard.setDefaults = function(options) {
|
||||
for (var ko in options) _defaults[ko] = options[ko];
|
||||
};
|
||||
ZeroClipboard.destroy = function() {
|
||||
ZeroClipboard.prototype._singleton.unglue(gluedElements);
|
||||
var bridge = ZeroClipboard.prototype._singleton.htmlBridge;
|
||||
bridge.parentNode.removeChild(bridge);
|
||||
delete ZeroClipboard.prototype._singleton;
|
||||
};
|
||||
ZeroClipboard.detectFlashSupport = function() {
|
||||
var hasFlash = false;
|
||||
if (typeof ActiveXObject === "function") {
|
||||
try {
|
||||
if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
|
||||
hasFlash = true;
|
||||
}
|
||||
} catch (error) {}
|
||||
}
|
||||
if (!hasFlash && navigator.mimeTypes["application/x-shockwave-flash"]) {
|
||||
hasFlash = true;
|
||||
}
|
||||
return hasFlash;
|
||||
};
|
||||
var _amdModuleId = null;
|
||||
var _cjsModuleId = null;
|
||||
var _bridge = function() {
|
||||
var client = ZeroClipboard.prototype._singleton;
|
||||
var container = document.getElementById("global-zeroclipboard-html-bridge");
|
||||
if (!container) {
|
||||
var opts = {};
|
||||
for (var ko in client.options) opts[ko] = client.options[ko];
|
||||
opts.amdModuleId = _amdModuleId;
|
||||
opts.cjsModuleId = _cjsModuleId;
|
||||
var flashvars = _vars(opts);
|
||||
var html = ' <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%"> <param name="movie" value="' + client.options.moviePath + _noCache(client.options.moviePath, client.options) + '"/> <param name="allowScriptAccess" value="' + client.options.allowScriptAccess + '"/> <param name="scale" value="exactfit"/> <param name="loop" value="false"/> <param name="menu" value="false"/> <param name="quality" value="best" /> <param name="bgcolor" value="#ffffff"/> <param name="wmode" value="transparent"/> <param name="flashvars" value="' + flashvars + '"/> <embed src="' + client.options.moviePath + _noCache(client.options.moviePath, client.options) + '" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="100%" height="100%" name="global-zeroclipboard-flash-bridge" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="' + flashvars + '" scale="exactfit"> </embed> </object>';
|
||||
container = document.createElement("div");
|
||||
container.id = "global-zeroclipboard-html-bridge";
|
||||
container.setAttribute("class", "global-zeroclipboard-container");
|
||||
container.setAttribute("data-clipboard-ready", false);
|
||||
container.style.position = "absolute";
|
||||
container.style.left = "-9999px";
|
||||
container.style.top = "-9999px";
|
||||
container.style.width = "15px";
|
||||
container.style.height = "15px";
|
||||
container.style.zIndex = "9999";
|
||||
container.innerHTML = html;
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
client.htmlBridge = container;
|
||||
client.flashBridge = document["global-zeroclipboard-flash-bridge"] || container.children[0].lastElementChild;
|
||||
};
|
||||
ZeroClipboard.prototype.resetBridge = function() {
|
||||
this.htmlBridge.style.left = "-9999px";
|
||||
this.htmlBridge.style.top = "-9999px";
|
||||
this.htmlBridge.removeAttribute("title");
|
||||
this.htmlBridge.removeAttribute("data-clipboard-text");
|
||||
_removeClass(currentElement, this.options.activeClass);
|
||||
currentElement = null;
|
||||
this.options.text = null;
|
||||
};
|
||||
ZeroClipboard.prototype.ready = function() {
|
||||
var ready = this.htmlBridge.getAttribute("data-clipboard-ready");
|
||||
return ready === "true" || ready === true;
|
||||
};
|
||||
ZeroClipboard.prototype.reposition = function() {
|
||||
if (!currentElement) return false;
|
||||
var pos = _getDOMObjectPosition(currentElement);
|
||||
this.htmlBridge.style.top = pos.top + "px";
|
||||
this.htmlBridge.style.left = pos.left + "px";
|
||||
this.htmlBridge.style.width = pos.width + "px";
|
||||
this.htmlBridge.style.height = pos.height + "px";
|
||||
this.htmlBridge.style.zIndex = pos.zIndex + 1;
|
||||
this.setSize(pos.width, pos.height);
|
||||
};
|
||||
ZeroClipboard.dispatch = function(eventName, args) {
|
||||
ZeroClipboard.prototype._singleton.receiveEvent(eventName, args);
|
||||
};
|
||||
ZeroClipboard.prototype.on = function(eventName, func) {
|
||||
var events = eventName.toString().split(/\s/g);
|
||||
for (var i = 0; i < events.length; i++) {
|
||||
eventName = events[i].toLowerCase().replace(/^on/, "");
|
||||
if (!this.handlers[eventName]) this.handlers[eventName] = func;
|
||||
}
|
||||
if (this.handlers.noflash && !ZeroClipboard.detectFlashSupport()) {
|
||||
this.receiveEvent("onNoFlash", null);
|
||||
}
|
||||
};
|
||||
ZeroClipboard.prototype.addEventListener = ZeroClipboard.prototype.on;
|
||||
ZeroClipboard.prototype.off = function(eventName, func) {
|
||||
var events = eventName.toString().split(/\s/g);
|
||||
for (var i = 0; i < events.length; i++) {
|
||||
eventName = events[i].toLowerCase().replace(/^on/, "");
|
||||
for (var event in this.handlers) {
|
||||
if (event === eventName && this.handlers[event] === func) {
|
||||
delete this.handlers[event];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
ZeroClipboard.prototype.removeEventListener = ZeroClipboard.prototype.off;
|
||||
ZeroClipboard.prototype.receiveEvent = function(eventName, args) {
|
||||
eventName = eventName.toString().toLowerCase().replace(/^on/, "");
|
||||
var element = currentElement;
|
||||
var performCallbackAsync = true;
|
||||
switch (eventName) {
|
||||
case "load":
|
||||
if (args && parseFloat(args.flashVersion.replace(",", ".").replace(/[^0-9\.]/gi, "")) < 10) {
|
||||
this.receiveEvent("onWrongFlash", {
|
||||
flashVersion: args.flashVersion
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.htmlBridge.setAttribute("data-clipboard-ready", true);
|
||||
break;
|
||||
|
||||
case "mouseover":
|
||||
_addClass(element, this.options.hoverClass);
|
||||
break;
|
||||
|
||||
case "mouseout":
|
||||
_removeClass(element, this.options.hoverClass);
|
||||
this.resetBridge();
|
||||
break;
|
||||
|
||||
case "mousedown":
|
||||
_addClass(element, this.options.activeClass);
|
||||
break;
|
||||
|
||||
case "mouseup":
|
||||
_removeClass(element, this.options.activeClass);
|
||||
break;
|
||||
|
||||
case "datarequested":
|
||||
var targetId = element.getAttribute("data-clipboard-target"), targetEl = !targetId ? null : document.getElementById(targetId);
|
||||
if (targetEl) {
|
||||
var textContent = targetEl.value || targetEl.textContent || targetEl.innerText;
|
||||
if (textContent) this.setText(textContent);
|
||||
} else {
|
||||
var defaultText = element.getAttribute("data-clipboard-text");
|
||||
if (defaultText) this.setText(defaultText);
|
||||
}
|
||||
performCallbackAsync = false;
|
||||
break;
|
||||
|
||||
case "complete":
|
||||
this.options.text = null;
|
||||
break;
|
||||
}
|
||||
if (this.handlers[eventName]) {
|
||||
var func = this.handlers[eventName];
|
||||
if (typeof func === "string" && typeof window[func] === "function") {
|
||||
func = window[func];
|
||||
}
|
||||
if (typeof func === "function") {
|
||||
_dispatchCallback(func, element, this, args, performCallbackAsync);
|
||||
}
|
||||
}
|
||||
};
|
||||
ZeroClipboard.prototype.glue = function(elements) {
|
||||
elements = _prepGlue(elements);
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
if (_inArray(elements[i], gluedElements) == -1) {
|
||||
gluedElements.push(elements[i]);
|
||||
_addEventHandler(elements[i], "mouseover", _elementMouseOver);
|
||||
}
|
||||
}
|
||||
};
|
||||
ZeroClipboard.prototype.unglue = function(elements) {
|
||||
elements = _prepGlue(elements);
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
_removeEventHandler(elements[i], "mouseover", _elementMouseOver);
|
||||
var arrayIndex = _inArray(elements[i], gluedElements);
|
||||
if (arrayIndex != -1) gluedElements.splice(arrayIndex, 1);
|
||||
}
|
||||
};
|
||||
if (typeof define === "function" && define.amd) {
|
||||
define([ "require", "exports", "module" ], function(require, exports, module) {
|
||||
_amdModuleId = module && module.id || null;
|
||||
return ZeroClipboard;
|
||||
});
|
||||
} else if (typeof module !== "undefined" && module) {
|
||||
_cjsModuleId = module.id || null;
|
||||
module.exports = ZeroClipboard;
|
||||
} else {
|
||||
window.ZeroClipboard = ZeroClipboard;
|
||||
}
|
||||
})();
|
||||
@@ -1,9 +0,0 @@
|
||||
/*!
|
||||
* ZeroClipboard
|
||||
* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
|
||||
* Copyright (c) 2013 Jon Rohan, James M. Greene
|
||||
* Licensed MIT
|
||||
* http://zeroclipboard.org/
|
||||
* v1.2.0-beta.4
|
||||
*/
|
||||
!function(){"use strict";var a,b=function(){var a=/\-([a-z])/g,b=function(a,b){return b.toUpperCase()};return function(c){return c.replace(a,b)}}(),c=function(a,c){var d,e,f,g,h,i;if(window.getComputedStyle?d=window.getComputedStyle(a,null).getPropertyValue(c):(e=b(c),d=a.currentStyle?a.currentStyle[e]:a.style[e]),"cursor"===c&&(!d||"auto"===d))for(f=a.tagName.toLowerCase(),g=["a"],h=0,i=g.length;i>h;h++)if(f===g[h])return"pointer";return d},d=function(a){if(p.prototype._singleton){a||(a=window.event);var b;this!==window?b=this:a.target?b=a.target:a.srcElement&&(b=a.srcElement),p.prototype._singleton.setCurrent(b)}},e=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},f=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c)},g=function(a,b){if(a.addClass)return a.addClass(b),a;if(b&&"string"==typeof b){var c=(b||"").split(/\s+/);if(1===a.nodeType)if(a.className){for(var d=" "+a.className+" ",e=a.className,f=0,g=c.length;g>f;f++)d.indexOf(" "+c[f]+" ")<0&&(e+=" "+c[f]);a.className=e.replace(/^\s+|\s+$/g,"")}else a.className=b}return a},h=function(a,b){if(a.removeClass)return a.removeClass(b),a;if(b&&"string"==typeof b||void 0===b){var c=(b||"").split(/\s+/);if(1===a.nodeType&&a.className)if(b){for(var d=(" "+a.className+" ").replace(/[\n\t]/g," "),e=0,f=c.length;f>e;e++)d=d.replace(" "+c[e]+" "," ");a.className=d.replace(/^\s+|\s+$/g,"")}else a.className=""}return a},i=function(){var a,b,c,d=1;return"function"==typeof document.body.getBoundingClientRect&&(a=document.body.getBoundingClientRect(),b=a.right-a.left,c=document.body.offsetWidth,d=Math.round(100*(b/c))/100),d},j=function(a){var b={left:0,top:0,width:0,height:0,zIndex:999999999},d=c(a,"z-index");if(d&&"auto"!==d&&(b.zIndex=parseInt(d,10)),a.getBoundingClientRect){var e,f,g,h=a.getBoundingClientRect();"pageXOffset"in window&&"pageYOffset"in window?(e=window.pageXOffset,f=window.pageYOffset):(g=i(),e=Math.round(document.documentElement.scrollLeft/g),f=Math.round(document.documentElement.scrollTop/g));var j=document.documentElement.clientLeft||0,k=document.documentElement.clientTop||0;b.left=h.left+e-j,b.top=h.top+f-k,b.width="width"in h?h.width:h.right-h.left,b.height="height"in h?h.height:h.bottom-h.top}return b},k=function(a,b){var c=!(b&&b.useNoCache===!1);return c?(-1===a.indexOf("?")?"?":"&")+"nocache="+(new Date).getTime():""},l=function(a){var b=[],c=[];return a.trustedOrigins&&("string"==typeof a.trustedOrigins?c=c.push(a.trustedOrigins):"object"==typeof a.trustedOrigins&&"length"in a.trustedOrigins&&(c=c.concat(a.trustedOrigins))),a.trustedDomains&&("string"==typeof a.trustedDomains?c=c.push(a.trustedDomains):"object"==typeof a.trustedDomains&&"length"in a.trustedDomains&&(c=c.concat(a.trustedDomains))),c.length&&b.push("trustedOrigins="+encodeURIComponent(c.join(","))),"string"==typeof a.amdModuleId&&a.amdModuleId&&b.push("amdModuleId="+encodeURIComponent(a.amdModuleId)),"string"==typeof a.cjsModuleId&&a.cjsModuleId&&b.push("cjsModuleId="+encodeURIComponent(a.cjsModuleId)),b.join("&")},m=function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;d>c;c++)if(b[c]===a)return c;return-1},n=function(a){if("string"==typeof a)throw new TypeError("ZeroClipboard doesn't accept query strings.");return a.length?a:[a]},o=function(a,b,c,d,e){e?window.setTimeout(function(){a.call(b,c,d)},0):a.call(b,c,d)},p=function(a,b){if(a&&(p.prototype._singleton||this).glue(a),p.prototype._singleton)return p.prototype._singleton;p.prototype._singleton=this,this.options={};for(var c in s)this.options[c]=s[c];for(var d in b)this.options[d]=b[d];this.handlers={},p.detectFlashSupport()&&v()},q=[];p.prototype.setCurrent=function(b){a=b,this.reposition();var d=b.getAttribute("title");d&&this.setTitle(d);var e=this.options.forceHandCursor===!0||"pointer"===c(b,"cursor");r.call(this,e)},p.prototype.setText=function(a){a&&""!==a&&(this.options.text=a,this.ready()&&this.flashBridge.setText(a))},p.prototype.setTitle=function(a){a&&""!==a&&this.htmlBridge.setAttribute("title",a)},p.prototype.setSize=function(a,b){this.ready()&&this.flashBridge.setSize(a,b)},p.prototype.setHandCursor=function(a){a="boolean"==typeof a?a:!!a,r.call(this,a),this.options.forceHandCursor=a};var r=function(a){this.ready()&&this.flashBridge.setHandCursor(a)};p.version="1.2.0-beta.4";var s={moviePath:"ZeroClipboard.swf",trustedOrigins:null,text:null,hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",allowScriptAccess:"sameDomain",useNoCache:!0,forceHandCursor:!1};p.setDefaults=function(a){for(var b in a)s[b]=a[b]},p.destroy=function(){p.prototype._singleton.unglue(q);var a=p.prototype._singleton.htmlBridge;a.parentNode.removeChild(a),delete p.prototype._singleton},p.detectFlashSupport=function(){var a=!1;if("function"==typeof ActiveXObject)try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(a=!0)}catch(b){}return!a&&navigator.mimeTypes["application/x-shockwave-flaLine truncated
|
||||
@@ -1,2 +1,2 @@
|
||||
(function(factory){factory(jQuery)})(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{s=decodeURIComponent(s.replace(pluses," "));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setTime(+t+days*864e5)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split("; "):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split("=");var name=decode(parts.shift());var cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie}}return result};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false}$.cookie(key,"",$.extend({},options,{expires:-1}));return!$.cookie(key)}});if(typeof jQuery==="undefined"){throw new Error("Bootstrap requires jQuery")}+function($){"use strict";function transitionEnd(){var el=document.createElement("bootstrap");var transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}}$.fn.emulateTransitionEnd=function(duration){var called=false,$el=this;$(this).one($.support.transition.end,function(){called=true});var callback=function(){if(!called)$($el).trigger($.support.transition.end)};setTimeout(callback,duration);return this};$(function(){$.support.transition=transitionEnd()})}(jQuery);+function($){"use strict";var dismiss='[data-dismiss="alert"]';var Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){var $this=$(this);var selector=$this.attr("data-target");if(!selector){selector=$this.attr("href");selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")}var $parent=$(selector);if(e)e.preventDefault();if(!$parent.length){$parent=$this.hasClass("alert")?$this:$this.parent()}$parent.trigger(e=$.Event("close.bs.alert"));if(e.isDefaultPrevented())return;$parent.removeClass("in");function removeElement(){$parent.trigger("closed.bs.alert").remove()}$.support.transition&&$parent.hasClass("fade")?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement()};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.alert");if(!data)$this.data("bs.alert",data=new Alert(this));if(typeof option=="string")data[option].call($this)})};$.fn.alert.Constructor=Alert;$.fn.alert.noConflict=function(){$.fn.alert=old;return this};$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(jQuery);+function($){"use strict";var Button=function(element,options){this.$element=$(element);this.options=$.extend({},Button.DEFAULTS,options)};Button.DEFAULTS={loadingText:"loading..."};Button.prototype.setState=function(state){var d="disabled";var $el=this.$element;var val=$el.is("input")?"val":"html";var data=$el.data();state=state+"Text";if(!data.resetText)$el.data("resetText",$el[val]());$el[val](data[state]||this.options[state]);setTimeout(function(){state=="loadingText"?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)};Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons"]');if($parent.length){var $input=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");if($input.prop("type")==="radio")$parent.find(".active").removeClass("active")}this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.button");var options=typeof option=="object"&&option;if(!data)$this.data("bs.button",data=new Button(this,options));if(option=="toggle")data.toggle();else if(option)data.setState(option)})};$.fn.button.Constructor=Button;$.fn.button.noConflict=function(){$.fn.button=old;return this};$(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);if(!$btn.hasClass("btn"))$btn=$btn.closest(".btn");$btn.button("toLine truncated
|
||||
})};$.fn.tab.Constructor=Tab;$.fn.tab.noConflict=function(){$.fn.tab=old;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault();$(this).tab("show")})}(jQuery);+function($){"use strict";var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options);this.$window=$(window).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this));this.$element=$(element);this.affixed=this.unpin=null;this.checkPosition()};Affix.RESET="affix affix-top affix-bottom";Affix.DEFAULTS={offset:0};Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)};Affix.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var scrollHeight=$(document).height();var scrollTop=this.$window.scrollTop();var position=this.$element.offset();var offset=this.options.offset;var offsetTop=offset.top;var offsetBottom=offset.bottom;if(typeof offset!="object")offsetBottom=offsetTop=offset;if(typeof offsetTop=="function")offsetTop=offset.top();if(typeof offsetBottom=="function")offsetBottom=offset.bottom();var affix=this.unpin!=null&&scrollTop+this.unpin<=position.top?false:offsetBottom!=null&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":offsetTop!=null&&scrollTop<=offsetTop?"top":false;if(this.affixed===affix)return;if(this.unpin)this.$element.css("top","");this.affixed=affix;this.unpin=affix=="bottom"?position.top-scrollTop:null;this.$element.removeClass(Affix.RESET).addClass("affix"+(affix?"-"+affix:""));if(affix=="bottom"){this.$element.offset({top:document.body.offsetHeight-offsetBottom-this.$element.height()})}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.affix");var options=typeof option=="object"&&option;if(!data)$this.data("bs.affix",data=new Affix(this,options));if(typeof option=="string")data[option]()})};$.fn.affix.Constructor=Affix;$.fn.affix.noConflict=function(){$.fn.affix=old;return this};$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this);var data=$spy.data();data.offset=data.offset||{};if(data.offsetBottom)data.offset.bottom=data.offsetBottom;if(data.offsetTop)data.offset.top=data.offsetTop;$spy.affix(data)})})}(jQuery);var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};var Mobile={};var Converter;var MarkdownEditor;var ScrollLink;function trimLeft(str,substr){if(!substr||substr==" "){return $.trim(str)}while(str.indexOf(substr)==0){str=str.substring(substr.length)}return str}function json(str){return eval("("+str+")")}function t(){var args=arguments;if(args.length<=1){return args[0]}var text=args[0];if(!text){return text}var pattern="LEAAEL";text=text.replace(/\?/g,pattern);for(var i=1;i<=args.length;++i){text=text.replace(pattern,args[i])}return text}var tt=t;function arrayEqual(a,b){a=a||[];b=b||[];return a.join(",")==b.join(",")}function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function isEmpty(obj){if(!obj){return true}if(isArray(obj)){if(obj.length==0){return true}}return false}function getFormJsonData(formId){var data=formArrDataToJson($("#"+formId).serializeArray());return data}function formArrDataToJson(arrData){var datas={};var arrObj={};for(var i in arrData){var attr=arrData[i].name;var value=arrData[i].value;if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function formSerializeDataToJson(formSerializeData){var arr=formSerializeData.split("&");var datas={};var arrObj={};for(var i=0;i<arr.length;++i){var each=arr[i].split("=");var attr=decodeURI(each[0]);var value=decodeURI(each[1]);if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function _ajaxCallback(ret,successFunc,failureFunc){if(ret===true||ret=="true"||typeof ret=="object"){if(ret&&typeof ret=="object"){if(ret.Msg=="NOTLOGIN"){alert("你还没有登录, 请先登录!");return}}if(typeof successFunc=="function"){successFunc(ret)}}else{if(typeof failureFunc=="function"){failureFunc(ret)}else{alert("error!")}}}function _ajax(type,url,param,successFunc,failureFunc,async){log("-------------------ajax:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}return $.ajax({type:type,url:url,data:param,async:async,success:function(ret){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function ajaxGet(url,param,successFunc,failureFunc,async){return _ajax("GET",url,param,successFunc,failureFunc,async)}functioLine truncated
|
||||
})};$.fn.tab.Constructor=Tab;$.fn.tab.noConflict=function(){$.fn.tab=old;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault();$(this).tab("show")})}(jQuery);+function($){"use strict";var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options);this.$window=$(window).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this));this.$element=$(element);this.affixed=this.unpin=null;this.checkPosition()};Affix.RESET="affix affix-top affix-bottom";Affix.DEFAULTS={offset:0};Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)};Affix.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var scrollHeight=$(document).height();var scrollTop=this.$window.scrollTop();var position=this.$element.offset();var offset=this.options.offset;var offsetTop=offset.top;var offsetBottom=offset.bottom;if(typeof offset!="object")offsetBottom=offsetTop=offset;if(typeof offsetTop=="function")offsetTop=offset.top();if(typeof offsetBottom=="function")offsetBottom=offset.bottom();var affix=this.unpin!=null&&scrollTop+this.unpin<=position.top?false:offsetBottom!=null&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":offsetTop!=null&&scrollTop<=offsetTop?"top":false;if(this.affixed===affix)return;if(this.unpin)this.$element.css("top","");this.affixed=affix;this.unpin=affix=="bottom"?position.top-scrollTop:null;this.$element.removeClass(Affix.RESET).addClass("affix"+(affix?"-"+affix:""));if(affix=="bottom"){this.$element.offset({top:document.body.offsetHeight-offsetBottom-this.$element.height()})}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.affix");var options=typeof option=="object"&&option;if(!data)$this.data("bs.affix",data=new Affix(this,options));if(typeof option=="string")data[option]()})};$.fn.affix.Constructor=Affix;$.fn.affix.noConflict=function(){$.fn.affix=old;return this};$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this);var data=$spy.data();data.offset=data.offset||{};if(data.offsetBottom)data.offset.bottom=data.offsetBottom;if(data.offsetTop)data.offset.top=data.offsetTop;$spy.affix(data)})})}(jQuery);var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};var Mobile={};var LeaAce={};var Converter;var MarkdownEditor;var ScrollLink;var MD;function trimLeft(str,substr){if(!substr||substr==" "){return $.trim(str)}while(str.indexOf(substr)==0){str=str.substring(substr.length)}return str}function json(str){return eval("("+str+")")}function t(){var args=arguments;if(args.length<=1){return args[0]}var text=args[0];if(!text){return text}var pattern="LEAAEL";text=text.replace(/\?/g,pattern);for(var i=1;i<=args.length;++i){text=text.replace(pattern,args[i])}return text}var tt=t;function arrayEqual(a,b){a=a||[];b=b||[];return a.join(",")==b.join(",")}function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function isEmpty(obj){if(!obj){return true}if(isArray(obj)){if(obj.length==0){return true}}return false}function getFormJsonData(formId){var data=formArrDataToJson($("#"+formId).serializeArray());return data}function formArrDataToJson(arrData){var datas={};var arrObj={};for(var i in arrData){var attr=arrData[i].name;var value=arrData[i].value;if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function formSerializeDataToJson(formSerializeData){var arr=formSerializeData.split("&");var datas={};var arrObj={};for(var i=0;i<arr.length;++i){var each=arr[i].split("=");var attr=decodeURI(each[0]);var value=decodeURI(each[1]);if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function _ajaxCallback(ret,successFunc,failureFunc){if(ret===true||ret=="true"||typeof ret=="object"){if(ret&&typeof ret=="object"){if(ret.Msg=="NOTLOGIN"){alert("你还没有登录, 请先登录!");return}}if(typeof successFunc=="function"){successFunc(ret)}}else{if(typeof failureFunc=="function"){failureFunc(ret)}else{alert("error!")}}}function _ajax(type,url,param,successFunc,failureFunc,async){log("-------------------ajax:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}return $.ajax({type:type,url:url,data:param,async:async,success:function(ret){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function ajaxGet(url,param,successFunc,failureFunc,async){return _ajax("GET",url,param,successFunc,failuLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
var urlPrefix=UrlPrefix;define("attachment_upload",["jquery.ui.widget","fileupload"],function(){function formatFileSize(bytes){if(typeof bytes!=="number"){return""}if(bytes>=1e9){return(bytes/1e9).toFixed(2)+" GB"}if(bytes>=1e6){return(bytes/1e6).toFixed(2)+" MB"}return(bytes/1e3).toFixed(2)+" KB"}function setDropStyle(dropzoneId,formId){var dropZone=$(dropzoneId);$(formId).bind("dragover",function(e){e.preventDefault();var timeout=window.dropZoneTimeoutAttach;if(timeout){clearTimeout(timeout)}var found=false,node=e.target;do{if(node===dropZone[0]){found=true;break}node=node.parentNode}while(node!=null);if(found){dropZone.addClass("hover")}else{dropZone.removeClass("hover")}window.dropZoneTimeoutAttach=setTimeout(function(){window.dropZoneTimeoutAttach=null;dropZone.removeClass("in hover")},100)})}setDropStyle("#dropAttach","#uploadAttach");setDropStyle("#dropAvatar","#uploadAvatar");var initUploader=function(){$(".dropzone .btn-choose-file").click(function(){$(this).parent().find("input").click()});var $msg=$("#attachUploadMsg");$("#uploadAttach").fileupload({dataType:"json",pasteZone:"",dropZone:$("#dropAttach"),formData:function(form){return[{name:"noteId",value:Note.curNoteId}]},add:function(e,data){var note=Note.getCurNote();if(!note||note.IsNew){alert("This note hasn't saved, please save it firstly!");return}var tpl=$('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');tpl.append(data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small>");$msg.html(tpl);data.context=$msg;var size=data.files[0].size;var maxFileSize=+GlobalConfigs["uploadAttachSize"]||100;if(typeof size=="number"&&size>1024*1024*maxFileSize){tpl.find("img").remove();tpl.removeClass("alert-info").addClass("alert-danger");tpl.append(" Warning: File size is bigger than "+maxFileSize+"M");setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3);return}var jqXHR;setTimeout(function(){jqXHR=data.submit()},10)},done:function(e,data){if(data.result.Ok==true){data.context.html("");Attach.addAttach(data.result.Item)}else{var re=data.result;data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.result.Msg);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3)}$("#uploadAttachMsg").scrollTop(1e3)},fail:function(e,data){data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.errorThrown);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3);$("#uploadAttachMsg").scrollTop(1e3)}});var $msg2=$("#avatarUploadMsg");$("#uploadAvatar").fileupload({dataType:"json",dropZone:$("#dropAvatar"),pasteZone:"",add:function(e,data){var tpl=$('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');tpl.append(data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small>");$msg2.html(tpl);data.context=$msg2;var size=data.files[0].size;var maxFileSize=+GlobalConfigs["uploadAvatarSize"]||100;if(typeof size=="number"&&size>1024*1024*maxFileSize){tpl.find("img").remove();tpl.removeClass("alert-info").addClass("alert-danger");tpl.append(" Warning: File size is bigger than "+maxFileSize+"M");setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3);return}var jqXHR;setTimeout(function(){jqXHR=data.submit()},10)},done:function(e,data){if(data.result.Ok==true){data.context.html("");var re=data.result;$("#avatar").attr("src",UrlPrefix+"/"+re.Id)}else{var re=data.result;data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.result.Msg);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3)}},fail:function(e,data){data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.errorThrown);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3)}})};initUploader()});
|
||||
@@ -54,11 +54,12 @@ define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
$('.dropzone .btn-choose-file').click(function() {
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
|
||||
var $msg = $('#attachUploadMsg');
|
||||
// Initialize the jQuery File Upload plugin
|
||||
$('#uploadAttach').fileupload({
|
||||
dataType: 'json',
|
||||
pasteZone: '', // 不能通过paste来上传图片
|
||||
// This element will accept file drag/drop uploading
|
||||
dropZone: $('#dropAttach'),
|
||||
formData: function(form) {
|
||||
@@ -72,6 +73,7 @@ define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
alert("This note hasn't saved, please save it firstly!")
|
||||
return;
|
||||
}
|
||||
|
||||
var tpl = $('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');
|
||||
|
||||
// Append the file name and file size
|
||||
@@ -140,11 +142,13 @@ define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
});
|
||||
|
||||
//-------------------
|
||||
// 已经过时, 没有avatar了
|
||||
|
||||
var $msg2 = $('#avatarUploadMsg');
|
||||
$('#uploadAvatar').fileupload({
|
||||
dataType: 'json',
|
||||
dropZone: $('#dropAvatar'),
|
||||
pasteZone: '',
|
||||
add: function(e, data) {
|
||||
var tpl = $('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');
|
||||
|
||||
@@ -206,7 +210,7 @@ define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
})(tpl), 3000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
initUploader();
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
var urlPrefix=UrlPrefix;define("editor_drop_paste",["jquery.ui.widget","fileupload"],function(){function Process(editor){var id="__mcenew"+(new Date).getTime();var str='<div contenteditable="false" id="'+id+'" class="leanote-image-container">'+'<img class="loader" src="/images/ajax-loader.gif">'+'<div class="progress">'+'<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">'+"0%"+"</div>"+"</div>"+"</div>";this.containerStr=str;editor.insertContent(str);var container=$("#"+id);this.container=container;this.id=id;this.processBar=container.find(".progress-bar")}Process.prototype.update=function(process){var me=this;process=Math.ceil(process*100);if(process>=100){process=99}process+="%";$("#"+me.id+" .progress-bar").html(process).css("width",process)};Process.prototype.replace=function(src){var me=this;getImageSize(src,function(){$("#"+me.id).replaceWith('<img src="'+src+'" />')})};Process.prototype.remove=function(){var me=this;$("#"+me.id).remove()};function getImageSize(url,callback){var img=document.createElement("img");function done(width,height){img.parentNode.removeChild(img);callback({width:width,height:height})}img.onload=function(){done(img.clientWidth,img.clientHeight)};img.onerror=function(){done()};img.src=url;var style=img.style;style.visibility="hidden";style.position="fixed";style.bottom=style.left=0;style.width=style.height="auto";document.body.appendChild(img)}var i=1;function insertImage(data){var editor=tinymce.activeEditor;var dom=editor.dom;var renderImage=function(data2){var d={};var imgElm;d.id="__mcenew"+i++;d.src="http://leanote.com/images/loading-24.gif";imgElm=dom.createHTML("img",d);tinymce.activeEditor.insertContent(imgElm);imgElm=dom.get(d.id);function callback(wh){dom.setAttrib(imgElm,"src",data2.src);if(data2.title){dom.setAttrib(imgElm,"title",data2.title)}dom.setAttrib(imgElm,"id",null)}getImageSize(data.src,callback)};var fileId="";fileIds=data.src.split("fileId=");if(fileIds.length==2&&fileIds[1].length=="53aecf8a8a039a43c8036282".length){fileId=fileIds[1]}if(fileId){var curNote=Note.getCurNote();if(curNote&&curNote.UserId!=UserInfo.UserId){(function(data){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:fileId,toUserId:curNote.UserId},function(re){if(reIsOk(re)&&re.Id){var urlPrefix=window.location.protocol+"//"+window.location.host;data.src=urlPrefix+"/file/outputImage?fileId="+re.Id}renderImage(data)})})(data)}else{renderImage(data)}}else{renderImage(data)}}var initUploader=function(){var ul=$("#upload ul");$("#drop a").click(function(){$(this).parent().find("input").click()});$("#upload").fileupload({dataType:"json",pasteZone:"",acceptFileTypes:/(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,maxFileSize:21e4,dropZone:$("#drop"),formData:function(form){return[{name:"albumId",value:""}]},add:function(e,data){var tpl=$('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');tpl.find("div").append(data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small>");data.context=tpl.appendTo(ul);var jqXHR=data.submit()},done:function(e,data){if(data.result.Ok==true){data.context.remove();var data2={src:urlPrefix+"/file/outputImage?fileId="+data.result.Id};insertImage(data2)}else{data.context.empty();var tpl=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');tpl.find("div").append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.result.Msg);data.context.append(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(e,data){data.context.empty();var tpl=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');tpl.find("div").append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.errorThrown);data.context.append(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),2e3);$("#uploadMsg").scrollTop(1e3)}});$(document).on("drop dragover",function(e){e.preventDefault()});function formatFileSize(bytes){if(typeof bytes!=="number"){return""}if(bytes>=1e9){return(bytes/1e9).toFixed(2)+" GB"}if(bytes>=1e6){return(bytes/1e6).toFixed(2)+" MB"}return(bytes/1e3).toFixed(2)+" KB"}function showUpload(){$("#upload").css("z-index",12);var top=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",top-8);$("#upload").show()}function hideUpload(){$("#upload").css("z-index",0).css("top","auto").hide()}$(document).bind("dragover",function(e){var dropZone=$("#drop"),timeout=window.dropZoneTimeout;if(!timeout){dropZone.addClass("in");showUpload()}else{clearTimeout(timeout)}var found=false,node=e.target;do{if(node===dropZone[0]){found=true;break}node=node.parentNode}while(noLine truncated
|
||||
@@ -0,0 +1,375 @@
|
||||
// for editor.
|
||||
// drag image to editor
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
define('editor_drop_paste', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
function Process(editor) {
|
||||
var id = '__mcenew' + (new Date()).getTime();
|
||||
var str = '<div contenteditable="false" id="' + id + '" class="leanote-image-container">' +
|
||||
'<img class="loader" src="/images/ajax-loader.gif">' +
|
||||
'<div class="progress">' +
|
||||
'<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">' +
|
||||
'0%' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
this.containerStr = str;
|
||||
editor.insertContent(str);
|
||||
var container = $('#' + id);
|
||||
this.container = container;
|
||||
this.id = id;
|
||||
this.processBar = container.find('.progress-bar');
|
||||
}
|
||||
Process.prototype.update = function(process) {
|
||||
var me = this;
|
||||
// 98%, 不要小数
|
||||
process = Math.ceil(process * 100);
|
||||
if(process >= 100) {
|
||||
process = 99;
|
||||
}
|
||||
process += "%";
|
||||
$('#' + me.id + ' .progress-bar').html(process).css('width', process);
|
||||
}
|
||||
Process.prototype.replace = function(src) {
|
||||
var me = this;
|
||||
getImageSize(src, function() {
|
||||
$('#' + me.id).replaceWith('<img src="' + src + '" />');
|
||||
});
|
||||
}
|
||||
Process.prototype.remove = function() {
|
||||
var me = this;
|
||||
$('#' + me.id).remove();
|
||||
}
|
||||
|
||||
// 当url改变时, 得到图片的大小
|
||||
function getImageSize(url, callback) {
|
||||
var img = document.createElement('img');
|
||||
|
||||
function done(width, height) {
|
||||
img.parentNode.removeChild(img);
|
||||
callback({width: width, height: height});
|
||||
}
|
||||
|
||||
img.onload = function() {
|
||||
done(img.clientWidth, img.clientHeight);
|
||||
};
|
||||
|
||||
img.onerror = function() {
|
||||
done();
|
||||
};
|
||||
|
||||
img.src = url;
|
||||
|
||||
var style = img.style;
|
||||
style.visibility = 'hidden';
|
||||
style.position = 'fixed';
|
||||
style.bottom = style.left = 0;
|
||||
style.width = style.height = 'auto';
|
||||
|
||||
document.body.appendChild(img);
|
||||
}
|
||||
|
||||
var i = 1;
|
||||
function insertImage(data) {
|
||||
var editor = tinymce.activeEditor;
|
||||
var dom = editor.dom;
|
||||
|
||||
var renderImage = function(data2) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
var d = {};
|
||||
var imgElm;
|
||||
// 先显示loading...
|
||||
d.id = '__mcenew' + (i++);
|
||||
d.src = "http://leanote.com/images/loading-24.gif";
|
||||
imgElm = dom.createHTML('img', d);
|
||||
tinymce.activeEditor.insertContent(imgElm);
|
||||
imgElm = dom.get(d.id);
|
||||
|
||||
function callback (wh) {
|
||||
dom.setAttrib(imgElm, 'src', data2.src);
|
||||
// dom.setAttrib(imgElm, 'width', data2.width);
|
||||
if(data2.title) {
|
||||
dom.setAttrib(imgElm, 'title', data2.title);
|
||||
}
|
||||
|
||||
dom.setAttrib(imgElm, 'id', null);
|
||||
};
|
||||
getImageSize(data.src, callback);
|
||||
}
|
||||
|
||||
//-------------
|
||||
// outputImage?fileId=123232323
|
||||
var fileId = "";
|
||||
fileIds = data.src.split("fileId=")
|
||||
if(fileIds.length == 2 && fileIds[1].length == "53aecf8a8a039a43c8036282".length) {
|
||||
fileId = fileIds[1];
|
||||
}
|
||||
if(fileId) {
|
||||
// 得到fileId, 如果这个笔记不是我的, 那么肯定是协作的笔记, 那么需要将图片copy给原note owner
|
||||
var curNote = Note.getCurNote();
|
||||
if(curNote && curNote.UserId != UserInfo.UserId) {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
if(reIsOk(re) && re.Id) {
|
||||
var urlPrefix = window.location.protocol + "//" + window.location.host;
|
||||
data.src = urlPrefix + "/file/outputImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
})(data);
|
||||
} else {
|
||||
renderImage(data);
|
||||
}
|
||||
} else {
|
||||
renderImage(data);
|
||||
}
|
||||
}
|
||||
|
||||
var initUploader = function() {
|
||||
var ul = $('#upload ul');
|
||||
|
||||
$('#drop a').click(function() {
|
||||
// trigger to show file select
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
// Initialize the jQuery File Upload plugin
|
||||
$('#upload').fileupload({
|
||||
dataType: 'json',
|
||||
pasteZone: '', // 不允许paste
|
||||
acceptFileTypes: /(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,
|
||||
maxFileSize: 210000,
|
||||
|
||||
// This element will accept file drag/drop uploading
|
||||
dropZone: $('#drop'),
|
||||
formData: function(form) {
|
||||
return [{name: 'albumId', value: ""}]
|
||||
},
|
||||
// This function is called when a file is added to the queue;
|
||||
// either via the browse button, or via drag/drop:
|
||||
add: function(e, data) {
|
||||
var tpl = $('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
|
||||
// Append the file name and file size
|
||||
tpl.find('div').append(data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small>');
|
||||
|
||||
// Add the HTML to the UL element
|
||||
data.context = tpl.appendTo(ul);
|
||||
|
||||
// data.form[0].action += "&album_id=" + $("#albumsForUpload").val();
|
||||
|
||||
// Automatically upload the file once it is added to the queue
|
||||
var jqXHR = data.submit();
|
||||
},
|
||||
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
data.context.remove();
|
||||
// life
|
||||
var data2 = {src: urlPrefix + "/file/outputImage?fileId=" + data.result.Id}
|
||||
insertImage(data2);
|
||||
} else {
|
||||
data.context.empty();
|
||||
var tpl = $('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
tpl.find('div').append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.result.Msg);
|
||||
data.context.append(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 2000);
|
||||
}
|
||||
$("#uploadMsg").scrollTop(1000);
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.context.empty();
|
||||
var tpl = $('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
tpl.find('div').append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.errorThrown);
|
||||
data.context.append(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 2000);
|
||||
|
||||
$("#uploadMsg").scrollTop(1000);
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent the default action when a file is dropped on the window
|
||||
$(document).on('drop dragover', function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Helper function that formats the file sizes
|
||||
function formatFileSize(bytes) {
|
||||
if (typeof bytes !== 'number') {
|
||||
return '';
|
||||
}
|
||||
if (bytes >= 1000000000) {
|
||||
return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
}
|
||||
if (bytes >= 1000000) {
|
||||
return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
}
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
}
|
||||
|
||||
function showUpload() {
|
||||
$("#upload").css("z-index", 12);
|
||||
var top = +$("#mceToolbar").css("height").slice(0, -2); // px
|
||||
$("#upload").css("top", top - 8);
|
||||
$("#upload").show();
|
||||
}
|
||||
|
||||
function hideUpload() {
|
||||
$("#upload").css("z-index", 0).css("top", "auto").hide();
|
||||
}
|
||||
|
||||
// drag css
|
||||
$(document).bind('dragover', function (e) {
|
||||
var dropZone = $('#drop'),
|
||||
timeout = window.dropZoneTimeout;
|
||||
if (!timeout) {
|
||||
dropZone.addClass('in');
|
||||
showUpload();
|
||||
} else {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
var found = false,
|
||||
node = e.target;
|
||||
do {
|
||||
if (node === dropZone[0]) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
node = node.parentNode;
|
||||
} while (node != null);
|
||||
if (found) {
|
||||
dropZone.addClass('hover');
|
||||
} else {
|
||||
dropZone.removeClass('hover');
|
||||
}
|
||||
window.dropZoneTimeout = setTimeout(function () {
|
||||
window.dropZoneTimeout = null;
|
||||
dropZone.removeClass('in hover');
|
||||
hideUpload();
|
||||
}, 100);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// pasteImage
|
||||
var pasteImageInit = function() {
|
||||
// Initialize the jQuery File Upload plugin
|
||||
var dom, editor;
|
||||
$('#editorContent').fileupload({
|
||||
dataType: 'json',
|
||||
pasteZone: $('#editorContent'),
|
||||
dropZone: '', // 只允许paste
|
||||
maxFileSize: 210000,
|
||||
url: "/file/pasteImage",
|
||||
paramName: 'file',
|
||||
formData: function(form) {
|
||||
return [{name: 'from', value: 'pasteImage'}, {name: 'noteId', value: Note.curNoteId}]
|
||||
},
|
||||
/*
|
||||
paste: function(e, data) {
|
||||
var jqXHR = data.submit();
|
||||
},
|
||||
*/
|
||||
progress: function(e, data) {
|
||||
data.process.update(data.loaded / data.total);
|
||||
},
|
||||
add: function(e, data) {
|
||||
var note = Note.getCurNote();
|
||||
if(!note || note.IsNew) {
|
||||
alert("This note hasn't saved, please save it firstly!")
|
||||
return;
|
||||
}
|
||||
// 先显示loading...
|
||||
editor = tinymce.EditorManager.activeEditor;
|
||||
var process = new Process(editor);
|
||||
data.process = process;
|
||||
var jqXHR = data.submit();
|
||||
/*
|
||||
d.id = '__mcenew' + (new Date()).getTime();
|
||||
d.src = "http://leanote.com/images/loading-24.gif"; // 写死了
|
||||
var img = '<img src="' + d.src + '" id="' + d.id + '" />';
|
||||
editor.insertContent(img);
|
||||
var imgElm = $(d.id);
|
||||
data.imgId = d.id;
|
||||
data.context = imgElm;
|
||||
*/
|
||||
|
||||
/*
|
||||
// 上传之
|
||||
var c = new FormData;
|
||||
c.append("from", "pasteImage");
|
||||
// var d;
|
||||
// d = $.ajaxSettings.xhr();
|
||||
// d.withCredentials = i;var d = {};
|
||||
|
||||
// 先显示loading...
|
||||
var editor = tinymce.EditorManager.activeEditor;
|
||||
var dom = editor.dom;
|
||||
var d = {};
|
||||
d.id = '__mcenew';
|
||||
d.src = "http://leanote.com/images/loading-24.gif"; // 写死了
|
||||
editor.insertContent(dom.createHTML('img', d));
|
||||
var imgElm = dom.get('__mcenew');
|
||||
$.ajax({url: "/file/pasteImage", contentType:false, processData:false , data: c, type: "POST"}
|
||||
).done(function(re) {
|
||||
if(!re || typeof re != "object" || !re.Ok) {
|
||||
// 删除
|
||||
dom.remove(imgElm);
|
||||
return;
|
||||
}
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
var src = urlPrefix + "/file/outputImage?fileId=" + re.Id;
|
||||
getImageSize(src, function(wh) {
|
||||
// life 4/25
|
||||
if(wh && wh.width) {
|
||||
if(wh.width > 600) {
|
||||
wh.width = 600;
|
||||
}
|
||||
d.width = wh.width;
|
||||
dom.setAttrib(imgElm, 'width', d.width);
|
||||
}
|
||||
dom.setAttrib(imgElm, 'src', src);
|
||||
});
|
||||
dom.setAttrib(imgElm, 'id', null);
|
||||
});
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
*/
|
||||
},
|
||||
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
var re = data.result;
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
var src = urlPrefix + "/file/outputImage?fileId=" + re.Id;
|
||||
|
||||
data.process.replace(src);
|
||||
/*
|
||||
getImageSize(src, function() {
|
||||
$img.attr('src', src);
|
||||
$img.removeAttr('id');
|
||||
});
|
||||
*/
|
||||
} else {
|
||||
data.process.remove();
|
||||
}
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.process.remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
initUploader();
|
||||
pasteImageInit();
|
||||
});
|
||||
@@ -1 +1 @@
|
||||
Note.curNoteId="";Note.interval="";Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>';Note.itemTplNoImg='<li href="#" class="item ?" noteId="?">';Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>';Note.itemTpl='<li href="#" class="item ? item-image" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>';Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>';Note.newItemTpl='<li href="#" class="item item-active ?" fromUserId="?" noteId="?">';Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>';Note.noteItemListO=$("#noteItemList");Note.cacheByNotebookId={all:{}};Note.notebookIds={};Note.isReadOnly=false;Note.intervalTime=6e5;Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始...");changedNote=Note.curChangedSaveIt(false)},Note.intervalTime)};Note.stopInterval=function(){clearInterval(Note.interval);setTimeout(function(){Note.startInterval()},Note.intervalTime)};Note.addNoteCache=function(note){Note.cache[note.NoteId]=note;Note.clearCacheByNotebookId(note.NotebookId)};Note.setNoteCache=function(content,clear){if(!Note.cache[content.NoteId]){Note.cache[content.NoteId]=content}else{$.extend(Note.cache[content.NoteId],content)}if(clear==undefined){clear=true}if(clear){Note.clearCacheByNotebookId(content.NotebookId)}};Note.getCurNote=function(){var self=this;if(self.curNoteId==""){return null}return self.cache[self.curNoteId]};Note.getNote=function(noteId){var self=this;return self.cache[noteId]};Note.clearCacheByNotebookId=function(notebookId){if(notebookId){Note.cacheByNotebookId[notebookId]={};Note.cacheByNotebookId["all"]={};Note.notebookIds[notebookId]=true}};Note.notebookHasNotes=function(notebookId){var notes=Note.getNotesByNotebookId(notebookId);return!isEmpty(notes)};Note.getNotesByNotebookId=function(notebookId,sortBy,isAsc){if(!sortBy){sortBy="UpdatedTime"}if(isAsc=="undefined"){isAsc=false}if(!notebookId){notebookId="all"}if(!Note.cacheByNotebookId[notebookId]){return[]}if(Note.cacheByNotebookId[notebookId][sortBy]){return Note.cacheByNotebookId[notebookId][sortBy]}else{}var notes=[];var sortBys=[];for(var i in Note.cache){if(!i){continue}var note=Note.cache[i];if(note.IsTrash||note.IsShared){continue}if(notebookId=="all"||note.NotebookId==notebookId){notes.push(note)}}notes.sort(function(a,b){var t1=a[sortBy];var t2=b[sortBy];if(isAsc){if(t1<t2){return-1}else if(t1>t2){return 1}}else{if(t1<t2){return 1}else if(t1>t2){return-1}}return 0});Note.cacheByNotebookId[notebookId][sortBy]=notes;return notes};Note.renderNotesAndFirstOneContent=function(ret){if(!isArray(ret)){return}Note.renderNotes(ret);if(!isEmpty(ret[0])){Note.changeNoteForPjax(ret[0].NoteId,true,false)}else{}};Note.curHasChanged=function(force){if(force==undefined){force=true}var cacheNote=Note.cache[Note.curNoteId]||{};var title=$("#noteTitle").val();var tags=Tag.getTags();var contents=getEditorContent(cacheNote.IsMarkdown);var content,preview;var contentText;if(isArray(contents)){content=contents[0];preview=contents[1];contentText=content;if(content&&previewIsEmpty(preview)&&Converter){preview=Converter.makeHtml(content)}if(!content){preview=""}cacheNote.Preview=preview}else{content=contents;try{contentText=$(content).text()}catch(e){}}var hasChanged={hasChanged:false,IsNew:cacheNote.IsNew,IsMarkdown:cacheNote.IsMarkdown,FromUserId:cacheNote.FromUserId,NoteId:cacheNote.NoteId,NotebookId:cacheNote.NotebookId};if(hasChanged.IsNew){$.extend(hasChanged,cacheNote)}if(cacheNote.Title!=title){hasChanged.hasChanged=true;hasChanged.Title=title;if(!hasChanged.Title){}}if(!arrayEqual(cacheNote.Tags,tags)){hasChanged.hasChanged=true;hasChanged.Tags=tags}if(force&&cacheNote.Content!=content||!force&&$(cacheNote.Content).text()!=contentText){hasChanged.hasChanged=true;hasChanged.Content=content;var c=preview||content;if(!cacheNote.HasSelfDefined||!cacheNote.IsBlog){hasChanged.Desc=Note.genDesc(c);hasChanged.ImgSrc=Note.getImgSrc(c);hasChanged.Abstract=Note.genAbstract(c)}}else{log("text相同");log(cacheNote.Content==content)}hasChanged["UserId"]=cacheNote["UserId"]||"";return hasChanged};Note.genDesc=function(content){if(!content){return""}content=content.replace(/<br \/>/g," <br />");content=content.replace(/<Line truncated
|
||||
Note.curNoteId="";Note.interval="";Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>';Note.itemTplNoImg='<li href="#" class="item ?" noteId="?">';Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>';Note.itemTpl='<li href="#" class="item ? item-image" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>';Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>';Note.newItemTpl='<li href="#" class="item item-active ?" fromUserId="?" noteId="?">';Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>';Note.noteItemListO=$("#noteItemList");Note.cacheByNotebookId={all:{}};Note.notebookIds={};Note.isReadOnly=false;Note.intervalTime=6e5;Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始...");changedNote=Note.curChangedSaveIt(false)},Note.intervalTime)};Note.stopInterval=function(){clearInterval(Note.interval);setTimeout(function(){Note.startInterval()},Note.intervalTime)};Note.addNoteCache=function(note){Note.cache[note.NoteId]=note;Note.clearCacheByNotebookId(note.NotebookId)};Note.setNoteCache=function(content,clear){if(!Note.cache[content.NoteId]){Note.cache[content.NoteId]=content}else{$.extend(Note.cache[content.NoteId],content)}if(clear==undefined){clear=true}if(clear){Note.clearCacheByNotebookId(content.NotebookId)}};Note.getCurNote=function(){var self=this;if(self.curNoteId==""){return null}return self.cache[self.curNoteId]};Note.getNote=function(noteId){var self=this;return self.cache[noteId]};Note.clearCacheByNotebookId=function(notebookId){if(notebookId){Note.cacheByNotebookId[notebookId]={};Note.cacheByNotebookId["all"]={};Note.notebookIds[notebookId]=true}};Note.notebookHasNotes=function(notebookId){var notes=Note.getNotesByNotebookId(notebookId);return!isEmpty(notes)};Note.getNotesByNotebookId=function(notebookId,sortBy,isAsc){if(!sortBy){sortBy="UpdatedTime"}if(isAsc=="undefined"){isAsc=false}if(!notebookId){notebookId="all"}if(!Note.cacheByNotebookId[notebookId]){return[]}if(Note.cacheByNotebookId[notebookId][sortBy]){return Note.cacheByNotebookId[notebookId][sortBy]}else{}var notes=[];var sortBys=[];for(var i in Note.cache){if(!i){continue}var note=Note.cache[i];if(note.IsTrash||note.IsShared){continue}if(notebookId=="all"||note.NotebookId==notebookId){notes.push(note)}}notes.sort(function(a,b){var t1=a[sortBy];var t2=b[sortBy];if(isAsc){if(t1<t2){return-1}else if(t1>t2){return 1}}else{if(t1<t2){return 1}else if(t1>t2){return-1}}return 0});Note.cacheByNotebookId[notebookId][sortBy]=notes;return notes};Note.renderNotesAndFirstOneContent=function(ret){if(!isArray(ret)){return}Note.renderNotes(ret);if(!isEmpty(ret[0])){Note.changeNoteForPjax(ret[0].NoteId,true,false)}else{}};Note.curHasChanged=function(force){if(force==undefined){force=true}var cacheNote=Note.cache[Note.curNoteId]||{};var title=$("#noteTitle").val();var tags=Tag.getTags();var contents=getEditorContent(cacheNote.IsMarkdown);var content,preview;var contentText;if(isArray(contents)){content=contents[0];preview=contents[1];contentText=content;if(content&&previewIsEmpty(preview)&&Converter){preview=Converter.makeHtml(content)}if(!content){preview=""}cacheNote.Preview=preview}else{content=contents;try{contentText=$(content).text()}catch(e){}}var hasChanged={hasChanged:false,IsNew:cacheNote.IsNew,IsMarkdown:cacheNote.IsMarkdown,FromUserId:cacheNote.FromUserId,NoteId:cacheNote.NoteId,NotebookId:cacheNote.NotebookId};if(hasChanged.IsNew){$.extend(hasChanged,cacheNote)}if(cacheNote.Title!=title){hasChanged.hasChanged=true;hasChanged.Title=title;if(!hasChanged.Title){}}if(!arrayEqual(cacheNote.Tags,tags)){hasChanged.hasChanged=true;hasChanged.Tags=tags}if(force&&cacheNote.Content!=content||!force&&(!cacheNote.IsMarkdown&&$(cacheNote.Content).text()!=contentText||cacheNote.IsMarkdown&&cacheNote.Content!=contentText)){hasChanged.hasChanged=true;hasChanged.Content=content;var c=preview||content;if(!cacheNote.HasSelfDefined||!cacheNote.IsBlog){hasChanged.Desc=Note.genDesc(c);hasChanged.ImgSrc=Note.getImgSrc(c);hasChanged.Abstract=Note.genAbstract(c)}}else{log("text相同");log(cacheNote.Content==content)}hasChanged["UserId"]=cacheNote["UserId"]||"";return hasChanged};Note.genDesc=function(content){if(!content){reLine truncated
|
||||
@@ -247,7 +247,7 @@ Note.curHasChanged = function(force) {
|
||||
}
|
||||
|
||||
// 比较text, 因为note Nav会添加dom会导致content改变
|
||||
if((force && cacheNote.Content != content) || (!force && $(cacheNote.Content).text() != contentText)) {
|
||||
if((force && cacheNote.Content != content) || (!force && (/**/(!cacheNote.IsMarkdown && $(cacheNote.Content).text() != contentText) || (cacheNote.IsMarkdown && cacheNote.Content != contentText)) /**/) ) {
|
||||
hasChanged.hasChanged = true;
|
||||
hasChanged.Content = content;
|
||||
|
||||
@@ -304,6 +304,7 @@ Note.genDesc = function(content) {
|
||||
// 避免其它的<img 之类的不完全
|
||||
content = $("<div></div>").html(content).text();
|
||||
|
||||
|
||||
// pre下text()会将< => < > => >
|
||||
content = content.replace(/</g, "<");
|
||||
content = content.replace(/>/g, ">");
|
||||
@@ -638,8 +639,10 @@ Note.clearNoteInfo = function() {
|
||||
setEditorContent("");
|
||||
|
||||
// markdown editor
|
||||
/*
|
||||
$("#wmd-input").val("");
|
||||
$("#wmd-preview").html("");
|
||||
*/
|
||||
|
||||
// 只隐藏即可
|
||||
$("#noteRead").hide();
|
||||
@@ -680,22 +683,22 @@ Note.renderNoteContent = function(content) {
|
||||
}
|
||||
|
||||
// 初始化时渲染最初的notes
|
||||
/**
|
||||
<div id="noteItemList">
|
||||
<!--
|
||||
<div href="#" class="item">
|
||||
<div class="item-thumb" style="">
|
||||
<img src="images/a.gif"/>
|
||||
</div>
|
||||
|
||||
<div class="item-desc" style="">
|
||||
<p class="item-title">?</p>
|
||||
<p class="item-text">
|
||||
?
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
/**
|
||||
<div id="noteItemList">
|
||||
<!--
|
||||
<div href="#" class="item">
|
||||
<div class="item-thumb" style="">
|
||||
<img src="images/a.gif"/>
|
||||
</div>
|
||||
|
||||
<div class="item-desc" style="">
|
||||
<p class="item-title">?</p>
|
||||
<p class="item-text">
|
||||
?
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
*/
|
||||
|
||||
Note.showEditorMask = function() {
|
||||
@@ -1056,6 +1059,13 @@ Note.listNoteContentHistories = function() {
|
||||
});
|
||||
}
|
||||
|
||||
// 导出成PDF
|
||||
Note.exportPDF = function(target) {
|
||||
var noteId = $(target).attr("noteId");
|
||||
ajaxGet("/note/exportPdf", {noteId: noteId}, function(ret) {
|
||||
});
|
||||
};
|
||||
|
||||
// 长微博
|
||||
Note.html2Image = function(target) {
|
||||
var noteId = $(target).attr("noteId");
|
||||
@@ -1384,8 +1394,9 @@ Note.initContextmenu = function() {
|
||||
{ type: "splitLine" },
|
||||
{ text: getMsg("publicAsBlog"), alias: 'set2Blog', faIcon: "fa-bold", action: Note.setNote2Blog },
|
||||
{ text: getMsg("cancelPublic"), alias: 'unset2Blog', faIcon: "fa-undo", action: Note.setNote2Blog },
|
||||
//{ type: "splitLine" },
|
||||
//{ text: "分享到社区", alias: 'html2Image', icon: "", action: Note.html2Image},
|
||||
// { type: "splitLine" },
|
||||
// { text: "分享到社区", alias: 'html2Image', icon: "", action: Note.html2Image},
|
||||
// { text: "导出PDF", alias: 'exportPDF', icon: "", action: Note.exportPDF},
|
||||
{ type: "splitLine" },
|
||||
{ text: getMsg("delete"), icon: "", faIcon: "fa-trash-o", action: Note.deleteNote },
|
||||
{ text: getMsg("move"), alias: "move", faIcon: "fa-arrow-right",
|
||||
@@ -1510,8 +1521,8 @@ var Attach = {
|
||||
var attachId = $(this).closest('li').data("id");
|
||||
var attach = self.attachsMap[attachId];
|
||||
var src = UrlPrefix + "/attach/download?attachId=" + attachId;
|
||||
if(LEA.isMarkdownEditor() && MarkdownEditor) {
|
||||
MarkdownEditor.insertLink(src, attach.Title);
|
||||
if(LEA.isMarkdownEditor() && MD) {
|
||||
MD.insertLink(src, attach.Title);
|
||||
} else {
|
||||
tinymce.activeEditor.insertContent('<a target="_blank" href="' + src + '">' + attach.Title + '</a>');
|
||||
}
|
||||
@@ -1527,8 +1538,8 @@ var Attach = {
|
||||
var src = UrlPrefix + "/attach/downloadAll?noteId=" + Note.curNoteId
|
||||
var title = note.Title ? note.Title + ".tar.gz" : "all.tar.gz";
|
||||
|
||||
if(LEA.isMarkdownEditor() && MarkdownEditor) {
|
||||
MarkdownEditor.insertLink(src, title);
|
||||
if(LEA.isMarkdownEditor() && MD) {
|
||||
MD.insertLink(src, title);
|
||||
} else {
|
||||
tinymce.activeEditor.insertContent('<a target="_blank" href="' + src + '">' + title + '</a>');
|
||||
}
|
||||
@@ -1661,9 +1672,15 @@ $(function() {
|
||||
Attach.init();
|
||||
|
||||
//-----------------
|
||||
// for list nav
|
||||
// 点击笔记展示之
|
||||
// 避免iphone, ipad两次点击
|
||||
// http://stackoverflow.com/questions/3038898/ipad-iphone-hover-problem-causes-the-user-to-double-click-a-link
|
||||
$("#noteItemList").on("mouseenter", ".item", function(event) {
|
||||
if(LEA.isIpad || LEA.isIphone) {
|
||||
$(this).trigger("click");
|
||||
}
|
||||
});
|
||||
$("#noteItemList").on("click", ".item", function(event) {
|
||||
log(event);
|
||||
event.stopPropagation();
|
||||
var noteId = $(this).attr("noteId");
|
||||
|
||||
@@ -1720,7 +1737,7 @@ $(function() {
|
||||
});
|
||||
*/
|
||||
$("#searchNoteInput").on("keydown", function(e) {
|
||||
var theEvent = e; // window.event || arguments.callee.caller.arguments[0];
|
||||
var theEvent = e; // window.event || arguments.callee.caller.arguments[0];
|
||||
if(theEvent.keyCode == 13 || theEvent.keyCode == 108) {
|
||||
theEvent.preventDefault();
|
||||
Note.searchNote();
|
||||
|
||||
@@ -60,13 +60,13 @@ Notebook.getNotebookTitle = function(notebookId) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的notebooks
|
||||
/**
|
||||
* 我的notebooks
|
||||
<ul class="folderBody" id="notebookList">
|
||||
<li><a class="active">所有</a></li>
|
||||
<li><a class="active">Hadoop</a></li>
|
||||
<li><a>August 13, 2013</a></li>
|
||||
</ul>
|
||||
<li><a class="active">所有</a></li>
|
||||
<li><a class="active">Hadoop</a></li>
|
||||
<li><a>August 13, 2013</a></li>
|
||||
</ul>
|
||||
*/
|
||||
|
||||
Notebook.getTreeSetting = function(isSearch, isShare){
|
||||
@@ -236,7 +236,7 @@ Notebook.getTreeSetting = function(isSearch, isShare){
|
||||
}
|
||||
|
||||
return setting;
|
||||
}
|
||||
}
|
||||
Notebook.allNotebookId = "0";
|
||||
Notebook.trashNotebookId = "-1";
|
||||
Notebook.curNotebookIsTrashOrAll = function() {
|
||||
@@ -436,38 +436,38 @@ Notebook.changeNav = function() {
|
||||
log(t2-t1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的共享notebooks
|
||||
<div id="shareNotebooks">
|
||||
<div class="folderNote closed">
|
||||
<div class="folderHeader">
|
||||
<a>
|
||||
<h1>
|
||||
<i class="fa fa-angle-right"></i>
|
||||
Life's</h1>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="folderBody">
|
||||
<li><a>Hadoop</a></li>
|
||||
<li><a>Node webkit</a></li>
|
||||
<li><a>Hadoop</a></li>
|
||||
<li><a>Node webkit</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
*/
|
||||
/**
|
||||
* 我的共享notebooks
|
||||
<div id="shareNotebooks">
|
||||
<div class="folderNote closed">
|
||||
<div class="folderHeader">
|
||||
<a>
|
||||
<h1>
|
||||
<i class="fa fa-angle-right"></i>
|
||||
Life's</h1>
|
||||
</a>
|
||||
</div>
|
||||
<ul class="folderBody">
|
||||
<li><a>Hadoop</a></li>
|
||||
<li><a>Node webkit</a></li>
|
||||
<li><a>Hadoop</a></li>
|
||||
<li><a>Node webkit</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
*/
|
||||
// TODO 层级
|
||||
Notebook.renderShareNotebooks = function(sharedUserInfos, shareNotebooks) {
|
||||
if(isEmpty(sharedUserInfos)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!shareNotebooks || typeof shareNotebooks != "object" || shareNotebooks.length < 0) {
|
||||
return;
|
||||
|
||||
if(!shareNotebooks || typeof shareNotebooks != "object" || shareNotebooks.length < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var $shareNotebooks = $("#shareNotebooks");
|
||||
var user2ShareNotebooks = {};
|
||||
for(var i in shareNotebooks) {
|
||||
var user2ShareNotebooks = {};
|
||||
for(var i in shareNotebooks) {
|
||||
var userNotebooks = shareNotebooks[i];
|
||||
user2ShareNotebooks[userNotebooks.UserId] = userNotebooks;
|
||||
}
|
||||
@@ -477,17 +477,17 @@ Notebook.renderShareNotebooks = function(sharedUserInfos, shareNotebooks) {
|
||||
|
||||
userNotebooks.ShareNotebooks = [{NotebookId: "-2", Title: "默认共享"}].concat(userNotebooks.ShareNotebooks)
|
||||
|
||||
var username = userInfo.Username || userInfo.Email;
|
||||
var header = tt('<div class="folderNote closed"><div class="folderHeader"><a><h1 title="? 的共享"><i class="fa fa-angle-right"></i>?</h1></a></div>', username, username);
|
||||
var body = '<ul class="folderBody">';
|
||||
for(var j in userNotebooks.ShareNotebooks) {
|
||||
var notebook = userNotebooks.ShareNotebooks[j];
|
||||
body += tt('<li><a notebookId="?">?</a></li>', notebook.NotebookId, notebook.Title)
|
||||
}
|
||||
body += "</ul>";
|
||||
|
||||
$shareNotebooks.append(header + body + "</div>")
|
||||
}
|
||||
var username = userInfo.Username || userInfo.Email;
|
||||
var header = tt('<div class="folderNote closed"><div class="folderHeader"><a><h1 title="? 的共享"><i class="fa fa-angle-right"></i>?</h1></a></div>', username, username);
|
||||
var body = '<ul class="folderBody">';
|
||||
for(var j in userNotebooks.ShareNotebooks) {
|
||||
var notebook = userNotebooks.ShareNotebooks[j];
|
||||
body += tt('<li><a notebookId="?">?</a></li>', notebook.NotebookId, notebook.Title)
|
||||
}
|
||||
body += "</ul>";
|
||||
|
||||
$shareNotebooks.append(header + body + "</div>")
|
||||
}
|
||||
}
|
||||
|
||||
// 左侧导航, 选中某个notebook
|
||||
|
||||
@@ -1 +1 @@
|
||||
function editorMode(){this.writingHash="writing";this.normalHash="normal";this.isWritingMode=location.hash.indexOf(this.writingHash)>=0;this.toggleA=null}editorMode.prototype.toggleAText=function(isWriting){var self=this;setTimeout(function(){var toggleA=$(".toggle-editor-mode a");var toggleSpan=$(".toggle-editor-mode span");if(isWriting){toggleA.attr("href","#"+self.normalHash);toggleSpan.text(getMsg("normalMode"))}else{toggleA.attr("href","#"+self.writingHash);toggleSpan.text(getMsg("writingMode"))}},0)};editorMode.prototype.isWriting=function(hash){return hash.indexOf(this.writingHash)>=0};editorMode.prototype.init=function(){this.changeMode(this.isWritingMode);var self=this;$(".toggle-editor-mode").click(function(e){e.preventDefault();saveBookmark();var $a=$(this).find("a");var isWriting=self.isWriting($a.attr("href"));self.changeMode(isWriting);if(isWriting){setHash("m",self.writingHash)}else{setHash("m",self.normalHash)}restoreBookmark()})};editorMode.prototype.changeMode=function(isWritingMode){this.toggleAText(isWritingMode);if(isWritingMode){this.writtingMode()}else{this.normalMode()}$("#moreBtn i").removeClass("fa-angle-up").addClass("fa-angle-down")};editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10);setTimeout(function(){resizeEditor()},20);setTimeout(function(){resizeEditor()},500)};editorMode.prototype.normalMode=function(){var $c=$("#editorContent_ifr").contents();$c.contents().find("#writtingMode").remove();$c.contents().find('link[href$="editor-writting-mode.css"]').remove();$("#noteItemListWrap, #notesAndSort").show();$("#noteList").unbind("mouseenter").unbind("mouseleave");var theme=UserInfo.Theme||"default";theme+=".css";$("#themeLink").attr("href","/css/theme/"+theme);$("#mceToolbar").css("height","30px");this.resizeEditor();$("#noteList").width(UserInfo.NoteListWidth);$("#note").css("left",UserInfo.NoteListWidth)};editorMode.prototype.writtingMode=function(){$("#themeLink").attr("href","/css/theme/writting-overwrite.css");setTimeout(function(){var $c=$("#editorContent_ifr").contents();$c.contents().find("head").append('<link type="text/css" rel="stylesheet" href="/css/editor/editor-writting-mode.css" id="writtingMode">')},0);$("#noteItemListWrap, #notesAndSort").fadeOut();$("#noteList").hover(function(){$("#noteItemListWrap, #notesAndSort").fadeIn()},function(){$("#noteItemListWrap, #notesAndSort").fadeOut()});$("#mceToolbar").css("height","40px");this.resizeEditor();$("#noteList").width(250);$("#note").css("left",0)};editorMode.prototype.getWritingCss=function(){if(this.isWritingMode){return["/css/editor/editor-writting-mode.css"]}return[]};var em=new editorMode;var Resize={lineMove:false,mdLineMove:false,target:null,leftNotebook:$("#leftNotebook"),notebookSplitter:$("#notebookSplitter"),noteList:$("#noteList"),noteAndEditor:$("#noteAndEditor"),noteSplitter:$("#noteSplitter"),note:$("#note"),body:$("body"),leftColumn:$("#left-column"),rightColumn:$("#right-column"),mdSplitter:$("#mdSplitter"),init:function(){var self=this;self.initEvent()},initEvent:function(){var self=this;$(".noteSplit").bind("mousedown",function(event){event.preventDefault();self.lineMove=true;$(this).css("background-color","#ccc");self.target=$(this).attr("id");$("#noteMask").css("z-index",99999)});self.mdSplitter.bind("mousedown",function(event){event.preventDefault();self.mdLineMove=true;$(this).css("background-color","#ccc")});self.body.bind("mousemove",function(event){if(self.lineMove){event.preventDefault();self.resize3Columns(event)}else if(self.mdLineMove){event.preventDefault();self.resizeMdColumns(event)}});self.body.bind("mouseup",function(event){self.stopResize();$("#noteMask").css("z-index",-1)})},stopResize:function(){var self=this;if(self.lineMove||self.mdLineMove){ajaxGet("/user/updateColumnWidth",{mdEditorWidth:UserInfo.MdEditorWidth,notebookWidth:UserInfo.NotebookWidth,noteListWidth:UserInfo.NoteListWidth},function(){})}self.lineMove=false;self.mdLineMove=false;$(".noteSplit").css("background","none");self.mdSplitter.css("background","none")},set3ColumnsWidth:function(notebookWidth,noteListWidth){var self=this;if(notebookWidth<150||noteListWidth<100){return}var noteWidth=self.body.width()-notebookWidth-noteListWidth;if(noteWidth<400){return}self.leftNotebook.width(notebookWidth);self.notebookSplitter.css("left",notebookWidth);self.noteAndEditor.css("left",notebookWidth);self.noteList.width(noteListWidth);self.noteSplitter.css("left",noteListWidth);self.note.css("left",noteListWidth);UserInfo.NotebookWidth=notebookWidth;UserInfo.NoteListWidth=noteListWidth},resize3Columns:function(event,isFromeIfr){var self=this;if(isFromeIfr){event.clientX+=self.body.width()-self.note.width()}var notebookWidth,noteListWidth;if(self.lineMove){if(self.target=="notebookSplitter"){notebookWidth=event.clientX;noteListWidth=self.noteList.width();self.set3ColumnsWidth(notebookWidth,noteListWidth)}else{notebookWidth=self.leftNotebook.width();noteListWidth=event.clientX-notebookWidth;seLine truncated
|
||||
function editorMode(){this.writingHash="writing";this.normalHash="normal";this.isWritingMode=location.hash.indexOf(this.writingHash)>=0;this.toggleA=null}editorMode.prototype.toggleAText=function(isWriting){var self=this;setTimeout(function(){var toggleA=$(".toggle-editor-mode a");var toggleSpan=$(".toggle-editor-mode span");if(isWriting){toggleA.attr("href","#"+self.normalHash);toggleSpan.text(getMsg("normalMode"))}else{toggleA.attr("href","#"+self.writingHash);toggleSpan.text(getMsg("writingMode"))}},0)};editorMode.prototype.isWriting=function(hash){return hash.indexOf(this.writingHash)>=0};editorMode.prototype.init=function(){this.changeMode(this.isWritingMode);var self=this;$(".toggle-editor-mode").click(function(e){e.preventDefault();saveBookmark();var $a=$(this).find("a");var isWriting=self.isWriting($a.attr("href"));self.changeMode(isWriting);if(isWriting){setHash("m",self.writingHash)}else{setHash("m",self.normalHash)}restoreBookmark()})};editorMode.prototype.changeMode=function(isWritingMode){this.toggleAText(isWritingMode);if(isWritingMode){this.writtingMode()}else{this.normalMode()}$("#moreBtn i").removeClass("fa-angle-up").addClass("fa-angle-down")};editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10);setTimeout(function(){resizeEditor()},20);setTimeout(function(){resizeEditor()},500)};editorMode.prototype.normalMode=function(){var $c=$("#editorContent_ifr").contents();$c.contents().find("#writtingMode").remove();$c.contents().find('link[href$="editor-writting-mode.css"]').remove();$("#noteItemListWrap, #notesAndSort").show();$("#noteList").unbind("mouseenter").unbind("mouseleave");var theme=UserInfo.Theme||"default";theme+=".css";$("#themeLink").attr("href","/css/theme/"+theme);$("#mceToolbar").css("height","30px");this.resizeEditor();$("#noteList").width(UserInfo.NoteListWidth);$("#note").css("left",UserInfo.NoteListWidth)};editorMode.prototype.writtingMode=function(){$("#themeLink").attr("href","/css/theme/writting-overwrite.css");setTimeout(function(){var $c=$("#editorContent_ifr").contents();$c.contents().find("head").append('<link type="text/css" rel="stylesheet" href="/css/editor/editor-writting-mode.css" id="writtingMode">')},0);$("#noteItemListWrap, #notesAndSort").fadeOut();$("#noteList").hover(function(){$("#noteItemListWrap, #notesAndSort").fadeIn()},function(){$("#noteItemListWrap, #notesAndSort").fadeOut()});$("#mceToolbar").css("height","40px");this.resizeEditor();$("#noteList").width(250);$("#note").css("left",0)};editorMode.prototype.getWritingCss=function(){if(this.isWritingMode){return["/css/editor/editor-writting-mode.css"]}return[]};var em=new editorMode;var Resize={lineMove:false,mdLineMove:false,target:null,leftNotebook:$("#leftNotebook"),notebookSplitter:$("#notebookSplitter"),noteList:$("#noteList"),noteAndEditor:$("#noteAndEditor"),noteSplitter:$("#noteSplitter"),note:$("#note"),body:$("body"),leftColumn:$("#left-column"),rightColumn:$("#right-column"),mdSplitter:$("#mdSplitter2"),init:function(){var self=this;self.initEvent()},initEvent:function(){var self=this;$(".noteSplit").bind("mousedown",function(event){event.preventDefault();self.lineMove=true;$(this).css("background-color","#ccc");self.target=$(this).attr("id");$("#noteMask").css("z-index",99999)});self.mdSplitter.bind("mousedown",function(event){event.preventDefault();if($(this).hasClass("open")){self.mdLineMove=true}});self.body.bind("mousemove",function(event){if(self.lineMove){event.preventDefault();self.resize3Columns(event)}else if(self.mdLineMove){event.preventDefault();self.resizeMdColumns(event)}});self.body.bind("mouseup",function(event){self.stopResize();$("#noteMask").css("z-index",-1)});var everLeftWidth;$(".layout-toggler-preview").click(function(){var $t=$(this);var $p=self.leftColumn.parent();if($t.hasClass("open")){var totalWidth=$p.width();var minRightWidth=22;var leftWidth=totalWidth-minRightWidth;everLeftWidth=self.leftColumn.width();self.leftColumn.width(leftWidth);self.rightColumn.css("left","auto").width(minRightWidth);$t.removeClass("open");self.rightColumn.find(".layout-resizer").removeClass("open");$(".preview-container").hide()}else{$t.addClass("open");self.rightColumn.find(".layout-resizer").addClass("open");self.leftColumn.width(everLeftWidth);$(".preview-container").show();self.rightColumn.css("left",everLeftWidth).width("auto");if(MD){MD.onResize()}}})},stopResize:function(){var self=this;if(self.lineMove||self.mdLineMove){ajaxGet("/user/updateColumnWidth",{mdEditorWidth:UserInfo.MdEditorWidth,notebookWidth:UserInfo.NotebookWidth,noteListWidth:UserInfo.NoteListWidth},function(){})}self.lineMove=false;self.mdLineMove=false;$(".noteSplit").css("background","none");self.mdSplitter.css("background","none")},set3ColumnsWidth:function(notebookWidth,noteListWidth){var self=this;if(notebookWidth<150||noteListWidth<100){return}var noteWidth=self.body.width()-notebookWidth-noteListWidth;if(noteWidth<400){return}self.leftNotebook.width(notebookWidth);self.nLine truncated
|
||||