Skip to content

Commit

Permalink
fixed bbcode using a new package since last one is now deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
HUET Benjamin committed Dec 13, 2017
1 parent 737d08d commit ebfb471
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"eveseat/web": "^2.0.13",
"eveseat/eveapi": "^2.0",
"eveseat/services": "^2.0",
"golonka/bbcodeparser": "^2.0"
"s9e/text-formatter": "*"
},
"authors": [{
"name": "Kassie Yvo",
Expand Down
10 changes: 8 additions & 2 deletions src/Models/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;

use s9e\TextFormatter\Bundles\Forum as TextFormatter;

use Carbon\Carbon;
use \DateTime;
use Seat\Web\Models\User;
Expand Down Expand Up @@ -53,8 +55,12 @@ public function setDescriptionAttribute($value) {
$this->attributes['description_new'] = $value;
}
public function getParsedDescriptionAttribute() {
$bbcode = new \Golonka\BBCode\BBCodeParser;
return $bbcode->parse($this->description ?: $this->description_new);
$parser = TextFormatter::getParser();
$parser->disablePlugin('Emoji');

$xml = $parser->parse($this->description ?: $this->description_new);

return TextFormatter::render($xml);
}

public function getDurationAttribute() {
Expand Down
6 changes: 4 additions & 2 deletions src/resources/assets/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ $('#modalUpdateOperation').on('show.bs.modal', function(e) {
nowRounded = moment.utc();
nowRounded = moment.utc(Math.ceil((+nowRounded) / ROUNDING) * ROUNDING);



$.getJSON("/calendar/operation/find/" + operation_id, function(op) {
$('#modalUpdateOperation').find('input[name=title]').val(op.title);
$('#modalUpdateOperation').find('option[value="' + op.type + '"]').prop('selected', true);
Expand All @@ -97,8 +99,8 @@ $('#modalUpdateOperation').on('show.bs.modal', function(e) {
$('#modalUpdateOperation').find('input[name=staging_info]').val(op.staging_info);
$('#modalUpdateOperation').find('input[name=fc]').val(op.fc);
$('#modalUpdateOperation').find('input[name=fc_character_id]').val(op.fc_character_id);
$('#modalUpdateOperation').find('input[name=description]').val(op.description);
$('#modalUpdateOperation').find('textarea[name=description]').val(op.description);

$.each(op.tags, function(i, tag) {
$('#checkbox-update-' + tag.id).prop('checked', true);
});
Expand Down

0 comments on commit ebfb471

Please sign in to comment.