From 452551fa23893961ac83dd20b0babef917f42453 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 24 Feb 2017 12:22:22 -0500 Subject: [PATCH] webhook: highlight delivery response on click This decreases page load time for webhook edit page. --- public/config.codekit | 12 ++++++------ public/js/gogs.js | 9 +++++++++ templates/repo/settings/webhook_history.tmpl | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/public/config.codekit b/public/config.codekit index 6b9256937..73c00eb39 100644 --- a/public/config.codekit +++ b/public/config.codekit @@ -20,11 +20,11 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 }, - "\/css\/semantic-2.2.7.min.css": { + "\/css\/semantic-2.2.9.min.css": { "fileType": 16, "ignore": 1, "ignoreWasSetByUser": 1, - "inputAbbreviatedPath": "\/css\/semantic-2.2.7.min.css", + "inputAbbreviatedPath": "\/css\/semantic-2.2.9.min.css", "outputAbbreviatedPath": "No Output Path", "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0 @@ -66,7 +66,7 @@ "fileType": 32768, "ignore": 0, "ignoreWasSetByUser": 0, - "initialSize": 4048, + "initialSize": 514087, "inputAbbreviatedPath": "\/img\/avatar_default.png", "outputAbbreviatedPath": "\/img\/avatar_default.png", "outputPathIsOutsideProject": 0, @@ -161,12 +161,12 @@ "outputStyle": 1, "syntaxCheckerStyle": 1 }, - "\/js\/semantic-2.2.7.min.js": { + "\/js\/semantic-2.2.9.min.js": { "fileType": 64, "ignore": 1, "ignoreWasSetByUser": 1, - "inputAbbreviatedPath": "\/js\/semantic-2.2.7.min.js", - "outputAbbreviatedPath": "\/js\/min\/semantic-2.2.7.min-min.js", + "inputAbbreviatedPath": "\/js\/semantic-2.2.9.min.js", + "outputAbbreviatedPath": "\/js\/min\/semantic-2.2.9.min-min.js", "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0, "outputStyle": 1, diff --git a/public/js/gogs.js b/public/js/gogs.js index 0bf65c13e..a06fcecb9 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -930,6 +930,15 @@ function initWebhook() { } }); + // Highlight payload on first click + $('.hook.history.list .toggle.button').click(function () { + $($(this).data('target') + ' .nohighlight').each(function () { + var $this = $(this); + $this.removeClass('nohighlight'); + setTimeout(function(){ hljs.highlightBlock($this[0]) }, 500); + }) + }) + // Test delivery $('#test-delivery').click(function () { var $this = $(this); diff --git a/templates/repo/settings/webhook_history.tmpl b/templates/repo/settings/webhook_history.tmpl index 26bbef3fb..b41fefafd 100644 --- a/templates/repo/settings/webhook_history.tmpl +++ b/templates/repo/settings/webhook_history.tmpl @@ -60,7 +60,7 @@
{{ range $key, $val := .ResponseInfo.Headers }}{{$key}}: {{$val}}
 {{end}}
{{$.i18n.Tr "repo.settings.webhook.body"}}
-
{{.ResponseInfo.Body}}
+
{{.ResponseInfo.Body}}
{{else}} N/A {{end}}