]> BookStack Code Mirror - bookstack/commitdiff
replace GPL diff lib with MIT lib 139/head
authorYounès EL BIACHE <redacted>
Sun, 10 Jul 2016 09:53:37 +0000 (11:53 +0200)
committerYounès EL BIACHE <redacted>
Sun, 10 Jul 2016 10:01:05 +0000 (12:01 +0200)
replace gpl lib with mit lib

app/Http/Controllers/PageController.php
composer.json
composer.lock
resources/assets/sass/_pages.scss

index 1844e0c0c2aadadb6f60a78d12d9ef8f746cc335..fc71292e0598d72c4913beca08a6f375efd1dfff 100644 (file)
@@ -12,7 +12,7 @@ use BookStack\Repos\ChapterRepo;
 use BookStack\Repos\PageRepo;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Views;
-use Icap\HtmlDiff\HtmlDiff;
+use GatherContent\Htmldiff\Htmldiff;
 
 class PageController extends Controller
 {
@@ -334,9 +334,8 @@ class PageController extends Controller
         $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());
index 41f1ada5deca7e6e7f0f3aea88b57725043c7c25..d1f99a8f3c8004121dfe4aa87ee5b2a6a9ae5ba7 100644 (file)
@@ -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",
@@ -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",
index f97aeb992ef990671763c2e95718ea1da401d376..98fb86ce585a4100d025a599b15d4eac52d75ecf 100644 (file)
@@ -4,8 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "3d8e2dfddefb412055d28ffc922969fd",
-    "content-hash": "7658fea0b4df71cf7b97bcdf8a29b9eb",
+    "hash": "097beaeb7ce90384b824d65d9dd36520",
+    "content-hash": "233ce3d93ee0c9b005c263ff1449ae0f",
     "packages": [
         {
             "name": "aws/aws-sdk-php",
             ],
             "time": "2015-11-09 22:51:51"
         },
+        {
+            "name": "cogpowered/finediff",
+            "version": "0.3.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/cogpowered/FineDiff.git",
+                "reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/cogpowered/FineDiff/zipball/339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
+                "reference": "339ddc8c3afb656efed4f2f0a80e5c3d026f8ea8",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "mockery/mockery": "*",
+                "phpunit/phpunit": "*"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "cogpowered\\FineDiff": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Rob Crowe",
+                    "email": "[email protected]"
+                },
+                {
+                    "name": "Raymond Hill"
+                }
+            ],
+            "description": "PHP implementation of a Fine granularity Diff engine",
+            "homepage": "https://github.com/cogpowered/FineDiff",
+            "keywords": [
+                "diff",
+                "finediff",
+                "opcode",
+                "string",
+                "text"
+            ],
+            "time": "2014-05-19 10:25:02"
+        },
         {
             "name": "dnoegel/php-xdg-base-dir",
             "version": "0.1",
             "homepage": "https://github.com/dompdf/dompdf",
             "time": "2015-12-07 04:07:13"
         },
+        {
+            "name": "gathercontent/htmldiff",
+            "version": "0.2.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/gathercontent/htmldiff.git",
+                "reference": "24674a62315f64330134b4a4c5b01a7b59193c93"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/gathercontent/htmldiff/zipball/24674a62315f64330134b4a4c5b01a7b59193c93",
+                "reference": "24674a62315f64330134b4a4c5b01a7b59193c93",
+                "shasum": ""
+            },
+            "require": {
+                "cogpowered/finediff": "0.3.1",
+                "ext-tidy": "*"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "4.*",
+                "squizlabs/php_codesniffer": "1.*"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "GatherContent\\Htmldiff": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Andrew Cairns",
+                    "email": "[email protected]"
+                },
+                {
+                    "name": "Mathew Chapman",
+                    "email": "[email protected]"
+                },
+                {
+                    "name": "Peter Legierski",
+                    "email": "[email protected]"
+                }
+            ],
+            "description": "Compare two HTML strings",
+            "time": "2015-04-15 15:39:46"
+        },
         {
             "name": "guzzle/guzzle",
             "version": "v3.8.1",
             ],
             "time": "2016-06-24 23:00:38"
         },
-        {
-            "name": "icap/html-diff",
-            "version": "v1.1.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/iCAPLyon1/HtmlDiff.git",
-                "reference": "f58ddb196292ae585a2efb7692653d015ecc436f"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/iCAPLyon1/HtmlDiff/zipball/f58ddb196292ae585a2efb7692653d015ecc436f",
-                "reference": "f58ddb196292ae585a2efb7692653d015ecc436f",
-                "shasum": ""
-            },
-            "require": {
-                "php": ">=5.3.0"
-            },
-            "require-dev": {
-                "php": ">=5.3.0"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "Icap\\HtmlDiff\\": "src/Icap/HtmlDiff"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "authors": [
-                {
-                    "name": "Panagiotis Tsavdaris",
-                    "email": "[email protected]"
-                },
-                {
-                    "name": "ICAP development team",
-                    "homepage": "https://github.com/iCAPLyon1"
-                }
-            ],
-            "description": "A PHP5 library that diffs (compares) HTML files.",
-            "keywords": [
-                "daisy diff",
-                "html diff"
-            ],
-            "time": "2016-02-17 16:35:09"
-        },
         {
             "name": "intervention/image",
             "version": "2.3.7",
             ],
             "time": "2015-05-11 14:41:42"
         },
+        {
+            "name": "icap/html-diff",
+            "version": "v1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/iCAPLyon1/HtmlDiff.git",
+                "reference": "f58ddb196292ae585a2efb7692653d015ecc436f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/iCAPLyon1/HtmlDiff/zipball/f58ddb196292ae585a2efb7692653d015ecc436f",
+                "reference": "f58ddb196292ae585a2efb7692653d015ecc436f",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Icap\\HtmlDiff\\": "src/Icap/HtmlDiff"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "authors": [
+                {
+                    "name": "Panagiotis Tsavdaris",
+                    "email": "[email protected]"
+                },
+                {
+                    "name": "ICAP development team",
+                    "homepage": "https://github.com/iCAPLyon1"
+                }
+            ],
+            "description": "A PHP5 library that diffs (compares) HTML files.",
+            "keywords": [
+                "daisy diff",
+                "html diff"
+            ],
+            "time": "2016-02-17 16:35:09"
+        },
         {
             "name": "mockery/mockery",
             "version": "0.9.5",
index 2a27fadb9dbb0084badde3cf77ddf9ad9a8a471c..562bc9a4788ba66d4030bd9f82933ef9b3719cd3 100755 (executable)
   }
 
   // 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;
   }
 }