From 497fe5a48c23b0856b381a6bd4bb13f90007e293 Mon Sep 17 00:00:00 2001 From: zhaoke Date: Fri, 30 Jun 2023 18:38:43 +0800 Subject: [PATCH] * Adjust css style of showsynccommit view. --- module/repo/css/common.ui.css | 10 +++++++++- module/repo/js/ajaxgeteditorcontent.ui.js | 1 + module/repo/js/diff.ui.js | 2 +- module/repo/js/showsynccommit.ui.js | 5 ++++- module/repo/ui/showsynccommit.html.php | 23 ++++++++++++++++++----- 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/module/repo/css/common.ui.css b/module/repo/css/common.ui.css index 53d74d8906..910a88ea3f 100644 --- a/module/repo/css/common.ui.css +++ b/module/repo/css/common.ui.css @@ -16,4 +16,12 @@ #monacoTree .tree-item-content span {cursor: pointer;} .directory {background-image:url('theme/default/images/repo/dir.png');} .file {background-image:url('theme/default/images/repo/txt.png');} -.mini-icon {display: inline-block; height: 16px; width: 16px; background-color: transparent; background-position: 0 0; background-repeat: no-repeat; vertical-align: text-bottom; margin-right: 5px;} \ No newline at end of file +.mini-icon {display: inline-block; height: 16px; width: 16px; background-color: transparent; background-position: 0 0; background-repeat: no-repeat; vertical-align: text-bottom; margin-right: 5px;} +#monacoTree .tree-item-content {cursor: pointer;} +.sync-content {margin: 10px} +.sync-main-content {padding: 20px;background-color: #fff;border-radius: 4px;} +.sync-line {border-top: 1px solid #e4e4e4; margin: 10px 0;} +.sync-main-content div {width: 100%;} +.sync-main-content h3 {font-size: 16px; font-weight: 700;} +.sync-main-content p {color: #313c52;} +.sync-main-content .alert > [class*="icon-"] {font-size: 42px;opacity: 0.8;} diff --git a/module/repo/js/ajaxgeteditorcontent.ui.js b/module/repo/js/ajaxgeteditorcontent.ui.js index 042fd56b7f..8a54b3bdc6 100644 --- a/module/repo/js/ajaxgeteditorcontent.ui.js +++ b/module/repo/js/ajaxgeteditorcontent.ui.js @@ -21,6 +21,7 @@ function showBlameAndRelation(line) if(pageType == 'diff') line = diffContent.line.new[line -1]; var blame = blames[line]; + if(!blame) return; var p_line = parseInt(line); diff --git a/module/repo/js/diff.ui.js b/module/repo/js/diff.ui.js index 6d7d9a0e08..07f14ed1c4 100644 --- a/module/repo/js/diff.ui.js +++ b/module/repo/js/diff.ui.js @@ -1,7 +1,7 @@ var iframeHeight = 0; var sidebarHeight = 0; var tabTemp; -var diffAppose = $.cookie.get('renderSideBySide');; +var diffAppose = $.cookie.get('renderSideBySide'); /* Close tab. */ $('#monacoTabs').on('click', '.monaco-close', function() diff --git a/module/repo/js/showsynccommit.ui.js b/module/repo/js/showsynccommit.ui.js index 9f80bcf18b..d635883664 100644 --- a/module/repo/js/showsynccommit.ui.js +++ b/module/repo/js/showsynccommit.ui.js @@ -4,9 +4,12 @@ function syncComments() { if(data == 'finish') return openUrl(browseLink); - $('#commits').html(parseInt($('#commits').html()) + parseInt(data)); + var count = parseInt(data); + if(isNaN(count)) count = 0; + $('#commits').html(parseInt($('#commits').html()) + count); setTimeout(syncComments, 100); }); } + setTimeout(syncComments, 500); \ No newline at end of file diff --git a/module/repo/ui/showsynccommit.html.php b/module/repo/ui/showsynccommit.html.php index 0930a74866..a928eaa759 100644 --- a/module/repo/ui/showsynccommit.html.php +++ b/module/repo/ui/showsynccommit.html.php @@ -26,11 +26,24 @@ else jsVar('link', $link); jsVar('browseLink', $browseLink); jsVar('syncComplete', $lang->repo->notice->syncComplete); - -div( - set::class('content'), - h3($lang->repo->notice->syncing), - p($lang->repo->notice->syncedCount, span($version, set::id('commits'))) +div +( + setClass('sync-main-content'), + div + ( + set::class('sync-content'), + div + ( + setClass('alert light-pale flex items-center'), + icon(setClass('icon icon-info-sign icon-2x alert-icon'), 'check-sign'), + div + ( + h3($lang->repo->notice->syncing), + div(setClass('sync-line')), + p($lang->repo->notice->syncedCount, span($version, set::id('commits'))) + ) + ) + ) ); render();