Commit graph

17 commits

Author SHA1 Message Date
José Iván
b1b51b774b 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
2016-11-03 23:00:21 -05:00
Fatih Acet
dd5e46ab69 Merge branch 'eslint' into 'master'
Add ESLint

## What does this MR do?

- create `package.json`
- add ESLint dependencies to `package.json`
- add JavaScript linting to CI
- add Rake task `lint:javascript`as alias for `eslint` (which itself is an alias for `npm run eslint`)

## Are there points in the code the reviewer needs to double check?

Probably not.

## Why was this MR needed?

My hovercraft was full of eels.

## What are the relevant issue numbers?

- https://gitlab.com/gitlab-org/gitlab-ce/issues/13224#note_12537431
- https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5006#note_13255658


See merge request !5445
2016-10-26 16:31:08 +00:00
Jack Davison
728f1f71a5 Refactored less readable existance checks
CoffeeScript generated JavaScript contains some unreadable
expressions. This refactoring addresses complex uses of
the exestential operator that produced unreadable Javascript.
2016-10-26 14:22:53 +01:00
winniehell
02f94cf038 disable ESLint for all JavaScript files 2016-10-26 10:02:58 +02:00
Mike Greiling
f8520f5d09 remove manual Cookie.set "path" option in favor of global setting 2016-10-24 18:09:00 -05:00
Mike Greiling
67d2b2acb3 replace jquery.cookie vendor script with js.cookie 2016-10-24 18:09:00 -05:00
Luke Bennett
454bb145f0 Added @zeivs changes to fix awards search, including CHANGELOG where he is credited 2016-09-27 00:16:39 +03:00
Jared Deckard
7f6474b269 Restore comments lost when converting CoffeeScript to JavaScript 2016-09-08 12:23:12 -05:00
Clement Ho
0986fe23bc Replace animateEmoji timeout with eventListener 2016-09-06 09:39:43 -05:00
Mike Greiling
33694a5a64 use gitlab global root url as canonical base url for all javascript set cookies (closes #20435) 2016-08-24 22:11:28 -05:00
Jack Davison
d548f3ee27 Replace resetTooltip with bootstrap's fixTitle
* resetTooltip totally destroyed and regenerated the
  tooltip while fixTitle simply replaces the text in
  the existing element.

* resetTooltip also called an asyncronous function
  with no suitable callback resulting in a messy
  setTimout workaround. fixTitle is syncronous.
2016-08-17 21:25:40 +01:00
Jack Davison
9250953af7 Fix duplicate "me" in award emoji tooltip
* Works by explicitly deleting out-of-date data attributes

* No longer directly assigns to data-original-title
2016-08-17 21:25:39 +01:00
Jack Davison
6c1ed00afc Award tooltips refer to current user as "You" 2016-08-17 21:25:39 +01:00
Jack Davison
1fc17a8a43 Switch to using to_sentence to construct tooltips
* Code in ruby now uses Array#to_sentence to construct award tooltips

* Coffeescript uses a combination of regexes for the same result
2016-08-17 21:25:39 +01:00
Jack Davison
bcdc369491 Truncated user list in award emoji tooltips
* Only the first 10 names are displayed

* Further users are indicated by "and X more."

* String "and X more" is appended to the array THEN join is called

* An oxford comma seperates the last name from "and X more"

* In coffeescript "me" is now always prepended

* Tests included
2016-08-17 13:33:50 +01:00
Clement Ho
e3292f1ede Fix awardable button mutuality loading spinners 2016-08-10 16:29:11 -05:00
Fatih Acet
aaa9509d12 ES6ify all the things! 2016-07-24 23:45:11 +03:00