-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- v3.3.1
- v3.3.0
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.1
- v3.1.0
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.10.10
- v2.10.9
- v2.10.8
- v2.10.7
- v2.10.6
- v2.10.5
- v2.10.4
- v2.10.3
- v2.10.2
- v2.10.1
- v2.10.0
- v2.9.15
- v2.9.14
- v2.9.13
- v2.9.12
- v2.9.11
- v2.9.10
- v2.9.9
- v2.9.8
- v2.9.7
- v2.9.6
- v2.9.5
- v2.9.4
- v2.9.3
- v2.9.2
- v2.9.1
- v2.9.0
- v2.8.16
- v2.8.15
- v2.8.13
- v2.8.12
- v2.8.11
- v2.8.10
- v2.8.9
- v2.8.8
- v2.8.7
- v2.8.6
- v2.8.5
- v2.8.3
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.7
- v2.6.6
- v2.6.5
- v2.6.3
- v2.6.2
- v2.6.1
- v2.5.5
- v2.5.3
- v2.5.2
- v2.5.1
- v2.4.17
- v2.4.16
- v2.4.15
- v2.4.13
- v2.4.12
- v2.4.11
- v2.4.10
- v2.4.9
- v2.4.8
- v2.4.7
- v2.4.6
- v2.4.5
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.3
- v2.3.1
- v2.3.0
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0
- v1.8.6
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- 2.8.14
Showing
6 changed files
with
232 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,128 @@ | ||
$(function() { | ||
hljs.initHighlightingOnLoad(); | ||
|
||
$(function(){ | ||
hljs.initHighlightingOnLoad(); | ||
|
||
var EditormdView = editormd.markdownToHTML("page_md_content", { | ||
htmlDecode : "style,script,iframe", // you can filter tags decode | ||
emoji : true, | ||
taskList : true, | ||
tex : true, // 默认不解析 | ||
flowChart : true, // 默认不解析 | ||
sequenceDiagram : true, // 默认不解析 | ||
}); | ||
|
||
//为所有table标签添加bootstap支持的表格类 | ||
$("table").addClass("table table-bordered table-hover"); | ||
//当表格列数过长时将自动出现滚动条 | ||
$.each($('table'), function() { | ||
$(this).prop('outerHTML', '<div style="width: 100%;overflow-x: auto;">'+$(this).prop('outerHTML')+'</div>'); | ||
}); | ||
|
||
//超链接都在新窗口打开 | ||
$('a[href^="http"]').each(function() { | ||
$(this).attr('target', '_blank'); | ||
}); | ||
if (!isMobile()) { | ||
$("th").css("min-width","77px"); | ||
}; | ||
|
||
//lightbox | ||
//增加返回顶部按钮 | ||
$.goup({ | ||
trigger: 100, | ||
bottomOffset: 150, | ||
locationOffset: 100, | ||
title: lang["back_to_top"] , | ||
titleAsText: true, | ||
containerColor:"#08c", | ||
}); | ||
var EditormdView = editormd.markdownToHTML("page_md_content", { | ||
htmlDecode: "style,script,iframe", // you can filter tags decode | ||
emoji: true, | ||
taskList: true, | ||
tex: true, // 默认不解析 | ||
flowChart: true, // 默认不解析 | ||
sequenceDiagram: true, // 默认不解析 | ||
}); | ||
|
||
if( isMobile() || $(window).width() < 1000){ | ||
AdaptToMobile(); | ||
} | ||
//为所有table标签添加bootstap支持的表格类 | ||
$("table").addClass("table table-bordered table-hover"); | ||
//当表格列数过长时将自动出现滚动条 | ||
$.each($('table'), function() { | ||
$(this).prop('outerHTML', '<div style="width: 100%;overflow-x: auto;">' + $(this).prop('outerHTML') + '</div>'); | ||
}); | ||
|
||
$(window).resize(function(){ | ||
if( isMobile()){ | ||
AdaptToMobile(); | ||
} | ||
//超链接都在新窗口打开 | ||
$('a[href^="http"]').each(function() { | ||
$(this).attr('target', '_blank'); | ||
}); | ||
if (!isMobile()) { | ||
$("th").css("min-width", "77px"); | ||
}; | ||
|
||
else if($(window).width() < 1000){ | ||
AdaptToMobile(); | ||
}else{ | ||
window.location.reload(); | ||
} | ||
}); | ||
//lightbox | ||
//增加返回顶部按钮 | ||
$.goup({ | ||
trigger: 100, | ||
bottomOffset: 150, | ||
locationOffset: 100, | ||
title: lang["back_to_top"], | ||
titleAsText: true, | ||
containerColor: "#08c", | ||
}); | ||
|
||
if (isMobile() || $(window).width() < 1000) { | ||
AdaptToMobile(); | ||
} | ||
|
||
$(window).resize(function() { | ||
if (isMobile()) { | ||
AdaptToMobile(); | ||
} else if ($(window).width() < 1000) { | ||
AdaptToMobile(); | ||
} else { | ||
window.location.reload(); | ||
} | ||
}); | ||
|
||
history.replaceState(null, null, $("#share-item-link").html()); | ||
history.replaceState(null, null, $("#share-item-link").html()); | ||
|
||
//分享项目 | ||
$("#share").click(function(){ | ||
$("#share").click(function() { | ||
$("#share-modal").modal(); | ||
//延迟绑定分享事件 | ||
setTimeout(function(){ | ||
$('#copy-item-link').zclip( | ||
{ | ||
path: DocConfig.pubile +'/jquery.zclip/ZeroClipboard.swf', | ||
copy:function() | ||
{ | ||
return $('#share-item-link').html(); | ||
}, | ||
afterCopy: function() { | ||
show_top_msg("已经成功复制到剪切板",2000); | ||
} | ||
}); | ||
|
||
},500); | ||
//延迟绑定分享事件 | ||
setTimeout(function() { | ||
$('#copy-item-link').zclip({ | ||
path: DocConfig.pubile + '/jquery.zclip/ZeroClipboard.swf', | ||
copy: function() { | ||
return $('#share-item-link').html(); | ||
}, | ||
afterCopy: function() { | ||
show_top_msg("已经成功复制到剪切板", 2000); | ||
} | ||
}); | ||
|
||
}, 500); | ||
return false; | ||
}); | ||
|
||
$("table thead tr").css({"background-color":"#08c","color":"#fff"}); | ||
$("table tr").each(function(){ | ||
if($(this).find("td").eq(1).html()=="object" || $(this).find("td").eq(1).html()=="array[object]") | ||
{ | ||
$(this).css({"background-color":"#99CC99","color":"#000"}); | ||
$("table thead tr").css({ | ||
"background-color": "#08c", | ||
"color": "#fff" | ||
}); | ||
$("table tr").each(function() { | ||
if ($(this).find("td").eq(1).html() == "object" || $(this).find("td").eq(1).html() == "array[object]") { | ||
$(this).css({ | ||
"background-color": "#99CC99", | ||
"color": "#000" | ||
}); | ||
} | ||
|
||
}); | ||
}); | ||
|
||
function AdaptToMobile() { | ||
$(".doc-container").css("width", "90%"); | ||
$("#doc-body").css("width", "90%"); | ||
$("#header").css("height", "20px"); | ||
$(".doc-title-box").css("margin", "20px 20px 0px 20px"); | ||
$("#footer").css("font-size", "11pt"); | ||
$(".tool-bar").hide(); | ||
} | ||
|
||
}); | ||
//图片点击放大 | ||
$("#page_md_content img").click(function() { | ||
var img_url = $(this).attr("src"); | ||
//如果不在iframe里,则直接当前窗口打开 | ||
if (self == top) { | ||
var json = { | ||
"title": "", //相册标题 | ||
"id": 123, //相册id | ||
"start": 0, //初始显示的图片序号,默认0 | ||
"data": [ //相册包含的图片,数组格式 | ||
{ | ||
"alt": "", | ||
"pid": 666, //图片id | ||
"src": img_url, //原图地址 | ||
"thumb": img_url //缩略图地址 | ||
} | ||
] | ||
} | ||
|
||
layer.photos({ | ||
photos: json, | ||
anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数) | ||
}); | ||
|
||
} else { | ||
//如果在iframe里,则直接传url给父窗口 | ||
top.postMessage(img_url, '*'); | ||
} | ||
|
||
}); | ||
|
||
function AdaptToMobile(){ | ||
$(".doc-container").css("width","90%"); | ||
$("#doc-body").css("width","90%"); | ||
$("#header").css("height","20px"); | ||
$(".doc-title-box").css("margin","20px 20px 0px 20px"); | ||
$("#footer").css("font-size","11pt"); | ||
$(".tool-bar").hide(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters