From a974dc384e3ce477de5c1bd7b3a7954a3780d9a4 Mon Sep 17 00:00:00 2001 From: Mashiro Date: Wed, 6 Jun 2018 11:32:00 +0800 Subject: [PATCH] Remove an useless tag... --- README.md | 1 - js/sakura-app.js | 1928 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 1797 insertions(+), 132 deletions(-) diff --git a/README.md b/README.md index 9af0fc3..bc7489c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ ![Sakura](https://view.moezx.cc/images/2018/05/26/sakura.png) -[![Github All Releases](https://img.shields.io/github/downloads/mashirozx/Sakura/total.svg?style=flat-square)](https://github.com/mashirozx/Sakura/releases) [![GitHub release](https://img.shields.io/github/release/mashirozx/Sakura.svg?style=flat-square)](https://github.com/mashirozx/Sakura/releases/latest) [![Github commits (since latest release)](https://img.shields.io/github/commits-since/mashirozx/Sakura/latest.svg?style=flat-square)](https://github.com/mashirozx/Sakura/commits/) [![](https://data.jsdelivr.com/v1/package/gh/moezx/cdn/badge)](https://www.jsdelivr.com/package/gh/moezx/cdn) diff --git a/js/sakura-app.js b/js/sakura-app.js index aeb0fe2..bffb6ea 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -4,134 +4,1800 @@ * @url https://2heng.xin * @date 2018.5.25 */ - -mashiro_global.variables=new function(){this.has_bot_ui=false;this.isNight=false;this.skinSecter=false;} -mashiro_global.ini=new function(){this.normalize=function(){lazyload();mashiro_global.post_list_show_animation.ini();} -this.pjax=function(){pjaxInit();mashiro_global.post_list_show_animation.ini();}} -function setCookie(name,value,days){var expires="";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toUTCString();} -document.cookie=name+mashiro_option.cookie_version_control+"="+(value||"")+expires+"; path=/";} -function getCookie(name){var nameEQ=name+mashiro_option.cookie_version_control+"=";var ca=document.cookie.split(';');for(var i=0;i=article_height) -$("article.post-list-thumb").eq(i).addClass('post-list-show');$(window).scroll(function(){var scrolltop=$(window).scrollTop();if(scrolltop+window_height>=article_height&&scrolltop) -$("article.post-list-thumb").eq(i).addClass("post-list-show");});});}} -mashiro_global.font_control=new function(){this.change_font=function(){if($("body").hasClass("serif")){$("body").removeClass("serif");$(".control-btn-serif").removeClass("selected");$(".control-btn-sans-serif").addClass("selected");setCookie("font_family","sans-serif",30);}else{$("body").addClass("serif");$(".control-btn-serif").addClass("selected");$(".control-btn-sans-serif").removeClass("selected");setCookie("font_family","serif",30);if(document.body.clientWidth<=860){addComment.createButterbar("将从网络加载字体,流量请注意");}}} -this.ini=function(){if(document.body.clientWidth>860){if(!getCookie("font_family")||getCookie("font_family")=="serif") -$("body").addClass("serif");} -if(getCookie("font_family")=="sans-serif"){$("body").removeClass("sans-serif");$(".control-btn-serif").removeClass("selected");$(".control-btn-sans-serif").addClass("selected");}}} -mashiro_global.font_control.ini();function code_highlight_style(){function gen_top_bar(i){var attributes={'autocomplete':'off','autocorrect':'off','autocapitalize':'off','spellcheck':'false','contenteditable':'false','design':'by Mashiro'} -var ele_name=$('pre:eq('+i+')')[0].children[0].className;var lang=ele_name.substr(0,ele_name.indexOf(" ")).replace('language-','');if(lang.toLowerCase()=="hljs")var lang="text";$('pre:eq('+i+')').addClass('highlight-wrap');for(var t in attributes){$('pre:eq('+i+')').attr(t,attributes[t]);} -$('pre:eq('+i+') code').attr('data-rel',lang.toUpperCase());} -$('pre code').each(function(i,block){hljs.highlightBlock(block);});for(var i=0;i<$('pre').length;i++){gen_top_bar(i);} -hljs.initLineNumbersOnLoad();$('pre').on('click',function(e){if(e.target!==this)return;$(this).toggleClass('code-block-fullscreen');$('html').toggleClass('code-block-fullscreen-html-scroll');});} -try{code_highlight_style();}catch(e){} -function attach_image(){$('#upload-img-file').change(function(){if(this.files.length>10){addComment.createButterbar("每次上传上限为10张.
10 files max per request.");return 0;} -for(i=0;i=5242880){alert('图片上传大小限制为5 MB.\n5 MB max per file.\n\n「'+this.files[i].name+'」\n\n这张图太大啦~\nThis image is too large~');}} -for(var i=0;i