Source for file textdiff.php
Documentation is available at textdiff.php
* @package Joomla.Libraries
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* HTML utility class for creating text diffs using jQuery, diff_patch_match.js and jquery.pretty-text-diff.js JavaScript libraries.
* @package Joomla.Administrator
* @subpackage com_contenthistory.HTML
* @var array Array containing information for loaded files
protected static $loaded =
array();
* Method to load Javascript text diff
* @param string $containerId DOM id of the element where the diff will be rendered
public static function textdiff($containerId)
if (isset
(static::$loaded[__METHOD__
]))
JHtml::_('bootstrap.framework');
JHtml::_('script', 'com_contenthistory/diff_match_patch.js', false, true);
JHtml::_('script', 'com_contenthistory/jquery.pretty-text-diff.min.js', false, true);
JHtml::_('stylesheet', 'com_contenthistory/jquery.pretty-text-diff.css', false, true, false);
// Attach diff to document
JFactory::getDocument()->addScriptDeclaration("
$(document).ready(function (){
$('#" .
$containerId .
" tr').prettyTextDiff();
static::$loaded[__METHOD__
] =
true;
Documentation generated on Tue, 19 Nov 2013 15:15:43 +0100 by phpDocumentor 1.4.3