diff --git a/Gemfile b/Gemfile index c7a59a82d1a9eb7bb6ac7754ce3eef58d51f01d0..460a0f93a96405fa7853e2ba07181f0ff748b892 100644 --- a/Gemfile +++ b/Gemfile @@ -158,7 +158,7 @@ gem "slack-notifier", "~> 1.0.0" gem 'asana', '~> 0.0.6' # d3 -gem "d3_rails", "~> 3.1.4" +gem 'd3_rails', '~> 3.5.5' #cal-heatmap gem "cal-heatmap-rails", "~> 0.0.1" @@ -188,7 +188,7 @@ gem 'turbolinks' gem 'jquery-turbolinks' gem 'select2-rails' -gem 'jquery-atwho-rails', "~> 0.3.3" +gem 'jquery-atwho-rails', '~> 1.0.0' gem "jquery-rails" gem "jquery-ui-rails" gem "jquery-scrollto-rails" diff --git a/Gemfile.lock b/Gemfile.lock index d905ac927fc68e0900f86812edbb32fe9b6a9439..f0f8601a760ee59f7bab84af5765968dc732413e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,7 +116,7 @@ GEM crack (0.4.1) safe_yaml (~> 0.9.0) creole (0.3.8) - d3_rails (3.1.10) + d3_rails (3.5.5) railties (>= 3.1.0) daemons (1.1.9) database_cleaner (1.3.0) @@ -298,7 +298,7 @@ GEM phantomjs (>= 1.9) railties (>= 3.2.0) sprockets-rails - jquery-atwho-rails (0.3.3) + jquery-atwho-rails (1.0.1) jquery-rails (3.1.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) @@ -683,7 +683,7 @@ DEPENDENCIES colored coveralls creole (~> 0.3.6) - d3_rails (~> 3.1.4) + d3_rails (~> 3.5.5) database_cleaner default_value_for (~> 3.0.0) devise (= 3.2.4) @@ -720,7 +720,7 @@ DEPENDENCIES httparty jasmine (~> 2.2.0) jasmine-rails - jquery-atwho-rails (~> 0.3.3) + jquery-atwho-rails (~> 1.0.0) jquery-rails jquery-scrollto-rails jquery-turbolinks diff --git a/app/assets/javascripts/gfm_auto_complete.js.coffee b/app/assets/javascripts/gfm_auto_complete.js.coffee index 00d56ae5b4b0de2d24c87d34e4b072c9a3ab56c8..4eb3f3c03f310a9a50276709ae0b639154b37791 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.coffee +++ b/app/assets/javascripts/gfm_auto_complete.js.coffee @@ -2,19 +2,19 @@ window.GitLab ?= {} GitLab.GfmAutoComplete = - # private_token: '' dataSource: '' + # 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 Members: - template: '<li data-value="${username}">${username} <small>${name}</small></li>' + template: '<li>${username} <small>${name}</small></li>' # Issues and MergeRequests 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. setup: -> @@ -23,45 +23,46 @@ GitLab.GfmAutoComplete = # Emoji input.atwho at: ':' - tpl: @Emoji.template - callbacks: - before_save: (emojis) => - $.map emojis, (em) => name: em.name, insert: em.name+ ':', image: em.path + displayTpl: @Emoji.template + insertTpl: ':${name}:' # Team Members input.atwho at: '@' - tpl: @Members.template - search_key: 'search' + displayTpl: @Members.template + insertTpl: '${atwho-at}${username}' + searchKey: 'search' callbacks: - before_save: (members) => - $.map members, (m) => name: m.name, username: m.username, search: "#{m.username} #{m.name}" + beforeSave: (members) -> + $.map members, (m) -> name: m.name, username: m.username, search: "#{m.username} #{m.name}" input.atwho at: '#' alias: 'issues' - search_key: 'search' - tpl: @Issues.template + searchKey: 'search' + displayTpl: @Issues.template + insertTpl: '${atwho-at}${id}' callbacks: - before_save: (issues) -> + beforeSave: (issues) -> $.map issues, (i) -> id: i.iid, title: sanitize(i.title), search: "#{i.iid} #{i.title}" input.atwho at: '!' alias: 'mergerequests' - search_key: 'search' - tpl: @Issues.template + searchKey: 'search' + displayTpl: @Issues.template + insertTpl: '${atwho-at}${id}' callbacks: - before_save: (merges) -> + beforeSave: (merges) -> $.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) -> # load members - input.atwho 'load', "@", data.members + input.atwho 'load', '@', data.members # load issues - input.atwho 'load', "issues", data.issues + input.atwho 'load', 'issues', data.issues # load merge requests - input.atwho 'load', "mergerequests", data.mergerequests + input.atwho 'load', 'mergerequests', data.mergerequests # load emojis - input.atwho 'load', ":", data.emojis + input.atwho 'load', ':', data.emojis