diff --git a/.gitignore b/.gitignore index dafc5e44d..d57f5a338 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ *~ .bundle db/*.sqlite3 -log/*.log +log/* tmp/**/* Gemfile.lock gpg/diaspora-development/*.gpg diff --git a/app/models/comment.rb b/app/models/comment.rb index b4f2fb2d9..bd72721ee 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -57,6 +57,11 @@ class Comment verify_signature(post_creator_signature, post.person) end + def signature_valid? + Rails.logger.warn "Received comment has person #{person.inspect}" + Rails.logger.warn "Received comment has person key #{person.serialized_key}" if person + verify_signature(creator_signature, person) && verify_signature(post_creator_signator, post.person) + end protected def sign_if_my_post diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index 47d2f68a9..2be320629 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -1,3 +1,9 @@ +- content_for :head do + :javascript + $(document).ready(function(){ + $("#add_album_button").fancybox(); + }); + .back= link_to "⇧ home", root_path %h1.big_text Albums diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index f67fb5d33..18e042ad9 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -1,8 +1,5 @@ - content_for :head do - :javascript - $(document).ready(function(){ - reset_photo_fancybox(); - }); + = javascript_include_tag 'photos', 'jquery.html5_upload' .album_id{:id => @album.id, :style => "display:hidden;"} .back= link_to '⇧ albums', albums_path diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index a0b69f271..d6e227b5f 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -8,18 +8,17 @@ = link_to "⇧ #{@group.name}", @group = "Editing Groups" - +%ul - for group in @groups %li.group = group.name %ul + stuff -for person in group.people %li.person = person.real_name - - #content_bottom .back = link_to "⇧ #{@group.name}", @group diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 328ab1650..cd3579319 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -23,8 +23,6 @@ = csrf_meta_tag = yield(:head) - = javascript_include_tag 'jquery.html5_upload' - %body - flash.each do |name, msg| = content_tag :div, msg, :id => "flash_#{name}" diff --git a/public/javascripts/group-edit.js b/public/javascripts/group-edit.js index 500691266..e92cadb75 100644 --- a/public/javascripts/group-edit.js +++ b/public/javascripts/group-edit.js @@ -1,12 +1,12 @@ $(function() { $("li .person").draggable({ - helper: 'clone', - cursor: 'move' - }); - $("li .group").droppable({ + revert: true + }); + $(".group ul").droppable({ + drop: function(event, ui) { - //alert('dropped!'); - $("
").text(ui.draggable.text()).appendTo(this); + $(this).closest("ul").append(ui.draggable) + //$("").text(ui.draggable.text()).appendTo(this).draggable(); } }); diff --git a/public/javascripts/jquery-ui-1.8.4.custom.min.js b/public/javascripts/jquery-ui-1.8.4.custom.min.js index e1dc0a4d5..3e451ea4b 100644 --- a/public/javascripts/jquery-ui-1.8.4.custom.min.js +++ b/public/javascripts/jquery-ui-1.8.4.custom.min.js @@ -159,4 +159,64 @@ this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h a.unselecting=false}if(!a.selecting){a.$element.addClass("ui-selecting");a.selecting=true;f._trigger("selecting",c,{selecting:a.element})}}else{if(a.selecting)if(c.metaKey&&a.startselected){a.$element.removeClass("ui-selecting");a.selecting=false;a.$element.addClass("ui-selected");a.selected=true}else{a.$element.removeClass("ui-selecting");a.selecting=false;if(a.startselected){a.$element.addClass("ui-unselecting");a.unselecting=true}f._trigger("unselecting",c,{unselecting:a.element})}if(a.selected)if(!c.metaKey&& !a.startselected){a.$element.removeClass("ui-selected");a.selected=false;a.$element.addClass("ui-unselecting");a.unselecting=true;f._trigger("unselecting",c,{unselecting:a.element})}}}});return false}},_mouseStop:function(c){var f=this;this.dragged=false;e(".ui-unselecting",this.element[0]).each(function(){var d=e.data(this,"selectable-item");d.$element.removeClass("ui-unselecting");d.unselecting=false;d.startselected=false;f._trigger("unselected",c,{unselected:d.element})});e(".ui-selecting",this.element[0]).each(function(){var d= e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected");d.selecting=false;d.selected=true;d.startselected=true;f._trigger("selected",c,{selected:d.element})});this._trigger("stop",c);this.helper.remove();return false}});e.extend(e.ui.selectable,{version:"1.8.4"})})(jQuery); +;/* + * jQuery UI Sortable 1.8.4 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, +arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= +c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, +{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); +if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", +a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); +if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY