diff options
author | José Iván <jivanvlop@gmail.com> | 2016-09-05 22:28:59 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-03 23:00:21 -0500 |
commit | b1b51b774bffd64b9117296d46052b8bbc44f430 (patch) | |
tree | b9329ef12e5c26d9172b5f9a022547d1bc7ee040 /app/assets/javascripts/gfm_auto_complete.js.es6 | |
parent | 3a8a7c1251cef4098ffbc54718ba21736c5e2800 (diff) | |
download | gitlab-ce-b1b51b774bffd64b9117296d46052b8bbc44f430.tar.gz |
Cleaned up global namespace JS
Moved most of the functions that contained "window.doSomething" that were located at:
- app/assets/javascripts/application.js
To the following file:
- app/assets/javascripts/lib/utils/common_utils.js
The functions listed here:
- window.ajaxGet
- window.split
- window.extractLast
- window.rstrip
- window.disableButtonIfEmptyField
- window.disableButtonIfAnyEmptyField
- window.sanitize
- window.unbindEvents
- window.shiftWindow
Now will be accessible from the "gl.utils" namespace
Diffstat (limited to 'app/assets/javascripts/gfm_auto_complete.js.es6')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js.es6 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js.es6 b/app/assets/javascripts/gfm_auto_complete.js.es6 index 31df51ac03a..824413bf20f 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.es6 +++ b/app/assets/javascripts/gfm_auto_complete.js.es6 @@ -126,8 +126,8 @@ } return { username: m.username, - title: sanitize(title), - search: sanitize(m.username + " " + m.name) + title: gl.utils.sanitize(title), + search: gl.utils.sanitize(m.username + " " + m.name) }; }); } @@ -159,7 +159,7 @@ } return { id: i.iid, - title: sanitize(i.title), + title: gl.utils.sanitize(i.title), search: i.iid + " " + i.title }; }); @@ -189,7 +189,7 @@ } return { id: m.iid, - title: sanitize(m.title), + title: gl.utils.sanitize(m.title), search: "" + m.title }; }); @@ -222,7 +222,7 @@ } return { id: m.iid, - title: sanitize(m.title), + title: gl.utils.sanitize(m.title), search: m.iid + " " + m.title }; }); @@ -240,9 +240,9 @@ var sanitizeLabelTitle; sanitizeLabelTitle = function(title) { if (/[\w\?&]+\s+[\w\?&]+/g.test(title)) { - return "\"" + (sanitize(title)) + "\""; + return "\"" + (gl.utils.sanitize(title)) + "\""; } else { - return sanitize(title); + return gl.utils.sanitize(title); } }; return $.map(merges, function(m) { |