From 89656306f4e6541a3ba1f978f50a17872cc21b58 Mon Sep 17 00:00:00 2001 From: mashiro Date: Thu, 14 Nov 2019 02:39:22 +0800 Subject: [PATCH] imgur upload support --- functions.php | 67 +-------- inc/api.php | 177 +++++++++++++++++++++++ inc/test.jpg | Bin 0 -> 32303 bytes inc/test.php | 31 ++++ js/sakura-app.js | 367 +++++++++++++++++++++++++---------------------- options.php | 38 +++++ 6 files changed, 446 insertions(+), 234 deletions(-) create mode 100644 inc/api.php create mode 100644 inc/test.jpg create mode 100644 inc/test.php diff --git a/functions.php b/functions.php index f212159..119d367 100644 --- a/functions.php +++ b/functions.php @@ -27,8 +27,6 @@ if ( !function_exists( 'optionsframework_init' ) ) { define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/inc/' ); require_once dirname( __FILE__ ) . '/inc/options-framework.php'; } - - function akina_setup() { /* @@ -214,6 +212,7 @@ add_action( 'wp_enqueue_scripts', 'sakura_scripts' ); */ require get_template_directory() .'/inc/decorate.php'; require get_template_directory() .'/inc/swicher.php'; +require get_template_directory() .'/inc/api.php'; /** * Custom template tags for this theme. @@ -1633,68 +1632,6 @@ add_action( 'pre_get_posts', function( $q ){ $q->set( 'post__not_in', get_option( 'sticky_posts' ) ); }); -/* - * 定制实时搜索 rest api - * @rest api接口路径:https://sakura.2heng.xin/wp-json/cache_search/v1/json/ - * @可在cache_search_json()函数末尾通过设置 HTTP header 控制 json 缓存时间 - */ -function cache_search_json() { - $vowels = array("[", "{","]","}","<",">","\r\n", "\r", "\n","-","'",'"','`'," ",":",";",'\\'," ","toc"); - $regex = <<])*>|begin[\S\s]*\/begin|hermit[\S\s]*\/hermit|img[\S\s]*\/img|{{.*?}}|:.*?:/m -EOS; - - $posts = new WP_Query('posts_per_page=-1&post_status=publish&post_type=post'); - while ($posts->have_posts()) : $posts->the_post(); - $output .= '{"type":"post","link":"'.get_post_permalink().'","title":'.json_encode(get_the_title()).',"comments":"'.get_comments_number('0', '1', '%').'","text":'.json_encode(str_replace($vowels, " ",preg_replace($regex,' ',get_the_content()))).'},'; - endwhile; - wp_reset_postdata(); - - $pages = get_pages(); - foreach ($pages as $page) { - $output .= '{"type":"page","link":"'.get_page_link($page).'","title":'.json_encode($page->post_title).',"comments":"'.$page->comment_count.'","text":'.json_encode(str_replace($vowels, " ",preg_replace($regex,' ',$page->post_content))).'},'; - } - - $tags = get_tags(); - foreach ($tags as $tag) { - $output .= '{"type":"tag","link":"'.get_term_link($tag).'","title":'.json_encode($tag->name).',"comments":"","text":""},'; - } - - $categories = get_categories(); - foreach ($categories as $category) { - $output .= '{"type":"category","link":"'.get_term_link($category).'","title":'.json_encode($category->name).',"comments":"","text":""},'; - } - if(akina_option('live_search_comment')){ - $comments = get_comments(); - foreach ($comments as $comment) { - $is_private = get_comment_meta($comment->comment_ID, '_private', true); - if($is_private){ - $output .= '{"type":"comment","link":"'.get_comment_link($comment).'","title":'.json_encode(get_the_title($comment->comment_post_ID)).',"comments":"","text":'.json_encode($comment->comment_author.":".__("The comment is private","sakura")/*该评论为私密评论*/).'},'; - continue; - }else{ - $output .= '{"type":"comment","link":"'.get_comment_link($comment).'","title":'.json_encode(get_the_title($comment->comment_post_ID)).',"comments":"","text":'.json_encode(str_replace($vowels, " ",preg_replace($regex," ",$comment->comment_author.":".$comment->comment_content))).'},'; - } - } - } - - $output = substr($output,0,strlen($output)-1); - - $data = '['.$output.']'; - $result = new WP_REST_Response(json_decode($data), 200); - $result->set_headers(array('Content-Type' => 'application/json', - 'Cache-Control' => 'max-age=3600')); // json 缓存控制 - - return $result; -} -if(akina_option('live_search')){ - add_action( 'rest_api_init', function () { - register_rest_route( 'cache_search/v1', '/json/', array( - 'methods' => 'GET', - 'callback' => 'cache_search_json', - ) ); - } ); -} - //评论回复 function sakura_comment_notify($comment_id){ if ( !$_POST['mail-notify'] ) @@ -1702,4 +1639,4 @@ function sakura_comment_notify($comment_id){ } add_action('comment_post', 'sakura_comment_notify'); -//code end +//code end \ No newline at end of file diff --git a/inc/api.php b/inc/api.php new file mode 100644 index 0000000..f361261 --- /dev/null +++ b/inc/api.php @@ -0,0 +1,177 @@ + 'POST', + 'callback' => 'upload_image', + )); + register_rest_route('sakura/v1', '/cache_search/json', array( + 'methods' => 'GET', + 'callback' => 'cache_search_json', + )); +}); + +/** + * Image uploader response + */ +function upload_image(WP_REST_Request $req) +{ + // see: https://developer.wordpress.org/rest-api/requests/ + + // handle file params $file === $_FILES + /** + * curl \ + * -F "filecomment=This is an img file" \ + * -F "cmt_img_file=@screenshot.jpg" \ + * https://dev.2heng.xin/wp-json/sakura/v1/image/upload + */ + $file = $req->get_file_params(); + $image = file_get_contents($_FILES["cmt_img_file"]["tmp_name"]); + + switch (akina_option("img_upload_api")) { + case 'imgur': + $API_Request = Imgur_API($image); + break; + case 'smms': + $API_Request = SMMS_API($image); + break; + } + + $result = new WP_REST_Response($API_Request, 200); + $result->set_headers(array('Content-Type' => 'application/json', + 'Cache-Control' => 'max-age=3600')); // json 缓存控制 + return $result; +} + +/** + * Imgur upload interface + */ +function Imgur_API($image) +{ + $client_id = akina_option('imgur_client_id'); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, akina_option('imgur_upload_image_proxy')); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Client-ID ' . $client_id)); + curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => base64_encode($image))); + + $reply = curl_exec($ch); + curl_close($ch); + + $reply = json_decode($reply); + + if ($reply->success && $reply->status == 200) { + $status = 200; + $message = "success"; + $link = $reply->data->link; + $proxy = akina_option('cmt_image_proxy') . $link; + } else { + $status = $reply->status; + $message = $reply->data->error; + $link = 'https://view.moezx.cc/images/2019/10/28/default_d_h_large.gif'; + $proxy = akina_option('cmt_image_proxy') . $link; + } + $output = array( + 'status' => $status, + 'message' => $message, + 'link' => $link, + 'proxy' => $proxy, + ); + return $output; +} + +function SMMS_API($image) +{ + $client_id = akina_option('smms_client_id'); + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, 'https://sm.ms/api/v2/upload'); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $client_id)); + curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type ' . 'multipart/form-data')); + curl_setopt($ch, CURLOPT_POSTFIELDS, array('smfile' => $image)); + + $reply = curl_exec($ch); + curl_close($ch); + + $reply = json_decode($reply); + + if ($reply->success && $reply->code == 'success') { + $status = 200; + $message = $reply->message; + $link = $reply->data->url; + $proxy = akina_option('cmt_image_proxy') . $link; + } else { + $status = 0; // sm.ms 接口不规范,谁给提个意见?我要状态码! + $message = $reply->message; + $link = 'https://view.moezx.cc/images/2019/10/28/default_d_h_large.gif'; + $proxy = akina_option('cmt_image_proxy') . $link; + } + $output = array('status' => $status, + 'message' => $message, + 'link' => $link, + 'proxy' => $proxy, + ); + return $output; +} + +/* + * 定制实时搜索 rest api + * @rest api接口路径:https://sakura.2heng.xin/wp-json/cache_search/v1/json/ + * @可在cache_search_json()函数末尾通过设置 HTTP header 控制 json 缓存时间 + */ +function cache_search_json() +{ + $vowels = array("[", "{", "]", "}", "<", ">", "\r\n", "\r", "\n", "-", "'", '"', '`', " ", ":", ";", '\\', " ", "toc"); + $regex = <<])*>|begin[\S\s]*\/begin|hermit[\S\s]*\/hermit|img[\S\s]*\/img|{{.*?}}|:.*?:/m +EOS; + + $posts = new WP_Query('posts_per_page=-1&post_status=publish&post_type=post'); + while ($posts->have_posts()): $posts->the_post(); + $output .= '{"type":"post","link":"' . get_post_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', get_the_content()))) . '},'; + endwhile; + wp_reset_postdata(); + + $pages = get_pages(); + foreach ($pages as $page) { + $output .= '{"type":"page","link":"' . get_page_link($page) . '","title":' . json_encode($page->post_title) . ',"comments":"' . $page->comment_count . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', $page->post_content))) . '},'; + } + + $tags = get_tags(); + foreach ($tags as $tag) { + $output .= '{"type":"tag","link":"' . get_term_link($tag) . '","title":' . json_encode($tag->name) . ',"comments":"","text":""},'; + } + + $categories = get_categories(); + foreach ($categories as $category) { + $output .= '{"type":"category","link":"' . get_term_link($category) . '","title":' . json_encode($category->name) . ',"comments":"","text":""},'; + } + if (akina_option('live_search_comment')) { + $comments = get_comments(); + foreach ($comments as $comment) { + $is_private = get_comment_meta($comment->comment_ID, '_private', true); + if ($is_private) { + $output .= '{"type":"comment","link":"' . get_comment_link($comment) . '","title":' . json_encode(get_the_title($comment->comment_post_ID)) . ',"comments":"","text":' . json_encode($comment->comment_author . ":" . __("The comment is private", "sakura") /*该评论为私密评论*/) . '},'; + continue; + } else { + $output .= '{"type":"comment","link":"' . get_comment_link($comment) . '","title":' . json_encode(get_the_title($comment->comment_post_ID)) . ',"comments":"","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, " ", $comment->comment_author . ":" . $comment->comment_content))) . '},'; + } + } + } + + $output = substr($output, 0, strlen($output) - 1); + + $data = '[' . $output . ']'; + $result = new WP_REST_Response(json_decode($data), 200); + $result->set_headers(array('Content-Type' => 'application/json', + 'Cache-Control' => 'max-age=3600')); // json 缓存控制 + + return $result; +} \ No newline at end of file diff --git a/inc/test.jpg b/inc/test.jpg new file mode 100644 index 0000000000000000000000000000000000000000..09d5076e10a0ca3fd0bddec989f1683f3eec9d1e GIT binary patch literal 32303 zcmeFYWl&tvwl3NP4en0k0fM_*5;OsVI|&w~gS)#s1PQ_2-Q61t4vo8OH`)OLmwoQL z`|NYysdMjruin2mtH!GCHM^>7%r(}W-}t^Uo)@220Kot>6ckhxWHeM%)Yq@k&@l*(s4nwfvIu(Yyv za&~cbbNBEJ3JwVk3y+9QO!|?Wl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*1w!fMAKSMs< Ag#Z8m literal 0 HcmV?d00001 diff --git a/inc/test.php b/inc/test.php new file mode 100644 index 0000000..ee10f85 --- /dev/null +++ b/inc/test.php @@ -0,0 +1,31 @@ + base64_encode($image))); + + $reply = curl_exec($ch); + curl_close($ch); + + $reply = json_decode($reply); + var_dump($reply); + printf('', $reply->data->link); + $res = $reply->data->link; + $res = 'https://images.weserv.nl/?url='.$res; + echo $res; + printf('', $res); +} + +Imgur_API($image); \ No newline at end of file diff --git a/js/sakura-app.js b/js/sakura-app.js index dd32459..f62e98a 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -63,7 +63,7 @@ function imgError(ele, type) { default: ele.src = 'https://view.moezx.cc/images/2018/05/13/image-404.png'; } -} +} function post_list_show_animation() { if ($("article").hasClass("post-list-thumb")) { @@ -73,6 +73,7 @@ function post_list_show_animation() { } var io = new IntersectionObserver(callback, options); var articles = document.querySelectorAll('.post-list-thumb'); + function callback(entries) { entries.forEach((article) => { if (article.target.classList.contains("post-list-show")) { @@ -157,9 +158,9 @@ try { code_highlight_style(); } catch (e) {} -if (Poi.reply_link_version == 'new'){ - $('body').on('click','.comment-reply-link',function(){ - addComment.moveForm( "comment-"+$(this).attr('data-commentid'), $(this).attr('data-commentid'), "respond", $(this).attr('data-postid') ); +if (Poi.reply_link_version == 'new') { + $('body').on('click', '.comment-reply-link', function () { + addComment.moveForm("comment-" + $(this).attr('data-commentid'), $(this).attr('data-commentid'), "respond", $(this).attr('data-postid')); return false; }); } @@ -179,9 +180,9 @@ function attach_image() { for (var i = 0; i < this.files.length; i++) { var f = this.files[i]; var formData = new FormData(); - formData.append('smfile', f); + formData.append('cmt_img_file', f); $.ajax({ - url: 'https://sm.ms/api/upload', + url: '/wp-json/sakura/v1/image/upload', type: 'POST', processData: false, contentType: false, @@ -195,18 +196,24 @@ function attach_image() { setTimeout(function () { cached.html(''); }, 1000); - var get_the_url = res.data.url; + var get_the_url = res.proxy; $('#upload-img-show').append(''); lazyload(); addComment.createButterbar("图片上传成功~
Uploaded successfully~"); - grin(res.data.url.replace('https://i.loli.net/', '{UPLOAD}'), type = 'Img'); + grin(get_the_url, type = 'Img'); }, - error: function () { + error: function (jqXHR, textStatus, errorThrown) { cached.html(''); alert("上传失败,请重试.\nUpload failed, please try again."); setTimeout(function () { cached.html(''); }, 1000); + // console.info(jqXHR.responseText); + // console.info(jqXHR.status); + // console.info(jqXHR.readyState); + // console.info(jqXHR.statusText); + // console.info(textStatus); + // console.info(errorThrown); } }) } @@ -297,6 +304,7 @@ function checkskinSecter() { $(".headertop-bar-sakura").removeClass('headertop-bar-sakura').addClass('headertop-bar'); } } + function checkBgImgCookie() { var bgurl = getCookie("bgImgSetting"); if (!bgurl) { @@ -306,7 +314,7 @@ function checkBgImgCookie() { } } if (document.body.clientWidth > 860) { - setTimeout(function() { + setTimeout(function () { checkBgImgCookie(); }, 100); } @@ -317,15 +325,16 @@ function no_right_click() { }); } no_right_click(); -$(document).ready(function() { - function checkskin_bg(a){ +$(document).ready(function () { + function checkskin_bg(a) { return a == "none" ? "" : a } + function changeBG() { - var cached=$(".menu-list"); - cached.find("li").each(function() { + var cached = $(".menu-list"); + cached.find("li").each(function () { var tagid = this.id; - cached.on("click", "#" + tagid, function(){ + cached.on("click", "#" + tagid, function () { if (tagid == "white-bg") { mashiro_global.variables.skinSecter = true; checkskinSecter(); @@ -372,14 +381,14 @@ $(document).ready(function() { function closeSkinMenu() { $(".skin-menu").removeClass('show'); - setTimeout(function() { + setTimeout(function () { $(".changeSkin-gear").css("visibility", "visible"); }, 300); } - $(".changeSkin-gear").click(function() { + $(".changeSkin-gear").click(function () { $(".skin-menu").toggleClass('show'); }) - $(".skin-menu #close-skinMenu").click(function() { + $(".skin-menu #close-skinMenu").click(function () { closeSkinMenu(); }); add_upload_tips(); @@ -514,16 +523,16 @@ function coverVideoIni() { if ($('video').hasClass('hls')) { var video = addComment.I('coverVideo'); var video_src = $('#coverVideo').attr('data-src'); - if(Hls.isSupported()) { + if (Hls.isSupported()) { var hls = new Hls(); hls.loadSource(video_src); hls.attachMedia(video); - hls.on(Hls.Events.MANIFEST_PARSED,function() { + hls.on(Hls.Events.MANIFEST_PARSED, function () { video.play(); }); } else if (video.canPlayType('application/vnd.apple.mpegurl')) { video.src = video_src; - video.addEventListener('loadedmetadata',function() { + video.addEventListener('loadedmetadata', function () { video.play(); }); } @@ -533,7 +542,9 @@ function coverVideoIni() { function copy_code_block() { $('pre code').each(function (i, block) { - $(block).attr({ id: 'hljs-' + i }); + $(block).attr({ + id: 'hljs-' + i + }); $(this).after(''); }); var clipboard = new ClipboardJS('.copy-code'); @@ -548,7 +559,7 @@ function tableOfContentScroll(flag) { if (flag) { var id = 1, heading_fix = mashiro_option.entry_content_theme == "sakura" ? $("article").hasClass("type-post") ? $("div").hasClass("pattern-attachment-img") ? -75 : 200 : 375 : window.innerHeight / 2; - $(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function() { + $(".entry-content , .links").children("h1,h2,h3,h4,h5").each(function () { var hyphenated = "toc-head-" + id; this.id = hyphenated; id++; @@ -557,7 +568,7 @@ function tableOfContentScroll(flag) { tocSelector: '.toc', contentSelector: ['.entry-content', '.links'], headingSelector: 'h1, h2, h3, h4, h5', - headingsOffset: heading_fix-window.innerHeight/2, + headingsOffset: heading_fix - window.innerHeight / 2, }); } } @@ -722,7 +733,7 @@ $(function () { getqqinfo(); }); -if(mashiro_option.float_player_on) { +if (mashiro_option.float_player_on) { function aplayerF() { 'use strict'; var aplayers = [], @@ -761,7 +772,7 @@ if(mashiro_option.float_player_on) { console.log(a) } var lrcTag = 1; - $(".aplayer.aplayer-fixed").click(function(){ + $(".aplayer.aplayer-fixed").click(function () { if (lrcTag == 1) { for (var f = 0; f < aplayers.length; f++) try { aplayers[f].lrc.show(); @@ -772,18 +783,24 @@ if(mashiro_option.float_player_on) { lrcTag = 2; }); var apSwitchTag = 0; - var aplayerlist=$(".aplayer-list"); - aplayerlist.removeClass( "aplayer-list-hide" ).css({maxHeight:'0px'}); + var aplayerlist = $(".aplayer-list"); + aplayerlist.removeClass("aplayer-list-hide").css({ + maxHeight: '0px' + }); $(".aplayer.aplayer-fixed .aplayer-body").addClass("ap-hover"); - $(".aplayer-miniswitcher").click(function(){ + $(".aplayer-miniswitcher").click(function () { if (apSwitchTag == 0) { - aplayerlist.removeClass( "aplayer-list-hide" ).animate({maxHeight:'250px'}); - $(".aplayer.aplayer-fixed .aplayer-body").removeClass( "ap-hover" ); + aplayerlist.removeClass("aplayer-list-hide").animate({ + maxHeight: '250px' + }); + $(".aplayer.aplayer-fixed .aplayer-body").removeClass("ap-hover"); apSwitchTag = 1; } else { - aplayerlist.css({maxHeight:'0px'}); - $(".aplayer.aplayer-fixed .aplayer-body").addClass( "ap-hover" ); - apSwitchTag =0; + aplayerlist.css({ + maxHeight: '0px' + }); + $(".aplayer.aplayer-fixed .aplayer-body").addClass("ap-hover"); + apSwitchTag = 0; } }); } @@ -824,12 +841,13 @@ if(mashiro_option.float_player_on) { document.addEventListener('DOMContentLoaded', loadMeting, !1); } if (document.body.clientWidth > 860) { - aplayerF (); + aplayerF(); } } function getqqinfo() { - var is_get_by_qq = false,cached = $('input'); + var is_get_by_qq = false, + cached = $('input'); if (!getCookie('user_qq') && !getCookie('user_qq_email') && !getCookie('user_author')) { cached.filter('#qq,#author,#email,#url').val(''); } @@ -1284,20 +1302,22 @@ var home = location.href, AH: function () { if (Poi.windowheight == 'auto') { if ($('h1.main-title').length > 0) { - var _height = $(window).height()+"px"; + var _height = $(window).height() + "px"; $('#centerbg').css({ 'height': _height }); $('#bgvideo').css({ 'min-height': _height }); - window.resizeFlag= null; + window.resizeFlag = null; $(window).resize(function () { //直接resize性能爆炸,改成延时 - if(resizeFlag=null){ + if (resizeFlag = null) { clearTimeout(resizeFlag); } - resizeFlag = setTimeout(function(){ Siren.AH();}, 1000); + resizeFlag = setTimeout(function () { + Siren.AH(); + }, 1000); }) } } else { @@ -1349,131 +1369,134 @@ var home = location.href, $('.js-toggle-search').on('click', function () { $('.js-toggle-search').toggleClass('is-active'); $('.js-search').toggleClass('is-visible'); - $('html').css('overflow-y','hidden'); + $('html').css('overflow-y', 'hidden'); if (mashiro_option.live_search) { - var QueryStorage = []; - search_a("https://"+document.domain+"/wp-json/cache_search/v1/json/"); - - var otxt = addComment.I("search-input"), - list = addComment.I("PostlistBox"), - Record = list.innerHTML, - searchFlag = null; - otxt.oninput = function () { - if(searchFlag=null){ - clearTimeout(searchFlag); - } - searchFlag = setTimeout(function(){ - query(QueryStorage, otxt.value, Record); - div_href(); - }, 250); - }; + var QueryStorage = []; + search_a("https://" + document.domain + "/wp-json/sakura/v1/cache_search/json"); - function search_a(val) { - if(sessionStorage.getItem('search')!=null){ - QueryStorage = JSON.parse(sessionStorage.getItem('search')); - query(QueryStorage, $("#search-input").val(), Record); - div_href(); - }else{ - var _xhr = new XMLHttpRequest(); - _xhr.open("GET", val, true) - _xhr.send(); - _xhr.onreadystatechange = function () { - if (_xhr.readyState == 4 && _xhr.status == 200) { - json = _xhr.responseText; - if (json != "") { - sessionStorage.setItem('search',json); - QueryStorage = JSON.parse(json); - query(QueryStorage, otxt.value, Record); - div_href(); + var otxt = addComment.I("search-input"), + list = addComment.I("PostlistBox"), + Record = list.innerHTML, + searchFlag = null; + otxt.oninput = function () { + if (searchFlag = null) { + clearTimeout(searchFlag); + } + searchFlag = setTimeout(function () { + query(QueryStorage, otxt.value, Record); + div_href(); + }, 250); + }; + + function search_a(val) { + if (sessionStorage.getItem('search') != null) { + QueryStorage = JSON.parse(sessionStorage.getItem('search')); + query(QueryStorage, $("#search-input").val(), Record); + div_href(); + } else { + var _xhr = new XMLHttpRequest(); + _xhr.open("GET", val, true) + _xhr.send(); + _xhr.onreadystatechange = function () { + if (_xhr.readyState == 4 && _xhr.status == 200) { + json = _xhr.responseText; + if (json != "") { + sessionStorage.setItem('search', json); + QueryStorage = JSON.parse(json); + query(QueryStorage, otxt.value, Record); + div_href(); + } } } } } - } - if (!Object.values) Object.values = function (obj) { - if (obj !== Object(obj)) - throw new TypeError('Object.values called on a non-object'); - var val = [], - key; - for (key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - val.push(obj[key]); + if (!Object.values) Object.values = function (obj) { + if (obj !== Object(obj)) + throw new TypeError('Object.values called on a non-object'); + var val = [], + key; + for (key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + val.push(obj[key]); + } } + return val; } - return val; - } - function Cx(arr, q) { - q = q.replace(q,"^(?=.*?"+q+").+$").replace(/\s/g,")(?=.*?"); - i = arr.filter( - v => Object.values(v).some( - v => new RegExp(q + '').test(v) - ) - ); - return i; - } - function div_href(){ - $(".ins-selectable").each(function(){ - $(this).click(function(){ - $("#Ty").attr('href',$(this).attr('href')); - $("#Ty").click(); - $(".search_close").click(); - }); - }); - } - function search_result(keyword, link, fa, title, iconfont, comments, text){ - if(keyword){ - var s = keyword.trim().split(" "), - a = title.indexOf(s[s.length-1]), - b = text.indexOf(s[s.length-1]); - title=a<60 ? title.slice(0,80):title.slice(a-30,a+30); - title=title.replace(s[s.length-1], ' ' + s[s.length-1].toUpperCase() + ' '); - text=b<60 ? text.slice(0,80):text.slice(b-30,b+30); - text=text.replace(s[s.length-1], ' ' + s[s.length-1].toUpperCase() + ' '); - } - return '

' + title + ' ' + comments + '' + '

' + text + '

'; - } - function query(B, A, z) { - var x, v, s, y = "", - w = "", - u = "", - r = "", - p = "", - F = "", - H = "", - G = '
', - D = "
", - E = "", - C = Cx(B, A.trim()); - for (x = 0; x < Object.keys(C).length; x++) { - H = C[x]; - switch (v = H.type) { - case "post": - w = w + search_result(A, H.link, "file", H.title, "mark", H.comments, H.text); - break; - case "tag": - p = p + search_result("", H.link, "tag", H.title, "none", "", ""); - break; - case "category": - r = r + search_result("", H.link, "folder", H.title, "none", "", ""); - break; - case "page": - u = u + search_result(A, H.link, "file", H.title, "mark", H.comments, H.text); - break; - case "comment": - F = F + search_result(A, H.link, "comment", H.title, "none", "", H.text); - break - } - } - w && (y = y + G + "文章" + E + w + D), u && (y = y + G + "页面" + E + u + D), r && (y = y + G + "分类" + E + r + D), p && (y = y + G + "标签" + E + p + D), F && (y = y + G + "评论" + E + F + D), s = addComment.I("PostlistBox"), s.innerHTML = y - } + function Cx(arr, q) { + q = q.replace(q, "^(?=.*?" + q + ").+$").replace(/\s/g, ")(?=.*?"); + i = arr.filter( + v => Object.values(v).some( + v => new RegExp(q + '').test(v) + ) + ); + return i; + } + + function div_href() { + $(".ins-selectable").each(function () { + $(this).click(function () { + $("#Ty").attr('href', $(this).attr('href')); + $("#Ty").click(); + $(".search_close").click(); + }); + }); + } + + function search_result(keyword, link, fa, title, iconfont, comments, text) { + if (keyword) { + var s = keyword.trim().split(" "), + a = title.indexOf(s[s.length - 1]), + b = text.indexOf(s[s.length - 1]); + title = a < 60 ? title.slice(0, 80) : title.slice(a - 30, a + 30); + title = title.replace(s[s.length - 1], ' ' + s[s.length - 1].toUpperCase() + ' '); + text = b < 60 ? text.slice(0, 80) : text.slice(b - 30, b + 30); + text = text.replace(s[s.length - 1], ' ' + s[s.length - 1].toUpperCase() + ' '); + } + return '
' + title + ' ' + comments + '' + '

' + text + '

'; + } + + function query(B, A, z) { + var x, v, s, y = "", + w = "", + u = "", + r = "", + p = "", + F = "", + H = "", + G = '
', + D = "
", + E = "", + C = Cx(B, A.trim()); + for (x = 0; x < Object.keys(C).length; x++) { + H = C[x]; + switch (v = H.type) { + case "post": + w = w + search_result(A, H.link, "file", H.title, "mark", H.comments, H.text); + break; + case "tag": + p = p + search_result("", H.link, "tag", H.title, "none", "", ""); + break; + case "category": + r = r + search_result("", H.link, "folder", H.title, "none", "", ""); + break; + case "page": + u = u + search_result(A, H.link, "file", H.title, "mark", H.comments, H.text); + break; + case "comment": + F = F + search_result(A, H.link, "comment", H.title, "none", "", H.text); + break + } + } + w && (y = y + G + "文章" + E + w + D), u && (y = y + G + "页面" + E + u + D), r && (y = y + G + "分类" + E + r + D), p && (y = y + G + "标签" + E + p + D), F && (y = y + G + "评论" + E + F + D), s = addComment.I("PostlistBox"), s.innerHTML = y + } } }); $('.search_close').on('click', function () { if ($('.js-search').hasClass('is-visible')) { $('.js-toggle-search').toggleClass('is-active'); $('.js-search').toggleClass('is-visible'); - $('html').css('overflow-y','unset'); + $('html').css('overflow-y', 'unset'); } }); $('#show-nav').on('click', function () { @@ -1492,7 +1515,8 @@ var home = location.href, NH: function () { var h1 = 0; $(window).scroll(function () { - var s = $(document).scrollTop(),cached = $('.site-header'); + var s = $(document).scrollTop(), + cached = $('.site-header'); if (s == h1) { cached.removeClass('yya'); } @@ -1505,16 +1529,18 @@ var home = location.href, $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body'); var load_post_timer; var intersectionObserver = new IntersectionObserver(function (entries) { - if (entries[0].intersectionRatio <= 0) return; - var page_next = $('#pagination a').attr("href"); - var load_key = addComment.I("add_post_time"); - if(page_next!=undefined && load_key ){ - var load_time = addComment.I("add_post_time").title; - if(load_time !="233"){ - console.log("%c 自动加载时倒计时 %c","background:#9a9da2; color:#ffffff; border-radius:4px;","","",load_time); - load_post_timer=setTimeout(function(){load_post();},load_time*1000); - } - } + if (entries[0].intersectionRatio <= 0) return; + var page_next = $('#pagination a').attr("href"); + var load_key = addComment.I("add_post_time"); + if (page_next != undefined && load_key) { + var load_time = addComment.I("add_post_time").title; + if (load_time != "233") { + console.log("%c 自动加载时倒计时 %c", "background:#9a9da2; color:#ffffff; border-radius:4px;", "", "", load_time); + load_post_timer = setTimeout(function () { + load_post(); + }, load_time * 1000); + } + } }); intersectionObserver.observe( document.querySelector('.footer-device') @@ -1524,7 +1550,8 @@ var home = location.href, load_post(); return false; }); - function load_post() { + + function load_post() { $('#pagination a').addClass("loading").text(""); $.ajax({ type: "POST", @@ -1539,17 +1566,19 @@ var home = location.href, post_list_show_animation(); if (nextHref != undefined) { $("#pagination a").attr("href", nextHref); - //加载完成上滑 + //加载完成上滑 var tempScrollTop = $(window).scrollTop(); $(window).scrollTop(tempScrollTop); - $body.animate({ scrollTop: tempScrollTop + 300 }, 666) + $body.animate({ + scrollTop: tempScrollTop + 300 + }, 666) } else { $("#pagination").html("很高兴你翻到这里,但是真的没有了..."); } } }); return false; - } + } }, XCS: function () { var __cancel = jQuery('#cancel-comment-reply-link'), @@ -1748,8 +1777,8 @@ $(function () { $(document).pjax('a[target!=_top]', '#page', { fragment: '#page', timeout: 8000, - }).on('pjax:beforeSend', () => { //离开页面停止播放 - $('.normal-cover-video').each(function() { + }).on('pjax:beforeSend', () => { //离开页面停止播放 + $('.normal-cover-video').each(function () { this.pause(); this.src = ''; this.load = ''; @@ -1784,7 +1813,7 @@ $(function () { if ($('.js-search.is-visible').length > 0) { $('.js-toggle-search').toggleClass('is-active'); $('.js-search').toggleClass('is-visible'); - $('html').css('overflow-y','unset'); + $('html').css('overflow-y', 'unset'); } }); window.addEventListener('popstate', function (e) { @@ -1838,4 +1867,4 @@ if ((isWebkit || isOpera || isIe) && document.getElementById && window.addEventL element.focus(); } }, false); -} +} \ No newline at end of file diff --git a/options.php b/options.php index e8f7f30..5563ca0 100644 --- a/options.php +++ b/options.php @@ -1004,6 +1004,44 @@ function optionsframework_options() { 'type_3' => __('23 333 Views (french)', 'sakura'),/*23 333 次访问(法式)*/ 'type_4' => __('23k Views (chinese)', 'sakura'),/*23k 次访问(中式)*/ )); + + $options[] = array( + 'name' => __('Comment image upload API', 'sakura'),/*评论图片上传接口*/ + 'id' => 'img_upload_api', + 'std' => "imgur", + 'type' => "radio", + 'options' => array( + 'imgur' => __('Imgur (https://imgur.com)', 'sakura'), + 'smms' => __('SM.MS (https://sm.ms)', 'sakura') + )); + + $options[] = array( + 'name' => __('Imgur Client ID', 'sakura'), + 'desc' => __('Register your application here, note we only need the Client ID here.', 'sakura'), + 'id' => 'imgur_client_id', + 'std' => '', + 'type' => 'text'); + + $options[] = array( + 'name' => __('SM.MS Secret Token', 'sakura'), + 'desc' => __('Register your application here.', 'sakura'), + 'id' => 'smms_client_id', + 'std' => '', + 'type' => 'text'); + + $options[] = array( + 'name' => __('Comment images proxy', 'sakura'), + 'desc' => __('A front-ed proxy for the uploaded images. Leave it blank if you do not need.', 'sakura'), + 'id' => 'cmt_image_proxy', + 'std' => 'https://images.weserv.nl/?url=', + 'type' => 'text'); + + $options[] = array( + 'name' => __('Imgur upload proxy', 'sakura'), + 'desc' => __('A back-ed proxy to upload images. You may set a self hosted proxy with Nginx, following my turtal. This feature is mainly for Chinese who cannot access to Imgur due to the GFW. The default and official setting is 【https://api.imgur.com/3/image/】', 'sakura'), + 'id' => 'imgur_upload_image_proxy', + 'std' => 'https://api.imgur.com/3/image/', + 'type' => 'text'); $options[] = array( 'name' => __('Enable live search', 'sakura'),/*启用实时搜索*/