Index: trunk/phase3/skins/common/diff.js |
— | — | @@ -18,15 +18,3 @@ |
19 | 19 | "table.diff td div { overflow: visible; }", |
20 | 20 | lastSheet.cssRules.length); |
21 | 21 | } |
22 | | - |
23 | | -function tipA(content){ |
24 | | - return false; |
25 | | -} |
26 | | - |
27 | | -function tipR(content){ |
28 | | - return false; |
29 | | -} |
30 | | - |
31 | | -function tipC(content){ |
32 | | - return false; |
33 | | -} |
Index: trunk/phase3/includes/HTMLDiff.php |
— | — | @@ -456,10 +456,6 @@ |
457 | 457 | |
458 | 458 | public $id = -1; |
459 | 459 | |
460 | | - public $prevMod; |
461 | | - |
462 | | - public $nextMod; |
463 | | - |
464 | 460 | public $firstOfID = false; |
465 | 461 | |
466 | 462 | public $changes; |
— | — | @@ -608,8 +604,6 @@ |
609 | 605 | private $oldTextNodes; |
610 | 606 | private $oldBodyNode; |
611 | 607 | |
612 | | - private $lastModified = array(); |
613 | | - |
614 | 608 | private $newID = 0; |
615 | 609 | |
616 | 610 | private $changedID = 0; |
— | — | @@ -637,27 +631,15 @@ |
638 | 632 | $this->textNodes[$start]->whiteBefore = false; |
639 | 633 | } |
640 | 634 | |
641 | | - $nextLastModified = array(); |
642 | | - |
643 | 635 | for ($i = $start; $i < $end; ++$i) { |
644 | 636 | $mod = new Modification(Modification::ADDED); |
645 | 637 | $mod->id = $this->newID; |
646 | | - if (count($this->lastModified) > 0) { |
647 | | - $mod->prevMod = $this->lastModified[0]; |
648 | | - if (is_null($this->lastModified[0]->nextMod )) { |
649 | | - foreach ($this->lastModified as &$lastMod) { |
650 | | - $lastMod->nextMod = $mod; |
651 | | - } |
652 | | - } |
653 | | - } |
654 | | - $nextLastModified[] = $mod; |
655 | 638 | $this->textNodes[$i]->modification = $mod; |
656 | 639 | } |
657 | 640 | if ($start < $end) { |
658 | 641 | $this->textNodes[$start]->modification->firstOfID = true; |
659 | 642 | } |
660 | 643 | ++$this->newID; |
661 | | - $this->lastModified = $nextLastModified; |
662 | 644 | } |
663 | 645 | |
664 | 646 | public function handlePossibleChangedPart($leftstart, $leftend, $rightstart, $rightend) { |
— | — | @@ -669,8 +651,6 @@ |
670 | 652 | $this->changedIDUsed = false; |
671 | 653 | } |
672 | 654 | |
673 | | - $nextLastModified = array(); |
674 | | - |
675 | 655 | $changes; |
676 | 656 | while ($i < $rightend) { |
677 | 657 | $acthis = new AncestorComparator($this->textNodes[$i]->getParentTree()); |
— | — | @@ -678,35 +658,16 @@ |
679 | 659 | $result = $acthis->getResult($acother); |
680 | 660 | unset($acthis, $acother); |
681 | 661 | |
682 | | - $nbLastModified = count($this->lastModified); |
683 | 662 | if ($result->changed) { |
684 | 663 | $mod = new Modification(Modification::CHANGED); |
685 | 664 | |
686 | 665 | if (!$this->changedIDUsed) { |
687 | 666 | $mod->firstOfID = true; |
688 | | - if (count($nextLastModified) > 0) { |
689 | | - $this->lastModified = $nextLastModified; |
690 | | - $nextLastModified = array(); |
691 | | - } |
692 | 667 | } else if (!is_null($result->changes) && $result->changes !== $this->changes) { |
693 | 668 | ++$this->changedID; |
694 | 669 | $mod->firstOfID = true; |
695 | | - if (count($nextLastModified) > 0) { |
696 | | - $this->lastModified = $nextLastModified; |
697 | | - $nextLastModified = array(); |
698 | | - } |
699 | 670 | } |
700 | 671 | |
701 | | - if ($nbLastModified > 0) { |
702 | | - $mod->prevMod = $this->lastModified[0]; |
703 | | - if (is_null($this->lastModified[0]->nextMod )) { |
704 | | - foreach ($this->lastModified as &$lastMod) { |
705 | | - $lastMod->nextMod = $mod; |
706 | | - } |
707 | | - } |
708 | | - } |
709 | | - $nextLastModified[] = $mod; |
710 | | - |
711 | 672 | $mod->changes = $result->changes; |
712 | 673 | $mod->id = $this->changedID; |
713 | 674 | |
— | — | @@ -720,9 +681,6 @@ |
721 | 682 | ++$i; |
722 | 683 | ++$j; |
723 | 684 | } |
724 | | - if (count($nextLastModified) > 0) { |
725 | | - $this->lastModified = $nextLastModified; |
726 | | - } |
727 | 685 | } |
728 | 686 | |
729 | 687 | public function markAsDeleted($start, $end, $before) { |
— | — | @@ -737,20 +695,9 @@ |
738 | 696 | $this->whiteAfterLastChangedPart = false; |
739 | 697 | } |
740 | 698 | |
741 | | - $nextLastModified = array(); |
742 | | - |
743 | 699 | for ($i = $start; $i < $end; ++$i) { |
744 | 700 | $mod = new Modification(Modification::REMOVED); |
745 | 701 | $mod->id = $this->deletedID; |
746 | | - if (count($this->lastModified) > 0) { |
747 | | - $mod->prevMod = $this->lastModified[0]; |
748 | | - if (is_null($this->lastModified[0]->nextMod )) { |
749 | | - foreach ($this->lastModified as &$lastMod) { |
750 | | - $lastMod->nextMod = $mod; |
751 | | - } |
752 | | - } |
753 | | - } |
754 | | - $nextLastModified[] = $mod; |
755 | 702 | |
756 | 703 | // oldTextNodes is used here because we're going to move its deleted |
757 | 704 | // elements to this tree! |
— | — | @@ -842,7 +789,6 @@ |
843 | 790 | throw new Exception("Uh?"); |
844 | 791 | } |
845 | 792 | } |
846 | | - $this->lastModified = $nextLastModified; |
847 | 793 | ++$this->deletedID; |
848 | 794 | } |
849 | 795 | |
— | — | @@ -1376,8 +1322,6 @@ |
1377 | 1323 | if ($mod->firstOfID) { |
1378 | 1324 | $attrs['id'] = "added-{$this->prefix}-{$mod->id}"; |
1379 | 1325 | } |
1380 | | - $this->addAttributes($mod, $attrs); |
1381 | | - $attrs['onclick'] = 'return tipA(constructToolTipA(this));'; |
1382 | 1326 | $handler->startElement('span', $attrs); |
1383 | 1327 | $newStarted = true; |
1384 | 1328 | } else if (!$changeStarted && $mod->type == Modification::CHANGED) { |
— | — | @@ -1385,8 +1329,6 @@ |
1386 | 1330 | if ($mod->firstOfID) { |
1387 | 1331 | $attrs['id'] = "changed-{$this->prefix}-{$mod->id}"; |
1388 | 1332 | } |
1389 | | - $this->addAttributes($mod, $attrs); |
1390 | | - $attrs['onclick'] = 'return tipC(constructToolTipC(this));'; |
1391 | 1333 | $handler->startElement('span', $attrs); |
1392 | 1334 | |
1393 | 1335 | //tooltip |
— | — | @@ -1401,8 +1343,6 @@ |
1402 | 1344 | if ($mod->firstOfID) { |
1403 | 1345 | $attrs['id'] = "removed-{$this->prefix}-{$mod->id}"; |
1404 | 1346 | } |
1405 | | - $this->addAttributes($mod, $attrs); |
1406 | | - $attrs['onclick'] = 'return tipR(constructToolTipR(this));'; |
1407 | 1347 | $handler->startElement('span', $attrs); |
1408 | 1348 | $remStarted = true; |
1409 | 1349 | } |
— | — | @@ -1414,7 +1354,6 @@ |
1415 | 1355 | } else { |
1416 | 1356 | $handler->characters($chars); |
1417 | 1357 | } |
1418 | | - |
1419 | 1358 | } |
1420 | 1359 | } |
1421 | 1360 | |
— | — | @@ -1437,39 +1376,9 @@ |
1438 | 1377 | |
1439 | 1378 | private function writeImage(ImageNode $imgNode) { |
1440 | 1379 | $attrs = $imgNode->attributes; |
1441 | | - if ($imgNode->modification->type == Modification::REMOVED) { |
1442 | | - $attrs['changeType']='diff-removed-image'; |
1443 | | - } else if ($imgNode->modification->type == Modification::ADDED) { |
1444 | | - $attrs['changeType'] = 'diff-added-image'; |
1445 | | - } |
1446 | | - $attrs['onload'] = 'updateOverlays()'; |
1447 | | - $attrs['onError'] = 'updateOverlays()'; |
1448 | | - $attrs['onAbort'] = 'updateOverlays()'; |
1449 | 1380 | $this->handler->startElement('img', $attrs); |
1450 | 1381 | $this->handler->endElement('img'); |
1451 | 1382 | } |
1452 | | - |
1453 | | - private function addAttributes(Modification $mod, /*array*/ &$attrs) { |
1454 | | - if (is_null($mod->prevMod)) { |
1455 | | - $previous = 'first-' . $this->prefix; |
1456 | | - } else { |
1457 | | - $type = Modification::typeToString($mod->prevMod->type); |
1458 | | - $previous = "$type-{$this->prefix}-{$mod->prevMod->id}"; |
1459 | | - } |
1460 | | - $attrs['previous'] = $previous; |
1461 | | - |
1462 | | - $type = Modification::typeToString($mod->type); |
1463 | | - $changeId = "$type-{$this->prefix}-{$mod->id}"; |
1464 | | - $attrs['changeId'] = $changeId; |
1465 | | - |
1466 | | - if (is_null($mod->nextMod )) { |
1467 | | - $next = "last-{$this->prefix}"; |
1468 | | - } else { |
1469 | | - $type = Modification::typeToString($mod->nextMod->type); |
1470 | | - $next = "$type-{$this->prefix}-{$mod->nextMod->id}"; |
1471 | | - } |
1472 | | - $attrs['next'] = $next; |
1473 | | - } |
1474 | 1383 | } |
1475 | 1384 | |
1476 | 1385 | class EchoingContentHandler { |