diff options
author | Unknwon <u@gogs.io> | 2016-08-12 02:29:29 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-14 23:52:24 -0700 |
commit | 15845cb28763c1542556ad61d2aa9735541dbf45 (patch) | |
tree | 94b2053202fcf5270e0697fc37c38203310571ed /public | |
parent | d0a0239bacf02eb004634dfe1bb0a3f7dfe5adb6 (diff) | |
download | gitea-15845cb28763c1542556ad61d2aa9735541dbf45.tar.gz gitea-15845cb28763c1542556ad61d2aa9735541dbf45.zip |
Code clean up for new config options
Diffstat (limited to 'public')
-rw-r--r-- | public/js/gogs.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index 81425503ba..03bd304f0e 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -29,7 +29,7 @@ function initCommentPreviewTab($form) { } var previewTab; -var previewTabApis; +var previewFileModes; function initEditPreviewTab($form) { var $tab_menu = $form.find('.tabular.menu'); @@ -37,7 +37,7 @@ function initEditPreviewTab($form) { previewTab = $tab_menu.find('.item[data-tab="' + $tab_menu.data('preview') + '"]'); if (previewTab.length) { - previewTabApis = previewTab.data('preview-apis').split(','); + previewFileModes = previewTab.data('preview-file-modes').split(','); previewTab.click(function () { var $this = $(this); $.post($this.data('url'), { @@ -662,7 +662,7 @@ var editArea; var editFilename; var smdEditor; var cmEditor; -var mdFileExtensions; +var markdownFileExts; var lineWrapExtensions; // For IE @@ -740,7 +740,7 @@ function initEditor() { if (!editArea.length) return; - mdFileExtensions = editArea.data("md-file-extensions").split(","); + markdownFileExts = editArea.data("markdown-file-exts").split(","); lineWrapExtensions = editArea.data("line-wrap-extensions").split(","); editFilename.on("keyup", function (e) { @@ -762,7 +762,7 @@ function initEditor() { apiCall = extension } - if (previewLink.length && apiCall && previewTabApis && previewTabApis.length && previewTabApis.indexOf(apiCall) >= 0) { + if (previewLink.length && apiCall && previewFileModes && previewFileModes.length && previewFileModes.indexOf(apiCall) >= 0) { dataUrl = previewLink.data('url'); previewLink.data('url', dataUrl.replace(/(.*)\/.*/i, '$1/' + mode)); previewLink.show(); @@ -772,7 +772,7 @@ function initEditor() { } // If this file is a Markdown extensions, we will load that editor and return - if (mdFileExtensions.indexOf(extWithDot) >= 0) { + if (markdownFileExts.indexOf(extWithDot) >= 0) { if (setSimpleMDE()) { return; } |