From 509fa9175a17213d3bde815c39aef6b67285653e Mon Sep 17 00:00:00 2001 From: Mashiro Date: Sat, 26 May 2018 22:12:38 +0800 Subject: [PATCH] fix motion --- functions.php | 27 ++++++--------------------- js/sakura-app.js | 2 +- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/functions.php b/functions.php index 4025c62..b0e7104 100644 --- a/functions.php +++ b/functions.php @@ -177,7 +177,7 @@ function sakura_scripts() { wp_enqueue_style( 'saukra_css', get_stylesheet_uri(), array(), SAKURA_VERSION ); // If you do not like the CDN, uncomment this line, and comment the next line //wp_enqueue_script( 'app', get_template_directory_uri() . '/js/sakura-app.js', array(), SAKURA_VERSION, true ); - wp_enqueue_script( 'app', 'https://cdn.jsdelivr.net/gh/moezx/cdn@3.3.0/js/other/sakura-app.js', array(), SAKURA_VERSION, true ); + wp_enqueue_script( 'app', 'https://cdn.jsdelivr.net/gh/moezx/cdn@3.3.1/js/other/sakura-app.js', array(), SAKURA_VERSION, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } @@ -885,8 +885,8 @@ function comment_mail_notify($comment_id){ '; $message = convert_smilies($message); - $message = str_replace("f(x)=∫(",'emoji',$message); + $message = str_replace("{{",'emoji',$message); $message = str_replace('{UPLOAD}', 'https://i.loli.net/', $message); $message = str_replace('[/img][img]', '[/img^img]', $message); @@ -1097,22 +1097,7 @@ function push_bili_smilies(){ height: ' .$img_height. 'px; ">'; // 正文转换 - // Type 1: ' f(x)=∫(xxx)sec²xdx ' - $bilismiliestrans[' f(x)=∫(' . $name[$i] . ')sec²xdx '] = ''; - // Type 2: 'f(x)=∫(xxx)sec²xdx' - $bilismiliestrans['f(x)=∫(' . $name[$i] . ')sec²xdx'] = ''; - // Type 3: '{xxx}' - $bilismiliestrans['{' . $name[$i] . '}'] = 'emoji',$content); + $content = str_replace("{{",'emoji',$content); $content = str_replace('[img]', '', $content); return $content; diff --git a/js/sakura-app.js b/js/sakura-app.js index 2a49aac..7896c2a 100644 --- a/js/sakura-app.js +++ b/js/sakura-app.js @@ -79,7 +79,7 @@ $(ele+'-bar').addClass("on-hover");$(ele+'-container').css("display","block");} $('.comt-addsmilies').click(function(){$('.comt-smilies').toggle();}) $('.comt-smilies a').click(function(){$(this).parent().hide();}) function smileBoxToggle(){$(document).ready(function(){$("#emotion-toggle").click(function(){$(".emotion-toggle-off").toggle(0);$(".emotion-toggle-on").toggle(0);$(".emotion-box").toggle(160);});});} -smileBoxToggle();function grin(tag,type,before,after){var myField;if(type=="custom"){tag=before+tag+after;}else if(type=="Img"){tag='[img]'+tag+'[/img]';}else if(type=="Math"){tag=' f(x)=∫('+tag+')sec²xdx ';}else{tag=' :'+tag+': ';} +smileBoxToggle();function grin(tag,type,before,after){var myField;if(type=="custom"){tag=before+tag+after;}else if(type=="Img"){tag='[img]'+tag+'[/img]';}else if(type=="Math"){tag=' {{'+tag+'}} ';}else{tag=' :'+tag+': ';} if(document.getElementById('comment')&&document.getElementById('comment').type=='textarea'){myField=document.getElementById('comment');}else{return false;} if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=tag;myField.focus();}else if(myField.selectionStart||myField.selectionStart=='0'){var startPos=myField.selectionStart;var endPos=myField.selectionEnd;var cursorPos=endPos;myField.value=myField.value.substring(0,startPos)+tag+myField.value.substring(endPos,myField.value.length);cursorPos+=tag.length;myField.focus();myField.selectionStart=cursorPos;myField.selectionEnd=cursorPos;}else{myField.value+=tag;myField.focus();}} if($("div").hasClass("popcontainer")){loadBotui();}