diff --git a/app/assets/images/buttons/bday@2x-white.png b/app/assets/images/buttons/bday@2x-white.png
new file mode 100644
index 000000000..ab5940c25
Binary files /dev/null and b/app/assets/images/buttons/bday@2x-white.png differ
diff --git a/app/assets/images/buttons/service-icons/fb@2x-white.png b/app/assets/images/buttons/service-icons/fb@2x-white.png
new file mode 100644
index 000000000..2fb0b930c
Binary files /dev/null and b/app/assets/images/buttons/service-icons/fb@2x-white.png differ
diff --git a/app/assets/images/buttons/service-icons/tumblr@2x-white.png b/app/assets/images/buttons/service-icons/tumblr@2x-white.png
new file mode 100644
index 000000000..48ce0dc3c
Binary files /dev/null and b/app/assets/images/buttons/service-icons/tumblr@2x-white.png differ
diff --git a/app/assets/images/buttons/service-icons/twitter@2x-white.png b/app/assets/images/buttons/service-icons/twitter@2x-white.png
new file mode 100644
index 000000000..7b6aec6a0
Binary files /dev/null and b/app/assets/images/buttons/service-icons/twitter@2x-white.png differ
diff --git a/app/assets/javascripts/app/forms/picture_form.js b/app/assets/javascripts/app/forms/picture_form.js
index 92640363b..21f3ba64c 100644
--- a/app/assets/javascripts/app/forms/picture_form.js
+++ b/app/assets/javascripts/app/forms/picture_form.js
@@ -1,11 +1,35 @@
-app.forms.Picture = app.views.Base.extend({
- templateName : "picture-form",
-
+app.forms.PictureBase = app.views.Base.extend({
events : {
'ajax:complete .new_photo' : "photoUploaded",
"change input[name='photo[user_file]']" : "submitForm"
},
+ onSubmit : $.noop,
+ uploadSuccess : $.noop,
+
+ postRenderTemplate : function(){
+ this.$("input[name=authenticity_token]").val($("meta[name=csrf-token]").attr("content"))
+ },
+
+ submitForm : function (){
+ this.$("form").submit();
+ this.onSubmit();
+ },
+
+ photoUploaded : function(evt, xhr) {
+ resp = JSON.parse(xhr.responseText)
+ if(resp.success) {
+ this.uploadSuccess(resp)
+ } else {
+ alert("Upload failed! Please try again. " + resp.error);
+ }
+ }
+});
+
+/* multi photo uploader */
+app.forms.Picture = app.forms.PictureBase.extend({
+ templateName : "picture-form",
+
initialize : function() {
this.photos = new Backbone.Collection()
this.photos.bind("add", this.render, this)
@@ -17,18 +41,12 @@ app.forms.Picture = app.views.Base.extend({
this.renderPhotos();
},
- submitForm : function (){
- this.$("form").submit();
+ onSubmit : function (){
this.$(".photos").append($(''))
},
- photoUploaded : function(evt, xhr) {
- resp = JSON.parse(xhr.responseText)
- if(resp.success) {
- this.photos.add(new Backbone.Model(resp.data))
- } else {
- alert("Upload failed! Please try again. " + resp.error);
- }
+ uploadSuccess : function(resp) {
+ this.photos.add(new Backbone.Model(resp.data))
},
renderPhotos : function(){
@@ -38,4 +56,13 @@ app.forms.Picture = app.views.Base.extend({
photoContainer.append(photoView)
})
}
+});
+
+/* wallpaper uploader */
+app.forms.Wallpaper = app.forms.PictureBase.extend({
+ templateName : "wallpaper-form",
+
+ uploadSuccess : function(resp) {
+ $("#profile").css("background-image", "url(" + resp.data.wallpaper + ")")
+ }
});
\ No newline at end of file
diff --git a/app/assets/javascripts/app/pages/profile.js b/app/assets/javascripts/app/pages/profile.js
index 1915d7dc2..ae3b97f4c 100644
--- a/app/assets/javascripts/app/pages/profile.js
+++ b/app/assets/javascripts/app/pages/profile.js
@@ -2,13 +2,15 @@
//= require ../views/profile_info_view
app.pages.Profile = app.views.Base.extend({
- className : "container",
+
+ id : "profile",
templateName : "profile",
subviews : {
"#profile-info" : "profileInfo",
- "#canvas" : "canvasView"
+ "#canvas" : "canvasView",
+ "#wallpaper-upload" : "wallpaperForm"
},
events : {
@@ -37,7 +39,7 @@ app.pages.Profile = app.views.Base.extend({
this.model = new app.models.Profile.findByGuid(options.personId)
this.stream = options && options.stream || new app.models.Stream()
- this.model.bind("change", this.setPageTitle, this)
+ this.model.bind("change", this.setPageTitleAndBackground, this)
/* binds for getting started pulsation */
this.stream.bind("fetched", this.pulsateNewPostControl, this)
@@ -46,6 +48,7 @@ app.pages.Profile = app.views.Base.extend({
this.stream.preloadOrFetch();
this.canvasView = new app.views.Canvas({ model : this.stream })
+ this.wallpaperForm = new app.forms.Wallpaper()
// send in isOwnProfile data
this.profileInfo = new app.views.ProfileInfo({ model : this.model.set({isOwnProfile : this.isOwnProfile()}) })
@@ -59,9 +62,11 @@ app.pages.Profile = app.views.Base.extend({
]("pulse")
},
- setPageTitle : function() {
- if(this.model.get("name"))
+ setPageTitleAndBackground : function() {
+ if(this.model.get("name")) {
document.title = this.model.get("name")
+ this.$el.css("background-image", "url(" + this.model.get("wallpaper") + ")")
+ }
},
toggleEdit : function(evt) {
diff --git a/app/assets/javascripts/app/views/canvas_view.js b/app/assets/javascripts/app/views/canvas_view.js
index a3e2f8ef5..709abdeff 100644
--- a/app/assets/javascripts/app/views/canvas_view.js
+++ b/app/assets/javascripts/app/views/canvas_view.js
@@ -29,6 +29,7 @@ app.views.Canvas = app.views.Base.extend(_.extend({}, app.views.infiniteScrollMi
itemSelector : '.canvas-frame',
visibleStyle : {scale : 1},
hiddenStyle : {scale : 0.001},
+ containerStyle : {position : "relative"},
masonry : {
columnWidth : 292.5
}
diff --git a/app/assets/stylesheets/new_styles/_base.scss b/app/assets/stylesheets/new_styles/_base.scss
index db268f266..719aaea8b 100644
--- a/app/assets/stylesheets/new_styles/_base.scss
+++ b/app/assets/stylesheets/new_styles/_base.scss
@@ -1,3 +1,7 @@
+body {
+ background-image : image_url("pattern.png");
+}
+
/* new link color */
a { color : rgb(42,156,235) }
@@ -437,19 +441,6 @@ div[data-template=flow] {
right : 10px;
top : 10px;
-
- .label {
- padding : 2px 5px;
- padding-bottom : 3px;
-
- span {
- display : inline-block;
- position : relative;
- top : 1px;
- font-family : Roboto-Bold;
- }
- }
-
& > a {
@include transition(opacity);
@include opacity(0.4);
@@ -461,4 +452,17 @@ div[data-template=flow] {
text-decoration : none;
}
}
-}
\ No newline at end of file
+}
+
+/* bootstrap label fixes for Roboto */
+.label {
+ padding : 2px 5px;
+ padding-bottom : 3px;
+
+ span {
+ display : inline-block;
+ position : relative;
+ top : 1px;
+ font-family : Roboto-Bold;
+ }
+}
diff --git a/app/assets/stylesheets/new_styles/_canvas.scss b/app/assets/stylesheets/new_styles/_canvas.scss
index fc8455bec..ab80a4e6d 100644
--- a/app/assets/stylesheets/new_styles/_canvas.scss
+++ b/app/assets/stylesheets/new_styles/_canvas.scss
@@ -1,18 +1,13 @@
-
@mixin wide() {
width : $two-column-width + px;
min-width : $two-column-width + px;
max-width : $two-column-width + px;
}
-body {
- background-color : #F6F6F6;
- background-image : image_url('pattern.png')
-}
-
.canvas-frame {
float : left;
margin : 10px;
+ margin-bottom : 18px;
/* expand / contract cursor declarations */
&.x2 .content {
@@ -28,12 +23,12 @@ body {
.content {
@include transition(box-shadow);
- @include box-shadow(0,1px,3px,rgba(0,0,0,0.2));
+ @include box-shadow(0, 8px, 50px, rgba(0,0,0,0.9));
background-image : image_url("paper-texture-1.jpg");
&:hover {
- @include box-shadow(0,1px,5px,rgba(0,0,0,0.5));
+ @include box-shadow(0, 3px, 10px,rgba(0,0,0,0.9));
.info {
top : 0;
@@ -59,11 +54,9 @@ body {
max-width : $column-width + px;
overflow : hidden;
- //padding : 20px;
/* used in masking photos with overflow: hidden; */
.image-container {
-
overflow : hidden;
width : 100%;
@@ -128,6 +121,8 @@ body {
background-color : rgba(255,255,255,0.8);
border-bottom : 1px solid #fff;
+ color : #000;
+
position : absolute;
top : -32px;
right : 0;
diff --git a/app/assets/stylesheets/new_styles/_composer.scss b/app/assets/stylesheets/new_styles/_composer.scss
index 7b8e8114a..89e5af3d3 100644
--- a/app/assets/stylesheets/new_styles/_composer.scss
+++ b/app/assets/stylesheets/new_styles/_composer.scss
@@ -11,9 +11,7 @@
#photo_upload_button {
position: relative;
- margin : {
- bottom : 9px;
- }
+ margin-bottom : 9px;
input{
@include opacity(0);
@@ -21,6 +19,7 @@
top: 0;
left: 0;
height:100%;
+ cursor : pointer;
}
}
diff --git a/app/assets/stylesheets/new_styles/_profile.scss b/app/assets/stylesheets/new_styles/_profile.scss
index de74b9a73..0f769d14c 100644
--- a/app/assets/stylesheets/new_styles/_profile.scss
+++ b/app/assets/stylesheets/new_styles/_profile.scss
@@ -1,3 +1,25 @@
+#profile {
+ color : #fff;
+ background : {
+ color : #333;
+
+ /* The background-image property will be user-generated and set in `app.pages.Profile` (app/assets/javascripts/app/pages/profile.js)
+ and should ONLY be set once the image is fully loaded.
+
+ Optimal imagemagick manipulation settings for uploaded image (via trial & error):
+
+ `convert -brightness-contrast -40x-50`
+
+ NOTE: I noticed that just turning the brightness down had an adverse affect on contrast,
+ thus the "washing out" at -50 contrast. For more info on this specific command, read the documentation
+ on it here: http://www.imagemagick.org/script/command-line-options.php#brightness-contrast */
+ //image : url('/imagetest.jpg');
+
+ size : cover;
+ attachment : fixed;
+ }
+}
+
/* getting started pulse animation */
#composer-button.pulse {
-webkit-animation: opacity-pulse 1s infinite;
diff --git a/app/assets/templates/profile-info.jst.hbs b/app/assets/templates/profile-info.jst.hbs
index 5b3aa27b4..305bdba72 100644
--- a/app/assets/templates/profile-info.jst.hbs
+++ b/app/assets/templates/profile-info.jst.hbs
@@ -8,7 +8,7 @@
{{#if location}}
-
+
{{location}}
@@ -17,7 +17,7 @@
{{#if birthday}}
-
+
{{birthday}}
•
@@ -25,20 +25,20 @@
-
+
-
+
-
+
{{#if isOwnProfile}}
•
-
+
{{/if}}
diff --git a/app/assets/templates/profile.jst.hbs b/app/assets/templates/profile.jst.hbs
index ebc58f3bb..03711e064 100644
--- a/app/assets/templates/profile.jst.hbs
+++ b/app/assets/templates/profile.jst.hbs
@@ -1,60 +1,66 @@
-