Merge branch 'master' of github.com:discourse/discourse

This commit is contained in:
Sam
2015-07-23 07:48:55 +10:00
53 changed files with 614 additions and 242 deletions

View File

@@ -1,3 +1,5 @@
export default Ember.Component.extend({
tagName: 'tr'
tagName: 'tr',
reverseColors: Ember.computed.match('report.type', /^(time_to_first_response|topics_with_no_response)$/),
classNameBindings: ['reverseColors']
});

View File

@@ -99,6 +99,7 @@ var translations = {
':|' : 'expressionless',
':-|' : 'expressionless',
':/' : 'confused',
'8-)' : 'sunglasses',
";P" : 'stuck_out_tongue_winking_eye',
";-P" : 'stuck_out_tongue_winking_eye',
":$" : 'blush',

View File

@@ -38,7 +38,7 @@
<div class="modal-footer">
<button class="btn btn-primary" {{action "upload" target="view"}}>
<span class='add-upload'><i {{bind-attr class=":fa view.uploadIcon"}}></i><i class='fa fa-plus'></i></span>
<span class='add-upload'><i {{bind-attr class=":fa view.uploadIcon"}}></i></span>
{{i18n 'upload'}}
</button>
<a {{action "closeModal"}}>{{i18n 'cancel'}}</a>

View File

@@ -1,6 +1,5 @@
{{#if controller.link}}
<h3>{{view.title}}</h3>
<span class="copy-text {{if copied "success"}}">{{i18n 'share.copied'}}</span>
{{#if date}}
<span class="date">{{displayDate}}</span>
@@ -19,4 +18,3 @@
<a href {{action "close"}} aria-label='{{i18n 'share.close'}}' title='{{i18n 'share.close'}}'>{{fa-icon "times-circle"}}</a>
</div>
{{/if}}
<span class="hidden" id="copy-target"></span>

View File

@@ -216,17 +216,17 @@
<div class="control-group category">
<label class="control-label">{{i18n 'user.categories_settings'}}</label>
<div class="controls category-controls">
<label>{{i18n 'user.watched_categories'}}</label>
<label><span class="icon fa fa-exclamation-circle watching"></span> {{i18n 'user.watched_categories'}}</label>
{{category-group categories=model.watchedCategories blacklist=selectedCategories}}
</div>
<div class="instructions">{{i18n 'user.watched_categories_instructions'}}</div>
<div class="controls category-controls">
<label>{{i18n 'user.tracked_categories'}}</label>
<label><span class="icon fa fa-circle tracking"></span> {{i18n 'user.tracked_categories'}}</label>
{{category-group categories=model.trackedCategories blacklist=selectedCategories}}
</div>
<div class="instructions">{{i18n 'user.tracked_categories_instructions'}}</div>
<div class="controls category-controls">
<label>{{i18n 'user.muted_categories'}}</label>
<label><span class="icon fa fa-times-circle muted"></span> {{i18n 'user.muted_categories'}}</label>
{{category-group categories=model.mutedCategories blacklist=selectedCategories}}
</div>
<div class="instructions">{{i18n 'user.muted_categories_instructions'}}</div>
@@ -235,7 +235,7 @@
<div class="control-group muting">
<label class="control-label">{{i18n 'user.users'}}</label>
<div class="controls category-controls">
<label>{{i18n 'user.muted_users'}}</label>
<label><span class="icon fa fa-times-circle muted"></span> {{i18n 'user.muted_users'}}</label>
{{user-selector excludeCurrentUser=true usernames=model.muted_usernames class="user-selector"}}
</div>
<div class="instructions">{{i18n 'user.muted_users_instructions'}}</div>

View File

@@ -1,4 +1,3 @@
import copyText from 'discourse/lib/copy-text';
export default Discourse.View.extend({
templateName: 'share',
@@ -36,6 +35,9 @@ export default Discourse.View.extend({
var $linkForTouch = $('#share-link .share-for-touch a');
$linkForTouch.attr('href',self.get('controller.link'));
$linkForTouch.html(self.get('controller.link'));
var range = window.document.createRange();
range.selectNode($linkForTouch[0]);
window.getSelection().addRange(range);
}
});
}
@@ -63,7 +65,6 @@ export default Discourse.View.extend({
var $currentTarget = $(e.currentTarget),
$currentTargetOffset = $currentTarget.offset(),
$shareLink = $('#share-link'),
copyElement = document.getElementById('copy-target'),
url = $currentTarget.data('share-url'),
postNumber = $currentTarget.data('post-number'),
date = $currentTarget.children().data('time');
@@ -94,18 +95,10 @@ export default Discourse.View.extend({
$shareLink.css({left: "" + x + "px"});
}
self.set('controller.copied', false);
const copySuccess = copyText(url, copyElement);
self.set('controller.link', url);
self.set('controller.postNumber', postNumber);
self.set('controller.date', date);
Ember.run.later(null, function() {
self.set('controller.copied', copySuccess);
}, 50);
return false;
});

View File

@@ -773,6 +773,9 @@ table.api-keys {
i.fa {
color: $primary;
}
i.fa-heart {
color: $love;
}
}
th {
@@ -816,6 +819,15 @@ table.api-keys {
}
}
}
tr.reverse-colors {
td.value.trending-down i.down {
color: $success;
}
td.value.trending-up i.up {
color: $danger;
}
}
}
&.detected-problems {

View File

@@ -193,6 +193,7 @@
// Notifications
&#notifications-dropdown {
.fa { color: scale-color($primary, $lightness: 50%); }
.fa-heart { color: $love; }
.icon { color: scale-color($primary, $lightness: 30%); }
li {
background-color: dark-light-diff($tertiary, $secondary, 85%, -65%);

View File

@@ -1,15 +1,3 @@
.add-upload .fa-plus {
font-size: 0.714em;
position: relative;
left: -5px;
bottom: -5px;
text-shadow:
-1px -1px 0 scale-color($tertiary, $lightness: -10%),
1px 1px 0 scale-color($tertiary, $lightness: -10%),
1px -1px 0 scale-color($tertiary, $lightness: -10%),
-1px 1px 0 scale-color($tertiary, $lightness: -10%);
}
.uploaded-image-preview {
background-position: center center;
background-size: cover;

View File

@@ -15,6 +15,12 @@
}
}
.user-main {
i.fa-heart {
color: $love !important;
}
}
.user-field {
.required {
text-align: top;
@@ -65,7 +71,6 @@
}
}
}
.avatar-selector {

View File

@@ -6,12 +6,20 @@ body {
background-color: $secondary;
}
// This sets the space between the application content and the edge of the
// screen. This value is required in 'mobile/header.scss' to set the position
// of the drop-down menu.
$mobile-wrapper-padding: 10px;
.wrap {
padding: 0 $mobile-wrapper-padding;
}
body {
.boxed {
height: 100%;
.contents {
padding: 10px;
padding: 10px 0;
}
&.white {
background-color: $secondary;

View File

@@ -43,6 +43,7 @@
.d-dropdown {
width: 290px;
margin-top: -1px;
right: -$mobile-wrapper-padding; // Line-up with edge of screen, not edge of padding
// Common

View File

@@ -9,7 +9,7 @@
.category-breadcrumb.hidden {
display: none;
}
margin: 5px;
margin: 5px 0;
.nav {
float: left;
margin-right: 15px;
@@ -71,7 +71,7 @@
th,
td {
padding: 7px 5px;
padding: 7px 0;
color: scale-color($primary, $lightness: 50%);
}
@@ -223,7 +223,7 @@ tr.category-topic-link {
.topic-list-bottom {
margin: 20px 12px 0 12px;
margin: 20px 0 0 0;
}

View File

@@ -167,7 +167,7 @@ a.star {
.topic-map {
margin: 10px;
margin: 10px 0;
background: dark-light-diff($primary, $secondary, 97%, -45%);
border: 1px solid dark-light-diff($primary, $secondary, 90%, -65%);
border-top: none; // would cause double top border
@@ -300,8 +300,9 @@ a.star {
}
#topic-footer-buttons {
@include clearfix;
border-top: 1px solid dark-light-diff($primary, $secondary, 90%, -60%);
padding: 20px 10px 0 10px;
padding: 20px 0 0 0;
.fa-bookmark.bookmarked { color: $tertiary; }
}
@@ -313,7 +314,7 @@ a.star {
#suggested-topics {
clear: left;
padding: 20px 10px 15px 10px;
padding: 20px 0 15px 0;
th.views, td.views, td.activity, th.activity, th.likes, td.likes {
display: none;
}
@@ -344,7 +345,7 @@ span.post-count {
#topic-title {
z-index: 1000;
margin: 0 0 0 0 !important;
padding: 15px 10px 15px 10px;
padding: 15px 0;
}
.topic-post {

View File

@@ -14,8 +14,8 @@
.edits {margin-right: 5px;}
#topic-title {
margin-bottom: 20px;
margin: 0 60px 10px 20px;
//margin-bottom: 20px;
margin: 0 60px 10px 0;
h1 {
font-size: 1.5em;
line-height: 1.25em;

View File

@@ -99,6 +99,7 @@ class OptimizedImage < ActiveRecord::Base
def self.resize_instructions(from, to, dimensions, opts={})
# NOTE: ORDER is important!
%W{
convert
#{from}[0]
-gravity center
-background transparent
@@ -113,17 +114,18 @@ class OptimizedImage < ActiveRecord::Base
def self.resize_instructions_animated(from, to, dimensions, opts={})
%W{
gifsicle
#{from}
-coalesce
-gravity center
-thumbnail #{dimensions}^
-extent #{dimensions}
#{to}
--colors=256
--resize-fit #{dimensions}
--optimize=3
--output #{to}
}
end
def self.downsize_instructions(from, to, dimensions, opts={})
%W{
convert
#{from}[0]
-gravity center
-background transparent
@@ -133,14 +135,7 @@ class OptimizedImage < ActiveRecord::Base
end
def self.downsize_instructions_animated(from, to, dimensions, opts={})
%W{
#{from}
-coalesce
-gravity center
-background transparent
-resize #{dimensions}#{!!opts[:force_aspect_ratio] ? "\\!" : "\\>"}
#{to}
}
resize_instructions_animated(from, to, dimensions, opts)
end
def self.resize(from, to, width, height, opts={})
@@ -164,7 +159,7 @@ class OptimizedImage < ActiveRecord::Base
end
def self.convert_with(instructions, to)
`convert #{instructions.join(" ")} &> /dev/null`
`#{instructions.join(" ")} &> /dev/null`
return false if $?.exitstatus != 0
ImageOptim.new.optimize_image!(to)

View File

@@ -65,8 +65,8 @@ class Upload < ActiveRecord::Base
w = svg["width"].to_i
h = svg["height"].to_i
else
# fix orientation first
fix_image_orientation(file.path)
# fix orientation first (but not for GIFs)
fix_image_orientation(file.path) unless filename =~ /\.GIF$/i
# retrieve image info
image_info = FastImage.new(file) rescue nil
w, h = *(image_info.try(:size) || [0, 0])
@@ -80,7 +80,7 @@ class Upload < ActiveRecord::Base
# crop images depending on their type
if CROPPED_IMAGE_TYPES.include?(options[:image_type])
allow_animation = false
allow_animation = SiteSetting.allow_animated_thumbnails
max_pixel_ratio = Discourse::PIXEL_RATIOS.max
case options[:image_type]

View File

@@ -16,7 +16,6 @@ class PostOwnerChanger
@topic.user = @new_owner if post.is_first_post?
if post.user == nil
post.recover!
@topic.recover! if post.is_first_post?
end
post.topic = @topic