chore: minor fixes

pull/93/head v0.2.0
ppoffice 2016-02-08 20:20:35 +08:00
parent 28854df5bd
commit b421b47e18
4 changed files with 47 additions and 118 deletions

View File

@ -1,19 +0,0 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8
# 4 space indentation
[{*.json,*.yml,*.styl,*.ejs}]
indent_style = space
indent_size = 2

View File

@ -1,46 +0,0 @@
module.exports = function(grunt){
grunt.initConfig({
gitclone: {
fontawesome: {
options: {
repository: 'https://github.com/FortAwesome/Font-Awesome.git',
directory: 'tmp/fontawesome'
},
},
fancybox: {
options: {
repository: 'https://github.com/fancyapps/fancyBox.git',
directory: 'tmp/fancybox'
}
}
},
copy: {
fontawesome: {
expand: true,
cwd: 'tmp/fontawesome/fonts/',
src: ['**'],
dest: 'source/css/fonts/'
},
fancybox: {
expand: true,
cwd: 'tmp/fancybox/source/',
src: ['**'],
dest: 'source/fancybox/'
}
},
_clean: {
tmp: ['tmp'],
fontawesome: ['source/css/fonts'],
fancybox: ['source/fancybox']
}
});
require('load-grunt-tasks')(grunt);
grunt.renameTask('clean', '_clean');
grunt.registerTask('fontawesome', ['gitclone:fontawesome', 'copy:fontawesome', '_clean:tmp']);
grunt.registerTask('fancybox', ['gitclone:fancybox', 'copy:fancybox', '_clean:tmp']);
grunt.registerTask('default', ['gitclone', 'copy', '_clean:tmp']);
grunt.registerTask('clean', ['_clean']);
};

View File

@ -1,12 +1,5 @@
{
"name": "hexo-theme-icarus",
"version": "0.0.1",
"private": true,
"devDependencies": {
"grunt": "~0.4.2",
"load-grunt-tasks": "~0.2.0",
"grunt-git": "~0.2.2",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-copy": "~0.4.1"
}
"version": "0.2.0",
"private": true
}

View File

@ -4,11 +4,13 @@
// Caption
$('.article-entry').each(function(i){
$(this).find('img').each(function(){
if ($(this).parent().hasClass('fancybox')) return;
if ($(this).parent().hasClass('fancybox')) {
return;
}
var alt = this.alt;
if (alt) $(this).after('<span class="caption">' + alt + '</span>');
if (alt) {
$(this).after('<span class="caption">' + alt + '</span>');
}
$(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
});
@ -17,7 +19,6 @@
$(this).attr('rel', 'article' + i);
});
});
if ($.fancybox){
$('.fancybox').fancybox();
}
@ -46,7 +47,7 @@
$('#toTop').css('right', 20);
}
}).on('click', '#toTop', function () {
$(document).scrollTop(0);
$('body, html').animate({ scrollTop: 0 }, 600);
});
})(jQuery);