Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagging #333

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions Gemfile
Expand Up @@ -33,7 +33,6 @@ gem "hominid"
gem "tanker", :git => "git://github.com/kidpollo/tanker.git"
gem "unicorn"
gem "surveyor", "~> 1.1.0"

gem "rspec-rails", :groups => [ :development, :test ]
gem "impressionist", "~> 1.2.0"

Expand All @@ -48,7 +47,7 @@ group :development do
gem "pry-rails"
gem "launchy"
gem "letters"
gem "debugger"
gem "debugger", ">= 1.2.2"
end

group :production do
Expand Down
39 changes: 21 additions & 18 deletions Gemfile.lock
Expand Up @@ -65,7 +65,7 @@ GEM
capybara-mechanize (0.3.0)
capybara (~> 1.1)
mechanize (~> 2.3)
childprocess (0.3.8)
childprocess (0.3.9)
ffi (~> 1.0, >= 1.0.11)
choice (0.1.6)
coderay (1.0.9)
Expand All @@ -75,18 +75,18 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.5.0)
coffee-script-source (1.6.1)
colorize (0.5.8)
columnize (0.3.6)
crack (0.3.2)
database_cleaner (0.9.1)
debugger (1.3.1)
debugger (1.4.0)
columnize (>= 0.3.1)
debugger-linecache (~> 1.1.1)
debugger-ruby_core_source (~> 1.1.8)
debugger-ruby_core_source (~> 1.2.0)
debugger-linecache (1.1.2)
debugger-ruby_core_source (>= 1.1.1)
debugger-ruby_core_source (1.1.8)
debugger-ruby_core_source (1.2.0)
devise (2.1.2)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
Expand Down Expand Up @@ -134,18 +134,21 @@ GEM
highline (1.6.15)
hike (1.2.1)
hominid (3.0.5)
httpauth (0.1)
i18n (0.6.1)
i18n_routing (0.6.1)
httpauth (0.2.0)
httpclient (2.3.3)
i18n (0.6.4)
i18n_routing (0.6.2)
i18n (> 0.3.5)
impressionist (1.2.0)
httpclient (~> 2.2)
nokogiri (~> 1.5)
journey (1.0.4)
jquery-rails (2.1.2)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.7.5)
json_pure (1.7.5)
jwt (0.1.5)
jquery-rails (2.2.1)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.7.7)
json_pure (1.7.7)
jwt (0.1.6)
multi_json (>= 1.0)
kgio (2.8.0)
launchy (2.2.0)
Expand Down Expand Up @@ -274,7 +277,7 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
selenium-webdriver (2.30.0)
selenium-webdriver (2.31.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
Expand Down Expand Up @@ -327,7 +330,7 @@ GEM
polyglot (>= 0.3.1)
turn (0.8.3)
ansi
tzinfo (0.3.35)
tzinfo (0.3.36)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
Expand All @@ -341,7 +344,7 @@ GEM
uuidtools (2.1.3)
warden (1.2.1)
rack (>= 1.0)
webmock (1.9.3)
webmock (1.11.0)
addressable (>= 2.2.7)
crack (>= 0.3.2)
webrobots (0.1.0)
Expand All @@ -360,7 +363,7 @@ DEPENDENCIES
capybara-mechanize
coffee-rails (~> 3.2.2)
database_cleaner
debugger
debugger (>= 1.2.2)
devise (= 2.1.2)
differ
email_spec
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ui-bg_flat_0_aaaaaa_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ui-bg_flat_75_ffffff_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/ui-bg_glass_55_fbf9ee_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/vote_against.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/vote_against_small.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/vote_for.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/vote_for_small.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion app/assets/javascripts/application.js
Expand Up @@ -6,6 +6,8 @@
//
//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require jquery.tokeninput
//= require jquery.carousel
//= require jquery.cookie
//= require raphael-min
Expand All @@ -15,4 +17,5 @@
//= require bootstrap-popover
//= require bootstrap-tour
//= require app-tour
//= require ideas
//= require ideas

52 changes: 52 additions & 0 deletions app/assets/javascripts/ideas.js
@@ -0,0 +1,52 @@
var tags = []
var suggested_tag = []

$(document).ready(function($) {

var idea_title = $('input#idea_title');
var idea_summary = $('textarea#idea_summary');
var idea_body = $('textarea#idea_body');
var idea_id = $('input#idea_id');

$('input#idea_tag_list').tokenInput("/tags.json",
{ theme: "facebook",
prePopulate: $('input#idea_tag_list').data('load'),
onAdd: function (item) {
tags.push(item.name);
send_data(idea_title.val(), idea_summary.val(), idea_body.val(), idea_id.val());
},
onDelete: function (item) {
tags.splice(tags.indexOf(item.name), 1 );
send_data(idea_title.val(), idea_summary.val(), idea_body.val(), idea_id.val());
}
});

$('.response').hide();

idea_title.focus();

idea_title.keyup(function() {
send_data(idea_title.val(), idea_summary.val(), idea_body.val(), idea_id.val());
});

idea_summary.keyup(function() {
send_data(idea_title.val(), idea_summary.val(), idea_body.val(), idea_id.val());
});

idea_body.keyup(function() {
send_data(idea_title.val(), idea_summary.val(), idea_body.val(), idea_id.val());
});
})

function send_data(title_text, summary_text, body_text, idea_id) {
$.ajax({
type:'POST',
beforeSend: function(xhr) {
xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))
},
url: '../ideas/lda?title_text=' + title_text + '&summary_text=' + summary_text + '&body_text=' + body_text + '&tags=' + tags + '&idea_id=' + idea_id ,
success:function(data){
//
}
});
}
6 changes: 6 additions & 0 deletions app/assets/javascripts/jquery-ui.js

Large diffs are not rendered by default.