summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-05 13:08:01 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-05 13:08:01 -0400
commitc1eb4d894a092aed1b87ddf5f80ee824fd56789d (patch)
treeb58beee7c762cbbb1cec524c16471788820609b6 /public
parent5f653898f3b39669ce9dbf0ee2263c391695019d (diff)
downloadgitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.tar.gz
gitea-c1eb4d894a092aed1b87ddf5f80ee824fd56789d.zip
Clean api code
Diffstat (limited to 'public')
-rw-r--r--public/js/app.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/public/js/app.js b/public/js/app.js
index 59fffd36d0..59d4461350 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -62,6 +62,12 @@ var Gogits = {
var method = $(this).data('ajax-method') || 'get';
var ajaxName = $(this).data('ajax-name');
var data = {};
+
+ if (ajaxName.endsWith("preview")) {
+ data["mode"] = "gfm";
+ data["context"] = $(this).data('ajax-context');
+ }
+
$('[data-ajax-rel=' + ajaxName + ']').each(function () {
var field = $(this).data("ajax-field");
var t = $(this).data("ajax-val");
@@ -547,10 +553,8 @@ function initIssue() {
(function () {
$('[data-ajax-name=issue-preview]').on("click", function () {
var $this = $(this);
- $this.toggleAjax(function (json) {
- if (json.ok) {
- $($this.data("preview")).html(json.content);
- }
+ $this.toggleAjax(function (resp) {
+ $($this.data("preview")).html(resp);
})
});
$('.issue-write a[data-toggle]').on("click", function () {