mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 21:35:15 +08:00
FEATURE: links that can't have no onebox can be used as featured topic links
This commit is contained in:
parent
bebc55eebd
commit
a6ebe495bf
|
@ -68,7 +68,8 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
if (loadOnebox && loadOnebox.then) {
|
if (loadOnebox && loadOnebox.then) {
|
||||||
loadOnebox.then( () => {
|
loadOnebox.then( () => {
|
||||||
this._updatePost(lookupCache(this.get('composer.title')));
|
const v = lookupCache(this.get('composer.title'));
|
||||||
|
this._updatePost(v ? v : link);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.set('composer.loading', false);
|
this.set('composer.loading', false);
|
||||||
Ember.run.schedule('afterRender', () => { this.$('input').putCursorAtEnd(); });
|
Ember.run.schedule('afterRender', () => { this.$('input').putCursorAtEnd(); });
|
||||||
|
|
|
@ -35,8 +35,8 @@ test("no onebox result", () => {
|
||||||
click('#create-topic');
|
click('#create-topic');
|
||||||
fillIn('#reply-title', "http://www.example.com/nope-onebox.html");
|
fillIn('#reply-title', "http://www.example.com/nope-onebox.html");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
equal(find('.d-editor-preview').html().trim().indexOf('onebox'), -1, "link isn't put into the post");
|
ok(find('.d-editor-preview').html().trim().indexOf('onebox') > 0, "it pastes the link into the body and previews it");
|
||||||
equal(find('.d-editor-input').val().length, 0, "link isn't put into the post");
|
ok(exists('.d-editor-textarea-wrapper .popup-tip.good'), 'link is pasted into body');
|
||||||
equal(find('.title-input input').val(), "http://www.example.com/nope-onebox.html", "title is unchanged");
|
equal(find('.title-input input').val(), "http://www.example.com/nope-onebox.html", "title is unchanged");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user