Commit c697d960 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce

parents c30079f3 3ae31c22
...@@ -158,7 +158,7 @@ gem "slack-notifier", "~> 1.0.0" ...@@ -158,7 +158,7 @@ gem "slack-notifier", "~> 1.0.0"
gem 'asana', '~> 0.0.6' gem 'asana', '~> 0.0.6'
# d3 # d3
gem "d3_rails", "~> 3.1.4" gem 'd3_rails', '~> 3.5.5'
#cal-heatmap #cal-heatmap
gem "cal-heatmap-rails", "~> 0.0.1" gem "cal-heatmap-rails", "~> 0.0.1"
...@@ -188,7 +188,7 @@ gem 'turbolinks' ...@@ -188,7 +188,7 @@ gem 'turbolinks'
gem 'jquery-turbolinks' gem 'jquery-turbolinks'
gem 'select2-rails' gem 'select2-rails'
gem 'jquery-atwho-rails', "~> 0.3.3" gem 'jquery-atwho-rails', '~> 1.0.0'
gem "jquery-rails" gem "jquery-rails"
gem "jquery-ui-rails" gem "jquery-ui-rails"
gem "jquery-scrollto-rails" gem "jquery-scrollto-rails"
......
...@@ -116,7 +116,7 @@ GEM ...@@ -116,7 +116,7 @@ GEM
crack (0.4.1) crack (0.4.1)
safe_yaml (~> 0.9.0) safe_yaml (~> 0.9.0)
creole (0.3.8) creole (0.3.8)
d3_rails (3.1.10) d3_rails (3.5.5)
railties (>= 3.1.0) railties (>= 3.1.0)
daemons (1.1.9) daemons (1.1.9)
database_cleaner (1.3.0) database_cleaner (1.3.0)
...@@ -298,7 +298,7 @@ GEM ...@@ -298,7 +298,7 @@ GEM
phantomjs (>= 1.9) phantomjs (>= 1.9)
railties (>= 3.2.0) railties (>= 3.2.0)
sprockets-rails sprockets-rails
jquery-atwho-rails (0.3.3) jquery-atwho-rails (1.0.1)
jquery-rails (3.1.0) jquery-rails (3.1.0)
railties (>= 3.0, < 5.0) railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
...@@ -683,7 +683,7 @@ DEPENDENCIES ...@@ -683,7 +683,7 @@ DEPENDENCIES
colored colored
coveralls coveralls
creole (~> 0.3.6) creole (~> 0.3.6)
d3_rails (~> 3.1.4) d3_rails (~> 3.5.5)
database_cleaner database_cleaner
default_value_for (~> 3.0.0) default_value_for (~> 3.0.0)
devise (= 3.2.4) devise (= 3.2.4)
...@@ -720,7 +720,7 @@ DEPENDENCIES ...@@ -720,7 +720,7 @@ DEPENDENCIES
httparty httparty
jasmine (~> 2.2.0) jasmine (~> 2.2.0)
jasmine-rails jasmine-rails
jquery-atwho-rails (~> 0.3.3) jquery-atwho-rails (~> 1.0.0)
jquery-rails jquery-rails
jquery-scrollto-rails jquery-scrollto-rails
jquery-turbolinks jquery-turbolinks
......
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
window.GitLab ?= {} window.GitLab ?= {}
GitLab.GfmAutoComplete = GitLab.GfmAutoComplete =
# private_token: ''
dataSource: '' dataSource: ''
# Emoji # Emoji
Emoji: Emoji:
template: '<li data-value="${insert}">${name} <img alt="${name}" height="20" src="${image}" width="20" /></li>' template: '<li>${name} <img alt="${name}" height="20" src="${path}" width="20" /></li>'
# Team Members # Team Members
Members: Members:
template: '<li data-value="${username}">${username} <small>${name}</small></li>' template: '<li>${username} <small>${name}</small></li>'
# Issues and MergeRequests # Issues and MergeRequests
Issues: Issues:
template: '<li data-value="${id}"><small>${id}</small> ${title} </li>' template: '<li><small>${id}</small> ${title}</li>'
# Add GFM auto-completion to all input fields, that accept GFM input. # Add GFM auto-completion to all input fields, that accept GFM input.
setup: -> setup: ->
...@@ -23,45 +23,46 @@ GitLab.GfmAutoComplete = ...@@ -23,45 +23,46 @@ GitLab.GfmAutoComplete =
# Emoji # Emoji
input.atwho input.atwho
at: ':' at: ':'
tpl: @Emoji.template displayTpl: @Emoji.template
callbacks: insertTpl: ':${name}:'
before_save: (emojis) =>
$.map emojis, (em) => name: em.name, insert: em.name+ ':', image: em.path
# Team Members # Team Members
input.atwho input.atwho
at: '@' at: '@'
tpl: @Members.template displayTpl: @Members.template
search_key: 'search' insertTpl: '${atwho-at}${username}'
searchKey: 'search'
callbacks: callbacks:
before_save: (members) => beforeSave: (members) ->
$.map members, (m) => name: m.name, username: m.username, search: "#{m.username} #{m.name}" $.map members, (m) -> name: m.name, username: m.username, search: "#{m.username} #{m.name}"
input.atwho input.atwho
at: '#' at: '#'
alias: 'issues' alias: 'issues'
search_key: 'search' searchKey: 'search'
tpl: @Issues.template displayTpl: @Issues.template
insertTpl: '${atwho-at}${id}'
callbacks: callbacks:
before_save: (issues) -> beforeSave: (issues) ->
$.map issues, (i) -> id: i.iid, title: sanitize(i.title), search: "#{i.iid} #{i.title}" $.map issues, (i) -> id: i.iid, title: sanitize(i.title), search: "#{i.iid} #{i.title}"
input.atwho input.atwho
at: '!' at: '!'
alias: 'mergerequests' alias: 'mergerequests'
search_key: 'search' searchKey: 'search'
tpl: @Issues.template displayTpl: @Issues.template
insertTpl: '${atwho-at}${id}'
callbacks: callbacks:
before_save: (merges) -> beforeSave: (merges) ->
$.map merges, (m) -> id: m.iid, title: sanitize(m.title), search: "#{m.iid} #{m.title}" $.map merges, (m) -> id: m.iid, title: sanitize(m.title), search: "#{m.iid} #{m.title}"
input.one "focus", => input.one 'focus', =>
$.getJSON(@dataSource).done (data) -> $.getJSON(@dataSource).done (data) ->
# load members # load members
input.atwho 'load', "@", data.members input.atwho 'load', '@', data.members
# load issues # load issues
input.atwho 'load', "issues", data.issues input.atwho 'load', 'issues', data.issues
# load merge requests # load merge requests
input.atwho 'load', "mergerequests", data.mergerequests input.atwho 'load', 'mergerequests', data.mergerequests
# load emojis # load emojis
input.atwho 'load', ":", data.emojis input.atwho 'load', ':', data.emojis
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment