nui-html-compare-plugin

1.1.1 • Public • Published

NUI html compare tool

is a highly customizable html compare tool (Demo). Features include:

  • Comparison of two html fragements and returns the comparison result in html form.
  • Exhibit the comparison using styling(background color).
  • Deleted tags/text are shown in red.
  • Added tags/text are shown in green.
  • Final html can be appended to other element if target is passed.
  • Compare and clear methods are exposed. compare do the html comparison and retruns the compared html and clear removes appended html from target.
  • This version allows users to pass their css class for added/ deleted tags.

Bug fixes

  • For some of the added/deleted tags css were not applying.

Installation

npm: npm i nui-html-compare-plugin

Usage

Manual

 var  _.tool = new NUI.CompareTool({
            oldHtml: inputOldHtml,
            newHtml: inputNewHtml,
            target: targetSelector,
        addedCss: 'added',
            deletedCss:'deleted'
        });
       var comparisonResult = _.tool.compare();

Requirements

jQuery version 1.6.0 or higher

Browser compatibility

  • Internet Explorer 8+
  • Firefox
  • Chrome
  • Opera
  • Safari
  • iOS
  • Android
  • Windows Phone

License

MIT License (MIT)

http://opensource.org/licenses/MIT

Package Sidebar

Install

npm i nui-html-compare-plugin

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

14 kB

Total Files

9

Last publish

Collaborators

  • pushp_ms_123