File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1882
1882
if ( ! GM_getValue ( 'switchpbsearch' ) ) return ;
1883
1883
if ( document . querySelector ( '#id-dropdown' ) == null ) {
1884
1884
// 做个搜索框
1885
- let div = document . createElement ( 'div' ) ;
1885
+ const div = document . createElement ( 'div' ) ;
1886
1886
div . setAttribute ( 'class' , 'layui-inline' ) ;
1887
1887
// 适配黑色主题
1888
1888
div . classList . add ( 'leetcodeRating-search' ) ;
1889
1889
div . innerHTML += `<input name="" placeholder="请输入题号或关键字" class="lcr layui-input" id="id-dropdown">` ;
1890
- let center = document . querySelector ( '.flex.justify-between' ) ;
1891
- center = center ?. childNodes [ 0 ] ?. childNodes [ 0 ] ?. childNodes [ 0 ] ;
1892
- if ( center == null ) return ;
1893
- if ( center . childNodes . length > 0 ) center . insertBefore ( div , center . childNodes [ 1 ] ) ;
1894
- else center . appendChild ( div ) ;
1890
+ const logo = document . querySelector ( 'nav > div > ul' ) ;
1891
+ if ( logo == null ) return ;
1892
+ logo . insertAdjacentElement ( 'afterend' , div ) ;
1893
+ // else navbar.appendChild(div);
1895
1894
layui . use ( function ( ) {
1896
1895
let dropdown = layui . dropdown ;
1897
1896
let $ = layui . $ ;
2753
2752
score +
2754
2753
', 当前等级为: ' +
2755
2754
Math . trunc ( level ) . toString ( )
2756
- ) ;
2755
+ )
2757
2756
} else if ( resp && resp . status_msg && ! resp . status_msg . includes ( 'Accepted' ) ) {
2758
2757
showMessage (
2759
2758
'很遗憾,主人提交失败,不过也不要气馁呀,加油! <br/> 当前分数为: ' +
You can’t perform that action at this time.
0 commit comments