member center, blog redesign

This commit is contained in:
life committed 2014-11-09 16:24:19 +08:00
1 parent 5f186f4455
commit 274782b89e
428 files changed
+23054 -480

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
博客的默认主题和一些公用的静态文件
themes 是默认主题, 有3个
用户自定义的主题不在这里, 在public/upload/userId/thmems下
+325
View File
@@ -0,0 +1,325 @@
.entry-controls {
text-align: right;
padding-top: 20px;
margin-top: 20px;
margin-bottom: 10px;
border-top: 1px solid #f1f2f3;
}
.entry-controls .right-section {
float: right;
color: #9d9e9f;
}
.entry-controls .right-section a {
color: #9d9e9f;
}
.post-menu-button {
padding-bottom: 10px;
}
.ui-menu-button {
position: relative;
display: inline-block;
cursor: pointer;
}
.entry-controls .control-item {
margin-left: 15px;
color: #9d9e9f;
font-size: 15px;
opacity: 1;
-webkit-transition: all 0.05s ease-in-out;
-moz-transition: all 0.05s ease-in-out;
-o-transition: all 0.05s ease-in-out;
transition: all 0.05s ease-in-out;
}
.vote-section-wrapper {
display: inline-block;
float: left;
}
.entry-controls .voters {
display: block;
margin-top: 52px;
height: 25px;
clear: both;
}
.entry-controls .voters .more-voters,
.entry-controls .voters .voter {
width: 25px;
height: 25px;
position: relative;
margin: 0 8px 8px 0;
float: left;
}
.entry-controls .voters .voter > img {
float: left;
}
.avatar-small {
width: 25px;
height: 25px;
border-radius: 50%;
}
.comment-box {
margin: 0;
padding: 0;
font-size: 16px;
}
.comment-box a {
font-size: 16px;
}
.comment-box .box-header {
border-top: 1px solid #f1f2f3;
font-size: 15px;
color: #9d9e9f;
padding: 30px 0 10px;
position: relative;
}
.comment-box .box-header .icon {
margin-right: 8px;
vertical-align: -3px;
}
.comment-box .box-header a.comment-options {
margin-left: 10px;
}
@media screen and (max-width: 600px) {
.comment-box .box-header {
padding-left: 17px;
padding-right: 17px;
}
}
.comment-box .load-more {
height: 26px;
margin-top: 15px;
padding-top: 24px;
text-align: center;
font-size: 15px;
border-top: solid 1px #f1f2f3;
}
.comment-box .load-more a {
color: #9d9e9f;
}
.comment-box .ui-spinner {
margin: 0 auto;
}
.comment-box .ui-spinner.small {
position: relative;
left: 10px;
}
.comment-box.empty.cannot-comment {
border: 1px solid #dddddd;
}
.comment-box.cannot-comment .editable,
.comment-box.cannot-comment .editable,
.comment-box.comment-box.cannot-comment .command,
.comment-box.comment-box.cannot-comment .op-link.reply {
display: none !important;
}
.comment-box.empty.cannot-comment .comment-form {
margin: 0;
}
.comment-box.empty.cannot-comment .comment-box-ft {
background: #ffffff;
}
.comment-box.empty.cannot-comment .comment-box-ft,
.comment-box .comment-box-ft {
position: relative;
margin-top: 0px;
}
.comment-box .avatar {
width: 40px;
height: 40px;
border-radius: 20px;
float: left;
}
.comment-box .message {
margin-top: 24px;
padding: 10px;
border-radius: 4px;
text-align: center;
background: #F7F8F9;
color: #9d9e9f;
}
.comment-item {
position: relative;
list-style: none;
outline: 0;
padding: 15px 0;
border-bottom: solid 1px #f1f2f3;
}
.item-highlight * {
border-radius: 5px;
font-weight: bold;
}
@media screen and (max-width: 600px) {
.comment-item {
padding-left: 17px;
padding-right: 17px;
}
}
.comment-item > .avatar-link {
float: left;
margin: 4px 0 0;
}
.comment-item > .comment-body {
margin: 0 0 0 60px;
}
.comment-item .comment-content {
min-height: 22px;
font-size: 15px;
word-wrap: break-word;
padding: 5px 0;
}
.comment-item .comment-hd,
.comment-item .comment-ft {
color: #9d9e9f;
}
.comment-item .comment-hd .desc,
.comment-item .comment-ft .desc {
font-size: 15px;
}
.comment-item .comment-ft {
font-size: 15px;
}
.comment-item .op-link {
color: #9d9e9f;
font-size: 15px;
margin-left: 12px;
}
.comment-item .op-link {
visibility: hidden;
}
@media screen and (max-width: 420px) {
.comment-item .op-link .icon {
display: none;
}
}
.comment-item .like-num {
float: right;
}
.comment-item .like-num.nil {
display: none;
}
.comment-item:hover .op-link {
visibility: visible;
}
.comment-form.comment-reply-form {
padding: 20px 0;
}
.comment-form .row {
margin: 0;
}
.comment-form .editable {
padding: 6px 12px;
font-size: 16px;
min-height: 18px;
line-height: 26px;
white-space: pre-wrap;
width: 100%;
color: #222;
cursor: text;
border: 1px solid #DDD;
border-radius: 4px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset;
background: #e6eaed;
color: #747f8c;
}
#commentForm {
border-top: solid 1px #f1f2f3;
padding: 10px 0;
}
.comment-form .editable:focus {
outline: none;
border: 1px solid #cccccc;
}
.comment-form > .command {
display: none;
margin-top: 20px;
padding-bottom: 0;
text-align: right;
}
.comment-form > .command .save {
float: right;
}
.comment-form > .command .cancel {
color: #9d9e9f;
vertical-align: -7px;
margin-right: 10px;
}
.comment-form.expanded .command {
display: block;
}
.comment-form > .avatar + .editable {
margin-left: 60px;
}
#comments {
padding: 0;
}
#comments form {
display: none;
}
@media screen and (max-width: 600px) {
.comment-form {
padding-left: 17px;
padding-right: 17px;
}
}
.btn-zan {
border-radius: 50px;
}
.btn-weibo {
border-radius: 50px;
color: #d44137;
border-color: #d44137;
}
.btn-weibo:hover {
color: #fff;
background: #d44137;
}
.btn-weixin {
color: #38ad5a;
border-color: #38ad5a;
border-radius: 50px;
}
.btn-weixin:hover {
color: #fff;
background: #38ad5a;
}
.reply-comment-btn {
width: 100px;
}
.avatar-wrap {
float: left;
}
.editor-wrap {
margin-left: 60px;
}
#weixinQRCode {
text-align: center;
}
.report-form ul {
margin: 0;
padding: 0;
}
.report-form .options > li {
list-style: none;
display: block;
line-height: 2;
color: #666768;
}
.report-form .options input {
margin-right: 10px;
vertical-align: 1px;
}
.footnote {
color: red;
}
#moreComments {
padding: 20px 0;
text-align: center;
}
.needLogin {
padding: 20px 0;
text-align: center;
font-size: 18px;
border-top: 1px solid #f1f2f3;
}
.needLogin a {
font-size: 18px;
}
+1
View File
@@ -0,0 +1 @@
!function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")(t)):"function"==typeof define&&define.amd?define("bootstrap-dialog",["jquery"],function(t){return e(t)}):t.BootstrapDialog=e(t.jQuery)}(this,function(t){"use strict";var e=function(n){this.defaultOptions=t.extend(!0,{id:e.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},e.defaultOptions),this.indexedButtons={},this.registeredButtonHotkeys={},this.draggableData={isMouseDown:!1,mouseOffset:{}},this.realized=!1,this.opened=!1,this.initOptions(n),this.holdThisInstance()};return e.NAMESPACE="bootstrap-dialog",e.TYPE_DEFAULT="type-default",e.TYPE_INFO="type-info",e.TYPE_PRIMARY="type-primary",e.TYPE_SUCCESS="type-success",e.TYPE_WARNING="type-warning",e.TYPE_DANGER="type-danger",e.DEFAULT_TEXTS={},e.DEFAULT_TEXTS[e.TYPE_DEFAULT]="提示",e.DEFAULT_TEXTS[e.TYPE_INFO]="提示",e.DEFAULT_TEXTS[e.TYPE_PRIMARY]="提示",e.DEFAULT_TEXTS[e.TYPE_SUCCESS]="Success",e.DEFAULT_TEXTS[e.TYPE_WARNING]="Warning",e.DEFAULT_TEXTS[e.TYPE_DANGER]="Danger",e.SIZE_NORMAL="size-normal",e.SIZE_LARGE="size-large",e.BUTTON_SIZES={},e.BUTTON_SIZES[e.SIZE_NORMAL]="",e.BUTTON_SIZES[e.SIZE_LARGE]="btn-lg",e.ICON_SPINNER="glyphicon glyphicon-asterisk",e.ZINDEX_BACKDROP=1040,e.ZINDEX_MODAL=1050,e.defaultOptions={type:e.TYPE_PRIMARY,size:e.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:!0,closable:!0,closeByBackdrop:!0,closeByKeyboard:!0,spinicon:e.ICON_SPINNER,autodestroy:!0,draggable:!1,animate:!0,description:""},e.configDefaultOptions=function(n){e.defaultOptions=t.extend(!0,e.defaultOptions,n)},e.dialogs={},e.openAll=function(){t.each(e.dialogs,function(t,e){e.open()})},e.closeAll=function(){t.each(e.dialogs,function(t,e){e.close()})},e.moveFocus=function(){var n=null;t.each(e.dialogs,function(t,e){n=e}),null!==n&&n.isRealized()&&n.getModal().focus()},e.showScrollbar=function(){var n=null;if(t.each(e.dialogs,function(t,e){n=e}),null!==n&&n.isRealized()&&n.isOpened()){var o=n.getModal().data("bs.modal");o.checkScrollbar(),t("body").addClass("modal-open"),o.setScrollbar()}},e.prototype={constructor:e,initOptions:function(e){return this.options=t.extend(!0,this.defaultOptions,e),this},holdThisInstance:function(){return e.dialogs[this.getId()]=this,this},initModalStuff:function(){return this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter()),this.getModal().append(this.getModalDialog()),this.getModalDialog().append(this.getModalContent()),this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter()),this},createModal:function(){var e=t('<div class="modal" tabindex="-1" role="dialog" aria-hidden="true"></div>');return e.prop("id",this.getId()).attr("aria-labelledby",this.getId()+"_title"),e},getModal:function(){return this.$modal},setModal:function(t){return this.$modal=t,this},createModalDialog:function(){return t('<div class="modal-dialog"></div>')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(t){return this.$modalDialog=t,this},createModalContent:function(){return t('<div class="modal-content"></div>')},getModalContent:function(){return this.$modalContent},setModalContent:function(t){return this.$modalContent=t,this},createModalHeader:function(){return t('<div class="modal-header"></div>')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(t){return this.$modalHeader=t,this},createModalBody:function(){return t('<div class="modal-body"></div>')},getModalBody:function(){return this.$modalBody},setModalBody:function(t){return this.$modalBody=t,this},createModalFooter:function(){return t('<div class="modal-footer"></div>')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(t){return this.$modalFooter=t,this},createDynamicContent:function(t){var e=null;return e="function"==typeof t?t.call(t,this):t,"string"==typeof e&&(e=this.formatStringContent(e)),e},formatStringContent:function(t){return this.options.nl2br?t.replace(/\r\n/g,"<br />").replace(/[\r\n]/g,"<br />"):t},setData:function(t,e){return this.options.data[t]=e,this},getData:function(t){return this.options.data[t]},setId:function(t){return this.options.id=t,this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(t){return this.options.type=t,this.updateType(),this},updateType:function(){if(this.isRealized()){var t=[e.TYPE_DEFAULT,e.TYPE_INFO,e.TYPE_PRIMARY,e.TYPE_SUCCESS,e.TYPE_WARNING,e.TYPE_DANGER];this.getModal().removeClass(t.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(t){return this.options.size=t,this},getCssClass:function(){return this.options.cssClass},setCssClass:function(t){return this.options.cssClass=t,this},geLine truncated
+111
View File
@@ -0,0 +1,111 @@
/**
* @preserve
* Project: Bootstrap Hover Dropdown
* Author: Cameron Spear
* Version: v2.0.11
* Contributors: Mattia Larentis
* Dependencies: Bootstrap's Dropdown plugin, jQuery
* Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
* License: MIT
* Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/
*/
;(function ($, window, undefined) {
// outside the scope of the jQuery plugin to
// keep track of all dropdowns
var $allDropdowns = $();
// if instantlyCloseOthers is true, then it will instantly
// shut other nav items when a new one is hovered over
$.fn.dropdownHover = function (options) {
// don't do anything if touch is supported
// (plugin causes some issues on mobile)
if('ontouchstart' in document) return this; // don't want to affect chaining
// the element we really care about
// is the dropdown-toggle's parent
$allDropdowns = $allDropdowns.add(this.parent());
return this.each(function () {
var $this = $(this),
$parent = $this.parent(),
defaults = {
delay: 500,
instantlyCloseOthers: true
},
data = {
delay: $(this).data('delay'),
instantlyCloseOthers: $(this).data('close-others')
},
showEvent = 'show.bs.dropdown',
hideEvent = 'hide.bs.dropdown',
// shownEvent = 'shown.bs.dropdown',
// hiddenEvent = 'hidden.bs.dropdown',
settings = $.extend(true, {}, defaults, options, data),
timeout;
$parent.hover(function (event) {
// so a neighbor can't open the dropdown
if(!$parent.hasClass('open') && !$this.is(event.target)) {
// stop this event, stop executing any code
// in this callback but continue to propagate
return true;
}
openDropdown(event);
}, function () {
timeout = window.setTimeout(function () {
$parent.removeClass('open');
$this.trigger(hideEvent);
}, settings.delay);
});
// this helps with button groups!
$this.hover(function (event) {
/*
// life
// this helps prevent a double event from firing.
// see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55
if(!$parent.hasClass('open') && !$parent.is(event.target)) {
// stop this event, stop executing any code
// in this callback but continue to propagate
return true;
}
*/
openDropdown(event);
});
// handle submenus
$parent.find('.dropdown-submenu').each(function (){
var $this = $(this);
var subTimeout;
$this.hover(function () {
window.clearTimeout(subTimeout);
$this.children('.dropdown-menu').show();
// always close submenu siblings instantly
$this.siblings().children('.dropdown-menu').hide();
}, function () {
var $submenu = $this.children('.dropdown-menu');
subTimeout = window.setTimeout(function () {
$submenu.hide();
}, settings.delay);
});
});
function openDropdown(event) {
$allDropdowns.find(':focus').blur();
if(settings.instantlyCloseOthers === true)
$allDropdowns.removeClass('open');
window.clearTimeout(timeout);
$parent.addClass('open');
$this.trigger(showEvent);
}
});
};
$(document).ready(function () {
// apply dropdownHover to all elements with the data-hover="dropdown" attribute
$('[data-hover="dropdown"]').dropdownHover({delay: 100});
});
})(jQuery, this);
+1
View File
@@ -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=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
+419
View File
@@ -0,0 +1,419 @@
// 返回是否是re.Ok == true
function reIsOk(re) {
return re && typeof re == "object" && re.Ok;
}
function showAlert(id, msg, type, id2Focus) {
$(id).html(msg).removeClass("alert-danger").removeClass("alert-success").removeClass("alert-warning").addClass("alert-" + type).show();
if(id2Focus) {
$(id2Focus).focus();
}
}
function hideAlert(id, timeout) {
if(timeout) {
setTimeout(function() {
$(id).hide();
}, timeout);
} else {
$(id).hide();
}
}
function ajaxGet(url, param, func) {
$.get(url, param, func);
}
function ajaxPost(url, param, func) {
$.post(url, param, func);
}
//------
// jsonp
function ajaxGetP(url, param, callback) {
ajaxP("GET", url, param, callback)
}
function ajaxPostP(url, param, callback) {
ajaxP("POST", url, param, callback)
}
function ajaxP(method, url, param, callback) {
param = param || {};
callback = callback || function() {};
$.ajax({
dataType: "jsonp",//跨域访问 dataType 必须是jsonp 类型。
url: url,
type: method,
data: param,
jsonp: "callback",
jsonpCallback: "jsonpCallback",
success: callback
});
}
//------------------
// 分享
var windowParam = 'width=700, height=580, top=180, left=320, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no';
function getShareUrl() {
return location.href;
}
function getShareTitle(title) {
return encodeURI(title + " (来自leanote.com)");
}
function shareSinaWeibo(noteId, title, pic) {
var url = "http://service.weibo.com/share/share.php?title=" + getShareTitle(title) + "&url=" + getShareUrl(noteId);
window.open(url, 'Share', windowParam);
}
function shareTencentWeibo(noteId, title, pic) {
var _appkey = '801542571';
var url = "http://share.v.t.qq.com/index.php?c=share&a=index&appkey=" + _appkey +"&title=" + getShareTitle(title) + "&url=" + getShareUrl(noteId) +"&pic=" + pic;
window.open(url, 'Share', windowParam);
}
function shareQQ(noteId, title, pic) {
var url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + getShareUrl(noteId) + '&title=' + title + '&pics=' + pic;
window.open(url, 'Share', windowParam);
}
function shareRenRen(noteId, title, pic) {
var url = 'http://widget.renren.com/dialog/share?resourceUrl=' + getShareUrl(noteId) + '&srcUrl=' + getShareUrl(noteId) + '&title=' + getShareTitle(title) + '&pic=' + pic;
window.open(url, 'Share', windowParam);
}
// https://twitter.com/intent/tweet?text=&pic=
function shareTwitter(noteId, title, pic) {
var url = 'https://twitter.com/intent/tweet?text=' + getShareTitle(title) + '&pic=' + pic;
window.open(url, 'Share', windowParam);
}
// http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>”
function shareFacebook(noteId, title, pic) {
var url = ' http://www.facebook.com/sharer.php?t=' + getShareTitle(title) + '&pic=' + pic;
window.open(url, 'Share', windowParam);
}
// go的datetime转成datetime字符串
// 2014-01-06T18:29:48.802+08:00 => 2012-12-12 12:12:12 字符串
function goNowToDatetime(goNow) {
if(!goNow) {
return "";
}
return goNow.substr(0, 10) + " " + goNow.substr(11, 8);
}
// 转成Date()
// 2014-01-06T18:29:48.802+08:00 => new Date(year, month, day, hour, minute, second)
function goNowToDate(goNow) {
if(!goNow) {
return "";
}
var str = goNow.substr(0, 10) + " " + goNow.substr(11, 8);
// 2012-12-12 12:12:12
var tempStrs = str.split(" ");
var dateStrs = tempStrs[0].split("-");
var year = parseInt(dateStrs[0], 10);
var month = parseInt(dateStrs[1], 10) - 1;
var day = parseInt(dateStrs[2], 10);
var timeStrs = tempStrs[1].split(":");
var hour = parseInt(timeStrs [0], 10);
var minute = parseInt(timeStrs[1], 10) - 1;
var second = parseInt(timeStrs[2], 10);
var date = new Date(year, month, day, hour, minute, second);
return date;
}
// 距离现在有多久, 评论时间间隔
var diff = {
minute : 1000 * 60,
hour : 1000 * 60 * 60,
day : 1000 * 60 * 60 * 24,
halfamonth : 1000 * 60 * 60 * 24 * 15,
month : 1000 * 60 * 60 * 24 * 30
}
function getDateDiff(dateTimeStamp) {
var now = new Date().getTime();
var diffValue = now - dateTimeStamp;
if (diffValue < 0) {
return "";
}
var monthC = diffValue / diff.month;
var weekC = diffValue / (7 * diff.day);
var dayC = diffValue / diff.day;
var hourC = diffValue / diff.hour;
var minC = diffValue / diff.minute;
if (monthC >= 1) {
result = parseInt(monthC) + "个月前";
} else if (weekC >= 1) {
result = parseInt(weekC) + "周前";
} else if (dayC >= 1) {
result = parseInt(dayC) + "天前";
} else if (hourC >= 1) {
result = parseInt(hourC) + "小时前";
} else if (minC >= 1) {
result = parseInt(minC) + "分钟前";
} else {
result = "刚刚";
}
return result;
}
function weixin() {
var local=window.location.href;
var title = $.trim($(".title").text());
var desc = $.trim($("#desc").text());
var imgUrl = $("#content img").eq(0).attr('src');
window.shareData = {
"imgUrl": imgUrl,
"timeLineLink":local,
"sendFriendLink": local,
"weiboLink":local,
"tTitle": title,
"tContent": desc,
"fTitle": title,
"fContent": desc,
"wContent": desc
};
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
// 发送给好友
WeixinJSBridge.on('menu:share:appmessage', function (argv) {
WeixinJSBridge.invoke('sendAppMessage', {
"img_url": window.shareData.imgUrl,
"img_width": "200",
"link": window.shareData.sendFriendLink,
"desc": window.shareData.fContent,
"title": window.shareData.fTitle
}, function (res) {
hs_guide('none');
_report('send_msg', res.err_msg);
})
});
// 分享到朋友圈
WeixinJSBridge.on('menu:share:timeline', function (argv) {
WeixinJSBridge.invoke('shareTimeline', {
"img_url": window.shareData.imgUrl,
"img_width": "200",
"link": window.shareData.timeLineLink,
"desc": window.shareData.tContent,
"title": window.shareData.tTitle
}, function (res) {
hs_guide('none');
_report('timeline', res.err_msg);
});
});
// 分享到微博
WeixinJSBridge.on('menu:share:weibo', function (argv) {
WeixinJSBridge.invoke('shareWeibo', {
"content": window.shareData.wContent,
"url": window.shareData.weiboLink,
}, function (res) {
hs_guide('none');
_report('weibo', res.err_msg);
});
});
}, false);
}
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("无");
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);
}
//-----------
// 分享与评论
// 得到登录的链接
function goLogin(){
var loginUrl = siteUrl + '/login?from=' + encodeURI(location.href);
location.href = loginUrl;
}
// 得到注册链接
function goRegister() {
var registerUrl = siteUrl + '/register?from=' + encodeURI(location.href);
location.href = registerUrl;
}
// 是否需要登录, 评论时用到
function needLogin() {
if(typeof visitUserInfo == "undefined" || !visitUserInfo || !visitUserInfo.UserId) {
// 弹框之
var loginUrl = siteUrl + '/login?from=' + encodeURI(location.href);
var registerUrl = siteUrl + '/register?from=' + encodeURI(location.href);
try {
var modal = BootstrapDialog.show({
title: "你还未登录",
message: '<div class="needLogin" style="border:none"><a href="' + loginUrl + '">立即登录</a>, 发表评论.<br />没有帐号? <a href="' + registerUrl +'">立即注册</a>',
nl2br: false
});
} catch(e) {}
return true;
}
return false;
}
// 定位评论
function scrollToTarget(t, fixed) {
if(!fixed) {
fixed = 0;
}
var $t = $(t)
var targetOffset = $t.offset().top + fixed;
$('html,body').animate({scrollTop: targetOffset}, 300);
}
// 得到访问者信息, 因为自定义域名的原因, 需要用jsonp来获取
function getCurVisitUserInfo() {
}
// 增加阅读次数
function incReadNum(noteId) {
if(!$.cookie(noteId)) {
$.cookie(noteId, 1);
ajaxGet(getCurHostUrl() + "/blog/incReadNum", {noteId: noteId});
}
}
function getCurHostUrl() {
return "//" + location.host;
}
function getLeanoteUrl() {
return siteUrl || "http://leanote.com";
}
// 得到博客统计信息
function getPostStat(noteId, callback) {
ajaxGet(getCurHostUrl() + "/blog/getPostStat", {noteId: noteId}, callback);
}
// 得到赞
function getLikes(noteId, callback) {
ajaxGetP(getLeanoteUrl() + "/blog/getLikes", {noteId: noteId}, callback);
}
// 得到赞和评论
function getLikesAndComments(noteId, callback) {
ajaxGetP(getLeanoteUrl() + "/blog/getLikesAndComments", {noteId: noteId}, callback);
}
// 得到评论
function getComments(noteId, page) {
ajaxGetP(getLeanoteUrl() + "/blog/listComments", {noteId: noteId, page: page}, callback);
}
// 点赞
function likePost(noteId, callback) {
ajaxPostP(getLeanoteUrl() + "/blog/likePost", {noteId: noteId}, callback)
}
// 提交评论
function commentPost(noteId, commentId, content, callback) {
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
ajaxPostP(getLeanoteUrl() + "/blog/commentPost", data, callback);
}
// 删除评论
function deleteComment(noteId, commentId, callback) {
ajaxPostP(getLeanoteUrl() + "/blog/deleteComment", {noteId: noteId, commentId: commentId}, callback);
}
// 点赞评论
function likeComment(commentId, callback) {
ajaxPostP(getLeanoteUrl() + "/blog/likeComment", {commentId: commentId}, callback);
}
// 分享与评论结束
//------------
//------------
// 手机端
var LEA = {isMobile: false};
function isMobile() {
var u = navigator.userAgent;
LEA.isMobile = false;
LEA.isMobile = /Mobile|Android|iPhone/i.test(u);
if(!LEA.isMobile && $(document).width() <= 600){
LEA.isMobile = true
}
}
$(function() {
isMobile();
});
+1
View File
@@ -0,0 +1 @@
(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)}});
+28
View File
@@ -0,0 +1,28 @@
(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);
File diff suppressed because it is too large. Load diff
+372
View File
@@ -0,0 +1,372 @@
// leanote blog share & comment
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(blogInfo.OpenComment && blogInfo.CommentType != "disqus") {
self.initLikesAndComments();
} else {
self.initLikes();
}
self.initEvent();
self.incReadNum();
//
},
// 博客的统计信息
getPostStat: function() {
},
// 增加阅读量
incReadNum: function() {
incReadNum(self.noteId);
},
initLikes: function() {
var self = this;
getLikes(self.noteId, function(ret) {
if(reIsOk(ret)) {
ret = ret.Item;
self.info = ret;
self.toggleLikeBtnActive();
self.renderLikers();
self.visitUserInfo = self.info.visitUserInfo || {};
}
});
},
initLikesAndComments: function() {
var self = this;
getLikesAndComments(self.noteId, function(ret) {
if(reIsOk(ret)) {
ret = ret.Item;
self.info = ret;
self.toggleLikeBtnActive();
self.renderLikers();
// 是否需要renderComments?
self.info.commentUserInfo = self.info.commentUserInfo || {};
self.visitUserInfo = self.info.visitUserInfo || {};
// 为了防止第一条评论找不到用户信息情况
if(self.visitUserInfo.UserId) {
self.info.commentUserInfo[self.visitUserInfo.UserId] = self.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();
}
// 是否已经登录?
if(self.visitUserInfo.UserId) {
$("#commentForm").removeClass("hide");
$("#visitUserLogo").attr("src", self.visitUserInfo.Logo);
} else {
$("#noLoginContainer").removeClass("hide");
}
}
});
},
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");
getComments(self.noteId, 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: self.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({comments: [comment], visitUserInfo: self.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 = blogInfo.UserId;
commentUserInfo = self.info.commentUserInfo;
comment.UserInfo = commentUserInfo[comment.UserId];
// 是作者自己
if(self.visitUserInfo.UserId == authorUserId) {
comment.IsMyNote = true;
}
if(comment.UserId == authorUserId) {
comment.IsAuthorComment = true;
}
if(comment.UserId == self.visitUserInfo.UserId) {
comment.IsMyComment = true;
}
// 不是回复自己
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
if(comment.ToUserInfo.UserId == authorUserId) {
comment.ToUserIsAuthor = true;
}
}
comment.PublishDate = getDateDiff(goNowToDate(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({comments: comments, visitUserInfo: self.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 == self.visitUserInfo.UserId) {
likedUsers.splice(i, 1);
break;
}
}
if(addMe) {
likedUsers = [self.visitUserInfo].concat(likedUsers);
self.info.likedUsers = likedUsers;
}
self.renderLikers();
},
renderLikers: function() {
var self = this;
var users = self.info.likedUsers || [];
var html = self.tLikersO.render({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(!self.visitUserInfo.UserId) {
needLogin();
return;
}
likePost(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};
commentPost(self.noteId, commentId, content, 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;
try {
BootstrapDialog.confirm("确定删除该评论?", function(yes) {
if(yes) {
deleteComment(noteId, commentId, function(ret) {
if(ret.Ok) {
var li = $(t).closest("li");
li.hide(500); // remove();
setTimeout(function() {
li.remove();
}, 300);
self.bindCommentNum(-1);
}
});
}
});
} catch(e) {}
});
// 点zan
$(".comment-box").on("click", ".comment-like", function(e) {
var commentId = $(this).parent().data("comment-id");
var t = this;
likeComment(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("取消赞");
} else {
$(t).find(".like-text").text("赞");
}
}
});
});
$(".comment-box").on("click", ".comment-report", function() {
if(needLogin()) {
return;
}
var commentId = $(this).parent().data("comment-id");
report(commentId, self.noteId, "举报评论?");
});
self.initShare();
},
weixinQRCodeO: $("#weixinQRCode"),
initShare: function() {
var self = this;
$(".btn-weixin").click(function() {
if(!self.weixinQRCodeO.html()) {
self.weixinQRCodeO.qrcode(location.href);
}
BootstrapDialog.show({
title: "打开微信扫一扫二维码",
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();
});
+1
View File
@@ -0,0 +1 @@
这里面是leanote默认主题
+47
View File
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="zh">
<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">
<title>404</title>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
<link href="/css/index.css" rel="stylesheet">
<style>
html, body {
height: 100%;
}
</style>
</head>
<body id="boxBody">
<section id="box">
<div>
<div>
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
</div>
<div id="errorBox">
<p class="error-info">
This page cann't found.
</p>
<div class="list-group m-b-sm bg-white m-b-lg">
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
<a class="list-group-item" href="mailto:leanote@leanote.com">
<span class="badge">leanote@leanote.com</span>
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
</div>
</div>
</div>
</section>
<div id="boxFooter">
<p>
<a href="/index">leanote</a> © 2014
</p>
</div>
</body>
</html>
+30
View File
@@ -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>
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
</li>
{{end}}
</ul>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+42
View File
@@ -0,0 +1,42 @@
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+51
View File
@@ -0,0 +1,51 @@
<div id="footerContainer">
{{$userId := $.blogInfo.UserId}}
<div class="container" id="footer">
<div class="col-md-4">
<h3>导航</h3>
<ul>
<li><a href="{{$.indexUrl}}">主页</a></li>
{{range $.cates}}
<li>
<a href="{{$.cateUrl}}/{{.CateId}}">{{.Title}}</a>
</li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>最近发表</h3>
<ul>
{{range .recentPosts}}
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.NoteId}}/">{{.Title}}</a></li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>友情链接 </h3>
<ul>
{{if $.themeInfo.FriendLinks}}
{{range $.themeInfo.FriendLinks}}
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
{{end}}
{{end}}
</ul>
</div>
</div>
</div>
<script src="{{$.jQueryUrl}}"></script>
<script src="{{$.bootstrapJsUrl}}"></script>
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.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>
+120
View File
@@ -0,0 +1,120 @@
<!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, not only a notebook">
<meta name="author" content="leanote">
<title>
{{if $.curIsIndex}}
{{$.blogInfo.Title}}
{{else if $.curIsCate}}
分类-{{$.curCateTitle}}
{{else if $.curIsView}}
{{$.post.Title}}
{{else if $.curIsSearch}}
搜索-{{$.keywords}}
{{else if $.curIsTags}}
我的标签
{{else if $.curIsTagPosts}}
标签-{{$.curTag}}
{{else}}
我的博客
{{end}}
</title>
<!-- Bootstrap core CSS -->
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
<!-- 字体必须同一域 -->
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
<link href="{{$.themeBaseUrl}}/style.css" 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>
@@ -0,0 +1,6 @@
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
<script src="{{$.prettifyJsUrl}}"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

+39
View File
@@ -0,0 +1,39 @@
{{template "header.html" .}}
<div id="postsContainer">
<div id="posts">
{{range $.posts}}
<div class="each-post">
<div class="title">
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+1
View File
@@ -0,0 +1 @@
aaaaaaaaaaaaaaaaaaa
+27
View File
@@ -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}}
+143
View File
@@ -0,0 +1,143 @@
{{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}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.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}}
&nbsp;
<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="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
</p>
<p>
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
</p>
</div>
<!-- share & comment -->
{{template "share_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>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些在share_comment.js 需要使用的变量 -->
<script>
var siteUrl = "{{$.siteUrl}}"; // common.js需要
// 以下 share_comment.js需要
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
var noteId = "{{$.post.NoteId}}"; //
var preLikeNum = +"{{$.post.LikeNum}}";
var commentNum = +"{{$.post.CommentNum}}";
</script>
<!-- 共享与评论css -->
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
<!-- 一些公用的js -->
<script src="{{$.blogCommonJsUrl}}"></script>
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
<!-- share && comment -->
<script src="{{$.shareCommentJsUrl}}"></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>
+49
View File
@@ -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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
@@ -0,0 +1,172 @@
<!-- 赞 -->
<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">{{$.post.LikeNum}}</span> 赞</button>
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
</div>
<div class="right-section">
<div id="weixinQRCode"></div>
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</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>
更多分享
</div>
<ul class="dropdown-menu" role="menu">
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
</ul>
</div>
</div>
<div class="voters clearfix" id="likers">
</div>
</div>
<script type="text/x-jsrender" id="tLikers">
[[for users]]
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" 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 $.blogInfo.OpenComment (not (eq $.blogInfo.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="[[:UserInfo.BlogUrl]]">
<img class="avatar" src="[[:UserInfo.Logo]]">
</a>
<!-- 评论 -->
<div class="comment-body">
<div class="comment-hd">
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
[[if IsAuthorComment]]
<span>(作者)</span>
[[/if]]
<!-- 回复其它人 -->
[[if ToUserInfo]]
<span class="in-reply-to">
回复
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
</span>
[[if ToUserIsAuthor]]
<span>(作者)</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]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
[[if ~root.visitUserInfo.UserId]]
[[if IsMyNote && !IsMyComment]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
[[/if]]
[[if !IsMyComment]]
<a href="javascript:;" class="comment-reply op-link ">
<i class="fa fa-reply"></i>
回复
</a>
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
[[else]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</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="回复"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
<a class="cancel reply-cancel btn-link">取消</a>
</div>
</form>
[[/if]]
</div>
</li>
[[/for]]
</script>
<!-- 评论 -->
<div class="comment-box hide">
<form class="comment-form comment-box-ft hide" id="commentForm">
<div class="clearfix">
<div class="avatar-wrap">
<img class="avatar" id="visitUserLogo">
</div>
<div class="editor-wrap">
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
</div>
</form>
<div class="needLogin hide" id="noLoginContainer">
<a onclick="goLogin()">立即登录</a>, 发表评论.
<br />
没有帐号? <a onclick="goRegister()">立即注册</a>
</div>
<div class="box-header">
<span class="counter">
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
</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>
{{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 = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.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}}
+53
View File
@@ -0,0 +1,53 @@
{{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> 更新 {{$.single.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.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>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些公用的js -->
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
<script>
$(function() {
initNav();
});
</script>
</body>
</html>
+505
View File
@@ -0,0 +1,505 @@
#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;
}
/*"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;
}
}
+47
View File
@@ -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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+26
View File
@@ -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}} {{.Count}}
</a>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+27
View File
@@ -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"}
]
}
+47
View File
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="zh">
<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">
<title>404</title>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
<link href="/css/index.css" rel="stylesheet">
<style>
html, body {
height: 100%;
}
</style>
</head>
<body id="boxBody">
<section id="box">
<div>
<div>
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
</div>
<div id="errorBox">
<p class="error-info">
This page cann't found.
</p>
<div class="list-group m-b-sm bg-white m-b-lg">
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
<a class="list-group-item" href="mailto:leanote@leanote.com">
<span class="badge">leanote@leanote.com</span>
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
</div>
</div>
</div>
</section>
<div id="boxFooter">
<p>
<a href="/index">leanote</a> © 2014
</p>
</div>
</body>
</html>
+30
View File
@@ -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>
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
</li>
{{end}}
</ul>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+42
View File
@@ -0,0 +1,42 @@
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+51
View File
@@ -0,0 +1,51 @@
<div id="footerContainer">
{{$userId := $.blogInfo.UserId}}
<div class="container" id="footer">
<div class="col-md-4">
<h3>导航</h3>
<ul>
<li><a href="{{$.indexUrl}}">主页</a></li>
{{range $.cates}}
<li>
<a href="{{$.cateUrl}}/{{.CateId}}">{{.Title}}</a>
</li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>最近发表</h3>
<ul>
{{range .recentPosts}}
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.NoteId}}/">{{.Title}}</a></li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>友情链接 </h3>
<ul>
{{if $.themeInfo.FriendLinks}}
{{range $.themeInfo.FriendLinks}}
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
{{end}}
{{end}}
</ul>
</div>
</div>
</div>
<script src="{{$.jQueryUrl}}"></script>
<script src="{{$.bootstrapJsUrl}}"></script>
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.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>
+122
View File
@@ -0,0 +1,122 @@
<!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, not only a notebook">
<meta name="author" content="leanote">
<title>
{{if $.curIsIndex}}
{{$.blogInfo.Title}}
{{else if $.curIsCate}}
分类-{{$.curCateTitle}}
{{else if $.curIsSearch}}
搜索-{{$.keywords}}
{{else if $.curIsTags}}
我的标签
{{else if $.curIsTagPosts}}
标签-{{$.curTag}}
{{else if $.curIsPost}}
{{$.post.Title}}
{{else if $.curIsSingle}}
{{$.single.Title}}
{{else if $.curIsArchive}}
归档
{{end}}
</title>
<!-- Bootstrap core CSS -->
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
<!-- 字体必须同一域 -->
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
<link href="{{$.themeBaseUrl}}/style.css" 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>
@@ -0,0 +1,6 @@
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
<script src="{{$.prettifyJsUrl}}"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

+39
View File
@@ -0,0 +1,39 @@
{{template "header.html" .}}
<div id="postsContainer">
<div id="posts">
{{range $.posts}}
<div class="each-post">
<div class="title">
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+27
View File
@@ -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}}
+143
View File
@@ -0,0 +1,143 @@
{{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}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.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}}
&nbsp;
<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="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
</p>
<p>
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
</p>
</div>
<!-- share & comment -->
{{template "share_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>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些在share_comment.js 需要使用的变量 -->
<script>
var siteUrl = "{{$.siteUrl}}"; // common.js需要
// 以下 share_comment.js需要
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
var noteId = "{{$.post.NoteId}}"; //
var preLikeNum = +"{{$.post.LikeNum}}";
var commentNum = +"{{$.post.CommentNum}}";
</script>
<!-- 共享与评论css -->
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
<!-- 一些公用的js -->
<script src="{{$.blogCommonJsUrl}}"></script>
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
<!-- share && comment -->
<script src="{{$.shareCommentJsUrl}}"></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>
+49
View File
@@ -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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
@@ -0,0 +1,172 @@
<!-- 赞 -->
<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">{{$.post.LikeNum}}</span> 赞</button>
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
</div>
<div class="right-section">
<div id="weixinQRCode"></div>
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</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>
更多分享
</div>
<ul class="dropdown-menu" role="menu">
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
</ul>
</div>
</div>
<div class="voters clearfix" id="likers">
</div>
</div>
<script type="text/x-jsrender" id="tLikers">
[[for users]]
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" 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 $.blogInfo.OpenComment (not (eq $.blogInfo.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="[[:UserInfo.BlogUrl]]">
<img class="avatar" src="[[:UserInfo.Logo]]">
</a>
<!-- 评论 -->
<div class="comment-body">
<div class="comment-hd">
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
[[if IsAuthorComment]]
<span>(作者)</span>
[[/if]]
<!-- 回复其它人 -->
[[if ToUserInfo]]
<span class="in-reply-to">
回复
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
</span>
[[if ToUserIsAuthor]]
<span>(作者)</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]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
[[if ~root.visitUserInfo.UserId]]
[[if IsMyNote && !IsMyComment]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
[[/if]]
[[if !IsMyComment]]
<a href="javascript:;" class="comment-reply op-link ">
<i class="fa fa-reply"></i>
回复
</a>
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
[[else]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</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="回复"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
<a class="cancel reply-cancel btn-link">取消</a>
</div>
</form>
[[/if]]
</div>
</li>
[[/for]]
</script>
<!-- 评论 -->
<div class="comment-box hide">
<form class="comment-form comment-box-ft hide" id="commentForm">
<div class="clearfix">
<div class="avatar-wrap">
<img class="avatar" id="visitUserLogo">
</div>
<div class="editor-wrap">
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
</div>
</form>
<div class="needLogin hide" id="noLoginContainer">
<a onclick="goLogin()">立即登录</a>, 发表评论.
<br />
没有帐号? <a onclick="goRegister()">立即注册</a>
</div>
<div class="box-header">
<span class="counter">
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
</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>
{{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 = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.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}}
+53
View File
@@ -0,0 +1,53 @@
{{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> 更新 {{$.single.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.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>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些公用的js -->
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
<script>
$(function() {
initNav();
});
</script>
</body>
</html>
+519
View File
@@ -0,0 +1,519 @@
#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;
}
/*"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;
}
}
+47
View File
@@ -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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+26
View File
@@ -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}} {{.Count}}
</a>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+31
View File
@@ -0,0 +1,31 @@
/*
以下是本主题的配置, 采用JSON格式
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
注意:
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
2) 以下配置不能包含任何注释, 不然解析会出错!
请在此解析所有配置
* Name 主题名
* Version 主题版本
* Author 主题的作者
* AuthorUrl 作者的博客链接或相关链接
* FriendLinks 友情链接
*/
{
"Name": "leanote-elegant",
"Version": "1.0",
"Author": "leanote.com",
"AuthorUrl": "http://leanote.com",
"FriendLinks": [
{"Title": "我的笔记", "Url": "http://leanote.com/note"},
{"Title": "leanote home", "Url": "http://leanote.com"},
{"Title": "leanote 社区", "Url": "http://bbs.leanote.com"},
{"Title": "lea++", "Url": "http://lea.leanote.com"},
{"Title": "leanote github", "Url": "https://github.com/leanote/leanote"}
]
}
+47
View File
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="zh">
<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">
<title>404</title>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
<link href="/css/index.css" rel="stylesheet">
<style>
html, body {
height: 100%;
}
</style>
</head>
<body id="boxBody">
<section id="box">
<div>
<div>
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
</div>
<div id="errorBox">
<p class="error-info">
This page cann't found.
</p>
<div class="list-group m-b-sm bg-white m-b-lg">
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
<a class="list-group-item" href="mailto:leanote@leanote.com">
<span class="badge">leanote@leanote.com</span>
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
</div>
</div>
</div>
</section>
<div id="boxFooter">
<p>
<a href="/index">leanote</a> © 2014
</p>
</div>
</body>
</html>
+30
View File
@@ -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>
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
</li>
{{end}}
</ul>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+42
View File
@@ -0,0 +1,42 @@
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+51
View File
@@ -0,0 +1,51 @@
<div id="footerContainer">
{{$userId := $.blogInfo.UserId}}
<div class="container" id="footer">
<div class="col-md-4">
<h3>导航</h3>
<ul>
<li><a href="{{$.indexUrl}}">主页</a></li>
{{range $.cates}}
<li>
<a href="{{$.cateUrl}}/{{.CateId}}">{{.Title}}</a>
</li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>最近发表</h3>
<ul>
{{range .recentPosts}}
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.NoteId}}/">{{.Title}}</a></li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>友情链接 </h3>
<ul>
{{if $.themeInfo.FriendLinks}}
{{range $.themeInfo.FriendLinks}}
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
{{end}}
{{end}}
</ul>
</div>
</div>
</div>
<script src="{{$.jQueryUrl}}"></script>
<script src="{{$.bootstrapJsUrl}}"></script>
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.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>
+120
View File
@@ -0,0 +1,120 @@
<!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, not only a notebook">
<meta name="author" content="leanote">
<title>
{{if $.curIsIndex}}
{{$.blogInfo.Title}}
{{else if $.curIsCate}}
分类-{{$.curCateTitle}}
{{else if $.curIsView}}
{{$.post.Title}}
{{else if $.curIsSearch}}
搜索-{{$.keywords}}
{{else if $.curIsTags}}
我的标签
{{else if $.curIsTagPosts}}
标签-{{$.curTag}}
{{else}}
我的博客
{{end}}
</title>
<!-- Bootstrap core CSS -->
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
<!-- 字体必须同一域 -->
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
<link href="{{$.themeBaseUrl}}/style.css" 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>
@@ -0,0 +1,6 @@
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
<script src="{{$.prettifyJsUrl}}"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

+39
View File
@@ -0,0 +1,39 @@
{{template "header.html" .}}
<div id="postsContainer">
<div id="posts">
{{range $.posts}}
<div class="each-post">
<div class="title">
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+27
View File
@@ -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}}
+143
View File
@@ -0,0 +1,143 @@
{{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}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.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}}
&nbsp;
<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="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
</p>
<p>
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
</p>
</div>
<!-- share & comment -->
{{template "share_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>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些在share_comment.js 需要使用的变量 -->
<script>
var siteUrl = "{{$.siteUrl}}"; // common.js需要
// 以下 share_comment.js需要
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
var noteId = "{{$.post.NoteId}}"; //
var preLikeNum = +"{{$.post.LikeNum}}";
var commentNum = +"{{$.post.CommentNum}}";
</script>
<!-- 共享与评论css -->
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
<!-- 一些公用的js -->
<script src="{{$.blogCommonJsUrl}}"></script>
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
<!-- share && comment -->
<script src="{{$.shareCommentJsUrl}}"></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>
+49
View File
@@ -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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
@@ -0,0 +1,172 @@
<!-- 赞 -->
<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">{{$.post.LikeNum}}</span> 赞</button>
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
</div>
<div class="right-section">
<div id="weixinQRCode"></div>
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</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>
更多分享
</div>
<ul class="dropdown-menu" role="menu">
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
</ul>
</div>
</div>
<div class="voters clearfix" id="likers">
</div>
</div>
<script type="text/x-jsrender" id="tLikers">
[[for users]]
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" 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 $.blogInfo.OpenComment (not (eq $.blogInfo.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="[[:UserInfo.BlogUrl]]">
<img class="avatar" src="[[:UserInfo.Logo]]">
</a>
<!-- 评论 -->
<div class="comment-body">
<div class="comment-hd">
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
[[if IsAuthorComment]]
<span>(作者)</span>
[[/if]]
<!-- 回复其它人 -->
[[if ToUserInfo]]
<span class="in-reply-to">
回复
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
</span>
[[if ToUserIsAuthor]]
<span>(作者)</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]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
[[if ~root.visitUserInfo.UserId]]
[[if IsMyNote && !IsMyComment]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
[[/if]]
[[if !IsMyComment]]
<a href="javascript:;" class="comment-reply op-link ">
<i class="fa fa-reply"></i>
回复
</a>
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
[[else]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</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="回复"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
<a class="cancel reply-cancel btn-link">取消</a>
</div>
</form>
[[/if]]
</div>
</li>
[[/for]]
</script>
<!-- 评论 -->
<div class="comment-box hide">
<form class="comment-form comment-box-ft hide" id="commentForm">
<div class="clearfix">
<div class="avatar-wrap">
<img class="avatar" id="visitUserLogo">
</div>
<div class="editor-wrap">
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
</div>
</form>
<div class="needLogin hide" id="noLoginContainer">
<a onclick="goLogin()">立即登录</a>, 发表评论.
<br />
没有帐号? <a onclick="goRegister()">立即注册</a>
</div>
<div class="box-header">
<span class="counter">
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
</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>
{{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 = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.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}}
+53
View File
@@ -0,0 +1,53 @@
{{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> 更新 {{$.single.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.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>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些公用的js -->
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
<script>
$(function() {
initNav();
});
</script>
</body>
</html>
+556
View File
@@ -0,0 +1,556 @@
#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;
}
/*"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="{{$.postUrl}}/{{.NoteId}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+26
View File
@@ -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}} {{.Count}}
</a>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+27
View File
@@ -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"}
]
}
+142
View File
@@ -0,0 +1,142 @@
{{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}}
&nbsp;
<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>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些在share_comment.js 需要使用的变量 -->
<script>
var siteUrl = "{{$.siteUrl}}"; // common.js需要
// 以下 share_comment.js需要
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
var noteId = "{{$.post.NoteId}}"; //
var preLikeNum = +"{{$.post.LikeNum}}";
var commentNum = +"{{$.post.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}}/share_comment.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>
+114
View File
@@ -0,0 +1,114 @@
define('import_theme', ['jquery.ui.widget', 'fileupload'], function(){
// 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 setDropStyle(dropzoneId, formId) {
// drag css
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("#dropAvatar", "#uploadAvatar");
var initUploader = function() {
$('.dropzone .btn-choose-file').click(function() {
$(this).parent().find('input').click();
});
var $msg2 = $('#avatarUploadMsg');
$('#uploadAvatar').fileupload({
dataType: 'json',
dropZone: $('#dropAvatar'),
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>');
// Append the file name and file size
tpl.append(data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small>');
// Add the HTML to the UL element
$msg2.html(tpl);
data.context = $msg2;
// 检查文件大小
var size = data.files[0].size;
if(typeof size == 'number' && size > 10 * 1024 * 1024) {
tpl.find("img").remove();
tpl.removeClass("alert-info").addClass("alert-danger");
tpl.append("Warning: File size is bigger than 10M");
return;
}
// Automatically upload the file once it is added to the queue
var jqXHR;
setTimeout(function() {
jqXHR = data.submit();
}, 10);
},
done: function(e, data) {
if (data.result.Ok == true) {
data.context.html("");
var re = data.result;
art.tips("Success");
setTimeout(function() {
location.reload();
}, 1000);
} 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);
}
},
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), 3000);
}
});
}
initUploader();
});
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
(function(){function o(e){var i=function(e,t){return r("",e,t)},s=t;e&&(t[e]||(t[e]={}),s=t[e]);if(!s.define||!s.define.packaged)n.original=s.define,s.define=n,s.define.packaged=!0;if(!s.require||!s.require.packaged)r.original=s.require,s.require=i,s.require.packaged=!0}var e="ace",t=function(){return this}();if(!e&&typeof requirejs!="undefined")return;var n=function(e,t,r){if(typeof e!="string"){n.original?n.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=t),n.modules||(n.modules={},n.payloads={}),n.payloads[e]=r,n.modules[e]=null},r=function(e,t,n){if(Object.prototype.toString.call(t)==="[object Array]"){var i=[];for(var o=0,u=t.length;o<u;++o){var a=s(e,t[o]);if(!a&&r.original)return r.original.apply(window,arguments);i.push(a)}n&&n.apply(null,i)}else{if(typeof t=="string"){var f=s(e,t);return!f&&r.original?r.original.apply(window,arguments):(n&&n(),f)}if(r.original)return r.original.apply(window,arguments)}},i=function(e,t){if(t.indexOf("!")!==-1){var n=t.split("!");return i(e,n[0])+"!"+i(e,n[1])}if(t.charAt(0)=="."){var r=e.split("/").slice(0,-1).join("/");t=r+"/"+t;while(t.indexOf(".")!==-1&&s!=t){var s=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},s=function(e,t){t=i(e,t);var s=n.modules[t];if(!s){s=n.payloads[t];if(typeof s=="function"){var o={},u={id:t,uri:"",exports:o,packaged:!0},a=function(e,n){return r(t,e,n)},f=s(a,o,u);o=f||u.exports,n.modules[t]=o,delete n.payloads[t]}s=n.modules[t]=o||s}return s};o(e)})(),ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"],function(e,t,n){e("./lib/fixoldbrowsers");var r=e("./lib/dom"),i=e("./lib/event"),s=e("./editor").Editor,o=e("./edit_session").EditSession,u=e("./undomanager").UndoManager,a=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.require=e,t.edit=function(e){if(typeof e=="string"){var n=e;e=document.getElementById(n);if(!e)throw new Error("ace.edit can't find div #"+n)}if(e.env&&e.env.editor instanceof s)return e.env.editor;var o=t.createEditSession(r.getInnerText(e));e.innerHTML="";var u=new s(new a(e));u.setSession(o);var f={document:o,editor:u,onResize:u.resize.bind(u,null)};return i.addListener(window,"resize",f.onResize),u.on("destroy",function(){i.removeListener(window,"resize",f.onResize)}),e.env=u.env=f,u},t.createEditSession=function(e,t){var n=new o(e,t);return n.setUndoManager(new u),n},t.EditSession=o,t.UndoManager=u}),ace.define("ace/mode/behaviour",["require","exports","module"],function(e,t,n){var r=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(undefined){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if(typeof e=="function")var n=(new e).getBehaviours(t);else var n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(!e)return this.$behaviours;var t={};for(var n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}}).call(r.prototype),t.Behaviour=r}),ace.define("ace/unicode",["require","exports","module"],function(e,t,n){function r(e){var n=/\w{4}/g;for(var r in e)t.packages[r]=e[r].replace(n,"\\u$&")}t.packages={},r({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70ELine truncated
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator","ace/ext/beautify/php_rules"],function(e,t,n){var r=e("ace/token_iterator").TokenIterator,i=e("./beautify/php_rules").transform;t.beautify=function(e){var t=new r(e,0,0),n=t.getCurrentToken(),s=e.$modeId.split("/").pop(),o=i(t,s);e.doc.setValue(o)},t.commands=[{name:"beautify",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]}),ace.define("ace/ext/beautify/php_rules",["require","exports","module","ace/token_iterator"],function(e,t,n){var r=e("ace/token_iterator").TokenIterator;t.newLines=[{type:"support.php_tag",value:"<?php"},{type:"support.php_tag",value:"<?"},{type:"support.php_tag",value:"?>"},{type:"paren.lparen",value:"{",indent:!0},{type:"paren.rparen",breakBefore:!0,value:"}",indent:!1},{type:"paren.rparen",breakBefore:!0,value:"})",indent:!1,dontBreak:!0},{type:"comment"},{type:"text",value:";"},{type:"text",value:":",context:"php"},{type:"keyword",value:"case",indent:!0,dontBreak:!0},{type:"keyword",value:"default",indent:!0,dontBreak:!0},{type:"keyword",value:"break",indent:!1,dontBreak:!0},{type:"punctuation.doctype.end",value:">"},{type:"meta.tag.punctuation.end",value:">"},{type:"meta.tag.punctuation.begin",value:"<",blockTag:!0,indent:!0,dontBreak:!0},{type:"meta.tag.punctuation.begin",value:"</",indent:!1,breakBefore:!0,dontBreak:!0},{type:"punctuation.operator",value:";"}],t.spaces=[{type:"xml-pe",prepend:!0},{type:"entity.other.attribute-name",prepend:!0},{type:"storage.type",value:"var",append:!0},{type:"storage.type",value:"function",append:!0},{type:"keyword.operator",value:"="},{type:"keyword",value:"as",prepend:!0,append:!0},{type:"keyword",value:"function",append:!0},{type:"support.function",next:/[^\(]/,append:!0},{type:"keyword",value:"or",append:!0,prepend:!0},{type:"keyword",value:"and",append:!0,prepend:!0},{type:"keyword",value:"case",append:!0},{type:"keyword.operator",value:"||",append:!0,prepend:!0},{type:"keyword.operator",value:"&&",append:!0,prepend:!0}],t.singleTags=["!doctype","area","base","br","hr","input","img","link","meta"],t.transform=function(e,n,r){var i=e.getCurrentToken(),s=t.newLines,o=t.spaces,u=t.singleTags,a="",f=0,l=!1,c,h,p={},d,v={},m=!1,g="";while(i!==null){console.log(i);if(!i){i=e.stepForward();continue}i.type=="support.php_tag"&&i.value!="?>"?r="php":i.type=="support.php_tag"&&i.value=="?>"?r="html":i.type=="meta.tag.name.style"&&r!="css"?r="css":i.type=="meta.tag.name.style"&&r=="css"?r="html":i.type=="meta.tag.name.script"&&r!="js"?r="js":i.type=="meta.tag.name.script"&&r=="js"&&(r="html"),v=e.stepForward(),v&&v.type.indexOf("meta.tag.name")==0&&(d=v.value),p.type=="support.php_tag"&&p.value=="<?="&&(l=!0),i.type=="meta.tag.name"&&(i.value=i.value.toLowerCase()),i.type=="text"&&(i.value=i.value.trim());if(!i.value){i=v;continue}g=i.value;for(var y in o)i.type==o[y].type&&(!o[y].value||i.value==o[y].value)&&v&&(!o[y].next||o[y].next.test(v.value))&&(o[y].prepend&&(g=" "+i.value),o[y].append&&(g+=" "));i.type.indexOf("meta.tag.name")==0&&(c=i.value),m=!1;for(y in s)if(i.type==s[y].type&&(!s[y].value||i.value==s[y].value)&&(!s[y].blockTag||u.indexOf(d)===-1)&&(!s[y].context||s[y].context===r)){s[y].indent===!1&&f--;if(s[y].breakBefore&&(!s[y].prev||s[y].prev.test(p.value))){a+="\n",m=!0;for(y=0;y<f;y++)a+=" "}break}if(l===!1)for(y in s)if(p.type==s[y].type&&(!s[y].value||p.value==s[y].value)&&(!s[y].blockTag||u.indexOf(c)===-1)&&(!s[y].context||s[y].context===r)){s[y].indent===!0&&f++;if(!s[y].dontBreak&&!m){a+="\n";for(y=0;y<f;y++)a+=" "}break}a+=g,p.type=="support.php_tag"&&p.value=="?>"&&(l=!1),h=c,p=i,i=v;if(i===null)break}return a}}),function(){ace.require(["ace/ext/beautify"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/chromevox",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function gt(){return typeof cvox!="undefined"&&cvox&&cvox.Api}function wt(e){if(gt())mt(e);else{yt++;if(yt>=bt)return;window.setTimeout(wt,500,e)}}var r={};r.SpeechProperty,r.Cursor,r.Token,r.Annotation;var i={rate:.8,pitch:.4,volume:.9},s={rate:1,pitch:.5,volume:.9},o={rate:.8,pitch:.8,volume:.9},u={rate:.8,pitch:.3,volume:.9},a={rate:.8,pitch:.7,volume:.9},f={rate:.8,pitch:.8,volume:.9},l={punctuationEcho:"none",relativePitch:-0.6},c="ALERT_NONMODAL",h="ALERT_MODAL",p="INVALID_KEYPRESS",d="insertMode",v="start",m=[{substr:";",newSubstr:" semicolon "},{substr:":",newSubstr:" colon "}],g={SPEAK_ANNOT:"annots",SPEAK_ALL_ANNOTS:"all_annots",TOGGLE_LOCATION:"toggle_location",SPEAK_MODE:"mode",SPEAK_ROW_COL:"row_col",TOGGLE_DISPLACEMENT:"toggle_displacement",FOCUS_TEXT:"focus_text"},y="CONTROL + SHIFT ";r.editor=null;var b=null,w={},E=!1,S=!1,x=!1,T=null,N={},C={},k=function(e){return y+String.fromCharCode(e)},L=function(){var e=r.editor.keyBinding.getKeyboardHandler();return e.$id==="ace/keyboard/vim"},A=function(e){return r.editor.getSession().getTokenAt(e.row,e.column+1)},O=function(e){return r.editor.getSession().getLine(e.row)},M=function(e){w[e.row]&&cvox.Api.playEarcon(c),E?(cvox.Api.stop(),W(e),R(A(e)),I(e.row,1)):I(e.row,0)},_=function(e){var t=O(e),n=t.substr(e.column-1);e.column===0&&(n=" "+t);var r=/^\W(\w+)/,i=r.exec(n);return i!==null},D={constant:{prop:i},entity:{prop:o},keyword:{prop:u},storage:{prop:a},variable:{prop:f},meta:{prop:s,replace:[{substr:"</",newSubstr:" closing tag "},{substr:"/>",newSubstr:" close tag "},{substr:"<",newSubstr:" tag start "},{substr:">",newSubstr:" tag end "}]}},P={prop:P},H=function(e,t){var n=e;for(var r=0;r<t.length;r++){var i=t[r],s=new RegExp(i.substr,"g");n=n.replace(s,i.newSubstr)}return n},B=function(e,t,n){var r={};r.value="",r.type=e[t].type;for(var i=t;i<n;i++)r.value+=e[i].value;return r},j=function(e){if(e.length<=1)return e;var t=[],n=0;for(var r=1;r<e.length;r++){var i=e[n],s=e[r];U(i)!==U(s)&&(t.push(B(e,n,r)),n=r)}return t.push(B(e,n,e.length)),t},F=function(e){var t=r.editor.getSession().getLine(e),n=/^\s*$/;return n.exec(t)!==null},I=function(e,t){var n=r.editor.getSession().getTokens(e);if(n.length===0||F(e)){cvox.Api.playEarcon("EDITABLE_TEXT");return}n=j(n);var i=n[0];n=n.filter(function(e){return e!==i}),z(i,t),n.forEach(R)},q=function(e){z(e,0)},R=function(e){z(e,1)},U=function(e){if(!e||!e.type)return;var t=e.type.split(".");if(t.length===0)return;var n=t[0],r=D[n];return r?r:P},z=function(e,t){var n=U(e),r=H(e.value,m);n.replace&&(r=H(r,n.replace)),cvox.Api.speak(r,t,n.prop)},W=function(e){var t=O(e);cvox.Api.speak(t[e.column],1)},X=function(e,t){var n=O(t),r=n.substring(e.column,t.column);r=r.replace(/ /g," space "),cvox.Api.speak(r)},V=function(e,t){if(Math.abs(e.column-t.column)!==1){var n=O(t).length;if(t.column===0||t.column===n){I(t.row,0);return}if(_(t)){cvox.Api.stop(),R(A(t));return}}W(t)},$=function(e,t){r.editor.selection.isEmpty()?S?X(e,t):V(e,t):(X(e,t),cvox.Api.speak("selected",1))},J=function(e){if(x){x=!1;return}var t=r.editor.selection.getCursor();t.row!==b.row?M(t):$(b,t),b=t},K=function(e){r.editor.selection.isEmpty()&&cvox.Api.speak("unselected")},Q=function(e){var t=e.data;switch(t.action){case"removeText":cvox.Api.speak(t.text,0,l),x=!0;break;case"insertText":cvox.Api.speak(t.text,0),x=!0}},G=function(e){var t=e.row,n=e.column;return!w[t]||!w[t][n]},Y=function(e){w={};for(var t=0;t<e.length;t++){var n=e[t],r=n.row,i=n.column;w[r]||(w[r]={}),w[r][i]=n}},Z=function(e){var t=r.editor.getSession().getAnnotations(),n=t.filter(G);n.length>0&&cvox.Api.playEarcon(c),Y(t)},et=function(e){var t=e.type+" "+e.text+" on "+nt(e.row,e.column);t=t.replace(";","semicolon"),cvox.Api.speak(t,1)},tt=function(e){var t=w[e];for(var n in t)et(t[n])},nt=function(e,t){return"row "+(e+1)+" column "+(t+1)},rt=function(){cvox.Api.speak(nt(b.row,b.column))},it=function(){for(var e in w)tt(e)},st=function(){if(!L())return;switch(r.editor.keyBinding.$data.state){case d:cvox.Api.speak("Insert mode");break;case v:cvox.Api.speak("Command mode")}},ot=function(){E=!E,E?cvox.Api.speak("Speak location on row change enabled."):cvox.Api.speak("Speak location on row change disabled.")},ut=function(){S=!S,S?cvox.Api.speak("Speak displacement on column changes."):cvox.Api.speak("Speak current character or word on column changes.")},at=function(e){if(e.ctrlKey&&e.shiftKey){var t=N[e.keyCode];t&&t.func()}},ft=function(e,t){if(!L())return;var n=t.keyBinding.$data.state;if(n===T)return;switch(n){case d:cvox.Api.playEarcon(h),cvox.Api.setKeyEcho(!0);break;case v:cvox.Api.playEarcon(h),cvox.Api.setKeyEcho(!1)}T=n},lt=function(e){var t=e.detail.customCommand,n=C[t];n&&(n.func(),r.editor.focus())},ct=function(){var e=dt.map(function(e){return{desc:e.desc+k(e.keyCode),cmd:e.cmd}}),t=document.querySelector("body");t.setAttribute("contextMenuActions",JSON.stringify(e)Line truncated
@@ -0,0 +1 @@
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){var t=e.data.range;r&&(n.indexOf(t.start.row)==-1&&n.push(t.start.row),t.end.row!=t.start.row&&n.push(t.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}),function(){ace.require(["ace/ext/elastic_tabstops_lite"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","ace/config"],function(e,t,n){function a(){}var r=e("ace/keyboard/hash_handler").HashHandler,i=e("ace/editor").Editor,s=e("ace/snippets").snippetManager,o=e("ace/range").Range,u;i.prototype.indexToPosition=function(e){return this.session.doc.indexToPosition(e)},i.prototype.positionToIndex=function(e){return this.session.doc.positionToIndex(e)},a.prototype={setupContext:function(e){this.ace=e,this.indentation=e.session.getTabString(),u||(u=window.emmet),u.require("resources").setVariable("indentation",this.indentation),this.$syntax=null,this.$syntax=this.getSyntax()},getSelectionRange:function(){var e=this.ace.getSelectionRange();return{start:this.ace.positionToIndex(e.start),end:this.ace.positionToIndex(e.end)}},createSelection:function(e,t){this.ace.selection.setRange({start:this.ace.indexToPosition(e),end:this.ace.indexToPosition(t)})},getCurrentLineRange:function(){var e=this.ace.getCursorPosition().row,t=this.ace.session.getLine(e).length,n=this.ace.positionToIndex({row:e,column:0});return{start:n,end:n+t}},getCaretPos:function(){var e=this.ace.getCursorPosition();return this.ace.positionToIndex(e)},setCaretPos:function(e){var t=this.ace.indexToPosition(e);this.ace.selection.moveToPosition(t)},getCurrentLine:function(){var e=this.ace.getCursorPosition().row;return this.ace.session.getLine(e)},replaceContent:function(e,t,n,r){n==null&&(n=t==null?this.getContent().length:t),t==null&&(t=0);var i=this.ace,u=o.fromPoints(i.indexToPosition(t),i.indexToPosition(n));i.session.remove(u),u.end=u.start,e=this.$updateTabstops(e),s.insertSnippet(i,e)},getContent:function(){return this.ace.getValue()},getSyntax:function(){if(this.$syntax)return this.$syntax;var e=this.ace.session.$modeId.split("/").pop();if(e=="html"||e=="php"){var t=this.ace.getCursorPosition(),n=this.ace.session.getState(t.row);typeof n!="string"&&(n=n[0]),n&&(n=n.split("-"),n.length>1?e=n[0]:e=="php"&&(e="html"))}return e},getProfileName:function(){switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var e=u.require("resources").getVariable("profile");return e||(e=this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i)!=-1?"xhtml":"html"),e}return"xhtml"},prompt:function(e){return prompt(e)},getSelection:function(){return this.ace.session.getTextRange()},getFilePath:function(){return""},$updateTabstops:function(e){var t=1e3,n=0,r=null,i=u.require("range"),s=u.require("tabStops"),o=u.require("resources").getVocabulary("user"),a={tabstop:function(e){var o=parseInt(e.group,10),u=o===0;u?o=++n:o+=t;var f=e.placeholder;f&&(f=s.processText(f,a));var l="${"+o+(f?":"+f:"")+"}";return u&&(r=i.create(e.start,l)),l},escape:function(e){return e=="$"?"\\$":e=="\\"?"\\\\":e}};return e=s.processText(e,a),o.variables.insert_final_tabstop&&!/\$\{0\}$/.test(e)?e+="${0}":r&&(e=u.require("utils").replaceSubstring(e,"${0}",r)),e}};var f={expand_abbreviation:{mac:"ctrl+alt+e",win:"alt+e"},match_pair_outward:{mac:"ctrl+d",win:"ctrl+,"},match_pair_inward:{mac:"ctrl+j",win:"ctrl+shift+0"},matching_pair:{mac:"ctrl+alt+j",win:"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{mac:"command+/",win:"ctrl+/"},split_join_tag:{mac:"shift+command+'",win:"shift+ctrl+`"},remove_tag:{mac:"command+'",win:"shift+ctrl+;"},evaluate_math_expression:{mac:"shift+command+y",win:"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{mac:"alt+command+up",win:"shift+alt+up"},decrement_number_by_10:{mac:"alt+command+down",win:"shift+alt+down"},select_next_item:{mac:"shift+command+.",win:"shift+ctrl+."},select_previous_item:{mac:"shift+command+,",win:"shift+ctrl+,"},reflect_css_value:{mac:"shift+command+r",win:"shift+ctrl+r"},encode_decode_data_url:{mac:"shift+ctrl+d",win:"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{mac:"shift+ctrl+a",win:"shift+ctrl+a"}},l=new a;t.commands=new r,t.runEmmetCommand=function(e){l.setupContext(e);if(l.getSyntax()=="php")return!1;var t=u.require("actions");if(this.action=="expand_abbreviation_with_tab"&&!e.selection.isEmpty())return!1;if(this.action=="wrap_with_abbreviation")return setTimeout(function(){t.run("wrap_with_abbreviation",l)},0);try{var n=t.run(this.action,l)}catch(r){e._signal("changeStatus",typeof r=="string"?r:r.message),console.log(r),n=!1}return n};for(var c in f)t.commands.addCommand({name:"emmet:"+c,action:c,bindKey:f[c],exec:t.runEmmetCommand,multiSelectAction:"forEach"});var h=function(e,n){var r=n;if(!r)return;var i=r.session.$modeId,s=i&&/css|less|scss|sass|stylus|html|php/.test(i);e.enableEmmet===!1&&(s=!1),s?r.keyBinding.addKeyboardHandler(t.commands):r.keyBinding.removeKeyboardHandler(t.commands)};t.AceEmmetEditor=a,e("ace/config").defineOptions(i.prototype,"editor",{enableEmmet:{set:function(e){thisLine truncated
+1
View File
@@ -0,0 +1 @@
(function(){ace.require(["ace/ext/error_marker"],function(){})})()
@@ -0,0 +1 @@
ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s,"0","0","0",null)}}var r=e("ace/editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);-webkit-transition: all 0.5s;transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 1000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var r=e.commandKeyBinding;for(var s in r){var o=parseInt(s);o==-1?o="":isNaN(o)?o=s:o=""+(o&t.command?"Cmd-":"")+(o&t.ctrl?"Ctrl-":"")+(o&t.alt?"Alt-":"")+(o&t.shift?"Shift-":"");for(var u in r[s]){var a=r[s][u];typeof a!="string"&&(a=a.name),i[a]?i[a].key+="|"+o+u:(i[a]={key:o+u,command:a},n.push(i[a]))}}}),n}}),function(){ace.require(["ace/ext/keybinding_menu"],function(){})}()
@@ -0,0 +1 @@
ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor"],function(e,t,n){var r=e("../snippets").snippetManager,i=e("../autocomplete").Autocomplete,s=e("../config"),o=e("../autocomplete/util"),u=e("../autocomplete/text_completer"),a={getCompletions:function(e,t,n,r,i){var s=e.session.getState(n.row),o=t.$mode.getCompletions(s,t,n,r);i(null,o)}},f={getCompletions:function(e,t,n,i,s){var o=r.snippetMap,u=[];r.getActiveScopes(e).forEach(function(e){var t=o[e]||[];for(var n=t.length;n--;){var r=t[n],i=r.name||r.tabTrigger;if(!i)continue;u.push({caption:i,snippet:r.content,meta:r.tabTrigger&&!r.name?r.tabTrigger+"\u21e5 ":"snippet"})}},this),s(null,u)}},l=[f,u,a];t.addCompleter=function(e){l.push(e)},t.textCompleter=u,t.keyWordCompleter=a,t.snippetCompleter=f;var c={name:"expandSnippet",exec:function(e){var t=r.expandWithTab(e);t||e.execCommand("indent")},bindKey:"Tab"},h=function(e,t){p(t.session.$mode)},p=function(e){var t=e.$id;r.files||(r.files={}),d(t),e.modes&&e.modes.forEach(p)},d=function(e){if(!e||r.files[e])return;var t=e.replace("mode","snippets");r.files[e]={},s.loadModule(t,function(t){t&&(r.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=r.parseSnippetFile(t.snippetText)),r.register(t.snippets||[],t.scope),t.includeScopes&&(r.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){d("ace/mode/"+e)})))})},v=function(e){var t=e.editor,n=e.args||"",r=t.getCursorPosition(),s=t.session.getLine(r.row),u=t.completer&&t.completer.activated,a=o.retrievePrecedingIdentifier(s,r.column);l.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){a||(a=o.retrievePrecedingIdentifier(s,r.column,e))})}),e.command.name==="backspace"&&!a?u&&t.completer.detach():e.command.name==="insertstring"&&(a&&!u?(t.completer||(t.completer=new i,t.completer.autoSelect=!1,t.completer.autoInsert=!1),t.completer.showPopup(t)):!a&&u&&t.completer.detach())},m=e("../editor").Editor;e("../config").defineOptions(m.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers=Array.isArray(e)?e:l,this.commands.addCommand(i.startCommand)):this.commands.removeCommand(i.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers=Array.isArray(e)?e:l,this.commands.on("afterExec",v)):this.commands.removeListener("afterExec",v)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(c),this.on("changeMode",h),h(null,this)):(this.commands.removeCommand(c),this.off("changeMode",h))},value:!1}})}),ace.define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"],function(e,t,n){var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),o=e("./range").Range,u=e("./anchor").Anchor,a=e("./keyboard/hash_handler").HashHandler,f=e("./tokenizer").Tokenizer,l=o.comparePoints,c=function(){this.snippetMap={},this.snippetNameMap={}};(function(){r.implement(this,i),this.getTokenizer=function(){function e(e,t,n){return e=e.substr(1),/^\d+$/.test(e)&&!n.inFormatString?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}return c.$tokenizer=new f({start:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectIf?(n[0].expectIf=!1,n[0].elseBranch=n[0],[n[0]]):":"}},{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return r=="}"&&n.length?e=r:"`$\\".indexOf(r)!=-1?e=r:n.inFormatString&&(r=="n"?e="\n":r=="t"?e="\n":"ulULE".indexOf(r)!=-1&&(e={changeCase:r,local:r>"a"})),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,r){var i=e(t.substr(1),n,r);return r.unshift(i[0]),i},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){n[0].choices=e.slice(1,-1).split(",")},next:"start"},{regex:"/("+t("/")+"+)/(?:("+t("/")+"*)/)(\\w*):?",onMatch:function(e,t,n){var r=n[0];return r.fmtString=e,e=this.splitRegex.exec(e),r.guard=e[1],r.fmt=e[2],r.flag=e[3],""},next:"start"},{regex:"`"+t("`")+"*`",onMatch:function(e,t,n){return n[0].code=e.splice(1,-1),""},next:"start"},{regex:"\\?",onMatch:function(e,t,n){n[0]&&(n[0].expectIf=!0)},next:"start"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:"/("+t("/")+"+)/",token:"regex"},{regex:"",onMatch:function(e,t,n){n.inFormatString=!0},next:"start"}]}),c.prototype.getTokenizer=function(){return c.$tokenizer},c.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.$getDefaultValue=function(e,t){if(/^[A-Z]\d+$/.test(t)){var n=t.substr(1);return(this.variables[t[0]+"__"]||{})[n]}if(/^\d+$/.test(t))return(this.variables.__Line truncated
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var t=e.editor,n=e.getAccelKey();if(n){var t=e.editor,r=e.getDocumentPosition(),i=t.session,s=i.getTokenAt(r.row,r.column);t._emit("linkHover",{position:r,token:s})}}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("ace/editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}})}),function(){ace.require(["ace/ext/linking"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;if(/\^/.test(n))var r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$";else var r="^.*\\.("+n+")$";this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc"],Assembly_x86:["asm"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C9Search:["c9search_results"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp"],Cirru:["cirru|cr"],Clojure:["clj"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],CSharp:["cs"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Erlang:["erl|hrl"],EJS:["ejs"],Forth:["frt|fs|ldr"],FTL:["ftl"],Gherkin:["feature"],Glsl:["glsl|frag|vert"],golang:["go"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],haXe:["hx"],HTML:["html|htm|xhtml"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Jack:["jack"],Jade:["jade"],Java:["java"],JavaScript:["js|jsm"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSX:["jsx"],Julia:["jl"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],MATLAB:["matlab"],Markdown:["md|markdown"],MEL:["mel"],MySQL:["mysql"],MUSHCode:["mc|mush"],Nix:["nix"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|phtml"],Powershell:["ps1"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],RDoc:["Rd"],RHTML:["Rhtml"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Smarty:["smarty|tpl"],Scheme:["scm|rkt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Space:["space"],snippets:["snippets"],Soy_Template:["soy"],SQL:["sql"],Stylus:["styl|stylus"],SVG:["svg"],Tcl:["tcl"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],Twig:["twig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],XQuery:["xq"],YAML:["yaml|yml"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C/C++",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",FTL:"FreeMarker"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}}),function(){ace.require(["ace/ext/modelist"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/old_ie",["require","exports","module","ace/lib/useragent","ace/tokenizer","ace/ext/searchbox","ace/mode/text"],function(require,exports,module){function patch(obj,name,regexp,replacement){eval("obj['"+name+"']="+obj[name].toString().replace(regexp,replacement))}var MAX_TOKEN_COUNT=1e3,useragent=require("../lib/useragent"),TokenizerModule=require("../tokenizer");useragent.isIE&&useragent.isIE<10&&window.top.document.compatMode==="BackCompat"&&(useragent.isOldIE=!0);if(typeof document!="undefined"&&!document.documentElement.querySelector){useragent.isOldIE=!0;var qs=function(e,t){if(t.charAt(0)==".")var n=t.slice(1);else var r=t.match(/(\w+)=(\w+)/),i=r&&r[1],s=r&&r[2];for(var o=0;o<e.all.length;o++){var u=e.all[o];if(n){if(u.className.indexOf(n)!=-1)return u}else if(i&&u.getAttribute(i)==s)return u}},sb=require("./searchbox").SearchBox.prototype;patch(sb,"$initElements",/([^\s=]*).querySelector\((".*?")\)/g,"qs($1, $2)")}var compliantExecNpcg=/()??/.exec("")[1]===undefined;if(compliantExecNpcg)return;var proto=TokenizerModule.Tokenizer.prototype;TokenizerModule.Tokenizer_orig=TokenizerModule.Tokenizer,proto.getLineTokens_orig=proto.getLineTokens,patch(TokenizerModule,"Tokenizer","ruleRegExps.push(adjustedregex);\n",function(e){return e+' if (state[i].next && RegExp(adjustedregex).test(""))\n rule._qre = RegExp(adjustedregex, "g");\n '}),TokenizerModule.Tokenizer.prototype=proto,patch(proto,"getLineTokens",/if \(match\[i \+ 1\] === undefined\)\s*continue;/,"if (!match[i + 1]) {\n if (value)continue;\n var qre = state[mapping[i]]._qre;\n if (!qre) continue;\n qre.lastIndex = lastIndex;\n if (!qre.exec(line) || qre.lastIndex != lastIndex)\n continue;\n }"),patch(require("../mode/text").Mode.prototype,"getTokenizer",/Tokenizer/,"TokenizerModule.Tokenizer"),useragent.isOldIE=!0}),ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o="/* ------------------------------------------------------------------------------------------* Editor Search Form* --------------------------------------------------------------------------------------- */.ace_search {background-color: #ddd;border: 1px solid #cbcbcb;border-top: 0 none;max-width: 297px;overflow: hidden;margin: 0;padding: 4px;padding-right: 6px;padding-bottom: 0;position: absolute;top: 0px;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {border-radius: 3px;border: 1px solid #cbcbcb;float: left;margin-bottom: 4px;overflow: hidden;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {background-color: white;border-right: 1px solid #cbcbcb;border: 0 none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;display: block;float: left;height: 22px;outline: 0;padding: 0 7px;width: 214px;margin: 0;}.ace_searchbtn,.ace_replacebtn {background: #fff;border: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;display: block;float: left;height: 22px;margin: 0;padding: 0;position: relative;}.ace_searchbtn:last-child,.ace_replacebtn:last-child {border-top-right-radius: 3px;border-bottom-right-radius: 3px;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn {background-position: 50% 50%;background-repeat: no-repeat;width: 27px;}.ace_searchbtn.prev {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); }.ace_searchbtn.next {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); }.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;display: block;float: right;font-family: Arial;font-size: 16px;height: 14px;line-height: 16px;margin: 5px 1px 9px 5px;padding: 0;text-align: center;width: 14px;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_replacebtn.prev {width: 54px}.ace_replacebtn.next {width: 27px}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: Line truncated
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/prompt",["require","exports","module","ace/lib/lang","ace/lib/dom","ace/lib/event","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/editor","ace/multi_select"],function(e,t,n){function c(e,t){var n=this.pixelToScreenCoordinates(e,t);return this.session.screenToDocumentPosition(Math.min(this.session.getScreenLength()-1,Math.max(n.row,0)),Math.max(n.column,0))}var r=e("../lib/lang"),i=e("ace/lib/dom"),s=e("ace/lib/event"),o=e("ace/edit_session").EditSession,u=e("ace/undomanager").UndoManager,a=e("ace/virtual_renderer").VirtualRenderer,f=e("ace/editor").Editor,l=e("ace/multi_select").MultiSelect;t.singleLineEditor=function(e){var t=new a;t.container.style.overflow="hidden",t.screenToTextCoordinates=c,t.setStyle("ace_one-line");var n=new f(t);return n.session.setUndoManager(new u),n.setOptions({showPrintMargin:!1,showGutter:!1,highlightGutterLine:!1,focusWaitTimout:0,maxLines:4}),n}}),function(){ace.require(["ace/ext/prompt"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){var r=e("../lib/dom"),i=e("../lib/lang"),s=e("../lib/event"),o="/* ------------------------------------------------------------------------------------------* Editor Search Form* --------------------------------------------------------------------------------------- */.ace_search {background-color: #ddd;border: 1px solid #cbcbcb;border-top: 0 none;max-width: 297px;overflow: hidden;margin: 0;padding: 4px;padding-right: 6px;padding-bottom: 0;position: absolute;top: 0px;z-index: 99;white-space: normal;}.ace_search.left {border-left: 0 none;border-radius: 0px 0px 5px 0px;left: 0;}.ace_search.right {border-radius: 0px 0px 0px 5px;border-right: 0 none;right: 0;}.ace_search_form, .ace_replace_form {border-radius: 3px;border: 1px solid #cbcbcb;float: left;margin-bottom: 4px;overflow: hidden;}.ace_search_form.ace_nomatch {outline: 1px solid red;}.ace_search_field {background-color: white;border-right: 1px solid #cbcbcb;border: 0 none;-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;display: block;float: left;height: 22px;outline: 0;padding: 0 7px;width: 214px;margin: 0;}.ace_searchbtn,.ace_replacebtn {background: #fff;border: 0 none;border-left: 1px solid #dcdcdc;cursor: pointer;display: block;float: left;height: 22px;margin: 0;padding: 0;position: relative;}.ace_searchbtn:last-child,.ace_replacebtn:last-child {border-top-right-radius: 3px;border-bottom-right-radius: 3px;}.ace_searchbtn:disabled {background: none;cursor: default;}.ace_searchbtn {background-position: 50% 50%;background-repeat: no-repeat;width: 27px;}.ace_searchbtn.prev {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); }.ace_searchbtn.next {background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); }.ace_searchbtn_close {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0;border-radius: 50%;border: 0 none;color: #656565;cursor: pointer;display: block;float: right;font-family: Arial;font-size: 16px;height: 14px;line-height: 16px;margin: 5px 1px 9px 5px;padding: 0;text-align: center;width: 14px;}.ace_searchbtn_close:hover {background-color: #656565;background-position: 50% 100%;color: white;}.ace_replacebtn.prev {width: 54px}.ace_replacebtn.next {width: 27px}.ace_button {margin-left: 2px;cursor: pointer;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;overflow: hidden;opacity: 0.7;border: 1px solid rgba(100,100,100,0.23);padding: 1px;-moz-box-sizing: border-box;box-sizing: border-box;color: black;}.ace_button:hover {background-color: #eee;opacity:1;}.ace_button:active {background-color: #ddd;}.ace_button.checked {border-color: #3399ff;opacity:1;}.ace_search_options{margin-bottom: 3px;text-align: right;-webkit-user-select: none;-moz-user-select: none;-o-user-select: none;-ms-user-select: none;user-select: none;}",u=e("../keyboard/hash_handler").HashHandler,a=e("../lib/keys");r.importCssString(o,"ace_searchbox");var f='<div class="ace_search right"> <button type="button" action="hide" class="ace_searchbtn_close"></button> <div class="ace_search_form"> <input class="ace_search_field" placeholder="Search for" spellcheck="false"></input> <button type="button" action="findNext" class="ace_searchbtn next"></button> <button type="button" action="findPrev" class="ace_searchbtn prev"></button> </div> <div class="ace_replace_form"> <input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input> <button type="button" action="replaceAndFindNext" class="ace_replacebtn">Replace</button> <button type="button" action="replaceAll" class="ace_replacebtn">All</button> </div> <div class="ace_search_options"> <span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span> <span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span> <span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span> </div></div>'.replace(/>\s+/g,">"),l=function(e,t,n){var i=r.createElement("div");i.innerHTML=f,this.element=i.firstChild,this.$init(),this.setEditor(e)};(function(){this.setEditor=function(e){e.searchBox=this,e.container.appendChild(this.element),this.editorLine truncated
@@ -0,0 +1 @@
ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/menu_tools/generate_settings_menu","ace/ext/menu_tools/overlay_page","ace/editor"],function(e,t,n){function s(e){var t=document.getElementById("ace_settingsmenu");t||i(e,r(e),"0","0","0")}var r=e("./menu_tools/generate_settings_menu").generateSettingsMenu,i=e("./menu_tools/overlay_page").overlayPage;n.exports.init=function(t){var n=e("ace/editor").Editor;n.prototype.showSettingsMenu=function(){s(this)}}}),ace.define("ace/ext/menu_tools/generate_settings_menu",["require","exports","module","ace/ext/menu_tools/element_generator","ace/ext/menu_tools/add_editor_menu_options","ace/ext/menu_tools/get_set_functions"],function(e,t,n){var r=e("./element_generator"),i=e("./add_editor_menu_options").addEditorMenuOptions,s=e("./get_set_functions").getSetFunctions;n.exports.generateSettingsMenu=function(t){function o(){n.sort(function(e,t){var n=e.getAttribute("contains"),r=t.getAttribute("contains");return n.localeCompare(r)})}function u(){var e=document.createElement("div");return e.setAttribute("id","ace_settingsmenu"),n.forEach(function(t){e.appendChild(t)}),e}function a(e,n,i,s){var o,u=document.createElement("div");return u.setAttribute("contains",i),u.setAttribute("class","ace_optionsMenuEntry"),u.setAttribute("style","clear: both;"),u.appendChild(r.createLabel(i.replace(/^set/,"").replace(/([A-Z])/g," $1").trim(),i)),Array.isArray(s)?(o=r.createSelection(i,s,n),o.addEventListener("change",function(n){try{t.menuOptions[n.target.id].forEach(function(e){e.textContent!==n.target.textContent&&delete e.selected}),e[n.target.id](n.target.value)}catch(r){throw new Error(r)}})):typeof s=="boolean"?(o=r.createCheckbox(i,s,n),o.addEventListener("change",function(t){try{e[t.target.id](!!t.target.checked)}catch(n){throw new Error(n)}})):(o=r.createInput(i,s,n),o.addEventListener("change",function(t){try{t.target.value==="true"?e[t.target.id](!0):t.target.value==="false"?e[t.target.id](!1):e[t.target.id](t.target.value)}catch(n){throw new Error(n)}})),o.style.cssText="float:right;",u.appendChild(o),u}function f(e,n,r,i){var s=t.menuOptions[e],o=n[i]();return typeof o=="object"&&(o=o.$id),s.forEach(function(e){e.value===o&&(e.selected="selected")}),a(n,r,e,s)}function l(e){var r=e.functionName,i=e.parentObj,s=e.parentName,o,u=r.replace(/^set/,"get");if(t.menuOptions[r]!==undefined)n.push(f(r,i,s,u));else if(typeof i[u]=="function")try{o=i[u](),typeof o=="object"&&(o=o.$id),n.push(a(i,s,r,o))}catch(l){}}var n=[];return i(t),s(t).forEach(function(e){l(e)}),o(),u()}}),ace.define("ace/ext/menu_tools/element_generator",["require","exports","module"],function(e,t,n){n.exports.createOption=function(t){var n,r=document.createElement("option");for(n in t)t.hasOwnProperty(n)&&(n==="selected"?r.setAttribute(n,t[n]):r[n]=t[n]);return r},n.exports.createCheckbox=function(t,n,r){var i=document.createElement("input");return i.setAttribute("type","checkbox"),i.setAttribute("id",t),i.setAttribute("name",t),i.setAttribute("value",n),i.setAttribute("class",r),n&&i.setAttribute("checked","checked"),i},n.exports.createInput=function(t,n,r){var i=document.createElement("input");return i.setAttribute("type","text"),i.setAttribute("id",t),i.setAttribute("name",t),i.setAttribute("value",n),i.setAttribute("class",r),i},n.exports.createLabel=function(t,n){var r=document.createElement("label");return r.setAttribute("for",n),r.textContent=t,r},n.exports.createSelection=function(t,r,i){var s=document.createElement("select");return s.setAttribute("id",t),s.setAttribute("name",t),s.setAttribute("class",i),r.forEach(function(e){s.appendChild(n.exports.createOption(e))}),s}}),ace.define("ace/ext/menu_tools/add_editor_menu_options",["require","exports","module","ace/ext/modelist","ace/ext/themelist"],function(e,t,n){n.exports.addEditorMenuOptions=function(n){var r=e("../modelist"),i=e("../themelist");n.menuOptions={setNewLineMode:[{textContent:"unix",value:"unix"},{textContent:"windows",value:"windows"},{textContent:"auto",value:"auto"}],setTheme:[],setMode:[],setKeyboardHandler:[{textContent:"ace",value:""},{textContent:"vim",value:"ace/keyboard/vim"},{textContent:"emacs",value:"ace/keyboard/emacs"}]},n.menuOptions.setTheme=i.themes.map(function(e){return{textContent:e.caption,value:e.theme}}),n.menuOptions.setMode=r.modes.map(function(e){return{textContent:e.name,value:e.mode}})}}),ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;if(/\^/.test(n))var r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$";else var r="^.*\\.("+n+")$";this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ActionScript:["as"],ADA:["ada|adb"],Apache_Conf:["^htaccess|^htgroups|^htpasswdLine truncated
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){console.log(e,a,n.selectionStart,n.selectionEnd);if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}),function(){ace.require(["ace/ext/spellcheck"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){n.exports=e("../split")}),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){function l(e,t){this.$u=e,this.$doc=t}var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();if(n){var r=new l(n,t);t.setUndoManager(r)}return t.$informUndoManager=i.delayedCall(function(){t.$deltas=[]}),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),function(){this.execute=function(e){this.$u.execute(e)},this.undo=function(){var e=this.$u.undo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.redo=function(){var e=this.$u.redo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.reset=function(){this.$u.reset()},this.hasUndo=function(){return this.$u.hasUndo()},this.hasRedo=function(){return this.$u.hasRedo()}}.call(l.prototype),t.Split=f}),function(){ace.require(["ace/ext/split"],function(){})}()
@@ -0,0 +1 @@
ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"],function(e,t,n){var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;}.ace_static_highlight .ace_gutter {width: 25px !important;display: block;float: left;text-align: right;padding: 0 3px 0 0;margin-right: 3px;position: static !important;}.ace_static_highlight .ace_line { clear: both; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom"),a=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",f=[];if(e.firstElementChild){var l=0;for(var c=0;c<e.childNodes.length;c++){var h=e.childNodes[c];h.nodeType==3?(l+=h.data.length,o+=h.data):f.push(l,h)}}else o=u.getInnerText(e),t.trim&&(o=o.trim());a.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<f.length;i+=2){var s=t.session.doc.indexToPosition(f[i]),o=f[i+1],a=r.children[s.row];a&&a.appendChild(o)}n&&n()})};a.render=function(e,t,n,i,s,u){function c(){var r=a.renderSync(e,t,n,i,s);return u?u(r):r}var f=1,l=r.prototype.$modes;return typeof n=="string"&&(f++,o.loadModule(["theme",n],function(e){n=e,--f||c()})),typeof t=="string"&&(f++,o.loadModule(["mode",t],function(e){l[t]||(l[t]=new e.Mode),t=l[t],--f||c()})),--f||c()},a.renderSync=function(e,t,n,o,u){o=parseInt(o||1,10);var a=new r("");a.setUseWorker(!1),a.setMode(t);var f=new i(document.createElement("div"));f.setSession(a),f.config={characterWidth:10,lineHeight:20},a.setValue(e);var l=[],c=a.getLength();for(var h=0;h<c;h++)l.push("<div class='ace_line'>"),u||l.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'></span>"),f.$renderLine(l,h,!0,!1),l.push("\n</div>");var p="<div class='"+n.cssClass+"'>"+"<div class='ace_static_highlight' style='counter-reset:ace_line "+(o-1)+"'>"+l.join("")+"</div>"+"</div>";return f.destroy(),{css:s+n.cssText,html:p,session:a}},n.exports=a,n.exports.highlight=a}),function(){ace.require(["ace/ext/static_highlight"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){var r=e("ace/lib/dom"),i=e("ace/lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this));e.on("changeStatus",function(){n.schedule(100)}),e.on("changeSelection",function(){n.schedule(100)})};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];e.$vimModeHandler?n(e.$vimModeHandler.getStatusText()):e.commands.recording&&n("REC");var r=e.selection.lead;n(r.row+":"+r.column," ");if(!e.selection.isEmpty()){var i=e.getSelectionRange();n("("+(i.end.row-i.start.row)+":"+(i.end.column-i.start.column)+")")}t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s}),function(){ace.require(["ace/ext/statusbar"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate","ace/mode/text"],function(e,t,n){function a(e,t){for(var n in t)e.style[n]=t[n]}function f(e,t){if(e.type!="textarea")throw new Error("Textarea required!");var n=e.parentNode,i=document.createElement("div"),s=function(){var t="position:relative;";["margin-top","margin-left","margin-right","margin-bottom"].forEach(function(n){t+=n+":"+u(e,i,n)+";"});var n=u(e,i,"width")||e.clientWidth+"px",r=u(e,i,"height")||e.clientHeight+"px";t+="height:"+r+";width:"+n+";",t+="display:inline-block;",i.setAttribute("style",t)};r.addListener(window,"resize",s),s(),n.insertBefore(i,e.nextSibling);while(n!==document){if(n.tagName.toUpperCase()==="FORM"){var o=n.onsubmit;n.onsubmit=function(n){e.value=t(),o&&o.call(this,n)};break}n=n.parentNode}return i}function l(t,n,r){s.loadScript(t,function(){e([n],r)})}function c(n,r,i,s,o,u){function c(e){return e==="true"||e==1}var a=n.getSession(),f=n.renderer;return u=u||l,n.setDisplaySettings=function(e){e==null&&(e=i.style.display=="none"),e?(i.style.display="block",i.hideButton.focus(),n.on("focus",function t(){n.removeListener("focus",t),i.style.display="none"})):n.focus()},n.$setOption=n.setOption,n.setOption=function(t,i){if(o[t]==i)return;switch(t){case"mode":i!="text"?u("mode-"+i+".js","ace/mode/"+i,function(){var t=e("../mode/"+i).Mode;a.setMode(new t)}):a.setMode(new(e("../mode/text").Mode));break;case"theme":i!="textmate"?u("theme-"+i+".js","ace/theme/"+i,function(){n.setTheme("ace/theme/"+i)}):n.setTheme("ace/theme/textmate");break;case"fontSize":r.style.fontSize=i;break;case"keybindings":switch(i){case"vim":n.setKeyboardHandler("ace/keyboard/vim");break;case"emacs":n.setKeyboardHandler("ace/keyboard/emacs");break;default:n.setKeyboardHandler(null)}break;case"softWrap":switch(i){case"off":a.setUseWrapMode(!1),f.setPrintMarginColumn(80);break;case"40":a.setUseWrapMode(!0),a.setWrapLimitRange(40,40),f.setPrintMarginColumn(40);break;case"80":a.setUseWrapMode(!0),a.setWrapLimitRange(80,80),f.setPrintMarginColumn(80);break;case"free":a.setUseWrapMode(!0),a.setWrapLimitRange(null,null),f.setPrintMarginColumn(80)}break;default:n.$setOption(t,c(i))}o[t]=i},n.getOption=function(e){return o[e]},n.getOptions=function(){return o},n.setOptions(t.options),n}function h(e,t,n,i){function f(e,t,n,r){if(!n){e.push("<input type='checkbox' title='",t,"' ",r=="true"?"checked='true'":"","'></input>");return}e.push("<select title='"+t+"'>");for(var i in n)e.push("<option value='"+i+"' "),r==i&&e.push(" selected "),e.push(">",n[i],"</option>");e.push("</select>")}var s=null,o={mode:"Mode:",gutter:"Display Gutter:",theme:"Theme:",fontSize:"Font Size:",softWrap:"Soft Wrap:",keybindings:"Keyboard",showPrintMargin:"Show Print Margin:",useSoftTabs:"Use Soft Tabs:",showInvisibles:"Show Invisibles"},u={mode:{text:"Plain",javascript:"JavaScript",xml:"XML",html:"HTML",css:"CSS",scss:"SCSS",python:"Python",php:"PHP",java:"Java",ruby:"Ruby",c_cpp:"C/C++",coffee:"CoffeeScript",json:"json",perl:"Perl",clojure:"Clojure",ocaml:"OCaml",csharp:"C#",haxe:"haXe",svg:"SVG",textile:"Textile",groovy:"Groovy",liquid:"Liquid",Scala:"Scala"},theme:{clouds:"Clouds",clouds_midnight:"Clouds Midnight",cobalt:"Cobalt",crimson_editor:"Crimson Editor",dawn:"Dawn",eclipse:"Eclipse",idle_fingers:"Idle Fingers",kr_theme:"Kr Theme",merbivore:"Merbivore",merbivore_soft:"Merbivore Soft",mono_industrial:"Mono Industrial",monokai:"Monokai",pastel_on_dark:"Pastel On Dark",solarized_dark:"Solarized Dark",solarized_light:"Solarized Light",textmate:"Textmate",twilight:"Twilight",vibrant_ink:"Vibrant Ink"},gutter:s,fontSize:{"10px":"10px","11px":"11px","12px":"12px","14px":"14px","16px":"16px"},softWrap:{off:"Off",40:"40",80:"80",free:"Free"},keybindings:{ace:"ace",vim:"vim",emacs:"emacs"},showPrintMargin:s,useSoftTabs:s,showInvisibles:s},a=[];a.push("<table><tr><th>Setting</th><th>Value</th></tr>");for(var l in i)a.push("<tr><td>",o[l],"</td>"),a.push("<td>"),f(a,l,u[l],i[l]),a.push("</td></tr>");a.push("</table>"),e.innerHTML=a.join("");var c=function(e){var t=e.currentTarget;n.setOption(t.title,t.value)},h=function(e){var t=e.currentTarget;n.setOption(t.title,t.checked)},p=e.getElementsByTagName("select");for(var d=0;d<p.length;d++)p[d].onchange=c;var v=e.getElementsByTagName("input");for(var d=0;d<v.length;d++)v[d].onclick=h;var m=document.createElement("input");m.type="button",m.value="Hide",r.addListener(m,"click",function(){n.setDisplaySettings(!1)}),e.appendChild(m),e.hideButton=m}var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/net"),o=e("../ace");e("../theme/textmate"),n.exports=t=o;var u=function(e,t,n){var r=e.style[n];r||(window.getComputedStyle?r=window.getComputedStyle(e,"").getPropertyValue(n):r=e.currentStyle[n]);if(!r||r=="auto"||r=="intrinsic")r=t.style[n];return r};t.transformTextarea=function(e,t){var n,s=f(e,function(){return n.getValue()});e.style.display="none",s.stylLine truncated
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"],function(e,t,n){e("ace/lib/fixoldbrowsers");var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["Solarized Light"],["TextMate"],["Tomorrow"],["XCode"],["Kuroir"],["KatzenMilch"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Cobalt","cobalt","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})}),function(){ace.require(["ace/ext/themelist"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){var r=e("../lib/lang");t.$detectIndentation=function(e,t){function h(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;var f=a.match(/^\t*/)[0].length;a[0]==" "&&i++;var l=a.match(/^ */)[0].length;if(l&&a[l]!=" "){var c=l-s;c>0&&!(s%c)&&!(l%c)&&(r[c]=(r[c]||0)+1),n[l]=(n[l]||0)+1}s=l;while(u<o&&a[a.length-1]=="\\")a=e[u++]}if(!n.length)return;var p=r.reduce(function(e,t){return e+t},0),d={score:0,length:0},v=0;for(var u=1;u<12;u++){if(u==1){v=h(u);var m=1}else var m=h(u)/v;r[u]&&(m+=r[u]/p),m>d.score&&(d={score:m,length:u})}if(d.score&&d.score>1.4)var g=d.length;if(i>v+1)return{ch:" ",length:g};if(v+1>i)return{ch:" ",length:g}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t?-1:0;for(var s=0,o=r.length;s<o;s++){var u=r[s],a=u.search(/\s+$/);a>i&&n.removeInLine(s,a,u.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e){t.trimTrailingSpace(e.session)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]}),function(){ace.require(["ace/ext/whitespace"],function(){})}()
+1
View File
@@ -0,0 +1 @@
ace.define("ace/keyboard/emacs",["require","exports","module","ace/lib/dom","ace/incremental_search","ace/commands/incremental_search_commands","ace/keyboard/hash_handler","ace/lib/keys"],function(e,t,n){var r=e("../lib/dom");e("../incremental_search");var i=e("../commands/incremental_search_commands"),s=function(e,t){var n=this.scroller.getBoundingClientRect(),r=Math.floor((e+this.scrollLeft-n.left-this.$padding)/this.characterWidth),i=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(i,r)},o=e("./hash_handler").HashHandler;t.handler=new o,t.handler.isEmacs=!0,t.handler.$id="ace/keyboard/emacs";var u=!1,a,f;t.handler.attach=function(e){u||(u=!0,r.importCssString(" .emacs-mode .ace_cursor{ border: 2px rgba(50,250,50,0.8) solid!important; -moz-box-sizing: border-box!important; -webkit-box-sizing: border-box!important; box-sizing: border-box!important; background-color: rgba(0,250,0,0.9); opacity: 0.5; } .emacs-mode .ace_hidden-cursors .ace_cursor{ opacity: 1; background-color: transparent; } .emacs-mode .ace_overwrite-cursors .ace_cursor { opacity: 1; background-color: transparent; border-width: 0 0 2px 2px !important; } .emacs-mode .ace_text-layer { z-index: 4 } .emacs-mode .ace_cursor-layer { z-index: 2 }","emacsMode")),a=e.session.$selectLongWords,e.session.$selectLongWords=!0,f=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.$emacsMark=null,e.session.$emacsMarkRing=e.session.$emacsMarkRing||[],e.emacsMark=function(){return this.session.$emacsMark},e.setEmacsMark=function(e){this.session.$emacsMark=e},e.pushEmacsMark=function(e,t){var n=this.session.$emacsMark;n&&this.session.$emacsMarkRing.push(n),!e||t?this.setEmacsMark(e):this.session.$emacsMarkRing.push(e)},e.popEmacsMark=function(){var e=this.emacsMark();return e?(this.setEmacsMark(null),e):this.session.$emacsMarkRing.pop()},e.getLastEmacsMark=function(e){return this.session.$emacsMark||this.session.$emacsMarkRing.slice(-1)[0]},e.on("click",c),e.on("changeSession",l),e.renderer.screenToTextCoordinates=s,e.setStyle("emacs-mode"),e.commands.addCommands(v),t.handler.platform=e.commands.platform,e.$emacsModeHandler=this,e.addEventListener("copy",this.onCopy),e.addEventListener("paste",this.onPaste)},t.handler.detach=function(e){delete e.renderer.screenToTextCoordinates,e.session.$selectLongWords=a,e.session.$useEmacsStyleLineStart=f,e.removeEventListener("click",c),e.removeEventListener("changeSession",l),e.unsetStyle("emacs-mode"),e.commands.removeCommands(v),e.removeEventListener("copy",this.onCopy),e.removeEventListener("paste",this.onPaste)};var l=function(e){e.oldSession&&(e.oldSession.$selectLongWords=a,e.oldSession.$useEmacsStyleLineStart=f),a=e.session.$selectLongWords,e.session.$selectLongWords=!0,f=e.session.$useEmacsStyleLineStart,e.session.$useEmacsStyleLineStart=!0,e.session.hasOwnProperty("$emacsMark")||(e.session.$emacsMark=null),e.session.hasOwnProperty("$emacsMarkRing")||(e.session.$emacsMarkRing=[])},c=function(e){e.editor.session.$emacsMark=null},h=e("../lib/keys").KEY_MODS,p={C:"ctrl",S:"shift",M:"alt",CMD:"command"},d=["C-S-M-CMD","S-M-CMD","C-M-CMD","C-S-CMD","C-S-M","M-CMD","S-CMD","S-M","C-CMD","C-M","C-S","CMD","M","S","C"];d.forEach(function(e){var t=0;e.split("-").forEach(function(e){t|=h[p[e]]}),p[t]=e.toLowerCase()+"-"}),t.handler.onCopy=function(e,n){if(n.$handlesEmacsOnCopy)return;n.$handlesEmacsOnCopy=!0,t.handler.commands.killRingSave.exec(n),delete n.$handlesEmacsOnCopy},t.handler.onPaste=function(e,t){t.pushEmacsMark(t.getCursorPosition())},t.handler.bindKey=function(e,t){if(!e)return;var n=this.commandKeyBinding;e.split("|").forEach(function(e){e=e.toLowerCase(),n[e]=t;var r=e.split(" ").slice(0,-1);r.reduce(function(e,t,n){var r=e[n-1]?e[n-1]+" ":"";return e.concat([r+t])},[]).forEach(function(e){n[e]||(n[e]="null")})},this)},t.handler.handleKeyboard=function(e,t,n,r){if(r===-1)return undefined;var i=e.editor;if(t==-1){i.pushEmacsMark();if(e.count){var s=(new Array(e.count+1)).join(n);return e.count=null,{command:"insertstring",args:s}}}if(n=="\0")return undefined;var o=p[t];if(o=="c-"||e.universalArgument){var u=String(e.count||0),a=parseInt(n[n.length-1]);if(typeof a=="number"&&!isNaN(a))return e.count=parseInt(u+a),{command:"null"};e.universalArgument&&(e.count=4)}e.universalArgument=!1,o&&(n=o+n),e.keyChain&&(n=e.keyChain+=" "+n);var f=this.commandKeyBinding[n];e.keyChain=f=="null"?n:"";if(!f)return undefined;if(f==="null")return{command:"null"};if(f==="universalArgument")return e.universalArgument=!0,{command:"null"};var l;typeof f!="string"&&(l=f.args,f.command&&(f=f.command),f==="goorselect"&&(f=i.emacsMark()?l[1]:l[0],l=null));if(Line truncated
+1
View File
@@ -0,0 +1 @@
ace.define("ace/keyboard/vim",["require","exports","module","ace/keyboard/vim/commands","ace/keyboard/vim/maps/util","ace/lib/useragent"],function(e,t,n){var r=e("./vim/commands"),i=r.coreCommands,s=e("./vim/maps/util"),o=e("../lib/useragent"),u={i:{command:i.start},I:{command:i.startBeginning},a:{command:i.append},A:{command:i.appendEnd},"ctrl-f":{command:"gotopagedown"},"ctrl-b":{command:"gotopageup"}};t.handler={$id:"ace/keyboard/vim",handleMacRepeat:function(e,t,n){if(t==-1)e.inputChar=n,e.lastEvent="input";else if(e.inputChar&&e.$lastHash==t&&e.$lastKey==n){if(e.lastEvent=="input")e.lastEvent="input1";else if(e.lastEvent=="input1")return!0}else e.$lastHash=t,e.$lastKey=n,e.lastEvent="keypress"},updateMacCompositionHandlers:function(e,t){var n=function(e){if(s.currentMode!=="insert"){var t=this.textInput.getElement();t.blur(),t.focus(),t.value=e}else this.onCompositionUpdateOrig(e)},r=function(e){s.currentMode==="insert"&&this.onCompositionStartOrig(e)};t?e.onCompositionUpdateOrig||(e.onCompositionUpdateOrig=e.onCompositionUpdate,e.onCompositionUpdate=n,e.onCompositionStartOrig=e.onCompositionStart,e.onCompositionStart=r):e.onCompositionUpdateOrig&&(e.onCompositionUpdate=e.onCompositionUpdateOrig,e.onCompositionUpdateOrig=null,e.onCompositionStart=e.onCompositionStartOrig,e.onCompositionStartOrig=null)},handleKeyboard:function(e,t,n,s,a){if(t!==0&&(!n||s==-1))return null;var f=e.editor,l=e.vimState||"start";t==1&&(n="ctrl-"+n);if(n=="ctrl-c")return!o.isMac&&f.getCopyText()?(f.once("copy",function(){l=="start"?i.stop.exec(f):f.selection.clearSelection()}),{command:"null",passEvent:!0}):{command:i.stop};if(n=="esc"&&t===0||n=="ctrl-[")return{command:i.stop};if(l=="start"){o.isMac&&this.handleMacRepeat(e,t,n)&&(t=-1,n=e.inputChar);if(t==-1||t==1||t===0&&n.length>1){if(r.inputBuffer.idle&&u[n])return u[n];var c=r.inputBuffer.push(f,n);if(!c&&t!==-1)return;return{command:"null",passEvent:!c}}if(n=="esc"&&t===0)return{command:i.stop};if(t===0||t==4)return{command:"null",passEvent:!0}}else if(n=="ctrl-w")return{command:"removewordleft"}},attach:function(e){e.on("click",t.onCursorMove),s.currentMode!=="insert"&&r.coreCommands.stop.exec(e),e.$vimModeHandler=this,this.updateMacCompositionHandlers(e,!0)},detach:function(e){e.removeListener("click",t.onCursorMove),s.noMode(e),s.currentMode="normal",this.updateMacCompositionHandlers(e,!1)},actions:r.actions,getStatusText:function(){return s.currentMode=="insert"?"INSERT":s.onVisualMode?(s.onVisualLineMode?"VISUAL LINE ":"VISUAL ")+r.inputBuffer.status:r.inputBuffer.status}},t.onCursorMove=function(e){r.onCursorMove(e.editor,e),t.onCursorMove.scheduled=!1}}),ace.define("ace/keyboard/vim/commands",["require","exports","module","ace/lib/lang","ace/keyboard/vim/maps/util","ace/keyboard/vim/maps/motions","ace/keyboard/vim/maps/operators","ace/keyboard/vim/maps/aliases","ace/keyboard/vim/registers"],function(e,t,n){"never use strict";function y(e){g.previous={action:{action:{fn:e}}}}var r=e("../../lib/lang"),i=e("./maps/util"),s=e("./maps/motions"),o=e("./maps/operators"),u=e("./maps/aliases"),a=e("./registers"),f=1,l=2,c=3,h=4,p=8,d=function(t,n,r){while(0<n--)t.apply(this,r)},v=function(e){var t=e.renderer,n=t.$cursorLayer.getPixelPosition(),r=n.top,i=p*t.layerConfig.lineHeight;2*i>t.$size.scrollerHeight&&(i=t.$size.scrollerHeight/2),t.scrollTop>r-i&&t.session.setScrollTop(r-i),t.scrollTop+t.$size.scrollerHeight<r+i+t.lineHeight&&t.session.setScrollTop(r+i+t.lineHeight-t.$size.scrollerHeight)},m=t.actions={z:{param:!0,fn:function(e,t,n,r){switch(r){case"z":e.renderer.alignCursor(null,.5);break;case"t":e.renderer.alignCursor(null,0);break;case"b":e.renderer.alignCursor(null,1);break;case"c":e.session.onFoldWidgetClick(t.start.row,{domEvent:{target:{}}});break;case"o":e.session.onFoldWidgetClick(t.start.row,{domEvent:{target:{}}});break;case"C":e.session.foldAll();break;case"O":e.session.unfold()}}},r:{param:!0,fn:function(e,t,n,r){r&&r.length&&(r.length>1&&(r=r=="return"?"\n":r=="tab"?" ":r),d(function(){e.insert(r)},n||1),e.navigateLeft())}},R:{fn:function(e,t,n,r){i.insertMode(e),e.setOverwrite(!0)}},"~":{fn:function(e,t,n){d(function(){var t=e.selection.getRange();t.isEmpty()&&t.end.column++;var n=e.session.getTextRange(t),r=n.toUpperCase();r!=n?e.session.replace(t,r):n.toLowerCase()!=n?e.session.replace(t,n.toLowerCase()):e.navigateRight()},n||1)}},"*":{fn:function(e,t,n,r){e.selection.selectWord(),e.findNext(),v(e);var i=e.selection.getRange();e.selection.setSelectionRange(i,!0)}},"#":{fn:function(e,t,n,r){e.selection.selectWord(),e.findPrevious(),v(e);var i=e.selection.getRange();e.selection.setSelectionRange(i,!0)}},m:{param:!0,fn:function(e,t,n,r){var i=e.session,s=i.vimMarkers||(i.vimMarkers={}),o=e.getCursorPosition();s[r]||(s[r]=e.session.doc.createAnchor(o)),s[r].setPosition(o.row,o.column,!0)}},n:{fn:function(e,t,n,r){var i=e.getLastSearchOptions();i.backwards=!1,i.start=null,e.selection.moveCursorRight(),e.selection.clearSelection(),e.findNext(i),v(e);var Line truncated
Loaded 100 of 428 files, more files were not shown because too many files have changed in this diff. Show more