beta2 ok
This commit is contained in:
1 parent
d979a0c3e2
commit
1f45666ec4
119 files changed
+2463
-675
No files matched your search
Vendored
-1
@@ -1 +0,0 @@
|
||||
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=n/diff.minute;return result=o>=1?parseInt(o)+"个月前":i>=1?parseInt(i)+"周前":a>=1?parseInt(a)+"天前":r>=1?parseInt(r)+"小时前":s>=1?parseInt(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"==typeLine truncated
|
||||
@@ -133,7 +133,7 @@ function getDateDiff(dateTimeStamp) {
|
||||
var weekC = diffValue / (7 * diff.day);
|
||||
var dayC = diffValue / diff.day;
|
||||
var hourC = diffValue / diff.hour;
|
||||
var minC = diffValue / diff.minute;
|
||||
var minC = parseInt(diffValue / diff.minute);
|
||||
if (monthC >= 1) {
|
||||
result = parseInt(monthC) + "个月前";
|
||||
} else if (weekC >= 1) {
|
||||
@@ -142,8 +142,8 @@ function getDateDiff(dateTimeStamp) {
|
||||
result = parseInt(dayC) + "天前";
|
||||
} else if (hourC >= 1) {
|
||||
result = parseInt(hourC) + "小时前";
|
||||
} else if (minC >= 1) {
|
||||
result = parseInt(minC) + "分钟前";
|
||||
} else if (minC > 1) {
|
||||
result = minC + "分钟前";
|
||||
} else {
|
||||
result = "刚刚";
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<p>这里面是leanote默认主题</p>
|
||||
@@ -13,16 +13,18 @@
|
||||
{{$.blogInfo.Title}}
|
||||
{{else if $.curIsCate}}
|
||||
分类-{{$.curCateTitle}}
|
||||
{{else if $.curIsView}}
|
||||
{{$.post.Title}}
|
||||
{{else if $.curIsSearch}}
|
||||
搜索-{{$.keywords}}
|
||||
{{else if $.curIsTags}}
|
||||
我的标签
|
||||
{{else if $.curIsTagPosts}}
|
||||
标签-{{$.curTag}}
|
||||
{{else}}
|
||||
我的博客
|
||||
{{else if $.curIsPost}}
|
||||
{{$.post.Title}}
|
||||
{{else if $.curIsSingle}}
|
||||
{{$.single.Title}}
|
||||
{{else if $.curIsArchive}}
|
||||
归档
|
||||
{{end}}
|
||||
|
||||
</title>
|
||||
|
||||
@@ -11,9 +11,17 @@
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
{{range .MonthAchives}}
|
||||
<li>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
<span class="archive-month">{{.Month}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
@@ -90,14 +90,14 @@ function log(o) {
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
<a href="{{$.cateUrl}}/{{.UrlTitle}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
<a href="{{$.singleUrl}}/{{.UrlTitle}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -25,7 +25,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
|
||||
@@ -13,16 +13,18 @@
|
||||
{{$.blogInfo.Title}}
|
||||
{{else if $.curIsCate}}
|
||||
分类-{{$.curCateTitle}}
|
||||
{{else if $.curIsView}}
|
||||
{{$.post.Title}}
|
||||
{{else if $.curIsSearch}}
|
||||
搜索-{{$.keywords}}
|
||||
{{else if $.curIsTags}}
|
||||
我的标签
|
||||
{{else if $.curIsTagPosts}}
|
||||
标签-{{$.curTag}}
|
||||
{{else}}
|
||||
我的博客
|
||||
{{else if $.curIsPost}}
|
||||
{{$.post.Title}}
|
||||
{{else if $.curIsSingle}}
|
||||
{{$.single.Title}}
|
||||
{{else if $.curIsArchive}}
|
||||
归档
|
||||
{{end}}
|
||||
|
||||
</title>
|
||||
|
||||
@@ -4291,3 +4291,9 @@ fieldset[disabled] .btn-gplus.active {
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.url-title {
|
||||
border: none;
|
||||
outline: none;
|
||||
border-bottom: 1px solid #eee;
|
||||
background: #fffbcc;
|
||||
}
|
||||
@@ -4822,4 +4822,10 @@ body.container {
|
||||
#avatarUploadMsg .alert {
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.url-title {
|
||||
border: none;
|
||||
outline: none;
|
||||
border-bottom: 1px solid #eee;
|
||||
background: #fffbcc;
|
||||
}
|
||||
@@ -149,7 +149,11 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
}
|
||||
if(fileId) {
|
||||
// 得到fileId, 如果这个笔记不是我的, 那么肯定是协作的笔记, 那么需要将图片copy给原note owner
|
||||
var curNote = Note.getCurNote();
|
||||
// 博客设置中不用没有Note
|
||||
var curNote;
|
||||
if(Note && Note.getCurNote) {
|
||||
curNote = Note.getCurNote();
|
||||
}
|
||||
if(curNote && curNote.UserId != UserInfo.UserId) {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
|
||||
Reference in new issue
Block a user