Skip to content

Commit

Permalink
replace GPL diff lib with MIT lib
Browse files Browse the repository at this point in the history
replace gpl lib with mit lib
  • Loading branch information
Younès EL BIACHE committed Jul 10, 2016
1 parent 9537e2a commit c279c6e
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 57 deletions.
7 changes: 3 additions & 4 deletions app/Http/Controllers/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use BookStack\Repos\PageRepo;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Views;
use Icap\HtmlDiff\HtmlDiff;
use GatherContent\Htmldiff\Htmldiff;

class PageController extends Controller
{
Expand Down Expand Up @@ -334,9 +334,8 @@ public function showRevision($bookSlug, $pageSlug, $revisionId)
$page = $this->pageRepo->getBySlug($pageSlug, $book->id);
$revision = $this->pageRepo->getRevisionById($revisionId);

$next = $revision->getNext() ?: $page;
$htmlDiff = new HtmlDiff($revision->html, $next->html, true);
$diff = $htmlDiff->outputDiff()->toString();
$next = $revision->getNext() ?: $page;
$diff = (new Htmldiff)->diff($revision->html, $next->html);

$page->fill($revision->toArray());
$this->setPageTitle('Page Revision For ' . $page->getShortName());
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"type": "project",
"require": {
"php": ">=5.5.9",
"ext-tidy": "*",

"laravel/framework": "5.2.*",
"intervention/image": "^2.3",
"laravel/socialite": "^2.0",
Expand All @@ -14,7 +16,7 @@
"league/flysystem-aws-s3-v3": "^1.0",
"barryvdh/laravel-dompdf": "0.6.*",
"predis/predis": "^1.0",
"icap/html-diff": "^1.1"
"gathercontent/htmldiff": "^0.2.1"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
Expand Down
192 changes: 146 additions & 46 deletions composer.lock

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

12 changes: 6 additions & 6 deletions resources/assets/sass/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@
}

// diffs
.diff-html-removed,
.diff-html-added {
ins,
del {
text-decoration: none;
}
.diff-html-added {
background: rgba(45, 255, 0, 0.2);
ins {
background: #dbffdb;
}
.diff-html-removed {
background: rgba(255, 0, 0, 0.2);
del {
background: #FFECEC;
}
}

Expand Down

0 comments on commit c279c6e

Please sign in to comment.