Skip to content

Commit

Permalink
Flarum 1.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed May 17, 2021
1 parent 9557736 commit c592688
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
],
"require": {
"flarum/core": "^0.1.0-beta.16"
"flarum/core": "^1.0.0"
},
"authors": [
{
Expand All @@ -43,7 +43,10 @@
"name": "fas fa-pen",
"backgroundColor": "#e74c3c",
"color": "#fff"
}
},
"optional-dependencies": [
"flarum/suspend"
]
},
"flagrow": {
"discuss": "https://discuss.flarum.org/d/17775"
Expand Down
6 changes: 3 additions & 3 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
},
"devDependencies": {
"flarum": "0.1.0-beta.16",
"prettier": "^1.19.1"
"prettier": "^2.2.1"
}
}
7 changes: 2 additions & 5 deletions js/src/forum/components/UserBio.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,13 @@ export default class UserBio extends Component {
m.redraw.sync();

const bio = this;
const save = function(e) {
const save = function (e) {
if (e.shiftKey) return;
e.preventDefault();
bio.save($(this).val());
};

this.$('textarea')
.focus()
.bind('blur', save)
.bind('keydown', 'return', save);
this.$('textarea').focus().bind('blur', save).bind('keydown', 'return', save);
m.redraw();
}

Expand Down
14 changes: 3 additions & 11 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ import UserBio from './components/UserBio';

app.initializers.add('fof-user-bio', () => {
User.prototype.bio = Model.attribute('bio');
User.prototype.bioHtml = computed('bio', bio =>
bio
? '<p>' +
$('<div/>')
.text(bio)
.html()
.replace(/\n/g, '<br>')
.autoLink({ rel: 'nofollow ugc' }) +
'</p>'
: ''
User.prototype.bioHtml = computed('bio', (bio) =>
bio ? '<p>' + $('<div/>').text(bio).html().replace(/\n/g, '<br>').autoLink({ rel: 'nofollow ugc' }) + '</p>' : ''
);

extend(UserCard.prototype, 'infoItems', function(items) {
extend(UserCard.prototype, 'infoItems', function (items) {
let user = this.attrs.user;

if (!user.attribute('canViewBio')) {
Expand Down

0 comments on commit c592688

Please sign in to comment.