Permalink
Browse files

style: move <script> to external JS files

  • Loading branch information...
MOxFIVE committed Mar 16, 2016
1 parent 41342a3 commit 0d5a87c485270a6b9698a3181df56564c970c6ac
@@ -8,7 +8,6 @@
<%- partial('mathjax') %>
<% } %>
<%- partial('scrolling-button') %>
<%- partial('_partial/hide-labels') %>
<% if (theme.jquery_ui){ %>
<script src="//cdn.bootcss.com/jqueryui/1.10.4/jquery-ui.min.js"></script>
<% } %>

This file was deleted.

Oops, something went wrong.
@@ -21,24 +21,5 @@
</div>
<%- list_posts({amount: 999}) %>
<script>
$(".post-list").addClass("toc-article");
$(".post-list-item a").attr("target","_blank");
$("#post-nav-button > a:nth-child(2)").click(function() {
$(".fa-bars, .fa-times").toggle();
$(".post-list").toggle(300);
if ($(".toc").length > 0) {
$("#toc, #tocButton").toggle(200, function() {
if ($(".switch-area").is(":visible")) {
$("#toc, .switch-btn, .switch-area").toggle();
$("#tocButton").attr("value", valueHide);
}
})
}
else {
$(".switch-btn, .switch-area").fadeToggle(300);
}
})
</script>
<% } %>
@@ -2,12 +2,4 @@
<a href="#" title="返回顶部"><i class="fa fa-arrow-up"></i></a>
<a href="#comments" title="查看评论"><i class="fa fa-comments-o"></i></a>
<a href="#footer" title="转到底部"><i class="fa fa-arrow-down"></i></a>
</div>
<script>
$(document).ready(function() {
if ($("#comments").length < 1) {
$("#scroll > a:nth-child(2)").hide();
};
})
</script>
</div>
View
@@ -148,4 +148,22 @@ require([], function (){
$("#container #mobile-nav .overlay").css({"background-color": colorList[id],"opacity": .7});
$("table").wrap("<div class='table-area'></div>");
// Hide Comment Button
$(document).ready(function() {
if ($("#comments").length < 1) {
$("#scroll > a:nth-child(2)").hide();
};
})
// Hide Labels
if(yiliaConfig.isArchive || yiliaConfig.isTag || yiliaConfig.isCategory) {
$(document).ready(function() {
$("#footer").after("<button class='hide-labels'>TAG 开关</button>");
$(".hide-labels").click(function() {
$(".article-info").toggle(200);
});
});
}
});
View
@@ -97,58 +97,82 @@ define([], function(){
});
}
var miniArchives = function(){
if(yiliaConfig.isPost) {
$(".post-list").addClass("toc-article");
$(".post-list-item a").attr("target","_blank");
$("#post-nav-button > a:nth-child(2)").click(function() {
$(".fa-bars, .fa-times").toggle();
$(".post-list").toggle(300);
if ($(".toc").length > 0) {
$("#toc, #tocButton").toggle(200, function() {
if ($(".switch-area").is(":visible")) {
$("#toc, .switch-btn, .switch-area").toggle();
$("#tocButton").attr("value", valueHide);
}
});
}
else {
$(".switch-btn, .switch-area").fadeToggle(300);
}
});
}
}
var tooltip = function(){
$(function() {
// if _config.yml => jquery_ui: false
if (!$().tooltip) return;
if (navigator.userAgent.match(/(iPhone|iPad|Android|ios|PlayBook|Touch)/i)) return;
$("[title]").tooltip({
show: {
effect: 'blind',
delay: 250,
duration: 55,
}
})
$("#scroll").tooltip({
show: {
effect: 'clip',
delay: 600,
duration: 50,
}
})
$("#tocButton, #comments").tooltip({
show: {
delay: 1200,
}
})
$(".ds-replybox form").off("tooltip")
$("#post-nav-button").tooltip({
show: {
effect: 'clip',
delay: 280,
duration: 65,
}
})
$("#post-nav-button > a:nth-child(2)").tooltip({
show: {
delay: 1500,
}
})
$(".social").tooltip({
show: {
effect: 'scale',
delay: 350,
duration: 70,
}
})
});
}
return {
init: function(){
resetTags();
bind();
Tips.init();
miniArchives();
tooltip();
}
}
});
$(function() {
// if _config.yml => jquery_ui: false
if (!$().tooltip) return;
if (navigator.userAgent.match(/(iPhone|iPad|Android|ios|PlayBook|Touch)/i)) return;
$("[title]").tooltip({
show: {
effect: 'blind',
delay: 250,
duration: 55,
}
})
$("#scroll").tooltip({
show: {
effect: 'clip',
delay: 600,
duration: 50,
}
})
$("#tocButton, #comments").tooltip({
show: {
delay: 1200,
}
})
$(".ds-replybox form").off("tooltip")
$("#post-nav-button").tooltip({
show: {
effect: 'clip',
delay: 280,
duration: 65,
}
})
$("#post-nav-button > a:nth-child(2)").tooltip({
show: {
delay: 1500,
}
})
$(".social").tooltip({
show: {
effect: 'scale',
delay: 350,
duration: 70,
}
})
});

0 comments on commit 0d5a87c

Please sign in to comment.