diff --git a/app/controllers/bookmarks_controller.rb b/app/controllers/bookmarks_controller.rb index 51f9fb6bb4a76565a055c7b8bc3cd830c6e52b2b..5d62eace7581d5338e68324f985384e0242c58bd 100644 --- a/app/controllers/bookmarks_controller.rb +++ b/app/controllers/bookmarks_controller.rb @@ -2,6 +2,7 @@ class BookmarksController < ApplicationController before_filter :authenticate_user! def index + @bookmark = Bookmark.new @bookmarks = Bookmark.sort(:created_at.desc).all end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index c8d14858fce40898a4a0cb083fabaa70bed092f1..834b333954062afd31521af3942daaf4b067347e 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -9,7 +9,7 @@ class DashboardController < ApplicationController def receive - store_posts_from_xml (params[:xml]) + store_posts_from_xml CGI::unescape(params[:xml]) render :nothing => true end diff --git a/app/views/bookmarks/_form.html.haml b/app/views/bookmarks/_form.html.haml deleted file mode 100644 index 0e02f4082f5c187b0e37996e5c4fab8ec16bbe10..0000000000000000000000000000000000000000 --- a/app/views/bookmarks/_form.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -= form_for @bookmark do |f| - = f.error_messages - %p - = f.label :title - %br - = f.text_field :title - %p - = f.label :link - %br - = f.text_field :link - %p - = f.submit diff --git a/app/views/bookmarks/_new_bookmark.haml b/app/views/bookmarks/_new_bookmark.haml new file mode 100644 index 0000000000000000000000000000000000000000..bea9ba7cced8be778ee250fcd024445788f69723 --- /dev/null +++ b/app/views/bookmarks/_new_bookmark.haml @@ -0,0 +1,6 @@ += form_for @bookmark, :remote => true do |f| + = f.error_messages + = f.text_field :title, :value => "Title" + = f.text_field :link, :value => "URL" + %p + = f.submit diff --git a/app/views/bookmarks/index.html.haml b/app/views/bookmarks/index.html.haml index f518a2635a9d9ae6ba3d63b355ebcd569b63aac1..48bfedc50c0db043dace334e5f61a1f2058e2a66 100644 --- a/app/views/bookmarks/index.html.haml +++ b/app/views/bookmarks/index.html.haml @@ -1,5 +1,5 @@ -%h1= link_to "new bookmark", new_bookmark_path - +%h1.big_text bookmarks += render "bookmarks/new_bookmark", :bookmark => @bookmark %ul#stream - for bookmark in @bookmarks = render "bookmark", :post => bookmark diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0eb53e9ce99b690ae0cb3da833f2605fc15aef56..8377906d274e3fe8d67c2d23d97a777514911e8e 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -71,8 +71,6 @@ %ul.nav %a{ :href => root_path, :title => "Your network stream."} %li home - %a{ :href => users_path, :title => "Registered users on your seed."} - %li users %a{ :href => status_messages_path, :title => "Recent status messages."} %li status messages %a{ :href => bookmarks_path, :title => "Recently shared links."} @@ -88,4 +86,4 @@ = yield = render "posts/debug" #friends_list - = render 'friends/sidebar' \ No newline at end of file + = render 'friends/sidebar' if user_signed_in? diff --git a/lib/common.rb b/lib/common.rb index 14afff2f31f92646bd6438546b0ecdbce6d1715b..0d13203610ca4f1c78abc015f0ba66a89673007b 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -8,7 +8,7 @@ module Diaspora def notify_friends if self.person_id == User.first.id xml = Post.build_xml_for(self) - @@queue.add_post_request( friends_with_permissions, xml ) + @@queue.add_post_request( friends_with_permissions, CGI::escape(xml) ) @@queue.process end end diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 53fdc03a04e9b1b1a951ea738264b39b55d6cb6a..3593fa4c6080c78142a455c548db7b5f1b6d0269 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -25,10 +25,16 @@ $(document).ready(function(){ $(this).fadeTo(80, 1); }); - $('#status_message_message').click(function() { - $(this).val("") - }); + $('#status_message_message').click(clearForm); + + $('#bookmark_title').click(clearForm); + $('#bookmark_link').click(clearForm); + + function clearForm(){ + $(this).val(""); + } + $('#debug_info').click(function() { $('#debug_more').toggle('fast', function() { @@ -39,4 +45,4 @@ $(document).ready(function(){ $('#flash_notice, #flash_error, #flash_alert').delay(1500).slideUp(130); -});//end document ready \ No newline at end of file +});//end document ready diff --git a/spec/models/bookmark_spec.rb b/spec/models/bookmark_spec.rb index 32f326591c6f09d41e27f26225b6eb0bd2acf530..879408430dd88f7a995d046cf56cd2850a0fdf07 100644 --- a/spec/models/bookmark_spec.rb +++ b/spec/models/bookmark_spec.rb @@ -34,6 +34,9 @@ describe Bookmark do bookmark.link = "http://www.google.com" bookmark.valid?.should == true + + #bookmark.link = "http://babycakes.sofaer.net:3000" + #bookmark.valid?.should == true #invalid links bookmark.link = "zsdvzxdg"