Ver código fonte

webhook: highlight delivery response on click

This decreases page load time for webhook edit page.
Unknwon 8 anos atrás
pai
commit
452551fa23

+ 6 - 6
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,

+ 9 - 0
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);

+ 1 - 1
templates/repo/settings/webhook_history.tmpl

@@ -60,7 +60,7 @@
 								<pre class="raw">{{ range $key, $val := .ResponseInfo.Headers }}<strong>{{$key}}:</strong> {{$val}}
 {{end}}</pre>
 								<h5>{{$.i18n.Tr "repo.settings.webhook.body"}}</h5>
-								<pre class="raw"><code>{{.ResponseInfo.Body}}</code></pre>
+								<pre class="raw"><code class="nohighlight">{{.ResponseInfo.Body}}</code></pre>
 							{{else}}
 								N/A
 							{{end}}