- md5
- 88dcb31f1182138b5ee2daa56976009e
- sha1
- 362c22802067a34f1c4dba1fc6d53f236ac528e2
- sha256
- ef60924cc361b982f9515165c6e0fcbdbc572107e7ff2b3fca4ca77fbf9d7371
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
<?php
/**
* @package Joomla.Libraries
* @subpackage HTML
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* 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
* @since 3.2
*/
abstract class JHtmlTextdiff
{
/**
* @var array Array containing information for loaded files
* @since 3.2
*/
protected static $loaded = array();
/**
* Method to load Javascript text diff
*
* @param string $containerId DOM id of the element where the diff will be rendered
*
* @return void
*
* @since 3.2
*/
public static function textdiff($containerId)
{
// Only load once
if (isset(static::$loaded[__METHOD__]))
{
return;
}
// Depends on jQuery UI
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("
(function ($){
$(document).ready(function (){
$('#" . $containerId . " tr').prettyTextDiff();
});
})(jQuery);
"
);
// Set static array
static::$loaded[__METHOD__] = true;
return;
}
}
The same content is in 2 releases, Joomla 3.2.0 to 3.2.1. See them all, or every version of this file.