mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 18:24:52 -06:00
Merge pull request #1194 from ZogStriP/uploads
[Upload] Great deal of renaming
This commit is contained in:
commit
ed60f24502
@ -62,10 +62,8 @@ Discourse.Markdown = {
|
||||
code: I18n.t("composer.code_title") + " <pre><code> Ctrl+K",
|
||||
codeexample: I18n.t("composer.code_text"),
|
||||
|
||||
image: I18n.t("composer.image_title") + " <img> Ctrl+G",
|
||||
imagedescription: I18n.t("composer.image_description"),
|
||||
imagedialog: "<p><b>" + I18n.t("composer.image_dialog_title") + "</b></p><p>http://example.com/images/diagram.jpg \"" +
|
||||
I18n.t("composer.image_optional_text") + "\"<br><br>" + I18n.t("composer.image_hosting_hint") + "</p>",
|
||||
image: I18n.t("composer.upload_title") + " - Ctrl+G",
|
||||
imagedescription: I18n.t("composer.upload_description"),
|
||||
|
||||
olist: I18n.t("composer.olist_title") + " <ol> Ctrl+O",
|
||||
ulist: I18n.t("composer.ulist_title") + " <ul> Ctrl+U",
|
||||
|
@ -224,7 +224,7 @@ Discourse.Utilities = {
|
||||
if (this.isAnImage(upload.original_filename)) {
|
||||
return '<img src="' + upload.url + '" width="' + upload.width + '" height="' + upload.height + '">';
|
||||
} else {
|
||||
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a>';
|
||||
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a><span class="size">(' + I18n.toHumanSize(upload.filesize) + ')</span>';
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
/**
|
||||
The modal for inviting a user to a topic
|
||||
|
||||
@class ImageSelectorController
|
||||
@extends Discourse.Controller
|
||||
@namespace Discourse
|
||||
@uses Discourse.ModalFunctionality
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.ImageSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
|
||||
|
||||
selectLocal: function() {
|
||||
this.set('localSelected', true);
|
||||
},
|
||||
|
||||
selectRemote: function() {
|
||||
this.set('localSelected', false);
|
||||
},
|
||||
|
||||
remoteSelected: Em.computed.not('localSelected')
|
||||
|
||||
});
|
@ -0,0 +1,17 @@
|
||||
/**
|
||||
The modal for upload a file to a post
|
||||
|
||||
@class UploadSelectorController
|
||||
@extends Discourse.Controller
|
||||
@namespace Discourse
|
||||
@uses Discourse.ModalFunctionality
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.UploadSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
|
||||
localSelected: true,
|
||||
remoteSelected: Em.computed.not('localSelected'),
|
||||
|
||||
selectLocal: function() { this.set('localSelected', true); },
|
||||
selectRemote: function() { this.set('localSelected', false); }
|
||||
|
||||
});
|
@ -2,13 +2,19 @@
|
||||
We always prefix with "js." to select exactly what we want passed
|
||||
through to the front end.
|
||||
**/
|
||||
|
||||
var oldI18nlookup = I18n.lookup;
|
||||
I18n.lookup = function() {
|
||||
// jshint doesn't like when we change the arguments directly...
|
||||
var args = arguments;
|
||||
if (args.length > 0) { args[0] = "js." + args[0]; }
|
||||
return oldI18nlookup.apply(this, args);
|
||||
I18n.lookup = function(scope, options) {
|
||||
return oldI18nlookup.apply(this, ["js." + scope, options]);
|
||||
};
|
||||
|
||||
/**
|
||||
Default format for storage units
|
||||
**/
|
||||
var oldI18ntoHumanSize = I18n.toHumanSize;
|
||||
I18n.toHumanSize = function(number, options) {
|
||||
options = options || {};
|
||||
options.format = I18n.t("number.human.storage_units.format");
|
||||
return oldI18ntoHumanSize.apply(this, [number, options]);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -26,12 +26,9 @@ Discourse.ApplicationRoute = Em.Route.extend({
|
||||
this.controllerFor('notActivated').setProperties(props);
|
||||
},
|
||||
|
||||
showImageSelector: function(composerView) {
|
||||
Discourse.Route.showModal(this, 'imageSelector');
|
||||
this.controllerFor('imageSelector').setProperties({
|
||||
localSelected: true,
|
||||
composerView: composerView
|
||||
});
|
||||
showUploadSelector: function(composerView) {
|
||||
Discourse.Route.showModal(this, 'uploadSelector');
|
||||
this.controllerFor('uploadSelector').setProperties({ composerView: composerView });
|
||||
},
|
||||
|
||||
|
||||
@ -62,4 +59,4 @@ Discourse.ApplicationRoute = Em.Route.extend({
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
@ -77,7 +77,7 @@
|
||||
<div id='draft-status'></div>
|
||||
{{#if view.isUploading}}
|
||||
<div id="file-uploading">
|
||||
{{i18n image_selector.uploading_image}} {{view.uploadProgress}}% <a id="cancel-file-upload">{{i18n cancel}}</a>
|
||||
{{i18n upload_selector.upload_file}} {{view.uploadProgress}}% <a id="cancel-file-upload">{{i18n cancel}}</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
@ -1,36 +0,0 @@
|
||||
<ul class="nav nav-pills image-options">
|
||||
<li title="{{i18n image_selector.local_title}}" {{bindAttr class="localSelected:active"}}>
|
||||
<a href="#" {{action selectLocal}}>{{i18n image_selector.from_my_computer}}</a>
|
||||
</li>
|
||||
<li title="{{i18n image_selector.remote_title}}" {{bindAttr class="remoteSelected:active"}}>
|
||||
<a href="#" {{action selectRemote}}>{{i18n image_selector.from_the_web}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{#if localSelected}}
|
||||
<div class='modal-body'>
|
||||
<form>
|
||||
<input type="file" name="file" id="filename-input" value="browse" accept="image/*"><br>
|
||||
<span class='description'>{{i18n image_selector.local_tip}}</span> <br>
|
||||
</form>
|
||||
</div>
|
||||
<div class='modal-footer'>
|
||||
<button class='btn btn-large btn-primary' {{action upload target="view"}}>
|
||||
<span class='add-picture'><i class='icon-picture'></i><i class='icon-plus'></i></span>
|
||||
{{i18n image_selector.upload}}
|
||||
</button>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='modal-body'>
|
||||
<form>
|
||||
<input type="text" name="text" id="fileurl-input" autofocus><br>
|
||||
<span class='description'>{{i18n image_selector.remote_tip}}</span> <br>
|
||||
</form>
|
||||
</div>
|
||||
<div class='modal-footer'>
|
||||
<button class='btn btn-large btn-primary' {{action add target="view"}}>
|
||||
<span class='add-picture'><i class='icon-picture'></i><i class='icon-plus'></i></span>
|
||||
{{i18n image_selector.add_image}}
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
@ -1,36 +0,0 @@
|
||||
<ul class="nav nav-pills image-options">
|
||||
<li title="{{i18n image_selector.local_title}}" {{bindAttr class="localSelected:active"}}>
|
||||
<a href="#" {{action selectLocal}}>{{i18n image_selector.from_my_computer}}</a>
|
||||
</li>
|
||||
<li title="{{i18n image_selector.remote_title}}" {{bindAttr class="remoteSelected:active"}}>
|
||||
<a href="#" {{action selectRemote}}>{{i18n image_selector.from_the_web}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{#if localSelected}}
|
||||
<div class='modal-body'>
|
||||
<form>
|
||||
<input type="file" name="file" id="filename-input" value="browse" accept="image/*"><br>
|
||||
<span class='description'>{{i18n image_selector.local_tip}}</span> <br>
|
||||
</form>
|
||||
</div>
|
||||
<div class='modal-footer'>
|
||||
<button class='btn btn-large btn-primary' {{action upload target="view"}}>
|
||||
<span class='add-picture'><i class='icon-picture'></i><i class='icon-plus'></i></span>
|
||||
{{i18n image_selector.upload}}
|
||||
</button>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='modal-body'>
|
||||
<form>
|
||||
<input type="text" name="text" id="fileurl-input" autofocus><br>
|
||||
<span class='description'>{{i18n image_selector.remote_tip}}</span> <br>
|
||||
</form>
|
||||
</div>
|
||||
<div class='modal-footer'>
|
||||
<button class='btn btn-large btn-primary' {{action add target="view"}}>
|
||||
<span class='add-picture'><i class='icon-picture'></i><i class='icon-plus'></i></span>
|
||||
{{i18n image_selector.add_image}}
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
@ -0,0 +1,36 @@
|
||||
<ul class="nav nav-pills">
|
||||
<li title="{{i18n upload_selector.local_title}}" {{bindAttr class="localSelected:active"}}>
|
||||
<a href="#" {{action selectLocal}}>{{i18n upload_selector.from_my_computer}}</a>
|
||||
</li>
|
||||
<li title="{{i18n upload_selector.remote_title}}" {{bindAttr class="remoteSelected:active"}}>
|
||||
<a href="#" {{action selectRemote}}>{{i18n upload_selector.from_the_web}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{#if localSelected}}
|
||||
<div class='modal-body'>
|
||||
<form>
|
||||
<input type="file" name="file" id="filename-input" value="browse"><br>
|
||||
<span class='description'>{{i18n upload_selector.local_tip}}</span> <br>
|
||||
</form>
|
||||
</div>
|
||||
<div class='modal-footer'>
|
||||
<button class='btn btn-large btn-primary' {{action upload target="view"}}>
|
||||
<span class='add-upload'><i class='icon-file-alt'></i><i class='icon-plus'></i></span>
|
||||
{{i18n upload_selector.upload}}
|
||||
</button>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class='modal-body'>
|
||||
<form>
|
||||
<input type="text" name="text" id="fileurl-input" autofocus><br>
|
||||
<span class='description'>{{i18n upload_selector.remote_tip}}</span> <br>
|
||||
</form>
|
||||
</div>
|
||||
<div class='modal-footer'>
|
||||
<button class='btn btn-large btn-primary' {{action add target="view"}}>
|
||||
<span class='add-upload'><i class='icon-file-alt'></i><i class='icon-plus'></i></span>
|
||||
{{i18n upload_selector.add_image}}
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
@ -199,7 +199,7 @@ Discourse.ComposerView = Discourse.View.extend({
|
||||
var $uploadTarget = $('#reply-control');
|
||||
this.editor.hooks.insertImageDialog = function(callback) {
|
||||
callback(null);
|
||||
composerView.get('controller').send('showImageSelector', composerView);
|
||||
composerView.get('controller').send('showUploadSelector', composerView);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
@ -1,23 +0,0 @@
|
||||
/**
|
||||
This view handles the image upload interface
|
||||
|
||||
@class ImageSelectorView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.ImageSelectorView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/image_selector',
|
||||
classNames: ['image-selector'],
|
||||
title: I18n.t('image_selector.title'),
|
||||
|
||||
upload: function() {
|
||||
$('#reply-control').fileupload('add', { fileInput: $('#filename-input') });
|
||||
},
|
||||
|
||||
add: function() {
|
||||
this.get('controller.composerView').addMarkdown("![image](" + $('#fileurl-input').val() + ")");
|
||||
this.get('controller').send('closeModal');
|
||||
}
|
||||
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
/**
|
||||
This view handles the upload interface
|
||||
|
||||
@class UploadSelectorView
|
||||
@extends Discourse.ModalBodyView
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.UploadSelectorView = Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/upload_selector',
|
||||
classNames: ['upload-selector'],
|
||||
title: I18n.t('upload_selector.title'),
|
||||
|
||||
upload: function() {
|
||||
$('#reply-control').fileupload('add', { fileInput: $('#filename-input') });
|
||||
},
|
||||
|
||||
add: function() {
|
||||
this.get('controller.composerView').addMarkdown($('#fileurl-input').val());
|
||||
this.get('controller').send('closeModal');
|
||||
}
|
||||
|
||||
});
|
@ -69,13 +69,13 @@
|
||||
}
|
||||
|
||||
|
||||
#wmd-bold-button:before {
|
||||
content: "\f032";
|
||||
#wmd-bold-button:before {
|
||||
content: "\f032";
|
||||
}
|
||||
|
||||
|
||||
#wmd-italic-button:before {
|
||||
content: "\f033";
|
||||
content: "\f033";
|
||||
}
|
||||
|
||||
#wmd-link-button:before {
|
||||
@ -91,15 +91,15 @@
|
||||
}
|
||||
|
||||
#wmd-image-button:before {
|
||||
content: "\f03e";
|
||||
content: "\f093";
|
||||
}
|
||||
|
||||
#wmd-olist-button:before {
|
||||
content: "\f0cb";
|
||||
content: "\f0cb";
|
||||
}
|
||||
|
||||
#wmd-ulist-button:before {
|
||||
content: "\f0ca";
|
||||
content: "\f0ca";
|
||||
}
|
||||
|
||||
#wmd-heading-button:before {
|
||||
|
@ -1,9 +1,7 @@
|
||||
// base styles for every modal popup used in Discourse
|
||||
|
||||
@import "foundation/variables";
|
||||
@import "foundation/mixins";
|
||||
|
||||
.add-picture .icon-plus {
|
||||
.add-upload .icon-plus {
|
||||
font-size: 10px;
|
||||
position: relative;
|
||||
left: -5px;
|
||||
@ -14,8 +12,7 @@
|
||||
-1px 1px 0 $btn-primary-background-color;
|
||||
}
|
||||
|
||||
// we should refactor this into something more general
|
||||
.image-selector {
|
||||
.upload-selector {
|
||||
input[type="text"]{
|
||||
width: 520px;
|
||||
}
|
@ -17,7 +17,7 @@ class Upload < ActiveRecord::Base
|
||||
validates_presence_of :original_filename
|
||||
|
||||
def thumbnail
|
||||
@thumbnail ||= optimized_images.where(width: width, height: height).first
|
||||
optimized_images.where(width: width, height: height).first
|
||||
end
|
||||
|
||||
def thumbnail_url
|
||||
@ -48,23 +48,25 @@ class Upload < ActiveRecord::Base
|
||||
sha1 = Digest::SHA1.file(file.tempfile).hexdigest
|
||||
# check if the file has already been uploaded
|
||||
unless upload = Upload.where(sha1: sha1).first
|
||||
# deal with width & heights for images
|
||||
if SiteSetting.authorized_image?(file)
|
||||
# retrieve image info
|
||||
image_info = FastImage.new(file.tempfile, raise_on_failure: true)
|
||||
# compute image aspect ratio
|
||||
width, height = ImageSizer.resize(*image_info.size)
|
||||
# make sure we're at the beginning of the file (FastImage is moving the pointer)
|
||||
file.rewind
|
||||
end
|
||||
# create a db record (so we can use the id)
|
||||
upload = Upload.create!({
|
||||
user_id: user_id,
|
||||
original_filename: file.original_filename,
|
||||
filesize: File.size(file.tempfile),
|
||||
sha1: sha1,
|
||||
url: ""
|
||||
url: "",
|
||||
width: width,
|
||||
height: height,
|
||||
})
|
||||
# deal with width & heights for images
|
||||
if SiteSetting.authorized_image?(file)
|
||||
# retrieve image info
|
||||
image_info = FastImage.new(file.tempfile, raise_on_failure: true)
|
||||
# compute image aspect ratio
|
||||
upload.width, upload.height = ImageSizer.resize(*image_info.size)
|
||||
# make sure we're at the beginning of the file (FastImage is moving the pointer)
|
||||
file.rewind
|
||||
end
|
||||
# store the file and update its url
|
||||
upload.url = Upload.store_file(file, sha1, upload.id)
|
||||
# save the url
|
||||
@ -80,8 +82,8 @@ class Upload < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.remove_file(url)
|
||||
S3.remove_file(url) if SiteSetting.enable_s3_uploads?
|
||||
LocalStore.remove_file(url)
|
||||
return S3.remove_file(url) if SiteSetting.enable_s3_uploads?
|
||||
return LocalStore.remove_file(url)
|
||||
end
|
||||
|
||||
def self.has_been_uploaded?(url)
|
||||
|
@ -1,5 +1,5 @@
|
||||
class UploadSerializer < ApplicationSerializer
|
||||
|
||||
attributes :url, :original_filename, :width, :height
|
||||
attributes :url, :original_filename, :filesize, :width, :height
|
||||
|
||||
end
|
||||
|
@ -7,6 +7,16 @@
|
||||
|
||||
cs:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte: B
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
dates:
|
||||
tiny:
|
||||
half_a_minute: "< 1m"
|
||||
@ -460,9 +470,9 @@ cs:
|
||||
quote_text: "Bloková citace"
|
||||
code_title: "Ukázka kódu"
|
||||
code_text: "sem vložte kód"
|
||||
image_title: "Obrázek"
|
||||
image_description: "sem vložek popis obrázku"
|
||||
image_dialog_title: "Vložit obrázek"
|
||||
upload_title: "Obrázek"
|
||||
upload_description: "sem vložek popis obrázku"
|
||||
upload_dialog_title: "Vložit obrázek"
|
||||
image_optional_text: "volitelný popis"
|
||||
image_hosting_hint: "Potřebujete <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>hosting obrázků zdarma?</a>"
|
||||
olist_title: "Číslovaný seznam"
|
||||
@ -496,7 +506,7 @@ cs:
|
||||
moved_post: "<i title='přesunutý příspěvek' class='icon icon-arrow-right'></i> {{username}} přesunul příspěvek do {{link}}"
|
||||
total_flagged: "celkem nahlášeno příspěvků"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Vložit obrázek"
|
||||
from_my_computer: "Z mého zařízení"
|
||||
from_the_web: "Z webu"
|
||||
@ -506,7 +516,7 @@ cs:
|
||||
local_title: "obrázek z lokálního úložiště"
|
||||
local_tip: "klikněte sem pro výběr obrázku z vašeho zařízení"
|
||||
upload: "Nahrát"
|
||||
uploading_image: "Nahrávám obrázek"
|
||||
upload_file: "Nahrávám obrázek"
|
||||
|
||||
search:
|
||||
title: "hledání témat, příspěvků, uživatelů a kategorií"
|
||||
|
@ -6,6 +6,18 @@
|
||||
|
||||
da:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
share:
|
||||
topic: 'del et link til dette emne'
|
||||
post: 'del et link til dette indlæg'
|
||||
@ -307,9 +319,9 @@ da:
|
||||
quote_text: "Citatblok"
|
||||
code_title: "Programkode"
|
||||
code_text: "skriv programkode her"
|
||||
image_title: "Billede"
|
||||
image_description: "skriv billedets beskrivelse her"
|
||||
image_dialog_title: "Indsæt billede"
|
||||
upload_title: "Billede"
|
||||
upload_description: "skriv billedets beskrivelse her"
|
||||
upload_dialog_title: "Indsæt billede"
|
||||
image_optional_text: "evt. titel"
|
||||
image_hosting_hint: "Brug for <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>gratis billed hosting?</a>"
|
||||
olist_title: "Numereret liste"
|
||||
@ -337,7 +349,7 @@ da:
|
||||
invitee_accepted: "<i title='accepted your invitation' class='icon icon-signin'></i> {{username}} har accepteret din invitation"
|
||||
moved_post: "<i title='moved post' class='icon icon-arrow-right'></i> {{username}} flyttede indlæg til {{link}}"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Indsæt billede"
|
||||
from_my_computer: "Fra min computer"
|
||||
from_the_web: "Fra nettet"
|
||||
@ -345,7 +357,7 @@ da:
|
||||
remote_tip: "skriv adressen på et billede i formen http://example.com/billede.jpg"
|
||||
local_tip: "klik for at vælge et billede fra din computer."
|
||||
upload: "Upload"
|
||||
uploading_image: "Uploader billede"
|
||||
upload_file: "Uploader billede"
|
||||
|
||||
search:
|
||||
title: "søg efter emner, indlæg, brugere eller kategorier"
|
||||
|
@ -7,6 +7,18 @@
|
||||
|
||||
de:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
dates:
|
||||
short_date_no_year: "D MMM"
|
||||
short_date: "D. MMM YYYY"
|
||||
@ -445,9 +457,9 @@ de:
|
||||
quote_text: "Zitat"
|
||||
code_title: "Code"
|
||||
code_text: "Gib hier den Code ein"
|
||||
image_title: "Bild"
|
||||
image_description: "Gib hier eine Bildbeschreibung ein"
|
||||
image_dialog_title: "Bild einfügen"
|
||||
upload_title: "Bild"
|
||||
upload_description: "Gib hier eine Bildbeschreibung ein"
|
||||
upload_dialog_title: "Bild einfügen"
|
||||
image_optional_text: "optionaler Titel"
|
||||
image_hosting_hint: "Benötigst Du <a href='http://www.google.com/search?q=kostenlos+bilder+hosten' target='_blank'>kostenlosen Dienst für Bilder?</a>"
|
||||
olist_title: "Nummerierte Liste"
|
||||
@ -481,7 +493,7 @@ de:
|
||||
moved_post: "<i title='moved post' class='icon icon-arrow-right'></i> {{username}} hat einen Beitrag nach {{link}} verschoben"
|
||||
total_flagged: "total markierte Einträge"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Bild einfügen"
|
||||
from_my_computer: "von meinem Gerät"
|
||||
from_the_web: "aus dem Web"
|
||||
@ -491,7 +503,7 @@ de:
|
||||
local_title: "Lokales Bild"
|
||||
local_tip: "Klicke hier, um ein Bild von deinem Gerät zu wählen."
|
||||
upload: "Hochladen"
|
||||
uploading_image: "Bild wird hochgeladen"
|
||||
upload_file: "Bild wird hochgeladen"
|
||||
|
||||
search:
|
||||
title: "Such nach Themen, Beiträgen, Nutzern oder Kategorien"
|
||||
|
@ -7,6 +7,18 @@
|
||||
|
||||
en:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
dates:
|
||||
tiny:
|
||||
half_a_minute: "< 1m"
|
||||
@ -436,9 +448,9 @@ en:
|
||||
quote_text: "Blockquote"
|
||||
code_title: "Code Sample"
|
||||
code_text: "enter code here"
|
||||
image_title: "Image"
|
||||
image_description: "enter image description here"
|
||||
image_dialog_title: "Insert Image"
|
||||
upload_title: "Image"
|
||||
upload_description: "enter image description here"
|
||||
upload_dialog_title: "Insert Image"
|
||||
image_optional_text: "optional title"
|
||||
image_hosting_hint: "Need <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>free image hosting?</a>"
|
||||
olist_title: "Numbered List"
|
||||
@ -472,17 +484,17 @@ en:
|
||||
moved_post: "<i title='moved post' class='icon icon-arrow-right'></i> {{username}} moved to {{link}}"
|
||||
total_flagged: "total flagged posts"
|
||||
|
||||
image_selector:
|
||||
title: "Insert Image"
|
||||
upload_selector:
|
||||
title: "Upload file"
|
||||
from_my_computer: "From My Device"
|
||||
from_the_web: "From The Web"
|
||||
add_image: "Add Image"
|
||||
remote_title: "remote image"
|
||||
remote_tip: "enter address of an image in the form http://example.com/image.jpg"
|
||||
local_title: "local image"
|
||||
local_tip: "click to select an image from your device."
|
||||
add_image: "Add File"
|
||||
remote_title: "remote file"
|
||||
remote_tip: "enter address of a file in the form http://example.com/image.jpg"
|
||||
local_title: "local file"
|
||||
local_tip: "click to select a file from your device."
|
||||
upload: "Upload"
|
||||
uploading_image: "Uploading image"
|
||||
upload_file: "Uploading"
|
||||
|
||||
search:
|
||||
title: "search for topics, posts, users, or categories"
|
||||
|
@ -8,6 +8,18 @@
|
||||
|
||||
es:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
dates:
|
||||
tiny:
|
||||
half_a_minute: "< 1m"
|
||||
@ -383,9 +395,9 @@ es:
|
||||
quote_text: "Blockquote"
|
||||
code_title: "Code Sample"
|
||||
code_text: "enter code here"
|
||||
image_title: "Image"
|
||||
image_description: "enter image description here"
|
||||
image_dialog_title: "Insert Image"
|
||||
upload_title: "Image"
|
||||
upload_description: "enter image description here"
|
||||
upload_dialog_title: "Insert Image"
|
||||
image_optional_text: "optional title"
|
||||
image_hosting_hint: "Need <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>free image hosting?</a>"
|
||||
olist_title: "Numbered List"
|
||||
@ -413,7 +425,7 @@ es:
|
||||
invitee_accepted: "<i title='aceptó tu invitación' class='icon icon-signin'></i> {{username}} aceptó tu invitación"
|
||||
moved_post: "<i title='publicación trasladada' class='icon icon-arrow-right'></i> {{username}} trasladó la publicación a {{link}}"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Insertar Imagen"
|
||||
from_my_computer: "Desde Mí Dispositivo"
|
||||
from_the_web: "Desde La Web"
|
||||
@ -421,7 +433,7 @@ es:
|
||||
remote_tip: "ingrese una dirección de una imagen en la siguiente forma http://ejemplo.com/imagen.jpg"
|
||||
local_tip: "click para seleccionar la imagen desde su dispositivo."
|
||||
upload: "Subir"
|
||||
uploading_image: "Subiendo imagen"
|
||||
upload_file: "Subiendo imagen"
|
||||
|
||||
search:
|
||||
title: "buscar por temas, publicaciones, usuarios o categorías"
|
||||
|
@ -11,6 +11,18 @@
|
||||
|
||||
fr:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: "%n %u"
|
||||
units:
|
||||
byte:
|
||||
one: "octet"
|
||||
other: "octets"
|
||||
kb: "ko"
|
||||
mb: "Mo"
|
||||
gb: "Go"
|
||||
tb: "To"
|
||||
dates:
|
||||
tiny:
|
||||
half_a_minute: "< 1m"
|
||||
@ -430,9 +442,9 @@ fr:
|
||||
quote_text: "Citation"
|
||||
code_title: "Bout de code"
|
||||
code_text: "renseignez ici votre code"
|
||||
image_title: "Image"
|
||||
image_description: "renseignez ici la description de l'image"
|
||||
image_dialog_title: "Insérez l'image"
|
||||
upload_title: "Image"
|
||||
upload_description: "renseignez ici la description de l'image"
|
||||
upload_dialog_title: "Insérez l'image"
|
||||
image_optional_text: "titre optionnel"
|
||||
image_hosting_hint: "Besoin <a href='https://www.google.fr/search?q=hébergement+d'image+gratuit' target='_blank'>d'un hébergeur d'image gratuit ?</a>"
|
||||
olist_title: "Liste numérotée"
|
||||
@ -477,17 +489,17 @@ fr:
|
||||
moved_post: "<i title='moved post' class='icon icon-arrow-right'></i> {{username}} a déplacé le message vers {{link}}"
|
||||
total_flagged: "Nombre total de messages signalés"
|
||||
|
||||
image_selector:
|
||||
title: "Insérer une image"
|
||||
upload_selector:
|
||||
title: "Insérer un fichier"
|
||||
from_my_computer: "Local"
|
||||
from_the_web: "Depuis internet"
|
||||
add_image: "Ajouter une image"
|
||||
remote_title: "Image distante"
|
||||
remote_tip: "saisissez l'url de l'image"
|
||||
local_title: "Image locale"
|
||||
local_tip: "Cliquez pour sélectionner une image depuis votre ordinateur."
|
||||
add_image: "Ajouter un fichier"
|
||||
remote_title: "Fichier distant"
|
||||
remote_tip: "saisissez l'url du fichier"
|
||||
local_title: "Fichier local"
|
||||
local_tip: "Cliquez pour sélectionner un fichier depuis votre ordinateur."
|
||||
upload: "Envoyer"
|
||||
uploading_image: "Image en cours d'envoi"
|
||||
upload_file: "Fichier en cours d'envoi"
|
||||
|
||||
search:
|
||||
title: "Rechercher les discussions, messages, utilisateurs ou catégories"
|
||||
|
@ -8,6 +8,18 @@
|
||||
|
||||
id:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Byte
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
share:
|
||||
topic: "Bagikan tautan ke topik ini"
|
||||
post: "Bagikan tautan ke muatan ini"
|
||||
@ -298,7 +310,7 @@ id:
|
||||
invitee_accepted: "<i title='accepted your invitation' class='icon icon-signin'></i> {{username}} accepted your invitation"
|
||||
moved_post: "<i title='moved post' class='icon icon-arrow-right'></i> {{username}} moved post to {{link}}"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Insert Image"
|
||||
from_my_computer: "From My Device"
|
||||
from_the_web: "From The Web"
|
||||
@ -306,7 +318,7 @@ id:
|
||||
remote_tip: "enter address of an image in the form http://example.com/image.jpg"
|
||||
local_tip: "click to select an image from your device."
|
||||
upload: "Upload"
|
||||
uploading_image: "Uploading image"
|
||||
upload_file: "Uploading image"
|
||||
|
||||
search:
|
||||
title: "search for topics, posts, users, or categories"
|
||||
|
@ -7,6 +7,18 @@
|
||||
|
||||
it:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Byte
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
share:
|
||||
topic: 'condividi un link a questo topic'
|
||||
post: 'condividi un link a questo post'
|
||||
@ -370,9 +382,9 @@ it:
|
||||
quote_text: "Blockquote"
|
||||
code_title: "Esempio di codice"
|
||||
code_text: "inserisci il codice qui"
|
||||
image_title: "Immagine"
|
||||
image_description: "descrizione dell'immagine"
|
||||
image_dialog_title: "Inserisci Immagine"
|
||||
upload_title: "Immagine"
|
||||
upload_description: "descrizione dell'immagine"
|
||||
upload_dialog_title: "Inserisci Immagine"
|
||||
image_optional_text: "titolo facoltativo"
|
||||
image_hosting_hint: "Hai bisogno di <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>free image hosting?</a>"
|
||||
olist_title: "Lista Numerata"
|
||||
@ -406,7 +418,7 @@ it:
|
||||
moved_post: "<i title='post spostato' class='icon icon-arrow-right'></i> {{username}} ha spostato il post qui {{link}}"
|
||||
total_flagged: "totale post segnalati"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Inserisci Immagine"
|
||||
from_my_computer: "Dal mio dispositivo"
|
||||
from_the_web: "Dal Web"
|
||||
@ -416,7 +428,7 @@ it:
|
||||
local_title: "immagine locale"
|
||||
local_tip: "clicca per selezionare un'immagine dal tuo dispositivo."
|
||||
upload: "Upload"
|
||||
uploading_image: "Carico l'immagine"
|
||||
upload_file: "Carico l'immagine"
|
||||
|
||||
search:
|
||||
title: "cerca topic, post, utenti o categorie"
|
||||
|
@ -7,6 +7,18 @@
|
||||
|
||||
nb_NO:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: kB
|
||||
mb: MB
|
||||
tb: TB
|
||||
share:
|
||||
topic: 'del en link til dette emnet'
|
||||
post: 'del en link til dette innlegget'
|
||||
@ -381,9 +393,9 @@ nb_NO:
|
||||
quote_text: "Sitatramme"
|
||||
code_title: "Kode Utsnitt"
|
||||
code_text: "Legg inn kode her"
|
||||
image_title: "Bilde"
|
||||
image_description: "beskriv bildet her"
|
||||
image_dialog_title: "Legg til Bildet"
|
||||
upload_title: "Bilde"
|
||||
upload_description: "beskriv bildet her"
|
||||
upload_dialog_title: "Legg til Bildet"
|
||||
image_optional_text: "valgfri title"
|
||||
image_hosting_hint: "Trenger du <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>gratis bildelagring?</a>"
|
||||
olist_title: "Nummerert Liste"
|
||||
@ -417,7 +429,7 @@ nb_NO:
|
||||
moved_post: "<i title='flyttet innlegg' class='icon icon-arrow-right'></i> {{username}} flyttet til {{link}}"
|
||||
total_flagged: "totalt markerte innlegg"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Legg til Bilde"
|
||||
from_my_computer: "Fra Min Enhet"
|
||||
from_the_web: "Fra Nettet"
|
||||
@ -427,7 +439,7 @@ nb_NO:
|
||||
local_title: "lokalt bilde"
|
||||
local_tip: "klikk for å velge et bilde fra din enhet."
|
||||
upload: "Last opp"
|
||||
uploading_image: "Laster opp bilde"
|
||||
upload_file: "Laster opp bilde"
|
||||
|
||||
search:
|
||||
title: "søk etter emner, innlegg, brukere eller kategorier"
|
||||
|
@ -12,6 +12,18 @@
|
||||
|
||||
nl:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
dates:
|
||||
tiny:
|
||||
half_a_minute: "< 1m"
|
||||
@ -441,9 +453,9 @@ nl:
|
||||
quote_text: Citaat
|
||||
code_title: Code voorbeeld
|
||||
code_text: hier de code
|
||||
image_title: Afbeelding
|
||||
image_description: geef een omschrijving voor de afbeelding op
|
||||
image_dialog_title: Voeg afbeelding toe
|
||||
upload_title: Afbeelding
|
||||
upload_description: geef een omschrijving voor de afbeelding op
|
||||
upload_dialog_title: Voeg afbeelding toe
|
||||
image_optional_text: optionele titel
|
||||
image_hosting_hint: "Heb je een <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>een gratis stek voor je afbeelding</a> nodig?"
|
||||
olist_title: Genummerde lijst
|
||||
@ -477,7 +489,7 @@ nl:
|
||||
moved_post: "<i title='bericht verplaatst' class='icon icon-arrow-right'></i> {{username}} verplaatst naar {{link}}"
|
||||
total_flagged: aantal gemarkeerde berichten
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: Voeg afbeelding toe
|
||||
from_my_computer: Vanaf mijn apparaat
|
||||
from_the_web: Vanaf het web
|
||||
@ -487,7 +499,7 @@ nl:
|
||||
local_title: lokale afbeelding
|
||||
local_tip: "klik om een afbeelding vanaf je apparaat te selecteren."
|
||||
upload: Uploaden
|
||||
uploading_image: Afbeelding uploaden
|
||||
upload_file: Afbeelding uploaden
|
||||
|
||||
search:
|
||||
title: "zoek naar topics, posts, leden of categoriëen"
|
||||
|
@ -429,9 +429,9 @@ pseudo:
|
||||
quote_text: '[[ Ɓłóčǩƣůóťé ]]'
|
||||
code_title: '[[ Čóďé Šáɱƿłé ]]'
|
||||
code_text: '[[ éɳťéř čóďé ĥéřé ]]'
|
||||
image_title: '[[ Íɱáǧé ]]'
|
||||
image_description: '[[ éɳťéř íɱáǧé ďéščříƿťíóɳ ĥéřé ]]'
|
||||
image_dialog_title: '[[ Íɳšéřť Íɱáǧé ]]'
|
||||
upload_title: '[[ Íɱáǧé ]]'
|
||||
upload_description: '[[ éɳťéř íɱáǧé ďéščříƿťíóɳ ĥéřé ]]'
|
||||
upload_dialog_title: '[[ Íɳšéřť Íɱáǧé ]]'
|
||||
image_optional_text: '[[ óƿťíóɳáł ťíťłé ]]'
|
||||
image_hosting_hint: '[[ Ѝééď <á ĥřéƒ=''ĥťťƿ://ŵŵŵ.ǧóóǧłé.čóɱ/šéářčĥ?ƣ=ƒřéé+íɱáǧé+ĥóšťíɳǧ''
|
||||
ťářǧéť=''_ƀłáɳǩ''>ƒřéé íɱáǧé ĥóšťíɳǧ?</á> ]]'
|
||||
@ -474,7 +474,7 @@ pseudo:
|
||||
moved_post: '[[ <í ťíťłé=''ɱóνéď ƿóšť'' čłášš=''íčóɳ íčóɳ-ářřóŵ-říǧĥť''></í>
|
||||
{{username}} ɱóνéď ťó {{link}} ]]'
|
||||
total_flagged: '[[ ťóťáł ƒłáǧǧéď ƿóšťš ]]'
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: '[[ Íɳšéřť Íɱáǧé ]]'
|
||||
from_my_computer: '[[ Ƒřóɱ Ϻý Ďéνíčé ]]'
|
||||
from_the_web: '[[ Ƒřóɱ Ťĥé Ŵéƀ ]]'
|
||||
@ -485,7 +485,7 @@ pseudo:
|
||||
local_title: '[[ łóčáł íɱáǧé ]]'
|
||||
local_tip: '[[ čłíčǩ ťó šéłéčť áɳ íɱáǧé ƒřóɱ ýóůř ďéνíčé. ]]'
|
||||
upload: '[[ Ůƿłóáď ]]'
|
||||
uploading_image: '[[ Ůƿłóáďíɳǧ íɱáǧé ]]'
|
||||
upload_file: '[[ Ůƿłóáďíɳǧ íɱáǧé ]]'
|
||||
search:
|
||||
title: '[[ šéářčĥ ƒóř ťóƿíčš, ƿóšťš, ůšéřš, óř čáťéǧóříéš ]]'
|
||||
placeholder: '[[ ťýƿé ýóůř šéářčĥ ťéřɱš ĥéřé ]]'
|
||||
|
@ -8,6 +8,18 @@
|
||||
|
||||
pt:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
share:
|
||||
topic: 'partilhe um link para este tópico'
|
||||
post: 'partilhe um link para esta mensagem'
|
||||
@ -289,14 +301,14 @@ pt:
|
||||
invitee_accepted: "<i title='accepted your invitation' class='icon icon-signin'></i> {{username}} aceitou o teu convite"
|
||||
moved_post: "<i title='moved post' class='icon icon-arrow-right'></i> {{username}} moveu o post para {{link}}"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
from_my_computer: "Do meu dispositivo"
|
||||
from_the_web: "Da internet"
|
||||
add_image: "Adicionar Imagem"
|
||||
remote_tip: "insere o endereço de uma imagem no formato http://example.com/image.jpg"
|
||||
local_tip: "clica para selecionar uma imagem no teu dispositivo."
|
||||
upload: "Enviar"
|
||||
uploading_image: "A enviar imagem"
|
||||
upload_file: "A enviar imagem"
|
||||
|
||||
search:
|
||||
title: "procurar por tópicos, posts, utilizadores, ou categorias"
|
||||
|
@ -10,6 +10,20 @@
|
||||
|
||||
ru:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
few: байта
|
||||
many: байт
|
||||
one: байт
|
||||
other: байта
|
||||
gb: ГБ
|
||||
kb: КБ
|
||||
mb: МБ
|
||||
tb: ТБ
|
||||
dates:
|
||||
tiny:
|
||||
half_a_minute: '< 1мин'
|
||||
@ -441,9 +455,9 @@ ru:
|
||||
quote_text: Цитата
|
||||
code_title: Фрагмент кода
|
||||
code_text: вводите код здесь
|
||||
image_title: Изображение
|
||||
image_description: введите здесь описание изображения
|
||||
image_dialog_title: Вставка изображения
|
||||
upload_title: Изображение
|
||||
upload_description: введите здесь описание изображения
|
||||
upload_dialog_title: Вставка изображения
|
||||
image_optional_text: необязательное название
|
||||
image_hosting_hint: "Нужен <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>бесплатный хостинг изображений?</a>"
|
||||
olist_title: Нумерованный список
|
||||
@ -474,7 +488,7 @@ ru:
|
||||
invitee_accepted: "<i title='принятое приглашение' class='icon icon-signin'></i> {{username}} принял ваше приглашение"
|
||||
moved_post: "<i title='перенесенное сообщение' class='icon icon-arrow-right'></i> {{username}} перенес сообщение в {{link}}"
|
||||
total_flagged: всего сообщений с жалобами
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: Вставка изображения
|
||||
from_my_computer: С устройства
|
||||
from_the_web: Из интернета
|
||||
@ -484,7 +498,7 @@ ru:
|
||||
local_title: локальное изображение
|
||||
local_tip: выбрать изображение с устройства.
|
||||
upload: Загрузить
|
||||
uploading_image: Загрузка изображения
|
||||
upload_file: Загрузка изображения
|
||||
search:
|
||||
title: поиск по темам, сообщениям, пользователям или категориям
|
||||
placeholder: условия поиска...
|
||||
|
@ -8,6 +8,18 @@
|
||||
|
||||
sv:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
share:
|
||||
topic: 'dela en länk till denna tråd'
|
||||
post: 'dela en länk till denna tråd'
|
||||
@ -313,9 +325,9 @@ sv:
|
||||
quote_text: "Citat"
|
||||
code_title: "Kodexempel"
|
||||
code_text: "skriv din kod här"
|
||||
image_title: "Bild"
|
||||
image_description: "skriv en bildbeskrivning här"
|
||||
image_dialog_title: "Infoga Bild"
|
||||
upload_title: "Bild"
|
||||
upload_description: "skriv en bildbeskrivning här"
|
||||
upload_dialog_title: "Infoga Bild"
|
||||
image_optional_text: "valfri titel"
|
||||
image_hosting_hint: "Behöver du <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>gratis bilduppladdning?</a>"
|
||||
olist_title: "Numrerad Lista"
|
||||
@ -343,7 +355,7 @@ sv:
|
||||
invitee_accepted: "<i title='accepterade din inbjudan' class='icon icon-signin'></i> {{username}} accepterade din inbjudan"
|
||||
moved_post: "<i title='flyttade inlägg' class='icon icon-arrow-right'></i> {{username}} flyttade inlägg till {{link}}"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "Infoga Bild"
|
||||
from_my_computer: "Från Min Enhet"
|
||||
from_the_web: "Från Internet"
|
||||
@ -351,7 +363,7 @@ sv:
|
||||
remote_tip: "skriv in en adress till en bild i formen http://exempel.se/bild.jpg"
|
||||
local_tip: "klicka för att välja en bild från din enhet."
|
||||
upload: "Ladda Upp"
|
||||
uploading_image: "Laddar upp bild"
|
||||
upload_file: "Laddar upp bild"
|
||||
|
||||
search:
|
||||
title: "sök efter trådar, inlägg, användare, eller kategorier"
|
||||
|
@ -7,6 +7,18 @@
|
||||
|
||||
zh_CN:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
dates:
|
||||
short_date_no_year: "D MMM"
|
||||
short_date: "D MMM, YYYY"
|
||||
@ -429,9 +441,9 @@ zh_CN:
|
||||
quote_text: "引用"
|
||||
code_title: "代码"
|
||||
code_text: "在此输入代码"
|
||||
image_title: "图片"
|
||||
image_description: "在此输入图片描述"
|
||||
image_dialog_title: "插入图片"
|
||||
upload_title: "图片"
|
||||
upload_description: "在此输入图片描述"
|
||||
upload_dialog_title: "插入图片"
|
||||
image_optional_text: "可选标题"
|
||||
image_hosting_hint: "需要 <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>免费图片存储?</a>"
|
||||
olist_title: "数字列表"
|
||||
@ -465,7 +477,7 @@ zh_CN:
|
||||
moved_post: "<i title='移动帖子' class='icon icon-arrow-right'></i> {{username}} 已将帖子移动到 {{link}}"
|
||||
total_flagged: "被投诉帖子的总数"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "插入图片"
|
||||
from_my_computer: "来自我的设备"
|
||||
from_the_web: "来自网络"
|
||||
@ -475,7 +487,7 @@ zh_CN:
|
||||
local_title: "本地图片"
|
||||
local_tip: "点击从你的设备中选择一张图片。"
|
||||
upload: "上传"
|
||||
uploading_image: "上传图片中"
|
||||
upload_file: "上传图片中"
|
||||
|
||||
search:
|
||||
title: "搜索主题、帖子、用户或分类"
|
||||
|
@ -7,6 +7,18 @@
|
||||
|
||||
zh_TW:
|
||||
js:
|
||||
number:
|
||||
human:
|
||||
storage_units:
|
||||
format: ! '%n %u'
|
||||
units:
|
||||
byte:
|
||||
one: Byte
|
||||
other: Bytes
|
||||
gb: GB
|
||||
kb: KB
|
||||
mb: MB
|
||||
tb: TB
|
||||
share:
|
||||
topic: '分享一個到本主題的鏈接'
|
||||
post: '分享一個到本帖的鏈接'
|
||||
@ -370,9 +382,9 @@ zh_TW:
|
||||
quote_text: "引用"
|
||||
code_title: "代碼"
|
||||
code_text: "在此輸入代碼"
|
||||
image_title: "圖片"
|
||||
image_description: "在此輸入圖片描述"
|
||||
image_dialog_title: "插入圖片"
|
||||
upload_title: "圖片"
|
||||
upload_description: "在此輸入圖片描述"
|
||||
upload_dialog_title: "插入圖片"
|
||||
image_optional_text: "可選標題"
|
||||
image_hosting_hint: "需要 <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>免費圖片存儲?</a>"
|
||||
olist_title: "數字列表"
|
||||
@ -406,7 +418,7 @@ zh_TW:
|
||||
moved_post: "<i title='移動帖子' class='icon icon-arrow-right'></i> {{username}} 已將帖子移動到 {{link}}"
|
||||
total_flagged: "被投訴帖子的總數"
|
||||
|
||||
image_selector:
|
||||
upload_selector:
|
||||
title: "插入圖片"
|
||||
from_my_computer: "來自我的設備"
|
||||
from_the_web: "來自網絡"
|
||||
@ -416,7 +428,7 @@ zh_TW:
|
||||
local_title: "本地圖片"
|
||||
local_tip: "點擊從你的設備中選擇一張圖片。"
|
||||
upload: "上傳"
|
||||
uploading_image: "上傳圖片中"
|
||||
upload_file: "上傳圖片中"
|
||||
|
||||
search:
|
||||
title: "搜索主題、帖子、用戶或分類"
|
||||
|
@ -25,14 +25,10 @@ class CookedPostProcessor
|
||||
attachments.each do |attachment|
|
||||
href = attachment['href']
|
||||
attachment['href'] = relative_to_absolute(href)
|
||||
# update reverse index
|
||||
if upload = Upload.get_from_url(href)
|
||||
# update reverse index
|
||||
associate_to_post(upload)
|
||||
# append the size
|
||||
append_human_size!(attachment, upload)
|
||||
end
|
||||
# mark as dirty
|
||||
@dirty = true
|
||||
end
|
||||
end
|
||||
|
||||
@ -234,13 +230,6 @@ class CookedPostProcessor
|
||||
end
|
||||
end
|
||||
|
||||
def append_human_size!(attachment, upload)
|
||||
size = Nokogiri::XML::Node.new("span", @doc)
|
||||
size["class"] = "size"
|
||||
size.content = "(#{number_to_human_size(upload.filesize)})"
|
||||
attachment.add_next_sibling(size)
|
||||
end
|
||||
|
||||
def dirty?
|
||||
@dirty
|
||||
end
|
||||
|
@ -34,10 +34,6 @@ describe CookedPostProcessor do
|
||||
cpp.html.should =~ /#{LocalStore.base_url}/
|
||||
# ensure name is present
|
||||
cpp.html.should =~ /archive.zip/
|
||||
# ensure size is present
|
||||
cpp.html.should =~ /<span class=\"size\">\(1.21 KB\)<\/span>/
|
||||
# dirty
|
||||
cpp.should be_dirty
|
||||
# keeps the reverse index up to date
|
||||
post.uploads.reload
|
||||
post.uploads.count.should == 1
|
||||
|
7
spec/fabricators/optimized_image_fabricator.rb
Normal file
7
spec/fabricators/optimized_image_fabricator.rb
Normal file
@ -0,0 +1,7 @@
|
||||
Fabricator(:optimized_image) do
|
||||
upload
|
||||
sha1 "abcdef"
|
||||
extension ".png"
|
||||
width 100
|
||||
height 200
|
||||
end
|
@ -13,52 +13,142 @@ describe Upload do
|
||||
it { should validate_presence_of :original_filename }
|
||||
it { should validate_presence_of :filesize }
|
||||
|
||||
context '.create_for' do
|
||||
let(:upload) { build(:upload) }
|
||||
let(:thumbnail) { build(:optimized_image, upload: upload) }
|
||||
|
||||
let(:user_id) { 1 }
|
||||
let(:user_id) { 1 }
|
||||
let(:url) { "http://domain.com" }
|
||||
|
||||
let(:logo) do
|
||||
ActionDispatch::Http::UploadedFile.new({
|
||||
filename: 'logo.png',
|
||||
content_type: 'image/png',
|
||||
tempfile: File.new("#{Rails.root}/spec/fixtures/images/logo.png")
|
||||
})
|
||||
let(:image) do
|
||||
ActionDispatch::Http::UploadedFile.new({
|
||||
filename: 'logo.png',
|
||||
tempfile: File.new("#{Rails.root}/spec/fixtures/images/logo.png")
|
||||
})
|
||||
end
|
||||
|
||||
let(:image_sha1) { Digest::SHA1.file(image.tempfile).hexdigest }
|
||||
|
||||
let(:attachment) do
|
||||
ActionDispatch::Http::UploadedFile.new({
|
||||
filename: File.basename(__FILE__),
|
||||
tempfile: File.new(__FILE__)
|
||||
})
|
||||
end
|
||||
|
||||
context ".create_thumbnail!" do
|
||||
|
||||
it "does not create a thumbnail when disabled" do
|
||||
SiteSetting.stubs(:create_thumbnails?).returns(false)
|
||||
SiteSetting.expects(:enable_s3_uploads?).never
|
||||
upload.create_thumbnail!
|
||||
end
|
||||
|
||||
let(:upload) { Upload.create_for(user_id, logo) }
|
||||
|
||||
let(:url) { "http://domain.com" }
|
||||
|
||||
shared_examples_for "upload" do
|
||||
it "is valid" do
|
||||
upload.user_id.should == user_id
|
||||
upload.original_filename.should == logo.original_filename
|
||||
upload.filesize.should == File.size(logo.tempfile)
|
||||
upload.sha1.should == Digest::SHA1.file(logo.tempfile).hexdigest
|
||||
upload.width.should == 244
|
||||
upload.height.should == 66
|
||||
upload.url.should == url
|
||||
end
|
||||
it "does not create a thumbnail when using S3" do
|
||||
SiteSetting.expects(:create_thumbnails?).returns(true)
|
||||
SiteSetting.expects(:enable_s3_uploads?).returns(true)
|
||||
upload.expects(:has_thumbnail?).never
|
||||
upload.create_thumbnail!
|
||||
end
|
||||
|
||||
context "s3" do
|
||||
before(:each) do
|
||||
SiteSetting.stubs(:enable_s3_uploads?).returns(true)
|
||||
S3.stubs(:store_file).returns(url)
|
||||
end
|
||||
|
||||
it_behaves_like "upload"
|
||||
|
||||
it "does not create another thumbnail" do
|
||||
SiteSetting.expects(:create_thumbnails?).returns(true)
|
||||
SiteSetting.expects(:enable_s3_uploads?).returns(false)
|
||||
upload.expects(:has_thumbnail?).returns(true)
|
||||
OptimizedImage.expects(:create_for).never
|
||||
upload.create_thumbnail!
|
||||
end
|
||||
|
||||
context "locally" do
|
||||
before(:each) { LocalStore.stubs(:store_file).returns(url) }
|
||||
it_behaves_like "upload"
|
||||
it "creates a thumbnail" do
|
||||
upload = Fabricate(:upload)
|
||||
thumbnail = Fabricate(:optimized_image, upload: upload)
|
||||
SiteSetting.expects(:create_thumbnails?).returns(true)
|
||||
SiteSetting.expects(:enable_s3_uploads?).returns(false)
|
||||
upload.expects(:has_thumbnail?).returns(false)
|
||||
OptimizedImage.expects(:create_for).returns(thumbnail)
|
||||
upload.create_thumbnail!
|
||||
upload.reload
|
||||
upload.optimized_images.count.should == 1
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'has_been_uploaded?' do
|
||||
context ".create_for" do
|
||||
|
||||
it "does not create another upload if it already exists" do
|
||||
Upload.expects(:where).with(sha1: image_sha1).returns([upload])
|
||||
Upload.expects(:create!).never
|
||||
Upload.create_for(user_id, image).should == upload
|
||||
end
|
||||
|
||||
it "computes width & height for images" do
|
||||
SiteSetting.expects(:authorized_image?).returns(true)
|
||||
FastImage.any_instance.expects(:size).returns([100, 200])
|
||||
ImageSizer.expects(:resize)
|
||||
ActionDispatch::Http::UploadedFile.any_instance.expects(:rewind)
|
||||
Upload.create_for(user_id, image)
|
||||
end
|
||||
|
||||
it "does not create an upload when there is an error with FastImage" do
|
||||
SiteSetting.expects(:authorized_image?).returns(true)
|
||||
Upload.expects(:create!).never
|
||||
expect { Upload.create_for(user_id, attachment) }.to raise_error(FastImage::UnknownImageType)
|
||||
end
|
||||
|
||||
it "does not compute width & height for non-image" do
|
||||
SiteSetting.expects(:authorized_image?).returns(false)
|
||||
FastImage.any_instance.expects(:size).never
|
||||
Upload.create_for(user_id, image)
|
||||
end
|
||||
|
||||
it "saves proper information" do
|
||||
Upload.expects(:store_file).returns(url)
|
||||
upload = Upload.create_for(user_id, image)
|
||||
upload.user_id.should == user_id
|
||||
upload.original_filename.should == image.original_filename
|
||||
upload.filesize.should == File.size(image.tempfile)
|
||||
upload.sha1.should == Digest::SHA1.file(image.tempfile).hexdigest
|
||||
upload.width.should == 244
|
||||
upload.height.should == 66
|
||||
upload.url.should == url
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context ".store_file" do
|
||||
|
||||
it "store files on s3 when enabled" do
|
||||
SiteSetting.expects(:enable_s3_uploads?).returns(true)
|
||||
LocalStore.expects(:store_file).never
|
||||
S3.expects(:store_file)
|
||||
Upload.store_file(image, image_sha1, 1)
|
||||
end
|
||||
|
||||
it "store files locally by default" do
|
||||
S3.expects(:store_file).never
|
||||
LocalStore.expects(:store_file)
|
||||
Upload.store_file(image, image_sha1, 1)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context ".remove_file" do
|
||||
|
||||
it "remove files on s3 when enabled" do
|
||||
SiteSetting.expects(:enable_s3_uploads?).returns(true)
|
||||
LocalStore.expects(:remove_file).never
|
||||
S3.expects(:remove_file)
|
||||
Upload.remove_file(upload.url)
|
||||
end
|
||||
|
||||
it "remove files locally by default" do
|
||||
S3.expects(:remove_file).never
|
||||
LocalStore.expects(:remove_file)
|
||||
Upload.remove_file(upload.url)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context ".has_been_uploaded?" do
|
||||
|
||||
it "identifies internal or relatives urls" do
|
||||
Discourse.expects(:base_url_no_prefix).returns("http://discuss.site.com")
|
||||
@ -84,4 +174,14 @@ describe Upload do
|
||||
|
||||
end
|
||||
|
||||
context ".get_from_url" do
|
||||
|
||||
it "works only when the file has been uploaded" do
|
||||
Upload.expects(:has_been_uploaded?).returns(false)
|
||||
Upload.expects(:where).never
|
||||
Upload.get_from_url("discourse.org")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -88,6 +88,7 @@ test("isAuthorizedUpload", function() {
|
||||
var getUploadMarkdown = function(filename) {
|
||||
return utils.getUploadMarkdown({
|
||||
original_filename: filename,
|
||||
filesize: 42,
|
||||
width: 100,
|
||||
height: 200,
|
||||
url: "/upload/123/abcdef.ext"
|
||||
@ -96,7 +97,7 @@ var getUploadMarkdown = function(filename) {
|
||||
|
||||
test("getUploadMarkdown", function() {
|
||||
ok(getUploadMarkdown("lolcat.gif") === '<img src="/upload/123/abcdef.ext" width="100" height="200">');
|
||||
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/upload/123/abcdef.ext">important.txt</a>');
|
||||
ok(getUploadMarkdown("important.txt") === '<a class="attachment" href="/upload/123/abcdef.ext">important.txt</a><span class="size">(42 Bytes)</span>');
|
||||
});
|
||||
|
||||
test("isAnImage", function() {
|
||||
|
Loading…
Reference in New Issue
Block a user